slice-machine-ui 1.24.1-beta.7 → 1.24.1-beta.9
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/out/404.html +1 -1
- package/out/_next/static/{1pfD8kf3T_M14h3yL2oNi → GpyLp1HegnRBAtS9Z95da}/_buildManifest.js +1 -1
- package/out/_next/static/chunks/18539003-a5a5d48f20a7b261.js +97 -0
- package/out/_next/static/chunks/{777-8c5507e3b119b5dc.js → 777-7bc4ca95c82802e5.js} +1 -1
- package/out/_next/static/chunks/pages/{_app-dc8dc7dc0c053ac9.js → _app-43a8d74e20dabd01.js} +34 -32
- package/out/_next/static/css/{d427429b16c00f66.css → 75711e840ea6c200.css} +1 -1
- package/out/changelog.html +1 -1
- package/out/changes.html +1 -1
- package/out/custom-types/[customTypeId].html +1 -1
- package/out/custom-types.html +1 -1
- package/out/index.html +1 -1
- package/out/labs.html +1 -1
- package/out/page-types/[pageTypeId].html +1 -1
- package/out/settings.html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
- package/out/slices.html +1 -1
- package/package.json +6 -6
- package/out/_next/static/chunks/18539003-682868ef17e68625.js +0 -97
- /package/out/_next/static/{1pfD8kf3T_M14h3yL2oNi → GpyLp1HegnRBAtS9Z95da}/_ssgManifest.js +0 -0
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[851],{71463:function(t,n,r){r.d(n,{kS:function(){return elN}});var i,o=r(2784),a=r(98863),u=r(22715),s=r(74217),l=r(50054),c=r(86579),d=r(17329),f=r(87322),p=r(1611),h=r(661),m=r(53429),g=r(52393),y=r(47124),v=r(77252),b=r(16247),x=r(28316),_=r(87598),S=Object.defineProperty,T=(t,n,r)=>n in t?S(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,w=(t,n,r)=>(T(t,"symbol"!=typeof n?n+"":n,r),r);let O={unclassified:{title:"Draft",color:"amber"},published:{title:"Live",color:"green"},release:{title:"Planned",color:"purple"},archived:{title:"Archived",color:"grey"}};var k="u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof r.g?r.g:"u">typeof self?self:{};function C(t){if(t.__esModule)return t;var n=t.default;if("function"==typeof n){var r=function t(){if(this instanceof t){var r=[null];return r.push.apply(r,arguments),new(Function.bind.apply(n,r))}return n.apply(this,arguments)};r.prototype=n.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var I,M={},R={get exports(){return M},set exports(e){M=e}},E={};function j(){return M.jsx(u.xu,{justifyContent:"center",flexDirection:"column",height:"100%",backgroundColor:"grey3",children:M.jsxs(u.R$,{children:[M.jsx(u.av,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed",size:"xlarge"}),M.jsx(u._T,{size:"big",children:'"Oops!"'}),M.jsx(u.nf,{width:360,children:'"We can\'t find any items with that name"'})]})})}(I=R).exports=function(){if(H2)return E;H2=1;var t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function u(n,o,u){var s,l={},c=null,d=null;for(s in void 0!==u&&(c=""+u),void 0!==o.key&&(c=""+o.key),void 0!==o.ref&&(d=o.ref),o)r.call(o,s)&&!a.hasOwnProperty(s)&&(l[s]=o[s]);if(n&&n.defaultProps)for(s in o=n.defaultProps)void 0===l[s]&&(l[s]=o[s]);return{$$typeof:t,type:n,key:c,ref:d,props:l,_owner:i.current}}return E.Fragment=n,E.jsx=u,E.jsxs=u,E}();let A={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."}}};(ny=H3||(H3={})).assertEqual=t=>t,ny.assertIs=function(t){},ny.assertNever=function(t){throw Error()},ny.arrayToEnum=t=>{let n={};for(let r of t)n[r]=r;return n},ny.getValidEnumValues=t=>{let n=ny.objectKeys(t).filter(n=>"number"!=typeof t[t[n]]),r={};for(let i of n)r[i]=t[i];return ny.objectValues(r)},ny.objectValues=t=>ny.objectKeys(t).map(function(n){return t[n]}),ny.objectKeys="function"==typeof Object.keys?t=>Object.keys(t):t=>{let n=[];for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&n.push(r);return n},ny.find=(t,n)=>{for(let r of t)if(n(r))return r},ny.isInteger="function"==typeof Number.isInteger?t=>Number.isInteger(t):t=>"number"==typeof t&&isFinite(t)&&Math.floor(t)===t,ny.joinValues=function(t,n=" | "){return t.map(t=>"string"==typeof t?`'${t}'`:t).join(n)},ny.jsonStringifyReplacer=(t,n)=>"bigint"==typeof n?n.toString():n,(nv=H4||(H4={})).mergeShapes=(t,n)=>({...t,...n});let N=H3.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),P=t=>{switch(typeof t){case"undefined":return N.undefined;case"string":return N.string;case"number":return isNaN(t)?N.nan:N.number;case"boolean":return N.boolean;case"function":return N.function;case"bigint":return N.bigint;case"symbol":return N.symbol;case"object":return Array.isArray(t)?N.array:null===t?N.null:t.then&&"function"==typeof t.then&&t.catch&&"function"==typeof t.catch?N.promise:"u">typeof Map&&t instanceof Map?N.map:"u">typeof Set&&t instanceof Set?N.set:"u">typeof Date&&t instanceof Date?N.date:N.object;default:return N.unknown}},L=H3.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"]),D=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class F extends Error{constructor(t){super(),this.issues=[],this.addIssue=t=>{this.issues=[...this.issues,t]},this.addIssues=(t=[])=>{this.issues=[...this.issues,...t]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){let n=t||function(t){return t.message},r={_errors:[]},i=t=>{for(let o of t.issues)if("invalid_union"===o.code)o.unionErrors.map(i);else if("invalid_return_type"===o.code)i(o.returnTypeError);else if("invalid_arguments"===o.code)i(o.argumentsError);else if(0===o.path.length)r._errors.push(n(o));else{let a=r,u=0;for(;u<o.path.length;){let s=o.path[u];u===o.path.length-1?(a[s]=a[s]||{_errors:[]},a[s]._errors.push(n(o))):a[s]=a[s]||{_errors:[]},a=a[s],u++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,H3.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(t=t=>t.message){let n={},r=[];for(let i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}F.create=t=>new F(t);let W=(t,n)=>{let r;switch(t.code){case L.invalid_type:r=t.received===N.undefined?"Required":`Expected ${t.expected}, received ${t.received}`;break;case L.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,H3.jsonStringifyReplacer)}`;break;case L.unrecognized_keys:r=`Unrecognized key(s) in object: ${H3.joinValues(t.keys,", ")}`;break;case L.invalid_union:r="Invalid input";break;case L.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${H3.joinValues(t.options)}`;break;case L.invalid_enum_value:r=`Invalid enum value. Expected ${H3.joinValues(t.options)}, received '${t.received}'`;break;case L.invalid_arguments:r="Invalid function arguments";break;case L.invalid_return_type:r="Invalid function return type";break;case L.invalid_date:r="Invalid date";break;case L.invalid_string:"object"==typeof t.validation?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,"number"==typeof t.validation.position&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:H3.assertNever(t.validation):r="regex"!==t.validation?`Invalid ${t.validation}`:"Invalid";break;case L.too_small:r="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:"number"===t.type?`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:"date"===t.type?`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:"Invalid input";break;case L.too_big:r="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:"number"===t.type?`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"bigint"===t.type?`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"date"===t.type?`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:"Invalid input";break;case L.custom:r="Invalid input";break;case L.invalid_intersection_types:r="Intersection results could not be merged";break;case L.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case L.not_finite:r="Number must be finite";break;default:r=n.defaultError,H3.assertNever(t)}return{message:r}},U=W;function z(t){U=t}function B(){return U}let V=t=>{let{data:n,path:r,errorMaps:i,issueData:o}=t,a=[...r,...o.path||[]],u={...o,path:a},s="",l=i.filter(t=>!!t).slice().reverse();for(let c of l)s=c(u,{data:n,defaultError:s}).message;return{...o,path:a,message:o.message||s}};function $(t,n){let r=V({issueData:n,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,U,W].filter(t=>!!t)});t.common.issues.push(r)}class q{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(t,n){let r=[];for(let i of n){if("aborted"===i.status)return K;"dirty"===i.status&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){let r=[];for(let i of n)r.push({key:await i.key,value:await i.value});return q.mergeObjectSync(t,r)}static mergeObjectSync(t,n){let r={};for(let i of n){let{key:o,value:a}=i;if("aborted"===o.status||"aborted"===a.status)return K;"dirty"===o.status&&t.dirty(),"dirty"===a.status&&t.dirty(),("u">typeof a.value||i.alwaysSet)&&(r[o.value]=a.value)}return{status:t.value,value:r}}}let K=Object.freeze({status:"aborted"}),H=t=>({status:"dirty",value:t}),G=t=>({status:"valid",value:t}),Z=t=>"aborted"===t.status,Y=t=>"dirty"===t.status,J=t=>"valid"===t.status,Q=t=>"u">typeof Promise&&t instanceof Promise;(nb=H5||(H5={})).errToObj=t=>"string"==typeof t?{message:t}:t||{},nb.toString=t=>"string"==typeof t?t:null==t?void 0:t.message;class X{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}let ee=(t,n)=>{if(J(n))return{success:!0,data:n.value};if(!t.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new F(t.common.issues);return this._error=r,this._error}}};function et(t){if(!t)return{};let{errorMap:n,invalid_type_error:r,required_error:i,description:o}=t;if(n&&(r||i))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return n?{errorMap:n,description:o}:{errorMap:(t,n)=>"invalid_type"!==t.code?{message:n.defaultError}:typeof n.data>"u"?{message:i??n.defaultError}:{message:r??n.defaultError},description:o}}class en{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 P(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:P(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new q,ctx:{common:t.parent.common,data:t.data,parsedType:P(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(Q(n))throw Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;let i={common:{issues:[],async:null!==(r=null==n?void 0:n.async)&&void 0!==r&&r,contextualErrorMap:null==n?void 0:n.errorMap},path:(null==n?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:P(t)},o=this._parseSync({data:t,path:i.path,parent:i});return ee(i,o)}async parseAsync(t,n){let r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){let r={common:{issues:[],contextualErrorMap:null==n?void 0:n.errorMap,async:!0},path:(null==n?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:P(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await (Q(i)?i:Promise.resolve(i));return ee(r,o)}refine(t,n){let r=t=>"string"==typeof n||typeof n>"u"?{message:n}:"function"==typeof n?n(t):n;return this._refinement((n,i)=>{let o=t(n),a=()=>i.addIssue({code:L.custom,...r(n)});return"u">typeof Promise&&o instanceof Promise?o.then(t=>!!t||(a(),!1)):!!o||(a(),!1)})}refinement(t,n){return this._refinement((r,i)=>!!t(r)||(i.addIssue("function"==typeof n?n(r,i):n),!1))}_refinement(t){return new eV({schema:this,typeName:H6.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return e$.create(this,this._def)}nullable(){return eq.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ek.create(this,this._def)}promise(){return eB.create(this,this._def)}or(t){return eI.create([this,t],this._def)}and(t){return eE.create(this,t,this._def)}transform(t){return new eV({...et(this._def),schema:this,typeName:H6.ZodEffects,effect:{type:"transform",transform:t}})}default(t){return new eK({...et(this._def),innerType:this,defaultValue:"function"==typeof t?t:()=>t,typeName:H6.ZodDefault})}brand(){return new eY({typeName:H6.ZodBranded,type:this,...et(this._def)})}catch(t){return new eH({...et(this._def),innerType:this,catchValue:"function"==typeof t?t:()=>t,typeName:H6.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return eJ.create(this,t)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}let er=/^c[^\s-]{8,}$/i,ei=/^[a-z][a-z0-9]*$/,eo=/[0-9A-HJKMNP-TV-Z]{26}/,ea=/^([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,eu=/^(([^<>()[\]\\.,;:\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,})+))$/,es=/^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u,el=/^(((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}))$/,ec=/^(([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})))$/,ed=t=>t.precision?t.offset?RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):0===t.precision?t.offset?RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function ef(t,n){return!!(("v4"===n||!n)&&el.test(t)||("v6"===n||!n)&&ec.test(t))}class ep extends en{constructor(){super(...arguments),this._regex=(t,n,r)=>this.refinement(n=>t.test(n),{validation:n,code:L.invalid_string,...H5.errToObj(r)}),this.nonempty=t=>this.min(1,H5.errToObj(t)),this.trim=()=>new ep({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new ep({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new ep({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==N.string){let n=this._getOrReturnCtx(t);return $(n,{code:L.invalid_type,expected:N.string,received:n.parsedType}),K}let r=new q,i;for(let o of this._def.checks)if("min"===o.kind)t.data.length<o.value&&($(i=this._getOrReturnCtx(t,i),{code:L.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if("max"===o.kind)t.data.length>o.value&&($(i=this._getOrReturnCtx(t,i),{code:L.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if("length"===o.kind){let a=t.data.length>o.value,u=t.data.length<o.value;(a||u)&&(i=this._getOrReturnCtx(t,i),a?$(i,{code:L.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):u&&$(i,{code:L.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if("email"===o.kind)eu.test(t.data)||($(i=this._getOrReturnCtx(t,i),{validation:"email",code:L.invalid_string,message:o.message}),r.dirty());else if("emoji"===o.kind)es.test(t.data)||($(i=this._getOrReturnCtx(t,i),{validation:"emoji",code:L.invalid_string,message:o.message}),r.dirty());else if("uuid"===o.kind)ea.test(t.data)||($(i=this._getOrReturnCtx(t,i),{validation:"uuid",code:L.invalid_string,message:o.message}),r.dirty());else if("cuid"===o.kind)er.test(t.data)||($(i=this._getOrReturnCtx(t,i),{validation:"cuid",code:L.invalid_string,message:o.message}),r.dirty());else if("cuid2"===o.kind)ei.test(t.data)||($(i=this._getOrReturnCtx(t,i),{validation:"cuid2",code:L.invalid_string,message:o.message}),r.dirty());else if("ulid"===o.kind)eo.test(t.data)||($(i=this._getOrReturnCtx(t,i),{validation:"ulid",code:L.invalid_string,message:o.message}),r.dirty());else if("url"===o.kind)try{new URL(t.data)}catch{$(i=this._getOrReturnCtx(t,i),{validation:"url",code:L.invalid_string,message:o.message}),r.dirty()}else"regex"===o.kind?(o.regex.lastIndex=0,o.regex.test(t.data)||($(i=this._getOrReturnCtx(t,i),{validation:"regex",code:L.invalid_string,message:o.message}),r.dirty())):"trim"===o.kind?t.data=t.data.trim():"includes"===o.kind?t.data.includes(o.value,o.position)||($(i=this._getOrReturnCtx(t,i),{code:L.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):"toLowerCase"===o.kind?t.data=t.data.toLowerCase():"toUpperCase"===o.kind?t.data=t.data.toUpperCase():"startsWith"===o.kind?t.data.startsWith(o.value)||($(i=this._getOrReturnCtx(t,i),{code:L.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):"endsWith"===o.kind?t.data.endsWith(o.value)||($(i=this._getOrReturnCtx(t,i),{code:L.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):"datetime"===o.kind?ed(o).test(t.data)||($(i=this._getOrReturnCtx(t,i),{code:L.invalid_string,validation:"datetime",message:o.message}),r.dirty()):"ip"===o.kind?ef(t.data,o.version)||($(i=this._getOrReturnCtx(t,i),{validation:"ip",code:L.invalid_string,message:o.message}),r.dirty()):H3.assertNever(o);return{status:r.value,value:t.data}}_addCheck(t){return new ep({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...H5.errToObj(t)})}url(t){return this._addCheck({kind:"url",...H5.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...H5.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...H5.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...H5.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...H5.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...H5.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...H5.errToObj(t)})}datetime(t){var n;return"string"==typeof t?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(null==t?void 0:t.precision)>"u"?null:null==t?void 0:t.precision,offset:null!==(n=null==t?void 0:t.offset)&&void 0!==n&&n,...H5.errToObj(null==t?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...H5.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:null==n?void 0:n.position,...H5.errToObj(null==n?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...H5.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...H5.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...H5.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...H5.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...H5.errToObj(n)})}get isDatetime(){return!!this._def.checks.find(t=>"datetime"===t.kind)}get isEmail(){return!!this._def.checks.find(t=>"email"===t.kind)}get isURL(){return!!this._def.checks.find(t=>"url"===t.kind)}get isEmoji(){return!!this._def.checks.find(t=>"emoji"===t.kind)}get isUUID(){return!!this._def.checks.find(t=>"uuid"===t.kind)}get isCUID(){return!!this._def.checks.find(t=>"cuid"===t.kind)}get isCUID2(){return!!this._def.checks.find(t=>"cuid2"===t.kind)}get isULID(){return!!this._def.checks.find(t=>"ulid"===t.kind)}get isIP(){return!!this._def.checks.find(t=>"ip"===t.kind)}get minLength(){let t=null;for(let n of this._def.checks)"min"===n.kind&&(null===t||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(let n of this._def.checks)"max"===n.kind&&(null===t||n.value<t)&&(t=n.value);return t}}function eh(t,n){let r=(t.toString().split(".")[1]||"").length,i=(n.toString().split(".")[1]||"").length,o=r>i?r:i,a=parseInt(t.toFixed(o).replace(".","")),u=parseInt(n.toFixed(o).replace(".",""));return a%u/Math.pow(10,o)}ep.create=t=>{var n;return new ep({checks:[],typeName:H6.ZodString,coerce:null!==(n=null==t?void 0:t.coerce)&&void 0!==n&&n,...et(t)})};class em extends en{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)!==N.number){let n=this._getOrReturnCtx(t);return $(n,{code:L.invalid_type,expected:N.number,received:n.parsedType}),K}let r,i=new q;for(let o of this._def.checks)"int"===o.kind?H3.isInteger(t.data)||($(r=this._getOrReturnCtx(t,r),{code:L.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):"min"===o.kind?(o.inclusive?t.data<o.value:t.data<=o.value)&&($(r=this._getOrReturnCtx(t,r),{code:L.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):"max"===o.kind?(o.inclusive?t.data>o.value:t.data>=o.value)&&($(r=this._getOrReturnCtx(t,r),{code:L.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):"multipleOf"===o.kind?0!==eh(t.data,o.value)&&($(r=this._getOrReturnCtx(t,r),{code:L.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):"finite"===o.kind?Number.isFinite(t.data)||($(r=this._getOrReturnCtx(t,r),{code:L.not_finite,message:o.message}),i.dirty()):H3.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,H5.toString(n))}gt(t,n){return this.setLimit("min",t,!1,H5.toString(n))}lte(t,n){return this.setLimit("max",t,!0,H5.toString(n))}lt(t,n){return this.setLimit("max",t,!1,H5.toString(n))}setLimit(t,n,r,i){return new em({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:H5.toString(i)}]})}_addCheck(t){return new em({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:H5.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:H5.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:H5.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:H5.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:H5.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:H5.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:H5.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:H5.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:H5.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)"min"===n.kind&&(null===t||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)"max"===n.kind&&(null===t||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>"int"===t.kind||"multipleOf"===t.kind&&H3.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===n||r.value>n)&&(n=r.value):"max"===r.kind&&(null===t||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}em.create=t=>new em({checks:[],typeName:H6.ZodNumber,coerce:(null==t?void 0:t.coerce)||!1,...et(t)});class eg extends en{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)!==N.bigint){let n=this._getOrReturnCtx(t);return $(n,{code:L.invalid_type,expected:N.bigint,received:n.parsedType}),K}let r,i=new q;for(let o of this._def.checks)"min"===o.kind?(o.inclusive?t.data<o.value:t.data<=o.value)&&($(r=this._getOrReturnCtx(t,r),{code:L.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):"max"===o.kind?(o.inclusive?t.data>o.value:t.data>=o.value)&&($(r=this._getOrReturnCtx(t,r),{code:L.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):"multipleOf"===o.kind?t.data%o.value!==BigInt(0)&&($(r=this._getOrReturnCtx(t,r),{code:L.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):H3.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,H5.toString(n))}gt(t,n){return this.setLimit("min",t,!1,H5.toString(n))}lte(t,n){return this.setLimit("max",t,!0,H5.toString(n))}lt(t,n){return this.setLimit("max",t,!1,H5.toString(n))}setLimit(t,n,r,i){return new eg({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:H5.toString(i)}]})}_addCheck(t){return new eg({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:H5.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:H5.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:H5.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:H5.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:H5.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)"min"===n.kind&&(null===t||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)"max"===n.kind&&(null===t||n.value<t)&&(t=n.value);return t}}eg.create=t=>{var n;return new eg({checks:[],typeName:H6.ZodBigInt,coerce:null!==(n=null==t?void 0:t.coerce)&&void 0!==n&&n,...et(t)})};class ey extends en{_parse(t){if(this._def.coerce&&(t.data=Boolean(t.data)),this._getType(t)!==N.boolean){let n=this._getOrReturnCtx(t);return $(n,{code:L.invalid_type,expected:N.boolean,received:n.parsedType}),K}return G(t.data)}}ey.create=t=>new ey({typeName:H6.ZodBoolean,coerce:(null==t?void 0:t.coerce)||!1,...et(t)});class ev extends en{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==N.date){let n=this._getOrReturnCtx(t);return $(n,{code:L.invalid_type,expected:N.date,received:n.parsedType}),K}if(isNaN(t.data.getTime())){let r=this._getOrReturnCtx(t);return $(r,{code:L.invalid_date}),K}let i=new q,o;for(let a of this._def.checks)"min"===a.kind?t.data.getTime()<a.value&&($(o=this._getOrReturnCtx(t,o),{code:L.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),i.dirty()):"max"===a.kind?t.data.getTime()>a.value&&($(o=this._getOrReturnCtx(t,o),{code:L.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),i.dirty()):H3.assertNever(a);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new ev({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:H5.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:H5.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)"min"===n.kind&&(null===t||n.value>t)&&(t=n.value);return null!=t?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)"max"===n.kind&&(null===t||n.value<t)&&(t=n.value);return null!=t?new Date(t):null}}ev.create=t=>new ev({checks:[],coerce:(null==t?void 0:t.coerce)||!1,typeName:H6.ZodDate,...et(t)});class eb extends en{_parse(t){if(this._getType(t)!==N.symbol){let n=this._getOrReturnCtx(t);return $(n,{code:L.invalid_type,expected:N.symbol,received:n.parsedType}),K}return G(t.data)}}eb.create=t=>new eb({typeName:H6.ZodSymbol,...et(t)});class ex extends en{_parse(t){if(this._getType(t)!==N.undefined){let n=this._getOrReturnCtx(t);return $(n,{code:L.invalid_type,expected:N.undefined,received:n.parsedType}),K}return G(t.data)}}ex.create=t=>new ex({typeName:H6.ZodUndefined,...et(t)});class e_ extends en{_parse(t){if(this._getType(t)!==N.null){let n=this._getOrReturnCtx(t);return $(n,{code:L.invalid_type,expected:N.null,received:n.parsedType}),K}return G(t.data)}}e_.create=t=>new e_({typeName:H6.ZodNull,...et(t)});class eS extends en{constructor(){super(...arguments),this._any=!0}_parse(t){return G(t.data)}}eS.create=t=>new eS({typeName:H6.ZodAny,...et(t)});class eT extends en{constructor(){super(...arguments),this._unknown=!0}_parse(t){return G(t.data)}}eT.create=t=>new eT({typeName:H6.ZodUnknown,...et(t)});class ew extends en{_parse(t){let n=this._getOrReturnCtx(t);return $(n,{code:L.invalid_type,expected:N.never,received:n.parsedType}),K}}ew.create=t=>new ew({typeName:H6.ZodNever,...et(t)});class eO extends en{_parse(t){if(this._getType(t)!==N.undefined){let n=this._getOrReturnCtx(t);return $(n,{code:L.invalid_type,expected:N.void,received:n.parsedType}),K}return G(t.data)}}eO.create=t=>new eO({typeName:H6.ZodVoid,...et(t)});class ek extends en{_parse(t){let{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==N.array)return $(n,{code:L.invalid_type,expected:N.array,received:n.parsedType}),K;if(null!==i.exactLength){let o=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(o||a)&&($(n,{code:o?L.too_big:L.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(null!==i.minLength&&n.data.length<i.minLength.value&&($(n,{code:L.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),null!==i.maxLength&&n.data.length>i.maxLength.value&&($(n,{code:L.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((t,r)=>i.type._parseAsync(new X(n,t,n.path,r)))).then(t=>q.mergeArray(r,t));let u=[...n.data].map((t,r)=>i.type._parseSync(new X(n,t,n.path,r)));return q.mergeArray(r,u)}get element(){return this._def.type}min(t,n){return new ek({...this._def,minLength:{value:t,message:H5.toString(n)}})}max(t,n){return new ek({...this._def,maxLength:{value:t,message:H5.toString(n)}})}length(t,n){return new ek({...this._def,exactLength:{value:t,message:H5.toString(n)}})}nonempty(t){return this.min(1,t)}}ek.create=(t,n)=>new ek({type:t,minLength:null,maxLength:null,exactLength:null,typeName:H6.ZodArray,...et(n)});class eC extends en{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;let t=this._def.shape(),n=H3.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==N.object){let n=this._getOrReturnCtx(t);return $(n,{code:L.invalid_type,expected:N.object,received:n.parsedType}),K}let{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),u=[];if(!(this._def.catchall instanceof ew&&"strip"===this._def.unknownKeys))for(let s in i.data)a.includes(s)||u.push(s);let l=[];for(let c of a){let d=o[c],f=i.data[c];l.push({key:{status:"valid",value:c},value:d._parse(new X(i,f,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof ew){let p=this._def.unknownKeys;if("passthrough"===p)for(let h of u)l.push({key:{status:"valid",value:h},value:{status:"valid",value:i.data[h]}});else if("strict"===p)u.length>0&&($(i,{code:L.unrecognized_keys,keys:u}),r.dirty());else if("strip"!==p)throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let m=this._def.catchall;for(let g of u){let y=i.data[g];l.push({key:{status:"valid",value:g},value:m._parse(new X(i,y,i.path,g)),alwaysSet:g in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let t=[];for(let n of l){let r=await n.key;t.push({key:r,value:await n.value,alwaysSet:n.alwaysSet})}return t}).then(t=>q.mergeObjectSync(r,t)):q.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return H5.errToObj,new eC({...this._def,unknownKeys:"strict",...void 0!==t?{errorMap:(n,r)=>{var i,o,a,u;let s=null!==(a=null===(o=(i=this._def).errorMap)||void 0===o?void 0:o.call(i,n,r).message)&&void 0!==a?a:r.defaultError;return"unrecognized_keys"===n.code?{message:null!==(u=H5.errToObj(t).message)&&void 0!==u?u:s}:{message:s}}}:{}})}strip(){return new eC({...this._def,unknownKeys:"strip"})}passthrough(){return new eC({...this._def,unknownKeys:"passthrough"})}extend(t){return new eC({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new eC({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:H6.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new eC({...this._def,catchall:t})}pick(t){let n={};return H3.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new eC({...this._def,shape:()=>n})}omit(t){let n={};return H3.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new eC({...this._def,shape:()=>n})}deepPartial(){return function t(n){if(!(n instanceof eC))return n instanceof ek?new ek({...n._def,type:t(n.element)}):n instanceof e$?e$.create(t(n.unwrap())):n instanceof eq?eq.create(t(n.unwrap())):n instanceof ej?ej.create(n.items.map(n=>t(n))):n;{let r={};for(let i in n.shape){let o=n.shape[i];r[i]=e$.create(t(o))}return new eC({...n._def,shape:()=>r})}}(this)}partial(t){let n={};return H3.objectKeys(this.shape).forEach(r=>{let i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new eC({...this._def,shape:()=>n})}required(t){let n={};return H3.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof e$;)i=i._def.innerType;n[r]=i}}),new eC({...this._def,shape:()=>n})}keyof(){return eW(H3.objectKeys(this.shape))}}eC.create=(t,n)=>new eC({shape:()=>t,unknownKeys:"strip",catchall:ew.create(),typeName:H6.ZodObject,...et(n)}),eC.strictCreate=(t,n)=>new eC({shape:()=>t,unknownKeys:"strict",catchall:ew.create(),typeName:H6.ZodObject,...et(n)}),eC.lazycreate=(t,n)=>new eC({shape:t,unknownKeys:"strip",catchall:ew.create(),typeName:H6.ZodObject,...et(n)});class eI extends en{_parse(t){let{ctx:n}=this._processInputParams(t),r=this._def.options;if(n.common.async)return Promise.all(r.map(async t=>{let r={...n,common:{...n.common,issues:[]},parent:null};return{result:await t._parseAsync({data:n.data,path:n.path,parent:r}),ctx:r}})).then(function(t){for(let r of t)if("valid"===r.result.status)return r.result;for(let i of t)if("dirty"===i.result.status)return n.common.issues.push(...i.ctx.common.issues),i.result;let o=t.map(t=>new F(t.ctx.common.issues));return $(n,{code:L.invalid_union,unionErrors:o}),K});{let i,o=[];for(let a of r){let u={...n,common:{...n.common,issues:[]},parent:null},s=a._parseSync({data:n.data,path:n.path,parent:u});if("valid"===s.status)return s;"dirty"!==s.status||i||(i={result:s,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;let l=o.map(t=>new F(t));return $(n,{code:L.invalid_union,unionErrors:l}),K}}get options(){return this._def.options}}eI.create=(t,n)=>new eI({options:t,typeName:H6.ZodUnion,...et(n)});let eM=t=>t instanceof eD?eM(t.schema):t instanceof eV?eM(t.innerType()):t instanceof eF?[t.value]:t instanceof eU?t.options:t instanceof ez?Object.keys(t.enum):t instanceof eK?eM(t._def.innerType):t instanceof ex?[void 0]:t instanceof e_?[null]:null;class eR extends en{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==N.object)return $(n,{code:L.invalid_type,expected:N.object,received:n.parsedType}),K;let r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):($(n,{code:L.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),K)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let o of n){let a=eM(o.shape[t]);if(!a)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let u of a){if(i.has(u))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(u)}`);i.set(u,o)}}return new eR({typeName:H6.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...et(r)})}}class eE extends en{_parse(t){let{status:n,ctx:r}=this._processInputParams(t),i=(t,i)=>{if(Z(t)||Z(i))return K;let o=function t(n,r){let i=P(n),o=P(r);if(n===r)return{valid:!0,data:n};if(i===N.object&&o===N.object){let a=H3.objectKeys(r),u=H3.objectKeys(n).filter(t=>-1!==a.indexOf(t)),s={...n,...r};for(let l of u){let c=t(n[l],r[l]);if(!c.valid)return{valid:!1};s[l]=c.data}return{valid:!0,data:s}}if(i!==N.array||o!==N.array)return i===N.date&&o===N.date&&+n==+r?{valid:!0,data:n}:{valid:!1};{if(n.length!==r.length)return{valid:!1};let d=[];for(let f=0;f<n.length;f++){let p=n[f],h=r[f],m=t(p,h);if(!m.valid)return{valid:!1};d.push(m.data)}return{valid:!0,data:d}}}(t.value,i.value);return o.valid?((Y(t)||Y(i))&&n.dirty(),{status:n.value,value:o.data}):($(r,{code:L.invalid_intersection_types}),K)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([t,n])=>i(t,n)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}eE.create=(t,n,r)=>new eE({left:t,right:n,typeName:H6.ZodIntersection,...et(r)});class ej extends en{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==N.array)return $(r,{code:L.invalid_type,expected:N.array,received:r.parsedType}),K;if(r.data.length<this._def.items.length)return $(r,{code:L.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),K;!this._def.rest&&r.data.length>this._def.items.length&&($(r,{code:L.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let i=[...r.data].map((t,n)=>{let i=this._def.items[n]||this._def.rest;return i?i._parse(new X(r,t,r.path,n)):null}).filter(t=>!!t);return r.common.async?Promise.all(i).then(t=>q.mergeArray(n,t)):q.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new ej({...this._def,rest:t})}}ej.create=(t,n)=>{if(!Array.isArray(t))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new ej({items:t,typeName:H6.ZodTuple,rest:null,...et(n)})};class eA extends en{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==N.object)return $(r,{code:L.invalid_type,expected:N.object,received:r.parsedType}),K;let i=[],o=this._def.keyType,a=this._def.valueType;for(let u in r.data)i.push({key:o._parse(new X(r,u,r.path,u)),value:a._parse(new X(r,r.data[u],r.path,u))});return r.common.async?q.mergeObjectAsync(n,i):q.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return new eA(n instanceof en?{keyType:t,valueType:n,typeName:H6.ZodRecord,...et(r)}:{keyType:ep.create(),valueType:t,typeName:H6.ZodRecord,...et(n)})}}class eN extends en{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==N.map)return $(r,{code:L.invalid_type,expected:N.map,received:r.parsedType}),K;let i=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([t,n],a)=>({key:i._parse(new X(r,t,r.path,[a,"key"])),value:o._parse(new X(r,n,r.path,[a,"value"]))}));if(r.common.async){let u=new Map;return Promise.resolve().then(async()=>{for(let t of a){let r=await t.key,i=await t.value;if("aborted"===r.status||"aborted"===i.status)return K;("dirty"===r.status||"dirty"===i.status)&&n.dirty(),u.set(r.value,i.value)}return{status:n.value,value:u}})}{let s=new Map;for(let l of a){let c=l.key,d=l.value;if("aborted"===c.status||"aborted"===d.status)return K;("dirty"===c.status||"dirty"===d.status)&&n.dirty(),s.set(c.value,d.value)}return{status:n.value,value:s}}}}eN.create=(t,n,r)=>new eN({valueType:n,keyType:t,typeName:H6.ZodMap,...et(r)});class eP extends en{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==N.set)return $(r,{code:L.invalid_type,expected:N.set,received:r.parsedType}),K;let i=this._def;null!==i.minSize&&r.data.size<i.minSize.value&&($(r,{code:L.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),null!==i.maxSize&&r.data.size>i.maxSize.value&&($(r,{code:L.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());let o=this._def.valueType;function a(t){let r=new Set;for(let i of t){if("aborted"===i.status)return K;"dirty"===i.status&&n.dirty(),r.add(i.value)}return{status:n.value,value:r}}let u=[...r.data.values()].map((t,n)=>o._parse(new X(r,t,r.path,n)));return r.common.async?Promise.all(u).then(t=>a(t)):a(u)}min(t,n){return new eP({...this._def,minSize:{value:t,message:H5.toString(n)}})}max(t,n){return new eP({...this._def,maxSize:{value:t,message:H5.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}eP.create=(t,n)=>new eP({valueType:t,minSize:null,maxSize:null,typeName:H6.ZodSet,...et(n)});class eL extends en{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==N.function)return $(n,{code:L.invalid_type,expected:N.function,received:n.parsedType}),K;function r(t,r){return V({data:t,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,U,W].filter(t=>!!t),issueData:{code:L.invalid_arguments,argumentsError:r}})}function i(t,r){return V({data:t,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,U,W].filter(t=>!!t),issueData:{code:L.invalid_return_type,returnTypeError:r}})}let o={errorMap:n.common.contextualErrorMap},a=n.data;return this._def.returns instanceof eB?G(async(...t)=>{let n=new F([]),u=await this._def.args.parseAsync(t,o).catch(i=>{throw n.addIssue(r(t,i)),n}),s=await a(...u);return await this._def.returns._def.type.parseAsync(s,o).catch(t=>{throw n.addIssue(i(s,t)),n})}):G((...t)=>{let n=this._def.args.safeParse(t,o);if(!n.success)throw new F([r(t,n.error)]);let u=a(...n.data),s=this._def.returns.safeParse(u,o);if(!s.success)throw new F([i(u,s.error)]);return s.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new eL({...this._def,args:ej.create(t).rest(eT.create())})}returns(t){return new eL({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new eL({args:t||ej.create([]).rest(eT.create()),returns:n||eT.create(),typeName:H6.ZodFunction,...et(r)})}}class eD extends en{get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}eD.create=(t,n)=>new eD({getter:t,typeName:H6.ZodLazy,...et(n)});class eF extends en{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return $(n,{received:n.data,code:L.invalid_literal,expected:this._def.value}),K}return{status:"valid",value:t.data}}get value(){return this._def.value}}function eW(t,n){return new eU({values:t,typeName:H6.ZodEnum,...et(n)})}eF.create=(t,n)=>new eF({value:t,typeName:H6.ZodLiteral,...et(n)});class eU extends en{_parse(t){if("string"!=typeof t.data){let n=this._getOrReturnCtx(t),r=this._def.values;return $(n,{expected:H3.joinValues(r),received:n.parsedType,code:L.invalid_type}),K}if(-1===this._def.values.indexOf(t.data)){let i=this._getOrReturnCtx(t),o=this._def.values;return $(i,{received:i.data,code:L.invalid_enum_value,options:o}),K}return G(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t){return eU.create(t)}exclude(t){return eU.create(this.options.filter(n=>!t.includes(n)))}}eU.create=eW;class ez extends en{_parse(t){let n=H3.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==N.string&&r.parsedType!==N.number){let i=H3.objectValues(n);return $(r,{expected:H3.joinValues(i),received:r.parsedType,code:L.invalid_type}),K}if(-1===n.indexOf(t.data)){let o=H3.objectValues(n);return $(r,{received:r.data,code:L.invalid_enum_value,options:o}),K}return G(t.data)}get enum(){return this._def.values}}ez.create=(t,n)=>new ez({values:t,typeName:H6.ZodNativeEnum,...et(n)});class eB extends en{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==N.promise&&!1===n.common.async)return $(n,{code:L.invalid_type,expected:N.promise,received:n.parsedType}),K;let r=n.parsedType===N.promise?n.data:Promise.resolve(n.data);return G(r.then(t=>this._def.type.parseAsync(t,{path:n.path,errorMap:n.common.contextualErrorMap})))}}eB.create=(t,n)=>new eB({type:t,typeName:H6.ZodPromise,...et(n)});class eV extends en{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===H6.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null;if("preprocess"===i.type){let o=i.transform(r.data);return r.common.async?Promise.resolve(o).then(t=>this._def.schema._parseAsync({data:t,path:r.path,parent:r})):this._def.schema._parseSync({data:o,path:r.path,parent:r})}let a={addIssue(t){$(r,t),t.fatal?n.abort():n.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),"refinement"===i.type){let u=t=>{let n=i.refinement(t,a);if(r.common.async)return Promise.resolve(n);if(n instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return t};if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(t=>"aborted"===t.status?K:("dirty"===t.status&&n.dirty(),u(t.value).then(()=>({status:n.value,value:t.value}))));{let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===s.status?K:("dirty"===s.status&&n.dirty(),u(s.value),{status:n.value,value:s.value})}}if("transform"===i.type){if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(t=>J(t)?Promise.resolve(i.transform(t.value,a)).then(t=>({status:n.value,value:t})):t);{let l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!J(l))return l;let c=i.transform(l.value,a);if(c instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:c}}}H3.assertNever(i)}}eV.create=(t,n,r)=>new eV({schema:t,typeName:H6.ZodEffects,effect:n,...et(r)}),eV.createWithPreprocess=(t,n,r)=>new eV({schema:n,effect:{type:"preprocess",transform:t},typeName:H6.ZodEffects,...et(r)});class e$ extends en{_parse(t){return this._getType(t)===N.undefined?G(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}e$.create=(t,n)=>new e$({innerType:t,typeName:H6.ZodOptional,...et(n)});class eq extends en{_parse(t){return this._getType(t)===N.null?G(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}eq.create=(t,n)=>new eq({innerType:t,typeName:H6.ZodNullable,...et(n)});class eK extends en{_parse(t){let{ctx:n}=this._processInputParams(t),r=n.data;return n.parsedType===N.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}eK.create=(t,n)=>new eK({innerType:t,typeName:H6.ZodDefault,defaultValue:"function"==typeof n.default?n.default:()=>n.default,...et(n)});class eH extends en{_parse(t){let{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Q(i)?i.then(t=>({status:"valid",value:"valid"===t.status?t.value:this._def.catchValue({get error(){return new F(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===i.status?i.value:this._def.catchValue({get error(){return new F(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}eH.create=(t,n)=>new eH({innerType:t,typeName:H6.ZodCatch,catchValue:"function"==typeof n.catch?n.catch:()=>n.catch,...et(n)});class eG extends en{_parse(t){if(this._getType(t)!==N.nan){let n=this._getOrReturnCtx(t);return $(n,{code:L.invalid_type,expected:N.nan,received:n.parsedType}),K}return{status:"valid",value:t.data}}}eG.create=t=>new eG({typeName:H6.ZodNaN,...et(t)});let eZ=Symbol("zod_brand");class eY extends en{_parse(t){let{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class eJ extends en{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{let t=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===t.status?K:"dirty"===t.status?(n.dirty(),H(t.value)):this._def.out._parseAsync({data:t.value,path:r.path,parent:r})})();{let i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===i.status?K:"dirty"===i.status?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new eJ({in:t,out:n,typeName:H6.ZodPipeline})}}let eQ=(t,n={},r)=>t?eS.create().superRefine((i,o)=>{var a,u;if(!t(i)){let s="function"==typeof n?n(i):"string"==typeof n?{message:n}:n,l=null===(u=null!==(a=s.fatal)&&void 0!==a?a:r)||void 0===u||u;o.addIssue({code:"custom",..."string"==typeof s?{message:s}:s,fatal:l})}}):eS.create(),eX={object:eC.lazycreate};(nx=H6||(H6={})).ZodString="ZodString",nx.ZodNumber="ZodNumber",nx.ZodNaN="ZodNaN",nx.ZodBigInt="ZodBigInt",nx.ZodBoolean="ZodBoolean",nx.ZodDate="ZodDate",nx.ZodSymbol="ZodSymbol",nx.ZodUndefined="ZodUndefined",nx.ZodNull="ZodNull",nx.ZodAny="ZodAny",nx.ZodUnknown="ZodUnknown",nx.ZodNever="ZodNever",nx.ZodVoid="ZodVoid",nx.ZodArray="ZodArray",nx.ZodObject="ZodObject",nx.ZodUnion="ZodUnion",nx.ZodDiscriminatedUnion="ZodDiscriminatedUnion",nx.ZodIntersection="ZodIntersection",nx.ZodTuple="ZodTuple",nx.ZodRecord="ZodRecord",nx.ZodMap="ZodMap",nx.ZodSet="ZodSet",nx.ZodFunction="ZodFunction",nx.ZodLazy="ZodLazy",nx.ZodLiteral="ZodLiteral",nx.ZodEnum="ZodEnum",nx.ZodEffects="ZodEffects",nx.ZodNativeEnum="ZodNativeEnum",nx.ZodOptional="ZodOptional",nx.ZodNullable="ZodNullable",nx.ZodDefault="ZodDefault",nx.ZodCatch="ZodCatch",nx.ZodPromise="ZodPromise",nx.ZodBranded="ZodBranded",nx.ZodPipeline="ZodPipeline";let e0=(t,n={message:`Input not instance of ${t.name}`})=>eQ(n=>n instanceof t,n),e1=ep.create,e2=em.create,e3=eG.create,e4=eg.create,e5=ey.create,e6=ev.create,e9=eb.create,e8=ex.create,e7=e_.create,te=eS.create,tt=eT.create,tn=ew.create,tr=eO.create,ti=ek.create,to=eC.create,ta=eC.strictCreate,tu=eI.create,ts=eR.create,tl=eE.create,tc=ej.create,td=eA.create,tf=eN.create,tp=eP.create,th=eL.create,tm=eD.create,tg=eF.create,ty=eU.create,tv=ez.create,tb=eB.create,tx=eV.create,t_=e$.create,tS=eq.create,tT=eV.createWithPreprocess,tw=eJ.create,tO=()=>e1().optional(),tk=()=>e2().optional(),tC=()=>e5().optional();var tI=Object.freeze({__proto__:null,defaultErrorMap:W,setErrorMap:z,getErrorMap:B,makeIssue:V,EMPTY_PATH:[],addIssueToContext:$,ParseStatus:q,INVALID:K,DIRTY:H,OK:G,isAborted:Z,isDirty:Y,isValid:J,isAsync:Q,get util(){return H3},get objectUtil(){return H4},ZodParsedType:N,getParsedType:P,ZodType:en,ZodString:ep,ZodNumber:em,ZodBigInt:eg,ZodBoolean:ey,ZodDate:ev,ZodSymbol:eb,ZodUndefined:ex,ZodNull:e_,ZodAny:eS,ZodUnknown:eT,ZodNever:ew,ZodVoid:eO,ZodArray:ek,ZodObject:eC,ZodUnion:eI,ZodDiscriminatedUnion:eR,ZodIntersection:eE,ZodTuple:ej,ZodRecord:eA,ZodMap:eN,ZodSet:eP,ZodFunction:eL,ZodLazy:eD,ZodLiteral:eF,ZodEnum:eU,ZodNativeEnum:ez,ZodPromise:eB,ZodEffects:eV,ZodTransformer:eV,ZodOptional:e$,ZodNullable:eq,ZodDefault:eK,ZodCatch:eH,ZodNaN:eG,BRAND:eZ,ZodBranded:eY,ZodPipeline:eJ,custom:eQ,Schema:en,ZodSchema:en,late:eX,get ZodFirstPartyTypeKind(){return H6},coerce:{string:t=>ep.create({...t,coerce:!0}),number:t=>em.create({...t,coerce:!0}),boolean:t=>ey.create({...t,coerce:!0}),bigint:t=>eg.create({...t,coerce:!0}),date:t=>ev.create({...t,coerce:!0})},any:te,array:ti,bigint:e4,boolean:e5,date:e6,discriminatedUnion:ts,effect:tx,enum:ty,function:th,instanceof:e0,intersection:tl,lazy:tm,literal:tg,map:tf,nan:e3,nativeEnum:tv,never:tn,null:e7,nullable:tS,number:e2,object:to,oboolean:tC,onumber:tk,optional:t_,ostring:tO,pipeline:tw,preprocess:tT,promise:tb,record:td,set:tp,strictObject:ta,string:e1,symbol:e9,transformer:tx,tuple:tc,undefined:e8,union:tu,unknown:tt,void:tr,NEVER:K,ZodIssueCode:L,quotelessJson:D,ZodError:F});let tM=(0,o.createContext)(void 0);function tR(){let t=(0,o.useContext)(tM);if(!t)throw Error("Missing EditorConfigContext.Provider");return t}class tE extends Error{}function tj(t){throw new tE(`Missing EditorConfig.${t}`)}let tA=to({id:e1(),kind:e1(),extension:e1(),filename:e1(),width:e2().optional(),height:e2().optional(),last_modified:e2(),url:e1(),alt:e1().optional(),size:e2(),notes:e1().optional(),credits:e1().optional()}),tN={"X-Prismic-Source":"Wroom"},tP=to({total:e2(),cursor:e1().optional(),items:ti(tA)});function tL(t,n,r,i,o,a,u){let s=new URLSearchParams((0,h.fW)([{name:"limit",values:["30"]},{name:"cursor",values:[u??""]},{name:"keyword",values:[o]},{name:"assetType",values:[i]}])).toString(),l=tP.transform(t=>({...t,assetType:i,keyword:o,page:a}));return(0,p.WY)(`${t}?${s}`,{headers:{repository:n,...tN},credentials:(0,p.xb)(r),okType:l})}function tD(t){(0,d.YC)(tL,n=>{let{items:r,total:i}=n,o=t(r,n);if(o)return{...n,total:i+(o.length-r.length),items:o}})}d.Fs.registerFetcherConfig(tL,{cacheCapacity:100,revalidationStrategy:{type:"never"}});let tF,tW=new Uint8Array(16);function tU(){if(!tF&&!(tF="u">typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return tF(tW)}let tz=[];for(let tB=0;tB<256;++tB)tz.push((tB+256).toString(16).slice(1));let tV="u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),t$={randomUUID:tV},tq=(0,o.createContext)(void 0);function tK(t){let{children:n,assetType:r="all",onSelectedChange:i,actionContainerRef:a}=t,[l,c]=(0,o.useState)(new Set),[h,m]=(0,o.useTransition)(),[v,b]=(0,o.useTransition)(),[x,_]=(0,o.useState)(""),{showAlert:S}=(0,u.VY)(),{media:T,onHasReachedBottom:w,updateMedia:O,unshiftMedia:k,deleteMedia:C,mediaTotal:I,revalidateFirstPage:R}=function(t){let{assetType:n="all",keyword:r}=t,i=tR(),[a,u]=(0,o.useState)({page:0});i.mediaLibrary||tj("mediaLibrary");let{assetsUrl:l,repository:c}=i,p=(0,d.QT)(tL,[l,c,i.env,n,r,a.page,a.cursor]),h=function(t,n){let r=(0,d.q_)(tL).filter(r=>r.assetType===t&&r.keyword===n);return(0,f.DY)(r,t=>t.page).flatMap(t=>t.items)}(n,r);function m(){u({page:0})}return(0,s.pQ)(n,m),(0,s.pQ)(r,m),{media:h,mediaTotal:p.total,limit:30,onHasReachedBottom:function(){0!==p.total&&u(t=>({page:t.page+1,cursor:p.cursor}))},updateMedia:function(t){tD(n=>n.flatMap(n=>{let r=t.find(t=>t.id===n.id);return r?void 0===r.response?[]:r.response:n}))},unshiftMedia:function(t){m(),tD((r,i)=>{if(0===i.page&&!(""!==i.keyword||i.assetType!==n))return[...t,...r]})},deleteMedia:function(t){tD(n=>n.filter(n=>n.id!==t))},revalidateFirstPage:function(){(0,d.gw)(tL,[l,c,i.env,n,"",0])}}}({assetType:r,keyword:x}),{isUploading:E,onFilesSelected:j,uploadingFiles:A,onRetry:N}=function(t){let{onBeforeUpload:n,onComplete:r}=t,[i,a]=(0,o.useState)([]),u=i.some(t=>"idle"===t.status||"uploading"===t.status),s=tR(),l=(0,o.useCallback)(t=>{let r=[{...t,status:"idle"},...i.filter(n=>n.id!==t.id)];a(r),n(r)},[n,i]);return(0,o.useEffect)(function(){if(!i.length||i.some(t=>"uploading"===t.status)||i.every(t=>"error"===t.status))return;let t=i.find(t=>"idle"===t.status);if(!t)return;let n=i;function o(t){n=t(n),a(n),n.every(t=>"success"===t.status||"error"===t.status)&&setTimeout(()=>{a([]),null==r||r(n)},1500)}o(n=>n.map(n=>n.id===t.id?{...n,status:"uploading"}:n)),(function(t){let{file:n,config:r}=t;if(!r.mediaLibrary)throw Error("Media Library not configured.");let{assetsUrl:i,repository:o,env:a}=r,u=new FormData;return u.append(n.name,n),(0,p.WY)(i,{headers:{repository:o,"Content-Type":"multipart/form-data",...tN},method:"POST",body:u,credentials:(0,p.xb)(a),okType:tA})})({file:t.file,config:s}).then(n=>{o(r=>r.map(r=>r.id===t.id?{...r,status:"success",response:n}:r))}).catch(()=>{o(n=>n.map(n=>n.id===t.id?{...n,status:"error"}:n))})},[s,i,r]),{isUploading:u,uploadingFiles:i,onFilesSelected:function(t){let r=t.map(t=>({id:`temp-${function(t,n,r){if(t$.randomUUID&&!n&&!t)return t$.randomUUID();t=t||{};let i=t.random||(t.rng||tU)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,n){r=r||0;for(let o=0;o<16;++o)n[r+o]=i[o];return n}return function(t,n=0){return(tz[t[n+0]]+tz[t[n+1]]+tz[t[n+2]]+tz[t[n+3]]+"-"+tz[t[n+4]]+tz[t[n+5]]+"-"+tz[t[n+6]]+tz[t[n+7]]+"-"+tz[t[n+8]]+tz[t[n+9]]+"-"+tz[t[n+10]]+tz[t[n+11]]+tz[t[n+12]]+tz[t[n+13]]+tz[t[n+14]]+tz[t[n+15]]).toLowerCase()}(i)}()}`,file:t,status:"idle"}));a(r),n(r)},onRetry:l}}({onBeforeUpload(t){_("");let n=t.filter(t=>"idle"===t.status).map(t=>({id:t.id,url:URL.createObjectURL(t.file),filename:t.file.name,size:t.file.size,extension:t.file.type,kind:t.file.type,last_modified:t.file.lastModified}));k(n);let[r]=n??[];r&&c(new Set([r.id]))},onComplete(t){let n=t.flatMap(t=>"success"===t.status?t:(function(t){let n=(0,y.tx)(t.file.name,30);S({id:t.id,title:`The specified file "${n}" could not be uploaded.`,subtitle:M.jsxs(u.xv,{color:"inherit",children:["Read more about our"," ",M.jsx(u.hh,{color:"tomato11",href:"https://prismic.io/docs/guides/manage-images#supported-media",underline:!0,children:"supported media"}),"."]}),buttons:{action:{text:"Retry upload",icon:"cloudUpload",onClick:()=>N(t)}}})}(t),{id:t.id,response:void 0}));O(n),R();let r=n[0];r&&r.response&&l.has(r.id)&&(c(t=>(0,g.IH)((0,g.Od)(t,r.id),r.response.id)),null==i||i(new Set([r.response.id])))}});function P(t,n){let r=new Set(l),o=A.some(n=>n.id===t&&"success"!==n.status);if("replace"===n)return c(new Set([t])),o||null==i?void 0:i(new Set([t]));r[n](t),c(r),"add"===n&&o||null==i||i(r)}return M.jsx(tq.Provider,{value:{isFetchingMedia:h,media:T,mediaTotal:I,onScrollToBottom:function(){m(w)},selectedMediaIds:l,actionContainerRef:a,onFilesUpload:function(t){E||j(t)},isUploading:E,uploadingFiles:A,addMediaItemSelection:function(t){P(t,"add")},removeMediaItemSelection:function(t){P(t,"delete")},replaceMediaItemSelection:function(t){P(t,"replace")},deleteMedia:C,updateMedia:function(t,n){O([{id:t,response:n}])},keyword:x,onKeywordChange:function(t){b(()=>{_(t),null==i||i(new Set),c(new Set)})},isSearchingMedia:v,assetType:r},children:n})}function tH(){let t=(0,o.useContext)(tq);if(!t)throw Error("useMediaLibrary must be used within a MediaLibraryProvider");return t}function tG(){let{actionContainerRef:t,isUploading:n,onFilesUpload:r}=tH(),i=null==t?void 0:t.current;return M.jsx(tY,{actionContainerRef:t,children:M.jsxs(u.xu,{width:"100%",gap:16,children:[M.jsx(tZ,{}),M.jsx(u.u,{title:A.warning.uploadWhileUploading.title,content:A.warning.uploadWhileUploading.description,visible:n,stableMount:!0,children:M.jsx(u.KH,{disabled:n,onFilesSelected:r,startIcon:"cloudUpload",color:i?"purple":"grey",size:"large",children:"Upload media"})})]})})}function tZ(){let{keyword:t,onKeywordChange:n,isFetchingMedia:r}=tH(),[i,a]=(0,o.useState)(t);return(0,s.pQ)(t,()=>{""===t&&a("")}),(0,s.Nr)(i,300,(0,s.R9)(t=>n(t))),M.jsx(u.xu,{width:"100%",flexDirection:"column",children:M.jsx(u.CR,{value:i,placeholder:"Search",onValueChange:a,maxLength:200,isLoading:r&&t!==i})})}function tY(t){let{children:n,actionContainerRef:r}=t,i=null==r?void 0:r.current,a=i?u.Uv:o.Fragment,s=i?{container:r.current,asChild:!0}:{};return M.jsx(a,{...s,children:n})}function tJ(t){let{children:n}=t,{onFilesUpload:r,assetType:i}=tH();return M.jsx(u.Zz,{overlay:M.jsx(tQ,{}),overlayVariant:"simple",onFilesSelected:r,assetType:i,children:n})}function tQ(){let{isUploading:t}=tH(),n=t?A.warning.uploadWhileUploading.title:"Drop files here",r=t?A.warning.uploadWhileUploading.description:"Drop your files to upload them instantly to the media library.";return M.jsx(u.xu,{justifyContent:"center",flexDirection:"column",height:"100%",backgroundColor:"grey3",children:M.jsxs(u.R$,{children:[M.jsx(u.av,{name:t?"block":"cloudUpload",lineColor:t?"tomato11":"purple10",backgroundColor:t?"tomato2":"purple3",borderColor:t?"tomato6":"purple6",borderStyle:"dashed",size:"xlarge"}),M.jsx(u._T,{size:"big",children:n}),M.jsx(u.nf,{width:360,children:r})]})})}function tX(){return M.jsx(u.Iq,{title:"Oops! Something went wrong",description:"An error occurred while searching for your image.",errorImageSrc:u.Os,sx:{marginBlock:"auto",marginInline:"auto"}})}function t0(t){let{mediaList:n,mediaActions:r,sidePane:i}=t;return M.jsxs(u.xu,{display:"grid",gridTemplateRows:"1fr 1fr",gridTemplateColumns:"1fr 292px",width:"100%",height:"100%",gap:16,children:[M.jsxs(u.xu,{position:"relative",display:"grid",gap:16,gridColumn:"1",gridRow:"1 / -1",children:[r,n]}),i]})}function t1(){var t;let{onScrollToBottom:n,media:r,selectedMediaIds:i,removeMediaItemSelection:a,replaceMediaItemSelection:s,isUploading:l,uploadingFiles:c,isSearchingMedia:d}=tH(),f=(0,o.useRef)(null);function p(t){if(i.has(t))return a(t);s(t)}return l&&(null==(t=f.current)||t.scrollTo({top:0,behavior:"instant"})),M.jsx(t2,{onScrollToBottom:n,scrollAreaRef:f,children:null==r?void 0:r.map(t=>{var n;return M.jsx(u.PB,{...t,loading:d,status:null==(n=c.find(n=>n.id===t.id))?void 0:n.status,selected:i.has(t.id),onCardClick:()=>p(t.id),onCheckedChange:()=>p(t.id)},t.id)})})}function t2(t){let{children:n,scrollAreaRef:r,onScrollToBottom:i}=t;return M.jsx(u.xr,{ref:r,style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 250px), 1fr))",gridTemplateRows:"1fr 1fr 1fr ",gap:16,paddingBottom:16,position:"relative"},onScrollToBottom:i,threshold:500,children:n})}function t3(t){let{children:n,hasSelectedMedia:r}=t;return M.jsx(u.xu,{overflow:"hidden",borderStyle:r?"solid":"dashed",border:{top:!0,right:!0,left:!0,bottom:!1},borderRadius:{topRight:8,topLeft:8},gridColumn:"2",gridRow:"1 / -1",children:n})}function t4(t){let{onFilesUpload:n,isUploading:r,isInitialLoad:i=!1}=t,o=i||r;return M.jsxs(u.xu,{flexDirection:"column",justifyContent:"center",alignItems:"center",padding:16,gap:16,width:"100%",children:[M.jsx(u.av,{name:"cloudUpload",lineColor:"purple11",backgroundColor:"purple5",size:"large"}),M.jsx(u.xu,{flexDirection:"column",gap:4,children:M.jsxs(u.xv,{align:"center",children:["Select or"," ",M.jsx(u.KH,{disabled:o,onFilesSelected:n,renderButton:t=>M.jsx(u.u,{title:A.warning.uploadWhileUploading.title,content:A.warning.uploadWhileUploading.description,visible:r,children:M.jsx(u.iC,{disabled:o,onClick:t,buttonText:"upload",inline:!0})})})," ","media."]})}),M.jsx(u.KH,{disabled:o,onFilesSelected:n,color:"grey",children:"Upload media"})]})}function t5(t){let{actionContainerRef:n}=t;return M.jsx(t0,{sidePane:M.jsx(t8,{}),mediaActions:M.jsx(t9,{actionContainerRef:n}),mediaList:M.jsxs(M.Fragment,{children:[M.jsx(u.xu,{width:"100%",height:24,alignItems:"center",children:M.jsx(u.Od,{color:"grey5",height:16,width:56,borderRadius:12})}),M.jsx(t6,{})]})})}function t6(){return M.jsx(t2,{children:(0,m.N)(12,M.jsx(t7,{}))})}function t9(t){let{actionContainerRef:n}=t,r=(0,s.NW)();return(0,o.useLayoutEffect)(()=>{r()},[r]),M.jsx(tY,{actionContainerRef:n,children:M.jsxs(u.xu,{width:"100%",gap:16,children:[M.jsx(u.xu,{width:"100%",flexDirection:"column",children:M.jsx(u.CR,{placeholder:"Search",maxLength:200,value:"",disabled:!0,onValueChange:()=>null})}),M.jsx(u.KH,{disabled:!0,onFilesSelected:()=>null,startIcon:"cloudUpload",color:n?"purple":"grey",size:"large",children:"Upload media"})]})})}function t8(){return M.jsx(t3,{hasSelectedMedia:!1,children:M.jsx(t4,{onFilesUpload:()=>null,isUploading:!1,isInitialLoad:!0})})}function t7(){return M.jsxs(u.xu,{height:302,width:"100%",flexDirection:"column",padding:16,backgroundColor:"grey1",border:!0,borderStyle:"solid",borderRadius:6,children:[M.jsx(u.Od,{height:164,width:"100%"}),M.jsx(u.Od,{height:16,width:"100%",sx:{marginTop:12}}),M.jsx(u.Od,{height:10,width:100,sx:{marginTop:8}}),M.jsx(u.Od,{height:1,width:"100%",sx:{marginTop:20,marginBottom:16}}),M.jsxs(u.xu,{flexDirection:"row",gap:8,children:[M.jsx(u.Od,{height:24,width:54}),M.jsx(u.Od,{height:24,width:45}),M.jsx(u.Od,{height:24,width:62})]})]})}let ne=(0,o.createContext)({showToast:()=>null});function nt(t){let{children:n}=t,{isFetchingMedia:r}=tH(),[i,a]=(0,o.useState)({title:"",seconds:5}),[s,l]=(0,o.useState)(!1),{title:c,action:d,seconds:f=1,icon:p="check"}=i,h=(0,o.useMemo)(()=>({showToast(t){a({seconds:f,...t}),l(!0)}}),[f]);return M.jsxs(M.Fragment,{children:[M.jsx(nn,{open:r}),M.jsx(u.FN,{anchor:M.jsx(u.xu,{position:"absolute",justifyContent:"center",width:"100%",bottom:72}),open:s,onOpenChange:l,title:c,action:d,seconds:f,icon:p}),M.jsx(ne.Provider,{value:h,children:n})]})}function nn(t){let{open:n}=t;return M.jsx(u.FN,{anchor:M.jsx(u.xu,{position:"absolute",justifyContent:"center",width:"100%",bottom:72}),loadingIndicator:!0,open:n,title:"Loading more items ...",seconds:1})}function nr(){let{media:t,selectedMediaIds:n}=tH();return t.filter(({id:t})=>n.has(t))}function ni(){let[t,n]=(0,o.useState)(!1),r=nr(),{uploadingFiles:i}=tH(),[a]=r;if(!a)return null;if(r.length>1)return M.jsxs(u.xu,{gap:8,alignItems:"center",children:[M.jsxs(u.xv,{variant:"emphasized",noWrap:!0,sx:{flexGrow:1},children:[r.length," media selected"]}),M.jsx(u.u,{content:"Open all selected media in new tabs",children:M.jsx(u.hU,{icon:"openInFull",variant:"solid",size:"small",onClick:()=>r.forEach(t=>window.open(t.url,"_blank"))})})]});let s=i.some(t=>t.id===a.id&&"success"!==t.status);return M.jsxs(u.xu,{gap:8,alignItems:"center",children:[M.jsx(u.xv,{variant:"emphasized",noWrap:!0,sx:{flexGrow:1},children:a.filename}),M.jsxs(u.xu,{gap:8,children:[M.jsx(u.u,{content:"Open media in new tab",children:M.jsx(u.hU,{icon:"openInFull",variant:"solid",size:"small",hiddenLabel:"Open media in new tab",onClick:()=>window.open(a.url,"_blank"),disabled:s})}),M.jsx(u.u,{content:"Copy media URL",children:M.jsx(u.hU,{icon:"link",variant:"solid",size:"small",hiddenLabel:"Copy media URL",onClick:()=>navigator.clipboard.writeText(a.url),disabled:s})}),M.jsx(u.u,{content:"Remove media",children:M.jsx(u.hU,{icon:"delete",variant:"solid",color:"tomato",size:"small",hiddenLabel:"Remove media",onClick:()=>n(!0),disabled:s})}),M.jsx(no,{open:t,onOpenChange:n,media:a})]})]})}function no(t){let{open:n,onOpenChange:r,media:i}=t,a=tR(),{showAlert:s}=(0,u.VY)(),{deleteMedia:l}=tH(),[c,d]=(0,o.useState)(!1);return M.jsxs(u.Vq,{onOpenChange:r,open:n,size:"small",children:[M.jsx(u.fK,{icon:"alert",title:"Remove this item from your media library?"}),M.jsx(u.cZ,{children:M.jsx(u.xu,{padding:16,children:M.jsxs(u.xv,{children:["You are about to delete this item: ",M.jsx("b",{children:i.filename})]})})}),M.jsx(u.kX,{asFooter:!0,ok:{onClick(){var t;return t=i.id,void(d(!0),(function(t){let{id:n,config:r}=t;if(!r.mediaLibrary)throw Error("Media Library not configured.");let{assetsUrl:i,repository:o,env:a}=r;return(0,p.WY)(`${i}/${n}`,{headers:{repository:o},method:"DELETE",credentials:(0,p.xb)(a),okType:tI.unknown()})})({id:t,config:a}).then(()=>{r(!1),l(t)}).catch(()=>{r(!1),s({title:"Error",subtitle:"Something went wrong when removing the item."})}).finally(()=>{d(!1)}))},text:"Yes, I want to remove this item",color:"tomato",loading:c},cancel:{text:"Cancel"}})]})}function na(){var t;let n=nr(),{uploadingFiles:r}=tH(),[i]=n;if(!i)return null;if(2===n.length)return M.jsx(nu,{children:n.map((t,n)=>M.jsx("div",{style:{position:"absolute",transform:0===n?"translateX(25%) rotate(15deg) ":"translateX(-25%) rotate(-15deg) "},children:M.jsx(ns,{media:t})},t.id))});if(n.length>2)return M.jsx(nu,{children:n.slice(-4).map((t,n)=>M.jsx("div",{style:{position:"absolute",paddingRight:16*n},children:M.jsx(ns,{media:t})},t.id))});let o=null==(t=r.find(t=>t.id===i.id))?void 0:t.status,a=i.kind.startsWith("image");return M.jsx(u.xu,{flexDirection:"column",children:M.jsx(u.hM,{children:M.jsx(nu,{uploadStatus:o,hasImage:a,children:a?M.jsx(u.Ee,{src:i.url,alt:i.alt,sizing:"contain"}):M.jsx(u.Sp,{extension:i.extension,filename:i.filename})})})})}function nu(t){let{children:n,uploadStatus:r,hasImage:i}=t;return M.jsxs(u.xu,{flexDirection:"column",alignItems:"center",justifyContent:"center",position:"relative",height:200,width:"100%",backgroundColor:i?"transparent":"purple2",children:[n,r&&M.jsx(u.xu,{position:"absolute",backgroundColor:"greyAlpha1",width:"100%",height:"100%",padding:{inline:16},justifyContent:"end",flexDirection:"column",children:M.jsx(u.wI,{status:r})})]})}function ns(t){let{media:n}=t;return M.jsx(u.xu,{width:111,height:152,children:"image"===n.kind?M.jsx(u.Ee,{borderRadius:8,src:n.url,alt:n.alt,sizing:"cover"}):M.jsx(u.Sp,{extension:n.extension,filename:n.filename})})}function nl(){var t,n;let[r,i]=(0,o.useState)("description"),a=nr();if(0===a.length||a.length>1)return null;let s="description"===r,l="more-info"===r;return M.jsxs(M.Fragment,{children:[M.jsxs(u.xu,{border:!0,borderStyle:"solid",borderRadius:8,backgroundColor:"grey2",children:[M.jsx(u.OK,{title:"Description",selected:s,onSelect:()=>i("description"),outline:s,background:s?void 0:"transparent",sx:{flexGrow:1,flexBasis:0}}),M.jsx(u.OK,{title:"More info",selected:l,onSelect:()=>i("more-info"),outline:l,background:l?void 0:"transparent",sx:{flexGrow:1,flexBasis:0}})]}),M.jsxs(u.xu,{gap:16,flexDirection:"column",children:[s&&M.jsx(nc,{},null==(t=a[0])?void 0:t.id),l&&M.jsx(nd,{},null==(n=a[0])?void 0:n.id)]})]})}function nc(){let{title:t,setTitle:n,alt:r,setAlt:i,onBlur:o,isUploading:a,selectedMedia:s}=nf();return s?M.jsxs(u.xu,{flexDirection:"column",gap:16,children:[M.jsx(u.yt,{value:t,onValueChange:n,label:"Image title",placeholder:"Image title",onBlur:o,disabled:a}),M.jsx(u.Wi,{label:"Alternative text",children:M.jsx(u.Kx,{value:r,onChange:i,placeholder:"A short description of the image for accessibility",onBlur:o,disabled:a})})]}):null}function nd(){let{credits:t,setCredits:n,notes:r,setNotes:i,onBlur:o,isUploading:a,selectedMedia:s}=nf();if(!s)return null;let d=function(t){let{width:n,height:r,last_modified:i,size:o,extension:a}=t,u=n&&r,s={label:"Date",value:(0,l._L)(new Date(i))},d={label:"File size",value:(0,y.td)(o)},f=u?{label:"Dimensions",value:`${n}x${r}`}:void 0,p=u?{label:"Ratio",value:((n??0)/(r??0)).toFixed(1)}:void 0,h={label:"Extension",value:a.toUpperCase()};return[s,d,f,p,h].filter(c.$)}(s);return M.jsxs(u.xu,{gap:8,flexDirection:"column",children:[d.map(t=>M.jsxs(u.xu,{gap:8,children:[M.jsxs(u.xv,{color:"grey11",children:[t.label,":"]}),M.jsx(u.xv,{children:t.value})]},t.label)),M.jsx(u.Wi,{label:"Copyright",children:M.jsx(u.Kx,{value:t,onChange:n,placeholder:"Copyrights or credits are applicable to this media item",onBlur:o,disabled:a})}),M.jsx(u.Wi,{label:"Private notes",children:M.jsx(u.Kx,{value:r,onChange:i,placeholder:"Private notes are never shared publicly",onBlur:o,disabled:a})})]})}function nf(){let[t]=nr(),{updateMedia:n,uploadingFiles:r}=tH(),i=tR(),{showToast:a}=(0,o.useContext)(ne),u=(null==t?void 0:t.id)??"",s=(null==t?void 0:t.credits)??"",l=(null==t?void 0:t.notes)??"",c=(null==t?void 0:t.filename)??"",d=(null==t?void 0:t.alt)??"",[f,h]=(0,o.useState)(c),[m,g]=(0,o.useState)(d),[y,v]=(0,o.useState)(s),[b,x]=(0,o.useState)(l),_=r.some(n=>n.id===(null==t?void 0:t.id)&&"success"!==n.status);return{selectedMedia:t,onBlur:function(){t&&(f!==c||m!==d||y!==s||b!==l)&&(n(u,{...t,filename:f,alt:m,credits:y,notes:b}),(function(t){let{id:n,config:r,metadata:i}=t;if(!r.mediaLibrary)throw Error("Media Library not configured.");let{assetsUrl:o,repository:a,env:u}=r;return(0,p.WY)(`${o}/${n}`,{headers:{repository:a},body:{...i},method:"PATCH",credentials:(0,p.xb)(u),okType:tA})})({id:u,config:i,metadata:{filename:f,credits:y,alt:m,notes:b}}).then(()=>{a({title:"Media metadata has been saved.",seconds:3})}).catch(t=>{console.error(t)}))},isUploading:_,title:f,setTitle:h,alt:m,setAlt:g,credits:y,setCredits:v,notes:b,setNotes:x}}function np(){let t=nr(),{onFilesUpload:n,isUploading:r}=tH();return 0===t.length?M.jsx(t4,{onFilesUpload:n,isUploading:r}):M.jsxs(u.xu,{flexDirection:"column",backgroundColor:"grey1",width:"100%",overflowY:"auto",padding:16,gap:16,children:[M.jsx(ni,{}),M.jsx(na,{}),M.jsx(nl,{})]})}function nh(){let{selectedMediaIds:t}=tH(),n=t.size>0;return M.jsx(t3,{hasSelectedMedia:n,children:M.jsx(np,{})})}function nm(t){let{assetType:n,onSelectedChange:r,actionContainerRef:i}=t;return M.jsx(u.SV,{renderError:()=>M.jsx(tX,{}),children:M.jsx(o.Suspense,{fallback:M.jsx(t5,{actionContainerRef:i}),children:M.jsx(tK,{assetType:n,actionContainerRef:i,onSelectedChange:r,children:M.jsx(tJ,{children:M.jsx(ng,{})})})})})}function ng(){let{media:t,mediaTotal:n}=tH();return M.jsx(nt,{children:M.jsx(t0,{sidePane:M.jsx(nh,{}),mediaActions:M.jsx(tG,{}),mediaList:M.jsxs(M.Fragment,{children:[0===t.length?M.jsx(j,{}):M.jsx(u.xu,{width:"100%",children:M.jsxs(u.xv,{variant:"bold",children:[n," items"]})}),M.jsx(t1,{})]})})})}var ny,nv,nb,nx,n_,nS,nT,nw,nO,nk,nC,nI,nM,nR,nE,nj,nA,nN,nP,nL,nD,nF,nW,nU,nz,nB,nV,n$,nq,nK,nH,nG,nZ,nY,nJ={},nQ={};n_={get exports(){return nQ},set exports(e){nQ=e}},function(t){var n="object"==typeof k?k:"object"==typeof self?self:"object"==typeof this?this:{};function r(t,r){return t!==n&&("function"==typeof Object.create?Object.defineProperty(t,"__esModule",{value:!0}):t.__esModule=!0),function(n,i){return t[n]=r?r(n,i):i}}t(r(n,r(n_.exports)))}(function(t){var n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])};nS=function(t,r){if("function"!=typeof r&&null!==r)throw TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=t}n(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)},nT=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},nw=function(t,n){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&0>n.indexOf(i)&&(r[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,i=Object.getOwnPropertySymbols(t);o<i.length;o++)0>n.indexOf(i[o])&&Object.prototype.propertyIsEnumerable.call(t,i[o])&&(r[i[o]]=t[i[o]]);return r},nO=function(t,n,r,i){var o,a=arguments.length,u=a<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(t,n,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(u=(a<3?o(u):a>3?o(n,r,u):o(n,r))||u);return a>3&&u&&Object.defineProperty(n,r,u),u},nk=function(t,n){return function(r,i){n(r,i,t)}},nC=function(t,n,r,i,o,a){function u(t){if(void 0!==t&&"function"!=typeof t)throw TypeError("Function expected");return t}for(var s,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!n&&t?i.static?t:t.prototype:null,f=n||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),p=!1,h=r.length-1;h>=0;h--){var m={};for(var g in i)m[g]="access"===g?{}:i[g];for(var g in i.access)m.access[g]=i.access[g];m.addInitializer=function(t){if(p)throw TypeError("Cannot add initializers after decoration has completed");a.push(u(t||null))};var y=(0,r[h])("accessor"===l?{get:f.get,set:f.set}:f[c],m);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw TypeError("Object expected");(s=u(y.get))&&(f.get=s),(s=u(y.set))&&(f.set=s),(s=u(y.init))&&o.push(s)}else(s=u(y))&&("field"===l?o.push(s):f[c]=s)}d&&Object.defineProperty(d,i.name,f),p=!0},nI=function(t,n,r){for(var i=arguments.length>2,o=0;o<n.length;o++)r=i?n[o].call(t,r):n[o].call(t);return i?r:void 0},nM=function(t){return"symbol"==typeof t?t:"".concat(t)},nR=function(t,n,r){return"symbol"==typeof n&&(n=n.description?"[".concat(n.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",n):n})},nE=function(t,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,n)},nj=function(t,n,r,i){return new(r||(r=Promise))(function(o,a){function u(t){try{l(i.next(t))}catch(n){a(n)}}function s(t){try{l(i.throw(t))}catch(n){a(n)}}function l(t){var n;t.done?o(t.value):((n=t.value)instanceof r?n:new r(function(t){t(n)})).then(u,s)}l((i=i.apply(t,n||[])).next())})},nA=function(t,n){var r,i,o,a,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(u=0)),u;)try{if(r=1,i&&(o=2&s[0]?i.return:s[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;switch(i=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,i=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){u=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){u.label=s[1];break}if(6===s[0]&&u.label<o[1]){u.label=o[1],o=s;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(s);break}o[2]&&u.ops.pop(),u.trys.pop();continue}s=n.call(t,u)}catch(l){s=[6,l],i=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},nN=function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||nY(n,t,r)},nY=Object.create?function(t,n,r,i){void 0===i&&(i=r);var o=Object.getOwnPropertyDescriptor(n,r);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[r]}}),Object.defineProperty(t,i,o)}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]},nP=function(t){var n="function"==typeof Symbol&&Symbol.iterator,r=n&&t[n],i=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")},nL=function(t,n){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,o,a=r.call(t),u=[];try{for(;(void 0===n||n-- >0)&&!(i=a.next()).done;)u.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return u},nD=function(){for(var t=[],n=0;n<arguments.length;n++)t=t.concat(nL(arguments[n]));return t},nF=function(){for(var t=0,n=0,r=arguments.length;n<r;n++)t+=arguments[n].length;for(var i=Array(t),o=0,n=0;n<r;n++)for(var a=arguments[n],u=0,s=a.length;u<s;u++,o++)i[o]=a[u];return i},nW=function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))},nU=function(t){return this instanceof nU?(this.v=t,this):new nU(t)},nz=function(t,n,r){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var i,o=r.apply(t,n||[]),a=[];return i={},u("next"),u("throw"),u("return"),i[Symbol.asyncIterator]=function(){return this},i;function u(t){o[t]&&(i[t]=function(n){return new Promise(function(r,i){a.push([t,n,r,i])>1||s(t,n)})})}function s(t,n){try{var r;r=o[t](n),r.value instanceof nU?Promise.resolve(r.value.v).then(l,c):d(a[0][2],r)}catch(i){d(a[0][3],i)}}function l(t){s("next",t)}function c(t){s("throw",t)}function d(t,n){t(n),a.shift(),a.length&&s(a[0][0],a[0][1])}},nB=function(t){var n,r;return n={},i("next"),i("throw",function(t){throw t}),i("return"),n[Symbol.iterator]=function(){return this},n;function i(i,o){n[i]=t[i]?function(n){return(r=!r)?{value:nU(t[i](n)),done:!1}:o?o(n):n}:o}},nV=function(t){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var n,r=t[Symbol.asyncIterator];return r?r.call(t):(t="function"==typeof nP?nP(t):t[Symbol.iterator](),n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n);function i(r){n[r]=t[r]&&function(n){return new Promise(function(i,o){(function(t,n,r,i){Promise.resolve(i).then(function(n){t({value:n,done:r})},n)})(i,o,(n=t[r](n)).done,n.value)})}}},n$=function(t,n){return Object.defineProperty?Object.defineProperty(t,"raw",{value:n}):t.raw=n,t};var r=Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n};nq=function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&nY(n,t,i);return r(n,t),n},nK=function(t){return t&&t.__esModule?t:{default:t}},nH=function(t,n,r,i){if("a"===r&&!i)throw TypeError("Private accessor was defined without a getter");if("function"==typeof n?t!==n||!i:!n.has(t))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(t):i?i.value:n.get(t)},nG=function(t,n,r,i,o){if("m"===i)throw TypeError("Private method is not writable");if("a"===i&&!o)throw TypeError("Private accessor was defined without a setter");if("function"==typeof n?t!==n||!o:!n.has(t))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(t,r):o?o.value=r:n.set(t,r),r},nZ=function(t,n){if(null===n||"object"!=typeof n&&"function"!=typeof n)throw TypeError("Cannot use 'in' operator on non-object");return"function"==typeof t?n===t:t.has(n)},t("__extends",nS),t("__assign",nT),t("__rest",nw),t("__decorate",nO),t("__param",nk),t("__esDecorate",nC),t("__runInitializers",nI),t("__propKey",nM),t("__setFunctionName",nR),t("__metadata",nE),t("__awaiter",nj),t("__generator",nA),t("__exportStar",nN),t("__createBinding",nY),t("__values",nP),t("__read",nL),t("__spread",nD),t("__spreadArrays",nF),t("__spreadArray",nW),t("__await",nU),t("__asyncGenerator",nz),t("__asyncDelegator",nB),t("__asyncValues",nV),t("__makeTemplateObject",n$),t("__importStar",nq),t("__importDefault",nK),t("__classPrivateFieldGet",nH),t("__classPrivateFieldSet",nG),t("__classPrivateFieldIn",nZ)});var nX={};function n0(t){return function(n){return function(r){return r.reduce(function(n,r){return t.alt(n,function(){return r})},n)}}}let n1=Object.freeze(Object.defineProperty({__proto__:null,altAll:n0},Symbol.toStringTag,{value:"Module"})),n2=Object.freeze(Object.defineProperty({__proto__:null,altAll:function(t){return n0(t)(t.zero())}},Symbol.toStringTag,{value:"Module"}));var n3=function(t){return function(){return{meet:function(n,r){return function(i){return t.meet(n(i),r(i))}},join:function(n,r){return function(i){return t.join(n(i),r(i))}},zero:function(){return t.zero},one:function(){return t.one},implies:function(n,r){return function(i){return t.implies(n(i),r(i))}},not:function(n){return function(r){return t.not(n(r))}}}}},n4=function(t){return function(){return{concat:function(n,r){return function(i){return t.concat(n(i),r(i))}}}}},n5=function(t){var n=n4(t);return function(){return{concat:n().concat,empty:function(){return t.empty}}}},n6=function(t){return{add:function(n,r){return function(i){return t.add(n(i),r(i))}},zero:function(){return t.zero},mul:function(n,r){return function(i){return t.mul(n(i),r(i))}},one:function(){return t.one}}},n9=function(t){var n=n6(t);return{add:n.add,mul:n.mul,one:n.one,zero:n.zero,sub:function(n,r){return function(i){return t.sub(n(i),r(i))}}}},n8=function(t){return function(n){return n(t)}};function n7(t){return t}function re(t){return function(){return t}}var rt=re(!0),rn=re(!1),rr=re(null),ri=re(void 0);function ro(t,n,r,i,o,a,u,s,l){switch(arguments.length){case 1:return t;case 2:return function(){return n(t.apply(this,arguments))};case 3:return function(){return r(n(t.apply(this,arguments)))};case 4:return function(){return i(r(n(t.apply(this,arguments))))};case 5:return function(){return o(i(r(n(t.apply(this,arguments)))))};case 6:return function(){return a(o(i(r(n(t.apply(this,arguments))))))};case 7:return function(){return u(a(o(i(r(n(t.apply(this,arguments)))))))};case 8:return function(){return s(u(a(o(i(r(n(t.apply(this,arguments))))))))};case 9:return function(){return l(s(u(a(o(i(r(n(t.apply(this,arguments)))))))))}}}function ra(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t}function ru(t){return t+1}function rs(t){return t-1}function rl(t){throw Error("Called `absurd` function which should be uncallable")}function rc(t,n,r,i,o,a,u,s,l){switch(arguments.length){case 1:return t;case 2:return n(t);case 3:return r(n(t));case 4:return i(r(n(t)));case 5:return o(i(r(n(t))));case 6:return a(o(i(r(n(t)))));case 7:return u(a(o(i(r(n(t))))));case 8:return s(u(a(o(i(r(n(t)))))));case 9:return l(s(u(a(o(i(r(n(t))))))));default:for(var c=arguments[0],d=1;d<arguments.length;d++)c=arguments[d](c);return c}}var rd=function(t,n){return n},rf=function(){return{concat:function(t,n){return ro(t,n)},empty:n7}};let rp=Object.freeze(Object.defineProperty({__proto__:null,SK:rd,absurd:rl,apply:n8,constFalse:rn,constNull:rr,constTrue:rt,constUndefined:ri,constVoid:ri,constant:re,decrement:rs,flip:function(t){return function(n,r){return t(r,n)}},flow:ro,getBooleanAlgebra:n3,getEndomorphismMonoid:rf,getMonoid:n5,getRing:n9,getSemigroup:n4,getSemiring:n6,hole:rl,identity:n7,increment:ru,not:function(t){return function(n){return!t(n)}},pipe:rc,tuple:ra,tupled:function(t){return function(n){return t.apply(void 0,n)}},unsafeCoerce:n7,untupled:function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(n)}}},Symbol.toStringTag,{value:"Module"}));var rh=globalThis&&globalThis.__spreadArray||function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))},rm=function(t){return"None"===t._tag},rg=function(t){return"Some"===t._tag},ry={_tag:"None"},rv=function(t){return{_tag:"Some",value:t}},rb=function(t){return"Left"===t._tag},rx=function(t){return"Right"===t._tag},r_=function(t){return{_tag:"Left",left:t}},rS=function(t){return{_tag:"Right",right:t}},rT=function(t){return[t]},rw=function(t){return t.length>0},rO=function(t){return t[0]},rk=function(t){return t.slice(1)},rC=[],rI={},rM=Object.prototype.hasOwnProperty,rR=function(t){return rh([t[0]],t.slice(1),!0)};function rE(t,n){return function(r){return function(i){return t.ap(t.map(i,function(t){return function(r){return n.ap(t,r)}}),r)}}}function rj(t){return function(n){return function(r){return t.ap(t.map(r,function(t){return function(){return t}}),n)}}}function rA(t){return function(n){return function(r){return t.ap(t.map(r,function(){return function(t){return t}}),n)}}}function rN(t){return function(n,r){return function(i){return t.ap(t.map(i,function(t){return function(r){var i;return Object.assign({},t,((i={})[n]=r,i))}}),r)}}}function rP(t){return function(n){return{concat:function(r,i){return t.ap(t.map(r,function(t){return function(r){return n.concat(t,r)}}),i)}}}}function rL(t,n,r){return function(i){for(var o=Array(r.length+1),a=0;a<r.length;a++)o[a]=r[a];return o[r.length]=i,0===n?t.apply(null,o):rL(t,n-1,o)}}var rD={1:function(t){return[t]},2:function(t){return function(n){return[t,n]}},3:function(t){return function(n){return function(r){return[t,n,r]}}},4:function(t){return function(n){return function(r){return function(i){return[t,n,r,i]}}}},5:function(t){return function(n){return function(r){return function(i){return function(o){return[t,n,r,i,o]}}}}}};function rF(t){return rM.call(rD,t)||(rD[t]=rL(ra,t-1,[])),rD[t]}function rW(t){var n=t.length;switch(n){case 1:return function(n){var r;return(r={})[t[0]]=n,r};case 2:return function(n){return function(r){var i;return(i={})[t[0]]=n,i[t[1]]=r,i}};case 3:return function(n){return function(r){return function(i){var o;return(o={})[t[0]]=n,o[t[1]]=r,o[t[2]]=i,o}}};case 4:return function(n){return function(r){return function(i){return function(o){var a;return(a={})[t[0]]=n,a[t[1]]=r,a[t[2]]=i,a[t[3]]=o,a}}}};case 5:return function(n){return function(r){return function(i){return function(o){return function(a){var u;return(u={})[t[0]]=n,u[t[1]]=r,u[t[2]]=i,u[t[3]]=o,u[t[4]]=a,u}}}}};default:return rL(function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];for(var o={},a=0;a<n;a++)o[t[a]]=r[a];return o},n-1,[])}}let rU=Object.freeze(Object.defineProperty({__proto__:null,ap:rE,apFirst:rj,apS:rN,apSecond:rA,getApplySemigroup:rP,sequenceS:function(t){return function(n){for(var r=Object.keys(n),i=r.length,o=rW(r),a=t.map(n[r[0]],o),u=1;u<i;u++)a=t.ap(a,n[r[u]]);return a}},sequenceT:function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i=n.length,o=rF(i),a=t.map(n[0],o),u=1;u<i;u++)a=t.ap(a,n[u]);return a}}},Symbol.toStringTag,{value:"Module"}));function rz(t,n){return function(r){return function(i){return t.map(i,function(t){return n.map(t,r)})}}}function rB(t){return function(n){return function(r){return t.map(r,function(t){return t(n)})}}}function rV(t){return function(n){return function(r){return t.map(r,function(t){var r;return(r={})[n]=t,r})}}}function r$(t,n){var r=rz(t,n);return{map:function(t,n){return rc(t,r(n))}}}let rq=Object.freeze(Object.defineProperty({__proto__:null,bindTo:rV,flap:rB,getFunctorComposition:r$,map:rz},Symbol.toStringTag,{value:"Module"}));function rK(t){var n=rP(t);return function(r){return{concat:n(r).concat,empty:t.of(r.empty)}}}function rH(t,n){var r=r$(t,n).map,i=rE(t,n);return{map:r,of:function(r){return t.of(n.of(r))},ap:function(t,n){return rc(t,i(n))}}}let rG=Object.freeze(Object.defineProperty({__proto__:null,getApplicativeComposition:rH,getApplicativeMonoid:rK},Symbol.toStringTag,{value:"Module"}));function rZ(t){return function(n){return function(r){return t.chain(r,function(r){return t.map(n(r),function(){return r})})}}}function rY(t){return function(n,r){return function(i){return t.chain(i,function(i){return t.map(r(i),function(t){var r;return Object.assign({},i,((r={})[n]=t,r))})})}}}let rJ=Object.freeze(Object.defineProperty({__proto__:null,bind:rY,chainFirst:rZ},Symbol.toStringTag,{value:"Module"}));function rQ(t){return function(n){return function(r){return t.fromEither(rm(r)?r_(n()):rS(r.value))}}}function rX(t){return function(n,r){return function(i){return t.fromEither(n(i)?rS(i):r_(r(i)))}}}function r0(t){var n=rQ(t);return function(t){var r=n(t);return function(t){return ro(t,r)}}}function r1(t,n){var r=r0(t);return function(t){var i=r(t);return function(t){return function(r){return n.chain(r,i(t))}}}}function r2(t){return function(n){return ro(n,t.fromEither)}}function r3(t,n){var r=r2(t);return function(t){return function(i){return n.chain(i,r(t))}}}function r4(t,n){return ro(r2(t),rZ(n))}function r5(t,n){return function(r,i){return function(o){return n.chain(o,function(n){return t.fromEither(r(n)?rS(n):r_(i(n)))})}}}let r6=Object.freeze(Object.defineProperty({__proto__:null,chainEitherK:r3,chainFirstEitherK:r4,chainOptionK:r1,filterOrElse:r5,fromEitherK:r2,fromOption:rQ,fromOptionK:r0,fromPredicate:rX},Symbol.toStringTag,{value:"Module"}));var r9=function(t){return{equals:function(n,r){return n===r||t(n,r)}}},r8=function(t){return r9(function(n,r){for(var i in t)if(!t[i].equals(n[i],r[i]))return!1;return!0})},r7=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return r9(function(n,r){return t.every(function(t,i){return t.equals(n[i],r[i])})})},ie=function(t){return function(n){return r9(function(r,i){return n.equals(t(r),t(i))})}},it={equals:function(t,n){return t===n}},ir={equals:function(){return!0}},ii=function(){return{concat:function(t,n){return r9(function(r,i){return t.equals(r,i)&&n.equals(r,i)})}}},io=function(){return{concat:ii().concat,empty:ir}},ia={URI:"Eq",contramap:function(t,n){return rc(t,ie(n))}},iu=it.equals;let is=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:ia,URI:"Eq",contramap:ie,eq:ia,eqBoolean:it,eqDate:{equals:function(t,n){return t.valueOf()===n.valueOf()}},eqNumber:it,eqStrict:it,eqString:it,fromEquals:r9,getMonoid:io,getSemigroup:ii,getStructEq:r8,getTupleEq:r7,strictEqual:iu,struct:r8,tuple:r7},Symbol.toStringTag,{value:"Module"}));var il=function(t){return function(n,r){return n===r||0===t(n,r)}},ic=function(t){return{equals:il(t),compare:function(n,r){return n===r?0:t(n,r)}}},id=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return ic(function(n,r){for(var i=0;i<t.length-1;i++){var o=t[i].compare(n[i],r[i]);if(0!==o)return o}return t[i].compare(n[i],r[i])})},ip=function(t){return ic(function(n,r){return t.compare(r,n)})},ih=function(t){return function(n){return ic(function(r,i){return n.compare(t(r),t(i))})}},im=function(){return{concat:function(t,n){return ic(function(r,i){var o=t.compare(r,i);return 0!==o?o:n.compare(r,i)})}}},ig=function(){return{concat:im().concat,empty:ic(function(){return 0})}},iy={URI:"Ord",contramap:function(t,n){return rc(t,ih(n))}},iv={equals:rt,compare:re(0)},ib=function(t){return function(n){return function(r){return r===n||0===t.compare(r,n)}}},ix=function(t){return function(n,r){return -1===t.compare(n,r)}},i_=function(t){return function(n,r){return 1===t.compare(n,r)}},iS=function(t){return function(n,r){return 1!==t.compare(n,r)}},iT=function(t){return function(n,r){return -1!==t.compare(n,r)}},iw=function(t){return function(n,r){return n===r||1>t.compare(n,r)?n:r}},iO=function(t){return function(n,r){return n===r||t.compare(n,r)>-1?n:r}},ik=function(t){var n=iw(t),r=iO(t);return function(t,i){return function(o){return r(n(o,i),t)}}},iC=function(t){var n=ix(t),r=i_(t);return function(t,i){return function(o){return!(n(o,t)||r(o,i))}}},iI={equals:it.equals,compare:function(t,n){return t<n?-1:t>n?1:0}},iM=rc(iI,ih(function(t){return t.valueOf()}));let iR=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:iy,URI:"Ord",between:iC,clamp:ik,contramap:ih,equals:ib,equalsDefault:il,fromCompare:ic,geq:iT,getDualOrd:ip,getMonoid:ig,getSemigroup:im,getTupleOrd:id,gt:i_,leq:iS,lt:ix,max:iO,min:iw,ord:iy,ordBoolean:iI,ordDate:iM,ordNumber:iI,ordString:iI,reverse:ip,trivial:iv,tuple:id},Symbol.toStringTag,{value:"Module"}));var iE=function(t){return{concat:function(n,r){return t.concat(r,n)}}},ij=function(t){return function(n){return{concat:function(r,i){return t(r)?n.concat(r,i):i}}}},iA=function(t){return function(n){return{concat:function(r,i){return t(i)?n.concat(r,i):r}}}},iN=function(t){return function(n){return{concat:function(r,i){return n.concat(t(r),t(i))}}}},iP=function(t){return function(n){return function(r){return r.reduce(function(n,r){return t.concat(n,r)},n)}}};let iL=Object.freeze(Object.defineProperty({__proto__:null,concatAll:iP,endo:iN,filterFirst:ij,filterSecond:iA,reverse:iE},Symbol.toStringTag,{value:"Module"}));var iD=function(t){return{concat:iw(t)}},iF=function(t){return{concat:iO(t)}},iW=function(t){return{concat:function(){return t}}},iU=function(t){return{concat:function(n,r){var i={};for(var o in t)rM.call(t,o)&&(i[o]=t[o].concat(n[o],r[o]));return i}}},iz=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return{concat:function(n,r){return t.map(function(t,i){return t.concat(n[i],r[i])})}}},iB=function(t){return function(n){return{concat:function(r,i){return n.concat(r,n.concat(t,i))}}}},iV=function(){return{concat:n7}},i$=function(){return{concat:function(t,n){return n}}},iq=iW(void 0),iK=function(){return{concat:function(t,n){return Object.assign({},t,n)}}},iH={concat:function(t,n){return t&&n}},iG={concat:function(t,n){return t||n}},iZ={concat:function(t,n){return t+n}},iY={concat:function(t,n){return t+n}},iJ={concat:function(t,n){return t*n}};let iQ=Object.freeze(Object.defineProperty({__proto__:null,concatAll:iP,constant:iW,first:iV,fold:function(t){var n=iP(t);return function(t,r){return void 0===r?n(t):n(t)(r)}},getDualSemigroup:iE,getFirstSemigroup:iV,getFunctionSemigroup:n4,getIntercalateSemigroup:iB,getJoinSemigroup:iF,getLastSemigroup:i$,getMeetSemigroup:iD,getObjectSemigroup:iK,getStructSemigroup:iU,getTupleSemigroup:iz,intercalate:iB,last:i$,max:iF,min:iD,reverse:iE,semigroupAll:iH,semigroupAny:iG,semigroupProduct:iJ,semigroupString:iZ,semigroupSum:iY,semigroupVoid:iq,struct:iU,tuple:iz},Symbol.toStringTag,{value:"Module"}));var iX=globalThis&&globalThis.__spreadArray||function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))},i0=function(t,n){return t<0||t>=n.length},i1=function(t){return function(n){return iX([t],n,!0)}},i2=function(t){return function(n){return iX(iX([],n,!0),[t],!1)}},i3=function(t,n,r){if(rw(r)){var i=rR(r);return i.splice(t,0,n),i}return[n]},i4=function(t,n,r){if(r[t]===n)return r;var i=rR(r);return i[t]=n,i},i5=function(t){return function(n){if(1===n.length)return n;for(var r=[au(n)],i=as(n),o=function(n){r.every(function(r){return!t.equals(r,n)})&&r.push(n)},a=0;a<i.length;a++)o(i[a]);return r}},i6=function(t){if(rw(t)){var n=ig();return of(t.reduce(n.concat,n.empty))}return n7},i9=function(t){var n=i5(t);return function(t){return function(r){return n(rc(r,ou(t)))}}},i8=function(t){return function(n){var r=n.length,i=Math.round(t)%r;if(i0(Math.abs(i),n)||0===i)return n;if(!(i<0))return i8(i-r)(n);var o=o_(-i)(n),a=o[0];return rc(o[1],ou(a))}},i7=function(t){return rw(t)?rv(t):ry},oe=function(t){return function(n){for(var r=Math.max(0,Math.floor(n)),i=[t(0)],o=1;o<r;o++)i.push(t(o));return i}},ot=function(t){return oe(function(){return t})},on=function(t,n){return t<=n?oe(function(n){return t+n})(n-t+1):[t]},or=function(t){return[au(t),as(t)]},oi=function(t){return[ac(t),al(t)]},oo=function(t){return i7(t.slice())};function oa(t){return function(n){return n.concat(t)}}function ou(t,n){return n?t.concat(n):function(n){return n.concat(t)}}var ol=function(t){return 1===t.length?t:iX([al(t)],t.slice(0,-1).reverse(),!0)};function oc(t){return function(n){var r=n.length;if(0===r)return rC;for(var i=[],o=n[0],a=[o],u=1;u<r;u++){var s=n[u];t.equals(s,o)?a.push(s):(i.push(a),a=[o=s])}return i.push(a),i}}var od=function(t){return function(n){for(var r={},i=0;i<n.length;i++){var o=n[i],a=t(o);rM.call(r,a)?r[a].push(o):r[a]=[o]}return r}},of=function(t){return function(n){return 1===n.length?n:n.slice().sort(t.compare)}},op=function(t,n){return oh(t,function(){return n})},oh=function(t,n){return function(r){return i0(t,r)?ry:rv(i4(t,n(r[t]),r))}},om=function(t,n,r){for(var i=[r(t[0],n[0])],o=Math.min(t.length,n.length),a=1;a<o;a++)i[a]=r(t[a],n[a]);return i},og=function(t){for(var n=[t[0][0]],r=[t[0][1]],i=1;i<t.length;i++)n[i]=t[i][0],r[i]=t[i][1];return[n,r]},oy=function(t){return function(n){for(var r=[t,n[0]],i=1;i<n.length;i++)r.push(t,n[i]);return r}},ov=function(t){return function(n){var r=as(n);return rw(r)?rc(r,oy(t),i1(au(n))):n}},ob=function(t){return function(n){for(var r=rR(t(0,au(n))),i=1;i<n.length;i++)r.push.apply(r,t(i,n[i]));return r}},ox=function(t){return function(n){for(var r=t(n),i=r[0],o=r[1],a=[i],u=o;rw(u);){var s=t(u),l=s[0],c=s[1];a.push(l),u=c}return a}},o_=function(t){return function(n){var r=Math.max(1,t);return r>=n.length?[n,rC]:[rc(n.slice(1,r),i1(au(n))),n.slice(r)]}},oS=function(t){return ox(o_(t))},oT=function(t,n){return rc(t,o$(n))},ow=function(t,n){return rc(t,oq(n))},oO=function(t,n){return rc(t,oW(n))},ok=function(t,n){return rc(t,oU(n))},oC=function(t,n){return rc(t,oz(n))},oI=function(t,n,r){return rc(t,oK(n,r))},oM=function(t){var n=oH(t);return function(t,r){return rc(t,n(r))}},oR=function(t,n,r){return rc(t,oG(n,r))},oE=function(t){var n=oQ(t);return function(t,r){return rc(t,n(r))}},oj=function(t,n){return rc(t,oF(n))},oA=function(t,n,r){return rc(t,oZ(n,r))},oN=function(t){var n=oY(t);return function(t,r){return rc(t,n(r))}},oP=function(t,n,r){return rc(t,oJ(n,r))},oL=function(t){var n=o0(t);return function(t,r){return rc(t,n(r))}},oD=function(t){return function(n){return rc(n,oa(t()))}},oF=oD,oW=function(t){return oU(function(n){return rc(t,o$(n))})},oU=function(t){return ob(function(n,r){return t(r)})},oz=function(t){return function(n){for(var r=as(n),i=[t(n)];rw(r);)i.push(t(r)),r=as(r);return i}},oB=oz(n7),oV=oU(n7),o$=function(t){return oq(function(n,r){return t(r)})},oq=function(t){return function(n){for(var r=[t(0,au(n))],i=1;i<n.length;i++)r.push(t(i,n[i]));return r}},oK=function(t,n){return oZ(t,function(t,r,i){return n(r,i)})},oH=function(t){return function(n){return function(r){return r.slice(1).reduce(function(r,i){return t.concat(r,n(i))},n(r[0]))}}},oG=function(t,n){return oJ(t,function(t,r,i){return n(r,i)})},oZ=function(t,n){return function(r){return r.reduce(function(t,r,i){return n(i,t,r)},t)}},oY=function(t){return function(n){return function(r){return r.slice(1).reduce(function(r,i,o){return t.concat(r,n(o+1,i))},n(0,r[0]))}}},oJ=function(t,n){return function(r){return r.reduceRight(function(t,r,i){return n(i,r,t)},t)}},oQ=function(t){var n=o0(t);return function(t){return n(function(n,r){return t(r)})}},oX=function(t){return o0(t)(rd)},o0=function(t){return function(n){return function(r){for(var i=t.map(n(0,au(r)),rT),o=1;o<r.length;o++)i=t.ap(t.map(i,function(t){return function(n){return rc(t,i2(n))}}),n(o,r[o]));return i}}},o1="ReadonlyNonEmptyArray",o2=function(t){return{show:function(n){return"[".concat(n.map(t.show).join(", "),"]")}}},o3=function(){return{concat:ou}},o4=function(t){return r9(function(n,r){return n.length===r.length&&n.every(function(n,i){return t.equals(n,r[i])})})},o5=function(t){var n=i9(t);return{concat:function(t,r){return n(r)(t)}}},o6={URI:o1,map:oT},o9=rB(o6),o8={URI:o1,map:oT,ap:oO},o7=rj(o8),ae=rA(o8),at={URI:o1,map:oT,ap:oO,chain:ok},an=rZ(at),ar=rT(rI),ai=rV(o6),ao=rY(at),aa=rN(o8),au=rO,as=rk,al=function(t){return t[t.length-1]},ac=function(t){return t.slice(0,-1)},ad=function(t){var n=iD(t);return function(t){return t.reduce(n.concat)}},af=function(t){var n=iF(t);return function(t){return t.reduce(n.concat)}},ap=function(t){return function(n){return n.reduce(t.concat)}},ah=function(t){return function(n){return t(au(n),as(n))}},am=function(t){return function(n){return t(ac(n),al(n))}},ag=function(t){return function(n){return iX([t(au(n))],as(n),!0)}},ay=function(t){return ag(function(){return t})},av=function(t){return function(n){return rc(ac(n),i2(t(al(n))))}},ab=function(t){return av(function(){return t})},ax=function(t){var n=ap(t);return function(t){return ro(ov(t),n)}},a_=function(t){return function(n){return i7(n.filter(function(n,r){return t(r,n)}))}};function aS(t,n){return void 0===n?i1(t):rc(n,i1(t))}var aT=function(t,n){return rc(t,ou([n]))},aw=function(t,n){return function(r){return t<0||t>r.length?ry:rv(i3(t,n,r))}};let aO=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:o1,map:oT,alt:oj},Applicative:{URI:o1,map:oT,ap:oO,of:rT},Apply:o8,Chain:at,Comonad:{URI:o1,map:oT,extend:oC,extract:rO},Do:ar,Foldable:{URI:o1,reduce:oI,foldMap:oM,reduceRight:oR},FoldableWithIndex:{URI:o1,reduce:oI,foldMap:oM,reduceRight:oR,reduceWithIndex:oA,foldMapWithIndex:oN,reduceRightWithIndex:oP},Functor:o6,FunctorWithIndex:{URI:o1,map:oT,mapWithIndex:ow},Monad:{URI:o1,map:oT,ap:oO,of:rT,chain:ok},Pointed:{URI:o1,of:rT},Traversable:{URI:o1,map:oT,reduce:oI,foldMap:oM,reduceRight:oR,traverse:oE,sequence:oX},TraversableWithIndex:{URI:o1,map:oT,mapWithIndex:ow,reduce:oI,foldMap:oM,reduceRight:oR,traverse:oE,sequence:oX,reduceWithIndex:oA,foldMapWithIndex:oN,reduceRightWithIndex:oP,traverseWithIndex:oL},URI:o1,alt:oF,altW:oD,ap:oW,apFirst:o7,apS:aa,apSecond:ae,append:i2,appendW:i2,bind:ao,bindTo:ai,chain:oU,chainFirst:an,chainWithIndex:ob,chop:ox,chunksOf:oS,concat:ou,concatAll:ap,concatW:oa,cons:aS,duplicate:oB,empty:rC,extend:oz,extract:rO,filter:function(t){return a_(function(n,r){return t(r)})},filterWithIndex:a_,flap:o9,flatten:oV,fold:ap,foldMap:oH,foldMapWithIndex:oY,fromArray:oo,fromReadonlyArray:i7,getEq:o4,getSemigroup:o3,getShow:o2,getUnionSemigroup:o5,group:oc,groupBy:od,groupSort:function(t){var n=of(t),r=oc(t);return function(t){return rw(t)?r(n(t)):rC}},head:au,init:ac,insertAt:aw,intercalate:ax,intersperse:ov,isNonEmpty:rw,isOutOfBound:i0,last:al,makeBy:oe,map:o$,mapWithIndex:oq,matchLeft:ah,matchRight:am,max:af,min:ad,modifyAt:oh,modifyHead:ag,modifyLast:av,of:rT,prepend:i1,prependAll:oy,prependToAll:oy,prependW:i1,range:on,readonlyNonEmptyArray:{URI:o1,of:rT,map:oT,mapWithIndex:ow,ap:oO,chain:ok,extend:oC,extract:rO,reduce:oI,foldMap:oM,reduceRight:oR,traverse:oE,sequence:oX,reduceWithIndex:oA,foldMapWithIndex:oN,reduceRightWithIndex:oP,traverseWithIndex:oL,alt:oj},reduce:oK,reduceRight:oG,reduceRightWithIndex:oJ,reduceWithIndex:oZ,replicate:ot,reverse:ol,rotate:i8,sequence:oX,snoc:aT,sort:of,sortBy:i6,splitAt:o_,tail:as,traverse:oQ,traverseWithIndex:o0,unappend:oi,uncons:or,union:i9,uniq:i5,unprepend:or,unsafeInsertAt:i3,unsafeUpdateAt:i4,unsnoc:oi,unzip:og,updateAt:op,updateHead:ay,updateLast:ab,zip:function t(n,r){return void 0===r?function(r){return t(r,n)}:om(n,r,function(t,n){return[t,n]})},zipWith:om},Symbol.toStringTag,{value:"Module"}));var ak=globalThis&&globalThis.__spreadArray||function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))},aC=function(t){return t.length>0},aI=function(t,n){return t<0||t>=n.length},aM=function(t){return function(n){return ak([t],n,!0)}},aR=function(t){return function(n){return ak(ak([],n,!0),[t],!1)}},aE=function(t,n,r){if(aC(r)){var i=aD(r);return i.splice(t,0,n),i}return[n]},aj=function(t,n,r){var i=aD(r);return i[t]=n,i},aA=function(t){return function(n){if(1===n.length)return aX(n);for(var r=[uV(n)],i=u$(n),o=function(n){r.every(function(r){return!t.equals(r,n)})&&r.push(n)},a=0;a<i.length;a++)o(i[a]);return r}},aN=function(t){if(aC(t)){var n=ig();return aZ(t.reduce(n.concat,n.empty))}return aX},aP=function(t){var n=aA(t);return function(t){return function(r){return n(rc(r,aq(t)))}}},aL=function(t){return function(n){var r=n.length,i=Math.round(t)%r;if(aI(Math.abs(i),n)||0===i)return aX(n);if(!(i<0))return aL(i-r)(n);var o=a9(-i)(n),a=o[0];return rc(o[1],aq(a))}},aD=rR,aF=function(t){return aC(t)?rv(t):ry},aW=function(t){return function(n){for(var r=Math.max(0,Math.floor(n)),i=[t(0)],o=1;o<r;o++)i.push(t(o));return i}},aU=function(t){return aW(function(){return t})},az=function(t,n){return t<=n?aW(function(n){return t+n})(n-t+1):[t]},aB=function(t){return[uV(t),u$(t)]},aV=function(t){return[uK(t),uq(t)]};function a$(t){return function(n){return n.concat(t)}}function aq(t,n){return n?t.concat(n):function(n){return n.concat(t)}}var aK=function(t){return ak([uq(t)],t.slice(0,-1).reverse(),!0)};function aH(t){return function(n){var r=n.length;if(0===r)return[];for(var i=[],o=n[0],a=[o],u=1;u<r;u++){var s=n[u];t.equals(s,o)?a.push(s):(i.push(a),a=[o=s])}return i.push(a),i}}var aG=function(t){return function(n){for(var r={},i=0;i<n.length;i++){var o=n[i],a=t(o);rM.call(r,a)?r[a].push(o):r[a]=[o]}return r}},aZ=function(t){return function(n){return n.slice().sort(t.compare)}},aY=function(t,n){return function(r){return t<0||t>r.length?ry:rv(aE(t,n,r))}},aJ=function(t,n){return aQ(t,function(){return n})},aQ=function(t,n){return function(r){return aI(t,r)?ry:rv(aj(t,n(r[t]),r))}},aX=aD,a0=function(t){return[t]},a1=function(t,n,r){for(var i=[r(t[0],n[0])],o=Math.min(t.length,n.length),a=1;a<o;a++)i[a]=r(t[a],n[a]);return i},a2=function(t){for(var n=[t[0][0]],r=[t[0][1]],i=1;i<t.length;i++)n[i]=t[i][0],r[i]=t[i][1];return[n,r]},a3=function(t){return function(n){for(var r=[t,n[0]],i=1;i<n.length;i++)r.push(t,n[i]);return r}},a4=function(t){return function(n){var r=u$(n);return aC(r)?rc(r,a3(t),aM(uV(n))):aX(n)}},a5=function(t){return function(n){for(var r=aD(t(0,uV(n))),i=1;i<n.length;i++)r.push.apply(r,t(i,n[i]));return r}},a6=function(t){return function(n){for(var r=t(n),i=r[0],o=r[1],a=[i],u=o;aC(u);){var s=t(u),l=s[0],c=s[1];a.push(l),u=c}return a}},a9=function(t){return function(n){var r=Math.max(1,t);return r>=n.length?[aX(n),[]]:[rc(n.slice(1,r),aM(uV(n))),n.slice(r)]}},a8=function(t){return a6(a9(t))},a7=function(t,n){return rc(t,ux(n))},ue=function(t,n){return rc(t,u_(n))},ut=function(t,n){return rc(t,um(n))},un=function(t,n){return rc(t,ug(n))},ur=function(t,n){return rc(t,uy(n))},ui=function(t,n,r){return rc(t,uS(n,r))},uo=function(t){var n=oH(t);return function(t,r){return rc(t,n(r))}},ua=function(t,n,r){return rc(t,uw(n,r))},uu=function(t){var n=uk(t);return function(t,r){return rc(t,n(r))}},us=function(t,n){return rc(t,uh(n))},ul=function(t,n,r){return rc(t,uT(n,r))},uc=function(t){var n=oY(t);return function(t,r){return rc(t,n(r))}},ud=function(t,n,r){return rc(t,uO(n,r))},uf=function(t){var n=uI(t);return function(t,r){return rc(t,n(r))}},up=function(t){return function(n){return rc(n,a$(t()))}},uh=up,um=function(t){return ug(function(n){return rc(t,ux(n))})},ug=function(t){return a5(function(n,r){return t(r)})},uy=function(t){return function(n){for(var r=u$(n),i=[t(n)];aC(r);)i.push(t(r)),r=u$(r);return i}},uv=uy(n7),ub=ug(n7),ux=function(t){return u_(function(n,r){return t(r)})},u_=function(t){return function(n){for(var r=[t(0,uV(n))],i=1;i<n.length;i++)r.push(t(i,n[i]));return r}},uS=oK,uT=oZ,uw=oG,uO=oJ,uk=function(t){var n=uI(t);return function(t){return n(function(n,r){return t(r)})}},uC=function(t){return uI(t)(function(t,n){return n})},uI=function(t){return function(n){return function(r){for(var i=t.map(n(0,uV(r)),a0),o=1;o<r.length;o++)i=t.ap(t.map(i,function(t){return function(n){return rc(t,aR(n))}}),n(o,r[o]));return i}}},uM="NonEmptyArray",uR=function(){return{concat:aq}},uE=function(t){var n=aP(t);return{concat:function(t,r){return n(r)(t)}}},uj={URI:uM,map:a7},uA=rB(uj),uN={URI:uM,map:a7,ap:ut},uP=rj(uN),uL=rA(uN),uD={URI:uM,map:a7,ap:ut,chain:un},uF=rZ(uD),uW=a0(rI),uU=rV(uj),uz=rY(uD),uB=rN(uN),uV=au,u$=function(t){return t.slice(1)},uq=al,uK=function(t){return t.slice(0,-1)},uH=function(t){return function(n){return n.reduce(t.concat)}},uG=function(t){return function(n){return t(uV(n),u$(n))}},uZ=function(t){return function(n){return t(uK(n),uq(n))}},uY=function(t){return function(n){return ak([t(uV(n))],u$(n),!0)}},uJ=function(t){return uY(function(){return t})},uQ=function(t){return function(n){return rc(uK(n),aR(t(uq(n))))}},uX=function(t){return uQ(function(){return t})},u0=function(t){return function(n){return aF(n.filter(function(n,r){return t(r,n)}))}};function u1(t,n){return void 0===n?aM(t):rc(n,aM(t))}var u2=function(t,n){return rc(t,aR(n))};let u3=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:uM,map:a7,alt:us},Applicative:{URI:uM,map:a7,ap:ut,of:a0},Apply:uN,Chain:uD,Comonad:{URI:uM,map:a7,extend:ur,extract:au},Do:uW,Foldable:{URI:uM,reduce:ui,foldMap:uo,reduceRight:ua},FoldableWithIndex:{URI:uM,reduce:ui,foldMap:uo,reduceRight:ua,reduceWithIndex:ul,foldMapWithIndex:uc,reduceRightWithIndex:ud},Functor:uj,FunctorWithIndex:{URI:uM,map:a7,mapWithIndex:ue},Monad:{URI:uM,map:a7,ap:ut,of:a0,chain:un},Pointed:{URI:uM,of:a0},Traversable:{URI:uM,map:a7,reduce:ui,foldMap:uo,reduceRight:ua,traverse:uu,sequence:uC},TraversableWithIndex:{URI:uM,map:a7,mapWithIndex:ue,reduce:ui,foldMap:uo,reduceRight:ua,traverse:uu,sequence:uC,reduceWithIndex:ul,foldMapWithIndex:uc,reduceRightWithIndex:ud,traverseWithIndex:uf},URI:uM,alt:uh,altW:up,ap:um,apFirst:uP,apS:uB,apSecond:uL,append:aR,appendW:aR,bind:uz,bindTo:uU,chain:ug,chainFirst:uF,chainWithIndex:a5,chop:a6,chunksOf:a8,concat:aq,concatAll:uH,concatW:a$,cons:u1,copy:aX,duplicate:uv,extend:uy,extract:au,filter:function(t){return u0(function(n,r){return t(r)})},filterWithIndex:u0,flap:uA,flatten:ub,fold:ap,foldMap:oH,foldMapWithIndex:oY,fromArray:aF,fromReadonlyNonEmptyArray:aD,getEq:o4,getSemigroup:uR,getShow:o2,getUnionSemigroup:uE,group:aH,groupBy:aG,groupSort:function(t){var n=aZ(t),r=aH(t);return function(t){return aC(t)?r(n(t)):[]}},head:uV,init:uK,insertAt:aY,intercalate:ax,intersperse:a4,isNonEmpty:aC,isOutOfBound:aI,last:uq,makeBy:aW,map:ux,mapWithIndex:u_,matchLeft:uG,matchRight:uZ,max:af,min:ad,modifyAt:aQ,modifyHead:uY,modifyLast:uQ,nonEmptyArray:{URI:uM,of:a0,map:a7,mapWithIndex:ue,ap:ut,chain:un,extend:ur,extract:au,reduce:ui,foldMap:uo,reduceRight:ua,traverse:uu,sequence:uC,reduceWithIndex:ul,foldMapWithIndex:uc,reduceRightWithIndex:ud,traverseWithIndex:uf,alt:us},of:a0,prepend:aM,prependAll:a3,prependToAll:a3,prependW:aM,range:az,reduce:uS,reduceRight:uw,reduceRightWithIndex:uO,reduceWithIndex:uT,replicate:aU,reverse:aK,rotate:aL,sequence:uC,snoc:u2,sort:aZ,sortBy:aN,splitAt:a9,tail:u$,traverse:uk,traverseWithIndex:uI,unappend:aV,uncons:aB,union:aP,uniq:aA,unprepend:aB,unsafeInsertAt:aE,unsafeUpdateAt:aj,unsnoc:aV,unzip:a2,updateAt:aJ,updateHead:uJ,updateLast:uX,zip:function t(n,r){return void 0===r?function(r){return t(r,n)}:a1(n,r,function(t,n){return[t,n]})},zipWith:a1},Symbol.toStringTag,{value:"Module"}));var u4=function(t){return"number"==typeof t},u5={equals:function(t,n){return t===n}},u6={equals:u5.equals,compare:function(t,n){return t<n?-1:t>n?1:0}},u9={equals:u5.equals,compare:u6.compare,top:1/0,bottom:-1/0},u8={concat:function(t,n){return t-n}},u7={concat:function(t,n){return t+n}},se={concat:function(t,n){return t*n}},st={concat:u7.concat,empty:0},sn={concat:se.concat,empty:1},sr={add:u7.concat,zero:0,mul:se.concat,one:1,sub:u8.concat,degree:function(t){return 1},div:function(t,n){return t/n},mod:function(t,n){return t%n}};let si=Object.freeze(Object.defineProperty({__proto__:null,Bounded:u9,Eq:u5,Field:sr,MagmaSub:u8,MonoidProduct:sn,MonoidSum:st,Ord:u6,SemigroupProduct:se,SemigroupSum:u7,Show:{show:function(t){return JSON.stringify(t)}},isNumber:u4},Symbol.toStringTag,{value:"Module"}));var so=function(t,n){return{left:t,right:n}},sa=function(t,n){return rc(t,sl(n))},su=function(t,n,r){return rc(t,sc(n,r))},ss=function(t){return function(n){return so(sh(n),t(sm(n)))}},sl=function(t){return function(n){return so(t(sh(n)),sm(n))}},sc=function(t,n){return function(r){return so(t(sh(r)),n(sm(r)))}},sd="Separated",sf={URI:sd,map:function(t,n){return rc(t,ss(n))}},sp=rB(sf),sh=function(t){return t.left},sm=function(t){return t.right};let sg=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:{URI:sd,mapLeft:sa,bimap:su},Functor:sf,URI:sd,bimap:sc,flap:sp,left:sh,map:ss,mapLeft:sl,right:sm,separated:so},Symbol.toStringTag,{value:"Module"}));function sy(t,n){return function(r){var i=t.traverse(r);return function(t,o){return r.map(i(t,o),n.separate)}}}function sv(t,n){return function(r){var i=t.traverse(r);return function(t,o){return r.map(i(t,o),n.compact)}}}function sb(t){return function(n){var r=t.wither(n);return function(t){return function(i){return r(i,function(r){return n.map(t(r),function(t){return t?rv(r):ry})})}}}}let sx=Object.freeze(Object.defineProperty({__proto__:null,filterE:sb,wiltDefault:sy,witherDefault:sv},Symbol.toStringTag,{value:"Module"}));function s_(t,n){return function(r){return r?n.of(void 0):t.zero()}}let sS=Object.freeze(Object.defineProperty({__proto__:null,guard:s_},Symbol.toStringTag,{value:"Module"}));var sT=globalThis&&globalThis.__spreadArray||function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))},sw=function(t){return 0===t.length},sO=function(t,n){return t<=0?cF:oe(n)(t)},sk=function(t,n){return sO(t,function(){return n})},sC=function(t){return rm(t)?cF:[t.value]},sI=function(t){return rb(t)?cF:[t.right]},sM=function(t,n){return function(r){return rw(r)?n(r):t()}},sR=function(t,n){return function(r){return rw(r)?n(au(r),as(r)):t()}},sE=function(t,n){return function(r){return rw(r)?n(ac(r),al(r)):t()}},sj=function(t){return function(n){if(sw(n))return cF;for(var r=[],i=0;i<n.length;i++)r.push.apply(r,t(i,n[i]));return r}},sA=function(t,n){return function(r){var i=r.length,o=Array(i+1);o[0]=t;for(var a=0;a<i;a++)o[a+1]=n(o[a],r[a]);return o}},sN=function(t,n){return function(r){var i=r.length,o=Array(i+1);o[i]=t;for(var a=i-1;a>=0;a--)o[a]=n(r[a],o[a+1]);return o}},sP=function(t){return t.length};function sL(t,n){return void 0===n?function(n){return sL(t,n)}:i0(t,n)?ry:rv(n[t])}var sD=function(t){return rw(t)?rv(au(t)):ry},sF=function(t){return rw(t)?rv(al(t)):ry},sW=function(t){return rw(t)?rv(as(t)):ry},sU=function(t){return rw(t)?rv(ac(t)):ry},sz=function(t){return function(n){return i0(t,n)?n:0===t?cF:n.slice(0,t)}},sB=function(t){return function(n){return i0(t,n)?n:0===t?cF:n.slice(-t)}},sV=function(t,n){for(var r=t.length,i=0;i<r&&n(t[i]);i++);return i},s$=function(t){return function(n){return t<=0||sw(n)?n:t>=n.length?cF:n.slice(t,n.length)}},sq=function(t){return function(n){return t<=0||sw(n)?n:t>=n.length?cF:n.slice(0,n.length-t)}},sK=function(t){return function(n){for(var r=0;r<n.length;r++)if(t(n[r]))return rv(r);return ry}};function sH(t){return function(n){for(var r=0;r<n.length;r++)if(t(n[r]))return rv(n[r]);return ry}}var sG=function(t){return function(n){for(var r=0;r<n.length;r++){var i=t(n[r]);if(rg(i))return i}return ry}};function sZ(t){return function(n){for(var r=n.length-1;r>=0;r--)if(t(n[r]))return rv(n[r]);return ry}}var sY=function(t){return function(n){for(var r=n.length-1;r>=0;r--){var i=t(n[r]);if(rg(i))return i}return ry}},sJ=function(t){return function(n){for(var r=n.length-1;r>=0;r--)if(t(n[r]))return rv(r);return ry}},sQ=function(t,n){return function(r){return t<0||t>r.length?ry:rv(i3(t,n,r))}},sX=function(t,n){return s1(t,function(){return n})},s0=function(t){return function(n){return i0(t,n)?ry:rv(cP(t,n))}},s1=function(t,n){return function(r){return i0(t,r)?ry:rv(cN(t,n(r[t]),r))}},s2=function(t){return t.length<=1?t:t.slice().reverse()},s3=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r];"Right"===i._tag&&n.push(i.right)}return n},s4=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r];"Left"===i._tag&&n.push(i.left)}return n},s5=function(t){return function(n){return n.length<=1?n:n.slice().sort(t.compare)}},s6=function(t,n,r){for(var i=[],o=Math.min(t.length,n.length),a=0;a<o;a++)i[a]=r(t[a],n[a]);return i},s9=function(t){for(var n=[],r=[],i=0;i<t.length;i++)n[i]=t[i][0],r[i]=t[i][1];return[n,r]},s8=function(t){var n=oy(t);return function(t){return rw(t)?n(t):t}},s7=function(t){var n=ov(t);return function(t){return rw(t)?n(t):t}},le=function(t){var n=i8(t);return function(t){return rw(t)?n(t):t}};function lt(t){return function(n,r){if(void 0===r){var i,o=lt(t);return function(t){return o(n,t)}}for(var a=0;a<r.length;a++)if(i=r[a],t.equals(i,n))return!0;return!1}}var ln=function(t){var n=i5(t);return function(t){return rw(t)?n(t):t}},lr=function(t){var n=i6(t);return function(t){return rw(t)?n(t):t}},li=function(t){var n=ox(t);return function(t){return rw(t)?n(t):cF}},lo=function(t){return function(n){return t>=1&&rw(n)?o_(t)(n):sw(n)?[n,cF]:[cF,n]}},la=function(t){var n=oS(t);return function(t){return rw(t)?n(t):cF}},lu=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return sC(t.apply(void 0,n))}},ls=function(t){return function(n){return sw(n)?t:sw(t)?n:n.concat(t)}};function ll(t){var n=i9(t);return function(r,i){if(void 0===i){var o=ll(t);return function(t){return o(t,r)}}return rw(r)&&rw(i)?n(i)(r):rw(r)?r:i}}function lc(t){var n=lt(t);return function(r,i){if(void 0===i){var o=lc(t);return function(t){return o(t,r)}}return r.filter(function(t){return n(t,i)})}}function ld(t){var n=lt(t);return function(r,i){if(void 0===i){var o=ld(t);return function(t){return o(t,r)}}return r.filter(function(t){return!n(t,i)})}}var lf=function(t,n){return rc(t,lB(n))},lp=function(t,n){return rc(t,lV(n))},lh=function(t,n){return rc(t,lW(n))},lm=function(t,n){return rc(t,lU(n))},lg=function(t,n){return rc(t,lq(n))},ly=function(t,n){return rc(t,lH(n))},lv=function(t,n){return rc(t,lZ(n))},lb=function(t,n){return rc(t,lJ(n))},lx=function(t,n){return rc(t,lY(n))},l_=function(t,n){return rc(t,lQ(n))},lS=function(t,n){return rc(t,lF(n))},lT=function(t,n,r){return rc(t,l3(n,r))},lw=function(t){var n=l4(t);return function(t,r){return rc(t,n(r))}},lO=function(t,n,r){return rc(t,l6(n,r))},lk=function(t,n,r){return rc(t,l5(n,r))},lC=function(t){var n=l2(t);return function(t,r){return rc(t,n(r))}},lI=function(t,n,r){return rc(t,l9(n,r))},lM=function(t,n){return rc(t,lK(n))},lR=function(t,n){return rc(t,lX(n))},lE=function(t,n){return rc(t,l0(n))},lj=function(t){var n=l8(t);return function(t,r){return rc(t,n(r))}},lA=function(t){var n=ce(t);return function(t,r){return rc(t,n(r))}},lN=function(t,n){return rc(t,ck(n))},lP=function(t,n){return rc(t,cC(n))},lL=function(){return cF},lD=function(t){return function(n){return n.concat(t())}},lF=lD,lW=function(t){return lU(function(n){return rc(t,lB(n))})},lU=function(t){return function(n){return rc(n,sj(function(n,r){return t(r)}))}},lz=lU(n7),lB=function(t){return function(n){return n.map(function(n){return t(n)})}},lV=function(t){return function(n){return n.map(function(n,r){return t(r,n)})}},l$=function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=t[i];"Left"===o._tag?n.push(o.left):r.push(o.right)}return so(n,r)},lq=function(t){return function(n){return n.filter(t)}},lK=function(t){return function(n){for(var r=[],i=0;i<n.length;i++){var o=t(i,n[i]);rg(o)&&r.push(o.value)}return r}},lH=function(t){return lK(function(n,r){return t(r)})},lG=lH(n7),lZ=function(t){return lY(function(n,r){return t(r)})},lY=function(t){return function(n){for(var r=[],i=[],o=0;o<n.length;o++){var a=n[o];t(o,a)?i.push(a):r.push(a)}return so(r,i)}},lJ=function(t){return lQ(function(n,r){return t(r)})},lQ=function(t){return function(n){for(var r=[],i=[],o=0;o<n.length;o++){var a=t(o,n[o]);"Left"===a._tag?r.push(a.left):i.push(a.right)}return so(r,i)}},lX=function(t){return function(n){return n.filter(function(n,r){return t(r,n)})}},l0=function(t){return function(n){return n.map(function(r,i){return t(n.slice(i))})}},l1=l0(n7),l2=function(t){return function(n){return function(r){return r.reduce(function(r,i,o){return t.concat(r,n(o,i))},t.empty)}}},l3=function(t,n){return l5(t,function(t,r,i){return n(r,i)})},l4=function(t){var n=l2(t);return function(t){return n(function(n,r){return t(r)})}},l5=function(t,n){return function(r){for(var i=r.length,o=t,a=0;a<i;a++)o=n(a,o,r[a]);return o}},l6=function(t,n){return l9(t,function(t,r,i){return n(r,i)})},l9=function(t,n){return function(r){return r.reduceRight(function(t,r,i){return n(i,r,t)},t)}},l8=function(t){var n=ce(t);return function(t){return n(function(n,r){return t(r)})}},l7=function(t){return function(n){return lT(n,t.of(lL()),function(n,r){return t.ap(t.map(n,function(t){return function(n){return rc(t,i2(n))}}),r)})}},ce=function(t){return function(n){return l5(t.of(lL()),function(r,i,o){return t.ap(t.map(i,function(t){return function(n){return rc(t,i2(n))}}),n(r,o))})}},ct=function(t){var n=cI(t);return function(t){return function(r){return n(r,t)}}},cn=function(t){var n=cM(t);return function(t){return function(r){return n(r,t)}}},cr=function(t,n){for(var r=[],i=t;;){var o=n(i);if(rg(o)){var a=o.value,u=a[0],s=a[1];r.push(u),i=s}else break}return r},ci="ReadonlyArray",co=function(t){return{show:function(n){return"[".concat(n.map(t.show).join(", "),"]")}}},ca=function(){return{concat:function(t,n){return sw(t)?n:sw(n)?t:t.concat(n)}}},cu=function(){return{concat:ca().concat,empty:cF}},cs=function(t){return r9(function(n,r){return n.length===r.length&&n.every(function(n,i){return t.equals(n,r[i])})})},cl=function(t){return ic(function(n,r){for(var i=n.length,o=r.length,a=Math.min(i,o),u=0;u<a;u++){var s=t.compare(n[u],r[u]);if(0!==s)return s}return u6.compare(i,o)})},cc=function(t){var n=ll(t);return{concat:function(t,r){return n(r)(t)}}},cd=function(t){return{concat:cc(t).concat,empty:cF}},cf=function(t){var n=lc(t);return{concat:function(t,r){return n(r)(t)}}},cp=function(t){var n=ld(t);return{concat:function(t,r){return n(r)(t)}}},ch={URI:ci,map:lf},cm=rB(ch),cg={URI:ci,of:rT},cy={URI:ci,map:lf,ap:lh},cv=rj(cy),cb=rA(cy),cx={URI:ci,map:lf,ap:lh,chain:lm},c_=rZ(cx),cS={URI:ci,zero:lL},cT=s_(cS,cg),cw={URI:ci,compact:lG,separate:l$},cO={URI:ci,map:lf,reduce:lT,foldMap:lw,reduceRight:lO,traverse:lj,sequence:l7},ck=function(t){return function(n){for(var r=sT([],t(n),!0),i=[];r.length>0;){var o=r.shift();rb(o)?r.unshift.apply(r,t(o.left)):i.push(o.right)}return i}},cC=function(t){return function(n){var r=t(n),i=[],o=[];function a(n){rb(n)?t(n.left).forEach(function(t){return i.push(t)}):o.push(n.right)}for(var u=0;u<r.length;u++)a(r[u]);for(;i.length>0;)a(i.shift());return o}},cI=sv(cO,cw),cM=sy(cO,cw),cR={URI:ci,map:lf,compact:lG,separate:l$,filter:lg,filterMap:ly,partition:lv,partitionMap:lb,reduce:lT,foldMap:lw,reduceRight:lO,traverse:lj,sequence:l7,wither:cI,wilt:cM},cE=sb(cR),cj={URI:ci,fromEither:sI},cA=r2(cj),cN=function(t,n,r){return rw(r)?i4(t,n,r):r},cP=function(t,n){var r=n.slice();return r.splice(t,1),r},cL=function(t){return t.slice()},cD=function(t){return sw(t)?cF:t.slice()},cF=rC;function cW(t){return function(n){return n.every(t)}}var cU=function(t){return function(n){return n.some(t)}},cz=function(t){var n=ax(t);return function(r){return sM(function(){return t.empty},n(r))}},cB=rT(rI),cV=rV(ch),c$=rY(cx),cq=rN(cy);let cK=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:ci,map:lf,alt:lS},Alternative:{URI:ci,map:lf,ap:lh,of:rT,alt:lS,zero:lL},Applicative:{URI:ci,map:lf,ap:lh,of:rT},Apply:cy,Chain:cx,ChainRecBreadthFirst:{URI:ci,map:lf,ap:lh,chain:lm,chainRec:lP},ChainRecDepthFirst:{URI:ci,map:lf,ap:lh,chain:lm,chainRec:lN},Compactable:cw,Do:cB,Extend:{URI:ci,map:lf,extend:lE},Filterable:{URI:ci,map:lf,compact:lG,separate:l$,filter:lg,filterMap:ly,partition:lv,partitionMap:lb},FilterableWithIndex:{URI:ci,map:lf,mapWithIndex:lp,compact:lG,separate:l$,filter:lg,filterMap:ly,partition:lv,partitionMap:lb,partitionMapWithIndex:l_,partitionWithIndex:lx,filterMapWithIndex:lM,filterWithIndex:lR},Foldable:{URI:ci,reduce:lT,foldMap:lw,reduceRight:lO},FoldableWithIndex:{URI:ci,reduce:lT,foldMap:lw,reduceRight:lO,reduceWithIndex:lk,foldMapWithIndex:lC,reduceRightWithIndex:lI},FromEither:cj,Functor:ch,FunctorWithIndex:{URI:ci,map:lf,mapWithIndex:lp},Monad:{URI:ci,map:lf,ap:lh,of:rT,chain:lm},Pointed:cg,Traversable:cO,TraversableWithIndex:{URI:ci,map:lf,mapWithIndex:lp,reduce:lT,foldMap:lw,reduceRight:lO,reduceWithIndex:lk,foldMapWithIndex:lC,reduceRightWithIndex:lI,traverse:lj,sequence:l7,traverseWithIndex:lA},URI:ci,Unfoldable:{URI:ci,unfold:cr},Witherable:cR,Zero:cS,_chainRecBreadthFirst:lP,_chainRecDepthFirst:lN,alt:lF,altW:lD,ap:lW,apFirst:cv,apS:cq,apSecond:cb,append:i2,appendW:i2,bind:c$,bindTo:cV,chain:lU,chainFirst:c_,chainRecBreadthFirst:cC,chainRecDepthFirst:ck,chainWithIndex:sj,chop:li,chunksOf:la,compact:lG,comprehension:function(t,n,r){void 0===r&&(r=function(){return!0});var i=function(t,o){return rw(o)?rc(au(o),lU(function(n){return i(rc(t,i2(n)),as(o))})):r.apply(void 0,t)?[n.apply(void 0,t)]:cF};return i(cF,t)},concat:ls,concatW:ls,cons:aS,deleteAt:s0,difference:ld,dropLeft:s$,dropLeftWhile:function(t){return function(n){var r=sV(n,t);return 0===r?n:r===n.length?cF:n.slice(r)}},dropRight:sq,duplicate:l1,elem:lt,empty:cF,every:cW,exists:cU,extend:l0,filter:lq,filterE:cE,filterMap:lH,filterMapWithIndex:lK,filterWithIndex:lX,findFirst:sH,findFirstMap:sG,findIndex:sK,findLast:sZ,findLastIndex:sJ,findLastMap:sY,flap:cm,flatten:lz,foldLeft:sR,foldMap:l4,foldMapWithIndex:l2,foldRight:sE,fromArray:cD,fromEither:sI,fromEitherK:cA,fromOption:sC,fromOptionK:lu,fromPredicate:function(t){return function(n){return t(n)?[n]:cF}},getDifferenceMagma:cp,getEq:cs,getIntersectionSemigroup:cf,getMonoid:cu,getOrd:cl,getSemigroup:ca,getShow:co,getUnionMonoid:cd,getUnionSemigroup:cc,guard:cT,head:sD,init:sU,insertAt:sQ,intercalate:cz,intersection:lc,intersperse:s7,isEmpty:sw,isNonEmpty:rw,isOutOfBound:i0,last:sF,lefts:s4,lookup:sL,makeBy:sO,map:lB,mapWithIndex:lV,match:sM,matchLeft:sR,matchLeftW:sR,matchRight:sE,matchRightW:sE,matchW:sM,modifyAt:s1,of:rT,partition:lZ,partitionMap:lJ,partitionMapWithIndex:lQ,partitionWithIndex:lY,prepend:i1,prependAll:s8,prependToAll:s8,prependW:i1,range:on,readonlyArray:{URI:ci,compact:lG,separate:l$,map:lf,ap:lh,of:rT,chain:lm,filter:lg,filterMap:ly,partition:lv,partitionMap:lb,mapWithIndex:lp,partitionMapWithIndex:l_,partitionWithIndex:lx,filterMapWithIndex:lM,filterWithIndex:lR,alt:lS,zero:lL,unfold:cr,reduce:lT,foldMap:lw,reduceRight:lO,traverse:lj,sequence:l7,reduceWithIndex:lk,foldMapWithIndex:lC,reduceRightWithIndex:lI,traverseWithIndex:lA,extend:lE,wither:cI,wilt:cM},reduce:l3,reduceRight:l6,reduceRightWithIndex:l9,reduceWithIndex:l5,replicate:sk,reverse:s2,rights:s3,rotate:le,scanLeft:sA,scanRight:sN,separate:l$,sequence:l7,size:sP,snoc:aT,some:cU,sort:s5,sortBy:lr,spanLeft:function(t){return function(n){var r,i=lo(sV(n,t))(n);return{init:i[0],rest:i[1]}}},splitAt:lo,tail:sW,takeLeft:sz,takeLeftWhile:function(t){return function(n){for(var r=[],i=0;i<n.length;i++){var o=n[i];if(!t(o))break;r.push(o)}var a=r.length;return a===n.length?n:0===a?cF:r}},takeRight:sB,toArray:cL,traverse:l8,traverseWithIndex:ce,unfold:cr,union:ll,uniq:ln,unsafeDeleteAt:cP,unsafeInsertAt:i3,unsafeUpdateAt:cN,unzip:s9,updateAt:sX,wilt:cn,wither:ct,zero:lL,zip:function t(n,r){return void 0===r?function(r){return t(r,n)}:s6(n,r,function(t,n){return[t,n]})},zipWith:s6},Symbol.toStringTag,{value:"Module"}));var cH=function(t){return 0===t.length},cG=function(t,n){return t<=0?[]:aW(n)(t)},cZ=function(t,n){return cG(t,function(){return n})},cY=function(t){return rm(t)?[]:[t.value]},cJ=function(t){return rb(t)?[]:[t.right]},cQ=function(t,n){return function(r){return aC(r)?n(r):t()}},cX=function(t,n){return function(r){return aC(r)?n(uV(r),u$(r)):t()}},c0=function(t,n){return function(r){return aC(r)?n(uK(r),uq(r)):t()}},c1=function(t){return function(n){for(var r=[],i=0;i<n.length;i++)r.push.apply(r,t(i,n[i]));return r}},c2=function(t,n){return function(r){var i=r.length,o=Array(i+1);o[0]=t;for(var a=0;a<i;a++)o[a+1]=n(o[a],r[a]);return o}},c3=function(t,n){return function(r){var i=r.length,o=Array(i+1);o[i]=t;for(var a=i-1;a>=0;a--)o[a]=n(r[a],o[a+1]);return o}},c4=function(t){return t.length},c5=function(t){return aC(t)?rv(u$(t)):ry},c6=function(t){return aC(t)?rv(uK(t)):ry},c9=function(t){return function(n){return aI(t,n)?di(n):n.slice(0,t)}},c8=function(t){return function(n){return aI(t,n)?di(n):0===t?[]:n.slice(-t)}},c7=function(t,n){for(var r=t.length,i=0;i<r&&n(t[i]);i++);return i},de=function(t){return function(n){return t<=0||cH(n)?di(n):t>=n.length?[]:n.slice(t,n.length)}},dt=function(t){return function(n){return t<=0||cH(n)?di(n):t>=n.length?[]:n.slice(0,n.length-t)}};function dn(t){return sH(t)}function dr(t){return sZ(t)}var di=function(t){return t.slice()},da=function(t,n){return function(r){return t<0||t>r.length?ry:rv(fq(t,n,r))}},du=function(t,n){return dl(t,function(){return n})},ds=function(t){return function(n){return aI(t,n)?ry:rv(fH(t,n))}},dl=function(t,n){return function(r){return aI(t,r)?ry:rv(fK(t,n(r[t]),r))}},dc=function(t){return cH(t)?[]:t.slice().reverse()},dd=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r];"Right"===i._tag&&n.push(i.right)}return n},df=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r];"Left"===i._tag&&n.push(i.left)}return n},dp=function(t){return function(n){return n.length<=1?di(n):n.slice().sort(t.compare)}},dh=function(t,n,r){for(var i=[],o=Math.min(t.length,n.length),a=0;a<o;a++)i[a]=r(t[a],n[a]);return i},dm=function(t){for(var n=[],r=[],i=0;i<t.length;i++)n[i]=t[i][0],r[i]=t[i][1];return[n,r]},dg=function(t){var n=a3(t);return function(t){return aC(t)?n(t):[]}},dy=function(t){var n=a4(t);return function(t){return aC(t)?n(t):di(t)}},dv=function(t){var n=aL(t);return function(t){return aC(t)?n(t):di(t)}},db=function(t){var n=aA(t);return function(t){return aC(t)?n(t):di(t)}},dx=function(t){var n=aN(t);return function(t){return aC(t)?n(t):di(t)}},d_=function(t){var n=a6(t);return function(t){return aC(t)?n(t):[]}},dS=function(t){return function(n){return t>=1&&aC(n)?a9(t)(n):cH(n)?[di(n),[]]:[[],di(n)]}},dT=function(t){var n=a8(t);return function(t){return aC(t)?n(t):[]}},dw=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return cY(t.apply(void 0,n))}},dO=function(t){return function(n){return cH(n)?di(t):cH(t)?di(n):n.concat(t)}};function dk(t){var n=aP(t);return function(r,i){if(void 0===i){var o=dk(t);return function(t){return o(t,r)}}return aC(r)&&aC(i)?n(i)(r):aC(r)?di(r):di(i)}}function dC(t){var n=lt(t);return function(r,i){if(void 0===i){var o=dC(t);return function(t){return o(t,r)}}return r.filter(function(t){return n(t,i)})}}function dI(t){var n=lt(t);return function(r,i){if(void 0===i){var o=dI(t);return function(t){return o(t,r)}}return r.filter(function(t){return!n(t,i)})}}var dM=function(t,n){return rc(t,dQ(n))},dR=function(t,n){return rc(t,d2(n))},dE=function(t,n){return rc(t,dX(n))},dj=function(t,n){return rc(t,d0(n))},dA=function(t,n){return rc(t,d9(n))},dN=function(t,n){return rc(t,d4(n))},dP=function(t,n){return rc(t,d8(n))},dL=function(t,n){return rc(t,fe(n))},dD=function(t,n){return rc(t,d7(n))},dF=function(t,n){return rc(t,ft(n))},dW=function(t,n){return rc(t,fr(n))},dU=function(t,n,r){return rc(t,fl(n,r))},dz=function(t){var n=fu(t);return function(t,r){return rc(t,n(r))}},dB=function(t,n,r){return rc(t,fd(n,r))},dV=function(t,n,r){return rc(t,fc(n,r))},d$=function(t){var n=fs(t);return function(t,r){return rc(t,n(r))}},dq=function(t,n,r){return rc(t,ff(n,r))},dK=function(t,n){return rc(t,d3(n))},dH=function(t,n){return rc(t,fi(n))},dG=function(t,n){return rc(t,fo(n))},dZ=function(t){var n=fp(t);return function(t,r){return rc(t,n(r))}},dY=function(t){var n=fm(t);return function(t,r){return rc(t,n(r))}},dJ=function(){return[]},dQ=function(t){return function(n){return n.map(function(n){return t(n)})}},dX=function(t){return d0(function(n){return rc(t,dQ(n))})},d0=function(t){return function(n){return rc(n,c1(function(n,r){return t(r)}))}},d1=d0(n7),d2=function(t){return function(n){return n.map(function(n,r){return t(r,n)})}},d3=function(t){return function(n){for(var r=[],i=0;i<n.length;i++){var o=t(i,n[i]);rg(o)&&r.push(o.value)}return r}},d4=function(t){return d3(function(n,r){return t(r)})},d5=d4(n7),d6=function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=t[i];"Left"===o._tag?n.push(o.left):r.push(o.right)}return so(n,r)},d9=function(t){return function(n){return n.filter(t)}},d8=function(t){return d7(function(n,r){return t(r)})},d7=function(t){return function(n){for(var r=[],i=[],o=0;o<n.length;o++){var a=n[o];t(o,a)?i.push(a):r.push(a)}return so(r,i)}},fe=function(t){return ft(function(n,r){return t(r)})},ft=function(t){return function(n){for(var r=[],i=[],o=0;o<n.length;o++){var a=t(o,n[o]);"Left"===a._tag?r.push(a.left):i.push(a.right)}return so(r,i)}},fn=function(t){return function(n){return n.concat(t())}},fr=fn,fi=function(t){return function(n){return n.filter(function(n,r){return t(r,n)})}},fo=function(t){return function(n){return n.map(function(r,i){return t(n.slice(i))})}},fa=fo(n7),fu=l4,fs=l2,fl=l3,fc=l5,fd=l6,ff=l9,fp=function(t){var n=fm(t);return function(t){return n(function(n,r){return t(r)})}},fh=function(t){return function(n){return dU(n,t.of(dJ()),function(n,r){return t.ap(t.map(n,function(t){return function(n){return rc(t,aR(n))}}),r)})}},fm=function(t){return function(n){return fc(t.of(dJ()),function(r,i,o){return t.ap(t.map(i,function(t){return function(n){return rc(t,aR(n))}}),n(r,o))})}},fg=function(t){var n=fW(t);return function(t){return function(r){return n(r,t)}}},fy=function(t){var n=fU(t);return function(t){return function(r){return n(r,t)}}},fv=function(t,n){for(var r=[],i=t;;){var o=n(i);if(rg(o)){var a=o.value,u=a[0],s=a[1];r.push(u),i=s}else break}return r},fb="Array",fx=function(){return{concat:function(t,n){return t.concat(n)}}},f_=function(){return{concat:fx().concat,empty:[]}},fS=function(t){var n=dk(t);return{concat:function(t,r){return n(r)(t)}}},fT=function(t){return{concat:fS(t).concat,empty:[]}},fw=function(t){var n=dC(t);return{concat:function(t,r){return n(r)(t)}}},fO=function(t){var n=dI(t);return{concat:function(t,r){return n(r)(t)}}},fk={URI:fb,map:dM},fC=rB(fk),fI={URI:fb,of:a0},fM={URI:fb,map:dM,ap:dE},fR=rj(fM),fE=rA(fM),fj={URI:fb,map:dM,ap:dE,chain:dj},fA=rZ(fj),fN={URI:fb,zero:dJ},fP=s_(fN,fI),fL={URI:fb,compact:d5,separate:d6},fD={URI:fb,reduce:dU,foldMap:dz,reduceRight:dB},fF={URI:fb,map:dM,reduce:dU,foldMap:dz,reduceRight:dB,traverse:dZ,sequence:fh},fW=sv(fF,fL),fU=sy(fF,fL),fz={URI:fb,map:dM,compact:d5,separate:d6,filter:dA,filterMap:dN,partition:dP,partitionMap:dL,reduce:dU,foldMap:dz,reduceRight:dB,traverse:dZ,sequence:fh,wither:fW,wilt:fU},fB=sb(fz),fV={URI:fb,fromEither:cJ},f$=r2(fV),fq=aE,fK=function(t,n,r){return aC(r)?aj(t,n,r):[]},fH=function(t,n){var r=n.slice();return r.splice(t,1),r},fG=function(t){return function(n){return n.some(t)}},fZ=a0(rI),fY=rV(fk),fJ=rY(fj),fQ=rN(fM);let fX=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:fb,map:dM,alt:dW},Alternative:{URI:fb,map:dM,ap:dE,of:a0,alt:dW,zero:dJ},Applicative:{URI:fb,map:dM,ap:dE,of:a0},Apply:fM,Chain:fj,ChainRecBreadthFirst:{URI:fb,map:dM,ap:dE,chain:dj,chainRec:lP},ChainRecDepthFirst:{URI:fb,map:dM,ap:dE,chain:dj,chainRec:lN},Compactable:fL,Do:fZ,Extend:{URI:fb,map:dM,extend:dG},Filterable:{URI:fb,map:dM,compact:d5,separate:d6,filter:dA,filterMap:dN,partition:dP,partitionMap:dL},FilterableWithIndex:{URI:fb,map:dM,mapWithIndex:dR,compact:d5,separate:d6,filter:dA,filterMap:dN,partition:dP,partitionMap:dL,partitionMapWithIndex:dF,partitionWithIndex:dD,filterMapWithIndex:dK,filterWithIndex:dH},Foldable:fD,FoldableWithIndex:{URI:fb,reduce:dU,foldMap:dz,reduceRight:dB,reduceWithIndex:dV,foldMapWithIndex:d$,reduceRightWithIndex:dq},FromEither:fV,Functor:fk,FunctorWithIndex:{URI:fb,map:dM,mapWithIndex:dR},Monad:{URI:fb,map:dM,ap:dE,of:a0,chain:dj},Pointed:fI,Traversable:fF,TraversableWithIndex:{URI:fb,map:dM,mapWithIndex:dR,reduce:dU,foldMap:dz,reduceRight:dB,reduceWithIndex:dV,foldMapWithIndex:d$,reduceRightWithIndex:dq,traverse:dZ,sequence:fh,traverseWithIndex:dY},URI:fb,Unfoldable:{URI:fb,unfold:fv},Witherable:fz,Zero:fN,alt:fr,altW:fn,ap:dX,apFirst:fR,apS:fQ,apSecond:fE,append:aR,appendW:aR,array:{URI:fb,compact:d5,separate:d6,map:dM,ap:dE,of:a0,chain:dj,filter:dA,filterMap:dN,partition:dP,partitionMap:dL,mapWithIndex:dR,partitionMapWithIndex:dF,partitionWithIndex:dD,filterMapWithIndex:dK,filterWithIndex:dH,alt:dW,zero:dJ,unfold:fv,reduce:dU,foldMap:dz,reduceRight:dB,traverse:dZ,sequence:fh,reduceWithIndex:dV,foldMapWithIndex:d$,reduceRightWithIndex:dq,traverseWithIndex:dY,extend:dG,wither:fW,wilt:fU},bind:fJ,bindTo:fY,chain:d0,chainFirst:fA,chainRecBreadthFirst:cC,chainRecDepthFirst:ck,chainWithIndex:c1,chop:d_,chunksOf:dT,compact:d5,comprehension:function(t,n,r){void 0===r&&(r=function(){return!0});var i=function(t,o){return aC(o)?rc(uV(o),d0(function(n){return i(rc(t,aR(n)),u$(o))})):r.apply(void 0,t)?[n.apply(void 0,t)]:[]};return i([],t)},concat:dO,concatW:dO,cons:u1,copy:di,deleteAt:ds,difference:dI,dropLeft:de,dropLeftWhile:function(t){return function(n){return n.slice(c7(n,t))}},dropRight:dt,duplicate:fa,elem:lt,empty:[],every:cW,exists:fG,extend:fo,filter:d9,filterE:fB,filterMap:d4,filterMapWithIndex:d3,filterWithIndex:fi,findFirst:dn,findFirstMap:sG,findIndex:sK,findLast:dr,findLastIndex:sJ,findLastMap:sY,flap:fC,flatten:d1,foldLeft:cX,foldMap:fu,foldMapWithIndex:fs,foldRight:c0,fromEither:cJ,fromEitherK:f$,fromOption:cY,fromOptionK:dw,fromPredicate:function(t){return function(n){return t(n)?[n]:[]}},getDifferenceMagma:fO,getEq:cs,getIntersectionSemigroup:fw,getMonoid:f_,getOrd:cl,getSemigroup:fx,getShow:co,getUnionMonoid:fT,getUnionSemigroup:fS,guard:fP,head:sD,init:c6,insertAt:da,intercalate:cz,intersection:dC,intersperse:dy,isEmpty:cH,isNonEmpty:aC,isOutOfBound:aI,last:sF,lefts:df,lookup:sL,makeBy:cG,map:dQ,mapWithIndex:d2,match:cQ,matchLeft:cX,matchLeftW:cX,matchRight:c0,matchRightW:c0,matchW:cQ,modifyAt:dl,of:a0,partition:d8,partitionMap:fe,partitionMapWithIndex:ft,partitionWithIndex:d7,prepend:aM,prependAll:dg,prependToAll:dg,prependW:aM,range:az,reduce:fl,reduceRight:fd,reduceRightWithIndex:ff,reduceWithIndex:fc,replicate:cZ,reverse:dc,rights:dd,rotate:dv,scanLeft:c2,scanRight:c3,separate:d6,sequence:fh,size:c4,snoc:u2,some:fG,sort:dp,sortBy:dx,spanLeft:function(t){return function(n){var r,i=dS(c7(n,t))(n);return{init:i[0],rest:i[1]}}},splitAt:dS,tail:c5,takeLeft:c9,takeLeftWhile:function(t){return function(n){for(var r=[],i=0;i<n.length;i++){var o=n[i];if(!t(o))break;r.push(o)}return r}},takeRight:c8,traverse:fp,traverseWithIndex:fm,unfold:fv,union:dk,uniq:db,unsafeDeleteAt:fH,unsafeInsertAt:fq,unsafeUpdateAt:fK,unzip:dm,updateAt:du,wilt:fy,wither:fg,zero:dJ,zip:function t(n,r){return void 0===r?function(r){return t(r,n)}:dh(n,r,function(t,n){return[t,n]})},zipWith:dh},Symbol.toStringTag,{value:"Module"})),f0=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var f1=function(t){return"boolean"==typeof t},f2=function(t,n){return function(r){return r?n():t()}},f3={equals:function(t,n){return t===n}},f4={concat:function(t,n){return t&&n}},f5={concat:function(t,n){return t||n}},f6={concat:f4.concat,empty:!0},f9={concat:f5.concat,empty:!1},f8={equals:f3.equals,compare:function(t,n){return t<n?-1:t>n?1:0}};let f7=Object.freeze(Object.defineProperty({__proto__:null,BooleanAlgebra:{meet:function(t,n){return t&&n},join:function(t,n){return t||n},zero:!1,one:!0,implies:function(t,n){return!t||n},not:function(t){return!t}},Eq:f3,MonoidAll:f6,MonoidAny:f9,Ord:f8,SemigroupAll:f4,SemigroupAny:f5,Show:{show:function(t){return JSON.stringify(t)}},fold:f2,foldW:f2,isBoolean:f1,match:f2,matchW:f2},Symbol.toStringTag,{value:"Module"}));var pe=function(t){return{meet:function(n,r){return t.join(n,r)},join:function(n,r){return t.meet(n,r)},zero:t.one,one:t.zero,implies:function(n,r){return t.join(t.not(n),r)},not:t.not}};let pt=Object.freeze(Object.defineProperty({__proto__:null,booleanAlgebraBoolean:{meet:function(t,n){return t&&n},join:function(t,n){return t||n},zero:!1,one:!0,implies:function(t,n){return!t||n},not:function(t){return!t}},booleanAlgebraVoid:{meet:function(){},join:function(){},zero:void 0,one:void 0,implies:function(){},not:function(){}},getDualBooleanAlgebra:pe,getFunctionBooleanAlgebra:n3,reverse:pe},Symbol.toStringTag,{value:"Module"}));var pn=function(t){return ik(t)(t.bottom,t.top)},pr=function(t){var n=ip(t);return{equals:n.equals,compare:n.compare,top:t.bottom,bottom:t.top}},pi={equals:iI.equals,compare:iI.compare,top:1/0,bottom:-1/0};let po=Object.freeze(Object.defineProperty({__proto__:null,boundedNumber:pi,clamp:pn,reverse:pr},Symbol.toStringTag,{value:"Module"}));function pa(t){return{meet:iw(t),join:iO(t)}}let pu=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxDistributiveLattice:pa},Symbol.toStringTag,{value:"Module"})),ps=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxBoundedDistributiveLattice:function(t){var n=pa(t);return function(t,r){return{join:n.join,meet:n.meet,zero:t,one:r}}}},Symbol.toStringTag,{value:"Module"})),pl=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),pc=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),pd=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),pf=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var pp=function(t,n){for(var r=n(t);"Left"===r._tag;)r=n(r.left);return r.right};let ph=Object.freeze(Object.defineProperty({__proto__:null,tailRec:pp},Symbol.toStringTag,{value:"Module"}));function pm(t,n){return function(r,i){return n.compose(t.right(i),t.left(r))}}function pg(t,n){var r=pm(t,n);return function(i,o){return n.compose(t.promap(n.id(),function(t){return"Left"===t._tag?t.left:t.right},n7),r(i,o))}}let py=Object.freeze(Object.defineProperty({__proto__:null,fanIn:pg,fanin:function(t){return pg(t,t)},split:pm,splitChoice:function(t){return pm(t,t)}},Symbol.toStringTag,{value:"Module"})),pv=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var pb=function(t,n){return rc(t,px(n))},px=function(t){return function(n){return ro(t,n)}},p_="Predicate",pS=function(){return{concat:function(t,n){return rc(t,pC(n))}}},pT=function(){return{concat:pS().concat,empty:rn}},pw=function(){return{concat:function(t,n){return rc(t,pI(n))}}},pO=function(){return{concat:pw().concat,empty:rt}},pk=function(t){return function(n){return!t(n)}},pC=function(t){return function(n){return function(r){return n(r)||t(r)}}},pI=function(t){return function(n){return function(r){return n(r)&&t(r)}}};let pM=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:{URI:p_,contramap:pb},URI:p_,and:pI,contramap:px,getMonoidAll:pO,getMonoidAny:pT,getSemigroupAll:pw,getSemigroupAny:pS,not:pk,or:pC},Symbol.toStringTag,{value:"Module"}));function pR(t){return function(n){return t(n)?rv(n):ry}}var pE=function(t){return"Right"===t._tag?ry:rv(t.left)},pj=function(t){return"Left"===t._tag?ry:rv(t.right)},pA=function(t,n){return rc(t,pJ(n))},pN=function(t,n){return rc(t,p0(n))},pP=function(t,n){return rc(t,p3(n))},pL=function(t,n,r){return rc(t,p5(n,r))},pD=function(t){var n=p6(t);return function(t,r){return rc(t,n(r))}},pF=function(t,n,r){return rc(t,p9(n,r))},pW=function(t){var n=hp(t);return function(t,r){return rc(t,n(r))}},pU=function(t,n){return rc(t,p7(n))},pz=function(t,n){return rc(t,hs(n))},pB=function(t,n){return rc(t,hl(n))},pV=function(t,n){return rc(t,hr(n))},p$=function(t,n){return rc(t,hc(n))},pq=function(t,n){return rc(t,hd(n))},pK="Option",pH=function(t){return{show:function(n){return hT(n)?"none":"some(".concat(t.show(n.value),")")}}},pG=function(t){return{equals:function(n,r){return n===r||(hT(n)?hT(r):!hT(r)&&t.equals(n.value,r.value))}}},pZ=function(t){return{equals:pG(t).equals,compare:function(n,r){return n===r?0:hS(n)?hS(r)?t.compare(n.value,r.value):1:-1}}},pY=function(t){return{concat:function(n,r){return hT(n)?r:hT(r)?n:rv(t.concat(n.value,r.value))},empty:ry}},pJ=function(t){return function(n){return hT(n)?ry:rv(t(n.value))}},pQ={URI:pK,map:pA},pX={URI:pK,of:rv},p0=function(t){return function(n){return hT(n)||hT(t)?ry:rv(n.value(t.value))}},p1={URI:pK,map:pA,ap:pN},p2={URI:pK,map:pA,ap:pN,of:rv},p3=function(t){return function(n){return hT(n)?ry:t(n.value)}},p4={URI:pK,map:pA,ap:pN,chain:pP},p5=function(t,n){return function(r){return hT(r)?t:n(t,r.value)}},p6=function(t){return function(n){return function(r){return hT(r)?t.empty:n(r.value)}}},p9=function(t,n){return function(r){return hT(r)?t:n(r.value,t)}},p8=function(t){return function(n){return hT(n)?t():n}},p7=p8,he=function(){return ry},ht={URI:pK,zero:he},hn=s_(ht,pX),hr=function(t){return function(n){return hT(n)?ry:rv(t(n))}},hi=p3(n7),ho=so(ry,ry),ha=function(t){return hT(t)?ho:so(pE(t.value),pj(t.value))},hu={URI:pK,compact:hi,separate:ha},hs=function(t){return function(n){return hT(n)?ry:t(n.value)?n:ry}},hl=function(t){return function(n){return hT(n)?ry:t(n.value)}},hc=function(t){return function(n){return so(pz(n,pk(t)),pz(n,t))}},hd=function(t){return ro(pJ(t),ha)},hf={URI:pK,map:pA,compact:hi,separate:ha,filter:pz,filterMap:pB,partition:p$,partitionMap:pq},hp=function(t){return function(n){return function(r){return hT(r)?t.of(ry):t.map(n(r.value),rv)}}},hh=function(t){return function(n){return hT(n)?t.of(ry):t.map(n.value,rv)}},hm={URI:pK,map:pA,reduce:pL,foldMap:pD,reduceRight:pF,traverse:pW,sequence:hh},hg=sv(hm,hu),hy=sy(hm,hu),hv=function(t){var n=hg(t);return function(t){return function(r){return n(r,t)}}},hb=function(t){var n=hy(t);return function(t){return function(r){return n(r,t)}}},hx=function(){return ry},h_={URI:pK,fromEither:pj},hS=rg,hT=function(t){return"None"===t._tag},hw=function(t,n){return function(r){return hT(r)?t():n(r.value)}},hO=function(t){return function(n){return hT(n)?t():n.value}},hk=rB(pQ),hC=rj(p1),hI=rA(p1),hM=rZ(p4),hR=hr(n7),hE=r2(h_),hj=r3(h_,p4),hA=r4(h_,p4),hN=function(t){return null==t?ry:rv(t)},hP=function(t){try{return rv(t())}catch{return ry}},hL=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return hP(function(){return t.apply(void 0,n)})}},hD=function(t){return ro(t,hN)},hF=function(t){return function(n){return hT(n)?ry:hN(t(n.value))}},hW=hw(rr,n7),hU=hw(ri,n7),hz=function(t){return function(n){return!hT(n)&&t(n.value)}},hB=rv(rI),hV=rV(pQ),h$=rY(p4),hq=rN(p1),hK=rv(rC),hH=function(t){return function(n){var r=t(0,rO(n));if(hT(r))return ry;for(var i=[r.value],o=1;o<n.length;o++){var a=t(o,n[o]);if(hT(a))return ry;i.push(a.value)}return rv(i)}},hG=function(t){var n=hH(t);return function(t){return rw(t)?n(t):hK}},hZ=function(t){return hG(function(n,r){return t(r)})},hY=hZ(n7),hJ={URI:pK,map:pA,of:rv,ap:pN,chain:pP,reduce:pL,foldMap:pD,reduceRight:pF,traverse:pW,sequence:hh,zero:he,alt:pU,extend:pV,compact:hi,separate:ha,filter:pz,filterMap:pB,partition:p$,partitionMap:pq,wither:hg,wilt:hy,throwError:hx},hQ=rP(p1),hX=rK(p2),h0=function(){return pY(iV())},h1=function(){return pY(i$())};let h2=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:pK,map:pA,alt:pU},Alternative:{URI:pK,map:pA,ap:pN,of:rv,alt:pU,zero:he},ApT:hK,Applicative:p2,Apply:p1,Chain:p4,Compactable:hu,Do:hB,Extend:{URI:pK,map:pA,extend:pV},Filterable:hf,Foldable:{URI:pK,reduce:pL,foldMap:pD,reduceRight:pF},FromEither:h_,Functor:pQ,Monad:{URI:pK,map:pA,ap:pN,of:rv,chain:pP},MonadThrow:{URI:pK,map:pA,ap:pN,of:rv,chain:pP,throwError:hx},Pointed:pX,Traversable:hm,URI:pK,Witherable:{URI:pK,map:pA,reduce:pL,foldMap:pD,reduceRight:pF,traverse:pW,sequence:hh,compact:hi,separate:ha,filter:pz,filterMap:pB,partition:p$,partitionMap:pq,wither:hg,wilt:hy},Zero:ht,alt:p7,altW:p8,ap:p0,apFirst:hC,apS:hq,apSecond:hI,bind:h$,bindTo:hV,chain:p3,chainEitherK:hj,chainFirst:hM,chainFirstEitherK:hA,chainNullableK:hF,compact:hi,duplicate:hR,elem:function t(n){return function(r,i){if(void 0===i){var o=t(n);return function(t){return o(r,t)}}return!hT(i)&&n.equals(r,i.value)}},exists:hz,extend:hr,filter:hs,filterMap:hl,flap:hk,flatten:hi,fold:hw,foldMap:p6,foldW:hw,fromEither:pj,fromEitherK:hE,fromNullable:hN,fromNullableK:hD,fromPredicate:pR,getApplyMonoid:hX,getApplySemigroup:hQ,getEq:pG,getFirstMonoid:h0,getLastMonoid:h1,getLeft:pE,getMonoid:pY,getOrElse:hO,getOrElseW:hO,getOrd:pZ,getRefinement:function(t){return function(n){return hS(t(n))}},getRight:pj,getShow:pH,guard:hn,isNone:hT,isSome:hS,map:pJ,mapNullable:hF,match:hw,matchW:hw,none:ry,of:rv,option:hJ,partition:hc,partitionMap:hd,reduce:p5,reduceRight:p9,separate:ha,sequence:hh,sequenceArray:hY,some:rv,throwError:hx,toNullable:hW,toUndefined:hU,traverse:hp,traverseArray:hZ,traverseArrayWithIndex:hG,traverseReadonlyArrayWithIndex:hG,traverseReadonlyNonEmptyArrayWithIndex:hH,tryCatch:hP,tryCatchK:hL,wilt:hb,wither:hv,zero:he},Symbol.toStringTag,{value:"Module"}));function h3(t,n){return function(r){return t.map(r,n.compact)}}function h4(t,n,r){var i=h3(t,n),o=rz(t,r);return function(t){return so(i(rc(t,o(pE))),i(rc(t,o(pj))))}}let h5=Object.freeze(Object.defineProperty({__proto__:null,compact:h3,getCompactableComposition:function(t,n){return{map:r$(t,n).map,compact:h3(t,n),separate:h4(t,n,n)}},separate:h4},Symbol.toStringTag,{value:"Module"}));var h6=function(t){return function(){return console.log(t)}},h9=function(t){return function(){return console.warn(t)}},h8=function(t){return function(){return console.error(t)}},h7=function(t){return function(){return console.info(t)}};let me=Object.freeze(Object.defineProperty({__proto__:null,error:h8,info:h7,log:h6,warn:h9},Symbol.toStringTag,{value:"Module"}));function mt(t){return{URI:md,_E:void 0,map:mi,ap:function(n,r){return n7(t.concat(n,r))}}}function mn(t){var n=mt(t);return{URI:md,_E:void 0,map:n.map,ap:n.ap,of:function(){return n7(t.empty)}}}var mr=function(t,n){return rc(t,mu())},mi=function(t,n){return rc(t,ms())},mo=function(t,n,r){return rc(t,ml(n))},ma=function(t,n){return rc(t,mc(n))},mu=function(){return n7},ms=function(){return n7},ml=function(t){return function(n){return n7(t(n))}},mc=function(t){return function(n){return n7(t(n))}},md="Const",mf={URI:md,map:mi},mp=rB(mf);let mh=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:{URI:md,bimap:mo,mapLeft:ma},Contravariant:{URI:md,contramap:mr},Functor:mf,URI:md,bimap:ml,const_:{URI:md,map:mi,contramap:mr,bimap:mo,mapLeft:ma},contramap:mu,flap:mp,getApplicative:mn,getApply:mt,getBooleanAlgebra:n7,getBounded:n7,getEq:n7,getHeytingAlgebra:n7,getMonoid:n7,getOrd:n7,getRing:n7,getSemigroup:n7,getSemiring:n7,getShow:function(t){return{show:function(n){return"make(".concat(t.show(n),")")}}},make:n7,map:ms,mapLeft:mc},Symbol.toStringTag,{value:"Module"})),mm=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var mg=rc(u6,ih(function(t){return t.valueOf()})),my=function(){return new Date},mv=function(){return new Date().getTime()};let mb=Object.freeze(Object.defineProperty({__proto__:null,Eq:{equals:function(t,n){return t.valueOf()===n.valueOf()}},Ord:mg,create:my,eqDate:{equals:function(t,n){return t.getDate()===n.getDate()}},eqMonth:{equals:function(t,n){return t.getMonth()===n.getMonth()}},eqYear:{equals:function(t,n){return t.getFullYear()===n.getFullYear()}},now:mv},Symbol.toStringTag,{value:"Module"}));var mx=function(t,n){return rc(t,mz(n))},m_=function(t,n){return rc(t,mq(n))},mS=function(t,n){return rc(t,mZ(n))},mT=function(t,n,r){return rc(t,mJ(n,r))},mw=function(t){return function(n,r){var i=mQ(t);return rc(n,i(r))}},mO=function(t,n,r){return rc(t,mX(n,r))},mk=function(t){var n=m0(t);return function(t,r){return rc(t,n(r))}},mC=function(t,n,r){return rc(t,m3(n,r))},mI=function(t,n){return rc(t,m4(n))},mM=function(t,n){return rc(t,m6(n))},mR=function(t,n){return rc(t,m9(n))},mE=function(t,n){return pp(n(t),function(t){return gt(t)?rS(r_(t.left)):gt(t.right)?r_(n(t.right.left)):rS(rS(t.right.right))})},mj="Either",mA=function(t,n){return{show:function(r){return gt(r)?"left(".concat(t.show(r.left),")"):"right(".concat(n.show(r.right),")")}}},mN=function(t,n){return{equals:function(r,i){return r===i||(gt(r)?gt(i)&&t.equals(r.left,i.left):gn(i)&&n.equals(r.right,i.right))}}},mP=function(t){return{concat:function(n,r){return gt(r)?n:gt(n)?r:rS(t.concat(n.right,r.right))}}},mL=function(t){var n=r_(t.empty);return{URI:mj,_E:void 0,compact:function(t){return gt(t)?t:"None"===t.right._tag?n:rS(t.right.value)},separate:function(t){return gt(t)?so(t,t):gt(t.right)?so(rS(t.right.left),n):so(n,rS(t.right.right))}}},mD=function(t){var n,r=r_(t.empty),i=mL(t),o=i.compact;return{URI:mj,_E:void 0,map:mx,compact:o,separate:i.separate,filter:function(t,n){return gt(t)||n(t.right)?t:r},filterMap:function(t,n){if(gt(t))return t;var i=n(t.right);return"None"===i._tag?r:rS(i.value)},partition:function(t,n){return gt(t)?so(t,t):n(t.right)?so(r,rS(t.right)):so(rS(t.right),r)},partitionMap:function(t,n){if(gt(t))return so(t,t);var i=n(t.right);return gt(i)?so(rS(i.left),r):so(r,rS(i.right))}}},mF=function(t){var n=mD(t),r=mL(t);return{URI:mj,_E:void 0,map:mx,compact:n.compact,separate:n.separate,filter:n.filter,filterMap:n.filterMap,partition:n.partition,partitionMap:n.partitionMap,traverse:mk,sequence:m1,reduce:mT,foldMap:mw,reduceRight:mO,wither:sv(m2,r),wilt:sy(m2,r)}},mW=function(t){return{URI:mj,_E:void 0,map:mx,ap:function(n,r){return gt(n)?gt(r)?r_(t.concat(n.left,r.left)):n:gt(r)?r:rS(n.right(r.right))},of:mV}},mU=function(t){return{URI:mj,_E:void 0,map:mx,alt:function(n,r){if(gn(n))return n;var i=r();return gt(i)?r_(t.concat(n.left,i.left)):i}}},mz=function(t){return function(n){return gt(n)?n:rS(t(n.right))}},mB={URI:mj,map:mx},mV=rS,m$=function(t){return function(n){return gt(n)?n:gt(t)?t:rS(n.right(t.right))}},mq=m$,mK={URI:mj,map:mx,ap:m_},mH={URI:mj,map:mx,ap:m_,of:mV},mG=function(t){return function(n){return gt(n)?n:t(n.right)}},mZ=mG,mY={URI:mj,map:mx,ap:m_,chain:mS},mJ=function(t,n){return function(r){return gt(r)?t:n(t,r.right)}},mQ=function(t){return function(n){return function(r){return gt(r)?t.empty:n(r.right)}}},mX=function(t,n){return function(r){return gt(r)?t:n(r.right,t)}},m0=function(t){return function(n){return function(r){return gt(r)?t.of(r_(r.left)):t.map(n(r.right),rS)}}},m1=function(t){return function(n){return gt(n)?t.of(r_(n.left)):t.map(n.right,rS)}},m2={URI:mj,map:mx,reduce:mT,foldMap:mw,reduceRight:mO,traverse:mk,sequence:m1},m3=function(t,n){return function(r){return gt(r)?r_(t(r.left)):rS(n(r.right))}},m4=function(t){return function(n){return gt(n)?r_(t(n.left)):n}},m5=function(t){return function(n){return gt(n)?t():n}},m6=m5,m9=function(t){return function(n){return gt(n)?n:rS(t(n))}},m8={URI:mj,fromEither:n7},m7=rX(m8),ge=rQ(m8),gt=rb,gn=rx,gr=function(t,n){return function(r){return gt(r)?t(r.left):n(r.right)}},gi=function(t){return function(n){return gt(n)?t(n.left):n.right}},go=rB(mB),ga=rj(mK),gu=rA(mK),gs=rZ(mY),gl=mG(n7),gc=m9(n7),gd=r0(m8),gf=r1(m8,mY),gp=r5(m8,mY),gh=function(t){return gt(t)?rS(t.left):r_(t.right)},gm=function(t){return function(n){return gt(n)?t(n.left):n}},gg=function(t){return function(n){return null==n?r_(t):rS(n)}},gy=function(t,n){try{return rS(t())}catch(r){return r_(n(r))}},gv=function(t,n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return gy(function(){return t.apply(void 0,r)},n)}},gb=function(t){var n=gg(t);return function(t){return ro(t,n)}},gx=function(t){var n=gb(t);return function(t){return mZ(n(t))}},g_=gr(n7,n7),gS=function(t){return function(n){return!gt(n)&&t(n.right)}},gT=mV(rI),gw=rV(mB),gO=rY(mY),gk=rN(mK),gC=mV(rC),gI=function(t){return function(n){var r=t(0,rO(n));if(gt(r))return r;for(var i=[r.right],o=1;o<n.length;o++){var a=t(o,n[o]);if(gt(a))return a;i.push(a.right)}return rS(i)}},gM=function(t){var n=gI(t);return function(t){return rw(t)?n(t):gC}},gR=function(t){return gM(function(n,r){return t(r)})},gE=gR(n7),gj=function(t,n){return gy(function(){var n=JSON.stringify(t);if("string"!=typeof n)throw Error("Converting unsupported structure to JSON");return n},n)},gA=rP(mK),gN=rK(mH),gP=function(t,n){return rP(mW(t))(n)},gL=function(t,n){return rK(mW(t))(n)};let gD=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:mj,map:mx,alt:mM},ApT:gC,Applicative:mH,Apply:mK,Bifunctor:{URI:mj,bimap:mC,mapLeft:mI},Chain:mY,ChainRec:{URI:mj,map:mx,ap:m_,chain:mS,chainRec:mE},Do:gT,Extend:{URI:mj,map:mx,extend:mR},Foldable:{URI:mj,reduce:mT,foldMap:mw,reduceRight:mO},FromEither:m8,Functor:mB,Monad:{URI:mj,map:mx,ap:m_,of:mV,chain:mS},MonadThrow:{URI:mj,map:mx,ap:m_,of:mV,chain:mS,throwError:r_},Pointed:{URI:mj,of:mV},Traversable:m2,URI:mj,alt:m6,altW:m5,ap:mq,apFirst:ga,apFirstW:ga,apS:gk,apSW:gk,apSecond:gu,apSecondW:gu,apW:m$,bimap:m3,bind:gO,bindTo:gw,bindW:gO,chain:mZ,chainFirst:gs,chainFirstW:gs,chainNullableK:gx,chainOptionK:gf,chainW:mG,duplicate:gc,either:{URI:mj,map:mx,of:mV,ap:m_,chain:mS,reduce:mT,foldMap:mw,reduceRight:mO,traverse:mk,sequence:m1,bimap:mC,mapLeft:mI,alt:mM,extend:mR,chainRec:mE,throwError:r_},elem:function t(n){return function(r,i){if(void 0===i){var o=t(n);return function(t){return o(r,t)}}return!gt(i)&&n.equals(r,i.right)}},exists:gS,extend:m9,filterOrElse:gp,filterOrElseW:gp,flap:go,flatten:gl,flattenW:gl,fold:gr,foldMap:mQ,foldW:gr,fromNullable:gg,fromNullableK:gb,fromOption:ge,fromOptionK:gd,fromPredicate:m7,getAltValidation:mU,getApplicativeValidation:mW,getApplyMonoid:gN,getApplySemigroup:gA,getCompactable:mL,getEq:mN,getFilterable:mD,getOrElse:gi,getOrElseW:gi,getSemigroup:mP,getShow:mA,getValidation:function(t){var n=mW(t).ap,r=mU(t).alt;return{URI:mj,_E:void 0,map:mx,of:mV,chain:mS,bimap:mC,mapLeft:mI,reduce:mT,foldMap:mw,reduceRight:mO,extend:mR,traverse:mk,sequence:m1,chainRec:mE,throwError:r_,ap:n,alt:r}},getValidationMonoid:gL,getValidationSemigroup:gP,getWitherable:mF,isLeft:gt,isRight:gn,left:r_,map:mz,mapLeft:m4,match:gr,matchW:gr,of:mV,orElse:gm,orElseW:gm,parseJSON:function(t,n){return gy(function(){return JSON.parse(t)},n)},reduce:mJ,reduceRight:mX,right:rS,sequence:m1,sequenceArray:gE,stringifyJSON:gj,swap:gh,throwError:r_,toError:function(t){return t instanceof Error?t:Error(String(t))},toUnion:g_,traverse:m0,traverseArray:gR,traverseArrayWithIndex:gM,traverseReadonlyArrayWithIndex:gM,traverseReadonlyNonEmptyArrayWithIndex:gI,tryCatch:gy,tryCatchK:gv},Symbol.toStringTag,{value:"Module"}));function gF(t){return ro(rS,t.of)}function gW(t){return ro(r_,t.of)}function gU(t){return function(n){return t.map(n,rS)}}function gz(t){return function(n){return t.map(n,r_)}}function gB(t){return function(n){return ro(gg(n),t.of)}}function gV(t){var n=gB(t);return function(t){var r=n(t);return function(t){return ro(t,r)}}}function g$(t){var n=gH(t),r=gV(t);return function(t){var i=r(t);return function(t){return n(i(t))}}}function gq(t){return rz(t,mB)}function gK(t){return rE(t,mK)}function gH(t){return function(n){return function(r){return t.chain(r,function(r){return gt(r)?t.of(r):n(r.right)})}}}function gG(t){return function(n){return function(r){return t.chain(r,function(r){return gt(r)?n():t.of(r)})}}}function gZ(t){return function(n,r){return function(i){return t.map(i,m3(n,r))}}}function gY(t){return function(n){return function(r){return t.map(r,m4(n))}}}function gJ(t,n){return function(r){return function(i){return t.chain(i,gr(function(i){return t.map(r(),m4(function(t){return n.concat(i,t)}))},gF(t)))}}}function gQ(t){return function(n,r){return function(i){return t.map(i,gr(n,r))}}}function gX(t){return function(n,r){return function(i){return t.chain(i,gr(n,r))}}}function g0(t){return function(n){return function(r){return t.chain(r,gr(n,t.of))}}}function g1(t){return function(n){return function(r){return t.chain(r,function(r){return gt(r)?n(r.left):t.of(r)})}}}function g2(t){var n=g1(t);return function(r){return n(function(n){return t.map(r(n),function(t){return gt(t)?t:r_(n)})})}}function g3(t){return function(n){return function(r){return t.chain(r,gr(function(r){return t.map(n(r),r_)},function(n){return t.of(rS(n))}))}}}function g4(t){return function(n){return t.map(n,gh)}}function g5(t){return function(n){return t.map(n,g_)}}let g6=Object.freeze(Object.defineProperty({__proto__:null,alt:gG,altValidation:gJ,ap:gK,bimap:gZ,chain:gH,chainNullableK:g$,fromNullable:gB,fromNullableK:gV,getEitherM:function(t){var n=gK(t),r=gq(t),i=gH(t),o=gG(t),a=gZ(t),u=gY(t),s=gX(t),l=g0(t),c=g1(t);return{map:function(t,n){return rc(t,r(n))},ap:function(t,r){return rc(t,n(r))},of:gF(t),chain:function(t,n){return rc(t,i(n))},alt:function(t,n){return rc(t,o(n))},bimap:function(t,n,r){return rc(t,a(n,r))},mapLeft:function(t,n){return rc(t,u(n))},fold:function(t,n,r){return rc(t,s(n,r))},getOrElse:function(t,n){return rc(t,l(n))},orElse:function(t,n){return rc(t,c(n))},swap:g4(t),rightM:gU(t),leftM:gz(t),left:gW(t)}},getOrElse:g0,left:gW,leftF:gz,map:gq,mapLeft:gY,match:gQ,matchE:gX,orElse:g1,orElseFirst:g2,orLeft:g3,right:gF,rightF:gU,swap:g4,toUnion:g5},Symbol.toStringTag,{value:"Module"}));var g9=function(){return{concat:function(t,n){return ro(t,n)}}},g8=function(){return{concat:g9().concat,empty:n7}};let g7=Object.freeze(Object.defineProperty({__proto__:null,URI:"Endomorphism",getMonoid:g8,getSemigroup:g9},Symbol.toStringTag,{value:"Module"})),ye=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function yt(t,n){var r=n.zero,i=function(o,a){return t.equals(a,r)?o:i(a,n.mod(o,a))};return i}let yn=Object.freeze(Object.defineProperty({__proto__:null,fieldNumber:{add:function(t,n){return t+n},zero:0,mul:function(t,n){return t*n},one:1,sub:function(t,n){return t-n},degree:function(t){return 1},div:function(t,n){return t/n},mod:function(t,n){return t%n}},gcd:yt,lcm:function(t,n){var r=n.zero,i=yt(t,n);return function(o,a){return t.equals(o,r)||t.equals(a,r)?r:n.div(n.mul(o,a),i(o,a))}}},Symbol.toStringTag,{value:"Module"}));function yr(t,n){return function(r){return function(i){return t.map(i,function(t){return n.filter(t,r)})}}}function yi(t,n){return function(r){return function(i){return t.map(i,function(t){return n.filterMap(t,r)})}}}function yo(t,n){var r=yr(t,n);return function(t){var n=r(pk(t)),i=r(t);return function(t){return so(n(t),i(t))}}}function ya(t,n){var r=yi(t,n);return function(t){return function(n){return so(rc(n,r(function(n){return pE(t(n))})),rc(n,r(function(n){return pj(t(n))})))}}}let yu=Object.freeze(Object.defineProperty({__proto__:null,filter:yr,filterMap:yi,getFilterableComposition:function(t,n){var r=r$(t,n).map,i=h3(t,n),o=h4(t,n,n),a=yr(t,n),u=yi(t,n),s=yo(t,n),l=ya(t,n);return{map:r,compact:i,separate:o,filter:function(t,n){return rc(t,a(n))},filterMap:function(t,n){return rc(t,u(n))},partition:function(t,n){return rc(t,s(n))},partitionMap:function(t,n){return rc(t,l(n))}}},partition:yo,partitionMap:ya},Symbol.toStringTag,{value:"Module"})),ys=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function yl(t,n){return function(r,i){return function(o){return t.reduce(o,r,function(t,r){return n.reduce(r,t,i)})}}}function yc(t,n){return function(r){var i=t.foldMap(r),o=n.foldMap(r);return function(t){return function(n){return i(n,function(n){return o(n,t)})}}}}function yd(t,n){return function(r,i){return function(o){return t.reduceRight(o,r,function(t,r){return n.reduceRight(t,r,i)})}}}function yf(t){return function(n){return t.reduce(n,[],function(t,n){return t.push(n),t})}}function yp(t,n){var r=yl(t,n),i=yc(t,n),o=yd(t,n);return{reduce:function(t,n,i){return rc(t,r(n,i))},foldMap:function(t){var n=i(t);return function(t,r){return rc(t,n(r))}},reduceRight:function(t,n,r){return rc(t,o(n,r))}}}let yh=Object.freeze(Object.defineProperty({__proto__:null,foldM:function(t,n){return function(r,i,o){return n.reduce(r,t.of(i),function(n,r){return t.chain(n,function(t){return o(t,r)})})}},foldMap:yc,getFoldableComposition:yp,intercalate:function(t,n){return function(r,i){var o=function(n,i){var o=n.init,a=n.acc;return o?{init:!1,acc:i}:{init:!1,acc:t.concat(t.concat(a,r),i)}};return n.reduce(i,{init:!0,acc:t.empty},o).acc}},reduce:yl,reduceM:function(t,n){return function(r,i){return function(o){return n.reduce(o,t.of(r),function(n,r){return t.chain(n,function(t){return i(t,r)})})}}},reduceRight:yd,toArray:yf,toReadonlyArray:yf,traverse_:function(t,n){var r=t.of(void 0);return function(i,o){return n.reduce(i,r,function(n,r){var i,a;return a=o(r),t.ap(t.map(n,re),a)})}}},Symbol.toStringTag,{value:"Module"}));function ym(t,n){return function(r,i){return function(o){return t.reduceWithIndex(o,r,function(t,r,o){return n.reduceWithIndex(o,r,function(n,r,o){return i([t,n],r,o)})})}}}function yg(t,n){return function(r){var i=t.foldMapWithIndex(r),o=n.foldMapWithIndex(r);return function(t){return function(n){return i(n,function(n,r){return o(r,function(r,i){return t([n,r],i)})})}}}}function yy(t,n){return function(r,i){return function(o){return t.reduceRightWithIndex(o,r,function(t,r,o){return n.reduceRightWithIndex(r,o,function(n,r,o){return i([t,n],r,o)})})}}}let yv=Object.freeze(Object.defineProperty({__proto__:null,foldMapWithIndex:yg,getFoldableWithIndexComposition:function(t,n){var r=yp(t,n),i=ym(t,n),o=yg(t,n),a=yy(t,n);return{reduce:r.reduce,foldMap:r.foldMap,reduceRight:r.reduceRight,reduceWithIndex:function(t,n,r){return rc(t,i(n,r))},foldMapWithIndex:function(t){var n=o(t);return function(t,r){return rc(t,n(r))}},reduceRightWithIndex:function(t,n,r){return rc(t,a(n,r))}}},reduceRightWithIndex:yy,reduceWithIndex:ym},Symbol.toStringTag,{value:"Module"}));function yb(t){return function(n){return ro(n,t.fromIO)}}function yx(t,n){return function(r){var i=ro(r,t.fromIO);return function(t){return n.chain(t,i)}}}function y_(t,n){var r=rZ(n);return function(n){return r(ro(n,t.fromIO))}}let yS=Object.freeze(Object.defineProperty({__proto__:null,chainFirstIOK:y_,chainIOK:yx,fromIOK:yb},Symbol.toStringTag,{value:"Module"}));var yT=function(){return n7},yw=function(t){return function(n){return function(r){return n(t(r))}}},yO=function(t){return function(n){return t(n)(n)}},yk=function(t,n){return rc(t,yE(n))},yC=function(t,n){return rc(t,yA(n))},yI=function(t,n){return rc(t,yP(n))},yM=function(t,n){return rc(t,yD(n))},yR=function(t,n,r){return rc(t,yF(n,r))},yE=function(t){return function(n){return function(r){return t(n(r))}}},yj=function(t){return function(n){return function(r){return n(r)(t(r))}}},yA=yj,yN=function(t){return function(n){return function(r){return t(n(r))(r)}}},yP=yN,yL=yN(n7),yD=function(t){return function(n){return ro(t,n)}},yF=function(t,n){return function(r){return function(i){return n(r(t(i)))}}},yW=function(){return n7},yU=function(t){return function(n){var r=n[0],i=n[1];return[t(r),i]}},yz=function(t){return function(n){var r;return[n[0],t(n[1])]}},yB=function(t){return gr(function(n){return r_(t(n))},rS)},yV=function(t){return gr(r_,function(n){return rS(t(n))})},y$="Reader",yq={URI:y$,map:yk},yK=rB(yq),yH={URI:y$,of:re},yG={URI:y$,map:yk,ap:yC},yZ=rj(yG),yY=rA(yG),yJ={URI:y$,map:yk,ap:yC,of:re},yQ={URI:y$,map:yk,ap:yC,chain:yI},yX={URI:y$,map:yk,of:re,ap:yC,chain:yI},y0=rZ(yQ),y1=rV(yq),y2=rY(yQ),y3=re(rI),y4=rN(yG),y5=re(rC),y6=function(t){return function(n){return function(r){for(var i=[t(0,rO(n))(r)],o=1;o<n.length;o++)i.push(t(o,n[o])(r));return i}}},y9=function(t){var n=y6(t);return function(t){return rw(t)?n(t):y5}},y8=function(t){return y9(function(n,r){return t(r)})},y7=y8(n7),ve=rP(yG),vt=rK(yJ);let vn=Object.freeze(Object.defineProperty({__proto__:null,ApT:y5,Applicative:yJ,Apply:yG,Category:{URI:y$,compose:yM,id:yW},Chain:yQ,Choice:{URI:y$,map:yk,promap:yR,left:yB,right:yV},Do:y3,Functor:yq,Monad:yX,Pointed:yH,Profunctor:{URI:y$,map:yk,promap:yR},Strong:{URI:y$,map:yk,promap:yR,first:yU,second:yz},URI:y$,ap:yA,apFirst:yZ,apFirstW:yZ,apS:y4,apSW:y4,apSecond:yY,apSecondW:yY,apW:yj,ask:yT,asks:n7,asksReader:yO,asksReaderW:yO,bind:y2,bindTo:y1,bindW:y2,chain:yP,chainFirst:y0,chainFirstW:y0,chainW:yN,compose:yD,first:yU,flap:yK,flatten:yL,flattenW:yL,getMonoid:vt,getSemigroup:ve,id:yW,left:yB,local:yw,map:yE,of:re,promap:yF,reader:{URI:y$,map:yk,of:re,ap:yC,chain:yI,promap:yR,compose:yM,id:yW,first:yU,second:yz,left:yB,right:yV},right:yV,second:yz,sequenceArray:y7,traverseArray:y8,traverseArrayWithIndex:y9,traverseReadonlyArrayWithIndex:y9,traverseReadonlyNonEmptyArrayWithIndex:y6},Symbol.toStringTag,{value:"Module"}));function vr(t){return function(){return t.fromReader(yT())}}function vi(t){return t.fromReader}function vo(t){return function(n){return ro(n,t.fromReader)}}function va(t,n){var r=vo(t);return function(t){return function(i){return n.chain(i,r(t))}}}function vu(t,n){return ro(vo(t),rZ(n))}let vs=Object.freeze(Object.defineProperty({__proto__:null,ask:vr,asks:vi,chainFirstReaderK:vu,chainReaderK:va,fromReaderK:vo},Symbol.toStringTag,{value:"Module"}));var vl=function(){return function(t){return[t,t]}},vc=function(t){return function(){return[void 0,t]}},vd=function(t){return function(n){return[void 0,t(n)]}},vf=function(t){return function(n){return[t(n),n]}},vp=function(t,n){return rc(t,vg(n))},vh=function(t,n){return rc(t,vy(n))},vm=function(t,n){return rc(t,vb(n))},vg=function(t){return function(n){return function(r){var i=n(r),o=i[0],a=i[1];return[t(o),a]}}},vy=function(t){return function(n){return function(r){var i=n(r),o=i[0],a=t(i[1]),u=a[0],s=a[1];return[o(u),s]}}},vv=function(t){return function(n){return[t,n]}},vb=function(t){return function(n){return function(r){var i=n(r),o=i[0],a=i[1];return t(o)(a)}}},vx=vb(n7),v_="State",vS={URI:v_,map:vp},vT=rB(vS),vw={URI:v_,map:vp,ap:vh},vO=rj(vw),vk=rA(vw),vC={URI:v_,map:vp,ap:vh,chain:vm},vI={URI:v_,map:vp,ap:vh,of:vv,chain:vm},vM=rZ(vC),vR=function(t){return function(n){return n(t)[0]}},vE=function(t){return function(n){return n(t)[1]}},vj=rV(vS),vA=rY(vC),vN=rN(vw),vP=function(t){return function(n){return function(r){for(var i=t(0,rO(n))(r),o=i[0],a=i[1],u=[o],s=a,l=1;l<n.length;l++){var c=t(l,n[l])(s),d=c[0],f=c[1];u.push(d),s=f}return[u,s]}}},vL=function(t){var n=vP(t);return function(t){return rw(t)?n(t):vv(rC)}},vD=function(t){return vL(function(n,r){return t(r)})},vF=vD(n7),vW=function(t,n){return t(n)[0]},vU=function(t,n){return t(n)[1]};let vz=Object.freeze(Object.defineProperty({__proto__:null,Applicative:{URI:v_,map:vp,ap:vh,of:vv},Apply:vw,Chain:vC,FromState:{URI:v_,fromState:n7},Functor:vS,Monad:vI,Pointed:{URI:v_,of:vv},URI:v_,ap:vy,apFirst:vO,apS:vN,apSecond:vk,bind:vA,bindTo:vj,chain:vb,chainFirst:vM,evalState:vW,evaluate:vR,execState:vU,execute:vE,flap:vT,flatten:vx,get:vl,gets:vf,map:vg,modify:vd,of:vv,put:vc,sequenceArray:vF,state:vI,traverseArray:vD,traverseArrayWithIndex:vL,traverseReadonlyArrayWithIndex:vL,traverseReadonlyNonEmptyArrayWithIndex:vP},Symbol.toStringTag,{value:"Module"}));function vB(t){return function(){return t.fromState(vl())}}function vV(t){return function(n){return t.fromState(vc(n))}}function v$(t){return ro(vd,t.fromState)}function vq(t){return ro(vf,t.fromState)}function vK(t){return function(n){return ro(n,t.fromState)}}function vH(t,n){var r=vK(t);return function(t){return function(i){return n.chain(i,r(t))}}}let vG=Object.freeze(Object.defineProperty({__proto__:null,chainStateK:vH,fromStateK:vK,get:vB,gets:vq,modify:v$,put:vV},Symbol.toStringTag,{value:"Module"}));function vZ(t){return function(n){return ro(n,t.fromTask)}}function vY(t,n){return function(r){var i=ro(r,t.fromTask);return function(t){return n.chain(t,i)}}}function vJ(t,n){var r=rZ(n);return function(n){return r(ro(n,t.fromTask))}}let vQ=Object.freeze(Object.defineProperty({__proto__:null,chainFirstTaskK:vJ,chainTaskK:vY,fromTaskK:vZ},Symbol.toStringTag,{value:"Module"}));function vX(t){return function(n){return ro(n,t.fromThese)}}let v0=Object.freeze(Object.defineProperty({__proto__:null,fromTheseK:vX},Symbol.toStringTag,{value:"Module"}));function v1(t,n){return function(r){return function(i){return t.mapWithIndex(i,function(t,i){return n.mapWithIndex(i,function(n,i){return r([t,n],i)})})}}}let v2=Object.freeze(Object.defineProperty({__proto__:null,getFunctorWithIndexComposition:function(t,n){var r=r$(t,n).map,i=v1(t,n);return{map:r,mapWithIndex:function(t,n){return rc(t,i(n))}}},mapWithIndex:v1},Symbol.toStringTag,{value:"Module"})),v3=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),v4=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),v5=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var v6=function(t,n){return rc(t,bo(n))},v9=function(t,n){return rc(t,ba(n))},v8=function(t,n){return rc(t,bu(n))},v7=function(t,n,r){return rc(t,bd(n,r))},be=function(t){return function(t,n){return rc(t,bf()(n))}},bt=function(t,n,r){return rc(t,bp(n,r))},bn=function(t,n){return rc(t,by())},br=function(t,n){return rc(t,bs(n))},bi=function(t){var n=bh(t);return function(t,r){return rc(t,n(r))}},bo=function(t){return function(n){return t(n)}},ba=function(t){return function(n){return n(t)}},bu=function(t){return function(n){return t(n)}},bs=function(t){return function(n){return t(n)}},bl=bs(n7),bc=bu(n7),bd=function(t,n){return function(r){return n(t,r)}},bf=function(){return function(t){return function(n){return t(n)}}},bp=function(t,n){return function(r){return n(r,t)}},bh=function(t){return function(n){return function(r){return t.map(n(r),n7)}}},bm=function(t){return function(n){return t.map(n,n7)}},bg=function(){return n7},by=bg,bv="Identity",bb={URI:bv,map:v6},bx=rB(bb),b_={URI:bv,map:v6,ap:v9},bS=rj(b_),bT=rA(b_),bw={URI:bv,map:v6,ap:v9,chain:v8},bO=rZ(bw),bk=n7(rI),bC=rV(bb),bI=rY(bw),bM=rN(b_);let bR=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:bv,map:v6,alt:bn},Applicative:{URI:bv,map:v6,ap:v9,of:n7},Apply:b_,Chain:bw,ChainRec:{URI:bv,map:v6,ap:v9,chain:v8,chainRec:pp},Comonad:{URI:bv,map:v6,extend:br,extract:n7},Do:bk,Foldable:{URI:bv,reduce:v7,foldMap:be,reduceRight:bt},Functor:bb,Monad:{URI:bv,map:v6,ap:v9,of:n7,chain:v8},Pointed:{URI:bv,of:n7},Traversable:{URI:bv,map:v6,reduce:v7,foldMap:be,reduceRight:bt,traverse:bi,sequence:bm},URI:bv,alt:by,altW:bg,ap:ba,apFirst:bS,apS:bM,apSecond:bT,bind:bI,bindTo:bC,chain:bu,chainFirst:bO,duplicate:bl,extend:bs,extract:n7,flap:bx,flatten:bc,foldMap:bf,getEq:n7,getShow:n7,identity:{URI:bv,map:v6,ap:v9,of:n7,chain:v8,reduce:v7,foldMap:be,reduceRight:bt,traverse:bi,sequence:bm,alt:bn,extract:n7,extend:br,chainRec:pp},map:bo,of:n7,reduce:bd,reduceRight:bp,sequence:bm,traverse:bh},Symbol.toStringTag,{value:"Module"})),bE=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var bj=function(t,n){return function(){return n(t())}},bA=function(t,n){return function(){return t()(n())}},bN=function(t,n){return function(){return n(t())()}},bP=function(t,n){return function(){for(var r=n(t)();"Left"===r._tag;)r=n(r.left)();return r.right}},bL=function(t){return function(n){return bj(n,t)}},bD=function(t){return function(n){return bA(n,t)}},bF=function(t){return function(n){return bN(n,t)}},bW=bF(n7),bU={URI:"IO",map:bj},bz=rB(bU),bB={URI:"IO",of:re},bV={URI:"IO",map:bj,ap:bA},b$=rj(bV),bq=rA(bV),bK={URI:"IO",map:bj,ap:bA,of:re},bH={URI:"IO",map:bj,ap:bA,chain:bN},bG={URI:"IO",map:bj,ap:bA,of:re,chain:bN},bZ=rZ(bH),bY=re(rI),bJ=rV(bU),bQ=rY(bH),bX=rN(bV),b0=re(rC),b1=function(t){return function(n){return function(){for(var r=[t(0,rO(n))()],i=1;i<n.length;i++)r.push(t(i,n[i])());return r}}},b2=function(t){var n=b1(t);return function(t){return rw(t)?n(t):b0}},b3=function(t){return b2(function(n,r){return t(r)})},b4=b3(n7),b5=rP(bV),b6=rK(bK);let b9=Object.freeze(Object.defineProperty({__proto__:null,ApT:b0,Applicative:bK,Apply:bV,Chain:bH,ChainRec:{URI:"IO",map:bj,ap:bA,chain:bN,chainRec:bP},Do:bY,FromIO:{URI:"IO",fromIO:n7},Functor:bU,Monad:bG,MonadIO:{URI:"IO",map:bj,ap:bA,of:re,chain:bN,fromIO:n7},Pointed:bB,URI:"IO",ap:bD,apFirst:b$,apS:bX,apSecond:bq,bind:bQ,bindTo:bJ,chain:bF,chainFirst:bZ,flap:bz,flatten:bW,fromIO:n7,getMonoid:b6,getSemigroup:b5,io:{URI:"IO",map:bj,of:re,ap:bA,chain:bN,fromIO:n7,chainRec:bP},map:bL,of:re,sequenceArray:b4,traverseArray:b3,traverseArrayWithIndex:b2,traverseReadonlyArrayWithIndex:b2,traverseReadonlyNonEmptyArrayWithIndex:b1},Symbol.toStringTag,{value:"Module"}));var b8=gW(bB),b7=gF(bB),xe=gU(bU),xt=gz(bU),xn=gQ(bU),xr=gX(bG),xi=g0(bG),xo=function(t,n){return function(){return gy(t,n)}},xa=function(t,n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return xo(function(){return t.apply(void 0,r)},n)}},xu=g5(bU),xs=g1(bG),xl=g2(bG),xc=function(t){return xl(xU(t))},xd=g3(bG),xf=g4(bU),xp=function(t,n){return rc(t,xx(n))},xh=function(t,n){return rc(t,xT(n))},xm=function(t,n){return rc(t,xw(function(t){return rc(n,xx(t))}))},xg=function(t,n){return rc(t,xw(n))},xy=function(t,n,r){return rc(t,x_(n,r))},xv=function(t,n){return rc(t,xS(n))},xb=function(t,n){return rc(t,xk(n))},xx=gq(bU),x_=gZ(bU),xS=gY(bU),xT=gK(bV),xw=gH(bG),xO=xw(n7),xk=gG(bG),xC="IOEither";function xI(t){var n=rE(bV,mW(t));return{URI:xC,_E:void 0,map:xp,ap:function(t,r){return rc(t,n(r))},of:b7}}function xM(t){var n=gJ(bG,t);return{URI:xC,_E:void 0,map:xp,alt:function(t,r){return rc(t,n(r))}}}var xR=function(t){var n=mL(t);return{URI:xC,_E:void 0,compact:h3(bU,n),separate:h4(bU,n,mB)}},xE={URI:xC,map:xp},xj=rB(xE),xA={URI:xC,map:xp,ap:xh},xN=rj(xA),xP=rA(xA),xL={URI:xC,map:xp,ap:xh,of:b7},xD={URI:xC,map:xp,ap:xh,chain:xg},xF=rZ(xD),xW={URI:xC,fromIO:xe},xU=yb(xW),xz=yx(xW,xD),xB=y_(xW,xD),xV={URI:xC,fromEither:re},x$=rQ(xV),xq=r0(xV),xK=r1(xV,xD),xH=r3(xV,xD),xG=r4(xV,xD),xZ=rX(xV),xY=r5(xV,xD),xJ=r2(xV),xQ=function(t,n,r){return xX(t,n,r)},xX=function(t,n,r){return rc(t,xw(function(t){return rc(n(t),bF(function(n){return rc(r(t,n),xw(function(){return re(n)}))}))}))},x0=b7(rI),x1=rV(xE),x2=rY(xD),x3=rN(xA),x4=b7(rC),x5=function(t){return ro(b1(t),bL(gI(rd)))},x6=function(t){var n=x5(t);return function(t){return rw(t)?n(t):x4}},x9=function(t){return function(n){return function(){var r=t(0,rO(n))();if(rb(r))return r;for(var i=[r.right],o=1;o<n.length;o++){var a=t(o,n[o])();if(rb(a))return a;i.push(a.right)}return rS(i)}}},x8=function(t){var n=x9(t);return function(t){return rw(t)?n(t):x4}},x7=function(t){return x6(function(n,r){return t(r)})},_e=x7(n7),_t=function(t){return x8(function(n,r){return t(r)})},_n=_t(n7),_r=rP(xA),_i=rK(xL),_o=function(t){return rP(bV)(mP(t))};let _a=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:xC,map:xp,alt:xb},ApT:x4,Applicative:xL,ApplicativePar:xL,ApplicativeSeq:{URI:xC,map:xp,ap:xm,of:b7},ApplyPar:xA,Bifunctor:{URI:xC,bimap:xy,mapLeft:xv},Chain:xD,Do:x0,FromEither:xV,FromIO:xW,Functor:xE,Monad:{URI:xC,map:xp,ap:xh,of:b7,chain:xg},MonadIO:{URI:xC,map:xp,ap:xh,of:b7,chain:xg,fromIO:xe},MonadThrow:{URI:xC,map:xp,ap:xh,of:b7,chain:xg,throwError:b8},Pointed:{URI:xC,of:b7},URI:xC,alt:xk,altW:xk,ap:xT,apFirst:xN,apFirstW:xN,apS:x3,apSW:x3,apSecond:xP,apSecondW:xP,apW:xT,bimap:x_,bind:x2,bindTo:x1,bindW:x2,bracket:xQ,bracketW:xX,chain:xw,chainEitherK:xH,chainEitherKW:xH,chainFirst:xF,chainFirstEitherK:xG,chainFirstEitherKW:xG,chainFirstIOK:xB,chainFirstW:xF,chainIOK:xz,chainOptionK:xK,chainW:xw,filterOrElse:xY,filterOrElseW:xY,flap:xj,flatten:xO,flattenW:xO,fold:xr,foldW:xr,fromEither:re,fromEitherK:xJ,fromIO:xe,fromIOK:xU,fromOption:x$,fromOptionK:xq,fromPredicate:xZ,getAltIOValidation:xM,getApplicativeIOValidation:xI,getApplyMonoid:_i,getApplySemigroup:_r,getCompactable:xR,getFilterable:function(t){var n=mD(t),r=xR(t),i=yr(bU,n),o=yi(bU,n),a=yo(bU,n),u=ya(bU,n);return{URI:xC,_E:void 0,map:xp,compact:r.compact,separate:r.separate,filter:function(t,n){return rc(t,i(n))},filterMap:function(t,n){return rc(t,o(n))},partition:function(t,n){return rc(t,a(n))},partitionMap:function(t,n){return rc(t,u(n))}}},getIOValidation:function(t){var n=xI(t),r=xM(t);return{URI:xC,_E:void 0,map:xp,ap:n.ap,of:b7,chain:xg,bimap:xy,mapLeft:xv,alt:r.alt,fromIO:xe,throwError:b8}},getOrElse:xi,getOrElseW:xi,getSemigroup:_o,ioEither:{URI:xC,bimap:xy,mapLeft:xv,map:xp,of:b7,ap:xh,chain:xg,alt:xb,fromIO:xe,throwError:b8},left:b8,leftIO:xt,map:xx,mapLeft:xS,match:xn,matchE:xr,matchEW:xr,matchW:xn,of:b7,orElse:xs,orElseFirst:xl,orElseFirstIOK:xc,orElseFirstW:xl,orElseW:xs,orLeft:xd,right:b7,rightIO:xe,sequenceArray:_e,sequenceSeqArray:_n,swap:xf,throwError:b8,toUnion:xu,traverseArray:x7,traverseArrayWithIndex:x6,traverseReadonlyArrayWithIndex:x6,traverseReadonlyArrayWithIndexSeq:x8,traverseReadonlyNonEmptyArrayWithIndex:x5,traverseReadonlyNonEmptyArrayWithIndexSeq:x9,traverseSeqArray:_t,traverseSeqArrayWithIndex:x8,tryCatch:xo,tryCatchK:xa},Symbol.toStringTag,{value:"Module"}));function _u(t){return ro(rv,t.of)}function _s(t){return re(t.of(ry))}function _l(t){return function(n){return t.map(n,rv)}}function _c(t){return ro(hN,t.of)}function _d(t){var n=_c(t);return function(t){return ro(t,n)}}function _f(t){var n=_S(t),r=_d(t);return function(t){return n(r(t))}}function _p(t){return function(n){return ro(n,t.of)}}function _h(t){var n=_S(t),r=_p(t);return function(t){return n(r(t))}}function _m(t){return function(n){return function(r){return t.of(pR(n)(r))}}}function _g(t){return ro(pj,t.of)}function _y(t){return function(n,r){return function(i){return t.map(i,hw(n,r))}}}function _v(t){return function(n,r){return function(i){return t.chain(i,hw(n,r))}}}function _b(t){return function(n){return function(r){return t.chain(r,hw(n,t.of))}}}function _x(t){return rz(t,pQ)}function __(t){return rE(t,p1)}function _S(t){var n=_s(t);return function(r){return function(i){return t.chain(i,hw(function(){return n()},r))}}}function _T(t){var n=_u(t);return function(r){return function(i){return t.chain(i,hw(r,n))}}}let _w=Object.freeze(Object.defineProperty({__proto__:null,alt:_T,ap:__,chain:_S,chainNullableK:_f,chainOptionK:_h,fromEither:_g,fromF:_l,fromNullable:_c,fromNullableK:_d,fromOptionK:_p,fromPredicate:_m,getOptionM:function(t){var n=__(t),r=_x(t),i=_S(t),o=_T(t),a=_v(t),u=_b(t),s=_s(t);return{map:function(t,n){return rc(t,r(n))},ap:function(t,r){return rc(t,n(r))},of:_u(t),chain:function(t,n){return rc(t,i(n))},alt:function(t,n){return rc(t,o(n))},fold:function(t,n,r){return rc(t,a(n,r))},getOrElse:function(t,n){return rc(t,u(n))},fromM:_l(t),none:function(){return s()}}},getOrElse:_b,map:_x,match:_y,matchE:_v,some:_u,zero:_s},Symbol.toStringTag,{value:"Module"}));var _O=_u(bB),_k=_m(bB),_C=_g(bB),_I=_l(bU),_M=bL(pj),_R=_y(bU),_E=_v(bH),_j=_b(bG),_A=bL(hU),_N=bL(hW),_P=_c(bB),_L=_d(bB),_D=_f(bG),_F=_p(bB),_W=_h(bG),_U=_x(bU),_z=__(bV),_B=_S(bG),_V=_B(n7),_$=_T(bG),_q=_s(bB),_K=_q(),_H=h3(bU,hu),_G=h4(bU,hu,pQ),_Z=yr(bU,hf),_Y=yi(bU,hf),_J=yo(bU,hf),_Q=ya(bU,hf),_X=function(t,n){return rc(t,_U(n))},_0=function(t,n){return rc(t,_z(n))},_1=function(t,n){return rc(t,_B(n))},_2=function(t,n){return rc(t,_$(n))},_3=function(t,n){return rc(t,_Z(n))},_4=function(t,n){return rc(t,_Y(n))},_5=function(t,n){return rc(t,_J(n))},_6=function(t,n){return rc(t,_Q(n))},_9="IOOption",_8={URI:_9,map:_X},_7=rB(_8),Se={URI:_9,of:_O},St={URI:_9,map:_X,ap:_0},Sn=rj(St),Sr=rA(St),Si={URI:_9,map:_X,ap:_0,chain:_1},So=rZ(Si),Sa={URI:_9,zero:_q},Su=s_(Sa,Se),Ss={URI:_9,fromIO:_I},Sl=yb(Ss),Sc=yx(Ss,Si),Sd=y_(Ss,Si),Sf={URI:_9,fromEither:_C},Sp=r2(Sf),Sh=r3(Sf,Si),Sm=r4(Sf,Si),Sg=_O(rI),Sy=rV(_8),Sv=rY(Si),Sb=rN(St),Sx=_O(rC),S_=function(t){return ro(b1(t),bL(hH(rd)))},SS=function(t){var n=S_(t);return function(t){return rw(t)?n(t):Sx}};let ST=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:_9,map:_X,alt:_2},Alternative:{URI:_9,map:_X,ap:_0,of:_O,alt:_2,zero:_q},ApT:Sx,Applicative:{URI:_9,map:_X,ap:_0,of:_O},Apply:St,Chain:Si,Compactable:{URI:_9,compact:_H,separate:_G},Do:Sg,Filterable:{URI:_9,map:_X,compact:_H,separate:_G,filter:_3,filterMap:_4,partition:_5,partitionMap:_6},FromEither:Sf,FromIO:Ss,Functor:_8,Monad:{URI:_9,map:_X,ap:_0,of:_O,chain:_1},MonadIO:{URI:_9,map:_X,ap:_0,of:_O,chain:_1,fromIO:_I},Pointed:Se,Zero:Sa,alt:_$,altW:_$,ap:_z,apFirst:Sn,apS:Sb,apSecond:Sr,bind:Sv,bindTo:Sy,chain:_B,chainEitherK:Sh,chainFirst:So,chainFirstEitherK:Sm,chainFirstIOK:Sd,chainIOK:Sc,chainNullableK:_D,chainOptionK:_W,compact:_H,filter:_Z,filterMap:_Y,flap:_7,flatten:_V,fold:_E,fromEither:_C,fromEitherK:Sp,fromIO:_I,fromIOEither:_M,fromIOK:Sl,fromNullable:_P,fromNullableK:_L,fromOption:re,fromOptionK:_F,fromPredicate:_k,getOrElse:_j,getOrElseW:_j,guard:Su,map:_U,match:_R,matchE:_E,matchEW:_E,matchW:_R,none:_K,of:_O,partition:_J,partitionMap:_Q,separate:_G,some:_O,toNullable:_N,toUndefined:_A,traverseReadonlyArrayWithIndex:SS,traverseReadonlyNonEmptyArrayWithIndex:S_,zero:_q},Symbol.toStringTag,{value:"Module"}));var Sw=function(){function t(t){var n=this;this.value=t,this.read=function(){return n.value},this.write=this.write.bind(this),this.modify=this.modify.bind(this)}return t.prototype.write=function(t){var n=this;return function(){n.value=t}},t.prototype.modify=function(t){var n=this;return function(){n.value=t(n.value)}},t}();let SO=Object.freeze(Object.defineProperty({__proto__:null,IORef:Sw,newIORef:function(t){return function(){return new Sw(t)}}},Symbol.toStringTag,{value:"Module"})),Sk=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var SC=function(t){return gy(function(){return JSON.parse(t)},n7)},SI=function(t){return gy(function(){var n=JSON.stringify(t);if("string"!=typeof n)throw Error("Converting unsupported structure to JSON");return n},n7)};let SM=Object.freeze(Object.defineProperty({__proto__:null,parse:SC,stringify:SI},Symbol.toStringTag,{value:"Module"})),SR=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var SE=function(t){return new Map(t)};function Sj(t,n){return{show:function(r){var i=[];return r.forEach(function(r,o){i.push("[".concat(t.show(o),", ").concat(n.show(r),"]"))}),"new Map([".concat(i.sort().join(", "),"])")}}}var SA=function(t){return t.size},SN=function(t){return 0===t.size};function SP(t){var n=SK(t);return function(r,i){if(void 0===i){var o=SP(t);return function(t){return o(r,t)}}return rg(n(r,i))}}function SL(t){return function(n,r){if(void 0===r){var i=SL(t);return function(t){return i(n,t)}}for(var o,a=r.values();!(o=a.next()).done;){var u=o.value;if(t.equals(n,u))return!0}return!1}}var SD=function(t){return function(n){return Array.from(n.keys()).sort(t.compare)}},SF=function(t){return function(n){return Array.from(n.values()).sort(t.compare)}};function SW(t){var n=SD(t);return function(t){return function(r){for(var i=[],o=n(r),a=0;a<o.length;a++){var u=o[a];i.push(t(u,r.get(u)))}return i}}}var SU=function(t){return SW(t)(function(t,n){return[t,n]})},Sz=function(t){var n=Sq(t);return function(t,r){var i=n(t);return function(n){var o=i(n);if(rm(o)){var a=new Map(n);return a.set(t,r),a}if(o.value[1]!==r){var a=new Map(n);return a.set(o.value[0],r),a}return n}}},SB=function(t){var n=Sq(t);return function(t){return function(r){var i=n(t,r);if(rg(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},SV=function(t){var n=S$(t);return function(t,r){return n(t,function(){return r})}},S$=function(t){var n=Sq(t);return function(t,r){return function(i){var o=n(t,i);if(rm(o))return ry;var a=o.value,u=a[0],s=a[1],l=r(s);if(l===s)return rv(i);var c=new Map(i);return c.set(u,l),rv(c)}}};function Sq(t){return function(n,r){if(void 0===r){var i=Sq(t);return function(t){return i(n,t)}}for(var o,a=r.entries();!(o=a.next()).done;){var u=o.value,s=u[0],l=u[1];if(t.equals(s,n))return rv([s,l])}return ry}}function SK(t){var n=Sq(t);return function(r,i){if(void 0===i){var o=SK(t);return function(t){return o(r,t)}}return rc(n(r,i),pJ(function(t){return t[0],t[1]}))}}function SH(t,n){var r=Sq(t);return function(i,o){if(void 0===o){var a=SH(t,n);return function(t){return a(t,i)}}for(var u,s=i.entries();!(u=s.next()).done;){var l=u.value,c=l[0],d=l[1],f=r(c,o);if(rm(f)||!t.equals(c,f.value[0])||!n.equals(d,f.value[1]))return!1}return!0}}var SG=new Map;function SZ(t,n){var r=SH(t,n);return r9(function(t,n){return r(t,n)&&r(n,t)})}var SY=function(t,n){return new Map([[t,n]])},SJ=function(t,n){for(var r,i=new Map,o=t.entries();!(r=o.next()).done;){var a=r.value,u=a[0],s=a[1];i.set(u,n(u,s))}return i},SQ=function(t){return function(n){for(var r,i=new Map,o=new Map,a=n.entries();!(r=a.next()).done;){var u=r.value,s=u[0],l=t(s,u[1]);rb(l)?i.set(s,l.left):o.set(s,l.right)}return so(i,o)}};function SX(t){return function(n){for(var r,i=new Map,o=new Map,a=n.entries();!(r=a.next()).done;){var u=r.value,s=u[0],l=u[1];t(s,l)?o.set(s,l):i.set(s,l)}return so(i,o)}}var S0=function(t){return function(n){for(var r,i=new Map,o=n.entries();!(r=o.next()).done;){var a=r.value,u=a[0],s=t(u,a[1]);rg(s)&&i.set(u,s.value)}return i}};function S1(t){return function(n){for(var r,i=new Map,o=n.entries();!(r=o.next()).done;){var a=r.value,u=a[0],s=a[1];t(u,s)&&i.set(u,s)}return i}}var S2=function(t,n){return SJ(t,function(t,r){return n(r)})},S3=function(t,n){return S9(t,function(t,r){return n(r)})},S4=function(t,n){return S8(t,function(t,r){return n(r)})},S5=function(t,n){return S7(t,function(t,r){return n(r)})},S6=function(t,n){return Te(t,function(t,r){return n(r)})},S9=function(t,n){return rc(t,S1(n))},S8=function(t,n){return rc(t,S0(n))},S7=function(t,n){return rc(t,SX(n))},Te=function(t,n){return rc(t,SQ(n))},Tt=function(t){for(var n,r=new Map,i=t.entries();!(n=i.next()).done;){var o=n.value,a=o[0],u=o[1];rg(u)&&r.set(a,u.value)}return r},Tn=function(t){return function(n){return S3(n,t)}},Tr=function(t){return function(n){return S4(n,t)}},Ti=function(t){return function(n){return S2(n,t)}},To=function(t){return function(n){return SJ(n,t)}},Ta=function(t){return function(n){return S5(n,t)}},Tu=function(t){return function(n){return S6(n,t)}},Ts=function(t){for(var n,r=new Map,i=new Map,o=t.entries();!(n=o.next()).done;){var a=n.value,u=a[0],s=a[1];rb(s)?r.set(u,s.left):i.set(u,s.right)}return so(r,i)},Tl="ReadonlyMap",Tc=function(t,n){var r=TI(t,n);return{concat:function(t,n){return r(n)(t)}}},Td=function(t,n){return{concat:Tc(t,n).concat,empty:SG}},Tf=function(t,n){var r=TM(t,n);return{concat:function(t,n){return r(n)(t)}}},Tp=function(t){return function(){var n=TR(t);return{concat:function(t,r){return n(r)(t)}}}},Th={URI:Tl,map:S2},Tm=rB(Th),Tg=function(){return{URI:Tl,_E:void 0,map:S2,mapWithIndex:SJ}},Ty={URI:Tl,compact:Tt,separate:Ts},Tv=function(t){var n=TS(t);return function(t,r){return n(t,function(t,n,i){return r(n,i)})}},Tb=function(t){var n=TT(t);return function(t){var r=n(t);return function(t){return r(function(n,r){return t(r)})}}},Tx=function(t){var n=Tw(t);return function(t,r){return n(t,function(t,n,i){return r(n,i)})}},T_=function(t){var n=Tv(t),r=Tb(t),i=Tx(t);return{URI:Tl,_E:void 0,reduce:function(t,r,i){return rc(t,n(r,i))},foldMap:function(t){var n=r(t);return function(t,r){return rc(t,n(r))}},reduceRight:function(t,n,r){return rc(t,i(n,r))}}},TS=function(t){var n=SD(t);return function(t,r){return function(i){for(var o=t,a=0,u=n(i);a<u.length;a++){var s=u[a];o=r(s,o,i.get(s))}return o}}},TT=function(t){var n=SD(t);return function(t){return function(r){return function(i){for(var o=t.empty,a=0,u=n(i);a<u.length;a++){var s=u[a];o=t.concat(o,r(s,i.get(s)))}return o}}}},Tw=function(t){var n=SD(t);return function(t,r){return function(i){for(var o=t,a=n(i),u=a.length,s=u-1;s>=0;s--){var l=a[s];o=r(l,i.get(l),o)}return o}}},TO=function(t){var n=T_(t),r=TS(t),i=TT(t),o=Tw(t);return{URI:Tl,_E:void 0,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:function(t,n,i){return rc(t,r(n,i))},foldMapWithIndex:function(t){var n=i(t);return function(t,r){return rc(t,n(r))}},reduceRightWithIndex:function(t,n,r){return rc(t,o(n,r))}}},Tk=function(t){var n=TC(t),r=T_(t);return{URI:Tl,_E:void 0,map:S2,reduce:r.reduce,foldMap:r.foldMap,reduceRight:r.reduceRight,traverse:n.traverse,sequence:n.sequence}},TC=function(t){var n=TO(t),r=SD(t),i=function(t){return function(n,i){for(var o=t.of(new Map),a=r(n),u=a.length,s=0;s<u;s++)!function(r){var u=a[r],s=n.get(u);o=t.ap(t.map(o,function(t){return function(n){return t.set(u,n)}}),i(u,s))}(s);return o}},o=function(t){var n=i(t);return function(t,r){return n(t,function(t,n){return r(n)})}},a=function(t){var n=i(t);return function(t){return n(t,rd)}};return{URI:Tl,_E:void 0,map:S2,mapWithIndex:SJ,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:n.reduceWithIndex,foldMapWithIndex:n.foldMapWithIndex,reduceRightWithIndex:n.reduceRightWithIndex,traverse:o,sequence:a,traverseWithIndex:i}},TI=function(t,n){var r=SK(t);return function(t){return function(i){if(SN(i))return t;if(SN(t))return i;for(var o,a=new Map,u=i.entries();!(o=u.next()).done;){var s=o.value,l=s[0],c=s[1],d=r(l)(t);rg(d)?a.set(l,n.concat(c,d.value)):a.set(l,c)}for(var f=t.entries();!(o=f.next()).done;){var p=o.value,l=p[0],c=p[1],d=r(l)(a);rm(d)&&a.set(l,c)}return a}}},TM=function(t,n){var r=SK(t);return function(t){return function(i){if(SN(i)||SN(t))return SG;for(var o,a=new Map,u=i.entries();!(o=u.next()).done;){var s=o.value,l=s[0],c=s[1],d=r(l)(t);rg(d)&&a.set(l,n.concat(c,d.value))}return a}}},TR=function(t){var n=SP(t);return function(t){return function(r){if(SN(r))return t;if(SN(t))return r;for(var i,o=new Map,a=r.entries();!(i=a.next()).done;){var u=i.value,s=u[0],l=u[1];n(s)(t)||o.set(s,l)}for(var c=t.entries();!(i=c.next()).done;){var d=i.value,s=d[0],l=d[1];n(s)(r)||o.set(s,l)}return o}}};let TE=Object.freeze(Object.defineProperty({__proto__:null,Compactable:Ty,Filterable:{URI:Tl,map:S2,compact:Tt,separate:Ts,filter:S3,filterMap:S4,partition:S5,partitionMap:S6},Functor:Th,URI:Tl,collect:SW,compact:Tt,deleteAt:SB,difference:TR,elem:SL,empty:SG,filter:Tn,filterMap:Tr,filterMapWithIndex:S0,filterWithIndex:S1,flap:Tm,foldMap:Tb,foldMapWithIndex:TT,fromFoldable:function(t,n,r){return function(i){var o=Sq(t);return r.reduce(i,new Map,function(t,r){var i=r[0],a=r[1],u=o(i,t);return rg(u)?t.set(u.value[0],n.concat(u.value[1],a)):t.set(i,a),t})}},fromMap:SE,getDifferenceMagma:Tp,getEq:SZ,getFilterableWithIndex:function(){return{URI:Tl,_E:void 0,map:S2,mapWithIndex:SJ,compact:Tt,separate:Ts,filter:S3,filterMap:S4,partition:S5,partitionMap:S6,partitionMapWithIndex:Te,partitionWithIndex:S7,filterMapWithIndex:S8,filterWithIndex:S9}},getFoldable:T_,getFoldableWithIndex:TO,getFunctorWithIndex:Tg,getIntersectionSemigroup:Tf,getMonoid:function(t,n){var r=Sq(t);return{concat:function(t,i){if(SN(t))return i;if(SN(i))return t;for(var o,a=new Map(t),u=i.entries();!(o=u.next()).done;){var s=o.value,l=s[0],c=s[1],d=r(l,t);rg(d)?a.set(d.value[0],n.concat(d.value[1],c)):a.set(l,c)}return a},empty:SG}},getShow:Sj,getTraversable:Tk,getTraversableWithIndex:TC,getUnionMonoid:Td,getUnionSemigroup:Tc,getWitherable:function(t){var n=TC(t);return{URI:Tl,_E:void 0,map:S2,compact:Tt,separate:Ts,filter:S3,filterMap:S4,partition:S5,partitionMap:S6,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,traverse:n.traverse,sequence:n.sequence,mapWithIndex:SJ,reduceWithIndex:n.reduceWithIndex,foldMapWithIndex:n.foldMapWithIndex,reduceRightWithIndex:n.reduceRightWithIndex,traverseWithIndex:n.traverseWithIndex,wilt:sy(n,Ty),wither:sv(n,Ty)}},insertAt:Sz,intersection:TM,isEmpty:SN,isSubmap:SH,keys:SD,lookup:SK,lookupWithKey:Sq,map:Ti,mapWithIndex:To,member:SP,modifyAt:S$,partition:Ta,partitionMap:Tu,partitionMapWithIndex:SQ,partitionWithIndex:SX,pop:function(t){var n=SK(t),r=SB(t);return function(t){var i=r(t);return function(r){return rc(n(t,r),pJ(function(t){return[t,i(r)]}))}}},readonlyMap:{URI:Tl,map:S2,compact:Tt,separate:Ts,filter:S3,filterMap:S4,partition:S5,partitionMap:S6},reduce:Tv,reduceRight:Tx,reduceRightWithIndex:Tw,reduceWithIndex:TS,separate:Ts,singleton:SY,size:SA,toMap:function(t){return new Map(t)},toReadonlyArray:SU,toUnfoldable:function(t,n){var r=SU(t);return function(t){var i=r(t),o=i.length;return n.unfold(0,function(t){return t<o?rv([i[t],t+1]):ry})}},union:TI,updateAt:SV,upsertAt:Sz,values:SF},Symbol.toStringTag,{value:"Module"}));var Tj=globalThis&&globalThis.__assign||function(){return(Tj=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)},TA=function(t){return function(n){return Array.from(n.keys()).sort(t.compare)}},TN=function(t){return function(n){return Array.from(n.values()).sort(t.compare)}};function TP(t){var n=TA(t);return function(t){return function(r){for(var i=[],o=n(r),a=0;a<o.length;a++){var u=o[a];i.push(t(u,r.get(u)))}return i}}}function TL(t){return TP(t)(function(t,n){return[t,n]})}var TD=function(t){var n=Tz(t);return function(t,r){var i=n(t);return function(n){var o=i(n);if(rm(o)){var a=new Map(n);return a.set(t,r),a}if(o.value[1]!==r){var a=new Map(n);return a.set(o.value[0],r),a}return n}}},TF=function(t){var n=Tz(t);return function(t){return function(r){var i=n(t,r);if(rg(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},TW=function(t){var n=TU(t);return function(t,r){return n(t,function(){return r})}},TU=function(t){var n=Tz(t);return function(t,r){return function(i){var o=n(t,i);if(rm(o))return ry;var a=new Map(i);return a.set(o.value[0],r(o.value[1])),rv(a)}}};function Tz(t){return function(n,r){if(void 0===r){var i=Tz(t);return function(t){return i(n,t)}}for(var o,a=r.entries();!(o=a.next()).done;){var u=o.value,s=u[0],l=u[1];if(t.equals(s,n))return rv([s,l])}return ry}}var TB=function(t,n){return new Map([[t,n]])},TV=function(t,n){for(var r,i=new Map,o=t.entries();!(r=o.next()).done;){var a=r.value,u=a[0],s=a[1];i.set(u,n(u,s))}return i},T$=function(t){return function(n){for(var r,i=new Map,o=new Map,a=n.entries();!(r=a.next()).done;){var u=r.value,s=u[0],l=t(s,u[1]);rb(l)?i.set(s,l.left):o.set(s,l.right)}return so(i,o)}};function Tq(t){return function(n){for(var r,i=new Map,o=new Map,a=n.entries();!(r=a.next()).done;){var u=r.value,s=u[0],l=u[1];t(s,l)?o.set(s,l):i.set(s,l)}return so(i,o)}}var TK=function(t){return function(n){for(var r,i=new Map,o=n.entries();!(r=o.next()).done;){var a=r.value,u=a[0],s=t(u,a[1]);rg(s)&&i.set(u,s.value)}return i}};function TH(t){return function(n){for(var r,i=new Map,o=n.entries();!(r=o.next()).done;){var a=r.value,u=a[0],s=a[1];t(u,s)&&i.set(u,s)}return i}}var TG=function(t,n){return TV(t,function(t,r){return n(r)})},TZ=function(t,n){return TX(t,function(t,r){return n(r)})},TY=function(t,n){return T0(t,function(t,r){return n(r)})},TJ=function(t,n){return T1(t,function(t,r){return n(r)})},TQ=function(t,n){return T2(t,function(t,r){return n(r)})},TX=function(t,n){return rc(t,TH(n))},T0=function(t,n){return rc(t,TK(n))},T1=function(t,n){return rc(t,Tq(n))},T2=function(t,n){return rc(t,T$(n))},T3=function(t){for(var n,r=new Map,i=t.entries();!(n=i.next()).done;){var o=n.value,a=o[0],u=o[1];rg(u)&&r.set(a,u.value)}return r},T4=function(t){return function(n){return TZ(n,t)}},T5=function(t){return function(n){return TY(n,t)}},T6=function(t){return function(n){return TG(n,t)}},T9=function(t){return function(n){return TV(n,t)}},T8=function(t){return function(n){return TJ(n,t)}},T7=function(t){return function(n){return TQ(n,t)}},we=function(t){for(var n,r=new Map,i=new Map,o=t.entries();!(n=o.next()).done;){var a=n.value,u=a[0],s=a[1];rb(s)?r.set(u,s.left):i.set(u,s.right)}return so(r,i)},wt=function(t,n){var r=wp(t,n);return{concat:function(t,n){return r(n)(t)}}},wn=function(t,n){return{concat:wt(t,n).concat,empty:new Map}},wr=function(t,n){var r=wh(t,n);return{concat:function(t,n){return r(n)(t)}}},wi=function(t){return function(){var n=wm(t);return{concat:function(t,r){return n(r)(t)}}}},wo=function(t){return Tj(Tj({},T_(t)),{URI:"Map"})},wa=function(t){return Tj(Tj({},TO(t)),{URI:"Map"})},wu=function(t){var n=wa(t),r=TA(t),i=function(t){return function(n,i){for(var o=t.of(new Map),a=r(n),u=a.length,s=0;s<u;s++)!function(r){var u=a[r],s=n.get(u);o=t.ap(t.map(o,function(t){return function(n){return t.set(u,n)}}),i(u,s))}(s);return o}},o=function(t){var n=i(t);return function(t,r){return n(t,function(t,n){return r(n)})}},a=function(t){var n=i(t);return function(t){return n(t,function(t,n){return n})}};return{URI:"Map",_E:void 0,map:TG,mapWithIndex:TV,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:n.reduceWithIndex,foldMapWithIndex:n.foldMapWithIndex,reduceRightWithIndex:n.reduceRightWithIndex,traverse:o,sequence:a,traverseWithIndex:i}},ws={URI:"Map",map:TG},wl=rB(ws),wc={URI:"Map",compact:T3,separate:we},wd={URI:"Map",map:TG,compact:T3,separate:we,filter:TZ,filterMap:TY,partition:TJ,partitionMap:TQ},wf=function(t){return new Map(t)},wp=function(t,n){var r=TI(t,n);return function(t){return function(n){return SN(n)?wf(t):SN(t)?wf(n):r(t)(n)}}},wh=function(t,n){var r=TM(t,n);return function(t){return function(n){return SN(n)||SN(t)?new Map:r(t)(n)}}},wm=function(t){var n=TR(t);return function(t){return function(r){return SN(r)?wf(t):SN(t)?wf(r):n(t)(r)}}},wg=new Map;let wy=Object.freeze(Object.defineProperty({__proto__:null,Compactable:wc,Filterable:wd,Functor:ws,URI:"Map",collect:TP,compact:T3,deleteAt:TF,difference:wm,elem:SL,empty:wg,filter:T4,filterMap:T5,filterMapWithIndex:TK,filterWithIndex:TH,flap:wl,foldMap:Tb,foldMapWithIndex:TT,fromFoldable:function(t,n,r){return function(i){var o=Tz(t);return r.reduce(i,new Map,function(t,r){var i=r[0],a=r[1],u=o(i,t);return rg(u)?t.set(u.value[0],n.concat(u.value[1],a)):t.set(i,a),t})}},getDifferenceMagma:wi,getEq:SZ,getFilterableWithIndex:function(){return{URI:"Map",_E:void 0,map:TG,mapWithIndex:TV,compact:T3,separate:we,filter:TZ,filterMap:TY,partition:TJ,partitionMap:TQ,partitionMapWithIndex:T2,partitionWithIndex:T1,filterMapWithIndex:T0,filterWithIndex:TX}},getFoldable:wo,getFoldableWithIndex:wa,getIntersectionSemigroup:wr,getMonoid:function(t,n){var r=Tz(t);return{concat:function(t,i){if(SN(t))return i;if(SN(i))return t;for(var o,a=new Map(t),u=i.entries();!(o=u.next()).done;){var s=o.value,l=s[0],c=s[1],d=r(l,t);rg(d)?a.set(d.value[0],n.concat(d.value[1],c)):a.set(l,c)}return a},empty:new Map}},getShow:Sj,getTraversableWithIndex:wu,getUnionMonoid:wn,getUnionSemigroup:wt,getWitherable:function(t){var n=wu(t);return{URI:"Map",_E:void 0,map:TG,compact:T3,separate:we,filter:TZ,filterMap:TY,partition:TJ,partitionMap:TQ,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,traverse:n.traverse,sequence:n.sequence,mapWithIndex:TV,reduceWithIndex:n.reduceWithIndex,foldMapWithIndex:n.foldMapWithIndex,reduceRightWithIndex:n.reduceRightWithIndex,traverseWithIndex:n.traverseWithIndex,wilt:sy(n,wc),wither:sv(n,wc)}},insertAt:TD,intersection:wh,isEmpty:SN,isSubmap:SH,keys:TA,lookup:SK,lookupWithKey:Tz,map:T6,mapWithIndex:T9,map_:wd,member:SP,modifyAt:TU,partition:T8,partitionMap:T7,partitionMapWithIndex:T$,partitionWithIndex:Tq,pop:function(t){var n=SK(t),r=TF(t);return function(t){var i=r(t);return function(r){return rc(n(t,r),pJ(function(t){return[t,i(r)]}))}}},reduce:Tv,reduceRight:Tx,reduceRightWithIndex:Tw,reduceWithIndex:TS,separate:we,singleton:TB,size:SA,toArray:TL,toUnfoldable:function(t,n){var r=TL(t);return function(t){var i=r(t),o=i.length;return n.unfold(0,function(t){return t<o?rv([i[t],t+1]):ry})}},union:wp,updateAt:TW,upsertAt:TD,values:TN},Symbol.toStringTag,{value:"Module"})),wv=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),wb=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),wx=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),w_=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),wS=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var wT=function(t){return{concat:iD(t).concat,empty:t.top}},ww=function(t){return{concat:iF(t).concat,empty:t.bottom}},wO=function(t){return{concat:iE(t).concat,empty:t.empty}},wk=function(t){var n={};for(var r in t)rM.call(t,r)&&(n[r]=t[r].empty);return{concat:iU(t).concat,empty:n}},wC=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return{concat:iz.apply(iQ,t).concat,empty:t.map(function(t){return t.empty})}},wI=function(t){return iP(t)(t.empty)},wM={concat:iq.concat,empty:void 0},wR={concat:iH.concat,empty:!0},wE={concat:iG.concat,empty:!1},wj=function(){return wO(g8())},wA={concat:iZ.concat,empty:""},wN={concat:iY.concat,empty:0},wP={concat:iJ.concat,empty:1};let wL=Object.freeze(Object.defineProperty({__proto__:null,concatAll:wI,fold:wI,getDualMonoid:wO,getEndomorphismMonoid:wj,getFunctionMonoid:n5,getJoinMonoid:ww,getMeetMonoid:wT,getStructMonoid:wk,getTupleMonoid:wC,max:ww,min:wT,monoidAll:wR,monoidAny:wE,monoidProduct:wP,monoidString:wA,monoidSum:wN,monoidVoid:wM,reverse:wO,struct:wk,tuple:wC},Symbol.toStringTag,{value:"Module"})),wD=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var wF=function(t,n,r){return function(i){return -1===i?t():0===i?n():r()}},wW=function(t){return -1===t?1:1===t?-1:0},wU={equals:function(t,n){return t===n}},wz={concat:function(t,n){return 0!==t?t:n}},wB={concat:wz.concat,empty:0},wV=function(t){return t<=-1?-1:t>=1?1:0};let w$=Object.freeze(Object.defineProperty({__proto__:null,Eq:wU,Monoid:wB,Semigroup:wz,eqOrdering:wU,invert:wW,match:wF,matchW:wF,monoidOrdering:wB,reverse:wW,semigroupOrdering:wz,sign:wV},Symbol.toStringTag,{value:"Module"})),wq=Object.freeze(Object.defineProperty({__proto__:null,pipe:rc,pipeable:function(t){var n,r,i,o,a,u,s,l,c,d,f,p,h,m,g,y={};if("function"==typeof t.map){var v=function(n){return function(r){return t.map(r,n)}};y.map=v}if("function"==typeof t.contramap){var b=function(n){return function(r){return t.contramap(r,n)}};y.contramap=b}if("function"==typeof t.mapWithIndex){var x=function(n){return function(r){return t.mapWithIndex(r,n)}};y.mapWithIndex=x}if("function"==typeof t.ap){var _=function(n){return function(r){return t.ap(r,n)}},S=function(n){return function(r){return t.ap(t.map(r,function(t){return function(){return t}}),n)}};y.ap=_,y.apFirst=S,y.apSecond=function(n){return function(r){return t.ap(t.map(r,function(){return function(t){return t}}),n)}}}if("function"==typeof t.chain){var T=function(n){return function(r){return t.chain(r,n)}},w=function(n){return function(r){return t.chain(r,function(r){return t.map(n(r),function(){return r})})}},O=function(n){return t.chain(n,n7)};y.chain=T,y.chainFirst=w,y.flatten=O}if("function"==typeof t.bimap){var k=function(n,r){return function(i){return t.bimap(i,n,r)}},C=function(n){return function(r){return t.mapLeft(r,n)}};y.bimap=k,y.mapLeft=C}if("function"==typeof t.extend){var I=function(n){return function(r){return t.extend(r,n)}},M=function(n){return t.extend(n,n7)};y.extend=I,y.duplicate=M}if("function"==typeof t.reduce){var R=function(n,r){return function(i){return t.reduce(i,n,r)}},E=function(n){var r=t.foldMap(n);return function(t){return function(n){return r(n,t)}}},j=function(n,r){return function(i){return t.reduceRight(i,n,r)}};y.reduce=R,y.foldMap=E,y.reduceRight=j}if("function"==typeof t.reduceWithIndex){var A=function(n,r){return function(i){return t.reduceWithIndex(i,n,r)}},N=function(n){var r=t.foldMapWithIndex(n);return function(t){return function(n){return r(n,t)}}},P=function(n,r){return function(i){return t.reduceRightWithIndex(i,n,r)}};y.reduceWithIndex=A,y.foldMapWithIndex=N,y.reduceRightWithIndex=P}if("function"==typeof t.alt){var L=function(n){return function(r){return t.alt(r,n)}};y.alt=L}if("function"==typeof t.compact&&(y.compact=t.compact,y.separate=t.separate),"function"==typeof t.filter){var D=function(n){return function(r){return t.filter(r,n)}},F=function(n){return function(r){return t.filterMap(r,n)}},W=function(n){return function(r){return t.partition(r,n)}},U=function(n){return function(r){return t.partitionMap(r,n)}};y.filter=D,y.filterMap=F,y.partition=W,y.partitionMap=U}if("function"==typeof t.filterWithIndex){var z=function(n){return function(r){return t.filterWithIndex(r,n)}},B=function(n){return function(r){return t.filterMapWithIndex(r,n)}},V=function(n){return function(r){return t.partitionWithIndex(r,n)}},$=function(n){return function(r){return t.partitionMapWithIndex(r,n)}};y.filterWithIndex=z,y.filterMapWithIndex=B,y.partitionWithIndex=V,y.partitionMapWithIndex=$}if("function"==typeof t.promap){var q=function(n,r){return function(i){return t.promap(i,n,r)}};y.promap=q}if("function"==typeof t.compose){var K=function(n){return function(r){return t.compose(r,n)}};y.compose=K}if("function"==typeof t.throwError){var H=function(n){return function(r){return"None"===r._tag?t.throwError(n()):t.of(r.value)}},G=function(n){return"Left"===n._tag?t.throwError(n.left):t.of(n.right)},Z=function(n,r){return function(i){return n(i)?t.of(i):t.throwError(r(i))}},Y=function(n,r){return function(i){return t.chain(i,function(i){return n(i)?t.of(i):t.throwError(r(i))})}};y.fromOption=H,y.fromEither=G,y.fromPredicate=Z,y.filterOrElse=Y}return y}},Symbol.toStringTag,{value:"Module"})),wK=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),wH=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var wG=function(){return Math.random()};function wZ(t,n){return rc(wG,bL(function(r){return Math.floor((n-t+1)*r+t)}))}var wY=rc(wG,bL(function(t){return t<.5})),wJ=function(t){return rc(wZ(0,t.length-1),bL(function(n){return t[n]}))};let wQ=Object.freeze(Object.defineProperty({__proto__:null,random:wG,randomBool:wY,randomElem:wJ,randomInt:wZ,randomRange:function(t,n){return rc(wG,bL(function(r){return(n-t)*r+t}))}},Symbol.toStringTag,{value:"Module"}));var wX=gW(yH),w0=gF(yH),w1=gU(yq),w2=gz(yq),w3=gQ(yq),w4=gX(yX),w5=g0(yX),w6=g5(yq),w9=g1(yX),w8=g2(yX),w7=g3(yX),Oe=g4(yq),Ot=function(t,n){return rc(t,Ou(n))},On=function(t,n,r){return rc(t,Os(n,r))},Or=function(t,n){return rc(t,Ol(n))},Oi=function(t,n){return rc(t,Oc(n))},Oo=function(t,n){return rc(t,Od(n))},Oa=function(t,n){return rc(t,Op(n))},Ou=gq(yq),Os=gZ(yq),Ol=gY(yq),Oc=gK(yG),Od=gH(yX),Of=Od(n7),Op=gG(yX),Oh="ReaderEither",Om=function(t){var n=mL(t);return{URI:Oh,_E:void 0,compact:h3(yq,n),separate:h4(yq,n,mB)}};function Og(t){var n=rE(yG,mW(t));return{URI:Oh,_E:void 0,map:Ot,ap:function(t,r){return rc(t,n(r))},of:w0}}function Oy(t){var n=gJ(yX,t);return{URI:Oh,_E:void 0,map:Ot,alt:function(t,r){return rc(t,n(r))}}}var Ov={URI:Oh,map:Ot},Ob=rB(Ov),Ox={URI:Oh,map:Ot,ap:Oi},O_=rj(Ox),OS=rA(Ox),OT={URI:Oh,map:Ot,ap:Oi,of:w0},Ow={URI:Oh,map:Ot,ap:Oi,chain:Oo},OO=rZ(Ow),Ok={URI:Oh,fromReader:w1},OC=vr(Ok),OI=vi(Ok),OM=vo(Ok),OR=va(Ok,Ow),OE=vu(Ok,Ow),Oj={URI:Oh,fromEither:re},OA=rQ(Oj),ON=r0(Oj),OP=r1(Oj,Ow),OL=r3(Oj,Ow),OD=r4(Oj,Ow),OF=rX(Oj),OW=r5(Oj,Ow),OU=r2(Oj),Oz=w0(rI),OB=rV(Ov),OV=rY(Ow),O$=rN(Ox),Oq=w0(rC),OK=function(t){return ro(y6(t),yE(gI(rd)))},OH=function(t){var n=OK(t);return function(t){return rw(t)?n(t):Oq}},OG=function(t){return OH(function(n,r){return t(r)})},OZ=OG(n7),OY=rP(Ox),OJ=rK(OT),OQ=function(t){return rP(yG)(mP(t))};let OX=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:Oh,map:Ot,alt:Oa},ApT:Oq,Applicative:OT,Apply:Ox,Bifunctor:{URI:Oh,bimap:On,mapLeft:Or},Chain:Ow,Do:Oz,FromEither:Oj,FromReader:Ok,Functor:Ov,Monad:{URI:Oh,map:Ot,ap:Oi,of:w0,chain:Oo},MonadThrow:{URI:Oh,map:Ot,ap:Oi,of:w0,chain:Oo,throwError:wX},Pointed:{URI:Oh,of:w0},URI:Oh,alt:Op,altW:Op,ap:Oc,apFirst:O_,apFirstW:O_,apS:O$,apSW:O$,apSecond:OS,apSecondW:OS,apW:Oc,ask:OC,asks:OI,asksReaderEither:yO,asksReaderEitherW:yO,bimap:Os,bind:OV,bindTo:OB,bindW:OV,chain:Od,chainEitherK:OL,chainEitherKW:OL,chainFirst:OO,chainFirstEitherK:OD,chainFirstEitherKW:OD,chainFirstReaderK:OE,chainFirstReaderKW:OE,chainFirstW:OO,chainOptionK:OP,chainReaderK:OR,chainReaderKW:OR,chainW:Od,filterOrElse:OW,filterOrElseW:OW,flap:Ob,flatten:Of,flattenW:Of,fold:w4,foldW:w4,fromEither:re,fromEitherK:OU,fromOption:OA,fromOptionK:ON,fromPredicate:OF,fromReader:w1,fromReaderK:OM,getAltReaderValidation:Oy,getApplicativeReaderValidation:Og,getApplyMonoid:OJ,getApplySemigroup:OY,getCompactable:Om,getFilterable:function(t){var n=mD(t),r=Om(t),i=yr(yq,n),o=yi(yq,n),a=yo(yq,n),u=ya(yq,n);return{URI:Oh,_E:void 0,map:Ot,compact:r.compact,separate:r.separate,filter:function(t,n){return rc(t,i(n))},filterMap:function(t,n){return rc(t,o(n))},partition:function(t,n){return rc(t,a(n))},partitionMap:function(t,n){return rc(t,u(n))}}},getOrElse:w5,getOrElseW:w5,getReaderValidation:function(t){var n=Og(t),r=Oy(t);return{URI:Oh,_E:void 0,map:Ot,ap:n.ap,of:w0,chain:Oo,bimap:On,mapLeft:Or,alt:r.alt,throwError:wX}},getSemigroup:OQ,left:wX,leftReader:w2,local:yw,map:Ou,mapLeft:Ol,match:w3,matchE:w4,matchEW:w4,matchW:w3,of:w0,orElse:w9,orElseFirst:w8,orElseFirstW:w8,orElseW:w9,orLeft:w7,readerEither:{URI:Oh,bimap:On,mapLeft:Or,map:Ot,of:w0,ap:Oi,chain:Oo,alt:Oa,throwError:wX},right:w0,rightReader:w1,sequenceArray:OZ,swap:Oe,throwError:wX,toUnion:w6,traverseArray:OG,traverseArrayWithIndex:OH,traverseReadonlyArrayWithIndex:OH,traverseReadonlyNonEmptyArrayWithIndex:OK},Symbol.toStringTag,{value:"Module"}));function O0(t){return function(n){return function(){return t.of(n)}}}function O1(t){return function(n){return function(r){return function(i){return t.map(r(i),n)}}}}function O2(t){return function(n){return function(r){return function(i){return t.ap(r(i),n(i))}}}}function O3(t){return function(n){return function(r){return function(i){return t.chain(r(i),function(t){return n(t)(i)})}}}}function O4(t){return function(n){return ro(n,t.of)}}let O5=Object.freeze(Object.defineProperty({__proto__:null,ap:O2,chain:O3,fromNaturalTransformation:function(t){return function(n){return ro(n,t)}},fromReader:O4,getReaderM:function(t){var n=O2(t),r=O1(t),i=O3(t);return{map:function(t,n){return rc(t,r(n))},ap:function(t,r){return rc(t,n(r))},of:O0(t),chain:function(t,n){return rc(t,i(n))},ask:function(){return t.of},asks:function(n){return ro(n,t.of)},local:function(t,n){return function(r){return t(n(r))}},fromReader:O4(t),fromM:function(t){return function(){return t}}}},map:O1,of:O0},Symbol.toStringTag,{value:"Module"}));var O6=function(t){return function(){return Promise.resolve().then(t)}},O9=function(t,n){return rc(t,kt(n))},O8=function(t,n){return rc(t,kn(n))},O7=function(t,n){return rc(t,ki(function(t){return rc(n,kt(t))}))},ke=function(t,n){return rc(t,ki(n))},kt=function(t){return function(n){return function(){return Promise.resolve().then(n).then(t)}}},kn=function(t){return function(n){return function(){return Promise.all([Promise.resolve().then(n),Promise.resolve().then(t)]).then(function(t){var n;return(0,t[0])(t[1])})}}},kr=function(t){return function(){return Promise.resolve(t)}},ki=function(t){return function(n){return function(){return Promise.resolve().then(n).then(function(n){return t(n)()})}}},ko=ki(n7),ka="Task",ku={URI:ka,map:O9},ks=rB(ku),kl={URI:ka,of:kr},kc={URI:ka,map:O9,ap:O8},kd=rj(kc),kf=rA(kc),kp={URI:ka,map:O9,ap:O8,of:kr},kh={URI:ka,map:O9,ap:O7},km={URI:ka,map:O9,ap:O7,of:kr},kg={URI:ka,map:O9,ap:O8,chain:ke},ky={URI:ka,map:O9,of:kr,ap:O8,chain:ke},kv=rZ(kg),kb={URI:ka,fromIO:O6},kx=yb(kb),k_=yx(kb,kg),kS=y_(kb,kg),kT=function(){return new Promise(function(t){})},kw=kr(rI),kO=rV(ku),kk=rY(kg),kC=rN(kc),kI=kr(rC),kM=function(t){return function(n){return function(){return Promise.all(n.map(function(n,r){return Promise.resolve().then(function(){return t(r,n)()})}))}}},kR=function(t){var n=kM(t);return function(t){return rw(t)?n(t):kI}},kE=function(t){return function(n){return function(){return rk(n).reduce(function(n,r,i){return n.then(function(n){return Promise.resolve().then(t(i+1,r)).then(function(t){return n.push(t),n})})},Promise.resolve().then(t(0,rO(n))).then(rT))}}},kj=function(t){var n=kE(t);return function(t){return rw(t)?n(t):kI}},kA=function(t){return kR(function(n,r){return t(r)})},kN=kA(n7),kP=function(t){return kj(function(n,r){return t(r)})},kL=kP(n7),kD=rP(kh),kF=rK(km);let kW=Object.freeze(Object.defineProperty({__proto__:null,ApT:kI,ApplicativePar:kp,ApplicativeSeq:km,ApplyPar:kc,ApplySeq:kh,Chain:kg,Do:kw,FromIO:kb,FromTask:{URI:ka,fromIO:O6,fromTask:n7},Functor:ku,Monad:ky,MonadIO:{URI:ka,map:O9,of:kr,ap:O8,chain:ke,fromIO:O6},MonadTask:{URI:ka,map:O9,of:kr,ap:O8,chain:ke,fromIO:O6,fromTask:n7},Pointed:kl,URI:ka,ap:kn,apFirst:kd,apS:kC,apSecond:kf,bind:kk,bindTo:kO,chain:ki,chainFirst:kv,chainFirstIOK:kS,chainIOK:k_,delay:function(t){return function(n){return function(){return new Promise(function(r){setTimeout(function(){Promise.resolve().then(n).then(r)},t)})}}},flap:ks,flatten:ko,fromIO:O6,fromIOK:kx,fromTask:n7,getMonoid:kF,getRaceMonoid:function(){return{concat:function(t,n){return function(){return Promise.race([Promise.resolve().then(t),Promise.resolve().then(n)])}},empty:kT}},getSemigroup:kD,map:kt,never:kT,of:kr,sequenceArray:kN,sequenceSeqArray:kL,task:{URI:ka,map:O9,of:kr,ap:O8,chain:ke,fromIO:O6,fromTask:n7},taskSeq:{URI:ka,map:O9,of:kr,ap:O7,chain:ke,fromIO:O6,fromTask:n7},traverseArray:kA,traverseArrayWithIndex:kR,traverseReadonlyArrayWithIndex:kR,traverseReadonlyArrayWithIndexSeq:kj,traverseReadonlyNonEmptyArrayWithIndex:kM,traverseReadonlyNonEmptyArrayWithIndexSeq:kE,traverseSeqArray:kP,traverseSeqArrayWithIndex:kj},Symbol.toStringTag,{value:"Module"}));var kU=O4(kl),kz=ro(O6,re),kB=function(t,n){return rc(t,kK(n))},kV=function(t,n){return rc(t,kH(n))},k$=function(t,n){return rc(t,kZ(function(t){return rc(n,kK(t))}))},kq=function(t,n){return rc(t,kZ(n))},kK=O1(ku),kH=O2(kc),kG=O0(kl),kZ=O3(ky),kY=kZ(n7),kJ="ReaderTask",kQ={URI:kJ,map:kB},kX=rB(kQ),k0={URI:kJ,of:kG},k1={URI:kJ,map:kB,ap:kV},k2=rj(k1),k3=rA(k1),k4={URI:kJ,map:kB,ap:k$},k5={URI:kJ,map:kB,ap:k$,of:kG},k6={URI:kJ,map:kB,ap:kV,chain:kq},k9={URI:kJ,map:kB,of:kG,ap:kV,chain:kq},k8=rZ(k6),k7={URI:kJ,fromIO:kz},Ce=yb(k7),Ct=yx(k7,k6),Cn=y_(k7,k6),Cr={URI:kJ,fromReader:kU},Ci=vr(Cr),Co=vi(Cr),Ca=vo(Cr),Cu=va(Cr,k6),Cs=vu(Cr,k6),Cl={URI:kJ,fromIO:kz,fromTask:re},Cc=vZ(Cl),Cd=vY(Cl,k6),Cf=vJ(Cl,k6),Cp=kG(rI),Ch=rV(kQ),Cm=rY(k6),Cg=rN(k1),Cy=kG(rC),Cv=function(t){return ro(y6(t),yE(kM(rd)))},Cb=function(t){var n=Cv(t);return function(t){return rw(t)?n(t):Cy}},Cx=function(t){return ro(y6(t),yE(kE(rd)))},C_=function(t){var n=Cx(t);return function(t){return rw(t)?n(t):Cy}},CS=function(t){return Cb(function(n,r){return t(r)})},CT=CS(n7),Cw=function(t){return C_(function(n,r){return t(r)})},CO=Cw(n7),Ck=rP(k4),CC=rK(k5);function CI(t,n){return t(n)()}let CM=Object.freeze(Object.defineProperty({__proto__:null,ApT:Cy,ApplicativePar:{URI:kJ,map:kB,ap:kV,of:kG},ApplicativeSeq:k5,ApplyPar:k1,ApplySeq:k4,Chain:k6,Do:Cp,FromIO:k7,FromReader:Cr,FromTask:Cl,Functor:kQ,Monad:k9,MonadIO:{URI:kJ,map:kB,of:kG,ap:kV,chain:kq,fromIO:kz},MonadTask:{URI:kJ,map:kB,of:kG,ap:kV,chain:kq,fromIO:kz,fromTask:re},Pointed:k0,URI:kJ,ap:kH,apFirst:k2,apS:Cg,apSW:Cg,apSecond:k3,apW:kH,ask:Ci,asks:Co,asksReaderTask:yO,asksReaderTaskW:yO,bind:Cm,bindTo:Ch,bindW:Cm,chain:kZ,chainFirst:k8,chainFirstIOK:Cn,chainFirstReaderK:Cs,chainFirstReaderKW:Cs,chainFirstTaskK:Cf,chainFirstW:k8,chainIOK:Ct,chainReaderK:Cu,chainReaderKW:Cu,chainTaskK:Cd,chainW:kZ,flap:kX,flatten:kY,flattenW:kY,fromIO:kz,fromIOK:Ce,fromReader:kU,fromReaderK:Ca,fromTask:re,fromTaskK:Cc,getMonoid:CC,getSemigroup:Ck,local:yw,map:kK,of:kG,readerTask:{URI:kJ,map:kB,of:kG,ap:kV,chain:kq,fromIO:kz,fromTask:re},readerTaskSeq:{URI:kJ,map:kB,of:kG,ap:k$,chain:kq,fromIO:kz,fromTask:re},run:CI,sequenceArray:CT,sequenceSeqArray:CO,traverseArray:CS,traverseArrayWithIndex:Cb,traverseReadonlyArrayWithIndex:Cb,traverseReadonlyArrayWithIndexSeq:C_,traverseReadonlyNonEmptyArrayWithIndex:Cv,traverseReadonlyNonEmptyArrayWithIndexSeq:Cx,traverseSeqArray:Cw,traverseSeqArrayWithIndex:C_},Symbol.toStringTag,{value:"Module"}));var CR=globalThis&&globalThis.__awaiter||function(t,n,r,i){return new(r||(r=Promise))(function(o,a){function u(t){try{l(i.next(t))}catch(n){a(n)}}function s(t){try{l(i.throw(t))}catch(n){a(n)}}function l(t){var n;t.done?o(t.value):((n=t.value)instanceof r?n:new r(function(t){t(n)})).then(u,s)}l((i=i.apply(t,n||[])).next())})},CE=globalThis&&globalThis.__generator||function(t,n){var r,i,o,a,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(r)throw TypeError("Generator is already executing.");for(;u;)try{if(r=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,i=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){u=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){u.label=a[1];break}if(6===a[0]&&u.label<o[1]){u.label=o[1],o=a;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(a);break}o[2]&&u.ops.pop(),u.trys.pop();continue}a=n.call(t,u)}catch(s){a=[6,s],i=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},Cj=gW(kl),CA=gF(kl),CN=gU(ku),CP=gz(ku),CL=ro(O6,CN),CD=ro(O6,CP),CF=function(t){return kt(ge(t))},CW=gQ(ku),CU=gX(ky),Cz=g0(ky),CB=function(t,n){return function(){return CR(void 0,void 0,void 0,function(){var r;return CE(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,t().then(rS)];case 1:return[2,r.sent()];case 2:return[2,r_(n(r.sent()))];case 3:return[2]}})})}},CV=function(t,n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return CB(function(){return t.apply(void 0,r)},n)}},C$=g5(ku),Cq=gB(kl),CK=gV(kl),CH=g$(ky),CG=g1(ky),CZ=g2(ky),CY=function(t){return CZ(Ij(t))},CJ=function(t){return CZ(IL(t))},CQ=g3(ky),CX=g4(ku),C0=function(t){var n=CF(t);return function(t){return ro(t,n)}},C1=function(t){return function(n){return function(r){return rc(r,Io(C0(t)(n)))}}},C2=function(t){return ro(t,O6)},C3=function(t){return Ia(C2(t))},C4=function(t,n){return rc(t,It(n))},C5=function(t,n){return rc(t,Ii(n))},C6=function(t,n){return rc(t,Io(function(t){return rc(n,It(t))}))},C9=function(t,n){return rc(t,Io(n))},C8=function(t,n,r){return rc(t,In(n,r))},C7=function(t,n){return rc(t,Ir(n))},Ie=function(t,n){return rc(t,Is(n))},It=gq(ku),In=gZ(ku),Ir=gY(ku),Ii=gK(kc),Io=gH(ky),Ia=Io,Iu=Ia(n7),Is=gG(ky),Il="TaskEither";function Ic(t,n){var r=rE(t,mW(n));return{URI:Il,_E:void 0,map:C4,ap:function(t,n){return rc(t,r(n))},of:CA}}function Id(t){var n=gJ(ky,t);return{URI:Il,_E:void 0,map:C4,alt:function(t,r){return rc(t,n(r))}}}var If=function(t){var n=mL(t);return{URI:Il,_E:void 0,compact:h3(ku,n),separate:h4(ku,n,mB)}},Ip={URI:Il,map:C4},Ih=rB(Ip),Im={URI:Il,map:C4,ap:C5},Ig=rj(Im),Iy=rA(Im),Iv={URI:Il,map:C4,ap:C6},Ib={URI:Il,map:C4,ap:C6,of:CA},Ix={URI:Il,map:C4,ap:C5,chain:C9},I_=rZ(Ix),IS={URI:Il,fromEither:kr},IT=rQ(IS),Iw=r0(IS),IO=r1(IS,Ix),Ik=r3(IS,Ix),IC=r4(IS,Ix),II=rX(IS),IM=r5(IS,Ix),IR=r2(IS),IE={URI:Il,fromIO:CL},Ij=yb(IE),IA=yx(IE,Ix),IN=y_(IE,Ix),IP={URI:Il,fromIO:CL,fromTask:CN},IL=vZ(IP),ID=vY(IP,Ix),IF=vJ(IP,Ix),IW=function(t,n,r){return IU(t,n,r)},IU=function(t,n,r){return rc(t,Ia(function(t){return rc(n(t),ki(function(n){return rc(r(t,n),Ia(function(){return kr(n)}))}))}))},Iz=CA(rI),IB=rV(Ip),IV=rY(Ix),I$=rN(Im),Iq=CA(rC),IK=function(t){return ro(kM(t),kt(gI(rd)))},IH=function(t){var n=IK(t);return function(t){return rw(t)?n(t):Iq}},IG=function(t){return function(n){return function(){return rk(n).reduce(function(n,r,i){return n.then(function(o){return rb(o)?n:t(i+1,r)().then(function(t){return rb(t)?t:(o.right.push(t.right),o)})})},t(0,rO(n))().then(mz(rT)))}}},IZ=function(t){var n=IG(t);return function(t){return rw(t)?n(t):Iq}},IY=function(t){return IH(function(n,r){return t(r)})},IJ=IY(n7),IQ=function(t){return IZ(function(n,r){return t(r)})},IX=IQ(n7),I0=rP(Iv),I1=rK(Ib),I2=function(t){return rP(kh)(mP(t))};let I3=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:Il,map:C4,alt:Ie},ApT:Iq,ApplicativePar:{URI:Il,map:C4,ap:C5,of:CA},ApplicativeSeq:Ib,ApplyPar:Im,ApplySeq:Iv,Bifunctor:{URI:Il,bimap:C8,mapLeft:C7},Chain:Ix,Do:Iz,FromEither:IS,FromIO:IE,FromTask:IP,Functor:Ip,Monad:{URI:Il,map:C4,ap:C5,chain:C9,of:CA},MonadIO:{URI:Il,map:C4,ap:C5,chain:C9,of:CA,fromIO:CL},MonadTask:{URI:Il,map:C4,ap:C5,chain:C9,of:CA,fromIO:CL,fromTask:CN},MonadThrow:{URI:Il,map:C4,ap:C5,chain:C9,of:CA,throwError:Cj},Pointed:{URI:Il,of:CA},URI:Il,alt:Is,altW:Is,ap:Ii,apFirst:Ig,apFirstW:Ig,apS:I$,apSW:I$,apSecond:Iy,apSecondW:Iy,apW:Ii,bimap:In,bind:IV,bindTo:IB,bindW:IV,bracket:IW,bracketW:IU,chain:Io,chainEitherK:Ik,chainEitherKW:Ik,chainFirst:I_,chainFirstEitherK:IC,chainFirstEitherKW:IC,chainFirstIOK:IN,chainFirstTaskK:IF,chainFirstW:I_,chainIOEitherK:C3,chainIOEitherKW:C3,chainIOK:IA,chainNullableK:CH,chainOptionK:IO,chainTaskK:ID,chainTaskOptionK:C1,chainTaskOptionKW:C1,chainW:Ia,filterOrElse:IM,filterOrElseW:IM,flap:Ih,flatten:Iu,flattenW:Iu,fold:CU,foldW:CU,fromEither:kr,fromEitherK:IR,fromIO:CL,fromIOEither:O6,fromIOEitherK:C2,fromIOK:Ij,fromNullable:Cq,fromNullableK:CK,fromOption:IT,fromOptionK:Iw,fromPredicate:II,fromTask:CN,fromTaskK:IL,fromTaskOption:CF,fromTaskOptionK:C0,getAltTaskValidation:Id,getApplicativeTaskValidation:Ic,getApplyMonoid:I1,getApplySemigroup:I0,getCompactable:If,getFilterable:function(t){var n=mD(t),r=If(t),i=yr(ku,n),o=yi(ku,n),a=yo(ku,n),u=ya(ku,n);return{URI:Il,_E:void 0,map:C4,compact:r.compact,separate:r.separate,filter:function(t,n){return rc(t,i(n))},filterMap:function(t,n){return rc(t,o(n))},partition:function(t,n){return rc(t,a(n))},partitionMap:function(t,n){return rc(t,u(n))}}},getOrElse:Cz,getOrElseW:Cz,getSemigroup:I2,getTaskValidation:function(t){var n=Ic(kp,t),r=Id(t);return{URI:Il,_E:void 0,map:C4,ap:n.ap,of:CA,chain:C9,bimap:C8,mapLeft:C7,alt:r.alt,fromIO:CL,fromTask:CN,throwError:Cj}},left:Cj,leftIO:CD,leftTask:CP,map:It,mapLeft:Ir,match:CW,matchE:CU,matchEW:CU,matchW:CW,of:CA,orElse:CG,orElseFirst:CZ,orElseFirstIOK:CY,orElseFirstTaskK:CJ,orElseFirstW:CZ,orElseW:CG,orLeft:CQ,right:CA,rightIO:CL,rightTask:CN,sequenceArray:IJ,sequenceSeqArray:IX,swap:CX,taskEither:{URI:Il,bimap:C8,mapLeft:C7,map:C4,of:CA,ap:C5,chain:C9,alt:Ie,fromIO:CL,fromTask:CN,throwError:Cj},taskEitherSeq:{URI:Il,bimap:C8,mapLeft:C7,map:C4,of:CA,ap:C6,chain:C9,alt:Ie,fromIO:CL,fromTask:CN,throwError:Cj},taskify:function(t){return function(){var n=Array.prototype.slice.call(arguments);return function(){return new Promise(function(r){var i=function(t,n){return null!=t?r(r_(t)):r(rS(n))};t.apply(null,n.concat(i))})}}},throwError:Cj,toUnion:C$,traverseArray:IY,traverseArrayWithIndex:IH,traverseReadonlyArrayWithIndex:IH,traverseReadonlyArrayWithIndexSeq:IZ,traverseReadonlyNonEmptyArrayWithIndex:IK,traverseReadonlyNonEmptyArrayWithIndexSeq:IG,traverseSeqArray:IQ,traverseSeqArrayWithIndex:IZ,tryCatch:CB,tryCatchK:CV},Symbol.toStringTag,{value:"Module"}));var I4=gW(k0),I5=gF(k0),I6=ro(CN,re),I9=ro(CP,re),I8=function(t){return ro(t,CA)},I7=function(t){return ro(t,Cj)},Me=gU(kQ),Mt=gz(kQ),Mn=ro(CL,re),Mr=ro(CD,re),Mi=ro(O6,re),Mo=function(t){return ro(t,kr)},Ma=gQ(kQ),Mu=gX(k6),Ms=g0(k9),Ml=g5(kQ),Mc=gB(k0),Md=gV(k0),Mf=g$(k9),Mp=g1(k9),Mh=g2(k9),Mm=g3(k9),Mg=g4(kQ),My=function(t){return ro(t,Mi)},Mv=function(t){return MD(My(t))},Mb=function(t){return ro(t,re)},Mx=function(t){return MD(Mb(t))},M_=function(t){return M0(Mb(t))},MS=function(t){return ro(t,Mo)},MT=function(t){return MD(MS(t))},Mw=function(t){return M0(MS(t))},MO=function(t,n){return rc(t,Mj(n))},Mk=function(t,n){return rc(t,MP(n))},MC=function(t,n){return rc(t,ML(function(t){return rc(n,Mj(t))}))},MI=function(t,n){return rc(t,ML(n))},MM=function(t,n){return rc(t,MW(n))},MR=function(t,n,r){return rc(t,MA(n,r))},ME=function(t,n){return rc(t,MN(n))},Mj=gq(kQ),MA=gZ(kQ),MN=gY(kQ),MP=gK(k1),ML=gH(k9),MD=ML,MF=MD(n7),MW=gG(k9),MU="ReaderTaskEither",Mz=function(t){var n=mL(t);return{URI:MU,_E:void 0,compact:h3(kQ,n),separate:h4(kQ,n,mB)}};function MB(t,n){var r=rE(yG,Ic(t,n));return{URI:MU,_E:void 0,map:MO,ap:function(t,n){return rc(t,r(n))},of:I5}}function MV(t){var n=gJ(k9,t);return{URI:MU,_E:void 0,map:MO,alt:function(t,r){return rc(t,n(r))}}}var M$={URI:MU,map:MO},Mq=rB(M$),MK={URI:MU,of:I5},MH={URI:MU,map:MO,ap:Mk},MG=rj(MH),MZ=rA(MH),MY={URI:MU,map:MO,ap:MC},MJ={URI:MU,map:MO,ap:MC,of:I5},MQ={URI:MU,map:MO,ap:Mk,chain:MI},MX=rZ(MQ),M0=MX,M1={URI:MU,fromReader:I8},M2=vr(M1),M3=vi(M1),M4=vo(M1),M5=va(M1,MQ),M6=vu(M1,MQ),M9=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return Me(t.apply(void 0,n))}},M8=function(t){return MD(M9(t))},M7=function(t){return M0(M9(t))},Re={URI:MU,fromEither:kG},Rt=rQ(Re),Rn=r0(Re),Rr=r1(Re,MQ),Ri=r3(Re,MQ),Ro=r4(Re,MQ),Ra=rX(Re),Ru=r5(Re,MQ),Rs=r2(Re),Rl={URI:MU,fromIO:Mn},Rc=yb(Rl),Rd=yx(Rl,MQ),Rf=y_(Rl,MQ),Rp={URI:MU,fromIO:Mn,fromTask:I6},Rh=vZ(Rp),Rm=vY(Rp,MQ),Rg=vJ(Rp,MQ);function Ry(t,n,r){return Rv(t,n,r)}function Rv(t,n,r){return function(i){return IU(t(i),function(t){return n(t)(i)},function(t,n){return r(t,n)(i)})}}var Rb=I5(rI),Rx=rV(M$),R_=rY(MQ),RS=rN(MH),RT=I5(rC),Rw=function(t){return ro(y6(t),yE(IK(rd)))},RO=function(t){var n=Rw(t);return function(t){return rw(t)?n(t):RT}},Rk=function(t){return ro(y6(t),yE(IG(rd)))},RC=function(t){var n=Rk(t);return function(t){return rw(t)?n(t):RT}},RI=function(t){return RO(function(n,r){return t(r)})},RM=RI(n7),RR=function(t){return RC(function(n,r){return t(r)})},RE=RR(n7),Rj=rP(MY),RA=rK(MJ),RN=function(t){return rP(k4)(mP(t))};function RP(t,n){return t(n)()}let RL=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:MU,map:MO,alt:MM},ApT:RT,ApplicativePar:{URI:MU,map:MO,ap:Mk,of:I5},ApplicativeSeq:MJ,ApplyPar:MH,ApplySeq:MY,Bifunctor:{URI:MU,bimap:MR,mapLeft:ME},Chain:MQ,Do:Rb,FromEither:Re,FromIO:Rl,FromReader:M1,FromTask:Rp,Functor:M$,Monad:{URI:MU,map:MO,ap:Mk,chain:MI,of:I5},MonadIO:{URI:MU,map:MO,ap:Mk,chain:MI,of:I5,fromIO:Mn},MonadTask:{URI:MU,map:MO,ap:Mk,chain:MI,of:I5,fromIO:Mn,fromTask:I6},MonadThrow:{URI:MU,map:MO,ap:Mk,chain:MI,of:I5,throwError:I4},Pointed:MK,URI:MU,alt:MW,altW:MW,ap:MP,apFirst:MG,apFirstW:MG,apS:RS,apSW:RS,apSecond:MZ,apSecondW:MZ,apW:MP,ask:M2,asks:M3,asksReaderTaskEither:yO,asksReaderTaskEitherW:yO,bimap:MA,bind:R_,bindTo:Rx,bindW:R_,bracket:Ry,bracketW:Rv,chain:ML,chainEitherK:Ri,chainEitherKW:Ri,chainFirst:MX,chainFirstEitherK:Ro,chainFirstEitherKW:Ro,chainFirstIOK:Rf,chainFirstReaderEitherK:Mw,chainFirstReaderEitherKW:Mw,chainFirstReaderK:M6,chainFirstReaderKW:M6,chainFirstReaderTaskK:M7,chainFirstReaderTaskKW:M7,chainFirstTaskEitherK:M_,chainFirstTaskEitherKW:M_,chainFirstTaskK:Rg,chainFirstW:M0,chainIOEitherK:Mv,chainIOEitherKW:Mv,chainIOK:Rd,chainNullableK:Mf,chainOptionK:Rr,chainReaderEitherK:MT,chainReaderEitherKW:MT,chainReaderK:M5,chainReaderKW:M5,chainReaderTaskK:M8,chainReaderTaskKW:M8,chainTaskEitherK:Mx,chainTaskEitherKW:Mx,chainTaskK:Rm,chainW:MD,filterOrElse:Ru,filterOrElseW:Ru,flap:Mq,flatten:MF,flattenW:MF,fold:Mu,foldW:Mu,fromEither:kG,fromEitherK:Rs,fromIO:Mn,fromIOEither:Mi,fromIOEitherK:My,fromIOK:Rc,fromNullable:Mc,fromNullableK:Md,fromOption:Rt,fromOptionK:Rn,fromPredicate:Ra,fromReader:I8,fromReaderEither:Mo,fromReaderEitherK:MS,fromReaderK:M4,fromReaderTaskK:M9,fromTask:I6,fromTaskEither:re,fromTaskEitherK:Mb,fromTaskK:Rh,getAltReaderTaskValidation:MV,getApplicativeReaderTaskValidation:MB,getApplyMonoid:RA,getApplySemigroup:Rj,getCompactable:Mz,getFilterable:function(t){var n=mD(t),r=Mz(t),i=yr(kQ,n),o=yi(kQ,n),a=yo(kQ,n),u=ya(kQ,n);return{URI:MU,_E:void 0,map:MO,compact:r.compact,separate:r.separate,filter:function(t,n){return rc(t,i(n))},filterMap:function(t,n){return rc(t,o(n))},partition:function(t,n){return rc(t,a(n))},partitionMap:function(t,n){return rc(t,u(n))}}},getOrElse:Ms,getOrElseW:Ms,getReaderTaskValidation:function(t){var n=MB(kp,t),r=MV(t);return{URI:MU,_E:void 0,map:MO,of:I5,chain:MI,bimap:MR,mapLeft:ME,ap:n.ap,alt:r.alt,fromIO:Mn,fromTask:I6,throwError:I4}},getSemigroup:RN,left:I4,leftIO:Mr,leftReader:I7,leftReaderTask:Mt,leftTask:I9,local:yw,map:Mj,mapLeft:MN,match:Ma,matchE:Mu,matchEW:Mu,matchW:Ma,of:I5,orElse:Mp,orElseFirst:Mh,orElseFirstW:Mh,orElseW:Mp,orLeft:Mm,readerTaskEither:{URI:MU,map:MO,of:I5,ap:Mk,chain:MI,alt:MM,bimap:MR,mapLeft:ME,fromIO:Mn,fromTask:I6,throwError:I4},readerTaskEitherSeq:{URI:MU,map:MO,of:I5,ap:MC,chain:MI,alt:MM,bimap:MR,mapLeft:ME,fromIO:Mn,fromTask:I6,throwError:I4},right:I5,rightIO:Mn,rightReader:I8,rightReaderTask:Me,rightTask:I6,run:RP,sequenceArray:RM,sequenceSeqArray:RE,swap:Mg,throwError:I4,toUnion:Ml,traverseArray:RI,traverseArrayWithIndex:RO,traverseReadonlyArrayWithIndex:RO,traverseReadonlyArrayWithIndexSeq:RC,traverseReadonlyNonEmptyArrayWithIndex:Rw,traverseReadonlyNonEmptyArrayWithIndexSeq:Rk,traverseSeqArray:RR,traverseSeqArrayWithIndex:RC},Symbol.toStringTag,{value:"Module"}));var RD={equals:function(t,n){return t===n}},RF={concat:function(t,n){return t+n}},RW={concat:RF.concat,empty:""},RU={equals:RD.equals,compare:function(t,n){return t<n?-1:t>n?1:0}},Rz=function(t){return"string"==typeof t},RB=function(t){return t.toUpperCase()},RV=function(t){return t.toLowerCase()},R$=function(t,n){return function(r){return r.replace(t,n)}},Rq=function(t){return t.trim()},RK=function(t){return t.trimLeft()},RH=function(t){return t.trimRight()},RG=function(t,n){return function(r){return r.slice(t,n)}},RZ=function(t){return 0===t.length},RY=function(t){return t.length},RJ=function(t){return function(n){var r=n.split(t);return rw(r)?r:[n]}},RQ=function(t,n){return function(r){return r.includes(t,n)}},RX=function(t,n){return function(r){return r.startsWith(t,n)}},R0=function(t,n){return function(r){return r.endsWith(t,n)}};let R1=Object.freeze(Object.defineProperty({__proto__:null,Eq:RD,Monoid:RW,Ord:RU,Semigroup:RF,Show:{show:function(t){return JSON.stringify(t)}},empty:"",endsWith:R0,includes:RQ,isEmpty:RZ,isString:Rz,replace:R$,size:RY,slice:RG,split:RJ,startsWith:RX,toLowerCase:RV,toUpperCase:RB,trim:Rq,trimLeft:RK,trimRight:RH},Symbol.toStringTag,{value:"Module"}));var R2=function(t){return Object.assign({},t)},R3=function(t){return Object.assign({},t)},R4=function(t){return Object.keys(t).length},R5=function(t){for(var n in t)if(rM.call(t,n))return!1;return!0},R6=function(t){return function(n){return Object.keys(n).sort(t.compare)}},R9=R6(RU);function R8(t){if("function"==typeof t)return R8(RU)(t);var n=R6(t);return function(t){return function(r){for(var i=[],o=0,a=n(r);o<a.length;o++){var u=a[o];i.push(t(u,r[u]))}return i}}}var R7=R8(RU)(function(t,n){return[t,n]}),Ee=function(t,n){return function(r){if(rM.call(r,t)&&r[t]===n)return r;var i=Object.assign({},r);return i[t]=n,i}},Et=function(t,n){return rM.call(n,t)};function En(t){return function(n){if(!rM.call(n,t))return n;var r=Object.assign({},n);return delete r[t],r}}var Er=function(t,n){return function(r){if(!Et(t,r))return ry;if(r[t]===n)return rv(r);var i=Object.assign({},r);return i[t]=n,rv(i)}},Ei=function(t,n){return function(r){if(!Et(t,r))return ry;var i=n(r[t]);if(i===r[t])return rv(r);var o=Object.assign({},r);return o[t]=i,rv(o)}};function Eo(t){return function(n,r){if(void 0===r){var i=Eo(t);return function(t){return i(t,n)}}for(var o in n)if(!rM.call(r,o)||!t.equals(n[o],r[o]))return!1;return!0}}function Ea(t,n){return void 0===n?function(n){return Ea(t,n)}:rM.call(n,t)?rv(n[t]):ry}var Eu={};function Es(t){return function(n){var r={};for(var i in n)rM.call(n,i)&&(r[i]=t(i,n[i]));return r}}function El(t){return Es(function(n,r){return t(r)})}function Ec(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(2===t.length)return Ec(RU).apply(void 0,t);var r=R6(t[0]);return function(t,n){return function(i){for(var o=t,a=r(i),u=a.length,s=0;s<u;s++){var l=a[s];o=n(l,o,i[l])}return o}}}function Ed(t){if("compare"in t){var n=R6(t);return function(t){return function(r){return function(i){for(var o=t.empty,a=n(i),u=a.length,s=0;s<u;s++){var l=a[s];o=t.concat(o,r(l,i[l]))}return o}}}}return Ed(RU)(t)}function Ef(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(2===t.length)return Ef(RU).apply(void 0,t);var r=R6(t[0]);return function(t,n){return function(i){for(var o=t,a=r(i),u=a.length,s=u-1;s>=0;s--){var l=a[s];o=n(l,i[l],o)}return o}}}var Ep=function(t,n){var r;return(r={})[t]=n,r};function Eh(t){var n=EY(RU)(t);return function(t){return function(r){return n(r,t)}}}function Em(t){var n=EG(RU)(t);return function(t){return function(r){return n(r,t)}}}function Eg(t){return EZ(RU)(t)}var Ey=function(t){var n=Em(t);return function(r){return function(i){return t.map(rc(i,n(r)),E4)}}},Ev=function(t){var n=Em(t);return function(r){return function(i){return t.map(rc(i,n(r)),E5)}}};function Eb(t){return function(n){var r={},i={};for(var o in n)if(rM.call(n,o)){var a=t(o,n[o]);switch(a._tag){case"Left":r[o]=a.left;break;case"Right":i[o]=a.right}}return so(r,i)}}function Ex(t){return function(n){var r={},i={};for(var o in n)if(rM.call(n,o)){var a=n[o];t(o,a)?i[o]=a:r[o]=a}return so(r,i)}}function E_(t){return function(n){var r={};for(var i in n)if(rM.call(n,i)){var o=t(i,n[i]);rg(o)&&(r[i]=o.value)}return r}}function ES(t){return function(n){var r={},i=!1;for(var o in n)if(rM.call(n,o)){var a=n[o];t(o,a)?r[o]=a:i=!0}return i?r:n}}function ET(t,n){var r=Ew(t,n);return function(t){return r(t,n7)}}function Ew(t,n){return function(r,i){return n.reduce(r,{},function(n,r){var o=i(r),a=o[0],u=o[1];return n[a]=rM.call(n,a)?t.concat(n[a],u):u,n})}}var EO=function(t){for(var n={},r=0;r<t.length;r++){var i=t[r];n[i[0]]=i[1]}return n};function Ek(t){return function(n){for(var r in n)if(!t(n[r]))return!1;return!0}}function EC(t){return function(n){for(var r in n)if(t(n[r]))return!0;return!1}}function EI(t){return function(n,r){if(void 0===r){var i=EI(t);return function(t){return i(n,t)}}for(var o in r)if(t.equals(r[o],n))return!0;return!1}}var EM=function(t){return function(n){return function(r){if(R5(r))return n;if(R5(n))return r;var i={};for(var o in r)Et(o,n)?i[o]=t.concat(r[o],n[o]):i[o]=r[o];for(var o in n)Et(o,i)||(i[o]=n[o]);return i}}},ER=function(t){return function(n){return function(r){if(R5(r)||R5(n))return Eu;var i={};for(var o in r)Et(o,n)&&(i[o]=t.concat(r[o],n[o]));return i}}},EE=function(t){return function(n){if(R5(n))return t;if(R5(t))return n;var r={};for(var i in n)Et(i,t)||(r[i]=n[i]);for(var i in t)Et(i,n)||(r[i]=t[i]);return r}},Ej=function(t,n){return rc(t,El(n))},EA=function(t,n){return rc(t,Es(n))},EN=function(t){var n=E1(t);return function(t,r,i){return rc(t,n(r,i))}},EP=function(t){return function(n){var r=E2(t)(n);return function(t,n){return rc(t,r(n))}}},EL=function(t){var n=E3(t);return function(t,r,i){return rc(t,n(r,i))}},ED=function(t,n){return rc(t,EJ(n))},EF=function(t,n){return rc(t,EQ(n))},EW=function(t,n){return rc(t,EX(n))},EU=function(t,n){return rc(t,E0(n))},Ez=function(t){var n=Ec(t);return function(t,r,i){return rc(t,n(r,i))}},EB=function(t){var n=Ed(t);return function(t){var r=n(t);return function(t,n){return rc(t,r(n))}}},EV=function(t){var n=Ef(t);return function(t,r,i){return rc(t,n(r,i))}},E$=function(t,n){return rc(t,Eb(n))},Eq=function(t,n){return rc(t,Ex(n))},EK=function(t,n){return rc(t,E_(n))},EH=function(t,n){return rc(t,ES(n))},EG=function(t){var n=EY(t);return function(t){var r=n(t);return function(t,n){return r(t,ro(rd,n))}}},EZ=function(t){var n=EG(t);return function(t){var r=n(t);return function(t){return r(t,n7)}}},EY=function(t){return function(n){var r=R6(t);return function(t,i){var o=r(t);if(0===o.length)return n.of(Eu);for(var a=n.of({}),u=function(r){a=n.ap(n.map(a,function(t){return function(n){var i;return Object.assign({},t,((i={})[r]=n,i))}}),i(r,t[r]))},s=0;s<o.length;s++)u(o[s]);return a}}},EJ=function(t){return ES(function(n,r){return t(r)})},EQ=function(t){return E_(function(n,r){return t(r)})},EX=function(t){return Ex(function(n,r){return t(r)})},E0=function(t){return Eb(function(n,r){return t(r)})};function E1(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(1===t.length){var r=Ec(t[0]);return function(t,n){return r(t,function(t,r,i){return n(r,i)})}}return E1(RU).apply(void 0,t)}function E2(t){if("compare"in t){var n=Ed(t);return function(t){var r=n(t);return function(t){return r(function(n,r){return t(r)})}}}return E2(RU)(t)}function E3(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(1===t.length){var r=Ef(t[0]);return function(t,n){return r(t,function(t,r,i){return n(r,i)})}}return E3(RU).apply(void 0,t)}var E4=function(t){var n={};for(var r in t)if(rM.call(t,r)){var i=t[r];rg(i)&&(n[r]=i.value)}return n},E5=function(t){var n={},r={};for(var i in t)if(rM.call(t,i)){var o=t[i];rb(o)?n[i]=o.left:r[i]=o.right}return so(n,r)},E6="ReadonlyRecord";function E9(t){return"compare"in t?function(n){return{show:function(r){var i=R8(t)(function(t,r){return"".concat(JSON.stringify(t),": ").concat(n.show(r))})(r).join(", ");return""===i?"{}":"{ ".concat(i," }")}}}:E9(RU)(t)}function E8(t){var n=Eo(t);return r9(function(t,r){return n(t)(r)&&n(r)(t)})}function E7(t){return{concat:function(n,r){if(R5(n))return r;if(R5(r))return n;var i=Object.assign({},n);for(var o in r)rM.call(r,o)&&(i[o]=rM.call(n,o)?t.concat(n[o],r[o]):r[o]);return i},empty:Eu}}var je={URI:E6,map:Ej},jt=rB(je),jn=function(t){return{URI:E6,reduce:EN(t),foldMap:EP(t),reduceRight:EL(t)}},jr=function(t){return{URI:E6,reduce:EN(t),foldMap:EP(t),reduceRight:EL(t),reduceWithIndex:Ez(t),foldMapWithIndex:EB(t),reduceRightWithIndex:EV(t)}},ji={URI:E6,compact:E4,separate:E5},jo=function(t){return{URI:E6,map:Ej,reduce:EN(t),foldMap:EP(t),reduceRight:EL(t),traverse:EG(t),sequence:EZ(t)}},ja=function(t){return{URI:E6,map:Ej,mapWithIndex:EA,reduce:EN(t),foldMap:EP(t),reduceRight:EL(t),reduceWithIndex:Ez(t),foldMapWithIndex:EB(t),reduceRightWithIndex:EV(t),traverse:EG(t),sequence:EZ(t),traverseWithIndex:EY(t)}},ju=function(t){var n=jo(t);return{URI:E6,map:Ej,reduce:EN(t),foldMap:EP(t),reduceRight:EL(t),traverse:n.traverse,sequence:n.sequence,compact:E4,separate:E5,filter:ED,filterMap:EF,partition:EW,partitionMap:EU,wither:sv(n,ji),wilt:sy(n,ji)}},js=function(t){var n=EM(t);return{concat:function(t,r){return n(r)(t)}}},jl=function(t){return{concat:js(t).concat,empty:Eu}},jc=function(t){var n=ER(t);return{concat:function(t,r){return n(r)(t)}}},jd=function(){return{concat:function(t,n){return EE(n)(t)}}},jf={URI:E6,reduce:EN(RU),foldMap:EP(RU),reduceRight:EL(RU)},jp={URI:E6,reduce:EN(RU),foldMap:EP(RU),reduceRight:EL(RU),reduceWithIndex:Ez(RU),foldMapWithIndex:EB(RU),reduceRightWithIndex:EV(RU)},jh={URI:E6,map:Ej,reduce:EN(RU),foldMap:EP(RU),reduceRight:EL(RU),traverse:EG(RU),sequence:Eg},jm={URI:E6,map:Ej,mapWithIndex:EA,reduce:EN(RU),foldMap:EP(RU),reduceRight:EL(RU),reduceWithIndex:Ez(RU),foldMapWithIndex:EB(RU),reduceRightWithIndex:EV(RU),traverse:EG(RU),sequence:Eg,traverseWithIndex:EY(RU)},jg=sv(jh,ji),jy=sy(jh,ji),jv={URI:E6,map:Ej,reduce:EN(RU),foldMap:EP(RU),reduceRight:EL(RU),traverse:EG(RU),sequence:Eg,compact:E4,separate:E5,filter:ED,filterMap:EF,partition:EW,partitionMap:EU,wither:jg,wilt:jy};function jb(t,n){return rM.call(void 0===n?this:n,t)}var jx={URI:E6,map:Ej,reduce:EN(RU),foldMap:EP(RU),reduceRight:EL(RU),traverse:EG(RU),sequence:Eg,compact:E4,separate:E5,filter:ED,filterMap:EF,partition:EW,partitionMap:EU,mapWithIndex:EA,reduceWithIndex:Ez(RU),foldMapWithIndex:EB(RU),reduceRightWithIndex:EV(RU),filterMapWithIndex:EK,filterWithIndex:EH,partitionMapWithIndex:E$,partitionWithIndex:Eq,traverseWithIndex:EY(RU),wither:jg,wilt:jy};let j_=Object.freeze(Object.defineProperty({__proto__:null,Compactable:ji,Filterable:{URI:E6,map:Ej,compact:E4,separate:E5,filter:ED,filterMap:EF,partition:EW,partitionMap:EU},FilterableWithIndex:{URI:E6,map:Ej,mapWithIndex:EA,compact:E4,separate:E5,filter:ED,filterMap:EF,partition:EW,partitionMap:EU,filterMapWithIndex:EK,filterWithIndex:EH,partitionMapWithIndex:E$,partitionWithIndex:Eq},Foldable:jf,FoldableWithIndex:jp,Functor:je,FunctorWithIndex:{URI:E6,map:Ej,mapWithIndex:EA},Traversable:jh,TraversableWithIndex:jm,URI:E6,Witherable:jv,_filter:ED,_filterMap:EF,_filterMapWithIndex:EK,_filterWithIndex:EH,_foldMap:EP,_foldMapWithIndex:EB,_map:Ej,_mapWithIndex:EA,_partition:EW,_partitionMap:EU,_partitionMapWithIndex:E$,_partitionWithIndex:Eq,_reduce:EN,_reduceRight:EL,_reduceRightWithIndex:EV,_reduceWithIndex:Ez,_sequence:EZ,_traverse:EG,collect:R8,compact:E4,deleteAt:En,difference:EE,elem:EI,empty:Eu,every:Ek,filter:EJ,filterMap:EQ,filterMapWithIndex:E_,filterWithIndex:ES,flap:jt,foldMap:E2,foldMapWithIndex:Ed,fromEntries:EO,fromFoldable:ET,fromFoldableMap:Ew,fromRecord:R2,getDifferenceMagma:jd,getEq:E8,getFoldable:jn,getFoldableWithIndex:jr,getIntersectionSemigroup:jc,getMonoid:E7,getShow:E9,getTraversable:jo,getTraversableWithIndex:ja,getUnionMonoid:jl,getUnionSemigroup:js,getWitherable:ju,has:Et,hasOwnProperty:jb,insertAt:Ee,intersection:ER,isEmpty:R5,isSubrecord:Eo,keys:R9,lookup:Ea,map:El,mapWithIndex:Es,modifyAt:Ei,partition:EX,partitionMap:E0,partitionMapWithIndex:Eb,partitionWithIndex:Ex,pop:function(t){var n=En(t);return function(r){var i=Ea(t,r);return rm(i)?ry:rv([i.value,n(r)])}},readonlyRecord:jx,reduce:E1,reduceRight:E3,reduceRightWithIndex:Ef,reduceWithIndex:Ec,separate:E5,sequence:Eg,singleton:Ep,size:R4,some:EC,toEntries:R7,toReadonlyArray:R7,toRecord:R3,toUnfoldable:function(t){return function(n){var r=R7(n),i=r.length;return t.unfold(0,function(t){return t<i?rv([r[t],t+1]):ry})}},traverse:Em,traverseWithIndex:Eh,union:EM,updateAt:Er,upsertAt:Ee,wilt:Ev,wither:Ey},Symbol.toStringTag,{value:"Module"}));var jS=function(t){return new Set(t)},jT=function(t){return new Set([t])},jw=function(t){return function(n){for(var r=n.length,i=new Set,o=jV(t),a=0;a<r;a++){var u=n[a];o(u,i)||i.add(u)}return i}};function jO(t){return function(n){for(var r,i=n.values(),o=new Set;!(r=i.next()).done;){var a=r.value;t(a)&&o.add(a)}return o}}function jk(t){var n=jV(t);return function(r,i){if(void 0===i){var o=jk(t);return function(t){return o(r,t)}}if(jF(r))return i;if(jF(i))return r;var a=new Set(r);return i.forEach(function(t){n(t,a)||a.add(t)}),a}}function jC(t){var n=jV(t);return function(r,i){if(void 0===i){var o=jC(t);return function(t){return o(t,r)}}if(jF(r)||jF(i))return jD;var a=new Set;return r.forEach(function(t){n(t,i)&&a.add(t)}),a}}function jI(t){var n=jV(t);return function(r,i){if(void 0===i){var o=jI(t);return function(t){return o(t,r)}}return jO(function(t){return!n(t,i)})(r)}}function jM(t){var n=j$(t);return function(t,r){return function(i){return n(i).reduce(r,t)}}}function jR(t,n){var r=j$(t);return function(t){return function(i){return r(i).reduce(function(r,i){return n.concat(r,t(i))},n.empty)}}}var jE=function(t){var n=j$(t);return function(t,r){return function(i){return n(i).reduceRight(function(t,n){return r(n,t)},t)}}};function jj(t){var n=jV(t);return function(t){return function(r){if(n(t)(r))return r;var i=new Set(r);return i.add(t),i}}}var jA=function(t){return function(n){return function(r){return jO(function(r){return!t.equals(n,r)})(r)}}},jN=function(t){var n=jV(t),r=jA(t),i=jj(t);return function(t){return function(o){return(n(t,o)?r:i)(t)(o)}}},jP=function(t){return jL(t)(n7)};function jL(t){var n=jV(t);return function(t){return function(r){var i=new Set;return r.forEach(function(r){var o=t(r);"Some"!==o._tag||n(o.value,i)||i.add(o.value)}),i}}}var jD=new Set,jF=function(t){return 0===t.size},jW=function(t){return t.size},jU=function(t){return function(n){for(var r,i=n.values(),o=!1;!o&&!(r=i.next()).done;)o=t(r.value);return o}};function jz(t){return pk(jU(pk(t)))}function jB(t){var n=jV(t);return function(r,i){if(void 0===i){var o=jB(t);return function(t){return o(t,r)}}return jz(function(t){return n(t,i)})(r)}}function jV(t){return function(n,r){if(void 0===r){var i=jV(t);return function(t){return i(n,t)}}for(var o,a=r.values(),u=!1;!u&&!(o=a.next()).done;)u=t.equals(n,o.value);return u}}var j$=function(t){return function(n){var r=[];return n.forEach(function(t){return r.push(t)}),r.sort(t.compare)}};function jq(t){return{show:function(n){var r=[];return n.forEach(function(n){r.push(t.show(n))}),"new Set([".concat(r.sort().join(", "),"])")}}}function jK(t){var n=jB(t);return r9(function(t,r){return n(t,r)&&n(r,t)})}var jH=function(t){return{concat:jk(t)}},jG=function(t){return{concat:jH(t).concat,empty:jD}},jZ=function(t){return{concat:jC(t)}},jY=function(t){return{concat:jI(t)}};let jJ=Object.freeze(Object.defineProperty({__proto__:null,URI:"ReadonlySet",chain:function(t){var n=jV(t);return function(t){return function(r){var i=new Set;return r.forEach(function(r){t(r).forEach(function(t){n(t,i)||i.add(t)})}),i}}},compact:jP,difference:jI,elem:jV,empty:jD,every:jz,filter:jO,filterMap:jL,foldMap:jR,fromArray:jw,fromReadonlyArray:jw,fromSet:jS,getDifferenceMagma:jY,getEq:jK,getIntersectionSemigroup:jZ,getShow:jq,getUnionMonoid:jG,getUnionSemigroup:jH,insert:jj,intersection:jC,isEmpty:jF,isSubset:jB,map:function(t){var n=jV(t);return function(t){return function(r){var i=new Set;return r.forEach(function(r){var o=t(r);n(o,i)||i.add(o)}),i}}},partition:function(t){return function(n){for(var r,i=n.values(),o=new Set,a=new Set;!(r=i.next()).done;){var u=r.value;t(u)?o.add(u):a.add(u)}return so(a,o)}},partitionMap:function(t,n){return function(r){return function(i){for(var o,a=i.values(),u=new Set,s=new Set,l=jV(t),c=jV(n);!(o=a.next()).done;){var d=r(o.value);switch(d._tag){case"Left":l(d.left,u)||u.add(d.left);break;case"Right":c(d.right,s)||s.add(d.right)}}return so(u,s)}}},reduce:jM,reduceRight:jE,remove:jA,separate:function(t,n){return function(r){var i=jV(t),o=jV(n),a=new Set,u=new Set;return r.forEach(function(t){switch(t._tag){case"Left":i(t.left,a)||a.add(t.left);break;case"Right":o(t.right,u)||u.add(t.right)}}),so(a,u)}},singleton:jT,size:jW,some:jU,toReadonlyArray:j$,toSet:function(t){return new Set(t)},toggle:jN,union:jk},Symbol.toStringTag,{value:"Module"}));function jQ(t){return t[0]}function jX(t){return t[1]}var j0=function(t){var n;return[jX(t),t[0]]};function j1(t){return{URI:Ah,_E:void 0,map:j5,ap:function(n,r){var i,o;return[(0,n[0])(r[0]),t.concat(jX(n),jX(r))]}}}var j2=function(t){return function(n){return[n,t.empty]}};function j3(t){var n=j1(t);return{URI:Ah,_E:void 0,map:n.map,ap:n.ap,chain:function(n,r){var i,o=r(n[0]),a=o[0],u=o[1];return[a,t.concat(jX(n),u)]}}}var j4=function(t,n){return rc(t,Aa(n))},j5=function(t,n){return rc(t,Ai(n))},j6=function(t,n,r){return rc(t,Ar(n,r))},j9=function(t,n){return rc(t,Ao(n))},j8=function(t,n){return rc(t,Au(n))},j7=function(t,n,r){return rc(t,Al(n,r))},Ae=function(t){var n=Ac();return function(t,r){return rc(t,n(r))}},At=function(t,n,r){return rc(t,Ad(n,r))},An=function(t){var n=Af(t);return function(t,r){return rc(t,n(r))}},Ar=function(t,n){return function(r){var i;return[n(r[0]),t(jX(r))]}},Ai=function(t){return function(n){var r;return[t(n[0]),jX(n)]}},Ao=function(t){return function(n){var r;return[n[0],t(jX(n))]}},Aa=function(t){return function(n){var r;return[n[0],jX(t)]}},Au=function(t){return function(n){return[t(n),jX(n)]}},As=Au(n7),Al=function(t,n){return function(r){var i;return n(t,r[0])}},Ac=function(){return function(t){return function(n){var r;return t(n[0])}}},Ad=function(t,n){return function(r){var i;return n(r[0],t)}},Af=function(t){return function(n){return function(r){var i;return t.map(n(r[0]),function(t){return[t,jX(r)]})}}},Ap=function(t){return function(n){var r;return t.map(n[0],function(t){return[t,jX(n)]})}},Ah="ReadonlyTuple",Am={URI:Ah,map:j5},Ag=rB(Am);let Ay=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:{URI:Ah,bimap:j6,mapLeft:j9},Comonad:{URI:Ah,map:j5,extend:j8,extract:jQ},Foldable:{URI:Ah,reduce:j7,foldMap:Ae,reduceRight:At},Functor:Am,Semigroupoid:{URI:Ah,compose:j4},Traversable:{URI:Ah,map:j5,reduce:j7,foldMap:Ae,reduceRight:At,traverse:An,sequence:Ap},URI:Ah,bimap:Ar,compose:Aa,duplicate:As,extend:Au,extract:jQ,flap:Ag,foldMap:Ac,fst:jQ,getApplicative:function(t){var n=j1(t);return{URI:Ah,_E:void 0,map:n.map,ap:n.ap,of:j2(t)}},getApply:j1,getChain:j3,getChainRec:function(t){var n=function(n,r){for(var i,o,a=r(n),u=t.empty,s=(i=a)[0];"Left"===s._tag;)u=t.concat(u,jX(a)),s=(a=r(s.left))[0];return[s.right,t.concat(u,jX(a))]},r=j3(t);return{URI:Ah,_E:void 0,map:r.map,ap:r.ap,chain:r.chain,chainRec:n}},getMonad:function(t){var n=j3(t);return{URI:Ah,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,of:j2(t)}},map:Ai,mapFst:Ai,mapLeft:Ao,mapSnd:Ao,readonlyTuple:{URI:Ah,compose:j4,map:j5,bimap:j6,mapLeft:j9,extract:jQ,extend:j8,reduce:j7,foldMap:Ae,reduceRight:At,traverse:An,sequence:Ap},reduce:Al,reduceRight:Ad,sequence:Ap,snd:jX,swap:j0,traverse:Af},Symbol.toStringTag,{value:"Module"}));var Av=globalThis&&globalThis.__assign||function(){return(Av=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)},Ab=function(t){return function(n){return Object.keys(n).sort(t.compare)}},Ax=Ab(RU);function A_(t){if("function"==typeof t)return A_(RU)(t);var n=Ab(t);return function(t){return function(r){for(var i=[],o=0,a=n(r);o<a.length;o++){var u=a[o];i.push(t(u,r[u]))}return i}}}var AS=A_(RU)(function(t,n){return[t,n]});function AT(t){return function(n){if(!rM.call(n,t))return n;var r=Object.assign({},n);return delete r[t],r}}var Aw=function(t,n){return AO(t,function(){return n})},AO=function(t,n){return function(r){if(!Et(t,r))return ry;var i=Object.assign({},r);return i[t]=n(r[t]),rv(i)}};function Ak(t){return Eh(t)}function AC(t){return Em(t)}function AI(t){return Eg(t)}var AM=function(t){var n,r=Em(t);return function(n){return function(i){return t.map(rc(i,r(n)),AU)}}},AR=function(t){var n,r=Em(t);return function(n){return function(i){return t.map(rc(i,r(n)),Az)}}};function AE(t){return Ex(t)}function Aj(t){return ES(t)}function AA(t,n){return ET(t,n)}var AN=function(t){var n,r;return(n=i$(),ET(n,fD))(t)};function AP(t,n){return Ew(t,n)}var AL=function(t){var n=EM(t);return function(t){return function(r){return R5(r)?Av({},t):R5(t)?Av({},r):n(t)(r)}}},AD=function(t){return function(n){return function(r){return R5(r)||R5(n)?{}:ER(t)(n)(r)}}},AF=function(t){return function(n){return R5(n)?Av({},t):R5(t)?Av({},n):EE(t)(n)}},AW=function(t){return function(n){var r=Ab(t);return function(t,i){var o=r(t);if(0===o.length)return n.of({});for(var a=n.of({}),u=function(r){a=n.ap(n.map(a,function(t){return function(n){return t[r]=n,t}}),i(r,t[r]))},s=0;s<o.length;s++)u(o[s]);return a}}},AU=E4,Az=E5,AB="Record",AV={URI:AB,map:Ej},A$=rB(AV),Aq=function(t){return{URI:AB,reduce:EN(t),foldMap:EP(t),reduceRight:EL(t)}},AK=function(t){return{URI:AB,reduce:EN(t),foldMap:EP(t),reduceRight:EL(t),reduceWithIndex:Ez(t),foldMapWithIndex:EB(t),reduceRightWithIndex:EV(t)}},AH={URI:AB,compact:AU,separate:Az},AG=function(t){return{URI:AB,map:Ej,reduce:EN(t),foldMap:EP(t),reduceRight:EL(t),traverse:EG(t),sequence:EZ(t)}},AZ=function(t){return{URI:AB,map:Ej,mapWithIndex:EA,reduce:EN(t),foldMap:EP(t),reduceRight:EL(t),reduceWithIndex:Ez(t),foldMapWithIndex:EB(t),reduceRightWithIndex:EV(t),traverse:EG(t),sequence:EZ(t),traverseWithIndex:AW(t)}},AY=function(t){var n=AG(t);return{URI:AB,map:Ej,reduce:EN(t),foldMap:EP(t),reduceRight:EL(t),traverse:n.traverse,sequence:n.sequence,compact:AU,separate:Az,filter:ED,filterMap:EF,partition:EW,partitionMap:EU,wither:sv(n,AH),wilt:sy(n,AH)}},AJ=function(t){var n=AL(t);return{concat:function(t,r){return n(r)(t)}}},AQ=function(t){return{concat:AJ(t).concat,empty:{}}},AX=function(t){var n=AD(t);return{concat:function(t,r){return n(r)(t)}}},A0=function(){return{concat:function(t,n){return AF(n)(t)}}},A1={URI:AB,reduce:EN(RU),foldMap:EP(RU),reduceRight:EL(RU)},A2={URI:AB,reduce:EN(RU),foldMap:EP(RU),reduceRight:EL(RU),reduceWithIndex:Ez(RU),foldMapWithIndex:EB(RU),reduceRightWithIndex:EV(RU)},A3={URI:AB,map:Ej,reduce:EN(RU),foldMap:EP(RU),reduceRight:EL(RU),traverse:EG(RU),sequence:AI},A4={URI:AB,map:Ej,mapWithIndex:EA,reduce:EN(RU),foldMap:EP(RU),reduceRight:EL(RU),reduceWithIndex:Ez(RU),foldMapWithIndex:EB(RU),reduceRightWithIndex:EV(RU),traverse:EG(RU),sequence:AI,traverseWithIndex:AW(RU)},A5=sv(A3,AH),A6=sy(A3,AH),A9={URI:AB,map:Ej,reduce:EN(RU),foldMap:EP(RU),reduceRight:EL(RU),traverse:EG(RU),sequence:AI,compact:AU,separate:Az,filter:ED,filterMap:EF,partition:EW,partitionMap:EU,wither:A5,wilt:A6},A8={URI:AB,map:Ej,reduce:EN(RU),foldMap:EP(RU),reduceRight:EL(RU),traverse:EG(RU),sequence:AI,compact:AU,separate:Az,filter:ED,filterMap:EF,partition:EW,partitionMap:EU,mapWithIndex:EA,reduceWithIndex:Ez(RU),foldMapWithIndex:EB(RU),reduceRightWithIndex:EV(RU),filterMapWithIndex:EK,filterWithIndex:EH,partitionMapWithIndex:E$,partitionWithIndex:Eq,traverseWithIndex:AW(RU),wither:A5,wilt:A6};let A7=Object.freeze(Object.defineProperty({__proto__:null,Compactable:AH,Filterable:{URI:AB,map:Ej,compact:AU,separate:Az,filter:ED,filterMap:EF,partition:EW,partitionMap:EU},FilterableWithIndex:{URI:AB,map:Ej,mapWithIndex:EA,compact:AU,separate:Az,filter:ED,filterMap:EF,partition:EW,partitionMap:EU,filterMapWithIndex:EK,filterWithIndex:EH,partitionMapWithIndex:E$,partitionWithIndex:Eq},Foldable:A1,FoldableWithIndex:A2,Functor:AV,FunctorWithIndex:{URI:AB,map:Ej,mapWithIndex:EA},Traversable:A3,TraversableWithIndex:A4,URI:AB,Witherable:A9,collect:A_,compact:AU,deleteAt:AT,difference:AF,elem:EI,empty:{},every:Ek,filter:EJ,filterMap:EQ,filterMapWithIndex:E_,filterWithIndex:Aj,flap:A$,foldMap:function(t){return"compare"in t?E2(t):E2(RU)(t)},foldMapWithIndex:function(t){return"compare"in t?Ed(t):Ed(RU)(t)},fromEntries:AN,fromFoldable:AA,fromFoldableMap:AP,getDifferenceMagma:A0,getEq:E8,getFoldable:Aq,getFoldableWithIndex:AK,getIntersectionSemigroup:AX,getMonoid:E7,getShow:function(t){return"compare"in t?E9(t):E9(RU)(t)},getTraversable:AG,getTraversableWithIndex:AZ,getUnionMonoid:AQ,getUnionSemigroup:AJ,getWitherable:AY,has:Et,hasOwnProperty:jb,insertAt:Ee,intersection:AD,isEmpty:R5,isSubrecord:Eo,keys:Ax,lookup:Ea,map:El,mapWithIndex:Es,modifyAt:AO,partition:EX,partitionMap:E0,partitionMapWithIndex:Eb,partitionWithIndex:AE,pop:function(t){var n=AT(t);return function(r){var i=Ea(t,r);return rm(i)?ry:rv([i.value,n(r)])}},record:A8,reduce:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length?E1(t[0]):E1(RU).apply(void 0,t)},reduceRight:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length?E3(t[0]):E3(RU).apply(void 0,t)},reduceRightWithIndex:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length?Ef(t[0]):Ef(RU).apply(void 0,t)},reduceWithIndex:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length?Ec(t[0]):Ec(RU).apply(void 0,t)},separate:Az,sequence:AI,singleton:Ep,size:R4,some:EC,toArray:AS,toEntries:AS,toUnfoldable:function(t){return function(n){var r=AS(n),i=r.length;return t.unfold(0,function(t){return t<i?rv([r[t],t+1]):ry})}},traverse:AC,traverseWithIndex:Ak,union:AL,updateAt:Aw,upsertAt:Ee,wilt:AR,wither:AM},Symbol.toStringTag,{value:"Module"}));var Ne=function(t){return function(n){return rg(t(n))}},Nt=function(t){return function(n){return rx(t(n))}},Nn=function(){return function(t){return!0}},Nr=function(t){return function(n){return!t(n)}},Ni=function(t){return function(n){return function(r){return n(r)||t(r)}}},No=function(t){return function(n){return function(r){return n(r)&&t(r)}}},Na=function(){return function(t){return!1}},Nu=function(t){return function(n){return function(r){return n(r)&&t(r)}}};let Ns=Object.freeze(Object.defineProperty({__proto__:null,and:No,compose:Nu,fromEitherK:Nt,fromOptionK:Ne,id:Nn,not:Nr,or:Ni,zero:Na},Symbol.toStringTag,{value:"Module"}));var Nl=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return{add:function(n,r){return t.map(function(t,i){return t.add(n[i],r[i])})},zero:t.map(function(t){return t.zero}),mul:function(n,r){return t.map(function(t,i){return t.mul(n[i],r[i])})},one:t.map(function(t){return t.one}),sub:function(n,r){return t.map(function(t,i){return t.sub(n[i],r[i])})}}},Nc=function(t){return function(n){return t.sub(t.zero,n)}};let Nd=Object.freeze(Object.defineProperty({__proto__:null,getFunctionRing:n9,getTupleRing:Nl,negate:Nc,tuple:Nl},Symbol.toStringTag,{value:"Module"})),Nf=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Np=Object.freeze(Object.defineProperty({__proto__:null,getFunctionSemiring:n6},Symbol.toStringTag,{value:"Module"}));function Nh(t){return function(n){for(var r,i=n.values(),o=new Set;!(r=i.next()).done;){var a=r.value;t(a)&&o.add(a)}return o}}function Nm(t){var n=Nj(t);return function(r,i){if(void 0===i){var o=Nm(t);return function(t){return o(r,t)}}if(NR(r))return i;if(NR(i))return r;var a=new Set(r);return i.forEach(function(t){n(t,a)||a.add(t)}),a}}function Ng(t){var n=Nj(t);return function(r,i){if(void 0===i){var o=Ng(t);return function(t){return o(t,r)}}if(NR(r)||NR(i))return new Set;var a=new Set;return r.forEach(function(t){n(t,i)&&a.add(t)}),a}}function Ny(t){var n=Nj(t);return function(r,i){if(void 0===i){var o=Ny(t);return function(t){return o(t,r)}}return Nh(function(t){return!n(t,i)})(r)}}var Nv=function(t){return{concat:Nm(t)}},Nb=function(t){return{concat:Nv(t).concat,empty:new Set}},Nx=function(t){return{concat:Ng(t)}},N_=function(t){return{concat:Ny(t)}},NS=function(t){return new Set([t])};function NT(t){var n=Nj(t);return function(t){return function(r){if(n(t)(r))return r;var i=new Set(r);return i.add(t),i}}}var Nw=function(t){return function(n){return function(r){return Nh(function(r){return!t.equals(n,r)})(r)}}},NO=function(t){var n=Nj(t),r=Nw(t),i=NT(t);return function(t){return function(o){return(n(t,o)?r:i)(t)(o)}}},Nk=function(t){return function(n){for(var r=n.length,i=new Set,o=Nj(t),a=0;a<r;a++){var u=n[a];o(u,i)||i.add(u)}return i}},NC=function(t){return NI(t)(n7)};function NI(t){var n=Nj(t);return function(t){return function(r){var i=new Set;return r.forEach(function(r){var o=t(r);"Some"!==o._tag||n(o.value,i)||i.add(o.value)}),i}}}var NM=new Set,NR=function(t){return 0===t.size},NE=function(t){return t.size},Nj=jV,NA=function(t){return function(n){var r=[];return n.forEach(function(t){return r.push(t)}),r.sort(t.compare)}};let NN=Object.freeze(Object.defineProperty({__proto__:null,chain:function(t){var n=Nj(t);return function(t){return function(r){var i=new Set;return r.forEach(function(r){t(r).forEach(function(t){n(t,i)||i.add(t)})}),i}}},compact:NC,difference:Ny,elem:Nj,empty:NM,every:jz,filter:Nh,filterMap:NI,foldMap:jR,fromArray:Nk,getDifferenceMagma:N_,getEq:jK,getIntersectionSemigroup:Nx,getShow:jq,getUnionMonoid:Nb,getUnionSemigroup:Nv,insert:NT,intersection:Ng,isEmpty:NR,isSubset:jB,map:function(t){var n=Nj(t);return function(t){return function(r){var i=new Set;return r.forEach(function(r){var o=t(r);n(o,i)||i.add(o)}),i}}},partition:function(t){return function(n){for(var r,i=n.values(),o=new Set,a=new Set;!(r=i.next()).done;){var u=r.value;t(u)?o.add(u):a.add(u)}return so(a,o)}},partitionMap:function(t,n){return function(r){return function(i){for(var o,a=i.values(),u=new Set,s=new Set,l=Nj(t),c=Nj(n);!(o=a.next()).done;){var d=r(o.value);switch(d._tag){case"Left":l(d.left,u)||u.add(d.left);break;case"Right":c(d.right,s)||s.add(d.right)}}return so(u,s)}}},reduce:jM,reduceRight:jE,remove:Nw,separate:function(t,n){return function(r){var i=Nj(t),o=Nj(n),a=new Set,u=new Set;return r.forEach(function(t){switch(t._tag){case"Left":i(t.left,a)||a.add(t.left);break;case"Right":o(t.right,u)||u.add(t.right)}}),so(a,u)}},singleton:NS,size:NE,some:jU,subset:jB,toArray:NA,toggle:NO,union:Nm},Symbol.toStringTag,{value:"Module"}));var NP=function(t){return{show:function(n){var r="{";for(var i in t)rM.call(t,i)&&(r+=" ".concat(i,": ").concat(t[i].show(n[i]),","));return r.length>1&&(r=r.slice(0,-1)+" "),r+="}"}}},NL=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return{show:function(n){return"[".concat(n.map(function(n,r){return t[r].show(n)}).join(", "),"]")}}};let ND=Object.freeze(Object.defineProperty({__proto__:null,getStructShow:NP,getTupleShow:NL,showBoolean:{show:function(t){return JSON.stringify(t)}},showNumber:{show:function(t){return JSON.stringify(t)}},showString:{show:function(t){return JSON.stringify(t)}},struct:NP,tuple:NL},Symbol.toStringTag,{value:"Module"}));function NF(t){return function(n){return function(r){return t.of([n,r])}}}function NW(t){return function(n){return function(r){return function(i){return t.map(r(i),function(t){var r=t[0],i=t[1];return[n(r),i]})}}}}function NU(t){return function(n){return function(r){return function(i){return t.chain(r(i),function(r){var i=r[0],o=r[1];return t.map(n(o),function(t){var n=t[0],r=t[1];return[i(n),r]})})}}}}function Nz(t){return function(n){return function(r){return function(i){return t.chain(r(i),function(t){var r=t[0],i=t[1];return n(r)(i)})}}}}function NB(t){return function(n){return function(r){return t.of(n(r))}}}function NV(t){return function(n){return function(r){return t.map(n,function(t){return[t,r]})}}}function N$(t){return function(n){return function(r){return t.map(r(n),function(t){return t[0]})}}}function Nq(t){return function(n){return function(r){return t.map(r(n),jX)}}}let NK=Object.freeze(Object.defineProperty({__proto__:null,ap:NU,chain:Nz,evaluate:N$,execute:Nq,fromF:NV,fromState:NB,getStateM:function(t){var n=NU(t),r=NW(t),i=Nz(t),o=N$(t),a=Nq(t);return{map:function(t,n){return rc(t,r(n))},ap:function(t,r){return rc(t,n(r))},of:NF(t),chain:function(t,n){return rc(t,i(n))},get:function(){return function(n){return t.of([n,n])}},put:function(n){return function(){return t.of([void 0,n])}},modify:function(n){return function(r){return t.of([void 0,n(r)])}},gets:function(n){return function(r){return t.of([n(r),r])}},fromState:NB(t),fromM:NV(t),evalState:function(t,n){return rc(t,o(n))},execState:function(t,n){return rc(t,a(n))}}},map:NW,of:NF},Symbol.toStringTag,{value:"Module"}));var NH=function(t){return function(){return I4(t)}},NG=NF(MK);function NZ(t){return N5(I6(t))}function NY(t){return N5(I8(t))}function NJ(t){return N5(Mn(t))}var NQ=function(t){return ro(t,I5)},NX=function(t){return function(n){return I4(t(n)[0])}},N0=gr(function(t){return NH(t)},NG),N1=NB(MK),N2=function(t){return N5(re(t))},N3=function(t){return N5(Mi(t))},N4=function(t){return N5(Mo(t))},N5=NV(M$),N6=function(t){return function(n){return ro(n,yw(t))}},N9=function(t){return function(n){return function(r){return t(r)(n)(r)}}},N8=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return N3(t.apply(void 0,n))}},N7=function(t){return function(n){return rc(n,Pm(N8(t)))}},Pe=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return N2(t.apply(void 0,n))}},Pt=function(t){return function(n){return rc(n,Pm(Pe(t)))}},Pn=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return N5(t.apply(void 0,n))}},Pr=function(t){return function(n){return rc(n,Pm(Pn(t)))}},Pi=function(t,n){return rc(t,Pc(n))},Po=function(t,n){return rc(t,Pp(n))},Pa=function(t,n){return rc(t,Ph(n))},Pu=function(t,n){return function(r){return rc(t(r),MW(function(){return n()(r)}))}},Ps=function(t,n,r){return function(i){return rc(t(i),MA(n,function(t){var n=t[0],i=t[1];return[r(n),i]}))}},Pl=function(t,n){return function(r){return rc(t(r),MN(n))}},Pc=NW(M$),Pd=function(t,n){return function(r){return Ps(r,t,n)}},Pf=function(t){return function(n){return Pl(n,t)}},Pp=NU(MQ),Ph=Nz(MQ),Pm=Ph,Pg=Pm(n7),Py=function(t){return function(n){return function(r){return rc(n(r),MW(function(){return t()(r)}))}}},Pv="StateReaderTaskEither",Pb={URI:Pv,map:Pi},Px=rB(Pb),P_={URI:Pv,map:Pi,ap:Po},PS=rj(P_),PT=rA(P_),Pw={URI:Pv,map:Pi,ap:Po,chain:Pa},PO={URI:Pv,fromState:N1},Pk=vB(PO),PC=vV(PO),PI=v$(PO),PM=vq(PO),PR=vK(PO),PE=vH(PO,Pw),Pj=rZ(Pw),PA={URI:Pv,fromReader:NY},PN=vr(PA),PP=vi(PA),PL=vo(PA),PD=va(PA,Pw),PF=vu(PA,Pw),PW={URI:Pv,fromEither:N0},PU=rQ(PW),Pz=r0(PW),PB=r1(PW,Pw),PV=r3(PW,Pw),P$=r4(PW,Pw),Pq=rX(PW),PK=r5(PW,Pw),PH=r2(PW),PG={URI:Pv,fromIO:NJ},PZ=yb(PG),PY=yx(PG,Pw),PJ=y_(PG,Pw),PQ={URI:Pv,fromIO:NJ,fromTask:NZ},PX=vZ(PQ),P0=vY(PQ,Pw),P1=vJ(PQ,Pw),P2=N$(M$),P3=Nq(M$),P4=rV(Pb),P5=rY(Pw),P6=rN(P_),P9=function(t){return function(n){return function(r){return function(i){return function(){return rk(n).reduce(function(n,r,o){return n.then(function(a){return rb(a)?n:t(o+1,r)(a.right[1])(i)().then(function(t){if(rb(t))return t;var n=t.right,r=n[0],i=n[1];return a.right[0].push(r),a.right[1]=i,a})})},t(0,rO(n))(r)(i)().then(mz(function(t){var n;return[[t[0]],t[1]]})))}}}}},P8=function(t){var n=P9(t);return function(t){return rw(t)?n(t):NG(rC)}},P7=function(t){return P8(function(n,r){return t(r)})},Le=P7(n7),Lt=function(t,n){return rc(t(n),Mj(function(t){return t[0]}))},Ln=function(t,n){return rc(t(n),Mj(function(t){return t[0],t[1]}))};let Lr=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:Pv,map:Pi,alt:Pu},Applicative:{URI:Pv,map:Pi,ap:Po,of:NG},Apply:P_,Bifunctor:{URI:Pv,bimap:Ps,mapLeft:Pl},Chain:Pw,FromEither:PW,FromIO:PG,FromReader:PA,FromState:PO,FromTask:PQ,Functor:Pb,Monad:{URI:Pv,map:Pi,ap:Po,of:NG,chain:Pa},MonadIO:{URI:Pv,map:Pi,ap:Po,of:NG,chain:Pa,fromIO:NJ},MonadTask:{URI:Pv,map:Pi,ap:Po,of:NG,chain:Pa,fromIO:NJ,fromTask:NZ},MonadThrow:{URI:Pv,map:Pi,ap:Po,of:NG,chain:Pa,throwError:NH},Pointed:{URI:Pv,of:NG},URI:Pv,alt:Py,altW:Py,ap:Pp,apFirst:PS,apFirstW:PS,apS:P6,apSW:P6,apSecond:PT,apSecondW:PT,apW:Pp,ask:PN,asks:PP,asksStateReaderTaskEither:N9,asksStateReaderTaskEitherW:N9,bimap:Pd,bind:P5,bindTo:P4,bindW:P5,chain:Ph,chainEitherK:PV,chainEitherKW:PV,chainFirst:Pj,chainFirstEitherK:P$,chainFirstEitherKW:P$,chainFirstIOK:PJ,chainFirstReaderK:PF,chainFirstReaderKW:PF,chainFirstTaskK:P1,chainFirstW:Pj,chainIOEitherK:N7,chainIOEitherKW:N7,chainIOK:PY,chainOptionK:PB,chainReaderK:PD,chainReaderKW:PD,chainReaderTaskEitherK:Pr,chainReaderTaskEitherKW:Pr,chainStateK:PE,chainTaskEitherK:Pt,chainTaskEitherKW:Pt,chainTaskK:P0,chainW:Pm,evalState:Lt,evaluate:P2,execState:Ln,execute:P3,filterOrElse:PK,filterOrElseW:PK,flap:Px,flatten:Pg,flattenW:Pg,fromEither:N0,fromEitherK:PH,fromIO:NJ,fromIOEither:N3,fromIOEitherK:N8,fromIOK:PZ,fromOption:PU,fromOptionK:Pz,fromPredicate:Pq,fromReader:NY,fromReaderEither:N4,fromReaderK:PL,fromReaderTaskEither:N5,fromReaderTaskEitherK:Pn,fromState:N1,fromStateK:PR,fromTask:NZ,fromTaskEither:N2,fromTaskEitherK:Pe,fromTaskK:PX,get:Pk,gets:PM,left:NH,leftIO:function(t){return N5(Mr(t))},leftReader:function(t){return N5(I7(t))},leftState:NX,leftTask:function(t){return N5(I9(t))},local:N6,map:Pc,mapLeft:Pf,modify:PI,of:NG,put:PC,right:NG,rightIO:NJ,rightReader:NY,rightState:NQ,rightTask:NZ,run:function(t,n,r){return t(n)(r)()},sequenceArray:Le,stateReaderTaskEither:{URI:Pv,map:Pi,of:NG,ap:Po,chain:Pa,bimap:Ps,mapLeft:Pl,alt:Pu,fromIO:NJ,fromTask:NZ,throwError:NH},stateReaderTaskEitherSeq:{URI:Pv,map:Pi,of:NG,ap:Po,chain:Pa,bimap:Ps,mapLeft:Pl,alt:Pu,fromIO:NJ,fromTask:NZ,throwError:NH},throwError:NH,traverseArray:P7,traverseArrayWithIndex:P8,traverseReadonlyArrayWithIndex:P8,traverseReadonlyNonEmptyArrayWithIndex:P9},Symbol.toStringTag,{value:"Module"}));var Li=function(t,n){return rc(t,Ll(n))},Lo=function(t,n){return rc(t,La(n))},La=function(t){return function(n){return{peek:function(r){return t({peek:n.peek,pos:r})},pos:n.pos}}},Lu=function(t){return t.peek(t.pos)},Ls=La(n7),Ll=function(t){return function(n){return{peek:function(r){return t(n.peek(r))},pos:n.pos}}},Lc="Store",Ld={URI:Lc,map:Li},Lf=rB(Ld),Lp={URI:Lc,map:Li,extend:Lo,extract:Lu};let Lh=Object.freeze(Object.defineProperty({__proto__:null,Comonad:Lp,Functor:Ld,URI:Lc,duplicate:Ls,experiment:function(t){return function(n){return function(r){return t.map(n(r.pos),function(t){return r.peek(t)})}}},extend:La,extract:Lu,flap:Lf,map:Ll,peeks:function(t){return function(n){return n.peek(t(n.pos))}},seek:function(t){return function(n){return{peek:n.peek,pos:t}}},seeks:function(t){return function(n){return{peek:n.peek,pos:t(n.pos)}}},store:Lp},Symbol.toStringTag,{value:"Module"}));function Lm(t,n){return function(r,i){return n.compose(t.second(i),t.first(r))}}function Lg(t,n){var r=Lm(t,n);return function(i,o){return n.compose(r(i,o),t.promap(n.id(),n7,function(t){return[t,t]}))}}let Ly=Object.freeze(Object.defineProperty({__proto__:null,fanOut:Lg,fanout:function(t){return Lg(t,t)},split:Lm,splitStrong:function(t){return Lm(t,t)}},Symbol.toStringTag,{value:"Module"}));var Lv=function(){return{concat:function(t,n){return Object.assign({},t,n)}}},Lb=function(t){return function(n){var r={};for(var i in n)rM.call(n,i)&&(r[i]=t[i](n[i]));return r}};let Lx=Object.freeze(Object.defineProperty({__proto__:null,evolve:Lb,getAssignSemigroup:Lv},Symbol.toStringTag,{value:"Module"}));var L_=globalThis&&globalThis.__awaiter||function(t,n,r,i){return new(r||(r=Promise))(function(o,a){function u(t){try{l(i.next(t))}catch(n){a(n)}}function s(t){try{l(i.throw(t))}catch(n){a(n)}}function l(t){var n;t.done?o(t.value):((n=t.value)instanceof r?n:new r(function(t){t(n)})).then(u,s)}l((i=i.apply(t,n||[])).next())})},LS=globalThis&&globalThis.__generator||function(t,n){var r,i,o,a,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(r)throw TypeError("Generator is already executing.");for(;u;)try{if(r=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,i=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){u=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){u.label=a[1];break}if(6===a[0]&&u.label<o[1]){u.label=o[1],o=a;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(a);break}o[2]&&u.ops.pop(),u.trys.pop();continue}a=n.call(t,u)}catch(s){a=[6,s],i=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},LT=_u(kl),Lw=_m(kl),LO=_g(kl),Lk=function(t){return LC(O6(t))},LC=_l(ku),LI=kt(pj),LM=_y(ku),LR=_v(kg),LE=_b(ky),Lj=_c(kl),LA=function(t){return function(){return L_(void 0,void 0,void 0,function(){return LS(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,t().then(rv)];case 1:return[2,n.sent()];case 2:return n.sent(),[2,ry];case 3:return[2]}})})}},LN=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return LA(function(){return t.apply(void 0,n)})}},LP=_d(kl),LL=_f(ky),LD=_p(kl),LF=_h(ky),LW=_x(ku),LU=__(kc),Lz=_S(ky),LB=Lz(n7),LV=_T(ky),L$=_s(kl),Lq=L$(),LK=h3(ku,hu),LH=h4(ku,hu,pQ),LG=yr(ku,hf),LZ=yi(ku,hf),LY=yo(ku,hf),LJ=ya(ku,hf),LQ=function(t,n){return rc(t,LW(n))},LX=function(t,n){return rc(t,LU(n))},L0=function(t,n){return rc(t,Lz(n))},L1=function(t,n){return rc(t,LV(n))},L2=function(t,n){return rc(t,LG(n))},L3=function(t,n){return rc(t,LZ(n))},L4=function(t,n){return rc(t,LY(n))},L5=function(t,n){return rc(t,LJ(n))},L6="TaskOption",L9={URI:L6,map:LQ},L8=rB(L9),L7={URI:L6,of:LT},De={URI:L6,map:LQ,ap:LX},Dt=rj(De),Dn=rA(De),Dr=function(t,n){return rc(t,Lz(function(t){return rc(n,LW(t))}))},Di={URI:L6,map:LQ,ap:LX,chain:L0},Do=rZ(Di),Da={URI:L6,zero:L$},Du=s_(Da,L7),Ds={URI:L6,fromIO:Lk},Dl=yb(Ds),Dc=yx(Ds,Di),Dd=y_(Ds,Di),Df={URI:L6,fromEither:LO},Dp=r2(Df),Dh=r3(Df,Di),Dm=r4(Df,Di),Dg={URI:L6,fromIO:Lk,fromTask:LC},Dy=vZ(Dg),Dv=vY(Dg,Di),Db=vJ(Dg,Di),Dx=LT(rI),D_=rV(L9),DS=rY(Di),DT=rN(De),Dw=LT(rC),DO=function(t){return ro(kM(t),kt(hH(rd)))},Dk=function(t){var n=DO(t);return function(t){return rw(t)?n(t):Dw}},DC=function(t){return function(n){return function(){return rk(n).reduce(function(n,r,i){return n.then(function(o){return rm(o)?n:t(i+1,r)().then(function(t){return rm(t)?t:(o.value.push(t.value),o)})})},t(0,rO(n))().then(pJ(rT)))}}},DI=function(t){var n=DC(t);return function(t){return rw(t)?n(t):Dw}},DM=function(t){return Dk(function(n,r){return t(r)})},DR=DM(n7),DE=function(t){return DI(function(n,r){return t(r)})},Dj=DE(n7);let DA=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:L6,map:LQ,alt:L1},Alternative:{URI:L6,map:LQ,ap:LX,of:LT,alt:L1,zero:L$},ApT:Dw,ApplicativePar:{URI:L6,map:LQ,ap:LX,of:LT},ApplicativeSeq:{URI:L6,map:LQ,ap:Dr,of:LT},ApplyPar:De,ApplySeq:{URI:L6,map:LQ,ap:Dr},Chain:Di,Compactable:{URI:L6,compact:LK,separate:LH},Do:Dx,Filterable:{URI:L6,map:LQ,compact:LK,separate:LH,filter:L2,filterMap:L3,partition:L4,partitionMap:L5},FromEither:Df,FromIO:Ds,FromTask:Dg,Functor:L9,Monad:{URI:L6,map:LQ,ap:LX,of:LT,chain:L0},MonadIO:{URI:L6,map:LQ,ap:LX,of:LT,chain:L0,fromIO:Lk},MonadTask:{URI:L6,map:LQ,ap:LX,of:LT,chain:L0,fromIO:Lk,fromTask:LC},Pointed:L7,Zero:Da,alt:LV,altW:LV,ap:LU,apFirst:Dt,apS:DT,apSecond:Dn,bind:DS,bindTo:D_,chain:Lz,chainEitherK:Dh,chainFirst:Do,chainFirstEitherK:Dm,chainFirstIOK:Dd,chainFirstTaskK:Db,chainIOK:Dc,chainNullableK:LL,chainOptionK:LF,chainTaskK:Dv,compact:LK,filter:LG,filterMap:LZ,flap:L8,flatten:LB,fold:LR,foldW:LR,fromEither:LO,fromEitherK:Dp,fromIO:Lk,fromIOK:Dl,fromNullable:Lj,fromNullableK:LP,fromOption:kr,fromOptionK:LD,fromPredicate:Lw,fromTask:LC,fromTaskEither:LI,fromTaskK:Dy,getOrElse:LE,getOrElseW:LE,guard:Du,map:LW,match:LM,matchE:LR,matchEW:LR,matchW:LM,none:Lq,of:LT,partition:LY,partitionMap:LJ,separate:LH,sequenceArray:DR,sequenceSeqArray:Dj,some:LT,traverseArray:DM,traverseArrayWithIndex:Dk,traverseReadonlyArrayWithIndex:Dk,traverseReadonlyArrayWithIndexSeq:DI,traverseReadonlyNonEmptyArrayWithIndex:DO,traverseReadonlyNonEmptyArrayWithIndexSeq:DC,traverseSeqArray:DE,traverseSeqArrayWithIndex:DI,tryCatch:LA,tryCatchK:LN,zero:L$},Symbol.toStringTag,{value:"Module"}));var DN=function(t){return"Left"===t._tag},DP=function(t){return"Right"===t._tag};function DL(t){return"Both"===t._tag}function DD(t){return{_tag:"Left",left:t}}function DF(t){return{_tag:"Right",right:t}}function DW(t,n){return{_tag:"Both",left:t,right:n}}var DU=function(t,n,r){return function(i){switch(i._tag){case"Left":return t(i.left);case"Right":return n(i.right);case"Both":return r(i.left,i.right)}}},Dz=DU(DF,DD,function(t,n){return DW(n,t)});function DB(t,n){return{concat:function(r,i){return DN(r)?DN(i)?DD(t.concat(r.left,i.left)):DP(i)?DW(r.left,i.right):DW(t.concat(r.left,i.left),i.right):DP(r)?DN(i)?DW(i.left,r.right):DP(i)?DF(n.concat(r.right,i.right)):DW(i.left,n.concat(r.right,i.right)):DN(i)?DW(t.concat(r.left,i.left),r.right):DP(i)?DW(r.left,n.concat(r.right,i.right)):DW(t.concat(r.left,i.left),n.concat(r.right,i.right))}}}var DV=function(t){return{URI:D9,_E:void 0,map:DK,ap:function(n,r){return DN(n)?DN(r)?DD(t.concat(n.left,r.left)):DP(r)?DD(n.left):DD(t.concat(n.left,r.left)):DP(n)?DN(r)?DD(r.left):DP(r)?DF(n.right(r.right)):DW(r.left,n.right(r.right)):DN(r)?DD(t.concat(n.left,r.left)):DP(r)?DW(n.left,n.right(r.right)):DW(t.concat(n.left,r.left),n.right(r.right))}}};function D$(t){var n=DV(t),r=function(n,r){if(DN(n))return n;if(DP(n))return r(n.right);var i=r(n.right);return DN(i)?DD(t.concat(n.left,i.left)):DP(i)?DW(n.left,i.right):DW(t.concat(n.left,i.left),i.right)};return{URI:D9,_E:void 0,map:DK,ap:n.ap,chain:r}}var Dq=function(t,n){return rm(t)?rm(n)?ry:rv(DF(n.value)):rm(n)?rv(DD(t.value)):rv(DW(t.value,n.value))},DK=function(t,n){return rc(t,D1(n))},DH=function(t,n,r){return rc(t,DX(n,r))},DG=function(t,n){return rc(t,D0(n))},DZ=function(t,n,r){return rc(t,D2(n,r))},DY=function(t){var n=D3(t);return function(t,r){return rc(t,n(r))}},DJ=function(t,n,r){return rc(t,D4(n,r))},DQ=function(t){var n=D5(t);return function(t,r){return rc(t,n(r))}},DX=function(t,n){return function(r){return DN(r)?DD(t(r.left)):DP(r)?DF(n(r.right)):DW(t(r.left),n(r.right))}},D0=function(t){return function(n){return DN(n)?DD(t(n.left)):DL(n)?DW(t(n.left),n.right):n}},D1=function(t){return function(n){return DN(n)?n:DP(n)?DF(t(n.right)):DW(n.left,t(n.right))}},D2=function(t,n){return function(r){return DN(r)?t:n(t,r.right)}},D3=function(t){return function(n){return function(r){return DN(r)?t.empty:n(r.right)}}},D4=function(t,n){return function(r){return DN(r)?t:n(r.right,t)}},D5=function(t){return function(n){return function(r){return DN(r)?t.of(r):DP(r)?t.map(n(r.right),DF):t.map(n(r.right),function(t){return DW(r.left,t)})}}},D6=function(t){return function(n){return DN(n)?t.of(n):DP(n)?t.map(n.right,DF):t.map(n.right,function(t){return DW(n.left,t)})}},D9="These",D8={URI:D9,map:DK},D7=rB(D8),Fe={URI:D9,fromEither:n7},Ft=rQ(Fe),Fn=r0(Fe),Fr=function(t){return function(n){return function(r){return!DN(r)&&t.equals(n,r.right)}}},Fi=function(t){return function(n){return!DN(n)&&t(n.right)}},Fo=function(t,n){return function(r){return DN(r)?[r.left,n()]:DP(r)?[t(),r.right]:[r.left,r.right]}},Fa=function(t,n){return Fo(function(){return t},function(){return n})},Fu=DF(rC),Fs=function(t){return function(n){return function(r){var i=ry,o=n(0,rO(r));if(DN(o))return o;DL(o)&&(i=rv(o.left));for(var a=[o.right],u=1;u<r.length;u++){var s=n(u,r[u]);if(DN(s))return s;DL(s)&&(i=rm(i)?rv(s.left):rv(t.concat(i.value,s.left))),a.push(s.right)}return rm(i)?DF(a):DW(i.value,a)}}},Fl=function(t){return function(n){var r=Fs(t)(n);return function(t){return rw(t)?r(t):Fu}}};let Fc=Object.freeze(Object.defineProperty({__proto__:null,ApT:Fu,Bifunctor:{URI:D9,bimap:DH,mapLeft:DG},Foldable:{URI:D9,reduce:DZ,foldMap:DY,reduceRight:DJ},FromEither:Fe,FromThese:{URI:D9,fromThese:n7},Functor:D8,Pointed:{URI:D9,of:DF},Traversable:{URI:D9,map:DK,reduce:DZ,foldMap:DY,reduceRight:DJ,traverse:DQ,sequence:D6},URI:D9,bimap:DX,both:DW,elem:Fr,exists:Fi,flap:D7,fold:DU,foldMap:D3,foldW:DU,fromOption:Ft,fromOptionK:Fn,fromOptions:Dq,getApplicative:function(t){var n=DV(t);return{URI:D9,_E:void 0,map:DK,ap:n.ap,of:DF}},getApply:DV,getChain:D$,getEq:function(t,n){return r9(function(r,i){return DN(r)?DN(i)&&t.equals(r.left,i.left):DP(r)?DP(i)&&n.equals(r.right,i.right):DL(i)&&t.equals(r.left,i.left)&&n.equals(r.right,i.right)})},getLeft:function(t){return DN(t)?rv(t.left):DP(t)?ry:rv(t.left)},getLeftOnly:function(t){return DN(t)?rv(t.left):ry},getMonad:function(t){var n=D$(t);return{URI:D9,_E:void 0,map:DK,of:DF,ap:n.ap,chain:n.chain,throwError:DD}},getRight:function(t){return DN(t)?ry:(DP(t),rv(t.right))},getRightOnly:function(t){return DP(t)?rv(t.right):ry},getSemigroup:DB,getShow:function(t,n){return{show:DU(function(n){return"left(".concat(t.show(n),")")},function(t){return"right(".concat(n.show(t),")")},function(r,i){return"both(".concat(t.show(r),", ").concat(n.show(i),")")})}},isBoth:DL,isLeft:DN,isRight:DP,left:DD,leftOrBoth:function(t){return function(n){return rm(n)?DD(t):DW(t,n.value)}},map:D1,mapLeft:D0,match:DU,matchW:DU,of:DF,reduce:D2,reduceRight:D4,right:DF,rightOrBoth:function(t){return function(n){return rm(n)?DF(t):DW(n.value,t)}},sequence:D6,swap:Dz,these:{URI:D9,map:DK,bimap:DH,mapLeft:DG,reduce:DZ,foldMap:DY,reduceRight:DJ,traverse:DQ,sequence:D6},toTuple:Fa,toTuple2:Fo,traverse:D5,traverseReadonlyArrayWithIndex:Fl,traverseReadonlyNonEmptyArrayWithIndex:Fs},Symbol.toStringTag,{value:"Module"}));function Fd(t){return ro(DF,t.of)}function Ff(t){return ro(DD,t.of)}function Fp(t){return ro(DW,t.of)}function Fh(t){return function(n){return t.map(n,DF)}}function Fm(t){return function(n){return t.map(n,DD)}}function Fg(t){return rz(t,D8)}function Fy(t,n){return rE(t,DV(n))}function Fv(t,n){var r=Ff(t);return function(i){return function(o){return t.chain(o,DU(r,i,function(r,o){return t.map(i(o),DU(function(t){return DD(n.concat(r,t))},function(t){return DW(r,t)},function(t,i){return DW(n.concat(r,t),i)}))}))}}}function Fb(t){return function(n,r){return function(i){return t.map(i,DX(n,r))}}}function Fx(t){return function(n){return function(r){return t.map(r,D0(n))}}}function F_(t){return function(n,r,i){return function(o){return t.map(o,DU(n,r,i))}}}function FS(t){return function(n,r,i){return function(o){return t.chain(o,DU(n,r,i))}}}function FT(t){return function(n){return t.map(n,Dz)}}function Fw(t){return function(n,r){return function(i){return t.map(i,Fo(n,r))}}}let FO=Object.freeze(Object.defineProperty({__proto__:null,ap:Fy,bimap:Fb,both:Fp,chain:Fv,getTheseM:function(t){var n=Fg(t),r=Fb(t),i=Fx(t),o=FS(t),a=Fw(t),u=Fd(t),s=function(t,r){return rc(t,n(r))};return{map:s,bimap:function(t,n,i){return rc(t,r(n,i))},mapLeft:function(t,n){return rc(t,i(n))},fold:function(t,n,r,i){return rc(t,o(n,r,i))},swap:FT(t),rightM:Fh(t),leftM:Fm(t),left:Ff(t),right:Fd(t),both:Fp(t),toTuple:function(t,n,r){return rc(t,a(function(){return n},function(){return r}))},getMonad:function(n){var r=Fy(t,n),i=Fv(t,n);return{_E:void 0,map:s,of:u,ap:function(t,n){return rc(t,r(n))},chain:function(t,n){return rc(t,i(n))}}}}},left:Ff,leftF:Fm,map:Fg,mapLeft:Fx,match:F_,matchE:FS,right:Fd,rightF:Fh,swap:FT,toTuple2:Fw},Symbol.toStringTag,{value:"Module"}));var Fk=Ff(kl),FC=Fd(kl),FI=Fp(kl),FM=Fh(ku),FR=Fm(ku),FE=ro(O6,FM),Fj=ro(O6,FR),FA=F_(ku),FN=FS(ky),FP=FT(ku),FL=function(t,n){return rc(t,FW(n))},FD=function(t,n,r){return rc(t,FU(n,r))},FF=function(t,n){return rc(t,Fz(n))},FW=Fg(ku),FU=Fb(ku),Fz=Fx(ku),FB="TaskThese",FV=function(t,n){var r=Fy(t,n);return{URI:FB,_E:void 0,map:FL,ap:function(t,n){return rc(t,r(n))}}};function F$(t,n){var r=FV(t,n).ap;return{URI:FB,_E:void 0,map:FL,ap:r,of:FC}}function Fq(t){var n=FV(kp,t),r=Fv(ky,t);return{URI:FB,_E:void 0,map:FL,ap:n.ap,chain:function(t,n){return rc(t,r(n))}}}var FK={URI:FB,map:FL},FH=rB(FK),FG={URI:FB,fromEither:kr},FZ=rQ(FG),FY=r0(FG),FJ=rX(FG),FQ={URI:FB,fromThese:kr},FX=vX(FQ),F0={URI:FB,fromIO:FE},F1=yb(F0),F2={URI:FB,fromIO:FE,fromTask:FM},F3=vZ(F2),F4=Fw(ku),F5=FC(rC),F6=function(t){var n=Fs(t);return function(t){return ro(kM(t),kt(n(rd)))}},F9=function(t){return function(n){var r=F6(t)(n);return function(t){return rw(t)?r(t):F5}}},F8=function(t){return function(n){return function(r){return function(){return rk(r).reduce(function(r,i,o){return r.then(function(a){return DN(a)?r:n(o+1,i)().then(function(n){if(DN(n))return n;if(DL(n)){var r=a.right;return r.push(n.right),DL(a)?DW(t.concat(a.left,n.left),r):DW(n.left,r)}return a.right.push(n.right),a})})},n(0,rO(r))().then(D1(rT)))}}}},F7=function(t){return function(n){var r=F8(t)(n);return function(t){return rw(t)?r(t):F5}}},We=function(t,n){return F4(function(){return t},function(){return n})},Wt=function(t,n){return rP(kh)(DB(t,n))};let Wn=Object.freeze(Object.defineProperty({__proto__:null,ApT:F5,Bifunctor:{URI:FB,bimap:FD,mapLeft:FF},FromEither:FG,FromIO:F0,FromTask:F2,FromThese:FQ,Functor:FK,Pointed:{URI:FB,of:FC},URI:FB,bifunctorTaskThese:{URI:FB,bimap:FD,mapLeft:FF},bimap:FU,both:FI,flap:FH,fold:FN,foldW:FN,fromEither:kr,fromIO:FE,fromIOEither:O6,fromIOK:F1,fromOption:FZ,fromOptionK:FY,fromPredicate:FJ,fromTask:FM,fromTaskK:F3,fromThese:kr,fromTheseK:FX,functorTaskThese:{URI:FB,map:FL},getApplicative:F$,getApply:FV,getChain:Fq,getMonad:function(t){var n=F$(kp,t),r=Fq(t);return{URI:FB,_E:void 0,map:FL,ap:n.ap,of:FC,chain:r.chain,fromIO:FE,fromTask:FM}},getSemigroup:Wt,left:Fk,leftIO:Fj,leftTask:FR,map:FW,mapLeft:Fz,match:FA,matchE:FN,matchEW:FN,matchW:FA,of:FC,right:FC,rightIO:FE,rightTask:FM,swap:FP,taskThese:{URI:FB,map:FL,bimap:FD,mapLeft:FF},toTuple:We,toTuple2:F4,traverseReadonlyArrayWithIndex:F9,traverseReadonlyArrayWithIndexSeq:F7,traverseReadonlyNonEmptyArrayWithIndex:F6,traverseReadonlyNonEmptyArrayWithIndexSeq:F8},Symbol.toStringTag,{value:"Module"}));var Wr=function(t,n){return rc(t,Wi(n))},Wi=function(t){return function(n){return function(r){return t(n(r))}}},Wo="Traced",Wa={URI:Wo,map:Wr},Wu=rB(Wa);let Ws=Object.freeze(Object.defineProperty({__proto__:null,Functor:Wa,URI:Wo,censor:function(t){return function(n){return function(r){return n(t(r))}}},flap:Wu,getComonad:function(t){return{URI:Wo,_E:void 0,map:Wr,extend:function(n,r){return function(i){return r(function(r){return n(t.concat(i,r))})}},extract:function(n){return n(t.empty)}}},listen:function(t){return function(n){return[t(n),n]}},listens:function(t){return function(n){return function(r){return[n(r),t(r)]}}},map:Wi,traced:Wa,tracks:function(t,n){return function(r){return r(n(r(t.empty)))}}},Symbol.toStringTag,{value:"Module"}));function Wl(t,n){return function(r){var i=t.traverse(r),o=n.traverse(r);return function(t){return function(n){return i(n,function(n){return o(n,t)})}}}}function Wc(t,n){return function(r){var i=t.sequence(r),o=n.sequence(r);return function(n){return i(t.map(n,o))}}}let Wd=Object.freeze(Object.defineProperty({__proto__:null,getTraversableComposition:function(t,n){var r=r$(t,n).map,i=yp(t,n),o=Wl(t,n),a=Wc(t,n);return{map:r,reduce:i.reduce,foldMap:i.foldMap,reduceRight:i.reduceRight,traverse:function(t){var n=o(t);return function(t,r){return rc(t,n(r))}},sequence:function(t){var n=a(t);return function(t){return rc(t,n)}}}},sequence:Wc,traverse:Wl},Symbol.toStringTag,{value:"Module"})),Wf=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function Wp(t,n){return void 0===n&&(n=[]),{value:t,forest:n}}var Wh=function(t,n){for(var r,i="",o=n.length,a=0;a<o;a++){r=n[a];var u=a===o-1;i+=t+(u?"└":"├")+"─ "+r.value,i+=Wh(t+(o>1&&!u?"│ ":" "),r.forest)}return i};function Wm(t){return Wh(`
|
|
2
|
-
`,t)}function Wg(t,n){var r,i=n(t);return{value:i[0],forest:Wy(i[1],n)}}function Wy(t,n){return t.map(function(t){return Wg(t,n)})}function Wv(t){var n=Wb(t);return function(r,i){return t.chain(i(r),function(r){var o=r[0],a=r[1];return t.map(n(a,i),function(t){return{value:o,forest:t}})})}}function Wb(t){var n=fp(t);return function(r,i){return rc(r,n(function(n){return Wv(t)(n,i)}))}}var Wx=function(t,n){return rc(t,WA(n))},W_=function(t,n){return rc(t,WM(function(t){return rc(n,WA(t))}))},WS=function(t,n){return rc(t,WM(n))},WT=function(t,n,r){return rc(t,WN(n,r))},Ww=function(t){var n=WP(t);return function(t,r){return rc(t,n(r))}},WO=function(t,n,r){return rc(t,WL(n,r))},Wk=function(t,n){return rc(t,WR(n))},WC=function(t){var n=WF(t);return function(t,r){return rc(t,n(r))}},WI=function(t){return function(n){return W_(n,t)}},WM=function(t){return function(n){var r=t(n.value),i=r.value,o=r.forest,a=f_().concat;return{value:i,forest:a(o,n.forest.map(WM(t)))}}},WR=function(t){return function(n){return{value:t(n),forest:n.forest.map(WR(t))}}},WE=WR(n7),Wj=WM(n7),WA=function(t){return function(n){return{value:t(n.value),forest:n.forest.map(WA(t))}}},WN=function(t,n){return function(r){for(var i=n(t,r.value),o=r.forest.length,a=0;a<o;a++)i=rc(r.forest[a],WN(i,n));return i}},WP=function(t){return function(n){return WN(t.empty,function(r,i){return t.concat(r,n(i))})}},WL=function(t,n){return function(r){for(var i=t,o=r.forest.length,a=o-1;a>=0;a--)i=rc(r.forest[a],WL(i,n));return n(r.value,i)}},WD=function(t){return t.value},WF=function(t){var n=fp(t),r=function(i){return function(o){return t.ap(t.map(i(o.value),function(t){return function(n){return{value:t,forest:n}}}),rc(o.forest,n(r(i))))}};return r},WW=function(t){return WF(t)(n7)},WU=function(t){return Wp(t)},Wz="Tree",WB={URI:Wz,map:Wx},WV=rB(WB),W$={URI:Wz,map:Wx,ap:W_},Wq=rj(W$),WK=rA(W$),WH={URI:Wz,map:Wx,ap:W_,chain:WS},WG=rZ(WH),WZ=WU(rI),WY=rV(WB),WJ=rY(WH),WQ=rN(W$),WX=function(t){return function(n){return t(n.value)||n.forest.some(WX(t))}};let W0=Object.freeze(Object.defineProperty({__proto__:null,Applicative:{URI:Wz,map:Wx,ap:W_,of:WU},Apply:W$,Chain:WH,Comonad:{URI:Wz,map:Wx,extend:Wk,extract:WD},Do:WZ,Foldable:{URI:Wz,reduce:WT,foldMap:Ww,reduceRight:WO},Functor:WB,Monad:{URI:Wz,map:Wx,ap:W_,of:WU,chain:WS},Pointed:{URI:Wz,of:WU},Traversable:{URI:Wz,map:Wx,reduce:WT,foldMap:Ww,reduceRight:WO,traverse:WC,sequence:WW},URI:Wz,ap:WI,apFirst:Wq,apS:WQ,apSecond:WK,bind:WJ,bindTo:WY,chain:WM,chainFirst:WG,drawForest:Wm,drawTree:function(t){return t.value+Wm(t.forest)},duplicate:WE,elem:function(t){var n=function(r,i){return t.equals(r,i.value)||i.forest.some(function(t){return n(r,t)})};return n},exists:WX,extend:WR,extract:WD,flap:WV,flatten:Wj,fold:function(t){var n=function(r){return t(r.value,r.forest.map(n))};return n},foldMap:WP,getEq:function(t){var n,r=r9(function(r,i){return t.equals(r.value,i.value)&&n.equals(r.forest,i.forest)});return n=cs(r),r},getShow:function(t){var n=function(r){return cH(r.forest)?"make(".concat(t.show(r.value),")"):"make(".concat(t.show(r.value),", [").concat(r.forest.map(n).join(", "),"])")};return{show:n}},make:Wp,map:WA,of:WU,reduce:WN,reduceRight:WL,sequence:WW,traverse:WF,tree:{URI:Wz,map:Wx,of:WU,ap:W_,chain:WS,reduce:WT,foldMap:Ww,reduceRight:WO,traverse:WC,sequence:WW,extract:WD,extend:Wk},unfoldForest:Wy,unfoldForestM:Wb,unfoldTree:Wg,unfoldTreeM:Wv},Symbol.toStringTag,{value:"Module"}));var W1=function(t){var n;return[jX(t),(n=t,n[0])]};function W2(t){return{URI:Um,_E:void 0,map:W6,ap:function(n,r){var i,o;return[(i=n,i[0])((o=r,o[0])),t.concat(jX(n),jX(r))]}}}var W3=function(t){return function(n){return[n,t.empty]}};function W4(t){var n=W2(t);return{URI:Um,_E:void 0,map:n.map,ap:n.ap,chain:function(n,r){var i,o=r((i=n,i[0])),a=o[0],u=o[1];return[a,t.concat(jX(n),u)]}}}var W5=function(t,n){return rc(t,Uu(n))},W6=function(t,n){return rc(t,Uo(n))},W9=function(t,n,r){return rc(t,Ui(n,r))},W8=function(t,n){return rc(t,Ua(n))},W7=function(t,n){return rc(t,Us(n))},Ue=function(t,n,r){return rc(t,Ud(n,r))},Ut=function(t){var n=Uc();return function(t,r){return rc(t,n(r))}},Un=function(t,n,r){return rc(t,Uf(n,r))};function Ur(t){var n=Up(t);return function(t,r){return rc(t,n(r))}}var Ui=function(t,n){return function(r){var i;return[n((i=r,i[0])),t(jX(r))]}},Uo=function(t){return function(n){var r;return[t((r=n,r[0])),jX(n)]}},Ua=function(t){return function(n){var r;return[(r=n,r[0]),t(jX(n))]}},Uu=function(t){return function(n){var r;return[(r=n,r[0]),jX(t)]}},Us=function(t){return function(n){return[t(n),jX(n)]}},Ul=Us(n7),Uc=Ac,Ud=Al,Uf=Ad,Up=function(t){return function(n){return function(r){var i;return t.map(n((i=r,i[0])),function(t){return[t,jX(r)]})}}},Uh=function(t){return function(n){var r;return t.map((r=n,r[0]),function(t){return[t,jX(n)]})}},Um="Tuple",Ug={URI:Um,map:W6},Uy=rB(Ug);let Uv=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:{URI:Um,bimap:W9,mapLeft:W8},Comonad:{URI:Um,map:W6,extend:W7,extract:jQ},Foldable:{URI:Um,reduce:Ue,foldMap:Ut,reduceRight:Un},Functor:Ug,Semigroupoid:{URI:Um,compose:W5},Traversable:{URI:Um,map:W6,reduce:Ue,foldMap:Ut,reduceRight:Un,traverse:Ur,sequence:Uh},URI:Um,bimap:Ui,compose:Uu,duplicate:Ul,extend:Us,extract:jQ,flap:Uy,foldMap:Uc,fst:jQ,getApplicative:function(t){var n=W2(t);return{URI:Um,_E:void 0,map:n.map,ap:n.ap,of:W3(t)}},getApply:W2,getChain:W4,getChainRec:function(t){var n=function(n,r){for(var i,o,a=r(n),u=t.empty,s=(i=a,i[0]);"Left"===s._tag;){u=t.concat(u,jX(a)),s=(o=a=r(s.left))[0]}return[s.right,t.concat(u,jX(a))]},r=W4(t);return{URI:Um,_E:void 0,map:r.map,ap:r.ap,chain:r.chain,chainRec:n}},getMonad:function(t){var n=W4(t);return{URI:Um,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,of:W3(t)}},map:Uo,mapFst:Uo,mapLeft:Ua,mapSnd:Ua,reduce:Ud,reduceRight:Uf,sequence:Uh,snd:jX,swap:W1,traverse:Up,tuple:{URI:Um,compose:W5,map:W6,bimap:W9,mapLeft:W8,extract:jQ,extend:W7,reduce:Ue,foldMap:Ut,reduceRight:Un,traverse:Ur,sequence:Uh}},Symbol.toStringTag,{value:"Module"})),Ub=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Ux=Object.freeze(Object.defineProperty({__proto__:null,getValidationM:function(t,n){var r=rH(n,mW(t));return{map:r.map,ap:r.ap,of:r.of,chain:function(t,r){return n.chain(t,function(t){return rb(t)?n.of(r_(t.left)):r(t.right)})},alt:function(r,i){return n.chain(r,function(r){return rx(r)?n.of(r):n.map(i(),function(n){return rb(n)?r_(t.concat(r.left,n.left)):n})})}}}},Symbol.toStringTag,{value:"Module"}));var U_=iW(void 0),US={concat:U_.concat,empty:void 0};let UT=Object.freeze(Object.defineProperty({__proto__:null,Monoid:US,Semigroup:U_},Symbol.toStringTag,{value:"Module"}));var Uw=function(t){return function(){return[void 0,t]}},UO=function(t){return function(){var n=t(),r=n[0],i=n[1];return[[r,i],i]}},Uk=function(t){return function(){var n,r=t(),i=r[0],o=i[0];return[o,(0,i[1])(r[1])]}},UC=function(t){return function(n){return function(){var r=n(),i=r[0],o=r[1];return[[i,t(o)],o]}}},UI=function(t){return function(n){return function(){var r,i=n();return[i[0],t(i[1])]}}},UM=function(t,n){return rc(t,UR(n))},UR=function(t){return function(n){return function(){var r=n(),i=r[0],o=r[1];return[t(i),o]}}},UE="Writer",Uj=function(t){return{URI:UE,_E:void 0,of:function(n){return function(){return[n,t.empty]}}}},UA=function(t){return{URI:UE,_E:void 0,map:UM,ap:function(n,r){return function(){var i=n(),o=i[0],a=i[1],u=r(),s=u[0],l=u[1];return[o(s),t.concat(a,l)]}}}},UN=function(t){var n=UA(t),r=Uj(t);return{URI:UE,_E:void 0,map:UM,ap:n.ap,of:r.of}};function UP(t){var n=UA(t);return{URI:UE,_E:void 0,map:UM,ap:n.ap,chain:function(n,r){return function(){var i=n(),o=i[0],a=i[1],u=r(o)(),s=u[0],l=u[1];return[s,t.concat(a,l)]}}}}var UL={URI:UE,map:UM},UD=rB(UL),UF=function(t){return t()[0]},UW=function(t){return t()[1]},UU=function(t){return t()[0]},Uz=function(t){return t()[1]};let UB=Object.freeze(Object.defineProperty({__proto__:null,Functor:UL,URI:UE,censor:UI,evalWriter:UU,evaluate:UF,execWriter:Uz,execute:UW,flap:UD,getApplicative:UN,getApply:UA,getChain:UP,getMonad:function(t){var n=UN(t),r=UP(t);return{URI:UE,_E:void 0,map:UM,ap:n.ap,of:n.of,chain:r.chain}},getPointed:Uj,listen:UO,listens:UC,map:UR,pass:Uk,tell:Uw,writer:UL},Symbol.toStringTag,{value:"Module"})),UV=Object.freeze(Object.defineProperty({__proto__:null,getWriterM:function(t){var n=function(n,r){return function(){return t.map(n(),function(t){var n=t[0],i=t[1];return[r(n),i]})}};return{map:n,evalWriter:function(n){return t.map(n(),function(t){return t[0]})},execWriter:function(n){return t.map(n(),function(t){return t[0],t[1]})},tell:function(n){return function(){return t.of([void 0,n])}},listen:function(n){return function(){return t.map(n(),function(t){var n=t[0],r=t[1];return[[n,r],r]})}},pass:function(n){return function(){return t.map(n(),function(t){var n,r=t[0],i=r[0];return[i,(0,r[1])(t[1])]})}},listens:function(n,r){return function(){return t.map(n(),function(t){var n=t[0],i=t[1];return[[n,r(i)],i]})}},censor:function(n,r){return function(){return t.map(n(),function(t){var n;return[t[0],r(t[1])]})}},getMonad:function(r){return{_E:void 0,map:n,of:function(n){return function(){return t.of([n,r.empty])}},ap:function(n,i){return function(){return t.chain(n(),function(n){var o=n[0],a=n[1];return t.map(i(),function(t){var n=t[0],i=t[1];return[o(n),r.concat(a,i)]})})}},chain:function(n,i){return function(){return t.chain(n(),function(n){var o=n[0],a=n[1];return t.map(i(o)(),function(t){var n=t[0],i=t[1];return[n,r.concat(a,i)]})})}}}}}}},Symbol.toStringTag,{value:"Module"})),U$=Object.freeze(Object.defineProperty({__proto__:null,alt:n1,alternative:n2,applicative:rG,apply:rU,array:fX,bifunctor:f0,boolean:f7,booleanAlgebra:pt,bounded:po,boundedDistributiveLattice:ps,boundedJoinSemilattice:pl,boundedLattice:pc,boundedMeetSemilattice:pd,category:pf,chain:rJ,chainRec:ph,choice:py,comonad:pv,compactable:h5,console:me,const:mh,contravariant:mm,date:mb,distributiveLattice:pu,either:gD,eitherT:g6,endomorphism:g7,eq:is,extend:ye,field:yn,filterable:yu,filterableWithIndex:ys,foldable:yh,foldableWithIndex:yv,fromEither:r6,fromIO:yS,fromReader:vs,fromState:vG,fromTask:vQ,fromThese:v0,function:rp,functor:rq,functorWithIndex:v2,group:v3,heytingAlgebra:v4,hkt:v5,identity:bR,invariant:bE,io:b9,ioEither:_a,ioOption:ST,ioRef:SO,joinSemilattice:Sk,json:SM,lattice:SR,magma:iL,map:wy,meetSemilattice:wv,monad:wb,monadIO:wx,monadTask:w_,monadThrow:wS,monoid:wL,naturalTransformation:wD,nonEmptyArray:u3,number:si,option:h2,optionT:_w,ord:iR,ordering:w$,pipeable:wq,pointed:wK,predicate:pM,profunctor:wH,random:wQ,reader:vn,readerEither:OX,readerT:O5,readerTask:CM,readerTaskEither:RL,readonlyArray:cK,readonlyMap:TE,readonlyNonEmptyArray:aO,readonlyRecord:j_,readonlySet:jJ,readonlyTuple:Ay,record:A7,refinement:Ns,ring:Nd,semigroup:iQ,semigroupoid:Nf,semiring:Np,separated:sg,set:NN,show:ND,state:vz,stateReaderTaskEither:Lr,stateT:NK,store:Lh,string:R1,strong:Ly,struct:Lx,task:kW,taskEither:I3,taskOption:DA,taskThese:Wn,these:Fc,theseT:FO,traced:Ws,traversable:Wd,traversableWithIndex:Wf,tree:W0,tuple:Uv,unfoldable:Ub,validationT:Ux,void:UT,witherable:sx,writer:UB,writerT:UV,zero:sS},Symbol.toStringTag,{value:"Module"})),Uq=C(U$);var UK={},UH={},UG={},UZ={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getEndomorphismMonoid=t.not=t.SK=t.hole=t.pipe=t.untupled=t.tupled=t.absurd=t.decrement=t.increment=t.tuple=t.flow=t.flip=t.constVoid=t.constUndefined=t.constNull=t.constFalse=t.constTrue=t.constant=t.unsafeCoerce=t.identity=t.apply=t.getRing=t.getSemiring=t.getMonoid=t.getSemigroup=t.getBooleanAlgebra=void 0;var n=function(t){return function(){return{meet:function(n,r){return function(i){return t.meet(n(i),r(i))}},join:function(n,r){return function(i){return t.join(n(i),r(i))}},zero:function(){return t.zero},one:function(){return t.one},implies:function(n,r){return function(i){return t.implies(n(i),r(i))}},not:function(n){return function(r){return t.not(n(r))}}}}};t.getBooleanAlgebra=n;var r=function(t){return function(){return{concat:function(n,r){return function(i){return t.concat(n(i),r(i))}}}}};t.getSemigroup=r;var i=function(n){var r=(0,t.getSemigroup)(n);return function(){return{concat:r().concat,empty:function(){return n.empty}}}};t.getMonoid=i;var o=function(t){return{add:function(n,r){return function(i){return t.add(n(i),r(i))}},zero:function(){return t.zero},mul:function(n,r){return function(i){return t.mul(n(i),r(i))}},one:function(){return t.one}}};t.getSemiring=o;var a=function(n){var r=(0,t.getSemiring)(n);return{add:r.add,mul:r.mul,one:r.one,zero:r.zero,sub:function(t,r){return function(i){return n.sub(t(i),r(i))}}}};t.getRing=a;var u=function(t){return function(n){return n(t)}};function s(t){return t}function l(t){return function(){return t}}function c(t,n,r,i,o,a,u,s,l){switch(arguments.length){case 1:return t;case 2:return function(){return n(t.apply(this,arguments))};case 3:return function(){return r(n(t.apply(this,arguments)))};case 4:return function(){return i(r(n(t.apply(this,arguments))))};case 5:return function(){return o(i(r(n(t.apply(this,arguments)))))};case 6:return function(){return a(o(i(r(n(t.apply(this,arguments))))))};case 7:return function(){return u(a(o(i(r(n(t.apply(this,arguments)))))))};case 8:return function(){return s(u(a(o(i(r(n(t.apply(this,arguments))))))))};case 9:return function(){return l(s(u(a(o(i(r(n(t.apply(this,arguments)))))))))}}}function d(t){return t+1}function f(t){return t-1}function p(t){throw Error("Called `absurd` function which should be uncallable")}t.apply=u,t.identity=s,t.unsafeCoerce=s,t.constant=l,t.constTrue=l(!0),t.constFalse=l(!1),t.constNull=l(null),t.constUndefined=l(void 0),t.constVoid=t.constUndefined,t.flip=function(t){return function(n,r){return t(r,n)}},t.flow=c,t.tuple=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t},t.increment=d,t.decrement=f,t.absurd=p,t.tupled=function(t){return function(n){return t.apply(void 0,n)}},t.untupled=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(n)}},t.pipe=function(t,n,r,i,o,a,u,s,l){switch(arguments.length){case 1:return t;case 2:return n(t);case 3:return r(n(t));case 4:return i(r(n(t)));case 5:return o(i(r(n(t))));case 6:return a(o(i(r(n(t)))));case 7:return u(a(o(i(r(n(t))))));case 8:return s(u(a(o(i(r(n(t)))))));case 9:return l(s(u(a(o(i(r(n(t))))))));default:for(var c=arguments[0],d=1;d<arguments.length;d++)c=arguments[d](c);return c}},t.hole=p;var h=function(t,n){return n};t.SK=h,t.not=function(t){return function(n){return!t(n)}};var m=function(){return{concat:function(t,n){return c(t,n)},empty:s}};t.getEndomorphismMonoid=m}(UZ);var UY={},UJ=k&&k.__spreadArray||function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))};Object.defineProperty(UY,"__esModule",{value:!0}),UY.fromReadonlyNonEmptyArray=UY.has=UY.emptyRecord=UY.emptyReadonlyArray=UY.tail=UY.head=UY.isNonEmpty=UY.singleton=UY.right=UY.left=UY.isRight=UY.isLeft=UY.some=UY.none=UY.isSome=UY.isNone=void 0;var UQ=function(t){return"None"===t._tag};UY.isNone=UQ;var UX=function(t){return"Some"===t._tag};UY.isSome=UX,UY.none={_tag:"None"};var U0=function(t){return{_tag:"Some",value:t}};UY.some=U0;var U1=function(t){return"Left"===t._tag};UY.isLeft=U1;var U2=function(t){return"Right"===t._tag};UY.isRight=U2;var U3=function(t){return{_tag:"Left",left:t}};UY.left=U3;var U4=function(t){return{_tag:"Right",right:t}};UY.right=U4;var U5=function(t){return[t]};UY.singleton=U5;var U6=function(t){return t.length>0};UY.isNonEmpty=U6;var U9=function(t){return t[0]};UY.head=U9;var U8=function(t){return t.slice(1)};UY.tail=U8,UY.emptyReadonlyArray=[],UY.emptyRecord={},UY.has=Object.prototype.hasOwnProperty;var U7=function(t){return UJ([t[0]],t.slice(1),!0)};UY.fromReadonlyNonEmptyArray=U7;var ze=k&&k.__createBinding||(Object.create?function(t,n,r,i){void 0===i&&(i=r);var o=Object.getOwnPropertyDescriptor(n,r);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[r]}}),Object.defineProperty(t,i,o)}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]}),zt=k&&k.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),zn=k&&k.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&ze(n,t,r);return zt(n,t),n};Object.defineProperty(UG,"__esModule",{value:!0}),UG.sequenceS=UG.sequenceT=UG.getApplySemigroup=UG.apS=UG.apSecond=UG.apFirst=UG.ap=void 0;var zr=zn(UY);function zi(t,n,r){return function(i){for(var o=Array(r.length+1),a=0;a<r.length;a++)o[a]=r[a];return o[r.length]=i,0===n?t.apply(null,o):zi(t,n-1,o)}}UG.ap=function(t,n){return function(r){return function(i){return t.ap(t.map(i,function(t){return function(r){return n.ap(t,r)}}),r)}}},UG.apFirst=function(t){return function(n){return function(r){return t.ap(t.map(r,function(t){return function(){return t}}),n)}}},UG.apSecond=function(t){return function(n){return function(r){return t.ap(t.map(r,function(){return function(t){return t}}),n)}}},UG.apS=function(t){return function(n,r){return function(i){return t.ap(t.map(i,function(t){return function(r){var i;return Object.assign({},t,((i={})[n]=r,i))}}),r)}}},UG.getApplySemigroup=function(t){return function(n){return{concat:function(r,i){return t.ap(t.map(r,function(t){return function(r){return n.concat(t,r)}}),i)}}}};var zo={1:function(t){return[t]},2:function(t){return function(n){return[t,n]}},3:function(t){return function(n){return function(r){return[t,n,r]}}},4:function(t){return function(n){return function(r){return function(i){return[t,n,r,i]}}}},5:function(t){return function(n){return function(r){return function(i){return function(o){return[t,n,r,i,o]}}}}}};function za(t){return zr.has.call(zo,t)||(zo[t]=zi(UZ.tuple,t-1,[])),zo[t]}function zu(t){var n=t.length;switch(n){case 1:return function(n){var r;return(r={})[t[0]]=n,r};case 2:return function(n){return function(r){var i;return(i={})[t[0]]=n,i[t[1]]=r,i}};case 3:return function(n){return function(r){return function(i){var o;return(o={})[t[0]]=n,o[t[1]]=r,o[t[2]]=i,o}}};case 4:return function(n){return function(r){return function(i){return function(o){var a;return(a={})[t[0]]=n,a[t[1]]=r,a[t[2]]=i,a[t[3]]=o,a}}}};case 5:return function(n){return function(r){return function(i){return function(o){return function(a){var u;return(u={})[t[0]]=n,u[t[1]]=r,u[t[2]]=i,u[t[3]]=o,u[t[4]]=a,u}}}}};default:return zi(function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];for(var o={},a=0;a<n;a++)o[t[a]]=r[a];return o},n-1,[])}}UG.sequenceT=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i=n.length,o=za(i),a=t.map(n[0],o),u=1;u<i;u++)a=t.ap(a,n[u]);return a}},UG.sequenceS=function(t){return function(n){for(var r=Object.keys(n),i=r.length,o=zu(r),a=t.map(n[r[0]],o),u=1;u<i;u++)a=t.ap(a,n[r[u]]);return a}};var zs={};function zl(t,n){return function(r){return function(i){return t.map(i,function(t){return n.map(t,r)})}}}Object.defineProperty(zs,"__esModule",{value:!0}),zs.getFunctorComposition=zs.bindTo=zs.flap=zs.map=void 0,zs.map=zl,zs.flap=function(t){return function(n){return function(r){return t.map(r,function(t){return t(n)})}}},zs.bindTo=function(t){return function(n){return function(r){return t.map(r,function(t){var r;return(r={})[n]=t,r})}}},zs.getFunctorComposition=function(t,n){var r=zl(t,n);return{map:function(t,n){return(0,UZ.pipe)(t,r(n))}}},Object.defineProperty(UH,"__esModule",{value:!0}),UH.getApplicativeComposition=UH.getApplicativeMonoid=void 0,UH.getApplicativeMonoid=function(t){var n=(0,UG.getApplySemigroup)(t);return function(r){return{concat:n(r).concat,empty:t.of(r.empty)}}},UH.getApplicativeComposition=function(t,n){var r=(0,zs.getFunctorComposition)(t,n).map,i=(0,UG.ap)(t,n);return{map:r,of:function(r){return t.of(n.of(r))},ap:function(t,n){return(0,UZ.pipe)(t,i(n))}}};var zc={};Object.defineProperty(zc,"__esModule",{value:!0}),zc.bind=zc.chainFirst=void 0,zc.chainFirst=function(t){return function(n){return function(r){return t.chain(r,function(r){return t.map(n(r),function(){return r})})}}},zc.bind=function(t){return function(n,r){return function(i){return t.chain(i,function(i){return t.map(r(i),function(t){var r;return Object.assign({},i,((r={})[n]=t,r))})})}}};var zd={};Object.defineProperty(zd,"__esModule",{value:!0}),zd.tailRec=void 0;var zf=function(t,n){for(var r=n(t);"Left"===r._tag;)r=n(r.left);return r.right};zd.tailRec=zf;var zp={},zh=k&&k.__createBinding||(Object.create?function(t,n,r,i){void 0===i&&(i=r);var o=Object.getOwnPropertyDescriptor(n,r);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[r]}}),Object.defineProperty(t,i,o)}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]}),zm=k&&k.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),zg=k&&k.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&zh(n,t,r);return zm(n,t),n};Object.defineProperty(zp,"__esModule",{value:!0}),zp.filterOrElse=zp.chainFirstEitherK=zp.chainEitherK=zp.fromEitherK=zp.chainOptionK=zp.fromOptionK=zp.fromPredicate=zp.fromOption=void 0;var zy=zg(UY);function zv(t){return function(n){return function(r){return t.fromEither(zy.isNone(r)?zy.left(n()):zy.right(r.value))}}}function zb(t){var n=zv(t);return function(t){var r=n(t);return function(t){return(0,UZ.flow)(t,r)}}}function zx(t){return function(n){return(0,UZ.flow)(n,t.fromEither)}}zp.fromOption=zv,zp.fromPredicate=function(t){return function(n,r){return function(i){return t.fromEither(n(i)?zy.right(i):zy.left(r(i)))}}},zp.fromOptionK=zb,zp.chainOptionK=function(t,n){var r=zb(t);return function(t){var i=r(t);return function(t){return function(r){return n.chain(r,i(t))}}}},zp.fromEitherK=zx,zp.chainEitherK=function(t,n){var r=zx(t);return function(t){return function(i){return n.chain(i,r(t))}}},zp.chainFirstEitherK=function(t,n){return(0,UZ.flow)(zx(t),(0,zc.chainFirst)(n))},zp.filterOrElse=function(t,n){return function(r,i){return function(o){return n.chain(o,function(n){return t.fromEither(r(n)?zy.right(n):zy.left(i(n)))})}}};var z_,zS,zT,zw,zO,zk,zC,zI,zM,zR,zE={};Object.defineProperty(z_=zE,"__esModule",{value:!0}),z_.right=z_.left=z_.flap=z_.Functor=z_.Bifunctor=z_.URI=z_.bimap=z_.mapLeft=z_.map=z_.separated=void 0,zS=function(t,n){return{left:t,right:n}},z_.separated=zS,zT=function(t,n){return(0,UZ.pipe)(t,(0,z_.map)(n))},zw=function(t,n){return(0,UZ.pipe)(t,(0,z_.mapLeft)(n))},zO=function(t,n,r){return(0,UZ.pipe)(t,(0,z_.bimap)(n,r))},zk=function(t){return function(n){return(0,z_.separated)((0,z_.left)(n),t((0,z_.right)(n)))}},z_.map=zk,zC=function(t){return function(n){return(0,z_.separated)(t((0,z_.left)(n)),(0,z_.right)(n))}},z_.mapLeft=zC,zI=function(t,n){return function(r){return(0,z_.separated)(t((0,z_.left)(r)),n((0,z_.right)(r)))}},z_.bimap=zI,z_.URI="Separated",z_.Bifunctor={URI:z_.URI,mapLeft:zw,bimap:zO},z_.Functor={URI:z_.URI,map:zT},z_.flap=(0,zs.flap)(z_.Functor),zM=function(t){return t.left},z_.left=zM,zR=function(t){return t.right},z_.right=zR;var zj={},zA=k&&k.__createBinding||(Object.create?function(t,n,r,i){void 0===i&&(i=r);var o=Object.getOwnPropertyDescriptor(n,r);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[r]}}),Object.defineProperty(t,i,o)}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]}),zN=k&&k.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),zP=k&&k.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&zA(n,t,r);return zN(n,t),n};Object.defineProperty(zj,"__esModule",{value:!0}),zj.filterE=zj.witherDefault=zj.wiltDefault=void 0;var zL=zP(UY);zj.wiltDefault=function(t,n){return function(r){var i=t.traverse(r);return function(t,o){return r.map(i(t,o),n.separate)}}},zj.witherDefault=function(t,n){return function(r){var i=t.traverse(r);return function(t,o){return r.map(i(t,o),n.compact)}}},zj.filterE=function(t){return function(n){var r=t.wither(n);return function(t){return function(i){return r(i,function(r){return n.map(t(r),function(t){return t?zL.some(r):zL.none})})}}}},Bk=UK,BC=k&&k.__createBinding||(Object.create?function(t,n,r,i){void 0===i&&(i=r);var o=Object.getOwnPropertyDescriptor(n,r);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[r]}}),Object.defineProperty(t,i,o)}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]}),BI=k&&k.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),BM=k&&k.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&BC(n,t,r);return BI(n,t),n},Object.defineProperty(Bk,"__esModule",{value:!0}),Bk.fold=Bk.match=Bk.foldW=Bk.matchW=Bk.isRight=Bk.isLeft=Bk.fromOption=Bk.fromPredicate=Bk.FromEither=Bk.MonadThrow=Bk.throwError=Bk.ChainRec=Bk.Extend=Bk.extend=Bk.Alt=Bk.alt=Bk.altW=Bk.Bifunctor=Bk.mapLeft=Bk.bimap=Bk.Traversable=Bk.sequence=Bk.traverse=Bk.Foldable=Bk.reduceRight=Bk.foldMap=Bk.reduce=Bk.Monad=Bk.Chain=Bk.chain=Bk.chainW=Bk.Applicative=Bk.Apply=Bk.ap=Bk.apW=Bk.Pointed=Bk.of=Bk.Functor=Bk.map=Bk.getAltValidation=Bk.getApplicativeValidation=Bk.getWitherable=Bk.getFilterable=Bk.getCompactable=Bk.getSemigroup=Bk.getEq=Bk.getShow=Bk.URI=Bk.right=Bk.left=void 0,Bk.getValidation=Bk.getValidationMonoid=Bk.getValidationSemigroup=Bk.getApplyMonoid=Bk.getApplySemigroup=Bk.either=Bk.stringifyJSON=Bk.parseJSON=Bk.sequenceArray=Bk.traverseArray=Bk.traverseArrayWithIndex=Bk.traverseReadonlyArrayWithIndex=Bk.traverseReadonlyNonEmptyArrayWithIndex=Bk.ApT=Bk.apSW=Bk.apS=Bk.bindW=Bk.bind=Bk.bindTo=Bk.Do=Bk.exists=Bk.elem=Bk.toError=Bk.toUnion=Bk.chainNullableK=Bk.fromNullableK=Bk.tryCatchK=Bk.tryCatch=Bk.fromNullable=Bk.orElse=Bk.orElseW=Bk.swap=Bk.filterOrElseW=Bk.filterOrElse=Bk.chainOptionK=Bk.fromOptionK=Bk.duplicate=Bk.flatten=Bk.flattenW=Bk.chainFirstW=Bk.chainFirst=Bk.apSecondW=Bk.apSecond=Bk.apFirstW=Bk.apFirst=Bk.flap=Bk.getOrElse=Bk.getOrElseW=void 0,BR=BM(UY),Bk.left=BR.left,Bk.right=BR.right,BE=function(t,n){return(0,UZ.pipe)(t,(0,Bk.map)(n))},Bj=function(t,n){return(0,UZ.pipe)(t,(0,Bk.ap)(n))},BA=function(t,n){return(0,UZ.pipe)(t,(0,Bk.chain)(n))},BN=function(t,n,r){return(0,UZ.pipe)(t,(0,Bk.reduce)(n,r))},BP=function(t){return function(n,r){var i=(0,Bk.foldMap)(t);return(0,UZ.pipe)(n,i(r))}},BL=function(t,n,r){return(0,UZ.pipe)(t,(0,Bk.reduceRight)(n,r))},BD=function(t){var n=(0,Bk.traverse)(t);return function(t,r){return(0,UZ.pipe)(t,n(r))}},BF=function(t,n,r){return(0,UZ.pipe)(t,(0,Bk.bimap)(n,r))},BW=function(t,n){return(0,UZ.pipe)(t,(0,Bk.mapLeft)(n))},BU=function(t,n){return(0,UZ.pipe)(t,(0,Bk.alt)(n))},Bz=function(t,n){return(0,UZ.pipe)(t,(0,Bk.extend)(n))},BB=function(t,n){return(0,zd.tailRec)(n(t),function(t){return(0,Bk.isLeft)(t)?(0,Bk.right)((0,Bk.left)(t.left)):(0,Bk.isLeft)(t.right)?(0,Bk.left)(n(t.right.left)):(0,Bk.right)((0,Bk.right)(t.right.right))})},Bk.URI="Either",BV=function(t,n){return{show:function(r){return(0,Bk.isLeft)(r)?"left(".concat(t.show(r.left),")"):"right(".concat(n.show(r.right),")")}}},Bk.getShow=BV,B$=function(t,n){return{equals:function(r,i){return r===i||((0,Bk.isLeft)(r)?(0,Bk.isLeft)(i)&&t.equals(r.left,i.left):(0,Bk.isRight)(i)&&n.equals(r.right,i.right))}}},Bk.getEq=B$,Bq=function(t){return{concat:function(n,r){return(0,Bk.isLeft)(r)?n:(0,Bk.isLeft)(n)?r:(0,Bk.right)(t.concat(n.right,r.right))}}},Bk.getSemigroup=Bq,BK=function(t){var n=(0,Bk.left)(t.empty);return{URI:Bk.URI,_E:void 0,compact:function(t){return(0,Bk.isLeft)(t)?t:"None"===t.right._tag?n:(0,Bk.right)(t.right.value)},separate:function(t){return(0,Bk.isLeft)(t)?(0,zE.separated)(t,t):(0,Bk.isLeft)(t.right)?(0,zE.separated)((0,Bk.right)(t.right.left),n):(0,zE.separated)(n,(0,Bk.right)(t.right.right))}}},Bk.getCompactable=BK,BH=function(t){var n=(0,Bk.left)(t.empty),r=(0,Bk.getCompactable)(t),i=r.compact,o=r.separate,a=function(t,r){return(0,Bk.isLeft)(t)||r(t.right)?t:n},u=function(t,r){return(0,Bk.isLeft)(t)?(0,zE.separated)(t,t):r(t.right)?(0,zE.separated)(n,(0,Bk.right)(t.right)):(0,zE.separated)((0,Bk.right)(t.right),n)};return{URI:Bk.URI,_E:void 0,map:BE,compact:i,separate:o,filter:a,filterMap:function(t,r){if((0,Bk.isLeft)(t))return t;var i=r(t.right);return"None"===i._tag?n:(0,Bk.right)(i.value)},partition:u,partitionMap:function(t,r){if((0,Bk.isLeft)(t))return(0,zE.separated)(t,t);var i=r(t.right);return(0,Bk.isLeft)(i)?(0,zE.separated)((0,Bk.right)(i.left),n):(0,zE.separated)(n,(0,Bk.right)(i.right))}}},Bk.getFilterable=BH,BG=function(t){var n=(0,Bk.getFilterable)(t),r=(0,Bk.getCompactable)(t);return{URI:Bk.URI,_E:void 0,map:BE,compact:n.compact,separate:n.separate,filter:n.filter,filterMap:n.filterMap,partition:n.partition,partitionMap:n.partitionMap,traverse:BD,sequence:Bk.sequence,reduce:BN,foldMap:BP,reduceRight:BL,wither:(0,zj.witherDefault)(Bk.Traversable,r),wilt:(0,zj.wiltDefault)(Bk.Traversable,r)}},Bk.getWitherable=BG,BZ=function(t){return{URI:Bk.URI,_E:void 0,map:BE,ap:function(n,r){return(0,Bk.isLeft)(n)?(0,Bk.isLeft)(r)?(0,Bk.left)(t.concat(n.left,r.left)):n:(0,Bk.isLeft)(r)?r:(0,Bk.right)(n.right(r.right))},of:Bk.of}},Bk.getApplicativeValidation=BZ,BY=function(t){return{URI:Bk.URI,_E:void 0,map:BE,alt:function(n,r){if((0,Bk.isRight)(n))return n;var i=r();return(0,Bk.isLeft)(i)?(0,Bk.left)(t.concat(n.left,i.left)):i}}},Bk.getAltValidation=BY,BJ=function(t){return function(n){return(0,Bk.isLeft)(n)?n:(0,Bk.right)(t(n.right))}},Bk.map=BJ,Bk.Functor={URI:Bk.URI,map:BE},Bk.of=Bk.right,Bk.Pointed={URI:Bk.URI,of:Bk.of},BQ=function(t){return function(n){return(0,Bk.isLeft)(n)?n:(0,Bk.isLeft)(t)?t:(0,Bk.right)(n.right(t.right))}},Bk.apW=BQ,Bk.ap=Bk.apW,Bk.Apply={URI:Bk.URI,map:BE,ap:Bj},Bk.Applicative={URI:Bk.URI,map:BE,ap:Bj,of:Bk.of},BX=function(t){return function(n){return(0,Bk.isLeft)(n)?n:t(n.right)}},Bk.chainW=BX,Bk.chain=Bk.chainW,Bk.Chain={URI:Bk.URI,map:BE,ap:Bj,chain:BA},Bk.Monad={URI:Bk.URI,map:BE,ap:Bj,of:Bk.of,chain:BA},B0=function(t,n){return function(r){return(0,Bk.isLeft)(r)?t:n(t,r.right)}},Bk.reduce=B0,B1=function(t){return function(n){return function(r){return(0,Bk.isLeft)(r)?t.empty:n(r.right)}}},Bk.foldMap=B1,B2=function(t,n){return function(r){return(0,Bk.isLeft)(r)?t:n(r.right,t)}},Bk.reduceRight=B2,Bk.Foldable={URI:Bk.URI,reduce:BN,foldMap:BP,reduceRight:BL},B3=function(t){return function(n){return function(r){return(0,Bk.isLeft)(r)?t.of((0,Bk.left)(r.left)):t.map(n(r.right),Bk.right)}}},Bk.traverse=B3,B4=function(t){return function(n){return(0,Bk.isLeft)(n)?t.of((0,Bk.left)(n.left)):t.map(n.right,Bk.right)}},Bk.sequence=B4,Bk.Traversable={URI:Bk.URI,map:BE,reduce:BN,foldMap:BP,reduceRight:BL,traverse:BD,sequence:Bk.sequence},B5=function(t,n){return function(r){return(0,Bk.isLeft)(r)?(0,Bk.left)(t(r.left)):(0,Bk.right)(n(r.right))}},Bk.bimap=B5,B6=function(t){return function(n){return(0,Bk.isLeft)(n)?(0,Bk.left)(t(n.left)):n}},Bk.mapLeft=B6,Bk.Bifunctor={URI:Bk.URI,bimap:BF,mapLeft:BW},B9=function(t){return function(n){return(0,Bk.isLeft)(n)?t():n}},Bk.altW=B9,Bk.alt=Bk.altW,Bk.Alt={URI:Bk.URI,map:BE,alt:BU},B8=function(t){return function(n){return(0,Bk.isLeft)(n)?n:(0,Bk.right)(t(n))}},Bk.extend=B8,Bk.Extend={URI:Bk.URI,map:BE,extend:Bz},Bk.ChainRec={URI:Bk.URI,map:BE,ap:Bj,chain:BA,chainRec:BB},Bk.throwError=Bk.left,Bk.MonadThrow={URI:Bk.URI,map:BE,ap:Bj,of:Bk.of,chain:BA,throwError:Bk.throwError},Bk.FromEither={URI:Bk.URI,fromEither:UZ.identity},Bk.fromPredicate=(0,zp.fromPredicate)(Bk.FromEither),Bk.fromOption=(0,zp.fromOption)(Bk.FromEither),Bk.isLeft=BR.isLeft,Bk.isRight=BR.isRight,B7=function(t,n){return function(r){return(0,Bk.isLeft)(r)?t(r.left):n(r.right)}},Bk.matchW=B7,Bk.foldW=Bk.matchW,Bk.match=Bk.matchW,Bk.fold=Bk.match,Ve=function(t){return function(n){return(0,Bk.isLeft)(n)?t(n.left):n.right}},Bk.getOrElseW=Ve,Bk.getOrElse=Bk.getOrElseW,Bk.flap=(0,zs.flap)(Bk.Functor),Bk.apFirst=(0,UG.apFirst)(Bk.Apply),Bk.apFirstW=Bk.apFirst,Bk.apSecond=(0,UG.apSecond)(Bk.Apply),Bk.apSecondW=Bk.apSecond,Bk.chainFirst=(0,zc.chainFirst)(Bk.Chain),Bk.chainFirstW=Bk.chainFirst,Bk.flattenW=(0,Bk.chainW)(UZ.identity),Bk.flatten=Bk.flattenW,Bk.duplicate=(0,Bk.extend)(UZ.identity),Bk.fromOptionK=(0,zp.fromOptionK)(Bk.FromEither),Bk.chainOptionK=(0,zp.chainOptionK)(Bk.FromEither,Bk.Chain),Bk.filterOrElse=(0,zp.filterOrElse)(Bk.FromEither,Bk.Chain),Bk.filterOrElseW=Bk.filterOrElse,Vt=function(t){return(0,Bk.isLeft)(t)?(0,Bk.right)(t.left):(0,Bk.left)(t.right)},Bk.swap=Vt,Vn=function(t){return function(n){return(0,Bk.isLeft)(n)?t(n.left):n}},Bk.orElseW=Vn,Bk.orElse=Bk.orElseW,Vr=function(t){return function(n){return null==n?(0,Bk.left)(t):(0,Bk.right)(n)}},Bk.fromNullable=Vr,Vi=function(t,n){try{return(0,Bk.right)(t())}catch(r){return(0,Bk.left)(n(r))}},Bk.tryCatch=Vi,Vo=function(t,n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return(0,Bk.tryCatch)(function(){return t.apply(void 0,r)},n)}},Bk.tryCatchK=Vo,Va=function(t){var n=(0,Bk.fromNullable)(t);return function(t){return(0,UZ.flow)(t,n)}},Bk.fromNullableK=Va,Vu=function(t){var n=(0,Bk.fromNullableK)(t);return function(t){return(0,Bk.chain)(n(t))}},Bk.chainNullableK=Vu,Bk.toUnion=(0,Bk.foldW)(UZ.identity,UZ.identity),Bk.toError=function(t){return t instanceof Error?t:Error(String(t))},Bk.elem=function t(n){return function(r,i){if(void 0===i){var o=t(n);return function(t){return o(r,t)}}return!(0,Bk.isLeft)(i)&&n.equals(r,i.right)}},Vs=function(t){return function(n){return!(0,Bk.isLeft)(n)&&t(n.right)}},Bk.exists=Vs,Bk.Do=(0,Bk.of)(BR.emptyRecord),Bk.bindTo=(0,zs.bindTo)(Bk.Functor),Bk.bind=(0,zc.bind)(Bk.Chain),Bk.bindW=Bk.bind,Bk.apS=(0,UG.apS)(Bk.Apply),Bk.apSW=Bk.apS,Bk.ApT=(0,Bk.of)(BR.emptyReadonlyArray),Vl=function(t){return function(n){var r=t(0,BR.head(n));if((0,Bk.isLeft)(r))return r;for(var i=[r.right],o=1;o<n.length;o++){var a=t(o,n[o]);if((0,Bk.isLeft)(a))return a;i.push(a.right)}return(0,Bk.right)(i)}},Bk.traverseReadonlyNonEmptyArrayWithIndex=Vl,Vc=function(t){var n=(0,Bk.traverseReadonlyNonEmptyArrayWithIndex)(t);return function(t){return BR.isNonEmpty(t)?n(t):Bk.ApT}},Bk.traverseReadonlyArrayWithIndex=Vc,Bk.traverseArrayWithIndex=Bk.traverseReadonlyArrayWithIndex,Vd=function(t){return(0,Bk.traverseReadonlyArrayWithIndex)(function(n,r){return t(r)})},Bk.traverseArray=Vd,Bk.sequenceArray=(0,Bk.traverseArray)(UZ.identity),Bk.parseJSON=function(t,n){return(0,Bk.tryCatch)(function(){return JSON.parse(t)},n)},Vf=function(t,n){return(0,Bk.tryCatch)(function(){var n=JSON.stringify(t);if("string"!=typeof n)throw Error("Converting unsupported structure to JSON");return n},n)},Bk.stringifyJSON=Vf,Bk.either={URI:Bk.URI,map:BE,of:Bk.of,ap:Bj,chain:BA,reduce:BN,foldMap:BP,reduceRight:BL,traverse:BD,sequence:Bk.sequence,bimap:BF,mapLeft:BW,alt:BU,extend:Bz,chainRec:BB,throwError:Bk.throwError},Bk.getApplySemigroup=(0,UG.getApplySemigroup)(Bk.Apply),Bk.getApplyMonoid=(0,UH.getApplicativeMonoid)(Bk.Applicative),Vp=function(t,n){return(0,UG.getApplySemigroup)((0,Bk.getApplicativeValidation)(t))(n)},Bk.getValidationSemigroup=Vp,Vh=function(t,n){return(0,UH.getApplicativeMonoid)((0,Bk.getApplicativeValidation)(t))(n)},Bk.getValidationMonoid=Vh,Bk.getValidation=function(t){var n=(0,Bk.getApplicativeValidation)(t).ap,r=(0,Bk.getAltValidation)(t).alt;return{URI:Bk.URI,_E:void 0,map:BE,of:Bk.of,chain:BA,bimap:BF,mapLeft:BW,reduce:BN,foldMap:BP,reduceRight:BL,extend:Bz,traverse:BD,sequence:Bk.sequence,chainRec:BB,throwError:Bk.throwError,ap:n,alt:r}};var zD=globalThis&&globalThis.__extends||(Vm=function(t,n){return(Vm=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])})(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}Vm(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}),zF=globalThis&&globalThis.__assign||function(){return(zF=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)},zW=globalThis&&globalThis.__spreadArray||function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))},zU=function(t,n,r){return r_([{value:t,context:n,message:r}])},zz=function(){function t(t,n,r,i){this.name=t,this.is=n,this.validate=r,this.encode=i,this.decode=this.decode.bind(this)}return t.prototype.pipe=function(n,r){var i=this;return void 0===r&&(r="pipe(".concat(this.name,", ").concat(n.name,")")),new t(r,n.is,function(t,r){var o=i.validate(t,r);return gt(o)?o:n.validate(o.right,r)},this.encode===zB&&n.encode===zB?zB:function(t){return i.encode(n.encode(t))})},t.prototype.asDecoder=function(){return this},t.prototype.asEncoder=function(){return this},t.prototype.decode=function(t){return this.validate(t,[{key:"",type:this,actual:t}])},t}(),zB=function(t){return t};function zV(t){return t.displayName||t.name||"<function".concat(t.length,">")}function z$(t,n,r,i){for(var o=t.length,a=Array(o+1),u=0;u<o;u++)a[u]=t[u];return a[o]={key:n,type:r,actual:i},a}function zq(t,n){for(var r=n.length,i=0;i<r;i++)t.push(n[i])}var zK=Object.prototype.hasOwnProperty;function zH(t){return Object.keys(t).map(function(n){return"".concat(n,": ").concat(t[n].name)}).join(", ")}function zG(t){for(var n=0;n<t.length;n++)if(t[n].encode!==zB)return!1;return!0}function zZ(t){return"{ ".concat(zH(t)," }")}function zY(t){return"Partial<".concat(t,">")}function zJ(t){if(z5(t)){var n,r,i=t.value;if(Bc.is(i))return(n={})[i]=null,n}else{if(r=t,"KeyofType"===r._tag)return t.keys;if(z9(t)){var o=t.types.map(function(t){return zJ(t)});return o.some(Bi.is)?void 0:Object.assign.apply(Object,zW([{}],o,!1))}}}function zQ(t){return"("+t.map(function(t){return t.name}).join(" | ")+")"}function zX(t,n){for(var r=!0,i=!0,o=!Bx.is(t),a=0;a<n.length;a++){var u=n[a];u!==t&&(r=!1),Bx.is(u)&&(i=!1)}if(r)return t;if(i)return n[n.length-1];for(var s={},l=0;l<n.length;l++){var u=n[l];for(var c in u)(!zK.call(s,c)||o||u[c]!==t[c])&&(s[c]=u[c])}return s}function z0(t,n){for(var r=Object.getOwnPropertyNames(t),i=!1,o={},a=0;a<r.length;a++){var u=r[a];zK.call(n,u)?o[u]=t[u]:i=!0}return i?o:t}function z1(t){return t.length>0}var z2={};function z3(t,n){for(var r=[],i=0;i<t.length;i++){var o=t[i];-1!==n.indexOf(o)&&r.push(o)}return r}function z4(t){return"AnyType"===t._tag}function z5(t){return"LiteralType"===t._tag}function z6(t){return"InterfaceType"===t._tag}function z9(t){return"UnionType"===t._tag}var z8=[];function z7(t){if(-1!==z8.indexOf(t))return z2;if(z6(t)||"StrictType"===(n=t)._tag){var n,r,i,o,a,u=z2;for(var s in t.props){var l=t.props[s];z5(l)&&(u===z2&&(u={}),u[s]=[l.value])}return u}if("ExactType"===t._tag||"RefinementType"===t._tag)return z7(t.type);if("IntersectionType"===t._tag)return t.types.reduce(function(t,n){return function(t,n){if(t===z2)return n;if(n===z2)return t;var r=Object.assign({},t);for(var i in n)if(zK.call(t,i)){var o=z3(t[i],n[i]);if(z1(o))r[i]=o;else{r=z2;break}}else r[i]=n[i];return r}(t,z7(n))},z2);if(z9(t))return t.types.slice(1).reduce(function(t,n){return function(t,n){if(t===z2||n===z2)return z2;var r=z2;for(var i in t)zK.call(n,i)&&0===z3(t[i],n[i]).length&&(r===z2&&(r={}),r[i]=t[i].concat(n[i]));return r}(t,z7(n))},z7(t.types[0]));if("RecursiveType"===t._tag){z8.push(t);var c=z7(t.type);return z8.pop(),c}return z2}function Be(t){var n=z7(t[0]),r=Object.keys(n),i=t.length;e:for(var o=0;o<r.length;o++){var a=function(r){for(var o=n[r].slice(),a=[n[r]],u=1;u<i;u++){var s=z7(t[u])[r];if(void 0===s||s.some(function(t){return -1!==o.indexOf(t)}))return"continue-keys";o.push.apply(o,s),a.push(s)}return{value:[r,a]}}(r[o]);if("object"==typeof a)return a.value;if("continue-keys"===a)continue e}}var Bt=function(t){function n(){var n=t.call(this,"null",function(t){return null===t},function(t,r){return n.is(t)?rS(t):zU(t,r)},zB)||this;return n._tag="NullType",n}return zD(n,t),n}(zz),Bn=new Bt,Br=function(t){function n(){var n=t.call(this,"undefined",function(t){return void 0===t},function(t,r){return n.is(t)?rS(t):zU(t,r)},zB)||this;return n._tag="UndefinedType",n}return zD(n,t),n}(zz),Bi=new Br,Bo=function(t){function n(){var n=t.call(this,"void",Bi.is,Bi.validate,zB)||this;return n._tag="VoidType",n}return zD(n,t),n}(zz),Ba=new Bo,Bu=function(t){function n(){var n=t.call(this,"unknown",function(t){return!0},rS,zB)||this;return n._tag="UnknownType",n}return zD(n,t),n}(zz),Bs=new Bu,Bl=function(t){function n(){var n=t.call(this,"string",function(t){return"string"==typeof t},function(t,r){return n.is(t)?rS(t):zU(t,r)},zB)||this;return n._tag="StringType",n}return zD(n,t),n}(zz),Bc=new Bl,Bd=function(t){function n(){var n=t.call(this,"number",function(t){return"number"==typeof t},function(t,r){return n.is(t)?rS(t):zU(t,r)},zB)||this;return n._tag="NumberType",n}return zD(n,t),n}(zz),Bf=new Bd,Bp=function(t){function n(){var n=t.call(this,"bigint",function(t){return"bigint"==typeof t},function(t,r){return n.is(t)?rS(t):zU(t,r)},zB)||this;return n._tag="BigIntType",n}return zD(n,t),n}(zz),Bh=new Bp,Bm=function(t){function n(){var n=t.call(this,"boolean",function(t){return"boolean"==typeof t},function(t,r){return n.is(t)?rS(t):zU(t,r)},zB)||this;return n._tag="BooleanType",n}return zD(n,t),n}(zz),Bg=new Bm,By=function(t){function n(){var n=t.call(this,"UnknownArray",Array.isArray,function(t,r){return n.is(t)?rS(t):zU(t,r)},zB)||this;return n._tag="AnyArrayType",n}return zD(n,t),n}(zz),Bv=new By,Bb=function(t){function n(){var n=t.call(this,"UnknownRecord",function(t){var n=Object.prototype.toString.call(t);return"[object Object]"===n||"[object Window]"===n},function(t,r){return n.is(t)?rS(t):zU(t,r)},zB)||this;return n._tag="AnyDictionaryType",n}return zD(n,t),n}(zz),Bx=new Bb,B_=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.value=a,u._tag="LiteralType",u}return zD(n,t),n}(zz);function BS(t,n){void 0===n&&(n=JSON.stringify(t));var r=function(n){return n===t};return new B_(n,r,function(n,i){return r(n)?rS(t):zU(n,i)},zB,t)}var BT=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.keys=a,u._tag="KeyofType",u}return zD(n,t),n}(zz),Bw=function(t){function n(n,r,i,o,a,u){var s=t.call(this,n,r,i,o)||this;return s.type=a,s.predicate=u,s._tag="RefinementType",s}return zD(n,t),n}(zz);function BO(t,n,r){return VY(t,n,r)}var Bk,BC,BI,BM,BR,BE,Bj,BA,BN,BP,BL,BD,BF,BW,BU,Bz,BB,BV,B$,Bq,BK,BH,BG,BZ,BY,BJ,BQ,BX,B0,B1,B2,B3,B4,B5,B6,B9,B8,B7,Ve,Vt,Vn,Vr,Vi,Vo,Va,Vu,Vs,Vl,Vc,Vd,Vf,Vp,Vh,Vm,Vg,Vy,Vv=VY(Bf,Vy=function(t){return Number.isInteger(t)},"Int"),Vb=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.runDefinition=a,u._tag="RecursiveType",u}return zD(n,t),n}(zz);function Vx(t,n){var r,i=function(){return r||((r=n(o)).name=t),r},o=new Vb(t,function(t){return i().is(t)},function(t,n){return i().validate(t,n)},function(t){return i().encode(t)},i);return o}Object.defineProperty(Vb.prototype,"type",{get:function(){return this.runDefinition()},enumerable:!0,configurable:!0});var V_=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.type=a,u._tag="ArrayType",u}return zD(n,t),n}(zz);function VS(t,n){return void 0===n&&(n="Array<".concat(t.name,">")),new V_(n,function(n){return Bv.is(n)&&n.every(t.is)},function(n,r){var i=Bv.validate(n,r);if(gt(i))return i;for(var o=i.right,a=o.length,u=o,s=[],l=0;l<a;l++){var c=o[l],d=t.validate(c,z$(r,String(l),t,c));if(gt(d))zq(s,d.left);else{var f=d.right;f!==c&&(u===o&&(u=o.slice()),u[l]=f)}}return s.length>0?r_(s):rS(u)},t.encode===zB?zB:function(n){return n.map(t.encode)},t)}var VT=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.props=a,u._tag="InterfaceType",u}return zD(n,t),n}(zz);function Vw(t,n){void 0===n&&(n=zZ(t));var r=Object.keys(t),i=r.map(function(n){return t[n]}),o=r.length;return new VT(n,function(t){if(Bx.is(t)){for(var n=0;n<o;n++){var a=r[n],u=t[a];if(void 0===u&&!zK.call(t,a)||!i[n].is(u))return!1}return!0}return!1},function(t,n){var a=Bx.validate(t,n);if(gt(a))return a;for(var u=a.right,s=u,l=[],c=0;c<o;c++){var d=r[c],f=s[d],p=i[c],h=p.validate(f,z$(n,d,p,f));if(gt(h))zq(l,h.left);else{var m=h.right;m===f&&(void 0!==m||zK.call(s,d))||(s===u&&(s=zF({},u)),s[d]=m)}}return l.length>0?r_(l):rS(s)},zG(i)?zB:function(t){for(var n=zF({},t),a=0;a<o;a++){var u=r[a],s=i[a].encode;s!==zB&&(n[u]=s(t[u]))}return n},t)}var VO=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.props=a,u._tag="PartialType",u}return zD(n,t),n}(zz),Vk=function(t){function n(n,r,i,o,a,u){var s=t.call(this,n,r,i,o)||this;return s.domain=a,s.codomain=u,s._tag="DictionaryType",s}return zD(n,t),n}(zz);function VC(t,n,r){var i,o,a,u,s,l,c,d,f=zJ(t);return f?(i=Object.keys(f),void 0===(u=r)&&(u="{ [K in ".concat(t.name,"]: ").concat(n.name," }")),s=i.length,new Vk(u,function(t){return Bx.is(t)&&i.every(function(r){return n.is(t[r])})},function(t,r){var o=Bx.validate(t,r);if(gt(o))return o;for(var a=o.right,u={},l=[],c=!1,d=0;d<s;d++){var f=i[d],p=a[f],h=n.validate(p,z$(r,f,n,p));if(gt(h))zq(l,h.left);else{var m=h.right;c=c||m!==p,u[f]=m}}return l.length>0?r_(l):rS(c||Object.keys(a).length!==s?u:a)},n.encode===zB?zB:function(t){for(var r={},o=0;o<s;o++){var a=i[o];r[a]=n.encode(t[a])}return r},t,n)):(l=t,void 0===(d=r)&&(d="{ [K in ".concat(l.name,"]: ").concat(n.name," }")),new Vk(d,function(t){return Bx.is(t)?Object.keys(t).every(function(r){return l.is(r)&&n.is(t[r])}):z4(n)&&Array.isArray(t)},function(t,r){if(Bx.is(t)){for(var i={},o=[],a=Object.keys(t),u=a.length,s=!1,c=0;c<u;c++){var d=a[c],f=t[d],p=l.validate(d,z$(r,d,l,d));if(gt(p))zq(o,p.left);else{var h=p.right;s=s||h!==d,d=h;var m=n.validate(f,z$(r,d,n,f));if(gt(m))zq(o,m.left);else{var g=m.right;s=s||g!==f,i[d]=g}}}return o.length>0?r_(o):rS(s?i:t)}return z4(n)&&Array.isArray(t)?rS(t):zU(t,r)},l.encode===zB&&n.encode===zB?zB:function(t){for(var r={},i=Object.keys(t),o=i.length,a=0;a<o;a++){var u=i[a];r[String(l.encode(u))]=n.encode(t[u])}return r},l,n))}var VI=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.types=a,u._tag="UnionType",u}return zD(n,t),n}(zz);function VM(t,n){void 0===n&&(n=zQ(t));var r=Be(t);if(void 0===r||!(t.length>0))return new VI(n,function(n){return t.some(function(t){return t.is(n)})},function(n,r){for(var i=[],o=0;o<t.length;o++){var a=t[o],u=a.validate(n,z$(r,String(o),a,n));if(!gt(u))return rS(u.right);zq(i,u.left)}return r_(i)},zG(t)?zB:function(r){for(var i=0;i<t.length;i++){var o=t[i];if(o.is(r))return o.encode(r)}throw Error("no codec found to encode value in union type ".concat(n))},t);var i=r[0],o=r[1],a=o.length,u=function(t){for(var n=0;n<a;n++)if(-1!==o[n].indexOf(t))return n};return new VU(n,function(n){if(Bx.is(n)){var r=u(n[i]);return void 0!==r&&t[r].is(n)}return!1},function(n,r){var o=Bx.validate(n,r);if(gt(o))return o;var a=o.right,s=u(a[i]);if(void 0===s)return zU(n,r);var l=t[s];return l.validate(a,z$(r,String(s),l,a))},zG(t)?zB:function(r){var o=u(r[i]);if(void 0===o)throw Error("no codec found to encode value in union codec ".concat(n));return t[o].encode(r)},t,i)}var VR=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.types=a,u._tag="IntersectionType",u}return zD(n,t),n}(zz),VE=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.types=a,u._tag="TupleType",u}return zD(n,t),n}(zz),Vj=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.type=a,u._tag="ReadonlyType",u}return zD(n,t),n}(zz),VA=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.type=a,u._tag="ReadonlyArrayType",u}return zD(n,t),n}(zz);function VN(t,n){void 0===n&&(n="ReadonlyArray<".concat(t.name,">"));var r=VS(t);return new VA(n,r.is,r.validate,r.encode,t)}var VP=function(t,n){return VD(Vw(t),n)},VL=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.type=a,u._tag="ExactType",u}return zD(n,t),n}(zz);function VD(t,n){void 0===n&&(n=z6(i=t)?"{| ".concat(zH(i.props)," |}"):(r=i,"PartialType"===r._tag)?zY("{| ".concat(zH(i.props)," |}")):"Exact<".concat(i.name,">"));var r,i,o=function t(n){switch(n._tag){case"RefinementType":case"ReadonlyType":return t(n.type);case"InterfaceType":case"StrictType":case"PartialType":return n.props;case"IntersectionType":return n.types.reduce(function(n,r){return Object.assign(n,t(r))},{})}}(t);return new VL(n,t.is,function(n,r){var i=Bx.validate(n,r);if(gt(i))return i;var a=t.validate(n,r);return gt(a)?a:rS(z0(a.right,o))},function(n){return t.encode(z0(n,o))},t)}var VF=function(t){function n(){var n=t.call(this,"Function",function(t){return"function"==typeof t},function(t,r){return n.is(t)?rS(t):zU(t,r)},zB)||this;return n._tag="FunctionType",n}return zD(n,t),n}(zz),VW=new VF,VU=function(t){function n(n,r,i,o,a,u){var s=t.call(this,n,r,i,o,a)||this;return s.tag=u,s}return zD(n,t),n}(VI),Vz=function(t,n,r){void 0===r&&(r=zQ(n));var i=VM(n,r);return i instanceof VU?i:(console.warn("[io-ts] Cannot build a tagged union for ".concat(r,", returning a de-optimized union")),new VU(r,i.is,i.validate,i.encode,n,t))},VB=function(t,n){return{value:t,context:n}},VV=function(t){return[{key:"",type:t}]},V$=function(t){function n(){var n=t.call(this,"never",function(t){return!1},function(t,n){return zU(t,n)},function(){throw Error("cannot encode never")})||this;return n._tag="NeverType",n}return zD(n,t),n}(zz),Vq=new V$,VK=function(t){function n(){var n=t.call(this,"any",function(t){return!0},rS,zB)||this;return n._tag="AnyType",n}return zD(n,t),n}(zz),VH=new VK,VG=function(t){function n(){var n=t.call(this,"object",function(t){return null!==t&&"object"==typeof t},function(t,r){return n.is(t)?rS(t):zU(t,r)},zB)||this;return n._tag="ObjectType",n}return zD(n,t),n}(zz),VZ=new VG;function VY(t,n,r){return void 0===r&&(r="(".concat(t.name," | ").concat(zV(n),")")),new Bw(r,function(r){return t.is(r)&&n(r)},function(r,i){var o=t.validate(r,i);if(gt(o))return o;var a=o.right;return n(a)?rS(a):zU(a,i)},t.encode,t,n)}var VJ=VY(Bf,Number.isInteger,"Integer"),VQ=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.props=a,u._tag="StrictType",u}return zD(n,t),n}(zz);function VX(t){return t}let V0=Object.freeze(Object.defineProperty({__proto__:null,AnyArrayType:By,AnyDictionaryType:Bb,AnyType:VK,Array:Bv,ArrayType:V_,BigIntType:Bp,BooleanType:Bm,Dictionary:Bx,DictionaryType:Vk,ExactType:VL,Function:VW,FunctionType:VF,Int:Vv,Integer:VJ,InterfaceType:VT,IntersectionType:VR,KeyofType:BT,LiteralType:B_,NeverType:V$,NullType:Bt,NumberType:Bd,ObjectType:VG,PartialType:VO,ReadonlyArrayType:VA,ReadonlyType:Vj,RecursiveType:Vb,RefinementType:Bw,StrictType:VQ,StringType:Bl,TaggedUnionType:VU,TupleType:VE,Type:zz,UndefinedType:Br,UnionType:VI,UnknownArray:Bv,UnknownRecord:Bx,UnknownType:Bu,VoidType:Bo,alias:function(t){return function(){return t}},any:VH,appendContext:z$,array:VS,bigint:Bh,boolean:Bg,brand:BO,clean:VX,dictionary:VC,emptyTags:z2,exact:VD,failure:zU,failures:r_,getContextEntry:function(t,n){return{key:t,type:n}},getDefaultContext:VV,getDomainKeys:zJ,getFunctionName:zV,getIndex:Be,getTags:z7,getValidationError:VB,identity:zB,interface:Vw,intersection:function(t,n){void 0===n&&(n="(".concat(t.map(function(t){return t.name}).join(" & "),")"));var r=t.length;return new VR(n,function(n){return t.every(function(t){return t.is(n)})},0===t.length?rS:function(n,i){for(var o=[],a=[],u=0;u<r;u++){var s=t[u],l=s.validate(n,z$(i,String(u),s,n));gt(l)?zq(a,l.left):o.push(l.right)}return a.length>0?r_(a):rS(zX(n,o))},0===t.length?zB:function(n){return zX(n,t.map(function(t){return t.encode(n)}))},t)},keyof:function(t,n){void 0===n&&(n=Object.keys(t).map(function(t){return JSON.stringify(t)}).join(" | "));var r=function(n){return Bc.is(n)&&zK.call(t,n)};return new BT(n,r,function(t,n){return r(t)?rS(t):zU(t,n)},zB,t)},literal:BS,mergeAll:zX,never:Vq,null:Bn,nullType:Bn,number:Bf,object:VZ,partial:function(t,n){void 0===n&&(n=zY(zZ(t)));var r=Object.keys(t),i=r.map(function(n){return t[n]}),o=r.length;return new VO(n,function(n){if(Bx.is(n)){for(var i=0;i<o;i++){var a=r[i],u=n[a];if(void 0!==u&&!t[a].is(u))return!1}return!0}return!1},function(n,i){var a=Bx.validate(n,i);if(gt(a))return a;for(var u=a.right,s=u,l=[],c=0;c<o;c++){var d=r[c],f=s[d],p=t[d],h=p.validate(f,z$(i,d,p,f));if(gt(h))void 0!==f&&zq(l,h.left);else{var m=h.right;m!==f&&(s===u&&(s=zF({},u)),s[d]=m)}}return l.length>0?r_(l):rS(s)},zG(i)?zB:function(t){for(var n=zF({},t),a=0;a<o;a++){var u=r[a],s=t[u];void 0!==s&&(n[u]=i[a].encode(s))}return n},t)},readonly:function(t,n){return void 0===n&&(n="Readonly<".concat(t.name,">")),new Vj(n,t.is,t.validate,t.encode,t)},readonlyArray:VN,record:VC,recursion:Vx,refinement:VY,strict:VP,string:Bc,success:rS,taggedUnion:Vz,tuple:function(t,n){void 0===n&&(n="[".concat(t.map(function(t){return t.name}).join(", "),"]"));var r=t.length;return new VE(n,function(n){return Bv.is(n)&&n.length===r&&t.every(function(t,r){return t.is(n[r])})},function(n,i){var o=Bv.validate(n,i);if(gt(o))return o;for(var a=o.right,u=a.length>r?a.slice(0,r):a,s=[],l=0;l<r;l++){var c=a[l],d=t[l],f=d.validate(c,z$(i,String(l),d,c));if(gt(f))zq(s,f.left);else{var p=f.right;p!==c&&(u===a&&(u=a.slice()),u[l]=p)}}return s.length>0?r_(s):rS(u)},zG(t)?zB:function(n){return t.map(function(t,r){return t.encode(n[r])})},t)},type:Vw,undefined:Bi,union:VM,unknown:Bs,void:Ba,voidType:Ba},Symbol.toStringTag,{value:"Module"})),V1=C(V0);var V2={};Object.defineProperty(V2,"__esModule",{value:!0}),V2.ContentPath=void 0,V2.ContentPath={serialize:t=>t.map(t=>t.key).join("::"),current:t=>t[t.length-1],append:(t,n)=>t+"::"+n,make:t=>t.reduce((t,{key:n,type:r})=>n?t.concat({key:n,type:r}):t,[])};var V3={},V4={};Object.defineProperty(V4,"__esModule",{value:!0}),V4.getAssetOrThrow=void 0;let V5=t=>n=>{let r=t[n];if(!r)throw Error(`Missing asset with id '${n}'!`);return r};V4.getAssetOrThrow=V5;var V6={};Object.defineProperty(V6,"__esModule",{value:!0}),V6.getEmbedOrThrow=void 0;let V9=t=>n=>{let r=t[n];if(!r)throw Error(`Missing embed with url '${n}'`);return r};V6.getEmbedOrThrow=V9;var V8={},V7={};let $e=C(rp);function $t(t,n,r){return void 0===r&&(r=t.name),new zz(r,t.is,t.validate,function(r){return n(t.encode(r))})}let $n=Object.freeze(Object.defineProperty({__proto__:null,mapOutput:$t},Symbol.toStringTag,{value:"Module"}));var $r,$i,$o,$a=VY(Bc,$i=function(t){return t.length>0},"NonEmptyString");function $u(t,n){void 0===n&&(n="NonEmptyArray<"+t.name+">");var r=VS(t);return new zz(n,function(t){return r.is(t)&&aC(t)},function(t,n){return rc(r.validate(t,n),mZ(function(r){var i=aF(r);return hT(i)?zU(t,n):rS(i.value)}))},function(t){return r.encode(t)})}function $s(t,n,r){void 0===r&&(r="Set<"+t.name+">");var i=VS(t),o=NA(n),a=Nk(n);return new zz(r,function(n){return n instanceof Set&&jz(t.is)(n)},function(t,n){return rc(i.validate(t,n),mZ(function(r){var i=a(r);return i.size!==r.length?zU(t,n):rS(i)}))},function(t){return i.encode(o(t))})}function $l(t,n){return new zz(t,n,function(t,r){return n(t)?rS(t):zU(t,r)},zB)}var $c=$l("Date",function(t){return t instanceof Date}),$d=globalThis&&globalThis.__spreadArray||function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))},$f=function(t,n){return{get:t,reverseGet:n}},$p=function(t){return $y(t.get,ro(t.reverseGet,re))},$h=function(t){return $I(ro(t.get,rv),t.reverseGet)},$m=function(t){return $A(ro(t.get,rv),ro(t.reverseGet,re))},$g=function(t){return $W(function(n){return function(r){return function(i){return n.map(r(t.get(i)),function(n){return t.reverseGet(n)})}}})},$y=function(t,n){return{get:t,set:n}},$v=function(t){return $A(ro(t.get,rv),t.set)},$b=function(t){return $W(function(n){return function(r){return function(i){return n.map(r(t.get(i)),function(n){return t.set(n)(i)})}}})},$x=function(t){return function(n){return $y(function(r){return t.get(n.get(r))},function(r){return function(i){return n.set(t.set(r)(n.get(i)))(i)}})}},$_=function(t){return function(n){return $I(ro(n.getOption,p3(t.getOption)),ro(t.reverseGet,n.reverseGet))}},$S=function(t){return function(n){return $D($M(t))($v(n))}},$T=function(){return $y(n7,re)},$w=function(t){return function(n){return $y(function(r){return n.get(r)[t]},function(r){return function(i){var o,a=n.get(i);return r===a[t]?i:n.set(Object.assign({},a,((o={})[t]=r,o)))(i)}})}},$O=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return function(n){return $y(function(r){for(var i=n.get(r),o={},a=0;a<t.length;a++){var u=t[a];o[u]=i[u]}return o},function(r){return function(i){for(var o=n.get(i),a=0;a<t.length;a++){var u=t[a];if(r[u]!==o[u])return n.set(Object.assign({},o,r))(i)}return i}})}},$k=function(t){return function(n){return $y(function(r){return n.get(r)[t]},function(r){return function(i){var o=n.get(i);if(r===o[t])return i;var a=o.slice();return a[t]=r,n.set(a)(i)}})}},$C=function(t){return function(n){var r;return rc(n,$x(({at:r=function(t){return $y(function(n){return Ea(t,n)},hw(function(){return En(t)},function(n){return Ee(t,n)}))}}).at(t)))}},$I=function(t,n){return{getOption:t,reverseGet:n}},$M=function(t){return $A(t.getOption,function(n){return $E(n)(t)})},$R=function(t){return $W(function(n){return function(r){return function(i){return rc(t.getOption(i),hw(function(){return n.of(i)},function(o){return n.map(r(o),function(n){return $E(n)(t)(i)})}))}}})},$E=function(t){var n;return n=function(){return t},function(t){var r,i,o=(r=t,function(t){return rc(r.getOption(t),pJ(function(i){var o=n(i);return o===i?t:r.reverseGet(o)}))});return function(t){return rc(o(t),hO(function(){return t}))}}},$j=function(t){return $I(pR(t),n7)},$A=function(t,n){return{getOption:t,set:n}},$N=function(t){return $W(function(n){return function(r){return function(i){return rc(t.getOption(i),hw(function(){return n.of(i)},function(o){return n.map(r(o),function(n){return t.set(n)(i)})}))}}})},$P=function(t){return function(n){return function(r){return rc(n.getOption(r),pJ(function(i){var o=t(i);return o===i?r:n.set(o)(r)}))}}},$L=function(t){return function(n){var r=$P(t)(n);return function(t){return rc(r(t),hO(function(){return t}))}}},$D=function(t){return function(n){return $A(ro(n.getOption,p3(t.getOption)),function(r){return $L(t.set(r))(n)})}},$F=function(t,n,r){if(r[t]===n)return r;var i=$d([r[0]],r.slice(1),!0);return i[t]=n,i},$W=function(t){return{modifyF:t}};function $U(t){return function(n){return $W(function(r){return function(i){return n.modifyF(r)(t.modifyF(r)(i))}})}}var $z={URI:"Identity",map:function(t,n){return n(t)},of:n7,ap:function(t,n){return t(n)}},$B=function(t){return{index:t}},$V=ro($p,$x),$$=function(t){return ro($v,$D(t))},$q=function(t){return ro($b,$U(t))},$K=function(t){return function(n){return function(r){var i=n.get(r),o=t(i);return i===o?r:n.set(o)(r)}}},$H=function(t){return $S($I(hN,n7))(t)},$G=function(t){var n;return ro($v,function(n){return rc(n,$D($B(function(t){return $A(function(n){return sL(t,n)},function(n){return function(r){return rc(sL(t,r),hw(function(){return r},function(){return cN(t,n,r)}))}})}).index(t)))})},$Z=function(t){var n;return ro($v,function(n){return rc(n,$D($B(function(t){return $A(function(n){return sL(t,n)},function(n){return function(r){return rc(sL(t,r),hw(function(){return r},function(){return $F(t,n,r)}))}})}).index(t)))})},$Y=function(t){var n;return ro($v,function(n){return rc(n,$D($B(function(t){return $A(function(n){return Ea(t,n)},function(n){return function(r){return r[t]===n||hT(Ea(t,r))?r:Ee(t,n)(r)}})}).index(t)))})},$J=$S($I(n7,rv)),$Q=$S($I(pj,rS)),$X=$S($I(function(t){return gt(t)?rv(t.left):ry},r_)),$0=function(t,n){return function(r){return $1(r,t,n)}},$1=function(t,n,r){return $y(ro(t.get,n),ro(r,t.set))},$2="monocle-ts/Lens",$3={URI:$2,compose:function(t,n){return $x(t)(n)}},$4={URI:$2,compose:$3.compose,id:$T};let $5=Object.freeze(Object.defineProperty({__proto__:null,Category:$4,Invariant:{URI:$2,imap:$1},Semigroupoid:$3,URI:$2,asOptional:$v,asTraversal:$b,atKey:$C,component:$k,compose:$x,composeIso:$V,composeLens:$x,composeOptional:$$,composePrism:$S,composeTraversal:$q,filter:function(t){return $S($j(t))},findFirst:function(t){var n;return $$($A(sH(t),function(n){return function(r){return rc(sK(t)(r),hw(function(){return r},function(t){return cN(t,n,r)}))}}))},findFirstNonEmpty:function(t){var n;return $$($A(sH(t),function(n){return function(r){return rc(sK(t)(r),hw(function(){return r},function(t){return $F(t,n,r)}))}}))},fromNullable:$H,id:$T,imap:$0,index:$G,indexNonEmpty:$Z,key:$Y,left:$X,lens:$y,modify:$K,modifyF:function(t){return function(n){return function(r){return function(i){return rc(r.get(i),n,function(n){return t.map(n,function(t){return r.set(t)(i)})})}}}},prop:$w,props:$O,right:$Q,some:$J,traverse:function(t){var n,r;return ro($b,$U($W(function(n){var r,i="Identity"===n.URI?t.map:t.traverse(n);return function(t){return function(n){return i(n,t)}}})))}},Symbol.toStringTag,{value:"Module"}));var $6=function(t){return function(n){return n.modifyF($z)(t)}},$9=function(t){return new qr(t.get,t.reverseGet)},$8=function(t){return new qi(t.get,t.set)},$7=function(t){return new qo(t.getOption,t.reverseGet)},qe=function(t){return new qu(t.getOption,t.set)},qt=function(t){return new qs(t.modifyF)},qn=function(t,n,r){var i;return r===t[n]?t:Object.assign({},t,((i={})[n]=r,i))},qr=function(){function t(t,n){this.get=t,this.reverseGet=n,this._tag="Iso",this.unwrap=this.get,this.to=this.get,this.wrap=this.reverseGet,this.from=this.reverseGet}return t.prototype.reverse=function(){var t;return $9($f(this.reverseGet,this.get))},t.prototype.modify=function(t){var n,r;return r=this,function(n){return r.reverseGet(t(r.get(n)))}},t.prototype.asLens=function(){return $8($p(this))},t.prototype.asPrism=function(){return $7($h(this))},t.prototype.asOptional=function(){return qe($m(this))},t.prototype.asTraversal=function(){return qt($g(this))},t.prototype.asFold=function(){var t=this;return new qc(function(){return function(n){return function(r){return n(t.get(r))}}})},t.prototype.asGetter=function(){var t=this;return new ql(function(n){return t.get(n)})},t.prototype.asSetter=function(){var t=this;return new qd(function(n){return t.modify(n)})},t.prototype.compose=function(t){var n,r;return $9((r=this,$f(ro(r.get,t.get),ro(t.reverseGet,r.reverseGet))))},t.prototype.composeIso=function(t){return this.compose(t)},t.prototype.composeLens=function(t){return $8(rc(this,$p,$x(t)))},t.prototype.composePrism=function(t){return $7(rc(this,$h,$_(t)))},t.prototype.composeOptional=function(t){return qe(rc(this,$m,$D(t)))},t.prototype.composeTraversal=function(t){return qt(rc(this,$g,$U(t)))},t.prototype.composeFold=function(t){return this.asFold().compose(t)},t.prototype.composeGetter=function(t){return this.asGetter().compose(t)},t.prototype.composeSetter=function(t){return this.asSetter().compose(t)},t}(),qi=function(){function t(t,n){this.get=t,this.set=n,this._tag="Lens"}return t.fromPath=function(){var n=t.fromProp();return function(t){var r=n(t[0]);return t.slice(1).reduce(function(t,r){return t.compose(n(r))},r)}},t.fromProp=function(){return function(t){return $8(rc($T(),$w(t)))}},t.fromProps=function(){return function(t){return $8(rc($T(),$O.apply($5,t)))}},t.fromNullableProp=function(){return function(n,r){return new t(function(t){var i=hN(t[n]);return hT(i)?r:i.value},function(t){return function(r){return qn(r,n,t)}})}},t.prototype.modify=function(t){return $K(t)(this)},t.prototype.asOptional=function(){return qe($v(this))},t.prototype.asTraversal=function(){return qt($b(this))},t.prototype.asSetter=function(){var t=this;return new qd(function(n){return t.modify(n)})},t.prototype.asGetter=function(){var t=this;return new ql(function(n){return t.get(n)})},t.prototype.asFold=function(){var t=this;return new qc(function(){return function(n){return function(r){return n(t.get(r))}}})},t.prototype.compose=function(t){return $8($x(t)(this))},t.prototype.composeLens=function(t){return this.compose(t)},t.prototype.composeGetter=function(t){return this.asGetter().compose(t)},t.prototype.composeFold=function(t){return this.asFold().compose(t)},t.prototype.composeOptional=function(t){return qe(rc(this,$v,$D(t)))},t.prototype.composeTraversal=function(t){return qt(rc(this,$b,$U(t)))},t.prototype.composeSetter=function(t){return this.asSetter().compose(t)},t.prototype.composeIso=function(t){return $8(rc(this,$x(rc(t,$p))))},t.prototype.composePrism=function(t){return qe($S(t)(this))},t}(),qo=function(){function t(t,n){this.getOption=t,this.reverseGet=n,this._tag="Prism"}return t.fromPredicate=function(t){return $7($j(t))},t.some=function(){return qa},t.prototype.modify=function(t){var n=this;return function(r){var i=n.modifyOption(t)(r);return hT(i)?r:i.value}},t.prototype.modifyOption=function(t){var n=this;return function(r){return hJ.map(n.getOption(r),function(i){var o=t(i);return o===i?r:n.reverseGet(o)})}},t.prototype.set=function(t){return this.modify(function(){return t})},t.prototype.asOptional=function(){return qe($M(this))},t.prototype.asTraversal=function(){return qt($R(this))},t.prototype.asSetter=function(){var t=this;return new qd(function(n){return t.modify(n)})},t.prototype.asFold=function(){var t=this;return new qc(function(n){return function(r){return function(i){var o=t.getOption(i);return hT(o)?n.empty:r(o.value)}}})},t.prototype.compose=function(t){return $7($_(t)(this))},t.prototype.composePrism=function(t){return this.compose(t)},t.prototype.composeOptional=function(t){return qe(rc(this,$M,$D(t)))},t.prototype.composeTraversal=function(t){return qt(rc(this,$R,$U(t)))},t.prototype.composeFold=function(t){return this.asFold().compose(t)},t.prototype.composeSetter=function(t){return this.asSetter().compose(t)},t.prototype.composeIso=function(t){return $7(rc(this,$_(rc(t,$h))))},t.prototype.composeLens=function(t){var n;return qe((n=t,function(t){return $D($v(n))($M(t))})(this))},t.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},t}(),qa=new qo(n7,rv),qu=function(){function t(t,n){this.getOption=t,this.set=n,this._tag="Optional"}return t.fromPath=function(){var n=t.fromNullableProp();return function(t){var r=n(t[0]);return t.slice(1).reduce(function(t,r){return t.compose(n(r))},r)}},t.fromNullableProp=function(){return function(n){return new t(function(t){return hN(t[n])},function(t){return function(r){return null==r[n]?r:qn(r,n,t)}})}},t.fromOptionProp=function(){var t=qi.fromProp();return function(n){return t(n).composePrism(qa)}},t.prototype.modify=function(t){return $L(t)(this)},t.prototype.modifyOption=function(t){return $P(t)(this)},t.prototype.asTraversal=function(){return qt($N(this))},t.prototype.asFold=function(){var t=this;return new qc(function(n){return function(r){return function(i){var o=t.getOption(i);return hT(o)?n.empty:r(o.value)}}})},t.prototype.asSetter=function(){var t=this;return new qd(function(n){return t.modify(n)})},t.prototype.compose=function(t){return qe($D(t)(this))},t.prototype.composeOptional=function(t){return this.compose(t)},t.prototype.composeTraversal=function(t){return qt(rc(this,$N,$U(t)))},t.prototype.composeFold=function(t){return this.asFold().compose(t)},t.prototype.composeSetter=function(t){return this.asSetter().compose(t)},t.prototype.composeLens=function(t){return qe(rc(this,$D(rc(t,$v))))},t.prototype.composePrism=function(t){return qe(rc(this,$D(rc(t,$M))))},t.prototype.composeIso=function(t){return qe(rc(this,$D(rc(t,$m))))},t.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},t}(),qs=function(){function t(t){this.modifyF=t,this._tag="Traversal"}return t.prototype.modify=function(t){return $6(t)(this)},t.prototype.set=function(t){var n;return $6(function(){return t})(this)},t.prototype.filter=function(t){var n;return qt($U($R($j(t)))(this))},t.prototype.asFold=function(){var t=this;return new qc(function(n){return function(r){return t.modifyF(mn(n))(function(t){return n7(r(t))})}})},t.prototype.asSetter=function(){var t=this;return new qd(function(n){return t.modify(n)})},t.prototype.compose=function(t){return qt($U(t)(this))},t.prototype.composeTraversal=function(t){return this.compose(t)},t.prototype.composeFold=function(t){return this.asFold().compose(t)},t.prototype.composeSetter=function(t){return this.asSetter().compose(t)},t.prototype.composeOptional=function(t){return this.compose(t.asTraversal())},t.prototype.composeLens=function(t){return qt(rc(this,$U(rc(t,$b))))},t.prototype.composePrism=function(t){return qt(rc(this,$U(rc(t,$R))))},t.prototype.composeIso=function(t){return qt(rc(this,$U(rc(t,$g))))},t.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},t}(),ql=function(){function t(t){this.get=t,this._tag="Getter"}return t.prototype.asFold=function(){var t=this;return new qc(function(){return function(n){return function(r){return n(t.get(r))}}})},t.prototype.compose=function(n){var r=this;return new t(function(t){return n.get(r.get(t))})},t.prototype.composeGetter=function(t){return this.compose(t)},t.prototype.composeFold=function(t){return this.asFold().compose(t)},t.prototype.composeLens=function(t){return this.compose(t.asGetter())},t.prototype.composeIso=function(t){return this.compose(t.asGetter())},t.prototype.composeTraversal=function(t){return this.asFold().compose(t.asFold())},t.prototype.composeOptional=function(t){return this.asFold().compose(t.asFold())},t.prototype.composePrism=function(t){return this.asFold().compose(t.asFold())},t}(),qc=function(){function t(t){this.foldMap=t,this._tag="Fold",this.getAll=t(f_())(a0),this.exist=t(wE),this.all=t(wR),this.foldMapFirst=t(h0())}return t.prototype.compose=function(n){var r=this;return new t(function(t){return function(i){return r.foldMap(t)(n.foldMap(t)(i))}})},t.prototype.composeFold=function(t){return this.compose(t)},t.prototype.composeGetter=function(t){return this.compose(t.asFold())},t.prototype.composeTraversal=function(t){return this.compose(t.asFold())},t.prototype.composeOptional=function(t){return this.compose(t.asFold())},t.prototype.composeLens=function(t){return this.compose(t.asFold())},t.prototype.composePrism=function(t){return this.compose(t.asFold())},t.prototype.composeIso=function(t){return this.compose(t.asFold())},t.prototype.find=function(t){return this.foldMapFirst(pR(t))},t.prototype.headOption=function(t){return this.find(function(){return!0})(t)},t}(),qd=function(){function t(t){this.modify=t,this._tag="Setter"}return t.prototype.set=function(t){return this.modify(re(t))},t.prototype.compose=function(n){var r=this;return new t(function(t){return r.modify(n.modify(t))})},t.prototype.composeSetter=function(t){return this.compose(t)},t.prototype.composeTraversal=function(t){return this.compose(t.asSetter())},t.prototype.composeOptional=function(t){return this.compose(t.asSetter())},t.prototype.composeLens=function(t){return this.compose(t.asSetter())},t.prototype.composePrism=function(t){return this.compose(t.asSetter())},t.prototype.composeIso=function(t){return this.compose(t.asSetter())},t}(),qf=new qr(n7,n7),qp=VP({_tag:BS("None")}),qh=BS("Some");function qm(t,n){return void 0===n&&(n="Option<"+t.name+">"),VM([qp,VP({_tag:qh,value:t},"Some<"+t.name+">")],n)}var qg=new zz("DateFromISOString",function(t){return t instanceof Date},function(t,n){return rc(Bc.validate(t,n),mZ(function(r){var i=new Date(r);return isNaN(i.getTime())?zU(t,n):rS(i)}))},function(t){return t.toISOString()});function qy(t){var n=Object.create(Object.getPrototypeOf(t));return Object.assign(n,t),n}var qv=new zz("DateFromNumber",function(t){return t instanceof Date},function(t,n){return rc(Bf.validate(t,n),mZ(function(r){var i=new Date(r);return isNaN(i.getTime())?zU(t,n):rS(i)}))},function(t){return t.getTime()});function qb(t,n,r){void 0===r&&(r=t.name);var i=qy(t);return i.validate=n,i.decode=function(t){return n(t,VV(i))},i.name=r,i}var qx,q_,qS,qT=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,qw=VY(Bc,q_=function(t){return qT.test(t)},"UUID"),qO=new zz("BooleanFromString",Bg.is,function(t,n){return rc(Bc.validate(t,n),mZ(function(r){return"true"===r?rS(!0):"false"===r?rS(!1):zU(t,n)}))},String);function qk(t){switch(t._tag){case"InterfaceType":return t.props;case"ExactType":return qk(t.type)}}var qC=qi.fromProp(),qI=$l("RegExp",function(t){return"[object RegExp]"===Object.prototype.toString.call(t)}),qM=new zz("DateFromUnixTime",function(t){return t instanceof Date},function(t,n){return rc(Vv.validate(t,n),mZ(function(r){var i=new Date(1e3*r);return isNaN(i.getTime())?zU(t,n):rS(i)}))},function(t){return Math.floor(t.getTime()/1e3)}),qR=new zz("NumberFromString",Bf.is,function(t,n){return rc(Bc.validate(t,n),mZ(function(r){var i=+r;return isNaN(i)||""===r.trim()?zU(t,n):rS(i)}))},String),qE=new zz("IntFromString",Vv.is,function(t,n){return rc(qR.validate(t,n),mZ(function(r){return Vv.is(r)?rS(r):zU(t,n)}))},qR.encode),qj=Vx("JsonArray",function(){return VN(qN)}),qA=Vx("JsonRecord",function(){return VC(Bc,qN)}),qN=VM([Bg,Bf,Bc,Bn,qj,qA],"Json"),qP=new zz("JsonFromString",qN.is,function(t,n){try{return rS(JSON.parse(t))}catch{return zU(t,n)}},function(t){return JSON.stringify(t)}),qL=BS("Left"),qD=BS("Right"),qF=new zz("BigIntFromString",function(t){return"bigint"==typeof t},function(t,n){return rc(Bc.validate(t,n),mZ(function(r){if(!$a.is(r.trim()))return zU(t,n);try{return rS(BigInt(r))}catch{return zU(t,n)}}))},String),qW=new zz("BooleanFromNumber",Bg.is,function(t,n){return rc(Bf.validate(t,n),mz(function(t){return 0!==t}))},Number);let qU=Object.freeze(Object.defineProperty({__proto__:null,BigIntFromString:qF,BooleanFromNumber:qW,BooleanFromString:qO,DateFromISOString:qg,DateFromNumber:qv,DateFromUnixTime:qM,IntFromString:qE,Json:qN,JsonArray:qj,JsonFromString:qP,JsonRecord:qA,NonEmptyString:$a,NumberFromString:qR,UUID:qw,clone:qy,date:$c,either:function(t,n,r){return void 0===r&&(r="Either<"+t.name+", "+n.name+">"),VM([VP({_tag:qL,left:t},"Left<"+t.name+">"),VP({_tag:qD,right:n},"Right<"+t.name+">")],r)},fromNewtype:function(t,n){return void 0===n&&(n="fromNewtype("+t.name+")"),new zz(n,function(n){return t.is(n)},function(n,r){return rc(t.validate(n,r),mz(qf.wrap))},function(n){return t.encode(qf.unwrap(n))})},fromNullable:function(t,n,r){return void 0===r&&(r="fromNullable("+t.name+")"),qb(t,function(r,i){return null==r?rS(n):t.validate(r,i)},r)},fromRefinement:$l,getLenses:function(t){var n={};for(var r in qk(t))n[r]=qC(r);return n},mapOutput:$t,nonEmptyArray:$u,option:qm,optionFromNullable:function(t,n){return void 0===n&&(n="Option<"+t.name+">"),new zz(n,qm(t).is,function(n,r){return null==n?rS(ry):rc(t.validate(n,r),mz(rv))},function(n){return hW(rc(n,pJ(t.encode)))})},readonlyNonEmptyArray:function(t,n){return void 0===n&&(n="ReadonlyNonEmptyArray<"+t.name+">"),$u(t,n)},readonlySetFromArray:function(t,n,r){return void 0===r&&(r="ReadonlySet<"+t.name+">"),$s(t,n,r)},regexp:qI,setFromArray:$s,withEncode:function(t,n,r){return void 0===r&&(r=t.name),new zz(r,t.is,t.validate,n)},withFallback:function(t,n,r){return void 0===r&&(r="withFallback("+t.name+")"),qb(t,function(r,i){return gm(function(){return rS(n)})(t.validate(r,i))},r)},withMessage:function(t,n){return qb(t,function(r,i){return m4(function(){return[{value:r,context:i,message:n(r,i),actual:r}]})(t.validate(r,i))})},withValidate:qb},Symbol.toStringTag,{value:"Module"})),qz=C(qU),qB=C($n);Object.defineProperty(V7,"__esModule",{value:!0}),V7.withCustomError=V7.addType=V7.isEmpty=V7.objectToMap=V7.grouped=V7.formatDate=V7.formatDateTime=V7.filterDouble=V7.refineType=V7.nullable=void 0;let qV=nQ,q$=(0,qV.__importStar)(V1);V7.nullable=function(t){return q$.union([t,q$.null,q$.undefined])},V7.refineType=function(t,n,r){return new q$.Type(n,t.is,(n,i)=>(0,$e.pipe)(t.validate(n,i),Uq.either.chain(t=>r(t)?q$.success(t):q$.failure(n,i))),t.encode)},V7.filterDouble=function(t){if(""===t)return null;let n=Number(t);return Number.isNaN(n)?null:n},V7.formatDateTime=function(t){return t.toISOString().replace(/\.\d{3}Z$/,"+0000")},V7.formatDate=function(t){return t.toISOString().replace(/T.*/,"")},V7.grouped=function(t,n){return t.reduce((t,r,i)=>(i%n==0?t.push([r]):t[Math.floor(i/n)].push(r),t),[])},V7.objectToMap=function(t){return new Map(Object.entries(t))},V7.isEmpty=function(t){for(let n in t)return!1;return!0},V7.addType=function(t,n){return(0,qB.mapOutput)(t,t=>({...t,__TYPE__:n}))},V7.withCustomError=function(t,n){return(0,qz.withValidate)(t,(r,i)=>Uq.either.mapLeft(t=>t.find(t=>t.message)?t:[{value:r,context:i,message:n(r,i),actual:r}])(t.validate(r,i)))},Object.defineProperty(V8,"__esModule",{value:!0}),V8.WidgetKey=void 0;let qq=nQ,qK=(0,qq.__importStar)(V1),qH=RegExp("^[^<>]+$");V8.WidgetKey=(0,V7.refineType)(qK.string,"WidgetKey",t=>0===t.length||qH.test(t)),function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nQ;(0,n.__exportStar)(V4,t),(0,n.__exportStar)(V6,t),(0,n.__exportStar)(V8,t)}(V3);var qG={},qZ={},qY={},qJ={},qQ={};Object.defineProperty(qQ,"__esModule",{value:!0}),qQ.clone=void 0,qQ.clone=function(t){var n=Object.create(Object.getPrototypeOf(t));return Object.assign(n,t),n};var qX=k&&k.__createBinding||(Object.create?function(t,n,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return n[r]}})}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]}),q0=k&&k.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),q1=k&&k.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&qX(n,t,r);return q0(n,t),n};Object.defineProperty(qJ,"__esModule",{value:!0}),qJ.withValidate=void 0;var q2=q1(V1);qJ.withValidate=function(t,n,r){void 0===r&&(r=t.name);var i=qQ.clone(t);return i.validate=n,i.decode=function(t){return n(t,q2.getDefaultContext(i))},i.name=r,i};var q3=k&&k.__createBinding||(Object.create?function(t,n,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return n[r]}})}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]}),q4=k&&k.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),q5=k&&k.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&q3(n,t,r);return q4(n,t),n};Object.defineProperty(qY,"__esModule",{value:!0}),qY.withFallback=void 0;var q6=q5(V1);qY.withFallback=function(t,n,r){return void 0===r&&(r="withFallback("+t.name+")"),qJ.withValidate(t,function(r,i){return UK.orElse(function(){return q6.success(n)})(t.validate(r,i))},r)};var q9={},q8={};Object.defineProperty(q8,"__esModule",{value:!0}),q8.EmptyArray=q8.EmptyObject=q8.Boolean=q8.NumberOrNull=q8.Number=q8.StringOrNull=q8.String=void 0;let q7=nQ,Ke=(0,q7.__importStar)(V1);q8.String=(0,V7.withCustomError)(Ke.string,()=>"The value must be a string"),q8.StringOrNull=(0,V7.withCustomError)(Ke.union([Ke.string,Ke.null]),()=>"The value must be a string or null"),q8.Number=(0,V7.withCustomError)(Ke.number,()=>"The value must be a number"),q8.NumberOrNull=(0,V7.withCustomError)(Ke.union([Ke.number,Ke.null]),()=>"The value must be a number or null"),q8.Boolean=(0,V7.withCustomError)(Ke.boolean,()=>"The value must be a boolean"),q8.EmptyObject=Ke.UnknownRecord.pipe(new Ke.Type("emptyObject",t=>Ke.UnknownRecord.is(t),(t,n)=>Object.keys(t).length>0?Ke.failure(t,n,"The object is not empty."):Ke.success({}),Ke.identity)),q8.EmptyArray=new Ke.Type("emptyArray",t=>Ke.UnknownArray.is(t)&&0===t.length,(t,n)=>(0,UZ.pipe)(Ke.UnknownArray.decode(t),Uq.either.chain(r=>r.length>0?Ke.failure(t,n,"The array is not empty."):Ke.success([]))),()=>[]);var Kt={};let Kn=C(gD);var Kr={};Object.defineProperty(Kr,"__esModule",{value:!0});let Ki=nQ,Ko=(0,Ki.__importStar)(V1);Kr.default=new Ko.Type("dateFromStringOrNumber",t=>t instanceof Date,(t,n)=>(0,$e.pipe)(Ko.union([Ko.number,Ko.string]).validate(t,n),(0,Kn.chain)(r=>{let i=new Date(r);return isNaN(i.getTime())?Ko.failure(t,n):Ko.success(i)})),t=>t);var Ka={};Object.defineProperty(Ka,"__esModule",{value:!0});let Ku=nQ,Ks=(0,Ku.__importStar)(V1);Ka.default=new Ks.Type("dateFromTsMs",t=>t instanceof Date,(t,n)=>(0,$e.pipe)(Ks.number.validate(t,n),(0,Kn.chain)(r=>{let i=new Date(r);return isNaN(i.getTime())?Ks.failure(t,n):Ks.success(i)})),t=>t.getTime());var Kl={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.EmptyArrayOrElse=t.EmptyObjectOrElse=t.NullOrElse=t.DefaultOrElse=void 0;let n=nQ,r=(0,n.__importStar)(V1),i=t=>n=>new r.Type(`DefaultOrElse<${t.name}, ${n.name}>`,t=>null===t||n.is(t),(i,o)=>(0,UK.isRight)(t.validate(i,o))?r.success(null):n.validate(i,o),t=>t?n.encode(t):void 0);t.DefaultOrElse=i;let o=n=>(0,t.DefaultOrElse)(r.null)(n);t.NullOrElse=o;let a=n=>(0,t.DefaultOrElse)(q8.EmptyObject)(n);t.EmptyObjectOrElse=a;let u=n=>(0,t.DefaultOrElse)(q8.EmptyArray)(n);t.EmptyArrayOrElse=u}(Kl);var Kc={};Object.defineProperty(Kc,"__esModule",{value:!0});let Kd=nQ,Kf=(0,Kd.__importStar)(V1);Kc.default=new Kf.Type("IntFromNumber",Kf.Int.is,(t,n)=>(0,$e.pipe)(Kf.number.validate(t,n),(0,Kn.chain)(t=>Kf.Int.is(t)?Kf.success(t):Kf.success(Math.round(t)))),Kf.Int.encode);var Kp={};Object.defineProperty(Kp,"__esModule",{value:!0});let Kh=nQ,Km=(0,Kh.__importStar)(V1),Kg=/^([0-9]+)px$/;Kp.default=new Km.Type("IntFromPixels",Km.Int.is,(t,n)=>(0,$e.pipe)(Km.string.validate(t,n),(0,Kn.chain)(r=>{try{let i=r.match(Kg);if(!i)return Km.failure(t,n);let o=parseInt(i[1]);return Km.success(o)}catch{return Km.failure(t,n)}})),String);var Ky={};Object.defineProperty(Ky,"__esModule",{value:!0});let Kv=nQ,Kb=(0,Kv.__importStar)(V1);Ky.default=(0,V7.withCustomError)((0,V7.refineType)(Kb.string,"nonEmptyString",t=>t.trim().length>0),()=>"The value must be a non-empty string");var Kx={},K_={};Object.defineProperty(K_,"__esModule",{value:!0});let KS=nQ,KT=(0,KS.__importStar)(V1);K_.default=(0,V7.nullable)(KT.string),Object.defineProperty(Kx,"__esModule",{value:!0});let Kw=nQ,KO=(0,Kw.__importDefault)(K_);Kx.default=new V1.Type("nonEmptyStringOrNull",t=>"string"==typeof t||null===t,(t,n)=>(0,$e.pipe)(KO.default.validate(t,n),(0,Kn.chain)(t=>"string"==typeof t&&t.length>0?(0,V1.success)(t):(0,V1.success)(null))),t=>t);var Kk={};Object.defineProperty(Kk,"__esModule",{value:!0});let KC=nQ,KI=(0,KC.__importStar)(V1);Kk.default=(0,V7.nullable)(KI.number);var KM={};Object.defineProperty(KM,"__esModule",{value:!0});let KR=nQ,KE=(0,KR.__importStar)(V1);KM.default=(t,n,r)=>q8.Number.pipe(new KE.Type("numberInRange",t=>q8.Number.is(t),(i,o)=>i>n||i<t?KE.failure(i,o,`${r} must be a number between ${t} and ${n}`):KE.success(i),KE.identity));var Kj={};Object.defineProperty(Kj,"__esModule",{value:!0});let KA=nQ,KN=(0,KA.__importStar)(V1);Kj.default=new KN.Type("StringFromInt",KN.string.is,(t,n)=>(0,$e.pipe)(KN.boolean.validate(t,n),(0,Kn.chain)(t=>KN.success(t.toString()))),t=>t);var KP={};Object.defineProperty(KP,"__esModule",{value:!0});let KL=nQ,KD=(0,KL.__importStar)(V1);function KF(){return H8||(H8=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.StringOrNull=t.StringFromNumber=t.StringFromBoolean=t.NumberRange=t.NumberOrNull=t.NonEmptyStringOrNull=t.NonEmptyString=t.IntFromPixels=t.IntFromNumber=t.Function=t.DateFromTsMs=t.DateFromStringOrNumber=t.DateFromString=void 0;let n=nQ;(0,n.__exportStar)(q8,t);var r=function(){if(H9)return Kt;H9=1,Object.defineProperty(Kt,"__esModule",{value:!0});let t=nQ,n=(0,t.__importStar)(V1),r=KF();return Kt.default=new n.Type("dateFromString",t=>t instanceof Date,(t,i)=>(0,$e.pipe)(r.String.validate(t,i),(0,Kn.chain)(r=>{let o=new Date(r);return isNaN(o.getTime())?n.failure(t,i):n.success(o)})),t=>t.toISOString()),Kt}();Object.defineProperty(t,"DateFromString",{enumerable:!0,get:function(){return(0,n.__importDefault)(r).default}}),Object.defineProperty(t,"DateFromStringOrNumber",{enumerable:!0,get:function(){return(0,n.__importDefault)(Kr).default}}),Object.defineProperty(t,"DateFromTsMs",{enumerable:!0,get:function(){return(0,n.__importDefault)(Ka).default}}),(0,n.__exportStar)(Kl,t),t.Function=(0,n.__importStar)(V7),Object.defineProperty(t,"IntFromNumber",{enumerable:!0,get:function(){return(0,n.__importDefault)(Kc).default}}),Object.defineProperty(t,"IntFromPixels",{enumerable:!0,get:function(){return(0,n.__importDefault)(Kp).default}}),Object.defineProperty(t,"NonEmptyString",{enumerable:!0,get:function(){return(0,n.__importDefault)(Ky).default}}),Object.defineProperty(t,"NonEmptyStringOrNull",{enumerable:!0,get:function(){return(0,n.__importDefault)(Kx).default}}),Object.defineProperty(t,"NumberOrNull",{enumerable:!0,get:function(){return(0,n.__importDefault)(Kk).default}}),Object.defineProperty(t,"NumberRange",{enumerable:!0,get:function(){return(0,n.__importDefault)(KM).default}}),Object.defineProperty(t,"StringFromBoolean",{enumerable:!0,get:function(){return(0,n.__importDefault)(Kj).default}}),Object.defineProperty(t,"StringFromNumber",{enumerable:!0,get:function(){return(0,n.__importDefault)(KP).default}}),Object.defineProperty(t,"StringOrNull",{enumerable:!0,get:function(){return(0,n.__importDefault)(K_).default}})}(q9)),q9}KP.default=new KD.Type("StringFromInt",KD.string.is,(t,n)=>(0,$e.pipe)(KD.number.validate(t,n),(0,Kn.chain)(t=>KD.success(t.toString()))),t=>t);var KW={},KU={},Kz={},KB={},KV={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanField=t.BooleanConfig=t.BooleanFieldType=void 0;let n=(0,nQ.__importStar)(V1),r=KF();t.BooleanFieldType="Boolean",t.BooleanConfig=n.exact(n.partial({label:r.StringOrNull,default_value:n.boolean,placeholder_true:n.string,placeholder_false:n.string})),t.BooleanField=n.exact(n.intersection([n.type({type:n.literal(t.BooleanFieldType)}),n.partial({config:t.BooleanConfig})]))}(KV);var K$={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Color=t.ColorConfig=t.ColorFieldType=void 0;let n=(0,nQ.__importStar)(V1),r=KF();t.ColorFieldType="Color",t.ColorConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string})),t.Color=n.exact(n.intersection([n.type({type:n.literal(t.ColorFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.ColorConfig})]))}(K$);var Kq={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Date=t.DateConfig=t.DateFieldType=void 0;let n=(0,nQ.__importStar)(V1),r=KF();t.DateFieldType="Date",t.DateConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,default:n.string})),t.Date=n.exact(n.intersection([n.type({type:n.literal(t.DateFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.DateConfig})]))}(Kq);var KK={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Embed=t.EmbedConfig=t.EmbedFieldType=void 0;let n=(0,nQ.__importStar)(V1),r=KF();t.EmbedFieldType="Embed",t.EmbedConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,useAsTitle:n.boolean})),t.Embed=n.exact(n.intersection([n.type({type:n.literal(t.EmbedFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.EmbedConfig})]))}(KK);var KH={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.GeoPoint=t.GeoPointConfig=t.GeoPointFieldType=void 0;let n=(0,nQ.__importStar)(V1),r=KF();t.GeoPointFieldType="GeoPoint",t.GeoPointConfig=n.exact(n.partial({label:r.StringOrNull})),t.GeoPoint=n.exact(n.intersection([n.type({type:n.literal(t.GeoPointFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.GeoPointConfig})]))}(KH);var KG={},KZ={},KY={},KJ={},KQ={};Object.defineProperty(KQ,"__esModule",{value:!0}),KQ.pipe=KQ.pipeable=void 0,KQ.pipeable=function(t){var n,r,i,o,a,u,s,l,c,d,f,p,h,m,g,y={};if("function"==typeof t.map){var v=function(n){return function(r){return t.map(r,n)}};y.map=v}if("function"==typeof t.contramap){var b=function(n){return function(r){return t.contramap(r,n)}};y.contramap=b}if("function"==typeof t.mapWithIndex){var x=function(n){return function(r){return t.mapWithIndex(r,n)}};y.mapWithIndex=x}if("function"==typeof t.ap){var _=function(n){return function(r){return t.ap(r,n)}},S=function(n){return function(r){return t.ap(t.map(r,function(t){return function(){return t}}),n)}};y.ap=_,y.apFirst=S,y.apSecond=function(n){return function(r){return t.ap(t.map(r,function(){return function(t){return t}}),n)}}}if("function"==typeof t.chain){var T=function(n){return function(r){return t.chain(r,n)}},w=function(n){return function(r){return t.chain(r,function(r){return t.map(n(r),function(){return r})})}},O=function(n){return t.chain(n,UZ.identity)};y.chain=T,y.chainFirst=w,y.flatten=O}if("function"==typeof t.bimap){var k=function(n,r){return function(i){return t.bimap(i,n,r)}},C=function(n){return function(r){return t.mapLeft(r,n)}};y.bimap=k,y.mapLeft=C}if("function"==typeof t.extend){var I=function(n){return function(r){return t.extend(r,n)}},M=function(n){return t.extend(n,UZ.identity)};y.extend=I,y.duplicate=M}if("function"==typeof t.reduce){var R=function(n,r){return function(i){return t.reduce(i,n,r)}},E=function(n){var r=t.foldMap(n);return function(t){return function(n){return r(n,t)}}},j=function(n,r){return function(i){return t.reduceRight(i,n,r)}};y.reduce=R,y.foldMap=E,y.reduceRight=j}if("function"==typeof t.reduceWithIndex){var A=function(n,r){return function(i){return t.reduceWithIndex(i,n,r)}},N=function(n){var r=t.foldMapWithIndex(n);return function(t){return function(n){return r(n,t)}}},P=function(n,r){return function(i){return t.reduceRightWithIndex(i,n,r)}};y.reduceWithIndex=A,y.foldMapWithIndex=N,y.reduceRightWithIndex=P}if("function"==typeof t.alt){var L=function(n){return function(r){return t.alt(r,n)}};y.alt=L}if("function"==typeof t.compact&&(y.compact=t.compact,y.separate=t.separate),"function"==typeof t.filter){var D=function(n){return function(r){return t.filter(r,n)}},F=function(n){return function(r){return t.filterMap(r,n)}},W=function(n){return function(r){return t.partition(r,n)}},U=function(n){return function(r){return t.partitionMap(r,n)}};y.filter=D,y.filterMap=F,y.partition=W,y.partitionMap=U}if("function"==typeof t.filterWithIndex){var z=function(n){return function(r){return t.filterWithIndex(r,n)}},B=function(n){return function(r){return t.filterMapWithIndex(r,n)}},V=function(n){return function(r){return t.partitionWithIndex(r,n)}},$=function(n){return function(r){return t.partitionMapWithIndex(r,n)}};y.filterWithIndex=z,y.filterMapWithIndex=B,y.partitionWithIndex=V,y.partitionMapWithIndex=$}if("function"==typeof t.promap){var q=function(n,r){return function(i){return t.promap(i,n,r)}};y.promap=q}if("function"==typeof t.compose){var K=function(n){return function(r){return t.compose(r,n)}};y.compose=K}if("function"==typeof t.throwError){var H=function(n){return function(r){return"None"===r._tag?t.throwError(n()):t.of(r.value)}},G=function(n){return"Left"===n._tag?t.throwError(n.left):t.of(n.right)},Z=function(n,r){return function(i){return n(i)?t.of(i):t.throwError(r(i))}},Y=function(n,r){return function(i){return t.chain(i,function(i){return n(i)?t.of(i):t.throwError(r(i))})}};y.fromOption=H,y.fromEither=G,y.fromPredicate=Z,y.filterOrElse=Y}return y},KQ.pipe=UZ.pipe;var KX=k&&k.__createBinding||(Object.create?function(t,n,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return n[r]}})}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]}),K0=k&&k.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),K1=k&&k.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&KX(n,t,r);return K0(n,t),n};Object.defineProperty(KJ,"__esModule",{value:!0}),KJ.NumberFromString=void 0;var K2=K1(V1);KJ.NumberFromString=new K2.Type("NumberFromString",K2.number.is,function(t,n){return KQ.pipe(K2.string.validate(t,n),UK.chain(function(r){var i=+r;return isNaN(i)||""===r.trim()?K2.failure(t,n):K2.success(i)}))},String);var K3=k&&k.__createBinding||(Object.create?function(t,n,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return n[r]}})}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]}),K4=k&&k.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),K5=k&&k.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&K3(n,t,r);return K4(n,t),n};Object.defineProperty(KY,"__esModule",{value:!0}),KY.IntFromString=void 0;var K6=K5(V1);KY.IntFromString=new K6.Type("IntFromString",K6.Int.is,function(t,n){return KQ.pipe(KJ.NumberFromString.validate(t,n),UK.chain(function(r){return K6.Int.is(r)?K6.success(r):K6.failure(t,n)}))},KJ.NumberFromString.encode),Object.defineProperty(KZ,"__esModule",{value:!0});let K9=nQ,K8=(0,K9.__importStar)(V1),K7=KF(),He=new K8.Type("SideConstraints",t=>!t||"number"==typeof t,(t,n)=>UK.either.chain(K8.union([K8.literal("auto"),K8.literal(""),K8.Int,KY.IntFromString,K7.IntFromNumber,K7.IntFromPixels,K8.null]).validate(t,n),t=>"auto"===t||""===t?K8.success(null):K8.success(t)),t=>t),Ht=K8.partial({width:He,height:He});KZ.default=Ht,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Image=t.ImageConfig=t.Thumbnail=t.ImageFieldType=void 0;let n=nQ,r=(0,n.__importStar)(V1),i=KF(),o=(0,n.__importDefault)(KZ);t.ImageFieldType="Image",t.Thumbnail=r.exact(r.intersection([r.type({name:r.string}),o.default])),t.ImageConfig=r.exact(r.partial({label:i.StringOrNull,placeholder:r.string,constraint:o.default,thumbnails:r.readonlyArray(t.Thumbnail)})),t.Image=r.exact(r.intersection([r.type({type:r.literal(t.ImageFieldType)}),r.partial({fieldset:i.StringOrNull,config:t.ImageConfig})]))}(KG);var Hn={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.IntegrationField=t.IntegrationFieldConfig=t.IntegrationFieldType=void 0;let n=(0,nQ.__importStar)(V1),r=KF();t.IntegrationFieldType="IntegrationFields",t.IntegrationFieldConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,catalog:n.string})),t.IntegrationField=n.exact(n.intersection([n.type({type:n.literal(t.IntegrationFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.IntegrationFieldConfig})]))}(Hn);var Hr={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Link=t.LinkConfig=t.LinkFieldType=void 0;let n=nQ,r=(0,n.__importStar)(V1),i=KF(),o=t=>{if(t instanceof Array&&t.reduce((t,n)=>t&&"string"==typeof n,!0))return r.success(t)},a=t=>{if("string"==typeof t)return r.success([t])},u=new r.Type("MasksArrayString",t=>t instanceof Array,(t,n)=>UK.either.chain(r.union([r.array(r.string),r.string]).validate(t,n),i=>o(i)||a(i)||r.failure(t,n)),t=>t);t.LinkFieldType="Link",t.LinkConfig=r.exact(r.partial({label:i.StringOrNull,useAsTitle:r.boolean,placeholder:r.string,select:(0,qY.withFallback)(r.union([r.literal("media"),r.literal("document"),r.literal("web"),r.null]),null),customtypes:r.readonlyArray(r.string),masks:u,tags:u,allowTargetBlank:r.boolean})),t.Link=r.exact(r.intersection([r.type({type:r.literal(t.LinkFieldType)}),r.partial({fieldset:i.StringOrNull,config:t.LinkConfig})]))}(Hr);var Hi={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Number=t.NumberConfig=t.NumberFieldType=void 0;let n=(0,nQ.__importStar)(V1),r=KF();t.NumberFieldType="Number",t.NumberConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,min:n.union([n.number,KJ.NumberFromString]),max:n.union([n.number,KJ.NumberFromString]),step:n.union([n.number,KJ.NumberFromString])})),t.Number=n.exact(n.intersection([n.type({type:n.literal(t.NumberFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.NumberConfig})]))}(Hi);var Ho={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Range=t.RangeConfig=t.RangeFieldType=void 0;let n=(0,nQ.__importStar)(V1),r=KF();t.RangeFieldType="Range",t.RangeConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,min:n.union([n.number,KJ.NumberFromString]),max:n.union([n.number,KJ.NumberFromString]),step:n.union([n.number,KJ.NumberFromString])})),t.Range=n.exact(n.intersection([n.type({type:n.literal(t.RangeFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.RangeConfig})]))}(Ho);var Ha={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RichText=t.RichTextConfig=t.RichTextNodeTypeCodec=t.RichTextNodeType=t.DEFAULT_OPTION=t.RichTextFieldType=void 0;let n=nQ,r=(0,n.__importStar)(V1),i=KF(),o=(0,n.__importDefault)(KZ);t.RichTextFieldType="StructuredText",t.DEFAULT_OPTION="paragraph",t.RichTextNodeType={heading1:"heading1",heading2:"heading2",heading3:"heading3",heading4:"heading4",heading5:"heading5",heading6:"heading6",paragraph:"paragraph",strong:"strong",em:"em",preformatted:"preformatted",hyperlink:"hyperlink",image:"image",embed:"embed",list:"list-item",orderedList:"o-list-item",rtl:"rtl"},t.RichTextNodeTypeCodec=r.keyof({[t.RichTextNodeType.heading1]:null,[t.RichTextNodeType.heading2]:null,[t.RichTextNodeType.heading3]:null,[t.RichTextNodeType.heading4]:null,[t.RichTextNodeType.heading5]:null,[t.RichTextNodeType.heading6]:null,[t.RichTextNodeType.paragraph]:null,[t.RichTextNodeType.strong]:null,[t.RichTextNodeType.em]:null,[t.RichTextNodeType.preformatted]:null,[t.RichTextNodeType.hyperlink]:null,[t.RichTextNodeType.image]:null,[t.RichTextNodeType.embed]:null,[t.RichTextNodeType.list]:null,[t.RichTextNodeType.orderedList]:null,[t.RichTextNodeType.rtl]:null});let a=new r.Type("RichTextOptions",t=>"string"==typeof t,n=>(0,UZ.pipe)(r.union([r.string,r.null]).decode(n),Uq.either.map(n=>{if(!n)return t.DEFAULT_OPTION;let r=n.split(",").map(t=>t.trim()).filter(n=>(0,UK.getOrElseW)(()=>{})(t.RichTextNodeTypeCodec.decode(n)));return r.length?r.join(","):t.DEFAULT_OPTION})),t=>t),u=t=>{if(!t)return r.success([])},s=t=>{if(t instanceof Object){if(!Object.entries(t).length)return r.success([]);if(t[""])return r.success(t[""].map(t=>t.name));let n=Object.entries(t).reduce((t,[,n])=>t.concat(n.map(t=>t.name)),[]).filter(Boolean);return r.success(n)}},l=t=>{if(t instanceof Array&&t.reduce((t,n)=>t&&"string"==typeof n,!0))return r.success(t)},c=t=>{if("string"==typeof t)return r.success([t])},d=new r.Type("RichTextLabels",t=>t instanceof Array,(t,n)=>{let i=r.record(r.string,r.readonlyArray(r.record(r.literal("name"),r.string))),o=r.readonlyArray(r.string);return(0,UZ.pipe)(r.union([i,o,r.string,r.null]).decode(t),Uq.either.chain(i=>u(i)||l(i)||s(i)||c(i)||r.failure(t,n)))},t=>t);t.RichTextConfig=r.exact(r.partial({label:i.StringOrNull,placeholder:r.string,useAsTitle:r.boolean,single:a,multi:a,imageConstraint:o.default,labels:d,allowTargetBlank:r.boolean})),t.RichText=r.exact(r.intersection([r.type({type:r.literal(t.RichTextFieldType)}),r.partial({fieldset:i.StringOrNull,config:t.RichTextConfig})]))}(Ha);var Hu={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Select=t.SelectConfig=t.SelectFieldType=void 0;let n=(0,nQ.__importStar)(V1),r=KF();t.SelectFieldType="Select",t.SelectConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,default_value:n.string,options:n.readonlyArray(n.union([n.string,r.StringFromNumber,r.StringFromBoolean]))})),t.Select=n.exact(n.intersection([n.type({type:n.literal(t.SelectFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.SelectConfig})]))}(Hu);var Hs={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Separator=t.SeparatorConfig=t.SeparatorFieldType=void 0;let n=(0,nQ.__importStar)(V1),r=KF();t.SeparatorFieldType="Separator",t.SeparatorConfig=n.exact(n.partial({label:r.StringOrNull})),t.Separator=n.exact(n.intersection([n.type({type:n.literal(t.SeparatorFieldType)}),n.partial({config:t.SeparatorConfig})]))}(Hs);var Hl={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Text=t.TextConfig=t.TextFieldType=void 0;let n=(0,nQ.__importStar)(V1),r=KF();t.TextFieldType="Text",t.TextConfig=n.exact(n.partial({label:r.StringOrNull,useAsTitle:n.boolean,placeholder:n.string})),t.Text=n.exact(n.intersection([n.type({type:n.literal(t.TextFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.TextConfig})]))}(Hl);var Hc={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Timestamp=t.TimestampConfig=t.TimestampFieldType=void 0;let n=(0,nQ.__importStar)(V1),r=KF();t.TimestampFieldType="Timestamp",t.TimestampConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,default:n.string})),t.Timestamp=n.exact(n.intersection([n.type({type:n.literal(t.TimestampFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.TimestampConfig})]))}(Hc),Object.defineProperty(KB,"__esModule",{value:!0}),KB.NestableWidget=void 0;let Hd=nQ,Hf=(0,Hd.__importStar)(V1);KB.NestableWidget=Hf.union([K$.Color,KV.BooleanField,KK.Embed,KH.GeoPoint,Kq.Date,Hi.Number,Ho.Range,Ha.RichText,Hu.Select,Hs.Separator,Hl.Text,Hc.Timestamp,Hr.Link,KG.Image,Hn.IntegrationField]),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Group=t.GroupConfig=t.GroupFieldType=void 0;let n=(0,nQ.__importStar)(V1),r=KF();t.GroupFieldType="Group",t.GroupConfig=n.exact(n.partial({label:r.StringOrNull,repeat:n.boolean,fields:n.record(V3.WidgetKey,KB.NestableWidget)})),t.Group=n.exact(n.intersection([n.type({type:n.literal(t.GroupFieldType)}),n.partial({fieldset:r.StringOrNull,icon:n.string,description:n.string,config:t.GroupConfig})]))}(Kz);var Hp={};!function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nQ;(0,n.__exportStar)(KV,t),(0,n.__exportStar)(K$,t),(0,n.__exportStar)(Kq,t),(0,n.__exportStar)(KK,t),(0,n.__exportStar)(KH,t),(0,n.__exportStar)(KG,t),(0,n.__exportStar)(Hn,t),(0,n.__exportStar)(Hr,t),(0,n.__exportStar)(KB,t),(0,n.__exportStar)(Hi,t),(0,n.__exportStar)(Ho,t),(0,n.__exportStar)(Ha,t),(0,n.__exportStar)(Hu,t),(0,n.__exportStar)(Hs,t),(0,n.__exportStar)(Hl,t),(0,n.__exportStar)(Hc,t)}(Hp);var Hh={},Hm={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.isCompositeSlice=t.CompositeSlice=t.CompositeSliceConfig=t.CompositeSliceType=void 0;let n=(0,nQ.__importStar)(V1),r=KF();t.CompositeSliceType="Slice",t.CompositeSliceConfig=n.exact(n.partial({label:r.StringOrNull})),t.CompositeSlice=n.exact(n.intersection([n.type({type:n.literal(t.CompositeSliceType)}),n.partial({fieldset:r.StringOrNull,description:n.string,icon:n.string,display:n.string,"non-repeat":n.record(V3.WidgetKey,KB.NestableWidget),repeat:n.record(V3.WidgetKey,KB.NestableWidget),config:t.CompositeSliceConfig})])),t.isCompositeSlice=function(t){return"Slice"===t.type}}(Hm);var Hg={};Object.defineProperty(Hg,"__esModule",{value:!0}),Hg.isLegacySlice=Hg.LegacySlice=void 0;let Hy=nQ,Hv=(0,Hy.__importStar)(V1);Hg.LegacySlice=Hv.union([KB.NestableWidget,Kz.Group]),Hg.isLegacySlice=function(t){return"Slice"!==t.type&&"SharedSlice"!==t.type};var Hb={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.isDynamicSharedSlice=t.isStaticSharedSlice=t.SharedSlice=t.SharedSliceType=t.Variation=void 0;let n=(0,nQ.__importStar)(V1);t.Variation=n.exact(n.intersection([n.type({id:n.string,name:n.string,description:n.string,imageUrl:(0,qY.withFallback)(n.string,"https://images.prismic.io/slice-machine/621a5ec4-0387-4bc5-9860-2dd46cbc07cd_default_ss.png?auto=compress,format"),docURL:n.string,version:n.string}),n.partial({display:n.string,primary:n.record(V3.WidgetKey,KB.NestableWidget),items:n.record(V3.WidgetKey,KB.NestableWidget)})])),t.SharedSliceType="SharedSlice";let r=n.string,i=n.string;t.SharedSlice=n.exact(n.intersection([n.type({id:n.string,type:n.literal(t.SharedSliceType),name:n.string,variations:n.readonlyArray(t.Variation)}),n.partial({description:n.string,legacyPaths:n.record(r,i)})])),t.isStaticSharedSlice=function(t){return"SharedSlice"===t.type},t.isDynamicSharedSlice=function(t){return"SharedSlice"===t.type}}(Hb);var Hx={};Object.defineProperty(Hx,"__esModule",{value:!0}),Hx.SharedSliceRef=void 0;let H_=nQ,HS=(0,H_.__importStar)(V1);Hx.SharedSliceRef=HS.exact(HS.type({type:HS.literal(Hb.SharedSliceType)})),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Slices=t.DynamicSlices=t.StaticSlices=t.slicesReader=t.DynamicSlicesConfig=t.StaticSlicesConfig=t.slicesConfigReader=t.SlicesLabels=t.SlicesFieldType=t.LegacySlicesFieldType=void 0;let n=(0,nQ.__importStar)(V1),r=KF();function i(i){return n.exact(n.partial({label:r.StringOrNull,labels:t.SlicesLabels,choices:n.record(V3.WidgetKey,n.union([Hg.LegacySlice,Hm.CompositeSlice,i]))}))}t.LegacySlicesFieldType="Choice",t.SlicesFieldType="Slices",t.SlicesLabels=n.union([n.record(n.string,n.readonlyArray(n.exact(n.intersection([n.type({name:n.string}),n.partial({display:n.string})])))),n.null]),t.slicesConfigReader=i,t.StaticSlicesConfig=i(Hb.SharedSlice),t.DynamicSlicesConfig=i(Hx.SharedSliceRef);let o={toStatic(t,n){let r=Object.entries(t.choices||{}).reduce((t,[r,i])=>{if("SharedSlice"!==i.type)return{...t,[r]:i};{let o=n.get(r);return o?{...t,[r]:o}:t}},{});return{...t,choices:r}}};function a(i){return n.exact(n.intersection([n.type({type:n.keyof({[t.SlicesFieldType]:null,[t.LegacySlicesFieldType]:null})}),n.partial({fieldset:r.StringOrNull,config:i})]))}t.slicesReader=a,t.StaticSlices=a(t.StaticSlicesConfig),t.DynamicSlices=a(t.DynamicSlicesConfig),t.Slices={toStatic:(t,n)=>t.config?{...t,config:o.toStatic(t.config,n)}:t}}(Hh);var HT={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.UID=t.UIDConfig=t.UIDFieldType=void 0;let n=(0,nQ.__importStar)(V1),r=KF();t.UIDFieldType="UID",t.UIDConfig=n.exact(n.partial({label:r.StringOrNull,useAsTitle:n.boolean,placeholder:n.string})),t.UID=n.exact(n.intersection([n.type({type:n.literal(t.UIDFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.UIDConfig})]))}(HT),Object.defineProperty(KU,"__esModule",{value:!0}),KU.Widgets=KU.FieldType=KU.DynamicWidget=KU.StaticWidget=KU.widgetReader=void 0;let Hw=nQ,HO=(0,Hw.__importStar)(V1);function Hk(t){return HO.union([HT.UID,KB.NestableWidget,Kz.Group,t])}KU.widgetReader=Hk,KU.StaticWidget=Hk(Hh.StaticSlices),KU.DynamicWidget=Hk(Hh.DynamicSlices),KU.FieldType=HO.keyof({[Hp.ColorFieldType]:null,[Hp.BooleanFieldType]:null,[Hp.NumberFieldType]:null,[Hp.EmbedFieldType]:null,[Hp.GeoPointFieldType]:null,[Hp.DateFieldType]:null,[Hp.RangeFieldType]:null,[Hp.RichTextFieldType]:null,[Hp.SelectFieldType]:null,[Hp.SeparatorFieldType]:null,[Hp.TextFieldType]:null,[Hp.TimestampFieldType]:null,[Hp.LinkFieldType]:null,[Hp.ImageFieldType]:null,[Hp.IntegrationFieldType]:null,[HT.UIDFieldType]:null,[Kz.GroupFieldType]:null,[Hh.SlicesFieldType]:null,[Hh.LegacySlicesFieldType]:null}),KU.Widgets={toStatic(t,n){switch(t.type){case"Choice":case"Slices":return Hh.Slices.toStatic(t,n);default:return t}}},Object.defineProperty(KW,"__esModule",{value:!0}),KW.Sections=KW.DynamicSection=KW.StaticSection=KW.sectionReader=void 0;let HC=nQ,HI=(0,HC.__importStar)(V1);function HM(t){return HI.record(V3.WidgetKey,t)}KW.sectionReader=HM,KW.StaticSection=HM(KU.StaticWidget),KW.DynamicSection=HM(KU.DynamicWidget),KW.Sections={toStatic:(t,n)=>Object.entries(t).reduce((t,[r,i])=>({...t,[r]:KU.Widgets.toStatic(i,n)}),{})},function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.collectSharedSlices=t.flattenCustomTypeFields=t.filterMissingSharedSlices=t.collectWidgets=t.validateSlices=t.toStatic=t.flattenSections=t.flattenWidgets=t.CustomType=t.StaticCustomType=t.CustomTypeFormat=void 0;let n=nQ,r=(0,n.__importStar)(V1),i=KF();t.CustomTypeFormat={page:"page",custom:"custom"};class o extends Error{constructor(t){super(),Object.defineProperty(this,"slices",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"message",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.slices=t,this.message=this._formatError(t)}_formatError(t){return`The following slices doesn't exists in your Prismic repository:
|
|
3
|
-
${t.map(t=>` - ${t}`).join(`
|
|
4
|
-
`)}
|
|
5
|
-
`}}function a(n){return r.exact(r.intersection([r.type({id:r.string,label:i.StringOrNull,repeatable:(0,qY.withFallback)(r.boolean,!0),json:r.record(r.string,n),status:(0,qY.withFallback)(r.boolean,!0)}),r.partial({hash:r.string,format:(0,qY.withFallback)(r.keyof(t.CustomTypeFormat),"custom")})]))}function u(t){return Object.entries(t.json).reduce((t,[,n])=>{let r=Object.entries(n);return t.concat(r)},[])}function s(t,n){let r=Object.entries(t.json).reduce((t,[r,i])=>{let o=Object.entries(i).reduce((t,[r,i])=>{let o=n(r,i);return o?{...t,[r]:o}:t},{});return{...t,[r]:o}},{});return{...t,json:r}}t.StaticCustomType=a(KW.StaticSection),t.CustomType=a(KW.DynamicSection),t.flattenWidgets=u,t.flattenSections=function(t){return Object.entries(t.json).reduce((t,[,n])=>{let r=Object.entries(n);return t.concat(r)},[])},t.toStatic=function(t,n){let r=Object.entries(t.json).reduce((t,[r,i])=>({...t,[r]:KW.Sections.toStatic(i,n)}),{});return{...t,json:r}},t.validateSlices=function(t,n){let r=(function(t){var n;let r=u(t).filter(([,t])=>"Slices"===t.type).reduce((t,[,n])=>{let r=Object.entries(n.config&&n.config.choices?n.config.choices:{}).filter(([,t])=>"SharedSlice"===t.type).map(([t])=>t);return t.concat(r)},[]);return function(t){return r.map(t)}})(t)(t=>{if(!n.get(t))return t}).filter(Boolean);return r.length>0?(0,UK.left)(new o(r)):(0,UK.right)(t)},t.collectWidgets=s,t.filterMissingSharedSlices=function(t,n){return s(t,(t,r)=>{if("Slices"===r.type){if(!r.config||!r.config.choices)return r;let i=Object.entries(r.config.choices).reduce((t,[r,i])=>"SharedSlice"!==i.type||n.get(r)?{...t,[r]:i}:t,{}),o={...r.config,choices:i};return{...r,config:o}}return r})},t.flattenCustomTypeFields=function(t){return Object.values(t.json).reduce((t,n)=>({...t,...n}),{})},t.collectSharedSlices=function(t){return Object.entries(t.fields).reduce((t,[,n])=>{var r;return"Slices"===n.type||"Choice"===n.type?{...t,...Object.entries((null===(r=n.config)||void 0===r?void 0:r.choices)||{}).reduce((t,[n,r])=>"SharedSlice"===r.type?{...t,[n]:r}:t,{})}:t},{})}}(qZ);var HR,HE,Hj={},HA={};Object.defineProperty(HR=HA,"__esModule",{value:!0}),HR.DiffOperation=void 0,(HE=HR.DiffOperation||(HR.DiffOperation={})).Added="added",HE.Removed="removed",HE.Updated="updated";var HN={},HP={},HL={};Object.defineProperty(HL,"__esModule",{value:!0}),HL.HexaColor=void 0;let HD=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;HL.HexaColor={is:t=>HD.test(t)};var HF={};Object.defineProperty(HF,"__esModule",{value:!0}),HF.toRecord=void 0,HF.toRecord=function(t,n){return t.reduce((t,r)=>{let i=n(r);return{...t,[i]:r}},{})};var HW={};Object.defineProperty(HW,"__esModule",{value:!0}),HW.mapValues=HW.isObject=HW.withOptionals=HW.isNotEmpty=HW.zipObjects=void 0;let HU=nQ,Hz=(0,HU.__importStar)(V1);HW.zipObjects=function(t,n){return[...new Set(Object.keys(t||{}).concat(Object.keys(n||{})))].reduce((r,i)=>{let o=null==t?void 0:t[i],a=null==n?void 0:n[i];return{...r,[i]:{left:o,right:a}}},{})},HW.isNotEmpty=function(t){return Boolean(Object.keys(t).length)},HW.withOptionals=function(t,n){return{...t,...n.reduce((t,[n,r])=>r?{...t,[n]:r}:t,{})}};let HB=Hz.record(Hz.string,Hz.unknown);HW.isObject=function(t){return(0,UK.isRight)(HB.decode(t))},HW.mapValues=function(t,n){return Object.entries(t).reduce((t,[r,i])=>({...t,[r]:n(i,r)}),{})},Object.defineProperty(HP,"__esModule",{value:!0}),HP.Objects=HP.Arrays=HP.HexaColorCode=void 0;let HV=nQ;HP.HexaColorCode=(0,HV.__importStar)(HL),HP.Arrays=(0,HV.__importStar)(HF),HP.Objects=(0,HV.__importStar)(HW);var H$={};function Hq(t,n){let r=HP.Objects.zipObjects(t,n),i=Object.entries(r).reduce((t,[n,r])=>{if(JSON.stringify(null==r?void 0:r.left)===JSON.stringify(null==r?void 0:r.right))return t;let i=(()=>{if(!(!(null!=r&&r.left)&&!(null!=r&&r.right)))return null!=r&&r.left&&!r.right?{op:HA.DiffOperation.Removed}:!(null!=r&&r.left)&&null!=r&&r.right?{op:HA.DiffOperation.Added,value:r.right}:{op:HA.DiffOperation.Updated,value:r.right}})();return i?{...t,[n]:i}:t},{});return HP.Objects.isNotEmpty(i)?i:void 0}Object.defineProperty(H$,"__esModule",{value:!0}),H$.VariationComparator=void 0,H$.VariationComparator={compare(t,n){if(t&&!n)return{op:HA.DiffOperation.Removed};if(!t&&n)return{op:HA.DiffOperation.Added,value:n};let r=function(t,n){let r=HP.Objects.zipObjects(t,n);return Object.entries(r).reduce((t,[n,r])=>"primary"===n||"items"===n||(null==r?void 0:r.left)===(null==r?void 0:r.right)?t:{...t,[n]:null==r?void 0:r.right},{})}(t,n),i=Hq(null==t?void 0:t.primary,null==n?void 0:n.primary),o=Hq(null==t?void 0:t.items,null==n?void 0:n.items),a={...r,...i?{primary:i}:{},...o?{items:o}:{}};if(HP.Objects.isNotEmpty(a))return{op:HA.DiffOperation.Updated,value:a}}},Object.defineProperty(HN,"__esModule",{value:!0}),HN.SliceComparator=void 0,HN.SliceComparator={compare(t,n){if(!t&&n)return{op:HA.DiffOperation.Added,value:n};if(t&&!n)return{op:HA.DiffOperation.Removed};let r=function(t,n){let r=HP.Objects.zipObjects(t,n);return Object.entries(r).reduce((t,[n,r])=>"variations"===n||(null==r?void 0:r.left)===(null==r?void 0:r.right)?t:{...t,[n]:null==r?void 0:r.right},{})}(t,n),i=HP.Objects.zipObjects(t&&HP.Arrays.toRecord(t.variations,t=>t.id),n&&HP.Arrays.toRecord(n.variations,t=>t.id)),o=Object.entries(i).reduce((t,[n,r])=>{if(!r)return t;let i=H$.VariationComparator.compare(r.left,r.right);return i?{...t,[n]:i}:t},{}),a={...r,...HP.Objects.isNotEmpty(o)?{variations:o}:{}};if(HP.Objects.isNotEmpty(a))return{op:HA.DiffOperation.Updated,value:a}}},function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nQ;(0,n.__exportStar)(HA,t),(0,n.__exportStar)(HN,t),(0,n.__exportStar)(H$,t)}(Hj);var HK,HH,HG={},HZ={};HK=HZ,HH=k&&k.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},Object.defineProperty(HK,"__esModule",{value:!0}),HK.ImageConstraint=void 0,Object.defineProperty(HK,"ImageConstraint",{enumerable:!0,get:function(){return HH(KZ).default}});var HY={},HJ={};Object.defineProperty(HJ,"__esModule",{value:!0});var HQ={};Object.defineProperty(HQ,"__esModule",{value:!0}),HQ.SlicesTypes=void 0;let HX=nQ,H0=(0,HX.__importStar)(V1);HQ.SlicesTypes=H0.keyof({[Hm.CompositeSliceType]:null,[Hb.SharedSliceType]:null}),function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nQ;(0,n.__exportStar)(Hm,t),(0,n.__exportStar)(Hg,t),(0,n.__exportStar)(Hb,t),(0,n.__exportStar)(Hx,t),(0,n.__exportStar)(HJ,t),(0,n.__exportStar)(Hh,t),(0,n.__exportStar)(HQ,t)}(HY),function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nQ;(0,n.__exportStar)(Kz,t),(0,n.__exportStar)(Hp,t),(0,n.__exportStar)(HZ,t),(0,n.__exportStar)(HY,t),(0,n.__exportStar)(HT,t),(0,n.__exportStar)(KU,t)}(HG),function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nQ;(0,n.__exportStar)(qZ,t),(0,n.__exportStar)(Hj,t),(0,n.__exportStar)(KW,t),(0,n.__exportStar)(HG,t)}(qG);var H1,H2,H3,H4,H5,H6,H9,H8,H7,Ge={},Gt={},Gn={};function Gr(){if(H7)return Gn;H7=1,Object.defineProperty(Gn,"__esModule",{value:!0}),Gn.hasContentType=Gn.hasFieldContentType=void 0;let t=ZU();function n(t){return"object"==typeof t&&null!==t&&"__TYPE__"in t}return Gn.hasFieldContentType=function(r){return n(r)&&r.__TYPE__===t.FieldContentType&&(null==r?void 0:r.type)!==void 0&&"string"==typeof r.type&&(0,UK.isRight)(t.FieldType.decode(r.type))},Gn.hasContentType=n,Gn}function Gi(){return Gc||(Gc=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.EmptyContent=t.EmptyLegacy=t.isEmptyContent=t.EmptyContentType=void 0;let n=nQ,r=(0,n.__importStar)(V1),i=Gr();t.EmptyContentType="EmptyContent";let o=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.EmptyContentType;t.isEmptyContent=o;let a=r.union([r.null,r.type({value:r.null})]),u=n=>new r.Type("EmptyLegacy",t.isEmptyContent,r=>(0,UZ.pipe)(a.decode(r),Uq.either.map(()=>({type:n,__TYPE__:t.EmptyContentType}))),()=>null);t.EmptyLegacy=u,t.EmptyContent=r.strict({type:r.string,__TYPE__:r.literal(t.EmptyContentType)})}(Gt)),Gt}var Go={},Ga={};Object.defineProperty(Ga,"__esModule",{value:!0}),Ga.defaultCtx=Ga.getFieldCtx=Ga.LegacyContentCtx=Ga.FieldOrSliceType=void 0;let Gu=nQ,Gs=(0,Gu.__importStar)(V1);Ga.FieldOrSliceType=Gs.union([HG.FieldType,HG.SlicesTypes]);class Gl{constructor(t,n,r){Object.defineProperty(this,"fieldKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"prefixedKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"keyOfType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fieldPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fieldType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"allTypes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.fieldKey=t,this.fieldPath=n||[],this.allTypes=r||new Map;let i=Array.of(this.fieldPath,[this.fieldKey]).flat().join(".");this.prefixedKey=i,this.keyOfType=`${i}_TYPE`,this.fieldType=this.allTypes.get(this.prefixedKey)}}Ga.LegacyContentCtx=Gl,Ga.getFieldCtx=function(t,n,r){return new Gl(t,[...n.fieldPath,n.fieldKey,...r||[]],n.allTypes)},Ga.defaultCtx=function(t,n=new Map){return new Gl(t,[],n)};var Gc,Gd,Gf={},Gp={};function Gh(){return Gd||(Gd=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanContentDefaultValue=t.BooleanContent=t.BooleanLegacy=t.isBooleanContent=t.BooleanContentType=void 0;let n=nQ,r=(0,n.__importStar)(V1),i=Gr();t.BooleanContentType="BooleanContent";let o=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.BooleanContentType;t.isBooleanContent=o;let a=n=>new r.Type("BooleanLegacy",t.isBooleanContent,n=>(0,UZ.pipe)(r.boolean.decode(n),Uq.either.map(n=>t.BooleanContent.encode({value:n,__TYPE__:t.BooleanContentType}))),t=>({content:t.value,types:{[n.keyOfType]:"Boolean"}}));t.BooleanLegacy=a,t.BooleanContent=r.strict({__TYPE__:r.literal(t.BooleanContentType),value:r.boolean});let u=n=>{var r;return(null===(r=n.config)||void 0===r?void 0:r.default_value)!==void 0?{__TYPE__:t.BooleanContentType,value:n.config.default_value||!1}:void 0};t.BooleanContentDefaultValue=u}(Gp)),Gp}var Gm,Gg={};function Gy(){return Gm||(Gm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.EmbedContent=t.EmbedLegacy=t.EmbedContentLegacy=t.isEmbedContent=t.EmbedContentType=void 0;let n=nQ,r=(0,n.__importStar)(V1),i=KF(),o=Gr();t.EmbedContentType="EmbedContent";let a=n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.EmbedContentType;t.isEmbedContent=a,t.EmbedContentLegacy=r.exact(r.intersection([r.type({embed_url:r.string,type:r.string}),r.partial({version:r.union([r.string,r.number,r.null]),title:i.StringOrNull,author_name:i.StringOrNull,author_url:i.StringOrNull,provider_name:i.StringOrNull,provider_url:i.StringOrNull,cache_age:r.union([r.string,r.number,r.null]),thumbnail_url:i.StringOrNull,thumbnail_width:i.NumberOrNull,thumbnail_height:i.NumberOrNull,html:i.StringOrNull})]));let u=n=>new r.Type("EmbedLegacy",t.isEmbedContent,n=>(0,UZ.pipe)(t.EmbedContentLegacy.decode(n),Uq.either.map(r=>({...r,all:n,__TYPE__:t.EmbedContentType}))),t=>({content:t.all,types:{[n.keyOfType]:"Embed"}}));t.EmbedLegacy=u,t.EmbedContent=r.intersection([t.EmbedContentLegacy,r.strict({__TYPE__:r.literal(t.EmbedContentType),all:r.unknown})])}(Gg)),Gg}var Gv={},Gb={},Gx={};Object.defineProperty(Gx,"__esModule",{value:!0});let G_=nQ,GS=(0,G_.__importStar)(V1);Gx.default=new GS.Type("TrimmedString",GS.string.is,(t,n)=>(0,$e.pipe)(GS.string.validate(t,n),(0,Kn.chain)(t=>GS.success(function(t){let n=0;for(;n<t.length&&t[n]<=" ";)n++;let r=t.length;for(;n<r&&t[r-1]<=" ";)r--;return t.substring(n,r)}(t)))),t=>t);var GT={};function Gw(){return GO||(GO=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ColorContent=t.ColorLegacy=t.isColorContent=void 0;let n=nQ,r=(0,n.__importStar)(V1),i=(0,n.__importDefault)(Gx),o=Gr(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===GT.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Color"===t.type;t.isColorContent=a;let u=n=>new r.Type("ColorLegacy",t.isColorContent,n=>(0,UZ.pipe)(i.default.decode(n),Uq.either.map(n=>t.ColorContent.encode({value:n,type:HG.ColorFieldType,__TYPE__:GT.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:HG.ColorFieldType}}));t.ColorLegacy=u,t.ColorContent=r.strict({type:r.literal(HG.ColorFieldType),value:i.default,__TYPE__:r.literal(GT.FieldContentType)})}(Gb)),Gb}Object.defineProperty(GT,"__esModule",{value:!0}),GT.FieldContentType=void 0,GT.FieldContentType="FieldContent";var GO,Gk,GC={};function GI(){return Gk||(Gk=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DateContent=t.DateLegacy=t.isDateContent=void 0;let n=nQ,r=(0,n.__importStar)(V1),i=(0,n.__importDefault)(Gx),o=Gr(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===GT.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Date"===t.type;t.isDateContent=a;let u=n=>new r.Type("DateLegacy",t.isDateContent,n=>(0,UZ.pipe)(i.default.decode(n),Uq.either.map(n=>t.DateContent.encode({value:n,type:HG.DateFieldType,__TYPE__:GT.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:HG.DateFieldType}}));t.DateLegacy=u,t.DateContent=r.strict({type:r.literal(HG.DateFieldType),value:i.default,__TYPE__:r.literal(GT.FieldContentType)})}(GC)),GC}var GM,GR={};function GE(){return GM||(GM=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.NumberContent=t.NumberLegacy=t.isNumberContent=void 0;let n=nQ,r=(0,n.__importStar)(V1),i=(0,n.__importDefault)(Gx),o=Gr(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===GT.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Number"===t.type;t.isNumberContent=a;let u=n=>new r.Type("NumberLegacy",t.isNumberContent,n=>(0,UZ.pipe)(i.default.decode(n),Uq.either.map(n=>t.NumberContent.encode({value:n,type:HG.NumberFieldType,__TYPE__:GT.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:HG.NumberFieldType}}));t.NumberLegacy=u,t.NumberContent=r.strict({type:r.literal(HG.NumberFieldType),value:i.default,__TYPE__:r.literal(GT.FieldContentType)})}(GR)),GR}var Gj,GA={};function GN(){return Gj||(Gj=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RangeContent=t.RangeLegacy=t.isRangeContent=void 0;let n=nQ,r=(0,n.__importStar)(V1),i=(0,n.__importDefault)(Gx),o=Gr(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===GT.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Range"===t.type;t.isRangeContent=a;let u=n=>new r.Type("RangeLegacy",t.isRangeContent,n=>(0,UZ.pipe)(i.default.decode(n),Uq.either.map(n=>t.RangeContent.encode({value:n,type:HG.RangeFieldType,__TYPE__:GT.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:HG.RangeFieldType}}));t.RangeLegacy=u,t.RangeContent=r.strict({type:r.literal(HG.RangeFieldType),value:i.default,__TYPE__:r.literal(GT.FieldContentType)})}(GA)),GA}var GP,GL={};function GD(){return GP||(GP=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SelectContentDefaultValue=t.SelectContent=t.SelectLegacy=t.isSelectContent=void 0;let n=nQ,r=(0,n.__importStar)(V1),i=(0,n.__importDefault)(Gx),o=Gr(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===GT.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Select"===t.type;t.isSelectContent=a;let u=n=>new r.Type("SelectLegacy",t.isSelectContent,n=>(0,UZ.pipe)(i.default.decode(n),Uq.either.map(n=>t.SelectContent.encode({value:n,type:HG.SelectFieldType,__TYPE__:GT.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:HG.SelectFieldType}}));t.SelectLegacy=u,t.SelectContent=r.strict({type:r.literal(HG.SelectFieldType),value:i.default,__TYPE__:r.literal(GT.FieldContentType)});let s=t=>{var n;return!(null===(n=t.config)||void 0===n)&&n.default_value?{__TYPE__:GT.FieldContentType,type:HG.SelectFieldType,value:t.config.default_value||""}:void 0};t.SelectContentDefaultValue=s}(GL)),GL}var GF,GW={};function GU(){return GF||(GF=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TextContent=t.TextLegacy=t.isTextContent=void 0;let n=nQ,r=(0,n.__importStar)(V1),i=(0,n.__importDefault)(Gx),o=Gr(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===GT.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Text"===t.type;t.isTextContent=a;let u=n=>new r.Type("TextLegacy",t.isTextContent,n=>(0,UZ.pipe)(i.default.decode(n),Uq.either.map(n=>t.TextContent.encode({value:n,type:HG.TextFieldType,__TYPE__:GT.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:HG.TextFieldType}}));t.TextLegacy=u,t.TextContent=r.strict({type:r.literal(HG.TextFieldType),value:i.default,__TYPE__:r.literal(GT.FieldContentType)})}(GW)),GW}var Gz,GB={};function GV(){return Gz||(Gz=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TimestampContent=t.TimestampLegacy=t.isTimestampContent=void 0;let n=nQ,r=(0,n.__importStar)(V1),i=(0,n.__importDefault)(Gx),o=Gr(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===GT.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Timestamp"===t.type;t.isTimestampContent=a;let u=n=>new r.Type("TimestampLegacy",t.isTimestampContent,n=>(0,UZ.pipe)(i.default.decode(n),Uq.either.map(n=>t.TimestampContent.encode({value:n,type:HG.TimestampFieldType,__TYPE__:GT.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:HG.TimestampFieldType}}));t.TimestampLegacy=u,t.TimestampContent=r.strict({type:r.literal(HG.TimestampFieldType),value:i.default,__TYPE__:r.literal(GT.FieldContentType)})}(GB)),GB}function G$(){return Gq||(Gq=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.FieldContent=t.FieldType=void 0;let n=nQ,r=(0,n.__importStar)(V1),i=Gw(),o=GI(),a=GE(),u=GN(),s=GD(),l=GU(),c=GV();t.FieldType=r.keyof({Text:null,Date:null,Timestamp:null,Color:null,Number:null,Range:null,Select:null}),t.FieldContent=r.union([o.DateContent,i.ColorContent,a.NumberContent,u.RangeContent,s.SelectContent,l.TextContent,c.TimestampContent]),(0,n.__exportStar)(Gw(),t),(0,n.__exportStar)(GT,t),(0,n.__exportStar)(GI(),t),(0,n.__exportStar)(GE(),t),(0,n.__exportStar)(GN(),t),(0,n.__exportStar)(GD(),t),(0,n.__exportStar)(GU(),t),(0,n.__exportStar)(GV(),t)}(Gv)),Gv}var Gq,GK,GH={};function GG(){return GK||(GK=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.GeoPointContent=t.GeoPointLegacy=t.isGeoPointContent=t.GeoPointContentType=void 0;let n=nQ,r=(0,n.__importStar)(V1),i=Gr();t.GeoPointContentType="GeoPointContent";let o=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.GeoPointContentType;t.isGeoPointContent=o;let a=r.strict({position:r.strict({lat:r.number,lng:r.number})}),u=n=>new r.Type("GeoPointLegacy",t.isGeoPointContent,n=>(0,$e.pipe)(a.decode(n),Uq.either.map(n=>t.GeoPointContent.encode({...n,__TYPE__:t.GeoPointContentType}))),t=>({content:{position:t.position},types:{[n.keyOfType]:"GeoPoint"}}));t.GeoPointLegacy=u,t.GeoPointContent=r.intersection([a,r.strict({__TYPE__:r.literal(t.GeoPointContentType)})])}(GH)),GH}var GZ,GY={};function GJ(){return GZ||(GZ=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ImageContent=t.ImageLegacy=t.ImageContentView=t.isImageContent=t.ImageContentType=void 0;let n=nQ,r=(0,n.__importStar)(V1),i=KF(),o=Gr();t.ImageContentType="ImageContent";let a=n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.ImageContentType;t.isImageContent=a;let u=r.exact(r.type({id:r.string,url:r.string,width:r.number,height:r.number}));t.ImageContentView=r.exact(r.intersection([r.type({origin:u,width:r.number,height:r.number,edit:r.type({zoom:r.number,crop:r.type({x:r.number,y:r.number}),background:r.string})}),r.partial({url:r.string,credits:i.NonEmptyStringOrNull,alt:i.NonEmptyStringOrNull,provider:i.StringOrNull})]));let s=r.intersection([t.ImageContentView,r.partial({thumbnails:r.record(r.string,t.ImageContentView)})]),l=n=>new r.Type("ImageLegacy",t.isImageContent,n=>(0,UZ.pipe)(s.decode(n),Uq.either.map(n=>t.ImageContent.encode({...n,__TYPE__:t.ImageContentType}))),t=>({content:(0,HW.withOptionals)({edit:t.edit,height:t.height,origin:t.origin,width:t.width},[["alt",t.alt],["credits",t.credits],["provider",t.provider],["thumbnails",t.thumbnails],["url",t.url]]),types:{[n.keyOfType]:"Image"}}));t.ImageLegacy=l,t.ImageContent=r.intersection([s,r.strict({__TYPE__:r.literal(t.ImageContentType)})])}(GY)),GY}var GQ,GX={};function G0(){return GQ||(GQ=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.IntegrationFieldContent=t.IntegrationFieldLegacy=t.isIntegrationFieldContent=t.IntegrationFieldContentType=void 0;let n=nQ,r=(0,n.__importStar)(V1),i=Gr();t.IntegrationFieldContentType="IntegrationFieldsContent";let o=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.IntegrationFieldContentType;t.isIntegrationFieldContent=o;let a=n=>new r.Type("IntegrationFieldLegacy",t.isIntegrationFieldContent,n=>(0,UZ.pipe)(r.string.decode(n),Uq.either.map(n=>t.IntegrationFieldContent.encode({value:n,__TYPE__:t.IntegrationFieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:"IntegrationFields"}}));t.IntegrationFieldLegacy=a,t.IntegrationFieldContent=r.strict({__TYPE__:r.literal(t.IntegrationFieldContentType),value:r.string})}(GX)),GX}var G1,G2={};function G3(){return G1||(G1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.LinkContent=t.Link=t.LinkContentLegacy=t.LinkLegacy=t.isLinkContent=t.LinkContentType=t.ExternalLinkContent=t.ExternalLinkType=t.DocumentLinkContent=t.DocumentLinkType=t.FileLinkContent=t.FileLinkType=t.ImageLinkContent=t.ImageLinkType=void 0;let n=nQ,r=(0,n.__importStar)(V1),i=KF(),o=Gr();t.ImageLinkType="ImageLink";let a=r.exact(r.intersection([r.type({id:r.string,url:r.string,height:r.string,width:r.string,size:r.string,name:r.string,kind:r.string}),r.partial({date:i.StringOrNull})])),u=new r.Type("ImageLink",n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.ImageLinkType,n=>(0,UZ.pipe)(a.decode(n),Uq.either.map(n=>t.ImageLinkContent.encode({...n,__TYPE__:t.ImageLinkType}))),t=>a.encode(t));t.ImageLinkContent=r.intersection([r.strict({__TYPE__:r.literal(t.ImageLinkType)}),a]),t.FileLinkType="FileLink";let s=r.exact(r.intersection([r.type({id:r.string,url:r.string,name:r.string,kind:r.string,size:(0,qz.withFallback)(r.string,"0")}),r.partial({date:(0,V7.nullable)(r.string)})])),l=new r.Type("FileLink",n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.FileLinkType,n=>(0,UZ.pipe)(s.decode(n),Uq.either.map(n=>t.FileLinkContent.encode({...n,__TYPE__:t.FileLinkType}))),t=>s.encode(t));t.FileLinkContent=r.intersection([s,r.exact(r.intersection([r.type({__TYPE__:r.literal(t.FileLinkType)}),r.partial({size:(0,qz.withFallback)(r.string,"0")})]))]),t.DocumentLinkType="DocumentLink";let c=r.strict({id:i.NonEmptyString}),d=new r.Type("DocumentLink",n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.DocumentLinkType,n=>(0,UZ.pipe)(c.decode(n),Uq.either.map(n=>t.DocumentLinkContent.encode({...n,__TYPE__:t.DocumentLinkType}))),t=>c.encode(t));t.DocumentLinkContent=r.intersection([r.strict({__TYPE__:r.literal(t.DocumentLinkType)}),c]),t.ExternalLinkType="ExternalLink";let f=r.exact(r.intersection([r.type({url:r.string}),r.partial({kind:r.literal("web"),target:i.StringOrNull,preview:(0,V7.nullable)(r.partial({title:r.string}))})])),p=new r.Type("ExternalLink",n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.ExternalLinkType,n=>(0,UZ.pipe)(f.decode(n),Uq.either.map(n=>t.ExternalLinkContent.encode({...n,__TYPE__:t.ExternalLinkType}))),t=>f.encode(t));t.ExternalLinkContent=r.intersection([r.strict({__TYPE__:r.literal(t.ExternalLinkType)}),f]),t.LinkContentType="LinkContent";let h=n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.LinkContentType;t.isLinkContent=h,t.LinkLegacy=r.union([u,l,d,p]);let m=n=>new r.Type("LinkLegacy",t.isLinkContent,n=>(0,UZ.pipe)(t.LinkLegacy.decode(n),Uq.either.map(n=>t.LinkContent.encode({value:n,__TYPE__:t.LinkContentType}))),r=>({content:t.LinkLegacy.encode(r.value),types:{[n.keyOfType]:"Link"}}));t.LinkContentLegacy=m,t.Link=r.union([t.ImageLinkContent,t.FileLinkContent,t.DocumentLinkContent,t.ExternalLinkContent]),t.LinkContent=r.strict({__TYPE__:r.literal(t.LinkContentType),value:t.Link})}(G2)),G2}var G4,G5={},G6={},G9={};function G8(){return G4||(G4=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Block=t.BlockLegacy=t.TextBlock=t.checkEmbedBlock=t.EmbedBlock=t.checkImageBlock=t.ImageBlock=t.ValidatedSpans=t.SpanLegacy=t.Span=void 0;let n=nQ,r=(0,n.__importStar)(V1),i=KF(),o=Gy(),a=GJ(),u=G3(),s=t=>r.strict({data:t,start:r.number,end:r.number,type:r.literal(Hp.RichTextNodeType.hyperlink)}),l=r.strict({data:(0,qz.withFallback)(r.string,""),start:r.number,end:r.number,type:r.literal("label")}),c=r.strict({start:r.number,end:r.number,type:r.keyof({[Hp.RichTextNodeType.strong]:null,[Hp.RichTextNodeType.em]:null,"list-item":null})});t.Span=r.union([s(u.Link),l,c]),t.SpanLegacy=r.union([s(u.LinkLegacy),l,c]);let d=t=>new r.Type("ValidatedSpans",n=>Array.isArray(n)&&n.every(t.is),(n,i)=>{if(!Array.isArray(n))return r.failure(n,i);{let o=n.reduce((n,r)=>{let i=t.decode(r);return(0,UK.isLeft)(i)?n:[...n,i.right]},[]).sort((t,n)=>t.start-n.start);return r.success(o)}},n=>n.reduce((n,r)=>{let i=t.encode(r);return[...n,i]},[]));t.ValidatedSpans=d;let f=t=>r.exact(r.intersection([r.type({type:r.literal(Hp.RichTextNodeType.image),data:r.intersection([a.ImageContentView,r.partial({linkTo:(0,V7.nullable)(t)})])}),r.partial({label:i.StringOrNull,direction:i.StringOrNull})]));t.ImageBlock=f(u.Link);let p=f(u.LinkLegacy);t.checkImageBlock=function(t){return t.type===Hp.RichTextNodeType.image};let h=r.exact(r.intersection([r.type({type:r.literal(Hp.RichTextNodeType.embed),data:r.unknown}),r.partial({label:i.StringOrNull,direction:i.StringOrNull})])),m=new r.Type("EmbedBlockLegacy",t=>"embed"===t.type,n=>(0,UZ.pipe)(h.decode(n),Uq.either.chain(t=>Uq.either.map(n=>[t,n])(o.EmbedContentLegacy.decode(t.data))),Uq.either.map(([n,r])=>t.EmbedBlock.encode({...n,data:{...r,__TYPE__:o.EmbedContentType,all:n.data}}))),t=>({...h.encode(t),data:o.EmbedContentLegacy.encode(t.data)}));t.EmbedBlock=r.exact(r.intersection([r.type({type:r.literal(Hp.RichTextNodeType.embed),data:o.EmbedContent}),r.partial({label:i.StringOrNull,direction:i.StringOrNull})])),t.checkEmbedBlock=function(t){return t.type===Hp.RichTextNodeType.embed};let g=n=>r.exact(r.intersection([r.type({type:(0,V7.refineType)(Hp.RichTextNodeTypeCodec,`string which isn't ${Hp.RichTextNodeType.image} ${Hp.RichTextNodeType.embed}`,t=>t!==Hp.RichTextNodeType.image&&t!==Hp.RichTextNodeType.embed),content:r.intersection([r.type({text:r.string}),r.partial({spans:(0,t.ValidatedSpans)(n)})])}),r.partial({label:r.string,direction:r.string})]));t.TextBlock=g(t.Span);let y=g(t.SpanLegacy),v=r.union([m,p,y]);t.BlockLegacy=new r.Type("BlockLegacy",t=>m.is(t)||p.is(t)||y.is(t),t=>v.decode(t),n=>t.ImageBlock.is(n)?p.encode(n):t.EmbedBlock.is(n)?m.encode(n):y.encode(n)),t.Block=r.union([t.ImageBlock,t.EmbedBlock,t.TextBlock])}(G9)),G9}function G7(){return Ze||(Ze=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RichTextLegacy=t.RichTextContent=t.isRichTextContent=t.RichTextContentType=void 0;let n=nQ,r=(0,n.__importStar)(V1),i=Gr(),o=G8();t.RichTextContentType="StructuredTextContent";let a=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.RichTextContentType;t.isRichTextContent=a;let u=r.array(o.BlockLegacy);t.RichTextContent=r.strict({__TYPE__:r.literal(t.RichTextContentType),value:r.array(o.Block)}),(0,n.__exportStar)(G8(),t);let s=n=>new r.Type("RichTextLegacy",t.isRichTextContent,n=>(0,UZ.pipe)(u.decode(n),Uq.either.map(n=>({value:n,__TYPE__:t.RichTextContentType}))),t=>({content:u.encode(t.value),types:{[n.keyOfType]:"StructuredText"}}));t.RichTextLegacy=s}(G6)),G6}var Ze,Zt,Zn={};function Zr(){return Zt||(Zt=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SeparatorContent=t.SeparatorLegacy=t.isSeparatorContent=t.SeparatorContentType=void 0;let n=(0,nQ.__importStar)(V1),r=Gr();t.SeparatorContentType="SeparatorContent";let i=n=>(0,r.hasContentType)(n)&&n.__TYPE__===t.SeparatorContentType;t.isSeparatorContent=i;let o=r=>new n.Type("SeparatorLegacy",t.isSeparatorContent,()=>n.success(t.SeparatorContent.encode({__TYPE__:t.SeparatorContentType})),()=>({content:{},types:{[r.keyOfType]:"Separator"}}));t.SeparatorLegacy=o,t.SeparatorContent=n.strict({__TYPE__:n.literal(t.SeparatorContentType)})}(Zn)),Zn}function Zi(){return Za||(Za=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nQ;(0,n.__exportStar)(Gh(),t),(0,n.__exportStar)(Gy(),t),(0,n.__exportStar)(G$(),t),(0,n.__exportStar)(GG(),t),(0,n.__exportStar)(GJ(),t),(0,n.__exportStar)(G0(),t),(0,n.__exportStar)(G3(),t),(0,n.__exportStar)(function(){if(Zo)return G5;Zo=1,Object.defineProperty(G5,"__esModule",{value:!0}),G5.NestableLegacy=G5.isNestableContent=G5.NestableContentDefaultValue=G5.NestableContent=void 0;let t=nQ,n=(0,t.__importStar)(V1),r=Gi(),i=Gh(),o=Gy(),a=G$(),u=GG(),s=GJ(),l=G0(),c=G3(),d=G7(),f=Zr();G5.NestableContent=n.union([r.EmptyContent,i.BooleanContent,o.EmbedContent,a.TextContent,a.TimestampContent,a.SelectContent,a.RangeContent,a.NumberContent,a.DateContent,a.ColorContent,u.GeoPointContent,s.ImageContent,l.IntegrationFieldContent,c.LinkContent,d.RichTextContent,f.SeparatorContent]);let p=t=>{switch(t.type){case"Boolean":return(0,i.BooleanContentDefaultValue)(t);case"Select":return(0,a.SelectContentDefaultValue)(t);default:return}};G5.NestableContentDefaultValue=p;let h=t=>(0,a.isTextContent)(t)||(0,a.isColorContent)(t)||(0,a.isDateContent)(t)||(0,a.isTimestampContent)(t)||(0,a.isNumberContent)(t)||(0,a.isRangeContent)(t)||(0,a.isSelectContent)(t)||(0,u.isGeoPointContent)(t)||(0,d.isRichTextContent)(t)||(0,i.isBooleanContent)(t)||(0,o.isEmbedContent)(t)||(0,s.isImageContent)(t)||(0,l.isIntegrationFieldContent)(t)||(0,c.isLinkContent)(t)||(0,f.isSeparatorContent)(t)||(0,r.isEmptyContent)(t);G5.isNestableContent=h;let m=t=>({decode(n){if(!t.fieldType)return;let p=(0,r.EmptyLegacy)(t.fieldType).decode(n);if((0,UK.isRight)(p))return p;let h=(()=>{switch(t.fieldType){case"Text":return(0,a.TextLegacy)(t);case"Color":return(0,a.ColorLegacy)(t);case"Date":return(0,a.DateLegacy)(t);case"Timestamp":return(0,a.TimestampLegacy)(t);case"Number":return(0,a.NumberLegacy)(t);case"Range":return(0,a.RangeLegacy)(t);case"Select":return(0,a.SelectLegacy)(t);case"GeoPoint":return(0,u.GeoPointLegacy)(t);case"StructuredText":return(0,d.RichTextLegacy)(t);case"Boolean":return(0,i.BooleanLegacy)(t);case"Embed":return(0,o.EmbedLegacy)(t);case"Image":return(0,s.ImageLegacy)(t);case"IntegrationFields":return(0,l.IntegrationFieldLegacy)(t);case"Link":return(0,c.LinkContentLegacy)(t);case"Separator":return(0,f.SeparatorLegacy)(t);default:return}})();if(h)return h.decode(n)},encode(n){switch(n.__TYPE__){case GT.FieldContentType:return"Text"===n.type?(0,a.TextLegacy)(t).encode(n):"Color"===n.type?(0,a.ColorLegacy)(t).encode(n):"Range"===n.type?(0,a.RangeLegacy)(t).encode(n):"Date"===n.type?(0,a.DateLegacy)(t).encode(n):"Number"===n.type?(0,a.NumberLegacy)(t).encode(n):"Timestamp"===n.type?(0,a.TimestampLegacy)(t).encode(n):"Select"===n.type?(0,a.SelectLegacy)(t).encode(n):void 0;case u.GeoPointContentType:return(0,u.GeoPointLegacy)(t).encode(n);case d.RichTextContentType:return(0,d.RichTextLegacy)(t).encode(n);case o.EmbedContentType:return(0,o.EmbedLegacy)(t).encode(n);case i.BooleanContentType:return(0,i.BooleanLegacy)(t).encode(n);case s.ImageContentType:return(0,s.ImageLegacy)(t).encode(n);case l.IntegrationFieldContentType:return(0,l.IntegrationFieldLegacy)(t).encode(n);case c.LinkContentType:return(0,c.LinkContentLegacy)(t).encode(n);case f.SeparatorContentType:return(0,f.SeparatorLegacy)(t).encode(n);default:return}}});return G5.NestableLegacy=m,G5}(),t),(0,n.__exportStar)(G7(),t),(0,n.__exportStar)(Zr(),t)}(Gf)),Gf}var Zo,Za,Zu,Zs={};function Zl(){if(Zu)return Zs;Zu=1,Object.defineProperty(Zs,"__esModule",{value:!0}),Zs.repeatableContentWithDefaultNestableContentValues=Zs.withDefaultNestableContentValues=void 0;let t=Zi();return Zs.withDefaultNestableContentValues=function(n,r){return Object.entries(n).reduce((n,[i,o])=>{if(void 0===r[i]){let a=(0,t.NestableContentDefaultValue)(o);return void 0!==a?{...n,[i]:a}:n}return n},r)},Zs.repeatableContentWithDefaultNestableContentValues=function(n,r){let i=Object.entries(n);return r.map(n=>i.reduce((r,[i,o])=>{if(!n.value.find(([t])=>t===i)){let a=(0,t.NestableContentDefaultValue)(o);return{...r,value:[...r.value,...a?[[i,a]]:[]]}}return r},n))},Zs}function Zc(){return Zd||(Zd=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.traverseGroupItemsContent=t.traverseGroupContent=t.groupContentWithDefaultValues=t.GroupContent=t.isGroupContent=t.GroupContentType=t.GroupLegacy=t.GroupItemLegacy=t.GroupItemContent=t.GroupItemContentType=void 0;let n=nQ,r=(0,n.__importStar)(V1),i=Gr(),o=Zi(),a=Zl();t.GroupItemContentType="GroupItemContent",t.GroupItemContent=r.strict({__TYPE__:r.literal(t.GroupItemContentType),value:r.array(r.tuple([r.string,o.NestableContent]))});let u=r.record(r.string,r.unknown),s=n=>new r.Type("GroupItemLegacy",n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.GroupItemContentType,r=>(0,UZ.pipe)(u.decode(r),Uq.either.map(r=>({value:Object.entries(r).reduce((t,[r,i])=>{let a=(0,Ga.getFieldCtx)(r,n),u=(0,o.NestableLegacy)(a).decode(i);return!u||(0,UK.isLeft)(u)?t:[...t,[r,u.right]]},[]),__TYPE__:t.GroupItemContentType}))),t=>t.value.reduce((t,[r,i])=>{let a=(0,Ga.getFieldCtx)(r,n),u=(0,o.NestableLegacy)(a).encode(i);return u?{content:{...t.content,[r]:u.content},types:{...t.types,...u.types}}:t},{content:{},types:{}}));t.GroupItemLegacy=s;let l=n=>{let i=r.array(r.union([r.null,(0,t.GroupItemLegacy)(n)])),o=r.array((0,t.GroupItemLegacy)(n));return new r.Type("GroupLegacy",t.isGroupContent,n=>(0,UZ.pipe)(i.decode(n),Uq.either.map(n=>({value:n.map(n=>null===n?{__TYPE__:t.GroupItemContentType,value:[]}:n),__TYPE__:t.GroupContentType}))),t=>{let r=o.encode(t.value);return{content:r.map(t=>t.content),types:r.reduce((t,n)=>({...t,...n.types}),{[n.keyOfType]:"Group"})}})};t.GroupLegacy=l,t.GroupContentType="GroupContentType";let c=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.GroupContentType;function d({path:t,model:n,content:r}){return i=>r.map((r,a)=>{let u=t.concat([{key:a.toString(),type:"GroupItem"}]),s=r.value.reduce((t,[r,a])=>{let s=null==n?void 0:n[r],l=i({path:u.concat([{key:r,type:"Widget"}]),key:r,apiId:r,model:s,content:a});return l&&(0,o.isNestableContent)(l)?t.concat([[r,l]]):t},[]);return{__TYPE__:r.__TYPE__,value:s}})}t.isGroupContent=c,t.GroupContent=r.strict({__TYPE__:r.literal(t.GroupContentType),value:r.array(t.GroupItemContent)}),t.groupContentWithDefaultValues=function(t,n){var r;let i=null===(r=t.config)||void 0===r?void 0:r.fields;return i?{...n,value:(0,a.repeatableContentWithDefaultNestableContentValues)(i,n.value)}:n},t.traverseGroupContent=function({path:t,key:n,apiId:r,model:i,content:o}){return a=>{var u;let s=d({path:t,model:null===(u=null==i?void 0:i.config)||void 0===u?void 0:u.fields,content:o.value})(a);return a({path:t,key:n,apiId:r,model:i,content:{__TYPE__:o.__TYPE__,value:s}})}},t.traverseGroupItemsContent=d}(Go)),Go}var Zd,Zf,Zp={},Zh={},Zm={},Zg={};function Zy(){if(Zf)return Zg;Zf=1,Object.defineProperty(Zg,"__esModule",{value:!0}),Zg.RepeatableWidgets=Zg.RepeatableWidgetsLegacy=void 0;let t=(0,nQ.__importStar)(V1),n=Zc(),r=Zi(),i=r=>t.array((0,n.GroupItemLegacy)(r));Zg.RepeatableWidgetsLegacy=i;let o=t.tuple([t.string,r.NestableContent]),a=t.strict({__TYPE__:t.literal(n.GroupItemContentType),value:t.array(o)});return Zg.RepeatableWidgets=t.array(a),Zg}function Zv(){return Zb||(Zb=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.migrateCompositeSlice=t.traverseCompositeSliceContent=t.compositeSliceContentWithDefaultValues=t.CompositeSliceContent=t.CompositeSliceLegacy=t.isCompositeSliceContent=t.CompositeSliceContentType=void 0;let n=nQ,r=(0,n.__importStar)(V1),i=Gr(),o=Zc(),a=Zi(),u=Zl(),s=Zy();t.CompositeSliceContentType="CompositeSliceContent";let l=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.CompositeSliceContentType;t.isCompositeSliceContent=l;let c=r.exact(r.partial({repeat:r.array(r.unknown),"non-repeat":r.UnknownRecord})),d=n=>new r.Type("CompositeSliceLegacy",t.isCompositeSliceContent,r=>(0,UZ.pipe)(c.decode(r),Uq.either.map(r=>{let i=(()=>{let t=(0,Ga.getFieldCtx)("repeat",n),i=(0,s.RepeatableWidgetsLegacy)(t).decode(r.repeat);if(!(!i||(0,UK.isLeft)(i)))return i.right})()||[];return{nonRepeat:Object.entries(r["non-repeat"]||{}).reduce((t,[r,i])=>{let o=(0,Ga.getFieldCtx)(r,n,["non-repeat"]);if(!o)return t;let u=(0,a.NestableLegacy)(o).decode(i);return!u||(0,UK.isLeft)(u)?t:{...t,[r]:u.right}},{}),repeat:i,__TYPE__:t.CompositeSliceContentType}})),t=>{let r=Object.entries(t.nonRepeat).reduce((t,[r,i])=>{let o=(0,Ga.getFieldCtx)(r,n,["non-repeat"]),u=(0,a.NestableLegacy)(o).encode(i);return u?{content:{...t.content,[r]:u.content},types:{...t.types,...u.types}}:t},{content:{},types:{}}),i=(()=>{let r=(0,Ga.getFieldCtx)("repeat",n);return(0,s.RepeatableWidgetsLegacy)(r).encode(t.repeat)})()||[];return{content:{"non-repeat":r.content,repeat:i.map(t=>t.content)},types:{[n.keyOfType]:"Slice",...r.types,...i.reduce((t,n)=>({...t,...n.types}),{})}}});t.CompositeSliceLegacy=d,t.CompositeSliceContent=r.strict({__TYPE__:r.literal(t.CompositeSliceContentType),nonRepeat:r.record(r.string,a.NestableContent),repeat:s.RepeatableWidgets}),t.compositeSliceContentWithDefaultValues=function(t,n){var r,i;let o=(0,u.withDefaultNestableContentValues)(null!==(r=t["non-repeat"])&&void 0!==r?r:{},n.nonRepeat),a=(0,u.repeatableContentWithDefaultNestableContentValues)(null!==(i=t.repeat)&&void 0!==i?i:{},n.repeat);return{...n,nonRepeat:o,repeat:a}},t.traverseCompositeSliceContent=function({path:t,sliceKey:n,sliceName:r,model:i,content:u}){return(s,l)=>{let c=Object.entries(u.widget.nonRepeat).reduce((o,[u,l])=>{var c,d,f;let p=(null==i?void 0:i.type)==="SharedSlice"?null===(d=null===(c=null==i?void 0:i.fields)||void 0===c?void 0:c.primary)||void 0===d?void 0:d[u]:null===(f=null==i?void 0:i["non-repeat"])||void 0===f?void 0:f[u],h=s({path:t.concat([{key:"non-repeat",type:"primary"},{key:u,type:"Widget"}]),key:u,apiId:r,model:p,content:l});return h?(0,a.isNestableContent)(h)?{...o,[u]:h}:(console.warn(`Warn: Non nestable content with key [${u}] detected in a composite slice [${r}] with key [${n}]`),o):o},{}),d=(0,o.traverseGroupItemsContent)({path:t.concat([{key:"repeat",type:"items"}]),model:(null==i?void 0:i.type)==="SharedSlice"?null==i?void 0:i.fields.items:null==i?void 0:i.repeat,content:u.widget.repeat})(s);return l({key:n,apiId:r,path:t,model:i,content:{...u,widget:{__TYPE__:"CompositeSliceContent",repeat:d,nonRepeat:c}}})}},t.migrateCompositeSlice=function(t,n){let[,r]=n.key.split("$");return{key:`${t.sliceName}$${r}`,name:t.sliceName,maybeLabel:n.maybeLabel,widget:{__TYPE__:"SharedSliceContent",variation:t.variationId,primary:Object.entries(n.widget.nonRepeat).reduce((r,[i,o])=>{var a;return!(null===(a=t.fields.primary)||void 0===a)&&a[i]?{...r,[i]:o}:(console.warn(`The widget ${i} in the non-repeat zone of the composite slice [${t.sliceName}] with key [${n.key}] doesn't exist in the model.`),r)},{}),items:n.widget.repeat.map(r=>({__TYPE__:"GroupItemContent",value:r.value.reduce((r,[i,o])=>{var a;return!(null===(a=t.fields.items)||void 0===a)&&a[i]?r.concat([[i,o]]):(console.warn(`The widget ${i} in the repeat zone of the composite slice [${t.sliceName}] with key [${n.key}] doesn't exist in the model.`),r)},[])}),[])}}}}(Zm)),Zm}var Zb,Zx,Z_={};function ZS(){return Zx||(Zx=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.traverseSharedSliceContent=t.sharedSliceContentWithDefaultValues=t.SharedSliceContent=t.SharedSliceLegacy=t.isSharedSliceContent=t.SharedSliceContentType=void 0;let n=nQ,r=(0,n.__importStar)(V1),i=Gr(),o=Zc(),a=Zi(),u=Zl(),s=Zy();t.SharedSliceContentType="SharedSliceContent";let l=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.SharedSliceContentType;t.isSharedSliceContent=l;let c=r.exact(r.type({variation:r.string,items:(0,qz.withFallback)(r.array(r.unknown),[]),primary:(0,qz.withFallback)(r.UnknownRecord,{})})),d=n=>new r.Type("SharedSliceLegacy",t.isSharedSliceContent,r=>(0,UZ.pipe)(c.decode(r),Uq.either.map(r=>{let i=(()=>{let t=(0,Ga.getFieldCtx)("items",n,["variations",r.variation]),i=(0,s.RepeatableWidgetsLegacy)(t).decode(r.items);if(!(!i||(0,UK.isLeft)(i)))return i.right})()||[],o=Object.entries(r.primary).reduce((t,[i,o])=>{let u=(0,Ga.getFieldCtx)(i,n,["variations",r.variation,"primary"]),s=(0,a.NestableLegacy)(u).decode(o);return!s||(0,UK.isLeft)(s)?t:{...t,[i]:s.right}},{});return{variation:r.variation,primary:o,items:i,__TYPE__:t.SharedSliceContentType}})),t=>{let r=Object.entries(t.primary).reduce((r,[i,o])=>{let u=(0,Ga.getFieldCtx)(i,n,["variations",t.variation,"primary"]),s=(0,a.NestableLegacy)(u).encode(o);return s?{content:{...r.content,[i]:s.content},types:{...r.types,...s.types}}:r},{content:{},types:{}}),i=(()=>{let r=(0,Ga.getFieldCtx)("items",n,["variations",t.variation]);return(0,s.RepeatableWidgetsLegacy)(r).encode(t.items)})()||[];return{content:{primary:r.content,items:i.map(t=>t.content),variation:t.variation},types:{[n.keyOfType]:"SharedSlice",...r.types,...i.reduce((t,n)=>({...t,...n.types}),{})}}});t.SharedSliceLegacy=d,t.SharedSliceContent=r.strict({__TYPE__:r.literal(t.SharedSliceContentType),variation:r.string,primary:r.record(r.string,a.NestableContent),items:s.RepeatableWidgets}),t.sharedSliceContentWithDefaultValues=function(t,n){var r,i;let o=t.variations.find(t=>t.id===n.variation),a=null!==(r=null==o?void 0:o.primary)&&void 0!==r?r:{},s=null!==(i=null==o?void 0:o.items)&&void 0!==i?i:{},l=(0,u.withDefaultNestableContentValues)(a,n.primary),c=(0,u.repeatableContentWithDefaultNestableContentValues)(s,n.items);return{...n,primary:l,items:c}},t.traverseSharedSliceContent=function({path:t,sliceKey:n,sliceName:r,model:i,content:u}){return(s,l)=>{let c=Object.entries(u.widget.primary).reduce((o,[u,l])=>{var c,d;let f=null===(d=null===(c=null==i?void 0:i.fields)||void 0===c?void 0:c.primary)||void 0===d?void 0:d[u],p=s({path:t.concat([{key:"primary",type:"primary"},{key:u,type:"Widget"}]),key:u,apiId:r,model:f,content:l});return p?(0,a.isNestableContent)(p)?{...o,[u]:p}:(console.warn(`Warn: Non nestable content with key [${u}] detected in a shared slice [${r}] with key [${n}]`),o):o},{}),d=(0,o.traverseGroupItemsContent)({path:t.concat([{key:"items",type:"items"}]),model:null==i?void 0:i.fields.items,content:u.widget.items})(s);return l({key:n,apiId:r,path:t,model:i,content:{...u,widget:{__TYPE__:"SharedSliceContent",variation:u.widget.variation,primary:c,items:d}}})}}}(Z_)),Z_}var ZT,Zw={};function ZO(){if(ZT)return Zw;ZT=1,Object.defineProperty(Zw,"__esModule",{value:!0}),Zw.migrateSimpleSlice=Zw.traverseSimpleSliceContent=Zw.SimpleSliceLegacy=Zw.isSimpleSliceContent=Zw.SimpleSliceContent=void 0;let t=(0,nQ.__importStar)(V1),n=Zc(),r=Zi();Zw.SimpleSliceContent=t.union([r.NestableContent,n.GroupContent]);let i=t=>(0,r.isNestableContent)(t)||(0,n.isGroupContent)(t);Zw.isSimpleSliceContent=i;let o=t=>({decode:"Group"===t.fieldType?(0,n.GroupLegacy)(t).decode.bind(null):(0,r.NestableLegacy)(t).decode.bind(null),encode:i=>"GroupContentType"===i.__TYPE__?(0,n.GroupLegacy)(t).encode(i):(0,r.NestableLegacy)(t).encode(i)});return Zw.SimpleSliceLegacy=o,Zw.traverseSimpleSliceContent=function({path:t,sliceKey:r,sliceName:i,model:o,content:a}){return(u,s)=>{var l;if((0,n.isGroupContent)(a.widget)){let c=(0,n.traverseGroupContent)({path:t,key:a.key,apiId:a.name,model:(null==o?void 0:o.type)==="Group"?o:(null==o?void 0:o.type)==="SharedSlice"?{type:"Group",config:{fields:o.fields.items||{}}}:void 0,content:a.widget})(u);return c&&s({key:a.key,apiId:a.name,path:t,model:o,content:{...a,widget:c}})}let d=u({key:a.key,apiId:a.name,path:t,model:(null==o?void 0:o.type)==="SharedSlice"?null===(l=o.fields.primary)||void 0===l?void 0:l[a.name]:(null==o?void 0:o.type)!=="Group"?o:void 0,content:a.widget});return d&&s({key:r,apiId:i,path:t,model:o,content:{...a,widget:d}})}},Zw.migrateSimpleSlice=function(t,n){var r;let[,i]=n.key.split("$"),o=`${t.sliceName}$${i}`;return"GroupContentType"===n.widget.__TYPE__?{key:o,name:t.sliceName,maybeLabel:n.maybeLabel,widget:{__TYPE__:"SharedSliceContent",variation:t.variationId,primary:{},items:n.widget.value.map(n=>({__TYPE__:"GroupItemContent",value:n.value.reduce((n,[r,i])=>{var o;return!(null===(o=t.fields.items)||void 0===o)&&o[r]?n.concat([[r,i]]):n},[])}),[])}}:{key:o,name:t.sliceName,maybeLabel:n.maybeLabel,widget:{__TYPE__:"SharedSliceContent",variation:t.variationId,primary:!(null===(r=t.fields.primary)||void 0===r)&&r[n.name]?{[n.name]:n.widget}:{},items:[]}}},Zw}function Zk(){return ZC||(ZC=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SliceContent=t.SliceLegacy=void 0;let n=nQ,r=(0,n.__importStar)(V1),i=Zv(),o=ZS(),a=ZO(),u=t=>({decode:n=>(()=>{switch(t.fieldType){case"Slice":return(0,i.CompositeSliceLegacy)(t);case"SharedSlice":return(0,o.SharedSliceLegacy)(t);default:return(0,a.SimpleSliceLegacy)(t)}})().decode(n),encode(n){switch(n.__TYPE__){case"SharedSliceContent":return(0,o.SharedSliceLegacy)(t).encode(n);case"CompositeSliceContent":return(0,i.CompositeSliceLegacy)(t).encode(n);default:return(0,a.SimpleSliceLegacy)(t).encode(n)}}});t.SliceLegacy=u,t.SliceContent=r.union([i.CompositeSliceContent,o.SharedSliceContent,a.SimpleSliceContent]),(0,n.__exportStar)(Zv(),t),(0,n.__exportStar)(ZS(),t),(0,n.__exportStar)(ZO(),t)}(Zh)),Zh}var ZC,ZI,ZM={};function ZR(){if(ZI)return ZM;ZI=1,Object.defineProperty(ZM,"__esModule",{value:!0}),ZM.migrateSliceItem=ZM.SlicesItemLegacy=ZM.sliceItemContentWithDefaultValues=ZM.isSimpleSliceItemContent=ZM.isCompositeSliceItemContent=ZM.isSharedSliceItemContent=ZM.SliceItemContent=void 0;let t=nQ,n=(0,t.__importStar)(V1),r=Zc(),i=Zi(),o=Zl(),a=Zk(),u=Zv(),s=ZS(),l=ZO();function c(t){return(0,u.isCompositeSliceContent)(t.widget)}function d(t){return(0,r.isGroupContent)(t.widget)||(0,i.isNestableContent)(t.widget)}ZM.SliceItemContent=n.type({key:n.string,name:n.string,maybeLabel:n.union([n.string,n.undefined]),widget:a.SliceContent}),ZM.isSharedSliceItemContent=function(t){return(0,s.isSharedSliceContent)(t.widget)},ZM.isCompositeSliceItemContent=c,ZM.isSimpleSliceItemContent=d,ZM.sliceItemContentWithDefaultValues=function(t,n){var i;if("SharedSlice"===t.type&&(0,s.isSharedSliceContent)(n))return(0,a.sharedSliceContentWithDefaultValues)(t,n);if("Slice"===t.type&&(0,u.isCompositeSliceContent)(n))return(0,a.compositeSliceContentWithDefaultValues)(t,n);if("Group"===t.type&&(0,r.isGroupContent)(n)&&!(null===(i=t.config)||void 0===i)&&i.fields){let l=(0,o.repeatableContentWithDefaultNestableContentValues)(t.config.fields,n.value);return{...n,value:l}}return n};let f=n.exact(n.intersection([n.type({key:n.string,value:n.unknown}),n.partial({label:(0,V7.nullable)(n.string)})])),p=t=>new n.Type("SlicesItemLegacy",t=>((0,s.isSharedSliceContent)(t.widget),(0,u.isCompositeSliceContent)(t.widget),(0,l.isSimpleSliceContent)(t.widget)),(r,i)=>(0,UZ.pipe)(f.decode(r),Uq.either.chain(o=>{var u;let s=o.key.indexOf("$"),l=o.key.substring(0,s>0?s:void 0),c=(0,Ga.getFieldCtx)(l,t),d=(0,a.SliceLegacy)(c).decode(o.value);return!d||(0,UK.isLeft)(d)?n.failure(r,i):n.success({key:o.key,name:l,maybeLabel:null!==(u=o.label)&&void 0!==u?u:void 0,widget:d.right})})),n=>{let r=(0,Ga.getFieldCtx)(n.name,t),i=(0,a.SliceLegacy)(r).encode(n.widget);return{content:{key:n.key,label:n.maybeLabel,value:(null==i?void 0:i.content)||{}},types:(null==i?void 0:i.types)||{}}});ZM.SlicesItemLegacy=p;let h=({model:t,content:n})=>c(n)&&(null==t?void 0:t.type)==="SharedSlice"?(0,u.migrateCompositeSlice)(t,n):d(n)&&(null==t?void 0:t.type)==="SharedSlice"?(0,l.migrateSimpleSlice)(t,n):n;return ZM.migrateSliceItem=h,ZM}var ZE,Zj={};function ZA(){return ZN||(ZN=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nQ;(0,n.__exportStar)(Zk(),t),(0,n.__exportStar)(ZR(),t),(0,n.__exportStar)((ZE||(ZE=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.traverseSlices=t.slicesContentWithDefaultValues=t.SlicesContent=t.SlicesLegacy=t.isSlicesContent=t.SlicesContentType=void 0;let n=nQ,r=(0,n.__importStar)(V1),i=Gr(),o=Zv(),a=ZS(),u=ZO(),s=ZR();t.SlicesContentType="SliceContentType";let l=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.SlicesContentType;t.isSlicesContent=l;let c=n=>{let i=r.array((0,s.SlicesItemLegacy)(n));return new r.Type("SlicesLegacy",t.isSlicesContent,n=>(0,UZ.pipe)(i.decode(n),Uq.either.map(n=>({__TYPE__:t.SlicesContentType,value:n}))),t=>{let r=i.encode(t.value);return{content:r.map(t=>t.content),types:r.reduce((t,n)=>({...t,...n.types}),{[n.keyOfType]:"Slices"})}})};t.SlicesLegacy=c,t.SlicesContent=r.type({__TYPE__:r.literal(t.SlicesContentType),value:r.array(s.SliceItemContent)}),t.slicesContentWithDefaultValues=function(t,n){var r;let i=null===(r=null==t?void 0:t.config)||void 0===r?void 0:r.choices;if(void 0===i)return n;let o=n.value.map(t=>{let n=i[t.name];if(n){let r=(0,s.sliceItemContentWithDefaultValues)(n,t.widget);return{...t,widget:r}}return t});return{...n,value:o}},t.traverseSlices=function({path:t,key:n,model:r,content:i}){return({transformWidget:l=({content:t})=>t,transformSlice:c=({content:t})=>t})=>{let d=i.value.reduce((n,i)=>{let d=r&&function(t,n,r){var i,o;let a=null===(o=null===(i=null==n?void 0:n.config)||void 0===i?void 0:i.choices)||void 0===o?void 0:o[r.name];return(()=>{if((0,s.isSharedSliceItemContent)(r)&&a&&(0,qG.isStaticSharedSlice)(a)){let t=a.variations.find(t=>t.id===r.widget.variation);return t?{type:"SharedSlice",sliceName:a.id,variationId:t.id,fields:{primary:t.primary||{},items:t.items||{}}}:void 0}})()||(()=>{var i;let o=V2.ContentPath.append(V2.ContentPath.serialize(t),r.name),a=Object.values((null===(i=null==n?void 0:n.config)||void 0===i?void 0:i.choices)||{}).find(t=>{var n;return!!(0,qG.isStaticSharedSlice)(t)&&!!(!(null===(n=t.legacyPaths)||void 0===n)&&n[o])});if(!a)return;let u=null==a?void 0:a.variations.find(t=>{var n;return t.id===(null===(n=a.legacyPaths)||void 0===n?void 0:n[o])});if(u)return{type:"SharedSlice",sliceName:a.id,variationId:u.id,fields:{primary:u.primary||{},items:u.items||{}}}})()||(()=>{if(a){if((0,qG.isCompositeSlice)(a))return{type:"Slice","non-repeat":a["non-repeat"]||{},repeat:a.repeat||{}};if((0,qG.isLegacySlice)(a))return a}})()}(t,r,i),f=(0,s.isSharedSliceItemContent)(i)?(0,a.traverseSharedSliceContent)({path:t.concat({key:i.key,type:"SharedSlice"}),sliceKey:i.key,sliceName:i.name,model:(null==d?void 0:d.type)==="SharedSlice"?d:void 0,content:i})(l,c):(0,s.isCompositeSliceItemContent)(i)?(0,o.traverseCompositeSliceContent)({path:t.concat({key:i.key,type:"Slice"}),sliceKey:i.key,sliceName:i.name,model:(null==d?void 0:d.type)==="Slice"||(null==d?void 0:d.type)==="SharedSlice"?d:void 0,content:i})(l,c):(0,s.isSimpleSliceItemContent)(i)?(0,u.traverseSimpleSliceContent)({path:t.concat({key:i.key,type:"LegacySlice"}),sliceKey:i.key,sliceName:i.name,model:d&&(null==d?void 0:d.type)!=="Slice"?d:void 0,content:i})(l,c):void 0;return f?n.concat(f):n},[]);return l({path:t,key:n,apiId:n,model:r,content:{__TYPE__:i.__TYPE__,value:d}})}}}(Zj)),Zj),t)}(Zp)),Zp}var ZN,ZP,ZL={};function ZD(){return ZP||(ZP=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.UIDContent=t.UIDLegacy=t.isUIDContent=t.UIDContentType=void 0;let n=nQ,r=(0,n.__importStar)(V1),i=Gr();t.UIDContentType="UIDContent";let o=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.UIDContentType;t.isUIDContent=o;let a=n=>new r.Type("UIDLegacy",t.isUIDContent,n=>(0,UZ.pipe)(r.string.decode(n),Uq.either.map(n=>t.UIDContent.encode({value:n,__TYPE__:t.UIDContentType}))),t=>({content:t.value,types:{[n.keyOfType]:"UID"}}));t.UIDLegacy=a,t.UIDContent=r.type({__TYPE__:r.literal(t.UIDContentType),value:r.string})}(ZL)),ZL}var ZF,ZW={};function ZU(){return i||(i=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nQ;(0,n.__exportStar)(Gi(),t),(0,n.__exportStar)(Zc(),t),(0,n.__exportStar)(Zi(),t),(0,n.__exportStar)(ZA(),t),(0,n.__exportStar)(ZD(),t),(0,n.__exportStar)(function(){if(ZF)return ZW;ZF=1,Object.defineProperty(ZW,"__esModule",{value:!0}),ZW.WidgetLegacy=ZW.isWidgetContent=ZW.WidgetContent=void 0;let t=(0,nQ.__importStar)(V1),n=Zc(),r=Zi(),i=ZA(),o=ZD();ZW.WidgetContent=t.union([n.GroupContent,r.NestableContent,o.UIDContent,i.SlicesContent]);let a=t=>(0,n.isGroupContent)(t)||(0,r.isNestableContent)(t)||(0,o.isUIDContent)(t)||(0,i.isSlicesContent)(t);ZW.isWidgetContent=a;let u=t=>({decode(a){if(!t.fieldType)return;let u=(()=>{switch(t.fieldType){case"UID":return(0,o.UIDLegacy)(t);case"Group":return(0,n.GroupLegacy)(t);case"Choice":case"Slices":return(0,i.SlicesLegacy)(t);default:return(0,r.NestableLegacy)(t)}})();if(u)return u.decode(a)},encode(a){switch(a.__TYPE__){case o.UIDContentType:return(0,o.UIDLegacy)(t).encode(a);case n.GroupContentType:return(0,n.GroupLegacy)(t).encode(a);case i.SlicesContentType:return(0,i.SlicesLegacy)(t).encode(a);default:return(0,r.NestableLegacy)(t).encode(a)}}});return ZW.WidgetLegacy=u,ZW}(),t)}(Ge)),Ge}Object.defineProperty(nX,"__esModule",{value:!0}),nX.migrateDocument=nX.collectWidgets=nX.traverseDocument=nX.fillDocumentWithDefaultValues=nX.DocumentLegacy=nX.Document=void 0;let Zz=nQ,ZB=(0,Zz.__importStar)(V1),ZV=ZU();nX.Document=ZB.record(V3.WidgetKey,ZV.WidgetContent);let Z$=ZB.record(V3.WidgetKey,ZB.unknown),Zq=t=>new ZB.Type("Document",t=>!!t&&"object"==typeof t,n=>(0,UZ.pipe)(Z$.decode(n),Uq.either.map(n=>Object.entries(n).reduce((n,[r,i])=>{let o=(0,Ga.defaultCtx)(r,t),a=(0,ZV.WidgetLegacy)(o).decode(i);return!a||(0,UK.isLeft)(a)?n:{...n,[r]:a.right}},{}))),n=>Object.entries(n).reduce((n,[r,i])=>{let o=(0,Ga.defaultCtx)(r,t),a=(0,ZV.WidgetLegacy)(o).encode(i);return a?{content:{...n.content,[r]:a.content},types:{...n.types,...a.types}}:n},{content:{},types:{}}));function ZK(t){let n=Object.entries(t),{types:r,widgets:i}=n.reduce((t,[n,r])=>{if(n.endsWith("_TYPE")){let i=Ga.FieldOrSliceType.decode(r);if((0,UK.isRight)(i))return{...t,types:t.types.set(n.substring(0,n.length-5),i.right)}}return n.endsWith("_POSITION")||n.endsWith("_TYPE")?t:{...t,widgets:{...t.widgets,[n]:r}}},{types:new Map,widgets:{}}),o=t.slugs_INTERNAL||[],a=t.uid;return{widgets:i,types:r,uid:a,slugs:o}}function ZH(t){return{customTypeId:null==t?void 0:t.id,fields:Object.fromEntries((0,qG.flattenSections)(t))}}function ZG({document:t,customType:n}){let r=n&&qG.StaticCustomType.is(n)?ZH(n):n;return({transformWidget:n=({content:t})=>t,transformSlice:i=({content:t})=>t})=>{let o=r&&Object.entries(r.fields).reduce((t,[n,r])=>({...t,[n]:r}),{});return Object.entries(t).reduce((t,[a,u])=>{let s=o&&o[a],l=V2.ContentPath.make([{key:null==r?void 0:r.customTypeId,type:"CustomType"},{key:a,type:"Widget"}]),c=(()=>{switch(u.__TYPE__){case"SliceContentType":return(0,ZV.traverseSlices)({path:l,key:a,model:(null==s?void 0:s.type)==="Slices"||(null==s?void 0:s.type)==="Choice"?s:void 0,content:u})({transformWidget:n,transformSlice:i});case"GroupContentType":return(0,ZV.traverseGroupContent)({path:l,key:a,apiId:a,model:(null==s?void 0:s.type)==="Group"?s:void 0,content:u})(n);default:return n({path:l,key:a,apiId:a,model:(null==s?void 0:s.type)!=="Group"&&(null==s?void 0:s.type)!=="Slices"&&(null==s?void 0:s.type)!=="Choice"?s:void 0,content:u})}})();return{...t,...c?{[a]:c}:{}}},{})}}function ZZ(t,n){let r=qG.StaticCustomType.is(n)?ZH(n):n;return Object.values((0,qG.collectSharedSlices)(r)).some(t=>Boolean(t.legacyPaths))?ZG({document:t,customType:n})({transformSlice:ZV.migrateSliceItem}):t}nX.DocumentLegacy={_codec:Zq,extractMetadata:ZK,parse:function(t,n){let r=(0,UZ.pipe)(ZB.record(V3.WidgetKey,ZB.unknown).decode(t),Uq.either.chain(t=>{let{types:n,widgets:r}=ZK(t);return Zq(n).decode(r)}));return(0,UK.isLeft)(r)?void 0:ZZ(r.right,n)},encode:function(t){let n=Zq().encode(t);return{...n.content,...n.types}}},nX.fillDocumentWithDefaultValues=function(t,n){let{fields:r}=t&&qG.StaticCustomType.is(t)?ZH(t):t;return Object.entries(r).reduce((t,[r,i])=>{let o=n[r],a=(()=>{switch(i.type){case"Group":return(0,ZV.isGroupContent)(o)?(0,ZV.groupContentWithDefaultValues)(i,o):o;case"Choice":case"Slices":return(0,ZV.isSlicesContent)(o)?(0,ZV.slicesContentWithDefaultValues)(i,o):o;default:return void 0===o&&qG.NestableWidget.is(i)?(0,ZV.NestableContentDefaultValue)(i):o}})();return a?{...t,[r]:a}:t},n)},nX.traverseDocument=ZG,nX.collectWidgets=function(t,n){let r={};return ZG({document:t})({transformWidget({content:t,path:i}){let o=V2.ContentPath.serialize(i);return n(t,i)&&(r[o]=t),t}}),r},nX.migrateDocument=ZZ,function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nQ;(0,n.__exportStar)(nX,t),(0,n.__exportStar)(ZU(),t),(0,n.__exportStar)(Ga,t)}(nJ);let ZY=(0,o.createContext)({update(){}});function ZJ(t){var n;return(null==(n=t.config)?void 0:n.label)??("Boolean"===t.type||"Separator"===t.type?void 0:t.fieldset)??t.type}function ZQ(t,n){var r,i,o;return"Boolean"===t.type?(n?null==(r=t.config)?void 0:r.placeholder_true:null==(i=t.config)?void 0:i.placeholder_false)||"...":(null==(o=t.config)?void 0:o.placeholder)||"..."}function ZX(t){var n;let{content:r,field:i,id:o,readOnly:a,onContentChange:s}=t,l=(null==r?void 0:r.value)??(null==(n=i.config)?void 0:n.default_value)??!1;return M.jsxs(u.gN,{children:[M.jsx(u.fw,{name:"toggleOff"}),M.jsx(u.Qy,{htmlFor:o,children:ZJ(i)}),M.jsxs(u.JO,{children:[M.jsx(u.xu,{padding:4,alignItems:"center",children:M.jsx(u.xv,{children:ZQ(i,l)})}),M.jsx(u.rs,{id:o,sx:{alignSelf:"center",marginLeft:"auto",marginRight:12},checked:l,onCheckedChange(t){var n;a||s((n=t,{__TYPE__:"BooleanContent",value:n}))}})]})]})}function Z0(t){let{id:n,field:r,content:i,onContentChange:o}=t;return M.jsxs(u.gN,{children:[M.jsx(u.fw,{name:"colorLens"}),M.jsx(u.Qy,{id:n,children:ZJ(r)}),M.jsx(u.JO,{children:M.jsx(u.xu,{padding:{left:4},alignItems:"center",children:M.jsx(u.TC,{onValueChange(t){var n;return o((n=t,void 0===n?void 0:{__TYPE__:"FieldContent",type:"Color",value:n}))},value:null==i?void 0:i.value,"aria-labelledby":n,placeholder:ZQ(r)})})})]})}function Z1(t){let{id:n,readOnly:r,field:i,content:o,onContentChange:a}=t,s=null!=o&&o.value?(0,l._O)(o.value):void 0;return M.jsxs(u.gN,{children:[M.jsx(u.fw,{name:"dateRange"}),M.jsx(u.Qy,{id:n,children:ZJ(i)}),M.jsx(u.JO,{children:M.jsx(u.xu,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:M.jsx(u.Wr,{mode:"date","aria-labelledby":n,disabled:r,value:s,onValueChange:t=>a(function(t){if(t)return{__TYPE__:"FieldContent",type:"Date",value:function(t){let n=`${t.getFullYear()}`.padStart(4,"0"),r=`${t.getMonth()+1}`.padStart(2,"0"),i=`${t.getDate()}`.padStart(2,"0");return`${n}-${r}-${i}`}(t)}}(t))})})})]})}function Z2(t){return M.jsx(u.oi,{...t,padding:Z3})}let Z3={input:{inline:4},adornment:{inline:12}};function Z4(t){this.content=t}Z4.prototype={constructor:Z4,find:function(t){for(var n=0;n<this.content.length;n+=2)if(this.content[n]===t)return n;return -1},get:function(t){var n=this.find(t);return -1==n?void 0:this.content[n+1]},update:function(t,n,r){var i=r&&r!=t?this.remove(r):this,o=i.find(t),a=i.content.slice();return -1==o?a.push(r||t,n):(a[o+1]=n,r&&(a[o]=r)),new Z4(a)},remove:function(t){var n=this.find(t);if(-1==n)return this;var r=this.content.slice();return r.splice(n,2),new Z4(r)},addToStart:function(t,n){return new Z4([t,n].concat(this.remove(t).content))},addToEnd:function(t,n){var r=this.remove(t).content.slice();return r.push(t,n),new Z4(r)},addBefore:function(t,n,r){var i=this.remove(n),o=i.content.slice(),a=i.find(t);return o.splice(-1==a?o.length:a,0,n,r),new Z4(o)},forEach:function(t){for(var n=0;n<this.content.length;n+=2)t(this.content[n],this.content[n+1])},prepend:function(t){return(t=Z4.from(t)).size?new Z4(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=Z4.from(t)).size?new Z4(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var n=this;t=Z4.from(t);for(var r=0;r<t.content.length;r+=2)n=n.remove(t.content[r]);return n},toObject:function(){var t={};return this.forEach(function(n,r){t[n]=r}),t},get size(){return this.content.length>>1}},Z4.from=function(t){if(t instanceof Z4)return t;var n=[];if(t)for(var r in t)n.push(r,t[r]);return new Z4(n)};class Z5{constructor(t,n){if(this.content=t,this.size=n||0,null==n)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,n,r,i=0,o){for(let a=0,u=0;u<n;a++){let s=this.content[a],l=u+s.nodeSize;if(l>t&&!1!==r(s,i+u,o||null,a)&&s.content.size){let c=u+1;s.nodesBetween(Math.max(0,t-c),Math.min(s.content.size,n-c),r,i+c)}u=l}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,i){let o="",a=!0;return this.nodesBetween(t,n,(u,s)=>{u.isText?(o+=u.text.slice(Math.max(t,s)-s,n-s),a=!r):u.isLeaf?(i?o+="function"==typeof i?i(u):i:u.type.spec.leafText&&(o+=u.type.spec.leafText(u)),a=!r):!a&&u.isBlock&&(o+=r,a=!0)},0),o}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<t.content.length;o++)i.push(t.content[o]);return new Z5(i,this.size+t.size)}cut(t,n=this.size){if(0==t&&n==this.size)return this;let r=[],i=0;if(n>t)for(let o=0,a=0;a<n;o++){let u=this.content[o],s=a+u.nodeSize;s>t&&((a<t||s>n)&&(u=u.isText?u.cut(Math.max(0,t-a),Math.min(u.text.length,n-a)):u.cut(Math.max(0,t-a-1),Math.min(u.content.size,n-a-1))),r.push(u),i+=u.nodeSize),a=s}return new Z5(r,i)}cutByIndex(t,n){return t==n?Z5.empty:0==t&&n==this.content.length?this:new Z5(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 Z5(i,o)}addToStart(t){return new Z5([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new Z5(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let n=this.content[t];if(!n)throw RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];t(i,r,n),r+=i.nodeSize}}findDiffStart(t,n=0){return function t(n,r,i){for(let o=0;;o++){if(o==n.childCount||o==r.childCount)return n.childCount==r.childCount?null:i;let a=n.child(o),u=r.child(o);if(a==u){i+=a.nodeSize;continue}if(!a.sameMarkup(u))return i;if(a.isText&&a.text!=u.text){for(let s=0;a.text[s]==u.text[s];s++)i++;return i}if(a.content.size||u.content.size){let l=t(a.content,u.content,i+1);if(null!=l)return l}i+=a.nodeSize}}(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return function t(n,r,i,o){for(let a=n.childCount,u=r.childCount;;){if(0==a||0==u)return a==u?null:{a:i,b:o};let s=n.child(--a),l=r.child(--u),c=s.nodeSize;if(s==l){i-=c,o-=c;continue}if(!s.sameMarkup(l))return{a:i,b:o};if(s.isText&&s.text!=l.text){let d=0,f=Math.min(s.text.length,l.text.length);for(;d<f&&s.text[s.text.length-d-1]==l.text[l.text.length-d-1];)d++,i--,o--;return{a:i,b:o}}if(s.content.size||l.content.size){let p=t(s.content,l.content,i-1,o-1);if(p)return p}i-=c,o-=c}}(this,t,n,r)}findIndex(t,n=-1){if(0==t)return Z9(0,t);if(t==this.size)return Z9(this.content.length,t);if(t>this.size||t<0)throw RangeError(`Position ${t} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=i+this.child(r).nodeSize;if(o>=t)return o==t||n>0?Z9(r+1,o):Z9(r,i);i=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return Z5.empty;if(!Array.isArray(n))throw RangeError("Invalid input for Fragment.fromJSON");return new Z5(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return Z5.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 Z5(n||t,r)}static from(t){if(!t)return Z5.empty;if(t instanceof Z5)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new Z5([t],t.nodeSize);throw RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Z5.empty=new Z5([],0);let Z6={index:0,offset:0};function Z9(t,n){return Z6.index=t,Z6.offset=n,Z6}function Z8(t,n){if(t===n)return!0;if(!(t&&"object"==typeof t)||!(n&&"object"==typeof n))return!1;let r=Array.isArray(t);if(Array.isArray(n)!=r)return!1;if(r){if(t.length!=n.length)return!1;for(let i=0;i<t.length;i++)if(!Z8(t[i],n[i]))return!1}else{for(let o in t)if(!(o in n)||!Z8(t[o],n[o]))return!1;for(let a in n)if(!(a in t))return!1}return!0}let Z7=class t{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,r=!1;for(let i=0;i<t.length;i++){let o=t[i];if(this.eq(o))return t;if(this.type.excludes(o.type))n||(n=t.slice(0,i));else{if(o.type.excludes(this.type))return t;!r&&o.type.rank>this.type.rank&&(n||(n=t.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=t.slice()),r||n.push(this),n}removeFromSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&Z8(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw RangeError("Invalid input for Mark.fromJSON");let r=t.marks[n.type];if(!r)throw RangeError(`There is no mark type ${n.type} in this schema`);return r.create(n.attrs)}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].eq(n[r]))return!1;return!0}static setFrom(n){if(!n||Array.isArray(n)&&0==n.length)return t.none;if(n instanceof t)return[n];let r=n.slice();return r.sort((t,n)=>t.type.rank-n.type.rank),r}};Z7.none=[];class Ye extends Error{}class Yt{constructor(t,n,r){this.content=t,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=function t(n,r,i,o){let{index:a,offset:u}=n.findIndex(r),s=n.maybeChild(a);if(u==r||s.isText)return o&&!o.canReplace(a,a,i)?null:n.cut(0,r).append(i).append(n.cut(r));let l=t(s.content,r-u-1,i);return l&&n.replaceChild(a,s.copy(l))}(this.content,t+this.openStart,n);return r&&new Yt(r,this.openStart,this.openEnd)}removeBetween(t,n){return new Yt(function t(n,r,i){let{index:o,offset:a}=n.findIndex(r),u=n.maybeChild(o),{index:s,offset:l}=n.findIndex(i);if(a==r||u.isText){if(l!=i&&!n.child(s).isText)throw RangeError("Removing non-flat range");return n.cut(0,r).append(n.cut(i))}if(o!=s)throw RangeError("Removing non-flat range");return n.replaceChild(o,u.copy(t(u.content,r-a-1,i-a-1)))}(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return Yt.empty;let r=n.openStart||0,i=n.openEnd||0;if("number"!=typeof r||"number"!=typeof i)throw RangeError("Invalid input for Slice.fromJSON");return new Yt(Z5.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let o=t.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let a=t.lastChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.lastChild)i++;return new Yt(t,r,i)}}function Yn(t,n){if(!n.type.compatibleContent(t.type))throw new Ye("Cannot join "+n.type.name+" onto "+t.type.name)}function Yr(t,n,r){let i=t.node(r);return Yn(i,n.node(r)),i}function Yi(t,n){let r=n.length-1;r>=0&&t.isText&&t.sameMarkup(n[r])?n[r]=t.withText(n[r].text+t.text):n.push(t)}function Yo(t,n,r,i){let o=(n||t).node(r),a=0,u=n?n.index(r):o.childCount;t&&(a=t.index(r),t.depth>r?a++:t.textOffset&&(Yi(t.nodeAfter,i),a++));for(let s=a;s<u;s++)Yi(o.child(s),i);n&&n.depth==r&&n.textOffset&&Yi(n.nodeBefore,i)}function Ya(t,n){return t.type.checkContent(n),t.copy(n)}function Yu(t,n,r){let i=[];return Yo(null,t,r,i),t.depth>r&&Yi(Ya(Yr(t,n,r+1),Yu(t,n,r+1)),i),Yo(n,null,r,i),new Z5(i)}Yt.empty=new Yt(Z5.empty,0,0);class Ys{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return null==t?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[3*this.resolveDepth(t)]}index(t){return this.path[3*this.resolveDepth(t)+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)}start(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(!(t=this.resolveDepth(t)))throw RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]}after(t){if(!(t=this.resolveDepth(t)))throw RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=t.child(n);return r?t.child(n).cut(r):i}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):0==t?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[3*n],i=0==n?0:this.path[3*n-1]+1;for(let o=0;o<t;o++)i+=r.child(o).nodeSize;return i}marks(){let t=this.parent,n=this.index();if(0==t.content.size)return Z7.none;if(this.textOffset)return t.child(n).marks;let r=t.maybeChild(n-1),i=t.maybeChild(n);if(!r){let o=r;r=i,i=o}let a=r.marks;for(var u=0;u<a.length;u++)!1!==a[u].type.spec.inclusive||i&&a[u].isInSet(i.marks)||(a=a[u--].removeFromSet(a));return a}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=t.parent.maybeChild(t.index());for(var o=0;o<r.length;o++)!1!==r[o].type.spec.inclusive||i&&r[o].isInSet(i.marks)||(r=r[o--].removeFromSet(r));return r}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);r>=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new Yf(this,t,r);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let a=t;;){let{index:u,offset:s}=a.content.findIndex(o),l=o-s;if(r.push(a,u,i+s),!l||(a=a.child(u)).isText)break;o=l-1,i+=s+1}return new Ys(n,r,o)}static resolveCached(t,n){for(let r=0;r<Yl.length;r++){let i=Yl[r];if(i.pos==n&&i.doc==t)return i}let o=Yl[Yc]=Ys.resolve(t,n);return Yc=(Yc+1)%Yd,o}}let Yl=[],Yc=0,Yd=12;class Yf{constructor(t,n,r){this.$from=t,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}let Yp=Object.create(null),Yh=class t{constructor(t,n,r,i=Z7.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||Z5.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&&Z8(this.attrs,n||t.defaultAttrs||Yp)&&Z7.sameSet(this.marks,r||Z7.none)}copy(n=null){return n==this.content?this:new t(this.type,this.attrs,n,this.marks)}mark(n){return n==this.marks?this:new t(this.type,this.attrs,this.content,n)}cut(t,n=this.content.size){return 0==t&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,r=!1){if(t==n)return Yt.empty;let i=this.resolve(t),o=this.resolve(n),a=r?0:i.sharedDepth(n),u=i.start(a),s=i.node(a).content.cut(i.pos-u,o.pos-u);return new Yt(s,i.depth-a,o.depth-a)}replace(t,n,r){return function(t,n,r){if(r.openStart>t.depth)throw new Ye("Inserted content deeper than insertion position");if(t.depth-r.openStart!=n.depth-r.openEnd)throw new Ye("Inconsistent open depths");return function t(n,r,i,o){let a=n.index(o),u=n.node(o);if(a==r.index(o)&&o<n.depth-i.openStart){let s=t(n,r,i,o+1);return u.copy(u.content.replaceChild(a,s))}if(!i.content.size)return Ya(u,Yu(n,r,o));if(i.openStart||i.openEnd||n.depth!=o||r.depth!=o){let{start:l,end:c}=function(t,n){let r=n.depth-t.openStart,i=n.node(r).copy(t.content);for(let o=r-1;o>=0;o--)i=n.node(o).copy(Z5.from(i));return{start:i.resolveNoCache(t.openStart+r),end:i.resolveNoCache(i.content.size-t.openEnd-r)}}(i,n);return Ya(u,function t(n,r,i,o,a){let u=n.depth>a&&Yr(n,r,a+1),s=o.depth>a&&Yr(i,o,a+1),l=[];return Yo(null,n,a,l),u&&s&&r.index(a)==i.index(a)?(Yn(u,s),Yi(Ya(u,t(n,r,i,o,a+1)),l)):(u&&Yi(Ya(u,Yu(n,r,a+1)),l),Yo(r,i,a,l),s&&Yi(Ya(s,Yu(i,o,a+1)),l)),Yo(o,null,a,l),new Z5(l)}(n,l,c,r,o))}{let d=n.parent,f=d.content;return Ya(d,f.cut(0,n.parentOffset).append(i.content).append(f.cut(r.parentOffset)))}}(t,n,r,0)}(this.resolve(t),this.resolve(n),r)}nodeAt(t){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(t);if(!(n=n.maybeChild(r)))return null;if(i==t||n.isText)return n;t-=i+1}}childAfter(t){let{index:n,offset:r}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(t){if(0==t)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(t);if(r<t)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(t){return Ys.resolveCached(this,t)}resolveNoCache(t){return Ys.resolve(this,t)}rangeHasMark(t,n,r){let i=!1;return n>t&&this.nodesBetween(t,n,t=>(r.isInSet(t.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),Yg(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=Z5.empty,i=0,o=r.childCount){let a=this.contentMatchAt(t).matchFragment(r,i,o),u=a&&a.matchFragment(this.content,n);if(!u||!u.validEnd)return!1;for(let s=i;s<o;s++)if(!this.type.allowsMarks(r.child(s).marks))return!1;return!0}canReplaceWith(t,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(t).matchType(r),a=o&&o.matchFragment(this.content,n);return!!a&&a.validEnd}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content);let t=Z7.none;for(let n=0;n<this.marks.length;n++)t=this.marks[n].addToSet(t);if(!Z7.sameSet(t,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(t=>t.toJSON())),t}static fromJSON(t,n){if(!n)throw RangeError("Invalid input for Node.fromJSON");let r=null;if(n.marks){if(!Array.isArray(n.marks))throw RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if("text"==n.type){if("string"!=typeof n.text)throw RangeError("Invalid text node in JSON");return t.text(n.text,r)}let i=Z5.fromJSON(t,n.content);return t.nodeType(n.type).create(n.attrs,i,r)}};Yh.prototype.text=void 0;class Ym extends Yh{constructor(t,n,r,i){if(super(t,n,null,i),!r)throw RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Yg(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 Ym(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Ym(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return 0==t&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function Yg(t,n){for(let r=t.length-1;r>=0;r--)n=t[r].type.name+"("+n+")";return n}class Yy{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){var r;let i=new Yv(t,n);if(null==i.next)return Yy.empty;let o=Yb(i);i.next&&i.err("Unexpected trailing text");let a,u=(r=function(t){let n=[[]];return o(a(t,0),r()),n;function r(){return n.push([])-1}function i(t,r,i){let o={term:i,to:r};return n[t].push(o),o}function o(t,n){t.forEach(t=>t.to=n)}function a(t,n){if("choice"==t.type)return t.exprs.reduce((t,r)=>t.concat(a(r,n)),[]);if("seq"==t.type)for(let u=0;;u++){let s=a(t.exprs[u],n);if(u==t.exprs.length-1)return s;o(s,n=r())}else if("star"==t.type){let l=r();return i(n,l),o(a(t.expr,l),l),[i(l)]}else if("plus"==t.type){let c=r();return o(a(t.expr,n),c),o(a(t.expr,c),c),[i(c)]}else{if("opt"==t.type)return[i(n)].concat(a(t.expr,n));if("range"==t.type){let d=n;for(let f=0;f<t.min;f++){let p=r();o(a(t.expr,d),p),d=p}if(-1==t.max)o(a(t.expr,d),d);else for(let h=t.min;h<t.max;h++){let m=r();i(d,m),o(a(t.expr,d),m),d=m}return[i(d)]}if("name"==t.type)return[i(n,void 0,t.value)];throw Error("Unknown expr type")}}}(o),a=Object.create(null),function t(n){let i=[];n.forEach(t=>{r[t].forEach(({term:t,to:n})=>{if(!t)return;let o;for(let a=0;a<i.length;a++)i[a][0]==t&&(o=i[a][1]);Yk(r,n).forEach(n=>{o||i.push([t,o=[]]),-1==o.indexOf(n)&&o.push(n)})})});let o=a[n.join(",")]=new Yy(n.indexOf(r.length-1)>-1);for(let u=0;u<i.length;u++){let s=i[u][1].sort(YO);o.next.push({type:i[u][0],next:a[s.join(",")]||t(s)})}return o}(Yk(r,0)));return function(t,n){for(let r=0,i=[t];r<i.length;r++){let o=i[r],a=!o.validEnd,u=[];for(let s=0;s<o.next.length;s++){let{type:l,next:c}=o.next[s];u.push(l.name),a&&!(l.isText||l.hasRequiredAttrs())&&(a=!1),-1==i.indexOf(c)&&i.push(c)}a&&n.err("Only non-generatable nodes ("+u.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(u,i),u}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,r=t.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(t.child(o).type);return i}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let r=0;r<t.next.length;r++)if(this.next[n].type==t.next[r].type)return!0;return!1}fillBefore(t,n=!1,r=0){let i=[this];return function o(a,u){let s=a.matchFragment(t,r);if(s&&(!n||s.validEnd))return Z5.from(u.map(t=>t.createAndFill()));for(let l=0;l<a.next.length;l++){let{type:c,next:d}=a.next[l];if(!(c.isText||c.hasRequiredAttrs())&&-1==i.indexOf(d)){i.push(d);let f=o(d,u.concat(c));if(f)return f}}return null}(this,[])}findWrapping(t){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==t)return this.wrapCache[n+1];let r=this.computeWrapping(t);return this.wrapCache.push(t,r),r}computeWrapping(t){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(t)){let a=[];for(let u=i;u.type;u=u.via)a.push(u.type);return a.reverse()}for(let s=0;s<o.next.length;s++){let{type:l,next:c}=o.next[s];l.isLeaf||l.hasRequiredAttrs()||l.name in n||i.type&&!c.validEnd||(r.push({match:l.contentMatch,type:l,via:i}),n[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];return function n(r){t.push(r);for(let i=0;i<r.next.length;i++)-1==t.indexOf(r.next[i].next)&&n(r.next[i].next)}(this),t.map((n,r)=>{let i=r+(n.validEnd?"*":" ")+" ";for(let o=0;o<n.next.length;o++)i+=(o?", ":"")+n.next[o].type.name+"->"+t.indexOf(n.next[o].next);return i}).join(`
|
|
6
|
-
`)}}Yy.empty=new Yy(!0);class Yv{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw SyntaxError(t+" (in content expression '"+this.string+"')")}}function Yb(t){let n=[];do n.push(Yx(t));while(t.eat("|"));return 1==n.length?n[0]:{type:"choice",exprs:n}}function Yx(t){let n=[];do n.push(Y_(t));while(t.next&&")"!=t.next&&"|"!=t.next);return 1==n.length?n[0]:{type:"seq",exprs:n}}function Y_(t){let n=Yw(t);for(;;)if(t.eat("+"))n={type:"plus",expr:n};else if(t.eat("*"))n={type:"star",expr:n};else if(t.eat("?"))n={type:"opt",expr:n};else if(t.eat("{"))n=YT(t,n);else break;return n}function YS(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let n=Number(t.next);return t.pos++,n}function YT(t,n){let r=YS(t),i=r;return t.eat(",")&&(i="}"!=t.next?YS(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:r,max:i,expr:n}}function Yw(t){if(t.eat("(")){let n=Yb(t);return t.eat(")")||t.err("Missing closing paren"),n}if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let r=(function(t,n){let r=t.nodeTypes,i=r[n];if(i)return[i];let o=[];for(let a in r){let u=r[a];u.groups.indexOf(n)>-1&&o.push(u)}return 0==o.length&&t.err("No node type or group '"+n+"' found"),o})(t,t.next).map(n=>(null==t.inline?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,1==r.length?r[0]:{type:"choice",exprs:r}}}function YO(t,n){return n-t}function Yk(t,n){let r=[];return function n(i){let o=t[i];if(1==o.length&&!o[0].term)return n(o[0].to);r.push(i);for(let a=0;a<o.length;a++){let{term:u,to:s}=o[a];u||-1!=r.indexOf(s)||n(s)}}(n),r.sort(YO)}function YC(t){let n=Object.create(null);for(let r in t){let i=t[r];if(!i.hasDefault)return null;n[r]=i.default}return n}function YI(t,n){let r=Object.create(null);for(let i in t){let o=n&&n[i];if(void 0===o){let a=t[i];if(a.hasDefault)o=a.default;else throw RangeError("No value supplied for attribute "+i)}r[i]=o}return r}function YM(t){let n=Object.create(null);if(t)for(let r in t)n[r]=new YE(t[r]);return n}let YR=class t{constructor(t,n,r){this.name=t,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=YM(r.attrs),this.defaultAttrs=YC(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||"text"==t),this.isText="text"==t}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Yy.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:YI(this.attrs,t)}create(t=null,n,r){if(this.isText)throw Error("NodeType.create can't construct text nodes");return new Yh(this,this.computeAttrs(t),Z5.from(n),Z7.setFrom(r))}createChecked(t=null,n,r){return n=Z5.from(n),this.checkContent(n),new Yh(this,this.computeAttrs(t),n,Z7.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),(n=Z5.from(n)).size){let i=this.contentMatch.fillBefore(n);if(!i)return null;n=i.append(n)}let o=this.contentMatch.matchFragment(n),a=o&&o.fillBefore(Z5.empty,!0);return a?new Yh(this,t,n.append(a),Z7.setFrom(r)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let r=0;r<t.childCount;r++)if(!this.allowsMarks(t.child(r).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}allowsMarkType(t){return null==this.markSet||this.markSet.indexOf(t)>-1}allowsMarks(t){if(null==this.markSet)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(null==this.markSet)return t;let n;for(let r=0;r<t.length;r++)this.allowsMarkType(t[r].type)?n&&n.push(t[r]):n||(n=t.slice(0,r));return n?n.length?n:Z7.none:t}static compile(n,r){let i=Object.create(null);n.forEach((n,o)=>i[n]=new t(n,r,o));let o=r.spec.topNode||"doc";if(!i[o])throw RangeError("Schema is missing its top node type ('"+o+"')");if(!i.text)throw RangeError("Every schema needs a 'text' type");for(let a in i.text.attrs)throw RangeError("The text node type should not have attributes");return i}};class YE{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class Yj{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=YM(i.attrs),this.excluded=null;let o=YC(this.attrs);this.instance=o?new Z7(this,o):null}create(t=null){return!t&&this.instance?this.instance:new Z7(this,YI(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,o)=>r[t]=new Yj(t,i++,n,o)),r}removeFromSet(t){for(var n=0;n<t.length;n++)t[n].type==this&&(t=t.slice(0,n).concat(t.slice(n+1)),n--);return t}isInSet(t){for(let n=0;n<t.length;n++)if(t[n].type==this)return t[n]}excludes(t){return this.excluded.indexOf(t)>-1}}class YA{constructor(t){this.cached=Object.create(null);let n=this.spec={};for(let r in t)n[r]=t[r];n.nodes=Z4.from(t.nodes),n.marks=Z4.from(t.marks||{}),this.nodes=YR.compile(this.spec.nodes,this),this.marks=Yj.compile(this.spec.marks,this);let i=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw RangeError(o+" can not be both a node and a mark");let a=this.nodes[o],u=a.spec.content||"",s=a.spec.marks;a.contentMatch=i[u]||(i[u]=Yy.parse(u,this.nodes)),a.inlineContent=a.contentMatch.inlineContent,a.markSet="_"==s?null:s?YN(this,s.split(" ")):""!=s&&a.inlineContent?null:[]}for(let l in this.marks){let c=this.marks[l],d=c.spec.excludes;c.excluded=null==d?[c]:""==d?[]:YN(this,d.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,r,i){if("string"==typeof t)t=this.nodeType(t);else if(t instanceof YR){if(t.schema!=this)throw RangeError("Node type from different schema used ("+t.name+")")}else throw RangeError("Invalid node type: "+t);return t.createChecked(n,r,i)}text(t,n){let r=this.nodes.text;return new Ym(r,r.defaultAttrs,t,Z7.setFrom(n))}mark(t,n){return"string"==typeof t&&(t=this.marks[t]),t.create(n)}nodeFromJSON(t){return Yh.fromJSON(this,t)}markFromJSON(t){return Z7.fromJSON(this,t)}nodeType(t){let n=this.nodes[t];if(!n)throw RangeError("Unknown node type: "+t);return n}}function YN(t,n){let r=[];for(let i=0;i<n.length;i++){let o=n[i],a=t.marks[o],u=a;if(a)r.push(a);else for(let s in t.marks){let l=t.marks[s];("_"==o||l.spec.group&&l.spec.group.split(" ").indexOf(o)>-1)&&r.push(u=l)}if(!u)throw SyntaxError("Unknown mark type: '"+n[i]+"'")}return r}class YP{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[],n.forEach(t=>{t.tag?this.tags.push(t):t.style&&this.styles.push(t)}),this.normalizeLists=!this.tags.some(n=>{if(!/^(ul|ol)\b/.test(n.tag)||!n.node)return!1;let r=t.nodes[n.node];return r.contentMatch.matchType(r)})}parse(t,n={}){let r=new Yz(this,n,!1);return r.addAll(t,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new Yz(this,n,!0);return r.addAll(t,n.from,n.to),Yt.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(YB(t,o.tag)&&(void 0===o.namespace||t.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let a=o.getAttrs(t);if(!1===a)continue;o.attrs=a||void 0}return o}}}matchStyle(t,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let a=this.styles[o],u=a.style;if(!(0!=u.indexOf(t)||a.context&&!r.matchesContext(a.context)||u.length>t.length&&(61!=u.charCodeAt(t.length)||u.slice(t.length+1)!=n))){if(a.getAttrs){let s=a.getAttrs(n);if(!1===s)continue;a.attrs=s||void 0}return a}}}static schemaRules(t){let n=[];function r(t){let r=null==t.priority?50:t.priority,i=0;for(;i<n.length;i++){let o=n[i];if((null==o.priority?50:o.priority)<r)break}n.splice(i,0,t)}for(let i in t.marks){let o=t.marks[i].spec.parseDOM;o&&o.forEach(t=>{r(t=YV(t)),t.mark||t.ignore||t.clearMark||(t.mark=i)})}for(let a in t.nodes){let u=t.nodes[a].spec.parseDOM;u&&u.forEach(t=>{r(t=YV(t)),t.node||t.ignore||t.mark||(t.node=a)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new YP(t,YP.schemaRules(t)))}}let YL={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},YD={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},YF={ol:!0,ul:!0};function YW(t,n,r){return null!=n?(n?1:0)|("full"===n?2:0):t&&"pre"==t.whitespace?3:-5&r}class YU{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=Z7.none,this.stashMarks=[],this.match=a||(4&u?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(Z5.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(t.type))?(this.match=r,i):null}}return this.match.findWrapping(t.type)}finish(t){if(!(1&this.options)){let n=this.content[this.content.length-1],r;n&&n.isText&&(r=/[ \t\r\n\u000c]+$/.exec(n.text))&&(n.text.length==r[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-r[0].length)))}let i=Z5.from(this.content);return!t&&this.match&&(i=i.append(this.match.fillBefore(Z5.empty,!0))),this.type?this.type.create(this.attrs,i,this.marks):i}popFromStashMark(t){for(let n=this.stashMarks.length-1;n>=0;n--)if(t.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(t){for(let n=0,r=this.pendingMarks;n<r.length;n++){let i=r[n];(this.type?this.type.allowsMarkType(i.type):Y$(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&&!YL.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class Yz{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0;let i=n.topNode,o,a=YW(null,n.preserveWhitespace,0)|(r?4:0);o=i?new YU(i.type,i.attrs,Z7.none,Z7.none,!0,n.topMatch||i.type.contentMatch,a):r?new YU(null,null,Z7.none,Z7.none,!0,null,a):new YU(t.schema.topNodeType,null,Z7.none,Z7.none,!0,null,a),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t){if(3==t.nodeType)this.addTextNode(t);else if(1==t.nodeType){let n=t.getAttribute("style");if(n){let r=this.readStyles(function(t){let n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r,i=[];for(;r=n.exec(t);)i.push(r[1],r[2].trim());return i}(n));if(!r)return;let[i,o]=r,a=this.top;for(let u=0;u<o.length;u++)this.removePendingMark(o[u],a);for(let s=0;s<i.length;s++)this.addPendingMark(i[s]);this.addElement(t);for(let l=0;l<i.length;l++)this.removePendingMark(i[l],a);for(let c=0;c<o.length;c++)this.addPendingMark(o[c])}else this.addElement(t)}}addTextNode(t){let n=t.nodeValue,r=this.top;if(2&r.options||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(1&r.options)n=2&r.options?n.replace(/\r\n?/g,`
|
|
7
|
-
`):n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let i=r.content[r.content.length-1],o=t.previousSibling;(!i||o&&"BR"==o.nodeName||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n)),this.findInText(t)}else this.findInside(t)}addElement(t,n){let r=t.nodeName.toLowerCase(),i;YF.hasOwnProperty(r)&&this.parser.normalizeLists&&function(t){for(let n=t.firstChild,r=null;n;n=n.nextSibling){let i=1==n.nodeType?n.nodeName.toLowerCase():null;i&&YF.hasOwnProperty(i)&&r?(r.appendChild(n),n=r):"li"==i?r=n:i&&(r=null)}}(t);let o=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(i=this.parser.matchTag(t,this,n));if(o?o.ignore:YD.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(YL.hasOwnProperty(r))u.content.length&&u.content[0].isInline&&this.open&&(this.open--,u=this.top),a=!0,u.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t);return}this.addAll(t),a&&this.sync(u),this.needsBlock=s}else this.addElementByRule(t,o,!1===o.consuming?i:void 0)}leafFallback(t){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
|
|
8
|
-
`))}ignoreFallback(t){"BR"!=t.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(t){let n=Z7.none,r=Z7.none;e:for(let i=0;i<t.length;i+=2)for(let o;;){let a=this.parser.matchStyle(t[i],t[i+1],this,o);if(!a)continue e;if(a.ignore)return null;if(a.clearMark?this.top.pendingMarks.forEach(t=>{a.clearMark(t)&&(r=t.addToSet(r))}):n=this.parser.schema.marks[a.mark].create(a.attrs).addToSet(n),!1===a.consuming)o=a;else break}return[n,r]}addElementByRule(t,n,r){let i,o,a;n.node?(o=this.parser.schema.nodes[n.node]).isLeaf?this.insertNode(o.create(n.attrs))||this.leafFallback(t):i=this.enter(o,n.attrs||null,n.preserveWhitespace):(a=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(a));let u=this.top;if(o&&o.isLeaf)this.findInside(t);else if(r)this.addElement(t,r);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(t=>this.insertNode(t));else{let s=t;"string"==typeof n.contentElement?s=t.querySelector(n.contentElement):"function"==typeof n.contentElement?s=n.contentElement(t):n.contentElement&&(s=n.contentElement),this.findAround(t,s,!0),this.addAll(s)}i&&this.sync(u)&&this.open--,a&&this.removePendingMark(a,u)}addAll(t,n,r){let i=n||0;for(let o=n?t.childNodes[n]:t.firstChild,a=null==r?null:t.childNodes[r];o!=a;o=o.nextSibling,++i)this.findAtPoint(t,i),this.addDOM(o);this.findAtPoint(t,i)}findPlace(t){let n,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],a=o.findWrapping(t);if(a&&(!n||n.length>a.length)&&(n=a,r=o,!a.length)||o.solid)break}if(!n)return!1;this.sync(r);for(let u=0;u<n.length;u++)this.enterInner(n[u],null,!1);return!0}insertNode(t){if(t.isInline&&this.needsBlock&&!this.top.type){let n=this.textblockFromContext();n&&this.enterInner(n)}if(this.findPlace(t)){this.closeExtra();let r=this.top;r.applyPending(t.type),r.match&&(r.match=r.match.matchType(t.type));let i=r.activeMarks;for(let o=0;o<t.marks.length;o++)(!r.type||r.type.allowsMarkType(t.marks[o].type))&&(i=t.marks[o].addToSet(i));return r.content.push(t.mark(i)),!0}return!1}enter(t,n,r){let i=this.findPlace(t.create(n));return i&&this.enterInner(t,n,!0,r),i}enterInner(t,n=null,r=!1,i){this.closeExtra();let o=this.top;o.applyPending(t),o.match=o.match&&o.match.matchType(t);let a=YW(t,i,o.options);4&o.options&&0==o.content.length&&(a|=4),this.nodes.push(new YU(t,n,o.activeMarks,o.pendingMarks,r,null,a)),this.open++}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(t){for(let n=this.open;n>=0;n--)if(this.nodes[n]==t)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)t+=r[i].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==t&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)null==this.find[n].pos&&1==t.nodeType&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,r){if(t!=n&&this.find)for(let i=0;i<this.find.length;i++)null==this.find[i].pos&&1==t.nodeType&&t.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),a=(t,u)=>{for(;t>=0;t--){let s=n[t];if(""==s){if(t==n.length-1||0==t)continue;for(;u>=o;u--)if(a(t-1,u))return!0;return!1}{let l=u>0||0==u&&i?this.nodes[u].type:r&&u>=o?r.node(u-o).type:null;if(!l||l.name!=s&&-1==l.groups.indexOf(s))return!1;u--}}return!0};return a(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let i in this.parser.schema.nodes){let o=this.parser.schema.nodes[i];if(o.isTextblock&&o.defaultAttrs)return o}}addPendingMark(t){let n=function(t,n){for(let r=0;r<n.length;r++)if(t.eq(n[r]))return n[r]}(t,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)}removePendingMark(t,n){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(t)>-1)i.pendingMarks=t.removeFromSet(i.pendingMarks);else{i.activeMarks=t.removeFromSet(i.activeMarks);let o=i.popFromStashMark(t);o&&i.type&&i.type.allowsMarkType(o.type)&&(i.activeMarks=o.addToSet(i.activeMarks))}if(i==n)break}}}function YB(t,n){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,n)}function YV(t){let n={};for(let r in t)n[r]=t[r];return n}function Y$(t,n){let r=n.schema.nodes;for(let i in r){let o=r[i];if(!o.allowsMarkType(t))continue;let a=[],u=t=>{a.push(t);for(let r=0;r<t.edgeCount;r++){let{type:i,next:o}=t.edge(r);if(i==n||0>a.indexOf(o)&&u(o))return!0}};if(u(o.contentMatch))return!0}}class Yq{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=YH(n).createDocumentFragment());let i=r,o=[];return t.forEach(t=>{if(o.length||t.marks.length){let r=0,a=0;for(;r<o.length&&a<t.marks.length;){let u=t.marks[a];if(!this.marks[u.type.name]){a++;continue}if(!u.eq(o[r][0])||!1===u.type.spec.spanning)break;r++,a++}for(;r<o.length;)i=o.pop()[1];for(;a<t.marks.length;){let s=t.marks[a++],l=this.serializeMark(s,t.isInline,n);l&&(o.push([s,i]),i.appendChild(l.dom),i=l.contentDOM||l.dom)}}i.appendChild(this.serializeNodeInner(t,n))}),r}serializeNodeInner(t,n){let{dom:r,contentDOM:i}=Yq.renderSpec(YH(n),this.nodes[t.type.name](t));if(i){if(t.isLeaf)throw RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,i)}return r}serializeNode(t,n={}){let r=this.serializeNodeInner(t,n);for(let i=t.marks.length-1;i>=0;i--){let o=this.serializeMark(t.marks[i],t.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(t,n,r={}){let i=this.marks[t.type.name];return i&&Yq.renderSpec(YH(r),i(t,n))}static renderSpec(t,n,r=null){if("string"==typeof n)return{dom:t.createTextNode(n)};if(null!=n.nodeType)return{dom:n};if(n.dom&&null!=n.dom.nodeType)return n;let i=n[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let a,u=r?t.createElementNS(r,i):t.createElement(i),s=n[1],l=1;if(s&&"object"==typeof s&&null==s.nodeType&&!Array.isArray(s)){for(let c in l=2,s)if(null!=s[c]){let d=c.indexOf(" ");d>0?u.setAttributeNS(c.slice(0,d),c.slice(d+1),s[c]):u.setAttribute(c,s[c])}}for(let f=l;f<n.length;f++){let p=n[f];if(0===p){if(f<n.length-1||f>l)throw RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}{let{dom:h,contentDOM:m}=Yq.renderSpec(t,p,r);if(u.appendChild(h),m){if(a)throw RangeError("Multiple content holes");a=m}}}return{dom:u,contentDOM:a}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Yq(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=YK(t.nodes);return n.text||(n.text=t=>t.text),n}static marksFromSchema(t){return YK(t.marks)}}function YK(t){let n={};for(let r in t){let i=t[r].spec.toDOM;i&&(n[r]=i)}return n}function YH(t){return t.document||window.document}function YG(t,n){return t+65536*n}function YZ(t){return 65535&t}class YY{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class YJ{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&YJ.empty)return YJ.empty}recover(t){var n;let r=0,i=YZ(t);if(!this.inverted)for(let o=0;o<i;o++)r+=this.ranges[3*o+2]-this.ranges[3*o+1];return this.ranges[3*i]+r+(t-(65535&t))/65536}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let i=0,o=this.inverted?2:1,a=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let s=this.ranges[u]-(this.inverted?i:0);if(s>t)break;let l=this.ranges[u+o],c=this.ranges[u+a],d=s+l;if(t<=d){let f=l?t==s?-1:t==d?1:n:n,p=s+i+(f<0?0:c);if(r)return p;let h=t==(n<0?s:d)?null:YG(u/3,t-s),m=t==s?2:t==d?1:4;return(n<0?t!=s:t!=d)&&(m|=8),new YY(p,m,h)}i+=c-l}return r?t+i:new YY(t+i,0,null)}touches(t,n){let r=0,i=YZ(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 l=this.ranges[u+o];if(t<=s+l&&u==3*i)return!0;r+=this.ranges[u+a]-l}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),l=this.ranges[i+n],c=this.ranges[i+r];t(u,u+l,s,s+c),o+=c-l}}invert(){return new YJ(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?YJ.empty:new YJ(t<0?[0,-t,0]:[0,0,t])}}YJ.empty=new YJ([]);class YQ{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 YQ(this.maps,this.mirror,t,n)}copy(){return new YQ(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(t,n){this.to=this.maps.push(t),null!=n&&this.setMirror(this.maps.length-1,n)}appendMapping(t){for(let n=0,r=this.maps.length;n<t.maps.length;n++){let i=t.getMirror(n);this.appendMap(t.maps[n],null!=i&&i<n?r+i:void 0)}}getMirror(t){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==t)return this.mirror[n+(n%2?-1:1)]}}setMirror(t,n){this.mirror||(this.mirror=[]),this.mirror.push(t,n)}appendMappingInverted(t){for(let n=t.maps.length-1,r=this.maps.length+t.maps.length;n>=0;n--){let i=t.getMirror(n);this.appendMap(t.maps[n].invert(),null!=i&&i>n?r-i-1:void 0)}}invert(){let t=new YQ;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let r=this.from;r<this.to;r++)t=this.maps[r].map(t,n);return t}mapResult(t,n=1){return this._map(t,n,!1)}_map(t,n,r){let i=0;for(let o=this.from;o<this.to;o++){let a=this.maps[o].mapResult(t,n);if(null!=a.recover){let u=this.getMirror(o);if(null!=u&&u>o&&u<this.to){o=u,t=this.maps[u].recover(a.recover);continue}}i|=a.delInfo,t=a.pos}return r?t:new YY(t,i,null)}}let YX=Object.create(null);class Y0{getMap(){return YJ.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw RangeError("Invalid input for Step.fromJSON");let r=YX[n.stepType];if(!r)throw RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in YX)throw RangeError("Duplicate use of step JSON ID "+t);return YX[t]=n,n.prototype.jsonID=t,n}}class Y1{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Y1(t,null)}static fail(t){return new Y1(null,t)}static fromReplace(t,n,r,i){try{return Y1.ok(t.replace(n,r,i))}catch(o){if(o instanceof Ye)return Y1.fail(o.message);throw o}}}function Y2(t,n,r){let i=[];for(let o=0;o<t.childCount;o++){let a=t.child(o);a.content.size&&(a=a.copy(Y2(a.content,n,a))),a.isInline&&(a=n(a,r,o)),i.push(a)}return Z5.fromArray(i)}class Y3 extends Y0{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 Yt(Y2(n.content,(t,n)=>t.isAtom&&n.type.allowsMarkType(this.mark.type)?t.mark(this.mark.addToSet(t.marks)):t,i),n.openStart,n.openEnd);return Y1.fromReplace(t,this.from,this.to,o)}invert(){return new Y4(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 Y3(n.pos,r.pos,this.mark)}merge(t){return t instanceof Y3&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Y3(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw RangeError("Invalid input for AddMarkStep.fromJSON");return new Y3(n.from,n.to,t.markFromJSON(n.mark))}}Y0.jsonID("addMark",Y3);class Y4 extends Y0{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 Yt(Y2(n.content,t=>t.mark(this.mark.removeFromSet(t.marks)),t),n.openStart,n.openEnd);return Y1.fromReplace(t,this.from,this.to,r)}invert(){return new Y3(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 Y4(n.pos,r.pos,this.mark)}merge(t){return t instanceof Y4&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Y4(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Y4(n.from,n.to,t.markFromJSON(n.mark))}}Y0.jsonID("removeMark",Y4);class Y5 extends Y0{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Y1.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Y1.fromReplace(t,this.pos,this.pos+1,new Yt(Z5.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 Y5(this.pos,n.marks[i]);return new Y5(this.pos,this.mark)}}return new Y6(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Y5(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if("number"!=typeof n.pos)throw RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Y5(n.pos,t.markFromJSON(n.mark))}}Y0.jsonID("addNodeMark",Y5);class Y6 extends Y0{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Y1.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Y1.fromReplace(t,this.pos,this.pos+1,new Yt(Z5.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return n&&this.mark.isInSet(n.marks)?new Y5(this.pos,this.mark):this}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Y6(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if("number"!=typeof n.pos)throw RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Y6(n.pos,t.markFromJSON(n.mark))}}Y0.jsonID("removeNodeMark",Y6);class Y9 extends Y0{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&Y7(t,this.from,this.to)?Y1.fail("Structure replace would overwrite content"):Y1.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new YJ([this.from,this.to-this.from,this.slice.size])}invert(t){return new Y9(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 Y9(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof Y9)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;{let n=this.slice.size+t.slice.size==0?Yt.empty:new Yt(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new Y9(t.from,this.to,n,this.structure)}}{let r=this.slice.size+t.slice.size==0?Yt.empty:new Yt(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new Y9(this.from,this.to+(t.to-t.from),r,this.structure)}}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw RangeError("Invalid input for ReplaceStep.fromJSON");return new Y9(n.from,n.to,Yt.fromJSON(t,n.slice),!!n.structure)}}Y0.jsonID("replace",Y9);class Y8 extends Y0{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&&(Y7(t,this.from,this.gapFrom)||Y7(t,this.gapTo,this.to)))return Y1.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Y1.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Y1.fromReplace(t,this.from,this.to,r):Y1.fail("Content does not fit in gap")}getMap(){return new YJ([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 Y8(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 Y8(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Y8(n.from,n.to,n.gapFrom,n.gapTo,Yt.fromJSON(t,n.slice),n.insert,!!n.structure)}}function Y7(t,n,r){let i=t.resolve(n),o=r-n,a=i.depth;for(;o>0&&a>0&&i.indexAfter(a)==i.node(a).childCount;)a--,o--;if(o>0){let u=i.node(a).maybeChild(i.indexAfter(a));for(;o>0;){if(!u||u.isLeaf)return!0;u=u.firstChild,o--}}return!1}function Je(t,n,r){return(0==n||t.canReplace(n,t.childCount))&&(r==t.childCount||t.canReplace(0,r))}function Jt(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),o=t.$from.index(r),a=t.$to.indexAfter(r);if(r<t.depth&&i.canReplace(o,a,n))return r;if(0==r||i.type.spec.isolating||!Je(i,o,a))break}return null}function Jn(t,n,r=null,i=t){let o=function(t,n){let{parent:r,startIndex:i,endIndex:o}=t,a=r.contentMatchAt(i).findWrapping(n);if(!a)return null;let u=a.length?a[0]:n;return r.canReplaceWith(i,o,u)?a:null}(t,n),a=o&&function(t,n){let{parent:r,startIndex:i,endIndex:o}=t,a=r.child(i),u=n.contentMatch.findWrapping(a.type);if(!u)return null;let s=(u.length?u[u.length-1]:n).contentMatch;for(let l=i;s&&l<o;l++)s=s.matchType(r.child(l).type);return s&&s.validEnd?u:null}(i,n);return a?o.map(Jr).concat({type:n,attrs:r}).concat(a.map(Jr)):null}function Jr(t){return{type:t,attrs:null}}function Ji(t,n,r=1,i){let o=t.resolve(n),a=o.depth-r,u=i&&i[i.length-1]||o.parent;if(a<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!u.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let s=o.depth-1,l=r-2;s>a;s--,l--){let c=o.node(s),d=o.index(s);if(c.type.spec.isolating)return!1;let f=c.content.cutByIndex(d,c.childCount),p=i&&i[l+1];p&&(f=f.replaceChild(0,p.type.create(p.attrs)));let h=i&&i[l]||c;if(!c.canReplace(d+1,c.childCount)||!h.type.validContent(f))return!1}let m=o.indexAfter(a),g=i&&i[0];return o.node(a).canReplaceWith(m,m,g?g.type:o.node(a+1).type)}function Jo(t,n){let r=t.resolve(n),i=r.index();return Ja(r.nodeBefore,r.nodeAfter)&&r.parent.canReplace(i,i+1)}function Ja(t,n){return!!(t&&n&&!t.isLeaf&&t.canAppend(n))}function Ju(t,n,r=-1){let i=t.resolve(n);for(let o=i.depth;;o--){let a,u,s=i.index(o);if(o==i.depth?(a=i.nodeBefore,u=i.nodeAfter):r>0?(a=i.node(o+1),s++,u=i.node(o).maybeChild(s)):(a=i.node(o).maybeChild(s-1),u=i.node(o+1)),a&&!a.isTextblock&&Ja(a,u)&&i.node(o).canReplace(s,s+1))return n;if(0==o)break;n=r<0?i.before(o):i.after(o)}}function Js(t,n,r=n,i=Yt.empty){if(n==r&&!i.size)return null;let o=t.resolve(n),a=t.resolve(r);return Jl(o,a,i)?new Y9(n,r,i):new Jc(o,a,i).fit()}function Jl(t,n,r){return!r.openStart&&!r.openEnd&&t.start()==n.start()&&t.parent.canReplace(t.index(),n.index(),r.content)}Y0.jsonID("replaceAround",Y8);class Jc{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=Z5.empty;for(let i=0;i<=t.depth;i++){let o=t.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(t.indexAfter(i))})}for(let a=t.depth;a>0;a--)this.placed=Z5.from(t.node(a).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}let n=this.mustMoveInline(),r=this.placed.size-this.depth-this.$from.depth,i=this.$from,o=this.close(n<0?this.$to:i.doc.resolve(n));if(!o)return null;let a=this.placed,u=i.depth,s=o.depth;for(;u&&s&&1==a.childCount;)a=a.firstChild.content,u--,s--;let l=new Yt(a,u,s);return n>-1?new Y8(i.pos,n,this.$to.pos,this.$to.end(),l,r):l.size||i.pos!=this.$to.pos?new Y9(i.pos,o.pos,l):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<t;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){t=r;break}n=o.content}for(let a=1;a<=2;a++)for(let u=1==a?t:this.unplaced.openStart;u>=0;u--){let s,l=null,c=(u?(l=Jp(this.unplaced.content,u-1).firstChild).content:this.unplaced.content).firstChild;for(let d=this.depth;d>=0;d--){let{type:f,match:p}=this.frontier[d],h,m=null;if(1==a&&(c?p.matchType(c.type)||(m=p.fillBefore(Z5.from(c),!1)):l&&f.compatibleContent(l.type)))return{sliceDepth:u,frontierDepth:d,parent:l,inject:m};if(2==a&&c&&(h=p.findWrapping(c.type)))return{sliceDepth:u,frontierDepth:d,parent:l,wrap:h};if(l&&p.matchType(l.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=Jp(t,n);return!!i.childCount&&!i.firstChild.isLeaf&&(this.unplaced=new Yt(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=Jp(t,n);if(i.childCount<=1&&n>0){let o=t.size-n<=n+i.size;this.unplaced=new Yt(Jd(t,n-1,1),n-1,o?n-1:r)}else this.unplaced=new Yt(Jd(t,n,1),n,r)}placeNodes({sliceDepth:t,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let a=0;a<o.length;a++)this.openFrontierNode(o[a]);let u=this.unplaced,s=r?r.content:u.content,l=u.openStart-t,c=0,d=[],{match:f,type:p}=this.frontier[n];if(i){for(let h=0;h<i.childCount;h++)d.push(i.child(h));f=f.matchFragment(i)}let m=s.size+t-(u.content.size-u.openEnd);for(;c<s.childCount;){let g=s.child(c),y=f.matchType(g.type);if(!y)break;(++c>1||0==l||g.content.size)&&(f=y,d.push(Jh(g.mark(p.allowedMarks(g.marks)),1==c?l:0,c==s.childCount?m:-1)))}let v=c==s.childCount;v||(m=-1),this.placed=Jf(this.placed,n,Z5.from(d)),this.frontier[n].match=f,v&&m<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let b=0,x=s;b<m;b++){let _=x.lastChild;this.frontier.push({type:_.type,match:_.contentMatchAt(_.childCount)}),x=_.content}this.unplaced=v?0==t?Yt.empty:new Yt(Jd(u.content,t-1,1),t-1,m<0?u.openEnd:t-1):new Yt(Jd(u.content,t,c),u.openStart,u.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return -1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!Jm(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=Jm(t,n,i,r,o);if(a){for(let u=n-1;u>=0;u--){let{match:s,type:l}=this.frontier[u],c=Jm(t,u,l,s,!0);if(!c||c.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=Jf(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=Jf(this.placed,this.depth,Z5.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(Z5.empty,!0);t.childCount&&(this.placed=Jf(this.placed,this.frontier.length,t))}}function Jd(t,n,r){return 0==n?t.cutByIndex(r,t.childCount):t.replaceChild(0,t.firstChild.copy(Jd(t.firstChild.content,n-1,r)))}function Jf(t,n,r){return 0==n?t.append(r):t.replaceChild(t.childCount-1,t.lastChild.copy(Jf(t.lastChild.content,n-1,r)))}function Jp(t,n){for(let r=0;r<n;r++)t=t.firstChild.content;return t}function Jh(t,n,r){if(n<=0)return t;let i=t.content;return n>1&&(i=i.replaceChild(0,Jh(i.firstChild,n-1,1==i.childCount?r-1:0))),n>0&&(i=t.type.contentMatch.fillBefore(i).append(i),r<=0&&(i=i.append(t.type.contentMatch.matchFragment(i).fillBefore(Z5.empty,!0)))),t.copy(i)}function Jm(t,n,r,i,o){let a=t.node(n),u=o?t.indexAfter(n):t.index(n);if(u==a.childCount&&!r.compatibleContent(a.type))return null;let s=i.fillBefore(a.content,!0,u);return s&&!function(t,n,r){for(let i=r;i<n.childCount;i++)if(!t.allowsMarks(n.child(i).marks))return!0;return!1}(r,a.content,u)?s:null}function Jg(t){return t.spec.defining||t.spec.definingForContent}function Jy(t,n,r,i,o){if(n<r){let a=t.firstChild;t=t.replaceChild(0,a.copy(Jy(a.content,n+1,r,i,a)))}if(n>i){let u=o.contentMatchAt(0),s=u.fillBefore(t).append(t);t=s.append(u.matchFragment(s).fillBefore(Z5.empty,!0))}return t}function Jv(t,n){let r=[],i=Math.min(t.depth,n.depth);for(let o=i;o>=0;o--){let a=t.start(o);if(a<t.pos-(t.depth-o)||n.end(o)>n.pos+(n.depth-o)||t.node(o).type.spec.isolating||n.node(o).type.spec.isolating)break;(a==n.start(o)||o==t.depth&&o==n.depth&&t.parent.inlineContent&&n.parent.inlineContent&&o&&n.start(o-1)==a-1)&&r.push(o)}return r}class Jb extends Y0{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 Y1.fail("No node at attribute step's position");let r=Object.create(null);for(let i in n.attrs)r[i]=n.attrs[i];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return Y1.fromReplace(t,this.pos,this.pos+1,new Yt(Z5.from(o),0,n.isLeaf?0:1))}getMap(){return YJ.empty}invert(t){return new Jb(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 Jb(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if("number"!=typeof n.pos||"string"!=typeof n.attr)throw RangeError("Invalid input for AttrStep.fromJSON");return new Jb(n.pos,n.attr,n.value)}}Y0.jsonID("attr",Jb);let Jx=class extends Error{};(Jx=function t(n){let r=Error.call(this,n);return r.__proto__=t.prototype,r}).prototype=Object.create(Error.prototype),Jx.prototype.constructor=Jx,Jx.prototype.name="TransformError";class J_{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new YQ}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new Jx(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,r=Yt.empty){let i=Js(this.doc,t,n,r);return i&&this.step(i),this}replaceWith(t,n,r){return this.replace(t,n,new Yt(Z5.from(r),0,0))}delete(t,n){return this.replace(t,n,Yt.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,r){return function(t,n,r,i){if(!i.size)return t.deleteRange(n,r);let o=t.doc.resolve(n),a=t.doc.resolve(r);if(Jl(o,a,i))return t.step(new Y9(n,r,i));let u=Jv(o,t.doc.resolve(r));0==u[u.length-1]&&u.pop();let s=-(o.depth+1);u.unshift(s);for(let l=o.depth,c=o.pos-1;l>0;l--,c--){let d=o.node(l).type.spec;if(d.defining||d.definingAsContext||d.isolating)break;u.indexOf(l)>-1?s=l:o.before(l)==c&&u.splice(1,0,-l)}let f=u.indexOf(s),p=[],h=i.openStart;for(let m=i.content,g=0;;g++){let y=m.firstChild;if(p.push(y),g==i.openStart)break;m=y.content}for(let v=h-1;v>=0;v--){let b=p[v].type,x=Jg(b);if(x&&o.node(f).type!=b)h=v;else if(x||!b.isTextblock)break}for(let _=i.openStart;_>=0;_--){let S=(_+h+1)%(i.openStart+1),T=p[S];if(T)for(let w=0;w<u.length;w++){let O=u[(w+f)%u.length],k=!0;O<0&&(k=!1,O=-O);let C=o.node(O-1),I=o.index(O-1);if(C.canReplaceWith(I,I,T.type,T.marks))return t.replace(o.before(O),k?a.after(O):r,new Yt(Jy(i.content,0,i.openStart,S),S,i.openEnd))}}let M=t.steps.length;for(let R=u.length-1;R>=0&&(t.replace(n,r,i),!(t.steps.length>M));R--){let E=u[R];E<0||(n=o.before(E),r=a.after(E))}}(this,t,n,r),this}replaceRangeWith(t,n,r){return function(t,n,r,i){if(!i.isInline&&n==r&&t.doc.resolve(n).parent.content.size){let o=function(t,n,r){let i=t.resolve(n);if(i.parent.canReplaceWith(i.index(),i.index(),r))return n;if(0==i.parentOffset)for(let o=i.depth-1;o>=0;o--){let a=i.index(o);if(i.node(o).canReplaceWith(a,a,r))return i.before(o+1);if(a>0)return null}if(i.parentOffset==i.parent.content.size)for(let u=i.depth-1;u>=0;u--){let s=i.indexAfter(u);if(i.node(u).canReplaceWith(s,s,r))return i.after(u+1);if(s<i.node(u).childCount)break}return null}(t.doc,n,i.type);null!=o&&(n=r=o)}t.replaceRange(n,r,new Yt(Z5.from(i),0,0))}(this,t,n,r),this}deleteRange(t,n){return function(t,n,r){let i=t.doc.resolve(n),o=t.doc.resolve(r),a=Jv(i,o);for(let u=0;u<a.length;u++){let s=a[u],l=u==a.length-1;if(l&&0==s||i.node(s).type.contentMatch.validEnd)return t.delete(i.start(s),o.end(s));if(s>0&&(l||i.node(s-1).canReplace(i.index(s-1),o.indexAfter(s-1))))return t.delete(i.before(s),o.after(s))}for(let c=1;c<=i.depth&&c<=o.depth;c++)if(n-i.start(c)==i.depth-c&&r>i.end(c)&&o.end(c)-r!=o.depth-c)return t.delete(i.before(c),r);t.delete(n,r)}(this,t,n),this}lift(t,n){return function(t,n,r){let{$from:i,$to:o,depth:a}=n,u=i.before(a+1),s=o.after(a+1),l=u,c=s,d=Z5.empty,f=0;for(let p=a,h=!1;p>r;p--)h||i.index(p)>0?(h=!0,d=Z5.from(i.node(p).copy(d)),f++):l--;let m=Z5.empty,g=0;for(let y=a,v=!1;y>r;y--)v||o.after(y+1)<o.end(y)?(v=!0,m=Z5.from(o.node(y).copy(m)),g++):c++;t.step(new Y8(l,c,u,s,new Yt(d.append(m),f,g),d.size-f,!0))}(this,t,n),this}join(t,n=1){return function(t,n,r){let i=new Y9(n-r,n+r,Yt.empty,!0);t.step(i)}(this,t,n),this}wrap(t,n){return function(t,n,r){let i=Z5.empty;for(let o=r.length-1;o>=0;o--){if(i.size){let a=r[o].type.contentMatch.matchFragment(i);if(!a||!a.validEnd)throw RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=Z5.from(r[o].type.create(r[o].attrs,i))}let u=n.start,s=n.end;t.step(new Y8(u,s,u,s,new Yt(i,0,0),r.length,!0))}(this,t,n),this}setBlockType(t,n=t,r,i=null){return function(t,n,r,i,o){if(!i.isTextblock)throw RangeError("Type given to setBlockType should be a textblock");let a=t.steps.length;t.doc.nodesBetween(n,r,(n,r)=>{var u,s,l;let c,d;if(n.isTextblock&&!n.hasMarkup(i,o)&&(u=t.doc,s=t.mapping.slice(a).map(r),l=i,c=u.resolve(s),d=c.index(),c.parent.canReplaceWith(d,d+1,l))){t.clearIncompatible(t.mapping.slice(a).map(r,1),i);let f=t.mapping.slice(a),p=f.map(r,1),h=f.map(r+n.nodeSize,1);return t.step(new Y8(p,h,p+1,h-1,new Yt(Z5.from(i.create(o,null,n.marks)),0,0),1,!0)),!1}})}(this,t,n,r,i),this}setNodeMarkup(t,n,r=null,i){return function(t,n,r,i,o){let a=t.doc.nodeAt(n);if(!a)throw RangeError("No node at given position");r||(r=a.type);let u=r.create(i,null,o||a.marks);if(a.isLeaf)return t.replaceWith(n,n+a.nodeSize,u);if(!r.validContent(a.content))throw RangeError("Invalid content for node type "+r.name);t.step(new Y8(n,n+a.nodeSize,n+1,n+a.nodeSize-1,new Yt(Z5.from(u),0,0),1,!0))}(this,t,n,r,i),this}setNodeAttribute(t,n,r){return this.step(new Jb(t,n,r)),this}addNodeMark(t,n){return this.step(new Y5(t,n)),this}removeNodeMark(t,n){if(!(n instanceof Z7)){let r=this.doc.nodeAt(t);if(!r)throw RangeError("No node at position "+t);if(!(n=n.isInSet(r.marks)))return this}return this.step(new Y6(t,n)),this}split(t,n=1,r){return function(t,n,r=1,i){let o=t.doc.resolve(n),a=Z5.empty,u=Z5.empty;for(let s=o.depth,l=o.depth-r,c=r-1;s>l;s--,c--){a=Z5.from(o.node(s).copy(a));let d=i&&i[c];u=Z5.from(d?d.type.create(d.attrs,u):o.node(s).copy(u))}t.step(new Y9(n,n,new Yt(a.append(u),r,r),!0))}(this,t,n,r),this}addMark(t,n,r){var i,o,a,u;let s,l,c,d;return i=this,s=[],l=[],i.doc.nodesBetween(t,n,(i,o,a)=>{if(!i.isInline)return;let u=i.marks;if(!r.isInSet(u)&&a.type.allowsMarkType(r.type)){let f=Math.max(o,t),p=Math.min(o+i.nodeSize,n),h=r.addToSet(u);for(let m=0;m<u.length;m++)u[m].isInSet(h)||(c&&c.to==f&&c.mark.eq(u[m])?c.to=p:s.push(c=new Y4(f,p,u[m])));d&&d.to==f?d.to=p:l.push(d=new Y3(f,p,r))}}),s.forEach(t=>i.step(t)),l.forEach(t=>i.step(t)),this}removeMark(t,n,r){var i,o,a,u;let s,l;return i=this,s=[],l=0,i.doc.nodesBetween(t,n,(i,o)=>{if(!i.isInline)return;l++;let a=null;if(r instanceof Yj){let u=i.marks,c;for(;c=r.isInSet(u);)(a||(a=[])).push(c),u=c.removeFromSet(u)}else r?r.isInSet(i.marks)&&(a=[r]):a=i.marks;if(a&&a.length){let d=Math.min(o+i.nodeSize,n);for(let f=0;f<a.length;f++){let p=a[f],h;for(let m=0;m<s.length;m++){let g=s[m];g.step==l-1&&p.eq(s[m].style)&&(h=g)}h?(h.to=d,h.step=l):s.push({style:p,from:Math.max(o,t),to:d,step:l})}}}),s.forEach(t=>i.step(new Y4(t.from,t.to,t.style))),this}clearIncompatible(t,n,r){return function(t,n,r,i=r.contentMatch){let o=t.doc.nodeAt(n),a=[],u=n+1;for(let s=0;s<o.childCount;s++){let l=o.child(s),c=u+l.nodeSize,d=i.matchType(l.type);if(d){i=d;for(let f=0;f<l.marks.length;f++)r.allowsMarkType(l.marks[f].type)||t.step(new Y4(u,c,l.marks[f]))}else a.push(new Y9(u,c,Yt.empty));u=c}if(!i.validEnd){let p=i.fillBefore(Z5.empty,!0);t.replace(u,u,new Yt(p,0,0))}for(let h=a.length-1;h>=0;h--)t.step(a[h])}(this,t,n,r),this}}let JS=Object.create(null);class JT{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new Jw(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=Yt.empty){let r=n.content.lastChild,i=null;for(let o=0;o<n.openEnd;o++)i=r,r=r.lastChild;let a=t.steps.length,u=this.ranges;for(let s=0;s<u.length;s++){let{$from:l,$to:c}=u[s],d=t.mapping.slice(a);t.replaceRange(d.map(l.pos),d.map(c.pos),s?Yt.empty:n),0==s&&JN(t,a,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(t,n){let r=t.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:a,$to:u}=i[o],s=t.mapping.slice(r),l=s.map(a.pos),c=s.map(u.pos);o?t.deleteRange(l,c):(t.replaceRangeWith(l,c,n),JN(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let i=t.parent.inlineContent?new JC(t):JA(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?JA(t.node(0),t.node(o),t.before(o+1),t.index(o),n,r):JA(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 JE(t.node(0))}static atStart(t){return JA(t,t,0,0,1)||new JE(t)}static atEnd(t){return JA(t,t,t.content.size,t.childCount,-1)||new JE(t)}static fromJSON(t,n){if(!n||!n.type)throw RangeError("Invalid input for Selection.fromJSON");let r=JS[n.type];if(!r)throw RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in JS)throw RangeError("Duplicate use of selection JSON ID "+t);return JS[t]=n,n.prototype.jsonID=t,n}getBookmark(){return JC.between(this.$anchor,this.$head).getBookmark()}}JT.prototype.visible=!0;class Jw{constructor(t,n){this.$from=t,this.$to=n}}let JO=!1;function Jk(t){JO||t.parent.inlineContent||(JO=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class JC extends JT{constructor(t,n=t){Jk(t),Jk(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 JT.near(r);let i=t.resolve(n.map(this.anchor));return new JC(i.parent.inlineContent?i:r,r)}replace(t,n=Yt.empty){if(super.replace(t,n),n==Yt.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof JC&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new JI(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if("number"!=typeof n.anchor||"number"!=typeof n.head)throw RangeError("Invalid input for TextSelection.fromJSON");return new JC(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=JT.findFrom(n,r,!0)||JT.findFrom(n,-r,!0);if(!o)return JT.near(n,r);n=o.$head}return t.parent.inlineContent||(0==i?t=n:(t=(JT.findFrom(t,-r,!0)||JT.findFrom(t,r,!0)).$anchor).pos<n.pos!=i<0&&(t=n)),new JC(t,n)}}JT.jsonID("text",JC);class JI{constructor(t,n){this.anchor=t,this.head=n}map(t){return new JI(t.map(this.anchor),t.map(this.head))}resolve(t){return JC.between(t.resolve(this.anchor),t.resolve(this.head))}}class JM extends JT{constructor(t){let n=t.nodeAfter;super(t,t.node(0).resolve(t.pos+n.nodeSize)),this.node=n}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),o=t.resolve(i);return r?JT.near(o):new JM(o)}content(){return new Yt(Z5.from(this.node),0,0)}eq(t){return t instanceof JM&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new JR(this.anchor)}static fromJSON(t,n){if("number"!=typeof n.anchor)throw RangeError("Invalid input for NodeSelection.fromJSON");return new JM(t.resolve(n.anchor))}static create(t,n){return new JM(t.resolve(n))}static isSelectable(t){return!t.isText&&!1!==t.type.spec.selectable}}JM.prototype.visible=!1,JT.jsonID("node",JM);class JR{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new JI(r,r):new JR(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&JM.isSelectable(r)?new JM(n):JT.near(n)}}class JE extends JT{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=Yt.empty){if(n==Yt.empty){t.delete(0,t.doc.content.size);let r=JT.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new JE(t)}map(t){return new JE(t)}eq(t){return t instanceof JE}getBookmark(){return Jj}}JT.jsonID("all",JE);let Jj={map(){return this},resolve:t=>new JE(t)};function JA(t,n,r,i,o,a=!1){if(n.inlineContent)return JC.create(t,r);for(let u=i-(o>0?0:1);o>0?u<n.childCount:u>=0;u+=o){let s=n.child(u);if(s.isAtom){if(!a&&JM.isSelectable(s))return JM.create(t,r-(o<0?s.nodeSize:0))}else{let l=JA(t,s,r+o,o<0?s.childCount:0,o,a);if(l)return l}r+=s.nodeSize*o}return null}function JN(t,n,r){let i=t.steps.length-1;if(i<n)return;let o=t.steps[i];if(!(o instanceof Y9||o instanceof Y8))return;let a;t.mapping.maps[i].forEach((t,n,r,i)=>{null==a&&(a=i)}),t.setSelection(JT.near(t.doc.resolve(a),r))}class JP extends J_{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(t){if(t.$from.doc!=this.doc)throw RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(1|this.updated)&-3,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=2,this}ensureMarks(t){return Z7.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(t,n){super.addStep(t,n),this.updated=-3&this.updated,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let r=this.selection;return n&&(t=t.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Z7.none))),r.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,r){let i=this.doc.type.schema;if(null==n)return t?this.replaceSelectionWith(i.text(t),!0):this.deleteSelection();{if(null==r&&(r=n),r=r??n,!t)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let a=this.doc.resolve(n);o=r==n?a.marks():a.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(t,o)),this.selection.empty||this.setSelection(JT.near(this.selection.$to)),this}}setMeta(t,n){return this.meta["string"==typeof t?t:t.key]=n,this}getMeta(t){return this.meta["string"==typeof t?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function JL(t,n){return n&&t?t.bind(n):t}class JD{constructor(t,n,r){this.name=t,this.init=JL(n.init,r),this.apply=JL(n.apply,r)}}let JF=[new JD("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new JD("selection",{init:(t,n)=>t.selection||JT.atStart(n.doc),apply:t=>t.selection}),new JD("storedMarks",{init:t=>t.storedMarks||null,apply:(t,n,r,i)=>i.selection.$cursor?t.storedMarks:null}),new JD("scrollToSelection",{init:()=>0,apply:(t,n)=>t.scrolledIntoView?n+1:n})];class JW{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=JF.slice(),n&&n.forEach(t=>{if(this.pluginsByKey[t.key])throw RangeError("Adding different instances of a keyed plugin ("+t.key+")");this.plugins.push(t),this.pluginsByKey[t.key]=t,t.spec.state&&this.fields.push(new JD(t.key,t.spec.state,t))})}}class JU{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let n=[t],r=this.applyInner(t),i=null;for(;;){let o=!1;for(let a=0;a<this.config.plugins.length;a++){let u=this.config.plugins[a];if(u.spec.appendTransaction){let s=i?i[a].n:0,l=i?i[a].state:this,c=s<n.length&&u.spec.appendTransaction.call(u,s?n.slice(s):n,l,r);if(c&&r.filterTransaction(c,a)){if(c.setMeta("appendedTransaction",t),!i){i=[];for(let d=0;d<this.config.plugins.length;d++)i.push(d<a?{state:r,n:n.length}:{state:this,n:0})}n.push(c),r=r.applyInner(c),o=!0}i&&(i[a]={state:r,n:n.length})}}if(!o)return{state:r,transactions:n}}}applyInner(t){if(!t.before.eq(this.doc))throw RangeError("Applying a mismatched transaction");let n=new JU(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let o=r[i];n[o.name]=o.apply(t,this[o.name],this,n)}return n}get tr(){return new JP(this)}static create(t){let n=new JW(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new JU(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(t,r);return r}reconfigure(t){let n=new JW(this.schema,t.plugins),r=n.fields,i=new JU(n);for(let o=0;o<r.length;o++){let a=r[o].name;i[a]=this.hasOwnProperty(a)?this[a]:r[o].init(t,i)}return i}toJSON(t){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(t=>t.toJSON())),t&&"object"==typeof t)for(let r in t){if("doc"==r||"selection"==r)throw RangeError("The JSON fields `doc` and `selection` are reserved");let i=t[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(t,n,r){if(!n)throw RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw RangeError("Required config field 'schema' missing");let i=new JW(t.schema,t.plugins),o=new JU(i);return i.fields.forEach(i=>{if("doc"==i.name)o.doc=Yh.fromJSON(t.schema,n.doc);else if("selection"==i.name)o.selection=JT.fromJSON(o.doc,n.selection);else if("storedMarks"==i.name)n.storedMarks&&(o.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let a in r){let u=r[a],s=u.spec.state;if(u.key==i.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){o[i.name]=s.fromJSON.call(u,t,n[a],o);return}}o[i.name]=i.init(t,o)}}),o}}class Jz{constructor(t){this.spec=t,this.props={},t.props&&function t(n,r,i){for(let o in n){let a=n[o];a instanceof Function?a=a.bind(r):"handleDOMEvents"==o&&(a=t(a,r,{})),i[o]=a}return i}(t.props,this,this.props),this.key=t.key?t.key.key:JV("plugin")}getState(t){return t[this.key]}}let JB=Object.create(null);function JV(t){return t in JB?t+"$"+ ++JB[t]:(JB[t]=0,t+"$")}class J${constructor(t="key"){this.key=JV(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}let Jq=function(t){for(var n=0;;n++)if(!(t=t.previousSibling))return n},JK=function(t){let n=t.assignedSlot||t.parentNode;return n&&11==n.nodeType?n.host:n},JH=null,JG=function(t,n,r){let i=JH||(JH=document.createRange());return i.setEnd(t,r??t.nodeValue.length),i.setStart(t,n||0),i},JZ=function(t,n,r,i){return r&&(JJ(t,n,r,i,-1)||JJ(t,n,r,i,1))},JY=/^(img|br|input|textarea|hr)$/i;function JJ(t,n,r,i,o){for(;;){if(t==r&&n==i)return!0;if(n==(o<0?0:JQ(t))){let a=t.parentNode;if(!a||1!=a.nodeType||JX(t)||JY.test(t.nodeName)||"false"==t.contentEditable)return!1;n=Jq(t)+(o<0?0:1),t=a}else{if(1!=t.nodeType||"false"==(t=t.childNodes[n+(o<0?-1:0)]).contentEditable)return!1;n=o<0?JQ(t):0}}}function JQ(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function JX(t){let n;for(let r=t;r&&!(n=r.pmViewDesc);r=r.parentNode);return n&&n.node&&n.node.isBlock&&(n.dom==t||n.contentDOM==t)}let J0=function(t){return t.focusNode&&JZ(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function J1(t,n){let r=document.createEvent("Event");return r.initEvent("keydown",!0,!0),r.keyCode=t,r.key=r.code=n,r}function J2(t,n,r){if(t.caretPositionFromPoint)try{let i=t.caretPositionFromPoint(n,r);if(i)return{node:i.offsetNode,offset:i.offset}}catch{}if(t.caretRangeFromPoint){let o=t.caretRangeFromPoint(n,r);if(o)return{node:o.startContainer,offset:o.startOffset}}}let J3="u">typeof navigator?navigator:null,J4="u">typeof document?document:null,J5=J3&&J3.userAgent||"",J6=/Edge\/(\d+)/.exec(J5),J9=/MSIE \d/.exec(J5),J8=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(J5),J7=!!(J9||J8||J6),Qe=J9?document.documentMode:J8?+J8[1]:J6?+J6[1]:0,Qt=!J7&&/gecko\/(\d+)/i.test(J5);Qt&&(/Firefox\/(\d+)/.exec(J5)||[0,0])[1];let Qn=!J7&&/Chrome\/(\d+)/.exec(J5),Qr=!!Qn,Qi=Qn?+Qn[1]:0,Qo=!J7&&!!J3&&/Apple Computer/.test(J3.vendor),Qa=Qo&&(/Mobile\/\w+/.test(J5)||!!J3&&J3.maxTouchPoints>2),Qu=Qa||!!J3&&/Mac/.test(J3.platform),Qs=!!J3&&/Win/.test(J3.platform),Ql=/Android \d/.test(J5),Qc=!!J4&&"webkitFontSmoothing"in J4.documentElement.style,Qd=Qc?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Qf(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Qp(t,n){return"number"==typeof t?t:t[n]}function Qh(t){let n=t.getBoundingClientRect(),r=n.width/t.offsetWidth||1,i=n.height/t.offsetHeight||1;return{left:n.left,right:n.left+t.clientWidth*r,top:n.top,bottom:n.top+t.clientHeight*i}}function Qm(t,n,r){let i=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,a=t.dom.ownerDocument;for(let u=r||t.dom;u;u=JK(u)){if(1!=u.nodeType)continue;let s=u,l=s==a.body,c=l?Qf(a):Qh(s),d=0,f=0;if(n.top<c.top+Qp(i,"top")?f=-(c.top-n.top+Qp(o,"top")):n.bottom>c.bottom-Qp(i,"bottom")&&(f=n.bottom-c.bottom+Qp(o,"bottom")),n.left<c.left+Qp(i,"left")?d=-(c.left-n.left+Qp(o,"left")):n.right>c.right-Qp(i,"right")&&(d=n.right-c.right+Qp(o,"right")),d||f){if(l)a.defaultView.scrollBy(d,f);else{let p=s.scrollLeft,h=s.scrollTop;f&&(s.scrollTop+=f),d&&(s.scrollLeft+=d);let m=s.scrollLeft-p,g=s.scrollTop-h;n={left:n.left-m,top:n.top-g,right:n.right-m,bottom:n.bottom-g}}}if(l)break}}function Qg(t){let n=[],r=t.ownerDocument;for(let i=t;i&&(n.push({dom:i,top:i.scrollTop,left:i.scrollLeft}),t!=r);i=JK(i));return n}function Qy(t,n){for(let r=0;r<t.length;r++){let{dom:i,top:o,left:a}=t[r];i.scrollTop!=o+n&&(i.scrollTop=o+n),i.scrollLeft!=a&&(i.scrollLeft=a)}}let Qv=null;function Qb(t,n){return t.left>=n.left-1&&t.left<=n.right+1&&t.top>=n.top-1&&t.top<=n.bottom+1}function Qx(t){return t.top<t.bottom||t.left<t.right}function Q_(t,n){let r=t.getClientRects();if(r.length){let i=r[n<0?0:r.length-1];if(Qx(i))return i}return Array.prototype.find.call(r,Qx)||t.getBoundingClientRect()}let QS=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function QT(t,n,r){let{node:i,offset:o,atom:a}=t.docView.domFromPos(n,r<0?-1:1),u=Qc||Qt;if(3==i.nodeType){if(u&&(QS.test(i.nodeValue)||(r<0?!o:o==i.nodeValue.length))){let s=Q_(JG(i,o,o),r);if(Qt&&o&&/\s/.test(i.nodeValue[o-1])&&o<i.nodeValue.length){let l=Q_(JG(i,o-1,o-1),-1);if(l.top==s.top){let c=Q_(JG(i,o,o+1),-1);if(c.top!=s.top)return Qw(c,c.left<l.left)}}return s}{let d=o,f=o,p=r<0?1:-1;return r<0&&!o?(f++,p=-1):r>=0&&o==i.nodeValue.length?(d--,p=1):r<0?d--:f++,Qw(Q_(JG(i,d,f),p),p<0)}}if(!t.state.doc.resolve(n-(a||0)).parent.inlineContent){if(null==a&&o&&(r<0||o==JQ(i))){let h=i.childNodes[o-1];if(1==h.nodeType)return QO(h.getBoundingClientRect(),!1)}if(null==a&&o<JQ(i)){let m=i.childNodes[o];if(1==m.nodeType)return QO(m.getBoundingClientRect(),!0)}return QO(i.getBoundingClientRect(),r>=0)}if(null==a&&o&&(r<0||o==JQ(i))){let g=i.childNodes[o-1],y=3==g.nodeType?JG(g,JQ(g)-(u?0:1)):1!=g.nodeType||"BR"==g.nodeName&&g.nextSibling?null:g;if(y)return Qw(Q_(y,1),!1)}if(null==a&&o<JQ(i)){let v=i.childNodes[o];for(;v.pmViewDesc&&v.pmViewDesc.ignoreForCoords;)v=v.nextSibling;let b=v?3==v.nodeType?JG(v,0,u?0:1):1==v.nodeType?v:null:null;if(b)return Qw(Q_(b,-1),!0)}return Qw(Q_(3==i.nodeType?JG(i):i,-r),r>=0)}function Qw(t,n){if(0==t.width)return t;let r=n?t.left:t.right;return{top:t.top,bottom:t.bottom,left:r,right:r}}function QO(t,n){if(0==t.height)return t;let r=n?t.top:t.bottom;return{top:r,bottom:r,left:t.left,right:t.right}}function Qk(t,n,r){let i=t.state,o=t.root.activeElement;i!=n&&t.updateState(n),o!=t.dom&&t.focus();try{return r()}finally{i!=n&&t.updateState(i),o!=t.dom&&o&&o.focus()}}let QC=/[\u0590-\u08ac]/,QI=null,QM=null,QR=!1;class QE{constructor(t,n,r,i){this.parent=t,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=0,r.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,n,r){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let n=0;n<this.children.length;n++)t+=this.children[n].size;return t}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let t=0;t<this.children.length;t++)this.children[t].destroy()}posBeforeChild(t){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==t)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(t,n,r){if(this.contentDOM&&this.contentDOM.contains(1==t.nodeType?t:t.parentNode)){if(r<0){let i,o;if(t==this.contentDOM)i=t.childNodes[n-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;i=t.previousSibling}for(;i&&!((o=i.pmViewDesc)&&o.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(o)+o.size:this.posAtStart}{let a,u;if(t==this.contentDOM)a=t.childNodes[n];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;a=t.nextSibling}for(;a&&!((u=a.pmViewDesc)&&u.parent==this);)a=a.nextSibling;return a?this.posBeforeChild(u):this.posAtEnd}}let s;if(t==this.dom&&this.contentDOM)s=n>Jq(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))s=2&t.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==n)for(let l=t;;l=l.parentNode){if(l==this.dom){s=!1;break}if(l.previousSibling)break}if(null==s&&n==t.childNodes.length)for(let c=t;;c=c.parentNode){if(c==this.dom){s=!0;break}if(c.nextSibling)break}}return s??r>0?this.posAtEnd:this.posAtStart}nearestDesc(t,n=!1){for(let r=!0,i=t;i;i=i.parentNode){let o=this.getDesc(i),a;if(o&&(!n||o.node)){if(!r||!(a=o.nodeDOM)||(1==a.nodeType?a.contains(1==t.nodeType?t:t.parentNode):a==t))return o;r=!1}}}getDesc(t){let n=t.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(t,n,r){for(let i=t;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(t,n,r)}return -1}descAt(t){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],o=r+i.size;if(r==t&&o!=r){for(;!i.border&&i.children.length;)i=i.children[0];return i}if(t<o)return i.descAt(t-r-i.border);r=o}}domFromPos(t,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};let r=0,i=0;for(let o=0;r<this.children.length;r++){let a=this.children[r],u=o+a.size;if(u>t||a instanceof QF){i=t-o;break}o=u}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let s;r&&!(s=this.children[r-1]).size&&s instanceof Qj&&s.side>=0;r--);if(n<=0){let l,c=!0;for(;!(!(l=r?this.children[r-1]:null)||l.dom.parentNode==this.contentDOM);r--,c=!1);return l&&n&&c&&!l.border&&!l.domAtom?l.domFromPos(l.size,n):{node:this.contentDOM,offset:l?Jq(l.dom)+1:0}}{let d,f=!0;for(;!(!(d=r<this.children.length?this.children[r]:null)||d.dom.parentNode==this.contentDOM);r++,f=!1);return d&&f&&!d.border&&!d.domAtom?d.domFromPos(0,n):{node:this.contentDOM,offset:d?Jq(d.dom):this.contentDOM.childNodes.length}}}parseRange(t,n,r=0){if(0==this.children.length)return{node:this.contentDOM,from:t,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let a=r,u=0;;u++){let s=this.children[u],l=a+s.size;if(-1==i&&t<=l){let c=a+s.border;if(t>=c&&n<=l-s.border&&s.node&&s.contentDOM&&this.contentDOM.contains(s.contentDOM))return s.parseRange(t,n,c);t=a;for(let d=u;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){i=Jq(f.dom)+1;break}t-=f.size}-1==i&&(i=0)}if(i>-1&&(l>n||u==this.children.length-1)){n=l;for(let p=u+1;p<this.children.length;p++){let h=this.children[p];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(-1)){o=Jq(h.dom);break}n+=h.size}-1==o&&(o=this.contentDOM.childNodes.length);break}a=l}return{node:this.contentDOM,from:t,to:n,fromOffset:i,toOffset:o}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[t<0?0:this.children.length-1];return 0==n.size||n.emptyChildAt(t)}domAfterPos(t){let{node:n,offset:r}=this.domFromPos(t,0);if(1!=n.nodeType||r==n.childNodes.length)throw RangeError("No node after pos "+t);return n.childNodes[r]}setSelection(t,n,r,i=!1){let o=Math.min(t,n),a=Math.max(t,n);for(let u=0,s=0;u<this.children.length;u++){let l=this.children[u],c=s+l.size;if(o>s&&a<c)return l.setSelection(t-s-l.border,n-s-l.border,r,i);s=c}let d=this.domFromPos(t,t?-1:1),f=n==t?d:this.domFromPos(n,n?-1:1),p=r.getSelection(),h=!1;if((Qt||Qo)&&t==n){let{node:m,offset:g}=d;if(3==m.nodeType){if((h=!!(g&&m.nodeValue[g-1]==`
|
|
9
|
-
`))&&g==m.nodeValue.length)for(let y=m,v;y;y=y.parentNode){if(v=y.nextSibling){"BR"==v.nodeName&&(d=f={node:v.parentNode,offset:Jq(v)+1});break}let b=y.pmViewDesc;if(b&&b.node&&b.node.isBlock)break}}else{let x=m.childNodes[g-1];h=x&&("BR"==x.nodeName||"false"==x.contentEditable)}}if(Qt&&p.focusNode&&p.focusNode!=f.node&&1==p.focusNode.nodeType){let _=p.focusNode.childNodes[p.focusOffset];_&&"false"==_.contentEditable&&(i=!0)}if(!(i||h&&Qo)&&JZ(d.node,d.offset,p.anchorNode,p.anchorOffset)&&JZ(f.node,f.offset,p.focusNode,p.focusOffset))return;let S=!1;if((p.extend||t==n)&&!h){p.collapse(d.node,d.offset);try{t!=n&&p.extend(f.node,f.offset),S=!0}catch{}}if(!S){if(t>n){let T=d;d=f,f=T}let w=document.createRange();w.setEnd(f.node,f.offset),w.setStart(d.node,d.offset),p.removeAllRanges(),p.addRange(w)}}ignoreMutation(t){return!this.contentDOM&&"selection"!=t.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,n){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],a=r+o.size;if(r==a?t<=a&&n>=r:t<a&&n>r){let u=r+o.border,s=a-o.border;if(t>=u&&n<=s){this.dirty=t==r||n==a?2:1,t==u&&n==s&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=3:o.markDirty(t-u,n-u);return}o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}r=a}this.dirty=2}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=1==t?2:1;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class Qj extends QE{constructor(t,n,r,i){let o,a=n.type.toDOM;if("function"==typeof a&&(a=a(r,()=>o?o.parent?o.parent.posBeforeChild(o):void 0:i)),!n.type.spec.raw){if(1!=a.nodeType){let u=document.createElement("span");u.appendChild(a),a=u}a.contentEditable="false",a.classList.add("ProseMirror-widget")}super(t,[],a,null),this.widget=n,this.widget=n,o=this}matchesWidget(t){return 0==this.dirty&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return!!n&&n(t)}ignoreMutation(t){return"selection"!=t.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class QA extends QE{constructor(t,n,r,i){super(t,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(t,n){return t!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return"characterData"===t.type&&t.target.nodeValue==t.oldValue}}class QN extends QE{constructor(t,n,r,i){super(t,[],r,i),this.mark=n}static create(t,n,r,i){let o=i.nodeViews[n.type.name],a=o&&o(n,i,r);return a&&a.dom||(a=Yq.renderSpec(document,n.type.spec.toDOM(n,r))),new QN(t,n,a.dom,a.contentDOM||a.dom)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(t){return 3!=this.dirty&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),0!=this.dirty){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=0}}slice(t,n,r){let i=QN.create(this.parent,this.mark,!0,r),o=this.children,a=this.size;n<a&&(o=QY(o,n,a,r)),t>0&&(o=QY(o,0,t,r));for(let u=0;u<o.length;u++)o[u].parent=i;return i.children=o,i}}class QP extends QE{constructor(t,n,r,i,o,a,u,s,l){super(t,[],o,a),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=u}static create(t,n,r,i,o,a){let u=o.nodeViews[n.type.name],s,l=u&&u(n,o,()=>s?s.parent?s.parent.posBeforeChild(s):void 0:a,r,i),c=l&&l.dom,d=l&&l.contentDOM;if(n.isText){if(c){if(3!=c.nodeType)throw RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(n.text)}else c||({dom:c,contentDOM:d}=Yq.renderSpec(document,n.type.spec.toDOM(n)));d||n.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),n.type.spec.draggable&&(c.draggable=!0));let f=c;return c=Qq(c,r,n),l?s=new QW(t,n,r,i,c,d||null,f,l,o,a+1):n.isText?new QD(t,n,r,i,c,f,o):new QP(t,n,r,i,c,d||null,f,o,a+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(t.preserveWhitespace="full"),this.contentDOM){if(this.contentLost){for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=()=>Z5.empty)}else t.contentElement=this.contentDOM}else t.getContent=()=>this.node.content;return t}matchesNode(t,n,r){return 0==this.dirty&&t.eq(this.node)&&QK(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,n){let r=this.node.inlineContent,i=n,o=t.composing?this.localCompositionInfo(t,n):null,a=o&&o.pos>-1?o:null,u=o&&o.pos<0,s=new QG(this,a&&a.node,t);(function(t,n,r,i){let o=n.locals(t),a=0;if(0==o.length){for(let u=0;u<t.childCount;u++){let s=t.child(u);i(s,o,n.forChild(a,s),u),a+=s.nodeSize}return}let l=0,c=[],d=null;for(let f=0;;){if(l<o.length&&o[l].to==a){let p=o[l++],h;for(;l<o.length&&o[l].to==a;)(h||(h=[p])).push(o[l++]);if(h){h.sort(QZ);for(let m=0;m<h.length;m++)r(h[m],f,!!d)}else r(p,f,!!d)}let g,y;if(d)y=-1,g=d,d=null;else if(f<t.childCount)y=f,g=t.child(f++);else break;for(let v=0;v<c.length;v++)c[v].to<=a&&c.splice(v--,1);for(;l<o.length&&o[l].from<=a&&o[l].to>a;)c.push(o[l++]);let b=a+g.nodeSize;if(g.isText){let x=b;l<o.length&&o[l].from<x&&(x=o[l].from);for(let _=0;_<c.length;_++)c[_].to<x&&(x=c[_].to);x<b&&(d=g.cut(x-a),g=g.cut(0,x-a),b=x,y=-1)}let S=g.isInline&&!g.isLeaf?c.filter(t=>!t.inline):c.slice();i(g,S,n.forChild(a,g),y),a=b}})(this.node,this.innerDeco,(n,o,a)=>{n.spec.marks?s.syncToMarks(n.spec.marks,r,t):n.type.side>=0&&!a&&s.syncToMarks(o==this.node.childCount?Z7.none:this.node.child(o).marks,r,t),s.placeWidget(n,t,i)},(n,a,l,c)=>{s.syncToMarks(n.marks,r,t);let d;s.findNodeMatch(n,a,l,c)||u&&t.state.selection.from>i&&t.state.selection.to<i+n.nodeSize&&(d=s.findIndexWithChild(o.node))>-1&&s.updateNodeAt(n,a,l,d,t)||s.updateNextNode(n,a,l,t,c,i)||s.addNode(n,a,l,t,i),i+=n.nodeSize}),s.syncToMarks([],r,t),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||2==this.dirty)&&(a&&this.protectLocalComposition(t,a),function t(n,r,i){let o=n.firstChild,a=!1;for(let u=0;u<r.length;u++){let s=r[u],l=s.dom;if(l.parentNode==n){for(;l!=o;)o=QH(o),a=!0;o=o.nextSibling}else a=!0,n.insertBefore(l,o);if(s instanceof QN){let c=o?o.previousSibling:n.lastChild;t(s.contentDOM,s.children,i),o=c?c.nextSibling:n.firstChild}}for(;o;)o=QH(o),a=!0;a&&i.trackWrites==n&&(i.trackWrites=null)}(this.contentDOM,this.children,t),Qa&&function(t){if("UL"==t.nodeName||"OL"==t.nodeName){let n=t.style.cssText;t.style.cssText=n+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=n}}(this.dom))}localCompositionInfo(t,n){let{from:r,to:i}=t.state.selection;if(!(t.state.selection instanceof JC)||r<n||i>n+this.node.content.size)return null;let o=t.domSelectionRange(),a=function(t,n){for(;;){if(3==t.nodeType)return t;if(1==t.nodeType&&n>0){if(t.childNodes.length>n&&3==t.childNodes[n].nodeType)return t.childNodes[n];n=JQ(t=t.childNodes[n-1])}else{if(1!=t.nodeType||!(n<t.childNodes.length))return null;t=t.childNodes[n],n=0}}}(o.focusNode,o.focusOffset);if(!a||!this.dom.contains(a.parentNode))return null;if(!this.node.inlineContent)return{node:a,pos:-1,text:""};{let u=a.nodeValue,s=function(t,n,r,i){for(let o=0,a=0;o<t.childCount&&a<=i;){let u=t.child(o++);if(a+=u.nodeSize,!u.isText)continue;let s=u.text;for(;o<t.childCount;){let l=t.child(o++);if(a+=l.nodeSize,!l.isText)break;s+=l.text}if(a>=r){let c=a<i?s.lastIndexOf(n,i-a-1):-1;if(c>=0&&c+n.length+a>=r)return a+c;if(r==i&&s.length>=i+n.length-a&&s.slice(i-a,i-a+n.length)==n)return i}}return -1}(this.node.content,u,r-n,i-n);return s<0?null:{node:a,pos:s,text:u}}}protectLocalComposition(t,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let a=new QA(this,o,n,i);t.input.compositionNodes.push(a),this.children=QY(this.children,r,r+i.length,t,a)}update(t,n,r,i){return!!(3!=this.dirty&&t.sameMarkup(this.node))&&(this.updateInner(t,n,r,i),!0)}updateInner(t,n,r,i){this.updateOuterDeco(n),this.node=t,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=0}updateOuterDeco(t){if(QK(t,this.outerDeco))return;let n=1!=this.nodeDOM.nodeType,r=this.dom;this.dom=QV(this.dom,this.nodeDOM,QB(this.outerDeco,this.node,n),QB(t,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function QL(t,n,r,i,o){Qq(i,n,t);let a=new QP(void 0,t,n,r,i,i,i,o,0);return a.contentDOM&&a.updateChildren(o,0),a}class QD extends QP{constructor(t,n,r,i,o,a,u){super(t,n,r,i,o,null,a,u,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,n,r,i){return!!(3!=this.dirty&&(0==this.dirty||this.inParent())&&t.sameMarkup(this.node))&&(this.updateOuterDeco(n),(0!=this.dirty||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=t,this.dirty=0,!0)}inParent(){let t=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(t,n,r)}ignoreMutation(t){return"characterData"!=t.type&&"selection"!=t.type}slice(t,n,r){let i=this.node.cut(t,n),o=document.createTextNode(i.text);return new QD(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(t,n){super.markDirty(t,n),this.dom!=this.nodeDOM&&(0==t||n==this.nodeDOM.nodeValue.length)&&(this.dirty=3)}get domAtom(){return!1}}class QF extends QE{parseRule(){return{ignore:!0}}matchesHack(t){return 0==this.dirty&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class QW extends QP{constructor(t,n,r,i,o,a,u,s,l,c){super(t,n,r,i,o,a,u,l,c),this.spec=s}update(t,n,r,i){if(3==this.dirty)return!1;if(!this.spec.update)return(!!this.contentDOM||!!t.isLeaf)&&super.update(t,n,r,i);{let o=this.spec.update(t,n,r);return o&&this.updateInner(t,n,r,i),o}}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,n,r,i){this.spec.setSelection?this.spec.setSelection(t,n,r):super.setSelection(t,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return!!this.spec.stopEvent&&this.spec.stopEvent(t)}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}let QU=function(t){t&&(this.nodeName=t)};QU.prototype=Object.create(null);let Qz=[new QU];function QB(t,n,r){if(0==t.length)return Qz;let i=r?Qz[0]:new QU,o=[i];for(let a=0;a<t.length;a++){let u=t[a].type.attrs;if(u)for(let s in u.nodeName&&o.push(i=new QU(u.nodeName)),u){let l=u[s];null!=l&&(r&&1==o.length&&o.push(i=new QU(n.isInline?"span":"div")),"class"==s?i.class=(i.class?i.class+" ":"")+l:"style"==s?i.style=(i.style?i.style+";":"")+l:"nodeName"!=s&&(i[s]=l))}}return o}function QV(t,n,r,i){if(r==Qz&&i==Qz)return n;let o=n;for(let a=0;a<i.length;a++){let u=i[a],s=r[a];if(a){let l;s&&s.nodeName==u.nodeName&&o!=t&&(l=o.parentNode)&&l.nodeName.toLowerCase()==u.nodeName||((l=document.createElement(u.nodeName)).pmIsDeco=!0,l.appendChild(o),s=Qz[0]),o=l}Q$(o,s||Qz[0],u)}return o}function Q$(t,n,r){for(let i in n)"class"==i||"style"==i||"nodeName"==i||i in r||t.removeAttribute(i);for(let o in r)"class"!=o&&"style"!=o&&"nodeName"!=o&&r[o]!=n[o]&&t.setAttribute(o,r[o]);if(n.class!=r.class){let a=n.class?n.class.split(" ").filter(Boolean):[],u=r.class?r.class.split(" ").filter(Boolean):[];for(let s=0;s<a.length;s++)-1==u.indexOf(a[s])&&t.classList.remove(a[s]);for(let l=0;l<u.length;l++)-1==a.indexOf(u[l])&&t.classList.add(u[l]);0==t.classList.length&&t.removeAttribute("class")}if(n.style!=r.style){if(n.style){let c=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,d;for(;d=c.exec(n.style);)t.style.removeProperty(d[1])}r.style&&(t.style.cssText+=r.style)}}function Qq(t,n,r){return QV(t,t,Qz,QB(n,r,1!=t.nodeType))}function QK(t,n){if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].type.eq(n[r].type))return!1;return!0}function QH(t){let n=t.nextSibling;return t.parentNode.removeChild(t),n}class QG{constructor(t,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=function(t,n){let r=n,i=r.children.length,o=t.childCount,a=new Map,u=[];e:for(;o>0;){let s;for(;;)if(i){let l=r.children[i-1];if(l instanceof QN)r=l,i=l.children.length;else{s=l,i--;break}}else{if(r==n)break e;i=r.parent.children.indexOf(r),r=r.parent}let c=s.node;if(c){if(c!=t.child(o-1))break;--o,a.set(s,o),u.push(s)}}return{index:o,matched:a,matches:u.reverse()}}(t.node.content,t)}destroyBetween(t,n){if(t!=n){for(let r=t;r<n;r++)this.top.children[r].destroy();this.top.children.splice(t,n-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,n,r){let i=0,o=this.stack.length>>1,a=Math.min(o,t.length);for(;i<a&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(t[i])&&!1!==t[i].type.spec.spanning;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<t.length;){this.stack.push(this.top,this.index+1);let u=-1;for(let s=this.index;s<Math.min(this.index+3,this.top.children.length);s++){let l=this.top.children[s];if(l.matchesMark(t[o])&&!this.isLocked(l.dom)){u=s;break}}if(u>-1)u>this.index&&(this.changed=!0,this.destroyBetween(this.index,u)),this.top=this.top.children[this.index];else{let c=QN.create(this.top,t[o],n,r);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,o++}}findNodeMatch(t,n,r,i){let o=-1,a;if(i>=this.preMatch.index&&(a=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&a.matchesNode(t,n,r))o=this.top.children.indexOf(a,this.index);else for(let u=this.index,s=Math.min(this.top.children.length,u+5);u<s;u++){let l=this.top.children[u];if(l.matchesNode(t,n,r)&&!this.preMatch.matched.has(l)){o=u;break}}return!(o<0)&&(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(t,n,r,i,o){let a=this.top.children[i];return 3==a.dirty&&a.dom==a.contentDOM&&(a.dirty=2),!!a.update(t,n,r,o)&&(this.destroyBetween(this.index,i),this.index++,!0)}findIndexWithChild(t){for(;;){let n=t.parentNode;if(!n)return -1;if(n==this.top.contentDOM){let r=t.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return -1}t=n}}updateNextNode(t,n,r,i,o,a){for(let u=this.index;u<this.top.children.length;u++){let s=this.top.children[u];if(s instanceof QP){let l=this.preMatch.matched.get(s);if(null!=l&&l!=o)return!1;let c=s.dom,d,f=this.isLocked(c)&&!(t.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==t.text&&3!=s.dirty&&QK(n,s.outerDeco));if(!f&&s.update(t,n,r,i))return this.destroyBetween(this.index,u),s.dom!=c&&(this.changed=!0),this.index++,!0;if(!f&&(d=this.recreateWrapper(s,t,n,r,i,a)))return this.top.children[this.index]=d,d.dirty=2,d.updateChildren(i,a+1),d.dirty=0,this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(t,n,r,i,o,a){if(t.dirty||n.isAtom||!t.children.length||!t.node.content.eq(n.content))return null;let u=QP.create(this.top,n,r,i,o,a);if(!u.contentDOM)return null;for(let s of(u.children=t.children,t.children=[],t.destroy(),u.children))s.parent=u;return u}addNode(t,n,r,i,o){let a=QP.create(this.top,t,n,r,i,o);a.contentDOM&&a.updateChildren(i,o+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(t,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(t)&&(t==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let o=new Qj(this.top,t,n,r);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let t=this.top.children[this.index-1],n=this.top;for(;t instanceof QN;)t=(n=t).children[n.children.length-1];(!t||!(t instanceof QD)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((Qo||Qr)&&t&&"false"==t.dom.contentEditable&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(t,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(t))this.index++;else{let r=document.createElement(t);"IMG"==t&&(r.className="ProseMirror-separator",r.alt=""),"BR"==t&&(r.className="ProseMirror-trailingBreak");let i=new QF(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(t){return this.lock&&(t==this.lock||1==t.nodeType&&t.contains(this.lock.parentNode))}}function QZ(t,n){return t.type.side-n.type.side}function QY(t,n,r,i,o){let a=[];for(let u=0,s=0;u<t.length;u++){let l=t[u],c=s+=l.size;s>=r||c<=n?a.push(l):(s<n&&a.push(l.slice(0,n-s,i)),o&&(a.push(o),o=void 0),c>r&&a.push(l.slice(r-s,l.size,i)))}return a}function QJ(t,n=null){let r=t.domSelectionRange(),i=t.state.doc;if(!r.focusNode)return null;let o=t.docView.nearestDesc(r.focusNode),a=o&&0==o.size,u=t.docView.posFromDOM(r.focusNode,r.focusOffset,1);if(u<0)return null;let s=i.resolve(u),l,c;if(J0(r)){for(l=s;o&&!o.node;)o=o.parent;let d=o.node;if(o&&d.isAtom&&JM.isSelectable(d)&&o.parent&&!(d.isInline&&function(t,n,r){for(let i=0==n,o=n==JQ(t);i||o;){if(t==r)return!0;let a=Jq(t);if(!(t=t.parentNode))return!1;i=i&&0==a,o=o&&a==JQ(t)}}(r.focusNode,r.focusOffset,o.dom))){let f=o.posBefore;c=new JM(u==f?s:i.resolve(f))}}else{let p=t.docView.posFromDOM(r.anchorNode,r.anchorOffset,1);if(p<0)return null;l=i.resolve(p)}if(!c){let h="pointer"==n||t.state.selection.head<s.pos&&!a?1:-1;c=Q6(t,l,s,h)}return c}function QQ(t){return t.editable?t.hasFocus():Q8(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function QX(t,n=!1){let r=t.state.selection;if(Q4(t,r),QQ(t)){var i,o;if(!n&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Qr){let a=t.domSelectionRange(),u=t.domObserver.currentSelection;if(a.anchorNode&&u.anchorNode&&JZ(a.anchorNode,a.anchorOffset,u.anchorNode,u.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper){let s,l,c,d;i=t,s=i.domSelection(),l=document.createRange(),c=i.cursorWrapper.dom,d="IMG"==c.nodeName,d?l.setEnd(c.parentNode,Jq(c)+1):l.setEnd(c,0),l.collapse(!1),s.removeAllRanges(),s.addRange(l),!d&&!i.state.selection.visible&&J7&&Qe<=11&&(c.disabled=!0,c.disabled=!1)}else{let{anchor:f,head:p}=r,h,m,g,y,v,b;!Q0||r instanceof JC||(r.$from.parent.inlineContent||(h=Q1(t,r.from)),r.empty||r.$from.parent.inlineContent||(m=Q1(t,r.to))),t.docView.setSelection(f,p,t.root,n),Q0&&(h&&Q3(h),m&&Q3(m)),r.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&(o=t,g=o.dom.ownerDocument,g.removeEventListener("selectionchange",o.input.hideSelectionGuard),y=o.domSelectionRange(),v=y.anchorNode,b=y.anchorOffset,g.addEventListener("selectionchange",o.input.hideSelectionGuard=()=>{(y.anchorNode!=v||y.anchorOffset!=b)&&(g.removeEventListener("selectionchange",o.input.hideSelectionGuard),setTimeout(()=>{(!QQ(o)||o.state.selection.visible)&&o.dom.classList.remove("ProseMirror-hideselection")},20))})))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}let Q0=Qo||Qr&&Qi<63;function Q1(t,n){let{node:r,offset:i}=t.docView.domFromPos(n,0),o=i<r.childNodes.length?r.childNodes[i]:null,a=i?r.childNodes[i-1]:null;if(Qo&&o&&"false"==o.contentEditable)return Q2(o);if((!o||"false"==o.contentEditable)&&(!a||"false"==a.contentEditable)){if(o)return Q2(o);if(a)return Q2(a)}}function Q2(t){return t.contentEditable="true",Qo&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Q3(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function Q4(t,n){if(n instanceof JM){let r=t.docView.descAt(n.from);r!=t.lastSelectedViewDesc&&(Q5(t),r&&r.selectNode(),t.lastSelectedViewDesc=r)}else Q5(t)}function Q5(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Q6(t,n,r,i){return t.someProp("createSelectionBetween",i=>i(t,n,r))||JC.between(n,r,i)}function Q9(t){return(!t.editable||!!t.hasFocus())&&Q8(t)}function Q8(t){let n=t.domSelectionRange();if(!n.anchorNode)return!1;try{return t.dom.contains(3==n.anchorNode.nodeType?n.anchorNode.parentNode:n.anchorNode)&&(t.editable||t.dom.contains(3==n.focusNode.nodeType?n.focusNode.parentNode:n.focusNode))}catch{return!1}}function Q7(t,n){let{$anchor:r,$head:i}=t.selection,o=n>0?r.max(i):r.min(i),a=o.parent.inlineContent?o.depth?t.doc.resolve(n>0?o.after():o.before()):null:o;return a&&JT.findFrom(a,n)}function Xe(t,n){return t.dispatch(t.state.tr.setSelection(n).scrollIntoView()),!0}function Xt(t,n,r){let i=t.state.selection;if(i instanceof JC){if(!i.empty||r.indexOf("s")>-1)return!1;if(t.endOfTextblock(n>0?"forward":"backward")){let o=Q7(t.state,n);return!!o&&o instanceof JM&&Xe(t,o)}if(!(Qu&&r.indexOf("m")>-1)){let a=i.$head,u=a.textOffset?null:n<0?a.nodeBefore:a.nodeAfter,s;if(!u||u.isText)return!1;let l=n<0?a.pos-u.nodeSize:a.pos;return!!(u.isAtom||(s=t.docView.descAt(l))&&!s.contentDOM)&&(JM.isSelectable(u)?Xe(t,new JM(n<0?t.state.doc.resolve(a.pos-u.nodeSize):a)):!!Qc&&Xe(t,new JC(t.state.doc.resolve(n<0?l:l+u.nodeSize))))}}else{if(i instanceof JM&&i.node.isInline)return Xe(t,new JC(n>0?i.$to:i.$from));{let c=Q7(t.state,n);return!!c&&Xe(t,c)}}}function Xn(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Xr(t){let n=t.pmViewDesc;return n&&0==n.size&&(t.nextSibling||"BR"!=t.nodeName)}function Xi(t,n){return n<0?function(t){let n=t.domSelectionRange(),r=n.focusNode,i=n.focusOffset;if(!r)return;let o,a,u=!1;for(Qt&&1==r.nodeType&&i<Xn(r)&&Xr(r.childNodes[i])&&(u=!0);;)if(i>0){if(1!=r.nodeType)break;{let s=r.childNodes[i-1];if(Xr(s))o=r,a=--i;else if(3==s.nodeType)i=(r=s).nodeValue.length;else break}}else{if(Xa(r))break;{let l=r.previousSibling;for(;l&&Xr(l);)o=r.parentNode,a=Jq(l),l=l.previousSibling;if(l)i=Xn(r=l);else{if((r=r.parentNode)==t.dom)break;i=0}}}u?Xu(t,r,i):o&&Xu(t,o,a)}(t):Xo(t)}function Xo(t){let n=t.domSelectionRange(),r=n.focusNode,i=n.focusOffset;if(!r)return;let o=Xn(r),a,u;for(;;)if(i<o){if(1!=r.nodeType)break;if(Xr(r.childNodes[i]))a=r,u=++i;else break}else{if(Xa(r))break;{let s=r.nextSibling;for(;s&&Xr(s);)a=s.parentNode,u=Jq(s)+1,s=s.nextSibling;if(s)i=0,o=Xn(r=s);else{if((r=r.parentNode)==t.dom)break;i=o=0}}}a&&Xu(t,a,u)}function Xa(t){let n=t.pmViewDesc;return n&&n.node&&n.node.isBlock}function Xu(t,n,r){let i=t.domSelection();if(J0(i)){let o=document.createRange();o.setEnd(n,r),o.setStart(n,r),i.removeAllRanges(),i.addRange(o)}else i.extend&&i.extend(n,r);t.domObserver.setCurSelection();let{state:a}=t;setTimeout(()=>{t.state==a&&QX(t)},50)}function Xs(t,n){let r=t.state.doc.resolve(n);if(!(Qr||Qs)&&r.parent.inlineContent){let i=t.coordsAtPos(n);if(n>r.start()){let o=t.coordsAtPos(n-1),a=(o.top+o.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(o.left-i.left)>1)return o.left<i.left?"ltr":"rtl"}if(n<r.end()){let u=t.coordsAtPos(n+1),s=(u.top+u.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(u.left-i.left)>1)return u.left>i.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(t.dom).direction?"rtl":"ltr"}function Xl(t,n,r){let i=t.state.selection;if(i instanceof JC&&!i.empty||r.indexOf("s")>-1||Qu&&r.indexOf("m")>-1)return!1;let{$from:o,$to:a}=i;if(!o.parent.inlineContent||t.endOfTextblock(n<0?"up":"down")){let u=Q7(t.state,n);if(u&&u instanceof JM)return Xe(t,u)}if(!o.parent.inlineContent){let s=n<0?o:a,l=i instanceof JE?JT.near(s,n):JT.findFrom(s,n);return!!l&&Xe(t,l)}return!1}function Xc(t,n){if(!(t.state.selection instanceof JC))return!0;let{$head:r,$anchor:i,empty:o}=t.state.selection;if(!r.sameParent(i))return!0;if(!o)return!1;if(t.endOfTextblock(n>0?"forward":"backward"))return!0;let a=!r.textOffset&&(n<0?r.nodeBefore:r.nodeAfter);if(a&&!a.isText){let u=t.state.tr;return n<0?u.delete(r.pos-a.nodeSize,r.pos):u.delete(r.pos,r.pos+a.nodeSize),t.dispatch(u),!0}return!1}function Xd(t,n,r){t.domObserver.stop(),n.contentEditable=r,t.domObserver.start()}function Xf(t,n){t.someProp("transformCopied",r=>{n=r(n,t)});let r=[],{content:i,openStart:o,openEnd:a}=n;for(;o>1&&a>1&&1==i.childCount&&1==i.firstChild.childCount;){o--,a--;let u=i.firstChild;r.push(u.type.name,u.attrs!=u.type.defaultAttrs?u.attrs:null),i=u.content}let s=t.someProp("clipboardSerializer")||Yq.fromSchema(t.state.schema),l=XS(),c=l.createElement("div");c.appendChild(s.serializeFragment(i,{document:l}));let d=c.firstChild,f,p=0;for(;d&&1==d.nodeType&&(f=Xx[d.nodeName.toLowerCase()]);){for(let h=f.length-1;h>=0;h--){let m=l.createElement(f[h]);for(;c.firstChild;)m.appendChild(c.firstChild);c.appendChild(m),p++}d=c.firstChild}return d&&1==d.nodeType&&d.setAttribute("data-pm-slice",`${o} ${a}${p?` -${p}`:""} ${JSON.stringify(r)}`),{dom:c,text:t.someProp("clipboardTextSerializer",r=>r(n,t))||n.content.textBetween(0,n.content.size,`
|
|
10
|
-
|
|
11
|
-
`)}}function Xp(t,n,r,i,o){let a=o.parent.type.spec.code,u,s;if(!r&&!n)return null;let l=n&&(i||a||!r);if(l){if(t.someProp("transformPastedText",r=>{n=r(n,a||i,t)}),a)return n?new Yt(Z5.from(t.state.schema.text(n.replace(/\r\n?/g,`
|
|
12
|
-
`))),0,0):Yt.empty;let c=t.someProp("clipboardTextParser",r=>r(n,o,i,t));if(c)s=c;else{let d=o.marks(),{schema:f}=t.state,p=Yq.fromSchema(f);u=document.createElement("div"),n.split(/(?:\r\n?|\n)+/).forEach(t=>{let n=u.appendChild(document.createElement("p"));t&&n.appendChild(p.serializeNode(f.text(t,d)))})}}else t.someProp("transformPastedHTML",n=>{r=n(r,t)}),u=function(t){let n=/^(\s*<meta [^>]*>)*/.exec(t);n&&(t=t.slice(n[0].length));let r=XS().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(t),o;if((o=i&&Xx[i[1].toLowerCase()])&&(t=o.map(t=>"<"+t+">").join("")+t+o.map(t=>"</"+t+">").reverse().join("")),r.innerHTML=t,o)for(let a=0;a<o.length;a++)r=r.querySelector(o[a])||r;return r}(r),Qc&&function(t){let n=t.querySelectorAll(Qr?"span:not([class]):not([style])":"span.Apple-converted-space");for(let r=0;r<n.length;r++){let i=n[r];1==i.childNodes.length&&"\xa0"==i.textContent&&i.parentNode&&i.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),i)}}(u);let h=u&&u.querySelector("[data-pm-slice]"),m=h&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(h.getAttribute("data-pm-slice")||"");if(m&&m[3])for(let g=+m[3];g>0;g--){let y=u.firstChild;for(;y&&1!=y.nodeType;)y=y.nextSibling;if(!y)break;u=y}if(s||(s=(t.someProp("clipboardParser")||t.someProp("domParser")||YP.fromSchema(t.state.schema)).parseSlice(u,{preserveWhitespace:!!(l||m),context:o,ruleFromNode:t=>"BR"!=t.nodeName||t.nextSibling||!t.parentNode||Xh.test(t.parentNode.nodeName)?null:{ignore:!0}})),m)s=function(t,n){if(!t.size)return t;let r=t.content.firstChild.type.schema,i;try{i=JSON.parse(n)}catch{return t}let{content:o,openStart:a,openEnd:u}=t;for(let s=i.length-2;s>=0;s-=2){let l=r.nodes[i[s]];if(!l||l.hasRequiredAttrs())break;o=Z5.from(l.create(i[s+1],o)),a++,u++}return new Yt(o,a,u)}(Xb(s,+m[1],+m[2]),m[4]);else if((s=Yt.maxOpen(function(t,n){if(t.childCount<2)return t;for(let r=n.depth;r>=0;r--){let i=n.node(r).contentMatchAt(n.index(r)),o,a=[];if(t.forEach(t=>{if(!a)return;let n=i.findWrapping(t.type),r;if(!n)return a=null;if(r=a.length&&o.length&&Xg(n,o,t,a[a.length-1],0))a[a.length-1]=r;else{a.length&&(a[a.length-1]=Xy(a[a.length-1],o.length));let u=Xm(t,n);a.push(u),i=i.matchType(u.type),o=n}}),a)return Z5.from(a)}return t}(s.content,o),!0)).openStart||s.openEnd){let v=0,b=0;for(let x=s.content.firstChild;v<s.openStart&&!x.type.spec.isolating;v++,x=x.firstChild);for(let _=s.content.lastChild;b<s.openEnd&&!_.type.spec.isolating;b++,_=_.lastChild);s=Xb(s,v,b)}return t.someProp("transformPasted",n=>{s=n(s,t)}),s}let Xh=/^(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 Xm(t,n,r=0){for(let i=n.length-1;i>=r;i--)t=n[i].create(null,Z5.from(t));return t}function Xg(t,n,r,i,o){if(o<t.length&&o<n.length&&t[o]==n[o]){let a=Xg(t,n,r,i.lastChild,o+1);if(a)return i.copy(i.content.replaceChild(i.childCount-1,a));if(i.contentMatchAt(i.childCount).matchType(o==t.length-1?r.type:t[o+1]))return i.copy(i.content.append(Z5.from(Xm(r,t,o+1))))}}function Xy(t,n){if(0==n)return t;let r=t.content.replaceChild(t.childCount-1,Xy(t.lastChild,n-1)),i=t.contentMatchAt(t.childCount).fillBefore(Z5.empty,!0);return t.copy(r.append(i))}function Xv(t,n,r,i,o,a){let u=n<0?t.firstChild:t.lastChild,s=u.content;return t.childCount>1&&(a=0),o<i-1&&(s=Xv(s,n,r,i,o+1,a)),o>=r&&(s=n<0?u.contentMatchAt(0).fillBefore(s,a<=o).append(s):s.append(u.contentMatchAt(u.childCount).fillBefore(Z5.empty,!0))),t.replaceChild(n<0?0:t.childCount-1,u.copy(s))}function Xb(t,n,r){return n<t.openStart&&(t=new Yt(Xv(t.content,-1,n,t.openStart,0,t.openEnd),n,t.openEnd)),r<t.openEnd&&(t=new Yt(Xv(t.content,1,r,t.openEnd,0,0),t.openStart,r)),t}let Xx={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},X_=null;function XS(){return X_||(X_=document.implementation.createHTMLDocument("title"))}let XT={},Xw={},XO={touchstart:!0,touchmove:!0};class Xk{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function XC(t,n){t.input.lastSelectionOrigin=n,t.input.lastSelectionTime=Date.now()}function XI(t){t.someProp("handleDOMEvents",n=>{for(let r in n)t.input.eventHandlers[r]||t.dom.addEventListener(r,t.input.eventHandlers[r]=n=>XM(t,n))})}function XM(t,n){return t.someProp("handleDOMEvents",r=>{let i=r[n.type];return!!i&&(i(t,n)||n.defaultPrevented)})}function XR(t,n){if(!n.bubbles)return!0;if(n.defaultPrevented)return!1;for(let r=n.target;r!=t.dom;r=r.parentNode)if(!r||11==r.nodeType||r.pmViewDesc&&r.pmViewDesc.stopEvent(n))return!1;return!0}function XE(t){return{left:t.clientX,top:t.clientY}}function Xj(t,n,r,i,o){if(-1==i)return!1;let a=t.state.doc.resolve(i);for(let u=a.depth+1;u>0;u--)if(t.someProp(n,n=>u>a.depth?n(t,r,a.nodeAfter,a.before(u),o,!0):n(t,r,a.node(u),a.before(u),o,!1)))return!0;return!1}function XA(t,n,r){t.focused||t.focus();let i=t.state.tr.setSelection(n);"pointer"==r&&i.setMeta("pointer",!0),t.dispatch(i)}function XN(t,n,r,i){return Xj(t,"handleDoubleClickOn",n,r,i)||t.someProp("handleDoubleClick",r=>r(t,n,i))}function XP(t,n,r,i){return Xj(t,"handleTripleClickOn",n,r,i)||t.someProp("handleTripleClick",r=>r(t,n,i))||function(t,n,r){if(0!=r.button)return!1;let i=t.state.doc;if(-1==n)return!!i.inlineContent&&(XA(t,JC.create(i,0,i.content.size),"pointer"),!0);let o=i.resolve(n);for(let a=o.depth+1;a>0;a--){let u=a>o.depth?o.nodeAfter:o.node(a),s=o.before(a);if(u.inlineContent)XA(t,JC.create(i,s+1,s+1+u.content.size),"pointer");else{if(!JM.isSelectable(u))continue;XA(t,JM.create(i,s),"pointer")}return!0}}(t,r,i)}Xw.keydown=(t,n)=>{if(t.input.shiftKey=16==n.keyCode||n.shiftKey,!XF(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Ql&&Qr&&13==n.keyCode))){if(229!=n.keyCode&&t.domObserver.forceFlush(),!Qa||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)t.someProp("handleKeyDown",r=>r(t,n))||function(t,n){var r;let i,o=n.keyCode,a=(i="",n.ctrlKey&&(i+="c"),n.metaKey&&(i+="m"),n.altKey&&(i+="a"),n.shiftKey&&(i+="s"),i);if(8==o||Qu&&72==o&&"c"==a)return Xc(t,-1)||Xi(t,-1);if(46==o&&!n.shiftKey||Qu&&68==o&&"c"==a)return Xc(t,1)||Xi(t,1);if(13==o||27==o)return!0;if(37==o||Qu&&66==o&&"c"==a){let u=37==o?"ltr"==Xs(t,t.state.selection.from)?-1:1:-1;return Xt(t,u,a)||Xi(t,u)}if(39==o||Qu&&70==o&&"c"==a){let s=39==o?"ltr"==Xs(t,t.state.selection.from)?1:-1:1;return Xt(t,s,a)||Xi(t,s)}return 38==o||Qu&&80==o&&"c"==a?Xl(t,-1,a)||Xi(t,-1):40==o||Qu&&78==o&&"c"==a?function(t){if(!Qo||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:n,focusOffset:r}=t.domSelectionRange();if(n&&1==n.nodeType&&0==r&&n.firstChild&&"false"==n.firstChild.contentEditable){let i=n.firstChild;Xd(t,i,"true"),setTimeout(()=>Xd(t,i,"false"),20)}return!1}(t)||Xl(t,1,a)||Xo(t):a==(Qu?"m":"c")&&(66==o||73==o||89==o||90==o)}(t,n)?n.preventDefault():XC(t,"key");else{let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",n=>n(t,J1(13,"Enter"))),t.input.lastIOSEnter=0)},200)}}},Xw.keyup=(t,n)=>{16==n.keyCode&&(t.input.shiftKey=!1)},Xw.keypress=(t,n)=>{if(XF(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Qu&&n.metaKey)return;if(t.someProp("handleKeyPress",r=>r(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof JC)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);/[\r\n]/.test(i)||t.someProp("handleTextInput",n=>n(t,r.$from.pos,r.$to.pos,i))||t.dispatch(t.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};let XL=Qu?"metaKey":"ctrlKey";XT.mousedown=(t,n)=>{var r,i,o;t.input.shiftKey=n.shiftKey;let a=XB(t),u=Date.now(),s="singleClick",l,c;u-t.input.lastClick.time<500&&(l=(o=t.input.lastClick).x-n.clientX,l*l+(c=o.y-n.clientY)*c<100)&&!n[XL]&&("singleClick"==t.input.lastClick.type?s="doubleClick":"doubleClick"==t.input.lastClick.type&&(s="tripleClick")),t.input.lastClick={time:u,x:n.clientX,y:n.clientY,type:s};let d=t.posAtCoords(XE(n));d&&("singleClick"==s?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new XD(t,d,n,!!a)):("doubleClick"==s?XN:XP)(t,d.pos,d.inside,n)?n.preventDefault():XC(t,"pointer"))};class XD{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[XL],this.allowDefault=r.shiftKey;let o,a;if(n.inside>-1)o=t.state.doc.nodeAt(n.inside),a=n.inside;else{let u=t.state.doc.resolve(n.pos);o=u.parent,a=u.depth?u.before():0}let s=i?null:r.target,l=s?t.docView.nearestDesc(s,!0):null;this.target=l?l.dom:null;let{selection:c}=t.state;(0==r.button&&o.type.spec.draggable&&!1!==o.type.spec.selectable||c instanceof JM&&c.from<=a&&c.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Qt&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),XC(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>QX(this.view)),this.view.input.mouseDown=null}up(t){var n,r,i,o,a;if(this.done(),!this.view.dom.contains(t.target))return;let u=this.pos;this.view.state.doc!=this.startDoc&&(u=this.view.posAtCoords(XE(t))),this.updateAllowDefault(t),this.allowDefault||!u?XC(this.view,"pointer"):(n=this.view,r=u.pos,i=u.inside,a=this.selectNode,Xj(n,"handleClickOn",r,i,t)||n.someProp("handleClick",i=>i(n,r,t))||(a?function(t,n){if(-1==n)return!1;let r=t.state.selection,i,o;r instanceof JM&&(i=r.node);let a=t.state.doc.resolve(n);for(let u=a.depth+1;u>0;u--){let s=u>a.depth?a.nodeAfter:a.node(u);if(JM.isSelectable(s)){o=i&&r.$from.depth>0&&u>=r.$from.depth&&a.before(r.$from.depth+1)==r.$from.pos?a.before(r.$from.depth):a.before(u);break}}return null!=o&&(XA(t,JM.create(t.state.doc,o),"pointer"),!0)}(n,i):function(t,n){if(-1==n)return!1;let r=t.state.doc.resolve(n),i=r.nodeAfter;return!!(i&&i.isAtom&&JM.isSelectable(i))&&(XA(t,new JM(r),"pointer"),!0)}(n,i)))?t.preventDefault():0==t.button&&(this.flushed||Qo&&this.mightDrag&&!this.mightDrag.node.isAtom||Qr&&!this.view.state.selection.visible&&2>=Math.min(Math.abs(u.pos-this.view.state.selection.from),Math.abs(u.pos-this.view.state.selection.to)))?(XA(this.view,JT.near(this.view.state.doc.resolve(u.pos)),"pointer"),t.preventDefault()):XC(this.view,"pointer")}move(t){this.updateAllowDefault(t),XC(this.view,"pointer"),0==t.buttons&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}function XF(t,n){return!!t.composing||!!(Qo&&500>Math.abs(n.timeStamp-t.input.compositionEndedAt))&&(t.input.compositionEndedAt=-2e8,!0)}XT.touchstart=t=>{t.input.lastTouch=Date.now(),XB(t),XC(t,"pointer")},XT.touchmove=t=>{t.input.lastTouch=Date.now(),XC(t,"pointer")},XT.contextmenu=t=>{var n;return XB(t)};let XW=Ql?5e3:-1;function XU(t,n){clearTimeout(t.input.composingTimeout),n>-1&&(t.input.composingTimeout=setTimeout(()=>XB(t),n))}function Xz(t){let n;for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=(n=document.createEvent("Event"),n.initEvent("event",!0,!0),n.timeStamp));t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function XB(t,n=!1){if(!(Ql&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Xz(t),n||t.docView&&t.docView.dirty){let r=QJ(t);return r&&!r.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(r)):t.updateState(t.state),!0}return!1}}Xw.compositionstart=Xw.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:n}=t,r=n.selection.$from;if(n.selection.empty&&(n.storedMarks||!r.textOffset&&r.parentOffset&&r.nodeBefore.marks.some(t=>!1===t.type.spec.inclusive)))t.markCursor=t.state.storedMarks||r.marks(),XB(t,!0),t.markCursor=null;else if(XB(t),Qt&&n.selection.empty&&r.parentOffset&&!r.textOffset&&r.nodeBefore.marks.length){let i=t.domSelectionRange();for(let o=i.focusNode,a=i.focusOffset;o&&1==o.nodeType&&0!=a;){let u=a<0?o.lastChild:o.childNodes[a-1];if(!u)break;if(3==u.nodeType){t.domSelection().collapse(u,u.nodeValue.length);break}o=u,a=-1}}t.input.composing=!0}XU(t,XW)},Xw.compositionend=(t,n)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=n.timeStamp,t.input.compositionID++,XU(t,20))};let XV=J7&&Qe<15||Qa&&Qd<604;function X$(t,n,r,i,o){var a;let u=Xp(t,n,r,i,t.state.selection.$from);if(t.someProp("handlePaste",n=>n(t,o,u||Yt.empty)))return!0;if(!u)return!1;let s=0==u.openStart&&0==u.openEnd&&1==u.content.childCount?u.content.firstChild:null,l=s?t.state.tr.replaceSelectionWith(s,i):t.state.tr.replaceSelection(u);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}XT.copy=Xw.cut=(t,n)=>{let r=t.state.selection,i="cut"==n.type;if(r.empty)return;let o=XV?null:n.clipboardData,{dom:a,text:u}=Xf(t,r.content());o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",u)):function(t,n){if(!t.dom.parentNode)return;let r=t.dom.parentNode.appendChild(document.createElement("div"));r.appendChild(n),r.style.cssText="position: fixed; left: -10000px; top: 10px";let i=getSelection(),o=document.createRange();o.selectNodeContents(n),t.dom.blur(),i.removeAllRanges(),i.addRange(o),setTimeout(()=>{r.parentNode&&r.parentNode.removeChild(r),t.focus()},50)}(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},Xw.paste=(t,n)=>{if(t.composing&&!Ql)return;let r=XV?null:n.clipboardData,i=t.input.shiftKey&&45!=t.input.lastKeyCode;r&&X$(t,r.getData("text/plain"),r.getData("text/html"),i,n)?n.preventDefault():function(t,n){if(!t.dom.parentNode)return;let r=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,i=t.dom.parentNode.appendChild(document.createElement(r?"textarea":"div"));r||(i.contentEditable="true"),i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus();let o=t.input.shiftKey&&45!=t.input.lastKeyCode;setTimeout(()=>{t.focus(),i.parentNode&&i.parentNode.removeChild(i),r?X$(t,i.value,null,o,n):X$(t,i.textContent,i.innerHTML,o,n)},50)}(t,n)};class Xq{constructor(t,n){this.slice=t,this.move=n}}let XK=Qu?"altKey":"ctrlKey";for(let XH in XT.dragstart=(t,n)=>{let r=n,i=t.input.mouseDown;if(i&&i.done(),!r.dataTransfer)return;let o=t.state.selection,a=o.empty?null:t.posAtCoords(XE(r));if(!(a&&a.pos>=o.from&&a.pos<=(o instanceof JM?o.to-1:o.to))){if(i&&i.mightDrag)t.dispatch(t.state.tr.setSelection(JM.create(t.state.doc,i.mightDrag.pos)));else if(r.target&&1==r.target.nodeType){let u=t.docView.nearestDesc(r.target,!0);u&&u.node.type.spec.draggable&&u!=t.docView&&t.dispatch(t.state.tr.setSelection(JM.create(t.state.doc,u.posBefore)))}}let s=t.state.selection.content(),{dom:l,text:c}=Xf(t,s);r.dataTransfer.clearData(),r.dataTransfer.setData(XV?"Text":"text/html",l.innerHTML),r.dataTransfer.effectAllowed="copyMove",XV||r.dataTransfer.setData("text/plain",c),t.dragging=new Xq(s,!r[XK])},XT.dragend=t=>{let n=t.dragging;window.setTimeout(()=>{t.dragging==n&&(t.dragging=null)},50)},Xw.dragover=Xw.dragenter=(t,n)=>n.preventDefault(),Xw.drop=(t,n)=>{let r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(XE(n));if(!i)return;let o=t.state.doc.resolve(i.pos),a=r&&r.slice;a?t.someProp("transformPasted",n=>{a=n(a,t)}):a=Xp(t,n.dataTransfer.getData(XV?"Text":"text/plain"),XV?null:n.dataTransfer.getData("text/html"),!1,o);let u=!!(r&&!n[XK]);if(t.someProp("handleDrop",r=>r(t,n,a||Yt.empty,u))){n.preventDefault();return}if(!a)return;n.preventDefault();let s=a?function(t,n,r){let i=t.resolve(n);if(!r.content.size)return n;let o=r.content;for(let a=0;a<r.openStart;a++)o=o.firstChild.content;for(let u=1;u<=(0==r.openStart&&r.size?2:1);u++)for(let s=i.depth;s>=0;s--){let l=s==i.depth?0:i.pos<=(i.start(s+1)+i.end(s+1))/2?-1:1,c=i.index(s)+(l>0?1:0),d=i.node(s),f=!1;if(1==u)f=d.canReplace(c,c,o);else{let p=d.contentMatchAt(c).findWrapping(o.firstChild.type);f=p&&d.canReplaceWith(c,c,p[0])}if(f)return 0==l?i.pos:l<0?i.before(s+1):i.after(s+1)}return null}(t.state.doc,o.pos,a):o.pos;null==s&&(s=o.pos);let l=t.state.tr;u&&l.deleteSelection();let c=l.mapping.map(s),d=0==a.openStart&&0==a.openEnd&&1==a.content.childCount,f=l.doc;if(d?l.replaceRangeWith(c,c,a.content.firstChild):l.replaceRange(c,c,a),l.doc.eq(f))return;let p=l.doc.resolve(c);if(d&&JM.isSelectable(a.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(a.content.firstChild))l.setSelection(new JM(p));else{let h=l.mapping.map(s);l.mapping.maps[l.mapping.maps.length-1].forEach((t,n,r,i)=>h=i),l.setSelection(Q6(t,p,l.doc.resolve(h)))}t.focus(),t.dispatch(l.setMeta("uiEvent","drop"))},XT.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&QX(t)},20))},XT.blur=(t,n)=>{t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},XT.beforeinput=(t,n)=>{if(Qr&&Ql&&"deleteContentBackward"==n.inputType){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",n=>n(t,J1(8,"Backspace")))))return;let{$cursor:n}=t.state.selection;n&&n.pos>0&&t.dispatch(t.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}},Xw)XT[XH]=Xw[XH];function XG(t,n){if(t==n)return!0;for(let r in t)if(t[r]!==n[r])return!1;for(let i in n)if(!(i in t))return!1;return!0}class XZ{constructor(t,n){this.toDOM=t,this.spec=n||X0,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 XQ(o-r,o-r,this)}valid(){return!0}eq(t){return this==t||t instanceof XZ&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&XG(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class XY{constructor(t,n){this.attrs=t,this.spec=n||X0}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 XQ(o,a,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof XY&&XG(this.attrs,t.attrs)&&XG(this.spec,t.spec)}static is(t){return t.type instanceof XY}destroy(){}}let XJ=class t{constructor(t,n){this.attrs=t,this.spec=n||X0}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 XQ(o.pos-r,a.pos-r,this)}valid(t,n){let{index:r,offset:i}=t.content.findIndex(n.from),o;return i==n.from&&!(o=t.child(r)).isText&&i+o.nodeSize==n.to}eq(n){return this==n||n instanceof t&&XG(this.attrs,n.attrs)&&XG(this.spec,n.spec)}destroy(){}};class XQ{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new XQ(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 XQ(t,t,new XZ(n,r))}static inline(t,n,r,i){return new XQ(t,n,new XY(r,i))}static node(t,n,r,i){return new XQ(t,n,new XJ(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof XY}}let XX=[],X0={};class X1{constructor(t,n){this.local=t.length?t:XX,this.children=n.length?n:XX}static create(t,n){return n.length?X9(n,t,0,X0):X2}find(t,n,r){let i=[];return this.findInner(t??0,n??1e9,i,0,r),i}findInner(t,n,r,i,o){for(let a=0;a<this.local.length;a++){let u=this.local[a];u.from<=n&&u.to>=t&&(!o||o(u.spec))&&r.push(u.copy(u.from+i,u.to+i))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>t){let l=this.children[s]+1;this.children[s+2].findInner(t-l,n-l,r,i+l,o)}}map(t,n,r){return this==X2||0==t.maps.length?this:this.mapInner(t,n,0,0,r||X0)}mapInner(t,n,r,i,o){let a;for(let u=0;u<this.local.length;u++){let s=this.local[u].map(t,r,i);s&&s.type.valid(n,s)?(a||(a=[])).push(s):o.onRemove&&o.onRemove(this.local[u].spec)}return this.children.length?function(t,n,r,i,o,a,u){let s=t.slice();for(let l=0,c=a;l<r.maps.length;l++){let d=0;r.maps[l].forEach((t,n,r,i)=>{let a=i-r-(n-t);for(let u=0;u<s.length;u+=3){let l=s[u+1];if(l<0||t>l+c-d)continue;let f=s[u]+c-d;n>=f?s[u+1]=t<=f?-2:-1:r>=o&&a&&(s[u]+=a,s[u+1]+=a)}d+=a}),c=r.maps[l].map(c,-1)}let f=!1;for(let p=0;p<s.length;p+=3)if(s[p+1]<0){if(-2==s[p+1]){f=!0,s[p+1]=-1;continue}let h=r.map(t[p]+a),m=h-o;if(m<0||m>=i.content.size){f=!0;continue}let g=r.map(t[p+1]+a,-1)-o,{index:y,offset:v}=i.content.findIndex(m),b=i.maybeChild(y);if(b&&v==m&&v+b.nodeSize==g){let x=s[p+2].mapInner(r,b,h+1,t[p]+a+1,u);x!=X2?(s[p]=m,s[p+1]=g,s[p+2]=x):(s[p+1]=-2,f=!0)}else f=!0}if(f){let _=function(t,n,r,i,o,a,u){function s(t,n){for(let a=0;a<t.local.length;a++){let l=t.local[a].map(i,o,n);l?r.push(l):u.onRemove&&u.onRemove(t.local[a].spec)}for(let c=0;c<t.children.length;c+=3)s(t.children[c+2],t.children[c]+n+1)}for(let l=0;l<t.length;l+=3)-1==t[l+1]&&s(t[l+2],n[l]+a+1);return r}(s,t,n,r,o,a,u),S=X9(_,i,0,u);n=S.local;for(let T=0;T<s.length;T+=3)s[T+1]<0&&(s.splice(T,3),T-=3);for(let w=0,O=0;w<S.children.length;w+=3){let k=S.children[w];for(;O<s.length&&s[O]<k;)O+=3;s.splice(O,0,S.children[w],S.children[w+1],S.children[w+2])}}return new X1(n.sort(X8),s)}(this.children,a||[],t,n,r,i,o):a?new X1(a.sort(X8),XX):X2}add(t,n){return n.length?this==X2?X1.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,o=0;t.forEach((t,a)=>{let u=a+r,s;if(s=X5(n,t,u)){for(i||(i=this.children.slice());o<i.length&&i[o]<a;)o+=3;i[o]==a?i[o+2]=i[o+2].addInner(t,s,u+1):i.splice(o,0,a,a+t.nodeSize,X9(s,t,u+1,X0)),o+=3}});let a=X4(o?X6(n):n,-r);for(let u=0;u<a.length;u++)a[u].type.valid(t,a[u])||a.splice(u--,1);return new X1(a.length?this.local.concat(a).sort(X8):this.local,i||this.children)}remove(t){return 0==t.length||this==X2?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,c;l<t.length;l++)(c=t[l])&&c.from>u&&c.to<s&&(t[l]=null,(a||(a=[])).push(c));if(!a)continue;r==this.children&&(r=this.children.slice());let d=r[o+2].removeInner(a,u+1);d!=X2?r[o+2]=d:(r.splice(o,3),o-=3)}if(i.length){for(let f=0,p;f<t.length;f++)if(p=t[f])for(let h=0;h<i.length;h++)i[h].eq(p,n)&&(i==this.local&&(i=this.local.slice()),i.splice(h--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new X1(i,r):X2}forChild(t,n){if(this==X2)return this;if(n.isLeaf)return X1.empty;let r,i;for(let o=0;o<this.children.length;o+=3)if(this.children[o]>=t){this.children[o]==t&&(r=this.children[o+2]);break}let a=t+1,u=a+n.content.size;for(let s=0;s<this.local.length;s++){let l=this.local[s];if(l.from<u&&l.to>a&&l.type instanceof XY){let c=Math.max(a,l.from)-a,d=Math.min(u,l.to)-a;c<d&&(i||(i=[])).push(l.copy(c,d))}}if(i){let f=new X1(i.sort(X8),XX);return r?new X3([f,r]):f}return r||X2}eq(t){if(this==t)return!0;if(!(t instanceof X1)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(let r=0;r<this.children.length;r+=3)if(this.children[r]!=t.children[r]||this.children[r+1]!=t.children[r+1]||!this.children[r+2].eq(t.children[r+2]))return!1;return!0}locals(t){return X7(this.localsInner(t))}localsInner(t){if(this==X2)return XX;if(t.inlineContent||!this.local.some(XY.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof XY||n.push(this.local[r]);return n}}X1.empty=new X1([],[]),X1.removeOverlap=X7;let X2=X1.empty;class X3{constructor(t){this.members=t}map(t,n){let r=this.members.map(r=>r.map(t,n,X0));return X3.from(r)}forChild(t,n){if(n.isLeaf)return X1.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(t,n);o!=X2&&(o instanceof X3?r=r.concat(o.members):r.push(o))}return X3.from(r)}eq(t){if(!(t instanceof X3)||t.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}locals(t){let n,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(t);if(o.length){if(n){r&&(n=n.slice(),r=!1);for(let a=0;a<o.length;a++)n.push(o[a])}else n=o}}return n?X7(r?n:n.sort(X8)):XX}static from(t){switch(t.length){case 0:return X2;case 1:return t[0];default:return new X3(t.every(t=>t instanceof X1)?t:t.reduce((t,n)=>t.concat(n instanceof X1?n:n.members),[]))}}}function X4(t,n){if(!n||!t.length)return t;let r=[];for(let i=0;i<t.length;i++){let o=t[i];r.push(new XQ(o.from+n,o.to+n,o.type))}return r}function X5(t,n,r){if(n.isLeaf)return null;let i=r+n.nodeSize,o=null;for(let a=0,u;a<t.length;a++)(u=t[a])&&u.from>r&&u.to<i&&((o||(o=[])).push(u),t[a]=null);return o}function X6(t){let n=[];for(let r=0;r<t.length;r++)null!=t[r]&&n.push(t[r]);return n}function X9(t,n,r,i){let o=[],a=!1;n.forEach((n,u)=>{let s=X5(t,n,u+r);if(s){a=!0;let l=X9(s,n,r+u+1,i);l!=X2&&o.push(u,u+n.nodeSize,l)}});let u=X4(a?X6(t):t,-r).sort(X8);for(let s=0;s<u.length;s++)u[s].type.valid(n,u[s])||(i.onRemove&&i.onRemove(u[s].spec),u.splice(s--,1));return u.length||o.length?new X1(u,o):X2}function X8(t,n){return t.from-n.from||t.to-n.to}function X7(t){let n=t;for(let r=0;r<n.length-1;r++){let i=n[r];if(i.from!=i.to)for(let o=r+1;o<n.length;o++){let a=n[o];if(a.from==i.from){a.to!=i.to&&(n==t&&(n=t.slice()),n[o]=a.copy(a.from,i.to),eee(n,o+1,a.copy(i.to,a.to)));continue}a.from<i.to&&(n==t&&(n=t.slice()),n[r]=i.copy(i.from,a.from),eee(n,o,i.copy(a.from,i.to)));break}}return n}function eee(t,n,r){for(;n<t.length&&X8(r,t[n])>0;)n++;t.splice(n,0,r)}function eet(t){let n=[];return t.someProp("decorations",r=>{let i=r(t.state);i&&i!=X2&&n.push(i)}),t.cursorWrapper&&n.push(X1.create(t.state.doc,[t.cursorWrapper.deco])),X3.from(n)}let een={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},eer=J7&&Qe<=11;class eei{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class eeo{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new eei,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let n=0;n<t.length;n++)this.queue.push(t[n]);J7&&Qe<=11&&t.some(t=>"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length)?this.flushSoon():this.flush()}),eer&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,een)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let n=0;n<t.length;n++)this.queue.push(t[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Q9(this.view)){if(this.suppressingSelectionUpdates)return QX(this.view);if(J7&&Qe<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&JZ(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let n=new Set,r;for(let i=t.focusNode;i;i=JK(i))n.add(i);for(let o=t.anchorNode;o;o=JK(o))if(n.has(o)){r=o;break}let a=r&&this.view.docView.nearestDesc(r);if(a&&a.ignoreMutation({type:"selection",target:3==r.nodeType?r.parentNode:r}))return this.setCurSelection(),!0}flush(){var t;let{view:n}=this;if(!n.docView||this.flushingSoon>-1)return;let r=this.observer?this.observer.takeRecords():[];this.queue.length&&(r=this.queue.concat(r),this.queue.length=0);let i=n.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(i)&&Q9(n)&&!this.ignoreSelectionChange(i),a=-1,u=-1,s=!1,l=[];if(n.editable)for(let c=0;c<r.length;c++){let d=this.registerMutation(r[c],l);d&&(a=a<0?d.from:Math.min(d.from,a),u=u<0?d.to:Math.max(d.to,u),d.typeOver&&(s=!0))}if(Qt&&l.length>1){let f=l.filter(t=>"BR"==t.nodeName);if(2==f.length){let p=f[0],h=f[1];p.parentNode&&p.parentNode.parentNode==h.parentNode?h.remove():p.remove()}}let m=null;a<0&&o&&n.input.lastFocus>Date.now()-200&&Math.max(n.input.lastTouch,n.input.lastClick.time)<Date.now()-300&&J0(i)&&(m=QJ(n))&&m.eq(JT.near(n.state.doc.resolve(0),1))?(n.input.lastFocus=0,QX(n),this.currentSelection.set(i),n.scrollToSelection()):(a>-1||o)&&(a>-1&&(n.docView.markDirty(a,u),t=n,eea.has(t)||(eea.set(t,null),-1===["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace))||(t.requiresGeckoHackNode=Qt,eeu||(console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),eeu=!0))),this.handleDOMChange(a,u,s,l),n.docView&&n.docView.dirty?n.updateState(n.state):this.currentSelection.eq(i)||QX(n),this.currentSelection.set(i))}registerMutation(t,n){if(n.indexOf(t.target)>-1)return null;let r=this.view.docView.nearestDesc(t.target);if("attributes"==t.type&&(r==this.view.docView||"contenteditable"==t.attributeName||"style"==t.attributeName&&!t.oldValue&&!t.target.getAttribute("style"))||!r||r.ignoreMutation(t))return null;if("childList"!=t.type)return"attributes"==t.type?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:{from:r.posAtStart,to:r.posAtEnd,typeOver:t.target.nodeValue==t.oldValue};{for(let i=0;i<t.addedNodes.length;i++)n.push(t.addedNodes[i]);if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(t.target))return{from:r.posBefore,to:r.posAfter};let o=t.previousSibling,a=t.nextSibling;if(J7&&Qe<=11&&t.addedNodes.length)for(let u=0;u<t.addedNodes.length;u++){let{previousSibling:s,nextSibling:l}=t.addedNodes[u];(!s||0>Array.prototype.indexOf.call(t.addedNodes,s))&&(o=s),(!l||0>Array.prototype.indexOf.call(t.addedNodes,l))&&(a=l)}let c=o&&o.parentNode==t.target?Jq(o)+1:0,d=r.localPosFromDOM(t.target,c,-1),f=a&&a.parentNode==t.target?Jq(a):t.target.childNodes.length,p=r.localPosFromDOM(t.target,f,1);return{from:d,to:p}}}}let eea=new WeakMap,eeu=!1;function ees(t){let n=t.pmViewDesc;if(n)return n.parseRule();if("BR"==t.nodeName&&t.parentNode){if(Qo&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}if(t.parentNode.lastChild==t||Qo&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if("IMG"==t.nodeName&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}let eel=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function eec(t,n,r){return Math.max(r.anchor,r.head)>n.content.size?null:Q6(t,n.resolve(r.anchor),n.resolve(r.head))}function eed(t,n,r){let i=t.depth,o=n?t.end():t.pos;for(;i>0&&(n||t.indexAfter(i)==t.node(i).childCount);)i--,o++,n=!1;if(r){let a=t.node(i).maybeChild(t.indexAfter(i));for(;a&&!a.isLeaf;)a=a.firstChild,o++}return o}class eef{constructor(t,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Xk,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(eey),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):"function"==typeof t?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=eem(this),eeh(this),this.nodeViews=eeg(this),this.docView=QL(this.state.doc,eep(this),eet(this),this.dom,this),this.domObserver=new eeo(this,(t,n,r,i)=>(function(t,n,r,i,o){if(n<0){let a=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,u=QJ(t,a);if(u&&!t.state.selection.eq(u)){if(Qr&&Ql&&13===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",n=>n(t,J1(13,"Enter"))))return;let s=t.state.tr.setSelection(u);"pointer"==a?s.setMeta("pointer",!0):"key"==a&&s.scrollIntoView(),t.composing&&s.setMeta("composition",t.input.compositionID),t.dispatch(s)}return}let l=t.state.doc.resolve(n),c=l.sharedDepth(r);n=l.before(c+1),r=t.state.doc.resolve(r).after(c+1);let d=t.state.selection,f=function(t,n,r){let{node:i,fromOffset:o,toOffset:a,from:u,to:s}=t.docView.parseRange(n,r),l=t.domSelectionRange(),c,d=l.anchorNode;if(d&&t.dom.contains(1==d.nodeType?d:d.parentNode)&&(c=[{node:d,offset:l.anchorOffset}],J0(l)||c.push({node:l.focusNode,offset:l.focusOffset})),Qr&&8===t.input.lastKeyCode)for(let f=a;f>o;f--){let p=i.childNodes[f-1],h=p.pmViewDesc;if("BR"==p.nodeName&&!h){a=f;break}if(!h||h.size)break}let m=t.state.doc,g=t.someProp("domParser")||YP.fromSchema(t.state.schema),y=m.resolve(u),v=null,b=g.parse(i,{topNode:y.parent,topMatch:y.parent.contentMatchAt(y.index()),topOpen:!0,from:o,to:a,preserveWhitespace:"pre"!=y.parent.type.whitespace||"full",findPositions:c,ruleFromNode:ees,context:y});if(c&&null!=c[0].pos){let x=c[0].pos,_=c[1]&&c[1].pos;null==_&&(_=x),v={anchor:x+u,head:_+u}}return{doc:b,sel:v,from:u,to:s}}(t,n,r),p=t.state.doc,h=p.slice(f.from,f.to),m,g;8===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime?(m=t.state.selection.to,g="end"):(m=t.state.selection.from,g="start"),t.input.lastKeyCode=null;let y=function(t,n,r,i,o){let a=t.findDiffStart(n,r);if(null==a)return null;let{a:u,b:s}=t.findDiffEnd(n,r+t.size,r+n.size);if("end"==o){let l=Math.max(0,a-Math.min(u,s));i-=u+l-a}if(u<a&&t.size<n.size){let c=i<=a&&i>=u?a-i:0;a-=c,s=a+(s-u),u=a}else if(s<a){let d=i<=a&&i>=s?a-i:0;a-=d,u=a+(u-s),s=a}return{start:a,endA:u,endB:s}}(h.content,f.doc.content,f.from,m,g);if((Qa&&t.input.lastIOSEnter>Date.now()-225||Ql)&&o.some(t=>1==t.nodeType&&!eel.test(t.nodeName))&&(!y||y.endA>=y.endB)&&t.someProp("handleKeyDown",n=>n(t,J1(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!y){if(i&&d instanceof JC&&!d.empty&&d.$head.sameParent(d.$anchor)&&!t.composing&&!(f.sel&&f.sel.anchor!=f.sel.head))y={start:d.from,endA:d.to,endB:d.to};else{if(f.sel){let v=eec(t,t.state.doc,f.sel);if(v&&!v.eq(t.state.selection)){let b=t.state.tr.setSelection(v);t.composing&&b.setMeta("composition",t.input.compositionID),t.dispatch(b)}}return}}if(Qr&&t.cursorWrapper&&f.sel&&f.sel.anchor==t.cursorWrapper.deco.from&&f.sel.head==f.sel.anchor){let x=y.endB-y.start;f.sel={anchor:f.sel.anchor+x,head:f.sel.anchor+x}}t.input.domChangeCount++,t.state.selection.from<t.state.selection.to&&y.start==y.endB&&t.state.selection instanceof JC&&(y.start>t.state.selection.from&&y.start<=t.state.selection.from+2&&t.state.selection.from>=f.from?y.start=t.state.selection.from:y.endA<t.state.selection.to&&y.endA>=t.state.selection.to-2&&t.state.selection.to<=f.to&&(y.endB+=t.state.selection.to-y.endA,y.endA=t.state.selection.to)),J7&&Qe<=11&&y.endB==y.start+1&&y.endA==y.start&&y.start>f.from&&" \xa0"==f.doc.textBetween(y.start-f.from-1,y.start-f.from+1)&&(y.start--,y.endA--,y.endB--);let _=f.doc.resolveNoCache(y.start-f.from),S=f.doc.resolveNoCache(y.endB-f.from),T=p.resolve(y.start),w=_.sameParent(S)&&_.parent.inlineContent&&T.end()>=y.endA,O;if((Qa&&t.input.lastIOSEnter>Date.now()-225&&(!w||o.some(t=>"DIV"==t.nodeName||"P"==t.nodeName))||!w&&_.pos<f.doc.content.size&&!_.sameParent(S)&&(O=JT.findFrom(f.doc.resolve(_.pos+1),1,!0))&&O.head==S.pos)&&t.someProp("handleKeyDown",n=>n(t,J1(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>y.start&&function(t,n,r,i,o){if(!i.parent.isTextblock||r-n<=o.pos-i.pos||eed(i,!0,!1)<o.pos)return!1;let a=t.resolve(n);if(a.parentOffset<a.parent.content.size||!a.parent.isTextblock)return!1;let u=t.resolve(eed(a,!0,!0));return!(!u.parent.isTextblock||u.pos>r||eed(u,!0,!1)<r)&&i.parent.content.cut(i.parentOffset).eq(u.parent.content)}(p,y.start,y.endA,_,S)&&t.someProp("handleKeyDown",n=>n(t,J1(8,"Backspace")))){Ql&&Qr&&t.domObserver.suppressSelectionUpdates();return}Qr&&Ql&&y.endB==y.start&&(t.input.lastAndroidDelete=Date.now()),Ql&&!w&&_.start()!=S.start()&&0==S.parentOffset&&_.depth==S.depth&&f.sel&&f.sel.anchor==f.sel.head&&f.sel.head==y.endA&&(y.endB-=2,S=f.doc.resolveNoCache(y.endB-f.from),setTimeout(()=>{t.someProp("handleKeyDown",function(n){return n(t,J1(13,"Enter"))})},20));let k=y.start,C=y.endA,I,M,R;if(w){if(_.pos==S.pos)J7&&Qe<=11&&0==_.parentOffset&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>QX(t),20)),I=t.state.tr.delete(k,C),M=p.resolve(y.start).marksAcross(p.resolve(y.endA));else if(y.endA==y.endB&&(R=function(t,n){let r=t.firstChild.marks,i=n.firstChild.marks,o=r,a=i,u,s,l;for(let c=0;c<i.length;c++)o=i[c].removeFromSet(o);for(let d=0;d<r.length;d++)a=r[d].removeFromSet(a);if(1==o.length&&0==a.length)s=o[0],u="add",l=t=>t.mark(s.addToSet(t.marks));else{if(0!=o.length||1!=a.length)return null;s=a[0],u="remove",l=t=>t.mark(s.removeFromSet(t.marks))}let f=[];for(let p=0;p<n.childCount;p++)f.push(l(n.child(p)));if(Z5.from(f).eq(t))return{mark:s,type:u}}(_.parent.content.cut(_.parentOffset,S.parentOffset),T.parent.content.cut(T.parentOffset,y.endA-T.start()))))I=t.state.tr,"add"==R.type?I.addMark(k,C,R.mark):I.removeMark(k,C,R.mark);else if(_.parent.child(_.index()).isText&&_.index()==S.index()-(S.textOffset?0:1)){let E=_.parent.textBetween(_.parentOffset,S.parentOffset);if(t.someProp("handleTextInput",n=>n(t,k,C,E)))return;I=t.state.tr.insertText(E,k,C)}}if(I||(I=t.state.tr.replace(k,C,f.doc.slice(y.start-f.from,y.endB-f.from))),f.sel){let j=eec(t,I.doc,f.sel);j&&!(Qr&&Ql&&t.composing&&j.empty&&(y.start!=y.endB||t.input.lastAndroidDelete<Date.now()-100)&&(j.head==k||j.head==I.mapping.map(C)-1)||J7&&j.empty&&j.head==k)&&I.setSelection(j)}M&&I.ensureMarks(M),t.composing&&I.setMeta("composition",t.input.compositionID),t.dispatch(I.scrollIntoView())})(this,t,n,r,i)),this.domObserver.start(),function(t){for(let n in XT){let r=XT[n];t.dom.addEventListener(n,t.input.eventHandlers[n]=n=>{!XR(t,n)||XM(t,n)||!t.editable&&n.type in Xw||r(t,n)},XO[n]?{passive:!0}:void 0)}Qo&&t.dom.addEventListener("input",()=>null),XI(t)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;for(let n in this._props={},t)this._props[n]=t[n];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&XI(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(eey),this.directPlugins=t.plugins),this.updateStateInner(t.state,n)}setProps(t){let n={};for(let r in this._props)n[r]=this._props[r];for(let i in n.state=this.state,t)n[i]=t[i];this.update(n)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,n){let r=this.state,i=!1,o=!1;t.storedMarks&&this.composing&&(Xz(this),o=!0),this.state=t;let a=r.plugins!=t.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let u=eeg(this);(function(t,n){let r=0,i=0;for(let o in t){if(t[o]!=n[o])return!0;r++}for(let a in n)i++;return r!=i})(u,this.nodeViews)&&(this.nodeViews=u,i=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&XI(this),this.editable=eem(this),eeh(this);let s=eet(this),l=eep(this),c=r.plugins==t.plugins||r.doc.eq(t.doc)?t.scrollToSelection>r.scrollToSelection?"to selection":"preserve":"reset",d=i||!this.docView.matchesNode(t.doc,l,s);(d||!t.selection.eq(r.selection))&&(o=!0);let f="preserve"==c&&o&&null==this.dom.style.overflowAnchor&&function(t){let n=t.dom.getBoundingClientRect(),r=Math.max(0,n.top),i,o;for(let a=(n.left+n.right)/2,u=r+1;u<Math.min(innerHeight,n.bottom);u+=5){let s=t.root.elementFromPoint(a,u);if(!s||s==t.dom||!t.dom.contains(s))continue;let l=s.getBoundingClientRect();if(l.top>=r-20){i=s,o=l.top;break}}return{refDOM:i,refTop:o,stack:Qg(t.dom)}}(this);if(o){var p,h,m;this.domObserver.stop();let g,y=d&&(J7||Qr)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&(h=r.selection,m=t.selection,g=Math.min(h.$anchor.sharedDepth(h.head),m.$anchor.sharedDepth(m.head)),h.$anchor.start(g)!=m.$anchor.start(g));if(d){let v=Qr?this.trackWrites=this.domSelectionRange().focusNode:null;(i||!this.docView.update(t.doc,l,s,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=QL(t.doc,l,s,this.dom,this)),v&&!this.trackWrites&&(y=!0)}let b,x;y||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&(b=this.docView.domFromPos(this.state.selection.anchor,0),x=this.domSelectionRange(),JZ(b.node,b.offset,x.anchorNode,x.anchorOffset)))?QX(this,y):(Q4(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),"reset"==c?this.dom.scrollTop=0:"to selection"==c?this.scrollToSelection():f&&function({refDOM:t,refTop:n,stack:r}){let i=t?t.getBoundingClientRect().top:0;Qy(r,0==i?0:i-n)}(f)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",t=>t(this))){if(this.state.selection instanceof JM){let n=this.docView.domAfterPos(this.state.selection.from);1==n.nodeType&&Qm(this,n.getBoundingClientRect(),t)}else Qm(this,this.coordsAtPos(this.state.selection.head,1),t)}}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(t&&t.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,t)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let i=0;i<this.directPlugins.length;i++){let o=this.directPlugins[i];o.spec.view&&this.pluginViews.push(o.spec.view(this))}for(let a=0;a<this.state.plugins.length;a++){let u=this.state.plugins[a];u.spec.view&&this.pluginViews.push(u.spec.view(this))}}}someProp(t,n){let r=this._props&&this._props[t],i;if(null!=r&&(i=n?n(r):r))return i;for(let o=0;o<this.directPlugins.length;o++){let a=this.directPlugins[o].props[t];if(null!=a&&(i=n?n(a):a))return i}let u=this.state.plugins;if(u)for(let s=0;s<u.length;s++){let l=u[s].props[t];if(null!=l&&(i=n?n(l):l))return i}}hasFocus(){if(J7){let t=this.root.activeElement;if(t==this.dom)return!0;if(!t||!this.dom.contains(t))return!1;for(;t&&this.dom!=t&&this.dom.contains(t);){if("false"==t.contentEditable)return!1;t=t.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(t){if(t.setActive)return t.setActive();if(Qv)return t.focus(Qv);let n=Qg(t);t.focus(null==Qv?{get preventScroll(){return Qv={preventScroll:!0},!0}}:void 0),Qv||(Qv=!1,Qy(n,0))}(this.dom),QX(this),this.domObserver.start()}get root(){let t=this._root;if(null==t){for(let n=this.dom.parentNode;n;n=n.parentNode)if(9==n.nodeType||11==n.nodeType&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return t||document}posAtCoords(t){return function(t,n){var r,i;let o=t.dom.ownerDocument,a,u=0,s=J2(o,n.left,n.top);s&&({node:a,offset:u}=s);let l=(t.root.elementFromPoint?t.root:o).elementFromPoint(n.left,n.top),c;if(!l||!t.dom.contains(1!=l.nodeType?l.parentNode:l)){let d=t.dom.getBoundingClientRect();if(!Qb(n,d)||!(l=function t(n,r,i){let o=n.childNodes.length;if(o&&i.top<i.bottom)for(let a=Math.max(0,Math.min(o-1,Math.floor(o*(r.top-i.top)/(i.bottom-i.top))-2)),u=a;;){let s=n.childNodes[u];if(1==s.nodeType){let l=s.getClientRects();for(let c=0;c<l.length;c++){let d=l[c];if(Qb(r,d))return t(s,r,d)}}if((u=(u+1)%o)==a)break}return n}(t.dom,n,d)))return null}if(Qo)for(let f=l;a&&f;f=JK(f))f.draggable&&(a=void 0);let p;if(l=(p=(r=l).parentNode)&&/^li$/i.test(p.nodeName)&&n.left<r.getBoundingClientRect().left?p:r,a){if(Qt&&1==a.nodeType&&(u=Math.min(u,a.childNodes.length))<a.childNodes.length){let h=a.childNodes[u],m;"IMG"==h.nodeName&&(m=h.getBoundingClientRect()).right<=n.left&&m.bottom>n.top&&u++}a==t.dom&&u==a.childNodes.length-1&&1==a.lastChild.nodeType&&n.top>a.lastChild.getBoundingClientRect().bottom?c=t.state.doc.content.size:(0==u||1!=a.nodeType||"BR"!=a.childNodes[u-1].nodeName)&&(c=function(t,n,r,i){let o=-1;for(let a=n,u=!1;a!=t.dom;){let s=t.docView.nearestDesc(a,!0);if(!s)return null;if(1==s.dom.nodeType&&(s.node.isBlock&&s.parent&&!u||!s.contentDOM)){let l=s.dom.getBoundingClientRect();if(s.node.isBlock&&s.parent&&!u&&(u=!0,l.left>i.left||l.top>i.top?o=s.posBefore:(l.right<i.left||l.bottom<i.top)&&(o=s.posAfter)),!s.contentDOM&&o<0)return(s.node.isBlock?i.top<(l.top+l.bottom)/2:i.left<(l.left+l.right)/2)?s.posBefore:s.posAfter}a=s.dom.parentNode}return o>-1?o:t.docView.posFromDOM(n,r,-1)}(t,a,u,n))}null==c&&(c=function(t,n,r){let{node:i,offset:o}=function t(n,r){let i,o=2e8,a,u=0,s=r.top,l=r.top,c,d;for(let f=n.firstChild,p=0;f;f=f.nextSibling,p++){let h;if(1==f.nodeType)h=f.getClientRects();else{if(3!=f.nodeType)continue;h=JG(f).getClientRects()}for(let m=0;m<h.length;m++){let g=h[m];if(g.top<=s&&g.bottom>=l){s=Math.max(g.bottom,s),l=Math.min(g.top,l);let y=g.left>r.left?g.left-r.left:g.right<r.left?r.left-g.right:0;if(y<o){i=f,o=y,a=y&&3==i.nodeType?{left:g.right<r.left?g.right:g.left,top:r.top}:r,1==f.nodeType&&y&&(u=p+(r.left>=(g.left+g.right)/2?1:0));continue}}else g.top>r.top&&!c&&g.left<=r.left&&g.right>=r.left&&(c=f,d={left:Math.max(g.left,Math.min(g.right,r.left)),top:g.top});!i&&(r.left>=g.right&&r.top>=g.top||r.left>=g.left&&r.top>=g.bottom)&&(u=p+1)}}return!i&&c&&(i=c,a=d,o=0),i&&3==i.nodeType?function(t,n){let r=t.nodeValue.length,i=document.createRange();for(let o=0;o<r;o++){i.setEnd(t,o+1),i.setStart(t,o);let a=Q_(i,1);if(a.top!=a.bottom&&Qb(n,a))return{node:t,offset:o+(n.left>=(a.left+a.right)/2?1:0)}}return{node:t,offset:0}}(i,a):!i||o&&1==i.nodeType?{node:n,offset:u}:t(i,a)}(n,r),a=-1;if(1==i.nodeType&&!i.firstChild){let u=i.getBoundingClientRect();a=u.left!=u.right&&r.left>(u.left+u.right)/2?1:-1}return t.docView.posFromDOM(i,o,a)}(t,l,n));let g=t.docView.nearestDesc(l,!0);return{pos:c,inside:g?g.posAtStart-g.border:-1}}(this,t)}coordsAtPos(t,n=1){return QT(this,t,n)}domAtPos(t,n=0){return this.docView.domFromPos(t,n)}nodeDOM(t){let n=this.docView.descAt(t);return n?n.nodeDOM:null}posAtDOM(t,n,r=-1){let i=this.docView.posFromDOM(t,n,r);if(null==i)throw RangeError("DOM position not inside the editor");return i}endOfTextblock(t,n){var r,i,o,a,u,s;let l,c;return QI==(i=n||this.state)&&QM==t?QR:(QI=i,QM=t,QR="up"==t||"down"==t?(a=this,l=i.selection,c="up"==t?l.$from:l.$to,Qk(a,i,()=>{let{node:n}=a.docView.domFromPos(c.pos,"up"==t?-1:1);for(;;){let r=a.docView.nearestDesc(n,!0);if(!r)break;if(r.node.isBlock){n=r.contentDOM||r.dom;break}n=r.dom.parentNode}let i=QT(a,c.pos,1);for(let o=n.firstChild;o;o=o.nextSibling){let u;if(1==o.nodeType)u=o.getClientRects();else{if(3!=o.nodeType)continue;u=JG(o,0,o.nodeValue.length).getClientRects()}for(let s=0;s<u.length;s++){let l=u[s];if(l.bottom>l.top+1&&("up"==t?i.top-l.top>(l.bottom-i.top)*2:l.bottom-i.bottom>(i.bottom-l.top)*2))return!1}}return!0})):function(t,n,r){let{$head:i}=n.selection;if(!i.parent.isTextblock)return!1;let o=i.parentOffset,a=o==i.parent.content.size,u=t.domSelection();return QC.test(i.parent.textContent)&&u.modify?Qk(t,n,()=>{let{focusNode:n,focusOffset:o,anchorNode:a,anchorOffset:s}=t.domSelectionRange(),l=u.caretBidiLevel;u.modify("move",r,"character");let c=i.depth?t.docView.domAfterPos(i.before()):t.dom,{focusNode:d,focusOffset:f}=t.domSelectionRange(),p=d&&!c.contains(1==d.nodeType?d:d.parentNode)||n==d&&o==f;try{u.collapse(a,s),n&&(n!=a||o!=s)&&u.extend&&u.extend(n,o)}catch{}return null!=l&&(u.caretBidiLevel=l),p}):"left"==r||"backward"==r?!o:a}(this,i,t))}pasteHTML(t,n){return X$(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return X$(this,t,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(function(t){for(let n in t.domObserver.stop(),t.input.eventHandlers)t.dom.removeEventListener(n,t.input.eventHandlers[n]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],eet(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return null==this.docView}dispatchEvent(t){var n,r;XM(this,t)||!XT[t.type]||!this.editable&&t.type in Xw||XT[t.type](this,t)}dispatch(t){let n=this._props.dispatchTransaction;n?n.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){return Qo&&11===this.root.nodeType&&function(t){let n=t.activeElement;for(;n&&n.shadowRoot;)n=n.shadowRoot.activeElement;return n}(this.dom.ownerDocument)==this.dom?function(t){let n;function r(t){t.preventDefault(),t.stopImmediatePropagation(),n=t.getTargetRanges()[0]}t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0);let i=n.startContainer,o=n.startOffset,a=n.endContainer,u=n.endOffset,s=t.domAtPos(t.state.selection.anchor);return JZ(s.node,s.offset,a,u)&&([i,o,a,u]=[a,u,i,o]),{anchorNode:i,anchorOffset:o,focusNode:a,focusOffset:u}}(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function eep(t){let n=Object.create(null);return n.class="ProseMirror",n.contenteditable=String(t.editable),t.someProp("attributes",r=>{if("function"==typeof r&&(r=r(t.state)),r)for(let i in r)"class"==i?n.class+=" "+r[i]:"style"==i?n.style=(n.style?n.style+";":"")+r[i]:n[i]||"contenteditable"==i||"nodeName"==i||(n[i]=String(r[i]))}),n.translate||(n.translate="no"),[XQ.node(0,t.state.doc.content.size,n)]}function eeh(t){if(t.markCursor){let n=document.createElement("img");n.className="ProseMirror-separator",n.setAttribute("mark-placeholder","true"),n.setAttribute("alt",""),t.cursorWrapper={dom:n,deco:XQ.widget(t.state.selection.head,n,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function eem(t){return!t.someProp("editable",n=>!1===n(t.state))}function eeg(t){let n=Object.create(null);function r(t){for(let r in t)Object.prototype.hasOwnProperty.call(n,r)||(n[r]=t[r])}return t.someProp("nodeViews",r),t.someProp("markViews",r),n}function eey(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw RangeError("Plugins passed directly to the view must not have a state component")}for(var eev={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},eeb={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},eex="u">typeof navigator&&/Mac/.test(navigator.platform),ee_="u">typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),eeS=0;eeS<10;eeS++)eev[48+eeS]=eev[96+eeS]=String(eeS);for(var eeS=1;eeS<=24;eeS++)eev[eeS+111]="F"+eeS;for(var eeS=65;eeS<=90;eeS++)eev[eeS]=String.fromCharCode(eeS+32),eeb[eeS]=String.fromCharCode(eeS);for(var eeT in eev)eeb.hasOwnProperty(eeT)||(eeb[eeT]=eev[eeT]);let eew="u">typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function eeO(t){let n=t.split(/-(?!$)/),r=n[n.length-1];"Space"==r&&(r=" ");let i,o,a,u;for(let s=0;s<n.length-1;s++){let l=n[s];if(/^(cmd|meta|m)$/i.test(l))u=!0;else if(/^a(lt)?$/i.test(l))i=!0;else if(/^(c|ctrl|control)$/i.test(l))o=!0;else if(/^s(hift)?$/i.test(l))a=!0;else if(/^mod$/i.test(l))eew?u=!0:o=!0;else throw Error("Unrecognized modifier name: "+l)}return i&&(r="Alt-"+r),o&&(r="Ctrl-"+r),u&&(r="Meta-"+r),a&&(r="Shift-"+r),r}function eek(t,n,r=!0){return n.altKey&&(t="Alt-"+t),n.ctrlKey&&(t="Ctrl-"+t),n.metaKey&&(t="Meta-"+t),r&&n.shiftKey&&(t="Shift-"+t),t}let eeC=(t,n)=>!t.selection.empty&&(n&&n(t.tr.deleteSelection().scrollIntoView()),!0),eeI=(t,n,r)=>{let i=function(t,n){let{$cursor:r}=t.selection;return r&&(n?n.endOfTextblock("backward",t):!(r.parentOffset>0))?r:null}(t,r);if(!i)return!1;let o=eeE(i);if(!o){let a=i.blockRange(),u=a&&Jt(a);return null!=u&&(n&&n(t.tr.lift(a,u).scrollIntoView()),!0)}let s=o.nodeBefore;if(!s.type.spec.isolating&&ee$(t,o,n))return!0;if(0==i.parent.content.size&&(eeM(s,"end")||JM.isSelectable(s))){let l=Js(t.doc,i.before(),i.after(),Yt.empty);if(l&&l.slice.size<l.to-l.from){if(n){let c=t.tr.step(l);c.setSelection(eeM(s,"end")?JT.findFrom(c.doc.resolve(c.mapping.map(o.pos,-1)),-1):JM.create(c.doc,o.pos-s.nodeSize)),n(c.scrollIntoView())}return!0}}return!!s.isAtom&&o.depth==i.depth-1&&(n&&n(t.tr.delete(o.pos-s.nodeSize,o.pos).scrollIntoView()),!0)};function eeM(t,n,r=!1){for(let i=t;i;i="start"==n?i.firstChild:i.lastChild){if(i.isTextblock)return!0;if(r&&1!=i.childCount)break}return!1}let eeR=(t,n,r)=>{let{$head:i,empty:o}=t.selection,a=i;if(!o)return!1;if(i.parent.isTextblock){if(r?!r.endOfTextblock("backward",t):i.parentOffset>0)return!1;a=eeE(i)}let u=a&&a.nodeBefore;return!!(u&&JM.isSelectable(u))&&(n&&n(t.tr.setSelection(JM.create(t.doc,a.pos-u.nodeSize)).scrollIntoView()),!0)};function eeE(t){if(!t.parent.type.spec.isolating)for(let n=t.depth-1;n>=0;n--){if(t.index(n)>0)return t.doc.resolve(t.before(n+1));if(t.node(n).type.spec.isolating)break}return null}let eej=(t,n,r)=>{let i=function(t,n){let{$cursor:r}=t.selection;return r&&(n?n.endOfTextblock("forward",t):!(r.parentOffset<r.parent.content.size))?r:null}(t,r);if(!i)return!1;let o=eeN(i);if(!o)return!1;let a=o.nodeAfter;if(ee$(t,o,n))return!0;if(0==i.parent.content.size&&(eeM(a,"start")||JM.isSelectable(a))){let u=Js(t.doc,i.before(),i.after(),Yt.empty);if(u&&u.slice.size<u.to-u.from){if(n){let s=t.tr.step(u);s.setSelection(eeM(a,"start")?JT.findFrom(s.doc.resolve(s.mapping.map(o.pos)),1):JM.create(s.doc,s.mapping.map(o.pos))),n(s.scrollIntoView())}return!0}}return!!a.isAtom&&o.depth==i.depth-1&&(n&&n(t.tr.delete(o.pos,o.pos+a.nodeSize).scrollIntoView()),!0)},eeA=(t,n,r)=>{let{$head:i,empty:o}=t.selection,a=i;if(!o)return!1;if(i.parent.isTextblock){if(r?!r.endOfTextblock("forward",t):i.parentOffset<i.parent.content.size)return!1;a=eeN(i)}let u=a&&a.nodeAfter;return!!(u&&JM.isSelectable(u))&&(n&&n(t.tr.setSelection(JM.create(t.doc,a.pos)).scrollIntoView()),!0)};function eeN(t){if(!t.parent.type.spec.isolating)for(let n=t.depth-1;n>=0;n--){let r=t.node(n);if(t.index(n)+1<r.childCount)return t.doc.resolve(t.after(n+1));if(r.type.spec.isolating)break}return null}let eeP=(t,n)=>{let r=t.selection,i=r instanceof JM,o;if(i){if(r.node.isTextblock||!Jo(t.doc,r.from))return!1;o=r.from}else if(null==(o=Ju(t.doc,r.from,-1)))return!1;if(n){let a=t.tr.join(o);i&&a.setSelection(JM.create(a.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),n(a.scrollIntoView())}return!0},eeL=(t,n)=>{let r=t.selection,i;if(r instanceof JM){if(r.node.isTextblock||!Jo(t.doc,r.to))return!1;i=r.to}else if(null==(i=Ju(t.doc,r.to,1)))return!1;return n&&n(t.tr.join(i).scrollIntoView()),!0},eeD=(t,n)=>{let{$from:r,$to:i}=t.selection,o=r.blockRange(i),a=o&&Jt(o);return null!=a&&(n&&n(t.tr.lift(o,a).scrollIntoView()),!0)},eeF=(t,n)=>{let{$head:r,$anchor:i}=t.selection;return!!(r.parent.type.spec.code&&r.sameParent(i))&&(n&&n(t.tr.insertText(`
|
|
13
|
-
`).scrollIntoView()),!0)};function eeW(t){for(let n=0;n<t.edgeCount;n++){let{type:r}=t.edge(n);if(r.isTextblock&&!r.hasRequiredAttrs())return r}return null}let eeU=(t,n)=>{let{$head:r,$anchor:i}=t.selection;if(!r.parent.type.spec.code||!r.sameParent(i))return!1;let o=r.node(-1),a=r.indexAfter(-1),u=eeW(o.contentMatchAt(a));if(!u||!o.canReplaceWith(a,a,u))return!1;if(n){let s=r.after(),l=t.tr.replaceWith(s,s,u.createAndFill());l.setSelection(JT.near(l.doc.resolve(s),1)),n(l.scrollIntoView())}return!0},eez=(t,n)=>{let r=t.selection,{$from:i,$to:o}=r;if(r instanceof JE||i.parent.inlineContent||o.parent.inlineContent)return!1;let a=eeW(o.parent.contentMatchAt(o.indexAfter()));if(!a||!a.isTextblock)return!1;if(n){let u=(!i.parentOffset&&o.index()<o.parent.childCount?i:o).pos,s=t.tr.insert(u,a.createAndFill());s.setSelection(JC.create(s.doc,u+1)),n(s.scrollIntoView())}return!0},eeB=(t,n)=>{let{$cursor:r}=t.selection;if(!r||r.parent.content.size)return!1;if(r.depth>1&&r.after()!=r.end(-1)){let i=r.before();if(Ji(t.doc,i))return n&&n(t.tr.split(i).scrollIntoView()),!0}let o=r.blockRange(),a=o&&Jt(o);return null!=a&&(n&&n(t.tr.lift(o,a).scrollIntoView()),!0)},eeV=(t,n)=>{let{$from:r,to:i}=t.selection,o,a=r.sharedDepth(i);return 0!=a&&(o=r.before(a),n&&n(t.tr.setSelection(JM.create(t.doc,o))),!0)};function ee$(t,n,r){var i,o,a;let u=n.nodeBefore,s=n.nodeAfter,l,c;if(u.type.spec.isolating||s.type.spec.isolating)return!1;let d,f,p;if(d=n.nodeBefore,f=n.nodeAfter,p=n.index(),d&&f&&d.type.compatibleContent(f.type)&&(!d.content.size&&n.parent.canReplace(p-1,p)?(r&&r(t.tr.delete(n.pos-d.nodeSize,n.pos).scrollIntoView()),!0):!!(n.parent.canReplace(p,p+1)&&(f.isTextblock||Jo(t.doc,n.pos)))&&(r&&r(t.tr.clearIncompatible(n.pos,d.type,d.contentMatchAt(d.childCount)).join(n.pos).scrollIntoView()),!0)))return!0;let h=n.parent.canReplace(n.index(),n.index()+1);if(h&&(l=(c=u.contentMatchAt(u.childCount)).findWrapping(s.type))&&c.matchType(l[0]||s.type).validEnd){if(r){let m=n.pos+s.nodeSize,g=Z5.empty;for(let y=l.length-1;y>=0;y--)g=Z5.from(l[y].create(null,g));g=Z5.from(u.copy(g));let v=t.tr.step(new Y8(n.pos-1,m,n.pos,m,new Yt(g,1,0),l.length,!0)),b=m+2*l.length;Jo(v.doc,b)&&v.join(b),r(v.scrollIntoView())}return!0}let x=JT.findFrom(n,1),_=x&&x.$from.blockRange(x.$to),S=_&&Jt(_);if(null!=S&&S>=n.depth)return r&&r(t.tr.lift(_,S).scrollIntoView()),!0;if(h&&eeM(s,"start",!0)&&eeM(u,"end")){let T=u,w=[];for(;w.push(T),!T.isTextblock;)T=T.lastChild;let O=s,k=1;for(;!O.isTextblock;O=O.firstChild)k++;if(T.canReplace(T.childCount,T.childCount,O.content)){if(r){let C=Z5.empty;for(let I=w.length-1;I>=0;I--)C=Z5.from(w[I].copy(C));let M=t.tr.step(new Y8(n.pos-w.length,n.pos+s.nodeSize,n.pos+k,n.pos+s.nodeSize-k,new Yt(C,w.length,0),0,!0));r(M.scrollIntoView())}return!0}}return!1}function eeq(t){return function(n,r){let i=n.selection,o=t<0?i.$from:i.$to,a=o.depth;for(;o.node(a).isInline;){if(!a)return!1;a--}return!!o.node(a).isTextblock&&(r&&r(n.tr.setSelection(JC.create(n.doc,t<0?o.start(a):o.end(a)))),!0)}}let eeK=eeq(-1),eeH=eeq(1);function eeG(t,n=null){return function(r,i){let o=!1;for(let a=0;a<r.selection.ranges.length&&!o;a++){let{$from:{pos:u},$to:{pos:s}}=r.selection.ranges[a];r.doc.nodesBetween(u,s,(i,a)=>{if(o)return!1;if(!(!i.isTextblock||i.hasMarkup(t,n))){if(i.type==t)o=!0;else{let u=r.doc.resolve(a),s=u.index();o=u.parent.canReplaceWith(s,s+1,t)}}})}if(!o)return!1;if(i){let l=r.tr;for(let c=0;c<r.selection.ranges.length;c++){let{$from:{pos:d},$to:{pos:f}}=r.selection.ranges[c];l.setBlockType(d,f,t,n)}i(l.scrollIntoView())}return!0}}function eeZ(t){let{state:n,transaction:r}=t,{selection:i}=r,{doc:o}=r,{storedMarks:a}=r;return{...n,apply:n.apply.bind(n),applyTransaction:n.applyTransaction.bind(n),filterTransaction:n.filterTransaction,plugins:n.plugins,schema:n.schema,reconfigure:n.reconfigure.bind(n),toJSON:n.toJSON.bind(n),get storedMarks(){return a},get selection(){return i},get doc(){return o},get tr(){return i=r.selection,o=r.doc,a=r.storedMarks,r}}}"u">typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"u">typeof os&&os.platform&&os.platform();class eeY{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:t,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,a=this.buildProps(o);return Object.fromEntries(Object.entries(t).map(([t,n])=>[t,(...t)=>{let r=n(...t)(a);return o.getMeta("preventDispatch")||this.hasCustomState||i.dispatch(o),r}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,n=!0){let{rawCommands:r,editor:i,state:o}=this,{view:a}=i,u=[],s=!!t,l=t||o.tr,c=()=>(s||!n||l.getMeta("preventDispatch")||this.hasCustomState||a.dispatch(l),u.every(t=>!0===t)),d={...Object.fromEntries(Object.entries(r).map(([t,r])=>[t,(...t)=>{let i=this.buildProps(l,n),o=r(...t)(i);return u.push(o),d}])),run:c};return d}createCan(t){let{rawCommands:n,state:r}=this,i=t||r.tr,o=this.buildProps(i,!1);return{...Object.fromEntries(Object.entries(n).map(([t,n])=>[t,(...t)=>n(...t)({...o,dispatch:void 0})])),chain:()=>this.createChain(i,!1)}}buildProps(t,n=!0){let{rawCommands:r,editor:i,state:o}=this,{view:a}=i;o.storedMarks&&t.setStoredMarks(o.storedMarks);let u={tr:t,editor:i,view:a,state:eeZ({state:o,transaction:t}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(t),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(r).map(([t,n])=>[t,(...t)=>n(...t)(u)]))}};return u}}class eeJ{constructor(){this.callbacks={}}on(t,n){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(n),this}emit(t,...n){let r=this.callbacks[t];return r&&r.forEach(t=>t.apply(this,n)),this}off(t,n){let r=this.callbacks[t];return r&&(n?this.callbacks[t]=r.filter(t=>t!==n):delete this.callbacks[t]),this}removeAllListeners(){this.callbacks={}}}function eeQ(t,n,r){return void 0===t.config[n]&&t.parent?eeQ(t.parent,n,r):"function"==typeof t.config[n]?t.config[n].bind({...r,parent:t.parent?eeQ(t.parent,n,r):null}):t.config[n]}function eeX(t){let n=t.filter(t=>"extension"===t.type),r=t.filter(t=>"node"===t.type),i=t.filter(t=>"mark"===t.type);return{baseExtensions:n,nodeExtensions:r,markExtensions:i}}function ee0(t){let n=[],{nodeExtensions:r,markExtensions:i}=eeX(t),o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(t=>{let r={name:t.name,options:t.options,storage:t.storage},i=eeQ(t,"addGlobalAttributes",r);i&&i().forEach(t=>{t.types.forEach(r=>{Object.entries(t.attributes).forEach(([t,i])=>{n.push({type:r,name:t,attribute:{...o,...i}})})})})}),[...r,...i].forEach(t=>{let r={name:t.name,options:t.options,storage:t.storage},i=eeQ(t,"addAttributes",r);if(!i)return;let a=i();Object.entries(a).forEach(([r,i])=>{let a={...o,...i};"function"==typeof(null==a?void 0:a.default)&&(a.default=a.default()),null!=a&&a.isRequired&&(null==a?void 0:a.default)===void 0&&delete a.default,n.push({type:t.name,name:r,attribute:a})})}),n}function ee1(t,n){if("string"==typeof t){if(!n.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return n.nodes[t]}return t}function ee2(...t){return t.filter(t=>!!t).reduce((t,n)=>{let r={...t};return Object.entries(n).forEach(([t,n])=>{if(!r[t]){r[t]=n;return}"class"===t?r[t]=[r[t],n].join(" "):"style"===t?r[t]=[r[t],n].join("; "):r[t]=n}),r},{})}function ee3(t,n){return n.filter(t=>t.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((t,n)=>ee2(t,n),{})}function ee4(t){return"function"==typeof t}function ee5(t,n,...r){return ee4(t)?n?t.bind(n)(...r):t(...r):t}function ee6(t,n){return t.style?t:{...t,getAttrs(r){let i=t.getAttrs?t.getAttrs(r):t.attrs;if(!1===i)return!1;let o=n.reduce((t,n)=>{var i;let o=n.attribute.parseHTML?n.attribute.parseHTML(r):"string"!=typeof(i=r.getAttribute(n.name))?i:i.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(i):"true"===i||"false"!==i&&i;return null==o?t:{...t,[n.name]:o}},{});return{...i,...o}}}}function ee9(t){return Object.fromEntries(Object.entries(t).filter(([t,n])=>!("attrs"===t&&function(t={}){return 0===Object.keys(t).length&&t.constructor===Object}(n))&&null!=n))}function ee8(t,n){var r;let i=ee0(t),{nodeExtensions:o,markExtensions:a}=eeX(t),u=null===(r=o.find(t=>eeQ(t,"topNode")))||void 0===r?void 0:r.name,s=Object.fromEntries(o.map(r=>{let o=i.filter(t=>t.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:n},u=t.reduce((t,n)=>{let i=eeQ(n,"extendNodeSchema",a);return{...t,...i?i(r):{}}},{}),s=ee9({...u,content:ee5(eeQ(r,"content",a)),marks:ee5(eeQ(r,"marks",a)),group:ee5(eeQ(r,"group",a)),inline:ee5(eeQ(r,"inline",a)),atom:ee5(eeQ(r,"atom",a)),selectable:ee5(eeQ(r,"selectable",a)),draggable:ee5(eeQ(r,"draggable",a)),code:ee5(eeQ(r,"code",a)),defining:ee5(eeQ(r,"defining",a)),isolating:ee5(eeQ(r,"isolating",a)),attrs:Object.fromEntries(o.map(t=>{var n;return[t.name,{default:null===(n=null==t?void 0:t.attribute)||void 0===n?void 0:n.default}]}))}),l=ee5(eeQ(r,"parseHTML",a));l&&(s.parseDOM=l.map(t=>ee6(t,o)));let c=eeQ(r,"renderHTML",a);c&&(s.toDOM=t=>c({node:t,HTMLAttributes:ee3(t,o)}));let d=eeQ(r,"renderText",a);return d&&(s.toText=d),[r.name,s]})),l=Object.fromEntries(a.map(r=>{let o=i.filter(t=>t.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:n},u=t.reduce((t,n)=>{let i=eeQ(n,"extendMarkSchema",a);return{...t,...i?i(r):{}}},{}),s=ee9({...u,inclusive:ee5(eeQ(r,"inclusive",a)),excludes:ee5(eeQ(r,"excludes",a)),group:ee5(eeQ(r,"group",a)),spanning:ee5(eeQ(r,"spanning",a)),code:ee5(eeQ(r,"code",a)),attrs:Object.fromEntries(o.map(t=>{var n;return[t.name,{default:null===(n=null==t?void 0:t.attribute)||void 0===n?void 0:n.default}]}))}),l=ee5(eeQ(r,"parseHTML",a));l&&(s.parseDOM=l.map(t=>ee6(t,o)));let c=eeQ(r,"renderHTML",a);return c&&(s.toDOM=t=>c({mark:t,HTMLAttributes:ee3(t,o)})),[r.name,s]}));return new YA({topNode:u,nodes:s,marks:l})}function ee7(t,n){return n.nodes[t]||n.marks[t]||null}function ete(t,n){return Array.isArray(n)?n.some(n=>("string"==typeof n?n:n.name)===t.name):n}let ett=(t,n=500)=>{let r="",i=t.parentOffset;return t.parent.nodesBetween(Math.max(0,i-n),i,(t,n,o,a)=>{var u,s;let l=(null===(s=(u=t.type.spec).toText)||void 0===s?void 0:s.call(u,{node:t,pos:n,parent:o,index:a}))||t.textContent||"%leaf%";r+=l.slice(0,Math.max(0,i-n))}),r};function etn(t){return"[object RegExp]"===Object.prototype.toString.call(t)}class etr{constructor(t){this.find=t.find,this.handler=t.handler}}let eti=(t,n)=>{if(etn(n))return n.exec(t);let r=n(t);if(!r)return null;let i=[r.text];return i.index=r.index,i.input=t,i.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),i.push(r.replaceWith)),i};function eto(t){var n;let{editor:r,from:i,to:o,text:a,rules:u,plugin:s}=t,{view:l}=r;if(l.composing)return!1;let c=l.state.doc.resolve(i);if(c.parent.type.spec.code||!(null===(n=c.nodeBefore||c.nodeAfter)||void 0===n)&&n.marks.find(t=>t.type.spec.code))return!1;let d=!1,f=ett(c)+a;return u.forEach(t=>{if(d)return;let n=eti(f,t.find);if(!n)return;let u=l.state.tr,c=eeZ({state:l.state,transaction:u}),p={from:i-(n[0].length-a.length),to:o},{commands:h,chain:m,can:g}=new eeY({editor:r,state:c});null!==t.handler({state:c,range:p,match:n,commands:h,chain:m,can:g})&&u.steps.length&&(u.setMeta(s,{transform:u,from:i,to:o,text:a}),l.dispatch(u),d=!0)}),d}class eta{constructor(t){this.find=t.find,this.handler=t.handler}}let etu=(t,n)=>{if(etn(n))return[...t.matchAll(n)];let r=n(t);return r?r.map(n=>{let r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),r.push(n.replaceWith)),r}):[]};class ets{constructor(t,n){this.splittableMarks=[],this.editor=n,this.extensions=ets.resolve(t),this.schema=ee8(this.extensions,n),this.extensions.forEach(t=>{var n;this.editor.extensionStorage[t.name]=t.storage;let r={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:ee7(t.name,this.schema)};"mark"===t.type&&(!(null!==(n=ee5(eeQ(t,"keepOnSplit",r)))&&void 0!==n)||n)&&this.splittableMarks.push(t.name);let i=eeQ(t,"onBeforeCreate",r);i&&this.editor.on("beforeCreate",i);let o=eeQ(t,"onCreate",r);o&&this.editor.on("create",o);let a=eeQ(t,"onUpdate",r);a&&this.editor.on("update",a);let u=eeQ(t,"onSelectionUpdate",r);u&&this.editor.on("selectionUpdate",u);let s=eeQ(t,"onTransaction",r);s&&this.editor.on("transaction",s);let l=eeQ(t,"onFocus",r);l&&this.editor.on("focus",l);let c=eeQ(t,"onBlur",r);c&&this.editor.on("blur",c);let d=eeQ(t,"onDestroy",r);d&&this.editor.on("destroy",d)})}static resolve(t){let n=ets.sort(ets.flatten(t)),r=function(t){let n=t.filter((n,r)=>t.indexOf(n)!==r);return[...new Set(n)]}(n.map(t=>t.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(t=>`'${t}'`).join(", ")}]. This can lead to issues.`),n}static flatten(t){return t.map(t=>{let n={name:t.name,options:t.options,storage:t.storage},r=eeQ(t,"addExtensions",n);return r?[t,...this.flatten(r())]:t}).flat(10)}static sort(t){return t.sort((t,n)=>{let r=eeQ(t,"priority")||100,i=eeQ(n,"priority")||100;return r>i?-1:r<i?1:0})}get commands(){return this.extensions.reduce((t,n)=>{let r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:ee7(n.name,this.schema)},i=eeQ(n,"addCommands",r);return i?{...t,...i()}:t},{})}get plugins(){let{editor:t}=this,n=ets.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(n=>{var o,a;let u={name:n.name,options:n.options,storage:n.storage,editor:t,type:ee7(n.name,this.schema)},s=[],l=eeQ(n,"addKeyboardShortcuts",u),c={};if("mark"===n.type&&n.config.exitable&&(c.ArrowRight=()=>enB.handleExit({editor:t,mark:n})),l){let d=Object.fromEntries(Object.entries(l()).map(([n,r])=>[n,()=>r({editor:t})]));c={...c,...d}}let f,p=(o=c,new Jz({props:{handleKeyDown:(a=o,f=function(t){let n=Object.create(null);for(let r in t)n[eeO(r)]=t[r];return n}(a),function(t,n){var r,i;let o=("Esc"==(i=!(eex&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||ee_&&n.shiftKey&&n.key&&1==n.key.length||"Unidentified"==n.key)&&n.key||(n.shiftKey?eeb:eev)[n.keyCode]||n.key||"Unidentified")&&(i="Escape"),"Del"==i&&(i="Delete"),"Left"==i&&(i="ArrowLeft"),"Up"==i&&(i="ArrowUp"),"Right"==i&&(i="ArrowRight"),"Down"==i&&(i="ArrowDown"),i),a,u=f[eek(o,n)];if(u&&u(t.state,t.dispatch,t))return!0;if(1==o.length&&" "!=o){if(n.shiftKey){let s=f[eek(o,n,!1)];if(s&&s(t.state,t.dispatch,t))return!0}if((n.shiftKey||n.altKey||n.metaKey||o.charCodeAt(0)>127)&&(a=eev[n.keyCode])&&a!=o){let l=f[eek(a,n)];if(l&&l(t.state,t.dispatch,t))return!0}}return!1})}}));s.push(p);let h=eeQ(n,"addInputRules",u);ete(n,t.options.enableInputRules)&&h&&r.push(...h());let m=eeQ(n,"addPasteRules",u);ete(n,t.options.enablePasteRules)&&m&&i.push(...m());let g=eeQ(n,"addProseMirrorPlugins",u);if(g){let y=g();s.push(...y)}return s}).flat();return[function(t){let{editor:n,rules:r}=t,i=new Jz({state:{init:()=>null,apply(t,n){let r=t.getMeta(i);return r||(t.selectionSet||t.docChanged?null:n)}},props:{handleTextInput:(t,o,a,u)=>eto({editor:n,from:o,to:a,text:u,rules:r,plugin:i}),handleDOMEvents:{compositionend:t=>(setTimeout(()=>{let{$cursor:o}=t.state.selection;o&&eto({editor:n,from:o.pos,to:o.pos,text:"",rules:r,plugin:i})}),!1)},handleKeyDown(t,o){if("Enter"!==o.key)return!1;let{$cursor:a}=t.state.selection;return!!a&&eto({editor:n,from:a.pos,to:a.pos,text:`
|
|
14
|
-
`,rules:r,plugin:i})}},isInputRules:!0});return i}({editor:t,rules:r}),...function(t){let{editor:n,rules:r}=t,i=null,o=!1,a=!1;return r.map(t=>new Jz({view(t){let n=n=>{var r;i=!(null===(r=t.dom.parentElement)||void 0===r)&&r.contains(n.target)?t.dom.parentElement:null};return window.addEventListener("dragstart",n),{destroy(){window.removeEventListener("dragstart",n)}}},props:{handleDOMEvents:{drop:t=>(a=i===t.dom.parentElement,!1),paste(t,n){var r;let i=null===(r=n.clipboardData)||void 0===r?void 0:r.getData("text/html");return o=!!(null!=i&&i.includes("data-pm-slice")),!1}}},appendTransaction(r,i,u){var s;let l=r[0],c="paste"===l.getMeta("uiEvent")&&!o,d="drop"===l.getMeta("uiEvent")&&!a;if(!c&&!d)return;let f=i.doc.content.findDiffStart(u.doc.content),p=i.doc.content.findDiffEnd(u.doc.content);if("number"!=typeof f||!p||f===p.b)return;let h=u.tr,m=eeZ({state:u,transaction:h});if(!(!function(t){let{editor:n,state:r,from:i,to:o,rule:a}=t,{commands:u,chain:s,can:l}=new eeY({editor:n,state:r}),c=[];return r.doc.nodesBetween(i,o,(t,n)=>{if(!t.isTextblock||t.type.spec.code)return;let d=Math.max(i,n),f=Math.min(o,n+t.content.size),p=t.textBetween(d-n,f-n,void 0,"");etu(p,a.find).forEach(t=>{if(void 0===t.index)return;let n=d+t.index+1,i=n+t[0].length,o={from:r.tr.mapping.map(n),to:r.tr.mapping.map(i)},f=a.handler({state:r,range:o,match:t,commands:u,chain:s,can:l});c.push(f)})}),c.every(t=>null!==t)}({editor:n,state:m,from:Math.max(f-1,0),to:p.b-1,rule:t})||!h.steps.length))return h}}))}({editor:t,rules:i}),...o]}get attributes(){return ee0(this.extensions)}get nodeViews(){let{editor:t}=this,{nodeExtensions:n}=eeX(this.extensions);return Object.fromEntries(n.filter(t=>!!eeQ(t,"addNodeView")).map(n=>{let r=this.attributes.filter(t=>t.type===n.name),i={name:n.name,options:n.options,storage:n.storage,editor:t,type:ee1(n.name,this.schema)},o=eeQ(n,"addNodeView",i);if(!o)return[];let a=(i,a,u,s)=>{let l=ee3(i,r);return o()({editor:t,node:i,getPos:u,decorations:s,HTMLAttributes:l,extension:n})};return[n.name,a]}))}}function etl(t){var n;return"Object"===Object.prototype.toString.call(t).slice(8,-1)&&t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function etc(t,n){let r={...t};return etl(t)&&etl(n)&&Object.keys(n).forEach(i=>{etl(n[i])&&i in t?r[i]=etc(t[i],n[i]):Object.assign(r,{[i]:n[i]})}),r}class etd{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ee5(eeQ(this,"addOptions",{name:this.name}))),this.storage=ee5(eeQ(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new etd(t)}configure(t={}){let n=this.extend();return n.options=etc(this.options,t),n.storage=ee5(eeQ(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){let n=new etd(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=ee5(eeQ(n,"addOptions",{name:n.name})),n.storage=ee5(eeQ(n,"addStorage",{name:n.name,options:n.options})),n}}function etf(t,n,r){let{from:i,to:o}=n,{blockSeparator:a=`
|
|
15
|
-
|
|
16
|
-
`,textSerializers:u={}}=r||{},s="",l=!0;return t.nodesBetween(i,o,(t,r,c,d)=>{var f;let p=null==u?void 0:u[t.type.name];p?(t.isBlock&&!l&&(s+=a,l=!0),c&&(s+=p({node:t,pos:r,parent:c,index:d,range:n}))):t.isText?(s+=null===(f=null==t?void 0:t.text)||void 0===f?void 0:f.slice(Math.max(i,r)-r,o-r),l=!1):t.isBlock&&!l&&(s+=a,l=!0)}),s}function etp(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}let eth=etd.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Jz({key:new J$("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:t}=this,{state:n,schema:r}=t,{doc:i,selection:o}=n,{ranges:a}=o,u=Math.min(...a.map(t=>t.$from.pos)),s=Math.max(...a.map(t=>t.$to.pos)),l=etp(r);return etf(i,{from:u,to:s},{textSerializers:l})}}})]}}),etm=()=>({editor:t,view:n})=>(requestAnimationFrame(()=>{var r;t.isDestroyed||(n.dom.blur(),null===(r=null==window?void 0:window.getSelection())||void 0===r||r.removeAllRanges())}),!0),etg=(t=!1)=>({commands:n})=>n.setContent("",t),ety=()=>({state:t,tr:n,dispatch:r})=>{let{selection:i}=n,{ranges:o}=i;return r&&o.forEach(({$from:r,$to:i})=>{t.doc.nodesBetween(r.pos,i.pos,(t,r)=>{if(t.type.isText)return;let{doc:i,mapping:o}=n,a=i.resolve(o.map(r)),u=i.resolve(o.map(r+t.nodeSize)),s=a.blockRange(u);if(!s)return;let l=Jt(s);if(t.type.isTextblock){let{defaultType:c}=a.parent.contentMatchAt(a.index());n.setNodeMarkup(s.start,c)}(l||0===l)&&n.lift(s,l)})}),!0},etv=t=>n=>t(n),etb=()=>({state:t,dispatch:n})=>eez(t,n),etx=()=>({tr:t,dispatch:n})=>{let{selection:r}=t,i=r.$anchor.node();if(i.content.size>0)return!1;let o=t.selection.$anchor;for(let a=o.depth;a>0;a-=1)if(o.node(a).type===i.type){if(n){let u=o.before(a),s=o.after(a);t.delete(u,s).scrollIntoView()}return!0}return!1},et_=t=>({tr:n,state:r,dispatch:i})=>{let o=ee1(t,r.schema),a=n.selection.$anchor;for(let u=a.depth;u>0;u-=1)if(a.node(u).type===o){if(i){let s=a.before(u),l=a.after(u);n.delete(s,l).scrollIntoView()}return!0}return!1},etS=t=>({tr:n,dispatch:r})=>{let{from:i,to:o}=t;return r&&n.delete(i,o),!0},etT=()=>({state:t,dispatch:n})=>eeC(t,n),etw=()=>({commands:t})=>t.keyboardShortcut("Enter"),etO=()=>({state:t,dispatch:n})=>eeU(t,n);function etk(t,n,r={strict:!0}){let i=Object.keys(n);return!i.length||i.every(i=>r.strict?n[i]===t[i]:etn(n[i])?n[i].test(t[i]):n[i]===t[i])}function etC(t,n,r={}){return t.find(t=>t.type===n&&etk(t.attrs,r))}function etI(t,n,r={}){return!!etC(t,n,r)}function etM(t,n,r={}){if(!t||!n)return;let i=t.parent.childAfter(t.parentOffset);if(t.parentOffset===i.offset&&0!==i.offset&&(i=t.parent.childBefore(t.parentOffset)),!i.node)return;let o=etC([...i.node.marks],n,r);if(!o)return;let a=i.index,u=t.start()+i.offset,s=a+1,l=u+i.node.nodeSize;for(etC([...i.node.marks],n,r);a>0&&o.isInSet(t.parent.child(a-1).marks);)a-=1,u-=t.parent.child(a).nodeSize;for(;s<t.parent.childCount&&etI([...t.parent.child(s).marks],n,r);)l+=t.parent.child(s).nodeSize,s+=1;return{from:u,to:l}}function etR(t,n){if("string"==typeof t){if(!n.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return n.marks[t]}return t}let etE=(t,n={})=>({tr:r,state:i,dispatch:o})=>{let a=etR(t,i.schema),{doc:u,selection:s}=r,{$from:l,from:c,to:d}=s;if(o){let f=etM(l,a,n);if(f&&f.from<=c&&f.to>=d){let p=JC.create(u,f.from,f.to);r.setSelection(p)}}return!0},etj=t=>n=>{let r="function"==typeof t?t(n):t;for(let i=0;i<r.length;i+=1)if(r[i](n))return!0;return!1};function etA(t){return t instanceof JC}function etN(t=0,n=0,r=0){return Math.min(Math.max(t,n),r)}function etP(t,n=null){if(!n)return null;let r=JT.atStart(t),i=JT.atEnd(t);if("start"===n||!0===n)return r;if("end"===n)return i;let o=r.from,a=i.to;return"all"===n?JC.create(t,etN(0,o,a),etN(t.content.size,o,a)):JC.create(t,etN(n,o,a),etN(n,o,a))}function etL(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}let etD=(t=null,n={})=>({editor:r,view:i,tr:o,dispatch:a})=>{n={scrollIntoView:!0,...n};let u=()=>{etL()&&i.dom.focus(),requestAnimationFrame(()=>{r.isDestroyed||(i.focus(),null!=n&&n.scrollIntoView&&r.commands.scrollIntoView())})};if(i.hasFocus()&&null===t||!1===t)return!0;if(a&&null===t&&!etA(r.state.selection))return u(),!0;let s=etP(o.doc,t)||r.state.selection,l=r.state.selection.eq(s);return a&&(l||o.setSelection(s),l&&o.storedMarks&&o.setStoredMarks(o.storedMarks),u()),!0},etF=(t,n)=>r=>t.every((t,i)=>n(t,{...r,index:i})),etW=(t,n)=>({tr:r,commands:i})=>i.insertContentAt({from:r.selection.from,to:r.selection.to},t,n);function etU(t){let n=`<body>${t}</body>`;return new window.DOMParser().parseFromString(n,"text/html").body}function etz(t,n,r){if(r={slice:!0,parseOptions:{},...r},"object"==typeof t&&null!==t)try{return Array.isArray(t)&&t.length>0?Z5.fromArray(t.map(t=>n.nodeFromJSON(t))):n.nodeFromJSON(t)}catch(i){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",i),etz("",n,r)}if("string"==typeof t){let o=YP.fromSchema(n);return r.slice?o.parseSlice(etU(t),r.parseOptions).content:o.parse(etU(t),r.parseOptions)}return etz("",n,r)}let etB=t=>t.toString().startsWith("<"),etV=(t,n,r)=>({tr:i,dispatch:o,editor:a})=>{if(o){r={parseOptions:{},updateSelection:!0,...r};let u=etz(n,a.schema,{parseOptions:{preserveWhitespace:"full",...r.parseOptions}});if("<>"===u.toString())return!0;let{from:s,to:l}="number"==typeof t?{from:t,to:t}:t,c=!0,d=!0;if((etB(u)?u:[u]).forEach(t=>{t.check(),c=!!c&&t.isText&&0===t.marks.length,d=!!d&&t.isBlock}),s===l&&d){let{parent:f}=i.doc.resolve(s);!f.isTextblock||f.type.spec.code||f.childCount||(s-=1,l+=1)}c?Array.isArray(n)?i.insertText(n.map(t=>t.text||"").join(""),s,l):"object"==typeof n&&n&&n.text?i.insertText(n.text,s,l):i.insertText(n,s,l):i.replaceWith(s,l,u),r.updateSelection&&function(t,n,r){let i=t.steps.length-1;if(i<n)return;let o=t.steps[i];if(!(o instanceof Y9||o instanceof Y8))return;let a=t.mapping.maps[i],u=0;a.forEach((t,n,r,i)=>{0===u&&(u=i)}),t.setSelection(JT.near(t.doc.resolve(u),-1))}(i,i.steps.length-1,-1)}return!0},et$=()=>({state:t,dispatch:n})=>eeP(t,n),etq=()=>({state:t,dispatch:n})=>eeL(t,n),etK=()=>({state:t,dispatch:n})=>eeI(t,n),etH=()=>({state:t,dispatch:n})=>eej(t,n);function etG(){return"u">typeof navigator&&/Mac/.test(navigator.platform)}let etZ=t=>({editor:n,view:r,tr:i,dispatch:o})=>{let a=(function(t){let n=t.split(/-(?!$)/),r=n[n.length-1];"Space"===r&&(r=" ");let i,o,a,u;for(let s=0;s<n.length-1;s+=1){let l=n[s];if(/^(cmd|meta|m)$/i.test(l))u=!0;else if(/^a(lt)?$/i.test(l))i=!0;else if(/^(c|ctrl|control)$/i.test(l))o=!0;else if(/^s(hift)?$/i.test(l))a=!0;else if(/^mod$/i.test(l))etL()||etG()?u=!0:o=!0;else throw Error(`Unrecognized modifier name: ${l}`)}return i&&(r=`Alt-${r}`),o&&(r=`Ctrl-${r}`),u&&(r=`Meta-${r}`),a&&(r=`Shift-${r}`),r})(t).split(/-(?!$)/),u=a.find(t=>!["Alt","Ctrl","Meta","Shift"].includes(t)),s=new KeyboardEvent("keydown",{key:"Space"===u?" ":u,altKey:a.includes("Alt"),ctrlKey:a.includes("Ctrl"),metaKey:a.includes("Meta"),shiftKey:a.includes("Shift"),bubbles:!0,cancelable:!0}),l=n.captureTransaction(()=>{r.someProp("handleKeyDown",t=>t(r,s))});return null==l||l.steps.forEach(t=>{let n=t.map(i.mapping);n&&o&&i.maybeStep(n)}),!0};function etY(t,n,r={}){let{from:i,to:o,empty:a}=t.selection,u=n?ee1(n,t.schema):null,s=[];t.doc.nodesBetween(i,o,(t,n)=>{if(t.isText)return;let r=Math.min(o,n+t.nodeSize);s.push({node:t,from:Math.max(i,n),to:r})});let l=s.filter(t=>!u||u.name===t.node.type.name).filter(t=>etk(t.node.attrs,r,{strict:!1}));return a?!!l.length:l.reduce((t,n)=>t+n.to-n.from,0)>=o-i}let etJ=(t,n={})=>({state:r,dispatch:i})=>{let o=ee1(t,r.schema);return!!etY(r,o,n)&&eeD(r,i)},etQ=()=>({state:t,dispatch:n})=>eeB(t,n),etX=t=>({state:n,dispatch:r})=>{var i;let o=ee1(t,n.schema);return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==o);return!!a&&(!n||(r.node(a.depth-1).type==o?function(t,n,r,i){let o=t.tr,a=i.end,u=i.$to.end(i.depth);a<u&&(o.step(new Y8(a-1,u,a,u,new Yt(Z5.from(r.create(null,i.parent.copy())),1,0),1,!0)),i=new Yf(o.doc.resolve(i.$from.pos),o.doc.resolve(u),i.depth));let s=Jt(i);if(null==s)return!1;o.lift(i,s);let l=o.mapping.map(a,-1)-1;return Jo(o.doc,l)&&o.join(l),n(o.scrollIntoView()),!0}(t,n,o,a):function(t,n,r){let i=t.tr,o=r.parent;for(let a=r.end,u=r.endIndex-1,s=r.startIndex;u>s;u--)a-=o.child(u).nodeSize,i.delete(a-1,a+1);let l=i.doc.resolve(r.start),c=l.nodeAfter;if(i.mapping.map(r.end)!=r.start+l.nodeAfter.nodeSize)return!1;let d=0==r.startIndex,f=r.endIndex==o.childCount,p=l.node(-1),h=l.index(-1);if(!p.canReplace(h+(d?0:1),h+1,c.content.append(f?Z5.empty:Z5.from(o))))return!1;let m=l.pos,g=m+c.nodeSize;return i.step(new Y8(m-(d?1:0),g+(f?1:0),m+1,g-1,new Yt((d?Z5.empty:Z5.from(o.copy(Z5.empty))).append(f?Z5.empty:Z5.from(o.copy(Z5.empty))),d?0:1,f?0:1),d?0:1)),n(i.scrollIntoView()),!0}(t,n,a)))}(n,r)},et0=()=>({state:t,dispatch:n})=>eeF(t,n);function et1(t,n){return n.nodes[t]?"node":n.marks[t]?"mark":null}function et2(t,n){let r="string"==typeof n?[n]:n;return Object.keys(t).reduce((n,i)=>(r.includes(i)||(n[i]=t[i]),n),{})}let et3=(t,n)=>({tr:r,state:i,dispatch:o})=>{let a=null,u=null,s=et1("string"==typeof t?t:t.name,i.schema);return!!s&&("node"===s&&(a=ee1(t,i.schema)),"mark"===s&&(u=etR(t,i.schema)),o&&r.selection.ranges.forEach(t=>{i.doc.nodesBetween(t.$from.pos,t.$to.pos,(t,i)=>{a&&a===t.type&&r.setNodeMarkup(i,void 0,et2(t.attrs,n)),u&&t.marks.length&&t.marks.forEach(o=>{u===o.type&&r.addMark(i,i+t.nodeSize,u.create(et2(o.attrs,n)))})})}),!0)},et4=()=>({tr:t,dispatch:n})=>(n&&t.scrollIntoView(),!0),et5=()=>({tr:t,commands:n})=>n.setTextSelection({from:0,to:t.doc.content.size}),et6=()=>({state:t,dispatch:n})=>eeR(t,n),et9=()=>({state:t,dispatch:n})=>eeA(t,n),et8=()=>({state:t,dispatch:n})=>eeV(t,n),et7=()=>({state:t,dispatch:n})=>eeH(t,n),ene=()=>({state:t,dispatch:n})=>eeK(t,n);function ent(t,n,r={}){return etz(t,n,{slice:!1,parseOptions:r})}let enn=(t,n=!1,r={})=>({tr:i,editor:o,dispatch:a})=>{let{doc:u}=i,s=ent(t,o.schema,r);return a&&i.replaceWith(0,u.content.size,s).setMeta("preventUpdate",!n),!0};function enr(t){return n=>(function(t,n){for(let r=t.depth;r>0;r-=1){let i=t.node(r);if(n(i))return{pos:r>0?t.before(r):0,start:t.start(r),depth:r,node:i}}})(n.$from,t)}function eni(t,n){let r=etR(n,t.schema),{from:i,to:o,empty:a}=t.selection,u=[];a?(t.storedMarks&&u.push(...t.storedMarks),u.push(...t.selection.$head.marks())):t.doc.nodesBetween(i,o,t=>{u.push(...t.marks)});let s=u.find(t=>t.type.name===r.name);return s?{...s.attrs}:{}}function eno(t,n,r){let i=[];return t===n?r.resolve(t).marks().forEach(n=>{let o=r.resolve(t-1),a=etM(o,n.type);a&&i.push({mark:n,...a})}):r.nodesBetween(t,n,(t,n)=>{i.push(...t.marks.map(r=>({from:n,to:n+t.nodeSize,mark:r})))}),i}function ena(t,n,r){return Object.fromEntries(Object.entries(r).filter(([r])=>{let i=t.find(t=>t.type===n&&t.name===r);return!!i&&i.attribute.keepOnSplit}))}function enu(t,n,r={}){let{empty:i,ranges:o}=t.selection,a=n?etR(n,t.schema):null;if(i)return!!(t.storedMarks||t.selection.$from.marks()).filter(t=>!a||a.name===t.type.name).find(t=>etk(t.attrs,r,{strict:!1}));let u=0,s=[];if(o.forEach(({$from:n,$to:r})=>{let i=n.pos,o=r.pos;t.doc.nodesBetween(i,o,(t,n)=>{if(!t.isText&&!t.marks.length)return;let r=Math.max(i,n),a=Math.min(o,n+t.nodeSize);u+=a-r,s.push(...t.marks.map(t=>({mark:t,from:r,to:a})))})}),0===u)return!1;let l=s.filter(t=>!a||a.name===t.mark.type.name).filter(t=>etk(t.mark.attrs,r,{strict:!1})).reduce((t,n)=>t+n.to-n.from,0),c=s.filter(t=>!a||t.mark.type!==a&&t.mark.type.excludes(a)).reduce((t,n)=>t+n.to-n.from,0);return(l>0?l+c:l)>=u}function ens(t,n){let{nodeExtensions:r}=eeX(n),i=r.find(n=>n.name===t);if(!i)return!1;let o={name:i.name,options:i.options,storage:i.storage},a=ee5(eeQ(i,"group",o));return"string"==typeof a&&a.split(" ").includes("list")}let enl=(t,n={})=>({tr:r,state:i,dispatch:o})=>{let{selection:a}=r,{empty:u,ranges:s}=a,l=etR(t,i.schema);if(o){if(u){let c=eni(i,l);r.addStoredMark(l.create({...c,...n}))}else s.forEach(t=>{let o=t.$from.pos,a=t.$to.pos;i.doc.nodesBetween(o,a,(t,i)=>{let u=Math.max(i,o),s=Math.min(i+t.nodeSize,a);t.marks.find(t=>t.type===l)?t.marks.forEach(t=>{l===t.type&&r.addMark(u,s,l.create({...t.attrs,...n}))}):r.addMark(u,s,l.create(n))})})}return function(t,n,r){var i;let{selection:o}=n,a=null;if(etA(o)&&(a=o.$cursor),a){let u=null!==(i=t.storedMarks)&&void 0!==i?i:a.marks();return!!r.isInSet(u)||!u.some(t=>t.type.excludes(r))}let{ranges:s}=o;return s.some(({$from:n,$to:i})=>{let o=0===n.depth&&t.doc.inlineContent&&t.doc.type.allowsMarkType(r);return t.doc.nodesBetween(n.pos,i.pos,(t,n,i)=>{if(o)return!1;if(t.isInline){let a=!i||i.type.allowsMarkType(r),u=!!r.isInSet(t.marks)||!t.marks.some(t=>t.type.excludes(r));o=a&&u}return!o}),o})}(i,r,l)},enc=(t,n)=>({tr:r})=>(r.setMeta(t,n),!0),end=(t,n={})=>({state:r,dispatch:i,chain:o})=>{let a=ee1(t,r.schema);return a.isTextblock?o().command(({commands:t})=>!!eeG(a,n)(r)||t.clearNodes()).command(({state:t})=>eeG(a,n)(t,i)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},enf=t=>({tr:n,dispatch:r})=>{if(r){let{doc:i}=n,o=etN(t,0,i.content.size),a=JM.create(i,o);n.setSelection(a)}return!0},enp=t=>({tr:n,dispatch:r})=>{if(r){let{doc:i}=n,{from:o,to:a}="number"==typeof t?{from:t,to:t}:t,u=JC.atStart(i).from,s=JC.atEnd(i).to,l=etN(o,u,s),c=etN(a,u,s),d=JC.create(i,l,c);n.setSelection(d)}return!0},enh=t=>({state:n,dispatch:r})=>{var i;let o=ee1(t,n.schema);return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==o);if(!a)return!1;let u=a.startIndex;if(0==u)return!1;let s=a.parent,l=s.child(u-1);if(l.type!=o)return!1;if(n){let c=l.lastChild&&l.lastChild.type==s.type,d=Z5.from(c?o.create():null),f=new Yt(Z5.from(o.create(null,Z5.from(s.type.create(null,d)))),c?3:1,0),p=a.start,h=a.end;n(t.tr.step(new Y8(p-(c?3:1),h,p,h,f,1,!0)).scrollIntoView())}return!0}(n,r)};function enm(t,n){let r=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(r){let i=r.filter(t=>null==n?void 0:n.includes(t.type.name));t.tr.ensureMarks(i)}}let eng=({keepMarks:t=!0}={})=>({tr:n,state:r,dispatch:i,editor:o})=>{let{selection:a,doc:u}=n,{$from:s,$to:l}=a,c=o.extensionManager.attributes,d=ena(c,s.node().type.name,s.node().attrs);if(a instanceof JM&&a.node.isBlock)return!!(s.parentOffset&&Ji(u,s.pos))&&(i&&(t&&enm(r,o.extensionManager.splittableMarks),n.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;if(i){let f=l.parentOffset===l.parent.content.size;a instanceof JC&&n.deleteSelection();let p=0===s.depth?void 0:function(t){for(let n=0;n<t.edgeCount;n+=1){let{type:r}=t.edge(n);if(r.isTextblock&&!r.hasRequiredAttrs())return r}return null}(s.node(-1).contentMatchAt(s.indexAfter(-1))),h=f&&p?[{type:p,attrs:d}]:void 0,m=Ji(n.doc,n.mapping.map(s.pos),1,h);if(!h&&!m&&Ji(n.doc,n.mapping.map(s.pos),1,p?[{type:p}]:void 0)&&(m=!0,h=p?[{type:p,attrs:d}]:void 0),m&&(n.split(n.mapping.map(s.pos),1,h),p&&!f&&!s.parentOffset&&s.parent.type!==p)){let g=n.mapping.map(s.before()),y=n.doc.resolve(g);s.node(-1).canReplaceWith(y.index(),y.index()+1,p)&&n.setNodeMarkup(n.mapping.map(s.before()),p)}t&&enm(r,o.extensionManager.splittableMarks),n.scrollIntoView()}return!0},eny=t=>({tr:n,state:r,dispatch:i,editor:o})=>{var a;let u=ee1(t,r.schema),{$from:s,$to:l}=r.selection,c=r.selection.node;if(c&&c.isBlock||s.depth<2||!s.sameParent(l))return!1;let d=s.node(-1);if(d.type!==u)return!1;let f=o.extensionManager.attributes;if(0===s.parent.content.size&&s.node(-1).childCount===s.indexAfter(-1)){if(2===s.depth||s.node(-3).type!==u||s.index(-2)!==s.node(-2).childCount-1)return!1;if(i){let p=Z5.empty,h=s.index(-1)?1:s.index(-2)?2:3;for(let m=s.depth-h;m>=s.depth-3;m-=1)p=Z5.from(s.node(m).copy(p));let g=s.indexAfter(-1)<s.node(-2).childCount?1:s.indexAfter(-2)<s.node(-3).childCount?2:3,y=ena(f,s.node().type.name,s.node().attrs),v=(null===(a=u.contentMatch.defaultType)||void 0===a?void 0:a.createAndFill(y))||void 0;p=p.append(Z5.from(u.createAndFill(null,v)||void 0));let b=s.before(s.depth-(h-1));n.replace(b,s.after(-g),new Yt(p,4-h,0));let x=-1;n.doc.nodesBetween(b,n.doc.content.size,(t,n)=>{if(x>-1)return!1;t.isTextblock&&0===t.content.size&&(x=n+1)}),x>-1&&n.setSelection(JC.near(n.doc.resolve(x))),n.scrollIntoView()}return!0}let _=l.pos===s.end()?d.contentMatchAt(0).defaultType:null,S=ena(f,d.type.name,d.attrs),T=ena(f,s.node().type.name,s.node().attrs);if(n.delete(s.pos,l.pos),!Ji(n.doc,s.pos,2))return!1;if(i){let{selection:w,storedMarks:O}=r,{splittableMarks:k}=o.extensionManager,C=O||w.$to.parentOffset&&w.$from.marks();if(n.split(s.pos,2,_?[{type:u,attrs:S},{type:_,attrs:T}]:[{type:u,attrs:S}]).scrollIntoView(),!C||!i)return!0;let I=C.filter(t=>k.includes(t.type.name));n.ensureMarks(I)}return!0},env=(t,n)=>{let r=enr(t=>t.type===n)(t.selection);if(!r)return!0;let i=t.doc.resolve(Math.max(0,r.pos-1)).before(r.depth);if(void 0===i)return!0;let o=t.doc.nodeAt(i);return r.node.type===(null==o?void 0:o.type)&&Jo(t.doc,r.pos)&&t.join(r.pos),!0},enb=(t,n)=>{let r=enr(t=>t.type===n)(t.selection);if(!r)return!0;let i=t.doc.resolve(r.start).after(r.depth);if(void 0===i)return!0;let o=t.doc.nodeAt(i);return r.node.type===(null==o?void 0:o.type)&&Jo(t.doc,i)&&t.join(i),!0},enx=(t,n,r,i={})=>({editor:o,tr:a,state:u,dispatch:s,chain:l,commands:c,can:d})=>{let{extensions:f,splittableMarks:p}=o.extensionManager,h=ee1(t,u.schema),m=ee1(n,u.schema),{selection:g,storedMarks:y}=u,{$from:v,$to:b}=g,x=v.blockRange(b),_=y||g.$to.parentOffset&&g.$from.marks();if(!x)return!1;let S=enr(t=>ens(t.type.name,f))(g);if(x.depth>=1&&S&&x.depth-S.depth<=1){if(S.node.type===h)return c.liftListItem(m);if(ens(S.node.type.name,f)&&h.validContent(S.node.content)&&s)return l().command(()=>(a.setNodeMarkup(S.pos,h),!0)).command(()=>env(a,h)).command(()=>enb(a,h)).run()}return r&&_&&s?l().command(()=>{let t=d().wrapInList(h,i),n=_.filter(t=>p.includes(t.type.name));return a.ensureMarks(n),!!t||c.clearNodes()}).wrapInList(h,i).command(()=>env(a,h)).command(()=>enb(a,h)).run():l().command(()=>!!d().wrapInList(h,i)||c.clearNodes()).wrapInList(h,i).command(()=>env(a,h)).command(()=>enb(a,h)).run()},en_=(t,n={},r={})=>({state:i,commands:o})=>{let{extendEmptyMarkRange:a=!1}=r,u=etR(t,i.schema);return enu(i,u,n)?o.unsetMark(u,{extendEmptyMarkRange:a}):o.setMark(u,n)},enS=(t,n,r={})=>({state:i,commands:o})=>{let a=ee1(t,i.schema),u=ee1(n,i.schema);return etY(i,a,r)?o.setNode(u):o.setNode(a,r)},enT=(t,n={})=>({state:r,commands:i})=>{let o=ee1(t,r.schema);return etY(r,o,n)?i.lift(o):i.wrapIn(o,n)},enw=()=>({state:t,dispatch:n})=>{let r=t.plugins;for(let i=0;i<r.length;i+=1){let o=r[i],a;if(o.spec.isInputRules&&(a=o.getState(t))){if(n){let u=t.tr,s=a.transform;for(let l=s.steps.length-1;l>=0;l-=1)u.step(s.steps[l].invert(s.docs[l]));if(a.text){let c=u.doc.resolve(a.from).marks();u.replaceWith(a.from,a.to,t.schema.text(a.text,c))}else u.delete(a.from,a.to)}return!0}}return!1},enO=()=>({tr:t,dispatch:n})=>{let{selection:r}=t,{empty:i,ranges:o}=r;return i||n&&o.forEach(n=>{t.removeMark(n.$from.pos,n.$to.pos)}),!0},enk=(t,n={})=>({tr:r,state:i,dispatch:o})=>{var a;let{extendEmptyMarkRange:u=!1}=n,{selection:s}=r,l=etR(t,i.schema),{$from:c,empty:d,ranges:f}=s;if(!o)return!0;if(d&&u){let{from:p,to:h}=s,m=null===(a=c.marks().find(t=>t.type===l))||void 0===a?void 0:a.attrs,g=etM(c,l,m);g&&(p=g.from,h=g.to),r.removeMark(p,h,l)}else f.forEach(t=>{r.removeMark(t.$from.pos,t.$to.pos,l)});return r.removeStoredMark(l),!0},enC=(t,n={})=>({tr:r,state:i,dispatch:o})=>{let a=null,u=null,s=et1("string"==typeof t?t:t.name,i.schema);return!!s&&("node"===s&&(a=ee1(t,i.schema)),"mark"===s&&(u=etR(t,i.schema)),o&&r.selection.ranges.forEach(t=>{let o=t.$from.pos,s=t.$to.pos;i.doc.nodesBetween(o,s,(t,i)=>{a&&a===t.type&&r.setNodeMarkup(i,void 0,{...t.attrs,...n}),u&&t.marks.length&&t.marks.forEach(a=>{if(u===a.type){let l=Math.min(i+t.nodeSize,s);r.addMark(Math.max(i,o),l,u.create({...a.attrs,...n}))}})})}),!0)},enI=(t,n={})=>({state:r,dispatch:i})=>{let o=ee1(t,r.schema);return(function(t,n=null){return function(r,i){let{$from:o,$to:a}=r.selection,u=o.blockRange(a),s=u&&Jn(u,t,n);return!!s&&(i&&i(r.tr.wrap(u,s).scrollIntoView()),!0)}})(o,n)(r,i)},enM=(t,n={})=>({state:r,dispatch:i})=>{let o=ee1(t,r.schema);return(function(t,n=null){return function(r,i){let{$from:o,$to:a}=r.selection,u=o.blockRange(a),s=!1,l=u;if(!u)return!1;if(u.depth>=2&&o.node(u.depth-1).type.compatibleContent(t)&&0==u.startIndex){if(0==o.index(u.depth-1))return!1;let c=r.doc.resolve(u.start-2);l=new Yf(c,c,u.depth),u.endIndex<u.parent.childCount&&(u=new Yf(o,r.doc.resolve(a.end(u.depth)),u.depth)),s=!0}let d=Jn(l,t,n,u);return!!d&&(i&&i((function(t,n,r,i,o){let a=Z5.empty;for(let u=r.length-1;u>=0;u--)a=Z5.from(r[u].type.create(r[u].attrs,a));t.step(new Y8(n.start-(i?2:0),n.end,n.start,n.end,new Yt(a,0,0),r.length,!0));let s=0;for(let l=0;l<r.length;l++)r[l].type==o&&(s=l+1);let c=r.length-s,d=n.start+r.length-(i?2:0),f=n.parent;for(let p=n.startIndex,h=n.endIndex,m=!0;p<h;p++,m=!1)!m&&Ji(t.doc,d,c)&&(t.split(d,c),d+=2*c),d+=f.child(p).nodeSize;return t})(r.tr,u,d,s,t).scrollIntoView()),!0)}})(o,n)(r,i)};var enR=Object.freeze({__proto__:null,blur:etm,clearContent:etg,clearNodes:ety,command:etv,createParagraphNear:etb,deleteCurrentNode:etx,deleteNode:et_,deleteRange:etS,deleteSelection:etT,enter:etw,exitCode:etO,extendMarkRange:etE,first:etj,focus:etD,forEach:etF,insertContent:etW,insertContentAt:etV,joinUp:et$,joinDown:etq,joinBackward:etK,joinForward:etH,keyboardShortcut:etZ,lift:etJ,liftEmptyBlock:etQ,liftListItem:etX,newlineInCode:et0,resetAttributes:et3,scrollIntoView:et4,selectAll:et5,selectNodeBackward:et6,selectNodeForward:et9,selectParentNode:et8,selectTextblockEnd:et7,selectTextblockStart:ene,setContent:enn,setMark:enl,setMeta:enc,setNode:end,setNodeSelection:enf,setTextSelection:enp,sinkListItem:enh,splitBlock:eng,splitListItem:eny,toggleList:enx,toggleMark:en_,toggleNode:enS,toggleWrap:enT,undoInputRule:enw,unsetAllMarks:enO,unsetMark:enk,updateAttributes:enC,wrapIn:enI,wrapInList:enM});let enE=etd.create({name:"commands",addCommands:()=>({...enR})}),enj=etd.create({name:"editable",addProseMirrorPlugins(){return[new Jz({key:new J$("editable"),props:{editable:()=>this.editor.options.editable}})]}}),enA=etd.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:t}=this;return[new Jz({key:new J$("focusEvents"),props:{handleDOMEvents:{focus(n,r){t.isFocused=!0;let i=t.state.tr.setMeta("focus",{event:r}).setMeta("addToHistory",!1);return n.dispatch(i),!1},blur(n,r){t.isFocused=!1;let i=t.state.tr.setMeta("blur",{event:r}).setMeta("addToHistory",!1);return n.dispatch(i),!1}}}})]}}),enN=etd.create({name:"keymap",addKeyboardShortcuts(){let t=()=>this.editor.commands.first(({commands:t})=>[()=>t.undoInputRule(),()=>t.command(({tr:n})=>{let{selection:r,doc:i}=n,{empty:o,$anchor:a}=r,{pos:u,parent:s}=a,l=JT.atStart(i).from===u;return!!o&&!!l&&!!s.type.isTextblock&&!s.textContent.length&&t.clearNodes()}),()=>t.deleteSelection(),()=>t.joinBackward(),()=>t.selectNodeBackward()]),n=()=>this.editor.commands.first(({commands:t})=>[()=>t.deleteSelection(),()=>t.deleteCurrentNode(),()=>t.joinForward(),()=>t.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:t})=>[()=>t.newlineInCode(),()=>t.createParagraphNear(),()=>t.liftEmptyBlock(),()=>t.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:n,"Mod-Delete":n,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":n,"Ctrl-Alt-Backspace":n,"Alt-Delete":n,"Alt-d":n,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return etL()||etG()?o:i},addProseMirrorPlugins(){return[new Jz({key:new J$("clearDocument"),appendTransaction:(t,n,r)=>{if(!(t.some(t=>t.docChanged)&&!n.doc.eq(r.doc)))return;let{empty:i,from:o,to:a}=n.selection,u=JT.atStart(n.doc).from,s=JT.atEnd(n.doc).to;if(i||!(o===u&&a===s)||0!==r.doc.textBetween(0,r.doc.content.size," "," ").length)return;let l=r.tr,c=eeZ({state:r,transaction:l}),{commands:d}=new eeY({editor:this.editor,state:c});if(d.clearNodes(),l.steps.length)return l}})]}}),enP=etd.create({name:"tabindex",addProseMirrorPlugins(){return[new Jz({key:new J$("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var enL=Object.freeze({__proto__:null,ClipboardTextSerializer:eth,Commands:enE,Editable:enj,FocusEvents:enA,Keymap:enN,Tabindex:enP});let enD=`.ProseMirror {
|
|
17
|
-
position: relative;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.ProseMirror {
|
|
21
|
-
word-wrap: break-word;
|
|
22
|
-
white-space: pre-wrap;
|
|
23
|
-
white-space: break-spaces;
|
|
24
|
-
-webkit-font-variant-ligatures: none;
|
|
25
|
-
font-variant-ligatures: none;
|
|
26
|
-
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.ProseMirror [contenteditable="false"] {
|
|
30
|
-
white-space: normal;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
|
|
34
|
-
white-space: pre-wrap;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.ProseMirror pre {
|
|
38
|
-
white-space: pre-wrap;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
img.ProseMirror-separator {
|
|
42
|
-
display: inline !important;
|
|
43
|
-
border: none !important;
|
|
44
|
-
margin: 0 !important;
|
|
45
|
-
width: 1px !important;
|
|
46
|
-
height: 1px !important;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.ProseMirror-gapcursor {
|
|
50
|
-
display: none;
|
|
51
|
-
pointer-events: none;
|
|
52
|
-
position: absolute;
|
|
53
|
-
margin: 0;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.ProseMirror-gapcursor:after {
|
|
57
|
-
content: "";
|
|
58
|
-
display: block;
|
|
59
|
-
position: absolute;
|
|
60
|
-
top: -2px;
|
|
61
|
-
width: 20px;
|
|
62
|
-
border-top: 1px solid black;
|
|
63
|
-
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
@keyframes ProseMirror-cursor-blink {
|
|
67
|
-
to {
|
|
68
|
-
visibility: hidden;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.ProseMirror-hideselection *::selection {
|
|
73
|
-
background: transparent;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.ProseMirror-hideselection *::-moz-selection {
|
|
77
|
-
background: transparent;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.ProseMirror-hideselection * {
|
|
81
|
-
caret-color: transparent;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
85
|
-
display: block;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.tippy-box[data-animation=fade][data-state=hidden] {
|
|
89
|
-
opacity: 0
|
|
90
|
-
}`,enF=class extends eeJ{constructor(t={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=function(t,n){let r=document.querySelector("style[data-tiptap-style]");if(null!==r)return r;let i=document.createElement("style");return n&&i.setAttribute("nonce",n),i.setAttribute("data-tiptap-style",""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}(enD,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},this.view&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,n=!0){this.setOptions({editable:t}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(t,n){let r=ee4(n)?n(t,[...this.state.plugins]):[...this.state.plugins,t],i=this.state.reconfigure({plugins:r});this.view.updateState(i)}unregisterPlugin(t){if(this.isDestroyed)return;let n="string"==typeof t?`${t}$`:t.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(t=>!t.key.startsWith(n))});this.view.updateState(r)}createExtensionManager(){let t=[...this.options.enableCoreExtensions?Object.values(enL):[],...this.options.extensions].filter(t=>["extension","node","mark"].includes(null==t?void 0:t.type));this.extensionManager=new ets(t,this)}createCommandManager(){this.commandManager=new eeY({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){let t=ent(this.options.content,this.schema,this.options.parseOptions),n=etP(t,this.options.autofocus);this.view=new eef(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:JU.create({doc:t,selection:n||void 0})});let r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews();let i=this.view.dom;i.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;let n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(t=>{var n;return null===(n=this.capturedTransaction)||void 0===n?void 0:n.step(t)});return}let n=this.state.apply(t),r=!this.state.selection.eq(n.selection);this.view.updateState(n),this.emit("transaction",{editor:this,transaction:t}),r&&this.emit("selectionUpdate",{editor:this,transaction:t});let i=t.getMeta("focus"),o=t.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:t}),o&&this.emit("blur",{editor:this,event:o.event,transaction:t}),!t.docChanged||t.getMeta("preventUpdate")||this.emit("update",{editor:this,transaction:t})}getAttributes(t){return function(t,n){let r=et1("string"==typeof n?n:n.name,t.schema);return"node"===r?function(t,n){let r=ee1(n,t.schema),{from:i,to:o}=t.selection,a=[];t.doc.nodesBetween(i,o,t=>{a.push(t)});let u=a.reverse().find(t=>t.type.name===r.name);return u?{...u.attrs}:{}}(t,n):"mark"===r?eni(t,n):{}}(this.state,t)}isActive(t,n){return function(t,n,r={}){if(!n)return etY(t,null,r)||enu(t,null,r);let i=et1(n,t.schema);return"node"===i?etY(t,n,r):"mark"===i&&enu(t,n,r)}(this.state,"string"==typeof t?t:null,"string"==typeof t?n:t)}getJSON(){return this.state.doc.toJSON()}getHTML(){return function(t,n){let r=Yq.fromSchema(n).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(r),i.innerHTML}(this.state.doc.content,this.schema)}getText(t){let{blockSeparator:n=`
|
|
91
|
-
|
|
92
|
-
`,textSerializers:r={}}=t||{};return function(t,n){let r={from:0,to:t.content.size};return etf(t,r,n)}(this.state.doc,{blockSeparator:n,textSerializers:{...etp(this.schema),...r}})}get isEmpty(){return function(t){var n;let r=null===(n=t.type.createAndFill())||void 0===n?void 0:n.toJSON(),i=t.toJSON();return JSON.stringify(r)===JSON.stringify(i)}(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var t;return!(!(null===(t=this.view)||void 0===t)&&t.docView)}};function enW(t){return new etr({find:t.find,handler({state:n,range:r,match:i}){let o=ee5(t.getAttributes,void 0,i);if(!1===o||null===o)return null;let{tr:a}=n,u=i[i.length-1],s=i[0],l=r.to;if(u){let c=s.search(/\S/),d=r.from+s.indexOf(u),f=d+u.length;if(eno(r.from,r.to,n.doc).filter(n=>n.mark.type.excluded.find(r=>r===t.type&&r!==n.mark.type)).filter(t=>t.to>d).length)return null;f<r.to&&a.delete(f,r.to),d>r.from&&a.delete(r.from+c,d),l=r.from+c+u.length,a.addMark(r.from+c,l,t.type.create(o||{})),a.removeStoredMark(t.type)}}})}function enU(t){return new etr({find:t.find,handler({state:n,range:r,match:i}){let o=n.doc.resolve(r.from),a=ee5(t.getAttributes,void 0,i)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t.type))return null;n.tr.delete(r.from,r.to).setBlockType(r.from,r.from,t.type,a)}})}function enz(t){return new etr({find:t.find,handler({state:n,range:r,match:i,chain:o}){let a=ee5(t.getAttributes,void 0,i)||{},u=n.tr.delete(r.from,r.to),s=u.doc.resolve(r.from).blockRange(),l=s&&Jn(s,t.type,a);if(!l)return null;if(u.wrap(s,l),t.keepMarks&&t.editor){let{selection:c,storedMarks:d}=n,{splittableMarks:f}=t.editor.extensionManager,p=d||c.$to.parentOffset&&c.$from.marks();if(p){let h=p.filter(t=>f.includes(t.type.name));u.ensureMarks(h)}}if(t.keepAttributes){let m="bulletList"===t.type.name||"orderedList"===t.type.name?"listItem":"taskList";o().updateAttributes(m,a).run()}let g=u.doc.resolve(r.from-1).nodeBefore;g&&g.type===t.type&&Jo(u.doc,r.from-1)&&(!t.joinPredicate||t.joinPredicate(i,g))&&u.join(r.from-1)}})}let enB=class t{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ee5(eeQ(this,"addOptions",{name:this.name}))),this.storage=ee5(eeQ(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(n={}){return new t(n)}configure(t={}){let n=this.extend();return n.options=etc(this.options,t),n.storage=ee5(eeQ(n,"addStorage",{name:n.name,options:n.options})),n}extend(n={}){let r=new t(n);return r.parent=this,this.child=r,r.name=n.name?n.name:r.parent.name,n.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${r.name}".`),r.options=ee5(eeQ(r,"addOptions",{name:r.name})),r.storage=ee5(eeQ(r,"addStorage",{name:r.name,options:r.options})),r}static handleExit({editor:t,mark:n}){let{tr:r}=t.state,i=t.state.selection.$from;if(i.pos===i.end()){let o=i.marks();if(!o.find(t=>(null==t?void 0:t.type.name)===n.name))return!1;let a=o.find(t=>(null==t?void 0:t.type.name)===n.name);return a&&r.removeStoredMark(a),r.insertText(" ",i.pos),t.view.dispatch(r),!0}return!1}};class enV{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ee5(eeQ(this,"addOptions",{name:this.name}))),this.storage=ee5(eeQ(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new enV(t)}configure(t={}){let n=this.extend();return n.options=etc(this.options,t),n.storage=ee5(eeQ(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){let n=new enV(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=ee5(eeQ(n,"addOptions",{name:n.name})),n.storage=ee5(eeQ(n,"addStorage",{name:n.name,options:n.options})),n}}class en${constructor(t,n,r){this.isDragging=!1,this.component=t,this.editor=n.editor,this.options={stopEvent:null,ignoreMutation:null,...r},this.extension=n.extension,this.node=n.node,this.decorations=n.decorations,this.getPos=n.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(t){var n,r,i,o,a,u,s;let{view:l}=this.editor,c=t.target,d=3===c.nodeType?null===(n=c.parentElement)||void 0===n?void 0:n.closest("[data-drag-handle]"):c.closest("[data-drag-handle]");if(!this.dom||!(null===(r=this.contentDOM)||void 0===r)&&r.contains(c)||!d)return;let f=0,p=0;if(this.dom!==d){let h=this.dom.getBoundingClientRect(),m=d.getBoundingClientRect(),g=null!==(i=t.offsetX)&&void 0!==i?i:null===(o=t.nativeEvent)||void 0===o?void 0:o.offsetX,y=null!==(a=t.offsetY)&&void 0!==a?a:null===(u=t.nativeEvent)||void 0===u?void 0:u.offsetY;f=m.x-h.x+g,p=m.y-h.y+y}null===(s=t.dataTransfer)||void 0===s||s.setDragImage(this.dom,f,p);let v=JM.create(l.state.doc,this.getPos()),b=l.state.tr.setSelection(v);l.dispatch(b)}stopEvent(t){var n;if(!this.dom)return!1;if("function"==typeof this.options.stopEvent)return this.options.stopEvent({event:t});let r=t.target;if(!(this.dom.contains(r)&&!(!(null===(n=this.contentDOM)||void 0===n)&&n.contains(r))))return!1;let i=t.type.startsWith("drag"),o="drop"===t.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!o&&!i)return!0;let{isEditable:a}=this.editor,{isDragging:u}=this,s=!!this.node.type.spec.draggable,l=JM.isSelectable(this.node),c="copy"===t.type,d="paste"===t.type,f="cut"===t.type,p="mousedown"===t.type;if(!s&&l&&i&&t.preventDefault(),s&&i&&!u)return t.preventDefault(),!1;if(s&&a&&!u&&p){let h=r.closest("[data-drag-handle]");h&&(this.dom===h||this.dom.contains(h))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(u||o||c||d||f||p&&l)}ignoreMutation(t){return!this.dom||!this.contentDOM||("function"==typeof this.options.ignoreMutation?this.options.ignoreMutation({mutation:t}):!!this.node.isLeaf||!!this.node.isAtom||!("selection"===t.type||this.dom.contains(t.target)&&"childList"===t.type&&etL()&&this.editor.isFocused&&[...Array.from(t.addedNodes),...Array.from(t.removedNodes)].every(t=>t.isContentEditable))&&(this.contentDOM===t.target&&"attributes"===t.type||!this.contentDOM.contains(t.target)))}updateAttributes(t){this.editor.commands.command(({tr:n})=>{let r=this.getPos();return n.setNodeMarkup(r,void 0,{...this.node.attrs,...t}),!0})}deleteNode(){let t=this.getPos(),n=t+this.node.nodeSize;this.editor.commands.deleteRange({from:t,to:n})}}function enq(t){return new eta({find:t.find,handler({state:n,range:r,match:i}){let o=ee5(t.getAttributes,void 0,i);if(!1===o||null===o)return null;let{tr:a}=n,u=i[i.length-1],s=i[0],l=r.to;if(u){let c=s.search(/\S/),d=r.from+s.indexOf(u),f=d+u.length;if(eno(r.from,r.to,n.doc).filter(n=>n.mark.type.excluded.find(r=>r===t.type&&r!==n.mark.type)).filter(t=>t.to>d).length)return null;f<r.to&&a.delete(f,r.to),d>r.from&&a.delete(r.from+c,d),l=r.from+c+u.length,a.addMark(r.from+c,l,t.type.create(o||{})),a.removeStoredMark(t.type)}}})}var enK="bottom",enH="right",enG="left",enZ="auto",enY=["top",enK,enH,enG],enJ="start",enQ="viewport",enX="popper",en0=enY.reduce(function(t,n){return t.concat([n+"-"+enJ,n+"-end"])},[]),en1=[].concat(enY,[enZ]).reduce(function(t,n){return t.concat([n,n+"-"+enJ,n+"-end"])},[]),en2=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function en3(t){return t?(t.nodeName||"").toLowerCase():null}function en4(t){if(null==t)return window;if("[object Window]"!==t.toString()){var n=t.ownerDocument;return n&&n.defaultView||window}return t}function en5(t){var n=en4(t).Element;return t instanceof n||t instanceof Element}function en6(t){var n=en4(t).HTMLElement;return t instanceof n||t instanceof HTMLElement}function en9(t){if(typeof ShadowRoot>"u")return!1;var n=en4(t).ShadowRoot;return t instanceof n||t instanceof ShadowRoot}let en8={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var n=t.state;Object.keys(n.elements).forEach(function(t){var r=n.styles[t]||{},i=n.attributes[t]||{},o=n.elements[t];en6(o)&&en3(o)&&(Object.assign(o.style,r),Object.keys(i).forEach(function(t){var n=i[t];!1===n?o.removeAttribute(t):o.setAttribute(t,!0===n?"":n)}))})},effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow),function(){Object.keys(n.elements).forEach(function(t){var i=n.elements[t],o=n.attributes[t]||{},a=Object.keys(n.styles.hasOwnProperty(t)?n.styles[t]:r[t]).reduce(function(t,n){return t[n]="",t},{});en6(i)&&en3(i)&&(Object.assign(i.style,a),Object.keys(o).forEach(function(t){i.removeAttribute(t)}))})}},requires:["computeStyles"]};function en7(t){return t.split("-")[0]}var ere=Math.max,ert=Math.min,ern=Math.round;function err(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function eri(){return!/^((?!chrome|android).)*safari/i.test(err())}function ero(t,n,r){void 0===n&&(n=!1),void 0===r&&(r=!1);var i=t.getBoundingClientRect(),o=1,a=1;n&&en6(t)&&(o=t.offsetWidth>0&&ern(i.width)/t.offsetWidth||1,a=t.offsetHeight>0&&ern(i.height)/t.offsetHeight||1);var u=(en5(t)?en4(t):window).visualViewport,s=!eri()&&r,l=(i.left+(s&&u?u.offsetLeft:0))/o,c=(i.top+(s&&u?u.offsetTop:0))/a,d=i.width/o,f=i.height/a;return{width:d,height:f,top:c,right:l+d,bottom:c+f,left:l,x:l,y:c}}function era(t){var n=ero(t),r=t.offsetWidth,i=t.offsetHeight;return 1>=Math.abs(n.width-r)&&(r=n.width),1>=Math.abs(n.height-i)&&(i=n.height),{x:t.offsetLeft,y:t.offsetTop,width:r,height:i}}function eru(t,n){var r=n.getRootNode&&n.getRootNode();if(t.contains(n))return!0;if(r&&en9(r)){var i=n;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function ers(t){return en4(t).getComputedStyle(t)}function erl(t){return["table","td","th"].indexOf(en3(t))>=0}function erc(t){return((en5(t)?t.ownerDocument:t.document)||window.document).documentElement}function erd(t){return"html"===en3(t)?t:t.assignedSlot||t.parentNode||(en9(t)?t.host:null)||erc(t)}function erf(t){return en6(t)&&"fixed"!==ers(t).position?t.offsetParent:null}function erp(t){for(var n=en4(t),r=erf(t);r&&erl(r)&&"static"===ers(r).position;)r=erf(r);return r&&("html"===en3(r)||"body"===en3(r)&&"static"===ers(r).position)?n:r||function(t){var n=/firefox/i.test(err());if(/Trident/i.test(err())&&en6(t)&&"fixed"===ers(t).position)return null;var r=erd(t);for(en9(r)&&(r=r.host);en6(r)&&0>["html","body"].indexOf(en3(r));){var i=ers(r);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||n&&"filter"===i.willChange||n&&i.filter&&"none"!==i.filter)return r;r=r.parentNode}return null}(t)||n}function erh(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function erm(t,n,r){return ere(t,ert(n,r))}function erg(){return{top:0,right:0,bottom:0,left:0}}function ery(t){return Object.assign({},erg(),t)}function erv(t,n){return n.reduce(function(n,r){return n[r]=t,n},{})}function erb(t){return t.split("-")[1]}var erx={top:"auto",right:"auto",bottom:"auto",left:"auto"};function er_(t){var n,r,i=t.popper,o=t.popperRect,a=t.placement,u=t.variation,s=t.offsets,l=t.position,c=t.gpuAcceleration,d=t.adaptive,f=t.roundOffsets,p=t.isFixed,h=s.x,m=void 0===h?0:h,g=s.y,y=void 0===g?0:g,v="function"==typeof f?f({x:m,y:y}):{x:m,y:y};m=v.x,y=v.y;var b=s.hasOwnProperty("x"),x=s.hasOwnProperty("y"),_=enG,S="top",T=window;if(d){var w=erp(i),O="clientHeight",k="clientWidth";w===en4(i)&&(w=erc(i),"static"!==ers(w).position&&"absolute"===l&&(O="scrollHeight",k="scrollWidth")),("top"===a||(a===enG||a===enH)&&"end"===u)&&(S=enK,y-=(p&&w===T&&T.visualViewport?T.visualViewport.height:w[O])-o.height,y*=c?1:-1),(a===enG||("top"===a||a===enK)&&"end"===u)&&(_=enH,m-=(p&&w===T&&T.visualViewport?T.visualViewport.width:w[k])-o.width,m*=c?1:-1)}var C,I,M,R,E,j=Object.assign({position:l},d&&erx),A=!0===f?(C={x:m,y:y},I=en4(i),M=C.x,R=C.y,{x:ern(M*(E=I.devicePixelRatio||1))/E||0,y:ern(R*E)/E||0}):{x:m,y:y};return(m=A.x,y=A.y,c)?Object.assign({},j,((n={})[S]=x?"0":"",n[_]=b?"0":"",n.transform=1>=(T.devicePixelRatio||1)?"translate("+m+"px, "+y+"px)":"translate3d("+m+"px, "+y+"px, 0)",n)):Object.assign({},j,((r={})[S]=x?y+"px":"",r[_]=b?m+"px":"",r.transform="",r))}var erS={passive:!0},erT={left:"right",right:"left",bottom:"top",top:"bottom"};function erw(t){return t.replace(/left|right|bottom|top/g,function(t){return erT[t]})}var erO={start:"end",end:"start"};function erk(t){return t.replace(/start|end/g,function(t){return erO[t]})}function erC(t){var n,r=en4(t);return{scrollLeft:r.pageXOffset,scrollTop:r.pageYOffset}}function erI(t){return ero(erc(t)).left+erC(t).scrollLeft}function erM(t){var n=ers(t),r=n.overflow,i=n.overflowX,o=n.overflowY;return/auto|scroll|overlay|hidden/.test(r+o+i)}function erR(t,n){void 0===n&&(n=[]);var r,i=function t(n){return["html","body","#document"].indexOf(en3(n))>=0?n.ownerDocument.body:en6(n)&&erM(n)?n:t(erd(n))}(t),o=i===(null==(r=t.ownerDocument)?void 0:r.body),a=en4(i),u=o?[a].concat(a.visualViewport||[],erM(i)?i:[]):i,s=n.concat(u);return o?s:s.concat(erR(erd(u)))}function erE(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function erj(t,n,r){var i,o,a,u,s,l,c,d,f,p,h,m;return n===enQ?erE(function(t,n){var r=en4(t),i=erc(t),o=r.visualViewport,a=i.clientWidth,u=i.clientHeight,s=0,l=0;if(o){a=o.width,u=o.height;var c=eri();(c||!c&&"fixed"===n)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:a,height:u,x:s+erI(t),y:l}}(t,r)):en5(n)?((a=ero(n,!1,"fixed"===r)).top=a.top+n.clientTop,a.left=a.left+n.clientLeft,a.bottom=a.top+n.clientHeight,a.right=a.left+n.clientWidth,a.width=n.clientWidth,a.height=n.clientHeight,a.x=a.left,a.y=a.top,a):erE((u=erc(t),l=erc(u),c=erC(u),d=null==(s=u.ownerDocument)?void 0:s.body,f=ere(l.scrollWidth,l.clientWidth,d?d.scrollWidth:0,d?d.clientWidth:0),p=ere(l.scrollHeight,l.clientHeight,d?d.scrollHeight:0,d?d.clientHeight:0),h=-c.scrollLeft+erI(u),m=-c.scrollTop,"rtl"===ers(d||l).direction&&(h+=ere(l.clientWidth,d?d.clientWidth:0)-f),{width:f,height:p,x:h,y:m}))}function erA(t){var n,r=t.reference,i=t.element,o=t.placement,a=o?en7(o):null,u=o?erb(o):null,s=r.x+r.width/2-i.width/2,l=r.y+r.height/2-i.height/2;switch(a){case"top":n={x:s,y:r.y-i.height};break;case enK:n={x:s,y:r.y+r.height};break;case enH:n={x:r.x+r.width,y:l};break;case enG:n={x:r.x-i.width,y:l};break;default:n={x:r.x,y:r.y}}var c=a?erh(a):null;if(null!=c){var d="y"===c?"height":"width";switch(u){case enJ:n[c]=n[c]-(r[d]/2-i[d]/2);break;case"end":n[c]=n[c]+(r[d]/2-i[d]/2)}}return n}function erN(t,n){void 0===n&&(n={});var r,i,o,a,u,s,l,c,d,f,p=n,h=p.placement,m=void 0===h?t.placement:h,g=p.strategy,y=void 0===g?t.strategy:g,v=p.boundary,b=p.rootBoundary,x=p.elementContext,_=void 0===x?enX:x,S=p.altBoundary,T=p.padding,w=void 0===T?0:T,O=ery("number"!=typeof w?w:erv(w,enY)),k=t.rects.popper,C=t.elements[void 0!==S&&S?_===enX?"reference":enX:_],I=(r=en5(C)?C:C.contextElement||erc(t.elements.popper),d=(c=[].concat("clippingParents"===(i=void 0===v?"clippingParents":v)?(s=erR(erd(r)),l=["absolute","fixed"].indexOf(ers(r).position)>=0&&en6(r)?erp(r):r,en5(l)?s.filter(function(t){return en5(t)&&eru(t,l)&&"body"!==en3(t)}):[]):[].concat(i),[void 0===b?enQ:b]))[0],(f=c.reduce(function(t,n){var i=erj(r,n,y);return t.top=ere(i.top,t.top),t.right=ert(i.right,t.right),t.bottom=ert(i.bottom,t.bottom),t.left=ere(i.left,t.left),t},erj(r,d,y))).width=f.right-f.left,f.height=f.bottom-f.top,f.x=f.left,f.y=f.top,f),M=ero(t.elements.reference),R=erA({reference:M,element:k,strategy:"absolute",placement:m}),E=erE(Object.assign({},k,R)),j=_===enX?E:M,A={top:I.top-j.top+O.top,bottom:j.bottom-I.bottom+O.bottom,left:I.left-j.left+O.left,right:j.right-I.right+O.right},N=t.modifiersData.offset;if(_===enX&&N){var P=N[m];Object.keys(A).forEach(function(t){var n=[enH,enK].indexOf(t)>=0?1:-1,r=["top",enK].indexOf(t)>=0?"y":"x";A[t]+=P[r]*n})}return A}function erP(t,n,r){return void 0===r&&(r={x:0,y:0}),{top:t.top-n.height-r.y,right:t.right-n.width+r.x,bottom:t.bottom-n.height+r.y,left:t.left-n.width-r.x}}function erL(t){return["top",enH,enK,enG].some(function(n){return t[n]>=0})}var erD={placement:"bottom",modifiers:[],strategy:"absolute"};function erF(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return!n.some(function(t){return!(t&&"function"==typeof t.getBoundingClientRect)})}var erW,erU,erz,erB,erV,er$,erq=(erW={defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var n=t.state,r=t.instance,i=t.options,o=i.scroll,a=void 0===o||o,u=i.resize,s=void 0===u||u,l=en4(n.elements.popper),c=[].concat(n.scrollParents.reference,n.scrollParents.popper);return a&&c.forEach(function(t){t.addEventListener("scroll",r.update,erS)}),s&&l.addEventListener("resize",r.update,erS),function(){a&&c.forEach(function(t){t.removeEventListener("scroll",r.update,erS)}),s&&l.removeEventListener("resize",r.update,erS)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var n=t.state,r=t.name;n.modifiersData[r]=erA({reference:n.rects.reference,element:n.rects.popper,strategy:"absolute",placement:n.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var n=t.state,r=t.options,i=r.gpuAcceleration,o=r.adaptive,a=r.roundOffsets,u=void 0===a||a,s={placement:en7(n.placement),variation:erb(n.placement),popper:n.elements.popper,popperRect:n.rects.popper,gpuAcceleration:void 0===i||i,isFixed:"fixed"===n.options.strategy};null!=n.modifiersData.popperOffsets&&(n.styles.popper=Object.assign({},n.styles.popper,er_(Object.assign({},s,{offsets:n.modifiersData.popperOffsets,position:n.options.strategy,adaptive:void 0===o||o,roundOffsets:u})))),null!=n.modifiersData.arrow&&(n.styles.arrow=Object.assign({},n.styles.arrow,er_(Object.assign({},s,{offsets:n.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-placement":n.placement})},data:{}},en8,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var n=t.state,r=t.options,i=t.name,o=r.offset,a=void 0===o?[0,0]:o,u=en1.reduce(function(t,r){var i,o,u,s,l,c,d,f;return t[r]=(o=n.rects,l=[enG,"top"].indexOf(s=en7(r))>=0?-1:1,d=(c="function"==typeof a?a(Object.assign({},o,{placement:r})):a)[0],f=c[1],d=d||0,f=(f||0)*l,[enG,enH].indexOf(s)>=0?{x:f,y:d}:{x:d,y:f}),t},{}),s=u[n.placement],l=s.x,c=s.y;null!=n.modifiersData.popperOffsets&&(n.modifiersData.popperOffsets.x+=l,n.modifiersData.popperOffsets.y+=c),n.modifiersData[i]=u}},{name:"flip",enabled:!0,phase:"main",fn:function(t){var n=t.state,r=t.options,i=t.name;if(!n.modifiersData[i]._skip){for(var o=r.mainAxis,a=void 0===o||o,u=r.altAxis,s=void 0===u||u,l=r.fallbackPlacements,c=r.padding,d=r.boundary,f=r.rootBoundary,p=r.altBoundary,h=r.flipVariations,m=void 0===h||h,g=r.allowedAutoPlacements,y=n.options.placement,v=en7(y),b=l||(v!==y&&m?function(t){if(en7(t)===enZ)return[];var n=erw(t);return[erk(t),n,erk(n)]}(y):[erw(y)]),x=[y].concat(b).reduce(function(t,r){var i,o,a,u,s,l,p,h,y,v,b,x,_,S;return t.concat(en7(r)===enZ?(o={placement:r,boundary:d,rootBoundary:f,padding:c,flipVariations:m,allowedAutoPlacements:g},u=(a=o).placement,s=a.boundary,l=a.rootBoundary,p=a.padding,h=a.flipVariations,v=void 0===(y=a.allowedAutoPlacements)?en1:y,0===(_=(x=(b=erb(u))?h?en0:en0.filter(function(t){return erb(t)===b}):enY).filter(function(t){return v.indexOf(t)>=0})).length&&(_=x),Object.keys(S=_.reduce(function(t,r){return t[r]=erN(n,{placement:r,boundary:s,rootBoundary:l,padding:p})[en7(r)],t},{})).sort(function(t,n){return S[t]-S[n]})):r)},[]),_=n.rects.reference,S=n.rects.popper,T=new Map,w=!0,O=x[0],k=0;k<x.length;k++){var C=x[k],I=en7(C),M=erb(C)===enJ,R=["top",enK].indexOf(I)>=0,E=R?"width":"height",j=erN(n,{placement:C,boundary:d,rootBoundary:f,altBoundary:p,padding:c}),A=R?M?enH:enG:M?enK:"top";_[E]>S[E]&&(A=erw(A));var N=erw(A),P=[];if(a&&P.push(j[I]<=0),s&&P.push(j[A]<=0,j[N]<=0),P.every(function(t){return t})){O=C,w=!1;break}T.set(C,P)}if(w)for(var L=m?3:1,D=function(t){var n=x.find(function(n){var r=T.get(n);if(r)return r.slice(0,t).every(function(t){return t})});if(n)return O=n,"break"},F=L;F>0&&"break"!==D(F);F--);n.placement!==O&&(n.modifiersData[i]._skip=!0,n.placement=O,n.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var n,r=t.state,i=t.options,o=t.name,a=i.mainAxis,u=i.altAxis,s=i.boundary,l=i.rootBoundary,c=i.altBoundary,d=i.padding,f=i.tether,p=void 0===f||f,h=i.tetherOffset,m=void 0===h?0:h,g=erN(r,{boundary:s,rootBoundary:l,padding:d,altBoundary:c}),y=en7(r.placement),v=erb(r.placement),b=!v,x=erh(y),_="x"===x?"y":"x",S=r.modifiersData.popperOffsets,T=r.rects.reference,w=r.rects.popper,O="function"==typeof m?m(Object.assign({},r.rects,{placement:r.placement})):m,k="number"==typeof O?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),C=r.modifiersData.offset?r.modifiersData.offset[r.placement]:null,I={x:0,y:0};if(S){if(void 0===a||a){var M,R="y"===x?"top":enG,E="y"===x?enK:enH,j="y"===x?"height":"width",A=S[x],N=A+g[R],P=A-g[E],L=p?-w[j]/2:0,D=v===enJ?T[j]:w[j],F=v===enJ?-w[j]:-T[j],W=r.elements.arrow,U=p&&W?era(W):{width:0,height:0},z=r.modifiersData["arrow#persistent"]?r.modifiersData["arrow#persistent"].padding:erg(),B=z[R],V=z[E],$=erm(0,T[j],U[j]),q=b?T[j]/2-L-$-B-k.mainAxis:D-$-B-k.mainAxis,K=b?-T[j]/2+L+$+V+k.mainAxis:F+$+V+k.mainAxis,H=r.elements.arrow&&erp(r.elements.arrow),G=H?"y"===x?H.clientTop||0:H.clientLeft||0:0,Z=null!=(M=null==C?void 0:C[x])?M:0,Y=erm(p?ert(N,A+q-Z-G):N,A,p?ere(P,A+K-Z):P);S[x]=Y,I[x]=Y-A}if(void 0!==u&&u){var J,Q,X,ee,et,en=S[_],er="y"===_?"height":"width",ei=en+g["x"===x?"top":enG],eo=en-g["x"===x?enK:enH],ea=-1!==["top",enG].indexOf(y),eu=null!=(et=null==C?void 0:C[_])?et:0,es=ea?ei:en-T[er]-w[er]-eu+k.altAxis,el=ea?en+T[er]+w[er]-eu-k.altAxis:eo,ec=p&&ea?(ee=erm(es,en,el))>el?el:ee:erm(p?es:ei,en,p?el:eo);S[_]=ec,I[_]=ec-en}r.modifiersData[o]=I}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(t){var n,r=t.state,i=t.name,o=t.options,a=r.elements.arrow,u=r.modifiersData.popperOffsets,s=en7(r.placement),l=erh(s),c=[enG,enH].indexOf(s)>=0?"height":"width";if(!(!a||!u)){var d,f,p=ery("number"!=typeof(d="function"==typeof(d=o.padding)?d(Object.assign({},r.rects,{placement:r.placement})):d)?d:erv(d,enY)),h=era(a),m=r.rects.reference[c]+r.rects.reference[l]-u[l]-r.rects.popper[c],g=u[l]-r.rects.reference[l],y=erp(a),v=y?"y"===l?y.clientHeight||0:y.clientWidth||0:0,b=p["y"===l?"top":enG],x=v-h[c]-p["y"===l?enK:enH],_=v/2-h[c]/2+(m/2-g/2),S=erm(b,_,x);r.modifiersData[i]=((n={})[l]=S,n.centerOffset=S-_,n)}},effect:function(t){var n=t.state,r=t.options.element,i=void 0===r?"[data-popper-arrow]":r;null==i||("string"!=typeof i||(i=n.elements.popper.querySelector(i)))&&eru(n.elements.popper,i)&&(n.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var n=t.state,r=t.name,i=n.rects.reference,o=n.rects.popper,a=n.modifiersData.preventOverflow,u=erN(n,{elementContext:"reference"}),s=erN(n,{altBoundary:!0}),l=erP(u,i),c=erP(s,o,a),d=erL(l),f=erL(c);n.modifiersData[r]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:f},n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":f})}}]},erB=void 0===(erz=(erU=erW).defaultModifiers)?[]:erz,er$=void 0===(erV=erU.defaultOptions)?erD:erV,function(t,n,r){void 0===r&&(r=er$);var i,o,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},erD,er$),modifiersData:{},elements:{reference:t,popper:n},attributes:{},styles:{}},u=[],s=!1,l={state:a,setOptions:function(r){var i,o,s,d,f,p,h,m,g="function"==typeof r?r(a.options):r;c(),a.options=Object.assign({},er$,a.options,g),a.scrollParents={reference:en5(t)?erR(t):t.contextElement?erR(t.contextElement):[],popper:erR(n)};var y=(s=Object.keys(o=(i=[].concat(erB,a.options.modifiers)).reduce(function(t,n){var r=t[n.name];return t[n.name]=r?Object.assign({},r,n,{options:Object.assign({},r.options,n.options),data:Object.assign({},r.data,n.data)}):n,t},{})).map(function(t){return o[t]}),f=new Map,p=new Set,h=[],s.forEach(function(t){f.set(t.name,t)}),s.forEach(function(t){p.has(t.name)||function t(n){p.add(n.name),[].concat(n.requires||[],n.requiresIfExists||[]).forEach(function(n){if(!p.has(n)){var r=f.get(n);r&&t(r)}}),h.push(n)}(t)}),en2.reduce(function(t,n){return t.concat(h.filter(function(t){return t.phase===n}))},[]));return a.orderedModifiers=y.filter(function(t){return t.enabled}),a.orderedModifiers.forEach(function(t){var n=t.name,r=t.options,i=t.effect;if("function"==typeof i){var o=i({state:a,name:n,instance:l,options:void 0===r?{}:r}),s=function(){};u.push(o||s)}}),l.update()},forceUpdate:function(){if(!s){var t,n,r,i,o,u,c,d,f,p,h,m,g,y,v,b=a.elements,x=b.reference,_=b.popper;if(erF(x,_)){a.rects={reference:(t=x,n=erp(_),r="fixed"===a.options.strategy,d=en6(n),f=en6(n)&&(u=ern((o=(i=n).getBoundingClientRect()).width)/i.offsetWidth||1,c=ern(o.height)/i.offsetHeight||1,1!==u||1!==c),p=erc(n),h=ero(t,f,r),m={scrollLeft:0,scrollTop:0},g={x:0,y:0},(d||!d&&!r)&&(("body"!==en3(n)||erM(p))&&(m=(y=n)!==en4(y)&&en6(y)?{scrollLeft:(v=y).scrollLeft,scrollTop:v.scrollTop}:erC(y)),en6(n)?(g=ero(n,!0),g.x+=n.clientLeft,g.y+=n.clientTop):p&&(g.x=erI(p))),{x:h.left+m.scrollLeft-g.x,y:h.top+m.scrollTop-g.y,width:h.width,height:h.height}),popper:era(_)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach(function(t){return a.modifiersData[t.name]=Object.assign({},t.data)});for(var S=0;S<a.orderedModifiers.length;S++){if(!0===a.reset){a.reset=!1,S=-1;continue}var T=a.orderedModifiers[S],w=T.fn,O=T.options,k=void 0===O?{}:O,C=T.name;"function"==typeof w&&(a=w({state:a,options:k,name:C,instance:l})||a)}}}},update:function(){return o||(o=new Promise(function(t){Promise.resolve().then(function(){o=void 0,t(new Promise(function(t){l.forceUpdate(),t(a)}))})})),o},destroy:function(){c(),s=!0}};if(!erF(t,n))return l;function c(){u.forEach(function(t){return t()}),u=[]}return l.setOptions(r).then(function(t){!s&&r.onFirstUpdate&&r.onFirstUpdate(t)}),l}),erK="tippy-content",erH="tippy-arrow",erG="tippy-svg-arrow",erZ={passive:!0,capture:!0},erY=function(){return document.body};function erJ(t,n,r){return Array.isArray(t)?t[n]??(Array.isArray(r)?r[n]:r):t}function erQ(t,n){var r=({}).toString.call(t);return 0===r.indexOf("[object")&&r.indexOf(n+"]")>-1}function erX(t,n){return"function"==typeof t?t.apply(void 0,n):t}function er0(t,n){var r;return 0===n?t:function(i){clearTimeout(r),r=setTimeout(function(){t(i)},n)}}function er1(t){return[].concat(t)}function er2(t,n){-1===t.indexOf(n)&&t.push(n)}function er3(t){return[].slice.call(t)}function er4(t){return Object.keys(t).reduce(function(n,r){return void 0!==t[r]&&(n[r]=t[r]),n},{})}function er5(){return document.createElement("div")}function er6(t){return["Element","Fragment"].some(function(n){return erQ(t,n)})}function er9(t,n){t.forEach(function(t){t&&(t.style.transitionDuration=n+"ms")})}function er8(t,n){t.forEach(function(t){t&&t.setAttribute("data-state",n)})}function er7(t,n,r){var i=n+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(n){t[i](n,r)})}function eie(t,n){for(var r,i=n;i;){if(t.contains(i))return!0;i=null==i.getRootNode||null==(r=i.getRootNode())?void 0:r.host}return!1}var eit={isTouch:!1},ein=0;function eir(){eit.isTouch||(eit.isTouch=!0,window.performance&&document.addEventListener("mousemove",eii))}function eii(){var t=performance.now();t-ein<20&&(eit.isTouch=!1,document.removeEventListener("mousemove",eii)),ein=t}function eio(){var t,n=document.activeElement;if(n&&n._tippy&&n._tippy.reference===n){var r=n._tippy;n.blur&&!r.state.isVisible&&n.blur()}}var eia=!!("u">typeof window&&"u">typeof document)&&!!window.msCrypto,eiu=Object.assign({appendTo:erY,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),eis=Object.keys(eiu),eil=function(t){Object.keys(t).forEach(function(n){eiu[n]=t[n]})};function eic(t){var n=(t.plugins||[]).reduce(function(n,r){var i,o=r.name,a=r.defaultValue;return o&&(n[o]=void 0!==t[o]?t[o]:null!=(i=eiu[o])?i:a),n},{});return Object.assign({},t,n)}function eid(t,n){var r,i,o=Object.assign({},n,{content:erX(n.content,[t])},n.ignoreAttributes?{}:((i=n.plugins)?Object.keys(eic(Object.assign({},eiu,{plugins:i}))):eis).reduce(function(n,r){var i=(t.getAttribute("data-tippy-"+r)||"").trim();if(!i)return n;if("content"===r)n[r]=i;else try{n[r]=JSON.parse(i)}catch{n[r]=i}return n},{}));return o.aria=Object.assign({},eiu.aria,o.aria),o.aria={expanded:"auto"===o.aria.expanded?n.interactive:o.aria.expanded,content:"auto"===o.aria.content?n.interactive?null:"describedby":o.aria.content},o}var eif=function(){return"innerHTML"};function eip(t,n){t[eif()]=n}function eih(t){var n=er5();return!0===t?n.className=erH:(n.className=erG,er6(t)?n.appendChild(t):eip(n,t)),n}function eim(t,n){er6(n.content)?(eip(t,""),t.appendChild(n.content)):"function"!=typeof n.content&&(n.allowHTML?eip(t,n.content):t.textContent=n.content)}function eig(t){var n=t.firstElementChild,r=er3(n.children);return{box:n,content:r.find(function(t){return t.classList.contains(erK)}),arrow:r.find(function(t){return t.classList.contains(erH)||t.classList.contains(erG)}),backdrop:r.find(function(t){return t.classList.contains("tippy-backdrop")})}}function eiy(t){var n=er5(),r=er5();r.className="tippy-box",r.setAttribute("data-state","hidden"),r.setAttribute("tabindex","-1");var i=er5();function o(r,i){var o=eig(n),a=o.box,u=o.content,s=o.arrow;i.theme?a.setAttribute("data-theme",i.theme):a.removeAttribute("data-theme"),"string"==typeof i.animation?a.setAttribute("data-animation",i.animation):a.removeAttribute("data-animation"),i.inertia?a.setAttribute("data-inertia",""):a.removeAttribute("data-inertia"),a.style.maxWidth="number"==typeof i.maxWidth?i.maxWidth+"px":i.maxWidth,i.role?a.setAttribute("role",i.role):a.removeAttribute("role"),(r.content!==i.content||r.allowHTML!==i.allowHTML)&&eim(u,t.props),i.arrow?s?r.arrow!==i.arrow&&(a.removeChild(s),a.appendChild(eih(i.arrow))):a.appendChild(eih(i.arrow)):s&&a.removeChild(s)}return i.className=erK,i.setAttribute("data-state","hidden"),eim(i,t.props),n.appendChild(r),r.appendChild(i),o(t.props,t.props),{popper:n,onUpdate:o}}eiy.$$tippy=!0;var eiv=1,eib=[],eix=[];function ei_(t,n){void 0===n&&(n={});var r,i,o=eiu.plugins.concat(n.plugins||[]);document.addEventListener("touchstart",eir,erZ),window.addEventListener("blur",eio);var a,u=Object.assign({},n,{plugins:o}),s=(er6(t)?[t]:erQ(t,"NodeList")?er3(t):Array.isArray(t)?t:er3(document.querySelectorAll(t))).reduce(function(t,n){var r=n&&function(t,n){var r,i,o,a,u,s,l,c,d=eid(t,Object.assign({},eiu,eic(er4(n)))),f=!1,p=!1,h=!1,m=!1,g=[],y=er0(G,d.interactiveDebounce),v=eiv++,b=(r=d.plugins).filter(function(t,n){return r.indexOf(t)===n}),x={id:v,reference:t,popper:er5(),popperInstance:null,props:d,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:b,clearDelayTimeouts:function(){clearTimeout(i),clearTimeout(o),cancelAnimationFrame(a)},setProps:function(n){if(!x.state.isDestroyed){N("onBeforeUpdate",[x,n]),K();var r=x.props,i=eid(t,Object.assign({},r,er4(n),{ignoreAttributes:!0}));x.props=i,q(),r.interactiveDebounce!==i.interactiveDebounce&&(D(),y=er0(G,i.interactiveDebounce)),r.triggerTarget&&!i.triggerTarget?er1(r.triggerTarget).forEach(function(t){t.removeAttribute("aria-expanded")}):i.triggerTarget&&t.removeAttribute("aria-expanded"),L(),A(),T&&T(r,i),x.popperInstance&&(Q(),ee().forEach(function(t){requestAnimationFrame(t._tippy.popperInstance.forceUpdate)})),N("onAfterUpdate",[x,n])}},setContent:function(t){x.setProps({content:t})},show:function(){var t=x.state.isVisible,n=x.state.isDestroyed,r=!x.state.isEnabled,i=eit.isTouch&&!x.props.touch,o=erJ(x.props.duration,0,eiu.duration);if(!(t||n||r||i)&&!M().hasAttribute("disabled")&&(N("onShow",[x],!1),!1!==x.props.onShow(x))){if(x.state.isVisible=!0,I()&&(S.style.visibility="visible"),A(),z(),x.state.isMounted||(S.style.transition="none"),I()){var a,u,s,c,d=E();er9([d.box,d.content],0)}l=function(){var t;if(!(!x.state.isVisible||m)){if(m=!0,S.offsetHeight,S.style.transition=x.props.moveTransition,I()&&x.props.animation){var n,r,i=E(),a=i.box,u=i.content;er9([a,u],o),er8([a,u],"visible")}P(),L(),er2(eix,x),null==(t=x.popperInstance)||t.forceUpdate(),N("onMount",[x]),x.props.animation&&I()&&V(o,r=function(){x.state.isShown=!0,N("onShown",[x])})}},u=x.props.appendTo,s=M(),(a=x.props.interactive&&u===erY||"parent"===u?s.parentNode:erX(u,[s])).contains(S)||a.appendChild(S),x.state.isMounted=!0,Q()}},hide:function(){var t=!x.state.isVisible,n=x.state.isDestroyed,r=!x.state.isEnabled,i=erJ(x.props.duration,1,eiu.duration);if(!(t||n||r)&&(N("onHide",[x],!1),!1!==x.props.onHide(x))){if(x.state.isVisible=!1,x.state.isShown=!1,m=!1,f=!1,I()&&(S.style.visibility="hidden"),D(),B(),A(!0),I()){var o,a,u=E(),s=u.box,l=u.content;x.props.animation&&(er9([s,l],i),er8([s,l],"hidden"))}P(),L(),x.props.animation?I()&&(a=x.unmount,V(i,function(){!x.state.isVisible&&S.parentNode&&S.parentNode.contains(S)&&a()})):x.unmount()}},hideWithInteractivity:function(t){R().addEventListener("mousemove",y),er2(eib,y),y(t)},enable:function(){x.state.isEnabled=!0},disable:function(){x.hide(),x.state.isEnabled=!1},unmount:function(){x.state.isVisible&&x.hide(),x.state.isMounted&&(X(),ee().forEach(function(t){t._tippy.unmount()}),S.parentNode&&S.parentNode.removeChild(S),eix=eix.filter(function(t){return t!==x}),x.state.isMounted=!1,N("onHidden",[x]))},destroy:function(){x.state.isDestroyed||(x.clearDelayTimeouts(),x.unmount(),K(),delete t._tippy,x.state.isDestroyed=!0,N("onDestroy",[x]))}};if(!d.render)return x;var _=d.render(x),S=_.popper,T=_.onUpdate;S.setAttribute("data-tippy-root",""),S.id="tippy-"+x.id,x.popper=S,t._tippy=x,S._tippy=x;var w=b.map(function(t){return t.fn(x)}),O=t.hasAttribute("aria-expanded");return q(),L(),A(),N("onCreate",[x]),d.showOnCreate&&et(),S.addEventListener("mouseenter",function(){x.props.interactive&&x.state.isVisible&&x.clearDelayTimeouts()}),S.addEventListener("mouseleave",function(){x.props.interactive&&x.props.trigger.indexOf("mouseenter")>=0&&R().addEventListener("mousemove",y)}),x;function k(){var t=x.props.touch;return Array.isArray(t)?t:[t,0]}function C(){return"hold"===k()[0]}function I(){var t;return!!(null!=(t=x.props.render)&&t.$$tippy)}function M(){return c||t}function R(){var t,n,r,i=M().parentNode;return i&&null!=(r=er1(i)[0])&&null!=(n=r.ownerDocument)&&n.body?r.ownerDocument:document}function E(){return eig(S)}function j(t){return x.state.isMounted&&!x.state.isVisible||eit.isTouch||u&&"focus"===u.type?0:erJ(x.props.delay,t?0:1,eiu.delay)}function A(t){void 0===t&&(t=!1),S.style.pointerEvents=x.props.interactive&&!t?"":"none",S.style.zIndex=""+x.props.zIndex}function N(t,n,r){if(void 0===r&&(r=!0),w.forEach(function(r){r[t]&&r[t].apply(r,n)}),r){var i;(i=x.props)[t].apply(i,n)}}function P(){var n=x.props.aria;if(n.content){var r="aria-"+n.content,i=S.id;er1(x.props.triggerTarget||t).forEach(function(t){var n=t.getAttribute(r);if(x.state.isVisible)t.setAttribute(r,n?n+" "+i:i);else{var o=n&&n.replace(i,"").trim();o?t.setAttribute(r,o):t.removeAttribute(r)}})}}function L(){!(O||!x.props.aria.expanded)&&er1(x.props.triggerTarget||t).forEach(function(t){x.props.interactive?t.setAttribute("aria-expanded",x.state.isVisible&&t===M()?"true":"false"):t.removeAttribute("aria-expanded")})}function D(){R().removeEventListener("mousemove",y),eib=eib.filter(function(t){return t!==y})}function F(n){if(!(eit.isTouch&&(h||"mousedown"===n.type))){var r=n.composedPath&&n.composedPath()[0]||n.target;if(!(x.props.interactive&&eie(S,r))){if(er1(x.props.triggerTarget||t).some(function(t){return eie(t,r)})){if(eit.isTouch||x.state.isVisible&&x.props.trigger.indexOf("click")>=0)return}else N("onClickOutside",[x,n]);!0===x.props.hideOnClick&&(x.clearDelayTimeouts(),x.hide(),p=!0,setTimeout(function(){p=!1}),x.state.isMounted||B())}}}function W(){h=!0}function U(){h=!1}function z(){var t=R();t.addEventListener("mousedown",F,!0),t.addEventListener("touchend",F,erZ),t.addEventListener("touchstart",U,erZ),t.addEventListener("touchmove",W,erZ)}function B(){var t=R();t.removeEventListener("mousedown",F,!0),t.removeEventListener("touchend",F,erZ),t.removeEventListener("touchstart",U,erZ),t.removeEventListener("touchmove",W,erZ)}function V(t,n){var r=E().box;function i(t){t.target===r&&(er7(r,"remove",i),n())}if(0===t)return n();er7(r,"remove",s),er7(r,"add",i),s=i}function $(n,r,i){void 0===i&&(i=!1),er1(x.props.triggerTarget||t).forEach(function(t){t.addEventListener(n,r,i),g.push({node:t,eventType:n,handler:r,options:i})})}function q(){var t;C()&&($("touchstart",H,{passive:!0}),$("touchend",Z,{passive:!0})),(t=x.props.trigger).split(/\s+/).filter(Boolean).forEach(function(t){if("manual"!==t)switch($(t,H),t){case"mouseenter":$("mouseleave",Z);break;case"focus":$(eia?"focusout":"blur",Y);break;case"focusin":$("focusout",Y)}})}function K(){g.forEach(function(t){var n=t.node,r=t.eventType,i=t.handler,o=t.options;n.removeEventListener(r,i,o)}),g=[]}function H(t){var n,r=!1;if(!(!x.state.isEnabled||J(t)||p)){var i,o=(null==(n=u)?void 0:n.type)==="focus";u=t,c=t.currentTarget,L(),!x.state.isVisible&&erQ(t,"MouseEvent")&&eib.forEach(function(n){return n(t)}),"click"===t.type&&(0>x.props.trigger.indexOf("mouseenter")||f)&&!1!==x.props.hideOnClick&&x.state.isVisible?r=!0:et(t),"click"===t.type&&(f=!r),r&&!o&&en(t)}}function G(t){var n,r,i,o,a=t.target,u=M().contains(a)||S.contains(a);!("mousemove"===t.type&&u)&&(n=ee().concat(S).map(function(t){var n,r=null==(n=t._tippy.popperInstance)?void 0:n.state;return r?{popperRect:t.getBoundingClientRect(),popperState:r,props:d}:null}).filter(Boolean),i=(r=t).clientX,o=r.clientY,n.every(function(t){var n,r=t.popperRect,a=t.popperState,u=t.props.interactiveBorder,s=(n=a.placement).split("-")[0],l=a.modifiersData.offset;if(!l)return!0;var c="bottom"===s?l.top.y:0,d="top"===s?l.bottom.y:0,f="right"===s?l.left.x:0,p="left"===s?l.right.x:0,h=r.top-o+c>u,m=o-r.bottom-d>u,g=r.left-i+f>u,y=i-r.right-p>u;return h||m||g||y})&&(D(),en(t)))}function Z(t){if(!(J(t)||x.props.trigger.indexOf("click")>=0&&f)){if(x.props.interactive){x.hideWithInteractivity(t);return}en(t)}}function Y(t){0>x.props.trigger.indexOf("focusin")&&t.target!==M()||x.props.interactive&&t.relatedTarget&&S.contains(t.relatedTarget)||en(t)}function J(t){return!!eit.isTouch&&C()!==t.type.indexOf("touch")>=0}function Q(){X();var n=x.props,r=n.popperOptions,i=n.placement,o=n.offset,a=n.getReferenceClientRect,u=n.moveTransition,s=I()?eig(S).arrow:null,c=a?{getBoundingClientRect:a,contextElement:a.contextElement||M()}:t,d=[{name:"offset",options:{offset:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!u}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(t){var n=t.state;if(I()){var r=E().box;["placement","reference-hidden","escaped"].forEach(function(t){"placement"===t?r.setAttribute("data-placement",n.placement):n.attributes.popper["data-popper-"+t]?r.setAttribute("data-"+t,""):r.removeAttribute("data-"+t)}),n.attributes.popper={}}}}];I()&&s&&d.push({name:"arrow",options:{element:s,padding:3}}),d.push.apply(d,(null==r?void 0:r.modifiers)||[]),x.popperInstance=erq(c,S,Object.assign({},r,{placement:i,onFirstUpdate:l,modifiers:d}))}function X(){x.popperInstance&&(x.popperInstance.destroy(),x.popperInstance=null)}function ee(){return er3(S.querySelectorAll("[data-tippy-root]"))}function et(t){x.clearDelayTimeouts(),t&&N("onTrigger",[x,t]),z();var n=j(!0),r=k(),o=r[0],a=r[1];eit.isTouch&&"hold"===o&&a&&(n=a),n?i=setTimeout(function(){x.show()},n):x.show()}function en(t){if(x.clearDelayTimeouts(),N("onUntrigger",[x,t]),!x.state.isVisible){B();return}if(!(x.props.trigger.indexOf("mouseenter")>=0&&x.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(t.type)>=0&&f)){var n=j(!1);n?o=setTimeout(function(){x.state.isVisible&&x.hide()},n):a=requestAnimationFrame(function(){x.hide()})}}}(n,u);return r&&t.push(r),t},[]);return er6(t)?s[0]:s}ei_.defaultProps=eiu,ei_.setDefaultProps=eil,ei_.currentInput=eit,Object.assign({},en8,{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)}}),ei_.setDefaultProps({render:eiy});class eiS{constructor({editor:t,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:a}){this.preventHide=!1,this.shouldShow=({view:t,state:n,from:r,to:i})=>{let{doc:o,selection:a}=n,{empty:u}=a,s=!o.textBetween(r,i).length&&etA(n.selection),l=this.element.contains(document.activeElement);return!(!(t.hasFocus()||l)||u||s||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:t})=>{var n;if(this.preventHide){this.preventHide=!1;return}null!=t&&t.relatedTarget&&!(null===(n=this.element.parentNode)||void 0===n)&&n.contains(t.relatedTarget)||this.hide()},this.tippyBlurHandler=t=>{this.blurHandler({event:t})},this.handleDebouncedUpdate=(t,n)=>{let r=!(null!=n&&n.selection.eq(t.state.selection)),i=!(null!=n&&n.doc.eq(t.state.doc));(r||i)&&(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(t,r,i,n)},this.updateDelay))},this.updateHandler=(t,n,r,i)=>{var o,a,u;let{state:s,composing:l}=t,{selection:c}=s;if(l||!n&&!r)return;this.createTooltip();let{ranges:d}=c,f=Math.min(...d.map(t=>t.$from.pos)),p=Math.max(...d.map(t=>t.$to.pos));if(!(null===(o=this.shouldShow)||void 0===o?void 0:o.call(this,{editor:this.editor,view:t,state:s,oldState:i,from:f,to:p}))){this.hide();return}null===(a=this.tippy)||void 0===a||a.setProps({getReferenceClientRect:(null===(u=this.tippyOptions)||void 0===u?void 0:u.getReferenceClientRect)||(()=>{var n;if((n=s.selection)instanceof JM){let r=t.nodeDOM(f),i=r.dataset.nodeViewWrapper?r:r.querySelector("[data-node-view-wrapper]");if(i&&(r=i.firstChild),r)return r.getBoundingClientRect()}return function(t,n,r){let i=t.state.doc.content.size,o=etN(n,0,i),a=etN(r,0,i),u=t.coordsAtPos(o),s=t.coordsAtPos(a,-1),l=Math.min(u.top,s.top),c=Math.max(u.bottom,s.bottom),d=Math.min(u.left,s.left),f=Math.max(u.right,s.right),p={top:l,bottom:c,left:d,right:f,width:f-d,height:c-l,x:d,y:l};return{...p,toJSON:()=>p}}(t,f,p)})}),this.show()},this.editor=t,this.element=n,this.view=r,this.updateDelay=o,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){let{element:t}=this.editor.options,n=!!t.parentElement;this.tippy||!n||(this.tippy=ei_(t,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(t,n){let{state:r}=t,i=r.selection.$from.pos!==r.selection.$to.pos;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(t,n);return}let o=!(null!=n&&n.selection.eq(t.state.selection)),a=!(null!=n&&n.doc.eq(t.state.doc));this.updateHandler(t,o,a,n)}show(){var t;null===(t=this.tippy)||void 0===t||t.show()}hide(){var t;null===(t=this.tippy)||void 0===t||t.hide()}destroy(){var t,n;!(null===(t=this.tippy)||void 0===t)&&t.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),null===(n=this.tippy)||void 0===n||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}let eiT=t=>new Jz({key:"string"==typeof t.pluginKey?new J$(t.pluginKey):t.pluginKey,view:n=>new eiS({view:n,...t})});etd.create({name:"bubbleMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[eiT({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});let eiw=t=>{let[n,r]=(0,o.useState)(null);return(0,o.useEffect)(()=>{if(!n||t.editor.isDestroyed)return;let{pluginKey:r="bubbleMenu",editor:i,tippyOptions:o={},updateDelay:a,shouldShow:u=null}=t,s=eiT({updateDelay:a,editor:i,element:n,pluginKey:r,shouldShow:u,tippyOptions:o});return i.registerPlugin(s),()=>i.unregisterPlugin(r)},[t.editor,n]),o.createElement("div",{ref:r,className:t.className,style:{visibility:"hidden"}},t.children)};class eiO extends enF{constructor(){super(...arguments),this.contentComponent=null}}let eik=({renderers:t})=>o.createElement(o.Fragment,null,Object.entries(t).map(([t,n])=>x.createPortal(n.reactElement,n.element,t)));class eiC extends o.Component{constructor(t){super(t),this.editorContentRef=o.createRef(),this.initialized=!1,this.state={renderers:{}}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){let{editor:t}=this.props;if(t&&t.options.element){if(t.contentComponent)return;let n=this.editorContentRef.current;n.append(...t.options.element.childNodes),t.setOptions({element:n}),t.contentComponent=this,t.createNodeViews(),this.initialized=!0}}maybeFlushSync(t){this.initialized?(0,x.flushSync)(t):t()}setRenderer(t,n){this.maybeFlushSync(()=>{this.setState(({renderers:r})=>({renderers:{...r,[t]:n}}))})}removeRenderer(t){this.maybeFlushSync(()=>{this.setState(({renderers:n})=>{let r={...n};return delete r[t],{renderers:r}})})}componentWillUnmount(){let{editor:t}=this.props;if(!t||(this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null,!t.options.element.firstChild))return;let n=document.createElement("div");n.append(...t.options.element.childNodes),t.setOptions({element:n})}render(){let{editor:t,...n}=this.props;return o.createElement(o.Fragment,null,o.createElement("div",{ref:this.editorContentRef,...n}),o.createElement(eik,{renderers:this.state.renderers}))}}let eiI=o.memo(eiC),eiM=(0,o.createContext)({onDragStart:void 0}),eiR=()=>(0,o.useContext)(eiM),eiE=o.forwardRef((t,n)=>{let{onDragStart:r}=eiR(),i=t.as||"div";return o.createElement(i,{...t,ref:n,"data-node-view-wrapper":"",onDragStart:r,style:{whiteSpace:"normal",...t.style}})});class eij{constructor(t,{editor:n,props:r={},as:i="div",className:o="",attrs:a}){this.ref=null,this.id=Math.floor(4294967295*Math.random()).toString(),this.component=t,this.editor=n,this.props=r,this.element=document.createElement(i),this.element.classList.add("react-renderer"),o&&this.element.classList.add(...o.split(" ")),a&&Object.keys(a).forEach(t=>{this.element.setAttribute(t,a[t])}),this.render()}render(){var t,n,r,i,a;let u=this.component,s=this.props;("function"==typeof u&&u.prototype&&u.prototype.isReactComponent||"object"==typeof u&&(null===(a=u.$$typeof)||void 0===a?void 0:a.toString())==="Symbol(react.forward_ref)")&&(s.ref=t=>{this.ref=t}),this.reactElement=o.createElement(u,{...s}),null===(n=null===(t=this.editor)||void 0===t?void 0:t.contentComponent)||void 0===n||n.setRenderer(this.id,this)}updateProps(t={}){this.props={...this.props,...t},this.render()}destroy(){var t,n;null===(n=null===(t=this.editor)||void 0===t?void 0:t.contentComponent)||void 0===n||n.removeRenderer(this.id)}}class eiA extends en${mount(){let t={editor:this.editor,node:this.node,decorations:this.decorations,selected:!1,extension:this.extension,getPos:()=>this.getPos(),updateAttributes:(t={})=>this.updateAttributes(t),deleteNode:()=>this.deleteNode()};if(!this.component.displayName){var n;this.component.displayName=(n=this.extension.name).charAt(0).toUpperCase()+n.substring(1)}let r=t=>{let n=this.component,r=this.onDragStart.bind(this),i=t=>{t&&this.contentDOMElement&&t.firstChild!==this.contentDOMElement&&t.appendChild(this.contentDOMElement)};return o.createElement(o.Fragment,null,o.createElement(eiM.Provider,{value:{onDragStart:r,nodeViewContentRef:i}},o.createElement(n,{...t})))};r.displayName="ReactNodeView",this.contentDOMElement=this.node.isLeaf?null:document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement&&(this.contentDOMElement.style.whiteSpace="inherit");let i=this.node.isInline?"span":"div";this.options.as&&(i=this.options.as);let{className:a=""}=this.options;this.renderer=new eij(r,{editor:this.editor,props:t,as:i,className:`node-${this.node.type.name} ${a}`.trim(),attrs:this.options.attrs})}get dom(){var t;if(this.renderer.element.firstElementChild&&!(!(null===(t=this.renderer.element.firstElementChild)||void 0===t)&&t.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}update(t,n){let r=t=>{this.renderer.updateProps(t)};if(t.type!==this.node.type)return!1;if("function"==typeof this.options.update){let i=this.node,o=this.decorations;return this.node=t,this.decorations=n,this.options.update({oldNode:i,oldDecorations:o,newNode:t,newDecorations:n,updateProps:()=>r({node:t,decorations:n})})}return t===this.node&&this.decorations===n||(this.node=t,this.decorations=n,r({node:t,decorations:n})),!0}selectNode(){this.renderer.updateProps({selected:!0})}deselectNode(){this.renderer.updateProps({selected:!1})}destroy(){this.renderer.destroy(),this.contentDOMElement=null}}function eiN(t,n){return r=>r.editor.contentComponent?new eiA(t,r,n):{}}function eiP(t){return setTimeout(()=>{t()})}function eiL(t){let{debouncedUrl:n,content:r,onContentChange:i,selected:a}=t,l=(0,o.useRef)(null),[c,d]=(0,o.useState)(!1);return(0,s.pQ)(n,()=>{var t;c&&(d(!1),null==(t=l.current)||t.reset())}),(0,v.ju)(n)?n===(null==r?void 0:r.embed_url)?M.jsx(eiF,{content:r,selected:a}):M.jsx(u.SV,{ref:l,renderError:eiD,onError:function(){d(!0),i(void 0)},children:M.jsx(o.Suspense,{fallback:r&&M.jsx(eiF,{content:r,selected:a}),children:M.jsx(eiW,{url:n,selected:a,onContentChange:i})})}):null}function eiD(){return M.jsx(u.yO,{title:"There is no embed data available."})}function eiF(t){let{content:n,selected:r}=t;return M.jsx(u.fu,{...function(t){let n="";switch(t.type){case"video":n=t.title??"";break;case"photo":n=`View this post${t.provider_name?` on ${t.provider_name}`:""}`;break;default:n=`Open${t.provider_name?` on ${t.provider_name}`:""}`}return{url:t.embed_url,thumbnail:{url:t.thumbnail_url??"",aspectRatio:"video"===t.type?"16:9":"1:1"},provider:t.provider_name??"",author:t.author_name??"",subtitle:n}}(n),selected:r})}function eiW(t){let{url:n,onContentChange:r,selected:i}=t,a=function(t){let{url:n,onContentChange:r}=t,{embedsUrl:i}=tR(),a=(0,d.QT)(eiU,[n,i]),u=(0,s.R9)(r);return(0,o.useEffect)(()=>{let t=eiP(()=>u(a));return()=>{clearTimeout(t)}},[a,u]),a}({url:n,onContentChange:r});return M.jsx(eiF,{content:a,selected:i})}function eiU(t,n){var r;let i=new URL(n);return i.search=new URLSearchParams({url:t}).toString(),(0,p.WY)(i.toString(),{okType:(r=t,tI.object({type:tI.string(),version:tI.string().or(tI.number()).nullish(),title:tI.string().nullish(),author_name:tI.string().nullish(),author_url:tI.string().nullish(),provider_name:tI.string().nullish(),provider_url:tI.string().nullish(),cache_age:tI.string().or(tI.number()).nullish(),thumbnail_url:tI.string().nullish(),thumbnail_width:tI.number().nullish(),thumbnail_height:tI.number().nullish(),html:tI.string().nullish()}).passthrough().transform(t=>{let n={embed_url:r};return{...n,__TYPE__:"EmbedContent",type:t.type,version:t.version,title:t.title,author_name:t.author_name,author_url:t.author_url,provider_name:t.provider_name,provider_url:t.provider_url,cache_age:t.cache_age,thumbnail_url:t.thumbnail_url,thumbnail_width:t.thumbnail_width,thumbnail_height:t.thumbnail_height,html:t.html,all:{...n,...t}}}))})}function eiz(t){let{id:n,readOnly:r,field:i,content:a,onContentChange:l}=t,c=(0,s.$P)({initialState:(null==a?void 0:a.embed_url)??"",startTransition:o.startTransition});function d(t){c.set(t),(0,v.ju)(t)||l(void 0)}return M.jsxs(u.gN,{footer:(0,v.ju)(c.value)&&M.jsx(u.mS,{children:M.jsx(eiL,{debouncedUrl:c.debouncedValue,content:a,onContentChange:l})}),children:[M.jsx(u.fw,{name:"cloud"}),M.jsx(u.Qy,{htmlFor:n,children:ZJ(i)}),M.jsx(u.JO,{children:M.jsx(Z2,{id:n,readOnly:r,placeholder:ZQ(i),value:c.value,onValueChange:d,variant:(0,v.ju)(c.value)?"link":"normal",endAdornment:M.jsx(u.zx,{startIcon:"close",color:"grey",size:"small",disabled:!c,onClick:()=>d("")})})})]})}function eiB(t){return!(t.lat>85||t.lat<-85||t.lng>180||t.lng<-180)}function eiV(t){let n=t.match(/^.*@(-?\d+.\d+),(-?\d+.\d+).*$/);if(!n)return;let r=parseFloat(n[1]??""),i=parseFloat(n[2]??"");if(isNaN(r)||isNaN(i))return;let o={lat:r,lng:i};if(eiB(o))return o}function ei$(t){return t?`${t.lat}, ${t.lng}`:""}function eiq(t){let n=t.match(/\(?([\d|.|-]*)[\s+]*,[\s]*([\d|.|-]*)\)?/);if(!n)return eiV(t);let r=parseFloat(n[1]??""),i=parseFloat(n[2]??"");if(isNaN(r)||isNaN(i))return eiV(t);let o={lat:r,lng:i};return eiB(o)?o:eiV(t)}function eiK(t){let{field:n,id:r,readOnly:i,...a}=t,{onValueChange:s,displayedValue:l,onBlur:c,clearValue:d,isValidCoordinates:f}=function(t){let{content:n,onContentChange:r}=t,i=ei$(null==n?void 0:n.position),[a,u]=(0,o.useState)(i),s=Boolean(eiq(a));return{displayedValue:a,isValidCoordinates:s,onValueChange:u,onBlur:function(){let t=eiq(a);if(!t)return u(""),r(void 0);let{lat:n,lng:i}=t;u(ei$({lat:n,lng:i})),r({__TYPE__:"GeoPointContent",position:{lat:n,lng:i}})},clearValue:function(){u(""),r(void 0)}}}(a);return M.jsxs(u.gN,{children:[M.jsx(u.fw,{name:"place"}),M.jsx(u.Qy,{htmlFor:r,children:ZJ(n)}),M.jsx(u.JO,{children:M.jsx(Z2,{id:r,onValueChange:s,placeholder:"...",readOnly:i,value:l,onBlur:c,variant:f?"link":"normal",endAdornment:M.jsx(u.zx,{startIcon:"close",color:"grey",size:"small",disabled:!l,onClick:d})})})]})}let eiH="__MAIN_THUMBNAIL__";function eiG(t,n,r){let i=t.name===eiH?void 0:t.name,o;return[i,(o=n?(0,c.$)(r)?[r.width,r.height]:(0,c.$)(t.width)||(0,c.$)(t.height)?[t.width??void 0,t.height??void 0]:[n.origin.width,n.origin.height]:void 0)?`${o[0]??"auto"}x${o[1]??"auto"}px`:void 0]}function eiZ(t,n){let{width:r,height:i}=n??{};return r&&i?[r,i]:r?[r,Math.round(t.height*(r/t.width))]:i?[Math.round(t.width*(i/t.height)),i]:[t.width,t.height]}function eiY(t,n,r,i,o){let a=new URL(t);if(o){let{x:u,y:s,width:l,height:c}=n;a.searchParams.set("rect",[u,s,l,c].join(",")),a.searchParams.set("w",r.toString()),a.searchParams.set("h",i.toString())}return a.toString()}function eiJ(t){let n=new URL(t);return n.searchParams.delete("q"),n.searchParams.set("w","800"),n.searchParams.set("h","800"),n.searchParams.set("auto","compress,format"),n.searchParams.set("fit","max"),n.toString()}function eiQ(t){return null!=t&&t.url?eiJ(t.url):void 0}function eiX(t,n){var r;let{width:i,height:o,rect:a}=function(t,n){let[r,i]=eiZ(t,n),o=Math.max(r/t.width,i/t.height),a=Math.round((t.width-r/o)/2),u=Math.round((t.height-i/o)/2);return{width:r,height:i,rect:{x:a,y:u,width:Math.round(r/o),height:Math.round(i/o)}}}({...t,width:(null==t?void 0:t.width)??2e3,height:(null==t?void 0:t.height)??2e3},n),u=Boolean((null==n?void 0:n.width)||(null==n?void 0:n.height));return{url:eiY(t.url,a,i,o,u),alt:t.alt,..."kind"in t&&"extension"in t?{credits:t.credits}:{},origin:{id:t.id,url:t.url,width:t.width??2e3,height:t.height??2e3},width:i,height:o,edit:{background:"transparent",zoom:1,crop:{x:a.x,y:a.y}}}}let ei0=to({id:e1(),width:e2(),height:e2(),urls:to({full:e1(),small:e1().transform(function(t){let n=new URL(t);return n.searchParams.delete("q"),n.searchParams.delete("fm"),n.searchParams.set("w","300"),n.searchParams.set("auto","compress,format"),n.toString()})}),alt_description:e1().optional(),description:e1().nullable()}),ei1=to({results:ti(ei0)}).transform(t=>t.results);function ei2(t,n){let r=new URLSearchParams({page:"1",per_page:"28",query:n});return(0,p.WY)(`${t}/search/photos?${r.toString()}`,{okType:ei1})}function ei3(t){let{onSelectedChange:n}=t,[r,i]=(0,o.useTransition)(),a=(0,s.$P)({initialState:"",ms:300,startTransition:i});return M.jsxs(u.xu,{flexDirection:"column",gap:16,width:"100%",position:"relative",children:[M.jsx(u.CR,{value:a.value,placeholder:"Search on Unsplash.com",onValueChange:a.set}),M.jsx(u.SV,{renderError:()=>M.jsx(tX,{}),children:M.jsx(o.Suspense,{fallback:M.jsx(ei6,{}),children:M.jsx(ei4,{term:a.debouncedValue,loading:r,onSelectedChange:n})})})]})}function ei4(t){let{term:n,onSelectedChange:r,loading:i}=t,{media:a,toggleSelected:l,selectedImageId:c}=function(t){var n;let{term:r,onSelectedChange:i}=t,a=tR(),u=function(t,n){let r=(0,o.useRef)(),i=tR(),a=(0,d.QT)(ei2,[t,n]);return(0,s.Nr)(n,1e3,()=>{var t;r.current&&n!==r.current&&(null==(t=i.onAnalyticsEvent)||t.call(i,"Unsplash Image Searched")),r.current=n}),a}(a.unsplashUrl,r||"citrus fruit"),l=null==(n=null==u?void 0:u[0])?void 0:n.id,[c,f]=(0,o.useState)();return(0,o.useEffect)(()=>{null==i||i([]),f(void 0)},[l,i]),{media:u,toggleSelected:function(t){if(t.id===c)return f(void 0),null==i?void 0:i([]);f(t.id),null==i||i([{...t,url:t.urls.full,alt:t.alt_description}])},selectedImageId:c}}({term:n,onSelectedChange:r});return M.jsxs(M.Fragment,{children:[M.jsx(ei5,{children:null==a?void 0:a.map(t=>{let n=new URL(t.urls.full).searchParams.get("fm")??"jpg";return M.jsx(u.PB,{url:t.urls.small,filename:t.description??"Unsplash Image",selected:c===t.id,onCardClick:()=>l(t),extension:n,width:t.width,height:t.height,loading:i},t.id)})}),0===a.length&&M.jsx(j,{})]})}function ei5(t){let{children:n}=t;return M.jsx(u.xr,{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 250px), 1fr))",gap:16,paddingBottom:16,position:"relative",width:"100%"},children:n})}function ei6(){return M.jsx(ei5,{children:(0,m.N)(24,M.jsx(t7,{}))})}function ei9(t){let{open:n,onOpenChange:r,onMediaSelected:i,assetType:a}=t,[l,c]=(0,o.useState)("media"),[f,p]=(0,o.useState)(new Set),[h,m]=(0,o.useState)([]),g=f.size+h.length,y=(0,d.q_)(tL),v=tR();function b(t){t||p(new Set),r(t)}let{containerRef:x}=(0,u.VY)();return M.jsxs(u.Vq,{open:n,onOpenChange:b,size:{width:1216,height:868},onPointerDownOutside(t){x&&(0,s.DX)(x,t.target)&&t.preventDefault()},children:[M.jsx(u.fK,{icon:"image",title:"Media library"}),M.jsxs(u.Zp,{value:l,onValueChange:function(t){if("media"!==t&&"unsplash"!==t)throw Error(`Invalid option ${t}.`);c(t)},padding:"small",width:"auto",children:[M.jsx(u.T9,{value:"media",icon:"photo"}),M.jsx(u.T9,{value:"unsplash",icon:"unsplash"})]}),M.jsx(u.cZ,{children:M.jsxs(u.xu,{overflow:"hidden",backgroundColor:"grey3",padding:{top:16,right:16,left:16},minHeight:"100%",children:["media"===l&&M.jsx(nm,{assetType:a,onSelectedChange:p}),"unsplash"===l&&M.jsx(ei3,{onSelectedChange:m})]})}),M.jsx(u.kX,{asFooter:!0,ok:{text:"Add to page",onClick:function(){var t;let n=y.flatMap(t=>t.items).filter(t=>f.has(t.id)),r="media"===l?n[0]:h[0];r&&(i(r),b(!1),"unsplash"===l&&(null==(t=v.onAnalyticsEvent)||t.call(v,"Unsplash Image Added")))},disabled:1!==g,disabledTooltip:0===g?"Select a media item to add to the page":g>1?"Only one media item can be added to the page":void 0},cancel:{text:"Cancel"}})]})}function ei8(t){let{onMediaSelected:n,readOnly:r,isUpdating:i}=t,[a,s]=(0,o.useState)(!1);return M.jsxs(u.aY,{children:[M.jsx(u.Zb,{color:"grey3",variant:"outlined",radius:4,children:M.jsx(u.aY,{children:M.jsx(u.xu,{padding:{block:48},flexDirection:"column",children:M.jsxs(u.R$,{children:[M.jsx(u.av,{name:"cloudUpload"}),M.jsx(u._T,{children:i?"Preparing your image...":"You haven't selected an image"}),!r&&M.jsx(u.Qj,{children:M.jsx(u.zx,{disabled:i,onClick:()=>s(!0),children:"Select image"})})]})})})}),M.jsx(ei9,{open:a,onOpenChange:s,onMediaSelected:n,assetType:"image"})]})}function ei7(t){let{id:n,readOnly:r,altText:i,onValueChange:o,selected:a}=t;return M.jsxs(u.gN,{labelPosition:"side",selected:a,children:[M.jsx(u.Qy,{htmlFor:n,children:"Alt text"}),M.jsx(u.JO,{children:M.jsx(u.oi,{id:n,placeholder:"Short description for the visually impaired",readOnly:r,padding:{input:{inline:16}},value:i,onValueChange:o})})]})}d.Fs.registerFetcherConfig(ei2,{cacheCapacity:5,revalidationStrategy:{type:"never"}});let eoe=({contentView:t,constraints:n,croppedImage:r})=>{let[i,o]=eiZ(t.origin,n),a=eiY(t.origin.url,r,i,o,!0);return{...t,width:i,height:o,url:a,edit:{...t.edit,zoom:r.zoom,crop:{x:r.x,y:r.y}}}},eot=({field:t,content:n,thumbnail:r,croppedImage:i})=>{var o,a,u,s;if(r===eiH){let l=eoe({contentView:n,constraints:null==(o=null==t?void 0:t.config)?void 0:o.constraint,croppedImage:i});return l.url===n.url?n:{...n,...l}}let c=null==(u=null==(a=null==t?void 0:t.config)?void 0:a.thumbnails)?void 0:u.find(t=>t.name===r),d=null==(s=n.thumbnails)?void 0:s[r];if(!c||!d)return n;let f=eoe({contentView:d,constraints:c,croppedImage:i});return f.url===d.url?n:{...n,thumbnails:{...n.thumbnails,[r]:f}}},eon=({initialSize:t,constraints:n})=>{let r=null!=n&&n.width&&null!=n&&n.height?n.width/n.height:t.width/t.height,[i,o]=t.width<t.height?[t.width,Math.round(t.width/r)]:[Math.round(t.height*r),t.height],a=Math.max(i/t.width,o/t.height,1);return{width:Math.round(i/a),height:Math.round(o/a)}},eor=({contentView:t,constraints:n})=>{let r=eon({initialSize:t.origin,constraints:n}),i=t.edit.zoom??1,o=Math.round(r.width/i),a=Math.round(r.height/i);return{...t.edit.crop,width:o,height:a,zoom:i}},eoi={x:0,y:0,width:0,height:0,zoom:1},eoo=({selectedImage:{thumbnail:t,contentView:n}})=>t.width&&t.height?t.width/t.height:n?n.origin.width/n.origin.height:1,eoa=({trigger:t,initialImages:n,initialOption:r,onClose:i})=>{var a;let[s,l]=(0,o.useState)({}),[c,d]=(0,o.useState)({}),[f,p]=(0,o.useState)(!1),[h,m]=(0,o.useState)(!1),[g,y]=(0,o.useState)(r),v=n[g],b=t=>{if(!v)return;let n=v.thumbnail.name,r=s[n]??eoi;l({...s,[n]:{...r,zoom:t}})},x=t=>{if(!v)return;let n=v.thumbnail.name,r=s[n]??eoi;l({...s,[n]:{...r,...t}})},_=t=>{if(!v)return;let n=v.thumbnail.name,r=c[n];d({...c,[n]:{...r,crop:t}})},S=t=>{if(!v)return;let n=v.thumbnail.name,r=c[n]??{};d({...c,[n]:{...r,aspectRatio:t}})},T=s[(null==v?void 0:v.thumbnail.name)??""],w=f?T??((null==v?void 0:v.contentView)&&eor({contentView:v.contentView,constraints:v.thumbnail})):void 0,O=c[(null==v?void 0:v.thumbnail.name)??""];return M.jsxs(u.Vq,{trigger:t,onAnimationEnd:()=>m(!0),open:f,onOpenChange(t){t?(y(r),l({}),d({})):(m(!1),i({option:g,croppedImages:s})),p(t)},children:[M.jsx(u.fK,{icon:"photo",title:"Image editor"}),M.jsx(u.Zp,{value:String(g),onValueChange:t=>y(Number(t)),children:n.map((t,n)=>M.jsx(u.T9,{value:String(n),icon:"photo",title:t.labels[0]??"Main",subtitle:t.labels[1]??""},t.thumbnail.name))}),v&&M.jsx(u.cZ,{children:h&&M.jsx(u.tP,{image:(null==(a=v.contentView)?void 0:a.origin.url)??"",crop:(null==O?void 0:O.crop)??{x:0,y:0},onCropChange:_,zoom:(null==T?void 0:T.zoom)??1,onZoomChange:b,aspectRatio:eoo({selectedImage:v,cropper:O}),onAspectRatioChange:S,initialCroppedArea:w,onCropAreaChange:x},v.thumbnail.name)})]})};function eou(t){var n,r;let{content:i,selected:a,fieldLabel:s,readOnly:l,imageLabel:c,onMediaSelected:d,initialImages:f,initialOption:p=0,onCropperDialogClose:h,onClear:m,children:g}=t,[y,v]=(0,o.useState)(!1),b=(null==(r=null==(n=null==i?void 0:i.url)?void 0:n.split("?")[0])?void 0:r.slice(-4))===".svg",x=null!=i&&i.url&&!l?"visible":"hidden";return M.jsxs(u.Zb,{color:a?"indigo2":"grey2",variant:a?"selected":"dashed",radius:4,children:[M.jsxs(u.Ol,{children:[M.jsxs(u.wP,{children:[s,0!==c.length&&M.jsx(u.xv,{color:"grey11",noSelect:!0,children:` • ${c.join(" • ")}`})]}),M.jsxs(u.Pf,{sx:{visibility:x},children:[M.jsx(eoa,{trigger:M.jsx(u.zx,{startIcon:"crop",disabled:b,children:"Crop & Resize"}),initialImages:f,initialOption:p,onClose:h}),M.jsx(u.zx,{startIcon:"imageSearch",onClick:()=>v(!0),children:"Replace"}),M.jsx(u.zx,{onClick:m,startIcon:"delete",children:"Clear"})]})]}),g,M.jsx(ei9,{open:y,onOpenChange:v,onMediaSelected:d,assetType:"image"})]})}function eos(t){let{content:n,field:r,id:i,onContentChange:u,readOnly:s}=t,l=n&&n.origin.url.length>0,{onCropperDialogClose:d,onPageChange:f,onMediaSelected:p,isUpdating:h,page:m,thumbnail:g,allThumbnails:y,allContentViews:v,contentView:b,onClear:x}=function(t){var n;let{content:r,onContentChange:i,field:u}=t,[s,l]=(0,o.useState)(0),[c,d]=(0,o.useTransition)(),f=(n=u,(0,o.useMemo)(()=>{var t,r,i;return[{...null==(r=n.config)?void 0:r.constraint,name:eiH}].concat((null==(i=n.config)?void 0:i.thumbnails)??[])},[n])),p=f[s],h=r?function(t,n){var r,i;let{__TYPE__:o,thumbnails:a,...u}=n,s=null==(i=null==(r=t.config)?void 0:r.thumbnails)?void 0:i.map(({name:t})=>null==a?void 0:a[t]);return[u,...s??[]]}(u,r):void 0,m=null==h?void 0:h[s];return{onCropperDialogClose:function({option:t,croppedImages:n}){if(l(t),!r)return;let o=Object.entries(n).reduce((t,[n,r])=>eot({field:u,content:t,thumbnail:n,croppedImage:r}),r);o!==r&&d(()=>i(o))},onPageChange:function(t){d(()=>l(t))},onMediaSelected:function(t){if(!p)return;let n=function(t,n,r,i){var o,u,s,l,c,d;if(!r){let f=null==(o=n.config)?void 0:o.thumbnails,p=f&&Object.fromEntries(f.map(t=>[t.name,eiX(i,t)]));return{__TYPE__:"ImageContent",...eiX(i,null==(u=n.config)?void 0:u.constraint),thumbnails:p}}if(t===eiH){let h=eiX(i,null==(s=n.config)?void 0:s.constraint);return h.url===r.url?r:{...r,...h}}let m=null==(c=null==(l=n.config)?void 0:l.thumbnails)?void 0:c.find(n=>n.name===t);if(!m)return r;let g=null==(d=r.thumbnails)?void 0:d[t],y=eiX(i,m);return y.url===(null==g?void 0:g.url)?r:{...r,thumbnails:(0,a.Q8)(r.thumbnails??{},(n,r)=>r===t?y:n)}}(p.name,u,r,t);n!==r&&d(()=>i(n))},isUpdating:c,page:s,thumbnail:p,allThumbnails:f,allContentViews:h,contentView:m,onClear:function(){null==l||l(0),i(void 0)}}}({field:r,content:n,onContentChange:u}),_=ZJ(r),S=y.map((t,r)=>{let i=null==v?void 0:v[r];return{thumbnail:t,contentView:i,labels:eiG(t,n,i)}}),T=g&&l?eiG(g,n,b).filter(c.$):[];return M.jsx(eou,{content:n,fieldLabel:_,imageLabel:T,initialOption:m,initialImages:S,readOnly:s,onMediaSelected:p,onCropperDialogClose:d,onClear:x,children:M.jsx(o.Suspense,{fallback:M.jsx("div",{style:{height:466}}),children:g&&n&&l&&v?M.jsx(eol,{allContentViews:v,content:n,contentView:b,id:i,onContentChange:u,onPageChange:f,page:m,readOnly:s,thumbnailName:g.name,isUpdating:h}):M.jsx(ei8,{onMediaSelected:p,readOnly:s,isUpdating:h})})})}function eol(t){let{allContentViews:n,content:r,contentView:i,id:o,onContentChange:a,onPageChange:s,page:l,readOnly:c,thumbnailName:d,isUpdating:f}=t;return M.jsxs(u.aY,{children:[M.jsx(u.lr,{getItemSource:eiQ,items:n,onPageChange:s,page:l,style:{height:400},children:t=>(null==t?void 0:t.url)&&M.jsx(u.d$,{src:eiJ(t.url),alt:t.alt??void 0,isUpdating:f},`${d}_${t.url}`)}),M.jsx(ei7,{id:o,readOnly:c||!i,altText:(null==i?void 0:i.alt)??"",onValueChange(t){i&&a(function(t,n,r,i){let o=0===i.length?void 0:i;return t===eiH?{...n,alt:o}:{...n,thumbnails:{...n.thumbnails,[t]:{...r,alt:o}}}}(d,r,i,t))}})]})}function eoc(t){let{content:n,field:r,id:i,onContentChange:o,readOnly:a}=t;return M.jsxs(u.gN,{children:[M.jsx(u.fw,{name:"notes"}),M.jsx(u.Qy,{htmlFor:i,children:ZJ(r)}),M.jsx(u.JO,{children:M.jsx(u.Kx,{id:i,placeholder:ZQ(r),readOnly:a,paddingLeft:4,paddingRight:12,sx:{flexGrow:1},value:(null==n?void 0:n.value)??"",onChange(t){var n;o((n=t,0===n.length?void 0:{__TYPE__:"FieldContent",type:"Text",value:n}))}})})]})}function eod(t,n,r,i){return(0,h.W7)(t,r,i,30,n)}function eof(){let t=tR();t.searchDocuments||tj("searchDocuments");let{coreApiUrl:n,env:r}=t,i=`${n}/repository`,o=(0,d.QT)(h.Ag,[i,r]);return new Set(o.languages.map(t=>({id:t.id,label:t.name})))}function eop(){let t=tR();t.searchDocuments||tj("searchDocuments");let{coreApiUrl:n,env:r}=t,i=`${n}/repository`,o=(0,d.QT)(h.Mi,[i,r]);return new Set(o.results.map(t=>({id:t,label:t})))}function eoh(){let t=tR();t.searchDocuments||tj("searchDocuments");let{customTypesApiUrl:n,env:r,repository:i}=t,o=(0,d.QT)(h.JY,[n,i,r]);return new Set(o)}function eom(t){return t?(0,g.UI)(t,t=>({id:t,label:t})):new Set}function eog(t){let{filteredLocales:n,setFilteredLocales:r,filteredTags:i,setFilteredTags:a,filteredCustomTypes:s,setFilteredCustomTypes:l,fixedTags:c,fixedCustomTypes:d}=t;return M.jsxs(M.Fragment,{children:[M.jsx(u.SV,{children:M.jsx(o.Suspense,{fallback:M.jsx(eoy,{selectedValues:n,onSelectedValuesChange:r,label:"Locale",icon:"public",fetchFilters:eof,multiple:!1}),children:M.jsx(eob,{selectedValues:n,onSelectedValuesChange:r})})}),M.jsx(eoy,{selectedValues:i,fixedSelectedValues:eom(c),onSelectedValuesChange:a,label:"Tags",icon:"label",fetchFilters:eop}),M.jsx(eoy,{selectedValues:s,fixedSelectedValues:eom(d),onSelectedValuesChange:l,label:"Type",icon:"description",fetchFilters:eoh})]})}function eoy(t){let[n,r]=(0,o.useState)(!1),i=(0,o.useContext)(d.Nk);return M.jsx(u.SV,{renderError:()=>M.jsx(u.R0,{mode:"error",onErrorRetry:null==i?void 0:i.reset,open:n,setOpen:r,values:new Set,...t}),children:M.jsx(o.Suspense,{fallback:M.jsx(u.R0,{mode:"loading",open:n,setOpen:r,values:new Set,...t}),children:M.jsx(eov,{open:n,setOpen:r,...t})})})}function eov(t){let{open:n,setOpen:r,onSelectedValuesChange:i,fixedSelectedValues:o,selectedValues:a,label:s,icon:l,fetchFilters:c,multiple:d}=t,f=c();return M.jsx(u.R0,{open:n,setOpen:r,label:s,icon:l,selectedValues:a,values:new Set(f),fixedSelectedValues:o,onSelectedValuesChange:i,multiple:d})}function eob(t){let{selectedValues:n,onSelectedValuesChange:r}=t,[i,a]=(0,o.useState)((0,g.Ps)(n)),u=(0,g.sE)(eof(),t=>{var r;return t.id===(null==(r=(0,g.Ps)(n))?void 0:r.id)});return(null==u?void 0:u.label)!==(null==i?void 0:i.label)&&a(u),M.jsx(eoy,{selectedValues:new Set(i?[i]:[]),onSelectedValuesChange:function(t){r(t),a((0,g.Ps)(t))},label:"Locale",icon:"public",fetchFilters:eof,multiple:!1})}function eox(t){let{onSelectDocument:n,fixedCustomTypes:r,fixedTags:i,...a}=t,l=tR(),{searchTerm:c,filteredTags:d,setFilteredTags:f,filteredCustomTypes:p,setFilteredCustomTypes:h,filteredLocales:m,setFilteredLocales:y,typesFilter:v,tagsFilter:b}=function(t,n){let r=tR(),i=(0,s.$P)({initialState:""}),[a,u]=(0,o.useState)(new Set),[l,c]=(0,o.useState)(new Set),[d,f]=(0,o.useState)(function(){return r.searchDocuments&&r.localeId?new Set([{id:r.localeId,label:r.localeId}]):new Set}),p=(0,g.G0)(l,eom(t)),h=(0,g.G0)(a,eom(n));return{searchTerm:i,filteredTags:a,setFilteredTags:u,filteredCustomTypes:l,setFilteredCustomTypes:c,filteredLocales:d,setFilteredLocales:f,typesFilter:p,tagsFilter:h}}(r,i),[x,_]=(0,o.useTransition)(),S=(0,s.$P)({initialState:x,ms:100}),{searchDocuments:T}=tR();return M.jsx(u.Vq,{size:{height:727,width:656},hasClose:!1,...a,children:M.jsx(u.cZ,{children:M.jsxs(u.xu,{flexDirection:"column",height:"100%",children:[M.jsxs(u.xu,{padding:{top:16,inline:16},flexDirection:"column",gap:12,children:[M.jsx(u.yt,{value:c.value,onValueChange:c.set,placeholder:"Search a page",icon:"search"}),T&&M.jsx(eog,{filteredTags:d,setFilteredTags:f,filteredCustomTypes:p,setFilteredCustomTypes:h,filteredLocales:m,setFilteredLocales:y,fixedTags:i,fixedCustomTypes:r}),M.jsx(u.xv,{variant:"smallBold",color:"grey11",children:"Link to a document"})]}),l.searchDocuments?M.jsx(u.SV,{renderError:eoS,children:M.jsx(o.Suspense,{children:M.jsx(eoT,{searchTerm:c.debouncedValue,tagsFilter:b,typesFilter:v,localesFilter:m,startTransition:_,onSelectDocument:n})})}):M.jsx(eow,{message:"Slice Machine does not yet support mock data for linked documents in the simulator."}),M.jsx(eo_,{debouncedIsLoading:S.debouncedValue})]})})})}function eo_(t){return M.jsx(u.FN,{anchor:M.jsx(u.xu,{position:"relative",width:"100%",justifyContent:"center",bottom:72}),loadingIndicator:!0,open:t.debouncedIsLoading,title:"Loading more results ...",seconds:1})}function eoS(){return M.jsx(u.xu,{height:"100%",flexDirection:"column",alignItems:"center",justifyContent:"center",children:M.jsx(u.Iq,{title:"Request failed",description:"An error occurred while fetching documents.",errorImageSrc:u.Os})})}function eoT(t){let{searchTerm:n,tagsFilter:r,typesFilter:i,localesFilter:a,startTransition:s,onSelectDocument:l}=t,{documents:c,onHasReachedBottom:p}=function(t){var n,r;let{searchTerm:i,tagsFilter:a,typesFilter:u,localesFilter:s}=t,l=tR();l.searchDocuments||tj("searchDocuments");let{coreApiUrl:c,env:p,status:m}=l,[y,v]=(0,o.useState)(""),[b,x]=(0,o.useState)([]),[_,S]=(0,o.useState)(""),T=new URLSearchParams((0,h.fW)([{name:"tags",values:[...(0,g.UI)(a,t=>t.id)]},{name:"customTypes",values:[...(0,g.UI)(u,t=>t.id)]},{name:"language",values:[...(0,g.UI)(s,t=>t.id)]},{name:"status",values:h.Vu[m]},{name:"term",values:[i]}])).toString(),w=(0,d.QT)(eod,[c,T===_?y:"",p,T]);return T!==_?(S(T),v(""),x(w.results)):w.results.length>0&&(null==(n=(0,f.Z$)(b))?void 0:n.id)!==(null==(r=(0,f.Z$)(w.results))?void 0:r.id)&&x(t=>t.concat(w.results)),{documents:b,onHasReachedBottom:function(){w.cursor&&v(w.cursor)},response:w}}({searchTerm:n,tagsFilter:r,localesFilter:a,typesFilter:i}),m=tR();return M.jsx(u.xr,{onScrollToBottom:()=>s(p),style:{height:"100%",gap:u.TV.space[16],paddingTop:u.TV.space[10],paddingBottom:u.TV.space[16],paddingInline:u.TV.space[16]},children:M.jsxs(u.xu,{flexDirection:"column",gap:12,height:"100%",children:[0===c.length&&M.jsx(eow,{}),c.map(t=>{let n=t.versions[0];if(!n)return null;let i=(0,b.u)({documentId:t.id,versionId:"archived"===n.status?n.version_id:void 0,releaseId:"release"===n.status?n.release_id:void 0,status:n.status,env:m.env}),o=function(t){let{tags:n,tagsFilter:r}=t,i=[...r].map(t=>t.label).reverse();return(0,f.DY)(n,t=>-i.indexOf(t))}({tags:n.tags,tagsFilter:r});return M.jsx(u.z4,{documentType:n.custom_type_label,documentURL:i,description:n.preview_summary,tags:o,title:t.title,previewImageUrl:n.preview_image,onSelect:()=>l(t.id),statusColor:O[n.status].color},`${t.id}-${n.status}`)})]})})}function eow(t){let{message:n="We can't find any versions matching this request"}=t;return M.jsx(u.xu,{justifyContent:"center",flexDirection:"column",height:"100%",children:M.jsxs(u.R$,{children:[M.jsx(u.av,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed",size:"xlarge"}),M.jsx(u._T,{size:"big",children:"Oops!"}),M.jsx(u.nf,{width:360,children:n})]})})}function eoO(t){let{hasLink:n,onUnlink:r,selectEnabled:i,selectedType:o,onValueChange:a,openInNewTab:s=!0,setOpenInNewTab:l}=t;return M.jsxs(M.Fragment,{children:[l&&"web"===o&&M.jsx(u.zx,{startIcon:s?"checkBox":"checkBoxOutlinedBlank",color:"grey",size:"small",onClick:()=>l(!s),children:"Open in new tab"}),M.jsxs(u.Ph,{value:o,color:"grey",size:"small",boldTriggerText:!0,startIcon:function(t){if(t)switch(t){case"document":return"description";case"web":return"public";case"media":return"image"}}(o),disabled:!i,onValueChange:a,placeholder:"Choose link type",children:[M.jsx(u.Ql,{value:"web",icon:"public",children:"Link to web page"}),M.jsx(u.Ql,{value:"document",icon:"description",children:"Link to Prismic page"}),M.jsx(u.Ql,{value:"media",icon:"image",children:"Link to media"})]}),M.jsx(u.zx,{startIcon:"close",color:"grey",size:"small",disabled:!n,onClick:r})]})}d.Fs.registerFetcherConfig(eod,{cacheCapacity:500,revalidationStrategy:{type:"never"}});let eok={DocumentLink:"document",ExternalLink:"web",FileLink:"media",ImageLink:"media"},eoC={document:"DocumentLink",web:"ExternalLink",media:"FileLink"},eoI=to({id:e1(),title:e1()});function eoM(t,n,r){return(0,p.WY)(`${t}/documents/${r}`,{credentials:(0,p.xb)(n),okType:eoI})}function eoR(t){var n,r,i,o,a,u;let{media:s}=t,l="kind"in s;return l&&"image"===s.kind?{__TYPE__:"LinkContent",value:{__TYPE__:"ImageLink",id:s.id,name:s.filename,url:s.url,kind:s.kind,size:s.size.toString(),height:(null==(n=s.height)?void 0:n.toString())??"2000",width:(null==(r=s.width)?void 0:r.toString())??"2000",date:(null==(i=s.last_modified)?void 0:i.toString())??""}}:l?{__TYPE__:"LinkContent",value:{__TYPE__:"FileLink",id:s.id,name:s.filename,kind:s.kind,url:s.url,size:s.size.toString(),date:(null==(o=s.last_modified)?void 0:o.toString())??""}}:{__TYPE__:"LinkContent",value:{__TYPE__:"ImageLink",id:s.id,name:(null==s?void 0:s.alt)??s.url,kind:"image",url:s.url,size:"0",height:(null==(a=s.height)?void 0:a.toString())??"2000",width:(null==(u=s.width)?void 0:u.toString())??"2000"}}}function eoE(t){var n,r;let{content:i,field:a,id:l,onContentChange:c,readOnly:d}=t,[f,p]=(0,o.useState)(!1),[h,m]=(0,o.useState)(!1),[g,y]=(0,o.useState)(!1),[b,x]=(0,o.useState)(!1),{contentType:_,fieldValue:S,errorBoundaryRef:T,onDocumentSelected:w,onError:O,onMediaSelected:k,...C}=function(t){var n;let{field:r,content:i,onContentChange:a}=t,u=i?"DocumentLink"===i.value.__TYPE__?i.value.id:"ExternalLink"===i.value.__TYPE__?i.value.url:i.value.name:"",[l,c]=(0,o.useState)(()=>{var t,n;return!(null!=(t=r.config)&&t.select)||null!=i&&i.value.__TYPE__?null==i?void 0:i.value.__TYPE__:eoC[null==(n=r.config)?void 0:n.select]}),[d,f]=(0,o.useState)(()=>(null==i?void 0:i.value.__TYPE__)==="ExternalLink"?i.value.target:""),[p,h]=(0,o.useState)(!1),m=(0,o.useRef)(null);(0,s.pQ)(u,function(){var t;p&&(h(!1),null==(t=m.current)||t.reset())});let g=l?eok[l]:void 0;function y(t){if(!t)return a(void 0);switch(l){case"ExternalLink":return a({__TYPE__:"LinkContent",value:{__TYPE__:"ExternalLink",url:t,target:d}});case"DocumentLink":return a({__TYPE__:"LinkContent",value:{__TYPE__:"DocumentLink",id:t}});default:return a(void 0)}}function v(t){y(t)}return{contentType:l,selectType:g,fieldValue:u,onValueChange:y,onTypeChange:function(t){c(eoC[t]),y("")},placeholder:ZQ(r),isTypeSelectEnabled:!(null!=(n=r.config)&&n.select),onDocumentSelected:v,onError:function(){h(!0)},errorBoundaryRef:m,isTargetNewTab:"_blank"===d,updateWebLinkTarget:function(t){let n=t?"_blank":null;f(n),a({__TYPE__:"LinkContent",value:{__TYPE__:"ExternalLink",url:u,target:n}})},onMediaSelected:function(t){a(eoR({media:t}))}}}({content:i,field:a,onContentChange:c}),I="ExternalLink"===_&&(0,v.ju)(S),R={id:l,contentType:_,onBlur:()=>p(!1),onFocus(){p(!0),"DocumentLink"===_&&y(!0),"FileLink"===_&&x(!0),"ImageLink"===_&&x(!0)},readOnly:d||!_,textType:I||"ImageLink"===_||"FileLink"===_?"link":"normal",value:S,...C},{searchDocuments:E}=tR();return M.jsxs(M.Fragment,{children:[M.jsxs(u.J2,{onMouseOverChange:m,open:f||h,align:"start",sideOffset:-3,openDelay:100,closeDelay:200,focusOnEnter:!1,anchor:M.jsxs(u.gN,{onMouseOverChange:p,children:[M.jsx(u.fw,{name:"link"}),M.jsx(u.Qy,{htmlFor:l,children:ZJ(a)}),M.jsx(u.JO,{children:"DocumentLink"===_&&""!==S&&E?M.jsx(eoN,{errorBoundaryRef:T,onError:O,fallback:M.jsx(eoj,{...R,value:"..."}),renderError(){var t;return t=R,M.jsx(eoj,{...t,textType:"link"})},children:M.jsx(eoA,{...R,documentId:S,openDocumentListModal:()=>y(!0)})}):M.jsx(eoj,{...R})})]}),children:[I&&M.jsx(u.oZ,{url:I,title:(0,v.S$)(I)??"",subTitle:I.toString()}),(null==i?void 0:i.value.__TYPE__)==="ImageLink"&&M.jsx(u.Qi,{url:i.value.url,title:i.value.name,subTitle:`${i.value.width} x ${i.value.height} pixels`})]}),M.jsx(ei9,{open:b,onOpenChange:x,onMediaSelected:k,assetType:"all"}),M.jsx(eox,{open:g,onOpenChange:y,onSelectDocument(t){y(!1),w(t)},fixedCustomTypes:new Set(null==(n=a.config)?void 0:n.customtypes),fixedTags:new Set(null==(r=a.config)?void 0:r.tags)})]})}function eoj(t){let{id:n,onValueChange:r,placeholder:i,readOnly:o,value:a,textType:u,onFocus:s,onBlur:l,contentType:c,isTypeSelectEnabled:d,selectType:f,onTypeChange:p,isTargetNewTab:h,updateWebLinkTarget:m}=t,g="DocumentLink"===c||"ImageLink"===c||"FileLink"===c;return M.jsx(Z2,{id:n,onValueChange:r,placeholder:i,readOnly:o||g,value:a,variant:u,onFocus:s,onBlur:l,cursor:g?"pointer":"text",endAdornment:M.jsx(eoO,{hasLink:Boolean(a),onUnlink:()=>r(""),selectEnabled:d,selectedType:f,onValueChange:p,openInNewTab:h,setOpenInNewTab:m})})}function eoA(t){let{id:n,documentId:r,openDocumentListModal:i,onValueChange:o,isTypeSelectEnabled:a,selectType:u,onTypeChange:s}=t,l=function(t){let n=tR();n.searchDocuments||tj("searchDocuments");let{coreApiUrl:r,env:i}=n;return(0,d.QT)(eoM,[r,i,t]).title}(r);return M.jsx(Z2,{id:n,readOnly:!0,value:l,variant:"link",onFocus:i,cursor:"pointer",endAdornment:M.jsx(eoO,{hasLink:!0,onUnlink:()=>o(""),selectEnabled:a,selectedType:u,onValueChange:s})})}function eoN(t){let{errorBoundaryRef:n,onError:r,children:i,fallback:a,renderError:s}=t;return M.jsx(u.SV,{ref:n,onError:r,renderError:s,children:M.jsx(o.Suspense,{fallback:a,children:i})})}let eoP=({content:t,field:n,id:r,onContentChange:i,readOnly:o})=>{var a,s;let l=Number(null==t?void 0:t.value),c=Number.isFinite(l)?l:void 0;return M.jsxs(u.gN,{children:[M.jsx(u.fw,{name:"pin"}),M.jsx(u.Qy,{htmlFor:r,children:ZJ(n)}),M.jsx(u.JO,{children:M.jsx(u.Y2,{id:r,value:c,min:null==(a=n.config)?void 0:a.min,max:null==(s=n.config)?void 0:s.max,padding:Z3,placeholder:ZQ(n),readOnly:o,onValueChange(t){var n;return i((n=t,void 0===n?void 0:{__TYPE__:"FieldContent",type:"Number",value:String(n)}))}})})]})};var eoL=function(){};eoL.prototype.append=function(t){return t.length?(t=eoL.from(t),!this.length&&t||t.length<200&&this.leafAppend(t)||this.length<200&&t.leafPrepend(this)||this.appendInner(t)):this},eoL.prototype.prepend=function(t){return t.length?eoL.from(t).append(this):this},eoL.prototype.appendInner=function(t){return new eoF(this,t)},eoL.prototype.slice=function(t,n){return void 0===t&&(t=0),void 0===n&&(n=this.length),t>=n?eoL.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))},eoL.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},eoL.prototype.forEach=function(t,n,r){void 0===n&&(n=0),void 0===r&&(r=this.length),n<=r?this.forEachInner(t,n,r,0):this.forEachInvertedInner(t,n,r,0)},eoL.prototype.map=function(t,n,r){void 0===n&&(n=0),void 0===r&&(r=this.length);var i=[];return this.forEach(function(n,r){return i.push(t(n,r))},n,r),i},eoL.from=function(t){return t instanceof eoL?t:t&&t.length?new eoD(t):eoL.empty};var eoD=function(t){function n(n){t.call(this),this.values=n}t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n;var r={length:{configurable:!0},depth:{configurable:!0}};return n.prototype.flatten=function(){return this.values},n.prototype.sliceInner=function(t,r){return 0==t&&r==this.length?this:new n(this.values.slice(t,r))},n.prototype.getInner=function(t){return this.values[t]},n.prototype.forEachInner=function(t,n,r,i){for(var o=n;o<r;o++)if(!1===t(this.values[o],i+o))return!1},n.prototype.forEachInvertedInner=function(t,n,r,i){for(var o=n-1;o>=r;o--)if(!1===t(this.values[o],i+o))return!1},n.prototype.leafAppend=function(t){if(this.length+t.length<=200)return new n(this.values.concat(t.flatten()))},n.prototype.leafPrepend=function(t){if(this.length+t.length<=200)return new n(t.flatten().concat(this.values))},r.length.get=function(){return this.values.length},r.depth.get=function(){return 0},Object.defineProperties(n.prototype,r),n}(eoL);eoL.empty=new eoD([]);var eoF=function(t){function n(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},n.prototype.getInner=function(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},n.prototype.forEachInner=function(t,n,r,i){var o=this.left.length;if(n<o&&!1===this.left.forEachInner(t,n,Math.min(r,o),i)||r>o&&!1===this.right.forEachInner(t,Math.max(n-o,0),Math.min(this.length,r)-o,i+o))return!1},n.prototype.forEachInvertedInner=function(t,n,r,i){var o=this.left.length;if(n>o&&!1===this.right.forEachInvertedInner(t,n-o,Math.max(r,o)-o,i+o)||r<o&&!1===this.left.forEachInvertedInner(t,Math.min(n,o),r,i))return!1},n.prototype.sliceInner=function(t,n){if(0==t&&n==this.length)return this;var r=this.left.length;return n<=r?this.left.slice(t,n):t>=r?this.right.slice(t-r,n-r):this.left.slice(t,r).append(this.right.slice(0,n-r))},n.prototype.leafAppend=function(t){var r=this.right.leafAppend(t);if(r)return new n(this.left,r)},n.prototype.leafPrepend=function(t){var r=this.left.leafPrepend(t);if(r)return new n(r,this.right)},n.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new n(this.left,new n(this.right,t)):new n(this,t)},n}(eoL);class eoW{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(0==this.eventCount)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(o=(i=this.remapping(r,this.items.length)).maps.length);let a=t.tr,u,s,l=[],c=[];return this.items.forEach((t,n)=>{if(!t.step){i||(o=(i=this.remapping(r,n+1)).maps.length),o--,c.push(t);return}if(i){c.push(new eoU(t.map));let d=t.step.map(i.slice(o)),f;d&&a.maybeStep(d).doc&&(f=a.mapping.maps[a.mapping.maps.length-1],l.push(new eoU(f,void 0,void 0,l.length+c.length))),o--,f&&i.appendMap(f,o)}else a.maybeStep(t.step);if(t.selection)return u=i?t.selection.map(i.slice(o)):t.selection,s=new eoW(this.items.slice(0,r).append(c.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:s,transform:a,selection:u}}addTransform(t,n,r,i){var o,a;let u=[],s=this.eventCount,l=this.items,c=!i&&l.length?l.get(l.length-1):null;for(let d=0;d<t.steps.length;d++){let f=t.steps[d].invert(t.docs[d]),p=new eoU(t.mapping.maps[d],f,n),h;(h=c&&c.merge(p))&&(p=h,d?u.pop():l=l.slice(0,l.length-1)),u.push(p),n&&(s++,n=void 0),i||(c=p)}let m=s-r.depth,g;return m>eoB&&(o=l,a=m,l=(o.forEach((t,n)=>{if(t.selection&&0==a--)return g=n,!1}),o.slice(g)),s-=m),new eoW(l.append(u),s)}remapping(t,n){let r=new YQ;return this.items.forEach((n,i)=>{let o=null!=n.mirrorOffset&&i-n.mirrorOffset>=t?r.maps.length-n.mirrorOffset:void 0;r.appendMap(n.map,o)},t,n),r}addMaps(t){return 0==this.eventCount?this:new eoW(this.items.append(t.map(t=>new eoU(t))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=t.mapping,a=t.steps.length,u=this.eventCount;this.items.forEach(t=>{t.selection&&u--},i);let s=n;this.items.forEach(n=>{let i=o.getMirror(--s);if(null==i)return;a=Math.min(a,i);let l=o.maps[i];if(n.step){let c=t.steps[i].invert(t.docs[i]),d=n.selection&&n.selection.map(o.slice(s+1,i));d&&u++,r.push(new eoU(l,c,d))}else r.push(new eoU(l))},i);let l=[];for(let c=n;c<a;c++)l.push(new eoU(o.maps[c]));let d=this.items.slice(0,i).append(l).append(r),f=new eoW(d,u);return f.emptyItemCount()>500&&(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)),l=s&&s.getMap();if(r--,l&&n.appendMap(l,r),s){let c=a.selection&&a.selection.map(n.slice(r));c&&o++;let d=new eoU(l.invert(),s,c),f,p=i.length-1;(f=i.length&&i[p].merge(d))?i[p]=f:i.push(d)}}else a.map&&r--},this.items.length,0),new eoW(eoL.from(i.reverse()),o)}}eoW.empty=new eoW(eoL.empty,0);class eoU{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 eoU(n.getMap().invert(),n,this.selection)}}}class eoz{constructor(t,n,r,i,o){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}let eoB=20;function eoV(t){let n=[];return t.forEach((t,r,i,o)=>n.push(i,o)),n}function eo$(t,n){if(!t)return null;let r=[];for(let i=0;i<t.length;i+=2){let o=n.map(t[i],1),a=n.map(t[i+1],-1);o<=a&&r.push(o,a)}return r}function eoq(t,n,r,i){let o=eoG(n),a=eoZ.get(n).spec.config,u=(i?t.undone:t.done).popEvent(n,o);if(!u)return;let s=u.selection.resolve(u.transform.doc),l=(i?t.done:t.undone).addTransform(u.transform,n.selection.getBookmark(),a,o),c=new eoz(i?l:u.remaining,i?u.remaining:l,null,0,-1);r(u.transform.setSelection(s).setMeta(eoZ,{redo:i,historyState:c}).scrollIntoView())}let eoK=!1,eoH=null;function eoG(t){let n=t.plugins;if(eoH!=n){eoK=!1,eoH=n;for(let r=0;r<n.length;r++)if(n[r].spec.historyPreserveItems){eoK=!0;break}}return eoK}let eoZ=new J$("history"),eoY=new J$("closeHistory"),eoJ=(t,n)=>{let r=eoZ.getState(t);return!!r&&0!=r.done.eventCount&&(n&&eoq(r,t,n,!1),!0)},eoQ=(t,n)=>{let r=eoZ.getState(t);return!!r&&0!=r.undone.eventCount&&(n&&eoq(r,t,n,!0),!0)},eoX=etd.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:t,dispatch:n})=>eoJ(t,n),redo:()=>({state:t,dispatch:n})=>eoQ(t,n)}),addProseMirrorPlugins(){return[function(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Jz({key:eoZ,state:{init:()=>new eoz(eoW.empty,eoW.empty,null,0,-1),apply:(n,r,i)=>(function(t,n,r,i){let o=r.getMeta(eoZ),a;if(o)return o.historyState;r.getMeta(eoY)&&(t=new eoz(t.done,t.undone,null,0,-1));let u=r.getMeta("appendedTransaction");if(0==r.steps.length)return t;if(u&&u.getMeta(eoZ))return u.getMeta(eoZ).redo?new eoz(t.done.addTransform(r,void 0,i,eoG(n)),t.undone,eoV(r.mapping.maps[r.steps.length-1]),t.prevTime,t.prevComposition):new eoz(t.done,t.undone.addTransform(r,void 0,i,eoG(n)),null,t.prevTime,t.prevComposition);if(!1===r.getMeta("addToHistory")||u&&!1===u.getMeta("addToHistory"))return(a=r.getMeta("rebased"))?new eoz(t.done.rebased(r,a),t.undone.rebased(r,a),eo$(t.prevRanges,r.mapping),t.prevTime,t.prevComposition):new eoz(t.done.addMaps(r.mapping.maps),t.undone.addMaps(r.mapping.maps),eo$(t.prevRanges,r.mapping),t.prevTime,t.prevComposition);{let s=r.getMeta("composition"),l=0==t.prevTime||!u&&t.prevComposition!=s&&(t.prevTime<(r.time||0)-i.newGroupDelay||!function(t,n){if(!n)return!1;if(!t.docChanged)return!0;let r=!1;return t.mapping.maps[0].forEach((t,i)=>{for(let o=0;o<n.length;o+=2)t<=n[o+1]&&i>=n[o]&&(r=!0)}),r}(r,t.prevRanges)),c=u?eo$(t.prevRanges,r.mapping):eoV(r.mapping.maps[r.steps.length-1]);return new eoz(t.done.addTransform(r,l?n.selection.getBookmark():void 0,i,eoG(n)),eoW.empty,c,r.time,s??t.prevComposition)}})(r,i,n,t)},config:t,props:{handleDOMEvents:{beforeinput(t,n){let r=n.inputType,i="historyUndo"==r?eoJ:"historyRedo"==r?eoQ:null;return!!i&&(n.preventDefault(),i(t.state,t.dispatch))}}}})}(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),eo0=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,eo1=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,eo2=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,eo3=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,eo4=enB.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"strong"},{tag:"b",getAttrs:t=>"normal"!==t.style.fontWeight&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],renderHTML({HTMLAttributes:t}){return["strong",ee2(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[enW({find:eo0,type:this.type}),enW({find:eo2,type:this.type})]},addPasteRules(){return[enq({find:eo1,type:this.type}),enq({find:eo3,type:this.type})]}});var eo5,eo6,eo9=((eo5=eo9||{}).Document="document",eo5.Mark="mark",eo5.Node="node",eo5),eo8=((eo6=eo8||{}).Text="text",eo6.Embed="embed",eo6.Image="image",eo6);class eo7{constructor(t,n,r,i,o,a=!1){w(this,"extType","node"),w(this,"nodeType","text"),this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i,this.placeholder=o,this.lockedFormat=a}}function eae(t){return t instanceof eo7}class eat extends eo7{constructor(t,n,r,i,o){super(t,"heading",n,i,o),this.levels=r}}class ean extends eo7{constructor(t,n,r,i){super(t,n,r,i)}}function ear(t){return t instanceof ean}let eai=enV.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:t}){return["br",ee2(this.options.HTMLAttributes,t)]},renderText:()=>`
|
|
93
|
-
`,addCommands(){return{setHardBreak:()=>({commands:t,chain:n,state:r,editor:i})=>t.first([()=>t.exitCode(),()=>t.command(()=>{let{selection:t,storedMarks:o}=r;if(t.$from.parent.type.spec.isolating)return!1;let{keepMarks:a}=this.options,{splittableMarks:u}=i.extensionManager,s=o||t.$to.parentOffset&&t.$from.marks();return n().insertContent({type:this.name}).command(({tr:t,dispatch:n})=>{if(n&&s&&a){let r=s.filter(t=>u.includes(t.type.name));t.ensureMarks(r)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),eao={isHardBreak:t=>t.type.name===eai.name,children:{reduce(t,n,r){let i=r;return t.forEach((t,r,o)=>{i=n(i,t,o)}),i},map(t,n){return this.reduce(t,(t,r)=>[...t,n(r)],[])},exists(t,n){return this.reduce(t,(t,r)=>t||n(r),!1)},filter(t,n){return this.reduce(t,(t,r)=>[...t,...n(r)?[r]:[]],[])}},marks:{reduce(t,n,r){let i=r;return t.marks.forEach((t,r)=>{i=n(i,t,r)}),i},map(t,n){return this.reduce(t,(t,r)=>[...t,n(r)],[])},filter(t,n){return this.reduce(t,(t,r)=>[...t,...n(r)?[r]:[]],[])}}};function eaa(){return{extensions:elt(),defaultTextConverter:void 0}}let eau=eo4.extend({name:"bold"}),eas=new class{constructor(t,n,r){w(this,"extType",eo9.Mark),w(this,"richTextNodeTypes",qG.RichTextNodeType.strong),this.name=t,this.component=n,this.converter=r}}(eau.name,eau,{fromPrismic:t=>function(){var n;return null==(n=t.marks[eau.name])?void 0:n.create()},toPrismic(){}}),eal=enV.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",ee2(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),eac=enB.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",ee2(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:n})=>{let r=eni(t,this.type);return!!Object.entries(r).some(([,t])=>!!t)||n.unsetMark(this.name)}}}}),ead=/^\s*([-+*])\s$/,eaf=enV.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:t}){return["ul",ee2(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:n})=>this.options.keepAttributes?n().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(eal.name,this.editor.getAttributes(eac.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=enz({find:ead,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=enz({find:ead,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(eac.name),editor:this.editor})),[t]}}),eap=enV.create({name:"doc",topNode:!0,content:"block+"}),eah=enV.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",ee2(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),eam=eah.extend({name:"listItem",content:"paragraph*",addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name)}}}),eag={component:eam,converter:{fromPrismic:t=>function(n){var r;let i=esp.converter.fromPrismic(t)(n);if(i)return null==(r=t.nodes[eam.name])?void 0:r.create({},i)},toPrismic:(t,n)=>eao.children.reduce(t,(t,r)=>{let i=esp.converter.toPrismic(r),o=i instanceof Array?i.map(t=>({...t,type:n})):i?[{...i,type:n}]:[];return[...t,...o]},[])},placeholder:"List"},eay="document",eav=t=>eap.extend({name:eay,content:t?"block+":"block"}),eab=t=>({fromPrismic(n,r){function i(t,n){return!n&&r&&nJ.TextBlock.is(t)?r(t):n}return function(r){var o;let a=r.value.reduce((r,o)=>{let a=t.find(t=>t.richTextNodeTypes.includes(o.type)),u=function(t){let{ext:n,block:r,schema:i}=t;if(n)switch(n.nodeType){case eo8.Embed:return nJ.EmbedBlock.is(r)?n.converter.fromPrismic(i)(r):void 0;case eo8.Text:return nJ.TextBlock.is(r)?n.converter.fromPrismic(i)(r):void 0;case eo8.Image:return nJ.ImageBlock.is(r)?n.converter.fromPrismic(i)(r):void 0;default:return}}({ext:a,block:o,schema:n}),s=r.slice(0,r.length-1),l=(0,f.Z$)(r),c=function(t){var n,r;let{node:i,block:o,nodeWithDefault:a,previousNode:u}=t;return i&&u?i.type.name===u.type.name&&(i.type.name===esS.name||i.type.name===es7.name)?{merged:!0,updatedNode:u.copy(u.content.append(i.content))}:{merged:!1,updatedNode:a(o,i)}:{merged:!1,updatedNode:i}}({node:u,block:o,nodeWithDefault:i,previousNode:l});return c.updatedNode?[...c.merged?s:r,c.updatedNode]:r},[]);return null==(o=n.nodes[eay])?void 0:o.create({},a)}},toPrismic:n=>({__TYPE__:"StructuredTextContent",value:[...eao.children.reduce(n,(n,r)=>{let i=Object.values(t).find(t=>r.type.name===t.name),o=null==i?void 0:i.converter.toPrismic(r);return o||console.warn(`Cannot convert node of type '${r.type.name}'.`),o?[...n,...o instanceof Array?o:[o]]:n},[])]})}),eax=new class{constructor(t,n,r){w(this,"extType","document"),this.name=t,this.component=n,this.converter=r}}(eay,eav,eab),ea_=eai.extend({name:"hard_break"}),eaS=`
|
|
94
|
-
`,eaT={fromPrismic:t=>function(n){var r;if(n===eaS)return null==(r=t.nodes[ea_.name])?void 0:r.create({})},toPrismic(t){if(t.type.name===ea_.name)return eaS}},eaw={isEmptyLine:t=>0===t.length,isFirst:t=>0===t},eaO={name:ea_.name,component:ea_,converter:eaT,splitTextToNodes:function(t,n){return function(r){let i=eaT.fromPrismic(t)(eaS);if(!i)return[r(n)];let o=n.split(eaS);return 1===o.length?n.length?[r(n)]:[i]:o.reduce((t,n,o)=>eaw.isFirst(o)?eaw.isEmptyLine(n)?t:[...t,r(n)]:eaw.isEmptyLine(n)?[...t,i]:[...t,i,r(n)],[])}}},eak=etd.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new Jz({key:new J$("placeholder"),props:{decorations:({doc:t,selection:n})=>{let r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=n,o=[];if(!r)return null;let a=t.type.createAndFill(),u=(null==a?void 0:a.sameMarkup(t))&&null===a.content.findDiffStart(t.content);return t.descendants((t,n)=>{let r=i>=n&&i<=n+t.nodeSize,a=!t.isLeaf&&!t.childCount;if((r||!this.options.showOnlyCurrent)&&a){let s=[this.options.emptyNodeClass];u&&s.push(this.options.emptyEditorClass);let l=XQ.node(n,n+t.nodeSize,{class:s.join(" "),"data-placeholder":"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:t,pos:n,hasAnchor:r}):this.options.placeholder});o.push(l)}return this.options.includeChildren}),X1.create(t,o)}}})]}}),eaC=t=>eak.configure({includeChildren:!0,placeholder:n=>(function({props:t,params:n}){var r;let{editor:i,hasAnchor:o,node:a}=t,{placeholderByNodeType:u,unfocusedPlaceholder:s,nodeExtensions:l}=n,c=!eao.children.exists(i.state.doc,t=>t===a),d=i.isEditable,f=i.isFocused&&o,p=a.type.name!==esp.name,h=f||p||c,m=l.length>1,g=function(){if(c)return eag.placeholder;let t=u[a.type.name];return"string"==typeof t?t:null==t?void 0:t(a.attrs)}();return s&&!f&&i.isEmpty?s:("Type '/' for commands"===g?d&&h&&m:d&&h)&&g||""})({props:n,params:t}),showOnlyCurrent:!1,showOnlyWhenEditable:!1});function eaI(t){return t.split("-")[1]}function eaM(t){return"y"===t?"height":"width"}function eaR(t){return t.split("-")[0]}function eaE(t){return["top","bottom"].includes(eaR(t))?"x":"y"}function eaj(t,n,r){let{reference:i,floating:o}=t,a=i.x+i.width/2-o.width/2,u=i.y+i.height/2-o.height/2,s=eaE(n),l=eaM(s),c=i[l]/2-o[l]/2,d=eaR(n),f="x"===s,p;switch(d){case"top":p={x:a,y:i.y-o.height};break;case"bottom":p={x:a,y:i.y+i.height};break;case"right":p={x:i.x+i.width,y:u};break;case"left":p={x:i.x-o.width,y:u};break;default:p={x:i.x,y:i.y}}switch(eaI(n)){case"start":p[s]-=c*(r&&f?-1:1);break;case"end":p[s]+=c*(r&&f?-1:1)}return p}let eaA=async(t,n,r)=>{let{placement:i="bottom",strategy:o="absolute",middleware:a=[],platform:u}=r,s=a.filter(Boolean),l=await (null==u.isRTL?void 0:u.isRTL(n)),c=await u.getElementRects({reference:t,floating:n,strategy:o}),{x:d,y:f}=eaj(c,i,l),p=i,h={},m=0;for(let g=0;g<s.length;g++){let{name:y,fn:v}=s[g],{x:b,y:x,data:_,reset:S}=await v({x:d,y:f,initialPlacement:i,placement:p,strategy:o,middlewareData:h,rects:c,platform:u,elements:{reference:t,floating:n}});if(d=b??d,f=x??f,h={...h,[y]:{...h[y],..._}},S&&m<=50){m++,"object"==typeof S&&(S.placement&&(p=S.placement),S.rects&&(c=!0===S.rects?await u.getElementRects({reference:t,floating:n,strategy:o}):S.rects),{x:d,y:f}=eaj(c,p,l)),g=-1;continue}}return{x:d,y:f,placement:p,strategy:o,middlewareData:h}};function eaN(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}async function eaP(t,n){var r,i,o;void 0===n&&(n={});let{x:a,y:u,platform:s,rects:l,elements:c,strategy:d}=t,{boundary:f="clippingAncestors",rootBoundary:p="viewport",elementContext:h="floating",altBoundary:m=!1,padding:g=0}=n,y="number"!=typeof g?{top:0,right:0,bottom:0,left:0,...g}:{top:g,right:g,bottom:g,left:g},v=c[m?"floating"===h?"reference":"floating":h],b=eaN(await s.getClippingRect({element:null==(r=await (null==s.isElement?void 0:s.isElement(v)))||r?v:v.contextElement||await (null==s.getDocumentElement?void 0:s.getDocumentElement(c.floating)),boundary:f,rootBoundary:p,strategy:d})),x="floating"===h?{...l.floating,x:a,y:u}:l.reference,_=await (null==s.getOffsetParent?void 0:s.getOffsetParent(c.floating)),S=await (null==s.isElement?void 0:s.isElement(_))&&await (null==s.getScale?void 0:s.getScale(_))||{x:1,y:1},T=eaN(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:x,offsetParent:_,strategy:d}):x);return{top:(b.top-T.top+y.top)/S.y,bottom:(T.bottom-b.bottom+y.bottom)/S.y,left:(b.left-T.left+y.left)/S.x,right:(T.right-b.right+y.right)/S.x}}let eaL=Math.min,eaD=Math.max;function eaF(t,n,r){return eaD(t,eaL(n,r))}let eaW={left:"right",right:"left",bottom:"top",top:"bottom"};function eaU(t){return t.replace(/left|right|bottom|top/g,t=>eaW[t])}let eaz={start:"end",end:"start"};function eaB(t){return t.replace(/start|end/g,t=>eaz[t])}async function eaV(t,n){let{placement:r,platform:i,elements:o}=t,a=await (null==i.isRTL?void 0:i.isRTL(o.floating)),u=eaR(r),s=eaI(r),l="x"===eaE(r),c=["left","top"].includes(u)?-1:1,d=a&&l?-1:1,f="function"==typeof n?n(t):n,{mainAxis:p,crossAxis:h,alignmentAxis:m}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return s&&"number"==typeof m&&(h="end"===s?-1*m:m),l?{x:h*d,y:p*c}:{x:p*c,y:h*d}}function ea$(t){return"x"===t?"y":"x"}function eaq(t){var n;return(null==(n=t.ownerDocument)?void 0:n.defaultView)||window}function eaK(t){return eaq(t).getComputedStyle(t)}let eaH=Math.min,eaG=Math.max,eaZ=Math.round;function eaY(t){let n=eaK(t),r=parseFloat(n.width),i=parseFloat(n.height),o=t.offsetWidth,a=t.offsetHeight,u=eaZ(r)!==o||eaZ(i)!==a;return u&&(r=o,i=a),{width:r,height:i,fallback:u}}function eaJ(t){return ea2(t)?(t.nodeName||"").toLowerCase():""}let eaQ;function eaX(){if(eaQ)return eaQ;let t=navigator.userAgentData;return t&&Array.isArray(t.brands)?eaQ=t.brands.map(t=>t.brand+"/"+t.version).join(" "):navigator.userAgent}function ea0(t){return t instanceof eaq(t).HTMLElement}function ea1(t){return t instanceof eaq(t).Element}function ea2(t){return t instanceof eaq(t).Node}function ea3(t){if(typeof ShadowRoot>"u")return!1;let n=eaq(t).ShadowRoot;return t instanceof n||t instanceof ShadowRoot}function ea4(t){let{overflow:n,overflowX:r,overflowY:i,display:o}=eaK(t);return/auto|scroll|overlay|hidden|clip/.test(n+i+r)&&!["inline","contents"].includes(o)}function ea5(t){return["table","td","th"].includes(eaJ(t))}function ea6(t){let n=/firefox/i.test(eaX()),r=eaK(t),i=r.backdropFilter||r.WebkitBackdropFilter;return"none"!==r.transform||"none"!==r.perspective||!!i&&"none"!==i||n&&"filter"===r.willChange||n&&!!r.filter&&"none"!==r.filter||["transform","perspective"].some(t=>r.willChange.includes(t))||["paint","layout","strict","content"].some(t=>{let n=r.contain;return null!=n&&n.includes(t)})}function ea9(){return/^((?!chrome|android).)*safari/i.test(eaX())}function ea8(t){return["html","body","#document"].includes(eaJ(t))}function ea7(t){return ea1(t)?t:t.contextElement}let eue={x:1,y:1};function eut(t){let n=ea7(t);if(!ea0(n))return eue;let r=n.getBoundingClientRect(),{width:i,height:o,fallback:a}=eaY(n),u=(a?eaZ(r.width):r.width)/i,s=(a?eaZ(r.height):r.height)/o;return u&&Number.isFinite(u)||(u=1),s&&Number.isFinite(s)||(s=1),{x:u,y:s}}function eun(t,n,r,i){var o,a;void 0===n&&(n=!1),void 0===r&&(r=!1);let u=t.getBoundingClientRect(),s=ea7(t),l=eue;n&&(i?ea1(i)&&(l=eut(i)):l=eut(t));let c=s?eaq(s):window,d=ea9()&&r,f=(u.left+(d&&(null==(o=c.visualViewport)?void 0:o.offsetLeft)||0))/l.x,p=(u.top+(d&&(null==(a=c.visualViewport)?void 0:a.offsetTop)||0))/l.y,h=u.width/l.x,m=u.height/l.y;if(s){let g=eaq(s),y=i&&ea1(i)?eaq(i):i,v=g.frameElement;for(;v&&i&&y!==g;){let b=eut(v),x=v.getBoundingClientRect(),_=getComputedStyle(v);x.x+=(v.clientLeft+parseFloat(_.paddingLeft))*b.x,x.y+=(v.clientTop+parseFloat(_.paddingTop))*b.y,f*=b.x,p*=b.y,h*=b.x,m*=b.y,f+=x.x,p+=x.y,v=eaq(v).frameElement}}return{width:h,height:m,top:p,right:f+h,bottom:p+m,left:f,x:f,y:p}}function eur(t){return((ea2(t)?t.ownerDocument:t.document)||window.document).documentElement}function eui(t){return ea1(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function euo(t){return eun(eur(t)).left+eui(t).scrollLeft}function eua(t){if("html"===eaJ(t))return t;let n=t.assignedSlot||t.parentNode||ea3(t)&&t.host||eur(t);return ea3(n)?n.host:n}function euu(t,n){var r;void 0===n&&(n=[]);let i=function t(n){let r=eua(n);return ea8(r)?r.ownerDocument.body:ea0(r)&&ea4(r)?r:t(r)}(t),o=i===(null==(r=t.ownerDocument)?void 0:r.body),a=eaq(i);return o?n.concat(a,a.visualViewport||[],ea4(i)?i:[]):n.concat(i,euu(i))}function eus(t,n,r){let i;if("viewport"===n)i=function(t,n){let r=eaq(t),i=eur(t),o=r.visualViewport,a=i.clientWidth,u=i.clientHeight,s=0,l=0;if(o){a=o.width,u=o.height;let c=ea9();(!c||c&&"fixed"===n)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:a,height:u,x:s,y:l}}(t,r);else if("document"===n)i=function(t){let n=eur(t),r=eui(t),i=t.ownerDocument.body,o=eaG(n.scrollWidth,n.clientWidth,i.scrollWidth,i.clientWidth),a=eaG(n.scrollHeight,n.clientHeight,i.scrollHeight,i.clientHeight),u=-r.scrollLeft+euo(t),s=-r.scrollTop;return"rtl"===eaK(i).direction&&(u+=eaG(n.clientWidth,i.clientWidth)-o),{width:o,height:a,x:u,y:s}}(eur(t));else if(ea1(n))i=function(t,n){let r=eun(t,!0,"fixed"===n),i=r.top+t.clientTop,o=r.left+t.clientLeft,a=ea0(t)?eut(t):{x:1,y:1},u=t.clientWidth*a.x,s=t.clientHeight*a.y,l=o*a.x,c=i*a.y;return{width:u,height:s,x:l,y:c}}(n,r);else{let o={...n};if(ea9()){var a,u;let s=eaq(t);o.x-=(null==(a=s.visualViewport)?void 0:a.offsetLeft)||0,o.y-=(null==(u=s.visualViewport)?void 0:u.offsetTop)||0}i=o}return eaN(i)}function eul(t,n){return ea0(t)&&"fixed"!==eaK(t).position?n?n(t):t.offsetParent:null}function euc(t,n){let r=eaq(t),i=eul(t,n);for(;i&&ea5(i)&&"static"===eaK(i).position;)i=eul(i,n);return i&&("html"===eaJ(i)||"body"===eaJ(i)&&"static"===eaK(i).position&&!ea6(i))?r:i||function(t){let n=eua(t);for(;ea0(n)&&!ea8(n);){if(ea6(n))return n;n=eua(n)}return null}(t)||r}let eud={getClippingRect:function(t){let{element:n,boundary:r,rootBoundary:i,strategy:o}=t,a=[..."clippingAncestors"===r?function(t,n){let r=n.get(t);if(r)return r;let i=euu(t).filter(t=>ea1(t)&&"body"!==eaJ(t)),o=null,a="fixed"===eaK(t).position,u=a?eua(t):t;for(;ea1(u)&&!ea8(u);){let s=eaK(u),l=ea6(u);"fixed"===s.position?o=null:(a?l||o:!(!l&&"static"===s.position&&o&&["absolute","fixed"].includes(o.position)))?o=s:i=i.filter(t=>t!==u),u=eua(u)}return n.set(t,i),i}(n,this._c):[].concat(r),i],u=a[0],s=a.reduce((t,r)=>{let i=eus(n,r,o);return t.top=eaG(i.top,t.top),t.right=eaH(i.right,t.right),t.bottom=eaH(i.bottom,t.bottom),t.left=eaG(i.left,t.left),t},eus(n,u,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:n,offsetParent:r,strategy:i}=t,o=ea0(r),a=eur(r);if(r===a)return n;let u={scrollLeft:0,scrollTop:0},s={x:1,y:1},l={x:0,y:0};if((o||!o&&"fixed"!==i)&&(("body"!==eaJ(r)||ea4(a))&&(u=eui(r)),ea0(r))){let c=eun(r);s=eut(r),l.x=c.x+r.clientLeft,l.y=c.y+r.clientTop}return{width:n.width*s.x,height:n.height*s.y,x:n.x*s.x-u.scrollLeft*s.x+l.x,y:n.y*s.y-u.scrollTop*s.y+l.y}},isElement:ea1,getDimensions:function(t){return ea0(t)?eaY(t):t.getBoundingClientRect()},getOffsetParent:euc,getDocumentElement:eur,getScale:eut,async getElementRects(t){let{reference:n,floating:r,strategy:i}=t,o=this.getOffsetParent||euc,a=this.getDimensions;return{reference:function(t,n,r){let i=ea0(n),o=eur(n),a=eun(t,!0,"fixed"===r,n),u={scrollLeft:0,scrollTop:0},s={x:0,y:0};if(i||!i&&"fixed"!==r){if(("body"!==eaJ(n)||ea4(o))&&(u=eui(n)),ea0(n)){let l=eun(n,!0);s.x=l.x+n.clientLeft,s.y=l.y+n.clientTop}else o&&(s.x=euo(o))}return{x:a.left+u.scrollLeft-s.x,y:a.top+u.scrollTop-s.y,width:a.width,height:a.height}}(n,await o(r),i),floating:{x:0,y:0,...await a(r)}}},getClientRects:t=>Array.from(t.getClientRects()),isRTL:t=>"rtl"===eaK(t).direction};function euf(t,n,r,i){void 0===i&&(i={});let{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:u=!0,animationFrame:s=!1}=i,l=o&&!s,c=l||a?[...ea1(t)?euu(t):t.contextElement?euu(t.contextElement):[],...euu(n)]:[];c.forEach(t=>{l&&t.addEventListener("scroll",r,{passive:!0}),a&&t.addEventListener("resize",r)});let d=null;if(u){let f=!0;d=new ResizeObserver(()=>{f||r(),f=!1}),ea1(t)&&!s&&d.observe(t),ea1(t)||!t.contextElement||s||d.observe(t.contextElement),d.observe(n)}let p,h=s?eun(t):null;return s&&function n(){let i=eun(t);h&&(i.x!==h.x||i.y!==h.y||i.width!==h.width||i.height!==h.height)&&r(),h=i,p=requestAnimationFrame(n)}(),r(),()=>{var t;c.forEach(t=>{l&&t.removeEventListener("scroll",r),a&&t.removeEventListener("resize",r)}),null==(t=d)||t.disconnect(),d=null,s&&cancelAnimationFrame(p)}}let eup=(t,n,r)=>{let i=new Map,o={platform:eud,...r},a={...o.platform,_c:i};return eaA(t,n,{...o,platform:a})};var euh="u">typeof document?o.useLayoutEffect:o.useEffect;function eum(t,n){if(t===n)return!0;if(typeof t!=typeof n)return!1;if("function"==typeof t&&t.toString()===n.toString())return!0;let r,i,o;if(t&&n&&"object"==typeof t){if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(i=r;0!=i--;)if(!eum(t[i],n[i]))return!1;return!0}if((r=(o=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=r;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;0!=i--;){let a=o[i];if(!("_owner"===a&&t.$$typeof)&&!eum(t[a],n[a]))return!1}return!0}return t!=t&&n!=n}function eug(t){let n=o.useRef(t);return euh(()=>{n.current=t}),n}var euy="u">typeof document?o.useLayoutEffect:o.useEffect;let euv=!1,eub=0,eux=()=>"floating-ui-"+eub++,eu_=(H1||(H1=r.t(o,2)))["useId".toString()],euS=eu_??function(){let[t,n]=o.useState(()=>euv?eux():void 0);return euy(()=>{null==t&&n(eux())},[]),o.useEffect(()=>{euv||(euv=!0)},[]),t},euT=o.createContext(null),euw=o.createContext(null),euO=()=>{var t,n;return null!=(t=null==(n=o.useContext(euT))?void 0:n.id)?t:null},euk=()=>o.useContext(euw);function euC(t){var n;return null!=(n=null==t?void 0:t.ownerDocument)?n:document}function euI(t){var n;return null!=(n=euC(t).defaultView)?n:window}function euM(t){return!!t&&t instanceof euI(t).Element}let euR=(H1||(H1=r.t(o,2)))["useInsertionEffect".toString()];function euE(t){let n=o.useRef(()=>{});return euR?euR(()=>{n.current=t}):n.current=t,o.useCallback(function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return null==n.current?void 0:n.current(...r)},[])}function euj(t,n,r){let i=new Map;return{..."floating"===r&&{tabIndex:-1},...t,...n.map(t=>t?t[r]:null).concat(t).reduce((t,n)=>(n&&Object.entries(n).forEach(n=>{let[r,o]=n;if(0===r.indexOf("on")){if(i.has(r)||i.set(r,[]),"function"==typeof o){var a;null==(a=i.get(r))||a.push(o),t[r]=function(){for(var t,n=arguments.length,o=Array(n),a=0;a<n;a++)o[a]=arguments[a];null==(t=i.get(r))||t.forEach(t=>t(...o))}}}else t[r]=o}),t),{})}}function euA(t,n){var r,i;let o=null!=(r=t.filter(t=>{var r;return t.parentId===n&&(null==(r=t.context)?void 0:r.open)}))?r:[],a=o;for(;a.length;)a=null!=(i=t.filter(t=>{var n;return null==(n=a)?void 0:n.some(n=>{var r;return t.parentId===n.id&&(null==(r=t.context)?void 0:r.open)})}))?i:[],o=o.concat(a);return o}function euN(t){let n=t.activeElement;for(;(null==(r=n)||null==(i=r.shadowRoot)?void 0:i.activeElement)!=null;){var r,i;n=n.shadowRoot.activeElement}return n}function euP(t){t.preventDefault(),t.stopPropagation()}function euL(t){let n=(0,o.useRef)();return euy(()=>{n.current=t},[t]),n.current}let euD=function(t,n){let{open:r}=t,{enabled:i=!0,role:o="dialog"}=void 0===n?{}:n,a=euS(),u=euS(),s={id:a,role:o};return i?"tooltip"===o?{reference:{"aria-describedby":r?a:void 0},floating:s}:{reference:{"aria-expanded":r?"true":"false","aria-haspopup":"alertdialog"===o?"dialog":o,"aria-controls":r?a:void 0,..."listbox"===o&&{role:"combobox"},..."menu"===o&&{id:u}},floating:{...s,..."menu"===o&&{"aria-labelledby":u}}}:{}};function euF(t,n){return null!=n&&("composedPath"in t?t.composedPath().includes(n):null!=t.target&&n.contains(t.target))}let euW=function(t,n){let{open:r,onOpenChange:i,refs:a,events:u,nodeId:s}=t,{enabled:l=!0,escapeKey:c=!0,outsidePointerDown:d=!0,referencePointerDown:f=!1,ancestorScroll:p=!1,bubbles:h=!0}=void 0===n?{}:n,m=euk(),g=null!=euO(),y=o.useRef(!1);return o.useEffect(()=>{if(!r||!l)return;function t(t){"Escape"!==t.key||!h&&m&&euA(m.nodesRef.current,s).length>0||(u.emit("dismiss",{preventScroll:!1}),i(!1))}function n(t){var n,r;let o=y.current;if(y.current=!1,o)return;let l="composedPath"in t?t.composedPath()[0]:t.target;if(euM(l)&&a.floating.current){let c=null!=(r=a.floating.current.ownerDocument.defaultView)?r:window,d=l.scrollWidth>l.clientWidth,f=l.scrollHeight>l.clientHeight,p=f&&t.offsetX>l.clientWidth;if(f&&"rtl"===c.getComputedStyle(l).direction&&(p=t.offsetX<=l.offsetWidth-l.clientWidth),p||d&&t.offsetY>l.clientHeight)return}let v=m&&euA(m.nodesRef.current,s).some(n=>{var r;return euF(t,null==(r=n.context)?void 0:r.refs.floating.current)});euF(t,a.floating.current)||euF(t,a.domReference.current)||v||!h&&m&&euA(m.nodesRef.current,s).length>0||(u.emit("dismiss",!!g&&{preventScroll:!0}),i(!1))}function o(){i(!1)}let f=euC(a.floating.current);c&&f.addEventListener("keydown",t),d&&f.addEventListener("pointerdown",n);let v=(p?[...euM(a.reference.current)?euu(a.reference.current):[],...euM(a.floating.current)?euu(a.floating.current):[]]:[]).filter(t=>{var n;return t!==(null==(n=f.defaultView)?void 0:n.visualViewport)});return v.forEach(t=>t.addEventListener("scroll",o,{passive:!0})),()=>{c&&f.removeEventListener("keydown",t),d&&f.removeEventListener("pointerdown",n),v.forEach(t=>t.removeEventListener("scroll",o))}},[c,d,u,m,s,r,i,p,l,h,a,g]),l?{reference:{onPointerDown(){f&&(u.emit("dismiss"),i(!1))}},floating:{onPointerDownCapture(){y.current=!0}}}:{}},euU="ArrowUp",euz="ArrowDown",euB="ArrowLeft",euV="ArrowRight";function eu$(t,n,r){return Math.floor(t/n)!==r}function euq(t,n){return n<0||n>=t.current.length}function euK(t,n){let{startingIndex:r=-1,decrement:i=!1,disabledIndices:o,amount:a=1}=void 0===n?{}:n,u=t.current,s=r;do{var l,c;s+=i?-a:a}while(s>=0&&s<=u.length-1&&(o?o.includes(s):null==u[s]||null!=(l=u[s])&&l.hasAttribute("disabled")||(null==(c=u[s])?void 0:c.getAttribute("aria-disabled"))==="true"));return s}function euH(t,n,r){switch(t){case"vertical":return n;case"horizontal":return r;default:return n||r}}function euG(t,n){return euH(n,t===euU||t===euz,t===euB||t===euV)}function euZ(t,n,r){return euH(n,t===euz,r?t===euB:t===euV)||"Enter"===t||" "==t||""===t}function euY(t,n){return euK(t,{disabledIndices:n})}function euJ(t,n){return euK(t,{decrement:!0,startingIndex:t.current.length,disabledIndices:n})}let euQ=function(t,n){let{open:r,onOpenChange:i,refs:a}=t,{listRef:u,activeIndex:s,onNavigate:l=()=>{},enabled:c=!0,selectedIndex:d=null,allowEscape:f=!1,loop:p=!1,nested:h=!1,rtl:m=!1,virtual:g=!1,focusItemOnOpen:y="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:b=!0,disabledIndices:x,orientation:_="vertical",cols:S=1}=void 0===n?{listRef:{current:[]},activeIndex:null,onNavigate(){}}:n,T=euO(),w=euk(),O=euL(r),k=euE(l),C=euE(euL(l)),I=o.useRef(y),M=o.useRef(d??-1),R=o.useRef(null),E=function(t){let n=(0,o.useRef)(t);return euy(()=>{n.current=t}),n}(x),j=o.useRef(!1),A=o.useRef(-1),[N,P]=o.useState(),L=o.useCallback((t,n)=>{A.current=requestAnimationFrame(()=>{var r,i;g?P(null==(r=t.current[n.current])?void 0:r.id):null==(i=t.current[n.current])||i.focus({preventScroll:!0})})},[g]);function D(t){var n,o,s,l;if(j.current=!0,h&&(n=t.key,euH(_,m?n===euV:n===euB,n===euU))){euP(t),i(!1),(l=a.domReference.current)&&l instanceof euI(l).HTMLElement&&a.domReference.current.focus();return}let c=M.current,d=euY(u,x),y=euJ(u,x);if("Home"===t.key&&(M.current=d,k(M.current)),"End"===t.key&&(M.current=y,k(M.current)),S>1){let v=M.current;if(t.key===euU){if(euP(t),-1===v)M.current=y;else if(M.current=euK(u,{startingIndex:v,amount:S,decrement:!0,disabledIndices:x}),p&&(v-S<d||M.current<0)){let b=v%S,T=y%S,w=y-(T-b);T===b?M.current=y:M.current=T>b?w:w-S}euq(u,M.current)&&(M.current=v),k(M.current)}if(t.key===euz&&(euP(t),-1===v?M.current=d:(M.current=euK(u,{startingIndex:v,amount:S,disabledIndices:x}),p&&v+S>y&&(M.current=euK(u,{startingIndex:v%S-S,amount:S,disabledIndices:x}))),euq(u,M.current)&&(M.current=v),k(M.current)),"both"===_){let O=Math.floor(v/S);t.key===euV&&(euP(t),v%S!=S-1?(M.current=euK(u,{startingIndex:v,disabledIndices:x}),p&&eu$(M.current,S,O)&&(M.current=euK(u,{startingIndex:v-v%S-1,disabledIndices:x}))):p&&(M.current=euK(u,{startingIndex:v-v%S-1,disabledIndices:x})),eu$(M.current,S,O)&&(M.current=v)),t.key===euB&&(euP(t),v%S!=0?(M.current=euK(u,{startingIndex:v,disabledIndices:x,decrement:!0}),p&&eu$(M.current,S,O)&&(M.current=euK(u,{startingIndex:v+(S-v%S),decrement:!0,disabledIndices:x}))):p&&(M.current=euK(u,{startingIndex:v+(S-v%S),decrement:!0,disabledIndices:x})),eu$(M.current,S,O)&&(M.current=v)),euq(u,M.current)&&(p&&Math.floor(y/S)===O?M.current=t.key===euB?y:euK(u,{startingIndex:v-v%S-1,disabledIndices:x}):M.current=v),k(M.current);return}}if(euG(t.key,_)){if(euP(t),r&&!g&&euN(t.currentTarget.ownerDocument)===t.currentTarget){M.current=euZ(t.key,_,m)?d:y,k(M.current);return}euZ(t.key,_,m)?p?M.current=c>=y?f&&c!==u.current.length?-1:d:euK(u,{startingIndex:c,disabledIndices:x}):M.current=Math.min(y,euK(u,{startingIndex:c,disabledIndices:x})):p?M.current=c<=d?f&&-1!==c?u.current.length:y:euK(u,{startingIndex:c,decrement:!0,disabledIndices:x}):M.current=Math.max(d,euK(u,{startingIndex:c,decrement:!0,disabledIndices:x})),euq(u,M.current)?k(null):k(M.current)}}return euy(()=>{c&&(!O&&r&&I.current&&null!=d&&k(d),O&&!r&&(cancelAnimationFrame(A.current),M.current=-1,C(null)))},[r,O,d,u,L,c,k,C]),euy(()=>{c&&r&&(null==s?null==d&&(O&&(M.current=-1,L(u,M)),!O&&I.current&&(null!=R.current||!0===I.current&&null==R.current)&&(M.current=null==R.current||euZ(R.current,_,m)||h?euY(u,E.current):euJ(u,E.current),k(M.current),L(u,M))):euq(u,s)||(M.current=s,L(u,M)))},[r,O,s,d,h,u,k,L,c,f,_,m,g,E]),euy(()=>{if(c&&!r&&O){var t,n;let i=null==w||null==(t=w.nodesRef.current.find(t=>t.id===T))||null==(n=t.context)?void 0:n.refs.floating.current;i&&!i.contains(euN(euC(i)))&&i.focus({preventScroll:!0})}},[c,r,O,w,T]),euy(()=>{R.current=null}),c?{reference:{...g&&r&&null!=s&&{"aria-activedescendant":N},onKeyDown(t){if(j.current=!0,g&&r)return D(t);if((0===t.key.indexOf("Arrow")||"Enter"===t.key||" "===t.key||""===t.key)&&(R.current=t.key),h){var n,o,a;n=t.key,euH(_,m?n===euB:n===euV,n===euz)&&(euP(t),r?(M.current=euY(u,x),k(M.current)):i(!0));return}euG(t.key,_)&&(null!=d&&(M.current=d),euP(t),!r&&b?i(!0):D(t),r&&k(M.current))}},floating:{"aria-orientation":"both"===_?void 0:_,...g&&null!=s&&{"aria-activedescendant":N},onKeyDown:D,onPointerMove(){j.current=!1}},item:{onFocus(t){let{currentTarget:n}=t,r=u.current.indexOf(n);-1!==r&&k(r)},onClick(t){let{currentTarget:n}=t;return n.focus({preventScroll:!0})},...v&&{onMouseMove(t){let{currentTarget:n}=t;if(n){let r=u.current.indexOf(n);-1!==r&&k(r)}},onPointerLeave(){if(!j.current&&(M.current=-1,L(u,M),k(null),!g)){var t;null==(t=a.floating.current)||t.focus({preventScroll:!0})}}}}}:{}},euX=new J$("suggestion"),eu0=enV.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",ee2(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),eu1={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"},eu2=()=>(++eu2.i).toString();eu2.i=0;let eu3=t=>{let n=eu6(t),r=[];for(let i=0;i<n.length;i++)r.push(eu9(n[i]));return{key:eu2(),children:r}},eu4=(t,n=[])=>({key:eu2(),type:t.type,text:"text"in t?t.text:void 0,node:t,children:n}),eu5=t=>eu4({type:eu1.span,text:t,spans:[]}),eu6=t=>{let n=t.slice(0);for(let r=0;r<n.length;r++){let i=n[r];if(i.type===eu1.listItem||i.type===eu1.oListItem){let o=[i];for(;n[r+1]&&n[r+1].type===i.type;)o.push(n[r+1]),n.splice(r,1);i.type===eu1.listItem?n[r]={type:eu1.list,items:o}:n[r]={type:eu1.oList,items:o}}}return n},eu9=t=>{if("text"in t)return eu4(t,eu8(t.spans,t));if("items"in t){let n=[];for(let r=0;r<t.items.length;r++)n.push(eu9(t.items[r]));return eu4(t,n)}return eu4(t)},eu8=(t,n,r)=>{if(!t.length)return[eu5(n.text)];let i=t.slice(0);i.sort((t,n)=>t.start-n.start||n.end-t.end);let o=[];for(let a=0;a<i.length;a++){let u=i[a],s=r&&r.start||0,l=u.start-s,c=u.end-s,d=n.text.slice(l,c),f=[];for(let p=a;p<i.length;p++){let h=i[p];h!==u&&h.start>=u.start&&h.end<=u.end&&(f.push(h),i.splice(p,1),p--)}0===a&&l>0&&o.push(eu5(n.text.slice(0,l)));let m={...u,text:d};o.push(eu4(m,eu8(f,{...n,text:d},u))),c<n.text.length&&o.push(eu5(n.text.slice(c,i[a+1]?i[a+1].start-s:void 0)))}return o},eu7=(t,n)=>ese(eu3(t).children,n),ese=(t,n)=>{let r=[];for(let i=0;i<t.length;i++){let o=t[i],a=n(o.type,o.node,o.text,ese(o.children,n),o.key);null!=a&&r.push(a)}return r};eu1.listItem,eu1.oListItem,eu1.list,eu1.oList;let est=enV.create({name:"text",group:"inline"});function esn(t){return t.sort((t,n)=>t.start-n.start)}let esr={fromPrismic:t=>n=>{switch(n.type){case"hyperlink":return es0.converter.fromPrismic(t)(n);case"em":return esQ.converter.fromPrismic(t)(n);case"strong":return eas.converter.fromPrismic(t)(n);default:return}},toPrismic(t,n,r){let i=ele.find(n=>t.type.name===n.name);if(!i)throw Error(`Invalid mark extension '${t.type.name}'.`);let o=i.richTextNodeTypes;if("hyperlink"!==o)return{type:o,start:n,end:r};let a=i.converter.toPrismic(t);return{type:o,start:n,end:r,data:a}}},esi=est.extend({name:"text"}),eso={name:esi.name,component:esi,converter:{fromPrismic:t=>function(n,r,i=!1){let o={type:n,text:r.content.text,spans:r.content.spans||[]};return eu7([o],function(t,n=!1){return(r,i,o,a)=>{if("span"===r&&o&&o.length)return n?[t.text(o)]:eaO.splitTextToNodes(t,o)(n=>t.text(n));{let u=esr.fromPrismic(t)(i);return u?a.flat().map(t=>t.mark([...t.marks,u].sort((t,n)=>t.type.name.localeCompare(n.type.name)))):a.flat()}}}(t,i))[0]},toPrismic(t,n,r){let i=eao.children.reduce(t,(t,n)=>{let r=n.type.name===eaO.name?eaO.converter.toPrismic(n):n.textContent,i=r?t.text+r:t.text,o=t.text.length,a=i.length,u=n.marks.length?eao.marks.map(n,t=>esr.toPrismic(t,o,a)):void 0;return{...t,text:i,spans:u?[...t.spans,...u]:t.spans}},{text:"",spans:[]});return{type:n,content:{text:i.text,spans:[...function(t){var n;let r=t.reduce((t,n)=>{let r=(t[n.type]||[]).concat(n);return{...t,[n.type]:r}},{}),i=Object.entries(r).map(([t,n])=>esn(n).reduce((t,n)=>{if(!t.length)return[n];let r=t.length-1,i=t[r];return i?i.end<n.start?[...t,n]:i.end>=n.end?t:[...t.slice(0,r),{...i,end:n.end}]:t},[])).flat();return esn(i)}(i.spans)].sort((t,n)=>t.type.localeCompare(n.type))},...r}}}};var esa,esu=((esa=esu||{}).LeftToRight="ltr",esa.RightToLeft="rtl",esa);let ess=qG.RichTextNodeType.rtl,esl=etd.create({name:"textDirection",addOptions:()=>({supportedExtensionNames:[]}),addGlobalAttributes(){return[{types:this.options.supportedExtensionNames,attributes:{dir:{default:"ltr",parseHTML:t=>t.getAttribute("dir"),renderHTML:t=>({dir:"ltr"===t.dir?"ltr":"rtl"})}}}]},addCommands(){return{setDirection:t=>({commands:n})=>"rtl"===t?n.setRightToLeft():n.setLeftToRight(),toggleDirection:t=>({commands:n})=>n.setDirection("rtl"===t?"ltr":"rtl"),setRightToLeft:()=>({commands:t})=>this.options.supportedExtensionNames.every(n=>t.updateAttributes(n,{dir:"rtl"})),setLeftToRight:()=>({commands:t})=>this.options.supportedExtensionNames.every(n=>t.resetAttributes(n,"dir"))}},addKeyboardShortcuts(){return{"Mod-Shift-r":()=>this.editor.commands.setRightToLeft(),"Mod-Shift-l":()=>this.editor.commands.setLeftToRight()}}}),esc={parseNodeAttrsDirection:t=>"rtl"===t.dir?"rtl":"ltr",fromPrismic(t){let n="rtl"===t.direction?"rtl":"ltr";return{dir:n}},toPrismic(t){return{direction:this.parseNodeAttrsDirection(t.attrs)}}},esd=eu0.extend({name:"paragraph",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",ee2(this.options.HTMLAttributes,t),0]}}),esf=new eo7([qG.RichTextNodeType.paragraph],esd.name,esd,{fromPrismic:t=>function(n){var r;let i=eso.converter.fromPrismic(t)(esd.name,n);return null==(r=t.nodes[esd.name])?void 0:r.create(esc.fromPrismic(n),i)},toPrismic:t=>eso.converter.toPrismic(t,qG.RichTextNodeType.paragraph,esc.toPrismic(t))},"Type '/' for commands"),esp=esf,esh=["ArrowDown","ArrowUp","End","Home"],esm=["Enter"],esg=["Escape",...esh,...esm],esy=etd.create({name:"slash-commands",addOptions:()=>({nodeTypes:[]}),addProseMirrorPlugins(){let t=elu(eln,this.options.nodeTypes);return t.length>1?[function({pluginKey:t=euX,editor:n,char:r="@",allowSpaces:i=!1,allowedPrefixes:o=[" "],startOfLine:a=!1,decorationTag:u="span",decorationClass:s="suggestion",command:l=()=>null,items:c=()=>[],render:d=()=>({}),allow:f=()=>!0}){let p,h=null==d?void 0:d(),m=new Jz({key:t,view(){return{update:async(t,r)=>{var i,o,a,u,s,d,f;let m=null===(i=this.key)||void 0===i?void 0:i.getState(r),g=null===(o=this.key)||void 0===o?void 0:o.getState(t.state),y=m.active&&g.active&&m.range.from!==g.range.from,v=!m.active&&g.active,b=m.active&&!g.active,x=!v&&!b&&m.query!==g.query,_=v||y,S=x&&!y,T=b||y;if(!_&&!S&&!T)return;let w=T&&!_?m:g,O=t.dom.querySelector(`[data-decoration-id="${w.decorationId}"]`);p={editor:n,range:w.range,query:w.query,text:w.text,items:[],command(t){l({editor:n,range:w.range,props:t})},decorationNode:O,clientRect:O?()=>{var r;let{decorationId:i}=null===(r=this.key)||void 0===r?void 0:r.getState(n.state),o=t.dom.querySelector(`[data-decoration-id="${i}"]`);return(null==o?void 0:o.getBoundingClientRect())||null}:null},_&&(null===(a=null==h?void 0:h.onBeforeStart)||void 0===a||a.call(h,p)),S&&(null===(u=null==h?void 0:h.onBeforeUpdate)||void 0===u||u.call(h,p)),(S||_)&&(p.items=await c({editor:n,query:w.query})),T&&(null===(s=null==h?void 0:h.onExit)||void 0===s||s.call(h,p)),S&&(null===(d=null==h?void 0:h.onUpdate)||void 0===d||d.call(h,p)),_&&(null===(f=null==h?void 0:h.onStart)||void 0===f||f.call(h,p))},destroy(){var t;p&&(null===(t=null==h?void 0:h.onExit)||void 0===t||t.call(h,p))}}},state:{init:()=>({active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}),apply(t,u,s,l){let{isEditable:c}=n,{composing:d}=n.view,{selection:p}=t,{empty:h,from:m}=p,g={...u};if(g.composing=d,c&&(h||n.view.composing)){(m<u.range.from||m>u.range.to)&&!d&&!u.composing&&(g.active=!1);let y=function(t){var n,r;let{char:i,allowSpaces:o,allowedPrefixes:a,startOfLine:u,$position:s}=t,l=i.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),c=RegExp(`\\s${l}$`),d=u?"^":"",f=o?RegExp(`${d}${l}.*?(?=\\s${l}|$)`,"gm"):RegExp(`${d}(?:^)?${l}[^\\s${l}]*`,"gm"),p=(null===(n=s.nodeBefore)||void 0===n?void 0:n.isText)&&s.nodeBefore.text;if(!p)return null;let h=s.pos-p.length,m=Array.from(p.matchAll(f)).pop();if(!m||void 0===m.input||void 0===m.index)return null;let g=m.input.slice(Math.max(0,m.index-1),m.index),y=RegExp(`^[${null==a?void 0:a.join("")}\0]?$`).test(g);if(null!==a&&!y)return null;let v=h+m.index,b=v+m[0].length;return o&&c.test(p.slice(b-1,b+1))&&(m[0]+=" ",b+=1),v<s.pos&&b>=s.pos?{range:{from:v,to:b},query:m[0].slice(i.length),text:m[0]}:null}({char:r,allowSpaces:i,allowedPrefixes:o,startOfLine:a,$position:p.$from}),v=`id_${Math.floor(4294967295*Math.random())}`;y&&f({editor:n,state:l,range:y.range})?(g.active=!0,g.decorationId=u.decorationId?u.decorationId:v,g.range=y.range,g.query=y.query,g.text=y.text):g.active=!1}else g.active=!1;return g.active||(g.decorationId=null,g.range={from:0,to:0},g.query=null,g.text=null),g}},props:{handleKeyDown(t,n){var r;let{active:i,range:o}=m.getState(t.state);return i&&(null===(r=null==h?void 0:h.onKeyDown)||void 0===r?void 0:r.call(h,{view:t,event:n,range:o}))||!1},decorations(t){let{active:n,range:r,decorationId:i}=m.getState(t);return n?X1.create(t.doc,[XQ.inline(r.from,r.to,{nodeName:u,class:s,"data-decoration-id":i})]):null}}});return m}({allowSpaces:!0,char:"/",editor:this.editor,startOfLine:!0,allow({state:t}){let n=t.selection.$from;return n.parent.type.name===esp.name&&1===n.depth},command({editor:t,props:n,range:r}){n.runCommands(t,{deleteRange:r})},items({query:n}){let r=n.toLocaleLowerCase().trim();return t.filter(t=>{var n,i;return(null==(n=t.shortText)?void 0:n.toLocaleLowerCase().includes(r))||(null==(i=t.text)?void 0:i.toLocaleLowerCase().includes(r))})},render(){let t;return{onStart(n){t=new eij(esv,{editor:n.editor,props:n}),document.body.appendChild(t.element)},onUpdate(n){null==t||t.updateProps(n)},onKeyDown({event:n}){var r;return Boolean(esg.includes(n.key)&&(null==(r=null==t?void 0:t.ref)?void 0:r.handleKeyDown(n)))},onExit(){null==t||t.destroy(),null==t||t.element.remove()}}}})]:[]}}),esv=(0,o.forwardRef)(function(t,n){var r,i,a,l,c;let{command:d,decorationNode:f,editor:p,items:h}=t,[m,g]=(0,o.useState)(!0),y=parseFloat(u.TV.space[0]),{context:v,floating:b,reference:_,x:S,y:T}=function(t){let{open:n=!1,onOpenChange:r,whileElementsMounted:i,placement:a,middleware:u,strategy:s,nodeId:l}=void 0===t?{}:t,[c,d]=o.useState(null),f=euk(),p=o.useRef(null),h=o.useRef({}),m=o.useState(()=>(function(){let t=new Map;return{emit(n,r){var i;null==(i=t.get(n))||i.forEach(t=>t(r))},on(n,r){t.set(n,[...t.get(n)||[],r])},off(n,r){t.set(n,(t.get(n)||[]).filter(t=>t!==r))}}})())[0],g=function(t){void 0===t&&(t={});let{placement:n="bottom",strategy:r="absolute",middleware:i=[],platform:a,whileElementsMounted:u,open:s}=t,[l,c]=o.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[d,f]=o.useState(i);eum(d,i)||f(i);let p=o.useRef(null),h=o.useRef(null),m=o.useRef(l),g=eug(u),y=eug(a),[v,b]=o.useState(null),[_,S]=o.useState(null),T=o.useCallback(t=>{p.current!==t&&(p.current=t,b(t))},[]),w=o.useCallback(t=>{h.current!==t&&(h.current=t,S(t))},[]),O=o.useCallback(()=>{if(!p.current||!h.current)return;let t={placement:n,strategy:r,middleware:d};y.current&&(t.platform=y.current),eup(p.current,h.current,t).then(t=>{let n={...t,isPositioned:!0};k.current&&!eum(m.current,n)&&(m.current=n,x.flushSync(()=>{c(n)}))})},[d,n,r,y]);euh(()=>{!1===s&&m.current.isPositioned&&(m.current.isPositioned=!1,c(t=>({...t,isPositioned:!1})))},[s]);let k=o.useRef(!1);euh(()=>(k.current=!0,()=>{k.current=!1}),[]),euh(()=>{if(v&&_){if(g.current)return g.current(v,_,O);O()}},[v,_,O,g]);let C=o.useMemo(()=>({reference:p,floating:h,setReference:T,setFloating:w}),[T,w]),I=o.useMemo(()=>({reference:v,floating:_}),[v,_]);return o.useMemo(()=>({...l,update:O,refs:C,elements:I,reference:T,floating:w}),[l,O,C,I,T,w])}({placement:a,middleware:u,strategy:s,whileElementsMounted:i}),y=euE(r),v=o.useMemo(()=>({...g.refs,domReference:p}),[g.refs]),b=o.useMemo(()=>({...g,refs:v,dataRef:h,nodeId:l,events:m,open:n,onOpenChange:y,_:{domReference:c}}),[g,l,m,n,y,v,c]);euy(()=>{let t=null==f?void 0:f.nodesRef.current.find(t=>t.id===l);t&&(t.context=b)});let{reference:_}=g,S=o.useCallback(t=>{(euM(t)||null===t)&&(b.refs.domReference.current=t,d(t)),_(t)},[_,b.refs]);return o.useMemo(()=>({...g,context:b,refs:v,reference:S}),[g,v,b,S])}({middleware:[(void 0===(r=y)&&(r=0),{name:"offset",options:r,async fn(t){let{x:n,y:i}=t,o=await eaV(t,r);return{x:n+o.x,y:i+o.y,data:o}}}),(void 0===i&&(i={}),{name:"flip",options:i,async fn(t){var n,r,o,a;let{placement:u,middlewareData:s,rects:l,initialPlacement:c,platform:d,elements:f}=t,{mainAxis:p=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:v=!0,...b}=i,x=eaR(u),_=eaR(c)===c,S=await (null==d.isRTL?void 0:d.isRTL(f.floating)),T=m||(_||!v?[eaU(c)]:function(t){let n=eaU(t);return[eaB(t),n,eaB(n)]}(c));m||"none"===y||T.push(...function(t,n,r,i){let o=eaI(t),a=function(t,n,r){let i=["left","right"],o=["right","left"];switch(t){case"top":case"bottom":return r?n?o:i:n?i:o;case"left":case"right":return n?["top","bottom"]:["bottom","top"];default:return[]}}(eaR(t),"start"===r,i);return o&&(a=a.map(t=>t+"-"+o),n&&(a=a.concat(a.map(eaB)))),a}(c,v,y,S));let w=await eaP(t,b),O=[],k=(null==(n=s.flip)?void 0:n.overflows)||[];if(p&&O.push(w[x]),h){let{main:C,cross:I}=function(t,n,r){void 0===r&&(r=!1);let i=eaI(t),o=eaE(t),a=eaM(o),u="x"===o?i===(r?"end":"start")?"right":"left":"start"===i?"bottom":"top";return n.reference[a]>n.floating[a]&&(u=eaU(u)),{main:u,cross:eaU(u)}}(u,l,S);O.push(w[C],w[I])}if(k=[...k,{placement:u,overflows:O}],!O.every(t=>t<=0)){let M=((null==(r=s.flip)?void 0:r.index)||0)+1,R=[c,...T][M];if(R)return{data:{index:M,overflows:k},reset:{placement:R}};let E=null==(o=k.filter(t=>t.overflows[0]<=0).sort((t,n)=>t.overflows[1]-n.overflows[1])[0])?void 0:o.placement;if(!E)switch(g){case"bestFit":{let j=null==(a=k.map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,n)=>t+n,0)]).sort((t,n)=>t[1]-n[1])[0])?void 0:a[0];j&&(E=j);break}case"initialPlacement":E=c}if(u!==E)return{reset:{placement:E}}}return{}}}),(l={limiter:(void 0===a&&(a={}),{options:a,fn(t){let{x:n,y:r,placement:i,rects:o,middlewareData:u}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=a,d={x:n,y:r},f=eaE(i),p=ea$(f),h=d[f],m=d[p],g="function"==typeof s?s(t):s,y="number"==typeof g?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){let v="y"===f?"height":"width",b=o.reference[f]-o.floating[v]+y.mainAxis,x=o.reference[f]+o.reference[v]-y.mainAxis;h<b?h=b:h>x&&(h=x)}if(c){var _,S;let T="y"===f?"width":"height",w=["top","left"].includes(eaR(i)),O=o.reference[p]-o.floating[T]+(w&&(null==(_=u.offset)?void 0:_[p])||0)+(w?0:y.crossAxis),k=o.reference[p]+o.reference[T]+(w?0:(null==(S=u.offset)?void 0:S[p])||0)-(w?y.crossAxis:0);m<O?m=O:m>k&&(m=k)}return{[f]:h,[p]:m}}})},{name:"shift",options:l,async fn(t){let{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:u={fn(t){let{x:n,y:r}=t;return{x:n,y:r}}},...s}=l,c={x:n,y:r},d=await eaP(t,s),f=eaE(eaR(i)),p=ea$(f),h=c[f],m=c[p];if(o){let g=h+d["y"===f?"top":"left"],y=h-d["y"===f?"bottom":"right"];h=eaF(g,h,y)}if(a){let v=m+d["y"===p?"top":"left"],b=m-d["y"===p?"bottom":"right"];m=eaF(v,m,b)}let x=u.fn({...t,[f]:h,[p]:m});return{...x,data:{x:x.x-n,y:x.y-r}}}})],onOpenChange:g,open:m,placement:"top-start",strategy:"fixed",whileElementsMounted:euf});(0,o.useLayoutEffect)(()=>{_(f)},[_,f]),(0,o.useEffect)(()=>{let t,n=()=>{t=window.setTimeout(()=>{g(!0)})},r=()=>{g(!1)};return p.on("focus",n).on("blur",r),()=>{p.off("focus",n).off("blur",r),clearTimeout(t)}},[p]);let[w,O]=(0,o.useState)(0),k=(0,o.useRef)([]);(0,s.pQ)(h,()=>{O(0),k.current=[]});let{getFloatingProps:C,getItemProps:I,getReferenceProps:R}=(c=[euW(v,{outsidePointerDown:!1}),euQ(v,{activeIndex:w,listRef:k,onNavigate(t){O(n=>t??n)},openOnArrowKeyDown:!1,virtual:!0}),euD(v,{role:"menu"})],{getReferenceProps:t=>euj(t,c,"reference"),getFloatingProps:t=>euj(t,c,"floating"),getItemProps:t=>euj(t,c,"item")}),E=R().onKeyDown;return(0,o.useImperativeHandle)(n,()=>({handleKeyDown(t){if(!m)return!1;if(esh.includes(t.key)&&E(t),esm.includes(t.key)){let n=h[w];void 0!==n&&d(n)}return!0}}),[w,d,h,E,m]),m?M.jsx(u.xu,{...C(),minWidth:256,backgroundColor:"grey1",border:!0,borderStyle:"solid",borderRadius:6,flexDirection:"column",ref:b,top:parseFloat(u.TV.space[0]),left:parseFloat(u.TV.space[0]),position:"fixed",transform:null!==S&&null!==T?`translate3d(${Math.round(S)}px, ${Math.round(T)}px, 0)`:"translate3d(0, -200%, 0)",children:M.jsxs("div",{style:{boxShadow:"0px 2px 10px 0px hsla(0, 0%, 0%, 0.1)"},children:[h.map((t,n)=>{let r=I({onClick(){d(t)},onPointerDown(t){t.preventDefault()}});return(0,o.createElement)(esb,{...r,key:t.nodeType,ref(t){k.current[n]=t},active:n===w,isFirstItem:0===n,isLastItem:n===h.length-1,shortcut:`/${t.shortText??""}`},t.text)}),0===h.length&&M.jsx(esb,{...I({onPointerDown(t){t.preventDefault()}}),disabled:!0,ref(t){k.current[0]=t},children:"No results"})]})}):null}),esb=(0,o.forwardRef)(function(t,n){let{children:r,disabled:i=!1,shortcut:o,active:a=!1,isFirstItem:s=!1,isLastItem:l=!1,...c}=t,d=function(t){let{isFirstItem:n,isLastItem:r}=t;return n?{topRight:6,topLeft:6}:r?{bottomRight:6,bottomLeft:6}:void 0}({isFirstItem:s,isLastItem:l});return M.jsx("div",{...c,role:"button",style:{all:"unset",cursor:i?"default":"pointer"},ref:n,children:M.jsxs(u.xu,{alignItems:"center",height:32,flexDirection:"row",gap:8,padding:8,backgroundColor:a?"grey4":"inherit",justifyContent:"space-between",borderRadius:d,opacity:i?"50%":"100%",children:[M.jsx(u.xv,{color:"grey12",component:"span",children:r}),o&&M.jsx(u.xv,{color:"inherit",component:"span",variant:"small",children:o})]})})}),esx=eaf.extend({name:"bulletList",parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:t}){return["ul",ee2(this.options.HTMLAttributes,t),0]}}).configure({itemTypeName:"listItem"}),es_=new ean([qG.RichTextNodeType.list],esx.name,esx,{fromPrismic:t=>function(n){var r;let i=eag.converter.fromPrismic(t)(n);if(i)return null==(r=t.nodes[esx.name])?void 0:r.create(esc.fromPrismic(n),i)},toPrismic:t=>eao.children.map(t,t=>eag.converter.toPrismic(t,qG.RichTextNodeType.list).filter(c.$)).flat()}),esS=es_,esT=/^```([a-z]+)?[\s\n]$/,esw=/^~~~([a-z]+)?[\s\n]$/,esO=enV.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:t=>{var n;let{languageClassPrefix:r}=this.options,i=[...(null===(n=t.firstElementChild)||void 0===n?void 0:n.classList)||[]].filter(t=>t.startsWith(r)).map(t=>t.replace(r,""))[0];return i||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:t,HTMLAttributes:n}){return["pre",ee2(this.options.HTMLAttributes,n),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:n})=>n.setNode(this.name,t),toggleCodeBlock:t=>({commands:n})=>n.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:t,$anchor:n}=this.editor.state.selection,r=1===n.pos;return!!t&&n.parent.type.name===this.name&&(!!r||!n.parent.textContent.length)&&this.editor.commands.clearNodes()},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:n}=t,{selection:r}=n,{$from:i,empty:o}=r;if(!o||i.parent.type!==this.type)return!1;let a=i.parentOffset===i.parent.nodeSize-2,u=i.parent.textContent.endsWith(`
|
|
95
|
-
|
|
96
|
-
`);return!!a&&!!u&&t.chain().command(({tr:t})=>(t.delete(i.pos-2,i.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;let{state:n}=t,{selection:r,doc:i}=n,{$from:o,empty:a}=r;if(!a||o.parent.type!==this.type||o.parentOffset!==o.parent.nodeSize-2)return!1;let u=o.after();return!(void 0===u||i.nodeAt(u))&&t.commands.exitCode()}}},addInputRules(){return[enU({find:esT,type:this.type,getAttributes:t=>({language:t[1]})}),enU({find:esw,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Jz({key:new J$("codeBlockVSCodeHandler"),props:{handlePaste:(t,n)=>{if(!n.clipboardData||this.editor.isActive(this.type.name))return!1;let r=n.clipboardData.getData("text/plain"),i=n.clipboardData.getData("vscode-editor-data"),o=i?JSON.parse(i):void 0,a=null==o?void 0:o.mode;if(!r||!a)return!1;let{tr:u}=t.state;return u.replaceSelectionWith(this.type.create({language:a})),u.setSelection(JC.near(u.doc.resolve(Math.max(0,u.selection.from-2)))),u.insertText(r.replace(/\r\n?/g,`
|
|
97
|
-
`)),u.setMeta("paste",!0),t.dispatch(u),!0}}})]}}),esk=esO.extend({name:"preformatted",addAttributes(){return{language:{default:null,parseHTML:t=>{var n;let{languageClassPrefix:r}=this.options,i=[...(null==(n=t.firstElementChild)?void 0:n.classList)||[]].filter(t=>t.startsWith(r)).map(t=>t.replace(r,""))[0];return i||null},renderHTML:t=>t.language?{class:this.options.languageClassPrefix+t.language}:null}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({HTMLAttributes:t}){return["pre",ee2(this.options.HTMLAttributes),["code",t,0]]}}).configure({exitOnTripleEnter:!1}),esC=new eo7([qG.RichTextNodeType.preformatted],esk.name,esk,{fromPrismic:t=>function(n){var r;let i=eso.converter.fromPrismic(t)(esk.name,n,!0);return null==(r=t.nodes[esk.name])?void 0:r.create(esc.fromPrismic(n),i)},toPrismic:t=>eso.converter.toPrismic(t,qG.RichTextNodeType.preformatted,esc.toPrismic(t))},"",!0);function esI(t){let{editor:n,getPos:r,node:i}=t,[a,u]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{function t(){let{from:t,to:o}=n.state.selection,a=r(),s=r()+i.nodeSize;u(t<=a&&o>=s)}function o(){u(!1)}return n.on("blur",o),n.on("selectionUpdate",t),()=>{n.off("blur",o),n.off("selectionUpdate",t)}},[n,r,i.nodeSize]),{selected:a}}function esM(t){let n=(0,o.useRef)(null),r=(0,o.useRef)(null),{onKeyDown:i,url:a,urlChanged:l,onContentChange:c,debouncedUrl:d,content:f}=function(t,n,r){let{node:i}=t,a=i.attrs.content,u=(0,s.R9)(t.updateAttributes),l=(0,s.$P)({initialState:(null==a?void 0:a.embed_url)??"",startTransition:o.startTransition});function c(t){u({content:t})}let{onKeyDown:d}=function(t,n,r,i){let{editor:a,getPos:u,node:s}=t,[l,c]=(0,o.useState)(!0);return(0,o.useEffect)(()=>{l&&t.editor.isFocused&&eiP(()=>{var t;return null==(t=r.current)?void 0:t.focus()})},[r,l,t.editor.isFocused]),{containerRef:i,inputRef:r,onKeyDown:function(t){let r=u(),i=u()+s.nodeSize;"Enter"===t.code&&(c(!1),a.chain().insertContentAt(i,{type:"paragraph"}).focus(i+1).run()),"Backspace"===t.code&&""===n&&a.chain().deleteRange({from:r,to:i}).focus(i+1).run(),"ArrowUp"===t.code&&(c(!1),a.chain().focus(r-1).run()),"ArrowDown"===t.code&&(c(!1),a.chain().focus(i+1).run())}}}(t,l.value,n,r);return{inputRef:n,containerRef:r,onKeyDown:d,url:l.value,urlChanged:function(t){l.set(t),(0,v.ju)(t)||c(void 0)},onContentChange:c,debouncedUrl:l.debouncedValue,content:t.node.attrs.content}}(t,n,r),{selected:p}=esI(t);return M.jsx(eiE,{className:"custom-embed",children:M.jsx("div",{contentEditable:"false",suppressContentEditableWarning:!0,children:M.jsxs(u.xu,{flexDirection:"column",children:[M.jsxs(u.xu,{flexGrow:1,alignItems:"center",children:[M.jsx(u.I5,{size:"small",name:"cloud",color:"grey11"}),M.jsx(u.xu,{flexGrow:1,flexDirection:"column",ref:r,children:M.jsx(u.oi,{id:"id",ref:n,value:a,variant:(0,v.ju)(a)?"link":"normal",placeholder:"Paste your link here",onValueChange:l,onKeyDown:i})})]}),(0,v.ju)(a)&&M.jsx(eiL,{selected:p,debouncedUrl:d,onContentChange:c,content:f})]})})})}let esR=enV.create({name:"embed",group:"block",atom:!0,content:"block*",marks:"",addAttributes:()=>({content:{default:void 0}}),addCommands(){return{setEmbed:()=>({tr:t,dispatch:n})=>{let r=this.type.create();return n&&t.replaceSelectionWith(r),!0}}},parseHTML:()=>[{tag:"embed"}],renderHTML:()=>["embed"],addNodeView:()=>eiN(esM)}),esE=new class{constructor(t,n,r,i){w(this,"extType","node"),w(this,"nodeType","embed"),this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}([qG.RichTextNodeType.embed],esR.name,esR,{fromPrismic:t=>function(n){var r;return null==(r=t.nodes[esR.name])?void 0:r.create({content:n.data})},toPrismic:t=>void 0===t.attrs.content?{type:"embed",data:{type:"embed",embed_url:"",__TYPE__:"EmbedContent",all:[]}}:{type:"embed",data:{...t.attrs.content}}}),esj=enV.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:n}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,ee2(this.options.HTMLAttributes,n),0]},addCommands(){return{setHeading:t=>({commands:n})=>!!this.options.levels.includes(t.level)&&n.setNode(this.name,t),toggleHeading:t=>({commands:n})=>!!this.options.levels.includes(t.level)&&n.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return this.options.levels.reduce((t,n)=>({...t,[`Mod-Alt-${n}`]:()=>this.editor.commands.toggleHeading({level:n})}),{})},addInputRules(){return this.options.levels.map(t=>enU({find:RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),esA="heading";function esN(t){switch(t){case 1:return qG.RichTextNodeType.heading1;case 2:return qG.RichTextNodeType.heading2;case 3:return qG.RichTextNodeType.heading3;case 4:return qG.RichTextNodeType.heading4;case 5:return qG.RichTextNodeType.heading5;case 6:return qG.RichTextNodeType.heading6}}function esP(t){return{fullName:esN(t),level:t}}let esL=[1,2,3,4,5,6];function esD(t,n=esL){let r=RegExp(`^heading([${n.join(",")}]){1}$`),i=t.match(r);if(!i||!i[1])return;let o=parseInt(i[1]);return{fullName:esN(o),level:o}}function esF(t,n){let r=t.level;if(n.includes(r))return{fullName:esN(r),level:r}}let esW=t=>{let n=t[0]??1;return{fromPrismic:r=>function(i){var o;let a=eso.converter.fromPrismic(r)(esA,i),u=esD(i.type,t)||esP(n);return null==(o=r.nodes[esA])?void 0:o.create({level:u.level,...esc.fromPrismic(i)},a)},toPrismic(r){let{fullName:i}=esF(r.attrs,t)||esP(n);return eso.converter.toPrismic(r,i,esc.toPrismic(r))}}},esU={name:esA,build(t){var n,r;let i=t?t.size?Array.from(t.values()).reduce((t,n)=>{let r=esD(n);return r?[...t,r.level]:t},[]).sort((t,n)=>t-n):[]:esL;if(!i)return;let o=i.map(t=>esN(t));return new eat(o,esj.extend({name:"heading"}).configure({levels:i}),i,esW(i),t=>{let n=esF(t,i);return n&&`Heading ${n.level}`})}};function esz(t){let{node:n}=t,r=n.attrs.content,{selected:i}=esI(t),a={width:null==r?void 0:r.width,height:null==r?void 0:r.height,name:eiH},{onMediaSelected:s,onCropperDialogClose:l,isUpdating:c,updateContent:d,onClear:f}=function(t){let{content:n,thumbnail:r,imageViewProps:{getPos:i,updateAttributes:a,editor:u,node:s}}=t,[l,c]=(0,o.useTransition)();function d(t){c(()=>a({content:t}))}return{onMediaSelected:function(t){let r=eiX(t),o=i()+s.nodeSize;d({__TYPE__:"ImageContent",...n,...r}),u.chain().focus(o+1).run()},onCropperDialogClose:function({croppedImages:t}){if(!n)return;let i=t[r.name];if(!i)return;let o=eot({content:n,thumbnail:r.name,croppedImage:i});o!==n&&d(o)},isUpdating:l,updateContent:d,onClear:function(){let t=i(),n=i()+s.nodeSize;u.chain().deleteRange({from:t,to:n}).focus(n).run()}}}({content:r,thumbnail:a,imageViewProps:t}),p=(null==r?void 0:r.width)===0&&(null==r?void 0:r.height)===0,h=r&&!p?[`${r.width}x${r.height}px`]:[],m=(null==r?void 0:r.alt)??"",g={thumbnail:a,contentView:r,labels:eiG(a,r,r)};return M.jsx(eiE,{className:"custom-image",children:M.jsx("div",{contentEditable:"false",suppressContentEditableWarning:!0,children:M.jsx(eou,{content:r,selected:i,fieldLabel:"Feature image",imageLabel:h,initialImages:[g],readOnly:!1,onMediaSelected:s,onCropperDialogClose:l,onClear:f,children:M.jsx(o.Suspense,{fallback:esB,children:null!=r&&r.url?M.jsxs(u.aY,{children:[M.jsx(u.hM,{children:M.jsx(u.xu,{flexDirection:"column",alignItems:"center",position:"relative",height:400,children:M.jsx(u.xu,{justifyContent:"center",flexGrow:1,maxHeight:"100%",maxWidth:"100%",children:M.jsx(u.kg,{src:eiJ(r.url),alt:m,sizing:"contain"})})})}),M.jsx(ei7,{onValueChange(t){d({...r,alt:t})},altText:m,readOnly:!r,selected:i})]}):M.jsx(ei8,{isUpdating:c,readOnly:!1,onMediaSelected:s})})})})})}let esB=M.jsx("div",{style:{height:468}}),esV=enV.create({name:"image",group:"block",atom:!0,addAttributes:()=>({content:{default:void 0}}),addCommands(){return{setImage:()=>t=>{let{dispatch:n,tr:r}=t,i=this.type.create();return n&&r.replaceSelectionWith(i),!0}}},parseHTML:()=>[{tag:"image"}],renderHTML:({HTMLAttributes:t})=>["image",ee2(t)],addNodeView:()=>eiN(esz)}),es$=new class{constructor(t,n,r,i){w(this,"extType","node"),w(this,"nodeType","image"),this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}([qG.RichTextNodeType.image],esV.name,esV,{fromPrismic:t=>function(n){var r;return null==(r=t.nodes[esV.name])?void 0:r.create({content:n.data})},toPrismic(t){if(void 0!==t.attrs.content)return{type:"image",data:{...t.attrs.content}}}}),esq=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,esK=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,esH=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,esG=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,esZ=enB.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"em"},{tag:"i",getAttrs:t=>"normal"!==t.style.fontStyle&&null},{style:"font-style=italic"}],renderHTML({HTMLAttributes:t}){return["em",ee2(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[enW({find:esq,type:this.type}),enW({find:esH,type:this.type})]},addPasteRules(){return[enq({find:esK,type:this.type}),enq({find:esG,type:this.type})]}}),esY=esZ.extend({name:"em"}),esJ=new class{constructor(t,n,r){w(this,"extType",eo9.Mark),w(this,"richTextNodeTypes",qG.RichTextNodeType.em),this.name=t,this.component=n,this.converter=r}}(esY.name,esY,{fromPrismic:t=>function(){var n;return null==(n=t.marks[esY.name])?void 0:n.create()},toPrismic(){}}),esQ=esJ,esX=enB.create({name:"hyperlink",priority:1e3,keepOnSplit:!1,inclusive:!1,addOptions:()=>({openOnClick:!1,linkOnPaste:!0,autolink:!0,protocols:[],htmlAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null,id:""},validate:void 0}),addAttributes:()=>({href:{default:""},id:{default:""},target:{default:"_blank"},rel:{default:"noopener noreferrer nofollow"},class:{default:null},media:{default:null}}),parseHTML:()=>[{tag:'a[href]:not([href *= "javascript:" i])'}],renderHTML({HTMLAttributes:t}){return["a",ee2(this.options.htmlAttributes,t),0]},addCommands(){return{setWebLink:t=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMark(this.name,t).setMeta("preventAutolink",!0).run(),setDocumentLink:t=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMark(this.name,t).setMeta("preventAutolink",!0).run(),setMediaLink:t=>({chain:n})=>{let r=es1(eoR({media:t.media}).value);return n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMark(this.name,{media:r}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}}}),es0=new class{constructor(t,n,r){w(this,"extType",eo9.Mark),w(this,"richTextNodeTypes",qG.RichTextNodeType.hyperlink),this.name=t,this.component=n,this.converter=r}}(esX.name,esX,{fromPrismic:t=>function(n){var r,i,o,a;let u=n.data;if("DocumentLink"===u.__TYPE__){let s={type:esX.name,id:u.id};return null==(r=t.marks[esX.name])?void 0:r.create(s)}if("ImageLink"===u.__TYPE__){let l={type:esX.name,media:es1(u)};return null==(i=t.marks[esX.name])?void 0:i.create(l)}if("FileLink"===u.__TYPE__){let c={type:esX.name,media:es1(u)};return null==(o=t.marks[esX.name])?void 0:o.create(c)}if("ExternalLink"===u.__TYPE__){let d={type:esX.name,url:u.url,href:u.url,target:u.target};return null==(a=t.marks[esX.name])?void 0:a.create(d)}},toPrismic:t=>t.attrs.media?es2(t.attrs.media):t.attrs.id?{__TYPE__:"DocumentLink",id:t.attrs.id}:{__TYPE__:"ExternalLink",url:t.attrs.href,target:t.attrs.target}});function es1(t){return JSON.stringify(t)}function es2(t){return JSON.parse(t)}let es3=enV.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",ee2(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),es4=enB.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",ee2(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:n})=>{let r=eni(t,this.type);return!!Object.entries(r).some(([,t])=>!!t)||n.unsetMark(this.name)}}}}),es5=/^(\d+)\.\s$/,es6=enV.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:t}){let{start:n,...r}=t;return 1===n?["ol",ee2(this.options.HTMLAttributes,r),0]:["ol",ee2(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:n})=>this.options.keepAttributes?n().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(es3.name,this.editor.getAttributes(es4.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=enz({find:es5,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=enz({find:es5,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(es4.name)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[t]}}),es9=es6.extend({name:"orderedList",addAttributes:()=>({start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1}}),renderHTML({HTMLAttributes:t}){let{start:n,...r}=t;return 1===n?["ol",ee2(this.options.HTMLAttributes,r),0]:["ol",ee2(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}}}).configure({itemTypeName:"listItem"}),es8=new ean([qG.RichTextNodeType.orderedList],es9.name,es9,{fromPrismic:t=>function(n){var r;let i=eag.converter.fromPrismic(t)(n);if(i)return null==(r=t.nodes[es9.name])?void 0:r.create(esc.fromPrismic(n),i)},toPrismic:t=>eao.children.map(t,t=>eag.converter.toPrismic(t,qG.RichTextNodeType.orderedList).filter(c.$)).flat()}),es7=es8,ele=[eas,esQ,es0];function elt(t){return[esp,esS,es7,esU.build(t),esC,esE,es$,...ele].filter(c.$)}let eln=[{nodeType:qG.RichTextNodeType.paragraph,icon:"textFields",isActive:t=>t.isActive(esp.name)&&!t.isActive(esS.name)&&!t.isActive(es7.name),runCommands:elo((t,n)=>t.clearNodes().setDirection(ela(n))),shortText:"par",text:"Paragraph"},{nodeType:qG.RichTextNodeType.heading1,icon:"looks1",isActive:t=>t.isActive(esU.name,{level:1}),runCommands:elo((t,n)=>t.setHeading({level:1}).setDirection(ela(n))),shortText:"h1",text:"Heading 1"},{nodeType:qG.RichTextNodeType.heading2,icon:"looks2",isActive:t=>t.isActive(esU.name,{level:2}),runCommands:elo((t,n)=>t.setHeading({level:2}).setDirection(ela(n))),shortText:"h2",text:"Heading 2"},{nodeType:qG.RichTextNodeType.heading3,icon:"looks3",isActive:t=>t.isActive(esU.name,{level:3}),runCommands:elo((t,n)=>t.setHeading({level:3}).setDirection(ela(n))),shortText:"h3",text:"Heading 3"},{nodeType:qG.RichTextNodeType.heading4,icon:"looks4",isActive:t=>t.isActive(esU.name,{level:4}),runCommands:elo((t,n)=>t.setHeading({level:4}).setDirection(ela(n))),shortText:"h4",text:"Heading 4"},{nodeType:qG.RichTextNodeType.heading5,icon:"looks5",isActive:t=>t.isActive(esU.name,{level:5}),runCommands:elo((t,n)=>t.setHeading({level:5}).setDirection(ela(n))),shortText:"h5",text:"Heading 5"},{nodeType:qG.RichTextNodeType.heading6,icon:"looks6",isActive:t=>t.isActive(esU.name,{level:6}),runCommands:elo((t,n)=>t.setHeading({level:6}).setDirection(ela(n))),shortText:"h6",text:"Heading 6"},{nodeType:qG.RichTextNodeType.list,icon:"formatListBulleted",isActive:t=>t.isActive(esS.name),runCommands:elo((t,n)=>t.toggleBulletList().setDirection(ela(n))),shortText:"bull",text:"Bulleted list"},{nodeType:qG.RichTextNodeType.orderedList,icon:"formatListNumbered",isActive:t=>t.isActive(es7.name),runCommands:elo((t,n)=>t.toggleOrderedList().setDirection(ela(n))),shortText:"num",text:"Numbered list"},{nodeType:qG.RichTextNodeType.preformatted,icon:"dataObject",isActive:t=>t.isActive(esC.name),runCommands:elo((t,n)=>t.setCodeBlock().setDirection(ela(n))),shortText:"code",text:"Code"},{nodeType:qG.RichTextNodeType.embed,icon:"cloud",isActive:t=>t.isActive(esE.name),runCommands:elo(t=>t.setEmbed()),shortText:"emb",text:"Embed"},{nodeType:qG.RichTextNodeType.image,icon:"image",isActive:t=>t.isActive(es$.name),runCommands:elo(t=>t.setImage()),shortText:"img",text:"Image"}],elr=[{nodeType:qG.RichTextNodeType.strong,icon:"formatBold",isActive:t=>t.isActive(eas.name),runCommands:elo(t=>t.toggleBold())},{nodeType:qG.RichTextNodeType.em,icon:"formatItalic",isActive:t=>t.isActive(esQ.name),runCommands:elo(t=>t.toggleItalic())}],eli=[{nodeType:qG.RichTextNodeType.rtl,icon:"formatTextDirectionRToL",isActive:t=>t.isActive({dir:esu.RightToLeft}),runCommands:elo((t,n)=>t.toggleDirection(ela(n)))}];function elo(t){return(n,r={})=>{let i=!0===r.can?n.can().chain():n.chain().focus();return void 0!==r.deleteRange&&(i=i.deleteRange(r.deleteRange)),r.can?function(t,n,r){try{return r(n,t).run()}catch{return!1}}(n,i,t):t(i,n).run()}}function ela(t){let n=t.state.selection.$from.parent.attrs;return esc.parseNodeAttrsDirection(n)}function elu(t,n){return t.filter(t=>n.includes(t.nodeType))}function els(t){let{items:n,editor:r}=t;return 0===n.length?null:M.jsxs(M.Fragment,{children:[M.jsx(u.Jf,{}),n.map(t=>M.jsx(u.r8,{disabled:!t.runCommands(r,{can:!0}),onPressedChange(){t.runCommands(r)},pressed:t.isActive(r),startIcon:t.icon},t.nodeType))]})}function ell(t){let{disabled:n,showWebLinkModal:r,showDocumentsLinkModal:i,showMediaLinkModal:o}=function(t){let{editor:n,setModal:r}=t;return{disabled:!elo(t=>t.setWebLink({href:""}))(n,{can:!0}),showWebLinkModal:function(){r("webLink")},showDocumentsLinkModal:function(){r("documentLink")},showMediaLinkModal:function(){r("mediaLink")}}}(t);return M.jsxs(M.Fragment,{children:[M.jsx(u.Jf,{}),M.jsxs(u.yM,{density:"compact",children:[M.jsx(u.hA,{disabled:n,startIcon:"link",onClick:r},qG.RichTextNodeType.hyperlink),M.jsxs(u.h_,{children:[M.jsx(u.$F,{children:M.jsx(u.hA,{startIcon:"arrowDropDown"})}),M.jsxs(u.AW,{align:"end",asPortal:!1,children:[M.jsx(u.Xi,{startIcon:M.jsx(u.I5,{name:"public"}),onSelect:r,children:"Link to web page"}),M.jsx(u.Xi,{startIcon:M.jsx(u.I5,{name:"description"}),onSelect:i,children:"Link to document"}),M.jsx(u.Xi,{startIcon:M.jsx(u.I5,{name:"image"}),onSelect:o,children:"Link to media"})]})]})]})]})}function elc(t){let{docId:n,onEdit:r,onUnlink:i}=t,o=function(t){let n=tR();n.searchDocuments||tj("searchDocuments");let{coreApiUrl:r,env:i}=n;return(0,d.QT)(h.EK,[r,i,t])}(n),a=tR();if(!o)return null;let s=o.versions[0],l=(0,b.u)({status:null==s?void 0:s.status,releaseId:(null==s?void 0:s.status)==="release"?s.release_id:void 0,documentId:o.id,versionId:null==s?void 0:s.version_id,env:a.env}),c=(null==s?void 0:s.preview_summary)??"",f=(null==s?void 0:s.custom_type_label)??"";return M.jsx(u.oZ,{url:l,title:o.title,subTitle:f,description:c,onEdit:r,onUnlink:i,largeIconName:"description"})}function eld(t){let{editor:n}=t,{searchDocuments:r}=tR(),i=n.getAttributes(qG.RichTextNodeType.hyperlink);if(i.id&&r){let o=i.id;return M.jsx(elf,{docId:o,...t})}if(i.href){let a=i.href;return M.jsx(elp,{url:a,...t})}if(i.media){let u=es2(i.media);return M.jsx(elh,{media:u,...t})}return null}function elf(t){let{editor:n,onEditDocumentLink:r,docId:i}=t;return M.jsx(u.SV,{renderError:()=>M.jsx(u.oZ,{url:"",title:"Failed to Load Linked Document Data",subTitle:"",error:!0,onEdit:r,onUnlink:()=>elm(n)}),children:M.jsx(o.Suspense,{fallback:M.jsx(u.oZ,{url:"",title:"",subTitle:"",loading:!0,onEdit:r,onUnlink:()=>elm(n)}),children:M.jsx(elc,{docId:i,onEdit:r,onUnlink:()=>elm(n)})})})}function elp(t){let{url:n,editor:r,onEditWebLink:i}=t,o=(0,v.ju)(n);return o?M.jsx(u.oZ,{url:n,title:(0,v.S$)(o),subTitle:n,onEdit:i,onUnlink:()=>elm(r)}):M.jsx(u.oZ,{url:n,title:"",subTitle:n,onEdit:i,onUnlink:()=>elm(r)})}function elh(t){let{media:n,editor:r,onEditMediaLink:i}=t;return"ImageLink"===n.__TYPE__?M.jsx(u.Qi,{url:n.url,title:n.name,subTitle:`${n.width} x ${n.height} pixels`,onEdit:i,onUnlink:()=>elm(r)}):"FileLink"===n.__TYPE__?M.jsx(u.oZ,{url:n.url,title:n.name,subTitle:function(t){let{filename:n}=t,r=n.split(".").pop();return r?r.toLowerCase():""}({filename:n.name}),onEdit:i,onUnlink:()=>elm(r),largeIconName:"insertDriveFile"}):null}function elm(t){elo(t=>t.unsetLink())(t)}function elg(t){let{open:n}=t,{onOpenChange:r,onSelectDocument:i}=function(t){let{editor:n,setOpen:r}=t;function i(t){r(t)}return{onSelectDocument:function(t){elo(n=>n.extendMarkRange(qG.RichTextNodeType.hyperlink).setDocumentLink({id:t}))(n),r(!1)},onOpenChange:i}}(t);return M.jsx(eox,{open:n,onOpenChange:r,onSelectDocument:i})}function ely(t){let{open:n}=t,{onOpenChange:r,onMediaSelected:i}=function(t){let{editor:n,setOpen:r}=t;return{onMediaSelected:function(t){elo(n=>n.extendMarkRange(qG.RichTextNodeType.hyperlink).setMediaLink({media:t}))(n),r(!1)},onOpenChange:r}}(t);return M.jsx(ei9,{open:n,onOpenChange:r,onMediaSelected:i,assetType:"all"})}function elv(t){let{open:n}=t,{url:r,setUrl:i,onOpenChange:a,onKeyDown:s,openInNewTab:l,setOpenInNewTab:c,onSetUrl:d,selectionUrl:f,selectionUrlTitle:p}=function(t){var n;let{editor:r,setOpen:i}=t,[a,u]=(0,o.useState)(""),[s,l]=(0,o.useState)(!1),c=function(t){let n=t.getAttributes(qG.RichTextNodeType.hyperlink);return n.href?n.href:void 0}(r),d=(n=r,"_blank"===n.getAttributes(qG.RichTextNodeType.hyperlink).target);(0,o.useEffect)(()=>{u(c??"")},[c]),(0,o.useEffect)(()=>{l(d??!1)},[d]);let f=c?(0,v.ju)(c):void 0,p=f?(0,v.S$)(f):"";function h(t){let n=s?"_blank":"_self";elo(r=>r.extendMarkRange(qG.RichTextNodeType.hyperlink).setWebLink({href:t,target:n}))(r),i(!1)}return{url:a,setUrl:u,onSetUrl:h,selectionUrl:c,selectionUrlTitle:p,openInNewTab:s,selectionOpenInNewTab:d,setOpenInNewTab:l,onKeyDown:function(t){"Enter"===t.key&&h(a)},onOpenChange:function(t){u(""),l(!1),i(t)}}}(t);return M.jsx(u.Vq,{open:n,onOpenChange:a,hasClose:!1,size:"small",children:M.jsx(u.cZ,{children:M.jsxs(u.xu,{flexDirection:"column",children:[M.jsxs(u.xu,{flexDirection:"column",height:"100%",padding:16,gap:4,children:[M.jsx(u.yt,{value:r,onValueChange:i,placeholder:"Paste URL",icon:"public",onKeyDown:s}),f&&M.jsxs(u.xu,{flexDirection:"column",padding:{top:8},gap:4,children:[M.jsx(u.xv,{variant:"smallBold",color:"grey11",children:"Linked to"}),M.jsxs(u.xu,{backgroundColor:"grey4",borderRadius:6,padding:8,alignItems:"center",gap:8,children:[M.jsx(u.pI,{largeIconName:"public",smallIconName:"link"}),M.jsxs(u.xu,{flexDirection:"column",children:[M.jsx(u.xv,{variant:"bold",color:"grey12",children:p}),M.jsx(u.xv,{color:"grey11",variant:"small",children:"Web page"})]})]})]})]}),r&&M.jsxs(u.xu,{flexDirection:"column",padding:{block:8},border:{top:!0},children:[M.jsx(u.UN,{onSelect:()=>c(!l),icon:l?"checkBox":"checkBoxOutlinedBlank",textContent:"Open in new tab"}),M.jsx(u.UN,{onSelect:()=>d(r),icon:"link",textContent:"Link to URL"})]})]})})})}function elb(t){let{items:n,editor:r}=t;return 0===n.length?null:M.jsxs(M.Fragment,{children:[M.jsx(u.Jf,{}),M.jsx(u.dV,{onValueChange(t){n.forEach(n=>{(n.isActive(r)&&!t.includes(n.nodeType)||!n.isActive(r)&&t.includes(n.nodeType))&&n.runCommands(r)})},type:"multiple",value:n.filter(t=>t.isActive(r)).map(t=>t.nodeType),children:n.map(t=>M.jsx(u.nG,{disabled:!t.runCommands(r,{can:!0}),startIcon:t.icon,value:t.nodeType},t.nodeType))},"mark")]})}function elx(t){var n;let{items:r,editor:i}=t;return 0===r.length?null:M.jsx(u.vT,{disabled:1===r.length,value:(null==(n=r.find(t=>t.isActive(i)))?void 0:n.nodeType)??"",onValueChange(t){var n;null==(n=r.find(n=>n.nodeType===t))||n.runCommands(i)},children:r.map(t=>M.jsx(u.KG,{value:t.nodeType,children:t.text},t.nodeType))})}let el_={duration:100,hideOnClick:!0,offset:[-48,8],placement:"top-start",zIndex:30};function elS(t){let{editor:n,nodeTypes:r}=t,[i,a]=(0,o.useState)(),u=r.includes(qG.RichTextNodeType.hyperlink),s=!i,{shouldShowBubbleMenu:l,shouldShowLinkPopover:c}=function(t){let{editor:n}=t;return{shouldShowBubbleMenu:function(t){let{view:r,state:i,from:o,to:a}=t;if(!r.hasFocus())return!1;let{doc:u,selection:s}=i;return!(n.isActive(qG.RichTextNodeType.preformatted)||s.empty||0===u.textBetween(o,a).length)},shouldShowLinkPopover:function(t){let{view:n,state:r,from:i,to:o}=t,a=n.state.doc.nodeAt(i),{doc:u,selection:s}=r;return!!s.empty&&!(u.textBetween(i,o).length>0)&&!!(null!=a&&a.marks.some(t=>"hyperlink"===t.type.name))}}}({editor:n});return M.jsxs(M.Fragment,{children:[M.jsx(eiw,{editor:n,tippyOptions:el_,shouldShow:l,children:s&&M.jsx(elT,{...t,setModal:a})}),M.jsx(eiw,{editor:n,tippyOptions:el_,shouldShow:c,children:s&&M.jsx(eld,{editor:n,onEditWebLink:()=>a("webLink"),onEditDocumentLink:()=>a("documentLink"),onEditMediaLink:()=>a("mediaLink")})}),u&&M.jsxs(M.Fragment,{children:[M.jsx(elv,{open:"webLink"===i,setOpen:function(t){a(t?"webLink":void 0)},editor:n}),M.jsx(elg,{open:"documentLink"===i,setOpen:function(t){a(t?"documentLink":void 0)},editor:n}),M.jsx(ely,{open:"mediaLink"===i,setOpen:function(t){a(t?"mediaLink":void 0)},editor:n})]})]})}function elT(t){let{editor:n,nodeTypes:r}=t,i=r.includes("hyperlink"),o=elu(eln,r),a=elu(elr,r),s=elu(eli,r),l=o.length+a.length+s.length+Number(i);return 0===l?null:M.jsxs(u.o8,{children:[M.jsx(elx,{items:o,editor:n}),M.jsx(elb,{items:a,editor:n}),i&&M.jsx(ell,{...t}),M.jsx(els,{items:s,editor:n}),l>1&&M.jsxs(M.Fragment,{children:[M.jsx(u.Jf,{}),M.jsx(u.hA,{onClick(){n.chain().focus().clearNodes().unsetAllMarks().run()},startIcon:"formatClear"},"clear")]})]})}function elw(t){var n;let{content:r,field:i,id:a,readOnly:l}=t,d=function(t){var n,r;let i=`${(null==(n=t.config)?void 0:n.multi)??""}-${(null==(r=t.config)?void 0:r.single)??""}`;return(0,o.useMemo)(()=>{let{extensions:n,defaultTextConverter:r}=function(t){var n;if(!t||!(null!=t&&t.single)&&!(null!=t&&t.multi))return eaa();let r=function(t){let n=(t.single||t.multi||"").split(/\s*,\s*/).map(t=>{let n=qG.RichTextNodeTypeCodec.decode(t);return"Right"===n._tag?n.right:void 0}).filter(c.$);return new Set(n)}(t);if(!(null!=r&&r.size))return eaa();let i=(n=r,elt(n).filter(t=>(0,g.G)(n,n=>t.richTextNodeTypes.includes(n)))),o=function(t){let n=new Set(t);return(0,g.G)(n,ear)&&n.add(esp),(0,g.G)(n,eae)||n.add(esp),[...n]}(i);return{extensions:o,defaultTextConverter:function(t){let n=t.find(eae)??esp;return function(t){return r=>n.converter.fromPrismic(t)({...r,type:n.richTextNodeTypes[0]??"heading1"})}}(o)}}(t.config),i=n.filter(elO),o=n.flatMap(t=>t.richTextNodeTypes),a=n.map(t=>t.component),u=n.filter(elk).map(t=>t.name),s=[...a,...function(t,n){var r,i,o;let a=n.map(t=>t.richTextNodeTypes).flat(),u={placeholderByNodeType:(o=n,o.reduce((t,n)=>(n.nodeType===eo8.Text&&(t[n.name]=n.placeholder),t),{})),unfocusedPlaceholder:null==(r=t.config)?void 0:r.placeholder,nodeExtensions:n},s=a.includes(qG.RichTextNodeType.orderedList)||a.includes(qG.RichTextNodeType.list);return[eax.component((null==(i=t.config)?void 0:i.single)===void 0),eso.component,eaO.component,eaC(u),s?eag.component:void 0,esy.configure({nodeTypes:a})].filter(c.$)}(t,i),esl.configure({supportedExtensionNames:u}),eoX],l=s.map(t=>t.name),d=function(t,n){let r=ets.resolve(t);return ee8(r,void 0)}(s);return{allComponents:s,extensionNames:l,defaultTextConverter:r,nodeExtensions:i,names:o,schema:d}},[i])}(i),f=r&&eax.converter(d.nodeExtensions).fromPrismic(d.schema,null==(n=d.defaultTextConverter)?void 0:n.call(d,d.schema))(r),p=(0,s.R9)(t.onContentChange),h=function(t={},n=[]){let{onUpdate:r}=t,[i,a]=(0,o.useState)(),u=(0,o.useRef)(r),l=(0,s.NW)();return(0,o.useEffect)(()=>{i&&r&&(i.off("update",u.current),i.on("update",r),u.current=r)},[r,i]),(0,o.useLayoutEffect)(()=>{let n=!0,r=new eiO(t);return a(r),r.on("transaction",()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{n&&l()})})}),()=>{n=!1}},n),(0,o.useEffect)(()=>()=>{null==i||i.destroy()},[i]),i}({content:null==f?void 0:f.toJSON(),editable:!l,editorProps:{attributes:{class:u.rk,id:a,tabIndex:"0"}},extensions:d.allComponents,injectCSS:!1,onUpdate({editor:t}){if(t.isEmpty)return p(void 0);let n=eax.converter(d.nodeExtensions).toPrismic(t.state.doc);p(n)}},[d,l]);return M.jsxs(u.gN,{children:[M.jsx(u.Qy,{htmlFor:a,children:ZJ(i)}),M.jsxs(u.JO,{children:[M.jsx(eiI,{editor:h??null,style:{flex:1}}),(null==h?void 0:h.isEditable)&&M.jsx(elS,{editor:h,nodeTypes:d.names.concat(ess)})]})]})}function elO(t){return t.extType===eo9.Node}function elk(t){return!(t.extType!==eo9.Node||t.nodeType!==eo8.Text||t.lockedFormat)}function elC(t){var n,r,i,o,a;let{content:s,field:l,id:c,onContentChange:d,readOnly:f}=t,p=ZQ(l),h=(i=l,(null==(o=i.config)?void 0:o.default_value)===void 0||null==(a=i.config.options)?void 0:a[0]),m=(null==s?void 0:s.value)??h;return M.jsxs(u.gN,{children:[M.jsx(u.fw,{name:"arrowDropDownCircle"}),M.jsx(u.Qy,{htmlFor:c,children:ZJ(l)}),M.jsx(u.JO,{children:M.jsx(u.Ph,{id:c,size:"large",color:"grey",value:m,renderTrigger:()=>M.jsx(u.JF,{id:c,placeholder:p}),onValueChange(t){var n;f||d((n=t,0===n.length?void 0:{__TYPE__:"FieldContent",type:"Select",value:n}))},children:null==(r=null==(n=l.config)?void 0:n.options)?void 0:r.map(t=>M.jsx(u.Ql,{value:t,children:t},t))})})]})}function elI(t){let{id:n,readOnly:r,field:i,content:o,onContentChange:a}=t,s=null!=o&&o.value?(0,l._O)(o.value):void 0;return M.jsxs(u.gN,{children:[M.jsx(u.fw,{name:"event"}),M.jsx(u.Qy,{id:n,children:ZJ(i)}),M.jsx(u.JO,{children:M.jsx(u.xu,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:M.jsx(u.Wr,{mode:"date-time","aria-labelledby":n,disabled:r,value:s,onValueChange:t=>a(function(t){if(t)return{__TYPE__:"FieldContent",type:"Timestamp",value:function(t){let n=`${t.getUTCFullYear()}`.padStart(4,"0"),r=`${t.getUTCMonth()+1}`.padStart(2,"0"),i=`${t.getUTCDate()}`.padStart(2,"0"),o=`${t.getUTCHours()}`.padStart(2,"0"),a=`${t.getUTCMinutes()}`.padStart(2,"0");return`${n}-${r}-${i}T${o}:${a}:00+00:00`}(t)}}(t))})})})]})}function elM(t){let{id:n,readOnly:r,content:i,nestableWidget:a}=t,u=(0,s.R9)(t.onContentChange);return(0,o.useMemo)(()=>{let t={id:n,readOnly:r,onContentChange:u};return"Boolean"===a.type?M.jsx(ZX,{...t,field:a,content:nJ.isBooleanContent(i)?i:void 0}):"Date"===a.type?M.jsx(Z1,{...t,field:a,content:nJ.isDateContent(i)?i:void 0}):"Timestamp"===a.type?M.jsx(elI,{...t,field:a,content:nJ.isTimestampContent(i)?i:void 0}):"Image"===a.type?M.jsx(eos,{...t,field:a,content:nJ.isImageContent(i)?i:void 0}):"Link"===a.type?M.jsx(eoE,{...t,field:a,content:nJ.isLinkContent(i)?i:void 0}):"Number"===a.type?M.jsx(eoP,{...t,field:a,content:nJ.isNumberContent(i)?i:void 0}):"StructuredText"===a.type?M.jsx(elw,{...t,field:a,content:nJ.isRichTextContent(i)?i:void 0}):"Select"===a.type?M.jsx(elC,{...t,field:a,content:nJ.isSelectContent(i)?i:void 0}):"Text"===a.type?M.jsx(eoc,{...t,field:a,content:nJ.isTextContent(i)?i:void 0}):"Embed"===a.type?M.jsx(eiz,{...t,field:a,content:nJ.isEmbedContent(i)?i:void 0}):"Color"===a.type?M.jsx(Z0,{...t,field:a,content:nJ.isColorContent(i)?i:void 0}):"GeoPoint"===a.type?M.jsx(eiK,{...t,field:a,content:nJ.isGeoPointContent(i)?i:void 0}):null},[i,n,a,u,r])}function elR(t){let{content:n,id:r,nonRepeatableZone:i,onContentChange:u,readOnly:s}=t,l=(0,o.useMemo)(()=>Object.entries(i),[i]);return M.jsx(M.Fragment,{children:l.map(([t,i])=>{let o=n[t];return M.jsx(elM,{id:`${r}.${t}`,readOnly:s,nestableWidget:i,content:nJ.isNestableContent(o)?o:void 0,onContentChange(r){var i,o,s;u((i=n,o=t,s=r,s?{...i,[o]:s}:(0,a.ud)(i,o)))}},t)})})}function elE(t){let{id:n,title:r,content:i,onContentChange:a,readOnly:s,repeatable:l=!0,repeatableZone:c}=t,d=(0,o.useMemo)(()=>Object.entries(c),[c]),p=i??[elj];!l&&p.length>1&&(p=p.slice(0,1));let h=(0,o.useRef)(new Map);function m(t){return h.current.get(t)??"!bugged!"}function g(t){let{index:n,offset:r}=t;a((0,f.pB)(p,n,n+r))}function y(t){let{index:n}=t;a((0,f.$E)(p,n))}return!function(t,n){let r=new Set(n);n.forEach(n=>{t.has(n)||t.set(n,(0,_.d)())}),(0,o.useLayoutEffect)(()=>{for(let[n]of t)r.has(n)||t.delete(n)})}(h.current,p),0===Object.keys(c).length?null:M.jsx(u.ZA,{title:`Repeatable zone${r?` • ${r}`:""}`,addItemButtonTitle:"Add item in group",items:p,maxItems:l?void 0:1,getItemKey:m,onAddItem:function(){a(p.concat(elA()))},children(t,r){let i=new Map(t.value),o=m(t);return M.jsx(u.MN,{index:r,title:"Item",onMove:g,onDelete:y,children:d.map(([u,l])=>{let c=i.get(u),d=nJ.isNestableContent(c)?c:void 0;return M.jsx(elM,{id:`${n}[${o}].${u}`,content:d,nestableWidget:l,onContentChange:n=>(function(t,n,r,i){let o=function(t,n){let[r,i]=n;if(!i){let o=t.value.filter(([t])=>t!==r);return elA(o)}let a=Array.from(new Map(t.value).set(r,i));return elA(a)}(t,[r,i]),u=function(t,n){let[r,i]=n;return i?t.map((t,n)=>n===r?i:t):t.filter((t,n)=>n!==r)}(p,[n,o]);(function(t,n,r){let i=t.get(n);void 0!==i&&t.set(r,i)})(h.current,t,o),a(u)})(t,r,u,n),readOnly:s},u)})})}})}let elj={__TYPE__:"GroupItemContent",value:[]};function elA(t=[]){return{__TYPE__:"GroupItemContent",value:t}}function elN(t){var n,r,i,a;let{config:s,content:l,sliceKey:c,readOnly:d=!1,sharedSlice:f,onContentChange:p,...h}=t,m=(n=f,r=l.variation,(0,o.useMemo)(()=>n.variations.find(t=>t.id===r),[n,r])),g=(0,o.useId)(),y={id:h.id??g,readOnly:d},{selected:v,selectionId:b,selection:x}=function(t){let{sliceKey:n}=t||{},r=(0,o.useContext)(ZY),i=function(t,n){if(n)return`${t}___${n}`}("sliceFieldSet",n),a=n===(null==r?void 0:r.id);return{selectionId:i,selected:a,selection:r}}({sliceKey:c}),_=()=>{c&&x.update("sliceFieldSet",c)};return void 0===m?null:M.jsx(tM.Provider,{value:s,children:M.jsxs(u.C3,{id:b,selected:v,onFocus:_,children:[M.jsx(u.ax,{children:(i=f,a=m,[i.name,a.name].join(" • "))}),M.jsxs(u.En,{heightEstimate:400,box:{gap:u.jM},children:[M.jsx(elR,{...y,nonRepeatableZone:m.primary??{},content:l.primary,onContentChange(t){p({...l,primary:t})}}),M.jsx(elE,{...y,repeatableZone:m.items??{},content:l.items,onContentChange(t){p({...l,items:t})}})]})]})})}(0,o.createContext)({editedUID:!1,onEditUID(){}})}}]);
|