slice-machine-ui 1.22.2-beta.8 → 1.22.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/components/AppLayout/index.tsx +1 -1
  2. package/lib/builders/CustomTypeBuilder/SliceZone/index.tsx +1 -1
  3. package/lib/builders/SliceBuilder/Sidebar/index.tsx +1 -1
  4. package/lib/builders/SliceBuilder/SimulatorButton/index.tsx +1 -1
  5. package/lib/builders/common/Zone/components/EmptyState/index.tsx +1 -1
  6. package/lib/builders/common/Zone/index.jsx +1 -1
  7. package/out/404.html +1 -1
  8. package/out/_next/static/{gmURGa9M7ohOYzPk99uIp → 3vLhj_JZ10e4rwC2sTZNQ}/_buildManifest.js +1 -1
  9. package/out/_next/static/chunks/18539003-4460ccbfe3109578.js +97 -0
  10. package/out/_next/static/chunks/482-49264466566eac99.js +1 -0
  11. package/out/_next/static/chunks/{505-fa47e200ac3a012d.js → 505-3f1cf09a086dcba8.js} +1 -1
  12. package/out/_next/static/chunks/550-c80fd46fb64d1eef.js +1 -0
  13. package/out/_next/static/chunks/904-fe1af089657fb0cc.js +1 -0
  14. package/out/_next/static/chunks/{958-0a6a103fac00582b.js → 958-3d829456f4f5632c.js} +1 -1
  15. package/out/_next/static/chunks/pages/_app-f88a66f6532a8e87.js +458 -0
  16. package/out/_next/static/chunks/pages/{changes-97d67a1d2c156b51.js → changes-52c9d917808d1461.js} +1 -1
  17. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-ef11594ce026b650.js +1 -0
  18. package/out/_next/static/css/{29d73729eff3b961.css → 1bbf650dfd37ce69.css} +1 -1
  19. package/out/changelog.html +1 -1
  20. package/out/changes.html +1 -1
  21. package/out/custom-types/[customTypeId].html +1 -1
  22. package/out/custom-types.html +1 -1
  23. package/out/index.html +1 -1
  24. package/out/labs.html +1 -1
  25. package/out/page-types/[pageTypeId].html +1 -1
  26. package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
  27. package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
  28. package/out/slices.html +1 -1
  29. package/package.json +7 -8
  30. package/src/components/BlankSlate/BlankSlate.css.ts +4 -1
  31. package/src/components/BlankSlate/BlankSlate.tsx +2 -7
  32. package/src/components/Card/Card.stories.tsx +3 -3
  33. package/src/components/HoverCard/HoverCard.css.ts +0 -9
  34. package/src/components/HoverCard/HoverCard.stories.tsx +1 -1
  35. package/src/components/HoverCard/HoverCard.tsx +1 -1
  36. package/src/components/List/List.stories.tsx +2 -2
  37. package/src/components/SideNav/SideNavEnvironmentSelector.tsx +35 -25
  38. package/src/components/Window/Window.tsx +1 -1
  39. package/src/features/customTypes/EditDropdown.tsx +7 -5
  40. package/src/features/customTypes/customTypesBuilder/PageSnippetDialog/PageSnippetDialog.tsx +2 -2
  41. package/src/features/inAppGuide/InAppGuideDialog.tsx +1 -7
  42. package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewSliceDialog.tsx +1 -1
  43. package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewVariationDialog.tsx +1 -1
  44. package/src/features/slices/convertLegacySlice/ConvertLegacySliceButton.tsx +1 -1
  45. package/src/features/slices/convertLegacySlice/ConvertLegacySliceMergeWithIdenticalDialog.tsx +1 -1
  46. package/src/features/slices/sliceBuilder/FloatingBackButton.tsx +1 -1
  47. package/src/features/slices/sliceCards/SharedSliceCard.tsx +2 -2
  48. package/out/_next/static/chunks/18539003-9f66499125869c64.js +0 -97
  49. package/out/_next/static/chunks/482-7e97f91961588a90.js +0 -1
  50. package/out/_next/static/chunks/550-8557ad3750e1e581.js +0 -1
  51. package/out/_next/static/chunks/904-dda24b22ea065891.js +0 -1
  52. package/out/_next/static/chunks/pages/_app-8c14c8d5b76781af.js +0 -447
  53. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-45f39b106898eeb3.js +0 -1
  54. /package/out/_next/static/{gmURGa9M7ohOYzPk99uIp → 3vLhj_JZ10e4rwC2sTZNQ}/_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 ecp}});var i,o=r(2784),a=r(98863),u=r(22715),s=r(74217),c=r(50054),l=r(86579),f=r(1611),d=r(17329),p=r(32184),h=r(87322),m=r(16247),g=r(661),y=r(52393),v=r(28316),b=r(87598),x=Object.defineProperty,_=(t,n,r)=>n in t?x(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,S=(t,n,r)=>(_(t,"symbol"!=typeof n?n+"":n,r),r),T="u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof r.g?r.g:"u">typeof self?self:{};function w(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 O,k,I,C={},M={get exports(){return C},set exports(e){C=e}},R={};(O=M).exports=function(){if(Hm)return R;Hm=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,c={},l=null,f=null;for(s in void 0!==u&&(l=""+u),void 0!==o.key&&(l=""+o.key),void 0!==o.ref&&(f=o.ref),o)r.call(o,s)&&!a.hasOwnProperty(s)&&(c[s]=o[s]);if(n&&n.defaultProps)for(s in o=n.defaultProps)void 0===c[s]&&(c[s]=o[s]);return{$$typeof:t,type:n,key:l,ref:f,props:c,_owner:i.current}}return R.Fragment=n,R.jsx=u,R.jsxs=u,R}(),(k=Hg||(Hg={})).assertEqual=t=>t,k.assertIs=function(t){},k.assertNever=function(t){throw Error()},k.arrayToEnum=t=>{let n={};for(let r of t)n[r]=r;return n},k.getValidEnumValues=t=>{let n=k.objectKeys(t).filter(n=>"number"!=typeof t[t[n]]),r={};for(let i of n)r[i]=t[i];return k.objectValues(r)},k.objectValues=t=>k.objectKeys(t).map(function(n){return t[n]}),k.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},k.find=(t,n)=>{for(let r of t)if(n(r))return r},k.isInteger="function"==typeof Number.isInteger?t=>Number.isInteger(t):t=>"number"==typeof t&&isFinite(t)&&Math.floor(t)===t,k.joinValues=function(t,n=" | "){return t.map(t=>"string"==typeof t?`'${t}'`:t).join(n)},k.jsonStringifyReplacer=(t,n)=>"bigint"==typeof n?n.toString():n,(I=Hy||(Hy={})).mergeShapes=(t,n)=>({...t,...n});let E=Hg.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),j=t=>{switch(typeof t){case"undefined":return E.undefined;case"string":return E.string;case"number":return isNaN(t)?E.nan:E.number;case"boolean":return E.boolean;case"function":return E.function;case"bigint":return E.bigint;case"symbol":return E.symbol;case"object":return Array.isArray(t)?E.array:null===t?E.null:t.then&&"function"==typeof t.then&&t.catch&&"function"==typeof t.catch?E.promise:"u">typeof Map&&t instanceof Map?E.map:"u">typeof Set&&t instanceof Set?E.set:"u">typeof Date&&t instanceof Date?E.date:E.object;default:return E.unknown}},N=Hg.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"]),A=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class P 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,Hg.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()}}P.create=t=>new P(t);let L=(t,n)=>{let r;switch(t.code){case N.invalid_type:r=t.received===E.undefined?"Required":`Expected ${t.expected}, received ${t.received}`;break;case N.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Hg.jsonStringifyReplacer)}`;break;case N.unrecognized_keys:r=`Unrecognized key(s) in object: ${Hg.joinValues(t.keys,", ")}`;break;case N.invalid_union:r="Invalid input";break;case N.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Hg.joinValues(t.options)}`;break;case N.invalid_enum_value:r=`Invalid enum value. Expected ${Hg.joinValues(t.options)}, received '${t.received}'`;break;case N.invalid_arguments:r="Invalid function arguments";break;case N.invalid_return_type:r="Invalid function return type";break;case N.invalid_date:r="Invalid date";break;case N.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}"`:Hg.assertNever(t.validation):r="regex"!==t.validation?`Invalid ${t.validation}`:"Invalid";break;case N.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 N.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 N.custom:r="Invalid input";break;case N.invalid_intersection_types:r="Intersection results could not be merged";break;case N.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case N.not_finite:r="Number must be finite";break;default:r=n.defaultError,Hg.assertNever(t)}return{message:r}},D=L;function F(t){D=t}function W(){return D}let U=t=>{let{data:n,path:r,errorMaps:i,issueData:o}=t,a=[...r,...o.path||[]],u={...o,path:a},s="",c=i.filter(t=>!!t).slice().reverse();for(let l of c)s=l(u,{data:n,defaultError:s}).message;return{...o,path:a,message:o.message||s}};function z(t,n){let r=U({issueData:n,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,D,L].filter(t=>!!t)});t.common.issues.push(r)}class B{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 V;"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 B.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 V;"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 V=Object.freeze({status:"aborted"}),$=t=>({status:"dirty",value:t}),q=t=>({status:"valid",value:t}),K=t=>"aborted"===t.status,H=t=>"dirty"===t.status,Z=t=>"valid"===t.status,G=t=>"u">typeof Promise&&t instanceof Promise;(tB=Hv||(Hv={})).errToObj=t=>"string"==typeof t?{message:t}:t||{},tB.toString=t=>"string"==typeof t?t:null==t?void 0:t.message;class Y{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 J=(t,n)=>{if(Z(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 P(t.common.issues);return this._error=r,this._error}}};function Q(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 X{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 j(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:j(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new B,ctx:{common:t.parent.common,data:t.data,parsedType:j(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(G(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:j(t)},o=this._parseSync({data:t,path:i.path,parent:i});return J(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:j(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await (G(i)?i:Promise.resolve(i));return J(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:N.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 eU({schema:this,typeName:Hb.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return ez.create(this,this._def)}nullable(){return eB.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return eT.create(this,this._def)}promise(){return eW.create(this,this._def)}or(t){return eO.create([this,t],this._def)}and(t){return eC.create(this,t,this._def)}transform(t){return new eU({...Q(this._def),schema:this,typeName:Hb.ZodEffects,effect:{type:"transform",transform:t}})}default(t){return new eV({...Q(this._def),innerType:this,defaultValue:"function"==typeof t?t:()=>t,typeName:Hb.ZodDefault})}brand(){return new eH({typeName:Hb.ZodBranded,type:this,...Q(this._def)})}catch(t){return new e$({...Q(this._def),innerType:this,catchValue:"function"==typeof t?t:()=>t,typeName:Hb.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return eZ.create(this,t)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}let ee=/^c[^\s-]{8,}$/i,et=/^[a-z][a-z0-9]*$/,en=/[0-9A-HJKMNP-TV-Z]{26}/,er=/^([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,ei=/^(([^<>()[\]\\.,;:\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,})+))$/,eo=/^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u,ea=/^(((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}))$/,eu=/^(([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})))$/,es=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 ec(t,n){return!!(("v4"===n||!n)&&ea.test(t)||("v6"===n||!n)&&eu.test(t))}class el extends X{constructor(){super(...arguments),this._regex=(t,n,r)=>this.refinement(n=>t.test(n),{validation:n,code:N.invalid_string,...Hv.errToObj(r)}),this.nonempty=t=>this.min(1,Hv.errToObj(t)),this.trim=()=>new el({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new el({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new el({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==E.string){let n=this._getOrReturnCtx(t);return z(n,{code:N.invalid_type,expected:E.string,received:n.parsedType}),V}let r=new B,i;for(let o of this._def.checks)if("min"===o.kind)t.data.length<o.value&&(z(i=this._getOrReturnCtx(t,i),{code:N.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&&(z(i=this._getOrReturnCtx(t,i),{code:N.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?z(i,{code:N.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):u&&z(i,{code:N.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if("email"===o.kind)ei.test(t.data)||(z(i=this._getOrReturnCtx(t,i),{validation:"email",code:N.invalid_string,message:o.message}),r.dirty());else if("emoji"===o.kind)eo.test(t.data)||(z(i=this._getOrReturnCtx(t,i),{validation:"emoji",code:N.invalid_string,message:o.message}),r.dirty());else if("uuid"===o.kind)er.test(t.data)||(z(i=this._getOrReturnCtx(t,i),{validation:"uuid",code:N.invalid_string,message:o.message}),r.dirty());else if("cuid"===o.kind)ee.test(t.data)||(z(i=this._getOrReturnCtx(t,i),{validation:"cuid",code:N.invalid_string,message:o.message}),r.dirty());else if("cuid2"===o.kind)et.test(t.data)||(z(i=this._getOrReturnCtx(t,i),{validation:"cuid2",code:N.invalid_string,message:o.message}),r.dirty());else if("ulid"===o.kind)en.test(t.data)||(z(i=this._getOrReturnCtx(t,i),{validation:"ulid",code:N.invalid_string,message:o.message}),r.dirty());else if("url"===o.kind)try{new URL(t.data)}catch{z(i=this._getOrReturnCtx(t,i),{validation:"url",code:N.invalid_string,message:o.message}),r.dirty()}else"regex"===o.kind?(o.regex.lastIndex=0,o.regex.test(t.data)||(z(i=this._getOrReturnCtx(t,i),{validation:"regex",code:N.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)||(z(i=this._getOrReturnCtx(t,i),{code:N.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)||(z(i=this._getOrReturnCtx(t,i),{code:N.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):"endsWith"===o.kind?t.data.endsWith(o.value)||(z(i=this._getOrReturnCtx(t,i),{code:N.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):"datetime"===o.kind?es(o).test(t.data)||(z(i=this._getOrReturnCtx(t,i),{code:N.invalid_string,validation:"datetime",message:o.message}),r.dirty()):"ip"===o.kind?ec(t.data,o.version)||(z(i=this._getOrReturnCtx(t,i),{validation:"ip",code:N.invalid_string,message:o.message}),r.dirty()):Hg.assertNever(o);return{status:r.value,value:t.data}}_addCheck(t){return new el({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Hv.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Hv.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Hv.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Hv.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Hv.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Hv.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Hv.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Hv.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,...Hv.errToObj(null==t?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Hv.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:null==n?void 0:n.position,...Hv.errToObj(null==n?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Hv.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Hv.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Hv.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Hv.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Hv.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 ef(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)}el.create=t=>{var n;return new el({checks:[],typeName:Hb.ZodString,coerce:null!==(n=null==t?void 0:t.coerce)&&void 0!==n&&n,...Q(t)})};class ed extends X{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)!==E.number){let n=this._getOrReturnCtx(t);return z(n,{code:N.invalid_type,expected:E.number,received:n.parsedType}),V}let r,i=new B;for(let o of this._def.checks)"int"===o.kind?Hg.isInteger(t.data)||(z(r=this._getOrReturnCtx(t,r),{code:N.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):"min"===o.kind?(o.inclusive?t.data<o.value:t.data<=o.value)&&(z(r=this._getOrReturnCtx(t,r),{code:N.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)&&(z(r=this._getOrReturnCtx(t,r),{code:N.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):"multipleOf"===o.kind?0!==ef(t.data,o.value)&&(z(r=this._getOrReturnCtx(t,r),{code:N.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):"finite"===o.kind?Number.isFinite(t.data)||(z(r=this._getOrReturnCtx(t,r),{code:N.not_finite,message:o.message}),i.dirty()):Hg.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Hv.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Hv.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Hv.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Hv.toString(n))}setLimit(t,n,r,i){return new ed({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Hv.toString(i)}]})}_addCheck(t){return new ed({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Hv.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Hv.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Hv.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Hv.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Hv.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Hv.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Hv.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Hv.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Hv.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&&Hg.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)}}ed.create=t=>new ed({checks:[],typeName:Hb.ZodNumber,coerce:(null==t?void 0:t.coerce)||!1,...Q(t)});class ep extends X{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)!==E.bigint){let n=this._getOrReturnCtx(t);return z(n,{code:N.invalid_type,expected:E.bigint,received:n.parsedType}),V}let r,i=new B;for(let o of this._def.checks)"min"===o.kind?(o.inclusive?t.data<o.value:t.data<=o.value)&&(z(r=this._getOrReturnCtx(t,r),{code:N.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)&&(z(r=this._getOrReturnCtx(t,r),{code:N.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):"multipleOf"===o.kind?t.data%o.value!==BigInt(0)&&(z(r=this._getOrReturnCtx(t,r),{code:N.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Hg.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Hv.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Hv.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Hv.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Hv.toString(n))}setLimit(t,n,r,i){return new ep({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Hv.toString(i)}]})}_addCheck(t){return new ep({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Hv.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Hv.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Hv.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Hv.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Hv.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}}ep.create=t=>{var n;return new ep({checks:[],typeName:Hb.ZodBigInt,coerce:null!==(n=null==t?void 0:t.coerce)&&void 0!==n&&n,...Q(t)})};class eh extends X{_parse(t){if(this._def.coerce&&(t.data=Boolean(t.data)),this._getType(t)!==E.boolean){let n=this._getOrReturnCtx(t);return z(n,{code:N.invalid_type,expected:E.boolean,received:n.parsedType}),V}return q(t.data)}}eh.create=t=>new eh({typeName:Hb.ZodBoolean,coerce:(null==t?void 0:t.coerce)||!1,...Q(t)});class em extends X{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==E.date){let n=this._getOrReturnCtx(t);return z(n,{code:N.invalid_type,expected:E.date,received:n.parsedType}),V}if(isNaN(t.data.getTime())){let r=this._getOrReturnCtx(t);return z(r,{code:N.invalid_date}),V}let i=new B,o;for(let a of this._def.checks)"min"===a.kind?t.data.getTime()<a.value&&(z(o=this._getOrReturnCtx(t,o),{code:N.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),i.dirty()):"max"===a.kind?t.data.getTime()>a.value&&(z(o=this._getOrReturnCtx(t,o),{code:N.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),i.dirty()):Hg.assertNever(a);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new em({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Hv.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Hv.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}}em.create=t=>new em({checks:[],coerce:(null==t?void 0:t.coerce)||!1,typeName:Hb.ZodDate,...Q(t)});class eg extends X{_parse(t){if(this._getType(t)!==E.symbol){let n=this._getOrReturnCtx(t);return z(n,{code:N.invalid_type,expected:E.symbol,received:n.parsedType}),V}return q(t.data)}}eg.create=t=>new eg({typeName:Hb.ZodSymbol,...Q(t)});class ey extends X{_parse(t){if(this._getType(t)!==E.undefined){let n=this._getOrReturnCtx(t);return z(n,{code:N.invalid_type,expected:E.undefined,received:n.parsedType}),V}return q(t.data)}}ey.create=t=>new ey({typeName:Hb.ZodUndefined,...Q(t)});class ev extends X{_parse(t){if(this._getType(t)!==E.null){let n=this._getOrReturnCtx(t);return z(n,{code:N.invalid_type,expected:E.null,received:n.parsedType}),V}return q(t.data)}}ev.create=t=>new ev({typeName:Hb.ZodNull,...Q(t)});class eb extends X{constructor(){super(...arguments),this._any=!0}_parse(t){return q(t.data)}}eb.create=t=>new eb({typeName:Hb.ZodAny,...Q(t)});class ex extends X{constructor(){super(...arguments),this._unknown=!0}_parse(t){return q(t.data)}}ex.create=t=>new ex({typeName:Hb.ZodUnknown,...Q(t)});class e_ extends X{_parse(t){let n=this._getOrReturnCtx(t);return z(n,{code:N.invalid_type,expected:E.never,received:n.parsedType}),V}}e_.create=t=>new e_({typeName:Hb.ZodNever,...Q(t)});class eS extends X{_parse(t){if(this._getType(t)!==E.undefined){let n=this._getOrReturnCtx(t);return z(n,{code:N.invalid_type,expected:E.void,received:n.parsedType}),V}return q(t.data)}}eS.create=t=>new eS({typeName:Hb.ZodVoid,...Q(t)});class eT extends X{_parse(t){let{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==E.array)return z(n,{code:N.invalid_type,expected:E.array,received:n.parsedType}),V;if(null!==i.exactLength){let o=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(o||a)&&(z(n,{code:o?N.too_big:N.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&&(z(n,{code:N.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&&(z(n,{code:N.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 Y(n,t,n.path,r)))).then(t=>B.mergeArray(r,t));let u=[...n.data].map((t,r)=>i.type._parseSync(new Y(n,t,n.path,r)));return B.mergeArray(r,u)}get element(){return this._def.type}min(t,n){return new eT({...this._def,minLength:{value:t,message:Hv.toString(n)}})}max(t,n){return new eT({...this._def,maxLength:{value:t,message:Hv.toString(n)}})}length(t,n){return new eT({...this._def,exactLength:{value:t,message:Hv.toString(n)}})}nonempty(t){return this.min(1,t)}}eT.create=(t,n)=>new eT({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Hb.ZodArray,...Q(n)});class ew extends X{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=Hg.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==E.object){let n=this._getOrReturnCtx(t);return z(n,{code:N.invalid_type,expected:E.object,received:n.parsedType}),V}let{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),u=[];if(!(this._def.catchall instanceof e_&&"strip"===this._def.unknownKeys))for(let s in i.data)a.includes(s)||u.push(s);let c=[];for(let l of a){let f=o[l],d=i.data[l];c.push({key:{status:"valid",value:l},value:f._parse(new Y(i,d,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof e_){let p=this._def.unknownKeys;if("passthrough"===p)for(let h of u)c.push({key:{status:"valid",value:h},value:{status:"valid",value:i.data[h]}});else if("strict"===p)u.length>0&&(z(i,{code:N.unrecognized_keys,keys:u}),r.dirty());else if("strip"!==p)throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let m=this._def.catchall;for(let g of u){let y=i.data[g];c.push({key:{status:"valid",value:g},value:m._parse(new Y(i,y,i.path,g)),alwaysSet:g in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let t=[];for(let n of c){let r=await n.key;t.push({key:r,value:await n.value,alwaysSet:n.alwaysSet})}return t}).then(t=>B.mergeObjectSync(r,t)):B.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(t){return Hv.errToObj,new ew({...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=Hv.errToObj(t).message)&&void 0!==u?u:s}:{message:s}}}:{}})}strip(){return new ew({...this._def,unknownKeys:"strip"})}passthrough(){return new ew({...this._def,unknownKeys:"passthrough"})}extend(t){return new ew({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new ew({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Hb.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new ew({...this._def,catchall:t})}pick(t){let n={};return Hg.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new ew({...this._def,shape:()=>n})}omit(t){let n={};return Hg.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new ew({...this._def,shape:()=>n})}deepPartial(){return function t(n){if(!(n instanceof ew))return n instanceof eT?new eT({...n._def,type:t(n.element)}):n instanceof ez?ez.create(t(n.unwrap())):n instanceof eB?eB.create(t(n.unwrap())):n instanceof eM?eM.create(n.items.map(n=>t(n))):n;{let r={};for(let i in n.shape){let o=n.shape[i];r[i]=ez.create(t(o))}return new ew({...n._def,shape:()=>r})}}(this)}partial(t){let n={};return Hg.objectKeys(this.shape).forEach(r=>{let i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new ew({...this._def,shape:()=>n})}required(t){let n={};return Hg.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof ez;)i=i._def.innerType;n[r]=i}}),new ew({...this._def,shape:()=>n})}keyof(){return eL(Hg.objectKeys(this.shape))}}ew.create=(t,n)=>new ew({shape:()=>t,unknownKeys:"strip",catchall:e_.create(),typeName:Hb.ZodObject,...Q(n)}),ew.strictCreate=(t,n)=>new ew({shape:()=>t,unknownKeys:"strict",catchall:e_.create(),typeName:Hb.ZodObject,...Q(n)}),ew.lazycreate=(t,n)=>new ew({shape:t,unknownKeys:"strip",catchall:e_.create(),typeName:Hb.ZodObject,...Q(n)});class eO extends X{_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 P(t.ctx.common.issues));return z(n,{code:N.invalid_union,unionErrors:o}),V});{let i,o=[];for(let a of r){let u={...n,common:{...n.common,issues:[]},parent:null},s=a._parseSync({data:n.data,path:n.path,parent:u});if("valid"===s.status)return s;"dirty"!==s.status||i||(i={result:s,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;let c=o.map(t=>new P(t));return z(n,{code:N.invalid_union,unionErrors:c}),V}}get options(){return this._def.options}}eO.create=(t,n)=>new eO({options:t,typeName:Hb.ZodUnion,...Q(n)});let ek=t=>t instanceof eA?ek(t.schema):t instanceof eU?ek(t.innerType()):t instanceof eP?[t.value]:t instanceof eD?t.options:t instanceof eF?Object.keys(t.enum):t instanceof eV?ek(t._def.innerType):t instanceof ey?[void 0]:t instanceof ev?[null]:null;class eI extends X{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==E.object)return z(n,{code:N.invalid_type,expected:E.object,received:n.parsedType}),V;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}):(z(n,{code:N.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),V)}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=ek(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 eI({typeName:Hb.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...Q(r)})}}class eC extends X{_parse(t){let{status:n,ctx:r}=this._processInputParams(t),i=(t,i)=>{if(K(t)||K(i))return V;let o=function t(n,r){let i=j(n),o=j(r);if(n===r)return{valid:!0,data:n};if(i===E.object&&o===E.object){let a=Hg.objectKeys(r),u=Hg.objectKeys(n).filter(t=>-1!==a.indexOf(t)),s={...n,...r};for(let c of u){let l=t(n[c],r[c]);if(!l.valid)return{valid:!1};s[c]=l.data}return{valid:!0,data:s}}if(i!==E.array||o!==E.array)return i===E.date&&o===E.date&&+n==+r?{valid:!0,data:n}:{valid:!1};{if(n.length!==r.length)return{valid:!1};let f=[];for(let d=0;d<n.length;d++){let p=n[d],h=r[d],m=t(p,h);if(!m.valid)return{valid:!1};f.push(m.data)}return{valid:!0,data:f}}}(t.value,i.value);return o.valid?((H(t)||H(i))&&n.dirty(),{status:n.value,value:o.data}):(z(r,{code:N.invalid_intersection_types}),V)};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}))}}eC.create=(t,n,r)=>new eC({left:t,right:n,typeName:Hb.ZodIntersection,...Q(r)});class eM extends X{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==E.array)return z(r,{code:N.invalid_type,expected:E.array,received:r.parsedType}),V;if(r.data.length<this._def.items.length)return z(r,{code:N.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),V;!this._def.rest&&r.data.length>this._def.items.length&&(z(r,{code:N.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 Y(r,t,r.path,n)):null}).filter(t=>!!t);return r.common.async?Promise.all(i).then(t=>B.mergeArray(n,t)):B.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new eM({...this._def,rest:t})}}eM.create=(t,n)=>{if(!Array.isArray(t))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new eM({items:t,typeName:Hb.ZodTuple,rest:null,...Q(n)})};class eR extends X{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!==E.object)return z(r,{code:N.invalid_type,expected:E.object,received:r.parsedType}),V;let i=[],o=this._def.keyType,a=this._def.valueType;for(let u in r.data)i.push({key:o._parse(new Y(r,u,r.path,u)),value:a._parse(new Y(r,r.data[u],r.path,u))});return r.common.async?B.mergeObjectAsync(n,i):B.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return new eR(n instanceof X?{keyType:t,valueType:n,typeName:Hb.ZodRecord,...Q(r)}:{keyType:el.create(),valueType:t,typeName:Hb.ZodRecord,...Q(n)})}}class eE extends X{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==E.map)return z(r,{code:N.invalid_type,expected:E.map,received:r.parsedType}),V;let i=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([t,n],a)=>({key:i._parse(new Y(r,t,r.path,[a,"key"])),value:o._parse(new Y(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 V;("dirty"===r.status||"dirty"===i.status)&&n.dirty(),u.set(r.value,i.value)}return{status:n.value,value:u}})}{let s=new Map;for(let c of a){let l=c.key,f=c.value;if("aborted"===l.status||"aborted"===f.status)return V;("dirty"===l.status||"dirty"===f.status)&&n.dirty(),s.set(l.value,f.value)}return{status:n.value,value:s}}}}eE.create=(t,n,r)=>new eE({valueType:n,keyType:t,typeName:Hb.ZodMap,...Q(r)});class ej extends X{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==E.set)return z(r,{code:N.invalid_type,expected:E.set,received:r.parsedType}),V;let i=this._def;null!==i.minSize&&r.data.size<i.minSize.value&&(z(r,{code:N.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&&(z(r,{code:N.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 V;"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 Y(r,t,r.path,n)));return r.common.async?Promise.all(u).then(t=>a(t)):a(u)}min(t,n){return new ej({...this._def,minSize:{value:t,message:Hv.toString(n)}})}max(t,n){return new ej({...this._def,maxSize:{value:t,message:Hv.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}ej.create=(t,n)=>new ej({valueType:t,minSize:null,maxSize:null,typeName:Hb.ZodSet,...Q(n)});class eN extends X{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==E.function)return z(n,{code:N.invalid_type,expected:E.function,received:n.parsedType}),V;function r(t,r){return U({data:t,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,D,L].filter(t=>!!t),issueData:{code:N.invalid_arguments,argumentsError:r}})}function i(t,r){return U({data:t,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,D,L].filter(t=>!!t),issueData:{code:N.invalid_return_type,returnTypeError:r}})}let o={errorMap:n.common.contextualErrorMap},a=n.data;return this._def.returns instanceof eW?q(async(...t)=>{let n=new P([]),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})}):q((...t)=>{let n=this._def.args.safeParse(t,o);if(!n.success)throw new P([r(t,n.error)]);let u=a(...n.data),s=this._def.returns.safeParse(u,o);if(!s.success)throw new P([i(u,s.error)]);return s.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new eN({...this._def,args:eM.create(t).rest(ex.create())})}returns(t){return new eN({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new eN({args:t||eM.create([]).rest(ex.create()),returns:n||ex.create(),typeName:Hb.ZodFunction,...Q(r)})}}class eA extends X{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})}}eA.create=(t,n)=>new eA({getter:t,typeName:Hb.ZodLazy,...Q(n)});class eP extends X{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return z(n,{received:n.data,code:N.invalid_literal,expected:this._def.value}),V}return{status:"valid",value:t.data}}get value(){return this._def.value}}function eL(t,n){return new eD({values:t,typeName:Hb.ZodEnum,...Q(n)})}eP.create=(t,n)=>new eP({value:t,typeName:Hb.ZodLiteral,...Q(n)});class eD extends X{_parse(t){if("string"!=typeof t.data){let n=this._getOrReturnCtx(t),r=this._def.values;return z(n,{expected:Hg.joinValues(r),received:n.parsedType,code:N.invalid_type}),V}if(-1===this._def.values.indexOf(t.data)){let i=this._getOrReturnCtx(t),o=this._def.values;return z(i,{received:i.data,code:N.invalid_enum_value,options:o}),V}return q(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 eD.create(t)}exclude(t){return eD.create(this.options.filter(n=>!t.includes(n)))}}eD.create=eL;class eF extends X{_parse(t){let n=Hg.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==E.string&&r.parsedType!==E.number){let i=Hg.objectValues(n);return z(r,{expected:Hg.joinValues(i),received:r.parsedType,code:N.invalid_type}),V}if(-1===n.indexOf(t.data)){let o=Hg.objectValues(n);return z(r,{received:r.data,code:N.invalid_enum_value,options:o}),V}return q(t.data)}get enum(){return this._def.values}}eF.create=(t,n)=>new eF({values:t,typeName:Hb.ZodNativeEnum,...Q(n)});class eW extends X{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==E.promise&&!1===n.common.async)return z(n,{code:N.invalid_type,expected:E.promise,received:n.parsedType}),V;let r=n.parsedType===E.promise?n.data:Promise.resolve(n.data);return q(r.then(t=>this._def.type.parseAsync(t,{path:n.path,errorMap:n.common.contextualErrorMap})))}}eW.create=(t,n)=>new eW({type:t,typeName:Hb.ZodPromise,...Q(n)});class eU extends X{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Hb.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){z(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?V:("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?V:("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=>Z(t)?Promise.resolve(i.transform(t.value,a)).then(t=>({status:n.value,value:t})):t);{let c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Z(c))return c;let l=i.transform(c.value,a);if(l instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:l}}}Hg.assertNever(i)}}eU.create=(t,n,r)=>new eU({schema:t,typeName:Hb.ZodEffects,effect:n,...Q(r)}),eU.createWithPreprocess=(t,n,r)=>new eU({schema:n,effect:{type:"preprocess",transform:t},typeName:Hb.ZodEffects,...Q(r)});class ez extends X{_parse(t){return this._getType(t)===E.undefined?q(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ez.create=(t,n)=>new ez({innerType:t,typeName:Hb.ZodOptional,...Q(n)});class eB extends X{_parse(t){return this._getType(t)===E.null?q(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}eB.create=(t,n)=>new eB({innerType:t,typeName:Hb.ZodNullable,...Q(n)});class eV extends X{_parse(t){let{ctx:n}=this._processInputParams(t),r=n.data;return n.parsedType===E.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}eV.create=(t,n)=>new eV({innerType:t,typeName:Hb.ZodDefault,defaultValue:"function"==typeof n.default?n.default:()=>n.default,...Q(n)});class e$ extends X{_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 G(i)?i.then(t=>({status:"valid",value:"valid"===t.status?t.value:this._def.catchValue({get error(){return new P(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===i.status?i.value:this._def.catchValue({get error(){return new P(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}e$.create=(t,n)=>new e$({innerType:t,typeName:Hb.ZodCatch,catchValue:"function"==typeof n.catch?n.catch:()=>n.catch,...Q(n)});class eq extends X{_parse(t){if(this._getType(t)!==E.nan){let n=this._getOrReturnCtx(t);return z(n,{code:N.invalid_type,expected:E.nan,received:n.parsedType}),V}return{status:"valid",value:t.data}}}eq.create=t=>new eq({typeName:Hb.ZodNaN,...Q(t)});let eK=Symbol("zod_brand");class eH extends X{_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 eZ extends X{_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?V:"dirty"===t.status?(n.dirty(),$(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?V:"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 eZ({in:t,out:n,typeName:Hb.ZodPipeline})}}let eG=(t,n={},r)=>t?eb.create().superRefine((i,o)=>{var a,u;if(!t(i)){let s="function"==typeof n?n(i):"string"==typeof n?{message:n}:n,c=null===(u=null!==(a=s.fatal)&&void 0!==a?a:r)||void 0===u||u;o.addIssue({code:"custom",..."string"==typeof s?{message:s}:s,fatal:c})}}):eb.create(),eY={object:ew.lazycreate};(tV=Hb||(Hb={})).ZodString="ZodString",tV.ZodNumber="ZodNumber",tV.ZodNaN="ZodNaN",tV.ZodBigInt="ZodBigInt",tV.ZodBoolean="ZodBoolean",tV.ZodDate="ZodDate",tV.ZodSymbol="ZodSymbol",tV.ZodUndefined="ZodUndefined",tV.ZodNull="ZodNull",tV.ZodAny="ZodAny",tV.ZodUnknown="ZodUnknown",tV.ZodNever="ZodNever",tV.ZodVoid="ZodVoid",tV.ZodArray="ZodArray",tV.ZodObject="ZodObject",tV.ZodUnion="ZodUnion",tV.ZodDiscriminatedUnion="ZodDiscriminatedUnion",tV.ZodIntersection="ZodIntersection",tV.ZodTuple="ZodTuple",tV.ZodRecord="ZodRecord",tV.ZodMap="ZodMap",tV.ZodSet="ZodSet",tV.ZodFunction="ZodFunction",tV.ZodLazy="ZodLazy",tV.ZodLiteral="ZodLiteral",tV.ZodEnum="ZodEnum",tV.ZodEffects="ZodEffects",tV.ZodNativeEnum="ZodNativeEnum",tV.ZodOptional="ZodOptional",tV.ZodNullable="ZodNullable",tV.ZodDefault="ZodDefault",tV.ZodCatch="ZodCatch",tV.ZodPromise="ZodPromise",tV.ZodBranded="ZodBranded",tV.ZodPipeline="ZodPipeline";let eJ=(t,n={message:`Input not instance of ${t.name}`})=>eG(n=>n instanceof t,n),eQ=el.create,eX=ed.create,e0=eq.create,e1=ep.create,e2=eh.create,e3=em.create,e4=eg.create,e5=ey.create,e9=ev.create,e6=eb.create,e8=ex.create,e7=e_.create,te=eS.create,tt=eT.create,tn=ew.create,tr=ew.strictCreate,ti=eO.create,to=eI.create,ta=eC.create,tu=eM.create,ts=eR.create,tc=eE.create,tl=ej.create,tf=eN.create,td=eA.create,tp=eP.create,th=eD.create,tm=eF.create,tg=eW.create,ty=eU.create,tv=ez.create,tb=eB.create,tx=eU.createWithPreprocess,t_=eZ.create,tS=()=>eQ().optional(),tT=()=>eX().optional(),tw=()=>e2().optional();var tO=Object.freeze({__proto__:null,defaultErrorMap:L,setErrorMap:F,getErrorMap:W,makeIssue:U,EMPTY_PATH:[],addIssueToContext:z,ParseStatus:B,INVALID:V,DIRTY:$,OK:q,isAborted:K,isDirty:H,isValid:Z,isAsync:G,get util(){return Hg},get objectUtil(){return Hy},ZodParsedType:E,getParsedType:j,ZodType:X,ZodString:el,ZodNumber:ed,ZodBigInt:ep,ZodBoolean:eh,ZodDate:em,ZodSymbol:eg,ZodUndefined:ey,ZodNull:ev,ZodAny:eb,ZodUnknown:ex,ZodNever:e_,ZodVoid:eS,ZodArray:eT,ZodObject:ew,ZodUnion:eO,ZodDiscriminatedUnion:eI,ZodIntersection:eC,ZodTuple:eM,ZodRecord:eR,ZodMap:eE,ZodSet:ej,ZodFunction:eN,ZodLazy:eA,ZodLiteral:eP,ZodEnum:eD,ZodNativeEnum:eF,ZodPromise:eW,ZodEffects:eU,ZodTransformer:eU,ZodOptional:ez,ZodNullable:eB,ZodDefault:eV,ZodCatch:e$,ZodNaN:eq,BRAND:eK,ZodBranded:eH,ZodPipeline:eZ,custom:eG,Schema:X,ZodSchema:X,late:eY,get ZodFirstPartyTypeKind(){return Hb},coerce:{string:t=>el.create({...t,coerce:!0}),number:t=>ed.create({...t,coerce:!0}),boolean:t=>eh.create({...t,coerce:!0}),bigint:t=>ep.create({...t,coerce:!0}),date:t=>em.create({...t,coerce:!0})},any:e6,array:tt,bigint:e1,boolean:e2,date:e3,discriminatedUnion:to,effect:ty,enum:th,function:tf,instanceof:eJ,intersection:ta,lazy:td,literal:tp,map:tc,nan:e0,nativeEnum:tm,never:e7,null:e9,nullable:tb,number:eX,object:tn,oboolean:tw,onumber:tT,optional:tv,ostring:tS,pipeline:t_,preprocess:tx,promise:tg,record:ts,set:tl,strictObject:tr,string:eQ,symbol:e4,transformer:ty,tuple:tu,undefined:e5,union:ti,unknown:e8,void:te,NEVER:V,ZodIssueCode:N,quotelessJson:A,ZodError:P});let tk=(0,o.createContext)(void 0);function tI(){let t=(0,o.useContext)(tk);if(!t)throw Error("Missing EditorConfigContext.Provider");return t}class tC extends Error{}function tM(t){throw new tC(`Missing EditorConfig.${t}`)}let tR=tn({id:eQ(),kind:eQ(),extension:eQ(),filename:eQ(),width:eX().optional(),height:eX().optional(),last_modified:eX(),url:eQ(),alt:eQ().optional(),size:eX()}),tE=tn({total:eX(),cursor:eQ().optional(),items:tt(tR)});function tj(t,n,r,i="all",o){let a=new URLSearchParams({assetType:i,limit:"30",...o&&{cursor:o}});return(0,f.WY)(`${t}?${a.toString()}`,{headers:{repository:n},credentials:(0,f.xb)(r),okType:tE})}function tN(t){let{assetType:n}=t,r=tI(),[i,a]=(0,o.useState)(),[u,s]=(0,o.useState)([]),[c,l]=(0,o.useState)(u);r.mediaLibrary||tM("mediaLibrary");let{assetsUrl:f,repository:p}=r,h=(0,d.QT)(tj,[f,p,r.env,n,i]);return c!==h.items&&(l(h.items),s(t=>[...t,...h.items])),{media:u,limit:30,onHasReachedBottom:function(){0!==h.total&&a(h.cursor)},response:h,updateMedia:function(t){let o=[...t,...u];s([]),(0,d.VA)(tj,[f,p,r.env,n,i],{total:o.length,items:o,cursor:void 0})}}}d.Fs.registerFetcherConfig(tj,{cacheCapacity:100,revalidationStrategy:{type:"never"}});let tA=(0,o.createContext)(void 0);function tP(t){let{children:n,assetType:r="all"}=t,[i,a]=(0,o.useTransition)(),{media:u,onHasReachedBottom:s}=tN({assetType:r});return C.jsx(tA.Provider,{value:{isFetchingMedia:i,media:u,onScrollToBottom:function(){a(s)}},children:n})}function tL(){let t=(0,o.useContext)(tA);if(!t)throw Error("useMediaLibrary must be used within a MediaLibraryProvider");return t}function tD(){let{isFetchingMedia:t}=tL();return C.jsx(u.FN,{anchor:C.jsx(u.xu,{position:"absolute",justifyContent:"center",width:"100%",bottom:72}),loadingIndicator:!0,open:t,title:"Loading more media ...",seconds:1})}function tF(t){let{url:n,filename:r}=t;return C.jsx("div",{children:C.jsx(u.hM,{children:C.jsx(u.xu,{flexDirection:"column",alignItems:"center",justifyContent:"center",position:"relative",height:164,children:C.jsx(u.Ee,{src:n,alt:r,sizing:"contain"})})})})}function tW(){let{onScrollToBottom:t,media:n}=tL();return C.jsx(u.xr,{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 250px), 1fr))",gap:16,paddingBottom:16,position:"relative"},onScrollToBottom:t,treshold:500,children:null==n?void 0:n.map(t=>C.jsx(tF,{...t},t.id))})}function tU(t){let{assetType:n}=t;return C.jsx(u.SV,{renderError:()=>C.jsx(u.xu,{minHeight:"100vh",children:"Error"}),children:C.jsx(o.Suspense,{children:C.jsx(tP,{assetType:n,children:C.jsx(tz,{})})})})}function tz(){let{media:t}=tL();return C.jsxs(u.xu,{display:"grid",gridTemplateRows:"1fr 1fr",gridTemplateColumns:"1fr 292px",width:"100%",gap:16,children:[C.jsxs(u.xu,{position:"relative",display:"grid",gap:16,overflow:"hidden",gridColumn:"1",gridRow:"1 / -1",children:[C.jsx(u.xu,{width:"100%",children:C.jsxs(u.xv,{variant:"bold",children:[t.length," Medias"]})}),C.jsx(u.SV,{renderError:()=>C.jsx(u.xu,{minHeight:"100vh",children:"Error"}),children:C.jsx(o.Suspense,{children:C.jsx(tW,{})})}),C.jsx(tD,{})]}),C.jsx(u.xu,{overflow:"hidden",borderStyle:"dashed",border:{top:!0,right:!0,left:!0,bottom:!1},borderRadius:{topRight:8,topLeft:8},gridColumn:"2",gridRow:"1 / -1",children:C.jsx(u.xu,{flexDirection:"column",gap:16,overflowY:"auto",width:"100%"})})]})}var tB,tV,t$,tq,tK,tH,tZ,tG,tY,tJ,tQ,tX,t0,t1,t2,t3,t4,t5,t9,t6,t8,t7,ne,nt,nn,nr,ni,no,na,nu,ns,nc,nl={},nf={};t$={get exports(){return nf},set exports(e){nf=e}},function(t){var n="object"==typeof T?T:"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(t$.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])};tq=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)},tK=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},tH=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},tZ=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},tG=function(t,n){return function(r,i){n(r,i,t)}},tY=function(t,n,r,i,o,a){function u(t){if(void 0!==t&&"function"!=typeof t)throw TypeError("Function expected");return t}for(var s,c=i.kind,l="getter"===c?"get":"setter"===c?"set":"value",f=!n&&t?i.static?t:t.prototype:null,d=n||(f?Object.getOwnPropertyDescriptor(f,i.name):{}),p=!1,h=r.length-1;h>=0;h--){var m={};for(var g in i)m[g]="access"===g?{}:i[g];for(var g in i.access)m.access[g]=i.access[g];m.addInitializer=function(t){if(p)throw TypeError("Cannot add initializers after decoration has completed");a.push(u(t||null))};var y=(0,r[h])("accessor"===c?{get:d.get,set:d.set}:d[l],m);if("accessor"===c){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw TypeError("Object expected");(s=u(y.get))&&(d.get=s),(s=u(y.set))&&(d.set=s),(s=u(y.init))&&o.push(s)}else(s=u(y))&&("field"===c?o.push(s):d[l]=s)}f&&Object.defineProperty(f,i.name,d),p=!0},tJ=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},tQ=function(t){return"symbol"==typeof t?t:"".concat(t)},tX=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})},t0=function(t,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,n)},t1=function(t,n,r,i){return new(r||(r=Promise))(function(o,a){function u(t){try{c(i.next(t))}catch(n){a(n)}}function s(t){try{c(i.throw(t))}catch(n){a(n)}}function c(t){var n;t.done?o(t.value):((n=t.value)instanceof r?n:new r(function(t){t(n)})).then(u,s)}c((i=i.apply(t,n||[])).next())})},t2=function(t,n){var r,i,o,a,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(u=0)),u;)try{if(r=1,i&&(o=2&s[0]?i.return:s[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;switch(i=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,i=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){u=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){u.label=s[1];break}if(6===s[0]&&u.label<o[1]){u.label=o[1],o=s;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(s);break}o[2]&&u.ops.pop(),u.trys.pop();continue}s=n.call(t,u)}catch(c){s=[6,c],i=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},t3=function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||nc(n,t,r)},nc=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]},t4=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.")},t5=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},t9=function(){for(var t=[],n=0;n<arguments.length;n++)t=t.concat(t5(arguments[n]));return t},t6=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},t8=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))},t7=function(t){return this instanceof t7?(this.v=t,this):new t7(t)},ne=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 t7?Promise.resolve(r.value.v).then(c,l):f(a[0][2],r)}catch(i){f(a[0][3],i)}}function c(t){s("next",t)}function l(t){s("throw",t)}function f(t,n){t(n),a.shift(),a.length&&s(a[0][0],a[0][1])}},nt=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:t7(t[i](n)),done:!1}:o?o(n):n}:o}},nn=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 t4?t4(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)})}}},nr=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};ni=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)&&nc(n,t,i);return r(n,t),n},no=function(t){return t&&t.__esModule?t:{default:t}},na=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)},nu=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},ns=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",tq),t("__assign",tK),t("__rest",tH),t("__decorate",tZ),t("__param",tG),t("__esDecorate",tY),t("__runInitializers",tJ),t("__propKey",tQ),t("__setFunctionName",tX),t("__metadata",t0),t("__awaiter",t1),t("__generator",t2),t("__exportStar",t3),t("__createBinding",nc),t("__values",t4),t("__read",t5),t("__spread",t9),t("__spreadArrays",t6),t("__spreadArray",t8),t("__await",t7),t("__asyncGenerator",ne),t("__asyncDelegator",nt),t("__asyncValues",nn),t("__makeTemplateObject",nr),t("__importStar",ni),t("__importDefault",no),t("__classPrivateFieldGet",na),t("__classPrivateFieldSet",nu),t("__classPrivateFieldIn",ns)});var nd={};function np(t){return function(n){return function(r){return r.reduce(function(n,r){return t.alt(n,function(){return r})},n)}}}let nh=Object.freeze(Object.defineProperty({__proto__:null,altAll:np},Symbol.toStringTag,{value:"Module"})),nm=Object.freeze(Object.defineProperty({__proto__:null,altAll:function(t){return np(t)(t.zero())}},Symbol.toStringTag,{value:"Module"}));var ng=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))}}}}},ny=function(t){return function(){return{concat:function(n,r){return function(i){return t.concat(n(i),r(i))}}}}},nv=function(t){var n=ny(t);return function(){return{concat:n().concat,empty:function(){return t.empty}}}},nb=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}}},nx=function(t){var n=nb(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))}}}},n_=function(t){return function(n){return n(t)}};function nS(t){return t}function nT(t){return function(){return t}}var nw=nT(!0),nO=nT(!1),nk=nT(null),nI=nT(void 0);function nC(t,n,r,i,o,a,u,s,c){switch(arguments.length){case 1:return t;case 2:return function(){return n(t.apply(this,arguments))};case 3:return function(){return r(n(t.apply(this,arguments)))};case 4:return function(){return i(r(n(t.apply(this,arguments))))};case 5:return function(){return o(i(r(n(t.apply(this,arguments)))))};case 6:return function(){return a(o(i(r(n(t.apply(this,arguments))))))};case 7:return function(){return u(a(o(i(r(n(t.apply(this,arguments)))))))};case 8:return function(){return s(u(a(o(i(r(n(t.apply(this,arguments))))))))};case 9:return function(){return c(s(u(a(o(i(r(n(t.apply(this,arguments)))))))))}}}function nM(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t}function nR(t){return t+1}function nE(t){return t-1}function nj(t){throw Error("Called `absurd` function which should be uncallable")}function nN(t,n,r,i,o,a,u,s,c){switch(arguments.length){case 1:return t;case 2:return n(t);case 3:return r(n(t));case 4:return i(r(n(t)));case 5:return o(i(r(n(t))));case 6:return a(o(i(r(n(t)))));case 7:return u(a(o(i(r(n(t))))));case 8:return s(u(a(o(i(r(n(t)))))));case 9:return c(s(u(a(o(i(r(n(t))))))));default:for(var l=arguments[0],f=1;f<arguments.length;f++)l=arguments[f](l);return l}}var nA=function(t,n){return n},nP=function(){return{concat:function(t,n){return nC(t,n)},empty:nS}};let nL=Object.freeze(Object.defineProperty({__proto__:null,SK:nA,absurd:nj,apply:n_,constFalse:nO,constNull:nk,constTrue:nw,constUndefined:nI,constVoid:nI,constant:nT,decrement:nE,flip:function(t){return function(n,r){return t(r,n)}},flow:nC,getBooleanAlgebra:ng,getEndomorphismMonoid:nP,getMonoid:nv,getRing:nx,getSemigroup:ny,getSemiring:nb,hole:nj,identity:nS,increment:nR,not:function(t){return function(n){return!t(n)}},pipe:nN,tuple:nM,tupled:function(t){return function(n){return t.apply(void 0,n)}},unsafeCoerce:nS,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 nD=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))},nF=function(t){return"None"===t._tag},nW=function(t){return"Some"===t._tag},nU={_tag:"None"},nz=function(t){return{_tag:"Some",value:t}},nB=function(t){return"Left"===t._tag},nV=function(t){return"Right"===t._tag},n$=function(t){return{_tag:"Left",left:t}},nq=function(t){return{_tag:"Right",right:t}},nK=function(t){return[t]},nH=function(t){return t.length>0},nZ=function(t){return t[0]},nG=function(t){return t.slice(1)},nY=[],nJ={},nQ=Object.prototype.hasOwnProperty,nX=function(t){return nD([t[0]],t.slice(1),!0)};function n0(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 n1(t){return function(n){return function(r){return t.ap(t.map(r,function(t){return function(){return t}}),n)}}}function n2(t){return function(n){return function(r){return t.ap(t.map(r,function(){return function(t){return t}}),n)}}}function n3(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 n4(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 n5(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):n5(t,n-1,o)}}var n9={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 n6(t){return nQ.call(n9,t)||(n9[t]=n5(nM,t-1,[])),n9[t]}function n8(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 n5(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 n7=Object.freeze(Object.defineProperty({__proto__:null,ap:n0,apFirst:n1,apS:n3,apSecond:n2,getApplySemigroup:n4,sequenceS:function(t){return function(n){for(var r=Object.keys(n),i=r.length,o=n8(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=n6(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 re(t,n){return function(r){return function(i){return t.map(i,function(t){return n.map(t,r)})}}}function rt(t){return function(n){return function(r){return t.map(r,function(t){return t(n)})}}}function rn(t){return function(n){return function(r){return t.map(r,function(t){var r;return(r={})[n]=t,r})}}}function rr(t,n){var r=re(t,n);return{map:function(t,n){return nN(t,r(n))}}}let ri=Object.freeze(Object.defineProperty({__proto__:null,bindTo:rn,flap:rt,getFunctorComposition:rr,map:re},Symbol.toStringTag,{value:"Module"}));function ro(t){var n=n4(t);return function(r){return{concat:n(r).concat,empty:t.of(r.empty)}}}function ra(t,n){var r=rr(t,n).map,i=n0(t,n);return{map:r,of:function(r){return t.of(n.of(r))},ap:function(t,n){return nN(t,i(n))}}}let ru=Object.freeze(Object.defineProperty({__proto__:null,getApplicativeComposition:ra,getApplicativeMonoid:ro},Symbol.toStringTag,{value:"Module"}));function rs(t){return function(n){return function(r){return t.chain(r,function(r){return t.map(n(r),function(){return r})})}}}function rc(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 rl=Object.freeze(Object.defineProperty({__proto__:null,bind:rc,chainFirst:rs},Symbol.toStringTag,{value:"Module"}));function rf(t){return function(n){return function(r){return t.fromEither(nF(r)?n$(n()):nq(r.value))}}}function rd(t){return function(n,r){return function(i){return t.fromEither(n(i)?nq(i):n$(r(i)))}}}function rp(t){var n=rf(t);return function(t){var r=n(t);return function(t){return nC(t,r)}}}function rh(t,n){var r=rp(t);return function(t){var i=r(t);return function(t){return function(r){return n.chain(r,i(t))}}}}function rm(t){return function(n){return nC(n,t.fromEither)}}function rg(t,n){var r=rm(t);return function(t){return function(i){return n.chain(i,r(t))}}}function ry(t,n){return nC(rm(t),rs(n))}function rv(t,n){return function(r,i){return function(o){return n.chain(o,function(n){return t.fromEither(r(n)?nq(n):n$(i(n)))})}}}let rb=Object.freeze(Object.defineProperty({__proto__:null,chainEitherK:rg,chainFirstEitherK:ry,chainOptionK:rh,filterOrElse:rv,fromEitherK:rm,fromOption:rf,fromOptionK:rp,fromPredicate:rd},Symbol.toStringTag,{value:"Module"}));var rx=function(t){return{equals:function(n,r){return n===r||t(n,r)}}},r_=function(t){return rx(function(n,r){for(var i in t)if(!t[i].equals(n[i],r[i]))return!1;return!0})},rS=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return rx(function(n,r){return t.every(function(t,i){return t.equals(n[i],r[i])})})},rT=function(t){return function(n){return rx(function(r,i){return n.equals(t(r),t(i))})}},rw={equals:function(t,n){return t===n}},rO={equals:function(){return!0}},rk=function(){return{concat:function(t,n){return rx(function(r,i){return t.equals(r,i)&&n.equals(r,i)})}}},rI=function(){return{concat:rk().concat,empty:rO}},rC={URI:"Eq",contramap:function(t,n){return nN(t,rT(n))}},rM=rw.equals;let rR=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:rC,URI:"Eq",contramap:rT,eq:rC,eqBoolean:rw,eqDate:{equals:function(t,n){return t.valueOf()===n.valueOf()}},eqNumber:rw,eqStrict:rw,eqString:rw,fromEquals:rx,getMonoid:rI,getSemigroup:rk,getStructEq:r_,getTupleEq:rS,strictEqual:rM,struct:r_,tuple:rS},Symbol.toStringTag,{value:"Module"}));var rE=function(t){return function(n,r){return n===r||0===t(n,r)}},rj=function(t){return{equals:rE(t),compare:function(n,r){return n===r?0:t(n,r)}}},rN=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return rj(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])})},rA=function(t){return rj(function(n,r){return t.compare(r,n)})},rP=function(t){return function(n){return rj(function(r,i){return n.compare(t(r),t(i))})}},rL=function(){return{concat:function(t,n){return rj(function(r,i){var o=t.compare(r,i);return 0!==o?o:n.compare(r,i)})}}},rD=function(){return{concat:rL().concat,empty:rj(function(){return 0})}},rF={URI:"Ord",contramap:function(t,n){return nN(t,rP(n))}},rW={equals:nw,compare:nT(0)},rU=function(t){return function(n){return function(r){return r===n||0===t.compare(r,n)}}},rz=function(t){return function(n,r){return -1===t.compare(n,r)}},rB=function(t){return function(n,r){return 1===t.compare(n,r)}},rV=function(t){return function(n,r){return 1!==t.compare(n,r)}},r$=function(t){return function(n,r){return -1!==t.compare(n,r)}},rq=function(t){return function(n,r){return n===r||1>t.compare(n,r)?n:r}},rK=function(t){return function(n,r){return n===r||t.compare(n,r)>-1?n:r}},rH=function(t){var n=rq(t),r=rK(t);return function(t,i){return function(o){return r(n(o,i),t)}}},rZ=function(t){var n=rz(t),r=rB(t);return function(t,i){return function(o){return!(n(o,t)||r(o,i))}}},rG={equals:rw.equals,compare:function(t,n){return t<n?-1:t>n?1:0}},rY=nN(rG,rP(function(t){return t.valueOf()}));let rJ=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:rF,URI:"Ord",between:rZ,clamp:rH,contramap:rP,equals:rU,equalsDefault:rE,fromCompare:rj,geq:r$,getDualOrd:rA,getMonoid:rD,getSemigroup:rL,getTupleOrd:rN,gt:rB,leq:rV,lt:rz,max:rK,min:rq,ord:rF,ordBoolean:rG,ordDate:rY,ordNumber:rG,ordString:rG,reverse:rA,trivial:rW,tuple:rN},Symbol.toStringTag,{value:"Module"}));var rQ=function(t){return{concat:function(n,r){return t.concat(r,n)}}},rX=function(t){return function(n){return{concat:function(r,i){return t(r)?n.concat(r,i):i}}}},r0=function(t){return function(n){return{concat:function(r,i){return t(i)?n.concat(r,i):r}}}},r1=function(t){return function(n){return{concat:function(r,i){return n.concat(t(r),t(i))}}}},r2=function(t){return function(n){return function(r){return r.reduce(function(n,r){return t.concat(n,r)},n)}}};let r3=Object.freeze(Object.defineProperty({__proto__:null,concatAll:r2,endo:r1,filterFirst:rX,filterSecond:r0,reverse:rQ},Symbol.toStringTag,{value:"Module"}));var r4=function(t){return{concat:rq(t)}},r5=function(t){return{concat:rK(t)}},r9=function(t){return{concat:function(){return t}}},r6=function(t){return{concat:function(n,r){var i={};for(var o in t)nQ.call(t,o)&&(i[o]=t[o].concat(n[o],r[o]));return i}}},r8=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])})}}},r7=function(t){return function(n){return{concat:function(r,i){return n.concat(r,n.concat(t,i))}}}},ie=function(){return{concat:nS}},it=function(){return{concat:function(t,n){return n}}},ir=r9(void 0),ii=function(){return{concat:function(t,n){return Object.assign({},t,n)}}},io={concat:function(t,n){return t&&n}},ia={concat:function(t,n){return t||n}},iu={concat:function(t,n){return t+n}},is={concat:function(t,n){return t+n}},ic={concat:function(t,n){return t*n}};let il=Object.freeze(Object.defineProperty({__proto__:null,concatAll:r2,constant:r9,first:ie,fold:function(t){var n=r2(t);return function(t,r){return void 0===r?n(t):n(t)(r)}},getDualSemigroup:rQ,getFirstSemigroup:ie,getFunctionSemigroup:ny,getIntercalateSemigroup:r7,getJoinSemigroup:r5,getLastSemigroup:it,getMeetSemigroup:r4,getObjectSemigroup:ii,getStructSemigroup:r6,getTupleSemigroup:r8,intercalate:r7,last:it,max:r5,min:r4,reverse:rQ,semigroupAll:io,semigroupAny:ia,semigroupProduct:ic,semigroupString:iu,semigroupSum:is,semigroupVoid:ir,struct:r6,tuple:r8},Symbol.toStringTag,{value:"Module"}));var id=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))},ip=function(t,n){return t<0||t>=n.length},ih=function(t){return function(n){return id([t],n,!0)}},im=function(t){return function(n){return id(id([],n,!0),[t],!1)}},ig=function(t,n,r){if(nH(r)){var i=nX(r);return i.splice(t,0,n),i}return[n]},iy=function(t,n,r){if(r[t]===n)return r;var i=nX(r);return i[t]=n,i},iv=function(t){return function(n){if(1===n.length)return n;for(var r=[oR(n)],i=oE(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}},ib=function(t){if(nH(t)){var n=rD();return iA(t.reduce(n.concat,n.empty))}return nS},ix=function(t){var n=iv(t);return function(t){return function(r){return n(nN(r,iR(t)))}}},i_=function(t){return function(n){var r=n.length,i=Math.round(t)%r;if(ip(Math.abs(i),n)||0===i)return n;if(!(i<0))return i_(i-r)(n);var o=iV(-i)(n),a=o[0];return nN(o[1],iR(a))}},iS=function(t){return nH(t)?nz(t):nU},iT=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}},iw=function(t){return iT(function(){return t})},iO=function(t,n){return t<=n?iT(function(n){return t+n})(n-t+1):[t]},ik=function(t){return[oR(t),oE(t)]},iI=function(t){return[oN(t),oj(t)]},iC=function(t){return iS(t.slice())};function iM(t){return function(n){return n.concat(t)}}function iR(t,n){return n?t.concat(n):function(n){return n.concat(t)}}var iE=function(t){return 1===t.length?t:id([oj(t)],t.slice(0,-1).reverse(),!0)};function ij(t){return function(n){var r=n.length;if(0===r)return nY;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 iN=function(t){return function(n){for(var r={},i=0;i<n.length;i++){var o=n[i],a=t(o);nQ.call(r,a)?r[a].push(o):r[a]=[o]}return r}},iA=function(t){return function(n){return 1===n.length?n:n.slice().sort(t.compare)}},iP=function(t,n){return iL(t,function(){return n})},iL=function(t,n){return function(r){return ip(t,r)?nU:nz(iy(t,n(r[t]),r))}},iD=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},iF=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]},iW=function(t){return function(n){for(var r=[t,n[0]],i=1;i<n.length;i++)r.push(t,n[i]);return r}},iU=function(t){return function(n){var r=oE(n);return nH(r)?nN(r,iW(t),ih(oR(n))):n}},iz=function(t){return function(n){for(var r=nX(t(0,oR(n))),i=1;i<n.length;i++)r.push.apply(r,t(i,n[i]));return r}},iB=function(t){return function(n){for(var r=t(n),i=r[0],o=r[1],a=[i],u=o;nH(u);){var s=t(u),c=s[0],l=s[1];a.push(c),u=l}return a}},iV=function(t){return function(n){var r=Math.max(1,t);return r>=n.length?[n,nY]:[nN(n.slice(1,r),ih(oR(n))),n.slice(r)]}},i$=function(t){return iB(iV(t))},iq=function(t,n){return nN(t,on(n))},iK=function(t,n){return nN(t,or(n))},iH=function(t,n){return nN(t,i6(n))},iZ=function(t,n){return nN(t,i8(n))},iG=function(t,n){return nN(t,i7(n))},iY=function(t,n,r){return nN(t,oi(n,r))},iJ=function(t){var n=oo(t);return function(t,r){return nN(t,n(r))}},iQ=function(t,n,r){return nN(t,oa(n,r))},iX=function(t){var n=of(t);return function(t,r){return nN(t,n(r))}},i0=function(t,n){return nN(t,i9(n))},i1=function(t,n,r){return nN(t,ou(n,r))},i2=function(t){var n=oc(t);return function(t,r){return nN(t,n(r))}},i3=function(t,n,r){return nN(t,ol(n,r))},i4=function(t){var n=op(t);return function(t,r){return nN(t,n(r))}},i5=function(t){return function(n){return nN(n,iM(t()))}},i9=i5,i6=function(t){return i8(function(n){return nN(t,on(n))})},i8=function(t){return iz(function(n,r){return t(r)})},i7=function(t){return function(n){for(var r=oE(n),i=[t(n)];nH(r);)i.push(t(r)),r=oE(r);return i}},oe=i7(nS),ot=i8(nS),on=function(t){return or(function(n,r){return t(r)})},or=function(t){return function(n){for(var r=[t(0,oR(n))],i=1;i<n.length;i++)r.push(t(i,n[i]));return r}},oi=function(t,n){return ou(t,function(t,r,i){return n(r,i)})},oo=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]))}}},oa=function(t,n){return ol(t,function(t,r,i){return n(r,i)})},ou=function(t,n){return function(r){return r.reduce(function(t,r,i){return n(i,t,r)},t)}},oc=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]))}}},ol=function(t,n){return function(r){return r.reduceRight(function(t,r,i){return n(i,r,t)},t)}},of=function(t){var n=op(t);return function(t){return n(function(n,r){return t(r)})}},od=function(t){return op(t)(nA)},op=function(t){return function(n){return function(r){for(var i=t.map(n(0,oR(r)),nK),o=1;o<r.length;o++)i=t.ap(t.map(i,function(t){return function(n){return nN(t,im(n))}}),n(o,r[o]));return i}}},oh="ReadonlyNonEmptyArray",om=function(t){return{show:function(n){return"[".concat(n.map(t.show).join(", "),"]")}}},og=function(){return{concat:iR}},oy=function(t){return rx(function(n,r){return n.length===r.length&&n.every(function(n,i){return t.equals(n,r[i])})})},ov=function(t){var n=ix(t);return{concat:function(t,r){return n(r)(t)}}},ob={URI:oh,map:iq},ox=rt(ob),o_={URI:oh,map:iq,ap:iH},oS=n1(o_),oT=n2(o_),ow={URI:oh,map:iq,ap:iH,chain:iZ},oO=rs(ow),ok=nK(nJ),oI=rn(ob),oC=rc(ow),oM=n3(o_),oR=nZ,oE=nG,oj=function(t){return t[t.length-1]},oN=function(t){return t.slice(0,-1)},oA=function(t){var n=r4(t);return function(t){return t.reduce(n.concat)}},oP=function(t){var n=r5(t);return function(t){return t.reduce(n.concat)}},oL=function(t){return function(n){return n.reduce(t.concat)}},oD=function(t){return function(n){return t(oR(n),oE(n))}},oF=function(t){return function(n){return t(oN(n),oj(n))}},oW=function(t){return function(n){return id([t(oR(n))],oE(n),!0)}},oU=function(t){return oW(function(){return t})},oz=function(t){return function(n){return nN(oN(n),im(t(oj(n))))}},oB=function(t){return oz(function(){return t})},oV=function(t){var n=oL(t);return function(t){return nC(iU(t),n)}},o$=function(t){return function(n){return iS(n.filter(function(n,r){return t(r,n)}))}};function oq(t,n){return void 0===n?ih(t):nN(n,ih(t))}var oK=function(t,n){return nN(t,iR([n]))},oH=function(t,n){return function(r){return t<0||t>r.length?nU:nz(ig(t,n,r))}};let oZ=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:oh,map:iq,alt:i0},Applicative:{URI:oh,map:iq,ap:iH,of:nK},Apply:o_,Chain:ow,Comonad:{URI:oh,map:iq,extend:iG,extract:nZ},Do:ok,Foldable:{URI:oh,reduce:iY,foldMap:iJ,reduceRight:iQ},FoldableWithIndex:{URI:oh,reduce:iY,foldMap:iJ,reduceRight:iQ,reduceWithIndex:i1,foldMapWithIndex:i2,reduceRightWithIndex:i3},Functor:ob,FunctorWithIndex:{URI:oh,map:iq,mapWithIndex:iK},Monad:{URI:oh,map:iq,ap:iH,of:nK,chain:iZ},Pointed:{URI:oh,of:nK},Traversable:{URI:oh,map:iq,reduce:iY,foldMap:iJ,reduceRight:iQ,traverse:iX,sequence:od},TraversableWithIndex:{URI:oh,map:iq,mapWithIndex:iK,reduce:iY,foldMap:iJ,reduceRight:iQ,traverse:iX,sequence:od,reduceWithIndex:i1,foldMapWithIndex:i2,reduceRightWithIndex:i3,traverseWithIndex:i4},URI:oh,alt:i9,altW:i5,ap:i6,apFirst:oS,apS:oM,apSecond:oT,append:im,appendW:im,bind:oC,bindTo:oI,chain:i8,chainFirst:oO,chainWithIndex:iz,chop:iB,chunksOf:i$,concat:iR,concatAll:oL,concatW:iM,cons:oq,duplicate:oe,empty:nY,extend:i7,extract:nZ,filter:function(t){return o$(function(n,r){return t(r)})},filterWithIndex:o$,flap:ox,flatten:ot,fold:oL,foldMap:oo,foldMapWithIndex:oc,fromArray:iC,fromReadonlyArray:iS,getEq:oy,getSemigroup:og,getShow:om,getUnionSemigroup:ov,group:ij,groupBy:iN,groupSort:function(t){var n=iA(t),r=ij(t);return function(t){return nH(t)?r(n(t)):nY}},head:oR,init:oN,insertAt:oH,intercalate:oV,intersperse:iU,isNonEmpty:nH,isOutOfBound:ip,last:oj,makeBy:iT,map:on,mapWithIndex:or,matchLeft:oD,matchRight:oF,max:oP,min:oA,modifyAt:iL,modifyHead:oW,modifyLast:oz,of:nK,prepend:ih,prependAll:iW,prependToAll:iW,prependW:ih,range:iO,readonlyNonEmptyArray:{URI:oh,of:nK,map:iq,mapWithIndex:iK,ap:iH,chain:iZ,extend:iG,extract:nZ,reduce:iY,foldMap:iJ,reduceRight:iQ,traverse:iX,sequence:od,reduceWithIndex:i1,foldMapWithIndex:i2,reduceRightWithIndex:i3,traverseWithIndex:i4,alt:i0},reduce:oi,reduceRight:oa,reduceRightWithIndex:ol,reduceWithIndex:ou,replicate:iw,reverse:iE,rotate:i_,sequence:od,snoc:oK,sort:iA,sortBy:ib,splitAt:iV,tail:oE,traverse:of,traverseWithIndex:op,unappend:iI,uncons:ik,union:ix,uniq:iv,unprepend:ik,unsafeInsertAt:ig,unsafeUpdateAt:iy,unsnoc:iI,unzip:iF,updateAt:iP,updateHead:oU,updateLast:oB,zip:function t(n,r){return void 0===r?function(r){return t(r,n)}:iD(n,r,function(t,n){return[t,n]})},zipWith:iD},Symbol.toStringTag,{value:"Module"}));var oG=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))},oY=function(t){return t.length>0},oJ=function(t,n){return t<0||t>=n.length},oQ=function(t){return function(n){return oG([t],n,!0)}},oX=function(t){return function(n){return oG(oG([],n,!0),[t],!1)}},o0=function(t,n,r){if(oY(r)){var i=o9(r);return i.splice(t,0,n),i}return[n]},o1=function(t,n,r){var i=o9(r);return i[t]=n,i},o2=function(t){return function(n){if(1===n.length)return ad(n);for(var r=[un(n)],i=ur(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}},o3=function(t){if(oY(t)){var n=rD();return as(t.reduce(n.concat,n.empty))}return ad},o4=function(t){var n=o2(t);return function(t){return function(r){return n(nN(r,ai(t)))}}},o5=function(t){return function(n){var r=n.length,i=Math.round(t)%r;if(oJ(Math.abs(i),n)||0===i)return ad(n);if(!(i<0))return o5(i-r)(n);var o=ax(-i)(n),a=o[0];return nN(o[1],ai(a))}},o9=nX,o6=function(t){return oY(t)?nz(t):nU},o8=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}},o7=function(t){return o8(function(){return t})},ae=function(t,n){return t<=n?o8(function(n){return t+n})(n-t+1):[t]},at=function(t){return[un(t),ur(t)]},an=function(t){return[uo(t),ui(t)]};function ar(t){return function(n){return n.concat(t)}}function ai(t,n){return n?t.concat(n):function(n){return n.concat(t)}}var ao=function(t){return oG([ui(t)],t.slice(0,-1).reverse(),!0)};function aa(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 au=function(t){return function(n){for(var r={},i=0;i<n.length;i++){var o=n[i],a=t(o);nQ.call(r,a)?r[a].push(o):r[a]=[o]}return r}},as=function(t){return function(n){return n.slice().sort(t.compare)}},ac=function(t,n){return function(r){return t<0||t>r.length?nU:nz(o0(t,n,r))}},al=function(t,n){return af(t,function(){return n})},af=function(t,n){return function(r){return oJ(t,r)?nU:nz(o1(t,n(r[t]),r))}},ad=o9,ap=function(t){return[t]},ah=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},am=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]},ag=function(t){return function(n){for(var r=[t,n[0]],i=1;i<n.length;i++)r.push(t,n[i]);return r}},ay=function(t){return function(n){var r=ur(n);return oY(r)?nN(r,ag(t),oQ(un(n))):ad(n)}},av=function(t){return function(n){for(var r=o9(t(0,un(n))),i=1;i<n.length;i++)r.push.apply(r,t(i,n[i]));return r}},ab=function(t){return function(n){for(var r=t(n),i=r[0],o=r[1],a=[i],u=o;oY(u);){var s=t(u),c=s[0],l=s[1];a.push(c),u=l}return a}},ax=function(t){return function(n){var r=Math.max(1,t);return r>=n.length?[ad(n),[]]:[nN(n.slice(1,r),oQ(un(n))),n.slice(r)]}},a_=function(t){return ab(ax(t))},aS=function(t,n){return nN(t,aV(n))},aT=function(t,n){return nN(t,a$(n))},aw=function(t,n){return nN(t,aF(n))},aO=function(t,n){return nN(t,aW(n))},ak=function(t,n){return nN(t,aU(n))},aI=function(t,n,r){return nN(t,aq(n,r))},aC=function(t){var n=oo(t);return function(t,r){return nN(t,n(r))}},aM=function(t,n,r){return nN(t,aH(n,r))},aR=function(t){var n=aG(t);return function(t,r){return nN(t,n(r))}},aE=function(t,n){return nN(t,aD(n))},aj=function(t,n,r){return nN(t,aK(n,r))},aN=function(t){var n=oc(t);return function(t,r){return nN(t,n(r))}},aA=function(t,n,r){return nN(t,aZ(n,r))},aP=function(t){var n=aJ(t);return function(t,r){return nN(t,n(r))}},aL=function(t){return function(n){return nN(n,ar(t()))}},aD=aL,aF=function(t){return aW(function(n){return nN(t,aV(n))})},aW=function(t){return av(function(n,r){return t(r)})},aU=function(t){return function(n){for(var r=ur(n),i=[t(n)];oY(r);)i.push(t(r)),r=ur(r);return i}},az=aU(nS),aB=aW(nS),aV=function(t){return a$(function(n,r){return t(r)})},a$=function(t){return function(n){for(var r=[t(0,un(n))],i=1;i<n.length;i++)r.push(t(i,n[i]));return r}},aq=oi,aK=ou,aH=oa,aZ=ol,aG=function(t){var n=aJ(t);return function(t){return n(function(n,r){return t(r)})}},aY=function(t){return aJ(t)(function(t,n){return n})},aJ=function(t){return function(n){return function(r){for(var i=t.map(n(0,un(r)),ap),o=1;o<r.length;o++)i=t.ap(t.map(i,function(t){return function(n){return nN(t,oX(n))}}),n(o,r[o]));return i}}},aQ="NonEmptyArray",aX=function(){return{concat:ai}},a0=function(t){var n=o4(t);return{concat:function(t,r){return n(r)(t)}}},a1={URI:aQ,map:aS},a2=rt(a1),a3={URI:aQ,map:aS,ap:aw},a4=n1(a3),a5=n2(a3),a9={URI:aQ,map:aS,ap:aw,chain:aO},a6=rs(a9),a8=ap(nJ),a7=rn(a1),ue=rc(a9),ut=n3(a3),un=oR,ur=function(t){return t.slice(1)},ui=oj,uo=function(t){return t.slice(0,-1)},ua=function(t){return function(n){return n.reduce(t.concat)}},uu=function(t){return function(n){return t(un(n),ur(n))}},us=function(t){return function(n){return t(uo(n),ui(n))}},uc=function(t){return function(n){return oG([t(un(n))],ur(n),!0)}},ul=function(t){return uc(function(){return t})},uf=function(t){return function(n){return nN(uo(n),oX(t(ui(n))))}},ud=function(t){return uf(function(){return t})},up=function(t){return function(n){return o6(n.filter(function(n,r){return t(r,n)}))}};function uh(t,n){return void 0===n?oQ(t):nN(n,oQ(t))}var um=function(t,n){return nN(t,oX(n))};let ug=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:aQ,map:aS,alt:aE},Applicative:{URI:aQ,map:aS,ap:aw,of:ap},Apply:a3,Chain:a9,Comonad:{URI:aQ,map:aS,extend:ak,extract:oR},Do:a8,Foldable:{URI:aQ,reduce:aI,foldMap:aC,reduceRight:aM},FoldableWithIndex:{URI:aQ,reduce:aI,foldMap:aC,reduceRight:aM,reduceWithIndex:aj,foldMapWithIndex:aN,reduceRightWithIndex:aA},Functor:a1,FunctorWithIndex:{URI:aQ,map:aS,mapWithIndex:aT},Monad:{URI:aQ,map:aS,ap:aw,of:ap,chain:aO},Pointed:{URI:aQ,of:ap},Traversable:{URI:aQ,map:aS,reduce:aI,foldMap:aC,reduceRight:aM,traverse:aR,sequence:aY},TraversableWithIndex:{URI:aQ,map:aS,mapWithIndex:aT,reduce:aI,foldMap:aC,reduceRight:aM,traverse:aR,sequence:aY,reduceWithIndex:aj,foldMapWithIndex:aN,reduceRightWithIndex:aA,traverseWithIndex:aP},URI:aQ,alt:aD,altW:aL,ap:aF,apFirst:a4,apS:ut,apSecond:a5,append:oX,appendW:oX,bind:ue,bindTo:a7,chain:aW,chainFirst:a6,chainWithIndex:av,chop:ab,chunksOf:a_,concat:ai,concatAll:ua,concatW:ar,cons:uh,copy:ad,duplicate:az,extend:aU,extract:oR,filter:function(t){return up(function(n,r){return t(r)})},filterWithIndex:up,flap:a2,flatten:aB,fold:oL,foldMap:oo,foldMapWithIndex:oc,fromArray:o6,fromReadonlyNonEmptyArray:o9,getEq:oy,getSemigroup:aX,getShow:om,getUnionSemigroup:a0,group:aa,groupBy:au,groupSort:function(t){var n=as(t),r=aa(t);return function(t){return oY(t)?r(n(t)):[]}},head:un,init:uo,insertAt:ac,intercalate:oV,intersperse:ay,isNonEmpty:oY,isOutOfBound:oJ,last:ui,makeBy:o8,map:aV,mapWithIndex:a$,matchLeft:uu,matchRight:us,max:oP,min:oA,modifyAt:af,modifyHead:uc,modifyLast:uf,nonEmptyArray:{URI:aQ,of:ap,map:aS,mapWithIndex:aT,ap:aw,chain:aO,extend:ak,extract:oR,reduce:aI,foldMap:aC,reduceRight:aM,traverse:aR,sequence:aY,reduceWithIndex:aj,foldMapWithIndex:aN,reduceRightWithIndex:aA,traverseWithIndex:aP,alt:aE},of:ap,prepend:oQ,prependAll:ag,prependToAll:ag,prependW:oQ,range:ae,reduce:aq,reduceRight:aH,reduceRightWithIndex:aZ,reduceWithIndex:aK,replicate:o7,reverse:ao,rotate:o5,sequence:aY,snoc:um,sort:as,sortBy:o3,splitAt:ax,tail:ur,traverse:aG,traverseWithIndex:aJ,unappend:an,uncons:at,union:o4,uniq:o2,unprepend:at,unsafeInsertAt:o0,unsafeUpdateAt:o1,unsnoc:an,unzip:am,updateAt:al,updateHead:ul,updateLast:ud,zip:function t(n,r){return void 0===r?function(r){return t(r,n)}:ah(n,r,function(t,n){return[t,n]})},zipWith:ah},Symbol.toStringTag,{value:"Module"}));var uy=function(t){return"number"==typeof t},uv={equals:function(t,n){return t===n}},ub={equals:uv.equals,compare:function(t,n){return t<n?-1:t>n?1:0}},ux={equals:uv.equals,compare:ub.compare,top:1/0,bottom:-1/0},u_={concat:function(t,n){return t-n}},uS={concat:function(t,n){return t+n}},uT={concat:function(t,n){return t*n}},uw={concat:uS.concat,empty:0},uO={concat:uT.concat,empty:1},uk={add:uS.concat,zero:0,mul:uT.concat,one:1,sub:u_.concat,degree:function(t){return 1},div:function(t,n){return t/n},mod:function(t,n){return t%n}};let uI=Object.freeze(Object.defineProperty({__proto__:null,Bounded:ux,Eq:uv,Field:uk,MagmaSub:u_,MonoidProduct:uO,MonoidSum:uw,Ord:ub,SemigroupProduct:uT,SemigroupSum:uS,Show:{show:function(t){return JSON.stringify(t)}},isNumber:uy},Symbol.toStringTag,{value:"Module"}));var uC=function(t,n){return{left:t,right:n}},uM=function(t,n){return nN(t,uj(n))},uR=function(t,n,r){return nN(t,uN(n,r))},uE=function(t){return function(n){return uC(uD(n),t(uF(n)))}},uj=function(t){return function(n){return uC(t(uD(n)),uF(n))}},uN=function(t,n){return function(r){return uC(t(uD(r)),n(uF(r)))}},uA="Separated",uP={URI:uA,map:function(t,n){return nN(t,uE(n))}},uL=rt(uP),uD=function(t){return t.left},uF=function(t){return t.right};let uW=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:{URI:uA,mapLeft:uM,bimap:uR},Functor:uP,URI:uA,bimap:uN,flap:uL,left:uD,map:uE,mapLeft:uj,right:uF,separated:uC},Symbol.toStringTag,{value:"Module"}));function uU(t,n){return function(r){var i=t.traverse(r);return function(t,o){return r.map(i(t,o),n.separate)}}}function uz(t,n){return function(r){var i=t.traverse(r);return function(t,o){return r.map(i(t,o),n.compact)}}}function uB(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?nz(r):nU})})}}}}let uV=Object.freeze(Object.defineProperty({__proto__:null,filterE:uB,wiltDefault:uU,witherDefault:uz},Symbol.toStringTag,{value:"Module"}));function u$(t,n){return function(r){return r?n.of(void 0):t.zero()}}let uq=Object.freeze(Object.defineProperty({__proto__:null,guard:u$},Symbol.toStringTag,{value:"Module"}));var uK=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))},uH=function(t){return 0===t.length},uZ=function(t,n){return t<=0?c6:iT(n)(t)},uG=function(t,n){return uZ(t,function(){return n})},uY=function(t){return nF(t)?c6:[t.value]},uJ=function(t){return nB(t)?c6:[t.right]},uQ=function(t,n){return function(r){return nH(r)?n(r):t()}},uX=function(t,n){return function(r){return nH(r)?n(oR(r),oE(r)):t()}},u0=function(t,n){return function(r){return nH(r)?n(oN(r),oj(r)):t()}},u1=function(t){return function(n){if(uH(n))return c6;for(var r=[],i=0;i<n.length;i++)r.push.apply(r,t(i,n[i]));return r}},u2=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}},u3=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}},u4=function(t){return t.length};function u5(t,n){return void 0===n?function(n){return u5(t,n)}:ip(t,n)?nU:nz(n[t])}var u9=function(t){return nH(t)?nz(oR(t)):nU},u6=function(t){return nH(t)?nz(oj(t)):nU},u8=function(t){return nH(t)?nz(oE(t)):nU},u7=function(t){return nH(t)?nz(oN(t)):nU},se=function(t){return function(n){return ip(t,n)?n:0===t?c6:n.slice(0,t)}},st=function(t){return function(n){return ip(t,n)?n:0===t?c6:n.slice(-t)}},sn=function(t,n){for(var r=t.length,i=0;i<r&&n(t[i]);i++);return i},sr=function(t){return function(n){return t<=0||uH(n)?n:t>=n.length?c6:n.slice(t,n.length)}},si=function(t){return function(n){return t<=0||uH(n)?n:t>=n.length?c6:n.slice(0,n.length-t)}},so=function(t){return function(n){for(var r=0;r<n.length;r++)if(t(n[r]))return nz(r);return nU}};function sa(t){return function(n){for(var r=0;r<n.length;r++)if(t(n[r]))return nz(n[r]);return nU}}var su=function(t){return function(n){for(var r=0;r<n.length;r++){var i=t(n[r]);if(nW(i))return i}return nU}};function ss(t){return function(n){for(var r=n.length-1;r>=0;r--)if(t(n[r]))return nz(n[r]);return nU}}var sc=function(t){return function(n){for(var r=n.length-1;r>=0;r--){var i=t(n[r]);if(nW(i))return i}return nU}},sl=function(t){return function(n){for(var r=n.length-1;r>=0;r--)if(t(n[r]))return nz(r);return nU}},sf=function(t,n){return function(r){return t<0||t>r.length?nU:nz(ig(t,n,r))}},sd=function(t,n){return sh(t,function(){return n})},sp=function(t){return function(n){return ip(t,n)?nU:nz(c4(t,n))}},sh=function(t,n){return function(r){return ip(t,r)?nU:nz(c3(t,n(r[t]),r))}},sm=function(t){return t.length<=1?t:t.slice().reverse()},sg=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r];"Right"===i._tag&&n.push(i.right)}return n},sy=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r];"Left"===i._tag&&n.push(i.left)}return n},sv=function(t){return function(n){return n.length<=1?n:n.slice().sort(t.compare)}},sb=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},sx=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]},s_=function(t){var n=iW(t);return function(t){return nH(t)?n(t):t}},sS=function(t){var n=iU(t);return function(t){return nH(t)?n(t):t}},sT=function(t){var n=i_(t);return function(t){return nH(t)?n(t):t}};function sw(t){return function(n,r){if(void 0===r){var i,o=sw(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 sO=function(t){var n=iv(t);return function(t){return nH(t)?n(t):t}},sk=function(t){var n=ib(t);return function(t){return nH(t)?n(t):t}},sI=function(t){var n=iB(t);return function(t){return nH(t)?n(t):c6}},sC=function(t){return function(n){return t>=1&&nH(n)?iV(t)(n):uH(n)?[n,c6]:[c6,n]}},sM=function(t){var n=i$(t);return function(t){return nH(t)?n(t):c6}},sR=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return uY(t.apply(void 0,n))}},sE=function(t){return function(n){return uH(n)?t:uH(t)?n:n.concat(t)}};function sj(t){var n=ix(t);return function(r,i){if(void 0===i){var o=sj(t);return function(t){return o(t,r)}}return nH(r)&&nH(i)?n(i)(r):nH(r)?r:i}}function sN(t){var n=sw(t);return function(r,i){if(void 0===i){var o=sN(t);return function(t){return o(t,r)}}return r.filter(function(t){return n(t,i)})}}function sA(t){var n=sw(t);return function(r,i){if(void 0===i){var o=sA(t);return function(t){return o(t,r)}}return r.filter(function(t){return!n(t,i)})}}var sP=function(t,n){return nN(t,ct(n))},sL=function(t,n){return nN(t,cn(n))},sD=function(t,n){return nN(t,s8(n))},sF=function(t,n){return nN(t,s7(n))},sW=function(t,n){return nN(t,ci(n))},sU=function(t,n){return nN(t,ca(n))},sz=function(t,n){return nN(t,cs(n))},sB=function(t,n){return nN(t,cl(n))},sV=function(t,n){return nN(t,cc(n))},s$=function(t,n){return nN(t,cf(n))},sq=function(t,n){return nN(t,s6(n))},sK=function(t,n,r){return nN(t,cg(n,r))},sH=function(t){var n=cy(t);return function(t,r){return nN(t,n(r))}},sZ=function(t,n,r){return nN(t,cb(n,r))},sG=function(t,n,r){return nN(t,cv(n,r))},sY=function(t){var n=cm(t);return function(t,r){return nN(t,n(r))}},sJ=function(t,n,r){return nN(t,cx(n,r))},sQ=function(t,n){return nN(t,co(n))},sX=function(t,n){return nN(t,cd(n))},s0=function(t,n){return nN(t,cp(n))},s1=function(t){var n=c_(t);return function(t,r){return nN(t,n(r))}},s2=function(t){var n=cT(t);return function(t,r){return nN(t,n(r))}},s3=function(t,n){return nN(t,cG(n))},s4=function(t,n){return nN(t,cY(n))},s5=function(){return c6},s9=function(t){return function(n){return n.concat(t())}},s6=s9,s8=function(t){return s7(function(n){return nN(t,ct(n))})},s7=function(t){return function(n){return nN(n,u1(function(n,r){return t(r)}))}},ce=s7(nS),ct=function(t){return function(n){return n.map(function(n){return t(n)})}},cn=function(t){return function(n){return n.map(function(n,r){return t(r,n)})}},cr=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 uC(n,r)},ci=function(t){return function(n){return n.filter(t)}},co=function(t){return function(n){for(var r=[],i=0;i<n.length;i++){var o=t(i,n[i]);nW(o)&&r.push(o.value)}return r}},ca=function(t){return co(function(n,r){return t(r)})},cu=ca(nS),cs=function(t){return cc(function(n,r){return t(r)})},cc=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 uC(r,i)}},cl=function(t){return cf(function(n,r){return t(r)})},cf=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 uC(r,i)}},cd=function(t){return function(n){return n.filter(function(n,r){return t(r,n)})}},cp=function(t){return function(n){return n.map(function(r,i){return t(n.slice(i))})}},ch=cp(nS),cm=function(t){return function(n){return function(r){return r.reduce(function(r,i,o){return t.concat(r,n(o,i))},t.empty)}}},cg=function(t,n){return cv(t,function(t,r,i){return n(r,i)})},cy=function(t){var n=cm(t);return function(t){return n(function(n,r){return t(r)})}},cv=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}},cb=function(t,n){return cx(t,function(t,r,i){return n(r,i)})},cx=function(t,n){return function(r){return r.reduceRight(function(t,r,i){return n(i,r,t)},t)}},c_=function(t){var n=cT(t);return function(t){return n(function(n,r){return t(r)})}},cS=function(t){return function(n){return sK(n,t.of(s5()),function(n,r){return t.ap(t.map(n,function(t){return function(n){return nN(t,im(n))}}),r)})}},cT=function(t){return function(n){return cv(t.of(s5()),function(r,i,o){return t.ap(t.map(i,function(t){return function(n){return nN(t,im(n))}}),n(r,o))})}},cw=function(t){var n=cJ(t);return function(t){return function(r){return n(r,t)}}},cO=function(t){var n=cQ(t);return function(t){return function(r){return n(r,t)}}},ck=function(t,n){for(var r=[],i=t;;){var o=n(i);if(nW(o)){var a=o.value,u=a[0],s=a[1];r.push(u),i=s}else break}return r},cI="ReadonlyArray",cC=function(t){return{show:function(n){return"[".concat(n.map(t.show).join(", "),"]")}}},cM=function(){return{concat:function(t,n){return uH(t)?n:uH(n)?t:t.concat(n)}}},cR=function(){return{concat:cM().concat,empty:c6}},cE=function(t){return rx(function(n,r){return n.length===r.length&&n.every(function(n,i){return t.equals(n,r[i])})})},cj=function(t){return rj(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 ub.compare(i,o)})},cN=function(t){var n=sj(t);return{concat:function(t,r){return n(r)(t)}}},cA=function(t){return{concat:cN(t).concat,empty:c6}},cP=function(t){var n=sN(t);return{concat:function(t,r){return n(r)(t)}}},cL=function(t){var n=sA(t);return{concat:function(t,r){return n(r)(t)}}},cD={URI:cI,map:sP},cF=rt(cD),cW={URI:cI,of:nK},cU={URI:cI,map:sP,ap:sD},cz=n1(cU),cB=n2(cU),cV={URI:cI,map:sP,ap:sD,chain:sF},c$=rs(cV),cq={URI:cI,zero:s5},cK=u$(cq,cW),cH={URI:cI,compact:cu,separate:cr},cZ={URI:cI,map:sP,reduce:sK,foldMap:sH,reduceRight:sZ,traverse:s1,sequence:cS},cG=function(t){return function(n){for(var r=uK([],t(n),!0),i=[];r.length>0;){var o=r.shift();nB(o)?r.unshift.apply(r,t(o.left)):i.push(o.right)}return i}},cY=function(t){return function(n){var r=t(n),i=[],o=[];function a(n){nB(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}},cJ=uz(cZ,cH),cQ=uU(cZ,cH),cX={URI:cI,map:sP,compact:cu,separate:cr,filter:sW,filterMap:sU,partition:sz,partitionMap:sB,reduce:sK,foldMap:sH,reduceRight:sZ,traverse:s1,sequence:cS,wither:cJ,wilt:cQ},c0=uB(cX),c1={URI:cI,fromEither:uJ},c2=rm(c1),c3=function(t,n,r){return nH(r)?iy(t,n,r):r},c4=function(t,n){var r=n.slice();return r.splice(t,1),r},c5=function(t){return t.slice()},c9=function(t){return uH(t)?c6:t.slice()},c6=nY;function c8(t){return function(n){return n.every(t)}}var c7=function(t){return function(n){return n.some(t)}},le=function(t){var n=oV(t);return function(r){return uQ(function(){return t.empty},n(r))}},lt=nK(nJ),ln=rn(cD),lr=rc(cV),li=n3(cU);let lo=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:cI,map:sP,alt:sq},Alternative:{URI:cI,map:sP,ap:sD,of:nK,alt:sq,zero:s5},Applicative:{URI:cI,map:sP,ap:sD,of:nK},Apply:cU,Chain:cV,ChainRecBreadthFirst:{URI:cI,map:sP,ap:sD,chain:sF,chainRec:s4},ChainRecDepthFirst:{URI:cI,map:sP,ap:sD,chain:sF,chainRec:s3},Compactable:cH,Do:lt,Extend:{URI:cI,map:sP,extend:s0},Filterable:{URI:cI,map:sP,compact:cu,separate:cr,filter:sW,filterMap:sU,partition:sz,partitionMap:sB},FilterableWithIndex:{URI:cI,map:sP,mapWithIndex:sL,compact:cu,separate:cr,filter:sW,filterMap:sU,partition:sz,partitionMap:sB,partitionMapWithIndex:s$,partitionWithIndex:sV,filterMapWithIndex:sQ,filterWithIndex:sX},Foldable:{URI:cI,reduce:sK,foldMap:sH,reduceRight:sZ},FoldableWithIndex:{URI:cI,reduce:sK,foldMap:sH,reduceRight:sZ,reduceWithIndex:sG,foldMapWithIndex:sY,reduceRightWithIndex:sJ},FromEither:c1,Functor:cD,FunctorWithIndex:{URI:cI,map:sP,mapWithIndex:sL},Monad:{URI:cI,map:sP,ap:sD,of:nK,chain:sF},Pointed:cW,Traversable:cZ,TraversableWithIndex:{URI:cI,map:sP,mapWithIndex:sL,reduce:sK,foldMap:sH,reduceRight:sZ,reduceWithIndex:sG,foldMapWithIndex:sY,reduceRightWithIndex:sJ,traverse:s1,sequence:cS,traverseWithIndex:s2},URI:cI,Unfoldable:{URI:cI,unfold:ck},Witherable:cX,Zero:cq,_chainRecBreadthFirst:s4,_chainRecDepthFirst:s3,alt:s6,altW:s9,ap:s8,apFirst:cz,apS:li,apSecond:cB,append:im,appendW:im,bind:lr,bindTo:ln,chain:s7,chainFirst:c$,chainRecBreadthFirst:cY,chainRecDepthFirst:cG,chainWithIndex:u1,chop:sI,chunksOf:sM,compact:cu,comprehension:function(t,n,r){void 0===r&&(r=function(){return!0});var i=function(t,o){return nH(o)?nN(oR(o),s7(function(n){return i(nN(t,im(n)),oE(o))})):r.apply(void 0,t)?[n.apply(void 0,t)]:c6};return i(c6,t)},concat:sE,concatW:sE,cons:oq,deleteAt:sp,difference:sA,dropLeft:sr,dropLeftWhile:function(t){return function(n){var r=sn(n,t);return 0===r?n:r===n.length?c6:n.slice(r)}},dropRight:si,duplicate:ch,elem:sw,empty:c6,every:c8,exists:c7,extend:cp,filter:ci,filterE:c0,filterMap:ca,filterMapWithIndex:co,filterWithIndex:cd,findFirst:sa,findFirstMap:su,findIndex:so,findLast:ss,findLastIndex:sl,findLastMap:sc,flap:cF,flatten:ce,foldLeft:uX,foldMap:cy,foldMapWithIndex:cm,foldRight:u0,fromArray:c9,fromEither:uJ,fromEitherK:c2,fromOption:uY,fromOptionK:sR,fromPredicate:function(t){return function(n){return t(n)?[n]:c6}},getDifferenceMagma:cL,getEq:cE,getIntersectionSemigroup:cP,getMonoid:cR,getOrd:cj,getSemigroup:cM,getShow:cC,getUnionMonoid:cA,getUnionSemigroup:cN,guard:cK,head:u9,init:u7,insertAt:sf,intercalate:le,intersection:sN,intersperse:sS,isEmpty:uH,isNonEmpty:nH,isOutOfBound:ip,last:u6,lefts:sy,lookup:u5,makeBy:uZ,map:ct,mapWithIndex:cn,match:uQ,matchLeft:uX,matchLeftW:uX,matchRight:u0,matchRightW:u0,matchW:uQ,modifyAt:sh,of:nK,partition:cs,partitionMap:cl,partitionMapWithIndex:cf,partitionWithIndex:cc,prepend:ih,prependAll:s_,prependToAll:s_,prependW:ih,range:iO,readonlyArray:{URI:cI,compact:cu,separate:cr,map:sP,ap:sD,of:nK,chain:sF,filter:sW,filterMap:sU,partition:sz,partitionMap:sB,mapWithIndex:sL,partitionMapWithIndex:s$,partitionWithIndex:sV,filterMapWithIndex:sQ,filterWithIndex:sX,alt:sq,zero:s5,unfold:ck,reduce:sK,foldMap:sH,reduceRight:sZ,traverse:s1,sequence:cS,reduceWithIndex:sG,foldMapWithIndex:sY,reduceRightWithIndex:sJ,traverseWithIndex:s2,extend:s0,wither:cJ,wilt:cQ},reduce:cg,reduceRight:cb,reduceRightWithIndex:cx,reduceWithIndex:cv,replicate:uG,reverse:sm,rights:sg,rotate:sT,scanLeft:u2,scanRight:u3,separate:cr,sequence:cS,size:u4,snoc:oK,some:c7,sort:sv,sortBy:sk,spanLeft:function(t){return function(n){var r,i=sC(sn(n,t))(n);return{init:i[0],rest:i[1]}}},splitAt:sC,tail:u8,takeLeft:se,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?c6:r}},takeRight:st,toArray:c5,traverse:c_,traverseWithIndex:cT,unfold:ck,union:sj,uniq:sO,unsafeDeleteAt:c4,unsafeInsertAt:ig,unsafeUpdateAt:c3,unzip:sx,updateAt:sd,wilt:cO,wither:cw,zero:s5,zip:function t(n,r){return void 0===r?function(r){return t(r,n)}:sb(n,r,function(t,n){return[t,n]})},zipWith:sb},Symbol.toStringTag,{value:"Module"}));var la=function(t){return 0===t.length},lu=function(t,n){return t<=0?[]:o8(n)(t)},ls=function(t,n){return lu(t,function(){return n})},lc=function(t){return nF(t)?[]:[t.value]},ll=function(t){return nB(t)?[]:[t.right]},lf=function(t,n){return function(r){return oY(r)?n(r):t()}},ld=function(t,n){return function(r){return oY(r)?n(un(r),ur(r)):t()}},lp=function(t,n){return function(r){return oY(r)?n(uo(r),ui(r)):t()}},lh=function(t){return function(n){for(var r=[],i=0;i<n.length;i++)r.push.apply(r,t(i,n[i]));return r}},lm=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}},lg=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}},ly=function(t){return t.length},lv=function(t){return oY(t)?nz(ur(t)):nU},lb=function(t){return oY(t)?nz(uo(t)):nU},lx=function(t){return function(n){return oJ(t,n)?lI(n):n.slice(0,t)}},l_=function(t){return function(n){return oJ(t,n)?lI(n):0===t?[]:n.slice(-t)}},lS=function(t,n){for(var r=t.length,i=0;i<r&&n(t[i]);i++);return i},lT=function(t){return function(n){return t<=0||la(n)?lI(n):t>=n.length?[]:n.slice(t,n.length)}},lw=function(t){return function(n){return t<=0||la(n)?lI(n):t>=n.length?[]:n.slice(0,n.length-t)}};function lO(t){return sa(t)}function lk(t){return ss(t)}var lI=function(t){return t.slice()},lC=function(t,n){return function(r){return t<0||t>r.length?nU:nz(dr(t,n,r))}},lM=function(t,n){return lE(t,function(){return n})},lR=function(t){return function(n){return oJ(t,n)?nU:nz(da(t,n))}},lE=function(t,n){return function(r){return oJ(t,r)?nU:nz(di(t,n(r[t]),r))}},lj=function(t){return la(t)?[]:t.slice().reverse()},lN=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r];"Right"===i._tag&&n.push(i.right)}return n},lA=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r];"Left"===i._tag&&n.push(i.left)}return n},lP=function(t){return function(n){return n.length<=1?lI(n):n.slice().sort(t.compare)}},lL=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},lD=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]},lF=function(t){var n=ag(t);return function(t){return oY(t)?n(t):[]}},lW=function(t){var n=ay(t);return function(t){return oY(t)?n(t):lI(t)}},lU=function(t){var n=o5(t);return function(t){return oY(t)?n(t):lI(t)}},lz=function(t){var n=o2(t);return function(t){return oY(t)?n(t):lI(t)}},lB=function(t){var n=o3(t);return function(t){return oY(t)?n(t):lI(t)}},lV=function(t){var n=ab(t);return function(t){return oY(t)?n(t):[]}},l$=function(t){return function(n){return t>=1&&oY(n)?ax(t)(n):la(n)?[lI(n),[]]:[[],lI(n)]}},lq=function(t){var n=a_(t);return function(t){return oY(t)?n(t):[]}},lK=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return lc(t.apply(void 0,n))}},lH=function(t){return function(n){return la(n)?lI(t):la(t)?lI(n):n.concat(t)}};function lZ(t){var n=o4(t);return function(r,i){if(void 0===i){var o=lZ(t);return function(t){return o(t,r)}}return oY(r)&&oY(i)?n(i)(r):oY(r)?lI(r):lI(i)}}function lG(t){var n=sw(t);return function(r,i){if(void 0===i){var o=lG(t);return function(t){return o(t,r)}}return r.filter(function(t){return n(t,i)})}}function lY(t){var n=sw(t);return function(r,i){if(void 0===i){var o=lY(t);return function(t){return o(t,r)}}return r.filter(function(t){return!n(t,i)})}}var lJ=function(t,n){return nN(t,fl(n))},lQ=function(t,n){return nN(t,fh(n))},lX=function(t,n){return nN(t,ff(n))},l0=function(t,n){return nN(t,fd(n))},l1=function(t,n){return nN(t,fb(n))},l2=function(t,n){return nN(t,fg(n))},l3=function(t,n){return nN(t,fx(n))},l4=function(t,n){return nN(t,fS(n))},l5=function(t,n){return nN(t,f_(n))},l9=function(t,n){return nN(t,fT(n))},l6=function(t,n){return nN(t,fO(n))},l8=function(t,n,r){return nN(t,fE(n,r))},l7=function(t){var n=fM(t);return function(t,r){return nN(t,n(r))}},fe=function(t,n,r){return nN(t,fN(n,r))},ft=function(t,n,r){return nN(t,fj(n,r))},fn=function(t){var n=fR(t);return function(t,r){return nN(t,n(r))}},fr=function(t,n,r){return nN(t,fA(n,r))},fi=function(t,n){return nN(t,fm(n))},fo=function(t,n){return nN(t,fk(n))},fa=function(t,n){return nN(t,fI(n))},fu=function(t){var n=fP(t);return function(t,r){return nN(t,n(r))}},fs=function(t){var n=fD(t);return function(t,r){return nN(t,n(r))}},fc=function(){return[]},fl=function(t){return function(n){return n.map(function(n){return t(n)})}},ff=function(t){return fd(function(n){return nN(t,fl(n))})},fd=function(t){return function(n){return nN(n,lh(function(n,r){return t(r)}))}},fp=fd(nS),fh=function(t){return function(n){return n.map(function(n,r){return t(r,n)})}},fm=function(t){return function(n){for(var r=[],i=0;i<n.length;i++){var o=t(i,n[i]);nW(o)&&r.push(o.value)}return r}},fg=function(t){return fm(function(n,r){return t(r)})},fy=fg(nS),fv=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 uC(n,r)},fb=function(t){return function(n){return n.filter(t)}},fx=function(t){return f_(function(n,r){return t(r)})},f_=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 uC(r,i)}},fS=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 uC(r,i)}},fw=function(t){return function(n){return n.concat(t())}},fO=fw,fk=function(t){return function(n){return n.filter(function(n,r){return t(r,n)})}},fI=function(t){return function(n){return n.map(function(r,i){return t(n.slice(i))})}},fC=fI(nS),fM=cy,fR=cm,fE=cg,fj=cv,fN=cb,fA=cx,fP=function(t){var n=fD(t);return function(t){return n(function(n,r){return t(r)})}},fL=function(t){return function(n){return l8(n,t.of(fc()),function(n,r){return t.ap(t.map(n,function(t){return function(n){return nN(t,oX(n))}}),r)})}},fD=function(t){return function(n){return fj(t.of(fc()),function(r,i,o){return t.ap(t.map(i,function(t){return function(n){return nN(t,oX(n))}}),n(r,o))})}},fF=function(t){var n=f6(t);return function(t){return function(r){return n(r,t)}}},fW=function(t){var n=f8(t);return function(t){return function(r){return n(r,t)}}},fU=function(t,n){for(var r=[],i=t;;){var o=n(i);if(nW(o)){var a=o.value,u=a[0],s=a[1];r.push(u),i=s}else break}return r},fz="Array",fB=function(){return{concat:function(t,n){return t.concat(n)}}},fV=function(){return{concat:fB().concat,empty:[]}},f$=function(t){var n=lZ(t);return{concat:function(t,r){return n(r)(t)}}},fq=function(t){return{concat:f$(t).concat,empty:[]}},fK=function(t){var n=lG(t);return{concat:function(t,r){return n(r)(t)}}},fH=function(t){var n=lY(t);return{concat:function(t,r){return n(r)(t)}}},fZ={URI:fz,map:lJ},fG=rt(fZ),fY={URI:fz,of:ap},fJ={URI:fz,map:lJ,ap:lX},fQ=n1(fJ),fX=n2(fJ),f0={URI:fz,map:lJ,ap:lX,chain:l0},f1=rs(f0),f2={URI:fz,zero:fc},f3=u$(f2,fY),f4={URI:fz,compact:fy,separate:fv},f5={URI:fz,reduce:l8,foldMap:l7,reduceRight:fe},f9={URI:fz,map:lJ,reduce:l8,foldMap:l7,reduceRight:fe,traverse:fu,sequence:fL},f6=uz(f9,f4),f8=uU(f9,f4),f7={URI:fz,map:lJ,compact:fy,separate:fv,filter:l1,filterMap:l2,partition:l3,partitionMap:l4,reduce:l8,foldMap:l7,reduceRight:fe,traverse:fu,sequence:fL,wither:f6,wilt:f8},de=uB(f7),dt={URI:fz,fromEither:ll},dn=rm(dt),dr=o0,di=function(t,n,r){return oY(r)?o1(t,n,r):[]},da=function(t,n){var r=n.slice();return r.splice(t,1),r},du=function(t){return function(n){return n.some(t)}},ds=ap(nJ),dc=rn(fZ),dl=rc(f0),df=n3(fJ);let dd=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:fz,map:lJ,alt:l6},Alternative:{URI:fz,map:lJ,ap:lX,of:ap,alt:l6,zero:fc},Applicative:{URI:fz,map:lJ,ap:lX,of:ap},Apply:fJ,Chain:f0,ChainRecBreadthFirst:{URI:fz,map:lJ,ap:lX,chain:l0,chainRec:s4},ChainRecDepthFirst:{URI:fz,map:lJ,ap:lX,chain:l0,chainRec:s3},Compactable:f4,Do:ds,Extend:{URI:fz,map:lJ,extend:fa},Filterable:{URI:fz,map:lJ,compact:fy,separate:fv,filter:l1,filterMap:l2,partition:l3,partitionMap:l4},FilterableWithIndex:{URI:fz,map:lJ,mapWithIndex:lQ,compact:fy,separate:fv,filter:l1,filterMap:l2,partition:l3,partitionMap:l4,partitionMapWithIndex:l9,partitionWithIndex:l5,filterMapWithIndex:fi,filterWithIndex:fo},Foldable:f5,FoldableWithIndex:{URI:fz,reduce:l8,foldMap:l7,reduceRight:fe,reduceWithIndex:ft,foldMapWithIndex:fn,reduceRightWithIndex:fr},FromEither:dt,Functor:fZ,FunctorWithIndex:{URI:fz,map:lJ,mapWithIndex:lQ},Monad:{URI:fz,map:lJ,ap:lX,of:ap,chain:l0},Pointed:fY,Traversable:f9,TraversableWithIndex:{URI:fz,map:lJ,mapWithIndex:lQ,reduce:l8,foldMap:l7,reduceRight:fe,reduceWithIndex:ft,foldMapWithIndex:fn,reduceRightWithIndex:fr,traverse:fu,sequence:fL,traverseWithIndex:fs},URI:fz,Unfoldable:{URI:fz,unfold:fU},Witherable:f7,Zero:f2,alt:fO,altW:fw,ap:ff,apFirst:fQ,apS:df,apSecond:fX,append:oX,appendW:oX,array:{URI:fz,compact:fy,separate:fv,map:lJ,ap:lX,of:ap,chain:l0,filter:l1,filterMap:l2,partition:l3,partitionMap:l4,mapWithIndex:lQ,partitionMapWithIndex:l9,partitionWithIndex:l5,filterMapWithIndex:fi,filterWithIndex:fo,alt:l6,zero:fc,unfold:fU,reduce:l8,foldMap:l7,reduceRight:fe,traverse:fu,sequence:fL,reduceWithIndex:ft,foldMapWithIndex:fn,reduceRightWithIndex:fr,traverseWithIndex:fs,extend:fa,wither:f6,wilt:f8},bind:dl,bindTo:dc,chain:fd,chainFirst:f1,chainRecBreadthFirst:cY,chainRecDepthFirst:cG,chainWithIndex:lh,chop:lV,chunksOf:lq,compact:fy,comprehension:function(t,n,r){void 0===r&&(r=function(){return!0});var i=function(t,o){return oY(o)?nN(un(o),fd(function(n){return i(nN(t,oX(n)),ur(o))})):r.apply(void 0,t)?[n.apply(void 0,t)]:[]};return i([],t)},concat:lH,concatW:lH,cons:uh,copy:lI,deleteAt:lR,difference:lY,dropLeft:lT,dropLeftWhile:function(t){return function(n){return n.slice(lS(n,t))}},dropRight:lw,duplicate:fC,elem:sw,empty:[],every:c8,exists:du,extend:fI,filter:fb,filterE:de,filterMap:fg,filterMapWithIndex:fm,filterWithIndex:fk,findFirst:lO,findFirstMap:su,findIndex:so,findLast:lk,findLastIndex:sl,findLastMap:sc,flap:fG,flatten:fp,foldLeft:ld,foldMap:fM,foldMapWithIndex:fR,foldRight:lp,fromEither:ll,fromEitherK:dn,fromOption:lc,fromOptionK:lK,fromPredicate:function(t){return function(n){return t(n)?[n]:[]}},getDifferenceMagma:fH,getEq:cE,getIntersectionSemigroup:fK,getMonoid:fV,getOrd:cj,getSemigroup:fB,getShow:cC,getUnionMonoid:fq,getUnionSemigroup:f$,guard:f3,head:u9,init:lb,insertAt:lC,intercalate:le,intersection:lG,intersperse:lW,isEmpty:la,isNonEmpty:oY,isOutOfBound:oJ,last:u6,lefts:lA,lookup:u5,makeBy:lu,map:fl,mapWithIndex:fh,match:lf,matchLeft:ld,matchLeftW:ld,matchRight:lp,matchRightW:lp,matchW:lf,modifyAt:lE,of:ap,partition:fx,partitionMap:fS,partitionMapWithIndex:fT,partitionWithIndex:f_,prepend:oQ,prependAll:lF,prependToAll:lF,prependW:oQ,range:ae,reduce:fE,reduceRight:fN,reduceRightWithIndex:fA,reduceWithIndex:fj,replicate:ls,reverse:lj,rights:lN,rotate:lU,scanLeft:lm,scanRight:lg,separate:fv,sequence:fL,size:ly,snoc:um,some:du,sort:lP,sortBy:lB,spanLeft:function(t){return function(n){var r,i=l$(lS(n,t))(n);return{init:i[0],rest:i[1]}}},splitAt:l$,tail:lv,takeLeft:lx,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:l_,traverse:fP,traverseWithIndex:fD,unfold:fU,union:lZ,uniq:lz,unsafeDeleteAt:da,unsafeInsertAt:dr,unsafeUpdateAt:di,unzip:lD,updateAt:lM,wilt:fW,wither:fF,zero:fc,zip:function t(n,r){return void 0===r?function(r){return t(r,n)}:lL(n,r,function(t,n){return[t,n]})},zipWith:lL},Symbol.toStringTag,{value:"Module"})),dp=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var dh=function(t){return"boolean"==typeof t},dm=function(t,n){return function(r){return r?n():t()}},dg={equals:function(t,n){return t===n}},dy={concat:function(t,n){return t&&n}},dv={concat:function(t,n){return t||n}},db={concat:dy.concat,empty:!0},dx={concat:dv.concat,empty:!1},d_={equals:dg.equals,compare:function(t,n){return t<n?-1:t>n?1:0}};let dS=Object.freeze(Object.defineProperty({__proto__:null,BooleanAlgebra:{meet:function(t,n){return t&&n},join:function(t,n){return t||n},zero:!1,one:!0,implies:function(t,n){return!t||n},not:function(t){return!t}},Eq:dg,MonoidAll:db,MonoidAny:dx,Ord:d_,SemigroupAll:dy,SemigroupAny:dv,Show:{show:function(t){return JSON.stringify(t)}},fold:dm,foldW:dm,isBoolean:dh,match:dm,matchW:dm},Symbol.toStringTag,{value:"Module"}));var dT=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 dw=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:dT,getFunctionBooleanAlgebra:ng,reverse:dT},Symbol.toStringTag,{value:"Module"}));var dO=function(t){return rH(t)(t.bottom,t.top)},dk=function(t){var n=rA(t);return{equals:n.equals,compare:n.compare,top:t.bottom,bottom:t.top}},dI={equals:rG.equals,compare:rG.compare,top:1/0,bottom:-1/0};let dC=Object.freeze(Object.defineProperty({__proto__:null,boundedNumber:dI,clamp:dO,reverse:dk},Symbol.toStringTag,{value:"Module"}));function dM(t){return{meet:rq(t),join:rK(t)}}let dR=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxDistributiveLattice:dM},Symbol.toStringTag,{value:"Module"})),dE=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxBoundedDistributiveLattice:function(t){var n=dM(t);return function(t,r){return{join:n.join,meet:n.meet,zero:t,one:r}}}},Symbol.toStringTag,{value:"Module"})),dj=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),dN=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),dA=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),dP=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var dL=function(t,n){for(var r=n(t);"Left"===r._tag;)r=n(r.left);return r.right};let dD=Object.freeze(Object.defineProperty({__proto__:null,tailRec:dL},Symbol.toStringTag,{value:"Module"}));function dF(t,n){return function(r,i){return n.compose(t.right(i),t.left(r))}}function dW(t,n){var r=dF(t,n);return function(i,o){return n.compose(t.promap(n.id(),function(t){return"Left"===t._tag?t.left:t.right},nS),r(i,o))}}let dU=Object.freeze(Object.defineProperty({__proto__:null,fanIn:dW,fanin:function(t){return dW(t,t)},split:dF,splitChoice:function(t){return dF(t,t)}},Symbol.toStringTag,{value:"Module"})),dz=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var dB=function(t,n){return nN(t,dV(n))},dV=function(t){return function(n){return nC(t,n)}},d$="Predicate",dq=function(){return{concat:function(t,n){return nN(t,dY(n))}}},dK=function(){return{concat:dq().concat,empty:nO}},dH=function(){return{concat:function(t,n){return nN(t,dJ(n))}}},dZ=function(){return{concat:dH().concat,empty:nw}},dG=function(t){return function(n){return!t(n)}},dY=function(t){return function(n){return function(r){return n(r)||t(r)}}},dJ=function(t){return function(n){return function(r){return n(r)&&t(r)}}};let dQ=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:{URI:d$,contramap:dB},URI:d$,and:dJ,contramap:dV,getMonoidAll:dZ,getMonoidAny:dK,getSemigroupAll:dH,getSemigroupAny:dq,not:dG,or:dY},Symbol.toStringTag,{value:"Module"}));function dX(t){return function(n){return t(n)?nz(n):nU}}var d0=function(t){return"Right"===t._tag?nU:nz(t.left)},d1=function(t){return"Left"===t._tag?nU:nz(t.right)},d2=function(t,n){return nN(t,pl(n))},d3=function(t,n){return nN(t,pp(n))},d4=function(t,n){return nN(t,pg(n))},d5=function(t,n,r){return nN(t,pv(n,r))},d9=function(t){var n=pb(t);return function(t,r){return nN(t,n(r))}},d6=function(t,n,r){return nN(t,px(n,r))},d8=function(t){var n=pL(t);return function(t,r){return nN(t,n(r))}},d7=function(t,n){return nN(t,pS(n))},pe=function(t,n){return nN(t,pE(n))},pt=function(t,n){return nN(t,pj(n))},pn=function(t,n){return nN(t,pk(n))},pr=function(t,n){return nN(t,pN(n))},pi=function(t,n){return nN(t,pA(n))},po="Option",pa=function(t){return{show:function(n){return pK(n)?"none":"some(".concat(t.show(n.value),")")}}},pu=function(t){return{equals:function(n,r){return n===r||(pK(n)?pK(r):!pK(r)&&t.equals(n.value,r.value))}}},ps=function(t){return{equals:pu(t).equals,compare:function(n,r){return n===r?0:pq(n)?pq(r)?t.compare(n.value,r.value):1:-1}}},pc=function(t){return{concat:function(n,r){return pK(n)?r:pK(r)?n:nz(t.concat(n.value,r.value))},empty:nU}},pl=function(t){return function(n){return pK(n)?nU:nz(t(n.value))}},pf={URI:po,map:d2},pd={URI:po,of:nz},pp=function(t){return function(n){return pK(n)||pK(t)?nU:nz(n.value(t.value))}},ph={URI:po,map:d2,ap:d3},pm={URI:po,map:d2,ap:d3,of:nz},pg=function(t){return function(n){return pK(n)?nU:t(n.value)}},py={URI:po,map:d2,ap:d3,chain:d4},pv=function(t,n){return function(r){return pK(r)?t:n(t,r.value)}},pb=function(t){return function(n){return function(r){return pK(r)?t.empty:n(r.value)}}},px=function(t,n){return function(r){return pK(r)?t:n(r.value,t)}},p_=function(t){return function(n){return pK(n)?t():n}},pS=p_,pT=function(){return nU},pw={URI:po,zero:pT},pO=u$(pw,pd),pk=function(t){return function(n){return pK(n)?nU:nz(t(n))}},pI=pg(nS),pC=uC(nU,nU),pM=function(t){return pK(t)?pC:uC(d0(t.value),d1(t.value))},pR={URI:po,compact:pI,separate:pM},pE=function(t){return function(n){return pK(n)?nU:t(n.value)?n:nU}},pj=function(t){return function(n){return pK(n)?nU:t(n.value)}},pN=function(t){return function(n){return uC(pe(n,dG(t)),pe(n,t))}},pA=function(t){return nC(pl(t),pM)},pP={URI:po,map:d2,compact:pI,separate:pM,filter:pe,filterMap:pt,partition:pr,partitionMap:pi},pL=function(t){return function(n){return function(r){return pK(r)?t.of(nU):t.map(n(r.value),nz)}}},pD=function(t){return function(n){return pK(n)?t.of(nU):t.map(n.value,nz)}},pF={URI:po,map:d2,reduce:d5,foldMap:d9,reduceRight:d6,traverse:d8,sequence:pD},pW=uz(pF,pR),pU=uU(pF,pR),pz=function(t){var n=pW(t);return function(t){return function(r){return n(r,t)}}},pB=function(t){var n=pU(t);return function(t){return function(r){return n(r,t)}}},pV=function(){return nU},p$={URI:po,fromEither:d1},pq=nW,pK=function(t){return"None"===t._tag},pH=function(t,n){return function(r){return pK(r)?t():n(r.value)}},pZ=function(t){return function(n){return pK(n)?t():n.value}},pG=rt(pf),pY=n1(ph),pJ=n2(ph),pQ=rs(py),pX=pk(nS),p0=rm(p$),p1=rg(p$,py),p2=ry(p$,py),p3=function(t){return null==t?nU:nz(t)},p4=function(t){try{return nz(t())}catch{return nU}},p5=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return p4(function(){return t.apply(void 0,n)})}},p9=function(t){return nC(t,p3)},p6=function(t){return function(n){return pK(n)?nU:p3(t(n.value))}},p8=pH(nk,nS),p7=pH(nI,nS),he=function(t){return function(n){return!pK(n)&&t(n.value)}},ht=nz(nJ),hn=rn(pf),hr=rc(py),hi=n3(ph),ho=nz(nY),ha=function(t){return function(n){var r=t(0,nZ(n));if(pK(r))return nU;for(var i=[r.value],o=1;o<n.length;o++){var a=t(o,n[o]);if(pK(a))return nU;i.push(a.value)}return nz(i)}},hu=function(t){var n=ha(t);return function(t){return nH(t)?n(t):ho}},hs=function(t){return hu(function(n,r){return t(r)})},hc=hs(nS),hl={URI:po,map:d2,of:nz,ap:d3,chain:d4,reduce:d5,foldMap:d9,reduceRight:d6,traverse:d8,sequence:pD,zero:pT,alt:d7,extend:pn,compact:pI,separate:pM,filter:pe,filterMap:pt,partition:pr,partitionMap:pi,wither:pW,wilt:pU,throwError:pV},hf=n4(ph),hd=ro(pm),hp=function(){return pc(ie())},hh=function(){return pc(it())};let hm=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:po,map:d2,alt:d7},Alternative:{URI:po,map:d2,ap:d3,of:nz,alt:d7,zero:pT},ApT:ho,Applicative:pm,Apply:ph,Chain:py,Compactable:pR,Do:ht,Extend:{URI:po,map:d2,extend:pn},Filterable:pP,Foldable:{URI:po,reduce:d5,foldMap:d9,reduceRight:d6},FromEither:p$,Functor:pf,Monad:{URI:po,map:d2,ap:d3,of:nz,chain:d4},MonadThrow:{URI:po,map:d2,ap:d3,of:nz,chain:d4,throwError:pV},Pointed:pd,Traversable:pF,URI:po,Witherable:{URI:po,map:d2,reduce:d5,foldMap:d9,reduceRight:d6,traverse:d8,sequence:pD,compact:pI,separate:pM,filter:pe,filterMap:pt,partition:pr,partitionMap:pi,wither:pW,wilt:pU},Zero:pw,alt:pS,altW:p_,ap:pp,apFirst:pY,apS:hi,apSecond:pJ,bind:hr,bindTo:hn,chain:pg,chainEitherK:p1,chainFirst:pQ,chainFirstEitherK:p2,chainNullableK:p6,compact:pI,duplicate:pX,elem:function t(n){return function(r,i){if(void 0===i){var o=t(n);return function(t){return o(r,t)}}return!pK(i)&&n.equals(r,i.value)}},exists:he,extend:pk,filter:pE,filterMap:pj,flap:pG,flatten:pI,fold:pH,foldMap:pb,foldW:pH,fromEither:d1,fromEitherK:p0,fromNullable:p3,fromNullableK:p9,fromPredicate:dX,getApplyMonoid:hd,getApplySemigroup:hf,getEq:pu,getFirstMonoid:hp,getLastMonoid:hh,getLeft:d0,getMonoid:pc,getOrElse:pZ,getOrElseW:pZ,getOrd:ps,getRefinement:function(t){return function(n){return pq(t(n))}},getRight:d1,getShow:pa,guard:pO,isNone:pK,isSome:pq,map:pl,mapNullable:p6,match:pH,matchW:pH,none:nU,of:nz,option:hl,partition:pN,partitionMap:pA,reduce:pv,reduceRight:px,separate:pM,sequence:pD,sequenceArray:hc,some:nz,throwError:pV,toNullable:p8,toUndefined:p7,traverse:pL,traverseArray:hs,traverseArrayWithIndex:hu,traverseReadonlyArrayWithIndex:hu,traverseReadonlyNonEmptyArrayWithIndex:ha,tryCatch:p4,tryCatchK:p5,wilt:pB,wither:pz,zero:pT},Symbol.toStringTag,{value:"Module"}));function hg(t,n){return function(r){return t.map(r,n.compact)}}function hy(t,n,r){var i=hg(t,n),o=re(t,r);return function(t){return uC(i(nN(t,o(d0))),i(nN(t,o(d1))))}}let hv=Object.freeze(Object.defineProperty({__proto__:null,compact:hg,getCompactableComposition:function(t,n){return{map:rr(t,n).map,compact:hg(t,n),separate:hy(t,n,n)}},separate:hy},Symbol.toStringTag,{value:"Module"}));var hb=function(t){return function(){return console.log(t)}},hx=function(t){return function(){return console.warn(t)}},h_=function(t){return function(){return console.error(t)}},hS=function(t){return function(){return console.info(t)}};let hT=Object.freeze(Object.defineProperty({__proto__:null,error:h_,info:hS,log:hb,warn:hx},Symbol.toStringTag,{value:"Module"}));function hw(t){return{URI:hA,_E:void 0,map:hI,ap:function(n,r){return nS(t.concat(n,r))}}}function hO(t){var n=hw(t);return{URI:hA,_E:void 0,map:n.map,ap:n.ap,of:function(){return nS(t.empty)}}}var hk=function(t,n){return nN(t,hR())},hI=function(t,n){return nN(t,hE())},hC=function(t,n,r){return nN(t,hj(n))},hM=function(t,n){return nN(t,hN(n))},hR=function(){return nS},hE=function(){return nS},hj=function(t){return function(n){return nS(t(n))}},hN=function(t){return function(n){return nS(t(n))}},hA="Const",hP={URI:hA,map:hI},hL=rt(hP);let hD=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:{URI:hA,bimap:hC,mapLeft:hM},Contravariant:{URI:hA,contramap:hk},Functor:hP,URI:hA,bimap:hj,const_:{URI:hA,map:hI,contramap:hk,bimap:hC,mapLeft:hM},contramap:hR,flap:hL,getApplicative:hO,getApply:hw,getBooleanAlgebra:nS,getBounded:nS,getEq:nS,getHeytingAlgebra:nS,getMonoid:nS,getOrd:nS,getRing:nS,getSemigroup:nS,getSemiring:nS,getShow:function(t){return{show:function(n){return"make(".concat(t.show(n),")")}}},make:nS,map:hE,mapLeft:hN},Symbol.toStringTag,{value:"Module"})),hF=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var hW=nN(ub,rP(function(t){return t.valueOf()})),hU=function(){return new Date},hz=function(){return new Date().getTime()};let hB=Object.freeze(Object.defineProperty({__proto__:null,Eq:{equals:function(t,n){return t.valueOf()===n.valueOf()}},Ord:hW,create:hU,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:hz},Symbol.toStringTag,{value:"Module"}));var hV=function(t,n){return nN(t,me(n))},h$=function(t,n){return nN(t,mi(n))},hq=function(t,n){return nN(t,ms(n))},hK=function(t,n,r){return nN(t,ml(n,r))},hH=function(t){return function(n,r){var i=mf(t);return nN(n,i(r))}},hZ=function(t,n,r){return nN(t,md(n,r))},hG=function(t){var n=mp(t);return function(t,r){return nN(t,n(r))}},hY=function(t,n,r){return nN(t,mg(n,r))},hJ=function(t,n){return nN(t,my(n))},hQ=function(t,n){return nN(t,mb(n))},hX=function(t,n){return nN(t,mx(n))},h0=function(t,n){return dL(n(t),function(t){return mw(t)?nq(n$(t.left)):mw(t.right)?n$(n(t.right.left)):nq(nq(t.right.right))})},h1="Either",h2=function(t,n){return{show:function(r){return mw(r)?"left(".concat(t.show(r.left),")"):"right(".concat(n.show(r.right),")")}}},h3=function(t,n){return{equals:function(r,i){return r===i||(mw(r)?mw(i)&&t.equals(r.left,i.left):mO(i)&&n.equals(r.right,i.right))}}},h4=function(t){return{concat:function(n,r){return mw(r)?n:mw(n)?r:nq(t.concat(n.right,r.right))}}},h5=function(t){var n=n$(t.empty);return{URI:h1,_E:void 0,compact:function(t){return mw(t)?t:"None"===t.right._tag?n:nq(t.right.value)},separate:function(t){return mw(t)?uC(t,t):mw(t.right)?uC(nq(t.right.left),n):uC(n,nq(t.right.right))}}},h9=function(t){var n,r=n$(t.empty),i=h5(t),o=i.compact;return{URI:h1,_E:void 0,map:hV,compact:o,separate:i.separate,filter:function(t,n){return mw(t)||n(t.right)?t:r},filterMap:function(t,n){if(mw(t))return t;var i=n(t.right);return"None"===i._tag?r:nq(i.value)},partition:function(t,n){return mw(t)?uC(t,t):n(t.right)?uC(r,nq(t.right)):uC(nq(t.right),r)},partitionMap:function(t,n){if(mw(t))return uC(t,t);var i=n(t.right);return mw(i)?uC(nq(i.left),r):uC(r,nq(i.right))}}},h6=function(t){var n=h9(t),r=h5(t);return{URI:h1,_E:void 0,map:hV,compact:n.compact,separate:n.separate,filter:n.filter,filterMap:n.filterMap,partition:n.partition,partitionMap:n.partitionMap,traverse:hG,sequence:mh,reduce:hK,foldMap:hH,reduceRight:hZ,wither:uz(mm,r),wilt:uU(mm,r)}},h8=function(t){return{URI:h1,_E:void 0,map:hV,ap:function(n,r){return mw(n)?mw(r)?n$(t.concat(n.left,r.left)):n:mw(r)?r:nq(n.right(r.right))},of:mn}},h7=function(t){return{URI:h1,_E:void 0,map:hV,alt:function(n,r){if(mO(n))return n;var i=r();return mw(i)?n$(t.concat(n.left,i.left)):i}}},me=function(t){return function(n){return mw(n)?n:nq(t(n.right))}},mt={URI:h1,map:hV},mn=nq,mr=function(t){return function(n){return mw(n)?n:mw(t)?t:nq(n.right(t.right))}},mi=mr,mo={URI:h1,map:hV,ap:h$},ma={URI:h1,map:hV,ap:h$,of:mn},mu=function(t){return function(n){return mw(n)?n:t(n.right)}},ms=mu,mc={URI:h1,map:hV,ap:h$,chain:hq},ml=function(t,n){return function(r){return mw(r)?t:n(t,r.right)}},mf=function(t){return function(n){return function(r){return mw(r)?t.empty:n(r.right)}}},md=function(t,n){return function(r){return mw(r)?t:n(r.right,t)}},mp=function(t){return function(n){return function(r){return mw(r)?t.of(n$(r.left)):t.map(n(r.right),nq)}}},mh=function(t){return function(n){return mw(n)?t.of(n$(n.left)):t.map(n.right,nq)}},mm={URI:h1,map:hV,reduce:hK,foldMap:hH,reduceRight:hZ,traverse:hG,sequence:mh},mg=function(t,n){return function(r){return mw(r)?n$(t(r.left)):nq(n(r.right))}},my=function(t){return function(n){return mw(n)?n$(t(n.left)):n}},mv=function(t){return function(n){return mw(n)?t():n}},mb=mv,mx=function(t){return function(n){return mw(n)?n:nq(t(n))}},m_={URI:h1,fromEither:nS},mS=rd(m_),mT=rf(m_),mw=nB,mO=nV,mk=function(t,n){return function(r){return mw(r)?t(r.left):n(r.right)}},mI=function(t){return function(n){return mw(n)?t(n.left):n.right}},mC=rt(mt),mM=n1(mo),mR=n2(mo),mE=rs(mc),mj=mu(nS),mN=mx(nS),mA=rp(m_),mP=rh(m_,mc),mL=rv(m_,mc),mD=function(t){return mw(t)?nq(t.left):n$(t.right)},mF=function(t){return function(n){return mw(n)?t(n.left):n}},mW=function(t){return function(n){return null==n?n$(t):nq(n)}},mU=function(t,n){try{return nq(t())}catch(r){return n$(n(r))}},mz=function(t,n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return mU(function(){return t.apply(void 0,r)},n)}},mB=function(t){var n=mW(t);return function(t){return nC(t,n)}},mV=function(t){var n=mB(t);return function(t){return ms(n(t))}},m$=mk(nS,nS),mq=function(t){return function(n){return!mw(n)&&t(n.right)}},mK=mn(nJ),mH=rn(mt),mZ=rc(mc),mG=n3(mo),mY=mn(nY),mJ=function(t){return function(n){var r=t(0,nZ(n));if(mw(r))return r;for(var i=[r.right],o=1;o<n.length;o++){var a=t(o,n[o]);if(mw(a))return a;i.push(a.right)}return nq(i)}},mQ=function(t){var n=mJ(t);return function(t){return nH(t)?n(t):mY}},mX=function(t){return mQ(function(n,r){return t(r)})},m0=mX(nS),m1=function(t,n){return mU(function(){var n=JSON.stringify(t);if("string"!=typeof n)throw Error("Converting unsupported structure to JSON");return n},n)},m2=n4(mo),m3=ro(ma),m4=function(t,n){return n4(h8(t))(n)},m5=function(t,n){return ro(h8(t))(n)};let m9=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:h1,map:hV,alt:hQ},ApT:mY,Applicative:ma,Apply:mo,Bifunctor:{URI:h1,bimap:hY,mapLeft:hJ},Chain:mc,ChainRec:{URI:h1,map:hV,ap:h$,chain:hq,chainRec:h0},Do:mK,Extend:{URI:h1,map:hV,extend:hX},Foldable:{URI:h1,reduce:hK,foldMap:hH,reduceRight:hZ},FromEither:m_,Functor:mt,Monad:{URI:h1,map:hV,ap:h$,of:mn,chain:hq},MonadThrow:{URI:h1,map:hV,ap:h$,of:mn,chain:hq,throwError:n$},Pointed:{URI:h1,of:mn},Traversable:mm,URI:h1,alt:mb,altW:mv,ap:mi,apFirst:mM,apFirstW:mM,apS:mG,apSW:mG,apSecond:mR,apSecondW:mR,apW:mr,bimap:mg,bind:mZ,bindTo:mH,bindW:mZ,chain:ms,chainFirst:mE,chainFirstW:mE,chainNullableK:mV,chainOptionK:mP,chainW:mu,duplicate:mN,either:{URI:h1,map:hV,of:mn,ap:h$,chain:hq,reduce:hK,foldMap:hH,reduceRight:hZ,traverse:hG,sequence:mh,bimap:hY,mapLeft:hJ,alt:hQ,extend:hX,chainRec:h0,throwError:n$},elem:function t(n){return function(r,i){if(void 0===i){var o=t(n);return function(t){return o(r,t)}}return!mw(i)&&n.equals(r,i.right)}},exists:mq,extend:mx,filterOrElse:mL,filterOrElseW:mL,flap:mC,flatten:mj,flattenW:mj,fold:mk,foldMap:mf,foldW:mk,fromNullable:mW,fromNullableK:mB,fromOption:mT,fromOptionK:mA,fromPredicate:mS,getAltValidation:h7,getApplicativeValidation:h8,getApplyMonoid:m3,getApplySemigroup:m2,getCompactable:h5,getEq:h3,getFilterable:h9,getOrElse:mI,getOrElseW:mI,getSemigroup:h4,getShow:h2,getValidation:function(t){var n=h8(t).ap,r=h7(t).alt;return{URI:h1,_E:void 0,map:hV,of:mn,chain:hq,bimap:hY,mapLeft:hJ,reduce:hK,foldMap:hH,reduceRight:hZ,extend:hX,traverse:hG,sequence:mh,chainRec:h0,throwError:n$,ap:n,alt:r}},getValidationMonoid:m5,getValidationSemigroup:m4,getWitherable:h6,isLeft:mw,isRight:mO,left:n$,map:me,mapLeft:my,match:mk,matchW:mk,of:mn,orElse:mF,orElseW:mF,parseJSON:function(t,n){return mU(function(){return JSON.parse(t)},n)},reduce:ml,reduceRight:md,right:nq,sequence:mh,sequenceArray:m0,stringifyJSON:m1,swap:mD,throwError:n$,toError:function(t){return t instanceof Error?t:Error(String(t))},toUnion:m$,traverse:mp,traverseArray:mX,traverseArrayWithIndex:mQ,traverseReadonlyArrayWithIndex:mQ,traverseReadonlyNonEmptyArrayWithIndex:mJ,tryCatch:mU,tryCatchK:mz},Symbol.toStringTag,{value:"Module"}));function m6(t){return nC(nq,t.of)}function m8(t){return nC(n$,t.of)}function m7(t){return function(n){return t.map(n,nq)}}function ge(t){return function(n){return t.map(n,n$)}}function gt(t){return function(n){return nC(mW(n),t.of)}}function gn(t){var n=gt(t);return function(t){var r=n(t);return function(t){return nC(t,r)}}}function gr(t){var n=ga(t),r=gn(t);return function(t){var i=r(t);return function(t){return n(i(t))}}}function gi(t){return re(t,mt)}function go(t){return n0(t,mo)}function ga(t){return function(n){return function(r){return t.chain(r,function(r){return mw(r)?t.of(r):n(r.right)})}}}function gu(t){return function(n){return function(r){return t.chain(r,function(r){return mw(r)?n():t.of(r)})}}}function gs(t){return function(n,r){return function(i){return t.map(i,mg(n,r))}}}function gc(t){return function(n){return function(r){return t.map(r,my(n))}}}function gl(t,n){return function(r){return function(i){return t.chain(i,mk(function(i){return t.map(r(),my(function(t){return n.concat(i,t)}))},m6(t)))}}}function gf(t){return function(n,r){return function(i){return t.map(i,mk(n,r))}}}function gd(t){return function(n,r){return function(i){return t.chain(i,mk(n,r))}}}function gp(t){return function(n){return function(r){return t.chain(r,mk(n,t.of))}}}function gh(t){return function(n){return function(r){return t.chain(r,function(r){return mw(r)?n(r.left):t.of(r)})}}}function gm(t){var n=gh(t);return function(r){return n(function(n){return t.map(r(n),function(t){return mw(t)?t:n$(n)})})}}function gg(t){return function(n){return function(r){return t.chain(r,mk(function(r){return t.map(n(r),n$)},function(n){return t.of(nq(n))}))}}}function gy(t){return function(n){return t.map(n,mD)}}function gv(t){return function(n){return t.map(n,m$)}}let gb=Object.freeze(Object.defineProperty({__proto__:null,alt:gu,altValidation:gl,ap:go,bimap:gs,chain:ga,chainNullableK:gr,fromNullable:gt,fromNullableK:gn,getEitherM:function(t){var n=go(t),r=gi(t),i=ga(t),o=gu(t),a=gs(t),u=gc(t),s=gd(t),c=gp(t),l=gh(t);return{map:function(t,n){return nN(t,r(n))},ap:function(t,r){return nN(t,n(r))},of:m6(t),chain:function(t,n){return nN(t,i(n))},alt:function(t,n){return nN(t,o(n))},bimap:function(t,n,r){return nN(t,a(n,r))},mapLeft:function(t,n){return nN(t,u(n))},fold:function(t,n,r){return nN(t,s(n,r))},getOrElse:function(t,n){return nN(t,c(n))},orElse:function(t,n){return nN(t,l(n))},swap:gy(t),rightM:m7(t),leftM:ge(t),left:m8(t)}},getOrElse:gp,left:m8,leftF:ge,map:gi,mapLeft:gc,match:gf,matchE:gd,orElse:gh,orElseFirst:gm,orLeft:gg,right:m6,rightF:m7,swap:gy,toUnion:gv},Symbol.toStringTag,{value:"Module"}));var gx=function(){return{concat:function(t,n){return nC(t,n)}}},g_=function(){return{concat:gx().concat,empty:nS}};let gS=Object.freeze(Object.defineProperty({__proto__:null,URI:"Endomorphism",getMonoid:g_,getSemigroup:gx},Symbol.toStringTag,{value:"Module"})),gT=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function gw(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 gO=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:gw,lcm:function(t,n){var r=n.zero,i=gw(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 gk(t,n){return function(r){return function(i){return t.map(i,function(t){return n.filter(t,r)})}}}function gI(t,n){return function(r){return function(i){return t.map(i,function(t){return n.filterMap(t,r)})}}}function gC(t,n){var r=gk(t,n);return function(t){var n=r(dG(t)),i=r(t);return function(t){return uC(n(t),i(t))}}}function gM(t,n){var r=gI(t,n);return function(t){return function(n){return uC(nN(n,r(function(n){return d0(t(n))})),nN(n,r(function(n){return d1(t(n))})))}}}let gR=Object.freeze(Object.defineProperty({__proto__:null,filter:gk,filterMap:gI,getFilterableComposition:function(t,n){var r=rr(t,n).map,i=hg(t,n),o=hy(t,n,n),a=gk(t,n),u=gI(t,n),s=gC(t,n),c=gM(t,n);return{map:r,compact:i,separate:o,filter:function(t,n){return nN(t,a(n))},filterMap:function(t,n){return nN(t,u(n))},partition:function(t,n){return nN(t,s(n))},partitionMap:function(t,n){return nN(t,c(n))}}},partition:gC,partitionMap:gM},Symbol.toStringTag,{value:"Module"})),gE=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function gj(t,n){return function(r,i){return function(o){return t.reduce(o,r,function(t,r){return n.reduce(r,t,i)})}}}function gN(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 gA(t,n){return function(r,i){return function(o){return t.reduceRight(o,r,function(t,r){return n.reduceRight(t,r,i)})}}}function gP(t){return function(n){return t.reduce(n,[],function(t,n){return t.push(n),t})}}function gL(t,n){var r=gj(t,n),i=gN(t,n),o=gA(t,n);return{reduce:function(t,n,i){return nN(t,r(n,i))},foldMap:function(t){var n=i(t);return function(t,r){return nN(t,n(r))}},reduceRight:function(t,n,r){return nN(t,o(n,r))}}}let gD=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:gN,getFoldableComposition:gL,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:gj,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:gA,toArray:gP,toReadonlyArray:gP,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,nT),a)})}}},Symbol.toStringTag,{value:"Module"}));function gF(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 gW(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 gU(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 gz=Object.freeze(Object.defineProperty({__proto__:null,foldMapWithIndex:gW,getFoldableWithIndexComposition:function(t,n){var r=gL(t,n),i=gF(t,n),o=gW(t,n),a=gU(t,n);return{reduce:r.reduce,foldMap:r.foldMap,reduceRight:r.reduceRight,reduceWithIndex:function(t,n,r){return nN(t,i(n,r))},foldMapWithIndex:function(t){var n=o(t);return function(t,r){return nN(t,n(r))}},reduceRightWithIndex:function(t,n,r){return nN(t,a(n,r))}}},reduceRightWithIndex:gU,reduceWithIndex:gF},Symbol.toStringTag,{value:"Module"}));function gB(t){return function(n){return nC(n,t.fromIO)}}function gV(t,n){return function(r){var i=nC(r,t.fromIO);return function(t){return n.chain(t,i)}}}function g$(t,n){var r=rs(n);return function(n){return r(nC(n,t.fromIO))}}let gq=Object.freeze(Object.defineProperty({__proto__:null,chainFirstIOK:g$,chainIOK:gV,fromIOK:gB},Symbol.toStringTag,{value:"Module"}));var gK=function(){return nS},gH=function(t){return function(n){return function(r){return n(t(r))}}},gZ=function(t){return function(n){return t(n)(n)}},gG=function(t,n){return nN(t,g0(n))},gY=function(t,n){return nN(t,g2(n))},gJ=function(t,n){return nN(t,g4(n))},gQ=function(t,n){return nN(t,g9(n))},gX=function(t,n,r){return nN(t,g6(n,r))},g0=function(t){return function(n){return function(r){return t(n(r))}}},g1=function(t){return function(n){return function(r){return n(r)(t(r))}}},g2=g1,g3=function(t){return function(n){return function(r){return t(n(r))(r)}}},g4=g3,g5=g3(nS),g9=function(t){return function(n){return nC(t,n)}},g6=function(t,n){return function(r){return function(i){return n(r(t(i)))}}},g8=function(){return nS},g7=function(t){return function(n){var r=n[0],i=n[1];return[t(r),i]}},ye=function(t){return function(n){var r;return[n[0],t(n[1])]}},yt=function(t){return mk(function(n){return n$(t(n))},nq)},yn=function(t){return mk(n$,function(n){return nq(t(n))})},yr="Reader",yi={URI:yr,map:gG},yo=rt(yi),ya={URI:yr,of:nT},yu={URI:yr,map:gG,ap:gY},ys=n1(yu),yc=n2(yu),yl={URI:yr,map:gG,ap:gY,of:nT},yf={URI:yr,map:gG,ap:gY,chain:gJ},yd={URI:yr,map:gG,of:nT,ap:gY,chain:gJ},yp=rs(yf),yh=rn(yi),ym=rc(yf),yg=nT(nJ),yy=n3(yu),yv=nT(nY),yb=function(t){return function(n){return function(r){for(var i=[t(0,nZ(n))(r)],o=1;o<n.length;o++)i.push(t(o,n[o])(r));return i}}},yx=function(t){var n=yb(t);return function(t){return nH(t)?n(t):yv}},y_=function(t){return yx(function(n,r){return t(r)})},yS=y_(nS),yT=n4(yu),yw=ro(yl);let yO=Object.freeze(Object.defineProperty({__proto__:null,ApT:yv,Applicative:yl,Apply:yu,Category:{URI:yr,compose:gQ,id:g8},Chain:yf,Choice:{URI:yr,map:gG,promap:gX,left:yt,right:yn},Do:yg,Functor:yi,Monad:yd,Pointed:ya,Profunctor:{URI:yr,map:gG,promap:gX},Strong:{URI:yr,map:gG,promap:gX,first:g7,second:ye},URI:yr,ap:g2,apFirst:ys,apFirstW:ys,apS:yy,apSW:yy,apSecond:yc,apSecondW:yc,apW:g1,ask:gK,asks:nS,asksReader:gZ,asksReaderW:gZ,bind:ym,bindTo:yh,bindW:ym,chain:g4,chainFirst:yp,chainFirstW:yp,chainW:g3,compose:g9,first:g7,flap:yo,flatten:g5,flattenW:g5,getMonoid:yw,getSemigroup:yT,id:g8,left:yt,local:gH,map:g0,of:nT,promap:g6,reader:{URI:yr,map:gG,of:nT,ap:gY,chain:gJ,promap:gX,compose:gQ,id:g8,first:g7,second:ye,left:yt,right:yn},right:yn,second:ye,sequenceArray:yS,traverseArray:y_,traverseArrayWithIndex:yx,traverseReadonlyArrayWithIndex:yx,traverseReadonlyNonEmptyArrayWithIndex:yb},Symbol.toStringTag,{value:"Module"}));function yk(t){return function(){return t.fromReader(gK())}}function yI(t){return t.fromReader}function yC(t){return function(n){return nC(n,t.fromReader)}}function yM(t,n){var r=yC(t);return function(t){return function(i){return n.chain(i,r(t))}}}function yR(t,n){return nC(yC(t),rs(n))}let yE=Object.freeze(Object.defineProperty({__proto__:null,ask:yk,asks:yI,chainFirstReaderK:yR,chainReaderK:yM,fromReaderK:yC},Symbol.toStringTag,{value:"Module"}));var yj=function(){return function(t){return[t,t]}},yN=function(t){return function(){return[void 0,t]}},yA=function(t){return function(n){return[void 0,t(n)]}},yP=function(t){return function(n){return[t(n),n]}},yL=function(t,n){return nN(t,yW(n))},yD=function(t,n){return nN(t,yU(n))},yF=function(t,n){return nN(t,yB(n))},yW=function(t){return function(n){return function(r){var i=n(r),o=i[0],a=i[1];return[t(o),a]}}},yU=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]}}},yz=function(t){return function(n){return[t,n]}},yB=function(t){return function(n){return function(r){var i=n(r),o=i[0],a=i[1];return t(o)(a)}}},yV=yB(nS),y$="State",yq={URI:y$,map:yL},yK=rt(yq),yH={URI:y$,map:yL,ap:yD},yZ=n1(yH),yG=n2(yH),yY={URI:y$,map:yL,ap:yD,chain:yF},yJ={URI:y$,map:yL,ap:yD,of:yz,chain:yF},yQ=rs(yY),yX=function(t){return function(n){return n(t)[0]}},y0=function(t){return function(n){return n(t)[1]}},y1=rn(yq),y2=rc(yY),y3=n3(yH),y4=function(t){return function(n){return function(r){for(var i=t(0,nZ(n))(r),o=i[0],a=i[1],u=[o],s=a,c=1;c<n.length;c++){var l=t(c,n[c])(s),f=l[0],d=l[1];u.push(f),s=d}return[u,s]}}},y5=function(t){var n=y4(t);return function(t){return nH(t)?n(t):yz(nY)}},y9=function(t){return y5(function(n,r){return t(r)})},y6=y9(nS),y8=function(t,n){return t(n)[0]},y7=function(t,n){return t(n)[1]};let ve=Object.freeze(Object.defineProperty({__proto__:null,Applicative:{URI:y$,map:yL,ap:yD,of:yz},Apply:yH,Chain:yY,FromState:{URI:y$,fromState:nS},Functor:yq,Monad:yJ,Pointed:{URI:y$,of:yz},URI:y$,ap:yU,apFirst:yZ,apS:y3,apSecond:yG,bind:y2,bindTo:y1,chain:yB,chainFirst:yQ,evalState:y8,evaluate:yX,execState:y7,execute:y0,flap:yK,flatten:yV,get:yj,gets:yP,map:yW,modify:yA,of:yz,put:yN,sequenceArray:y6,state:yJ,traverseArray:y9,traverseArrayWithIndex:y5,traverseReadonlyArrayWithIndex:y5,traverseReadonlyNonEmptyArrayWithIndex:y4},Symbol.toStringTag,{value:"Module"}));function vt(t){return function(){return t.fromState(yj())}}function vn(t){return function(n){return t.fromState(yN(n))}}function vr(t){return nC(yA,t.fromState)}function vi(t){return nC(yP,t.fromState)}function vo(t){return function(n){return nC(n,t.fromState)}}function va(t,n){var r=vo(t);return function(t){return function(i){return n.chain(i,r(t))}}}let vu=Object.freeze(Object.defineProperty({__proto__:null,chainStateK:va,fromStateK:vo,get:vt,gets:vi,modify:vr,put:vn},Symbol.toStringTag,{value:"Module"}));function vs(t){return function(n){return nC(n,t.fromTask)}}function vc(t,n){return function(r){var i=nC(r,t.fromTask);return function(t){return n.chain(t,i)}}}function vl(t,n){var r=rs(n);return function(n){return r(nC(n,t.fromTask))}}let vf=Object.freeze(Object.defineProperty({__proto__:null,chainFirstTaskK:vl,chainTaskK:vc,fromTaskK:vs},Symbol.toStringTag,{value:"Module"}));function vd(t){return function(n){return nC(n,t.fromThese)}}let vp=Object.freeze(Object.defineProperty({__proto__:null,fromTheseK:vd},Symbol.toStringTag,{value:"Module"}));function vh(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 vm=Object.freeze(Object.defineProperty({__proto__:null,getFunctorWithIndexComposition:function(t,n){var r=rr(t,n).map,i=vh(t,n);return{map:r,mapWithIndex:function(t,n){return nN(t,i(n))}}},mapWithIndex:vh},Symbol.toStringTag,{value:"Module"})),vg=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),vy=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),vv=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var vb=function(t,n){return nN(t,vC(n))},vx=function(t,n){return nN(t,vM(n))},v_=function(t,n){return nN(t,vR(n))},vS=function(t,n,r){return nN(t,vA(n,r))},vT=function(t){return function(t,n){return nN(t,vP()(n))}},vw=function(t,n,r){return nN(t,vL(n,r))},vO=function(t,n){return nN(t,vU())},vk=function(t,n){return nN(t,vE(n))},vI=function(t){var n=vD(t);return function(t,r){return nN(t,n(r))}},vC=function(t){return function(n){return t(n)}},vM=function(t){return function(n){return n(t)}},vR=function(t){return function(n){return t(n)}},vE=function(t){return function(n){return t(n)}},vj=vE(nS),vN=vR(nS),vA=function(t,n){return function(r){return n(t,r)}},vP=function(){return function(t){return function(n){return t(n)}}},vL=function(t,n){return function(r){return n(r,t)}},vD=function(t){return function(n){return function(r){return t.map(n(r),nS)}}},vF=function(t){return function(n){return t.map(n,nS)}},vW=function(){return nS},vU=vW,vz="Identity",vB={URI:vz,map:vb},vV=rt(vB),v$={URI:vz,map:vb,ap:vx},vq=n1(v$),vK=n2(v$),vH={URI:vz,map:vb,ap:vx,chain:v_},vZ=rs(vH),vG=nS(nJ),vY=rn(vB),vJ=rc(vH),vQ=n3(v$);let vX=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:vz,map:vb,alt:vO},Applicative:{URI:vz,map:vb,ap:vx,of:nS},Apply:v$,Chain:vH,ChainRec:{URI:vz,map:vb,ap:vx,chain:v_,chainRec:dL},Comonad:{URI:vz,map:vb,extend:vk,extract:nS},Do:vG,Foldable:{URI:vz,reduce:vS,foldMap:vT,reduceRight:vw},Functor:vB,Monad:{URI:vz,map:vb,ap:vx,of:nS,chain:v_},Pointed:{URI:vz,of:nS},Traversable:{URI:vz,map:vb,reduce:vS,foldMap:vT,reduceRight:vw,traverse:vI,sequence:vF},URI:vz,alt:vU,altW:vW,ap:vM,apFirst:vq,apS:vQ,apSecond:vK,bind:vJ,bindTo:vY,chain:vR,chainFirst:vZ,duplicate:vj,extend:vE,extract:nS,flap:vV,flatten:vN,foldMap:vP,getEq:nS,getShow:nS,identity:{URI:vz,map:vb,ap:vx,of:nS,chain:v_,reduce:vS,foldMap:vT,reduceRight:vw,traverse:vI,sequence:vF,alt:vO,extract:nS,extend:vk,chainRec:dL},map:vC,of:nS,reduce:vA,reduceRight:vL,sequence:vF,traverse:vD},Symbol.toStringTag,{value:"Module"})),v0=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var v1=function(t,n){return function(){return n(t())}},v2=function(t,n){return function(){return t()(n())}},v3=function(t,n){return function(){return n(t())()}},v4=function(t,n){return function(){for(var r=n(t)();"Left"===r._tag;)r=n(r.left)();return r.right}},v5=function(t){return function(n){return v1(n,t)}},v9=function(t){return function(n){return v2(n,t)}},v6=function(t){return function(n){return v3(n,t)}},v8=v6(nS),v7={URI:"IO",map:v1},be=rt(v7),bt={URI:"IO",of:nT},bn={URI:"IO",map:v1,ap:v2},br=n1(bn),bi=n2(bn),bo={URI:"IO",map:v1,ap:v2,of:nT},ba={URI:"IO",map:v1,ap:v2,chain:v3},bu={URI:"IO",map:v1,ap:v2,of:nT,chain:v3},bs=rs(ba),bc=nT(nJ),bl=rn(v7),bf=rc(ba),bd=n3(bn),bp=nT(nY),bh=function(t){return function(n){return function(){for(var r=[t(0,nZ(n))()],i=1;i<n.length;i++)r.push(t(i,n[i])());return r}}},bm=function(t){var n=bh(t);return function(t){return nH(t)?n(t):bp}},bg=function(t){return bm(function(n,r){return t(r)})},by=bg(nS),bv=n4(bn),bb=ro(bo);let bx=Object.freeze(Object.defineProperty({__proto__:null,ApT:bp,Applicative:bo,Apply:bn,Chain:ba,ChainRec:{URI:"IO",map:v1,ap:v2,chain:v3,chainRec:v4},Do:bc,FromIO:{URI:"IO",fromIO:nS},Functor:v7,Monad:bu,MonadIO:{URI:"IO",map:v1,ap:v2,of:nT,chain:v3,fromIO:nS},Pointed:bt,URI:"IO",ap:v9,apFirst:br,apS:bd,apSecond:bi,bind:bf,bindTo:bl,chain:v6,chainFirst:bs,flap:be,flatten:v8,fromIO:nS,getMonoid:bb,getSemigroup:bv,io:{URI:"IO",map:v1,of:nT,ap:v2,chain:v3,fromIO:nS,chainRec:v4},map:v5,of:nT,sequenceArray:by,traverseArray:bg,traverseArrayWithIndex:bm,traverseReadonlyArrayWithIndex:bm,traverseReadonlyNonEmptyArrayWithIndex:bh},Symbol.toStringTag,{value:"Module"}));var b_=m8(bt),bS=m6(bt),bT=m7(v7),bw=ge(v7),bO=gf(v7),bk=gd(bu),bI=gp(bu),bC=function(t,n){return function(){return mU(t,n)}},bM=function(t,n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return bC(function(){return t.apply(void 0,r)},n)}},bR=gv(v7),bE=gh(bu),bj=gm(bu),bN=function(t){return bj(b7(t))},bA=gg(bu),bP=gy(v7),bL=function(t,n){return nN(t,bV(n))},bD=function(t,n){return nN(t,bK(n))},bF=function(t,n){return nN(t,bH(function(t){return nN(n,bV(t))}))},bW=function(t,n){return nN(t,bH(n))},bU=function(t,n,r){return nN(t,b$(n,r))},bz=function(t,n){return nN(t,bq(n))},bB=function(t,n){return nN(t,bG(n))},bV=gi(v7),b$=gs(v7),bq=gc(v7),bK=go(bn),bH=ga(bu),bZ=bH(nS),bG=gu(bu),bY="IOEither";function bJ(t){var n=n0(bn,h8(t));return{URI:bY,_E:void 0,map:bL,ap:function(t,r){return nN(t,n(r))},of:bS}}function bQ(t){var n=gl(bu,t);return{URI:bY,_E:void 0,map:bL,alt:function(t,r){return nN(t,n(r))}}}var bX=function(t){var n=h5(t);return{URI:bY,_E:void 0,compact:hg(v7,n),separate:hy(v7,n,mt)}},b0={URI:bY,map:bL},b1=rt(b0),b2={URI:bY,map:bL,ap:bD},b3=n1(b2),b4=n2(b2),b5={URI:bY,map:bL,ap:bD,of:bS},b9={URI:bY,map:bL,ap:bD,chain:bW},b6=rs(b9),b8={URI:bY,fromIO:bT},b7=gB(b8),xe=gV(b8,b9),xt=g$(b8,b9),xn={URI:bY,fromEither:nT},xr=rf(xn),xi=rp(xn),xo=rh(xn,b9),xa=rg(xn,b9),xu=ry(xn,b9),xs=rd(xn),xc=rv(xn,b9),xl=rm(xn),xf=function(t,n,r){return xd(t,n,r)},xd=function(t,n,r){return nN(t,bH(function(t){return nN(n(t),v6(function(n){return nN(r(t,n),bH(function(){return nT(n)}))}))}))},xp=bS(nJ),xh=rn(b0),xm=rc(b9),xg=n3(b2),xy=bS(nY),xv=function(t){return nC(bh(t),v5(mJ(nA)))},xb=function(t){var n=xv(t);return function(t){return nH(t)?n(t):xy}},xx=function(t){return function(n){return function(){var r=t(0,nZ(n))();if(nB(r))return r;for(var i=[r.right],o=1;o<n.length;o++){var a=t(o,n[o])();if(nB(a))return a;i.push(a.right)}return nq(i)}}},x_=function(t){var n=xx(t);return function(t){return nH(t)?n(t):xy}},xS=function(t){return xb(function(n,r){return t(r)})},xT=xS(nS),xw=function(t){return x_(function(n,r){return t(r)})},xO=xw(nS),xk=n4(b2),xI=ro(b5),xC=function(t){return n4(bn)(h4(t))};let xM=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:bY,map:bL,alt:bB},ApT:xy,Applicative:b5,ApplicativePar:b5,ApplicativeSeq:{URI:bY,map:bL,ap:bF,of:bS},ApplyPar:b2,Bifunctor:{URI:bY,bimap:bU,mapLeft:bz},Chain:b9,Do:xp,FromEither:xn,FromIO:b8,Functor:b0,Monad:{URI:bY,map:bL,ap:bD,of:bS,chain:bW},MonadIO:{URI:bY,map:bL,ap:bD,of:bS,chain:bW,fromIO:bT},MonadThrow:{URI:bY,map:bL,ap:bD,of:bS,chain:bW,throwError:b_},Pointed:{URI:bY,of:bS},URI:bY,alt:bG,altW:bG,ap:bK,apFirst:b3,apFirstW:b3,apS:xg,apSW:xg,apSecond:b4,apSecondW:b4,apW:bK,bimap:b$,bind:xm,bindTo:xh,bindW:xm,bracket:xf,bracketW:xd,chain:bH,chainEitherK:xa,chainEitherKW:xa,chainFirst:b6,chainFirstEitherK:xu,chainFirstEitherKW:xu,chainFirstIOK:xt,chainFirstW:b6,chainIOK:xe,chainOptionK:xo,chainW:bH,filterOrElse:xc,filterOrElseW:xc,flap:b1,flatten:bZ,flattenW:bZ,fold:bk,foldW:bk,fromEither:nT,fromEitherK:xl,fromIO:bT,fromIOK:b7,fromOption:xr,fromOptionK:xi,fromPredicate:xs,getAltIOValidation:bQ,getApplicativeIOValidation:bJ,getApplyMonoid:xI,getApplySemigroup:xk,getCompactable:bX,getFilterable:function(t){var n=h9(t),r=bX(t),i=gk(v7,n),o=gI(v7,n),a=gC(v7,n),u=gM(v7,n);return{URI:bY,_E:void 0,map:bL,compact:r.compact,separate:r.separate,filter:function(t,n){return nN(t,i(n))},filterMap:function(t,n){return nN(t,o(n))},partition:function(t,n){return nN(t,a(n))},partitionMap:function(t,n){return nN(t,u(n))}}},getIOValidation:function(t){var n=bJ(t),r=bQ(t);return{URI:bY,_E:void 0,map:bL,ap:n.ap,of:bS,chain:bW,bimap:bU,mapLeft:bz,alt:r.alt,fromIO:bT,throwError:b_}},getOrElse:bI,getOrElseW:bI,getSemigroup:xC,ioEither:{URI:bY,bimap:bU,mapLeft:bz,map:bL,of:bS,ap:bD,chain:bW,alt:bB,fromIO:bT,throwError:b_},left:b_,leftIO:bw,map:bV,mapLeft:bq,match:bO,matchE:bk,matchEW:bk,matchW:bO,of:bS,orElse:bE,orElseFirst:bj,orElseFirstIOK:bN,orElseFirstW:bj,orElseW:bE,orLeft:bA,right:bS,rightIO:bT,sequenceArray:xT,sequenceSeqArray:xO,swap:bP,throwError:b_,toUnion:bR,traverseArray:xS,traverseArrayWithIndex:xb,traverseReadonlyArrayWithIndex:xb,traverseReadonlyArrayWithIndexSeq:x_,traverseReadonlyNonEmptyArrayWithIndex:xv,traverseReadonlyNonEmptyArrayWithIndexSeq:xx,traverseSeqArray:xw,traverseSeqArrayWithIndex:x_,tryCatch:bC,tryCatchK:bM},Symbol.toStringTag,{value:"Module"}));function xR(t){return nC(nz,t.of)}function xE(t){return nT(t.of(nU))}function xj(t){return function(n){return t.map(n,nz)}}function xN(t){return nC(p3,t.of)}function xA(t){var n=xN(t);return function(t){return nC(t,n)}}function xP(t){var n=xq(t),r=xA(t);return function(t){return n(r(t))}}function xL(t){return function(n){return nC(n,t.of)}}function xD(t){var n=xq(t),r=xL(t);return function(t){return n(r(t))}}function xF(t){return function(n){return function(r){return t.of(dX(n)(r))}}}function xW(t){return nC(d1,t.of)}function xU(t){return function(n,r){return function(i){return t.map(i,pH(n,r))}}}function xz(t){return function(n,r){return function(i){return t.chain(i,pH(n,r))}}}function xB(t){return function(n){return function(r){return t.chain(r,pH(n,t.of))}}}function xV(t){return re(t,pf)}function x$(t){return n0(t,ph)}function xq(t){var n=xE(t);return function(r){return function(i){return t.chain(i,pH(function(){return n()},r))}}}function xK(t){var n=xR(t);return function(r){return function(i){return t.chain(i,pH(r,n))}}}let xH=Object.freeze(Object.defineProperty({__proto__:null,alt:xK,ap:x$,chain:xq,chainNullableK:xP,chainOptionK:xD,fromEither:xW,fromF:xj,fromNullable:xN,fromNullableK:xA,fromOptionK:xL,fromPredicate:xF,getOptionM:function(t){var n=x$(t),r=xV(t),i=xq(t),o=xK(t),a=xz(t),u=xB(t),s=xE(t);return{map:function(t,n){return nN(t,r(n))},ap:function(t,r){return nN(t,n(r))},of:xR(t),chain:function(t,n){return nN(t,i(n))},alt:function(t,n){return nN(t,o(n))},fold:function(t,n,r){return nN(t,a(n,r))},getOrElse:function(t,n){return nN(t,u(n))},fromM:xj(t),none:function(){return s()}}},getOrElse:xB,map:xV,match:xU,matchE:xz,some:xR,zero:xE},Symbol.toStringTag,{value:"Module"}));var xZ=xR(bt),xG=xF(bt),xY=xW(bt),xJ=xj(v7),xQ=v5(d1),xX=xU(v7),x0=xz(ba),x1=xB(bu),x2=v5(p7),x3=v5(p8),x4=xN(bt),x5=xA(bt),x9=xP(bu),x6=xL(bt),x8=xD(bu),x7=xV(v7),_e=x$(bn),_t=xq(bu),_n=_t(nS),_r=xK(bu),_i=xE(bt),_o=_i(),_a=hg(v7,pR),_u=hy(v7,pR,pf),_s=gk(v7,pP),_c=gI(v7,pP),_l=gC(v7,pP),_f=gM(v7,pP),_d=function(t,n){return nN(t,x7(n))},_p=function(t,n){return nN(t,_e(n))},_h=function(t,n){return nN(t,_t(n))},_m=function(t,n){return nN(t,_r(n))},_g=function(t,n){return nN(t,_s(n))},_y=function(t,n){return nN(t,_c(n))},_v=function(t,n){return nN(t,_l(n))},_b=function(t,n){return nN(t,_f(n))},_x="IOOption",__={URI:_x,map:_d},_S=rt(__),_T={URI:_x,of:xZ},_w={URI:_x,map:_d,ap:_p},_O=n1(_w),_k=n2(_w),_I={URI:_x,map:_d,ap:_p,chain:_h},_C=rs(_I),_M={URI:_x,zero:_i},_R=u$(_M,_T),_E={URI:_x,fromIO:xJ},_j=gB(_E),_N=gV(_E,_I),_A=g$(_E,_I),_P={URI:_x,fromEither:xY},_L=rm(_P),_D=rg(_P,_I),_F=ry(_P,_I),_W=xZ(nJ),_U=rn(__),_z=rc(_I),_B=n3(_w),_V=xZ(nY),_$=function(t){return nC(bh(t),v5(ha(nA)))},_q=function(t){var n=_$(t);return function(t){return nH(t)?n(t):_V}};let _K=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:_x,map:_d,alt:_m},Alternative:{URI:_x,map:_d,ap:_p,of:xZ,alt:_m,zero:_i},ApT:_V,Applicative:{URI:_x,map:_d,ap:_p,of:xZ},Apply:_w,Chain:_I,Compactable:{URI:_x,compact:_a,separate:_u},Do:_W,Filterable:{URI:_x,map:_d,compact:_a,separate:_u,filter:_g,filterMap:_y,partition:_v,partitionMap:_b},FromEither:_P,FromIO:_E,Functor:__,Monad:{URI:_x,map:_d,ap:_p,of:xZ,chain:_h},MonadIO:{URI:_x,map:_d,ap:_p,of:xZ,chain:_h,fromIO:xJ},Pointed:_T,Zero:_M,alt:_r,altW:_r,ap:_e,apFirst:_O,apS:_B,apSecond:_k,bind:_z,bindTo:_U,chain:_t,chainEitherK:_D,chainFirst:_C,chainFirstEitherK:_F,chainFirstIOK:_A,chainIOK:_N,chainNullableK:x9,chainOptionK:x8,compact:_a,filter:_s,filterMap:_c,flap:_S,flatten:_n,fold:x0,fromEither:xY,fromEitherK:_L,fromIO:xJ,fromIOEither:xQ,fromIOK:_j,fromNullable:x4,fromNullableK:x5,fromOption:nT,fromOptionK:x6,fromPredicate:xG,getOrElse:x1,getOrElseW:x1,guard:_R,map:x7,match:xX,matchE:x0,matchEW:x0,matchW:xX,none:_o,of:xZ,partition:_l,partitionMap:_f,separate:_u,some:xZ,toNullable:x3,toUndefined:x2,traverseReadonlyArrayWithIndex:_q,traverseReadonlyNonEmptyArrayWithIndex:_$,zero:_i},Symbol.toStringTag,{value:"Module"}));var _H=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 _Z=Object.freeze(Object.defineProperty({__proto__:null,IORef:_H,newIORef:function(t){return function(){return new _H(t)}}},Symbol.toStringTag,{value:"Module"})),_G=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var _Y=function(t){return mU(function(){return JSON.parse(t)},nS)},_J=function(t){return mU(function(){var n=JSON.stringify(t);if("string"!=typeof n)throw Error("Converting unsupported structure to JSON");return n},nS)};let _Q=Object.freeze(Object.defineProperty({__proto__:null,parse:_Y,stringify:_J},Symbol.toStringTag,{value:"Module"})),_X=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var _0=function(t){return new Map(t)};function _1(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 _2=function(t){return t.size},_3=function(t){return 0===t.size};function _4(t){var n=So(t);return function(r,i){if(void 0===i){var o=_4(t);return function(t){return o(r,t)}}return nW(n(r,i))}}function _5(t){return function(n,r){if(void 0===r){var i=_5(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 _9=function(t){return function(n){return Array.from(n.keys()).sort(t.compare)}},_6=function(t){return function(n){return Array.from(n.values()).sort(t.compare)}};function _8(t){var n=_9(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 _7=function(t){return _8(t)(function(t,n){return[t,n]})},Se=function(t){var n=Si(t);return function(t,r){var i=n(t);return function(n){var o=i(n);if(nF(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}}},St=function(t){var n=Si(t);return function(t){return function(r){var i=n(t,r);if(nW(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},Sn=function(t){var n=Sr(t);return function(t,r){return n(t,function(){return r})}},Sr=function(t){var n=Si(t);return function(t,r){return function(i){var o=n(t,i);if(nF(o))return nU;var a=o.value,u=a[0],s=a[1],c=r(s);if(c===s)return nz(i);var l=new Map(i);return l.set(u,c),nz(l)}}};function Si(t){return function(n,r){if(void 0===r){var i=Si(t);return function(t){return i(n,t)}}for(var o,a=r.entries();!(o=a.next()).done;){var u=o.value,s=u[0],c=u[1];if(t.equals(s,n))return nz([s,c])}return nU}}function So(t){var n=Si(t);return function(r,i){if(void 0===i){var o=So(t);return function(t){return o(r,t)}}return nN(n(r,i),pl(function(t){return t[0],t[1]}))}}function Sa(t,n){var r=Si(t);return function(i,o){if(void 0===o){var a=Sa(t,n);return function(t){return a(t,i)}}for(var u,s=i.entries();!(u=s.next()).done;){var c=u.value,l=c[0],f=c[1],d=r(l,o);if(nF(d)||!t.equals(l,d.value[0])||!n.equals(f,d.value[1]))return!1}return!0}}var Su=new Map;function Ss(t,n){var r=Sa(t,n);return rx(function(t,n){return r(t,n)&&r(n,t)})}var Sc=function(t,n){return new Map([[t,n]])},Sl=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},Sf=function(t){return function(n){for(var r,i=new Map,o=new Map,a=n.entries();!(r=a.next()).done;){var u=r.value,s=u[0],c=t(s,u[1]);nB(c)?i.set(s,c.left):o.set(s,c.right)}return uC(i,o)}};function Sd(t){return function(n){for(var r,i=new Map,o=new Map,a=n.entries();!(r=a.next()).done;){var u=r.value,s=u[0],c=u[1];t(s,c)?o.set(s,c):i.set(s,c)}return uC(i,o)}}var Sp=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]);nW(s)&&i.set(u,s.value)}return i}};function Sh(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 Sm=function(t,n){return Sl(t,function(t,r){return n(r)})},Sg=function(t,n){return Sx(t,function(t,r){return n(r)})},Sy=function(t,n){return S_(t,function(t,r){return n(r)})},Sv=function(t,n){return SS(t,function(t,r){return n(r)})},Sb=function(t,n){return ST(t,function(t,r){return n(r)})},Sx=function(t,n){return nN(t,Sh(n))},S_=function(t,n){return nN(t,Sp(n))},SS=function(t,n){return nN(t,Sd(n))},ST=function(t,n){return nN(t,Sf(n))},Sw=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];nW(u)&&r.set(a,u.value)}return r},SO=function(t){return function(n){return Sg(n,t)}},Sk=function(t){return function(n){return Sy(n,t)}},SI=function(t){return function(n){return Sm(n,t)}},SC=function(t){return function(n){return Sl(n,t)}},SM=function(t){return function(n){return Sv(n,t)}},SR=function(t){return function(n){return Sb(n,t)}},SE=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];nB(s)?r.set(u,s.left):i.set(u,s.right)}return uC(r,i)},Sj="ReadonlyMap",SN=function(t,n){var r=SJ(t,n);return{concat:function(t,n){return r(n)(t)}}},SA=function(t,n){return{concat:SN(t,n).concat,empty:Su}},SP=function(t,n){var r=SQ(t,n);return{concat:function(t,n){return r(n)(t)}}},SL=function(t){return function(){var n=SX(t);return{concat:function(t,r){return n(r)(t)}}}},SD={URI:Sj,map:Sm},SF=rt(SD),SW=function(){return{URI:Sj,_E:void 0,map:Sm,mapWithIndex:Sl}},SU={URI:Sj,compact:Sw,separate:SE},Sz=function(t){var n=Sq(t);return function(t,r){return n(t,function(t,n,i){return r(n,i)})}},SB=function(t){var n=SK(t);return function(t){var r=n(t);return function(t){return r(function(n,r){return t(r)})}}},SV=function(t){var n=SH(t);return function(t,r){return n(t,function(t,n,i){return r(n,i)})}},S$=function(t){var n=Sz(t),r=SB(t),i=SV(t);return{URI:Sj,_E:void 0,reduce:function(t,r,i){return nN(t,n(r,i))},foldMap:function(t){var n=r(t);return function(t,r){return nN(t,n(r))}},reduceRight:function(t,n,r){return nN(t,i(n,r))}}},Sq=function(t){var n=_9(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}}},SK=function(t){var n=_9(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}}}},SH=function(t){var n=_9(t);return function(t,r){return function(i){for(var o=t,a=n(i),u=a.length,s=u-1;s>=0;s--){var c=a[s];o=r(c,i.get(c),o)}return o}}},SZ=function(t){var n=S$(t),r=Sq(t),i=SK(t),o=SH(t);return{URI:Sj,_E:void 0,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:function(t,n,i){return nN(t,r(n,i))},foldMapWithIndex:function(t){var n=i(t);return function(t,r){return nN(t,n(r))}},reduceRightWithIndex:function(t,n,r){return nN(t,o(n,r))}}},SG=function(t){var n=SY(t),r=S$(t);return{URI:Sj,_E:void 0,map:Sm,reduce:r.reduce,foldMap:r.foldMap,reduceRight:r.reduceRight,traverse:n.traverse,sequence:n.sequence}},SY=function(t){var n=SZ(t),r=_9(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,nA)}};return{URI:Sj,_E:void 0,map:Sm,mapWithIndex:Sl,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:n.reduceWithIndex,foldMapWithIndex:n.foldMapWithIndex,reduceRightWithIndex:n.reduceRightWithIndex,traverse:o,sequence:a,traverseWithIndex:i}},SJ=function(t,n){var r=So(t);return function(t){return function(i){if(_3(i))return t;if(_3(t))return i;for(var o,a=new Map,u=i.entries();!(o=u.next()).done;){var s=o.value,c=s[0],l=s[1],f=r(c)(t);nW(f)?a.set(c,n.concat(l,f.value)):a.set(c,l)}for(var d=t.entries();!(o=d.next()).done;){var p=o.value,c=p[0],l=p[1],f=r(c)(a);nF(f)&&a.set(c,l)}return a}}},SQ=function(t,n){var r=So(t);return function(t){return function(i){if(_3(i)||_3(t))return Su;for(var o,a=new Map,u=i.entries();!(o=u.next()).done;){var s=o.value,c=s[0],l=s[1],f=r(c)(t);nW(f)&&a.set(c,n.concat(l,f.value))}return a}}},SX=function(t){var n=_4(t);return function(t){return function(r){if(_3(r))return t;if(_3(t))return r;for(var i,o=new Map,a=r.entries();!(i=a.next()).done;){var u=i.value,s=u[0],c=u[1];n(s)(t)||o.set(s,c)}for(var l=t.entries();!(i=l.next()).done;){var f=i.value,s=f[0],c=f[1];n(s)(r)||o.set(s,c)}return o}}};let S0=Object.freeze(Object.defineProperty({__proto__:null,Compactable:SU,Filterable:{URI:Sj,map:Sm,compact:Sw,separate:SE,filter:Sg,filterMap:Sy,partition:Sv,partitionMap:Sb},Functor:SD,URI:Sj,collect:_8,compact:Sw,deleteAt:St,difference:SX,elem:_5,empty:Su,filter:SO,filterMap:Sk,filterMapWithIndex:Sp,filterWithIndex:Sh,flap:SF,foldMap:SB,foldMapWithIndex:SK,fromFoldable:function(t,n,r){return function(i){var o=Si(t);return r.reduce(i,new Map,function(t,r){var i=r[0],a=r[1],u=o(i,t);return nW(u)?t.set(u.value[0],n.concat(u.value[1],a)):t.set(i,a),t})}},fromMap:_0,getDifferenceMagma:SL,getEq:Ss,getFilterableWithIndex:function(){return{URI:Sj,_E:void 0,map:Sm,mapWithIndex:Sl,compact:Sw,separate:SE,filter:Sg,filterMap:Sy,partition:Sv,partitionMap:Sb,partitionMapWithIndex:ST,partitionWithIndex:SS,filterMapWithIndex:S_,filterWithIndex:Sx}},getFoldable:S$,getFoldableWithIndex:SZ,getFunctorWithIndex:SW,getIntersectionSemigroup:SP,getMonoid:function(t,n){var r=Si(t);return{concat:function(t,i){if(_3(t))return i;if(_3(i))return t;for(var o,a=new Map(t),u=i.entries();!(o=u.next()).done;){var s=o.value,c=s[0],l=s[1],f=r(c,t);nW(f)?a.set(f.value[0],n.concat(f.value[1],l)):a.set(c,l)}return a},empty:Su}},getShow:_1,getTraversable:SG,getTraversableWithIndex:SY,getUnionMonoid:SA,getUnionSemigroup:SN,getWitherable:function(t){var n=SY(t);return{URI:Sj,_E:void 0,map:Sm,compact:Sw,separate:SE,filter:Sg,filterMap:Sy,partition:Sv,partitionMap:Sb,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,traverse:n.traverse,sequence:n.sequence,mapWithIndex:Sl,reduceWithIndex:n.reduceWithIndex,foldMapWithIndex:n.foldMapWithIndex,reduceRightWithIndex:n.reduceRightWithIndex,traverseWithIndex:n.traverseWithIndex,wilt:uU(n,SU),wither:uz(n,SU)}},insertAt:Se,intersection:SQ,isEmpty:_3,isSubmap:Sa,keys:_9,lookup:So,lookupWithKey:Si,map:SI,mapWithIndex:SC,member:_4,modifyAt:Sr,partition:SM,partitionMap:SR,partitionMapWithIndex:Sf,partitionWithIndex:Sd,pop:function(t){var n=So(t),r=St(t);return function(t){var i=r(t);return function(r){return nN(n(t,r),pl(function(t){return[t,i(r)]}))}}},readonlyMap:{URI:Sj,map:Sm,compact:Sw,separate:SE,filter:Sg,filterMap:Sy,partition:Sv,partitionMap:Sb},reduce:Sz,reduceRight:SV,reduceRightWithIndex:SH,reduceWithIndex:Sq,separate:SE,singleton:Sc,size:_2,toMap:function(t){return new Map(t)},toReadonlyArray:_7,toUnfoldable:function(t,n){var r=_7(t);return function(t){var i=r(t),o=i.length;return n.unfold(0,function(t){return t<o?nz([i[t],t+1]):nU})}},union:SJ,updateAt:Sn,upsertAt:Se,values:_6},Symbol.toStringTag,{value:"Module"}));var S1=globalThis&&globalThis.__assign||function(){return(S1=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)},S2=function(t){return function(n){return Array.from(n.keys()).sort(t.compare)}},S3=function(t){return function(n){return Array.from(n.values()).sort(t.compare)}};function S4(t){var n=S2(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 S5(t){return S4(t)(function(t,n){return[t,n]})}var S9=function(t){var n=Te(t);return function(t,r){var i=n(t);return function(n){var o=i(n);if(nF(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}}},S6=function(t){var n=Te(t);return function(t){return function(r){var i=n(t,r);if(nW(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},S8=function(t){var n=S7(t);return function(t,r){return n(t,function(){return r})}},S7=function(t){var n=Te(t);return function(t,r){return function(i){var o=n(t,i);if(nF(o))return nU;var a=new Map(i);return a.set(o.value[0],r(o.value[1])),nz(a)}}};function Te(t){return function(n,r){if(void 0===r){var i=Te(t);return function(t){return i(n,t)}}for(var o,a=r.entries();!(o=a.next()).done;){var u=o.value,s=u[0],c=u[1];if(t.equals(s,n))return nz([s,c])}return nU}}var Tt=function(t,n){return new Map([[t,n]])},Tn=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},Tr=function(t){return function(n){for(var r,i=new Map,o=new Map,a=n.entries();!(r=a.next()).done;){var u=r.value,s=u[0],c=t(s,u[1]);nB(c)?i.set(s,c.left):o.set(s,c.right)}return uC(i,o)}};function Ti(t){return function(n){for(var r,i=new Map,o=new Map,a=n.entries();!(r=a.next()).done;){var u=r.value,s=u[0],c=u[1];t(s,c)?o.set(s,c):i.set(s,c)}return uC(i,o)}}var To=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]);nW(s)&&i.set(u,s.value)}return i}};function Ta(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 Tu=function(t,n){return Tn(t,function(t,r){return n(r)})},Ts=function(t,n){return Td(t,function(t,r){return n(r)})},Tc=function(t,n){return Tp(t,function(t,r){return n(r)})},Tl=function(t,n){return Th(t,function(t,r){return n(r)})},Tf=function(t,n){return Tm(t,function(t,r){return n(r)})},Td=function(t,n){return nN(t,Ta(n))},Tp=function(t,n){return nN(t,To(n))},Th=function(t,n){return nN(t,Ti(n))},Tm=function(t,n){return nN(t,Tr(n))},Tg=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];nW(u)&&r.set(a,u.value)}return r},Ty=function(t){return function(n){return Ts(n,t)}},Tv=function(t){return function(n){return Tc(n,t)}},Tb=function(t){return function(n){return Tu(n,t)}},Tx=function(t){return function(n){return Tn(n,t)}},T_=function(t){return function(n){return Tl(n,t)}},TS=function(t){return function(n){return Tf(n,t)}},TT=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];nB(s)?r.set(u,s.left):i.set(u,s.right)}return uC(r,i)},Tw=function(t,n){var r=TL(t,n);return{concat:function(t,n){return r(n)(t)}}},TO=function(t,n){return{concat:Tw(t,n).concat,empty:new Map}},Tk=function(t,n){var r=TD(t,n);return{concat:function(t,n){return r(n)(t)}}},TI=function(t){return function(){var n=TF(t);return{concat:function(t,r){return n(r)(t)}}}},TC=function(t){return S1(S1({},S$(t)),{URI:"Map"})},TM=function(t){return S1(S1({},SZ(t)),{URI:"Map"})},TR=function(t){var n=TM(t),r=S2(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:Tu,mapWithIndex:Tn,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:n.reduceWithIndex,foldMapWithIndex:n.foldMapWithIndex,reduceRightWithIndex:n.reduceRightWithIndex,traverse:o,sequence:a,traverseWithIndex:i}},TE={URI:"Map",map:Tu},Tj=rt(TE),TN={URI:"Map",compact:Tg,separate:TT},TA={URI:"Map",map:Tu,compact:Tg,separate:TT,filter:Ts,filterMap:Tc,partition:Tl,partitionMap:Tf},TP=function(t){return new Map(t)},TL=function(t,n){var r=SJ(t,n);return function(t){return function(n){return _3(n)?TP(t):_3(t)?TP(n):r(t)(n)}}},TD=function(t,n){var r=SQ(t,n);return function(t){return function(n){return _3(n)||_3(t)?new Map:r(t)(n)}}},TF=function(t){var n=SX(t);return function(t){return function(r){return _3(r)?TP(t):_3(t)?TP(r):n(t)(r)}}},TW=new Map;let TU=Object.freeze(Object.defineProperty({__proto__:null,Compactable:TN,Filterable:TA,Functor:TE,URI:"Map",collect:S4,compact:Tg,deleteAt:S6,difference:TF,elem:_5,empty:TW,filter:Ty,filterMap:Tv,filterMapWithIndex:To,filterWithIndex:Ta,flap:Tj,foldMap:SB,foldMapWithIndex:SK,fromFoldable:function(t,n,r){return function(i){var o=Te(t);return r.reduce(i,new Map,function(t,r){var i=r[0],a=r[1],u=o(i,t);return nW(u)?t.set(u.value[0],n.concat(u.value[1],a)):t.set(i,a),t})}},getDifferenceMagma:TI,getEq:Ss,getFilterableWithIndex:function(){return{URI:"Map",_E:void 0,map:Tu,mapWithIndex:Tn,compact:Tg,separate:TT,filter:Ts,filterMap:Tc,partition:Tl,partitionMap:Tf,partitionMapWithIndex:Tm,partitionWithIndex:Th,filterMapWithIndex:Tp,filterWithIndex:Td}},getFoldable:TC,getFoldableWithIndex:TM,getIntersectionSemigroup:Tk,getMonoid:function(t,n){var r=Te(t);return{concat:function(t,i){if(_3(t))return i;if(_3(i))return t;for(var o,a=new Map(t),u=i.entries();!(o=u.next()).done;){var s=o.value,c=s[0],l=s[1],f=r(c,t);nW(f)?a.set(f.value[0],n.concat(f.value[1],l)):a.set(c,l)}return a},empty:new Map}},getShow:_1,getTraversableWithIndex:TR,getUnionMonoid:TO,getUnionSemigroup:Tw,getWitherable:function(t){var n=TR(t);return{URI:"Map",_E:void 0,map:Tu,compact:Tg,separate:TT,filter:Ts,filterMap:Tc,partition:Tl,partitionMap:Tf,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,traverse:n.traverse,sequence:n.sequence,mapWithIndex:Tn,reduceWithIndex:n.reduceWithIndex,foldMapWithIndex:n.foldMapWithIndex,reduceRightWithIndex:n.reduceRightWithIndex,traverseWithIndex:n.traverseWithIndex,wilt:uU(n,TN),wither:uz(n,TN)}},insertAt:S9,intersection:TD,isEmpty:_3,isSubmap:Sa,keys:S2,lookup:So,lookupWithKey:Te,map:Tb,mapWithIndex:Tx,map_:TA,member:_4,modifyAt:S7,partition:T_,partitionMap:TS,partitionMapWithIndex:Tr,partitionWithIndex:Ti,pop:function(t){var n=So(t),r=S6(t);return function(t){var i=r(t);return function(r){return nN(n(t,r),pl(function(t){return[t,i(r)]}))}}},reduce:Sz,reduceRight:SV,reduceRightWithIndex:SH,reduceWithIndex:Sq,separate:TT,singleton:Tt,size:_2,toArray:S5,toUnfoldable:function(t,n){var r=S5(t);return function(t){var i=r(t),o=i.length;return n.unfold(0,function(t){return t<o?nz([i[t],t+1]):nU})}},union:TL,updateAt:S8,upsertAt:S9,values:S3},Symbol.toStringTag,{value:"Module"})),Tz=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),TB=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),TV=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),T$=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Tq=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var TK=function(t){return{concat:r4(t).concat,empty:t.top}},TH=function(t){return{concat:r5(t).concat,empty:t.bottom}},TZ=function(t){return{concat:rQ(t).concat,empty:t.empty}},TG=function(t){var n={};for(var r in t)nQ.call(t,r)&&(n[r]=t[r].empty);return{concat:r6(t).concat,empty:n}},TY=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return{concat:r8.apply(il,t).concat,empty:t.map(function(t){return t.empty})}},TJ=function(t){return r2(t)(t.empty)},TQ={concat:ir.concat,empty:void 0},TX={concat:io.concat,empty:!0},T0={concat:ia.concat,empty:!1},T1=function(){return TZ(g_())},T2={concat:iu.concat,empty:""},T3={concat:is.concat,empty:0},T4={concat:ic.concat,empty:1};let T5=Object.freeze(Object.defineProperty({__proto__:null,concatAll:TJ,fold:TJ,getDualMonoid:TZ,getEndomorphismMonoid:T1,getFunctionMonoid:nv,getJoinMonoid:TH,getMeetMonoid:TK,getStructMonoid:TG,getTupleMonoid:TY,max:TH,min:TK,monoidAll:TX,monoidAny:T0,monoidProduct:T4,monoidString:T2,monoidSum:T3,monoidVoid:TQ,reverse:TZ,struct:TG,tuple:TY},Symbol.toStringTag,{value:"Module"})),T9=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var T6=function(t,n,r){return function(i){return -1===i?t():0===i?n():r()}},T8=function(t){return -1===t?1:1===t?-1:0},T7={equals:function(t,n){return t===n}},we={concat:function(t,n){return 0!==t?t:n}},wt={concat:we.concat,empty:0},wn=function(t){return t<=-1?-1:t>=1?1:0};let wr=Object.freeze(Object.defineProperty({__proto__:null,Eq:T7,Monoid:wt,Semigroup:we,eqOrdering:T7,invert:T8,match:T6,matchW:T6,monoidOrdering:wt,reverse:T8,semigroupOrdering:we,sign:wn},Symbol.toStringTag,{value:"Module"})),wi=Object.freeze(Object.defineProperty({__proto__:null,pipe:nN,pipeable:function(t){var n,r,i,o,a,u,s,c,l,f,d,p,h,m,g,y={};if("function"==typeof t.map){var v=function(n){return function(r){return t.map(r,n)}};y.map=v}if("function"==typeof t.contramap){var b=function(n){return function(r){return t.contramap(r,n)}};y.contramap=b}if("function"==typeof t.mapWithIndex){var x=function(n){return function(r){return t.mapWithIndex(r,n)}};y.mapWithIndex=x}if("function"==typeof t.ap){var _=function(n){return function(r){return t.ap(r,n)}},S=function(n){return function(r){return t.ap(t.map(r,function(t){return function(){return t}}),n)}};y.ap=_,y.apFirst=S,y.apSecond=function(n){return function(r){return t.ap(t.map(r,function(){return function(t){return t}}),n)}}}if("function"==typeof t.chain){var T=function(n){return function(r){return t.chain(r,n)}},w=function(n){return function(r){return t.chain(r,function(r){return t.map(n(r),function(){return r})})}},O=function(n){return t.chain(n,nS)};y.chain=T,y.chainFirst=w,y.flatten=O}if("function"==typeof t.bimap){var k=function(n,r){return function(i){return t.bimap(i,n,r)}},I=function(n){return function(r){return t.mapLeft(r,n)}};y.bimap=k,y.mapLeft=I}if("function"==typeof t.extend){var C=function(n){return function(r){return t.extend(r,n)}},M=function(n){return t.extend(n,nS)};y.extend=C,y.duplicate=M}if("function"==typeof t.reduce){var R=function(n,r){return function(i){return t.reduce(i,n,r)}},E=function(n){var r=t.foldMap(n);return function(t){return function(n){return r(n,t)}}},j=function(n,r){return function(i){return t.reduceRight(i,n,r)}};y.reduce=R,y.foldMap=E,y.reduceRight=j}if("function"==typeof t.reduceWithIndex){var N=function(n,r){return function(i){return t.reduceWithIndex(i,n,r)}},A=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=N,y.foldMapWithIndex=A,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)}},Z=function(n){return"Left"===n._tag?t.throwError(n.left):t.of(n.right)},G=function(n,r){return function(i){return n(i)?t.of(i):t.throwError(r(i))}},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=Z,y.fromPredicate=G,y.filterOrElse=Y}return y}},Symbol.toStringTag,{value:"Module"})),wo=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),wa=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var wu=function(){return Math.random()};function ws(t,n){return nN(wu,v5(function(r){return Math.floor((n-t+1)*r+t)}))}var wc=nN(wu,v5(function(t){return t<.5})),wl=function(t){return nN(ws(0,t.length-1),v5(function(n){return t[n]}))};let wf=Object.freeze(Object.defineProperty({__proto__:null,random:wu,randomBool:wc,randomElem:wl,randomInt:ws,randomRange:function(t,n){return nN(wu,v5(function(r){return(n-t)*r+t}))}},Symbol.toStringTag,{value:"Module"}));var wd=m8(ya),wp=m6(ya),wh=m7(yi),wm=ge(yi),wg=gf(yi),wy=gd(yd),wv=gp(yd),wb=gv(yi),wx=gh(yd),w_=gm(yd),wS=gg(yd),wT=gy(yi),ww=function(t,n){return nN(t,wR(n))},wO=function(t,n,r){return nN(t,wE(n,r))},wk=function(t,n){return nN(t,wj(n))},wI=function(t,n){return nN(t,wN(n))},wC=function(t,n){return nN(t,wA(n))},wM=function(t,n){return nN(t,wL(n))},wR=gi(yi),wE=gs(yi),wj=gc(yi),wN=go(yu),wA=ga(yd),wP=wA(nS),wL=gu(yd),wD="ReaderEither",wF=function(t){var n=h5(t);return{URI:wD,_E:void 0,compact:hg(yi,n),separate:hy(yi,n,mt)}};function wW(t){var n=n0(yu,h8(t));return{URI:wD,_E:void 0,map:ww,ap:function(t,r){return nN(t,n(r))},of:wp}}function wU(t){var n=gl(yd,t);return{URI:wD,_E:void 0,map:ww,alt:function(t,r){return nN(t,n(r))}}}var wz={URI:wD,map:ww},wB=rt(wz),wV={URI:wD,map:ww,ap:wI},w$=n1(wV),wq=n2(wV),wK={URI:wD,map:ww,ap:wI,of:wp},wH={URI:wD,map:ww,ap:wI,chain:wC},wZ=rs(wH),wG={URI:wD,fromReader:wh},wY=yk(wG),wJ=yI(wG),wQ=yC(wG),wX=yM(wG,wH),w0=yR(wG,wH),w1={URI:wD,fromEither:nT},w2=rf(w1),w3=rp(w1),w4=rh(w1,wH),w5=rg(w1,wH),w9=ry(w1,wH),w6=rd(w1),w8=rv(w1,wH),w7=rm(w1),Oe=wp(nJ),Ot=rn(wz),On=rc(wH),Or=n3(wV),Oi=wp(nY),Oo=function(t){return nC(yb(t),g0(mJ(nA)))},Oa=function(t){var n=Oo(t);return function(t){return nH(t)?n(t):Oi}},Ou=function(t){return Oa(function(n,r){return t(r)})},Os=Ou(nS),Oc=n4(wV),Ol=ro(wK),Of=function(t){return n4(yu)(h4(t))};let Od=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:wD,map:ww,alt:wM},ApT:Oi,Applicative:wK,Apply:wV,Bifunctor:{URI:wD,bimap:wO,mapLeft:wk},Chain:wH,Do:Oe,FromEither:w1,FromReader:wG,Functor:wz,Monad:{URI:wD,map:ww,ap:wI,of:wp,chain:wC},MonadThrow:{URI:wD,map:ww,ap:wI,of:wp,chain:wC,throwError:wd},Pointed:{URI:wD,of:wp},URI:wD,alt:wL,altW:wL,ap:wN,apFirst:w$,apFirstW:w$,apS:Or,apSW:Or,apSecond:wq,apSecondW:wq,apW:wN,ask:wY,asks:wJ,asksReaderEither:gZ,asksReaderEitherW:gZ,bimap:wE,bind:On,bindTo:Ot,bindW:On,chain:wA,chainEitherK:w5,chainEitherKW:w5,chainFirst:wZ,chainFirstEitherK:w9,chainFirstEitherKW:w9,chainFirstReaderK:w0,chainFirstReaderKW:w0,chainFirstW:wZ,chainOptionK:w4,chainReaderK:wX,chainReaderKW:wX,chainW:wA,filterOrElse:w8,filterOrElseW:w8,flap:wB,flatten:wP,flattenW:wP,fold:wy,foldW:wy,fromEither:nT,fromEitherK:w7,fromOption:w2,fromOptionK:w3,fromPredicate:w6,fromReader:wh,fromReaderK:wQ,getAltReaderValidation:wU,getApplicativeReaderValidation:wW,getApplyMonoid:Ol,getApplySemigroup:Oc,getCompactable:wF,getFilterable:function(t){var n=h9(t),r=wF(t),i=gk(yi,n),o=gI(yi,n),a=gC(yi,n),u=gM(yi,n);return{URI:wD,_E:void 0,map:ww,compact:r.compact,separate:r.separate,filter:function(t,n){return nN(t,i(n))},filterMap:function(t,n){return nN(t,o(n))},partition:function(t,n){return nN(t,a(n))},partitionMap:function(t,n){return nN(t,u(n))}}},getOrElse:wv,getOrElseW:wv,getReaderValidation:function(t){var n=wW(t),r=wU(t);return{URI:wD,_E:void 0,map:ww,ap:n.ap,of:wp,chain:wC,bimap:wO,mapLeft:wk,alt:r.alt,throwError:wd}},getSemigroup:Of,left:wd,leftReader:wm,local:gH,map:wR,mapLeft:wj,match:wg,matchE:wy,matchEW:wy,matchW:wg,of:wp,orElse:wx,orElseFirst:w_,orElseFirstW:w_,orElseW:wx,orLeft:wS,readerEither:{URI:wD,bimap:wO,mapLeft:wk,map:ww,of:wp,ap:wI,chain:wC,alt:wM,throwError:wd},right:wp,rightReader:wh,sequenceArray:Os,swap:wT,throwError:wd,toUnion:wb,traverseArray:Ou,traverseArrayWithIndex:Oa,traverseReadonlyArrayWithIndex:Oa,traverseReadonlyNonEmptyArrayWithIndex:Oo},Symbol.toStringTag,{value:"Module"}));function Op(t){return function(n){return function(){return t.of(n)}}}function Oh(t){return function(n){return function(r){return function(i){return t.map(r(i),n)}}}}function Om(t){return function(n){return function(r){return function(i){return t.ap(r(i),n(i))}}}}function Og(t){return function(n){return function(r){return function(i){return t.chain(r(i),function(t){return n(t)(i)})}}}}function Oy(t){return function(n){return nC(n,t.of)}}let Ov=Object.freeze(Object.defineProperty({__proto__:null,ap:Om,chain:Og,fromNaturalTransformation:function(t){return function(n){return nC(n,t)}},fromReader:Oy,getReaderM:function(t){var n=Om(t),r=Oh(t),i=Og(t);return{map:function(t,n){return nN(t,r(n))},ap:function(t,r){return nN(t,n(r))},of:Op(t),chain:function(t,n){return nN(t,i(n))},ask:function(){return t.of},asks:function(n){return nC(n,t.of)},local:function(t,n){return function(r){return t(n(r))}},fromReader:Oy(t),fromM:function(t){return function(){return t}}}},map:Oh,of:Op},Symbol.toStringTag,{value:"Module"}));var Ob=function(t){return function(){return Promise.resolve().then(t)}},Ox=function(t,n){return nN(t,Ow(n))},O_=function(t,n){return nN(t,OO(n))},OS=function(t,n){return nN(t,OI(function(t){return nN(n,Ow(t))}))},OT=function(t,n){return nN(t,OI(n))},Ow=function(t){return function(n){return function(){return Promise.resolve().then(n).then(t)}}},OO=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])})}}},Ok=function(t){return function(){return Promise.resolve(t)}},OI=function(t){return function(n){return function(){return Promise.resolve().then(n).then(function(n){return t(n)()})}}},OC=OI(nS),OM="Task",OR={URI:OM,map:Ox},OE=rt(OR),Oj={URI:OM,of:Ok},ON={URI:OM,map:Ox,ap:O_},OA=n1(ON),OP=n2(ON),OL={URI:OM,map:Ox,ap:O_,of:Ok},OD={URI:OM,map:Ox,ap:OS},OF={URI:OM,map:Ox,ap:OS,of:Ok},OW={URI:OM,map:Ox,ap:O_,chain:OT},OU={URI:OM,map:Ox,of:Ok,ap:O_,chain:OT},Oz=rs(OW),OB={URI:OM,fromIO:Ob},OV=gB(OB),O$=gV(OB,OW),Oq=g$(OB,OW),OK=function(){return new Promise(function(t){})},OH=Ok(nJ),OZ=rn(OR),OG=rc(OW),OY=n3(ON),OJ=Ok(nY),OQ=function(t){return function(n){return function(){return Promise.all(n.map(function(n,r){return Promise.resolve().then(function(){return t(r,n)()})}))}}},OX=function(t){var n=OQ(t);return function(t){return nH(t)?n(t):OJ}},O0=function(t){return function(n){return function(){return nG(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,nZ(n))).then(nK))}}},O1=function(t){var n=O0(t);return function(t){return nH(t)?n(t):OJ}},O2=function(t){return OX(function(n,r){return t(r)})},O3=O2(nS),O4=function(t){return O1(function(n,r){return t(r)})},O5=O4(nS),O9=n4(OD),O6=ro(OF);let O8=Object.freeze(Object.defineProperty({__proto__:null,ApT:OJ,ApplicativePar:OL,ApplicativeSeq:OF,ApplyPar:ON,ApplySeq:OD,Chain:OW,Do:OH,FromIO:OB,FromTask:{URI:OM,fromIO:Ob,fromTask:nS},Functor:OR,Monad:OU,MonadIO:{URI:OM,map:Ox,of:Ok,ap:O_,chain:OT,fromIO:Ob},MonadTask:{URI:OM,map:Ox,of:Ok,ap:O_,chain:OT,fromIO:Ob,fromTask:nS},Pointed:Oj,URI:OM,ap:OO,apFirst:OA,apS:OY,apSecond:OP,bind:OG,bindTo:OZ,chain:OI,chainFirst:Oz,chainFirstIOK:Oq,chainIOK:O$,delay:function(t){return function(n){return function(){return new Promise(function(r){setTimeout(function(){Promise.resolve().then(n).then(r)},t)})}}},flap:OE,flatten:OC,fromIO:Ob,fromIOK:OV,fromTask:nS,getMonoid:O6,getRaceMonoid:function(){return{concat:function(t,n){return function(){return Promise.race([Promise.resolve().then(t),Promise.resolve().then(n)])}},empty:OK}},getSemigroup:O9,map:Ow,never:OK,of:Ok,sequenceArray:O3,sequenceSeqArray:O5,task:{URI:OM,map:Ox,of:Ok,ap:O_,chain:OT,fromIO:Ob,fromTask:nS},taskSeq:{URI:OM,map:Ox,of:Ok,ap:OS,chain:OT,fromIO:Ob,fromTask:nS},traverseArray:O2,traverseArrayWithIndex:OX,traverseReadonlyArrayWithIndex:OX,traverseReadonlyArrayWithIndexSeq:O1,traverseReadonlyNonEmptyArrayWithIndex:OQ,traverseReadonlyNonEmptyArrayWithIndexSeq:O0,traverseSeqArray:O4,traverseSeqArrayWithIndex:O1},Symbol.toStringTag,{value:"Module"}));var O7=Oy(Oj),ke=nC(Ob,nT),kt=function(t,n){return nN(t,ko(n))},kn=function(t,n){return nN(t,ka(n))},kr=function(t,n){return nN(t,ks(function(t){return nN(n,ko(t))}))},ki=function(t,n){return nN(t,ks(n))},ko=Oh(OR),ka=Om(ON),ku=Op(Oj),ks=Og(OU),kc=ks(nS),kl="ReaderTask",kf={URI:kl,map:kt},kd=rt(kf),kp={URI:kl,of:ku},kh={URI:kl,map:kt,ap:kn},km=n1(kh),kg=n2(kh),ky={URI:kl,map:kt,ap:kr},kv={URI:kl,map:kt,ap:kr,of:ku},kb={URI:kl,map:kt,ap:kn,chain:ki},kx={URI:kl,map:kt,of:ku,ap:kn,chain:ki},k_=rs(kb),kS={URI:kl,fromIO:ke},kT=gB(kS),kw=gV(kS,kb),kO=g$(kS,kb),kk={URI:kl,fromReader:O7},kI=yk(kk),kC=yI(kk),kM=yC(kk),kR=yM(kk,kb),kE=yR(kk,kb),kj={URI:kl,fromIO:ke,fromTask:nT},kN=vs(kj),kA=vc(kj,kb),kP=vl(kj,kb),kL=ku(nJ),kD=rn(kf),kF=rc(kb),kW=n3(kh),kU=ku(nY),kz=function(t){return nC(yb(t),g0(OQ(nA)))},kB=function(t){var n=kz(t);return function(t){return nH(t)?n(t):kU}},kV=function(t){return nC(yb(t),g0(O0(nA)))},k$=function(t){var n=kV(t);return function(t){return nH(t)?n(t):kU}},kq=function(t){return kB(function(n,r){return t(r)})},kK=kq(nS),kH=function(t){return k$(function(n,r){return t(r)})},kZ=kH(nS),kG=n4(ky),kY=ro(kv);function kJ(t,n){return t(n)()}let kQ=Object.freeze(Object.defineProperty({__proto__:null,ApT:kU,ApplicativePar:{URI:kl,map:kt,ap:kn,of:ku},ApplicativeSeq:kv,ApplyPar:kh,ApplySeq:ky,Chain:kb,Do:kL,FromIO:kS,FromReader:kk,FromTask:kj,Functor:kf,Monad:kx,MonadIO:{URI:kl,map:kt,of:ku,ap:kn,chain:ki,fromIO:ke},MonadTask:{URI:kl,map:kt,of:ku,ap:kn,chain:ki,fromIO:ke,fromTask:nT},Pointed:kp,URI:kl,ap:ka,apFirst:km,apS:kW,apSW:kW,apSecond:kg,apW:ka,ask:kI,asks:kC,asksReaderTask:gZ,asksReaderTaskW:gZ,bind:kF,bindTo:kD,bindW:kF,chain:ks,chainFirst:k_,chainFirstIOK:kO,chainFirstReaderK:kE,chainFirstReaderKW:kE,chainFirstTaskK:kP,chainFirstW:k_,chainIOK:kw,chainReaderK:kR,chainReaderKW:kR,chainTaskK:kA,chainW:ks,flap:kd,flatten:kc,flattenW:kc,fromIO:ke,fromIOK:kT,fromReader:O7,fromReaderK:kM,fromTask:nT,fromTaskK:kN,getMonoid:kY,getSemigroup:kG,local:gH,map:ko,of:ku,readerTask:{URI:kl,map:kt,of:ku,ap:kn,chain:ki,fromIO:ke,fromTask:nT},readerTaskSeq:{URI:kl,map:kt,of:ku,ap:kr,chain:ki,fromIO:ke,fromTask:nT},run:kJ,sequenceArray:kK,sequenceSeqArray:kZ,traverseArray:kq,traverseArrayWithIndex:kB,traverseReadonlyArrayWithIndex:kB,traverseReadonlyArrayWithIndexSeq:k$,traverseReadonlyNonEmptyArrayWithIndex:kz,traverseReadonlyNonEmptyArrayWithIndexSeq:kV,traverseSeqArray:kH,traverseSeqArrayWithIndex:k$},Symbol.toStringTag,{value:"Module"}));var kX=globalThis&&globalThis.__awaiter||function(t,n,r,i){return new(r||(r=Promise))(function(o,a){function u(t){try{c(i.next(t))}catch(n){a(n)}}function s(t){try{c(i.throw(t))}catch(n){a(n)}}function c(t){var n;t.done?o(t.value):((n=t.value)instanceof r?n:new r(function(t){t(n)})).then(u,s)}c((i=i.apply(t,n||[])).next())})},k0=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])}}},k1=m8(Oj),k2=m6(Oj),k3=m7(OR),k4=ge(OR),k5=nC(Ob,k3),k9=nC(Ob,k4),k6=function(t){return Ow(mT(t))},k8=gf(OR),k7=gd(OU),Ie=gp(OU),It=function(t,n){return function(){return kX(void 0,void 0,void 0,function(){var r;return k0(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,t().then(nq)];case 1:return[2,r.sent()];case 2:return[2,n$(n(r.sent()))];case 3:return[2]}})})}},In=function(t,n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return It(function(){return t.apply(void 0,r)},n)}},Ir=gv(OR),Ii=gt(Oj),Io=gn(Oj),Ia=gr(OU),Iu=gh(OU),Is=gm(OU),Ic=function(t){return Is(I1(t))},Il=function(t){return Is(I5(t))},If=gg(OU),Id=gy(OR),Ip=function(t){var n=k6(t);return function(t){return nC(t,n)}},Ih=function(t){return function(n){return function(r){return nN(r,IC(Ip(t)(n)))}}},Im=function(t){return nC(t,Ob)},Ig=function(t){return IM(Im(t))},Iy=function(t,n){return nN(t,Iw(n))},Iv=function(t,n){return nN(t,II(n))},Ib=function(t,n){return nN(t,IC(function(t){return nN(n,Iw(t))}))},Ix=function(t,n){return nN(t,IC(n))},I_=function(t,n,r){return nN(t,IO(n,r))},IS=function(t,n){return nN(t,Ik(n))},IT=function(t,n){return nN(t,IE(n))},Iw=gi(OR),IO=gs(OR),Ik=gc(OR),II=go(ON),IC=ga(OU),IM=IC,IR=IM(nS),IE=gu(OU),Ij="TaskEither";function IN(t,n){var r=n0(t,h8(n));return{URI:Ij,_E:void 0,map:Iy,ap:function(t,n){return nN(t,r(n))},of:k2}}function IA(t){var n=gl(OU,t);return{URI:Ij,_E:void 0,map:Iy,alt:function(t,r){return nN(t,n(r))}}}var IP=function(t){var n=h5(t);return{URI:Ij,_E:void 0,compact:hg(OR,n),separate:hy(OR,n,mt)}},IL={URI:Ij,map:Iy},ID=rt(IL),IF={URI:Ij,map:Iy,ap:Iv},IW=n1(IF),IU=n2(IF),Iz={URI:Ij,map:Iy,ap:Ib},IB={URI:Ij,map:Iy,ap:Ib,of:k2},IV={URI:Ij,map:Iy,ap:Iv,chain:Ix},I$=rs(IV),Iq={URI:Ij,fromEither:Ok},IK=rf(Iq),IH=rp(Iq),IZ=rh(Iq,IV),IG=rg(Iq,IV),IY=ry(Iq,IV),IJ=rd(Iq),IQ=rv(Iq,IV),IX=rm(Iq),I0={URI:Ij,fromIO:k5},I1=gB(I0),I2=gV(I0,IV),I3=g$(I0,IV),I4={URI:Ij,fromIO:k5,fromTask:k3},I5=vs(I4),I9=vc(I4,IV),I6=vl(I4,IV),I8=function(t,n,r){return I7(t,n,r)},I7=function(t,n,r){return nN(t,IM(function(t){return nN(n(t),OI(function(n){return nN(r(t,n),IM(function(){return Ok(n)}))}))}))},Ce=k2(nJ),Ct=rn(IL),Cn=rc(IV),Cr=n3(IF),Ci=k2(nY),Co=function(t){return nC(OQ(t),Ow(mJ(nA)))},Ca=function(t){var n=Co(t);return function(t){return nH(t)?n(t):Ci}},Cu=function(t){return function(n){return function(){return nG(n).reduce(function(n,r,i){return n.then(function(o){return nB(o)?n:t(i+1,r)().then(function(t){return nB(t)?t:(o.right.push(t.right),o)})})},t(0,nZ(n))().then(me(nK)))}}},Cs=function(t){var n=Cu(t);return function(t){return nH(t)?n(t):Ci}},Cc=function(t){return Ca(function(n,r){return t(r)})},Cl=Cc(nS),Cf=function(t){return Cs(function(n,r){return t(r)})},Cd=Cf(nS),Cp=n4(Iz),Ch=ro(IB),Cm=function(t){return n4(OD)(h4(t))};let Cg=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:Ij,map:Iy,alt:IT},ApT:Ci,ApplicativePar:{URI:Ij,map:Iy,ap:Iv,of:k2},ApplicativeSeq:IB,ApplyPar:IF,ApplySeq:Iz,Bifunctor:{URI:Ij,bimap:I_,mapLeft:IS},Chain:IV,Do:Ce,FromEither:Iq,FromIO:I0,FromTask:I4,Functor:IL,Monad:{URI:Ij,map:Iy,ap:Iv,chain:Ix,of:k2},MonadIO:{URI:Ij,map:Iy,ap:Iv,chain:Ix,of:k2,fromIO:k5},MonadTask:{URI:Ij,map:Iy,ap:Iv,chain:Ix,of:k2,fromIO:k5,fromTask:k3},MonadThrow:{URI:Ij,map:Iy,ap:Iv,chain:Ix,of:k2,throwError:k1},Pointed:{URI:Ij,of:k2},URI:Ij,alt:IE,altW:IE,ap:II,apFirst:IW,apFirstW:IW,apS:Cr,apSW:Cr,apSecond:IU,apSecondW:IU,apW:II,bimap:IO,bind:Cn,bindTo:Ct,bindW:Cn,bracket:I8,bracketW:I7,chain:IC,chainEitherK:IG,chainEitherKW:IG,chainFirst:I$,chainFirstEitherK:IY,chainFirstEitherKW:IY,chainFirstIOK:I3,chainFirstTaskK:I6,chainFirstW:I$,chainIOEitherK:Ig,chainIOEitherKW:Ig,chainIOK:I2,chainNullableK:Ia,chainOptionK:IZ,chainTaskK:I9,chainTaskOptionK:Ih,chainTaskOptionKW:Ih,chainW:IM,filterOrElse:IQ,filterOrElseW:IQ,flap:ID,flatten:IR,flattenW:IR,fold:k7,foldW:k7,fromEither:Ok,fromEitherK:IX,fromIO:k5,fromIOEither:Ob,fromIOEitherK:Im,fromIOK:I1,fromNullable:Ii,fromNullableK:Io,fromOption:IK,fromOptionK:IH,fromPredicate:IJ,fromTask:k3,fromTaskK:I5,fromTaskOption:k6,fromTaskOptionK:Ip,getAltTaskValidation:IA,getApplicativeTaskValidation:IN,getApplyMonoid:Ch,getApplySemigroup:Cp,getCompactable:IP,getFilterable:function(t){var n=h9(t),r=IP(t),i=gk(OR,n),o=gI(OR,n),a=gC(OR,n),u=gM(OR,n);return{URI:Ij,_E:void 0,map:Iy,compact:r.compact,separate:r.separate,filter:function(t,n){return nN(t,i(n))},filterMap:function(t,n){return nN(t,o(n))},partition:function(t,n){return nN(t,a(n))},partitionMap:function(t,n){return nN(t,u(n))}}},getOrElse:Ie,getOrElseW:Ie,getSemigroup:Cm,getTaskValidation:function(t){var n=IN(OL,t),r=IA(t);return{URI:Ij,_E:void 0,map:Iy,ap:n.ap,of:k2,chain:Ix,bimap:I_,mapLeft:IS,alt:r.alt,fromIO:k5,fromTask:k3,throwError:k1}},left:k1,leftIO:k9,leftTask:k4,map:Iw,mapLeft:Ik,match:k8,matchE:k7,matchEW:k7,matchW:k8,of:k2,orElse:Iu,orElseFirst:Is,orElseFirstIOK:Ic,orElseFirstTaskK:Il,orElseFirstW:Is,orElseW:Iu,orLeft:If,right:k2,rightIO:k5,rightTask:k3,sequenceArray:Cl,sequenceSeqArray:Cd,swap:Id,taskEither:{URI:Ij,bimap:I_,mapLeft:IS,map:Iy,of:k2,ap:Iv,chain:Ix,alt:IT,fromIO:k5,fromTask:k3,throwError:k1},taskEitherSeq:{URI:Ij,bimap:I_,mapLeft:IS,map:Iy,of:k2,ap:Ib,chain:Ix,alt:IT,fromIO:k5,fromTask:k3,throwError:k1},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(n$(t)):r(nq(n))};t.apply(null,n.concat(i))})}}},throwError:k1,toUnion:Ir,traverseArray:Cc,traverseArrayWithIndex:Ca,traverseReadonlyArrayWithIndex:Ca,traverseReadonlyArrayWithIndexSeq:Cs,traverseReadonlyNonEmptyArrayWithIndex:Co,traverseReadonlyNonEmptyArrayWithIndexSeq:Cu,traverseSeqArray:Cf,traverseSeqArrayWithIndex:Cs,tryCatch:It,tryCatchK:In},Symbol.toStringTag,{value:"Module"}));var Cy=m8(kp),Cv=m6(kp),Cb=nC(k3,nT),Cx=nC(k4,nT),C_=function(t){return nC(t,k2)},CS=function(t){return nC(t,k1)},CT=m7(kf),Cw=ge(kf),CO=nC(k5,nT),Ck=nC(k9,nT),CI=nC(Ob,nT),CC=function(t){return nC(t,Ok)},CM=gf(kf),CR=gd(kb),CE=gp(kx),Cj=gv(kf),CN=gt(kp),CA=gn(kp),CP=gr(kx),CL=gh(kx),CD=gm(kx),CF=gg(kx),CW=gy(kf),CU=function(t){return nC(t,CI)},Cz=function(t){return C9(CU(t))},CB=function(t){return nC(t,nT)},CV=function(t){return C9(CB(t))},C$=function(t){return Mp(CB(t))},Cq=function(t){return nC(t,CC)},CK=function(t){return C9(Cq(t))},CH=function(t){return Mp(Cq(t))},CZ=function(t,n){return nN(t,C1(n))},CG=function(t,n){return nN(t,C4(n))},CY=function(t,n){return nN(t,C5(function(t){return nN(n,C1(t))}))},CJ=function(t,n){return nN(t,C5(n))},CQ=function(t,n){return nN(t,C8(n))},CX=function(t,n,r){return nN(t,C2(n,r))},C0=function(t,n){return nN(t,C3(n))},C1=gi(kf),C2=gs(kf),C3=gc(kf),C4=go(kh),C5=ga(kx),C9=C5,C6=C9(nS),C8=gu(kx),C7="ReaderTaskEither",Me=function(t){var n=h5(t);return{URI:C7,_E:void 0,compact:hg(kf,n),separate:hy(kf,n,mt)}};function Mt(t,n){var r=n0(yu,IN(t,n));return{URI:C7,_E:void 0,map:CZ,ap:function(t,n){return nN(t,r(n))},of:Cv}}function Mn(t){var n=gl(kx,t);return{URI:C7,_E:void 0,map:CZ,alt:function(t,r){return nN(t,n(r))}}}var Mr={URI:C7,map:CZ},Mi=rt(Mr),Mo={URI:C7,of:Cv},Ma={URI:C7,map:CZ,ap:CG},Mu=n1(Ma),Ms=n2(Ma),Mc={URI:C7,map:CZ,ap:CY},Ml={URI:C7,map:CZ,ap:CY,of:Cv},Mf={URI:C7,map:CZ,ap:CG,chain:CJ},Md=rs(Mf),Mp=Md,Mh={URI:C7,fromReader:C_},Mm=yk(Mh),Mg=yI(Mh),My=yC(Mh),Mv=yM(Mh,Mf),Mb=yR(Mh,Mf),Mx=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return CT(t.apply(void 0,n))}},M_=function(t){return C9(Mx(t))},MS=function(t){return Mp(Mx(t))},MT={URI:C7,fromEither:ku},Mw=rf(MT),MO=rp(MT),Mk=rh(MT,Mf),MI=rg(MT,Mf),MC=ry(MT,Mf),MM=rd(MT),MR=rv(MT,Mf),ME=rm(MT),Mj={URI:C7,fromIO:CO},MN=gB(Mj),MA=gV(Mj,Mf),MP=g$(Mj,Mf),ML={URI:C7,fromIO:CO,fromTask:Cb},MD=vs(ML),MF=vc(ML,Mf),MW=vl(ML,Mf);function MU(t,n,r){return Mz(t,n,r)}function Mz(t,n,r){return function(i){return I7(t(i),function(t){return n(t)(i)},function(t,n){return r(t,n)(i)})}}var MB=Cv(nJ),MV=rn(Mr),M$=rc(Mf),Mq=n3(Ma),MK=Cv(nY),MH=function(t){return nC(yb(t),g0(Co(nA)))},MZ=function(t){var n=MH(t);return function(t){return nH(t)?n(t):MK}},MG=function(t){return nC(yb(t),g0(Cu(nA)))},MY=function(t){var n=MG(t);return function(t){return nH(t)?n(t):MK}},MJ=function(t){return MZ(function(n,r){return t(r)})},MQ=MJ(nS),MX=function(t){return MY(function(n,r){return t(r)})},M0=MX(nS),M1=n4(Mc),M2=ro(Ml),M3=function(t){return n4(ky)(h4(t))};function M4(t,n){return t(n)()}let M5=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:C7,map:CZ,alt:CQ},ApT:MK,ApplicativePar:{URI:C7,map:CZ,ap:CG,of:Cv},ApplicativeSeq:Ml,ApplyPar:Ma,ApplySeq:Mc,Bifunctor:{URI:C7,bimap:CX,mapLeft:C0},Chain:Mf,Do:MB,FromEither:MT,FromIO:Mj,FromReader:Mh,FromTask:ML,Functor:Mr,Monad:{URI:C7,map:CZ,ap:CG,chain:CJ,of:Cv},MonadIO:{URI:C7,map:CZ,ap:CG,chain:CJ,of:Cv,fromIO:CO},MonadTask:{URI:C7,map:CZ,ap:CG,chain:CJ,of:Cv,fromIO:CO,fromTask:Cb},MonadThrow:{URI:C7,map:CZ,ap:CG,chain:CJ,of:Cv,throwError:Cy},Pointed:Mo,URI:C7,alt:C8,altW:C8,ap:C4,apFirst:Mu,apFirstW:Mu,apS:Mq,apSW:Mq,apSecond:Ms,apSecondW:Ms,apW:C4,ask:Mm,asks:Mg,asksReaderTaskEither:gZ,asksReaderTaskEitherW:gZ,bimap:C2,bind:M$,bindTo:MV,bindW:M$,bracket:MU,bracketW:Mz,chain:C5,chainEitherK:MI,chainEitherKW:MI,chainFirst:Md,chainFirstEitherK:MC,chainFirstEitherKW:MC,chainFirstIOK:MP,chainFirstReaderEitherK:CH,chainFirstReaderEitherKW:CH,chainFirstReaderK:Mb,chainFirstReaderKW:Mb,chainFirstReaderTaskK:MS,chainFirstReaderTaskKW:MS,chainFirstTaskEitherK:C$,chainFirstTaskEitherKW:C$,chainFirstTaskK:MW,chainFirstW:Mp,chainIOEitherK:Cz,chainIOEitherKW:Cz,chainIOK:MA,chainNullableK:CP,chainOptionK:Mk,chainReaderEitherK:CK,chainReaderEitherKW:CK,chainReaderK:Mv,chainReaderKW:Mv,chainReaderTaskK:M_,chainReaderTaskKW:M_,chainTaskEitherK:CV,chainTaskEitherKW:CV,chainTaskK:MF,chainW:C9,filterOrElse:MR,filterOrElseW:MR,flap:Mi,flatten:C6,flattenW:C6,fold:CR,foldW:CR,fromEither:ku,fromEitherK:ME,fromIO:CO,fromIOEither:CI,fromIOEitherK:CU,fromIOK:MN,fromNullable:CN,fromNullableK:CA,fromOption:Mw,fromOptionK:MO,fromPredicate:MM,fromReader:C_,fromReaderEither:CC,fromReaderEitherK:Cq,fromReaderK:My,fromReaderTaskK:Mx,fromTask:Cb,fromTaskEither:nT,fromTaskEitherK:CB,fromTaskK:MD,getAltReaderTaskValidation:Mn,getApplicativeReaderTaskValidation:Mt,getApplyMonoid:M2,getApplySemigroup:M1,getCompactable:Me,getFilterable:function(t){var n=h9(t),r=Me(t),i=gk(kf,n),o=gI(kf,n),a=gC(kf,n),u=gM(kf,n);return{URI:C7,_E:void 0,map:CZ,compact:r.compact,separate:r.separate,filter:function(t,n){return nN(t,i(n))},filterMap:function(t,n){return nN(t,o(n))},partition:function(t,n){return nN(t,a(n))},partitionMap:function(t,n){return nN(t,u(n))}}},getOrElse:CE,getOrElseW:CE,getReaderTaskValidation:function(t){var n=Mt(OL,t),r=Mn(t);return{URI:C7,_E:void 0,map:CZ,of:Cv,chain:CJ,bimap:CX,mapLeft:C0,ap:n.ap,alt:r.alt,fromIO:CO,fromTask:Cb,throwError:Cy}},getSemigroup:M3,left:Cy,leftIO:Ck,leftReader:CS,leftReaderTask:Cw,leftTask:Cx,local:gH,map:C1,mapLeft:C3,match:CM,matchE:CR,matchEW:CR,matchW:CM,of:Cv,orElse:CL,orElseFirst:CD,orElseFirstW:CD,orElseW:CL,orLeft:CF,readerTaskEither:{URI:C7,map:CZ,of:Cv,ap:CG,chain:CJ,alt:CQ,bimap:CX,mapLeft:C0,fromIO:CO,fromTask:Cb,throwError:Cy},readerTaskEitherSeq:{URI:C7,map:CZ,of:Cv,ap:CY,chain:CJ,alt:CQ,bimap:CX,mapLeft:C0,fromIO:CO,fromTask:Cb,throwError:Cy},right:Cv,rightIO:CO,rightReader:C_,rightReaderTask:CT,rightTask:Cb,run:M4,sequenceArray:MQ,sequenceSeqArray:M0,swap:CW,throwError:Cy,toUnion:Cj,traverseArray:MJ,traverseArrayWithIndex:MZ,traverseReadonlyArrayWithIndex:MZ,traverseReadonlyArrayWithIndexSeq:MY,traverseReadonlyNonEmptyArrayWithIndex:MH,traverseReadonlyNonEmptyArrayWithIndexSeq:MG,traverseSeqArray:MX,traverseSeqArrayWithIndex:MY},Symbol.toStringTag,{value:"Module"}));var M9={equals:function(t,n){return t===n}},M6={concat:function(t,n){return t+n}},M8={concat:M6.concat,empty:""},M7={equals:M9.equals,compare:function(t,n){return t<n?-1:t>n?1:0}},Re=function(t){return"string"==typeof t},Rt=function(t){return t.toUpperCase()},Rn=function(t){return t.toLowerCase()},Rr=function(t,n){return function(r){return r.replace(t,n)}},Ri=function(t){return t.trim()},Ro=function(t){return t.trimLeft()},Ra=function(t){return t.trimRight()},Ru=function(t,n){return function(r){return r.slice(t,n)}},Rs=function(t){return 0===t.length},Rc=function(t){return t.length},Rl=function(t){return function(n){var r=n.split(t);return nH(r)?r:[n]}},Rf=function(t,n){return function(r){return r.includes(t,n)}},Rd=function(t,n){return function(r){return r.startsWith(t,n)}},Rp=function(t,n){return function(r){return r.endsWith(t,n)}};let Rh=Object.freeze(Object.defineProperty({__proto__:null,Eq:M9,Monoid:M8,Ord:M7,Semigroup:M6,Show:{show:function(t){return JSON.stringify(t)}},empty:"",endsWith:Rp,includes:Rf,isEmpty:Rs,isString:Re,replace:Rr,size:Rc,slice:Ru,split:Rl,startsWith:Rd,toLowerCase:Rn,toUpperCase:Rt,trim:Ri,trimLeft:Ro,trimRight:Ra},Symbol.toStringTag,{value:"Module"}));var Rm=function(t){return Object.assign({},t)},Rg=function(t){return Object.assign({},t)},Ry=function(t){return Object.keys(t).length},Rv=function(t){for(var n in t)if(nQ.call(t,n))return!1;return!0},Rb=function(t){return function(n){return Object.keys(n).sort(t.compare)}},Rx=Rb(M7);function R_(t){if("function"==typeof t)return R_(M7)(t);var n=Rb(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 RS=R_(M7)(function(t,n){return[t,n]}),RT=function(t,n){return function(r){if(nQ.call(r,t)&&r[t]===n)return r;var i=Object.assign({},r);return i[t]=n,i}},Rw=function(t,n){return nQ.call(n,t)};function RO(t){return function(n){if(!nQ.call(n,t))return n;var r=Object.assign({},n);return delete r[t],r}}var Rk=function(t,n){return function(r){if(!Rw(t,r))return nU;if(r[t]===n)return nz(r);var i=Object.assign({},r);return i[t]=n,nz(i)}},RI=function(t,n){return function(r){if(!Rw(t,r))return nU;var i=n(r[t]);if(i===r[t])return nz(r);var o=Object.assign({},r);return o[t]=i,nz(o)}};function RC(t){return function(n,r){if(void 0===r){var i=RC(t);return function(t){return i(t,n)}}for(var o in n)if(!nQ.call(r,o)||!t.equals(n[o],r[o]))return!1;return!0}}function RM(t,n){return void 0===n?function(n){return RM(t,n)}:nQ.call(n,t)?nz(n[t]):nU}var RR={};function RE(t){return function(n){var r={};for(var i in n)nQ.call(n,i)&&(r[i]=t(i,n[i]));return r}}function Rj(t){return RE(function(n,r){return t(r)})}function RN(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(2===t.length)return RN(M7).apply(void 0,t);var r=Rb(t[0]);return function(t,n){return function(i){for(var o=t,a=r(i),u=a.length,s=0;s<u;s++){var c=a[s];o=n(c,o,i[c])}return o}}}function RA(t){if("compare"in t){var n=Rb(t);return function(t){return function(r){return function(i){for(var o=t.empty,a=n(i),u=a.length,s=0;s<u;s++){var c=a[s];o=t.concat(o,r(c,i[c]))}return o}}}}return RA(M7)(t)}function RP(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(2===t.length)return RP(M7).apply(void 0,t);var r=Rb(t[0]);return function(t,n){return function(i){for(var o=t,a=r(i),u=a.length,s=u-1;s>=0;s--){var c=a[s];o=n(c,i[c],o)}return o}}}var RL=function(t,n){var r;return(r={})[t]=n,r};function RD(t){var n=Ec(M7)(t);return function(t){return function(r){return n(r,t)}}}function RF(t){var n=Eu(M7)(t);return function(t){return function(r){return n(r,t)}}}function RW(t){return Es(M7)(t)}var RU=function(t){var n=RF(t);return function(r){return function(i){return t.map(nN(i,n(r)),Ey)}}},Rz=function(t){var n=RF(t);return function(r){return function(i){return t.map(nN(i,n(r)),Ev)}}};function RB(t){return function(n){var r={},i={};for(var o in n)if(nQ.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 uC(r,i)}}function RV(t){return function(n){var r={},i={};for(var o in n)if(nQ.call(n,o)){var a=n[o];t(o,a)?i[o]=a:r[o]=a}return uC(r,i)}}function R$(t){return function(n){var r={};for(var i in n)if(nQ.call(n,i)){var o=t(i,n[i]);nW(o)&&(r[i]=o.value)}return r}}function Rq(t){return function(n){var r={},i=!1;for(var o in n)if(nQ.call(n,o)){var a=n[o];t(o,a)?r[o]=a:i=!0}return i?r:n}}function RK(t,n){var r=RH(t,n);return function(t){return r(t,nS)}}function RH(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]=nQ.call(n,a)?t.concat(n[a],u):u,n})}}var RZ=function(t){for(var n={},r=0;r<t.length;r++){var i=t[r];n[i[0]]=i[1]}return n};function RG(t){return function(n){for(var r in n)if(!t(n[r]))return!1;return!0}}function RY(t){return function(n){for(var r in n)if(t(n[r]))return!0;return!1}}function RJ(t){return function(n,r){if(void 0===r){var i=RJ(t);return function(t){return i(n,t)}}for(var o in r)if(t.equals(r[o],n))return!0;return!1}}var RQ=function(t){return function(n){return function(r){if(Rv(r))return n;if(Rv(n))return r;var i={};for(var o in r)Rw(o,n)?i[o]=t.concat(r[o],n[o]):i[o]=r[o];for(var o in n)Rw(o,i)||(i[o]=n[o]);return i}}},RX=function(t){return function(n){return function(r){if(Rv(r)||Rv(n))return RR;var i={};for(var o in r)Rw(o,n)&&(i[o]=t.concat(r[o],n[o]));return i}}},R0=function(t){return function(n){if(Rv(n))return t;if(Rv(t))return n;var r={};for(var i in n)Rw(i,t)||(r[i]=n[i]);for(var i in t)Rw(i,n)||(r[i]=t[i]);return r}},R1=function(t,n){return nN(t,Rj(n))},R2=function(t,n){return nN(t,RE(n))},R3=function(t){var n=Eh(t);return function(t,r,i){return nN(t,n(r,i))}},R4=function(t){return function(n){var r=Em(t)(n);return function(t,n){return nN(t,r(n))}}},R5=function(t){var n=Eg(t);return function(t,r,i){return nN(t,n(r,i))}},R9=function(t,n){return nN(t,El(n))},R6=function(t,n){return nN(t,Ef(n))},R8=function(t,n){return nN(t,Ed(n))},R7=function(t,n){return nN(t,Ep(n))},Ee=function(t){var n=RN(t);return function(t,r,i){return nN(t,n(r,i))}},Et=function(t){var n=RA(t);return function(t){var r=n(t);return function(t,n){return nN(t,r(n))}}},En=function(t){var n=RP(t);return function(t,r,i){return nN(t,n(r,i))}},Er=function(t,n){return nN(t,RB(n))},Ei=function(t,n){return nN(t,RV(n))},Eo=function(t,n){return nN(t,R$(n))},Ea=function(t,n){return nN(t,Rq(n))},Eu=function(t){var n=Ec(t);return function(t){var r=n(t);return function(t,n){return r(t,nC(nA,n))}}},Es=function(t){var n=Eu(t);return function(t){var r=n(t);return function(t){return r(t,nS)}}},Ec=function(t){return function(n){var r=Rb(t);return function(t,i){var o=r(t);if(0===o.length)return n.of(RR);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}}},El=function(t){return Rq(function(n,r){return t(r)})},Ef=function(t){return R$(function(n,r){return t(r)})},Ed=function(t){return RV(function(n,r){return t(r)})},Ep=function(t){return RB(function(n,r){return t(r)})};function Eh(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(1===t.length){var r=RN(t[0]);return function(t,n){return r(t,function(t,r,i){return n(r,i)})}}return Eh(M7).apply(void 0,t)}function Em(t){if("compare"in t){var n=RA(t);return function(t){var r=n(t);return function(t){return r(function(n,r){return t(r)})}}}return Em(M7)(t)}function Eg(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(1===t.length){var r=RP(t[0]);return function(t,n){return r(t,function(t,r,i){return n(r,i)})}}return Eg(M7).apply(void 0,t)}var Ey=function(t){var n={};for(var r in t)if(nQ.call(t,r)){var i=t[r];nW(i)&&(n[r]=i.value)}return n},Ev=function(t){var n={},r={};for(var i in t)if(nQ.call(t,i)){var o=t[i];nB(o)?n[i]=o.left:r[i]=o.right}return uC(n,r)},Eb="ReadonlyRecord";function Ex(t){return"compare"in t?function(n){return{show:function(r){var i=R_(t)(function(t,r){return"".concat(JSON.stringify(t),": ").concat(n.show(r))})(r).join(", ");return""===i?"{}":"{ ".concat(i," }")}}}:Ex(M7)(t)}function E_(t){var n=RC(t);return rx(function(t,r){return n(t)(r)&&n(r)(t)})}function ES(t){return{concat:function(n,r){if(Rv(n))return r;if(Rv(r))return n;var i=Object.assign({},n);for(var o in r)nQ.call(r,o)&&(i[o]=nQ.call(n,o)?t.concat(n[o],r[o]):r[o]);return i},empty:RR}}var ET={URI:Eb,map:R1},Ew=rt(ET),EO=function(t){return{URI:Eb,reduce:R3(t),foldMap:R4(t),reduceRight:R5(t)}},Ek=function(t){return{URI:Eb,reduce:R3(t),foldMap:R4(t),reduceRight:R5(t),reduceWithIndex:Ee(t),foldMapWithIndex:Et(t),reduceRightWithIndex:En(t)}},EI={URI:Eb,compact:Ey,separate:Ev},EC=function(t){return{URI:Eb,map:R1,reduce:R3(t),foldMap:R4(t),reduceRight:R5(t),traverse:Eu(t),sequence:Es(t)}},EM=function(t){return{URI:Eb,map:R1,mapWithIndex:R2,reduce:R3(t),foldMap:R4(t),reduceRight:R5(t),reduceWithIndex:Ee(t),foldMapWithIndex:Et(t),reduceRightWithIndex:En(t),traverse:Eu(t),sequence:Es(t),traverseWithIndex:Ec(t)}},ER=function(t){var n=EC(t);return{URI:Eb,map:R1,reduce:R3(t),foldMap:R4(t),reduceRight:R5(t),traverse:n.traverse,sequence:n.sequence,compact:Ey,separate:Ev,filter:R9,filterMap:R6,partition:R8,partitionMap:R7,wither:uz(n,EI),wilt:uU(n,EI)}},EE=function(t){var n=RQ(t);return{concat:function(t,r){return n(r)(t)}}},Ej=function(t){return{concat:EE(t).concat,empty:RR}},EN=function(t){var n=RX(t);return{concat:function(t,r){return n(r)(t)}}},EA=function(){return{concat:function(t,n){return R0(n)(t)}}},EP={URI:Eb,reduce:R3(M7),foldMap:R4(M7),reduceRight:R5(M7)},EL={URI:Eb,reduce:R3(M7),foldMap:R4(M7),reduceRight:R5(M7),reduceWithIndex:Ee(M7),foldMapWithIndex:Et(M7),reduceRightWithIndex:En(M7)},ED={URI:Eb,map:R1,reduce:R3(M7),foldMap:R4(M7),reduceRight:R5(M7),traverse:Eu(M7),sequence:RW},EF={URI:Eb,map:R1,mapWithIndex:R2,reduce:R3(M7),foldMap:R4(M7),reduceRight:R5(M7),reduceWithIndex:Ee(M7),foldMapWithIndex:Et(M7),reduceRightWithIndex:En(M7),traverse:Eu(M7),sequence:RW,traverseWithIndex:Ec(M7)},EW=uz(ED,EI),EU=uU(ED,EI),Ez={URI:Eb,map:R1,reduce:R3(M7),foldMap:R4(M7),reduceRight:R5(M7),traverse:Eu(M7),sequence:RW,compact:Ey,separate:Ev,filter:R9,filterMap:R6,partition:R8,partitionMap:R7,wither:EW,wilt:EU};function EB(t,n){return nQ.call(void 0===n?this:n,t)}var EV={URI:Eb,map:R1,reduce:R3(M7),foldMap:R4(M7),reduceRight:R5(M7),traverse:Eu(M7),sequence:RW,compact:Ey,separate:Ev,filter:R9,filterMap:R6,partition:R8,partitionMap:R7,mapWithIndex:R2,reduceWithIndex:Ee(M7),foldMapWithIndex:Et(M7),reduceRightWithIndex:En(M7),filterMapWithIndex:Eo,filterWithIndex:Ea,partitionMapWithIndex:Er,partitionWithIndex:Ei,traverseWithIndex:Ec(M7),wither:EW,wilt:EU};let E$=Object.freeze(Object.defineProperty({__proto__:null,Compactable:EI,Filterable:{URI:Eb,map:R1,compact:Ey,separate:Ev,filter:R9,filterMap:R6,partition:R8,partitionMap:R7},FilterableWithIndex:{URI:Eb,map:R1,mapWithIndex:R2,compact:Ey,separate:Ev,filter:R9,filterMap:R6,partition:R8,partitionMap:R7,filterMapWithIndex:Eo,filterWithIndex:Ea,partitionMapWithIndex:Er,partitionWithIndex:Ei},Foldable:EP,FoldableWithIndex:EL,Functor:ET,FunctorWithIndex:{URI:Eb,map:R1,mapWithIndex:R2},Traversable:ED,TraversableWithIndex:EF,URI:Eb,Witherable:Ez,_filter:R9,_filterMap:R6,_filterMapWithIndex:Eo,_filterWithIndex:Ea,_foldMap:R4,_foldMapWithIndex:Et,_map:R1,_mapWithIndex:R2,_partition:R8,_partitionMap:R7,_partitionMapWithIndex:Er,_partitionWithIndex:Ei,_reduce:R3,_reduceRight:R5,_reduceRightWithIndex:En,_reduceWithIndex:Ee,_sequence:Es,_traverse:Eu,collect:R_,compact:Ey,deleteAt:RO,difference:R0,elem:RJ,empty:RR,every:RG,filter:El,filterMap:Ef,filterMapWithIndex:R$,filterWithIndex:Rq,flap:Ew,foldMap:Em,foldMapWithIndex:RA,fromEntries:RZ,fromFoldable:RK,fromFoldableMap:RH,fromRecord:Rm,getDifferenceMagma:EA,getEq:E_,getFoldable:EO,getFoldableWithIndex:Ek,getIntersectionSemigroup:EN,getMonoid:ES,getShow:Ex,getTraversable:EC,getTraversableWithIndex:EM,getUnionMonoid:Ej,getUnionSemigroup:EE,getWitherable:ER,has:Rw,hasOwnProperty:EB,insertAt:RT,intersection:RX,isEmpty:Rv,isSubrecord:RC,keys:Rx,lookup:RM,map:Rj,mapWithIndex:RE,modifyAt:RI,partition:Ed,partitionMap:Ep,partitionMapWithIndex:RB,partitionWithIndex:RV,pop:function(t){var n=RO(t);return function(r){var i=RM(t,r);return nF(i)?nU:nz([i.value,n(r)])}},readonlyRecord:EV,reduce:Eh,reduceRight:Eg,reduceRightWithIndex:RP,reduceWithIndex:RN,separate:Ev,sequence:RW,singleton:RL,size:Ry,some:RY,toEntries:RS,toReadonlyArray:RS,toRecord:Rg,toUnfoldable:function(t){return function(n){var r=RS(n),i=r.length;return t.unfold(0,function(t){return t<i?nz([r[t],t+1]):nU})}},traverse:RF,traverseWithIndex:RD,union:RQ,updateAt:Rk,upsertAt:RT,wilt:Rz,wither:RU},Symbol.toStringTag,{value:"Module"}));var Eq=function(t){return new Set(t)},EK=function(t){return new Set([t])},EH=function(t){return function(n){for(var r=n.length,i=new Set,o=jn(t),a=0;a<r;a++){var u=n[a];o(u,i)||i.add(u)}return i}};function EZ(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 EG(t){var n=jn(t);return function(r,i){if(void 0===i){var o=EG(t);return function(t){return o(r,t)}}if(E6(r))return i;if(E6(i))return r;var a=new Set(r);return i.forEach(function(t){n(t,a)||a.add(t)}),a}}function EY(t){var n=jn(t);return function(r,i){if(void 0===i){var o=EY(t);return function(t){return o(t,r)}}if(E6(r)||E6(i))return E9;var a=new Set;return r.forEach(function(t){n(t,i)&&a.add(t)}),a}}function EJ(t){var n=jn(t);return function(r,i){if(void 0===i){var o=EJ(t);return function(t){return o(t,r)}}return EZ(function(t){return!n(t,i)})(r)}}function EQ(t){var n=jr(t);return function(t,r){return function(i){return n(i).reduce(r,t)}}}function EX(t,n){var r=jr(t);return function(t){return function(i){return r(i).reduce(function(r,i){return n.concat(r,t(i))},n.empty)}}}var E0=function(t){var n=jr(t);return function(t,r){return function(i){return n(i).reduceRight(function(t,n){return r(n,t)},t)}}};function E1(t){var n=jn(t);return function(t){return function(r){if(n(t)(r))return r;var i=new Set(r);return i.add(t),i}}}var E2=function(t){return function(n){return function(r){return EZ(function(r){return!t.equals(n,r)})(r)}}},E3=function(t){var n=jn(t),r=E2(t),i=E1(t);return function(t){return function(o){return(n(t,o)?r:i)(t)(o)}}},E4=function(t){return E5(t)(nS)};function E5(t){var n=jn(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 E9=new Set,E6=function(t){return 0===t.size},E8=function(t){return t.size},E7=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 je(t){return dG(E7(dG(t)))}function jt(t){var n=jn(t);return function(r,i){if(void 0===i){var o=jt(t);return function(t){return o(t,r)}}return je(function(t){return n(t,i)})(r)}}function jn(t){return function(n,r){if(void 0===r){var i=jn(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 jr=function(t){return function(n){var r=[];return n.forEach(function(t){return r.push(t)}),r.sort(t.compare)}};function ji(t){return{show:function(n){var r=[];return n.forEach(function(n){r.push(t.show(n))}),"new Set([".concat(r.sort().join(", "),"])")}}}function jo(t){var n=jt(t);return rx(function(t,r){return n(t,r)&&n(r,t)})}var ja=function(t){return{concat:EG(t)}},ju=function(t){return{concat:ja(t).concat,empty:E9}},js=function(t){return{concat:EY(t)}},jc=function(t){return{concat:EJ(t)}};let jl=Object.freeze(Object.defineProperty({__proto__:null,URI:"ReadonlySet",chain:function(t){var n=jn(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:E4,difference:EJ,elem:jn,empty:E9,every:je,filter:EZ,filterMap:E5,foldMap:EX,fromArray:EH,fromReadonlyArray:EH,fromSet:Eq,getDifferenceMagma:jc,getEq:jo,getIntersectionSemigroup:js,getShow:ji,getUnionMonoid:ju,getUnionSemigroup:ja,insert:E1,intersection:EY,isEmpty:E6,isSubset:jt,map:function(t){var n=jn(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 uC(a,o)}},partitionMap:function(t,n){return function(r){return function(i){for(var o,a=i.values(),u=new Set,s=new Set,c=jn(t),l=jn(n);!(o=a.next()).done;){var f=r(o.value);switch(f._tag){case"Left":c(f.left,u)||u.add(f.left);break;case"Right":l(f.right,s)||s.add(f.right)}}return uC(u,s)}}},reduce:EQ,reduceRight:E0,remove:E2,separate:function(t,n){return function(r){var i=jn(t),o=jn(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)}}),uC(a,u)}},singleton:EK,size:E8,some:E7,toReadonlyArray:jr,toSet:function(t){return new Set(t)},toggle:E3,union:EG},Symbol.toStringTag,{value:"Module"}));function jf(t){return t[0]}function jd(t){return t[1]}var jp=function(t){var n;return[jd(t),t[0]]};function jh(t){return{URI:jD,_E:void 0,map:jv,ap:function(n,r){var i,o;return[(0,n[0])(r[0]),t.concat(jd(n),jd(r))]}}}var jm=function(t){return function(n){return[n,t.empty]}};function jg(t){var n=jh(t);return{URI:jD,_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(jd(n),u)]}}}var jy=function(t,n){return nN(t,jM(n))},jv=function(t,n){return nN(t,jI(n))},jb=function(t,n,r){return nN(t,jk(n,r))},jx=function(t,n){return nN(t,jC(n))},j_=function(t,n){return nN(t,jR(n))},jS=function(t,n,r){return nN(t,jj(n,r))},jT=function(t){var n=jN();return function(t,r){return nN(t,n(r))}},jw=function(t,n,r){return nN(t,jA(n,r))},jO=function(t){var n=jP(t);return function(t,r){return nN(t,n(r))}},jk=function(t,n){return function(r){var i;return[n(r[0]),t(jd(r))]}},jI=function(t){return function(n){var r;return[t(n[0]),jd(n)]}},jC=function(t){return function(n){var r;return[n[0],t(jd(n))]}},jM=function(t){return function(n){var r;return[n[0],jd(t)]}},jR=function(t){return function(n){return[t(n),jd(n)]}},jE=jR(nS),jj=function(t,n){return function(r){var i;return n(t,r[0])}},jN=function(){return function(t){return function(n){var r;return t(n[0])}}},jA=function(t,n){return function(r){var i;return n(r[0],t)}},jP=function(t){return function(n){return function(r){var i;return t.map(n(r[0]),function(t){return[t,jd(r)]})}}},jL=function(t){return function(n){var r;return t.map(n[0],function(t){return[t,jd(n)]})}},jD="ReadonlyTuple",jF={URI:jD,map:jv},jW=rt(jF);let jU=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:{URI:jD,bimap:jb,mapLeft:jx},Comonad:{URI:jD,map:jv,extend:j_,extract:jf},Foldable:{URI:jD,reduce:jS,foldMap:jT,reduceRight:jw},Functor:jF,Semigroupoid:{URI:jD,compose:jy},Traversable:{URI:jD,map:jv,reduce:jS,foldMap:jT,reduceRight:jw,traverse:jO,sequence:jL},URI:jD,bimap:jk,compose:jM,duplicate:jE,extend:jR,extract:jf,flap:jW,foldMap:jN,fst:jf,getApplicative:function(t){var n=jh(t);return{URI:jD,_E:void 0,map:n.map,ap:n.ap,of:jm(t)}},getApply:jh,getChain:jg,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,jd(a)),s=(a=r(s.left))[0];return[s.right,t.concat(u,jd(a))]},r=jg(t);return{URI:jD,_E:void 0,map:r.map,ap:r.ap,chain:r.chain,chainRec:n}},getMonad:function(t){var n=jg(t);return{URI:jD,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,of:jm(t)}},map:jI,mapFst:jI,mapLeft:jC,mapSnd:jC,readonlyTuple:{URI:jD,compose:jy,map:jv,bimap:jb,mapLeft:jx,extract:jf,extend:j_,reduce:jS,foldMap:jT,reduceRight:jw,traverse:jO,sequence:jL},reduce:jj,reduceRight:jA,sequence:jL,snd:jd,swap:jp,traverse:jP},Symbol.toStringTag,{value:"Module"}));var jz=globalThis&&globalThis.__assign||function(){return(jz=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)},jB=function(t){return function(n){return Object.keys(n).sort(t.compare)}},jV=jB(M7);function j$(t){if("function"==typeof t)return j$(M7)(t);var n=jB(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 jq=j$(M7)(function(t,n){return[t,n]});function jK(t){return function(n){if(!nQ.call(n,t))return n;var r=Object.assign({},n);return delete r[t],r}}var jH=function(t,n){return jZ(t,function(){return n})},jZ=function(t,n){return function(r){if(!Rw(t,r))return nU;var i=Object.assign({},r);return i[t]=n(r[t]),nz(i)}};function jG(t){return RD(t)}function jY(t){return RF(t)}function jJ(t){return RW(t)}var jQ=function(t){var n,r=RF(t);return function(n){return function(i){return t.map(nN(i,r(n)),j7)}}},jX=function(t){var n,r=RF(t);return function(n){return function(i){return t.map(nN(i,r(n)),Ne)}}};function j0(t){return RV(t)}function j1(t){return Rq(t)}function j2(t,n){return RK(t,n)}var j3=function(t){var n,r;return(n=it(),RK(n,f5))(t)};function j4(t,n){return RH(t,n)}var j5=function(t){var n=RQ(t);return function(t){return function(r){return Rv(r)?jz({},t):Rv(t)?jz({},r):n(t)(r)}}},j9=function(t){return function(n){return function(r){return Rv(r)||Rv(n)?{}:RX(t)(n)(r)}}},j6=function(t){return function(n){return Rv(n)?jz({},t):Rv(t)?jz({},n):R0(t)(n)}},j8=function(t){return function(n){var r=jB(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}}},j7=Ey,Ne=Ev,Nt="Record",Nn={URI:Nt,map:R1},Nr=rt(Nn),Ni=function(t){return{URI:Nt,reduce:R3(t),foldMap:R4(t),reduceRight:R5(t)}},No=function(t){return{URI:Nt,reduce:R3(t),foldMap:R4(t),reduceRight:R5(t),reduceWithIndex:Ee(t),foldMapWithIndex:Et(t),reduceRightWithIndex:En(t)}},Na={URI:Nt,compact:j7,separate:Ne},Nu=function(t){return{URI:Nt,map:R1,reduce:R3(t),foldMap:R4(t),reduceRight:R5(t),traverse:Eu(t),sequence:Es(t)}},Ns=function(t){return{URI:Nt,map:R1,mapWithIndex:R2,reduce:R3(t),foldMap:R4(t),reduceRight:R5(t),reduceWithIndex:Ee(t),foldMapWithIndex:Et(t),reduceRightWithIndex:En(t),traverse:Eu(t),sequence:Es(t),traverseWithIndex:j8(t)}},Nc=function(t){var n=Nu(t);return{URI:Nt,map:R1,reduce:R3(t),foldMap:R4(t),reduceRight:R5(t),traverse:n.traverse,sequence:n.sequence,compact:j7,separate:Ne,filter:R9,filterMap:R6,partition:R8,partitionMap:R7,wither:uz(n,Na),wilt:uU(n,Na)}},Nl=function(t){var n=j5(t);return{concat:function(t,r){return n(r)(t)}}},Nf=function(t){return{concat:Nl(t).concat,empty:{}}},Nd=function(t){var n=j9(t);return{concat:function(t,r){return n(r)(t)}}},Np=function(){return{concat:function(t,n){return j6(n)(t)}}},Nh={URI:Nt,reduce:R3(M7),foldMap:R4(M7),reduceRight:R5(M7)},Nm={URI:Nt,reduce:R3(M7),foldMap:R4(M7),reduceRight:R5(M7),reduceWithIndex:Ee(M7),foldMapWithIndex:Et(M7),reduceRightWithIndex:En(M7)},Ng={URI:Nt,map:R1,reduce:R3(M7),foldMap:R4(M7),reduceRight:R5(M7),traverse:Eu(M7),sequence:jJ},Ny={URI:Nt,map:R1,mapWithIndex:R2,reduce:R3(M7),foldMap:R4(M7),reduceRight:R5(M7),reduceWithIndex:Ee(M7),foldMapWithIndex:Et(M7),reduceRightWithIndex:En(M7),traverse:Eu(M7),sequence:jJ,traverseWithIndex:j8(M7)},Nv=uz(Ng,Na),Nb=uU(Ng,Na),Nx={URI:Nt,map:R1,reduce:R3(M7),foldMap:R4(M7),reduceRight:R5(M7),traverse:Eu(M7),sequence:jJ,compact:j7,separate:Ne,filter:R9,filterMap:R6,partition:R8,partitionMap:R7,wither:Nv,wilt:Nb},N_={URI:Nt,map:R1,reduce:R3(M7),foldMap:R4(M7),reduceRight:R5(M7),traverse:Eu(M7),sequence:jJ,compact:j7,separate:Ne,filter:R9,filterMap:R6,partition:R8,partitionMap:R7,mapWithIndex:R2,reduceWithIndex:Ee(M7),foldMapWithIndex:Et(M7),reduceRightWithIndex:En(M7),filterMapWithIndex:Eo,filterWithIndex:Ea,partitionMapWithIndex:Er,partitionWithIndex:Ei,traverseWithIndex:j8(M7),wither:Nv,wilt:Nb};let NS=Object.freeze(Object.defineProperty({__proto__:null,Compactable:Na,Filterable:{URI:Nt,map:R1,compact:j7,separate:Ne,filter:R9,filterMap:R6,partition:R8,partitionMap:R7},FilterableWithIndex:{URI:Nt,map:R1,mapWithIndex:R2,compact:j7,separate:Ne,filter:R9,filterMap:R6,partition:R8,partitionMap:R7,filterMapWithIndex:Eo,filterWithIndex:Ea,partitionMapWithIndex:Er,partitionWithIndex:Ei},Foldable:Nh,FoldableWithIndex:Nm,Functor:Nn,FunctorWithIndex:{URI:Nt,map:R1,mapWithIndex:R2},Traversable:Ng,TraversableWithIndex:Ny,URI:Nt,Witherable:Nx,collect:j$,compact:j7,deleteAt:jK,difference:j6,elem:RJ,empty:{},every:RG,filter:El,filterMap:Ef,filterMapWithIndex:R$,filterWithIndex:j1,flap:Nr,foldMap:function(t){return"compare"in t?Em(t):Em(M7)(t)},foldMapWithIndex:function(t){return"compare"in t?RA(t):RA(M7)(t)},fromEntries:j3,fromFoldable:j2,fromFoldableMap:j4,getDifferenceMagma:Np,getEq:E_,getFoldable:Ni,getFoldableWithIndex:No,getIntersectionSemigroup:Nd,getMonoid:ES,getShow:function(t){return"compare"in t?Ex(t):Ex(M7)(t)},getTraversable:Nu,getTraversableWithIndex:Ns,getUnionMonoid:Nf,getUnionSemigroup:Nl,getWitherable:Nc,has:Rw,hasOwnProperty:EB,insertAt:RT,intersection:j9,isEmpty:Rv,isSubrecord:RC,keys:jV,lookup:RM,map:Rj,mapWithIndex:RE,modifyAt:jZ,partition:Ed,partitionMap:Ep,partitionMapWithIndex:RB,partitionWithIndex:j0,pop:function(t){var n=jK(t);return function(r){var i=RM(t,r);return nF(i)?nU:nz([i.value,n(r)])}},record:N_,reduce:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length?Eh(t[0]):Eh(M7).apply(void 0,t)},reduceRight:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length?Eg(t[0]):Eg(M7).apply(void 0,t)},reduceRightWithIndex:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length?RP(t[0]):RP(M7).apply(void 0,t)},reduceWithIndex:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length?RN(t[0]):RN(M7).apply(void 0,t)},separate:Ne,sequence:jJ,singleton:RL,size:Ry,some:RY,toArray:jq,toEntries:jq,toUnfoldable:function(t){return function(n){var r=jq(n),i=r.length;return t.unfold(0,function(t){return t<i?nz([r[t],t+1]):nU})}},traverse:jY,traverseWithIndex:jG,union:j5,updateAt:jH,upsertAt:RT,wilt:jX,wither:jQ},Symbol.toStringTag,{value:"Module"}));var NT=function(t){return function(n){return nW(t(n))}},Nw=function(t){return function(n){return nV(t(n))}},NO=function(){return function(t){return!0}},Nk=function(t){return function(n){return!t(n)}},NI=function(t){return function(n){return function(r){return n(r)||t(r)}}},NC=function(t){return function(n){return function(r){return n(r)&&t(r)}}},NM=function(){return function(t){return!1}},NR=function(t){return function(n){return function(r){return n(r)&&t(r)}}};let NE=Object.freeze(Object.defineProperty({__proto__:null,and:NC,compose:NR,fromEitherK:Nw,fromOptionK:NT,id:NO,not:Nk,or:NI,zero:NM},Symbol.toStringTag,{value:"Module"}));var Nj=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])})}}},NN=function(t){return function(n){return t.sub(t.zero,n)}};let NA=Object.freeze(Object.defineProperty({__proto__:null,getFunctionRing:nx,getTupleRing:Nj,negate:NN,tuple:Nj},Symbol.toStringTag,{value:"Module"})),NP=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),NL=Object.freeze(Object.defineProperty({__proto__:null,getFunctionSemiring:nb},Symbol.toStringTag,{value:"Module"}));function ND(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 NF(t){var n=N1(t);return function(r,i){if(void 0===i){var o=NF(t);return function(t){return o(r,t)}}if(NX(r))return i;if(NX(i))return r;var a=new Set(r);return i.forEach(function(t){n(t,a)||a.add(t)}),a}}function NW(t){var n=N1(t);return function(r,i){if(void 0===i){var o=NW(t);return function(t){return o(t,r)}}if(NX(r)||NX(i))return new Set;var a=new Set;return r.forEach(function(t){n(t,i)&&a.add(t)}),a}}function NU(t){var n=N1(t);return function(r,i){if(void 0===i){var o=NU(t);return function(t){return o(t,r)}}return ND(function(t){return!n(t,i)})(r)}}var Nz=function(t){return{concat:NF(t)}},NB=function(t){return{concat:Nz(t).concat,empty:new Set}},NV=function(t){return{concat:NW(t)}},N$=function(t){return{concat:NU(t)}},Nq=function(t){return new Set([t])};function NK(t){var n=N1(t);return function(t){return function(r){if(n(t)(r))return r;var i=new Set(r);return i.add(t),i}}}var NH=function(t){return function(n){return function(r){return ND(function(r){return!t.equals(n,r)})(r)}}},NZ=function(t){var n=N1(t),r=NH(t),i=NK(t);return function(t){return function(o){return(n(t,o)?r:i)(t)(o)}}},NG=function(t){return function(n){for(var r=n.length,i=new Set,o=N1(t),a=0;a<r;a++){var u=n[a];o(u,i)||i.add(u)}return i}},NY=function(t){return NJ(t)(nS)};function NJ(t){var n=N1(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 NQ=new Set,NX=function(t){return 0===t.size},N0=function(t){return t.size},N1=jn,N2=function(t){return function(n){var r=[];return n.forEach(function(t){return r.push(t)}),r.sort(t.compare)}};let N3=Object.freeze(Object.defineProperty({__proto__:null,chain:function(t){var n=N1(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:NY,difference:NU,elem:N1,empty:NQ,every:je,filter:ND,filterMap:NJ,foldMap:EX,fromArray:NG,getDifferenceMagma:N$,getEq:jo,getIntersectionSemigroup:NV,getShow:ji,getUnionMonoid:NB,getUnionSemigroup:Nz,insert:NK,intersection:NW,isEmpty:NX,isSubset:jt,map:function(t){var n=N1(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 uC(a,o)}},partitionMap:function(t,n){return function(r){return function(i){for(var o,a=i.values(),u=new Set,s=new Set,c=N1(t),l=N1(n);!(o=a.next()).done;){var f=r(o.value);switch(f._tag){case"Left":c(f.left,u)||u.add(f.left);break;case"Right":l(f.right,s)||s.add(f.right)}}return uC(u,s)}}},reduce:EQ,reduceRight:E0,remove:NH,separate:function(t,n){return function(r){var i=N1(t),o=N1(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)}}),uC(a,u)}},singleton:Nq,size:N0,some:E7,subset:jt,toArray:N2,toggle:NZ,union:NF},Symbol.toStringTag,{value:"Module"}));var N4=function(t){return{show:function(n){var r="{";for(var i in t)nQ.call(t,i)&&(r+=" ".concat(i,": ").concat(t[i].show(n[i]),","));return r.length>1&&(r=r.slice(0,-1)+" "),r+="}"}}},N5=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 N9=Object.freeze(Object.defineProperty({__proto__:null,getStructShow:N4,getTupleShow:N5,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:N4,tuple:N5},Symbol.toStringTag,{value:"Module"}));function N6(t){return function(n){return function(r){return t.of([n,r])}}}function N8(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 N7(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 Ae(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 At(t){return function(n){return function(r){return t.of(n(r))}}}function An(t){return function(n){return function(r){return t.map(n,function(t){return[t,r]})}}}function Ar(t){return function(n){return function(r){return t.map(r(n),function(t){return t[0]})}}}function Ai(t){return function(n){return function(r){return t.map(r(n),jd)}}}let Ao=Object.freeze(Object.defineProperty({__proto__:null,ap:N7,chain:Ae,evaluate:Ar,execute:Ai,fromF:An,fromState:At,getStateM:function(t){var n=N7(t),r=N8(t),i=Ae(t),o=Ar(t),a=Ai(t);return{map:function(t,n){return nN(t,r(n))},ap:function(t,r){return nN(t,n(r))},of:N6(t),chain:function(t,n){return nN(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:At(t),fromM:An(t),evalState:function(t,n){return nN(t,o(n))},execState:function(t,n){return nN(t,a(n))}}},map:N8,of:N6},Symbol.toStringTag,{value:"Module"}));var Aa=function(t){return function(){return Cy(t)}},Au=N6(Mo);function As(t){return Av(Cb(t))}function Ac(t){return Av(C_(t))}function Al(t){return Av(CO(t))}var Af=function(t){return nC(t,Cv)},Ad=function(t){return function(n){return Cy(t(n)[0])}},Ap=mk(function(t){return Aa(t)},Au),Ah=At(Mo),Am=function(t){return Av(nT(t))},Ag=function(t){return Av(CI(t))},Ay=function(t){return Av(CC(t))},Av=An(Mr),Ab=function(t){return function(n){return nC(n,gH(t))}},Ax=function(t){return function(n){return function(r){return t(r)(n)(r)}}},A_=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return Ag(t.apply(void 0,n))}},AS=function(t){return function(n){return nN(n,AF(A_(t)))}},AT=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return Am(t.apply(void 0,n))}},Aw=function(t){return function(n){return nN(n,AF(AT(t)))}},AO=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return Av(t.apply(void 0,n))}},Ak=function(t){return function(n){return nN(n,AF(AO(t)))}},AI=function(t,n){return nN(t,AN(n))},AC=function(t,n){return nN(t,AL(n))},AM=function(t,n){return nN(t,AD(n))},AR=function(t,n){return function(r){return nN(t(r),C8(function(){return n()(r)}))}},AE=function(t,n,r){return function(i){return nN(t(i),C2(n,function(t){var n=t[0],i=t[1];return[r(n),i]}))}},Aj=function(t,n){return function(r){return nN(t(r),C3(n))}},AN=N8(Mr),AA=function(t,n){return function(r){return AE(r,t,n)}},AP=function(t){return function(n){return Aj(n,t)}},AL=N7(Mf),AD=Ae(Mf),AF=AD,AW=AF(nS),AU=function(t){return function(n){return function(r){return nN(n(r),C8(function(){return t()(r)}))}}},Az="StateReaderTaskEither",AB={URI:Az,map:AI},AV=rt(AB),A$={URI:Az,map:AI,ap:AC},Aq=n1(A$),AK=n2(A$),AH={URI:Az,map:AI,ap:AC,chain:AM},AZ={URI:Az,fromState:Ah},AG=vt(AZ),AY=vn(AZ),AJ=vr(AZ),AQ=vi(AZ),AX=vo(AZ),A0=va(AZ,AH),A1=rs(AH),A2={URI:Az,fromReader:Ac},A3=yk(A2),A4=yI(A2),A5=yC(A2),A9=yM(A2,AH),A6=yR(A2,AH),A8={URI:Az,fromEither:Ap},A7=rf(A8),Pe=rp(A8),Pt=rh(A8,AH),Pn=rg(A8,AH),Pr=ry(A8,AH),Pi=rd(A8),Po=rv(A8,AH),Pa=rm(A8),Pu={URI:Az,fromIO:Al},Ps=gB(Pu),Pc=gV(Pu,AH),Pl=g$(Pu,AH),Pf={URI:Az,fromIO:Al,fromTask:As},Pd=vs(Pf),Pp=vc(Pf,AH),Ph=vl(Pf,AH),Pm=Ar(Mr),Pg=Ai(Mr),Py=rn(AB),Pv=rc(AH),Pb=n3(A$),Px=function(t){return function(n){return function(r){return function(i){return function(){return nG(n).reduce(function(n,r,o){return n.then(function(a){return nB(a)?n:t(o+1,r)(a.right[1])(i)().then(function(t){if(nB(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,nZ(n))(r)(i)().then(me(function(t){var n;return[[t[0]],t[1]]})))}}}}},P_=function(t){var n=Px(t);return function(t){return nH(t)?n(t):Au(nY)}},PS=function(t){return P_(function(n,r){return t(r)})},PT=PS(nS),Pw=function(t,n){return nN(t(n),C1(function(t){return t[0]}))},PO=function(t,n){return nN(t(n),C1(function(t){return t[0],t[1]}))};let Pk=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:Az,map:AI,alt:AR},Applicative:{URI:Az,map:AI,ap:AC,of:Au},Apply:A$,Bifunctor:{URI:Az,bimap:AE,mapLeft:Aj},Chain:AH,FromEither:A8,FromIO:Pu,FromReader:A2,FromState:AZ,FromTask:Pf,Functor:AB,Monad:{URI:Az,map:AI,ap:AC,of:Au,chain:AM},MonadIO:{URI:Az,map:AI,ap:AC,of:Au,chain:AM,fromIO:Al},MonadTask:{URI:Az,map:AI,ap:AC,of:Au,chain:AM,fromIO:Al,fromTask:As},MonadThrow:{URI:Az,map:AI,ap:AC,of:Au,chain:AM,throwError:Aa},Pointed:{URI:Az,of:Au},URI:Az,alt:AU,altW:AU,ap:AL,apFirst:Aq,apFirstW:Aq,apS:Pb,apSW:Pb,apSecond:AK,apSecondW:AK,apW:AL,ask:A3,asks:A4,asksStateReaderTaskEither:Ax,asksStateReaderTaskEitherW:Ax,bimap:AA,bind:Pv,bindTo:Py,bindW:Pv,chain:AD,chainEitherK:Pn,chainEitherKW:Pn,chainFirst:A1,chainFirstEitherK:Pr,chainFirstEitherKW:Pr,chainFirstIOK:Pl,chainFirstReaderK:A6,chainFirstReaderKW:A6,chainFirstTaskK:Ph,chainFirstW:A1,chainIOEitherK:AS,chainIOEitherKW:AS,chainIOK:Pc,chainOptionK:Pt,chainReaderK:A9,chainReaderKW:A9,chainReaderTaskEitherK:Ak,chainReaderTaskEitherKW:Ak,chainStateK:A0,chainTaskEitherK:Aw,chainTaskEitherKW:Aw,chainTaskK:Pp,chainW:AF,evalState:Pw,evaluate:Pm,execState:PO,execute:Pg,filterOrElse:Po,filterOrElseW:Po,flap:AV,flatten:AW,flattenW:AW,fromEither:Ap,fromEitherK:Pa,fromIO:Al,fromIOEither:Ag,fromIOEitherK:A_,fromIOK:Ps,fromOption:A7,fromOptionK:Pe,fromPredicate:Pi,fromReader:Ac,fromReaderEither:Ay,fromReaderK:A5,fromReaderTaskEither:Av,fromReaderTaskEitherK:AO,fromState:Ah,fromStateK:AX,fromTask:As,fromTaskEither:Am,fromTaskEitherK:AT,fromTaskK:Pd,get:AG,gets:AQ,left:Aa,leftIO:function(t){return Av(Ck(t))},leftReader:function(t){return Av(CS(t))},leftState:Ad,leftTask:function(t){return Av(Cx(t))},local:Ab,map:AN,mapLeft:AP,modify:AJ,of:Au,put:AY,right:Au,rightIO:Al,rightReader:Ac,rightState:Af,rightTask:As,run:function(t,n,r){return t(n)(r)()},sequenceArray:PT,stateReaderTaskEither:{URI:Az,map:AI,of:Au,ap:AC,chain:AM,bimap:AE,mapLeft:Aj,alt:AR,fromIO:Al,fromTask:As,throwError:Aa},stateReaderTaskEitherSeq:{URI:Az,map:AI,of:Au,ap:AC,chain:AM,bimap:AE,mapLeft:Aj,alt:AR,fromIO:Al,fromTask:As,throwError:Aa},throwError:Aa,traverseArray:PS,traverseArrayWithIndex:P_,traverseReadonlyArrayWithIndex:P_,traverseReadonlyNonEmptyArrayWithIndex:Px},Symbol.toStringTag,{value:"Module"}));var PI=function(t,n){return nN(t,Pj(n))},PC=function(t,n){return nN(t,PM(n))},PM=function(t){return function(n){return{peek:function(r){return t({peek:n.peek,pos:r})},pos:n.pos}}},PR=function(t){return t.peek(t.pos)},PE=PM(nS),Pj=function(t){return function(n){return{peek:function(r){return t(n.peek(r))},pos:n.pos}}},PN="Store",PA={URI:PN,map:PI},PP=rt(PA),PL={URI:PN,map:PI,extend:PC,extract:PR};let PD=Object.freeze(Object.defineProperty({__proto__:null,Comonad:PL,Functor:PA,URI:PN,duplicate:PE,experiment:function(t){return function(n){return function(r){return t.map(n(r.pos),function(t){return r.peek(t)})}}},extend:PM,extract:PR,flap:PP,map:Pj,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:PL},Symbol.toStringTag,{value:"Module"}));function PF(t,n){return function(r,i){return n.compose(t.second(i),t.first(r))}}function PW(t,n){var r=PF(t,n);return function(i,o){return n.compose(r(i,o),t.promap(n.id(),nS,function(t){return[t,t]}))}}let PU=Object.freeze(Object.defineProperty({__proto__:null,fanOut:PW,fanout:function(t){return PW(t,t)},split:PF,splitStrong:function(t){return PF(t,t)}},Symbol.toStringTag,{value:"Module"}));var Pz=function(){return{concat:function(t,n){return Object.assign({},t,n)}}},PB=function(t){return function(n){var r={};for(var i in n)nQ.call(n,i)&&(r[i]=t[i](n[i]));return r}};let PV=Object.freeze(Object.defineProperty({__proto__:null,evolve:PB,getAssignSemigroup:Pz},Symbol.toStringTag,{value:"Module"}));var P$=globalThis&&globalThis.__awaiter||function(t,n,r,i){return new(r||(r=Promise))(function(o,a){function u(t){try{c(i.next(t))}catch(n){a(n)}}function s(t){try{c(i.throw(t))}catch(n){a(n)}}function c(t){var n;t.done?o(t.value):((n=t.value)instanceof r?n:new r(function(t){t(n)})).then(u,s)}c((i=i.apply(t,n||[])).next())})},Pq=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])}}},PK=xR(Oj),PH=xF(Oj),PZ=xW(Oj),PG=function(t){return PY(Ob(t))},PY=xj(OR),PJ=Ow(d1),PQ=xU(OR),PX=xz(OW),P0=xB(OU),P1=xN(Oj),P2=function(t){return function(){return P$(void 0,void 0,void 0,function(){return Pq(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,t().then(nz)];case 1:return[2,n.sent()];case 2:return n.sent(),[2,nU];case 3:return[2]}})})}},P3=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return P2(function(){return t.apply(void 0,n)})}},P4=xA(Oj),P5=xP(OU),P9=xL(Oj),P6=xD(OU),P8=xV(OR),P7=x$(ON),Le=xq(OU),Lt=Le(nS),Ln=xK(OU),Lr=xE(Oj),Li=Lr(),Lo=hg(OR,pR),La=hy(OR,pR,pf),Lu=gk(OR,pP),Ls=gI(OR,pP),Lc=gC(OR,pP),Ll=gM(OR,pP),Lf=function(t,n){return nN(t,P8(n))},Ld=function(t,n){return nN(t,P7(n))},Lp=function(t,n){return nN(t,Le(n))},Lh=function(t,n){return nN(t,Ln(n))},Lm=function(t,n){return nN(t,Lu(n))},Lg=function(t,n){return nN(t,Ls(n))},Ly=function(t,n){return nN(t,Lc(n))},Lv=function(t,n){return nN(t,Ll(n))},Lb="TaskOption",Lx={URI:Lb,map:Lf},L_=rt(Lx),LS={URI:Lb,of:PK},LT={URI:Lb,map:Lf,ap:Ld},Lw=n1(LT),LO=n2(LT),Lk=function(t,n){return nN(t,Le(function(t){return nN(n,P8(t))}))},LI={URI:Lb,map:Lf,ap:Ld,chain:Lp},LC=rs(LI),LM={URI:Lb,zero:Lr},LR=u$(LM,LS),LE={URI:Lb,fromIO:PG},Lj=gB(LE),LN=gV(LE,LI),LA=g$(LE,LI),LP={URI:Lb,fromEither:PZ},LL=rm(LP),LD=rg(LP,LI),LF=ry(LP,LI),LW={URI:Lb,fromIO:PG,fromTask:PY},LU=vs(LW),Lz=vc(LW,LI),LB=vl(LW,LI),LV=PK(nJ),L$=rn(Lx),Lq=rc(LI),LK=n3(LT),LH=PK(nY),LZ=function(t){return nC(OQ(t),Ow(ha(nA)))},LG=function(t){var n=LZ(t);return function(t){return nH(t)?n(t):LH}},LY=function(t){return function(n){return function(){return nG(n).reduce(function(n,r,i){return n.then(function(o){return nF(o)?n:t(i+1,r)().then(function(t){return nF(t)?t:(o.value.push(t.value),o)})})},t(0,nZ(n))().then(pl(nK)))}}},LJ=function(t){var n=LY(t);return function(t){return nH(t)?n(t):LH}},LQ=function(t){return LG(function(n,r){return t(r)})},LX=LQ(nS),L0=function(t){return LJ(function(n,r){return t(r)})},L1=L0(nS);let L2=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:Lb,map:Lf,alt:Lh},Alternative:{URI:Lb,map:Lf,ap:Ld,of:PK,alt:Lh,zero:Lr},ApT:LH,ApplicativePar:{URI:Lb,map:Lf,ap:Ld,of:PK},ApplicativeSeq:{URI:Lb,map:Lf,ap:Lk,of:PK},ApplyPar:LT,ApplySeq:{URI:Lb,map:Lf,ap:Lk},Chain:LI,Compactable:{URI:Lb,compact:Lo,separate:La},Do:LV,Filterable:{URI:Lb,map:Lf,compact:Lo,separate:La,filter:Lm,filterMap:Lg,partition:Ly,partitionMap:Lv},FromEither:LP,FromIO:LE,FromTask:LW,Functor:Lx,Monad:{URI:Lb,map:Lf,ap:Ld,of:PK,chain:Lp},MonadIO:{URI:Lb,map:Lf,ap:Ld,of:PK,chain:Lp,fromIO:PG},MonadTask:{URI:Lb,map:Lf,ap:Ld,of:PK,chain:Lp,fromIO:PG,fromTask:PY},Pointed:LS,Zero:LM,alt:Ln,altW:Ln,ap:P7,apFirst:Lw,apS:LK,apSecond:LO,bind:Lq,bindTo:L$,chain:Le,chainEitherK:LD,chainFirst:LC,chainFirstEitherK:LF,chainFirstIOK:LA,chainFirstTaskK:LB,chainIOK:LN,chainNullableK:P5,chainOptionK:P6,chainTaskK:Lz,compact:Lo,filter:Lu,filterMap:Ls,flap:L_,flatten:Lt,fold:PX,foldW:PX,fromEither:PZ,fromEitherK:LL,fromIO:PG,fromIOK:Lj,fromNullable:P1,fromNullableK:P4,fromOption:Ok,fromOptionK:P9,fromPredicate:PH,fromTask:PY,fromTaskEither:PJ,fromTaskK:LU,getOrElse:P0,getOrElseW:P0,guard:LR,map:P8,match:PQ,matchE:PX,matchEW:PX,matchW:PQ,none:Li,of:PK,partition:Lc,partitionMap:Ll,separate:La,sequenceArray:LX,sequenceSeqArray:L1,some:PK,traverseArray:LQ,traverseArrayWithIndex:LG,traverseReadonlyArrayWithIndex:LG,traverseReadonlyArrayWithIndexSeq:LJ,traverseReadonlyNonEmptyArrayWithIndex:LZ,traverseReadonlyNonEmptyArrayWithIndexSeq:LY,traverseSeqArray:L0,traverseSeqArrayWithIndex:LJ,tryCatch:P2,tryCatchK:P3,zero:Lr},Symbol.toStringTag,{value:"Module"}));var L3=function(t){return"Left"===t._tag},L4=function(t){return"Right"===t._tag};function L5(t){return"Both"===t._tag}function L9(t){return{_tag:"Left",left:t}}function L6(t){return{_tag:"Right",right:t}}function L8(t,n){return{_tag:"Both",left:t,right:n}}var L7=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)}}},De=L7(L6,L9,function(t,n){return L8(n,t)});function Dt(t,n){return{concat:function(r,i){return L3(r)?L3(i)?L9(t.concat(r.left,i.left)):L4(i)?L8(r.left,i.right):L8(t.concat(r.left,i.left),i.right):L4(r)?L3(i)?L8(i.left,r.right):L4(i)?L6(n.concat(r.right,i.right)):L8(i.left,n.concat(r.right,i.right)):L3(i)?L8(t.concat(r.left,i.left),r.right):L4(i)?L8(r.left,n.concat(r.right,i.right)):L8(t.concat(r.left,i.left),n.concat(r.right,i.right))}}}var Dn=function(t){return{URI:Dx,_E:void 0,map:Do,ap:function(n,r){return L3(n)?L3(r)?L9(t.concat(n.left,r.left)):L4(r)?L9(n.left):L9(t.concat(n.left,r.left)):L4(n)?L3(r)?L9(r.left):L4(r)?L6(n.right(r.right)):L8(r.left,n.right(r.right)):L3(r)?L9(t.concat(n.left,r.left)):L4(r)?L8(n.left,n.right(r.right)):L8(t.concat(n.left,r.left),n.right(r.right))}}};function Dr(t){var n=Dn(t),r=function(n,r){if(L3(n))return n;if(L4(n))return r(n.right);var i=r(n.right);return L3(i)?L9(t.concat(n.left,i.left)):L4(i)?L8(n.left,i.right):L8(t.concat(n.left,i.left),i.right)};return{URI:Dx,_E:void 0,map:Do,ap:n.ap,chain:r}}var Di=function(t,n){return nF(t)?nF(n)?nU:nz(L6(n.value)):nF(n)?nz(L9(t.value)):nz(L8(t.value,n.value))},Do=function(t,n){return nN(t,Dh(n))},Da=function(t,n,r){return nN(t,Dd(n,r))},Du=function(t,n){return nN(t,Dp(n))},Ds=function(t,n,r){return nN(t,Dm(n,r))},Dc=function(t){var n=Dg(t);return function(t,r){return nN(t,n(r))}},Dl=function(t,n,r){return nN(t,Dy(n,r))},Df=function(t){var n=Dv(t);return function(t,r){return nN(t,n(r))}},Dd=function(t,n){return function(r){return L3(r)?L9(t(r.left)):L4(r)?L6(n(r.right)):L8(t(r.left),n(r.right))}},Dp=function(t){return function(n){return L3(n)?L9(t(n.left)):L5(n)?L8(t(n.left),n.right):n}},Dh=function(t){return function(n){return L3(n)?n:L4(n)?L6(t(n.right)):L8(n.left,t(n.right))}},Dm=function(t,n){return function(r){return L3(r)?t:n(t,r.right)}},Dg=function(t){return function(n){return function(r){return L3(r)?t.empty:n(r.right)}}},Dy=function(t,n){return function(r){return L3(r)?t:n(r.right,t)}},Dv=function(t){return function(n){return function(r){return L3(r)?t.of(r):L4(r)?t.map(n(r.right),L6):t.map(n(r.right),function(t){return L8(r.left,t)})}}},Db=function(t){return function(n){return L3(n)?t.of(n):L4(n)?t.map(n.right,L6):t.map(n.right,function(t){return L8(n.left,t)})}},Dx="These",D_={URI:Dx,map:Do},DS=rt(D_),DT={URI:Dx,fromEither:nS},Dw=rf(DT),DO=rp(DT),Dk=function(t){return function(n){return function(r){return!L3(r)&&t.equals(n,r.right)}}},DI=function(t){return function(n){return!L3(n)&&t(n.right)}},DC=function(t,n){return function(r){return L3(r)?[r.left,n()]:L4(r)?[t(),r.right]:[r.left,r.right]}},DM=function(t,n){return DC(function(){return t},function(){return n})},DR=L6(nY),DE=function(t){return function(n){return function(r){var i=nU,o=n(0,nZ(r));if(L3(o))return o;L5(o)&&(i=nz(o.left));for(var a=[o.right],u=1;u<r.length;u++){var s=n(u,r[u]);if(L3(s))return s;L5(s)&&(i=nF(i)?nz(s.left):nz(t.concat(i.value,s.left))),a.push(s.right)}return nF(i)?L6(a):L8(i.value,a)}}},Dj=function(t){return function(n){var r=DE(t)(n);return function(t){return nH(t)?r(t):DR}}};let DN=Object.freeze(Object.defineProperty({__proto__:null,ApT:DR,Bifunctor:{URI:Dx,bimap:Da,mapLeft:Du},Foldable:{URI:Dx,reduce:Ds,foldMap:Dc,reduceRight:Dl},FromEither:DT,FromThese:{URI:Dx,fromThese:nS},Functor:D_,Pointed:{URI:Dx,of:L6},Traversable:{URI:Dx,map:Do,reduce:Ds,foldMap:Dc,reduceRight:Dl,traverse:Df,sequence:Db},URI:Dx,bimap:Dd,both:L8,elem:Dk,exists:DI,flap:DS,fold:L7,foldMap:Dg,foldW:L7,fromOption:Dw,fromOptionK:DO,fromOptions:Di,getApplicative:function(t){var n=Dn(t);return{URI:Dx,_E:void 0,map:Do,ap:n.ap,of:L6}},getApply:Dn,getChain:Dr,getEq:function(t,n){return rx(function(r,i){return L3(r)?L3(i)&&t.equals(r.left,i.left):L4(r)?L4(i)&&n.equals(r.right,i.right):L5(i)&&t.equals(r.left,i.left)&&n.equals(r.right,i.right)})},getLeft:function(t){return L3(t)?nz(t.left):L4(t)?nU:nz(t.left)},getLeftOnly:function(t){return L3(t)?nz(t.left):nU},getMonad:function(t){var n=Dr(t);return{URI:Dx,_E:void 0,map:Do,of:L6,ap:n.ap,chain:n.chain,throwError:L9}},getRight:function(t){return L3(t)?nU:(L4(t),nz(t.right))},getRightOnly:function(t){return L4(t)?nz(t.right):nU},getSemigroup:Dt,getShow:function(t,n){return{show:L7(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:L5,isLeft:L3,isRight:L4,left:L9,leftOrBoth:function(t){return function(n){return nF(n)?L9(t):L8(t,n.value)}},map:Dh,mapLeft:Dp,match:L7,matchW:L7,of:L6,reduce:Dm,reduceRight:Dy,right:L6,rightOrBoth:function(t){return function(n){return nF(n)?L6(t):L8(n.value,t)}},sequence:Db,swap:De,these:{URI:Dx,map:Do,bimap:Da,mapLeft:Du,reduce:Ds,foldMap:Dc,reduceRight:Dl,traverse:Df,sequence:Db},toTuple:DM,toTuple2:DC,traverse:Dv,traverseReadonlyArrayWithIndex:Dj,traverseReadonlyNonEmptyArrayWithIndex:DE},Symbol.toStringTag,{value:"Module"}));function DA(t){return nC(L6,t.of)}function DP(t){return nC(L9,t.of)}function DL(t){return nC(L8,t.of)}function DD(t){return function(n){return t.map(n,L6)}}function DF(t){return function(n){return t.map(n,L9)}}function DW(t){return re(t,D_)}function DU(t,n){return n0(t,Dn(n))}function Dz(t,n){var r=DP(t);return function(i){return function(o){return t.chain(o,L7(r,i,function(r,o){return t.map(i(o),L7(function(t){return L9(n.concat(r,t))},function(t){return L8(r,t)},function(t,i){return L8(n.concat(r,t),i)}))}))}}}function DB(t){return function(n,r){return function(i){return t.map(i,Dd(n,r))}}}function DV(t){return function(n){return function(r){return t.map(r,Dp(n))}}}function D$(t){return function(n,r,i){return function(o){return t.map(o,L7(n,r,i))}}}function Dq(t){return function(n,r,i){return function(o){return t.chain(o,L7(n,r,i))}}}function DK(t){return function(n){return t.map(n,De)}}function DH(t){return function(n,r){return function(i){return t.map(i,DC(n,r))}}}let DZ=Object.freeze(Object.defineProperty({__proto__:null,ap:DU,bimap:DB,both:DL,chain:Dz,getTheseM:function(t){var n=DW(t),r=DB(t),i=DV(t),o=Dq(t),a=DH(t),u=DA(t),s=function(t,r){return nN(t,n(r))};return{map:s,bimap:function(t,n,i){return nN(t,r(n,i))},mapLeft:function(t,n){return nN(t,i(n))},fold:function(t,n,r,i){return nN(t,o(n,r,i))},swap:DK(t),rightM:DD(t),leftM:DF(t),left:DP(t),right:DA(t),both:DL(t),toTuple:function(t,n,r){return nN(t,a(function(){return n},function(){return r}))},getMonad:function(n){var r=DU(t,n),i=Dz(t,n);return{_E:void 0,map:s,of:u,ap:function(t,n){return nN(t,r(n))},chain:function(t,n){return nN(t,i(n))}}}}},left:DP,leftF:DF,map:DW,mapLeft:DV,match:D$,matchE:Dq,right:DA,rightF:DD,swap:DK,toTuple2:DH},Symbol.toStringTag,{value:"Module"}));var DG=DP(Oj),DY=DA(Oj),DJ=DL(Oj),DQ=DD(OR),DX=DF(OR),D0=nC(Ob,DQ),D1=nC(Ob,DX),D2=D$(OR),D3=Dq(OU),D4=DK(OR),D5=function(t,n){return nN(t,D8(n))},D9=function(t,n,r){return nN(t,D7(n,r))},D6=function(t,n){return nN(t,Fe(n))},D8=DW(OR),D7=DB(OR),Fe=DV(OR),Ft="TaskThese",Fn=function(t,n){var r=DU(t,n);return{URI:Ft,_E:void 0,map:D5,ap:function(t,n){return nN(t,r(n))}}};function Fr(t,n){var r=Fn(t,n).ap;return{URI:Ft,_E:void 0,map:D5,ap:r,of:DY}}function Fi(t){var n=Fn(OL,t),r=Dz(OU,t);return{URI:Ft,_E:void 0,map:D5,ap:n.ap,chain:function(t,n){return nN(t,r(n))}}}var Fo={URI:Ft,map:D5},Fa=rt(Fo),Fu={URI:Ft,fromEither:Ok},Fs=rf(Fu),Fc=rp(Fu),Fl=rd(Fu),Ff={URI:Ft,fromThese:Ok},Fd=vd(Ff),Fp={URI:Ft,fromIO:D0},Fh=gB(Fp),Fm={URI:Ft,fromIO:D0,fromTask:DQ},Fg=vs(Fm),Fy=DH(OR),Fv=DY(nY),Fb=function(t){var n=DE(t);return function(t){return nC(OQ(t),Ow(n(nA)))}},Fx=function(t){return function(n){var r=Fb(t)(n);return function(t){return nH(t)?r(t):Fv}}},F_=function(t){return function(n){return function(r){return function(){return nG(r).reduce(function(r,i,o){return r.then(function(a){return L3(a)?r:n(o+1,i)().then(function(n){if(L3(n))return n;if(L5(n)){var r=a.right;return r.push(n.right),L5(a)?L8(t.concat(a.left,n.left),r):L8(n.left,r)}return a.right.push(n.right),a})})},n(0,nZ(r))().then(Dh(nK)))}}}},FS=function(t){return function(n){var r=F_(t)(n);return function(t){return nH(t)?r(t):Fv}}},FT=function(t,n){return Fy(function(){return t},function(){return n})},Fw=function(t,n){return n4(OD)(Dt(t,n))};let FO=Object.freeze(Object.defineProperty({__proto__:null,ApT:Fv,Bifunctor:{URI:Ft,bimap:D9,mapLeft:D6},FromEither:Fu,FromIO:Fp,FromTask:Fm,FromThese:Ff,Functor:Fo,Pointed:{URI:Ft,of:DY},URI:Ft,bifunctorTaskThese:{URI:Ft,bimap:D9,mapLeft:D6},bimap:D7,both:DJ,flap:Fa,fold:D3,foldW:D3,fromEither:Ok,fromIO:D0,fromIOEither:Ob,fromIOK:Fh,fromOption:Fs,fromOptionK:Fc,fromPredicate:Fl,fromTask:DQ,fromTaskK:Fg,fromThese:Ok,fromTheseK:Fd,functorTaskThese:{URI:Ft,map:D5},getApplicative:Fr,getApply:Fn,getChain:Fi,getMonad:function(t){var n=Fr(OL,t),r=Fi(t);return{URI:Ft,_E:void 0,map:D5,ap:n.ap,of:DY,chain:r.chain,fromIO:D0,fromTask:DQ}},getSemigroup:Fw,left:DG,leftIO:D1,leftTask:DX,map:D8,mapLeft:Fe,match:D2,matchE:D3,matchEW:D3,matchW:D2,of:DY,right:DY,rightIO:D0,rightTask:DQ,swap:D4,taskThese:{URI:Ft,map:D5,bimap:D9,mapLeft:D6},toTuple:FT,toTuple2:Fy,traverseReadonlyArrayWithIndex:Fx,traverseReadonlyArrayWithIndexSeq:FS,traverseReadonlyNonEmptyArrayWithIndex:Fb,traverseReadonlyNonEmptyArrayWithIndexSeq:F_},Symbol.toStringTag,{value:"Module"}));var Fk=function(t,n){return nN(t,FI(n))},FI=function(t){return function(n){return function(r){return t(n(r))}}},FC="Traced",FM={URI:FC,map:Fk},FR=rt(FM);let FE=Object.freeze(Object.defineProperty({__proto__:null,Functor:FM,URI:FC,censor:function(t){return function(n){return function(r){return n(t(r))}}},flap:FR,getComonad:function(t){return{URI:FC,_E:void 0,map:Fk,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:FI,traced:FM,tracks:function(t,n){return function(r){return r(n(r(t.empty)))}}},Symbol.toStringTag,{value:"Module"}));function Fj(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 FN(t,n){return function(r){var i=t.sequence(r),o=n.sequence(r);return function(n){return i(t.map(n,o))}}}let FA=Object.freeze(Object.defineProperty({__proto__:null,getTraversableComposition:function(t,n){var r=rr(t,n).map,i=gL(t,n),o=Fj(t,n),a=FN(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 nN(t,n(r))}},sequence:function(t){var n=a(t);return function(t){return nN(t,n)}}}},sequence:FN,traverse:Fj},Symbol.toStringTag,{value:"Module"})),FP=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function FL(t,n){return void 0===n&&(n=[]),{value:t,forest:n}}var FD=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+=FD(t+(o>1&&!u?"│ ":" "),r.forest)}return i};function FF(t){return FD(`
2
- `,t)}function FW(t,n){var r,i=n(t);return{value:i[0],forest:FU(i[1],n)}}function FU(t,n){return t.map(function(t){return FW(t,n)})}function Fz(t){var n=FB(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 FB(t){var n=fP(t);return function(r,i){return nN(r,n(function(n){return Fz(t)(n,i)}))}}var FV=function(t,n){return nN(t,F2(n))},F$=function(t,n){return nN(t,FQ(function(t){return nN(n,F2(t))}))},Fq=function(t,n){return nN(t,FQ(n))},FK=function(t,n,r){return nN(t,F3(n,r))},FH=function(t){var n=F4(t);return function(t,r){return nN(t,n(r))}},FZ=function(t,n,r){return nN(t,F5(n,r))},FG=function(t,n){return nN(t,FX(n))},FY=function(t){var n=F6(t);return function(t,r){return nN(t,n(r))}},FJ=function(t){return function(n){return F$(n,t)}},FQ=function(t){return function(n){var r=t(n.value),i=r.value,o=r.forest,a=fV().concat;return{value:i,forest:a(o,n.forest.map(FQ(t)))}}},FX=function(t){return function(n){return{value:t(n),forest:n.forest.map(FX(t))}}},F0=FX(nS),F1=FQ(nS),F2=function(t){return function(n){return{value:t(n.value),forest:n.forest.map(F2(t))}}},F3=function(t,n){return function(r){for(var i=n(t,r.value),o=r.forest.length,a=0;a<o;a++)i=nN(r.forest[a],F3(i,n));return i}},F4=function(t){return function(n){return F3(t.empty,function(r,i){return t.concat(r,n(i))})}},F5=function(t,n){return function(r){for(var i=t,o=r.forest.length,a=o-1;a>=0;a--)i=nN(r.forest[a],F5(i,n));return n(r.value,i)}},F9=function(t){return t.value},F6=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}}}),nN(o.forest,n(r(i))))}};return r},F8=function(t){return F6(t)(nS)},F7=function(t){return FL(t)},We="Tree",Wt={URI:We,map:FV},Wn=rt(Wt),Wr={URI:We,map:FV,ap:F$},Wi=n1(Wr),Wo=n2(Wr),Wa={URI:We,map:FV,ap:F$,chain:Fq},Wu=rs(Wa),Ws=F7(nJ),Wc=rn(Wt),Wl=rc(Wa),Wf=n3(Wr),Wd=function(t){return function(n){return t(n.value)||n.forest.some(Wd(t))}};let Wp=Object.freeze(Object.defineProperty({__proto__:null,Applicative:{URI:We,map:FV,ap:F$,of:F7},Apply:Wr,Chain:Wa,Comonad:{URI:We,map:FV,extend:FG,extract:F9},Do:Ws,Foldable:{URI:We,reduce:FK,foldMap:FH,reduceRight:FZ},Functor:Wt,Monad:{URI:We,map:FV,ap:F$,of:F7,chain:Fq},Pointed:{URI:We,of:F7},Traversable:{URI:We,map:FV,reduce:FK,foldMap:FH,reduceRight:FZ,traverse:FY,sequence:F8},URI:We,ap:FJ,apFirst:Wi,apS:Wf,apSecond:Wo,bind:Wl,bindTo:Wc,chain:FQ,chainFirst:Wu,drawForest:FF,drawTree:function(t){return t.value+FF(t.forest)},duplicate:F0,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:Wd,extend:FX,extract:F9,flap:Wn,flatten:F1,fold:function(t){var n=function(r){return t(r.value,r.forest.map(n))};return n},foldMap:F4,getEq:function(t){var n,r=rx(function(r,i){return t.equals(r.value,i.value)&&n.equals(r.forest,i.forest)});return n=cE(r),r},getShow:function(t){var n=function(r){return la(r.forest)?"make(".concat(t.show(r.value),")"):"make(".concat(t.show(r.value),", [").concat(r.forest.map(n).join(", "),"])")};return{show:n}},make:FL,map:F2,of:F7,reduce:F3,reduceRight:F5,sequence:F8,traverse:F6,tree:{URI:We,map:FV,of:F7,ap:F$,chain:Fq,reduce:FK,foldMap:FH,reduceRight:FZ,traverse:FY,sequence:F8,extract:F9,extend:FG},unfoldForest:FU,unfoldForestM:FB,unfoldTree:FW,unfoldTreeM:Fz},Symbol.toStringTag,{value:"Module"}));var Wh=function(t){var n;return[jd(t),(n=t,n[0])]};function Wm(t){return{URI:WF,_E:void 0,map:Wb,ap:function(n,r){var i,o;return[(i=n,i[0])((o=r,o[0])),t.concat(jd(n),jd(r))]}}}var Wg=function(t){return function(n){return[n,t.empty]}};function Wy(t){var n=Wm(t);return{URI:WF,_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(jd(n),u)]}}}var Wv=function(t,n){return nN(t,WR(n))},Wb=function(t,n){return nN(t,WC(n))},Wx=function(t,n,r){return nN(t,WI(n,r))},W_=function(t,n){return nN(t,WM(n))},WS=function(t,n){return nN(t,WE(n))},WT=function(t,n,r){return nN(t,WA(n,r))},Ww=function(t){var n=WN();return function(t,r){return nN(t,n(r))}},WO=function(t,n,r){return nN(t,WP(n,r))};function Wk(t){var n=WL(t);return function(t,r){return nN(t,n(r))}}var WI=function(t,n){return function(r){var i;return[n((i=r,i[0])),t(jd(r))]}},WC=function(t){return function(n){var r;return[t((r=n,r[0])),jd(n)]}},WM=function(t){return function(n){var r;return[(r=n,r[0]),t(jd(n))]}},WR=function(t){return function(n){var r;return[(r=n,r[0]),jd(t)]}},WE=function(t){return function(n){return[t(n),jd(n)]}},Wj=WE(nS),WN=jN,WA=jj,WP=jA,WL=function(t){return function(n){return function(r){var i;return t.map(n((i=r,i[0])),function(t){return[t,jd(r)]})}}},WD=function(t){return function(n){var r;return t.map((r=n,r[0]),function(t){return[t,jd(n)]})}},WF="Tuple",WW={URI:WF,map:Wb},WU=rt(WW);let Wz=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:{URI:WF,bimap:Wx,mapLeft:W_},Comonad:{URI:WF,map:Wb,extend:WS,extract:jf},Foldable:{URI:WF,reduce:WT,foldMap:Ww,reduceRight:WO},Functor:WW,Semigroupoid:{URI:WF,compose:Wv},Traversable:{URI:WF,map:Wb,reduce:WT,foldMap:Ww,reduceRight:WO,traverse:Wk,sequence:WD},URI:WF,bimap:WI,compose:WR,duplicate:Wj,extend:WE,extract:jf,flap:WU,foldMap:WN,fst:jf,getApplicative:function(t){var n=Wm(t);return{URI:WF,_E:void 0,map:n.map,ap:n.ap,of:Wg(t)}},getApply:Wm,getChain:Wy,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,jd(a)),s=(o=a=r(s.left))[0]}return[s.right,t.concat(u,jd(a))]},r=Wy(t);return{URI:WF,_E:void 0,map:r.map,ap:r.ap,chain:r.chain,chainRec:n}},getMonad:function(t){var n=Wy(t);return{URI:WF,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,of:Wg(t)}},map:WC,mapFst:WC,mapLeft:WM,mapSnd:WM,reduce:WA,reduceRight:WP,sequence:WD,snd:jd,swap:Wh,traverse:WL,tuple:{URI:WF,compose:Wv,map:Wb,bimap:Wx,mapLeft:W_,extract:jf,extend:WS,reduce:WT,foldMap:Ww,reduceRight:WO,traverse:Wk,sequence:WD}},Symbol.toStringTag,{value:"Module"})),WB=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),WV=Object.freeze(Object.defineProperty({__proto__:null,getValidationM:function(t,n){var r=ra(n,h8(t));return{map:r.map,ap:r.ap,of:r.of,chain:function(t,r){return n.chain(t,function(t){return nB(t)?n.of(n$(t.left)):r(t.right)})},alt:function(r,i){return n.chain(r,function(r){return nV(r)?n.of(r):n.map(i(),function(n){return nB(n)?n$(t.concat(r.left,n.left)):n})})}}}},Symbol.toStringTag,{value:"Module"}));var W$=r9(void 0),Wq={concat:W$.concat,empty:void 0};let WK=Object.freeze(Object.defineProperty({__proto__:null,Monoid:Wq,Semigroup:W$},Symbol.toStringTag,{value:"Module"}));var WH=function(t){return function(){return[void 0,t]}},WZ=function(t){return function(){var n=t(),r=n[0],i=n[1];return[[r,i],i]}},WG=function(t){return function(){var n,r=t(),i=r[0],o=i[0];return[o,(0,i[1])(r[1])]}},WY=function(t){return function(n){return function(){var r=n(),i=r[0],o=r[1];return[[i,t(o)],o]}}},WJ=function(t){return function(n){return function(){var r,i=n();return[i[0],t(i[1])]}}},WQ=function(t,n){return nN(t,WX(n))},WX=function(t){return function(n){return function(){var r=n(),i=r[0],o=r[1];return[t(i),o]}}},W0="Writer",W1=function(t){return{URI:W0,_E:void 0,of:function(n){return function(){return[n,t.empty]}}}},W2=function(t){return{URI:W0,_E:void 0,map:WQ,ap:function(n,r){return function(){var i=n(),o=i[0],a=i[1],u=r(),s=u[0],c=u[1];return[o(s),t.concat(a,c)]}}}},W3=function(t){var n=W2(t),r=W1(t);return{URI:W0,_E:void 0,map:WQ,ap:n.ap,of:r.of}};function W4(t){var n=W2(t);return{URI:W0,_E:void 0,map:WQ,ap:n.ap,chain:function(n,r){return function(){var i=n(),o=i[0],a=i[1],u=r(o)(),s=u[0],c=u[1];return[s,t.concat(a,c)]}}}}var W5={URI:W0,map:WQ},W9=rt(W5),W6=function(t){return t()[0]},W8=function(t){return t()[1]},W7=function(t){return t()[0]},Ue=function(t){return t()[1]};let Ut=Object.freeze(Object.defineProperty({__proto__:null,Functor:W5,URI:W0,censor:WJ,evalWriter:W7,evaluate:W6,execWriter:Ue,execute:W8,flap:W9,getApplicative:W3,getApply:W2,getChain:W4,getMonad:function(t){var n=W3(t),r=W4(t);return{URI:W0,_E:void 0,map:WQ,ap:n.ap,of:n.of,chain:r.chain}},getPointed:W1,listen:WZ,listens:WY,map:WX,pass:WG,tell:WH,writer:W5},Symbol.toStringTag,{value:"Module"})),Un=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"})),Ur=Object.freeze(Object.defineProperty({__proto__:null,alt:nh,alternative:nm,applicative:ru,apply:n7,array:dd,bifunctor:dp,boolean:dS,booleanAlgebra:dw,bounded:dC,boundedDistributiveLattice:dE,boundedJoinSemilattice:dj,boundedLattice:dN,boundedMeetSemilattice:dA,category:dP,chain:rl,chainRec:dD,choice:dU,comonad:dz,compactable:hv,console:hT,const:hD,contravariant:hF,date:hB,distributiveLattice:dR,either:m9,eitherT:gb,endomorphism:gS,eq:rR,extend:gT,field:gO,filterable:gR,filterableWithIndex:gE,foldable:gD,foldableWithIndex:gz,fromEither:rb,fromIO:gq,fromReader:yE,fromState:vu,fromTask:vf,fromThese:vp,function:nL,functor:ri,functorWithIndex:vm,group:vg,heytingAlgebra:vy,hkt:vv,identity:vX,invariant:v0,io:bx,ioEither:xM,ioOption:_K,ioRef:_Z,joinSemilattice:_G,json:_Q,lattice:_X,magma:r3,map:TU,meetSemilattice:Tz,monad:TB,monadIO:TV,monadTask:T$,monadThrow:Tq,monoid:T5,naturalTransformation:T9,nonEmptyArray:ug,number:uI,option:hm,optionT:xH,ord:rJ,ordering:wr,pipeable:wi,pointed:wo,predicate:dQ,profunctor:wa,random:wf,reader:yO,readerEither:Od,readerT:Ov,readerTask:kQ,readerTaskEither:M5,readonlyArray:lo,readonlyMap:S0,readonlyNonEmptyArray:oZ,readonlyRecord:E$,readonlySet:jl,readonlyTuple:jU,record:NS,refinement:NE,ring:NA,semigroup:il,semigroupoid:NP,semiring:NL,separated:uW,set:N3,show:N9,state:ve,stateReaderTaskEither:Pk,stateT:Ao,store:PD,string:Rh,strong:PU,struct:PV,task:O8,taskEither:Cg,taskOption:L2,taskThese:FO,these:DN,theseT:DZ,traced:FE,traversable:FA,traversableWithIndex:FP,tree:Wp,tuple:Wz,unfoldable:WB,validationT:WV,void:WK,witherable:uV,writer:Ut,writerT:Un,zero:uq},Symbol.toStringTag,{value:"Module"})),Ui=w(Ur);var Uo={},Ua={},Uu={},Us={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getEndomorphismMonoid=t.not=t.SK=t.hole=t.pipe=t.untupled=t.tupled=t.absurd=t.decrement=t.increment=t.tuple=t.flow=t.flip=t.constVoid=t.constUndefined=t.constNull=t.constFalse=t.constTrue=t.constant=t.unsafeCoerce=t.identity=t.apply=t.getRing=t.getSemiring=t.getMonoid=t.getSemigroup=t.getBooleanAlgebra=void 0;var n=function(t){return function(){return{meet:function(n,r){return function(i){return t.meet(n(i),r(i))}},join:function(n,r){return function(i){return t.join(n(i),r(i))}},zero:function(){return t.zero},one:function(){return t.one},implies:function(n,r){return function(i){return t.implies(n(i),r(i))}},not:function(n){return function(r){return t.not(n(r))}}}}};t.getBooleanAlgebra=n;var r=function(t){return function(){return{concat:function(n,r){return function(i){return t.concat(n(i),r(i))}}}}};t.getSemigroup=r;var i=function(n){var r=(0,t.getSemigroup)(n);return function(){return{concat:r().concat,empty:function(){return n.empty}}}};t.getMonoid=i;var o=function(t){return{add:function(n,r){return function(i){return t.add(n(i),r(i))}},zero:function(){return t.zero},mul:function(n,r){return function(i){return t.mul(n(i),r(i))}},one:function(){return t.one}}};t.getSemiring=o;var a=function(n){var r=(0,t.getSemiring)(n);return{add:r.add,mul:r.mul,one:r.one,zero:r.zero,sub:function(t,r){return function(i){return n.sub(t(i),r(i))}}}};t.getRing=a;var u=function(t){return function(n){return n(t)}};function s(t){return t}function c(t){return function(){return t}}function l(t,n,r,i,o,a,u,s,c){switch(arguments.length){case 1:return t;case 2:return function(){return n(t.apply(this,arguments))};case 3:return function(){return r(n(t.apply(this,arguments)))};case 4:return function(){return i(r(n(t.apply(this,arguments))))};case 5:return function(){return o(i(r(n(t.apply(this,arguments)))))};case 6:return function(){return a(o(i(r(n(t.apply(this,arguments))))))};case 7:return function(){return u(a(o(i(r(n(t.apply(this,arguments)))))))};case 8:return function(){return s(u(a(o(i(r(n(t.apply(this,arguments))))))))};case 9:return function(){return c(s(u(a(o(i(r(n(t.apply(this,arguments)))))))))}}}function f(t){return t+1}function d(t){return t-1}function p(t){throw Error("Called `absurd` function which should be uncallable")}t.apply=u,t.identity=s,t.unsafeCoerce=s,t.constant=c,t.constTrue=c(!0),t.constFalse=c(!1),t.constNull=c(null),t.constUndefined=c(void 0),t.constVoid=t.constUndefined,t.flip=function(t){return function(n,r){return t(r,n)}},t.flow=l,t.tuple=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t},t.increment=f,t.decrement=d,t.absurd=p,t.tupled=function(t){return function(n){return t.apply(void 0,n)}},t.untupled=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(n)}},t.pipe=function(t,n,r,i,o,a,u,s,c){switch(arguments.length){case 1:return t;case 2:return n(t);case 3:return r(n(t));case 4:return i(r(n(t)));case 5:return o(i(r(n(t))));case 6:return a(o(i(r(n(t)))));case 7:return u(a(o(i(r(n(t))))));case 8:return s(u(a(o(i(r(n(t)))))));case 9:return c(s(u(a(o(i(r(n(t))))))));default:for(var l=arguments[0],f=1;f<arguments.length;f++)l=arguments[f](l);return l}},t.hole=p;var h=function(t,n){return n};t.SK=h,t.not=function(t){return function(n){return!t(n)}};var m=function(){return{concat:function(t,n){return l(t,n)},empty:s}};t.getEndomorphismMonoid=m}(Us);var Uc={},Ul=T&&T.__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(Uc,"__esModule",{value:!0}),Uc.fromReadonlyNonEmptyArray=Uc.has=Uc.emptyRecord=Uc.emptyReadonlyArray=Uc.tail=Uc.head=Uc.isNonEmpty=Uc.singleton=Uc.right=Uc.left=Uc.isRight=Uc.isLeft=Uc.some=Uc.none=Uc.isSome=Uc.isNone=void 0;var Uf=function(t){return"None"===t._tag};Uc.isNone=Uf;var Ud=function(t){return"Some"===t._tag};Uc.isSome=Ud,Uc.none={_tag:"None"};var Up=function(t){return{_tag:"Some",value:t}};Uc.some=Up;var Uh=function(t){return"Left"===t._tag};Uc.isLeft=Uh;var Um=function(t){return"Right"===t._tag};Uc.isRight=Um;var Ug=function(t){return{_tag:"Left",left:t}};Uc.left=Ug;var Uy=function(t){return{_tag:"Right",right:t}};Uc.right=Uy;var Uv=function(t){return[t]};Uc.singleton=Uv;var Ub=function(t){return t.length>0};Uc.isNonEmpty=Ub;var Ux=function(t){return t[0]};Uc.head=Ux;var U_=function(t){return t.slice(1)};Uc.tail=U_,Uc.emptyReadonlyArray=[],Uc.emptyRecord={},Uc.has=Object.prototype.hasOwnProperty;var US=function(t){return Ul([t[0]],t.slice(1),!0)};Uc.fromReadonlyNonEmptyArray=US;var UT=T&&T.__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]}),Uw=T&&T.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),UO=T&&T.__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)&&UT(n,t,r);return Uw(n,t),n};Object.defineProperty(Uu,"__esModule",{value:!0}),Uu.sequenceS=Uu.sequenceT=Uu.getApplySemigroup=Uu.apS=Uu.apSecond=Uu.apFirst=Uu.ap=void 0;var Uk=UO(Uc);function UI(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):UI(t,n-1,o)}}Uu.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)}}},Uu.apFirst=function(t){return function(n){return function(r){return t.ap(t.map(r,function(t){return function(){return t}}),n)}}},Uu.apSecond=function(t){return function(n){return function(r){return t.ap(t.map(r,function(){return function(t){return t}}),n)}}},Uu.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)}}},Uu.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 UC={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 UM(t){return Uk.has.call(UC,t)||(UC[t]=UI(Us.tuple,t-1,[])),UC[t]}function UR(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 UI(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,[])}}Uu.sequenceT=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i=n.length,o=UM(i),a=t.map(n[0],o),u=1;u<i;u++)a=t.ap(a,n[u]);return a}},Uu.sequenceS=function(t){return function(n){for(var r=Object.keys(n),i=r.length,o=UR(r),a=t.map(n[r[0]],o),u=1;u<i;u++)a=t.ap(a,n[r[u]]);return a}};var UE={};function Uj(t,n){return function(r){return function(i){return t.map(i,function(t){return n.map(t,r)})}}}Object.defineProperty(UE,"__esModule",{value:!0}),UE.getFunctorComposition=UE.bindTo=UE.flap=UE.map=void 0,UE.map=Uj,UE.flap=function(t){return function(n){return function(r){return t.map(r,function(t){return t(n)})}}},UE.bindTo=function(t){return function(n){return function(r){return t.map(r,function(t){var r;return(r={})[n]=t,r})}}},UE.getFunctorComposition=function(t,n){var r=Uj(t,n);return{map:function(t,n){return(0,Us.pipe)(t,r(n))}}},Object.defineProperty(Ua,"__esModule",{value:!0}),Ua.getApplicativeComposition=Ua.getApplicativeMonoid=void 0,Ua.getApplicativeMonoid=function(t){var n=(0,Uu.getApplySemigroup)(t);return function(r){return{concat:n(r).concat,empty:t.of(r.empty)}}},Ua.getApplicativeComposition=function(t,n){var r=(0,UE.getFunctorComposition)(t,n).map,i=(0,Uu.ap)(t,n);return{map:r,of:function(r){return t.of(n.of(r))},ap:function(t,n){return(0,Us.pipe)(t,i(n))}}};var UN={};Object.defineProperty(UN,"__esModule",{value:!0}),UN.bind=UN.chainFirst=void 0,UN.chainFirst=function(t){return function(n){return function(r){return t.chain(r,function(r){return t.map(n(r),function(){return r})})}}},UN.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 UA={};Object.defineProperty(UA,"__esModule",{value:!0}),UA.tailRec=void 0;var UP=function(t,n){for(var r=n(t);"Left"===r._tag;)r=n(r.left);return r.right};UA.tailRec=UP;var UL={},UD=T&&T.__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]}),UF=T&&T.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),UW=T&&T.__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)&&UD(n,t,r);return UF(n,t),n};Object.defineProperty(UL,"__esModule",{value:!0}),UL.filterOrElse=UL.chainFirstEitherK=UL.chainEitherK=UL.fromEitherK=UL.chainOptionK=UL.fromOptionK=UL.fromPredicate=UL.fromOption=void 0;var UU=UW(Uc);function Uz(t){return function(n){return function(r){return t.fromEither(UU.isNone(r)?UU.left(n()):UU.right(r.value))}}}function UB(t){var n=Uz(t);return function(t){var r=n(t);return function(t){return(0,Us.flow)(t,r)}}}function UV(t){return function(n){return(0,Us.flow)(n,t.fromEither)}}UL.fromOption=Uz,UL.fromPredicate=function(t){return function(n,r){return function(i){return t.fromEither(n(i)?UU.right(i):UU.left(r(i)))}}},UL.fromOptionK=UB,UL.chainOptionK=function(t,n){var r=UB(t);return function(t){var i=r(t);return function(t){return function(r){return n.chain(r,i(t))}}}},UL.fromEitherK=UV,UL.chainEitherK=function(t,n){var r=UV(t);return function(t){return function(i){return n.chain(i,r(t))}}},UL.chainFirstEitherK=function(t,n){return(0,Us.flow)(UV(t),(0,UN.chainFirst)(n))},UL.filterOrElse=function(t,n){return function(r,i){return function(o){return n.chain(o,function(n){return t.fromEither(r(n)?UU.right(n):UU.left(i(n)))})}}};var U$,Uq,UK,UH,UZ,UG,UY,UJ,UQ,UX,U0={};Object.defineProperty(U$=U0,"__esModule",{value:!0}),U$.right=U$.left=U$.flap=U$.Functor=U$.Bifunctor=U$.URI=U$.bimap=U$.mapLeft=U$.map=U$.separated=void 0,Uq=function(t,n){return{left:t,right:n}},U$.separated=Uq,UK=function(t,n){return(0,Us.pipe)(t,(0,U$.map)(n))},UH=function(t,n){return(0,Us.pipe)(t,(0,U$.mapLeft)(n))},UZ=function(t,n,r){return(0,Us.pipe)(t,(0,U$.bimap)(n,r))},UG=function(t){return function(n){return(0,U$.separated)((0,U$.left)(n),t((0,U$.right)(n)))}},U$.map=UG,UY=function(t){return function(n){return(0,U$.separated)(t((0,U$.left)(n)),(0,U$.right)(n))}},U$.mapLeft=UY,UJ=function(t,n){return function(r){return(0,U$.separated)(t((0,U$.left)(r)),n((0,U$.right)(r)))}},U$.bimap=UJ,U$.URI="Separated",U$.Bifunctor={URI:U$.URI,mapLeft:UH,bimap:UZ},U$.Functor={URI:U$.URI,map:UK},U$.flap=(0,UE.flap)(U$.Functor),UQ=function(t){return t.left},U$.left=UQ,UX=function(t){return t.right},U$.right=UX;var U1={},U2=T&&T.__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]}),U3=T&&T.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),U4=T&&T.__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)&&U2(n,t,r);return U3(n,t),n};Object.defineProperty(U1,"__esModule",{value:!0}),U1.filterE=U1.witherDefault=U1.wiltDefault=void 0;var U5=U4(Uc);U1.wiltDefault=function(t,n){return function(r){var i=t.traverse(r);return function(t,o){return r.map(i(t,o),n.separate)}}},U1.witherDefault=function(t,n){return function(r){var i=t.traverse(r);return function(t,o){return r.map(i(t,o),n.compact)}}},U1.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?U5.some(r):U5.none})})}}}},zG=Uo,zY=T&&T.__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]}),zJ=T&&T.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),zQ=T&&T.__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)&&zY(n,t,r);return zJ(n,t),n},Object.defineProperty(zG,"__esModule",{value:!0}),zG.fold=zG.match=zG.foldW=zG.matchW=zG.isRight=zG.isLeft=zG.fromOption=zG.fromPredicate=zG.FromEither=zG.MonadThrow=zG.throwError=zG.ChainRec=zG.Extend=zG.extend=zG.Alt=zG.alt=zG.altW=zG.Bifunctor=zG.mapLeft=zG.bimap=zG.Traversable=zG.sequence=zG.traverse=zG.Foldable=zG.reduceRight=zG.foldMap=zG.reduce=zG.Monad=zG.Chain=zG.chain=zG.chainW=zG.Applicative=zG.Apply=zG.ap=zG.apW=zG.Pointed=zG.of=zG.Functor=zG.map=zG.getAltValidation=zG.getApplicativeValidation=zG.getWitherable=zG.getFilterable=zG.getCompactable=zG.getSemigroup=zG.getEq=zG.getShow=zG.URI=zG.right=zG.left=void 0,zG.getValidation=zG.getValidationMonoid=zG.getValidationSemigroup=zG.getApplyMonoid=zG.getApplySemigroup=zG.either=zG.stringifyJSON=zG.parseJSON=zG.sequenceArray=zG.traverseArray=zG.traverseArrayWithIndex=zG.traverseReadonlyArrayWithIndex=zG.traverseReadonlyNonEmptyArrayWithIndex=zG.ApT=zG.apSW=zG.apS=zG.bindW=zG.bind=zG.bindTo=zG.Do=zG.exists=zG.elem=zG.toError=zG.toUnion=zG.chainNullableK=zG.fromNullableK=zG.tryCatchK=zG.tryCatch=zG.fromNullable=zG.orElse=zG.orElseW=zG.swap=zG.filterOrElseW=zG.filterOrElse=zG.chainOptionK=zG.fromOptionK=zG.duplicate=zG.flatten=zG.flattenW=zG.chainFirstW=zG.chainFirst=zG.apSecondW=zG.apSecond=zG.apFirstW=zG.apFirst=zG.flap=zG.getOrElse=zG.getOrElseW=void 0,zX=zQ(Uc),zG.left=zX.left,zG.right=zX.right,z0=function(t,n){return(0,Us.pipe)(t,(0,zG.map)(n))},z1=function(t,n){return(0,Us.pipe)(t,(0,zG.ap)(n))},z2=function(t,n){return(0,Us.pipe)(t,(0,zG.chain)(n))},z3=function(t,n,r){return(0,Us.pipe)(t,(0,zG.reduce)(n,r))},z4=function(t){return function(n,r){var i=(0,zG.foldMap)(t);return(0,Us.pipe)(n,i(r))}},z5=function(t,n,r){return(0,Us.pipe)(t,(0,zG.reduceRight)(n,r))},z9=function(t){var n=(0,zG.traverse)(t);return function(t,r){return(0,Us.pipe)(t,n(r))}},z6=function(t,n,r){return(0,Us.pipe)(t,(0,zG.bimap)(n,r))},z8=function(t,n){return(0,Us.pipe)(t,(0,zG.mapLeft)(n))},z7=function(t,n){return(0,Us.pipe)(t,(0,zG.alt)(n))},Be=function(t,n){return(0,Us.pipe)(t,(0,zG.extend)(n))},Bt=function(t,n){return(0,UA.tailRec)(n(t),function(t){return(0,zG.isLeft)(t)?(0,zG.right)((0,zG.left)(t.left)):(0,zG.isLeft)(t.right)?(0,zG.left)(n(t.right.left)):(0,zG.right)((0,zG.right)(t.right.right))})},zG.URI="Either",Bn=function(t,n){return{show:function(r){return(0,zG.isLeft)(r)?"left(".concat(t.show(r.left),")"):"right(".concat(n.show(r.right),")")}}},zG.getShow=Bn,Br=function(t,n){return{equals:function(r,i){return r===i||((0,zG.isLeft)(r)?(0,zG.isLeft)(i)&&t.equals(r.left,i.left):(0,zG.isRight)(i)&&n.equals(r.right,i.right))}}},zG.getEq=Br,Bi=function(t){return{concat:function(n,r){return(0,zG.isLeft)(r)?n:(0,zG.isLeft)(n)?r:(0,zG.right)(t.concat(n.right,r.right))}}},zG.getSemigroup=Bi,Bo=function(t){var n=(0,zG.left)(t.empty);return{URI:zG.URI,_E:void 0,compact:function(t){return(0,zG.isLeft)(t)?t:"None"===t.right._tag?n:(0,zG.right)(t.right.value)},separate:function(t){return(0,zG.isLeft)(t)?(0,U0.separated)(t,t):(0,zG.isLeft)(t.right)?(0,U0.separated)((0,zG.right)(t.right.left),n):(0,U0.separated)(n,(0,zG.right)(t.right.right))}}},zG.getCompactable=Bo,Ba=function(t){var n=(0,zG.left)(t.empty),r=(0,zG.getCompactable)(t),i=r.compact,o=r.separate,a=function(t,r){return(0,zG.isLeft)(t)||r(t.right)?t:n},u=function(t,r){return(0,zG.isLeft)(t)?(0,U0.separated)(t,t):r(t.right)?(0,U0.separated)(n,(0,zG.right)(t.right)):(0,U0.separated)((0,zG.right)(t.right),n)};return{URI:zG.URI,_E:void 0,map:z0,compact:i,separate:o,filter:a,filterMap:function(t,r){if((0,zG.isLeft)(t))return t;var i=r(t.right);return"None"===i._tag?n:(0,zG.right)(i.value)},partition:u,partitionMap:function(t,r){if((0,zG.isLeft)(t))return(0,U0.separated)(t,t);var i=r(t.right);return(0,zG.isLeft)(i)?(0,U0.separated)((0,zG.right)(i.left),n):(0,U0.separated)(n,(0,zG.right)(i.right))}}},zG.getFilterable=Ba,Bu=function(t){var n=(0,zG.getFilterable)(t),r=(0,zG.getCompactable)(t);return{URI:zG.URI,_E:void 0,map:z0,compact:n.compact,separate:n.separate,filter:n.filter,filterMap:n.filterMap,partition:n.partition,partitionMap:n.partitionMap,traverse:z9,sequence:zG.sequence,reduce:z3,foldMap:z4,reduceRight:z5,wither:(0,U1.witherDefault)(zG.Traversable,r),wilt:(0,U1.wiltDefault)(zG.Traversable,r)}},zG.getWitherable=Bu,Bs=function(t){return{URI:zG.URI,_E:void 0,map:z0,ap:function(n,r){return(0,zG.isLeft)(n)?(0,zG.isLeft)(r)?(0,zG.left)(t.concat(n.left,r.left)):n:(0,zG.isLeft)(r)?r:(0,zG.right)(n.right(r.right))},of:zG.of}},zG.getApplicativeValidation=Bs,Bc=function(t){return{URI:zG.URI,_E:void 0,map:z0,alt:function(n,r){if((0,zG.isRight)(n))return n;var i=r();return(0,zG.isLeft)(i)?(0,zG.left)(t.concat(n.left,i.left)):i}}},zG.getAltValidation=Bc,Bl=function(t){return function(n){return(0,zG.isLeft)(n)?n:(0,zG.right)(t(n.right))}},zG.map=Bl,zG.Functor={URI:zG.URI,map:z0},zG.of=zG.right,zG.Pointed={URI:zG.URI,of:zG.of},Bf=function(t){return function(n){return(0,zG.isLeft)(n)?n:(0,zG.isLeft)(t)?t:(0,zG.right)(n.right(t.right))}},zG.apW=Bf,zG.ap=zG.apW,zG.Apply={URI:zG.URI,map:z0,ap:z1},zG.Applicative={URI:zG.URI,map:z0,ap:z1,of:zG.of},Bd=function(t){return function(n){return(0,zG.isLeft)(n)?n:t(n.right)}},zG.chainW=Bd,zG.chain=zG.chainW,zG.Chain={URI:zG.URI,map:z0,ap:z1,chain:z2},zG.Monad={URI:zG.URI,map:z0,ap:z1,of:zG.of,chain:z2},Bp=function(t,n){return function(r){return(0,zG.isLeft)(r)?t:n(t,r.right)}},zG.reduce=Bp,Bh=function(t){return function(n){return function(r){return(0,zG.isLeft)(r)?t.empty:n(r.right)}}},zG.foldMap=Bh,Bm=function(t,n){return function(r){return(0,zG.isLeft)(r)?t:n(r.right,t)}},zG.reduceRight=Bm,zG.Foldable={URI:zG.URI,reduce:z3,foldMap:z4,reduceRight:z5},Bg=function(t){return function(n){return function(r){return(0,zG.isLeft)(r)?t.of((0,zG.left)(r.left)):t.map(n(r.right),zG.right)}}},zG.traverse=Bg,By=function(t){return function(n){return(0,zG.isLeft)(n)?t.of((0,zG.left)(n.left)):t.map(n.right,zG.right)}},zG.sequence=By,zG.Traversable={URI:zG.URI,map:z0,reduce:z3,foldMap:z4,reduceRight:z5,traverse:z9,sequence:zG.sequence},Bv=function(t,n){return function(r){return(0,zG.isLeft)(r)?(0,zG.left)(t(r.left)):(0,zG.right)(n(r.right))}},zG.bimap=Bv,Bb=function(t){return function(n){return(0,zG.isLeft)(n)?(0,zG.left)(t(n.left)):n}},zG.mapLeft=Bb,zG.Bifunctor={URI:zG.URI,bimap:z6,mapLeft:z8},Bx=function(t){return function(n){return(0,zG.isLeft)(n)?t():n}},zG.altW=Bx,zG.alt=zG.altW,zG.Alt={URI:zG.URI,map:z0,alt:z7},B_=function(t){return function(n){return(0,zG.isLeft)(n)?n:(0,zG.right)(t(n))}},zG.extend=B_,zG.Extend={URI:zG.URI,map:z0,extend:Be},zG.ChainRec={URI:zG.URI,map:z0,ap:z1,chain:z2,chainRec:Bt},zG.throwError=zG.left,zG.MonadThrow={URI:zG.URI,map:z0,ap:z1,of:zG.of,chain:z2,throwError:zG.throwError},zG.FromEither={URI:zG.URI,fromEither:Us.identity},zG.fromPredicate=(0,UL.fromPredicate)(zG.FromEither),zG.fromOption=(0,UL.fromOption)(zG.FromEither),zG.isLeft=zX.isLeft,zG.isRight=zX.isRight,BS=function(t,n){return function(r){return(0,zG.isLeft)(r)?t(r.left):n(r.right)}},zG.matchW=BS,zG.foldW=zG.matchW,zG.match=zG.matchW,zG.fold=zG.match,BT=function(t){return function(n){return(0,zG.isLeft)(n)?t(n.left):n.right}},zG.getOrElseW=BT,zG.getOrElse=zG.getOrElseW,zG.flap=(0,UE.flap)(zG.Functor),zG.apFirst=(0,Uu.apFirst)(zG.Apply),zG.apFirstW=zG.apFirst,zG.apSecond=(0,Uu.apSecond)(zG.Apply),zG.apSecondW=zG.apSecond,zG.chainFirst=(0,UN.chainFirst)(zG.Chain),zG.chainFirstW=zG.chainFirst,zG.flattenW=(0,zG.chainW)(Us.identity),zG.flatten=zG.flattenW,zG.duplicate=(0,zG.extend)(Us.identity),zG.fromOptionK=(0,UL.fromOptionK)(zG.FromEither),zG.chainOptionK=(0,UL.chainOptionK)(zG.FromEither,zG.Chain),zG.filterOrElse=(0,UL.filterOrElse)(zG.FromEither,zG.Chain),zG.filterOrElseW=zG.filterOrElse,Bw=function(t){return(0,zG.isLeft)(t)?(0,zG.right)(t.left):(0,zG.left)(t.right)},zG.swap=Bw,BO=function(t){return function(n){return(0,zG.isLeft)(n)?t(n.left):n}},zG.orElseW=BO,zG.orElse=zG.orElseW,Bk=function(t){return function(n){return null==n?(0,zG.left)(t):(0,zG.right)(n)}},zG.fromNullable=Bk,BI=function(t,n){try{return(0,zG.right)(t())}catch(r){return(0,zG.left)(n(r))}},zG.tryCatch=BI,BC=function(t,n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return(0,zG.tryCatch)(function(){return t.apply(void 0,r)},n)}},zG.tryCatchK=BC,BM=function(t){var n=(0,zG.fromNullable)(t);return function(t){return(0,Us.flow)(t,n)}},zG.fromNullableK=BM,BR=function(t){var n=(0,zG.fromNullableK)(t);return function(t){return(0,zG.chain)(n(t))}},zG.chainNullableK=BR,zG.toUnion=(0,zG.foldW)(Us.identity,Us.identity),zG.toError=function(t){return t instanceof Error?t:Error(String(t))},zG.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,zG.isLeft)(i)&&n.equals(r,i.right)}},BE=function(t){return function(n){return!(0,zG.isLeft)(n)&&t(n.right)}},zG.exists=BE,zG.Do=(0,zG.of)(zX.emptyRecord),zG.bindTo=(0,UE.bindTo)(zG.Functor),zG.bind=(0,UN.bind)(zG.Chain),zG.bindW=zG.bind,zG.apS=(0,Uu.apS)(zG.Apply),zG.apSW=zG.apS,zG.ApT=(0,zG.of)(zX.emptyReadonlyArray),Bj=function(t){return function(n){var r=t(0,zX.head(n));if((0,zG.isLeft)(r))return r;for(var i=[r.right],o=1;o<n.length;o++){var a=t(o,n[o]);if((0,zG.isLeft)(a))return a;i.push(a.right)}return(0,zG.right)(i)}},zG.traverseReadonlyNonEmptyArrayWithIndex=Bj,BN=function(t){var n=(0,zG.traverseReadonlyNonEmptyArrayWithIndex)(t);return function(t){return zX.isNonEmpty(t)?n(t):zG.ApT}},zG.traverseReadonlyArrayWithIndex=BN,zG.traverseArrayWithIndex=zG.traverseReadonlyArrayWithIndex,BA=function(t){return(0,zG.traverseReadonlyArrayWithIndex)(function(n,r){return t(r)})},zG.traverseArray=BA,zG.sequenceArray=(0,zG.traverseArray)(Us.identity),zG.parseJSON=function(t,n){return(0,zG.tryCatch)(function(){return JSON.parse(t)},n)},BP=function(t,n){return(0,zG.tryCatch)(function(){var n=JSON.stringify(t);if("string"!=typeof n)throw Error("Converting unsupported structure to JSON");return n},n)},zG.stringifyJSON=BP,zG.either={URI:zG.URI,map:z0,of:zG.of,ap:z1,chain:z2,reduce:z3,foldMap:z4,reduceRight:z5,traverse:z9,sequence:zG.sequence,bimap:z6,mapLeft:z8,alt:z7,extend:Be,chainRec:Bt,throwError:zG.throwError},zG.getApplySemigroup=(0,Uu.getApplySemigroup)(zG.Apply),zG.getApplyMonoid=(0,Ua.getApplicativeMonoid)(zG.Applicative),BL=function(t,n){return(0,Uu.getApplySemigroup)((0,zG.getApplicativeValidation)(t))(n)},zG.getValidationSemigroup=BL,BD=function(t,n){return(0,Ua.getApplicativeMonoid)((0,zG.getApplicativeValidation)(t))(n)},zG.getValidationMonoid=BD,zG.getValidation=function(t){var n=(0,zG.getApplicativeValidation)(t).ap,r=(0,zG.getAltValidation)(t).alt;return{URI:zG.URI,_E:void 0,map:z0,of:zG.of,chain:z2,bimap:z6,mapLeft:z8,reduce:z3,foldMap:z4,reduceRight:z5,extend:Be,traverse:z9,sequence:zG.sequence,chainRec:Bt,throwError:zG.throwError,ap:n,alt:r}};var U9=globalThis&&globalThis.__extends||(BF=function(t,n){return(BF=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}BF(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}),U6=globalThis&&globalThis.__assign||function(){return(U6=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)},U8=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))},U7=function(t,n,r){return n$([{value:t,context:n,message:r}])},ze=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 mw(o)?o:n.validate(o.right,r)},this.encode===zt&&n.encode===zt?zt: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}(),zt=function(t){return t};function zn(t){return t.displayName||t.name||"<function".concat(t.length,">")}function zr(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 zi(t,n){for(var r=n.length,i=0;i<r;i++)t.push(n[i])}var zo=Object.prototype.hasOwnProperty;function za(t){return Object.keys(t).map(function(n){return"".concat(n,": ").concat(t[n].name)}).join(", ")}function zu(t){for(var n=0;n<t.length;n++)if(t[n].encode!==zt)return!1;return!0}function zs(t){return"{ ".concat(za(t)," }")}function zc(t){return"Partial<".concat(t,">")}function zl(t){if(zv(t)){var n,r,i=t.value;if(zN.is(i))return(n={})[i]=null,n}else{if(r=t,"KeyofType"===r._tag)return t.keys;if(zx(t)){var o=t.types.map(function(t){return zl(t)});return o.some(zI.is)?void 0:Object.assign.apply(Object,U8([{}],o,!1))}}}function zf(t){return"("+t.map(function(t){return t.name}).join(" | ")+")"}function zd(t,n){for(var r=!0,i=!0,o=!zV.is(t),a=0;a<n.length;a++){var u=n[a];u!==t&&(r=!1),zV.is(u)&&(i=!1)}if(r)return t;if(i)return n[n.length-1];for(var s={},c=0;c<n.length;c++){var u=n[c];for(var l in u)(!zo.call(s,l)||o||u[l]!==t[l])&&(s[l]=u[l])}return s}function zp(t,n){for(var r=Object.getOwnPropertyNames(t),i=!1,o={},a=0;a<r.length;a++){var u=r[a];zo.call(n,u)?o[u]=t[u]:i=!0}return i?o:t}function zh(t){return t.length>0}var zm={};function zg(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 zy(t){return"AnyType"===t._tag}function zv(t){return"LiteralType"===t._tag}function zb(t){return"InterfaceType"===t._tag}function zx(t){return"UnionType"===t._tag}var z_=[];function zS(t){if(-1!==z_.indexOf(t))return zm;if(zb(t)||"StrictType"===(n=t)._tag){var n,r,i,o,a,u=zm;for(var s in t.props){var c=t.props[s];zv(c)&&(u===zm&&(u={}),u[s]=[c.value])}return u}if("ExactType"===t._tag||"RefinementType"===t._tag)return zS(t.type);if("IntersectionType"===t._tag)return t.types.reduce(function(t,n){return function(t,n){if(t===zm)return n;if(n===zm)return t;var r=Object.assign({},t);for(var i in n)if(zo.call(t,i)){var o=zg(t[i],n[i]);if(zh(o))r[i]=o;else{r=zm;break}}else r[i]=n[i];return r}(t,zS(n))},zm);if(zx(t))return t.types.slice(1).reduce(function(t,n){return function(t,n){if(t===zm||n===zm)return zm;var r=zm;for(var i in t)zo.call(n,i)&&0===zg(t[i],n[i]).length&&(r===zm&&(r={}),r[i]=t[i].concat(n[i]));return r}(t,zS(n))},zS(t.types[0]));if("RecursiveType"===t._tag){z_.push(t);var l=zS(t.type);return z_.pop(),l}return zm}function zT(t){var n=zS(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=zS(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 zw=function(t){function n(){var n=t.call(this,"null",function(t){return null===t},function(t,r){return n.is(t)?nq(t):U7(t,r)},zt)||this;return n._tag="NullType",n}return U9(n,t),n}(ze),zO=new zw,zk=function(t){function n(){var n=t.call(this,"undefined",function(t){return void 0===t},function(t,r){return n.is(t)?nq(t):U7(t,r)},zt)||this;return n._tag="UndefinedType",n}return U9(n,t),n}(ze),zI=new zk,zC=function(t){function n(){var n=t.call(this,"void",zI.is,zI.validate,zt)||this;return n._tag="VoidType",n}return U9(n,t),n}(ze),zM=new zC,zR=function(t){function n(){var n=t.call(this,"unknown",function(t){return!0},nq,zt)||this;return n._tag="UnknownType",n}return U9(n,t),n}(ze),zE=new zR,zj=function(t){function n(){var n=t.call(this,"string",function(t){return"string"==typeof t},function(t,r){return n.is(t)?nq(t):U7(t,r)},zt)||this;return n._tag="StringType",n}return U9(n,t),n}(ze),zN=new zj,zA=function(t){function n(){var n=t.call(this,"number",function(t){return"number"==typeof t},function(t,r){return n.is(t)?nq(t):U7(t,r)},zt)||this;return n._tag="NumberType",n}return U9(n,t),n}(ze),zP=new zA,zL=function(t){function n(){var n=t.call(this,"bigint",function(t){return"bigint"==typeof t},function(t,r){return n.is(t)?nq(t):U7(t,r)},zt)||this;return n._tag="BigIntType",n}return U9(n,t),n}(ze),zD=new zL,zF=function(t){function n(){var n=t.call(this,"boolean",function(t){return"boolean"==typeof t},function(t,r){return n.is(t)?nq(t):U7(t,r)},zt)||this;return n._tag="BooleanType",n}return U9(n,t),n}(ze),zW=new zF,zU=function(t){function n(){var n=t.call(this,"UnknownArray",Array.isArray,function(t,r){return n.is(t)?nq(t):U7(t,r)},zt)||this;return n._tag="AnyArrayType",n}return U9(n,t),n}(ze),zz=new zU,zB=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)?nq(t):U7(t,r)},zt)||this;return n._tag="AnyDictionaryType",n}return U9(n,t),n}(ze),zV=new zB,z$=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 U9(n,t),n}(ze);function zq(t,n){void 0===n&&(n=JSON.stringify(t));var r=function(n){return n===t};return new z$(n,r,function(n,i){return r(n)?nq(t):U7(n,i)},zt,t)}var zK=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 U9(n,t),n}(ze),zH=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 U9(n,t),n}(ze);function zZ(t,n,r){return Vc(t,n,r)}var zG,zY,zJ,zQ,zX,z0,z1,z2,z3,z4,z5,z9,z6,z8,z7,Be,Bt,Bn,Br,Bi,Bo,Ba,Bu,Bs,Bc,Bl,Bf,Bd,Bp,Bh,Bm,Bg,By,Bv,Bb,Bx,B_,BS,BT,Bw,BO,Bk,BI,BC,BM,BR,BE,Bj,BN,BA,BP,BL,BD,BF,BW,BU,Bz=Vc(zP,BU=function(t){return Number.isInteger(t)},"Int"),BB=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 U9(n,t),n}(ze);function BV(t,n){var r,i=function(){return r||((r=n(o)).name=t),r},o=new BB(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(BB.prototype,"type",{get:function(){return this.runDefinition()},enumerable:!0,configurable:!0});var B$=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 U9(n,t),n}(ze);function Bq(t,n){return void 0===n&&(n="Array<".concat(t.name,">")),new B$(n,function(n){return zz.is(n)&&n.every(t.is)},function(n,r){var i=zz.validate(n,r);if(mw(i))return i;for(var o=i.right,a=o.length,u=o,s=[],c=0;c<a;c++){var l=o[c],f=t.validate(l,zr(r,String(c),t,l));if(mw(f))zi(s,f.left);else{var d=f.right;d!==l&&(u===o&&(u=o.slice()),u[c]=d)}}return s.length>0?n$(s):nq(u)},t.encode===zt?zt:function(n){return n.map(t.encode)},t)}var BK=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 U9(n,t),n}(ze);function BH(t,n){void 0===n&&(n=zs(t));var r=Object.keys(t),i=r.map(function(n){return t[n]}),o=r.length;return new BK(n,function(t){if(zV.is(t)){for(var n=0;n<o;n++){var a=r[n],u=t[a];if(void 0===u&&!zo.call(t,a)||!i[n].is(u))return!1}return!0}return!1},function(t,n){var a=zV.validate(t,n);if(mw(a))return a;for(var u=a.right,s=u,c=[],l=0;l<o;l++){var f=r[l],d=s[f],p=i[l],h=p.validate(d,zr(n,f,p,d));if(mw(h))zi(c,h.left);else{var m=h.right;m===d&&(void 0!==m||zo.call(s,f))||(s===u&&(s=U6({},u)),s[f]=m)}}return c.length>0?n$(c):nq(s)},zu(i)?zt:function(t){for(var n=U6({},t),a=0;a<o;a++){var u=r[a],s=i[a].encode;s!==zt&&(n[u]=s(t[u]))}return n},t)}var BZ=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 U9(n,t),n}(ze),BG=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 U9(n,t),n}(ze);function BY(t,n,r){var i,o,a,u,s,c,l,f,d=zl(t);return d?(i=Object.keys(d),void 0===(u=r)&&(u="{ [K in ".concat(t.name,"]: ").concat(n.name," }")),s=i.length,new BG(u,function(t){return zV.is(t)&&i.every(function(r){return n.is(t[r])})},function(t,r){var o=zV.validate(t,r);if(mw(o))return o;for(var a=o.right,u={},c=[],l=!1,f=0;f<s;f++){var d=i[f],p=a[d],h=n.validate(p,zr(r,d,n,p));if(mw(h))zi(c,h.left);else{var m=h.right;l=l||m!==p,u[d]=m}}return c.length>0?n$(c):nq(l||Object.keys(a).length!==s?u:a)},n.encode===zt?zt:function(t){for(var r={},o=0;o<s;o++){var a=i[o];r[a]=n.encode(t[a])}return r},t,n)):(c=t,void 0===(f=r)&&(f="{ [K in ".concat(c.name,"]: ").concat(n.name," }")),new BG(f,function(t){return zV.is(t)?Object.keys(t).every(function(r){return c.is(r)&&n.is(t[r])}):zy(n)&&Array.isArray(t)},function(t,r){if(zV.is(t)){for(var i={},o=[],a=Object.keys(t),u=a.length,s=!1,l=0;l<u;l++){var f=a[l],d=t[f],p=c.validate(f,zr(r,f,c,f));if(mw(p))zi(o,p.left);else{var h=p.right;s=s||h!==f,f=h;var m=n.validate(d,zr(r,f,n,d));if(mw(m))zi(o,m.left);else{var g=m.right;s=s||g!==d,i[f]=g}}}return o.length>0?n$(o):nq(s?i:t)}return zy(n)&&Array.isArray(t)?nq(t):U7(t,r)},c.encode===zt&&n.encode===zt?zt:function(t){for(var r={},i=Object.keys(t),o=i.length,a=0;a<o;a++){var u=i[a];r[String(c.encode(u))]=n.encode(t[u])}return r},c,n))}var BJ=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 U9(n,t),n}(ze);function BQ(t,n){void 0===n&&(n=zf(t));var r=zT(t);if(void 0===r||!(t.length>0))return new BJ(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,zr(r,String(o),a,n));if(!mw(u))return nq(u.right);zi(i,u.left)}return n$(i)},zu(t)?zt: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 B7(n,function(n){if(zV.is(n)){var r=u(n[i]);return void 0!==r&&t[r].is(n)}return!1},function(n,r){var o=zV.validate(n,r);if(mw(o))return o;var a=o.right,s=u(a[i]);if(void 0===s)return U7(n,r);var c=t[s];return c.validate(a,zr(r,String(s),c,a))},zu(t)?zt: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 BX=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 U9(n,t),n}(ze),B0=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 U9(n,t),n}(ze),B1=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 U9(n,t),n}(ze),B2=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 U9(n,t),n}(ze);function B3(t,n){void 0===n&&(n="ReadonlyArray<".concat(t.name,">"));var r=Bq(t);return new B2(n,r.is,r.validate,r.encode,t)}var B4=function(t,n){return B9(BH(t),n)},B5=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 U9(n,t),n}(ze);function B9(t,n){void 0===n&&(n=zb(i=t)?"{| ".concat(za(i.props)," |}"):(r=i,"PartialType"===r._tag)?zc("{| ".concat(za(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 B5(n,t.is,function(n,r){var i=zV.validate(n,r);if(mw(i))return i;var a=t.validate(n,r);return mw(a)?a:nq(zp(a.right,o))},function(n){return t.encode(zp(n,o))},t)}var B6=function(t){function n(){var n=t.call(this,"Function",function(t){return"function"==typeof t},function(t,r){return n.is(t)?nq(t):U7(t,r)},zt)||this;return n._tag="FunctionType",n}return U9(n,t),n}(ze),B8=new B6,B7=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 U9(n,t),n}(BJ),Ve=function(t,n,r){void 0===r&&(r=zf(n));var i=BQ(n,r);return i instanceof B7?i:(console.warn("[io-ts] Cannot build a tagged union for ".concat(r,", returning a de-optimized union")),new B7(r,i.is,i.validate,i.encode,n,t))},Vt=function(t,n){return{value:t,context:n}},Vn=function(t){return[{key:"",type:t}]},Vr=function(t){function n(){var n=t.call(this,"never",function(t){return!1},function(t,n){return U7(t,n)},function(){throw Error("cannot encode never")})||this;return n._tag="NeverType",n}return U9(n,t),n}(ze),Vi=new Vr,Vo=function(t){function n(){var n=t.call(this,"any",function(t){return!0},nq,zt)||this;return n._tag="AnyType",n}return U9(n,t),n}(ze),Va=new Vo,Vu=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)?nq(t):U7(t,r)},zt)||this;return n._tag="ObjectType",n}return U9(n,t),n}(ze),Vs=new Vu;function Vc(t,n,r){return void 0===r&&(r="(".concat(t.name," | ").concat(zn(n),")")),new zH(r,function(r){return t.is(r)&&n(r)},function(r,i){var o=t.validate(r,i);if(mw(o))return o;var a=o.right;return n(a)?nq(a):U7(a,i)},t.encode,t,n)}var Vl=Vc(zP,Number.isInteger,"Integer"),Vf=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 U9(n,t),n}(ze);function Vd(t){return t}let Vp=Object.freeze(Object.defineProperty({__proto__:null,AnyArrayType:zU,AnyDictionaryType:zB,AnyType:Vo,Array:zz,ArrayType:B$,BigIntType:zL,BooleanType:zF,Dictionary:zV,DictionaryType:BG,ExactType:B5,Function:B8,FunctionType:B6,Int:Bz,Integer:Vl,InterfaceType:BK,IntersectionType:BX,KeyofType:zK,LiteralType:z$,NeverType:Vr,NullType:zw,NumberType:zA,ObjectType:Vu,PartialType:BZ,ReadonlyArrayType:B2,ReadonlyType:B1,RecursiveType:BB,RefinementType:zH,StrictType:Vf,StringType:zj,TaggedUnionType:B7,TupleType:B0,Type:ze,UndefinedType:zk,UnionType:BJ,UnknownArray:zz,UnknownRecord:zV,UnknownType:zR,VoidType:zC,alias:function(t){return function(){return t}},any:Va,appendContext:zr,array:Bq,bigint:zD,boolean:zW,brand:zZ,clean:Vd,dictionary:BY,emptyTags:zm,exact:B9,failure:U7,failures:n$,getContextEntry:function(t,n){return{key:t,type:n}},getDefaultContext:Vn,getDomainKeys:zl,getFunctionName:zn,getIndex:zT,getTags:zS,getValidationError:Vt,identity:zt,interface:BH,intersection:function(t,n){void 0===n&&(n="(".concat(t.map(function(t){return t.name}).join(" & "),")"));var r=t.length;return new BX(n,function(n){return t.every(function(t){return t.is(n)})},0===t.length?nq:function(n,i){for(var o=[],a=[],u=0;u<r;u++){var s=t[u],c=s.validate(n,zr(i,String(u),s,n));mw(c)?zi(a,c.left):o.push(c.right)}return a.length>0?n$(a):nq(zd(n,o))},0===t.length?zt:function(n){return zd(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 zN.is(n)&&zo.call(t,n)};return new zK(n,r,function(t,n){return r(t)?nq(t):U7(t,n)},zt,t)},literal:zq,mergeAll:zd,never:Vi,null:zO,nullType:zO,number:zP,object:Vs,partial:function(t,n){void 0===n&&(n=zc(zs(t)));var r=Object.keys(t),i=r.map(function(n){return t[n]}),o=r.length;return new BZ(n,function(n){if(zV.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=zV.validate(n,i);if(mw(a))return a;for(var u=a.right,s=u,c=[],l=0;l<o;l++){var f=r[l],d=s[f],p=t[f],h=p.validate(d,zr(i,f,p,d));if(mw(h))void 0!==d&&zi(c,h.left);else{var m=h.right;m!==d&&(s===u&&(s=U6({},u)),s[f]=m)}}return c.length>0?n$(c):nq(s)},zu(i)?zt:function(t){for(var n=U6({},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 B1(n,t.is,t.validate,t.encode,t)},readonlyArray:B3,record:BY,recursion:BV,refinement:Vc,strict:B4,string:zN,success:nq,taggedUnion:Ve,tuple:function(t,n){void 0===n&&(n="[".concat(t.map(function(t){return t.name}).join(", "),"]"));var r=t.length;return new B0(n,function(n){return zz.is(n)&&n.length===r&&t.every(function(t,r){return t.is(n[r])})},function(n,i){var o=zz.validate(n,i);if(mw(o))return o;for(var a=o.right,u=a.length>r?a.slice(0,r):a,s=[],c=0;c<r;c++){var l=a[c],f=t[c],d=f.validate(l,zr(i,String(c),f,l));if(mw(d))zi(s,d.left);else{var p=d.right;p!==l&&(u===a&&(u=a.slice()),u[c]=p)}}return s.length>0?n$(s):nq(u)},zu(t)?zt:function(n){return t.map(function(t,r){return t.encode(n[r])})},t)},type:BH,undefined:zI,union:BQ,unknown:zE,void:zM,voidType:zM},Symbol.toStringTag,{value:"Module"})),Vh=w(Vp);var Vm={};Object.defineProperty(Vm,"__esModule",{value:!0}),Vm.ContentPath=void 0,Vm.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 Vg={},Vy={};Object.defineProperty(Vy,"__esModule",{value:!0}),Vy.getAssetOrThrow=void 0;let Vv=t=>n=>{let r=t[n];if(!r)throw Error(`Missing asset with id '${n}'!`);return r};Vy.getAssetOrThrow=Vv;var Vb={};Object.defineProperty(Vb,"__esModule",{value:!0}),Vb.getEmbedOrThrow=void 0;let Vx=t=>n=>{let r=t[n];if(!r)throw Error(`Missing embed with url '${n}'`);return r};Vb.getEmbedOrThrow=Vx;var V_={},VS={};let VT=w(nL);function Vw(t,n,r){return void 0===r&&(r=t.name),new ze(r,t.is,t.validate,function(r){return n(t.encode(r))})}let VO=Object.freeze(Object.defineProperty({__proto__:null,mapOutput:Vw},Symbol.toStringTag,{value:"Module"}));var Vk,VI,VC,VM=Vc(zN,VI=function(t){return t.length>0},"NonEmptyString");function VR(t,n){void 0===n&&(n="NonEmptyArray<"+t.name+">");var r=Bq(t);return new ze(n,function(t){return r.is(t)&&oY(t)},function(t,n){return nN(r.validate(t,n),ms(function(r){var i=o6(r);return pK(i)?U7(t,n):nq(i.value)}))},function(t){return r.encode(t)})}function VE(t,n,r){void 0===r&&(r="Set<"+t.name+">");var i=Bq(t),o=N2(n),a=NG(n);return new ze(r,function(n){return n instanceof Set&&je(t.is)(n)},function(t,n){return nN(i.validate(t,n),ms(function(r){var i=a(r);return i.size!==r.length?U7(t,n):nq(i)}))},function(t){return i.encode(o(t))})}function Vj(t,n){return new ze(t,n,function(t,r){return n(t)?nq(t):U7(t,r)},zt)}var VN=Vj("Date",function(t){return t instanceof Date}),VA=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))},VP=function(t,n){return{get:t,reverseGet:n}},VL=function(t){return VU(t.get,nC(t.reverseGet,nT))},VD=function(t){return VJ(nC(t.get,nz),t.reverseGet)},VF=function(t){return V2(nC(t.get,nz),nC(t.reverseGet,nT))},VW=function(t){return V8(function(n){return function(r){return function(i){return n.map(r(t.get(i)),function(n){return t.reverseGet(n)})}}})},VU=function(t,n){return{get:t,set:n}},Vz=function(t){return V2(nC(t.get,nz),t.set)},VB=function(t){return V8(function(n){return function(r){return function(i){return n.map(r(t.get(i)),function(n){return t.set(n)(i)})}}})},VV=function(t){return function(n){return VU(function(r){return t.get(n.get(r))},function(r){return function(i){return n.set(t.set(r)(n.get(i)))(i)}})}},V$=function(t){return function(n){return VJ(nC(n.getOption,pg(t.getOption)),nC(t.reverseGet,n.reverseGet))}},Vq=function(t){return function(n){return V9(VQ(t))(Vz(n))}},VK=function(){return VU(nS,nT)},VH=function(t){return function(n){return VU(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)}})}},VZ=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return function(n){return VU(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}})}},VG=function(t){return function(n){return VU(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)}})}},VY=function(t){return function(n){var r;return nN(n,VV(({at:r=function(t){return VU(function(n){return RM(t,n)},pH(function(){return RO(t)},function(n){return RT(t,n)}))}}).at(t)))}},VJ=function(t,n){return{getOption:t,reverseGet:n}},VQ=function(t){return V2(t.getOption,function(n){return V0(n)(t)})},VX=function(t){return V8(function(n){return function(r){return function(i){return nN(t.getOption(i),pH(function(){return n.of(i)},function(o){return n.map(r(o),function(n){return V0(n)(t)(i)})}))}}})},V0=function(t){var n;return n=function(){return t},function(t){var r,i,o=(r=t,function(t){return nN(r.getOption(t),pl(function(i){var o=n(i);return o===i?t:r.reverseGet(o)}))});return function(t){return nN(o(t),pZ(function(){return t}))}}},V1=function(t){return VJ(dX(t),nS)},V2=function(t,n){return{getOption:t,set:n}},V3=function(t){return V8(function(n){return function(r){return function(i){return nN(t.getOption(i),pH(function(){return n.of(i)},function(o){return n.map(r(o),function(n){return t.set(n)(i)})}))}}})},V4=function(t){return function(n){return function(r){return nN(n.getOption(r),pl(function(i){var o=t(i);return o===i?r:n.set(o)(r)}))}}},V5=function(t){return function(n){var r=V4(t)(n);return function(t){return nN(r(t),pZ(function(){return t}))}}},V9=function(t){return function(n){return V2(nC(n.getOption,pg(t.getOption)),function(r){return V5(t.set(r))(n)})}},V6=function(t,n,r){if(r[t]===n)return r;var i=VA([r[0]],r.slice(1),!0);return i[t]=n,i},V8=function(t){return{modifyF:t}};function V7(t){return function(n){return V8(function(r){return function(i){return n.modifyF(r)(t.modifyF(r)(i))}})}}var $e={URI:"Identity",map:function(t,n){return n(t)},of:nS,ap:function(t,n){return t(n)}},$t=function(t){return{index:t}},$n=nC(VL,VV),$r=function(t){return nC(Vz,V9(t))},$i=function(t){return nC(VB,V7(t))},$o=function(t){return function(n){return function(r){var i=n.get(r),o=t(i);return i===o?r:n.set(o)(r)}}},$a=function(t){return Vq(VJ(p3,nS))(t)},$u=function(t){var n;return nC(Vz,function(n){return nN(n,V9($t(function(t){return V2(function(n){return u5(t,n)},function(n){return function(r){return nN(u5(t,r),pH(function(){return r},function(){return c3(t,n,r)}))}})}).index(t)))})},$s=function(t){var n;return nC(Vz,function(n){return nN(n,V9($t(function(t){return V2(function(n){return u5(t,n)},function(n){return function(r){return nN(u5(t,r),pH(function(){return r},function(){return V6(t,n,r)}))}})}).index(t)))})},$c=function(t){var n;return nC(Vz,function(n){return nN(n,V9($t(function(t){return V2(function(n){return RM(t,n)},function(n){return function(r){return r[t]===n||pK(RM(t,r))?r:RT(t,n)(r)}})}).index(t)))})},$l=Vq(VJ(nS,nz)),$f=Vq(VJ(d1,nq)),$d=Vq(VJ(function(t){return mw(t)?nz(t.left):nU},n$)),$p=function(t,n){return function(r){return $h(r,t,n)}},$h=function(t,n,r){return VU(nC(t.get,n),nC(r,t.set))},$m="monocle-ts/Lens",$g={URI:$m,compose:function(t,n){return VV(t)(n)}},$y={URI:$m,compose:$g.compose,id:VK};let $v=Object.freeze(Object.defineProperty({__proto__:null,Category:$y,Invariant:{URI:$m,imap:$h},Semigroupoid:$g,URI:$m,asOptional:Vz,asTraversal:VB,atKey:VY,component:VG,compose:VV,composeIso:$n,composeLens:VV,composeOptional:$r,composePrism:Vq,composeTraversal:$i,filter:function(t){return Vq(V1(t))},findFirst:function(t){var n;return $r(V2(sa(t),function(n){return function(r){return nN(so(t)(r),pH(function(){return r},function(t){return c3(t,n,r)}))}}))},findFirstNonEmpty:function(t){var n;return $r(V2(sa(t),function(n){return function(r){return nN(so(t)(r),pH(function(){return r},function(t){return V6(t,n,r)}))}}))},fromNullable:$a,id:VK,imap:$p,index:$u,indexNonEmpty:$s,key:$c,left:$d,lens:VU,modify:$o,modifyF:function(t){return function(n){return function(r){return function(i){return nN(r.get(i),n,function(n){return t.map(n,function(t){return r.set(t)(i)})})}}}},prop:VH,props:VZ,right:$f,some:$l,traverse:function(t){var n,r;return nC(VB,V7(V8(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 $b=function(t){return function(n){return n.modifyF($e)(t)}},$x=function(t){return new $k(t.get,t.reverseGet)},$_=function(t){return new $I(t.get,t.set)},$S=function(t){return new $C(t.getOption,t.reverseGet)},$T=function(t){return new $R(t.getOption,t.set)},$w=function(t){return new $E(t.modifyF)},$O=function(t,n,r){var i;return r===t[n]?t:Object.assign({},t,((i={})[n]=r,i))},$k=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 $x(VP(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 $_(VL(this))},t.prototype.asPrism=function(){return $S(VD(this))},t.prototype.asOptional=function(){return $T(VF(this))},t.prototype.asTraversal=function(){return $w(VW(this))},t.prototype.asFold=function(){var t=this;return new $N(function(){return function(n){return function(r){return n(t.get(r))}}})},t.prototype.asGetter=function(){var t=this;return new $j(function(n){return t.get(n)})},t.prototype.asSetter=function(){var t=this;return new $A(function(n){return t.modify(n)})},t.prototype.compose=function(t){var n,r;return $x((r=this,VP(nC(r.get,t.get),nC(t.reverseGet,r.reverseGet))))},t.prototype.composeIso=function(t){return this.compose(t)},t.prototype.composeLens=function(t){return $_(nN(this,VL,VV(t)))},t.prototype.composePrism=function(t){return $S(nN(this,VD,V$(t)))},t.prototype.composeOptional=function(t){return $T(nN(this,VF,V9(t)))},t.prototype.composeTraversal=function(t){return $w(nN(this,VW,V7(t)))},t.prototype.composeFold=function(t){return this.asFold().compose(t)},t.prototype.composeGetter=function(t){return this.asGetter().compose(t)},t.prototype.composeSetter=function(t){return this.asSetter().compose(t)},t}(),$I=function(){function t(t,n){this.get=t,this.set=n,this._tag="Lens"}return t.fromPath=function(){var n=t.fromProp();return function(t){var r=n(t[0]);return t.slice(1).reduce(function(t,r){return t.compose(n(r))},r)}},t.fromProp=function(){return function(t){return $_(nN(VK(),VH(t)))}},t.fromProps=function(){return function(t){return $_(nN(VK(),VZ.apply($v,t)))}},t.fromNullableProp=function(){return function(n,r){return new t(function(t){var i=p3(t[n]);return pK(i)?r:i.value},function(t){return function(r){return $O(r,n,t)}})}},t.prototype.modify=function(t){return $o(t)(this)},t.prototype.asOptional=function(){return $T(Vz(this))},t.prototype.asTraversal=function(){return $w(VB(this))},t.prototype.asSetter=function(){var t=this;return new $A(function(n){return t.modify(n)})},t.prototype.asGetter=function(){var t=this;return new $j(function(n){return t.get(n)})},t.prototype.asFold=function(){var t=this;return new $N(function(){return function(n){return function(r){return n(t.get(r))}}})},t.prototype.compose=function(t){return $_(VV(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 $T(nN(this,Vz,V9(t)))},t.prototype.composeTraversal=function(t){return $w(nN(this,VB,V7(t)))},t.prototype.composeSetter=function(t){return this.asSetter().compose(t)},t.prototype.composeIso=function(t){return $_(nN(this,VV(nN(t,VL))))},t.prototype.composePrism=function(t){return $T(Vq(t)(this))},t}(),$C=function(){function t(t,n){this.getOption=t,this.reverseGet=n,this._tag="Prism"}return t.fromPredicate=function(t){return $S(V1(t))},t.some=function(){return $M},t.prototype.modify=function(t){var n=this;return function(r){var i=n.modifyOption(t)(r);return pK(i)?r:i.value}},t.prototype.modifyOption=function(t){var n=this;return function(r){return hl.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 $T(VQ(this))},t.prototype.asTraversal=function(){return $w(VX(this))},t.prototype.asSetter=function(){var t=this;return new $A(function(n){return t.modify(n)})},t.prototype.asFold=function(){var t=this;return new $N(function(n){return function(r){return function(i){var o=t.getOption(i);return pK(o)?n.empty:r(o.value)}}})},t.prototype.compose=function(t){return $S(V$(t)(this))},t.prototype.composePrism=function(t){return this.compose(t)},t.prototype.composeOptional=function(t){return $T(nN(this,VQ,V9(t)))},t.prototype.composeTraversal=function(t){return $w(nN(this,VX,V7(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 $S(nN(this,V$(nN(t,VD))))},t.prototype.composeLens=function(t){var n;return $T((n=t,function(t){return V9(Vz(n))(VQ(t))})(this))},t.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},t}(),$M=new $C(nS,nz),$R=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 p3(t[n])},function(t){return function(r){return null==r[n]?r:$O(r,n,t)}})}},t.fromOptionProp=function(){var t=$I.fromProp();return function(n){return t(n).composePrism($M)}},t.prototype.modify=function(t){return V5(t)(this)},t.prototype.modifyOption=function(t){return V4(t)(this)},t.prototype.asTraversal=function(){return $w(V3(this))},t.prototype.asFold=function(){var t=this;return new $N(function(n){return function(r){return function(i){var o=t.getOption(i);return pK(o)?n.empty:r(o.value)}}})},t.prototype.asSetter=function(){var t=this;return new $A(function(n){return t.modify(n)})},t.prototype.compose=function(t){return $T(V9(t)(this))},t.prototype.composeOptional=function(t){return this.compose(t)},t.prototype.composeTraversal=function(t){return $w(nN(this,V3,V7(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 $T(nN(this,V9(nN(t,Vz))))},t.prototype.composePrism=function(t){return $T(nN(this,V9(nN(t,VQ))))},t.prototype.composeIso=function(t){return $T(nN(this,V9(nN(t,VF))))},t.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},t}(),$E=function(){function t(t){this.modifyF=t,this._tag="Traversal"}return t.prototype.modify=function(t){return $b(t)(this)},t.prototype.set=function(t){var n;return $b(function(){return t})(this)},t.prototype.filter=function(t){var n;return $w(V7(VX(V1(t)))(this))},t.prototype.asFold=function(){var t=this;return new $N(function(n){return function(r){return t.modifyF(hO(n))(function(t){return nS(r(t))})}})},t.prototype.asSetter=function(){var t=this;return new $A(function(n){return t.modify(n)})},t.prototype.compose=function(t){return $w(V7(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 $w(nN(this,V7(nN(t,VB))))},t.prototype.composePrism=function(t){return $w(nN(this,V7(nN(t,VX))))},t.prototype.composeIso=function(t){return $w(nN(this,V7(nN(t,VW))))},t.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},t}(),$j=function(){function t(t){this.get=t,this._tag="Getter"}return t.prototype.asFold=function(){var t=this;return new $N(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}(),$N=function(){function t(t){this.foldMap=t,this._tag="Fold",this.getAll=t(fV())(ap),this.exist=t(T0),this.all=t(TX),this.foldMapFirst=t(hp())}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(dX(t))},t.prototype.headOption=function(t){return this.find(function(){return!0})(t)},t}(),$A=function(){function t(t){this.modify=t,this._tag="Setter"}return t.prototype.set=function(t){return this.modify(nT(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}(),$P=new $k(nS,nS),$L=B4({_tag:zq("None")}),$D=zq("Some");function $F(t,n){return void 0===n&&(n="Option<"+t.name+">"),BQ([$L,B4({_tag:$D,value:t},"Some<"+t.name+">")],n)}var $W=new ze("DateFromISOString",function(t){return t instanceof Date},function(t,n){return nN(zN.validate(t,n),ms(function(r){var i=new Date(r);return isNaN(i.getTime())?U7(t,n):nq(i)}))},function(t){return t.toISOString()});function $U(t){var n=Object.create(Object.getPrototypeOf(t));return Object.assign(n,t),n}var $z=new ze("DateFromNumber",function(t){return t instanceof Date},function(t,n){return nN(zP.validate(t,n),ms(function(r){var i=new Date(r);return isNaN(i.getTime())?U7(t,n):nq(i)}))},function(t){return t.getTime()});function $B(t,n,r){void 0===r&&(r=t.name);var i=$U(t);return i.validate=n,i.decode=function(t){return n(t,Vn(i))},i.name=r,i}var $V,$$,$q,$K=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,$H=Vc(zN,$$=function(t){return $K.test(t)},"UUID"),$Z=new ze("BooleanFromString",zW.is,function(t,n){return nN(zN.validate(t,n),ms(function(r){return"true"===r?nq(!0):"false"===r?nq(!1):U7(t,n)}))},String);function $G(t){switch(t._tag){case"InterfaceType":return t.props;case"ExactType":return $G(t.type)}}var $Y=$I.fromProp(),$J=Vj("RegExp",function(t){return"[object RegExp]"===Object.prototype.toString.call(t)}),$Q=new ze("DateFromUnixTime",function(t){return t instanceof Date},function(t,n){return nN(Bz.validate(t,n),ms(function(r){var i=new Date(1e3*r);return isNaN(i.getTime())?U7(t,n):nq(i)}))},function(t){return Math.floor(t.getTime()/1e3)}),$X=new ze("NumberFromString",zP.is,function(t,n){return nN(zN.validate(t,n),ms(function(r){var i=+r;return isNaN(i)||""===r.trim()?U7(t,n):nq(i)}))},String),$0=new ze("IntFromString",Bz.is,function(t,n){return nN($X.validate(t,n),ms(function(r){return Bz.is(r)?nq(r):U7(t,n)}))},$X.encode),$1=BV("JsonArray",function(){return B3($3)}),$2=BV("JsonRecord",function(){return BY(zN,$3)}),$3=BQ([zW,zP,zN,zO,$1,$2],"Json"),$4=new ze("JsonFromString",$3.is,function(t,n){try{return nq(JSON.parse(t))}catch{return U7(t,n)}},function(t){return JSON.stringify(t)}),$5=zq("Left"),$9=zq("Right"),$6=new ze("BigIntFromString",function(t){return"bigint"==typeof t},function(t,n){return nN(zN.validate(t,n),ms(function(r){if(!VM.is(r.trim()))return U7(t,n);try{return nq(BigInt(r))}catch{return U7(t,n)}}))},String),$8=new ze("BooleanFromNumber",zW.is,function(t,n){return nN(zP.validate(t,n),me(function(t){return 0!==t}))},Number);let $7=Object.freeze(Object.defineProperty({__proto__:null,BigIntFromString:$6,BooleanFromNumber:$8,BooleanFromString:$Z,DateFromISOString:$W,DateFromNumber:$z,DateFromUnixTime:$Q,IntFromString:$0,Json:$3,JsonArray:$1,JsonFromString:$4,JsonRecord:$2,NonEmptyString:VM,NumberFromString:$X,UUID:$H,clone:$U,date:VN,either:function(t,n,r){return void 0===r&&(r="Either<"+t.name+", "+n.name+">"),BQ([B4({_tag:$5,left:t},"Left<"+t.name+">"),B4({_tag:$9,right:n},"Right<"+t.name+">")],r)},fromNewtype:function(t,n){return void 0===n&&(n="fromNewtype("+t.name+")"),new ze(n,function(n){return t.is(n)},function(n,r){return nN(t.validate(n,r),me($P.wrap))},function(n){return t.encode($P.unwrap(n))})},fromNullable:function(t,n,r){return void 0===r&&(r="fromNullable("+t.name+")"),$B(t,function(r,i){return null==r?nq(n):t.validate(r,i)},r)},fromRefinement:Vj,getLenses:function(t){var n={};for(var r in $G(t))n[r]=$Y(r);return n},mapOutput:Vw,nonEmptyArray:VR,option:$F,optionFromNullable:function(t,n){return void 0===n&&(n="Option<"+t.name+">"),new ze(n,$F(t).is,function(n,r){return null==n?nq(nU):nN(t.validate(n,r),me(nz))},function(n){return p8(nN(n,pl(t.encode)))})},readonlyNonEmptyArray:function(t,n){return void 0===n&&(n="ReadonlyNonEmptyArray<"+t.name+">"),VR(t,n)},readonlySetFromArray:function(t,n,r){return void 0===r&&(r="ReadonlySet<"+t.name+">"),VE(t,n,r)},regexp:$J,setFromArray:VE,withEncode:function(t,n,r){return void 0===r&&(r=t.name),new ze(r,t.is,t.validate,n)},withFallback:function(t,n,r){return void 0===r&&(r="withFallback("+t.name+")"),$B(t,function(r,i){return mF(function(){return nq(n)})(t.validate(r,i))},r)},withMessage:function(t,n){return $B(t,function(r,i){return my(function(){return[{value:r,context:i,message:n(r,i),actual:r}]})(t.validate(r,i))})},withValidate:$B},Symbol.toStringTag,{value:"Module"})),qe=w($7),qt=w(VO);Object.defineProperty(VS,"__esModule",{value:!0}),VS.withCustomError=VS.addType=VS.isEmpty=VS.objectToMap=VS.grouped=VS.formatDate=VS.formatDateTime=VS.filterDouble=VS.refineType=VS.nullable=void 0;let qn=nf,qr=(0,qn.__importStar)(Vh);VS.nullable=function(t){return qr.union([t,qr.null,qr.undefined])},VS.refineType=function(t,n,r){return new qr.Type(n,t.is,(n,i)=>(0,VT.pipe)(t.validate(n,i),Ui.either.chain(t=>r(t)?qr.success(t):qr.failure(n,i))),t.encode)},VS.filterDouble=function(t){if(""===t)return null;let n=Number(t);return Number.isNaN(n)?null:n},VS.formatDateTime=function(t){return t.toISOString().replace(/\.\d{3}Z$/,"+0000")},VS.formatDate=function(t){return t.toISOString().replace(/T.*/,"")},VS.grouped=function(t,n){return t.reduce((t,r,i)=>(i%n==0?t.push([r]):t[Math.floor(i/n)].push(r),t),[])},VS.objectToMap=function(t){return new Map(Object.entries(t))},VS.isEmpty=function(t){for(let n in t)return!1;return!0},VS.addType=function(t,n){return(0,qt.mapOutput)(t,t=>({...t,__TYPE__:n}))},VS.withCustomError=function(t,n){return(0,qe.withValidate)(t,(r,i)=>Ui.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(V_,"__esModule",{value:!0}),V_.WidgetKey=void 0;let qi=nf,qo=(0,qi.__importStar)(Vh),qa=RegExp("^[^<>]+$");V_.WidgetKey=(0,VS.refineType)(qo.string,"WidgetKey",t=>0===t.length||qa.test(t)),function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nf;(0,n.__exportStar)(Vy,t),(0,n.__exportStar)(Vb,t),(0,n.__exportStar)(V_,t)}(Vg);var qu={},qs={},qc={},ql={},qf={};Object.defineProperty(qf,"__esModule",{value:!0}),qf.clone=void 0,qf.clone=function(t){var n=Object.create(Object.getPrototypeOf(t));return Object.assign(n,t),n};var qd=T&&T.__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]}),qp=T&&T.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),qh=T&&T.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&qd(n,t,r);return qp(n,t),n};Object.defineProperty(ql,"__esModule",{value:!0}),ql.withValidate=void 0;var qm=qh(Vh);ql.withValidate=function(t,n,r){void 0===r&&(r=t.name);var i=qf.clone(t);return i.validate=n,i.decode=function(t){return n(t,qm.getDefaultContext(i))},i.name=r,i};var qg=T&&T.__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]}),qy=T&&T.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),qv=T&&T.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&qg(n,t,r);return qy(n,t),n};Object.defineProperty(qc,"__esModule",{value:!0}),qc.withFallback=void 0;var qb=qv(Vh);qc.withFallback=function(t,n,r){return void 0===r&&(r="withFallback("+t.name+")"),ql.withValidate(t,function(r,i){return Uo.orElse(function(){return qb.success(n)})(t.validate(r,i))},r)};var qx={},q_={};Object.defineProperty(q_,"__esModule",{value:!0}),q_.EmptyArray=q_.EmptyObject=q_.Boolean=q_.NumberOrNull=q_.Number=q_.StringOrNull=q_.String=void 0;let qS=nf,qT=(0,qS.__importStar)(Vh);q_.String=(0,VS.withCustomError)(qT.string,()=>"The value must be a string"),q_.StringOrNull=(0,VS.withCustomError)(qT.union([qT.string,qT.null]),()=>"The value must be a string or null"),q_.Number=(0,VS.withCustomError)(qT.number,()=>"The value must be a number"),q_.NumberOrNull=(0,VS.withCustomError)(qT.union([qT.number,qT.null]),()=>"The value must be a number or null"),q_.Boolean=(0,VS.withCustomError)(qT.boolean,()=>"The value must be a boolean"),q_.EmptyObject=qT.UnknownRecord.pipe(new qT.Type("emptyObject",t=>qT.UnknownRecord.is(t),(t,n)=>Object.keys(t).length>0?qT.failure(t,n,"The object is not empty."):qT.success({}),qT.identity)),q_.EmptyArray=new qT.Type("emptyArray",t=>qT.UnknownArray.is(t)&&0===t.length,(t,n)=>(0,Us.pipe)(qT.UnknownArray.decode(t),Ui.either.chain(r=>r.length>0?qT.failure(t,n,"The array is not empty."):qT.success([]))),()=>[]);var qw={};let qO=w(m9);var qk={};Object.defineProperty(qk,"__esModule",{value:!0});let qI=nf,qC=(0,qI.__importStar)(Vh);qk.default=new qC.Type("dateFromStringOrNumber",t=>t instanceof Date,(t,n)=>(0,VT.pipe)(qC.union([qC.number,qC.string]).validate(t,n),(0,qO.chain)(r=>{let i=new Date(r);return isNaN(i.getTime())?qC.failure(t,n):qC.success(i)})),t=>t);var qM={};Object.defineProperty(qM,"__esModule",{value:!0});let qR=nf,qE=(0,qR.__importStar)(Vh);qM.default=new qE.Type("dateFromTsMs",t=>t instanceof Date,(t,n)=>(0,VT.pipe)(qE.number.validate(t,n),(0,qO.chain)(r=>{let i=new Date(r);return isNaN(i.getTime())?qE.failure(t,n):qE.success(i)})),t=>t.getTime());var qj={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.EmptyArrayOrElse=t.EmptyObjectOrElse=t.NullOrElse=t.DefaultOrElse=void 0;let n=nf,r=(0,n.__importStar)(Vh),i=t=>n=>new r.Type(`DefaultOrElse<${t.name}, ${n.name}>`,t=>null===t||n.is(t),(i,o)=>(0,Uo.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)(q_.EmptyObject)(n);t.EmptyObjectOrElse=a;let u=n=>(0,t.DefaultOrElse)(q_.EmptyArray)(n);t.EmptyArrayOrElse=u}(qj);var qN={};Object.defineProperty(qN,"__esModule",{value:!0});let qA=nf,qP=(0,qA.__importStar)(Vh);qN.default=new qP.Type("IntFromNumber",qP.Int.is,(t,n)=>(0,VT.pipe)(qP.number.validate(t,n),(0,qO.chain)(t=>qP.Int.is(t)?qP.success(t):qP.success(Math.round(t)))),qP.Int.encode);var qL={};Object.defineProperty(qL,"__esModule",{value:!0});let qD=nf,qF=(0,qD.__importStar)(Vh),qW=/^([0-9]+)px$/;qL.default=new qF.Type("IntFromPixels",qF.Int.is,(t,n)=>(0,VT.pipe)(qF.string.validate(t,n),(0,qO.chain)(r=>{try{let i=r.match(qW);if(!i)return qF.failure(t,n);let o=parseInt(i[1]);return qF.success(o)}catch{return qF.failure(t,n)}})),String);var qU={};Object.defineProperty(qU,"__esModule",{value:!0});let qz=nf,qB=(0,qz.__importStar)(Vh);qU.default=(0,VS.withCustomError)((0,VS.refineType)(qB.string,"nonEmptyString",t=>t.trim().length>0),()=>"The value must be a non-empty string");var qV={},q$={};Object.defineProperty(q$,"__esModule",{value:!0});let qq=nf,qK=(0,qq.__importStar)(Vh);q$.default=(0,VS.nullable)(qK.string),Object.defineProperty(qV,"__esModule",{value:!0});let qH=nf,qZ=(0,qH.__importDefault)(q$);qV.default=new Vh.Type("nonEmptyStringOrNull",t=>"string"==typeof t||null===t,(t,n)=>(0,VT.pipe)(qZ.default.validate(t,n),(0,qO.chain)(t=>"string"==typeof t&&t.length>0?(0,Vh.success)(t):(0,Vh.success)(null))),t=>t);var qG={};Object.defineProperty(qG,"__esModule",{value:!0});let qY=nf,qJ=(0,qY.__importStar)(Vh);qG.default=(0,VS.nullable)(qJ.number);var qQ={};Object.defineProperty(qQ,"__esModule",{value:!0});let qX=nf,q0=(0,qX.__importStar)(Vh);qQ.default=(t,n,r)=>q_.Number.pipe(new q0.Type("numberInRange",t=>q_.Number.is(t),(i,o)=>i>n||i<t?q0.failure(i,o,`${r} must be a number between ${t} and ${n}`):q0.success(i),q0.identity));var q1={};Object.defineProperty(q1,"__esModule",{value:!0});let q2=nf,q3=(0,q2.__importStar)(Vh);q1.default=new q3.Type("StringFromInt",q3.string.is,(t,n)=>(0,VT.pipe)(q3.boolean.validate(t,n),(0,qO.chain)(t=>q3.success(t.toString()))),t=>t);var q4={};Object.defineProperty(q4,"__esModule",{value:!0});let q5=nf,q9=(0,q5.__importStar)(Vh);function q6(){return H_||(H_=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=nf;(0,n.__exportStar)(q_,t);var r=function(){if(Hx)return qw;Hx=1,Object.defineProperty(qw,"__esModule",{value:!0});let t=nf,n=(0,t.__importStar)(Vh),r=q6();return qw.default=new n.Type("dateFromString",t=>t instanceof Date,(t,i)=>(0,VT.pipe)(r.String.validate(t,i),(0,qO.chain)(r=>{let o=new Date(r);return isNaN(o.getTime())?n.failure(t,i):n.success(o)})),t=>t.toISOString()),qw}();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)(qk).default}}),Object.defineProperty(t,"DateFromTsMs",{enumerable:!0,get:function(){return(0,n.__importDefault)(qM).default}}),(0,n.__exportStar)(qj,t),t.Function=(0,n.__importStar)(VS),Object.defineProperty(t,"IntFromNumber",{enumerable:!0,get:function(){return(0,n.__importDefault)(qN).default}}),Object.defineProperty(t,"IntFromPixels",{enumerable:!0,get:function(){return(0,n.__importDefault)(qL).default}}),Object.defineProperty(t,"NonEmptyString",{enumerable:!0,get:function(){return(0,n.__importDefault)(qU).default}}),Object.defineProperty(t,"NonEmptyStringOrNull",{enumerable:!0,get:function(){return(0,n.__importDefault)(qV).default}}),Object.defineProperty(t,"NumberOrNull",{enumerable:!0,get:function(){return(0,n.__importDefault)(qG).default}}),Object.defineProperty(t,"NumberRange",{enumerable:!0,get:function(){return(0,n.__importDefault)(qQ).default}}),Object.defineProperty(t,"StringFromBoolean",{enumerable:!0,get:function(){return(0,n.__importDefault)(q1).default}}),Object.defineProperty(t,"StringFromNumber",{enumerable:!0,get:function(){return(0,n.__importDefault)(q4).default}}),Object.defineProperty(t,"StringOrNull",{enumerable:!0,get:function(){return(0,n.__importDefault)(q$).default}})}(qx)),qx}q4.default=new q9.Type("StringFromInt",q9.string.is,(t,n)=>(0,VT.pipe)(q9.number.validate(t,n),(0,qO.chain)(t=>q9.success(t.toString()))),t=>t);var q8={},q7={},Ke={},Kt={},Kn={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanField=t.BooleanConfig=t.BooleanFieldType=void 0;let n=(0,nf.__importStar)(Vh),r=q6();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})]))}(Kn);var Kr={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Color=t.ColorConfig=t.ColorFieldType=void 0;let n=(0,nf.__importStar)(Vh),r=q6();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})]))}(Kr);var Ki={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Date=t.DateConfig=t.DateFieldType=void 0;let n=(0,nf.__importStar)(Vh),r=q6();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})]))}(Ki);var Ko={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Embed=t.EmbedConfig=t.EmbedFieldType=void 0;let n=(0,nf.__importStar)(Vh),r=q6();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})]))}(Ko);var Ka={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.GeoPoint=t.GeoPointConfig=t.GeoPointFieldType=void 0;let n=(0,nf.__importStar)(Vh),r=q6();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})]))}(Ka);var Ku={},Ks={},Kc={},Kl={},Kf={};Object.defineProperty(Kf,"__esModule",{value:!0}),Kf.pipe=Kf.pipeable=void 0,Kf.pipeable=function(t){var n,r,i,o,a,u,s,c,l,f,d,p,h,m,g,y={};if("function"==typeof t.map){var v=function(n){return function(r){return t.map(r,n)}};y.map=v}if("function"==typeof t.contramap){var b=function(n){return function(r){return t.contramap(r,n)}};y.contramap=b}if("function"==typeof t.mapWithIndex){var x=function(n){return function(r){return t.mapWithIndex(r,n)}};y.mapWithIndex=x}if("function"==typeof t.ap){var _=function(n){return function(r){return t.ap(r,n)}},S=function(n){return function(r){return t.ap(t.map(r,function(t){return function(){return t}}),n)}};y.ap=_,y.apFirst=S,y.apSecond=function(n){return function(r){return t.ap(t.map(r,function(){return function(t){return t}}),n)}}}if("function"==typeof t.chain){var T=function(n){return function(r){return t.chain(r,n)}},w=function(n){return function(r){return t.chain(r,function(r){return t.map(n(r),function(){return r})})}},O=function(n){return t.chain(n,Us.identity)};y.chain=T,y.chainFirst=w,y.flatten=O}if("function"==typeof t.bimap){var k=function(n,r){return function(i){return t.bimap(i,n,r)}},I=function(n){return function(r){return t.mapLeft(r,n)}};y.bimap=k,y.mapLeft=I}if("function"==typeof t.extend){var C=function(n){return function(r){return t.extend(r,n)}},M=function(n){return t.extend(n,Us.identity)};y.extend=C,y.duplicate=M}if("function"==typeof t.reduce){var R=function(n,r){return function(i){return t.reduce(i,n,r)}},E=function(n){var r=t.foldMap(n);return function(t){return function(n){return r(n,t)}}},j=function(n,r){return function(i){return t.reduceRight(i,n,r)}};y.reduce=R,y.foldMap=E,y.reduceRight=j}if("function"==typeof t.reduceWithIndex){var N=function(n,r){return function(i){return t.reduceWithIndex(i,n,r)}},A=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=N,y.foldMapWithIndex=A,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)}},Z=function(n){return"Left"===n._tag?t.throwError(n.left):t.of(n.right)},G=function(n,r){return function(i){return n(i)?t.of(i):t.throwError(r(i))}},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=Z,y.fromPredicate=G,y.filterOrElse=Y}return y},Kf.pipe=Us.pipe;var Kd=T&&T.__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]}),Kp=T&&T.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),Kh=T&&T.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&Kd(n,t,r);return Kp(n,t),n};Object.defineProperty(Kl,"__esModule",{value:!0}),Kl.NumberFromString=void 0;var Km=Kh(Vh);Kl.NumberFromString=new Km.Type("NumberFromString",Km.number.is,function(t,n){return Kf.pipe(Km.string.validate(t,n),Uo.chain(function(r){var i=+r;return isNaN(i)||""===r.trim()?Km.failure(t,n):Km.success(i)}))},String);var Kg=T&&T.__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]}),Ky=T&&T.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),Kv=T&&T.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&Kg(n,t,r);return Ky(n,t),n};Object.defineProperty(Kc,"__esModule",{value:!0}),Kc.IntFromString=void 0;var Kb=Kv(Vh);Kc.IntFromString=new Kb.Type("IntFromString",Kb.Int.is,function(t,n){return Kf.pipe(Kl.NumberFromString.validate(t,n),Uo.chain(function(r){return Kb.Int.is(r)?Kb.success(r):Kb.failure(t,n)}))},Kl.NumberFromString.encode),Object.defineProperty(Ks,"__esModule",{value:!0});let Kx=nf,K_=(0,Kx.__importStar)(Vh),KS=q6(),KT=new K_.Type("SideConstraints",t=>!t||"number"==typeof t,(t,n)=>Uo.either.chain(K_.union([K_.literal("auto"),K_.literal(""),K_.Int,Kc.IntFromString,KS.IntFromNumber,KS.IntFromPixels,K_.null]).validate(t,n),t=>"auto"===t||""===t?K_.success(null):K_.success(t)),t=>t),Kw=K_.partial({width:KT,height:KT});Ks.default=Kw,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Image=t.ImageConfig=t.Thumbnail=t.ImageFieldType=void 0;let n=nf,r=(0,n.__importStar)(Vh),i=q6(),o=(0,n.__importDefault)(Ks);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})]))}(Ku);var KO={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.IntegrationField=t.IntegrationFieldConfig=t.IntegrationFieldType=void 0;let n=(0,nf.__importStar)(Vh),r=q6();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})]))}(KO);var Kk={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Link=t.LinkConfig=t.LinkFieldType=void 0;let n=nf,r=(0,n.__importStar)(Vh),i=q6(),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)=>Uo.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,qc.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})]))}(Kk);var KI={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Number=t.NumberConfig=t.NumberFieldType=void 0;let n=(0,nf.__importStar)(Vh),r=q6();t.NumberFieldType="Number",t.NumberConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,min:n.union([n.number,Kl.NumberFromString]),max:n.union([n.number,Kl.NumberFromString]),step:n.union([n.number,Kl.NumberFromString])})),t.Number=n.exact(n.intersection([n.type({type:n.literal(t.NumberFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.NumberConfig})]))}(KI);var KC={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Range=t.RangeConfig=t.RangeFieldType=void 0;let n=(0,nf.__importStar)(Vh),r=q6();t.RangeFieldType="Range",t.RangeConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,min:n.union([n.number,Kl.NumberFromString]),max:n.union([n.number,Kl.NumberFromString]),step:n.union([n.number,Kl.NumberFromString])})),t.Range=n.exact(n.intersection([n.type({type:n.literal(t.RangeFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.RangeConfig})]))}(KC);var KM={};!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=nf,r=(0,n.__importStar)(Vh),i=q6(),o=(0,n.__importDefault)(Ks);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,Us.pipe)(r.union([r.string,r.null]).decode(n),Ui.either.map(n=>{if(!n)return t.DEFAULT_OPTION;let r=n.split(",").map(t=>t.trim()).filter(n=>(0,Uo.getOrElseW)(()=>{})(t.RichTextNodeTypeCodec.decode(n)));return r.length?r.join(","):t.DEFAULT_OPTION})),t=>t),u=t=>{if(!t)return r.success([])},s=t=>{if(t instanceof Object){if(!Object.entries(t).length)return r.success([]);if(t[""])return r.success(t[""].map(t=>t.name));let n=Object.entries(t).reduce((t,[,n])=>t.concat(n.map(t=>t.name)),[]).filter(Boolean);return r.success(n)}},c=t=>{if(t instanceof Array&&t.reduce((t,n)=>t&&"string"==typeof n,!0))return r.success(t)},l=t=>{if("string"==typeof t)return r.success([t])},f=new r.Type("RichTextLabels",t=>t instanceof Array,(t,n)=>{let i=r.record(r.string,r.readonlyArray(r.record(r.literal("name"),r.string))),o=r.readonlyArray(r.string);return(0,Us.pipe)(r.union([i,o,r.string,r.null]).decode(t),Ui.either.chain(i=>u(i)||c(i)||s(i)||l(i)||r.failure(t,n)))},t=>t);t.RichTextConfig=r.exact(r.partial({label:i.StringOrNull,placeholder:r.string,useAsTitle:r.boolean,single:a,multi:a,imageConstraint:o.default,labels:f,allowTargetBlank:r.boolean})),t.RichText=r.exact(r.intersection([r.type({type:r.literal(t.RichTextFieldType)}),r.partial({fieldset:i.StringOrNull,config:t.RichTextConfig})]))}(KM);var KR={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Select=t.SelectConfig=t.SelectFieldType=void 0;let n=(0,nf.__importStar)(Vh),r=q6();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})]))}(KR);var KE={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Separator=t.SeparatorConfig=t.SeparatorFieldType=void 0;let n=(0,nf.__importStar)(Vh),r=q6();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})]))}(KE);var Kj={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Text=t.TextConfig=t.TextFieldType=void 0;let n=(0,nf.__importStar)(Vh),r=q6();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})]))}(Kj);var KN={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Timestamp=t.TimestampConfig=t.TimestampFieldType=void 0;let n=(0,nf.__importStar)(Vh),r=q6();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})]))}(KN),Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.NestableWidget=void 0;let KA=nf,KP=(0,KA.__importStar)(Vh);Kt.NestableWidget=KP.union([Kr.Color,Kn.BooleanField,Ko.Embed,Ka.GeoPoint,Ki.Date,KI.Number,KC.Range,KM.RichText,KR.Select,KE.Separator,Kj.Text,KN.Timestamp,Kk.Link,Ku.Image,KO.IntegrationField]),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Group=t.GroupConfig=t.GroupFieldType=void 0;let n=(0,nf.__importStar)(Vh),r=q6();t.GroupFieldType="Group",t.GroupConfig=n.exact(n.partial({label:r.StringOrNull,repeat:n.boolean,fields:n.record(Vg.WidgetKey,Kt.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})]))}(Ke);var KL={};!function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nf;(0,n.__exportStar)(Kn,t),(0,n.__exportStar)(Kr,t),(0,n.__exportStar)(Ki,t),(0,n.__exportStar)(Ko,t),(0,n.__exportStar)(Ka,t),(0,n.__exportStar)(Ku,t),(0,n.__exportStar)(KO,t),(0,n.__exportStar)(Kk,t),(0,n.__exportStar)(Kt,t),(0,n.__exportStar)(KI,t),(0,n.__exportStar)(KC,t),(0,n.__exportStar)(KM,t),(0,n.__exportStar)(KR,t),(0,n.__exportStar)(KE,t),(0,n.__exportStar)(Kj,t),(0,n.__exportStar)(KN,t)}(KL);var KD={},KF={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.isCompositeSlice=t.CompositeSlice=t.CompositeSliceConfig=t.CompositeSliceType=void 0;let n=(0,nf.__importStar)(Vh),r=q6();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(Vg.WidgetKey,Kt.NestableWidget),repeat:n.record(Vg.WidgetKey,Kt.NestableWidget),config:t.CompositeSliceConfig})])),t.isCompositeSlice=function(t){return"Slice"===t.type}}(KF);var KW={};Object.defineProperty(KW,"__esModule",{value:!0}),KW.isLegacySlice=KW.LegacySlice=void 0;let KU=nf,Kz=(0,KU.__importStar)(Vh);KW.LegacySlice=Kz.union([Kt.NestableWidget,Ke.Group]),KW.isLegacySlice=function(t){return"Slice"!==t.type&&"SharedSlice"!==t.type};var KB={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.isDynamicSharedSlice=t.isStaticSharedSlice=t.SharedSlice=t.SharedSliceType=t.Variation=void 0;let n=(0,nf.__importStar)(Vh);t.Variation=n.exact(n.intersection([n.type({id:n.string,name:n.string,description:n.string,imageUrl:(0,qc.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(Vg.WidgetKey,Kt.NestableWidget),items:n.record(Vg.WidgetKey,Kt.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}}(KB);var KV={};Object.defineProperty(KV,"__esModule",{value:!0}),KV.SharedSliceRef=void 0;let K$=nf,Kq=(0,K$.__importStar)(Vh);KV.SharedSliceRef=Kq.exact(Kq.type({type:Kq.literal(KB.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,nf.__importStar)(Vh),r=q6();function i(i){return n.exact(n.partial({label:r.StringOrNull,labels:t.SlicesLabels,choices:n.record(Vg.WidgetKey,n.union([KW.LegacySlice,KF.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(KB.SharedSlice),t.DynamicSlicesConfig=i(KV.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}}(KD);var KK={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.UID=t.UIDConfig=t.UIDFieldType=void 0;let n=(0,nf.__importStar)(Vh),r=q6();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})]))}(KK),Object.defineProperty(q7,"__esModule",{value:!0}),q7.Widgets=q7.FieldType=q7.DynamicWidget=q7.StaticWidget=q7.widgetReader=void 0;let KH=nf,KZ=(0,KH.__importStar)(Vh);function KG(t){return KZ.union([KK.UID,Kt.NestableWidget,Ke.Group,t])}q7.widgetReader=KG,q7.StaticWidget=KG(KD.StaticSlices),q7.DynamicWidget=KG(KD.DynamicSlices),q7.FieldType=KZ.keyof({[KL.ColorFieldType]:null,[KL.BooleanFieldType]:null,[KL.NumberFieldType]:null,[KL.EmbedFieldType]:null,[KL.GeoPointFieldType]:null,[KL.DateFieldType]:null,[KL.RangeFieldType]:null,[KL.RichTextFieldType]:null,[KL.SelectFieldType]:null,[KL.SeparatorFieldType]:null,[KL.TextFieldType]:null,[KL.TimestampFieldType]:null,[KL.LinkFieldType]:null,[KL.ImageFieldType]:null,[KL.IntegrationFieldType]:null,[KK.UIDFieldType]:null,[Ke.GroupFieldType]:null,[KD.SlicesFieldType]:null,[KD.LegacySlicesFieldType]:null}),q7.Widgets={toStatic(t,n){switch(t.type){case"Choice":case"Slices":return KD.Slices.toStatic(t,n);default:return t}}},Object.defineProperty(q8,"__esModule",{value:!0}),q8.Sections=q8.DynamicSection=q8.StaticSection=q8.sectionReader=void 0;let KY=nf,KJ=(0,KY.__importStar)(Vh);function KQ(t){return KJ.record(Vg.WidgetKey,t)}q8.sectionReader=KQ,q8.StaticSection=KQ(q7.StaticWidget),q8.DynamicSection=KQ(q7.DynamicWidget),q8.Sections={toStatic:(t,n)=>Object.entries(t).reduce((t,[r,i])=>({...t,[r]:q7.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=nf,r=(0,n.__importStar)(Vh),i=q6();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,qc.withFallback)(r.boolean,!0),json:r.record(r.string,n),status:(0,qc.withFallback)(r.boolean,!0)}),r.partial({hash:r.string,format:(0,qc.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(q8.StaticSection),t.CustomType=a(q8.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]:q8.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,Uo.left)(new o(r)):(0,Uo.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},{})}}(qs);var KX,K0,K1={},K2={};Object.defineProperty(KX=K2,"__esModule",{value:!0}),KX.DiffOperation=void 0,(K0=KX.DiffOperation||(KX.DiffOperation={})).Added="added",K0.Removed="removed",K0.Updated="updated";var K3={},K4={},K5={};Object.defineProperty(K5,"__esModule",{value:!0}),K5.HexaColor=void 0;let K9=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;K5.HexaColor={is:t=>K9.test(t)};var K6={};Object.defineProperty(K6,"__esModule",{value:!0}),K6.toRecord=void 0,K6.toRecord=function(t,n){return t.reduce((t,r)=>{let i=n(r);return{...t,[i]:r}},{})};var K8={};Object.defineProperty(K8,"__esModule",{value:!0}),K8.mapValues=K8.isObject=K8.withOptionals=K8.isNotEmpty=K8.zipObjects=void 0;let K7=nf,He=(0,K7.__importStar)(Vh);K8.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}}},{})},K8.isNotEmpty=function(t){return Boolean(Object.keys(t).length)},K8.withOptionals=function(t,n){return{...t,...n.reduce((t,[n,r])=>r?{...t,[n]:r}:t,{})}};let Ht=He.record(He.string,He.unknown);K8.isObject=function(t){return(0,Uo.isRight)(Ht.decode(t))},K8.mapValues=function(t,n){return Object.entries(t).reduce((t,[r,i])=>({...t,[r]:n(i,r)}),{})},Object.defineProperty(K4,"__esModule",{value:!0}),K4.Objects=K4.Arrays=K4.HexaColorCode=void 0;let Hn=nf;K4.HexaColorCode=(0,Hn.__importStar)(K5),K4.Arrays=(0,Hn.__importStar)(K6),K4.Objects=(0,Hn.__importStar)(K8);var Hr={};function Hi(t,n){let r=K4.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:K2.DiffOperation.Removed}:!(null!=r&&r.left)&&null!=r&&r.right?{op:K2.DiffOperation.Added,value:r.right}:{op:K2.DiffOperation.Updated,value:r.right}})();return i?{...t,[n]:i}:t},{});return K4.Objects.isNotEmpty(i)?i:void 0}Object.defineProperty(Hr,"__esModule",{value:!0}),Hr.VariationComparator=void 0,Hr.VariationComparator={compare(t,n){if(t&&!n)return{op:K2.DiffOperation.Removed};if(!t&&n)return{op:K2.DiffOperation.Added,value:n};let r=function(t,n){let r=K4.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=Hi(null==t?void 0:t.primary,null==n?void 0:n.primary),o=Hi(null==t?void 0:t.items,null==n?void 0:n.items),a={...r,...i?{primary:i}:{},...o?{items:o}:{}};if(K4.Objects.isNotEmpty(a))return{op:K2.DiffOperation.Updated,value:a}}},Object.defineProperty(K3,"__esModule",{value:!0}),K3.SliceComparator=void 0,K3.SliceComparator={compare(t,n){if(!t&&n)return{op:K2.DiffOperation.Added,value:n};if(t&&!n)return{op:K2.DiffOperation.Removed};let r=function(t,n){let r=K4.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=K4.Objects.zipObjects(t&&K4.Arrays.toRecord(t.variations,t=>t.id),n&&K4.Arrays.toRecord(n.variations,t=>t.id)),o=Object.entries(i).reduce((t,[n,r])=>{if(!r)return t;let i=Hr.VariationComparator.compare(r.left,r.right);return i?{...t,[n]:i}:t},{}),a={...r,...K4.Objects.isNotEmpty(o)?{variations:o}:{}};if(K4.Objects.isNotEmpty(a))return{op:K2.DiffOperation.Updated,value:a}}},function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nf;(0,n.__exportStar)(K2,t),(0,n.__exportStar)(K3,t),(0,n.__exportStar)(Hr,t)}(K1);var Ho,Ha,Hu={},Hs={};Ho=Hs,Ha=T&&T.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},Object.defineProperty(Ho,"__esModule",{value:!0}),Ho.ImageConstraint=void 0,Object.defineProperty(Ho,"ImageConstraint",{enumerable:!0,get:function(){return Ha(Ks).default}});var Hc={},Hl={};Object.defineProperty(Hl,"__esModule",{value:!0});var Hf={};Object.defineProperty(Hf,"__esModule",{value:!0}),Hf.SlicesTypes=void 0;let Hd=nf,Hp=(0,Hd.__importStar)(Vh);Hf.SlicesTypes=Hp.keyof({[KF.CompositeSliceType]:null,[KB.SharedSliceType]:null}),function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nf;(0,n.__exportStar)(KF,t),(0,n.__exportStar)(KW,t),(0,n.__exportStar)(KB,t),(0,n.__exportStar)(KV,t),(0,n.__exportStar)(Hl,t),(0,n.__exportStar)(KD,t),(0,n.__exportStar)(Hf,t)}(Hc),function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nf;(0,n.__exportStar)(Ke,t),(0,n.__exportStar)(KL,t),(0,n.__exportStar)(Hs,t),(0,n.__exportStar)(Hc,t),(0,n.__exportStar)(KK,t),(0,n.__exportStar)(q7,t)}(Hu),function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nf;(0,n.__exportStar)(qs,t),(0,n.__exportStar)(K1,t),(0,n.__exportStar)(q8,t),(0,n.__exportStar)(Hu,t)}(qu);var Hh,Hm,Hg,Hy,Hv,Hb,Hx,H_,HS,HT={},Hw={},HO={};function Hk(){if(HS)return HO;HS=1,Object.defineProperty(HO,"__esModule",{value:!0}),HO.hasContentType=HO.hasFieldContentType=void 0;let t=Z7();function n(t){return"object"==typeof t&&null!==t&&"__TYPE__"in t}return HO.hasFieldContentType=function(r){return n(r)&&r.__TYPE__===t.FieldContentType&&(null==r?void 0:r.type)!==void 0&&"string"==typeof r.type&&(0,Uo.isRight)(t.FieldType.decode(r.type))},HO.hasContentType=n,HO}function HI(){return HN||(HN=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.EmptyContent=t.EmptyLegacy=t.isEmptyContent=t.EmptyContentType=void 0;let n=nf,r=(0,n.__importStar)(Vh),i=Hk();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,Us.pipe)(a.decode(r),Ui.either.map(()=>({type:n,__TYPE__:t.EmptyContentType}))),()=>null);t.EmptyLegacy=u,t.EmptyContent=r.strict({type:r.string,__TYPE__:r.literal(t.EmptyContentType)})}(Hw)),Hw}var HC={},HM={};Object.defineProperty(HM,"__esModule",{value:!0}),HM.defaultCtx=HM.getFieldCtx=HM.LegacyContentCtx=HM.FieldOrSliceType=void 0;let HR=nf,HE=(0,HR.__importStar)(Vh);HM.FieldOrSliceType=HE.union([Hu.FieldType,Hu.SlicesTypes]);class Hj{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)}}HM.LegacyContentCtx=Hj,HM.getFieldCtx=function(t,n,r){return new Hj(t,[...n.fieldPath,n.fieldKey,...r||[]],n.allTypes)},HM.defaultCtx=function(t,n=new Map){return new Hj(t,[],n)};var HN,HA,HP={},HL={};function HD(){return HA||(HA=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanContentDefaultValue=t.BooleanContent=t.BooleanLegacy=t.isBooleanContent=t.BooleanContentType=void 0;let n=nf,r=(0,n.__importStar)(Vh),i=Hk();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,Us.pipe)(r.boolean.decode(n),Ui.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}(HL)),HL}var HF,HW={};function HU(){return HF||(HF=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.EmbedContent=t.EmbedLegacy=t.EmbedContentLegacy=t.isEmbedContent=t.EmbedContentType=void 0;let n=nf,r=(0,n.__importStar)(Vh),i=q6(),o=Hk();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,Us.pipe)(t.EmbedContentLegacy.decode(n),Ui.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})])}(HW)),HW}var Hz={},HB={},HV={};Object.defineProperty(HV,"__esModule",{value:!0});let H$=nf,Hq=(0,H$.__importStar)(Vh);HV.default=new Hq.Type("TrimmedString",Hq.string.is,(t,n)=>(0,VT.pipe)(Hq.string.validate(t,n),(0,qO.chain)(t=>Hq.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 HK={};function HH(){return HZ||(HZ=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ColorContent=t.ColorLegacy=t.isColorContent=void 0;let n=nf,r=(0,n.__importStar)(Vh),i=(0,n.__importDefault)(HV),o=Hk(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===HK.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Color"===t.type;t.isColorContent=a;let u=n=>new r.Type("ColorLegacy",t.isColorContent,n=>(0,Us.pipe)(i.default.decode(n),Ui.either.map(n=>t.ColorContent.encode({value:n,type:Hu.ColorFieldType,__TYPE__:HK.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:Hu.ColorFieldType}}));t.ColorLegacy=u,t.ColorContent=r.strict({type:r.literal(Hu.ColorFieldType),value:i.default,__TYPE__:r.literal(HK.FieldContentType)})}(HB)),HB}Object.defineProperty(HK,"__esModule",{value:!0}),HK.FieldContentType=void 0,HK.FieldContentType="FieldContent";var HZ,HG,HY={};function HJ(){return HG||(HG=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DateContent=t.DateLegacy=t.isDateContent=void 0;let n=nf,r=(0,n.__importStar)(Vh),i=(0,n.__importDefault)(HV),o=Hk(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===HK.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Date"===t.type;t.isDateContent=a;let u=n=>new r.Type("DateLegacy",t.isDateContent,n=>(0,Us.pipe)(i.default.decode(n),Ui.either.map(n=>t.DateContent.encode({value:n,type:Hu.DateFieldType,__TYPE__:HK.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:Hu.DateFieldType}}));t.DateLegacy=u,t.DateContent=r.strict({type:r.literal(Hu.DateFieldType),value:i.default,__TYPE__:r.literal(HK.FieldContentType)})}(HY)),HY}var HQ,HX={};function H0(){return HQ||(HQ=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.NumberContent=t.NumberLegacy=t.isNumberContent=void 0;let n=nf,r=(0,n.__importStar)(Vh),i=(0,n.__importDefault)(HV),o=Hk(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===HK.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Number"===t.type;t.isNumberContent=a;let u=n=>new r.Type("NumberLegacy",t.isNumberContent,n=>(0,Us.pipe)(i.default.decode(n),Ui.either.map(n=>t.NumberContent.encode({value:n,type:Hu.NumberFieldType,__TYPE__:HK.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:Hu.NumberFieldType}}));t.NumberLegacy=u,t.NumberContent=r.strict({type:r.literal(Hu.NumberFieldType),value:i.default,__TYPE__:r.literal(HK.FieldContentType)})}(HX)),HX}var H1,H2={};function H3(){return H1||(H1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RangeContent=t.RangeLegacy=t.isRangeContent=void 0;let n=nf,r=(0,n.__importStar)(Vh),i=(0,n.__importDefault)(HV),o=Hk(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===HK.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Range"===t.type;t.isRangeContent=a;let u=n=>new r.Type("RangeLegacy",t.isRangeContent,n=>(0,Us.pipe)(i.default.decode(n),Ui.either.map(n=>t.RangeContent.encode({value:n,type:Hu.RangeFieldType,__TYPE__:HK.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:Hu.RangeFieldType}}));t.RangeLegacy=u,t.RangeContent=r.strict({type:r.literal(Hu.RangeFieldType),value:i.default,__TYPE__:r.literal(HK.FieldContentType)})}(H2)),H2}var H4,H5={};function H9(){return H4||(H4=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SelectContentDefaultValue=t.SelectContent=t.SelectLegacy=t.isSelectContent=void 0;let n=nf,r=(0,n.__importStar)(Vh),i=(0,n.__importDefault)(HV),o=Hk(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===HK.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Select"===t.type;t.isSelectContent=a;let u=n=>new r.Type("SelectLegacy",t.isSelectContent,n=>(0,Us.pipe)(i.default.decode(n),Ui.either.map(n=>t.SelectContent.encode({value:n,type:Hu.SelectFieldType,__TYPE__:HK.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:Hu.SelectFieldType}}));t.SelectLegacy=u,t.SelectContent=r.strict({type:r.literal(Hu.SelectFieldType),value:i.default,__TYPE__:r.literal(HK.FieldContentType)});let s=t=>{var n;return!(null===(n=t.config)||void 0===n)&&n.default_value?{__TYPE__:HK.FieldContentType,type:Hu.SelectFieldType,value:t.config.default_value||""}:void 0};t.SelectContentDefaultValue=s}(H5)),H5}var H6,H8={};function H7(){return H6||(H6=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TextContent=t.TextLegacy=t.isTextContent=void 0;let n=nf,r=(0,n.__importStar)(Vh),i=(0,n.__importDefault)(HV),o=Hk(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===HK.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Text"===t.type;t.isTextContent=a;let u=n=>new r.Type("TextLegacy",t.isTextContent,n=>(0,Us.pipe)(i.default.decode(n),Ui.either.map(n=>t.TextContent.encode({value:n,type:Hu.TextFieldType,__TYPE__:HK.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:Hu.TextFieldType}}));t.TextLegacy=u,t.TextContent=r.strict({type:r.literal(Hu.TextFieldType),value:i.default,__TYPE__:r.literal(HK.FieldContentType)})}(H8)),H8}var Ze,Zt={};function Zn(){return Ze||(Ze=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TimestampContent=t.TimestampLegacy=t.isTimestampContent=void 0;let n=nf,r=(0,n.__importStar)(Vh),i=(0,n.__importDefault)(HV),o=Hk(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===HK.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Timestamp"===t.type;t.isTimestampContent=a;let u=n=>new r.Type("TimestampLegacy",t.isTimestampContent,n=>(0,Us.pipe)(i.default.decode(n),Ui.either.map(n=>t.TimestampContent.encode({value:n,type:Hu.TimestampFieldType,__TYPE__:HK.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:Hu.TimestampFieldType}}));t.TimestampLegacy=u,t.TimestampContent=r.strict({type:r.literal(Hu.TimestampFieldType),value:i.default,__TYPE__:r.literal(HK.FieldContentType)})}(Zt)),Zt}function Zr(){return Zi||(Zi=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.FieldContent=t.FieldType=void 0;let n=nf,r=(0,n.__importStar)(Vh),i=HH(),o=HJ(),a=H0(),u=H3(),s=H9(),c=H7(),l=Zn();t.FieldType=r.keyof({Text:null,Date:null,Timestamp:null,Color:null,Number:null,Range:null,Select:null}),t.FieldContent=r.union([o.DateContent,i.ColorContent,a.NumberContent,u.RangeContent,s.SelectContent,c.TextContent,l.TimestampContent]),(0,n.__exportStar)(HH(),t),(0,n.__exportStar)(HK,t),(0,n.__exportStar)(HJ(),t),(0,n.__exportStar)(H0(),t),(0,n.__exportStar)(H3(),t),(0,n.__exportStar)(H9(),t),(0,n.__exportStar)(H7(),t),(0,n.__exportStar)(Zn(),t)}(Hz)),Hz}var Zi,Zo,Za={};function Zu(){return Zo||(Zo=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.GeoPointContent=t.GeoPointLegacy=t.isGeoPointContent=t.GeoPointContentType=void 0;let n=nf,r=(0,n.__importStar)(Vh),i=Hk();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,VT.pipe)(a.decode(n),Ui.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)})])}(Za)),Za}var Zs,Zc={};function Zl(){return Zs||(Zs=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ImageContent=t.ImageLegacy=t.ImageContentView=t.isImageContent=t.ImageContentType=void 0;let n=nf,r=(0,n.__importStar)(Vh),i=q6(),o=Hk();t.ImageContentType="ImageContent";let a=n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.ImageContentType;t.isImageContent=a;let u=r.exact(r.type({id:r.string,url:r.string,width:r.number,height:r.number}));t.ImageContentView=r.exact(r.intersection([r.type({origin:u,width:r.number,height:r.number,edit:r.type({zoom:r.number,crop:r.type({x:r.number,y:r.number}),background:r.string})}),r.partial({url:r.string,credits:i.NonEmptyStringOrNull,alt:i.NonEmptyStringOrNull,provider:i.StringOrNull})]));let s=r.intersection([t.ImageContentView,r.partial({thumbnails:r.record(r.string,t.ImageContentView)})]),c=n=>new r.Type("ImageLegacy",t.isImageContent,n=>(0,Us.pipe)(s.decode(n),Ui.either.map(n=>t.ImageContent.encode({...n,__TYPE__:t.ImageContentType}))),t=>({content:(0,K8.withOptionals)({edit:t.edit,height:t.height,origin:t.origin,width:t.width},[["alt",t.alt],["credits",t.credits],["provider",t.provider],["thumbnails",t.thumbnails],["url",t.url]]),types:{[n.keyOfType]:"Image"}}));t.ImageLegacy=c,t.ImageContent=r.intersection([s,r.strict({__TYPE__:r.literal(t.ImageContentType)})])}(Zc)),Zc}var Zf,Zd={};function Zp(){return Zf||(Zf=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.IntegrationFieldContent=t.IntegrationFieldLegacy=t.isIntegrationFieldContent=t.IntegrationFieldContentType=void 0;let n=nf,r=(0,n.__importStar)(Vh),i=Hk();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,Us.pipe)(r.string.decode(n),Ui.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})}(Zd)),Zd}var Zh,Zm={};function Zg(){return Zh||(Zh=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=nf,r=(0,n.__importStar)(Vh),i=q6(),o=Hk();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,Us.pipe)(a.decode(n),Ui.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,qe.withFallback)(r.string,"0")}),r.partial({date:(0,VS.nullable)(r.string)})])),c=new r.Type("FileLink",n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.FileLinkType,n=>(0,Us.pipe)(s.decode(n),Ui.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,qe.withFallback)(r.string,"0")})]))]),t.DocumentLinkType="DocumentLink";let l=r.strict({id:i.NonEmptyString}),f=new r.Type("DocumentLink",n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.DocumentLinkType,n=>(0,Us.pipe)(l.decode(n),Ui.either.map(n=>t.DocumentLinkContent.encode({...n,__TYPE__:t.DocumentLinkType}))),t=>l.encode(t));t.DocumentLinkContent=r.intersection([r.strict({__TYPE__:r.literal(t.DocumentLinkType)}),l]),t.ExternalLinkType="ExternalLink";let d=r.exact(r.intersection([r.type({url:r.string}),r.partial({kind:r.literal("web"),target:i.StringOrNull,preview:(0,VS.nullable)(r.partial({title:r.string}))})])),p=new r.Type("ExternalLink",n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.ExternalLinkType,n=>(0,Us.pipe)(d.decode(n),Ui.either.map(n=>t.ExternalLinkContent.encode({...n,__TYPE__:t.ExternalLinkType}))),t=>d.encode(t));t.ExternalLinkContent=r.intersection([r.strict({__TYPE__:r.literal(t.ExternalLinkType)}),d]),t.LinkContentType="LinkContent";let h=n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.LinkContentType;t.isLinkContent=h,t.LinkLegacy=r.union([u,c,f,p]);let m=n=>new r.Type("LinkLegacy",t.isLinkContent,n=>(0,Us.pipe)(t.LinkLegacy.decode(n),Ui.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})}(Zm)),Zm}var Zy,Zv={},Zb={},Zx={};function Z_(){return Zy||(Zy=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=nf,r=(0,n.__importStar)(Vh),i=q6(),o=HU(),a=Zl(),u=Zg(),s=t=>r.strict({data:t,start:r.number,end:r.number,type:r.literal(KL.RichTextNodeType.hyperlink)}),c=r.strict({data:(0,qe.withFallback)(r.string,""),start:r.number,end:r.number,type:r.literal("label")}),l=r.strict({start:r.number,end:r.number,type:r.keyof({[KL.RichTextNodeType.strong]:null,[KL.RichTextNodeType.em]:null,"list-item":null})});t.Span=r.union([s(u.Link),c,l]),t.SpanLegacy=r.union([s(u.LinkLegacy),c,l]);let f=t=>new r.Type("ValidatedSpans",n=>Array.isArray(n)&&n.every(t.is),(n,i)=>{if(!Array.isArray(n))return r.failure(n,i);{let o=n.reduce((n,r)=>{let i=t.decode(r);return(0,Uo.isLeft)(i)?n:[...n,i.right]},[]).sort((t,n)=>t.start-n.start);return r.success(o)}},n=>n.reduce((n,r)=>{let i=t.encode(r);return[...n,i]},[]));t.ValidatedSpans=f;let d=t=>r.exact(r.intersection([r.type({type:r.literal(KL.RichTextNodeType.image),data:r.intersection([a.ImageContentView,r.partial({linkTo:(0,VS.nullable)(t)})])}),r.partial({label:i.StringOrNull,direction:i.StringOrNull})]));t.ImageBlock=d(u.Link);let p=d(u.LinkLegacy);t.checkImageBlock=function(t){return t.type===KL.RichTextNodeType.image};let h=r.exact(r.intersection([r.type({type:r.literal(KL.RichTextNodeType.embed),data:r.unknown}),r.partial({label:i.StringOrNull,direction:i.StringOrNull})])),m=new r.Type("EmbedBlockLegacy",t=>"embed"===t.type,n=>(0,Us.pipe)(h.decode(n),Ui.either.chain(t=>Ui.either.map(n=>[t,n])(o.EmbedContentLegacy.decode(t.data))),Ui.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(KL.RichTextNodeType.embed),data:o.EmbedContent}),r.partial({label:i.StringOrNull,direction:i.StringOrNull})])),t.checkEmbedBlock=function(t){return t.type===KL.RichTextNodeType.embed};let g=n=>r.exact(r.intersection([r.type({type:(0,VS.refineType)(KL.RichTextNodeTypeCodec,`string which isn't ${KL.RichTextNodeType.image} ${KL.RichTextNodeType.embed}`,t=>t!==KL.RichTextNodeType.image&&t!==KL.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])}(Zx)),Zx}function ZS(){return ZT||(ZT=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RichTextLegacy=t.RichTextContent=t.isRichTextContent=t.RichTextContentType=void 0;let n=nf,r=(0,n.__importStar)(Vh),i=Hk(),o=Z_();t.RichTextContentType="StructuredTextContent";let a=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.RichTextContentType;t.isRichTextContent=a;let u=r.array(o.BlockLegacy);t.RichTextContent=r.strict({__TYPE__:r.literal(t.RichTextContentType),value:r.array(o.Block)}),(0,n.__exportStar)(Z_(),t);let s=n=>new r.Type("RichTextLegacy",t.isRichTextContent,n=>(0,Us.pipe)(u.decode(n),Ui.either.map(n=>({value:n,__TYPE__:t.RichTextContentType}))),t=>({content:u.encode(t.value),types:{[n.keyOfType]:"StructuredText"}}));t.RichTextLegacy=s}(Zb)),Zb}var ZT,Zw,ZO={};function Zk(){return Zw||(Zw=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SeparatorContent=t.SeparatorLegacy=t.isSeparatorContent=t.SeparatorContentType=void 0;let n=(0,nf.__importStar)(Vh),r=Hk();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)})}(ZO)),ZO}function ZI(){return ZM||(ZM=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nf;(0,n.__exportStar)(HD(),t),(0,n.__exportStar)(HU(),t),(0,n.__exportStar)(Zr(),t),(0,n.__exportStar)(Zu(),t),(0,n.__exportStar)(Zl(),t),(0,n.__exportStar)(Zp(),t),(0,n.__exportStar)(Zg(),t),(0,n.__exportStar)(function(){if(ZC)return Zv;ZC=1,Object.defineProperty(Zv,"__esModule",{value:!0}),Zv.NestableLegacy=Zv.isNestableContent=Zv.NestableContentDefaultValue=Zv.NestableContent=void 0;let t=nf,n=(0,t.__importStar)(Vh),r=HI(),i=HD(),o=HU(),a=Zr(),u=Zu(),s=Zl(),c=Zp(),l=Zg(),f=ZS(),d=Zk();Zv.NestableContent=n.union([r.EmptyContent,i.BooleanContent,o.EmbedContent,a.TextContent,a.TimestampContent,a.SelectContent,a.RangeContent,a.NumberContent,a.DateContent,a.ColorContent,u.GeoPointContent,s.ImageContent,c.IntegrationFieldContent,l.LinkContent,f.RichTextContent,d.SeparatorContent]);let p=t=>{switch(t.type){case"Boolean":return(0,i.BooleanContentDefaultValue)(t);case"Select":return(0,a.SelectContentDefaultValue)(t);default:return}};Zv.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,f.isRichTextContent)(t)||(0,i.isBooleanContent)(t)||(0,o.isEmbedContent)(t)||(0,s.isImageContent)(t)||(0,c.isIntegrationFieldContent)(t)||(0,l.isLinkContent)(t)||(0,d.isSeparatorContent)(t)||(0,r.isEmptyContent)(t);Zv.isNestableContent=h;let m=t=>({decode(n){if(!t.fieldType)return;let p=(0,r.EmptyLegacy)(t.fieldType).decode(n);if((0,Uo.isRight)(p))return p;let h=(()=>{switch(t.fieldType){case"Text":return(0,a.TextLegacy)(t);case"Color":return(0,a.ColorLegacy)(t);case"Date":return(0,a.DateLegacy)(t);case"Timestamp":return(0,a.TimestampLegacy)(t);case"Number":return(0,a.NumberLegacy)(t);case"Range":return(0,a.RangeLegacy)(t);case"Select":return(0,a.SelectLegacy)(t);case"GeoPoint":return(0,u.GeoPointLegacy)(t);case"StructuredText":return(0,f.RichTextLegacy)(t);case"Boolean":return(0,i.BooleanLegacy)(t);case"Embed":return(0,o.EmbedLegacy)(t);case"Image":return(0,s.ImageLegacy)(t);case"IntegrationFields":return(0,c.IntegrationFieldLegacy)(t);case"Link":return(0,l.LinkContentLegacy)(t);case"Separator":return(0,d.SeparatorLegacy)(t);default:return}})();if(h)return h.decode(n)},encode(n){switch(n.__TYPE__){case HK.FieldContentType:return"Text"===n.type?(0,a.TextLegacy)(t).encode(n):"Color"===n.type?(0,a.ColorLegacy)(t).encode(n):"Range"===n.type?(0,a.RangeLegacy)(t).encode(n):"Date"===n.type?(0,a.DateLegacy)(t).encode(n):"Number"===n.type?(0,a.NumberLegacy)(t).encode(n):"Timestamp"===n.type?(0,a.TimestampLegacy)(t).encode(n):"Select"===n.type?(0,a.SelectLegacy)(t).encode(n):void 0;case u.GeoPointContentType:return(0,u.GeoPointLegacy)(t).encode(n);case f.RichTextContentType:return(0,f.RichTextLegacy)(t).encode(n);case o.EmbedContentType:return(0,o.EmbedLegacy)(t).encode(n);case i.BooleanContentType:return(0,i.BooleanLegacy)(t).encode(n);case s.ImageContentType:return(0,s.ImageLegacy)(t).encode(n);case c.IntegrationFieldContentType:return(0,c.IntegrationFieldLegacy)(t).encode(n);case l.LinkContentType:return(0,l.LinkContentLegacy)(t).encode(n);case d.SeparatorContentType:return(0,d.SeparatorLegacy)(t).encode(n);default:return}}});return Zv.NestableLegacy=m,Zv}(),t),(0,n.__exportStar)(ZS(),t),(0,n.__exportStar)(Zk(),t)}(HP)),HP}var ZC,ZM,ZR,ZE={};function Zj(){if(ZR)return ZE;ZR=1,Object.defineProperty(ZE,"__esModule",{value:!0}),ZE.repeatableContentWithDefaultNestableContentValues=ZE.withDefaultNestableContentValues=void 0;let t=ZI();return ZE.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)},ZE.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))},ZE}function ZN(){return ZA||(ZA=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=nf,r=(0,n.__importStar)(Vh),i=Hk(),o=ZI(),a=Zj();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,Us.pipe)(u.decode(r),Ui.either.map(r=>({value:Object.entries(r).reduce((t,[r,i])=>{let a=(0,HM.getFieldCtx)(r,n),u=(0,o.NestableLegacy)(a).decode(i);return!u||(0,Uo.isLeft)(u)?t:[...t,[r,u.right]]},[]),__TYPE__:t.GroupItemContentType}))),t=>t.value.reduce((t,[r,i])=>{let a=(0,HM.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 c=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,Us.pipe)(i.decode(n),Ui.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=c,t.GroupContentType="GroupContentType";let l=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.GroupContentType;function f({path:t,model:n,content:r}){return i=>r.map((r,a)=>{let u=t.concat([{key:a.toString(),type:"GroupItem"}]),s=r.value.reduce((t,[r,a])=>{let s=null==n?void 0:n[r],c=i({path:u.concat([{key:r,type:"Widget"}]),key:r,apiId:r,model:s,content:a});return c&&(0,o.isNestableContent)(c)?t.concat([[r,c]]):t},[]);return{__TYPE__:r.__TYPE__,value:s}})}t.isGroupContent=l,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=f({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=f}(HC)),HC}var ZA,ZP,ZL={},ZD={},ZF={},ZW={};function ZU(){if(ZP)return ZW;ZP=1,Object.defineProperty(ZW,"__esModule",{value:!0}),ZW.RepeatableWidgets=ZW.RepeatableWidgetsLegacy=void 0;let t=(0,nf.__importStar)(Vh),n=ZN(),r=ZI(),i=r=>t.array((0,n.GroupItemLegacy)(r));ZW.RepeatableWidgetsLegacy=i;let o=t.tuple([t.string,r.NestableContent]),a=t.strict({__TYPE__:t.literal(n.GroupItemContentType),value:t.array(o)});return ZW.RepeatableWidgets=t.array(a),ZW}function Zz(){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=nf,r=(0,n.__importStar)(Vh),i=Hk(),o=ZN(),a=ZI(),u=Zj(),s=ZU();t.CompositeSliceContentType="CompositeSliceContent";let c=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.CompositeSliceContentType;t.isCompositeSliceContent=c;let l=r.exact(r.partial({repeat:r.array(r.unknown),"non-repeat":r.UnknownRecord})),f=n=>new r.Type("CompositeSliceLegacy",t.isCompositeSliceContent,r=>(0,Us.pipe)(l.decode(r),Ui.either.map(r=>{let i=(()=>{let t=(0,HM.getFieldCtx)("repeat",n),i=(0,s.RepeatableWidgetsLegacy)(t).decode(r.repeat);if(!(!i||(0,Uo.isLeft)(i)))return i.right})()||[];return{nonRepeat:Object.entries(r["non-repeat"]||{}).reduce((t,[r,i])=>{let o=(0,HM.getFieldCtx)(r,n,["non-repeat"]);if(!o)return t;let u=(0,a.NestableLegacy)(o).decode(i);return!u||(0,Uo.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,HM.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,HM.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=f,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,c)=>{let l=Object.entries(u.widget.nonRepeat).reduce((o,[u,c])=>{var l,f,d;let p=(null==i?void 0:i.type)==="SharedSlice"?null===(f=null===(l=null==i?void 0:i.fields)||void 0===l?void 0:l.primary)||void 0===f?void 0:f[u]:null===(d=null==i?void 0:i["non-repeat"])||void 0===d?void 0:d[u],h=s({path:t.concat([{key:"non-repeat",type:"primary"},{key:u,type:"Widget"}]),key:u,apiId:r,model:p,content:c});return h?(0,a.isNestableContent)(h)?{...o,[u]:h}:(console.warn(`Warn: Non nestable content with key [${u}] detected in a composite slice [${r}] with key [${n}]`),o):o},{}),f=(0,o.traverseGroupItemsContent)({path:t.concat([{key:"repeat",type:"items"}]),model:(null==i?void 0:i.type)==="SharedSlice"?null==i?void 0:i.fields.items:null==i?void 0:i.repeat,content:u.widget.repeat})(s);return c({key:n,apiId:r,path:t,model:i,content:{...u,widget:{__TYPE__:"CompositeSliceContent",repeat:f,nonRepeat:l}}})}},t.migrateCompositeSlice=function(t,n){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)},[])}),[])}}}}(ZF)),ZF}var ZB,ZV,Z$={};function Zq(){return ZV||(ZV=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=nf,r=(0,n.__importStar)(Vh),i=Hk(),o=ZN(),a=ZI(),u=Zj(),s=ZU();t.SharedSliceContentType="SharedSliceContent";let c=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.SharedSliceContentType;t.isSharedSliceContent=c;let l=r.exact(r.type({variation:r.string,items:(0,qe.withFallback)(r.array(r.unknown),[]),primary:(0,qe.withFallback)(r.UnknownRecord,{})})),f=n=>new r.Type("SharedSliceLegacy",t.isSharedSliceContent,r=>(0,Us.pipe)(l.decode(r),Ui.either.map(r=>{let i=(()=>{let t=(0,HM.getFieldCtx)("items",n,["variations",r.variation]),i=(0,s.RepeatableWidgetsLegacy)(t).decode(r.items);if(!(!i||(0,Uo.isLeft)(i)))return i.right})()||[],o=Object.entries(r.primary).reduce((t,[i,o])=>{let u=(0,HM.getFieldCtx)(i,n,["variations",r.variation,"primary"]),s=(0,a.NestableLegacy)(u).decode(o);return!s||(0,Uo.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,HM.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,HM.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=f,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:{},c=(0,u.withDefaultNestableContentValues)(a,n.primary),l=(0,u.repeatableContentWithDefaultNestableContentValues)(s,n.items);return{...n,primary:c,items:l}},t.traverseSharedSliceContent=function({path:t,sliceKey:n,sliceName:r,model:i,content:u}){return(s,c)=>{let l=Object.entries(u.widget.primary).reduce((o,[u,c])=>{var l,f;let d=null===(f=null===(l=null==i?void 0:i.fields)||void 0===l?void 0:l.primary)||void 0===f?void 0:f[u],p=s({path:t.concat([{key:"primary",type:"primary"},{key:u,type:"Widget"}]),key:u,apiId:r,model:d,content:c});return p?(0,a.isNestableContent)(p)?{...o,[u]:p}:(console.warn(`Warn: Non nestable content with key [${u}] detected in a shared slice [${r}] with key [${n}]`),o):o},{}),f=(0,o.traverseGroupItemsContent)({path:t.concat([{key:"items",type:"items"}]),model:null==i?void 0:i.fields.items,content:u.widget.items})(s);return c({key:n,apiId:r,path:t,model:i,content:{...u,widget:{__TYPE__:"SharedSliceContent",variation:u.widget.variation,primary:l,items:f}}})}}}(Z$)),Z$}var ZK,ZH={};function ZZ(){if(ZK)return ZH;ZK=1,Object.defineProperty(ZH,"__esModule",{value:!0}),ZH.migrateSimpleSlice=ZH.traverseSimpleSliceContent=ZH.SimpleSliceLegacy=ZH.isSimpleSliceContent=ZH.SimpleSliceContent=void 0;let t=(0,nf.__importStar)(Vh),n=ZN(),r=ZI();ZH.SimpleSliceContent=t.union([r.NestableContent,n.GroupContent]);let i=t=>(0,r.isNestableContent)(t)||(0,n.isGroupContent)(t);ZH.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 ZH.SimpleSliceLegacy=o,ZH.traverseSimpleSliceContent=function({path:t,sliceKey:r,sliceName:i,model:o,content:a}){return(u,s)=>{var c;if((0,n.isGroupContent)(a.widget)){let l=(0,n.traverseGroupContent)({path:t,key:a.key,apiId:a.name,model:(null==o?void 0:o.type)==="Group"?o:(null==o?void 0:o.type)==="SharedSlice"?{type:"Group",config:{fields:o.fields.items||{}}}:void 0,content:a.widget})(u);return l&&s({key:a.key,apiId:a.name,path:t,model:o,content:{...a,widget:l}})}let f=u({key:a.key,apiId:a.name,path:t,model:(null==o?void 0:o.type)==="SharedSlice"?null===(c=o.fields.primary)||void 0===c?void 0:c[a.name]:(null==o?void 0:o.type)!=="Group"?o:void 0,content:a.widget});return f&&s({key:r,apiId:i,path:t,model:o,content:{...a,widget:f}})}},ZH.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:[]}}},ZH}function ZG(){return ZY||(ZY=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SliceContent=t.SliceLegacy=void 0;let n=nf,r=(0,n.__importStar)(Vh),i=Zz(),o=Zq(),a=ZZ(),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)(Zz(),t),(0,n.__exportStar)(Zq(),t),(0,n.__exportStar)(ZZ(),t)}(ZD)),ZD}var ZY,ZJ,ZQ={};function ZX(){if(ZJ)return ZQ;ZJ=1,Object.defineProperty(ZQ,"__esModule",{value:!0}),ZQ.migrateSliceItem=ZQ.SlicesItemLegacy=ZQ.sliceItemContentWithDefaultValues=ZQ.isSimpleSliceItemContent=ZQ.isCompositeSliceItemContent=ZQ.isSharedSliceItemContent=ZQ.SliceItemContent=void 0;let t=nf,n=(0,t.__importStar)(Vh),r=ZN(),i=ZI(),o=Zj(),a=ZG(),u=Zz(),s=Zq(),c=ZZ();function l(t){return(0,u.isCompositeSliceContent)(t.widget)}function f(t){return(0,r.isGroupContent)(t.widget)||(0,i.isNestableContent)(t.widget)}ZQ.SliceItemContent=n.type({key:n.string,name:n.string,maybeLabel:n.union([n.string,n.undefined]),widget:a.SliceContent}),ZQ.isSharedSliceItemContent=function(t){return(0,s.isSharedSliceContent)(t.widget)},ZQ.isCompositeSliceItemContent=l,ZQ.isSimpleSliceItemContent=f,ZQ.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 c=(0,o.repeatableContentWithDefaultNestableContentValues)(t.config.fields,n.value);return{...n,value:c}}return n};let d=n.exact(n.intersection([n.type({key:n.string,value:n.unknown}),n.partial({label:(0,VS.nullable)(n.string)})])),p=t=>new n.Type("SlicesItemLegacy",t=>((0,s.isSharedSliceContent)(t.widget),(0,u.isCompositeSliceContent)(t.widget),(0,c.isSimpleSliceContent)(t.widget)),(r,i)=>(0,Us.pipe)(d.decode(r),Ui.either.chain(o=>{var u;let s=o.key.indexOf("$"),c=o.key.substring(0,s>0?s:void 0),l=(0,HM.getFieldCtx)(c,t),f=(0,a.SliceLegacy)(l).decode(o.value);return!f||(0,Uo.isLeft)(f)?n.failure(r,i):n.success({key:o.key,name:c,maybeLabel:null!==(u=o.label)&&void 0!==u?u:void 0,widget:f.right})})),n=>{let r=(0,HM.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)||{}}});ZQ.SlicesItemLegacy=p;let h=({model:t,content:n})=>l(n)&&(null==t?void 0:t.type)==="SharedSlice"?(0,u.migrateCompositeSlice)(t,n):f(n)&&(null==t?void 0:t.type)==="SharedSlice"?(0,c.migrateSimpleSlice)(t,n):n;return ZQ.migrateSliceItem=h,ZQ}var Z0,Z1={};function Z2(){return Z3||(Z3=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nf;(0,n.__exportStar)(ZG(),t),(0,n.__exportStar)(ZX(),t),(0,n.__exportStar)((Z0||(Z0=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=nf,r=(0,n.__importStar)(Vh),i=Hk(),o=Zz(),a=Zq(),u=ZZ(),s=ZX();t.SlicesContentType="SliceContentType";let c=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.SlicesContentType;t.isSlicesContent=c;let l=n=>{let i=r.array((0,s.SlicesItemLegacy)(n));return new r.Type("SlicesLegacy",t.isSlicesContent,n=>(0,Us.pipe)(i.decode(n),Ui.either.map(n=>({__TYPE__:t.SlicesContentType,value:n}))),t=>{let r=i.encode(t.value);return{content:r.map(t=>t.content),types:r.reduce((t,n)=>({...t,...n.types}),{[n.keyOfType]:"Slices"})}})};t.SlicesLegacy=l,t.SlicesContent=r.type({__TYPE__:r.literal(t.SlicesContentType),value:r.array(s.SliceItemContent)}),t.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:c=({content:t})=>t,transformSlice:l=({content:t})=>t})=>{let f=i.value.reduce((n,i)=>{let f=r&&function(t,n,r){var i,o;let a=null===(o=null===(i=null==n?void 0:n.config)||void 0===i?void 0:i.choices)||void 0===o?void 0:o[r.name];return(()=>{if((0,s.isSharedSliceItemContent)(r)&&a&&(0,qu.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=Vm.ContentPath.append(Vm.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,qu.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,qu.isCompositeSlice)(a))return{type:"Slice","non-repeat":a["non-repeat"]||{},repeat:a.repeat||{}};if((0,qu.isLegacySlice)(a))return a}})()}(t,r,i),d=(0,s.isSharedSliceItemContent)(i)?(0,a.traverseSharedSliceContent)({path:t.concat({key:i.key,type:"SharedSlice"}),sliceKey:i.key,sliceName:i.name,model:(null==f?void 0:f.type)==="SharedSlice"?f:void 0,content:i})(c,l):(0,s.isCompositeSliceItemContent)(i)?(0,o.traverseCompositeSliceContent)({path:t.concat({key:i.key,type:"Slice"}),sliceKey:i.key,sliceName:i.name,model:(null==f?void 0:f.type)==="Slice"||(null==f?void 0:f.type)==="SharedSlice"?f:void 0,content:i})(c,l):(0,s.isSimpleSliceItemContent)(i)?(0,u.traverseSimpleSliceContent)({path:t.concat({key:i.key,type:"LegacySlice"}),sliceKey:i.key,sliceName:i.name,model:f&&(null==f?void 0:f.type)!=="Slice"?f:void 0,content:i})(c,l):void 0;return d?n.concat(d):n},[]);return c({path:t,key:n,apiId:n,model:r,content:{__TYPE__:i.__TYPE__,value:f}})}}}(Z1)),Z1),t)}(ZL)),ZL}var Z3,Z4,Z5={};function Z9(){return Z4||(Z4=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.UIDContent=t.UIDLegacy=t.isUIDContent=t.UIDContentType=void 0;let n=nf,r=(0,n.__importStar)(Vh),i=Hk();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,Us.pipe)(r.string.decode(n),Ui.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})}(Z5)),Z5}var Z6,Z8={};function Z7(){return i||(i=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nf;(0,n.__exportStar)(HI(),t),(0,n.__exportStar)(ZN(),t),(0,n.__exportStar)(ZI(),t),(0,n.__exportStar)(Z2(),t),(0,n.__exportStar)(Z9(),t),(0,n.__exportStar)(function(){if(Z6)return Z8;Z6=1,Object.defineProperty(Z8,"__esModule",{value:!0}),Z8.WidgetLegacy=Z8.isWidgetContent=Z8.WidgetContent=void 0;let t=(0,nf.__importStar)(Vh),n=ZN(),r=ZI(),i=Z2(),o=Z9();Z8.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);Z8.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 Z8.WidgetLegacy=u,Z8}(),t)}(HT)),HT}Object.defineProperty(nd,"__esModule",{value:!0}),nd.migrateDocument=nd.collectWidgets=nd.traverseDocument=nd.fillDocumentWithDefaultValues=nd.DocumentLegacy=nd.Document=void 0;let Ge=nf,Gt=(0,Ge.__importStar)(Vh),Gn=Z7();nd.Document=Gt.record(Vg.WidgetKey,Gn.WidgetContent);let Gr=Gt.record(Vg.WidgetKey,Gt.unknown),Gi=t=>new Gt.Type("Document",t=>!!t&&"object"==typeof t,n=>(0,Us.pipe)(Gr.decode(n),Ui.either.map(n=>Object.entries(n).reduce((n,[r,i])=>{let o=(0,HM.defaultCtx)(r,t),a=(0,Gn.WidgetLegacy)(o).decode(i);return!a||(0,Uo.isLeft)(a)?n:{...n,[r]:a.right}},{}))),n=>Object.entries(n).reduce((n,[r,i])=>{let o=(0,HM.defaultCtx)(r,t),a=(0,Gn.WidgetLegacy)(o).encode(i);return a?{content:{...n.content,[r]:a.content},types:{...n.types,...a.types}}:n},{content:{},types:{}}));function Go(t){let n=Object.entries(t),{types:r,widgets:i}=n.reduce((t,[n,r])=>{if(n.endsWith("_TYPE")){let i=HM.FieldOrSliceType.decode(r);if((0,Uo.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 Ga(t){return{customTypeId:null==t?void 0:t.id,fields:Object.fromEntries((0,qu.flattenSections)(t))}}function Gu({document:t,customType:n}){let r=n&&qu.StaticCustomType.is(n)?Ga(n):n;return({transformWidget:n=({content:t})=>t,transformSlice:i=({content:t})=>t})=>{let o=r&&Object.entries(r.fields).reduce((t,[n,r])=>({...t,[n]:r}),{});return Object.entries(t).reduce((t,[a,u])=>{let s=o&&o[a],c=Vm.ContentPath.make([{key:null==r?void 0:r.customTypeId,type:"CustomType"},{key:a,type:"Widget"}]),l=(()=>{switch(u.__TYPE__){case"SliceContentType":return(0,Gn.traverseSlices)({path:c,key:a,model:(null==s?void 0:s.type)==="Slices"||(null==s?void 0:s.type)==="Choice"?s:void 0,content:u})({transformWidget:n,transformSlice:i});case"GroupContentType":return(0,Gn.traverseGroupContent)({path:c,key:a,apiId:a,model:(null==s?void 0:s.type)==="Group"?s:void 0,content:u})(n);default:return n({path:c,key:a,apiId:a,model:(null==s?void 0:s.type)!=="Group"&&(null==s?void 0:s.type)!=="Slices"&&(null==s?void 0:s.type)!=="Choice"?s:void 0,content:u})}})();return{...t,...l?{[a]:l}:{}}},{})}}function Gs(t,n){let r=qu.StaticCustomType.is(n)?Ga(n):n;return Object.values((0,qu.collectSharedSlices)(r)).some(t=>Boolean(t.legacyPaths))?Gu({document:t,customType:n})({transformSlice:Gn.migrateSliceItem}):t}nd.DocumentLegacy={_codec:Gi,extractMetadata:Go,parse:function(t,n){let r=(0,Us.pipe)(Gt.record(Vg.WidgetKey,Gt.unknown).decode(t),Ui.either.chain(t=>{let{types:n,widgets:r}=Go(t);return Gi(n).decode(r)}));return(0,Uo.isLeft)(r)?void 0:Gs(r.right,n)},encode:function(t){let n=Gi().encode(t);return{...n.content,...n.types}}},nd.fillDocumentWithDefaultValues=function(t,n){let{fields:r}=t&&qu.StaticCustomType.is(t)?Ga(t):t;return Object.entries(r).reduce((t,[r,i])=>{let o=n[r],a=(()=>{switch(i.type){case"Group":return(0,Gn.isGroupContent)(o)?(0,Gn.groupContentWithDefaultValues)(i,o):o;case"Choice":case"Slices":return(0,Gn.isSlicesContent)(o)?(0,Gn.slicesContentWithDefaultValues)(i,o):o;default:return void 0===o&&qu.NestableWidget.is(i)?(0,Gn.NestableContentDefaultValue)(i):o}})();return a?{...t,[r]:a}:t},n)},nd.traverseDocument=Gu,nd.collectWidgets=function(t,n){let r={};return Gu({document:t})({transformWidget({content:t,path:i}){let o=Vm.ContentPath.serialize(i);return n(t,i)&&(r[o]=t),t}}),r},nd.migrateDocument=Gs,function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nf;(0,n.__exportStar)(nd,t),(0,n.__exportStar)(Z7(),t),(0,n.__exportStar)(HM,t)}(nl);let Gc=(0,o.createContext)({update(){}});function Gl(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 Gf(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 Gd(t){var n;let{content:r,field:i,id:o,onContentChange:a,readOnly:s}=t,c=(null==r?void 0:r.value)??(null==(n=i.config)?void 0:n.default_value)??!1;return C.jsxs(u.gN,{children:[C.jsx(u.fw,{name:"toggleOff"}),C.jsx(u.Qy,{htmlFor:o,children:Gl(i)}),C.jsxs(u.JO,{children:[C.jsx(u.xu,{padding:4,alignItems:"center",children:C.jsx(u.xv,{children:Gf(i,c)})}),C.jsx(u.rs,{checked:c,id:o,onCheckedChange(t){var n;s||a((n=t,{__TYPE__:"BooleanContent",value:n}))}})]})]})}function Gp(t){let{id:n,field:r,content:i,onContentChange:o}=t;return C.jsxs(u.gN,{children:[C.jsx(u.fw,{name:"colorLens"}),C.jsx(u.Qy,{id:n,children:Gl(r)}),C.jsx(u.JO,{children:C.jsx(u.xu,{padding:{left:4},alignItems:"center",children:C.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:Gf(r)})})})]})}function Gh(t){let{id:n,readOnly:r,field:i,content:o,onContentChange:a}=t,s=null!=o&&o.value?(0,c._O)(o.value):void 0;return C.jsxs(u.gN,{children:[C.jsx(u.fw,{name:"dateRange"}),C.jsx(u.Qy,{id:n,children:Gl(i)}),C.jsx(u.JO,{children:C.jsx(u.xu,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:C.jsx(u.Wr,{mode:"date","aria-labelledby":n,readOnly: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 Gm(t){this.content=t}Gm.prototype={constructor:Gm,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 Gm(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 Gm(r)},addToStart:function(t,n){return new Gm([t,n].concat(this.remove(t).content))},addToEnd:function(t,n){var r=this.remove(t).content.slice();return r.push(t,n),new Gm(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 Gm(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=Gm.from(t)).size?new Gm(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=Gm.from(t)).size?new Gm(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var n=this;t=Gm.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}},Gm.from=function(t){if(t instanceof Gm)return t;var n=[];if(t)for(var r in t)n.push(r,t[r]);return new Gm(n)};class Gg{constructor(t,n){if(this.content=t,this.size=n||0,null==n)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,n,r,i=0,o){for(let a=0,u=0;u<n;a++){let s=this.content[a],c=u+s.nodeSize;if(c>t&&!1!==r(s,i+u,o||null,a)&&s.content.size){let l=u+1;s.nodesBetween(Math.max(0,t-l),Math.min(s.content.size,n-l),r,i+l)}u=c}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,i){let o="",a=!0;return this.nodesBetween(t,n,(u,s)=>{u.isText?(o+=u.text.slice(Math.max(t,s)-s,n-s),a=!r):u.isLeaf?(i?o+="function"==typeof i?i(u):i:u.type.spec.leafText&&(o+=u.type.spec.leafText(u)),a=!r):!a&&u.isBlock&&(o+=r,a=!0)},0),o}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<t.content.length;o++)i.push(t.content[o]);return new Gg(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 Gg(r,i)}cutByIndex(t,n){return t==n?Gg.empty:0==t&&n==this.content.length?this:new Gg(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 Gg(i,o)}addToStart(t){return new Gg([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new Gg(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let n=this.content[t];if(!n)throw RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];t(i,r,n),r+=i.nodeSize}}findDiffStart(t,n=0){return function t(n,r,i){for(let o=0;;o++){if(o==n.childCount||o==r.childCount)return n.childCount==r.childCount?null:i;let a=n.child(o),u=r.child(o);if(a==u){i+=a.nodeSize;continue}if(!a.sameMarkup(u))return i;if(a.isText&&a.text!=u.text){for(let s=0;a.text[s]==u.text[s];s++)i++;return i}if(a.content.size||u.content.size){let c=t(a.content,u.content,i+1);if(null!=c)return c}i+=a.nodeSize}}(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return function t(n,r,i,o){for(let a=n.childCount,u=r.childCount;;){if(0==a||0==u)return a==u?null:{a:i,b:o};let s=n.child(--a),c=r.child(--u),l=s.nodeSize;if(s==c){i-=l,o-=l;continue}if(!s.sameMarkup(c))return{a:i,b:o};if(s.isText&&s.text!=c.text){let f=0,d=Math.min(s.text.length,c.text.length);for(;f<d&&s.text[s.text.length-f-1]==c.text[c.text.length-f-1];)f++,i--,o--;return{a:i,b:o}}if(s.content.size||c.content.size){let p=t(s.content,c.content,i-1,o-1);if(p)return p}i-=l,o-=l}}(this,t,n,r)}findIndex(t,n=-1){if(0==t)return Gv(0,t);if(t==this.size)return Gv(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?Gv(r+1,o):Gv(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 Gg.empty;if(!Array.isArray(n))throw RangeError("Invalid input for Fragment.fromJSON");return new Gg(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return Gg.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 Gg(n||t,r)}static from(t){if(!t)return Gg.empty;if(t instanceof Gg)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new Gg([t],t.nodeSize);throw RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Gg.empty=new Gg([],0);let Gy={index:0,offset:0};function Gv(t,n){return Gy.index=t,Gy.offset=n,Gy}function Gb(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(!Gb(t[i],n[i]))return!1}else{for(let o in t)if(!(o in n)||!Gb(t[o],n[o]))return!1;for(let a in n)if(!(a in t))return!1}return!0}let Gx=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&&Gb(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}};Gx.none=[];class G_ extends Error{}class GS{constructor(t,n,r){this.content=t,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=function t(n,r,i,o){let{index:a,offset:u}=n.findIndex(r),s=n.maybeChild(a);if(u==r||s.isText)return o&&!o.canReplace(a,a,i)?null:n.cut(0,r).append(i).append(n.cut(r));let c=t(s.content,r-u-1,i);return c&&n.replaceChild(a,s.copy(c))}(this.content,t+this.openStart,n);return r&&new GS(r,this.openStart,this.openEnd)}removeBetween(t,n){return new GS(function t(n,r,i){let{index:o,offset:a}=n.findIndex(r),u=n.maybeChild(o),{index:s,offset:c}=n.findIndex(i);if(a==r||u.isText){if(c!=i&&!n.child(s).isText)throw RangeError("Removing non-flat range");return n.cut(0,r).append(n.cut(i))}if(o!=s)throw RangeError("Removing non-flat range");return n.replaceChild(o,u.copy(t(u.content,r-a-1,i-a-1)))}(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return GS.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 GS(Gg.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 GS(t,r,i)}}function GT(t,n){if(!n.type.compatibleContent(t.type))throw new G_("Cannot join "+n.type.name+" onto "+t.type.name)}function Gw(t,n,r){let i=t.node(r);return GT(i,n.node(r)),i}function GO(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 Gk(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&&(GO(t.nodeAfter,i),a++));for(let s=a;s<u;s++)GO(o.child(s),i);n&&n.depth==r&&n.textOffset&&GO(n.nodeBefore,i)}function GI(t,n){return t.type.checkContent(n),t.copy(n)}function GC(t,n,r){let i=[];return Gk(null,t,r,i),t.depth>r&&GO(GI(Gw(t,n,r+1),GC(t,n,r+1)),i),Gk(n,null,r,i),new Gg(i)}GS.empty=new GS(Gg.empty,0,0);class GM{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 Gx.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 GN(this,t,r);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let a=t;;){let{index:u,offset:s}=a.content.findIndex(o),c=o-s;if(r.push(a,u,i+s),!c||(a=a.child(u)).isText)break;o=c-1,i+=s+1}return new GM(n,r,o)}static resolveCached(t,n){for(let r=0;r<GR.length;r++){let i=GR[r];if(i.pos==n&&i.doc==t)return i}let o=GR[GE]=GM.resolve(t,n);return GE=(GE+1)%Gj,o}}let GR=[],GE=0,Gj=12;class GN{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 GA=Object.create(null),GP=class t{constructor(t,n,r,i=Gx.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||Gg.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&&Gb(this.attrs,n||t.defaultAttrs||GA)&&Gx.sameSet(this.marks,r||Gx.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 GS.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 GS(s,i.depth-a,o.depth-a)}replace(t,n,r){return function(t,n,r){if(r.openStart>t.depth)throw new G_("Inserted content deeper than insertion position");if(t.depth-r.openStart!=n.depth-r.openEnd)throw new G_("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 GI(u,GC(n,r,o));if(i.openStart||i.openEnd||n.depth!=o||r.depth!=o){let{start:c,end:l}=function(t,n){let r=n.depth-t.openStart,i=n.node(r).copy(t.content);for(let o=r-1;o>=0;o--)i=n.node(o).copy(Gg.from(i));return{start:i.resolveNoCache(t.openStart+r),end:i.resolveNoCache(i.content.size-t.openEnd-r)}}(i,n);return GI(u,function t(n,r,i,o,a){let u=n.depth>a&&Gw(n,r,a+1),s=o.depth>a&&Gw(i,o,a+1),c=[];return Gk(null,n,a,c),u&&s&&r.index(a)==i.index(a)?(GT(u,s),GO(GI(u,t(n,r,i,o,a+1)),c)):(u&&GO(GI(u,GC(n,r,a+1)),c),Gk(r,i,a,c),s&&GO(GI(s,GC(i,o,a+1)),c)),Gk(o,null,a,c),new Gg(c)}(n,c,l,r,o))}{let f=n.parent,d=f.content;return GI(f,d.cut(0,n.parentOffset).append(i.content).append(d.cut(r.parentOffset)))}}(t,n,r,0)}(this.resolve(t),this.resolve(n),r)}nodeAt(t){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(t);if(!(n=n.maybeChild(r)))return null;if(i==t||n.isText)return n;t-=i+1}}childAfter(t){let{index:n,offset:r}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(t){if(0==t)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(t);if(r<t)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(t){return GM.resolveCached(this,t)}resolveNoCache(t){return GM.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()+")"),GD(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=Gg.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=Gx.none;for(let n=0;n<this.marks.length;n++)t=this.marks[n].addToSet(t);if(!Gx.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=Gg.fromJSON(t,n.content);return t.nodeType(n.type).create(n.attrs,i,r)}};GP.prototype.text=void 0;class GL extends GP{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):GD(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 GL(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new GL(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 GD(t,n){for(let r=t.length-1;r>=0;r--)n=t[r].type.name+"("+n+")";return n}class GF{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){var r;let i=new GW(t,n);if(null==i.next)return GF.empty;let o=GU(i);i.next&&i.err("Unexpected trailing text");let a,u=(r=function(t){let n=[[]];return o(a(t,0),r()),n;function r(){return n.push([])-1}function i(t,r,i){let o={term:i,to:r};return n[t].push(o),o}function o(t,n){t.forEach(t=>t.to=n)}function a(t,n){if("choice"==t.type)return t.exprs.reduce((t,r)=>t.concat(a(r,n)),[]);if("seq"==t.type)for(let u=0;;u++){let s=a(t.exprs[u],n);if(u==t.exprs.length-1)return s;o(s,n=r())}else if("star"==t.type){let c=r();return i(n,c),o(a(t.expr,c),c),[i(c)]}else if("plus"==t.type){let l=r();return o(a(t.expr,n),l),o(a(t.expr,l),l),[i(l)]}else{if("opt"==t.type)return[i(n)].concat(a(t.expr,n));if("range"==t.type){let f=n;for(let d=0;d<t.min;d++){let p=r();o(a(t.expr,f),p),f=p}if(-1==t.max)o(a(t.expr,f),f);else for(let h=t.min;h<t.max;h++){let m=r();i(f,m),o(a(t.expr,f),m),f=m}return[i(f)]}if("name"==t.type)return[i(n,void 0,t.value)];throw Error("Unknown expr type")}}}(o),a=Object.create(null),function t(n){let i=[];n.forEach(t=>{r[t].forEach(({term:t,to:n})=>{if(!t)return;let o;for(let a=0;a<i.length;a++)i[a][0]==t&&(o=i[a][1]);GH(r,n).forEach(n=>{o||i.push([t,o=[]]),-1==o.indexOf(n)&&o.push(n)})})});let o=a[n.join(",")]=new GF(n.indexOf(r.length-1)>-1);for(let u=0;u<i.length;u++){let s=i[u][1].sort(GK);o.next.push({type:i[u][0],next:a[s.join(",")]||t(s)})}return o}(GH(r,0)));return function(t,n){for(let r=0,i=[t];r<i.length;r++){let o=i[r],a=!o.validEnd,u=[];for(let s=0;s<o.next.length;s++){let{type:c,next:l}=o.next[s];u.push(c.name),a&&!(c.isText||c.hasRequiredAttrs())&&(a=!1),-1==i.indexOf(l)&&i.push(l)}a&&n.err("Only non-generatable nodes ("+u.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(u,i),u}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,r=t.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(t.child(o).type);return i}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let r=0;r<t.next.length;r++)if(this.next[n].type==t.next[r].type)return!0;return!1}fillBefore(t,n=!1,r=0){let i=[this];return function o(a,u){let s=a.matchFragment(t,r);if(s&&(!n||s.validEnd))return Gg.from(u.map(t=>t.createAndFill()));for(let c=0;c<a.next.length;c++){let{type:l,next:f}=a.next[c];if(!(l.isText||l.hasRequiredAttrs())&&-1==i.indexOf(f)){i.push(f);let d=o(f,u.concat(l));if(d)return d}}return null}(this,[])}findWrapping(t){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==t)return this.wrapCache[n+1];let r=this.computeWrapping(t);return this.wrapCache.push(t,r),r}computeWrapping(t){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(t)){let a=[];for(let u=i;u.type;u=u.via)a.push(u.type);return a.reverse()}for(let s=0;s<o.next.length;s++){let{type:c,next:l}=o.next[s];c.isLeaf||c.hasRequiredAttrs()||c.name in n||i.type&&!l.validEnd||(r.push({match:c.contentMatch,type:c,via:i}),n[c.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];return function n(r){t.push(r);for(let i=0;i<r.next.length;i++)-1==t.indexOf(r.next[i].next)&&n(r.next[i].next)}(this),t.map((n,r)=>{let i=r+(n.validEnd?"*":" ")+" ";for(let o=0;o<n.next.length;o++)i+=(o?", ":"")+n.next[o].type.name+"->"+t.indexOf(n.next[o].next);return i}).join(`
6
- `)}}GF.empty=new GF(!0);class GW{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 GU(t){let n=[];do n.push(Gz(t));while(t.eat("|"));return 1==n.length?n[0]:{type:"choice",exprs:n}}function Gz(t){let n=[];do n.push(GB(t));while(t.next&&")"!=t.next&&"|"!=t.next);return 1==n.length?n[0]:{type:"seq",exprs:n}}function GB(t){let n=Gq(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=G$(t,n);else break;return n}function GV(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let n=Number(t.next);return t.pos++,n}function G$(t,n){let r=GV(t),i=r;return t.eat(",")&&(i="}"!=t.next?GV(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:r,max:i,expr:n}}function Gq(t){if(t.eat("(")){let n=GU(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 GK(t,n){return n-t}function GH(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(GK)}function GZ(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 GG(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 GY(t){let n=Object.create(null);if(t)for(let r in t)n[r]=new GQ(t[r]);return n}let GJ=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=GY(r.attrs),this.defaultAttrs=GZ(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==GF.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:GG(this.attrs,t)}create(t=null,n,r){if(this.isText)throw Error("NodeType.create can't construct text nodes");return new GP(this,this.computeAttrs(t),Gg.from(n),Gx.setFrom(r))}createChecked(t=null,n,r){return n=Gg.from(n),this.checkContent(n),new GP(this,this.computeAttrs(t),n,Gx.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),(n=Gg.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(Gg.empty,!0);return a?new GP(this,t,n.append(a),Gx.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:Gx.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 GQ{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class GX{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=GY(i.attrs),this.excluded=null;let o=GZ(this.attrs);this.instance=o?new Gx(this,o):null}create(t=null){return!t&&this.instance?this.instance:new Gx(this,GG(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,o)=>r[t]=new GX(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 G0{constructor(t){this.cached=Object.create(null);let n=this.spec={};for(let r in t)n[r]=t[r];n.nodes=Gm.from(t.nodes),n.marks=Gm.from(t.marks||{}),this.nodes=GJ.compile(this.spec.nodes,this),this.marks=GX.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]=GF.parse(u,this.nodes)),a.inlineContent=a.contentMatch.inlineContent,a.markSet="_"==s?null:s?G1(this,s.split(" ")):""!=s&&a.inlineContent?null:[]}for(let c in this.marks){let l=this.marks[c],f=l.spec.excludes;l.excluded=null==f?[l]:""==f?[]:G1(this,f.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,r,i){if("string"==typeof t)t=this.nodeType(t);else if(t instanceof GJ){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 GL(r,r.defaultAttrs,t,Gx.setFrom(n))}mark(t,n){return"string"==typeof t&&(t=this.marks[t]),t.create(n)}nodeFromJSON(t){return GP.fromJSON(this,t)}markFromJSON(t){return Gx.fromJSON(this,t)}nodeType(t){let n=this.nodes[t];if(!n)throw RangeError("Unknown node type: "+t);return n}}function G1(t,n){let r=[];for(let i=0;i<n.length;i++){let o=n[i],a=t.marks[o],u=a;if(a)r.push(a);else for(let s in t.marks){let c=t.marks[s];("_"==o||c.spec.group&&c.spec.group.split(" ").indexOf(o)>-1)&&r.push(u=c)}if(!u)throw SyntaxError("Unknown mark type: '"+n[i]+"'")}return r}class G2{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 G8(this,n,!1);return r.addAll(t,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new G8(this,n,!0);return r.addAll(t,n.from,n.to),GS.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(G7(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=Ye(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=Ye(t)),t.node||t.ignore||t.mark||(t.node=a)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new G2(t,G2.schemaRules(t)))}}let G3={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},G4={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},G5={ol:!0,ul:!0};function G9(t,n,r){return null!=n?(n?1:0)|("full"===n?2:0):t&&"pre"==t.whitespace?3:-5&r}class G6{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=Gx.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(Gg.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=Gg.from(this.content);return!t&&this.match&&(i=i.append(this.match.fillBefore(Gg.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):Yt(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&&!G3.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class G8{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0;let i=n.topNode,o,a=G9(null,n.preserveWhitespace,0)|(r?4:0);o=i?new G6(i.type,i.attrs,Gx.none,Gx.none,!0,n.topMatch||i.type.contentMatch,a):r?new G6(null,null,Gx.none,Gx.none,!0,null,a):new G6(t.schema.topNodeType,null,Gx.none,Gx.none,!0,null,a),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t){if(3==t.nodeType)this.addTextNode(t);else if(1==t.nodeType){let n=t.getAttribute("style");if(n){let r=this.readStyles(function(t){let n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r,i=[];for(;r=n.exec(t);)i.push(r[1],r[2].trim());return i}(n));if(!r)return;let[i,o]=r,a=this.top;for(let u=0;u<o.length;u++)this.removePendingMark(o[u],a);for(let s=0;s<i.length;s++)this.addPendingMark(i[s]);this.addElement(t);for(let c=0;c<i.length;c++)this.removePendingMark(i[c],a);for(let l=0;l<o.length;l++)this.addPendingMark(o[l])}else this.addElement(t)}}addTextNode(t){let n=t.nodeValue,r=this.top;if(2&r.options||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(1&r.options)n=2&r.options?n.replace(/\r\n?/g,`
7
- `):n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let i=r.content[r.content.length-1],o=t.previousSibling;(!i||o&&"BR"==o.nodeName||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n)),this.findInText(t)}else this.findInside(t)}addElement(t,n){let r=t.nodeName.toLowerCase(),i;G5.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&&G5.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:G4.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(G3.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=Gx.none,r=Gx.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=G9(t,i,o.options);4&o.options&&0==o.content.length&&(a|=4),this.nodes.push(new G6(t,n,o.activeMarks,o.pendingMarks,r,null,a)),this.open++}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(t){for(let n=this.open;n>=0;n--)if(this.nodes[n]==t)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)t+=r[i].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==t&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)null==this.find[n].pos&&1==t.nodeType&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,r){if(t!=n&&this.find)for(let i=0;i<this.find.length;i++)null==this.find[i].pos&&1==t.nodeType&&t.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),a=(t,u)=>{for(;t>=0;t--){let s=n[t];if(""==s){if(t==n.length-1||0==t)continue;for(;u>=o;u--)if(a(t-1,u))return!0;return!1}{let c=u>0||0==u&&i?this.nodes[u].type:r&&u>=o?r.node(u-o).type:null;if(!c||c.name!=s&&-1==c.groups.indexOf(s))return!1;u--}}return!0};return a(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let i in this.parser.schema.nodes){let o=this.parser.schema.nodes[i];if(o.isTextblock&&o.defaultAttrs)return o}}addPendingMark(t){let n=function(t,n){for(let r=0;r<n.length;r++)if(t.eq(n[r]))return n[r]}(t,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)}removePendingMark(t,n){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(t)>-1)i.pendingMarks=t.removeFromSet(i.pendingMarks);else{i.activeMarks=t.removeFromSet(i.activeMarks);let o=i.popFromStashMark(t);o&&i.type&&i.type.allowsMarkType(o.type)&&(i.activeMarks=o.addToSet(i.activeMarks))}if(i==n)break}}}function G7(t,n){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,n)}function Ye(t){let n={};for(let r in t)n[r]=t[r];return n}function Yt(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 Yn{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=Yi(n).createDocumentFragment());let i=r,o=[];return t.forEach(t=>{if(o.length||t.marks.length){let r=0,a=0;for(;r<o.length&&a<t.marks.length;){let u=t.marks[a];if(!this.marks[u.type.name]){a++;continue}if(!u.eq(o[r][0])||!1===u.type.spec.spanning)break;r++,a++}for(;r<o.length;)i=o.pop()[1];for(;a<t.marks.length;){let s=t.marks[a++],c=this.serializeMark(s,t.isInline,n);c&&(o.push([s,i]),i.appendChild(c.dom),i=c.contentDOM||c.dom)}}i.appendChild(this.serializeNodeInner(t,n))}),r}serializeNodeInner(t,n){let{dom:r,contentDOM:i}=Yn.renderSpec(Yi(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&&Yn.renderSpec(Yi(r),i(t,n))}static renderSpec(t,n,r=null){if("string"==typeof n)return{dom:t.createTextNode(n)};if(null!=n.nodeType)return{dom:n};if(n.dom&&null!=n.dom.nodeType)return n;let i=n[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let a,u=r?t.createElementNS(r,i):t.createElement(i),s=n[1],c=1;if(s&&"object"==typeof s&&null==s.nodeType&&!Array.isArray(s)){for(let l in c=2,s)if(null!=s[l]){let f=l.indexOf(" ");f>0?u.setAttributeNS(l.slice(0,f),l.slice(f+1),s[l]):u.setAttribute(l,s[l])}}for(let d=c;d<n.length;d++){let p=n[d];if(0===p){if(d<n.length-1||d>c)throw RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}{let{dom:h,contentDOM:m}=Yn.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 Yn(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=Yr(t.nodes);return n.text||(n.text=t=>t.text),n}static marksFromSchema(t){return Yr(t.marks)}}function Yr(t){let n={};for(let r in t){let i=t[r].spec.toDOM;i&&(n[r]=i)}return n}function Yi(t){return t.document||window.document}function Yo(t,n){return t+65536*n}function Ya(t){return 65535&t}class Yu{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 Ys{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Ys.empty)return Ys.empty}recover(t){var n;let r=0,i=Ya(t);if(!this.inverted)for(let o=0;o<i;o++)r+=this.ranges[3*o+2]-this.ranges[3*o+1];return this.ranges[3*i]+r+(t-(65535&t))/65536}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let i=0,o=this.inverted?2:1,a=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let s=this.ranges[u]-(this.inverted?i:0);if(s>t)break;let c=this.ranges[u+o],l=this.ranges[u+a],f=s+c;if(t<=f){let d=c?t==s?-1:t==f?1:n:n,p=s+i+(d<0?0:l);if(r)return p;let h=t==(n<0?s:f)?null:Yo(u/3,t-s),m=t==s?2:t==f?1:4;return(n<0?t!=s:t!=f)&&(m|=8),new Yu(p,m,h)}i+=l-c}return r?t+i:new Yu(t+i,0,null)}touches(t,n){let r=0,i=Ya(n),o=this.inverted?2:1,a=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let s=this.ranges[u]-(this.inverted?r:0);if(s>t)break;let c=this.ranges[u+o];if(t<=s+c&&u==3*i)return!0;r+=this.ranges[u+a]-c}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let a=this.ranges[i],u=a-(this.inverted?o:0),s=a+(this.inverted?0:o),c=this.ranges[i+n],l=this.ranges[i+r];t(u,u+c,s,s+l),o+=l-c}}invert(){return new Ys(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?Ys.empty:new Ys(t<0?[0,-t,0]:[0,0,t])}}Ys.empty=new Ys([]);class Yc{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 Yc(this.maps,this.mirror,t,n)}copy(){return new Yc(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 Yc;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 Yu(t,i,null)}}let Yl=Object.create(null);class Yf{getMap(){return Ys.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw RangeError("Invalid input for Step.fromJSON");let r=Yl[n.stepType];if(!r)throw RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in Yl)throw RangeError("Duplicate use of step JSON ID "+t);return Yl[t]=n,n.prototype.jsonID=t,n}}class Yd{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Yd(t,null)}static fail(t){return new Yd(null,t)}static fromReplace(t,n,r,i){try{return Yd.ok(t.replace(n,r,i))}catch(o){if(o instanceof G_)return Yd.fail(o.message);throw o}}}function Yp(t,n,r){let i=[];for(let o=0;o<t.childCount;o++){let a=t.child(o);a.content.size&&(a=a.copy(Yp(a.content,n,a))),a.isInline&&(a=n(a,r,o)),i.push(a)}return Gg.fromArray(i)}class Yh extends Yf{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 GS(Yp(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 Yd.fromReplace(t,this.from,this.to,o)}invert(){return new Ym(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 Yh(n.pos,r.pos,this.mark)}merge(t){return t instanceof Yh&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Yh(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 Yh(n.from,n.to,t.markFromJSON(n.mark))}}Yf.jsonID("addMark",Yh);class Ym extends Yf{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 GS(Yp(n.content,t=>t.mark(this.mark.removeFromSet(t.marks)),t),n.openStart,n.openEnd);return Yd.fromReplace(t,this.from,this.to,r)}invert(){return new Yh(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 Ym(n.pos,r.pos,this.mark)}merge(t){return t instanceof Ym&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Ym(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 Ym(n.from,n.to,t.markFromJSON(n.mark))}}Yf.jsonID("removeMark",Ym);class Yg extends Yf{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Yd.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Yd.fromReplace(t,this.pos,this.pos+1,new GS(Gg.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 Yg(this.pos,n.marks[i]);return new Yg(this.pos,this.mark)}}return new Yy(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Yg(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 Yg(n.pos,t.markFromJSON(n.mark))}}Yf.jsonID("addNodeMark",Yg);class Yy extends Yf{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Yd.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Yd.fromReplace(t,this.pos,this.pos+1,new GS(Gg.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return n&&this.mark.isInSet(n.marks)?new Yg(this.pos,this.mark):this}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Yy(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 Yy(n.pos,t.markFromJSON(n.mark))}}Yf.jsonID("removeNodeMark",Yy);class Yv extends Yf{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&Yx(t,this.from,this.to)?Yd.fail("Structure replace would overwrite content"):Yd.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Ys([this.from,this.to-this.from,this.slice.size])}invert(t){return new Yv(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 Yv(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof Yv)||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?GS.empty:new GS(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new Yv(t.from,this.to,n,this.structure)}}{let r=this.slice.size+t.slice.size==0?GS.empty:new GS(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new Yv(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 Yv(n.from,n.to,GS.fromJSON(t,n.slice),!!n.structure)}}Yf.jsonID("replace",Yv);class Yb extends Yf{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&&(Yx(t,this.from,this.gapFrom)||Yx(t,this.gapTo,this.to)))return Yd.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Yd.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Yd.fromReplace(t,this.from,this.to,r):Yd.fail("Content does not fit in gap")}getMap(){return new Ys([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 Yb(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 Yb(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 Yb(n.from,n.to,n.gapFrom,n.gapTo,GS.fromJSON(t,n.slice),n.insert,!!n.structure)}}function Yx(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 Y_(t,n,r){return(0==n||t.canReplace(n,t.childCount))&&(r==t.childCount||t.canReplace(0,r))}function YS(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||!Y_(i,o,a))break}return null}function YT(t,n,r=null,i=t){let o=function(t,n){let{parent:r,startIndex:i,endIndex:o}=t,a=r.contentMatchAt(i).findWrapping(n);if(!a)return null;let u=a.length?a[0]:n;return r.canReplaceWith(i,o,u)?a:null}(t,n),a=o&&function(t,n){let{parent:r,startIndex:i,endIndex:o}=t,a=r.child(i),u=n.contentMatch.findWrapping(a.type);if(!u)return null;let s=(u.length?u[u.length-1]:n).contentMatch;for(let c=i;s&&c<o;c++)s=s.matchType(r.child(c).type);return s&&s.validEnd?u:null}(i,n);return a?o.map(Yw).concat({type:n,attrs:r}).concat(a.map(Yw)):null}function Yw(t){return{type:t,attrs:null}}function YO(t,n,r=1,i){let o=t.resolve(n),a=o.depth-r,u=i&&i[i.length-1]||o.parent;if(a<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!u.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let s=o.depth-1,c=r-2;s>a;s--,c--){let l=o.node(s),f=o.index(s);if(l.type.spec.isolating)return!1;let d=l.content.cutByIndex(f,l.childCount),p=i&&i[c+1];p&&(d=d.replaceChild(0,p.type.create(p.attrs)));let h=i&&i[c]||l;if(!l.canReplace(f+1,l.childCount)||!h.type.validContent(d))return!1}let m=o.indexAfter(a),g=i&&i[0];return o.node(a).canReplaceWith(m,m,g?g.type:o.node(a+1).type)}function Yk(t,n){let r=t.resolve(n),i=r.index();return YI(r.nodeBefore,r.nodeAfter)&&r.parent.canReplace(i,i+1)}function YI(t,n){return!!(t&&n&&!t.isLeaf&&t.canAppend(n))}function YC(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&&YI(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 YM(t,n,r=n,i=GS.empty){if(n==r&&!i.size)return null;let o=t.resolve(n),a=t.resolve(r);return YR(o,a,i)?new Yv(n,r,i):new YE(o,a,i).fit()}function YR(t,n,r){return!r.openStart&&!r.openEnd&&t.start()==n.start()&&t.parent.canReplace(t.index(),n.index(),r.content)}Yf.jsonID("replaceAround",Yb);class YE{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=Gg.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=Gg.from(t.node(a).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}let n=this.mustMoveInline(),r=this.placed.size-this.depth-this.$from.depth,i=this.$from,o=this.close(n<0?this.$to:i.doc.resolve(n));if(!o)return null;let a=this.placed,u=i.depth,s=o.depth;for(;u&&s&&1==a.childCount;)a=a.firstChild.content,u--,s--;let c=new GS(a,u,s);return n>-1?new Yb(i.pos,n,this.$to.pos,this.$to.end(),c,r):c.size||i.pos!=this.$to.pos?new Yv(i.pos,o.pos,c):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<t;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){t=r;break}n=o.content}for(let a=1;a<=2;a++)for(let u=1==a?t:this.unplaced.openStart;u>=0;u--){let s,c=null,l=(u?(c=YA(this.unplaced.content,u-1).firstChild).content:this.unplaced.content).firstChild;for(let f=this.depth;f>=0;f--){let{type:d,match:p}=this.frontier[f],h,m=null;if(1==a&&(l?p.matchType(l.type)||(m=p.fillBefore(Gg.from(l),!1)):c&&d.compatibleContent(c.type)))return{sliceDepth:u,frontierDepth:f,parent:c,inject:m};if(2==a&&l&&(h=p.findWrapping(l.type)))return{sliceDepth:u,frontierDepth:f,parent:c,wrap:h};if(c&&p.matchType(c.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=YA(t,n);return!!i.childCount&&!i.firstChild.isLeaf&&(this.unplaced=new GS(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=YA(t,n);if(i.childCount<=1&&n>0){let o=t.size-n<=n+i.size;this.unplaced=new GS(Yj(t,n-1,1),n-1,o?n-1:r)}else this.unplaced=new GS(Yj(t,n,1),n,r)}placeNodes({sliceDepth:t,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let a=0;a<o.length;a++)this.openFrontierNode(o[a]);let u=this.unplaced,s=r?r.content:u.content,c=u.openStart-t,l=0,f=[],{match:d,type:p}=this.frontier[n];if(i){for(let h=0;h<i.childCount;h++)f.push(i.child(h));d=d.matchFragment(i)}let m=s.size+t-(u.content.size-u.openEnd);for(;l<s.childCount;){let g=s.child(l),y=d.matchType(g.type);if(!y)break;(++l>1||0==c||g.content.size)&&(d=y,f.push(YP(g.mark(p.allowedMarks(g.marks)),1==l?c:0,l==s.childCount?m:-1)))}let v=l==s.childCount;v||(m=-1),this.placed=YN(this.placed,n,Gg.from(f)),this.frontier[n].match=d,v&&m<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let b=0,x=s;b<m;b++){let _=x.lastChild;this.frontier.push({type:_.type,match:_.contentMatchAt(_.childCount)}),x=_.content}this.unplaced=v?0==t?GS.empty:new GS(Yj(u.content,t-1,1),t-1,m<0?u.openEnd:t-1):new GS(Yj(u.content,t,l),u.openStart,u.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return -1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!YL(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=YL(t,n,i,r,o);if(a){for(let u=n-1;u>=0;u--){let{match:s,type:c}=this.frontier[u],l=YL(t,u,c,s,!0);if(!l||l.childCount)continue e}return{depth:n,fit:a,move:o?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=YN(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=YN(this.placed,this.depth,Gg.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(Gg.empty,!0);t.childCount&&(this.placed=YN(this.placed,this.frontier.length,t))}}function Yj(t,n,r){return 0==n?t.cutByIndex(r,t.childCount):t.replaceChild(0,t.firstChild.copy(Yj(t.firstChild.content,n-1,r)))}function YN(t,n,r){return 0==n?t.append(r):t.replaceChild(t.childCount-1,t.lastChild.copy(YN(t.lastChild.content,n-1,r)))}function YA(t,n){for(let r=0;r<n;r++)t=t.firstChild.content;return t}function YP(t,n,r){if(n<=0)return t;let i=t.content;return n>1&&(i=i.replaceChild(0,YP(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(Gg.empty,!0)))),t.copy(i)}function YL(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 YD(t){return t.spec.defining||t.spec.definingForContent}function YF(t,n,r,i,o){if(n<r){let a=t.firstChild;t=t.replaceChild(0,a.copy(YF(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(Gg.empty,!0))}return t}function YW(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 YU extends Yf{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 Yd.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 Yd.fromReplace(t,this.pos,this.pos+1,new GS(Gg.from(o),0,n.isLeaf?0:1))}getMap(){return Ys.empty}invert(t){return new YU(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 YU(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 YU(n.pos,n.attr,n.value)}}Yf.jsonID("attr",YU);let Yz=class extends Error{};(Yz=function t(n){let r=Error.call(this,n);return r.__proto__=t.prototype,r}).prototype=Object.create(Error.prototype),Yz.prototype.constructor=Yz,Yz.prototype.name="TransformError";class YB{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new Yc}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new Yz(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=GS.empty){let i=YM(this.doc,t,n,r);return i&&this.step(i),this}replaceWith(t,n,r){return this.replace(t,n,new GS(Gg.from(r),0,0))}delete(t,n){return this.replace(t,n,GS.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(YR(o,a,i))return t.step(new Yv(n,r,i));let u=YW(o,t.doc.resolve(r));0==u[u.length-1]&&u.pop();let s=-(o.depth+1);u.unshift(s);for(let c=o.depth,l=o.pos-1;c>0;c--,l--){let f=o.node(c).type.spec;if(f.defining||f.definingAsContext||f.isolating)break;u.indexOf(c)>-1?s=c:o.before(c)==l&&u.splice(1,0,-c)}let d=u.indexOf(s),p=[],h=i.openStart;for(let m=i.content,g=0;;g++){let y=m.firstChild;if(p.push(y),g==i.openStart)break;m=y.content}for(let v=h-1;v>=0;v--){let b=p[v].type,x=YD(b);if(x&&o.node(d).type!=b)h=v;else if(x||!b.isTextblock)break}for(let _=i.openStart;_>=0;_--){let S=(_+h+1)%(i.openStart+1),T=p[S];if(T)for(let w=0;w<u.length;w++){let O=u[(w+d)%u.length],k=!0;O<0&&(k=!1,O=-O);let I=o.node(O-1),C=o.index(O-1);if(I.canReplaceWith(C,C,T.type,T.marks))return t.replace(o.before(O),k?a.after(O):r,new GS(YF(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 GS(Gg.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=YW(i,o);for(let u=0;u<a.length;u++){let s=a[u],c=u==a.length-1;if(c&&0==s||i.node(s).type.contentMatch.validEnd)return t.delete(i.start(s),o.end(s));if(s>0&&(c||i.node(s-1).canReplace(i.index(s-1),o.indexAfter(s-1))))return t.delete(i.before(s),o.after(s))}for(let l=1;l<=i.depth&&l<=o.depth;l++)if(n-i.start(l)==i.depth-l&&r>i.end(l)&&o.end(l)-r!=o.depth-l)return t.delete(i.before(l),r);t.delete(n,r)}(this,t,n),this}lift(t,n){return function(t,n,r){let{$from:i,$to:o,depth:a}=n,u=i.before(a+1),s=o.after(a+1),c=u,l=s,f=Gg.empty,d=0;for(let p=a,h=!1;p>r;p--)h||i.index(p)>0?(h=!0,f=Gg.from(i.node(p).copy(f)),d++):c--;let m=Gg.empty,g=0;for(let y=a,v=!1;y>r;y--)v||o.after(y+1)<o.end(y)?(v=!0,m=Gg.from(o.node(y).copy(m)),g++):l++;t.step(new Yb(c,l,u,s,new GS(f.append(m),d,g),f.size-d,!0))}(this,t,n),this}join(t,n=1){return function(t,n,r){let i=new Yv(n-r,n+r,GS.empty,!0);t.step(i)}(this,t,n),this}wrap(t,n){return function(t,n,r){let i=Gg.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=Gg.from(r[o].type.create(r[o].attrs,i))}let u=n.start,s=n.end;t.step(new Yb(u,s,u,s,new GS(i,0,0),r.length,!0))}(this,t,n),this}setBlockType(t,n=t,r,i=null){return function(t,n,r,i,o){if(!i.isTextblock)throw RangeError("Type given to setBlockType should be a textblock");let a=t.steps.length;t.doc.nodesBetween(n,r,(n,r)=>{var u,s,c;let l,f;if(n.isTextblock&&!n.hasMarkup(i,o)&&(u=t.doc,s=t.mapping.slice(a).map(r),c=i,l=u.resolve(s),f=l.index(),l.parent.canReplaceWith(f,f+1,c))){t.clearIncompatible(t.mapping.slice(a).map(r,1),i);let d=t.mapping.slice(a),p=d.map(r,1),h=d.map(r+n.nodeSize,1);return t.step(new Yb(p,h,p+1,h-1,new GS(Gg.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 Yb(n,n+a.nodeSize,n+1,n+a.nodeSize-1,new GS(Gg.from(u),0,0),1,!0))}(this,t,n,r,i),this}setNodeAttribute(t,n,r){return this.step(new YU(t,n,r)),this}addNodeMark(t,n){return this.step(new Yg(t,n)),this}removeNodeMark(t,n){if(!(n instanceof Gx)){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 Yy(t,n)),this}split(t,n=1,r){return function(t,n,r=1,i){let o=t.doc.resolve(n),a=Gg.empty,u=Gg.empty;for(let s=o.depth,c=o.depth-r,l=r-1;s>c;s--,l--){a=Gg.from(o.node(s).copy(a));let f=i&&i[l];u=Gg.from(f?f.type.create(f.attrs,u):o.node(s).copy(u))}t.step(new Yv(n,n,new GS(a.append(u),r,r),!0))}(this,t,n,r),this}addMark(t,n,r){var i,o,a,u;let s,c,l,f;return i=this,s=[],c=[],i.doc.nodesBetween(t,n,(i,o,a)=>{if(!i.isInline)return;let u=i.marks;if(!r.isInSet(u)&&a.type.allowsMarkType(r.type)){let d=Math.max(o,t),p=Math.min(o+i.nodeSize,n),h=r.addToSet(u);for(let m=0;m<u.length;m++)u[m].isInSet(h)||(l&&l.to==d&&l.mark.eq(u[m])?l.to=p:s.push(l=new Ym(d,p,u[m])));f&&f.to==d?f.to=p:c.push(f=new Yh(d,p,r))}}),s.forEach(t=>i.step(t)),c.forEach(t=>i.step(t)),this}removeMark(t,n,r){var i,o,a,u;let s,c;return i=this,s=[],c=0,i.doc.nodesBetween(t,n,(i,o)=>{if(!i.isInline)return;c++;let a=null;if(r instanceof GX){let u=i.marks,l;for(;l=r.isInSet(u);)(a||(a=[])).push(l),u=l.removeFromSet(u)}else r?r.isInSet(i.marks)&&(a=[r]):a=i.marks;if(a&&a.length){let f=Math.min(o+i.nodeSize,n);for(let d=0;d<a.length;d++){let p=a[d],h;for(let m=0;m<s.length;m++){let g=s[m];g.step==c-1&&p.eq(s[m].style)&&(h=g)}h?(h.to=f,h.step=c):s.push({style:p,from:Math.max(o,t),to:f,step:c})}}}),s.forEach(t=>i.step(new Ym(t.from,t.to,t.style))),this}clearIncompatible(t,n,r){return function(t,n,r,i=r.contentMatch){let o=t.doc.nodeAt(n),a=[],u=n+1;for(let s=0;s<o.childCount;s++){let c=o.child(s),l=u+c.nodeSize,f=i.matchType(c.type);if(f){i=f;for(let d=0;d<c.marks.length;d++)r.allowsMarkType(c.marks[d].type)||t.step(new Ym(u,l,c.marks[d]))}else a.push(new Yv(u,l,GS.empty));u=l}if(!i.validEnd){let p=i.fillBefore(Gg.empty,!0);t.replace(u,u,new GS(p,0,0))}for(let h=a.length-1;h>=0;h--)t.step(a[h])}(this,t,n,r),this}}let YV=Object.create(null);class Y${constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new Yq(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=GS.empty){let r=n.content.lastChild,i=null;for(let o=0;o<n.openEnd;o++)i=r,r=r.lastChild;let a=t.steps.length,u=this.ranges;for(let s=0;s<u.length;s++){let{$from:c,$to:l}=u[s],f=t.mapping.slice(a);t.replaceRange(f.map(c.pos),f.map(l.pos),s?GS.empty:n),0==s&&Y1(t,a,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(t,n){let r=t.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:a,$to:u}=i[o],s=t.mapping.slice(r),c=s.map(a.pos),l=s.map(u.pos);o?t.deleteRange(c,l):(t.replaceRangeWith(c,l,n),Y1(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let i=t.parent.inlineContent?new YZ(t):Y0(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?Y0(t.node(0),t.node(o),t.before(o+1),t.index(o),n,r):Y0(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 YQ(t.node(0))}static atStart(t){return Y0(t,t,0,0,1)||new YQ(t)}static atEnd(t){return Y0(t,t,t.content.size,t.childCount,-1)||new YQ(t)}static fromJSON(t,n){if(!n||!n.type)throw RangeError("Invalid input for Selection.fromJSON");let r=YV[n.type];if(!r)throw RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in YV)throw RangeError("Duplicate use of selection JSON ID "+t);return YV[t]=n,n.prototype.jsonID=t,n}getBookmark(){return YZ.between(this.$anchor,this.$head).getBookmark()}}Y$.prototype.visible=!0;class Yq{constructor(t,n){this.$from=t,this.$to=n}}let YK=!1;function YH(t){YK||t.parent.inlineContent||(YK=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class YZ extends Y${constructor(t,n=t){YH(t),YH(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 Y$.near(r);let i=t.resolve(n.map(this.anchor));return new YZ(i.parent.inlineContent?i:r,r)}replace(t,n=GS.empty){if(super.replace(t,n),n==GS.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof YZ&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new YG(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 YZ(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=Y$.findFrom(n,r,!0)||Y$.findFrom(n,-r,!0);if(!o)return Y$.near(n,r);n=o.$head}return t.parent.inlineContent||(0==i?t=n:(t=(Y$.findFrom(t,-r,!0)||Y$.findFrom(t,r,!0)).$anchor).pos<n.pos!=i<0&&(t=n)),new YZ(t,n)}}Y$.jsonID("text",YZ);class YG{constructor(t,n){this.anchor=t,this.head=n}map(t){return new YG(t.map(this.anchor),t.map(this.head))}resolve(t){return YZ.between(t.resolve(this.anchor),t.resolve(this.head))}}class YY extends Y${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?Y$.near(o):new YY(o)}content(){return new GS(Gg.from(this.node),0,0)}eq(t){return t instanceof YY&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new YJ(this.anchor)}static fromJSON(t,n){if("number"!=typeof n.anchor)throw RangeError("Invalid input for NodeSelection.fromJSON");return new YY(t.resolve(n.anchor))}static create(t,n){return new YY(t.resolve(n))}static isSelectable(t){return!t.isText&&!1!==t.type.spec.selectable}}YY.prototype.visible=!1,Y$.jsonID("node",YY);class YJ{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new YG(r,r):new YJ(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&YY.isSelectable(r)?new YY(n):Y$.near(n)}}class YQ extends Y${constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=GS.empty){if(n==GS.empty){t.delete(0,t.doc.content.size);let r=Y$.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new YQ(t)}map(t){return new YQ(t)}eq(t){return t instanceof YQ}getBookmark(){return YX}}Y$.jsonID("all",YQ);let YX={map(){return this},resolve:t=>new YQ(t)};function Y0(t,n,r,i,o,a=!1){if(n.inlineContent)return YZ.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&&YY.isSelectable(s))return YY.create(t,r-(o<0?s.nodeSize:0))}else{let c=Y0(t,s,r+o,o<0?s.childCount:0,o,a);if(c)return c}r+=s.nodeSize*o}return null}function Y1(t,n,r){let i=t.steps.length-1;if(i<n)return;let o=t.steps[i];if(!(o instanceof Yv||o instanceof Yb))return;let a;t.mapping.maps[i].forEach((t,n,r,i)=>{null==a&&(a=i)}),t.setSelection(Y$.near(t.doc.resolve(a),r))}class Y2 extends YB{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 Gx.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)||Gx.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(Y$.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 Y3(t,n){return n&&t?t.bind(n):t}class Y4{constructor(t,n,r){this.name=t,this.init=Y3(n.init,r),this.apply=Y3(n.apply,r)}}let Y5=[new Y4("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new Y4("selection",{init:(t,n)=>t.selection||Y$.atStart(n.doc),apply:t=>t.selection}),new Y4("storedMarks",{init:t=>t.storedMarks||null,apply:(t,n,r,i)=>i.selection.$cursor?t.storedMarks:null}),new Y4("scrollToSelection",{init:()=>0,apply:(t,n)=>t.scrolledIntoView?n+1:n})];class Y9{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Y5.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 Y4(t.key,t.spec.state,t))})}}class Y6{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let n=[t],r=this.applyInner(t),i=null;for(;;){let o=!1;for(let a=0;a<this.config.plugins.length;a++){let u=this.config.plugins[a];if(u.spec.appendTransaction){let s=i?i[a].n:0,c=i?i[a].state:this,l=s<n.length&&u.spec.appendTransaction.call(u,s?n.slice(s):n,c,r);if(l&&r.filterTransaction(l,a)){if(l.setMeta("appendedTransaction",t),!i){i=[];for(let f=0;f<this.config.plugins.length;f++)i.push(f<a?{state:r,n:n.length}:{state:this,n:0})}n.push(l),r=r.applyInner(l),o=!0}i&&(i[a]={state:r,n:n.length})}}if(!o)return{state:r,transactions:n}}}applyInner(t){if(!t.before.eq(this.doc))throw RangeError("Applying a mismatched transaction");let n=new Y6(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 Y2(this)}static create(t){let n=new Y9(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new Y6(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 Y9(this.schema,t.plugins),r=n.fields,i=new Y6(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 Y9(t.schema,t.plugins),o=new Y6(i);return i.fields.forEach(i=>{if("doc"==i.name)o.doc=GP.fromJSON(t.schema,n.doc);else if("selection"==i.name)o.selection=Y$.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 Y8{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:Je("plugin")}getState(t){return t[this.key]}}let Y7=Object.create(null);function Je(t){return t in Y7?t+"$"+ ++Y7[t]:(Y7[t]=0,t+"$")}class Jt{constructor(t="key"){this.key=Je(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}let Jn=function(t){for(var n=0;;n++)if(!(t=t.previousSibling))return n},Jr=function(t){let n=t.assignedSlot||t.parentNode;return n&&11==n.nodeType?n.host:n},Ji=null,Jo=function(t,n,r){let i=Ji||(Ji=document.createRange());return i.setEnd(t,r??t.nodeValue.length),i.setStart(t,n||0),i},Ja=function(t,n,r,i){return r&&(Js(t,n,r,i,-1)||Js(t,n,r,i,1))},Ju=/^(img|br|input|textarea|hr)$/i;function Js(t,n,r,i,o){for(;;){if(t==r&&n==i)return!0;if(n==(o<0?0:Jc(t))){let a=t.parentNode;if(!a||1!=a.nodeType||Jl(t)||Ju.test(t.nodeName)||"false"==t.contentEditable)return!1;n=Jn(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?Jc(t):0}}}function Jc(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Jl(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 Jf=function(t){return t.focusNode&&Ja(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Jd(t,n){let r=document.createEvent("Event");return r.initEvent("keydown",!0,!0),r.keyCode=t,r.key=r.code=n,r}function Jp(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 Jh="u">typeof navigator?navigator:null,Jm="u">typeof document?document:null,Jg=Jh&&Jh.userAgent||"",Jy=/Edge\/(\d+)/.exec(Jg),Jv=/MSIE \d/.exec(Jg),Jb=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Jg),Jx=!!(Jv||Jb||Jy),J_=Jv?document.documentMode:Jb?+Jb[1]:Jy?+Jy[1]:0,JS=!Jx&&/gecko\/(\d+)/i.test(Jg);JS&&(/Firefox\/(\d+)/.exec(Jg)||[0,0])[1];let JT=!Jx&&/Chrome\/(\d+)/.exec(Jg),Jw=!!JT,JO=JT?+JT[1]:0,Jk=!Jx&&!!Jh&&/Apple Computer/.test(Jh.vendor),JI=Jk&&(/Mobile\/\w+/.test(Jg)||!!Jh&&Jh.maxTouchPoints>2),JC=JI||!!Jh&&/Mac/.test(Jh.platform),JM=!!Jh&&/Win/.test(Jh.platform),JR=/Android \d/.test(Jg),JE=!!Jm&&"webkitFontSmoothing"in Jm.documentElement.style,Jj=JE?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function JN(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function JA(t,n){return"number"==typeof t?t:t[n]}function JP(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 JL(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=Jr(u)){if(1!=u.nodeType)continue;let s=u,c=s==a.body,l=c?JN(a):JP(s),f=0,d=0;if(n.top<l.top+JA(i,"top")?d=-(l.top-n.top+JA(o,"top")):n.bottom>l.bottom-JA(i,"bottom")&&(d=n.bottom-l.bottom+JA(o,"bottom")),n.left<l.left+JA(i,"left")?f=-(l.left-n.left+JA(o,"left")):n.right>l.right-JA(i,"right")&&(f=n.right-l.right+JA(o,"right")),f||d){if(c)a.defaultView.scrollBy(f,d);else{let p=s.scrollLeft,h=s.scrollTop;d&&(s.scrollTop+=d),f&&(s.scrollLeft+=f);let m=s.scrollLeft-p,g=s.scrollTop-h;n={left:n.left-m,top:n.top-g,right:n.right-m,bottom:n.bottom-g}}}if(c)break}}function JD(t){let n=[],r=t.ownerDocument;for(let i=t;i&&(n.push({dom:i,top:i.scrollTop,left:i.scrollLeft}),t!=r);i=Jr(i));return n}function JF(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 JW=null;function JU(t,n){return t.left>=n.left-1&&t.left<=n.right+1&&t.top>=n.top-1&&t.top<=n.bottom+1}function Jz(t){return t.top<t.bottom||t.left<t.right}function JB(t,n){let r=t.getClientRects();if(r.length){let i=r[n<0?0:r.length-1];if(Jz(i))return i}return Array.prototype.find.call(r,Jz)||t.getBoundingClientRect()}let JV=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function J$(t,n,r){let{node:i,offset:o,atom:a}=t.docView.domFromPos(n,r<0?-1:1),u=JE||JS;if(3==i.nodeType){if(u&&(JV.test(i.nodeValue)||(r<0?!o:o==i.nodeValue.length))){let s=JB(Jo(i,o,o),r);if(JS&&o&&/\s/.test(i.nodeValue[o-1])&&o<i.nodeValue.length){let c=JB(Jo(i,o-1,o-1),-1);if(c.top==s.top){let l=JB(Jo(i,o,o+1),-1);if(l.top!=s.top)return Jq(l,l.left<c.left)}}return s}{let f=o,d=o,p=r<0?1:-1;return r<0&&!o?(d++,p=-1):r>=0&&o==i.nodeValue.length?(f--,p=1):r<0?f--:d++,Jq(JB(Jo(i,f,d),p),p<0)}}if(!t.state.doc.resolve(n-(a||0)).parent.inlineContent){if(null==a&&o&&(r<0||o==Jc(i))){let h=i.childNodes[o-1];if(1==h.nodeType)return JK(h.getBoundingClientRect(),!1)}if(null==a&&o<Jc(i)){let m=i.childNodes[o];if(1==m.nodeType)return JK(m.getBoundingClientRect(),!0)}return JK(i.getBoundingClientRect(),r>=0)}if(null==a&&o&&(r<0||o==Jc(i))){let g=i.childNodes[o-1],y=3==g.nodeType?Jo(g,Jc(g)-(u?0:1)):1!=g.nodeType||"BR"==g.nodeName&&g.nextSibling?null:g;if(y)return Jq(JB(y,1),!1)}if(null==a&&o<Jc(i)){let v=i.childNodes[o];for(;v.pmViewDesc&&v.pmViewDesc.ignoreForCoords;)v=v.nextSibling;let b=v?3==v.nodeType?Jo(v,0,u?0:1):1==v.nodeType?v:null:null;if(b)return Jq(JB(b,-1),!0)}return Jq(JB(3==i.nodeType?Jo(i):i,-r),r>=0)}function Jq(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 JK(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 JH(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 JZ=/[\u0590-\u08ac]/,JG=null,JY=null,JJ=!1;class JQ{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>Jn(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))s=2&t.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==n)for(let c=t;;c=c.parentNode){if(c==this.dom){s=!1;break}if(c.previousSibling)break}if(null==s&&n==t.childNodes.length)for(let l=t;;l=l.parentNode){if(l==this.dom){s=!0;break}if(l.nextSibling)break}}return s??r>0?this.posAtEnd:this.posAtStart}nearestDesc(t,n=!1){for(let r=!0,i=t;i;i=i.parentNode){let o=this.getDesc(i),a;if(o&&(!n||o.node)){if(!r||!(a=o.nodeDOM)||(1==a.nodeType?a.contains(1==t.nodeType?t:t.parentNode):a==t))return o;r=!1}}}getDesc(t){let n=t.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(t,n,r){for(let i=t;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(t,n,r)}return -1}descAt(t){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],o=r+i.size;if(r==t&&o!=r){for(;!i.border&&i.children.length;)i=i.children[0];return i}if(t<o)return i.descAt(t-r-i.border);r=o}}domFromPos(t,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};let r=0,i=0;for(let o=0;r<this.children.length;r++){let a=this.children[r],u=o+a.size;if(u>t||a instanceof J5){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 JX&&s.side>=0;r--);if(n<=0){let c,l=!0;for(;!(!(c=r?this.children[r-1]:null)||c.dom.parentNode==this.contentDOM);r--,l=!1);return c&&n&&l&&!c.border&&!c.domAtom?c.domFromPos(c.size,n):{node:this.contentDOM,offset:c?Jn(c.dom)+1:0}}{let f,d=!0;for(;!(!(f=r<this.children.length?this.children[r]:null)||f.dom.parentNode==this.contentDOM);r++,d=!1);return f&&d&&!f.border&&!f.domAtom?f.domFromPos(0,n):{node:this.contentDOM,offset:f?Jn(f.dom):this.contentDOM.childNodes.length}}}parseRange(t,n,r=0){if(0==this.children.length)return{node:this.contentDOM,from:t,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let a=r,u=0;;u++){let s=this.children[u],c=a+s.size;if(-1==i&&t<=c){let l=a+s.border;if(t>=l&&n<=c-s.border&&s.node&&s.contentDOM&&this.contentDOM.contains(s.contentDOM))return s.parseRange(t,n,l);t=a;for(let f=u;f>0;f--){let d=this.children[f-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){i=Jn(d.dom)+1;break}t-=d.size}-1==i&&(i=0)}if(i>-1&&(c>n||u==this.children.length-1)){n=c;for(let p=u+1;p<this.children.length;p++){let h=this.children[p];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(-1)){o=Jn(h.dom);break}n+=h.size}-1==o&&(o=this.contentDOM.childNodes.length);break}a=c}return{node:this.contentDOM,from:t,to:n,fromOffset:i,toOffset:o}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[t<0?0:this.children.length-1];return 0==n.size||n.emptyChildAt(t)}domAfterPos(t){let{node:n,offset:r}=this.domFromPos(t,0);if(1!=n.nodeType||r==n.childNodes.length)throw RangeError("No node after pos "+t);return n.childNodes[r]}setSelection(t,n,r,i=!1){let o=Math.min(t,n),a=Math.max(t,n);for(let u=0,s=0;u<this.children.length;u++){let c=this.children[u],l=s+c.size;if(o>s&&a<l)return c.setSelection(t-s-c.border,n-s-c.border,r,i);s=l}let f=this.domFromPos(t,t?-1:1),d=n==t?f:this.domFromPos(n,n?-1:1),p=r.getSelection(),h=!1;if((JS||Jk)&&t==n){let{node:m,offset:g}=f;if(3==m.nodeType){if((h=!!(g&&m.nodeValue[g-1]==`
9
- `))&&g==m.nodeValue.length)for(let y=m,v;y;y=y.parentNode){if(v=y.nextSibling){"BR"==v.nodeName&&(f=d={node:v.parentNode,offset:Jn(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(JS&&p.focusNode&&p.focusNode!=d.node&&1==p.focusNode.nodeType){let _=p.focusNode.childNodes[p.focusOffset];_&&"false"==_.contentEditable&&(i=!0)}if(!(i||h&&Jk)&&Ja(f.node,f.offset,p.anchorNode,p.anchorOffset)&&Ja(d.node,d.offset,p.focusNode,p.focusOffset))return;let S=!1;if((p.extend||t==n)&&!h){p.collapse(f.node,f.offset);try{t!=n&&p.extend(d.node,d.offset),S=!0}catch{}}if(!S){if(t>n){let T=f;f=d,d=T}let w=document.createRange();w.setEnd(d.node,d.offset),w.setStart(f.node,f.offset),p.removeAllRanges(),p.addRange(w)}}ignoreMutation(t){return!this.contentDOM&&"selection"!=t.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,n){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],a=r+o.size;if(r==a?t<=a&&n>=r:t<a&&n>r){let u=r+o.border,s=a-o.border;if(t>=u&&n<=s){this.dirty=t==r||n==a?2:1,t==u&&n==s&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=3:o.markDirty(t-u,n-u);return}o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}r=a}this.dirty=2}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=1==t?2:1;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class JX extends JQ{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 J0 extends JQ{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 J1 extends JQ{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=Yn.renderSpec(document,n.type.spec.toDOM(n,r))),new J1(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=J1.create(this.parent,this.mark,!0,r),o=this.children,a=this.size;n<a&&(o=Qu(o,n,a,r)),t>0&&(o=Qu(o,0,t,r));for(let u=0;u<o.length;u++)o[u].parent=i;return i.children=o,i}}class J2 extends JQ{constructor(t,n,r,i,o,a,u,s,c){super(t,[],o,a),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=u}static create(t,n,r,i,o,a){let u=o.nodeViews[n.type.name],s,c=u&&u(n,o,()=>s?s.parent?s.parent.posBeforeChild(s):void 0:a,r,i),l=c&&c.dom,f=c&&c.contentDOM;if(n.isText){if(l){if(3!=l.nodeType)throw RangeError("Text must be rendered as a DOM text node")}else l=document.createTextNode(n.text)}else l||({dom:l,contentDOM:f}=Yn.renderSpec(document,n.type.spec.toDOM(n)));f||n.isText||"BR"==l.nodeName||(l.hasAttribute("contenteditable")||(l.contentEditable="false"),n.type.spec.draggable&&(l.draggable=!0));let d=l;return l=Qn(l,r,n),c?s=new J9(t,n,r,i,l,f||null,d,c,o,a+1):n.isText?new J4(t,n,r,i,l,d,o):new J2(t,n,r,i,l,f||null,d,o,a+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(t.preserveWhitespace="full"),this.contentDOM){if(this.contentLost){for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=()=>Gg.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)&&Qr(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 Qo(this,a&&a.node,t);(function(t,n,r,i){let o=n.locals(t),a=0;if(0==o.length){for(let u=0;u<t.childCount;u++){let s=t.child(u);i(s,o,n.forChild(a,s),u),a+=s.nodeSize}return}let c=0,l=[],f=null;for(let d=0;;){if(c<o.length&&o[c].to==a){let p=o[c++],h;for(;c<o.length&&o[c].to==a;)(h||(h=[p])).push(o[c++]);if(h){h.sort(Qa);for(let m=0;m<h.length;m++)r(h[m],d,!!f)}else r(p,d,!!f)}let g,y;if(f)y=-1,g=f,f=null;else if(d<t.childCount)y=d,g=t.child(d++);else break;for(let v=0;v<l.length;v++)l[v].to<=a&&l.splice(v--,1);for(;c<o.length&&o[c].from<=a&&o[c].to>a;)l.push(o[c++]);let b=a+g.nodeSize;if(g.isText){let x=b;c<o.length&&o[c].from<x&&(x=o[c].from);for(let _=0;_<l.length;_++)l[_].to<x&&(x=l[_].to);x<b&&(f=g.cut(x-a),g=g.cut(0,x-a),b=x,y=-1)}let S=g.isInline&&!g.isLeaf?l.filter(t=>!t.inline):l.slice();i(g,S,n.forChild(a,g),y),a=b}})(this.node,this.innerDeco,(n,o,a)=>{n.spec.marks?s.syncToMarks(n.spec.marks,r,t):n.type.side>=0&&!a&&s.syncToMarks(o==this.node.childCount?Gx.none:this.node.child(o).marks,r,t),s.placeWidget(n,t,i)},(n,a,c,l)=>{s.syncToMarks(n.marks,r,t);let f;s.findNodeMatch(n,a,c,l)||u&&t.state.selection.from>i&&t.state.selection.to<i+n.nodeSize&&(f=s.findIndexWithChild(o.node))>-1&&s.updateNodeAt(n,a,c,f,t)||s.updateNextNode(n,a,c,t,l,i)||s.addNode(n,a,c,t,i),i+=n.nodeSize}),s.syncToMarks([],r,t),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||2==this.dirty)&&(a&&this.protectLocalComposition(t,a),function t(n,r,i){let o=n.firstChild,a=!1;for(let u=0;u<r.length;u++){let s=r[u],c=s.dom;if(c.parentNode==n){for(;c!=o;)o=Qi(o),a=!0;o=o.nextSibling}else a=!0,n.insertBefore(c,o);if(s instanceof J1){let l=o?o.previousSibling:n.lastChild;t(s.contentDOM,s.children,i),o=l?l.nextSibling:n.firstChild}}for(;o;)o=Qi(o),a=!0;a&&i.trackWrites==n&&(i.trackWrites=null)}(this.contentDOM,this.children,t),JI&&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 YZ)||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=Jc(t=t.childNodes[n-1])}else{if(1!=t.nodeType||!(n<t.childNodes.length))return null;t=t.childNodes[n],n=0}}}(o.focusNode,o.focusOffset);if(!a||!this.dom.contains(a.parentNode))return null;if(!this.node.inlineContent)return{node:a,pos:-1,text:""};{let u=a.nodeValue,s=function(t,n,r,i){for(let o=0,a=0;o<t.childCount&&a<=i;){let u=t.child(o++);if(a+=u.nodeSize,!u.isText)continue;let s=u.text;for(;o<t.childCount;){let c=t.child(o++);if(a+=c.nodeSize,!c.isText)break;s+=c.text}if(a>=r){let l=a<i?s.lastIndexOf(n,i-a-1):-1;if(l>=0&&l+n.length+a>=r)return a+l;if(r==i&&s.length>=i+n.length-a&&s.slice(i-a,i-a+n.length)==n)return i}}return -1}(this.node.content,u,r-n,i-n);return s<0?null:{node:a,pos:s,text:u}}}protectLocalComposition(t,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let a=new J0(this,o,n,i);t.input.compositionNodes.push(a),this.children=Qu(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(Qr(t,this.outerDeco))return;let n=1!=this.nodeDOM.nodeType,r=this.dom;this.dom=Qe(this.dom,this.nodeDOM,J7(this.outerDeco,this.node,n),J7(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 J3(t,n,r,i,o){Qn(i,n,t);let a=new J2(void 0,t,n,r,i,i,i,o,0);return a.contentDOM&&a.updateChildren(o,0),a}class J4 extends J2{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 J4(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 J5 extends JQ{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 J9 extends J2{constructor(t,n,r,i,o,a,u,s,c,l){super(t,n,r,i,o,a,u,c,l),this.spec=s}update(t,n,r,i){if(3==this.dirty)return!1;if(!this.spec.update)return(!!this.contentDOM||!!t.isLeaf)&&super.update(t,n,r,i);{let o=this.spec.update(t,n,r);return o&&this.updateInner(t,n,r,i),o}}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,n,r,i){this.spec.setSelection?this.spec.setSelection(t,n,r):super.setSelection(t,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return!!this.spec.stopEvent&&this.spec.stopEvent(t)}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}let J6=function(t){t&&(this.nodeName=t)};J6.prototype=Object.create(null);let J8=[new J6];function J7(t,n,r){if(0==t.length)return J8;let i=r?J8[0]:new J6,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 J6(u.nodeName)),u){let c=u[s];null!=c&&(r&&1==o.length&&o.push(i=new J6(n.isInline?"span":"div")),"class"==s?i.class=(i.class?i.class+" ":"")+c:"style"==s?i.style=(i.style?i.style+";":"")+c:"nodeName"!=s&&(i[s]=c))}}return o}function Qe(t,n,r,i){if(r==J8&&i==J8)return n;let o=n;for(let a=0;a<i.length;a++){let u=i[a],s=r[a];if(a){let c;s&&s.nodeName==u.nodeName&&o!=t&&(c=o.parentNode)&&c.nodeName.toLowerCase()==u.nodeName||((c=document.createElement(u.nodeName)).pmIsDeco=!0,c.appendChild(o),s=J8[0]),o=c}Qt(o,s||J8[0],u)}return o}function Qt(t,n,r){for(let i in n)"class"==i||"style"==i||"nodeName"==i||i in r||t.removeAttribute(i);for(let o in r)"class"!=o&&"style"!=o&&"nodeName"!=o&&r[o]!=n[o]&&t.setAttribute(o,r[o]);if(n.class!=r.class){let a=n.class?n.class.split(" ").filter(Boolean):[],u=r.class?r.class.split(" ").filter(Boolean):[];for(let s=0;s<a.length;s++)-1==u.indexOf(a[s])&&t.classList.remove(a[s]);for(let c=0;c<u.length;c++)-1==a.indexOf(u[c])&&t.classList.add(u[c]);0==t.classList.length&&t.removeAttribute("class")}if(n.style!=r.style){if(n.style){let l=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,f;for(;f=l.exec(n.style);)t.style.removeProperty(f[1])}r.style&&(t.style.cssText+=r.style)}}function Qn(t,n,r){return Qe(t,t,J8,J7(n,r,1!=t.nodeType))}function Qr(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 Qi(t){let n=t.nextSibling;return t.parentNode.removeChild(t),n}class Qo{constructor(t,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=function(t,n){let r=n,i=r.children.length,o=t.childCount,a=new Map,u=[];e:for(;o>0;){let s;for(;;)if(i){let c=r.children[i-1];if(c instanceof J1)r=c,i=c.children.length;else{s=c,i--;break}}else{if(r==n)break e;i=r.parent.children.indexOf(r),r=r.parent}let l=s.node;if(l){if(l!=t.child(o-1))break;--o,a.set(s,o),u.push(s)}}return{index:o,matched:a,matches:u.reverse()}}(t.node.content,t)}destroyBetween(t,n){if(t!=n){for(let r=t;r<n;r++)this.top.children[r].destroy();this.top.children.splice(t,n-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,n,r){let i=0,o=this.stack.length>>1,a=Math.min(o,t.length);for(;i<a&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(t[i])&&!1!==t[i].type.spec.spanning;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<t.length;){this.stack.push(this.top,this.index+1);let u=-1;for(let s=this.index;s<Math.min(this.index+3,this.top.children.length);s++){let c=this.top.children[s];if(c.matchesMark(t[o])&&!this.isLocked(c.dom)){u=s;break}}if(u>-1)u>this.index&&(this.changed=!0,this.destroyBetween(this.index,u)),this.top=this.top.children[this.index];else{let l=J1.create(this.top,t[o],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,o++}}findNodeMatch(t,n,r,i){let o=-1,a;if(i>=this.preMatch.index&&(a=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&a.matchesNode(t,n,r))o=this.top.children.indexOf(a,this.index);else for(let u=this.index,s=Math.min(this.top.children.length,u+5);u<s;u++){let c=this.top.children[u];if(c.matchesNode(t,n,r)&&!this.preMatch.matched.has(c)){o=u;break}}return!(o<0)&&(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(t,n,r,i,o){let a=this.top.children[i];return 3==a.dirty&&a.dom==a.contentDOM&&(a.dirty=2),!!a.update(t,n,r,o)&&(this.destroyBetween(this.index,i),this.index++,!0)}findIndexWithChild(t){for(;;){let n=t.parentNode;if(!n)return -1;if(n==this.top.contentDOM){let r=t.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return -1}t=n}}updateNextNode(t,n,r,i,o,a){for(let u=this.index;u<this.top.children.length;u++){let s=this.top.children[u];if(s instanceof J2){let c=this.preMatch.matched.get(s);if(null!=c&&c!=o)return!1;let l=s.dom,f,d=this.isLocked(l)&&!(t.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==t.text&&3!=s.dirty&&Qr(n,s.outerDeco));if(!d&&s.update(t,n,r,i))return this.destroyBetween(this.index,u),s.dom!=l&&(this.changed=!0),this.index++,!0;if(!d&&(f=this.recreateWrapper(s,t,n,r,i,a)))return this.top.children[this.index]=f,f.dirty=2,f.updateChildren(i,a+1),f.dirty=0,this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(t,n,r,i,o,a){if(t.dirty||n.isAtom||!t.children.length||!t.node.content.eq(n.content))return null;let u=J2.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=J2.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 JX(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 J1;)t=(n=t).children[n.children.length-1];(!t||!(t instanceof J4)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((Jk||Jw)&&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 J5(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 Qa(t,n){return t.type.side-n.type.side}function Qu(t,n,r,i,o){let a=[];for(let u=0,s=0;u<t.length;u++){let c=t[u],l=s+=c.size;s>=r||l<=n?a.push(c):(s<n&&a.push(c.slice(0,n-s,i)),o&&(a.push(o),o=void 0),l>r&&a.push(c.slice(r-s,c.size,i)))}return a}function Qs(t,n=null){let r=t.domSelectionRange(),i=t.state.doc;if(!r.focusNode)return null;let o=t.docView.nearestDesc(r.focusNode),a=o&&0==o.size,u=t.docView.posFromDOM(r.focusNode,r.focusOffset,1);if(u<0)return null;let s=i.resolve(u),c,l;if(Jf(r)){for(c=s;o&&!o.node;)o=o.parent;let f=o.node;if(o&&f.isAtom&&YY.isSelectable(f)&&o.parent&&!(f.isInline&&function(t,n,r){for(let i=0==n,o=n==Jc(t);i||o;){if(t==r)return!0;let a=Jn(t);if(!(t=t.parentNode))return!1;i=i&&0==a,o=o&&a==Jc(t)}}(r.focusNode,r.focusOffset,o.dom))){let d=o.posBefore;l=new YY(u==d?s:i.resolve(d))}}else{let p=t.docView.posFromDOM(r.anchorNode,r.anchorOffset,1);if(p<0)return null;c=i.resolve(p)}if(!l){let h="pointer"==n||t.state.selection.head<s.pos&&!a?1:-1;l=Qy(t,c,s,h)}return l}function Qc(t){return t.editable?t.hasFocus():Qb(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Ql(t,n=!1){let r=t.state.selection;if(Qm(t,r),Qc(t)){var i,o;if(!n&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Jw){let a=t.domSelectionRange(),u=t.domObserver.currentSelection;if(a.anchorNode&&u.anchorNode&&Ja(a.anchorNode,a.anchorOffset,u.anchorNode,u.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper){let s,c,l,f;i=t,s=i.domSelection(),c=document.createRange(),l=i.cursorWrapper.dom,f="IMG"==l.nodeName,f?c.setEnd(l.parentNode,Jn(l)+1):c.setEnd(l,0),c.collapse(!1),s.removeAllRanges(),s.addRange(c),!f&&!i.state.selection.visible&&Jx&&J_<=11&&(l.disabled=!0,l.disabled=!1)}else{let{anchor:d,head:p}=r,h,m,g,y,v,b;!Qf||r instanceof YZ||(r.$from.parent.inlineContent||(h=Qd(t,r.from)),r.empty||r.$from.parent.inlineContent||(m=Qd(t,r.to))),t.docView.setSelection(d,p,t.root,n),Qf&&(h&&Qh(h),m&&Qh(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(()=>{(!Qc(o)||o.state.selection.visible)&&o.dom.classList.remove("ProseMirror-hideselection")},20))})))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}let Qf=Jk||Jw&&JO<63;function Qd(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(Jk&&o&&"false"==o.contentEditable)return Qp(o);if((!o||"false"==o.contentEditable)&&(!a||"false"==a.contentEditable)){if(o)return Qp(o);if(a)return Qp(a)}}function Qp(t){return t.contentEditable="true",Jk&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Qh(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function Qm(t,n){if(n instanceof YY){let r=t.docView.descAt(n.from);r!=t.lastSelectedViewDesc&&(Qg(t),r&&r.selectNode(),t.lastSelectedViewDesc=r)}else Qg(t)}function Qg(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Qy(t,n,r,i){return t.someProp("createSelectionBetween",i=>i(t,n,r))||YZ.between(n,r,i)}function Qv(t){return(!t.editable||!!t.hasFocus())&&Qb(t)}function Qb(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 Qx(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&&Y$.findFrom(a,n)}function Q_(t,n){return t.dispatch(t.state.tr.setSelection(n).scrollIntoView()),!0}function QS(t,n,r){let i=t.state.selection;if(i instanceof YZ){if(!i.empty||r.indexOf("s")>-1)return!1;if(t.endOfTextblock(n>0?"forward":"backward")){let o=Qx(t.state,n);return!!o&&o instanceof YY&&Q_(t,o)}if(!(JC&&r.indexOf("m")>-1)){let a=i.$head,u=a.textOffset?null:n<0?a.nodeBefore:a.nodeAfter,s;if(!u||u.isText)return!1;let c=n<0?a.pos-u.nodeSize:a.pos;return!!(u.isAtom||(s=t.docView.descAt(c))&&!s.contentDOM)&&(YY.isSelectable(u)?Q_(t,new YY(n<0?t.state.doc.resolve(a.pos-u.nodeSize):a)):!!JE&&Q_(t,new YZ(t.state.doc.resolve(n<0?c:c+u.nodeSize))))}}else{if(i instanceof YY&&i.node.isInline)return Q_(t,new YZ(n>0?i.$to:i.$from));{let l=Qx(t.state,n);return!!l&&Q_(t,l)}}}function QT(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Qw(t){let n=t.pmViewDesc;return n&&0==n.size&&(t.nextSibling||"BR"!=t.nodeName)}function QO(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(JS&&1==r.nodeType&&i<QT(r)&&Qw(r.childNodes[i])&&(u=!0);;)if(i>0){if(1!=r.nodeType)break;{let s=r.childNodes[i-1];if(Qw(s))o=r,a=--i;else if(3==s.nodeType)i=(r=s).nodeValue.length;else break}}else{if(QI(r))break;{let c=r.previousSibling;for(;c&&Qw(c);)o=r.parentNode,a=Jn(c),c=c.previousSibling;if(c)i=QT(r=c);else{if((r=r.parentNode)==t.dom)break;i=0}}}u?QC(t,r,i):o&&QC(t,o,a)}(t):Qk(t)}function Qk(t){let n=t.domSelectionRange(),r=n.focusNode,i=n.focusOffset;if(!r)return;let o=QT(r),a,u;for(;;)if(i<o){if(1!=r.nodeType)break;if(Qw(r.childNodes[i]))a=r,u=++i;else break}else{if(QI(r))break;{let s=r.nextSibling;for(;s&&Qw(s);)a=s.parentNode,u=Jn(s)+1,s=s.nextSibling;if(s)i=0,o=QT(r=s);else{if((r=r.parentNode)==t.dom)break;i=o=0}}}a&&QC(t,a,u)}function QI(t){let n=t.pmViewDesc;return n&&n.node&&n.node.isBlock}function QC(t,n,r){let i=t.domSelection();if(Jf(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&&Ql(t)},50)}function QM(t,n){let r=t.state.doc.resolve(n);if(!(Jw||JM)&&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 QR(t,n,r){let i=t.state.selection;if(i instanceof YZ&&!i.empty||r.indexOf("s")>-1||JC&&r.indexOf("m")>-1)return!1;let{$from:o,$to:a}=i;if(!o.parent.inlineContent||t.endOfTextblock(n<0?"up":"down")){let u=Qx(t.state,n);if(u&&u instanceof YY)return Q_(t,u)}if(!o.parent.inlineContent){let s=n<0?o:a,c=i instanceof YQ?Y$.near(s,n):Y$.findFrom(s,n);return!!c&&Q_(t,c)}return!1}function QE(t,n){if(!(t.state.selection instanceof YZ))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 Qj(t,n,r){t.domObserver.stop(),n.contentEditable=r,t.domObserver.start()}function QN(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")||Yn.fromSchema(t.state.schema),c=QV(),l=c.createElement("div");l.appendChild(s.serializeFragment(i,{document:c}));let f=l.firstChild,d,p=0;for(;f&&1==f.nodeType&&(d=Qz[f.nodeName.toLowerCase()]);){for(let h=d.length-1;h>=0;h--){let m=c.createElement(d[h]);for(;l.firstChild;)m.appendChild(l.firstChild);l.appendChild(m),p++}f=l.firstChild}return f&&1==f.nodeType&&f.setAttribute("data-pm-slice",`${o} ${a}${p?` -${p}`:""} ${JSON.stringify(r)}`),{dom:l,text:t.someProp("clipboardTextSerializer",r=>r(n,t))||n.content.textBetween(0,n.content.size,`
10
-
11
- `)}}function QA(t,n,r,i,o){let a=o.parent.type.spec.code,u,s;if(!r&&!n)return null;let c=n&&(i||a||!r);if(c){if(t.someProp("transformPastedText",r=>{n=r(n,a||i,t)}),a)return n?new GS(Gg.from(t.state.schema.text(n.replace(/\r\n?/g,`
12
- `))),0,0):GS.empty;let l=t.someProp("clipboardTextParser",r=>r(n,o,i,t));if(l)s=l;else{let f=o.marks(),{schema:d}=t.state,p=Yn.fromSchema(d);u=document.createElement("div"),n.split(/(?:\r\n?|\n)+/).forEach(t=>{let n=u.appendChild(document.createElement("p"));t&&n.appendChild(p.serializeNode(d.text(t,f)))})}}else t.someProp("transformPastedHTML",n=>{r=n(r,t)}),u=function(t){let n=/^(\s*<meta [^>]*>)*/.exec(t);n&&(t=t.slice(n[0].length));let r=QV().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(t),o;if((o=i&&Qz[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),JE&&function(t){let n=t.querySelectorAll(Jw?"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")||G2.fromSchema(t.state.schema)).parseSlice(u,{preserveWhitespace:!!(c||m),context:o,ruleFromNode:t=>"BR"!=t.nodeName||t.nextSibling||!t.parentNode||QP.test(t.parentNode.nodeName)?null:{ignore:!0}})),m)s=function(t,n){if(!t.size)return t;let r=t.content.firstChild.type.schema,i;try{i=JSON.parse(n)}catch{return t}let{content:o,openStart:a,openEnd:u}=t;for(let s=i.length-2;s>=0;s-=2){let c=r.nodes[i[s]];if(!c||c.hasRequiredAttrs())break;o=Gg.from(c.create(i[s+1],o)),a++,u++}return new GS(o,a,u)}(QU(s,+m[1],+m[2]),m[4]);else if((s=GS.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&&QD(n,o,t,a[a.length-1],0))a[a.length-1]=r;else{a.length&&(a[a.length-1]=QF(a[a.length-1],o.length));let u=QL(t,n);a.push(u),i=i.matchType(u.type),o=n}}),a)return Gg.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=QU(s,v,b)}return t.someProp("transformPasted",n=>{s=n(s,t)}),s}let QP=/^(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 QL(t,n,r=0){for(let i=n.length-1;i>=r;i--)t=n[i].create(null,Gg.from(t));return t}function QD(t,n,r,i,o){if(o<t.length&&o<n.length&&t[o]==n[o]){let a=QD(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(Gg.from(QL(r,t,o+1))))}}function QF(t,n){if(0==n)return t;let r=t.content.replaceChild(t.childCount-1,QF(t.lastChild,n-1)),i=t.contentMatchAt(t.childCount).fillBefore(Gg.empty,!0);return t.copy(r.append(i))}function QW(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=QW(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(Gg.empty,!0))),t.replaceChild(n<0?0:t.childCount-1,u.copy(s))}function QU(t,n,r){return n<t.openStart&&(t=new GS(QW(t.content,-1,n,t.openStart,0,t.openEnd),n,t.openEnd)),r<t.openEnd&&(t=new GS(QW(t.content,1,r,t.openEnd,0,0),t.openStart,r)),t}let Qz={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},QB=null;function QV(){return QB||(QB=document.implementation.createHTMLDocument("title"))}let Q$={},Qq={},QK={touchstart:!0,touchmove:!0};class QH{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 QZ(t,n){t.input.lastSelectionOrigin=n,t.input.lastSelectionTime=Date.now()}function QG(t){t.someProp("handleDOMEvents",n=>{for(let r in n)t.input.eventHandlers[r]||t.dom.addEventListener(r,t.input.eventHandlers[r]=n=>QY(t,n))})}function QY(t,n){return t.someProp("handleDOMEvents",r=>{let i=r[n.type];return!!i&&(i(t,n)||n.defaultPrevented)})}function QJ(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 QQ(t){return{left:t.clientX,top:t.clientY}}function QX(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 Q0(t,n,r){t.focused||t.focus();let i=t.state.tr.setSelection(n);"pointer"==r&&i.setMeta("pointer",!0),t.dispatch(i)}function Q1(t,n,r,i){return QX(t,"handleDoubleClickOn",n,r,i)||t.someProp("handleDoubleClick",r=>r(t,n,i))}function Q2(t,n,r,i){return QX(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&&(Q0(t,YZ.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)Q0(t,YZ.create(i,s+1,s+1+u.content.size),"pointer");else{if(!YY.isSelectable(u))continue;Q0(t,YY.create(i,s),"pointer")}return!0}}(t,r,i)}Qq.keydown=(t,n)=>{if(t.input.shiftKey=16==n.keyCode||n.shiftKey,!Q5(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(JR&&Jw&&13==n.keyCode))){if(229!=n.keyCode&&t.domObserver.forceFlush(),!JI||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||JC&&72==o&&"c"==a)return QE(t,-1)||QO(t,-1);if(46==o&&!n.shiftKey||JC&&68==o&&"c"==a)return QE(t,1)||QO(t,1);if(13==o||27==o)return!0;if(37==o||JC&&66==o&&"c"==a){let u=37==o?"ltr"==QM(t,t.state.selection.from)?-1:1:-1;return QS(t,u,a)||QO(t,u)}if(39==o||JC&&70==o&&"c"==a){let s=39==o?"ltr"==QM(t,t.state.selection.from)?1:-1:1;return QS(t,s,a)||QO(t,s)}return 38==o||JC&&80==o&&"c"==a?QR(t,-1,a)||QO(t,-1):40==o||JC&&78==o&&"c"==a?function(t){if(!Jk||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;Qj(t,i,"true"),setTimeout(()=>Qj(t,i,"false"),20)}return!1}(t)||QR(t,1,a)||Qk(t):a==(JC?"m":"c")&&(66==o||73==o||89==o||90==o)}(t,n)?n.preventDefault():QZ(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,Jd(13,"Enter"))),t.input.lastIOSEnter=0)},200)}}},Qq.keyup=(t,n)=>{16==n.keyCode&&(t.input.shiftKey=!1)},Qq.keypress=(t,n)=>{if(Q5(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||JC&&n.metaKey)return;if(t.someProp("handleKeyPress",r=>r(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof YZ)||!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 Q3=JC?"metaKey":"ctrlKey";Q$.mousedown=(t,n)=>{var r,i,o;t.input.shiftKey=n.shiftKey;let a=Q7(t),u=Date.now(),s="singleClick",c,l;u-t.input.lastClick.time<500&&(c=(o=t.input.lastClick).x-n.clientX,c*c+(l=o.y-n.clientY)*l<100)&&!n[Q3]&&("singleClick"==t.input.lastClick.type?s="doubleClick":"doubleClick"==t.input.lastClick.type&&(s="tripleClick")),t.input.lastClick={time:u,x:n.clientX,y:n.clientY,type:s};let f=t.posAtCoords(QQ(n));f&&("singleClick"==s?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new Q4(t,f,n,!!a)):("doubleClick"==s?Q1:Q2)(t,f.pos,f.inside,n)?n.preventDefault():QZ(t,"pointer"))};class Q4{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[Q3],this.allowDefault=r.shiftKey;let o,a;if(n.inside>-1)o=t.state.doc.nodeAt(n.inside),a=n.inside;else{let u=t.state.doc.resolve(n.pos);o=u.parent,a=u.depth?u.before():0}let s=i?null:r.target,c=s?t.docView.nearestDesc(s,!0):null;this.target=c?c.dom:null;let{selection:l}=t.state;(0==r.button&&o.type.spec.draggable&&!1!==o.type.spec.selectable||l instanceof YY&&l.from<=a&&l.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&JS&&!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)),QZ(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(()=>Ql(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(QQ(t))),this.updateAllowDefault(t),this.allowDefault||!u?QZ(this.view,"pointer"):(n=this.view,r=u.pos,i=u.inside,a=this.selectNode,QX(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 YY&&(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(YY.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&&(Q0(t,YY.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&&YY.isSelectable(i))&&(Q0(t,new YY(r),"pointer"),!0)}(n,i)))?t.preventDefault():0==t.button&&(this.flushed||Jk&&this.mightDrag&&!this.mightDrag.node.isAtom||Jw&&!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)))?(Q0(this.view,Y$.near(this.view.state.doc.resolve(u.pos)),"pointer"),t.preventDefault()):QZ(this.view,"pointer")}move(t){this.updateAllowDefault(t),QZ(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 Q5(t,n){return!!t.composing||!!(Jk&&500>Math.abs(n.timeStamp-t.input.compositionEndedAt))&&(t.input.compositionEndedAt=-2e8,!0)}Q$.touchstart=t=>{t.input.lastTouch=Date.now(),Q7(t),QZ(t,"pointer")},Q$.touchmove=t=>{t.input.lastTouch=Date.now(),QZ(t,"pointer")},Q$.contextmenu=t=>{var n;return Q7(t)};let Q9=JR?5e3:-1;function Q6(t,n){clearTimeout(t.input.composingTimeout),n>-1&&(t.input.composingTimeout=setTimeout(()=>Q7(t),n))}function Q8(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 Q7(t,n=!1){if(!(JR&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Q8(t),n||t.docView&&t.docView.dirty){let r=Qs(t);return r&&!r.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(r)):t.updateState(t.state),!0}return!1}}Qq.compositionstart=Qq.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(),Q7(t,!0),t.markCursor=null;else if(Q7(t),JS&&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}Q6(t,Q9)},Qq.compositionend=(t,n)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=n.timeStamp,t.input.compositionID++,Q6(t,20))};let Xe=Jx&&J_<15||JI&&Jj<604;function Xt(t,n,r,i,o){var a;let u=QA(t,n,r,i,t.state.selection.$from);if(t.someProp("handlePaste",n=>n(t,o,u||GS.empty)))return!0;if(!u)return!1;let s=0==u.openStart&&0==u.openEnd&&1==u.content.childCount?u.content.firstChild:null,c=s?t.state.tr.replaceSelectionWith(s,i):t.state.tr.replaceSelection(u);return t.dispatch(c.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Q$.copy=Qq.cut=(t,n)=>{let r=t.state.selection,i="cut"==n.type;if(r.empty)return;let o=Xe?null:n.clipboardData,{dom:a,text:u}=QN(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"))},Qq.paste=(t,n)=>{if(t.composing&&!JR)return;let r=Xe?null:n.clipboardData,i=t.input.shiftKey&&45!=t.input.lastKeyCode;r&&Xt(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?Xt(t,i.value,null,o,n):Xt(t,i.textContent,i.innerHTML,o,n)},50)}(t,n)};class Xn{constructor(t,n){this.slice=t,this.move=n}}let Xr=JC?"altKey":"ctrlKey";for(let Xi in Q$.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(QQ(r));if(!(a&&a.pos>=o.from&&a.pos<=(o instanceof YY?o.to-1:o.to))){if(i&&i.mightDrag)t.dispatch(t.state.tr.setSelection(YY.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(YY.create(t.state.doc,u.posBefore)))}}let s=t.state.selection.content(),{dom:c,text:l}=QN(t,s);r.dataTransfer.clearData(),r.dataTransfer.setData(Xe?"Text":"text/html",c.innerHTML),r.dataTransfer.effectAllowed="copyMove",Xe||r.dataTransfer.setData("text/plain",l),t.dragging=new Xn(s,!r[Xr])},Q$.dragend=t=>{let n=t.dragging;window.setTimeout(()=>{t.dragging==n&&(t.dragging=null)},50)},Qq.dragover=Qq.dragenter=(t,n)=>n.preventDefault(),Qq.drop=(t,n)=>{let r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(QQ(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=QA(t,n.dataTransfer.getData(Xe?"Text":"text/plain"),Xe?null:n.dataTransfer.getData("text/html"),!1,o);let u=!!(r&&!n[Xr]);if(t.someProp("handleDrop",r=>r(t,n,a||GS.empty,u))){n.preventDefault();return}if(!a)return;n.preventDefault();let s=a?function(t,n,r){let i=t.resolve(n);if(!r.content.size)return n;let o=r.content;for(let a=0;a<r.openStart;a++)o=o.firstChild.content;for(let u=1;u<=(0==r.openStart&&r.size?2:1);u++)for(let s=i.depth;s>=0;s--){let c=s==i.depth?0:i.pos<=(i.start(s+1)+i.end(s+1))/2?-1:1,l=i.index(s)+(c>0?1:0),f=i.node(s),d=!1;if(1==u)d=f.canReplace(l,l,o);else{let p=f.contentMatchAt(l).findWrapping(o.firstChild.type);d=p&&f.canReplaceWith(l,l,p[0])}if(d)return 0==c?i.pos:c<0?i.before(s+1):i.after(s+1)}return null}(t.state.doc,o.pos,a):o.pos;null==s&&(s=o.pos);let c=t.state.tr;u&&c.deleteSelection();let l=c.mapping.map(s),f=0==a.openStart&&0==a.openEnd&&1==a.content.childCount,d=c.doc;if(f?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(d))return;let p=c.doc.resolve(l);if(f&&YY.isSelectable(a.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new YY(p));else{let h=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((t,n,r,i)=>h=i),c.setSelection(Qy(t,p,c.doc.resolve(h)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))},Q$.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())&&Ql(t)},20))},Q$.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)},Q$.beforeinput=(t,n)=>{if(Jw&&JR&&"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,Jd(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)}},Qq)Q$[Xi]=Qq[Xi];function Xo(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 Xa{constructor(t,n){this.toDOM=t,this.spec=n||Xf,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 Xc(o-r,o-r,this)}valid(){return!0}eq(t){return this==t||t instanceof Xa&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Xo(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Xu{constructor(t,n){this.attrs=t,this.spec=n||Xf}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 Xc(o,a,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof Xu&&Xo(this.attrs,t.attrs)&&Xo(this.spec,t.spec)}static is(t){return t.type instanceof Xu}destroy(){}}let Xs=class t{constructor(t,n){this.attrs=t,this.spec=n||Xf}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 Xc(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&&Xo(this.attrs,n.attrs)&&Xo(this.spec,n.spec)}destroy(){}};class Xc{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new Xc(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 Xc(t,t,new Xa(n,r))}static inline(t,n,r,i){return new Xc(t,n,new Xu(r,i))}static node(t,n,r,i){return new Xc(t,n,new Xs(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Xu}}let Xl=[],Xf={};class Xd{constructor(t,n){this.local=t.length?t:Xl,this.children=n.length?n:Xl}static create(t,n){return n.length?Xv(n,t,0,Xf):Xp}find(t,n,r){let i=[];return this.findInner(t??0,n??1e9,i,0,r),i}findInner(t,n,r,i,o){for(let a=0;a<this.local.length;a++){let u=this.local[a];u.from<=n&&u.to>=t&&(!o||o(u.spec))&&r.push(u.copy(u.from+i,u.to+i))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>t){let c=this.children[s]+1;this.children[s+2].findInner(t-c,n-c,r,i+c,o)}}map(t,n,r){return this==Xp||0==t.maps.length?this:this.mapInner(t,n,0,0,r||Xf)}mapInner(t,n,r,i,o){let a;for(let u=0;u<this.local.length;u++){let s=this.local[u].map(t,r,i);s&&s.type.valid(n,s)?(a||(a=[])).push(s):o.onRemove&&o.onRemove(this.local[u].spec)}return this.children.length?function(t,n,r,i,o,a,u){let s=t.slice();for(let c=0,l=a;c<r.maps.length;c++){let f=0;r.maps[c].forEach((t,n,r,i)=>{let a=i-r-(n-t);for(let u=0;u<s.length;u+=3){let c=s[u+1];if(c<0||t>c+l-f)continue;let d=s[u]+l-f;n>=d?s[u+1]=t<=d?-2:-1:r>=o&&a&&(s[u]+=a,s[u+1]+=a)}f+=a}),l=r.maps[c].map(l,-1)}let d=!1;for(let p=0;p<s.length;p+=3)if(s[p+1]<0){if(-2==s[p+1]){d=!0,s[p+1]=-1;continue}let h=r.map(t[p]+a),m=h-o;if(m<0||m>=i.content.size){d=!0;continue}let g=r.map(t[p+1]+a,-1)-o,{index:y,offset:v}=i.content.findIndex(m),b=i.maybeChild(y);if(b&&v==m&&v+b.nodeSize==g){let x=s[p+2].mapInner(r,b,h+1,t[p]+a+1,u);x!=Xp?(s[p]=m,s[p+1]=g,s[p+2]=x):(s[p+1]=-2,d=!0)}else d=!0}if(d){let _=function(t,n,r,i,o,a,u){function s(t,n){for(let a=0;a<t.local.length;a++){let c=t.local[a].map(i,o,n);c?r.push(c):u.onRemove&&u.onRemove(t.local[a].spec)}for(let l=0;l<t.children.length;l+=3)s(t.children[l+2],t.children[l]+n+1)}for(let c=0;c<t.length;c+=3)-1==t[c+1]&&s(t[c+2],n[c]+a+1);return r}(s,t,n,r,o,a,u),S=Xv(_,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 Xd(n.sort(Xb),s)}(this.children,a||[],t,n,r,i,o):a?new Xd(a.sort(Xb),Xl):Xp}add(t,n){return n.length?this==Xp?Xd.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=Xg(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,Xv(s,t,u+1,Xf)),o+=3}});let a=Xm(o?Xy(n):n,-r);for(let u=0;u<a.length;u++)a[u].type.valid(t,a[u])||a.splice(u--,1);return new Xd(a.length?this.local.concat(a).sort(Xb):this.local,i||this.children)}remove(t){return 0==t.length||this==Xp?this:this.removeInner(t,0)}removeInner(t,n){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let a,u=r[o]+n,s=r[o+1]+n;for(let c=0,l;c<t.length;c++)(l=t[c])&&l.from>u&&l.to<s&&(t[c]=null,(a||(a=[])).push(l));if(!a)continue;r==this.children&&(r=this.children.slice());let f=r[o+2].removeInner(a,u+1);f!=Xp?r[o+2]=f:(r.splice(o,3),o-=3)}if(i.length){for(let d=0,p;d<t.length;d++)if(p=t[d])for(let h=0;h<i.length;h++)i[h].eq(p,n)&&(i==this.local&&(i=this.local.slice()),i.splice(h--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Xd(i,r):Xp}forChild(t,n){if(this==Xp)return this;if(n.isLeaf)return Xd.empty;let r,i;for(let o=0;o<this.children.length;o+=3)if(this.children[o]>=t){this.children[o]==t&&(r=this.children[o+2]);break}let a=t+1,u=a+n.content.size;for(let s=0;s<this.local.length;s++){let c=this.local[s];if(c.from<u&&c.to>a&&c.type instanceof Xu){let l=Math.max(a,c.from)-a,f=Math.min(u,c.to)-a;l<f&&(i||(i=[])).push(c.copy(l,f))}}if(i){let d=new Xd(i.sort(Xb),Xl);return r?new Xh([d,r]):d}return r||Xp}eq(t){if(this==t)return!0;if(!(t instanceof Xd)||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 Xx(this.localsInner(t))}localsInner(t){if(this==Xp)return Xl;if(t.inlineContent||!this.local.some(Xu.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Xu||n.push(this.local[r]);return n}}Xd.empty=new Xd([],[]),Xd.removeOverlap=Xx;let Xp=Xd.empty;class Xh{constructor(t){this.members=t}map(t,n){let r=this.members.map(r=>r.map(t,n,Xf));return Xh.from(r)}forChild(t,n){if(n.isLeaf)return Xd.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(t,n);o!=Xp&&(o instanceof Xh?r=r.concat(o.members):r.push(o))}return Xh.from(r)}eq(t){if(!(t instanceof Xh)||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?Xx(r?n:n.sort(Xb)):Xl}static from(t){switch(t.length){case 0:return Xp;case 1:return t[0];default:return new Xh(t.every(t=>t instanceof Xd)?t:t.reduce((t,n)=>t.concat(n instanceof Xd?n:n.members),[]))}}}function Xm(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 Xc(o.from+n,o.to+n,o.type))}return r}function Xg(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 Xy(t){let n=[];for(let r=0;r<t.length;r++)null!=t[r]&&n.push(t[r]);return n}function Xv(t,n,r,i){let o=[],a=!1;n.forEach((n,u)=>{let s=Xg(t,n,u+r);if(s){a=!0;let c=Xv(s,n,r+u+1,i);c!=Xp&&o.push(u,u+n.nodeSize,c)}});let u=Xm(a?Xy(t):t,-r).sort(Xb);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 Xd(u,o):Xp}function Xb(t,n){return t.from-n.from||t.to-n.to}function Xx(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),X_(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),X_(n,o,i.copy(a.from,i.to)));break}}return n}function X_(t,n,r){for(;n<t.length&&Xb(r,t[n])>0;)n++;t.splice(n,0,r)}function XS(t){let n=[];return t.someProp("decorations",r=>{let i=r(t.state);i&&i!=Xp&&n.push(i)}),t.cursorWrapper&&n.push(Xd.create(t.state.doc,[t.cursorWrapper.deco])),Xh.from(n)}let XT={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Xw=Jx&&J_<=11;class XO{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 Xk{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new XO,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]);Jx&&J_<=11&&t.some(t=>"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length)?this.flushSoon():this.flush()}),Xw&&(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,XT)),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(Qv(this.view)){if(this.suppressingSelectionUpdates)return Ql(this.view);if(Jx&&J_<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&Ja(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=Jr(i))n.add(i);for(let o=t.anchorNode;o;o=Jr(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)&&Qv(n)&&!this.ignoreSelectionChange(i),a=-1,u=-1,s=!1,c=[];if(n.editable)for(let l=0;l<r.length;l++){let f=this.registerMutation(r[l],c);f&&(a=a<0?f.from:Math.min(f.from,a),u=u<0?f.to:Math.max(f.to,u),f.typeOver&&(s=!0))}if(JS&&c.length>1){let d=c.filter(t=>"BR"==t.nodeName);if(2==d.length){let p=d[0],h=d[1];p.parentNode&&p.parentNode.parentNode==h.parentNode?h.remove():p.remove()}}let m=null;a<0&&o&&n.input.lastFocus>Date.now()-200&&Math.max(n.input.lastTouch,n.input.lastClick.time)<Date.now()-300&&Jf(i)&&(m=Qs(n))&&m.eq(Y$.near(n.state.doc.resolve(0),1))?(n.input.lastFocus=0,Ql(n),this.currentSelection.set(i),n.scrollToSelection()):(a>-1||o)&&(a>-1&&(n.docView.markDirty(a,u),t=n,XI.has(t)||(XI.set(t,null),-1===["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace))||(t.requiresGeckoHackNode=JS,XC||(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."),XC=!0))),this.handleDOMChange(a,u,s,c),n.docView&&n.docView.dirty?n.updateState(n.state):this.currentSelection.eq(i)||Ql(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(Jx&&J_<=11&&t.addedNodes.length)for(let u=0;u<t.addedNodes.length;u++){let{previousSibling:s,nextSibling:c}=t.addedNodes[u];(!s||0>Array.prototype.indexOf.call(t.addedNodes,s))&&(o=s),(!c||0>Array.prototype.indexOf.call(t.addedNodes,c))&&(a=c)}let l=o&&o.parentNode==t.target?Jn(o)+1:0,f=r.localPosFromDOM(t.target,l,-1),d=a&&a.parentNode==t.target?Jn(a):t.target.childNodes.length,p=r.localPosFromDOM(t.target,d,1);return{from:f,to:p}}}}let XI=new WeakMap,XC=!1;function XM(t){let n=t.pmViewDesc;if(n)return n.parseRule();if("BR"==t.nodeName&&t.parentNode){if(Jk&&/^(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||Jk&&/^(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 XR=/^(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 XE(t,n,r){return Math.max(r.anchor,r.head)>n.content.size?null:Qy(t,n.resolve(r.anchor),n.resolve(r.head))}function Xj(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 XN{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 QH,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(XF),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=XL(this),XP(this),this.nodeViews=XD(this),this.docView=J3(this.state.doc,XA(this),XS(this),this.dom,this),this.domObserver=new Xk(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=Qs(t,a);if(u&&!t.state.selection.eq(u)){if(Jw&&JR&&13===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",n=>n(t,Jd(13,"Enter"))))return;let s=t.state.tr.setSelection(u);"pointer"==a?s.setMeta("pointer",!0):"key"==a&&s.scrollIntoView(),t.composing&&s.setMeta("composition",t.input.compositionID),t.dispatch(s)}return}let c=t.state.doc.resolve(n),l=c.sharedDepth(r);n=c.before(l+1),r=t.state.doc.resolve(r).after(l+1);let f=t.state.selection,d=function(t,n,r){let{node:i,fromOffset:o,toOffset:a,from:u,to:s}=t.docView.parseRange(n,r),c=t.domSelectionRange(),l,f=c.anchorNode;if(f&&t.dom.contains(1==f.nodeType?f:f.parentNode)&&(l=[{node:f,offset:c.anchorOffset}],Jf(c)||l.push({node:c.focusNode,offset:c.focusOffset})),Jw&&8===t.input.lastKeyCode)for(let d=a;d>o;d--){let p=i.childNodes[d-1],h=p.pmViewDesc;if("BR"==p.nodeName&&!h){a=d;break}if(!h||h.size)break}let m=t.state.doc,g=t.someProp("domParser")||G2.fromSchema(t.state.schema),y=m.resolve(u),v=null,b=g.parse(i,{topNode:y.parent,topMatch:y.parent.contentMatchAt(y.index()),topOpen:!0,from:o,to:a,preserveWhitespace:"pre"!=y.parent.type.whitespace||"full",findPositions:l,ruleFromNode:XM,context:y});if(l&&null!=l[0].pos){let x=l[0].pos,_=l[1]&&l[1].pos;null==_&&(_=x),v={anchor:x+u,head:_+u}}return{doc:b,sel:v,from:u,to:s}}(t,n,r),p=t.state.doc,h=p.slice(d.from,d.to),m,g;8===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime?(m=t.state.selection.to,g="end"):(m=t.state.selection.from,g="start"),t.input.lastKeyCode=null;let y=function(t,n,r,i,o){let a=t.findDiffStart(n,r);if(null==a)return null;let{a:u,b:s}=t.findDiffEnd(n,r+t.size,r+n.size);if("end"==o){let c=Math.max(0,a-Math.min(u,s));i-=u+c-a}if(u<a&&t.size<n.size){let l=i<=a&&i>=u?a-i:0;a-=l,s=a+(s-u),u=a}else if(s<a){let f=i<=a&&i>=s?a-i:0;a-=f,u=a+(u-s),s=a}return{start:a,endA:u,endB:s}}(h.content,d.doc.content,d.from,m,g);if((JI&&t.input.lastIOSEnter>Date.now()-225||JR)&&o.some(t=>1==t.nodeType&&!XR.test(t.nodeName))&&(!y||y.endA>=y.endB)&&t.someProp("handleKeyDown",n=>n(t,Jd(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!y){if(i&&f instanceof YZ&&!f.empty&&f.$head.sameParent(f.$anchor)&&!t.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))y={start:f.from,endA:f.to,endB:f.to};else{if(d.sel){let v=XE(t,t.state.doc,d.sel);if(v&&!v.eq(t.state.selection)){let b=t.state.tr.setSelection(v);t.composing&&b.setMeta("composition",t.input.compositionID),t.dispatch(b)}}return}}if(Jw&&t.cursorWrapper&&d.sel&&d.sel.anchor==t.cursorWrapper.deco.from&&d.sel.head==d.sel.anchor){let x=y.endB-y.start;d.sel={anchor:d.sel.anchor+x,head:d.sel.anchor+x}}t.input.domChangeCount++,t.state.selection.from<t.state.selection.to&&y.start==y.endB&&t.state.selection instanceof YZ&&(y.start>t.state.selection.from&&y.start<=t.state.selection.from+2&&t.state.selection.from>=d.from?y.start=t.state.selection.from:y.endA<t.state.selection.to&&y.endA>=t.state.selection.to-2&&t.state.selection.to<=d.to&&(y.endB+=t.state.selection.to-y.endA,y.endA=t.state.selection.to)),Jx&&J_<=11&&y.endB==y.start+1&&y.endA==y.start&&y.start>d.from&&" \xa0"==d.doc.textBetween(y.start-d.from-1,y.start-d.from+1)&&(y.start--,y.endA--,y.endB--);let _=d.doc.resolveNoCache(y.start-d.from),S=d.doc.resolveNoCache(y.endB-d.from),T=p.resolve(y.start),w=_.sameParent(S)&&_.parent.inlineContent&&T.end()>=y.endA,O;if((JI&&t.input.lastIOSEnter>Date.now()-225&&(!w||o.some(t=>"DIV"==t.nodeName||"P"==t.nodeName))||!w&&_.pos<d.doc.content.size&&!_.sameParent(S)&&(O=Y$.findFrom(d.doc.resolve(_.pos+1),1,!0))&&O.head==S.pos)&&t.someProp("handleKeyDown",n=>n(t,Jd(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||Xj(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(Xj(a,!0,!0));return!(!u.parent.isTextblock||u.pos>r||Xj(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,Jd(8,"Backspace")))){JR&&Jw&&t.domObserver.suppressSelectionUpdates();return}Jw&&JR&&y.endB==y.start&&(t.input.lastAndroidDelete=Date.now()),JR&&!w&&_.start()!=S.start()&&0==S.parentOffset&&_.depth==S.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==y.endA&&(y.endB-=2,S=d.doc.resolveNoCache(y.endB-d.from),setTimeout(()=>{t.someProp("handleKeyDown",function(n){return n(t,Jd(13,"Enter"))})},20));let k=y.start,I=y.endA,C,M,R;if(w){if(_.pos==S.pos)Jx&&J_<=11&&0==_.parentOffset&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Ql(t),20)),C=t.state.tr.delete(k,I),M=p.resolve(y.start).marksAcross(p.resolve(y.endA));else if(y.endA==y.endB&&(R=function(t,n){let r=t.firstChild.marks,i=n.firstChild.marks,o=r,a=i,u,s,c;for(let l=0;l<i.length;l++)o=i[l].removeFromSet(o);for(let f=0;f<r.length;f++)a=r[f].removeFromSet(a);if(1==o.length&&0==a.length)s=o[0],u="add",c=t=>t.mark(s.addToSet(t.marks));else{if(0!=o.length||1!=a.length)return null;s=a[0],u="remove",c=t=>t.mark(s.removeFromSet(t.marks))}let d=[];for(let p=0;p<n.childCount;p++)d.push(c(n.child(p)));if(Gg.from(d).eq(t))return{mark:s,type:u}}(_.parent.content.cut(_.parentOffset,S.parentOffset),T.parent.content.cut(T.parentOffset,y.endA-T.start()))))C=t.state.tr,"add"==R.type?C.addMark(k,I,R.mark):C.removeMark(k,I,R.mark);else if(_.parent.child(_.index()).isText&&_.index()==S.index()-(S.textOffset?0:1)){let E=_.parent.textBetween(_.parentOffset,S.parentOffset);if(t.someProp("handleTextInput",n=>n(t,k,I,E)))return;C=t.state.tr.insertText(E,k,I)}}if(C||(C=t.state.tr.replace(k,I,d.doc.slice(y.start-d.from,y.endB-d.from))),d.sel){let j=XE(t,C.doc,d.sel);j&&!(Jw&&JR&&t.composing&&j.empty&&(y.start!=y.endB||t.input.lastAndroidDelete<Date.now()-100)&&(j.head==k||j.head==C.mapping.map(I)-1)||Jx&&j.empty&&j.head==k)&&C.setSelection(j)}M&&C.ensureMarks(M),t.composing&&C.setMeta("composition",t.input.compositionID),t.dispatch(C.scrollIntoView())})(this,t,n,r,i)),this.domObserver.start(),function(t){for(let n in Q$){let r=Q$[n];t.dom.addEventListener(n,t.input.eventHandlers[n]=n=>{!QJ(t,n)||QY(t,n)||!t.editable&&n.type in Qq||r(t,n)},QK[n]?{passive:!0}:void 0)}Jk&&t.dom.addEventListener("input",()=>null),QG(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&&QG(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(XF),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&&(Q8(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=XD(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)&&QG(this),this.editable=XL(this),XP(this);let s=XS(this),c=XA(this),l=r.plugins==t.plugins||r.doc.eq(t.doc)?t.scrollToSelection>r.scrollToSelection?"to selection":"preserve":"reset",f=i||!this.docView.matchesNode(t.doc,c,s);(f||!t.selection.eq(r.selection))&&(o=!0);let d="preserve"==l&&o&&null==this.dom.style.overflowAnchor&&function(t){let n=t.dom.getBoundingClientRect(),r=Math.max(0,n.top),i,o;for(let a=(n.left+n.right)/2,u=r+1;u<Math.min(innerHeight,n.bottom);u+=5){let s=t.root.elementFromPoint(a,u);if(!s||s==t.dom||!t.dom.contains(s))continue;let c=s.getBoundingClientRect();if(c.top>=r-20){i=s,o=c.top;break}}return{refDOM:i,refTop:o,stack:JD(t.dom)}}(this);if(o){var p,h,m;this.domObserver.stop();let g,y=f&&(Jx||Jw)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&(h=r.selection,m=t.selection,g=Math.min(h.$anchor.sharedDepth(h.head),m.$anchor.sharedDepth(m.head)),h.$anchor.start(g)!=m.$anchor.start(g));if(f){let v=Jw?this.trackWrites=this.domSelectionRange().focusNode:null;(i||!this.docView.update(t.doc,c,s,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=J3(t.doc,c,s,this.dom,this)),v&&!this.trackWrites&&(y=!0)}let b,x;y||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&(b=this.docView.domFromPos(this.state.selection.anchor,0),x=this.domSelectionRange(),Ja(b.node,b.offset,x.anchorNode,x.anchorOffset)))?Ql(this,y):(Qm(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),"reset"==l?this.dom.scrollTop=0:"to selection"==l?this.scrollToSelection():d&&function({refDOM:t,refTop:n,stack:r}){let i=t?t.getBoundingClientRect().top:0;JF(r,0==i?0:i-n)}(d)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",t=>t(this))){if(this.state.selection instanceof YY){let n=this.docView.domAfterPos(this.state.selection.from);1==n.nodeType&&JL(this,n.getBoundingClientRect(),t)}else JL(this,this.coordsAtPos(this.state.selection.head,1),t)}}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(t&&t.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,t)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let i=0;i<this.directPlugins.length;i++){let o=this.directPlugins[i];o.spec.view&&this.pluginViews.push(o.spec.view(this))}for(let a=0;a<this.state.plugins.length;a++){let u=this.state.plugins[a];u.spec.view&&this.pluginViews.push(u.spec.view(this))}}}someProp(t,n){let r=this._props&&this._props[t],i;if(null!=r&&(i=n?n(r):r))return i;for(let o=0;o<this.directPlugins.length;o++){let a=this.directPlugins[o].props[t];if(null!=a&&(i=n?n(a):a))return i}let u=this.state.plugins;if(u)for(let s=0;s<u.length;s++){let c=u[s].props[t];if(null!=c&&(i=n?n(c):c))return i}}hasFocus(){if(Jx){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(JW)return t.focus(JW);let n=JD(t);t.focus(null==JW?{get preventScroll(){return JW={preventScroll:!0},!0}}:void 0),JW||(JW=!1,JF(n,0))}(this.dom),Ql(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=Jp(o,n.left,n.top);s&&({node:a,offset:u}=s);let c=(t.root.elementFromPoint?t.root:o).elementFromPoint(n.left,n.top),l;if(!c||!t.dom.contains(1!=c.nodeType?c.parentNode:c)){let f=t.dom.getBoundingClientRect();if(!JU(n,f)||!(c=function t(n,r,i){let o=n.childNodes.length;if(o&&i.top<i.bottom)for(let a=Math.max(0,Math.min(o-1,Math.floor(o*(r.top-i.top)/(i.bottom-i.top))-2)),u=a;;){let s=n.childNodes[u];if(1==s.nodeType){let c=s.getClientRects();for(let l=0;l<c.length;l++){let f=c[l];if(JU(r,f))return t(s,r,f)}}if((u=(u+1)%o)==a)break}return n}(t.dom,n,f)))return null}if(Jk)for(let d=c;a&&d;d=Jr(d))d.draggable&&(a=void 0);let p;if(c=(p=(r=c).parentNode)&&/^li$/i.test(p.nodeName)&&n.left<r.getBoundingClientRect().left?p:r,a){if(JS&&1==a.nodeType&&(u=Math.min(u,a.childNodes.length))<a.childNodes.length){let h=a.childNodes[u],m;"IMG"==h.nodeName&&(m=h.getBoundingClientRect()).right<=n.left&&m.bottom>n.top&&u++}a==t.dom&&u==a.childNodes.length-1&&1==a.lastChild.nodeType&&n.top>a.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:(0==u||1!=a.nodeType||"BR"!=a.childNodes[u-1].nodeName)&&(l=function(t,n,r,i){let o=-1;for(let a=n,u=!1;a!=t.dom;){let s=t.docView.nearestDesc(a,!0);if(!s)return null;if(1==s.dom.nodeType&&(s.node.isBlock&&s.parent&&!u||!s.contentDOM)){let c=s.dom.getBoundingClientRect();if(s.node.isBlock&&s.parent&&!u&&(u=!0,c.left>i.left||c.top>i.top?o=s.posBefore:(c.right<i.left||c.bottom<i.top)&&(o=s.posAfter)),!s.contentDOM&&o<0)return(s.node.isBlock?i.top<(c.top+c.bottom)/2:i.left<(c.left+c.right)/2)?s.posBefore:s.posAfter}a=s.dom.parentNode}return o>-1?o:t.docView.posFromDOM(n,r,-1)}(t,a,u,n))}null==l&&(l=function(t,n,r){let{node:i,offset:o}=function t(n,r){let i,o=2e8,a,u=0,s=r.top,c=r.top,l,f;for(let d=n.firstChild,p=0;d;d=d.nextSibling,p++){let h;if(1==d.nodeType)h=d.getClientRects();else{if(3!=d.nodeType)continue;h=Jo(d).getClientRects()}for(let m=0;m<h.length;m++){let g=h[m];if(g.top<=s&&g.bottom>=c){s=Math.max(g.bottom,s),c=Math.min(g.top,c);let y=g.left>r.left?g.left-r.left:g.right<r.left?r.left-g.right:0;if(y<o){i=d,o=y,a=y&&3==i.nodeType?{left:g.right<r.left?g.right:g.left,top:r.top}:r,1==d.nodeType&&y&&(u=p+(r.left>=(g.left+g.right)/2?1:0));continue}}else g.top>r.top&&!l&&g.left<=r.left&&g.right>=r.left&&(l=d,f={left:Math.max(g.left,Math.min(g.right,r.left)),top:g.top});!i&&(r.left>=g.right&&r.top>=g.top||r.left>=g.left&&r.top>=g.bottom)&&(u=p+1)}}return!i&&l&&(i=l,a=f,o=0),i&&3==i.nodeType?function(t,n){let r=t.nodeValue.length,i=document.createRange();for(let o=0;o<r;o++){i.setEnd(t,o+1),i.setStart(t,o);let a=JB(i,1);if(a.top!=a.bottom&&JU(n,a))return{node:t,offset:o+(n.left>=(a.left+a.right)/2?1:0)}}return{node:t,offset:0}}(i,a):!i||o&&1==i.nodeType?{node:n,offset:u}:t(i,a)}(n,r),a=-1;if(1==i.nodeType&&!i.firstChild){let u=i.getBoundingClientRect();a=u.left!=u.right&&r.left>(u.left+u.right)/2?1:-1}return t.docView.posFromDOM(i,o,a)}(t,c,n));let g=t.docView.nearestDesc(c,!0);return{pos:l,inside:g?g.posAtStart-g.border:-1}}(this,t)}coordsAtPos(t,n=1){return J$(this,t,n)}domAtPos(t,n=0){return this.docView.domFromPos(t,n)}nodeDOM(t){let n=this.docView.descAt(t);return n?n.nodeDOM:null}posAtDOM(t,n,r=-1){let i=this.docView.posFromDOM(t,n,r);if(null==i)throw RangeError("DOM position not inside the editor");return i}endOfTextblock(t,n){var r,i,o,a,u,s;let c,l;return JG==(i=n||this.state)&&JY==t?JJ:(JG=i,JY=t,JJ="up"==t||"down"==t?(a=this,c=i.selection,l="up"==t?c.$from:c.$to,JH(a,i,()=>{let{node:n}=a.docView.domFromPos(l.pos,"up"==t?-1:1);for(;;){let r=a.docView.nearestDesc(n,!0);if(!r)break;if(r.node.isBlock){n=r.contentDOM||r.dom;break}n=r.dom.parentNode}let i=J$(a,l.pos,1);for(let o=n.firstChild;o;o=o.nextSibling){let u;if(1==o.nodeType)u=o.getClientRects();else{if(3!=o.nodeType)continue;u=Jo(o,0,o.nodeValue.length).getClientRects()}for(let s=0;s<u.length;s++){let c=u[s];if(c.bottom>c.top+1&&("up"==t?i.top-c.top>(c.bottom-i.top)*2:c.bottom-i.bottom>(i.bottom-c.top)*2))return!1}}return!0})):function(t,n,r){let{$head:i}=n.selection;if(!i.parent.isTextblock)return!1;let o=i.parentOffset,a=o==i.parent.content.size,u=t.domSelection();return JZ.test(i.parent.textContent)&&u.modify?JH(t,n,()=>{let{focusNode:n,focusOffset:o,anchorNode:a,anchorOffset:s}=t.domSelectionRange(),c=u.caretBidiLevel;u.modify("move",r,"character");let l=i.depth?t.docView.domAfterPos(i.before()):t.dom,{focusNode:f,focusOffset:d}=t.domSelectionRange(),p=f&&!l.contains(1==f.nodeType?f:f.parentNode)||n==f&&o==d;try{u.collapse(a,s),n&&(n!=a||o!=s)&&u.extend&&u.extend(n,o)}catch{}return null!=c&&(u.caretBidiLevel=c),p}):"left"==r||"backward"==r?!o:a}(this,i,t))}pasteHTML(t,n){return Xt(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return Xt(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,[],XS(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;QY(this,t)||!Q$[t.type]||!this.editable&&t.type in Qq||Q$[t.type](this,t)}dispatch(t){let n=this._props.dispatchTransaction;n?n.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){return Jk&&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 Ja(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 XA(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"),[Xc.node(0,t.state.doc.content.size,n)]}function XP(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:Xc.widget(t.state.selection.head,n,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function XL(t){return!t.someProp("editable",n=>!1===n(t.state))}function XD(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 XF(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 XW={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:"'"},XU={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Xz="u">typeof navigator&&/Mac/.test(navigator.platform),XB="u">typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),XV=0;XV<10;XV++)XW[48+XV]=XW[96+XV]=String(XV);for(var XV=1;XV<=24;XV++)XW[XV+111]="F"+XV;for(var XV=65;XV<=90;XV++)XW[XV]=String.fromCharCode(XV+32),XU[XV]=String.fromCharCode(XV);for(var X$ in XW)XU.hasOwnProperty(X$)||(XU[X$]=XW[X$]);let Xq="u">typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function XK(t){let n=t.split(/-(?!$)/),r=n[n.length-1];"Space"==r&&(r=" ");let i,o,a,u;for(let s=0;s<n.length-1;s++){let c=n[s];if(/^(cmd|meta|m)$/i.test(c))u=!0;else if(/^a(lt)?$/i.test(c))i=!0;else if(/^(c|ctrl|control)$/i.test(c))o=!0;else if(/^s(hift)?$/i.test(c))a=!0;else if(/^mod$/i.test(c))Xq?u=!0:o=!0;else throw Error("Unrecognized modifier name: "+c)}return i&&(r="Alt-"+r),o&&(r="Ctrl-"+r),u&&(r="Meta-"+r),a&&(r="Shift-"+r),r}function XH(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 XZ=(t,n)=>!t.selection.empty&&(n&&n(t.tr.deleteSelection().scrollIntoView()),!0),XG=(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=XQ(i);if(!o){let a=i.blockRange(),u=a&&YS(a);return null!=u&&(n&&n(t.tr.lift(a,u).scrollIntoView()),!0)}let s=o.nodeBefore;if(!s.type.spec.isolating&&eet(t,o,n))return!0;if(0==i.parent.content.size&&(XY(s,"end")||YY.isSelectable(s))){let c=YM(t.doc,i.before(),i.after(),GS.empty);if(c&&c.slice.size<c.to-c.from){if(n){let l=t.tr.step(c);l.setSelection(XY(s,"end")?Y$.findFrom(l.doc.resolve(l.mapping.map(o.pos,-1)),-1):YY.create(l.doc,o.pos-s.nodeSize)),n(l.scrollIntoView())}return!0}}return!!s.isAtom&&o.depth==i.depth-1&&(n&&n(t.tr.delete(o.pos-s.nodeSize,o.pos).scrollIntoView()),!0)};function XY(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 XJ=(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=XQ(i)}let u=a&&a.nodeBefore;return!!(u&&YY.isSelectable(u))&&(n&&n(t.tr.setSelection(YY.create(t.doc,a.pos-u.nodeSize)).scrollIntoView()),!0)};function XQ(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 XX=(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=X1(i);if(!o)return!1;let a=o.nodeAfter;if(eet(t,o,n))return!0;if(0==i.parent.content.size&&(XY(a,"start")||YY.isSelectable(a))){let u=YM(t.doc,i.before(),i.after(),GS.empty);if(u&&u.slice.size<u.to-u.from){if(n){let s=t.tr.step(u);s.setSelection(XY(a,"start")?Y$.findFrom(s.doc.resolve(s.mapping.map(o.pos)),1):YY.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)},X0=(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=X1(i)}let u=a&&a.nodeAfter;return!!(u&&YY.isSelectable(u))&&(n&&n(t.tr.setSelection(YY.create(t.doc,a.pos)).scrollIntoView()),!0)};function X1(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 X2=(t,n)=>{let r=t.selection,i=r instanceof YY,o;if(i){if(r.node.isTextblock||!Yk(t.doc,r.from))return!1;o=r.from}else if(null==(o=YC(t.doc,r.from,-1)))return!1;if(n){let a=t.tr.join(o);i&&a.setSelection(YY.create(a.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),n(a.scrollIntoView())}return!0},X3=(t,n)=>{let r=t.selection,i;if(r instanceof YY){if(r.node.isTextblock||!Yk(t.doc,r.to))return!1;i=r.to}else if(null==(i=YC(t.doc,r.to,1)))return!1;return n&&n(t.tr.join(i).scrollIntoView()),!0},X4=(t,n)=>{let{$from:r,$to:i}=t.selection,o=r.blockRange(i),a=o&&YS(o);return null!=a&&(n&&n(t.tr.lift(o,a).scrollIntoView()),!0)},X5=(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 X9(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 X6=(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=X9(o.contentMatchAt(a));if(!u||!o.canReplaceWith(a,a,u))return!1;if(n){let s=r.after(),c=t.tr.replaceWith(s,s,u.createAndFill());c.setSelection(Y$.near(c.doc.resolve(s),1)),n(c.scrollIntoView())}return!0},X8=(t,n)=>{let r=t.selection,{$from:i,$to:o}=r;if(r instanceof YQ||i.parent.inlineContent||o.parent.inlineContent)return!1;let a=X9(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(YZ.create(s.doc,u+1)),n(s.scrollIntoView())}return!0},X7=(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(YO(t.doc,i))return n&&n(t.tr.split(i).scrollIntoView()),!0}let o=r.blockRange(),a=o&&YS(o);return null!=a&&(n&&n(t.tr.lift(o,a).scrollIntoView()),!0)},eee=(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(YY.create(t.doc,o))),!0)};function eet(t,n,r){var i,o,a;let u=n.nodeBefore,s=n.nodeAfter,c,l;if(u.type.spec.isolating||s.type.spec.isolating)return!1;let f,d,p;if(f=n.nodeBefore,d=n.nodeAfter,p=n.index(),f&&d&&f.type.compatibleContent(d.type)&&(!f.content.size&&n.parent.canReplace(p-1,p)?(r&&r(t.tr.delete(n.pos-f.nodeSize,n.pos).scrollIntoView()),!0):!!(n.parent.canReplace(p,p+1)&&(d.isTextblock||Yk(t.doc,n.pos)))&&(r&&r(t.tr.clearIncompatible(n.pos,f.type,f.contentMatchAt(f.childCount)).join(n.pos).scrollIntoView()),!0)))return!0;let h=n.parent.canReplace(n.index(),n.index()+1);if(h&&(c=(l=u.contentMatchAt(u.childCount)).findWrapping(s.type))&&l.matchType(c[0]||s.type).validEnd){if(r){let m=n.pos+s.nodeSize,g=Gg.empty;for(let y=c.length-1;y>=0;y--)g=Gg.from(c[y].create(null,g));g=Gg.from(u.copy(g));let v=t.tr.step(new Yb(n.pos-1,m,n.pos,m,new GS(g,1,0),c.length,!0)),b=m+2*c.length;Yk(v.doc,b)&&v.join(b),r(v.scrollIntoView())}return!0}let x=Y$.findFrom(n,1),_=x&&x.$from.blockRange(x.$to),S=_&&YS(_);if(null!=S&&S>=n.depth)return r&&r(t.tr.lift(_,S).scrollIntoView()),!0;if(h&&XY(s,"start",!0)&&XY(u,"end")){let T=u,w=[];for(;w.push(T),!T.isTextblock;)T=T.lastChild;let O=s,k=1;for(;!O.isTextblock;O=O.firstChild)k++;if(T.canReplace(T.childCount,T.childCount,O.content)){if(r){let I=Gg.empty;for(let C=w.length-1;C>=0;C--)I=Gg.from(w[C].copy(I));let M=t.tr.step(new Yb(n.pos-w.length,n.pos+s.nodeSize,n.pos+k,n.pos+s.nodeSize-k,new GS(I,w.length,0),0,!0));r(M.scrollIntoView())}return!0}}return!1}function een(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(YZ.create(n.doc,t<0?o.start(a):o.end(a)))),!0)}}let eer=een(-1),eei=een(1);function eeo(t,n=null){return function(r,i){let o=!1;for(let a=0;a<r.selection.ranges.length&&!o;a++){let{$from:{pos:u},$to:{pos:s}}=r.selection.ranges[a];r.doc.nodesBetween(u,s,(i,a)=>{if(o)return!1;if(!(!i.isTextblock||i.hasMarkup(t,n))){if(i.type==t)o=!0;else{let u=r.doc.resolve(a),s=u.index();o=u.parent.canReplaceWith(s,s+1,t)}}})}if(!o)return!1;if(i){let c=r.tr;for(let l=0;l<r.selection.ranges.length;l++){let{$from:{pos:f},$to:{pos:d}}=r.selection.ranges[l];c.setBlockType(f,d,t,n)}i(c.scrollIntoView())}return!0}}function eea(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 eeu{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:t,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,a=this.buildProps(o);return Object.fromEntries(Object.entries(t).map(([t,n])=>[t,(...t)=>{let r=n(...t)(a);return o.getMeta("preventDispatch")||this.hasCustomState||i.dispatch(o),r}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,n=!0){let{rawCommands:r,editor:i,state:o}=this,{view:a}=i,u=[],s=!!t,c=t||o.tr,l=()=>(s||!n||c.getMeta("preventDispatch")||this.hasCustomState||a.dispatch(c),u.every(t=>!0===t)),f={...Object.fromEntries(Object.entries(r).map(([t,r])=>[t,(...t)=>{let i=this.buildProps(c,n),o=r(...t)(i);return u.push(o),f}])),run:l};return f}createCan(t){let{rawCommands:n,state:r}=this,i=t||r.tr,o=this.buildProps(i,!1);return{...Object.fromEntries(Object.entries(n).map(([t,n])=>[t,(...t)=>n(...t)({...o,dispatch:void 0})])),chain:()=>this.createChain(i,!1)}}buildProps(t,n=!0){let{rawCommands:r,editor:i,state:o}=this,{view:a}=i;o.storedMarks&&t.setStoredMarks(o.storedMarks);let u={tr:t,editor:i,view:a,state:eea({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 ees{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 eec(t,n,r){return void 0===t.config[n]&&t.parent?eec(t.parent,n,r):"function"==typeof t.config[n]?t.config[n].bind({...r,parent:t.parent?eec(t.parent,n,r):null}):t.config[n]}function eel(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 eef(t){let n=[],{nodeExtensions:r,markExtensions:i}=eel(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=eec(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=eec(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 eed(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 eep(...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 eeh(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)=>eep(t,n),{})}function eem(t){return"function"==typeof t}function eeg(t,n,...r){return eem(t)?n?t.bind(n)(...r):t(...r):t}function eey(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 eev(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 eeb(t,n){var r;let i=eef(t),{nodeExtensions:o,markExtensions:a}=eel(t),u=null===(r=o.find(t=>eec(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=eec(n,"extendNodeSchema",a);return{...t,...i?i(r):{}}},{}),s=eev({...u,content:eeg(eec(r,"content",a)),marks:eeg(eec(r,"marks",a)),group:eeg(eec(r,"group",a)),inline:eeg(eec(r,"inline",a)),atom:eeg(eec(r,"atom",a)),selectable:eeg(eec(r,"selectable",a)),draggable:eeg(eec(r,"draggable",a)),code:eeg(eec(r,"code",a)),defining:eeg(eec(r,"defining",a)),isolating:eeg(eec(r,"isolating",a)),attrs:Object.fromEntries(o.map(t=>{var n;return[t.name,{default:null===(n=null==t?void 0:t.attribute)||void 0===n?void 0:n.default}]}))}),c=eeg(eec(r,"parseHTML",a));c&&(s.parseDOM=c.map(t=>eey(t,o)));let l=eec(r,"renderHTML",a);l&&(s.toDOM=t=>l({node:t,HTMLAttributes:eeh(t,o)}));let f=eec(r,"renderText",a);return f&&(s.toText=f),[r.name,s]})),c=Object.fromEntries(a.map(r=>{let o=i.filter(t=>t.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:n},u=t.reduce((t,n)=>{let i=eec(n,"extendMarkSchema",a);return{...t,...i?i(r):{}}},{}),s=eev({...u,inclusive:eeg(eec(r,"inclusive",a)),excludes:eeg(eec(r,"excludes",a)),group:eeg(eec(r,"group",a)),spanning:eeg(eec(r,"spanning",a)),code:eeg(eec(r,"code",a)),attrs:Object.fromEntries(o.map(t=>{var n;return[t.name,{default:null===(n=null==t?void 0:t.attribute)||void 0===n?void 0:n.default}]}))}),c=eeg(eec(r,"parseHTML",a));c&&(s.parseDOM=c.map(t=>eey(t,o)));let l=eec(r,"renderHTML",a);return l&&(s.toDOM=t=>l({mark:t,HTMLAttributes:eeh(t,o)})),[r.name,s]}));return new G0({topNode:u,nodes:s,marks:c})}function eex(t,n){return n.nodes[t]||n.marks[t]||null}function ee_(t,n){return Array.isArray(n)?n.some(n=>("string"==typeof n?n:n.name)===t.name):n}let eeS=(t,n=500)=>{let r="",i=t.parentOffset;return t.parent.nodesBetween(Math.max(0,i-n),i,(t,n,o,a)=>{var u,s;let c=(null===(s=(u=t.type.spec).toText)||void 0===s?void 0:s.call(u,{node:t,pos:n,parent:o,index:a}))||t.textContent||"%leaf%";r+=c.slice(0,Math.max(0,i-n))}),r};function eeT(t){return"[object RegExp]"===Object.prototype.toString.call(t)}class eew{constructor(t){this.find=t.find,this.handler=t.handler}}let eeO=(t,n)=>{if(eeT(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 eek(t){var n;let{editor:r,from:i,to:o,text:a,rules:u,plugin:s}=t,{view:c}=r;if(c.composing)return!1;let l=c.state.doc.resolve(i);if(l.parent.type.spec.code||!(null===(n=l.nodeBefore||l.nodeAfter)||void 0===n)&&n.marks.find(t=>t.type.spec.code))return!1;let f=!1,d=eeS(l)+a;return u.forEach(t=>{if(f)return;let n=eeO(d,t.find);if(!n)return;let u=c.state.tr,l=eea({state:c.state,transaction:u}),p={from:i-(n[0].length-a.length),to:o},{commands:h,chain:m,can:g}=new eeu({editor:r,state:l});null!==t.handler({state:l,range:p,match:n,commands:h,chain:m,can:g})&&u.steps.length&&(u.setMeta(s,{transform:u,from:i,to:o,text:a}),c.dispatch(u),f=!0)}),f}class eeI{constructor(t){this.find=t.find,this.handler=t.handler}}let eeC=(t,n)=>{if(eeT(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 eeM{constructor(t,n){this.splittableMarks=[],this.editor=n,this.extensions=eeM.resolve(t),this.schema=eeb(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:eex(t.name,this.schema)};"mark"===t.type&&(!(null!==(n=eeg(eec(t,"keepOnSplit",r)))&&void 0!==n)||n)&&this.splittableMarks.push(t.name);let i=eec(t,"onBeforeCreate",r);i&&this.editor.on("beforeCreate",i);let o=eec(t,"onCreate",r);o&&this.editor.on("create",o);let a=eec(t,"onUpdate",r);a&&this.editor.on("update",a);let u=eec(t,"onSelectionUpdate",r);u&&this.editor.on("selectionUpdate",u);let s=eec(t,"onTransaction",r);s&&this.editor.on("transaction",s);let c=eec(t,"onFocus",r);c&&this.editor.on("focus",c);let l=eec(t,"onBlur",r);l&&this.editor.on("blur",l);let f=eec(t,"onDestroy",r);f&&this.editor.on("destroy",f)})}static resolve(t){let n=eeM.sort(eeM.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=eec(t,"addExtensions",n);return r?[t,...this.flatten(r())]:t}).flat(10)}static sort(t){return t.sort((t,n)=>{let r=eec(t,"priority")||100,i=eec(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:eex(n.name,this.schema)},i=eec(n,"addCommands",r);return i?{...t,...i()}:t},{})}get plugins(){let{editor:t}=this,n=eeM.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:eex(n.name,this.schema)},s=[],c=eec(n,"addKeyboardShortcuts",u),l={};if("mark"===n.type&&n.config.exitable&&(l.ArrowRight=()=>et7.handleExit({editor:t,mark:n})),c){let f=Object.fromEntries(Object.entries(c()).map(([n,r])=>[n,()=>r({editor:t})]));l={...l,...f}}let d,p=(o=l,new Y8({props:{handleKeyDown:(a=o,d=function(t){let n=Object.create(null);for(let r in t)n[XK(r)]=t[r];return n}(a),function(t,n){var r,i;let o=("Esc"==(i=!(Xz&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||XB&&n.shiftKey&&n.key&&1==n.key.length||"Unidentified"==n.key)&&n.key||(n.shiftKey?XU:XW)[n.keyCode]||n.key||"Unidentified")&&(i="Escape"),"Del"==i&&(i="Delete"),"Left"==i&&(i="ArrowLeft"),"Up"==i&&(i="ArrowUp"),"Right"==i&&(i="ArrowRight"),"Down"==i&&(i="ArrowDown"),i),a,u=d[XH(o,n)];if(u&&u(t.state,t.dispatch,t))return!0;if(1==o.length&&" "!=o){if(n.shiftKey){let s=d[XH(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=XW[n.keyCode])&&a!=o){let c=d[XH(a,n)];if(c&&c(t.state,t.dispatch,t))return!0}}return!1})}}));s.push(p);let h=eec(n,"addInputRules",u);ee_(n,t.options.enableInputRules)&&h&&r.push(...h());let m=eec(n,"addPasteRules",u);ee_(n,t.options.enablePasteRules)&&m&&i.push(...m());let g=eec(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 Y8({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)=>eek({editor:n,from:o,to:a,text:u,rules:r,plugin:i}),handleDOMEvents:{compositionend:t=>(setTimeout(()=>{let{$cursor:o}=t.state.selection;o&&eek({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&&eek({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 Y8({view(t){let n=n=>{var r;i=!(null===(r=t.dom.parentElement)||void 0===r)&&r.contains(n.target)?t.dom.parentElement:null};return window.addEventListener("dragstart",n),{destroy(){window.removeEventListener("dragstart",n)}}},props:{handleDOMEvents:{drop:t=>(a=i===t.dom.parentElement,!1),paste(t,n){var r;let i=null===(r=n.clipboardData)||void 0===r?void 0:r.getData("text/html");return o=!!(null!=i&&i.includes("data-pm-slice")),!1}}},appendTransaction(r,i,u){var s;let c=r[0],l="paste"===c.getMeta("uiEvent")&&!o,f="drop"===c.getMeta("uiEvent")&&!a;if(!l&&!f)return;let d=i.doc.content.findDiffStart(u.doc.content),p=i.doc.content.findDiffEnd(u.doc.content);if("number"!=typeof d||!p||d===p.b)return;let h=u.tr,m=eea({state:u,transaction:h});if(!(!function(t){let{editor:n,state:r,from:i,to:o,rule:a}=t,{commands:u,chain:s,can:c}=new eeu({editor:n,state:r}),l=[];return r.doc.nodesBetween(i,o,(t,n)=>{if(!t.isTextblock||t.type.spec.code)return;let f=Math.max(i,n),d=Math.min(o,n+t.content.size),p=t.textBetween(f-n,d-n,void 0,"");eeC(p,a.find).forEach(t=>{if(void 0===t.index)return;let n=f+t.index+1,i=n+t[0].length,o={from:r.tr.mapping.map(n),to:r.tr.mapping.map(i)},d=a.handler({state:r,range:o,match:t,commands:u,chain:s,can:c});l.push(d)})}),l.every(t=>null!==t)}({editor:n,state:m,from:Math.max(d-1,0),to:p.b-1,rule:t})||!h.steps.length))return h}}))}({editor:t,rules:i}),...o]}get attributes(){return eef(this.extensions)}get nodeViews(){let{editor:t}=this,{nodeExtensions:n}=eel(this.extensions);return Object.fromEntries(n.filter(t=>!!eec(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:eed(n.name,this.schema)},o=eec(n,"addNodeView",i);if(!o)return[];let a=(i,a,u,s)=>{let c=eeh(i,r);return o()({editor:t,node:i,getPos:u,decorations:s,HTMLAttributes:c,extension:n})};return[n.name,a]}))}}function eeR(t){var n;return"Object"===Object.prototype.toString.call(t).slice(8,-1)&&t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function eeE(t,n){let r={...t};return eeR(t)&&eeR(n)&&Object.keys(n).forEach(i=>{eeR(n[i])&&i in t?r[i]=eeE(t[i],n[i]):Object.assign(r,{[i]:n[i]})}),r}class eej{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=eeg(eec(this,"addOptions",{name:this.name}))),this.storage=eeg(eec(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new eej(t)}configure(t={}){let n=this.extend();return n.options=eeE(this.options,t),n.storage=eeg(eec(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){let n=new eej(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=eeg(eec(n,"addOptions",{name:n.name})),n.storage=eeg(eec(n,"addStorage",{name:n.name,options:n.options})),n}}function eeN(t,n,r){let{from:i,to:o}=n,{blockSeparator:a=`
15
-
16
- `,textSerializers:u={}}=r||{},s="",c=!0;return t.nodesBetween(i,o,(t,r,l,f)=>{var d;let p=null==u?void 0:u[t.type.name];p?(t.isBlock&&!c&&(s+=a,c=!0),l&&(s+=p({node:t,pos:r,parent:l,index:f,range:n}))):t.isText?(s+=null===(d=null==t?void 0:t.text)||void 0===d?void 0:d.slice(Math.max(i,r)-r,o-r),c=!1):t.isBlock&&!c&&(s+=a,c=!0)}),s}function eeA(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}let eeP=eej.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Y8({key:new Jt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:t}=this,{state:n,schema:r}=t,{doc:i,selection:o}=n,{ranges:a}=o,u=Math.min(...a.map(t=>t.$from.pos)),s=Math.max(...a.map(t=>t.$to.pos)),c=eeA(r);return eeN(i,{from:u,to:s},{textSerializers:c})}}})]}}),eeL=()=>({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),eeD=(t=!1)=>({commands:n})=>n.setContent("",t),eeF=()=>({state:t,tr:n,dispatch:r})=>{let{selection:i}=n,{ranges:o}=i;return r&&o.forEach(({$from:r,$to:i})=>{t.doc.nodesBetween(r.pos,i.pos,(t,r)=>{if(t.type.isText)return;let{doc:i,mapping:o}=n,a=i.resolve(o.map(r)),u=i.resolve(o.map(r+t.nodeSize)),s=a.blockRange(u);if(!s)return;let c=YS(s);if(t.type.isTextblock){let{defaultType:l}=a.parent.contentMatchAt(a.index());n.setNodeMarkup(s.start,l)}(c||0===c)&&n.lift(s,c)})}),!0},eeW=t=>n=>t(n),eeU=()=>({state:t,dispatch:n})=>X8(t,n),eez=()=>({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},eeB=t=>({tr:n,state:r,dispatch:i})=>{let o=eed(t,r.schema),a=n.selection.$anchor;for(let u=a.depth;u>0;u-=1)if(a.node(u).type===o){if(i){let s=a.before(u),c=a.after(u);n.delete(s,c).scrollIntoView()}return!0}return!1},eeV=t=>({tr:n,dispatch:r})=>{let{from:i,to:o}=t;return r&&n.delete(i,o),!0},ee$=()=>({state:t,dispatch:n})=>XZ(t,n),eeq=()=>({commands:t})=>t.keyboardShortcut("Enter"),eeK=()=>({state:t,dispatch:n})=>X6(t,n);function eeH(t,n,r={strict:!0}){let i=Object.keys(n);return!i.length||i.every(i=>r.strict?n[i]===t[i]:eeT(n[i])?n[i].test(t[i]):n[i]===t[i])}function eeZ(t,n,r={}){return t.find(t=>t.type===n&&eeH(t.attrs,r))}function eeG(t,n,r={}){return!!eeZ(t,n,r)}function eeY(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=eeZ([...i.node.marks],n,r);if(!o)return;let a=i.index,u=t.start()+i.offset,s=a+1,c=u+i.node.nodeSize;for(eeZ([...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&&eeG([...t.parent.child(s).marks],n,r);)c+=t.parent.child(s).nodeSize,s+=1;return{from:u,to:c}}function eeJ(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 eeQ=(t,n={})=>({tr:r,state:i,dispatch:o})=>{let a=eeJ(t,i.schema),{doc:u,selection:s}=r,{$from:c,from:l,to:f}=s;if(o){let d=eeY(c,a,n);if(d&&d.from<=l&&d.to>=f){let p=YZ.create(u,d.from,d.to);r.setSelection(p)}}return!0},eeX=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 ee0(t){return t instanceof YZ}function ee1(t=0,n=0,r=0){return Math.min(Math.max(t,n),r)}function ee2(t,n=null){if(!n)return null;let r=Y$.atStart(t),i=Y$.atEnd(t);if("start"===n||!0===n)return r;if("end"===n)return i;let o=r.from,a=i.to;return"all"===n?YZ.create(t,ee1(0,o,a),ee1(t.content.size,o,a)):YZ.create(t,ee1(n,o,a),ee1(n,o,a))}function ee3(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}let ee4=(t=null,n={})=>({editor:r,view:i,tr:o,dispatch:a})=>{n={scrollIntoView:!0,...n};let u=()=>{ee3()&&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&&!ee0(r.state.selection))return u(),!0;let s=ee2(o.doc,t)||r.state.selection,c=r.state.selection.eq(s);return a&&(c||o.setSelection(s),c&&o.storedMarks&&o.setStoredMarks(o.storedMarks),u()),!0},ee5=(t,n)=>r=>t.every((t,i)=>n(t,{...r,index:i})),ee9=(t,n)=>({tr:r,commands:i})=>i.insertContentAt({from:r.selection.from,to:r.selection.to},t,n);function ee6(t){let n=`<body>${t}</body>`;return new window.DOMParser().parseFromString(n,"text/html").body}function ee8(t,n,r){if(r={slice:!0,parseOptions:{},...r},"object"==typeof t&&null!==t)try{return Array.isArray(t)&&t.length>0?Gg.fromArray(t.map(t=>n.nodeFromJSON(t))):n.nodeFromJSON(t)}catch(i){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",i),ee8("",n,r)}if("string"==typeof t){let o=G2.fromSchema(n);return r.slice?o.parseSlice(ee6(t),r.parseOptions).content:o.parse(ee6(t),r.parseOptions)}return ee8("",n,r)}let ee7=t=>t.toString().startsWith("<"),ete=(t,n,r)=>({tr:i,dispatch:o,editor:a})=>{if(o){r={parseOptions:{},updateSelection:!0,...r};let u=ee8(n,a.schema,{parseOptions:{preserveWhitespace:"full",...r.parseOptions}});if("<>"===u.toString())return!0;let{from:s,to:c}="number"==typeof t?{from:t,to:t}:t,l=!0,f=!0;if((ee7(u)?u:[u]).forEach(t=>{t.check(),l=!!l&&t.isText&&0===t.marks.length,f=!!f&&t.isBlock}),s===c&&f){let{parent:d}=i.doc.resolve(s);!d.isTextblock||d.type.spec.code||d.childCount||(s-=1,c+=1)}l?Array.isArray(n)?i.insertText(n.map(t=>t.text||"").join(""),s,c):"object"==typeof n&&n&&n.text?i.insertText(n.text,s,c):i.insertText(n,s,c):i.replaceWith(s,c,u),r.updateSelection&&function(t,n,r){let i=t.steps.length-1;if(i<n)return;let o=t.steps[i];if(!(o instanceof Yv||o instanceof Yb))return;let a=t.mapping.maps[i],u=0;a.forEach((t,n,r,i)=>{0===u&&(u=i)}),t.setSelection(Y$.near(t.doc.resolve(u),-1))}(i,i.steps.length-1,-1)}return!0},ett=()=>({state:t,dispatch:n})=>X2(t,n),etn=()=>({state:t,dispatch:n})=>X3(t,n),etr=()=>({state:t,dispatch:n})=>XG(t,n),eti=()=>({state:t,dispatch:n})=>XX(t,n);function eto(){return"u">typeof navigator&&/Mac/.test(navigator.platform)}let eta=t=>({editor:n,view:r,tr:i,dispatch:o})=>{let a=(function(t){let n=t.split(/-(?!$)/),r=n[n.length-1];"Space"===r&&(r=" ");let i,o,a,u;for(let s=0;s<n.length-1;s+=1){let c=n[s];if(/^(cmd|meta|m)$/i.test(c))u=!0;else if(/^a(lt)?$/i.test(c))i=!0;else if(/^(c|ctrl|control)$/i.test(c))o=!0;else if(/^s(hift)?$/i.test(c))a=!0;else if(/^mod$/i.test(c))ee3()||eto()?u=!0:o=!0;else throw Error(`Unrecognized modifier name: ${c}`)}return i&&(r=`Alt-${r}`),o&&(r=`Ctrl-${r}`),u&&(r=`Meta-${r}`),a&&(r=`Shift-${r}`),r})(t).split(/-(?!$)/),u=a.find(t=>!["Alt","Ctrl","Meta","Shift"].includes(t)),s=new KeyboardEvent("keydown",{key:"Space"===u?" ":u,altKey:a.includes("Alt"),ctrlKey:a.includes("Ctrl"),metaKey:a.includes("Meta"),shiftKey:a.includes("Shift"),bubbles:!0,cancelable:!0}),c=n.captureTransaction(()=>{r.someProp("handleKeyDown",t=>t(r,s))});return null==c||c.steps.forEach(t=>{let n=t.map(i.mapping);n&&o&&i.maybeStep(n)}),!0};function etu(t,n,r={}){let{from:i,to:o,empty:a}=t.selection,u=n?eed(n,t.schema):null,s=[];t.doc.nodesBetween(i,o,(t,n)=>{if(t.isText)return;let r=Math.min(o,n+t.nodeSize);s.push({node:t,from:Math.max(i,n),to:r})});let c=s.filter(t=>!u||u.name===t.node.type.name).filter(t=>eeH(t.node.attrs,r,{strict:!1}));return a?!!c.length:c.reduce((t,n)=>t+n.to-n.from,0)>=o-i}let ets=(t,n={})=>({state:r,dispatch:i})=>{let o=eed(t,r.schema);return!!etu(r,o,n)&&X4(r,i)},etc=()=>({state:t,dispatch:n})=>X7(t,n),etl=t=>({state:n,dispatch:r})=>{var i;let o=eed(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 Yb(a-1,u,a,u,new GS(Gg.from(r.create(null,i.parent.copy())),1,0),1,!0)),i=new GN(o.doc.resolve(i.$from.pos),o.doc.resolve(u),i.depth));let s=YS(i);if(null==s)return!1;o.lift(i,s);let c=o.mapping.map(a,-1)-1;return Yk(o.doc,c)&&o.join(c),n(o.scrollIntoView()),!0}(t,n,o,a):function(t,n,r){let i=t.tr,o=r.parent;for(let a=r.end,u=r.endIndex-1,s=r.startIndex;u>s;u--)a-=o.child(u).nodeSize,i.delete(a-1,a+1);let c=i.doc.resolve(r.start),l=c.nodeAfter;if(i.mapping.map(r.end)!=r.start+c.nodeAfter.nodeSize)return!1;let f=0==r.startIndex,d=r.endIndex==o.childCount,p=c.node(-1),h=c.index(-1);if(!p.canReplace(h+(f?0:1),h+1,l.content.append(d?Gg.empty:Gg.from(o))))return!1;let m=c.pos,g=m+l.nodeSize;return i.step(new Yb(m-(f?1:0),g+(d?1:0),m+1,g-1,new GS((f?Gg.empty:Gg.from(o.copy(Gg.empty))).append(d?Gg.empty:Gg.from(o.copy(Gg.empty))),f?0:1,d?0:1),f?0:1)),n(i.scrollIntoView()),!0}(t,n,a)))}(n,r)},etf=()=>({state:t,dispatch:n})=>X5(t,n);function etd(t,n){return n.nodes[t]?"node":n.marks[t]?"mark":null}function etp(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 eth=(t,n)=>({tr:r,state:i,dispatch:o})=>{let a=null,u=null,s=etd("string"==typeof t?t:t.name,i.schema);return!!s&&("node"===s&&(a=eed(t,i.schema)),"mark"===s&&(u=eeJ(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,etp(t.attrs,n)),u&&t.marks.length&&t.marks.forEach(o=>{u===o.type&&r.addMark(i,i+t.nodeSize,u.create(etp(o.attrs,n)))})})}),!0)},etm=()=>({tr:t,dispatch:n})=>(n&&t.scrollIntoView(),!0),etg=()=>({tr:t,commands:n})=>n.setTextSelection({from:0,to:t.doc.content.size}),ety=()=>({state:t,dispatch:n})=>XJ(t,n),etv=()=>({state:t,dispatch:n})=>X0(t,n),etb=()=>({state:t,dispatch:n})=>eee(t,n),etx=()=>({state:t,dispatch:n})=>eei(t,n),et_=()=>({state:t,dispatch:n})=>eer(t,n);function etS(t,n,r={}){return ee8(t,n,{slice:!1,parseOptions:r})}let etT=(t,n=!1,r={})=>({tr:i,editor:o,dispatch:a})=>{let{doc:u}=i,s=etS(t,o.schema,r);return a&&i.replaceWith(0,u.content.size,s).setMeta("preventUpdate",!n),!0};function etw(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 etO(t,n){let r=eeJ(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 etk(t,n,r){let i=[];return t===n?r.resolve(t).marks().forEach(n=>{let o=r.resolve(t-1),a=eeY(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 etI(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 etC(t,n,r={}){let{empty:i,ranges:o}=t.selection,a=n?eeJ(n,t.schema):null;if(i)return!!(t.storedMarks||t.selection.$from.marks()).filter(t=>!a||a.name===t.type.name).find(t=>eeH(t.attrs,r,{strict:!1}));let u=0,s=[];if(o.forEach(({$from:n,$to:r})=>{let i=n.pos,o=r.pos;t.doc.nodesBetween(i,o,(t,n)=>{if(!t.isText&&!t.marks.length)return;let r=Math.max(i,n),a=Math.min(o,n+t.nodeSize);u+=a-r,s.push(...t.marks.map(t=>({mark:t,from:r,to:a})))})}),0===u)return!1;let c=s.filter(t=>!a||a.name===t.mark.type.name).filter(t=>eeH(t.mark.attrs,r,{strict:!1})).reduce((t,n)=>t+n.to-n.from,0),l=s.filter(t=>!a||t.mark.type!==a&&t.mark.type.excludes(a)).reduce((t,n)=>t+n.to-n.from,0);return(c>0?c+l:c)>=u}function etM(t,n){let{nodeExtensions:r}=eel(n),i=r.find(n=>n.name===t);if(!i)return!1;let o={name:i.name,options:i.options,storage:i.storage},a=eeg(eec(i,"group",o));return"string"==typeof a&&a.split(" ").includes("list")}let etR=(t,n={})=>({tr:r,state:i,dispatch:o})=>{let{selection:a}=r,{empty:u,ranges:s}=a,c=eeJ(t,i.schema);if(o){if(u){let l=etO(i,c);r.addStoredMark(c.create({...l,...n}))}else s.forEach(t=>{let o=t.$from.pos,a=t.$to.pos;i.doc.nodesBetween(o,a,(t,i)=>{let u=Math.max(i,o),s=Math.min(i+t.nodeSize,a);t.marks.find(t=>t.type===c)?t.marks.forEach(t=>{c===t.type&&r.addMark(u,s,c.create({...t.attrs,...n}))}):r.addMark(u,s,c.create(n))})})}return function(t,n,r){var i;let{selection:o}=n,a=null;if(ee0(o)&&(a=o.$cursor),a){let u=null!==(i=t.storedMarks)&&void 0!==i?i:a.marks();return!!r.isInSet(u)||!u.some(t=>t.type.excludes(r))}let{ranges:s}=o;return s.some(({$from:n,$to:i})=>{let o=0===n.depth&&t.doc.inlineContent&&t.doc.type.allowsMarkType(r);return t.doc.nodesBetween(n.pos,i.pos,(t,n,i)=>{if(o)return!1;if(t.isInline){let a=!i||i.type.allowsMarkType(r),u=!!r.isInSet(t.marks)||!t.marks.some(t=>t.type.excludes(r));o=a&&u}return!o}),o})}(i,r,c)},etE=(t,n)=>({tr:r})=>(r.setMeta(t,n),!0),etj=(t,n={})=>({state:r,dispatch:i,chain:o})=>{let a=eed(t,r.schema);return a.isTextblock?o().command(({commands:t})=>!!eeo(a,n)(r)||t.clearNodes()).command(({state:t})=>eeo(a,n)(t,i)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},etN=t=>({tr:n,dispatch:r})=>{if(r){let{doc:i}=n,o=ee1(t,0,i.content.size),a=YY.create(i,o);n.setSelection(a)}return!0},etA=t=>({tr:n,dispatch:r})=>{if(r){let{doc:i}=n,{from:o,to:a}="number"==typeof t?{from:t,to:t}:t,u=YZ.atStart(i).from,s=YZ.atEnd(i).to,c=ee1(o,u,s),l=ee1(a,u,s),f=YZ.create(i,c,l);n.setSelection(f)}return!0},etP=t=>({state:n,dispatch:r})=>{var i;let o=eed(t,n.schema);return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==o);if(!a)return!1;let u=a.startIndex;if(0==u)return!1;let s=a.parent,c=s.child(u-1);if(c.type!=o)return!1;if(n){let l=c.lastChild&&c.lastChild.type==s.type,f=Gg.from(l?o.create():null),d=new GS(Gg.from(o.create(null,Gg.from(s.type.create(null,f)))),l?3:1,0),p=a.start,h=a.end;n(t.tr.step(new Yb(p-(l?3:1),h,p,h,d,1,!0)).scrollIntoView())}return!0}(n,r)};function etL(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 etD=({keepMarks:t=!0}={})=>({tr:n,state:r,dispatch:i,editor:o})=>{let{selection:a,doc:u}=n,{$from:s,$to:c}=a,l=o.extensionManager.attributes,f=etI(l,s.node().type.name,s.node().attrs);if(a instanceof YY&&a.node.isBlock)return!!(s.parentOffset&&YO(u,s.pos))&&(i&&(t&&etL(r,o.extensionManager.splittableMarks),n.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;if(i){let d=c.parentOffset===c.parent.content.size;a instanceof YZ&&n.deleteSelection();let p=0===s.depth?void 0:function(t){for(let n=0;n<t.edgeCount;n+=1){let{type:r}=t.edge(n);if(r.isTextblock&&!r.hasRequiredAttrs())return r}return null}(s.node(-1).contentMatchAt(s.indexAfter(-1))),h=d&&p?[{type:p,attrs:f}]:void 0,m=YO(n.doc,n.mapping.map(s.pos),1,h);if(!h&&!m&&YO(n.doc,n.mapping.map(s.pos),1,p?[{type:p}]:void 0)&&(m=!0,h=p?[{type:p,attrs:f}]:void 0),m&&(n.split(n.mapping.map(s.pos),1,h),p&&!d&&!s.parentOffset&&s.parent.type!==p)){let g=n.mapping.map(s.before()),y=n.doc.resolve(g);s.node(-1).canReplaceWith(y.index(),y.index()+1,p)&&n.setNodeMarkup(n.mapping.map(s.before()),p)}t&&etL(r,o.extensionManager.splittableMarks),n.scrollIntoView()}return!0},etF=t=>({tr:n,state:r,dispatch:i,editor:o})=>{var a;let u=eed(t,r.schema),{$from:s,$to:c}=r.selection,l=r.selection.node;if(l&&l.isBlock||s.depth<2||!s.sameParent(c))return!1;let f=s.node(-1);if(f.type!==u)return!1;let d=o.extensionManager.attributes;if(0===s.parent.content.size&&s.node(-1).childCount===s.indexAfter(-1)){if(2===s.depth||s.node(-3).type!==u||s.index(-2)!==s.node(-2).childCount-1)return!1;if(i){let p=Gg.empty,h=s.index(-1)?1:s.index(-2)?2:3;for(let m=s.depth-h;m>=s.depth-3;m-=1)p=Gg.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=etI(d,s.node().type.name,s.node().attrs),v=(null===(a=u.contentMatch.defaultType)||void 0===a?void 0:a.createAndFill(y))||void 0;p=p.append(Gg.from(u.createAndFill(null,v)||void 0));let b=s.before(s.depth-(h-1));n.replace(b,s.after(-g),new GS(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(YZ.near(n.doc.resolve(x))),n.scrollIntoView()}return!0}let _=c.pos===s.end()?f.contentMatchAt(0).defaultType:null,S=etI(d,f.type.name,f.attrs),T=etI(d,s.node().type.name,s.node().attrs);if(n.delete(s.pos,c.pos),!YO(n.doc,s.pos,2))return!1;if(i){let{selection:w,storedMarks:O}=r,{splittableMarks:k}=o.extensionManager,I=O||w.$to.parentOffset&&w.$from.marks();if(n.split(s.pos,2,_?[{type:u,attrs:S},{type:_,attrs:T}]:[{type:u,attrs:S}]).scrollIntoView(),!I||!i)return!0;let C=I.filter(t=>k.includes(t.type.name));n.ensureMarks(C)}return!0},etW=(t,n)=>{let r=etw(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)&&Yk(t.doc,r.pos)&&t.join(r.pos),!0},etU=(t,n)=>{let r=etw(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)&&Yk(t.doc,i)&&t.join(i),!0},etz=(t,n,r,i={})=>({editor:o,tr:a,state:u,dispatch:s,chain:c,commands:l,can:f})=>{let{extensions:d,splittableMarks:p}=o.extensionManager,h=eed(t,u.schema),m=eed(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=etw(t=>etM(t.type.name,d))(g);if(x.depth>=1&&S&&x.depth-S.depth<=1){if(S.node.type===h)return l.liftListItem(m);if(etM(S.node.type.name,d)&&h.validContent(S.node.content)&&s)return c().command(()=>(a.setNodeMarkup(S.pos,h),!0)).command(()=>etW(a,h)).command(()=>etU(a,h)).run()}return r&&_&&s?c().command(()=>{let t=f().wrapInList(h,i),n=_.filter(t=>p.includes(t.type.name));return a.ensureMarks(n),!!t||l.clearNodes()}).wrapInList(h,i).command(()=>etW(a,h)).command(()=>etU(a,h)).run():c().command(()=>!!f().wrapInList(h,i)||l.clearNodes()).wrapInList(h,i).command(()=>etW(a,h)).command(()=>etU(a,h)).run()},etB=(t,n={},r={})=>({state:i,commands:o})=>{let{extendEmptyMarkRange:a=!1}=r,u=eeJ(t,i.schema);return etC(i,u,n)?o.unsetMark(u,{extendEmptyMarkRange:a}):o.setMark(u,n)},etV=(t,n,r={})=>({state:i,commands:o})=>{let a=eed(t,i.schema),u=eed(n,i.schema);return etu(i,a,r)?o.setNode(u):o.setNode(a,r)},et$=(t,n={})=>({state:r,commands:i})=>{let o=eed(t,r.schema);return etu(r,o,n)?i.lift(o):i.wrapIn(o,n)},etq=()=>({state:t,dispatch:n})=>{let r=t.plugins;for(let i=0;i<r.length;i+=1){let o=r[i],a;if(o.spec.isInputRules&&(a=o.getState(t))){if(n){let u=t.tr,s=a.transform;for(let c=s.steps.length-1;c>=0;c-=1)u.step(s.steps[c].invert(s.docs[c]));if(a.text){let l=u.doc.resolve(a.from).marks();u.replaceWith(a.from,a.to,t.schema.text(a.text,l))}else u.delete(a.from,a.to)}return!0}}return!1},etK=()=>({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},etH=(t,n={})=>({tr:r,state:i,dispatch:o})=>{var a;let{extendEmptyMarkRange:u=!1}=n,{selection:s}=r,c=eeJ(t,i.schema),{$from:l,empty:f,ranges:d}=s;if(!o)return!0;if(f&&u){let{from:p,to:h}=s,m=null===(a=l.marks().find(t=>t.type===c))||void 0===a?void 0:a.attrs,g=eeY(l,c,m);g&&(p=g.from,h=g.to),r.removeMark(p,h,c)}else d.forEach(t=>{r.removeMark(t.$from.pos,t.$to.pos,c)});return r.removeStoredMark(c),!0},etZ=(t,n={})=>({tr:r,state:i,dispatch:o})=>{let a=null,u=null,s=etd("string"==typeof t?t:t.name,i.schema);return!!s&&("node"===s&&(a=eed(t,i.schema)),"mark"===s&&(u=eeJ(t,i.schema)),o&&r.selection.ranges.forEach(t=>{let o=t.$from.pos,s=t.$to.pos;i.doc.nodesBetween(o,s,(t,i)=>{a&&a===t.type&&r.setNodeMarkup(i,void 0,{...t.attrs,...n}),u&&t.marks.length&&t.marks.forEach(a=>{if(u===a.type){let c=Math.min(i+t.nodeSize,s);r.addMark(Math.max(i,o),c,u.create({...a.attrs,...n}))}})})}),!0)},etG=(t,n={})=>({state:r,dispatch:i})=>{let o=eed(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&&YT(u,t,n);return!!s&&(i&&i(r.tr.wrap(u,s).scrollIntoView()),!0)}})(o,n)(r,i)},etY=(t,n={})=>({state:r,dispatch:i})=>{let o=eed(t,r.schema);return(function(t,n=null){return function(r,i){let{$from:o,$to:a}=r.selection,u=o.blockRange(a),s=!1,c=u;if(!u)return!1;if(u.depth>=2&&o.node(u.depth-1).type.compatibleContent(t)&&0==u.startIndex){if(0==o.index(u.depth-1))return!1;let l=r.doc.resolve(u.start-2);c=new GN(l,l,u.depth),u.endIndex<u.parent.childCount&&(u=new GN(o,r.doc.resolve(a.end(u.depth)),u.depth)),s=!0}let f=YT(c,t,n,u);return!!f&&(i&&i((function(t,n,r,i,o){let a=Gg.empty;for(let u=r.length-1;u>=0;u--)a=Gg.from(r[u].type.create(r[u].attrs,a));t.step(new Yb(n.start-(i?2:0),n.end,n.start,n.end,new GS(a,0,0),r.length,!0));let s=0;for(let c=0;c<r.length;c++)r[c].type==o&&(s=c+1);let l=r.length-s,f=n.start+r.length-(i?2:0),d=n.parent;for(let p=n.startIndex,h=n.endIndex,m=!0;p<h;p++,m=!1)!m&&YO(t.doc,f,l)&&(t.split(f,l),f+=2*l),f+=d.child(p).nodeSize;return t})(r.tr,u,f,s,t).scrollIntoView()),!0)}})(o,n)(r,i)};var etJ=Object.freeze({__proto__:null,blur:eeL,clearContent:eeD,clearNodes:eeF,command:eeW,createParagraphNear:eeU,deleteCurrentNode:eez,deleteNode:eeB,deleteRange:eeV,deleteSelection:ee$,enter:eeq,exitCode:eeK,extendMarkRange:eeQ,first:eeX,focus:ee4,forEach:ee5,insertContent:ee9,insertContentAt:ete,joinUp:ett,joinDown:etn,joinBackward:etr,joinForward:eti,keyboardShortcut:eta,lift:ets,liftEmptyBlock:etc,liftListItem:etl,newlineInCode:etf,resetAttributes:eth,scrollIntoView:etm,selectAll:etg,selectNodeBackward:ety,selectNodeForward:etv,selectParentNode:etb,selectTextblockEnd:etx,selectTextblockStart:et_,setContent:etT,setMark:etR,setMeta:etE,setNode:etj,setNodeSelection:etN,setTextSelection:etA,sinkListItem:etP,splitBlock:etD,splitListItem:etF,toggleList:etz,toggleMark:etB,toggleNode:etV,toggleWrap:et$,undoInputRule:etq,unsetAllMarks:etK,unsetMark:etH,updateAttributes:etZ,wrapIn:etG,wrapInList:etY});let etQ=eej.create({name:"commands",addCommands:()=>({...etJ})}),etX=eej.create({name:"editable",addProseMirrorPlugins(){return[new Y8({key:new Jt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),et0=eej.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:t}=this;return[new Y8({key:new Jt("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}}}})]}}),et1=eej.create({name:"keymap",addKeyboardShortcuts(){let t=()=>this.editor.commands.first(({commands:t})=>[()=>t.undoInputRule(),()=>t.command(({tr:n})=>{let{selection:r,doc:i}=n,{empty:o,$anchor:a}=r,{pos:u,parent:s}=a,c=Y$.atStart(i).from===u;return!!o&&!!c&&!!s.type.isTextblock&&!s.textContent.length&&t.clearNodes()}),()=>t.deleteSelection(),()=>t.joinBackward(),()=>t.selectNodeBackward()]),n=()=>this.editor.commands.first(({commands:t})=>[()=>t.deleteSelection(),()=>t.deleteCurrentNode(),()=>t.joinForward(),()=>t.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:t})=>[()=>t.newlineInCode(),()=>t.createParagraphNear(),()=>t.liftEmptyBlock(),()=>t.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:n,"Mod-Delete":n,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":n,"Ctrl-Alt-Backspace":n,"Alt-Delete":n,"Alt-d":n,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return ee3()||eto()?o:i},addProseMirrorPlugins(){return[new Y8({key:new Jt("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=Y$.atStart(n.doc).from,s=Y$.atEnd(n.doc).to;if(i||!(o===u&&a===s)||0!==r.doc.textBetween(0,r.doc.content.size," "," ").length)return;let c=r.tr,l=eea({state:r,transaction:c}),{commands:f}=new eeu({editor:this.editor,state:l});if(f.clearNodes(),c.steps.length)return c}})]}}),et2=eej.create({name:"tabindex",addProseMirrorPlugins(){return[new Y8({key:new Jt("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var et3=Object.freeze({__proto__:null,ClipboardTextSerializer:eeP,Commands:etQ,Editable:etX,FocusEvents:et0,Keymap:et1,Tabindex:et2});let et4=`.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
- }`,et5=class extends ees{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}(et4,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=eem(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(et3):[],...this.options.extensions].filter(t=>["extension","node","mark"].includes(null==t?void 0:t.type));this.extensionManager=new eeM(t,this)}createCommandManager(){this.commandManager=new eeu({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){let t=etS(this.options.content,this.schema,this.options.parseOptions),n=ee2(t,this.options.autofocus);this.view=new XN(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:Y6.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=etd("string"==typeof n?n:n.name,t.schema);return"node"===r?function(t,n){let r=eed(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?etO(t,n):{}}(this.state,t)}isActive(t,n){return function(t,n,r={}){if(!n)return etu(t,null,r)||etC(t,null,r);let i=etd(n,t.schema);return"node"===i?etu(t,n,r):"mark"===i&&etC(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=Yn.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 eeN(t,r,n)}(this.state.doc,{blockSeparator:n,textSerializers:{...eeA(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 et9(t){return new eew({find:t.find,handler({state:n,range:r,match:i}){let o=eeg(t.getAttributes,void 0,i);if(!1===o||null===o)return null;let{tr:a}=n,u=i[i.length-1],s=i[0],c=r.to;if(u){let l=s.search(/\S/),f=r.from+s.indexOf(u),d=f+u.length;if(etk(r.from,r.to,n.doc).filter(n=>n.mark.type.excluded.find(r=>r===t.type&&r!==n.mark.type)).filter(t=>t.to>f).length)return null;d<r.to&&a.delete(d,r.to),f>r.from&&a.delete(r.from+l,f),c=r.from+l+u.length,a.addMark(r.from+l,c,t.type.create(o||{})),a.removeStoredMark(t.type)}}})}function et6(t){return new eew({find:t.find,handler({state:n,range:r,match:i}){let o=n.doc.resolve(r.from),a=eeg(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 et8(t){return new eew({find:t.find,handler({state:n,range:r,match:i,chain:o}){let a=eeg(t.getAttributes,void 0,i)||{},u=n.tr.delete(r.from,r.to),s=u.doc.resolve(r.from).blockRange(),c=s&&YT(s,t.type,a);if(!c)return null;if(u.wrap(s,c),t.keepMarks&&t.editor){let{selection:l,storedMarks:f}=n,{splittableMarks:d}=t.editor.extensionManager,p=f||l.$to.parentOffset&&l.$from.marks();if(p){let h=p.filter(t=>d.includes(t.type.name));u.ensureMarks(h)}}if(t.keepAttributes){let m="bulletList"===t.type.name||"orderedList"===t.type.name?"listItem":"taskList";o().updateAttributes(m,a).run()}let g=u.doc.resolve(r.from-1).nodeBefore;g&&g.type===t.type&&Yk(u.doc,r.from-1)&&(!t.joinPredicate||t.joinPredicate(i,g))&&u.join(r.from-1)}})}let et7=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=eeg(eec(this,"addOptions",{name:this.name}))),this.storage=eeg(eec(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(n={}){return new t(n)}configure(t={}){let n=this.extend();return n.options=eeE(this.options,t),n.storage=eeg(eec(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=eeg(eec(r,"addOptions",{name:r.name})),r.storage=eeg(eec(r,"addStorage",{name:r.name,options:r.options})),r}static handleExit({editor:t,mark:n}){let{tr:r}=t.state,i=t.state.selection.$from;if(i.pos===i.end()){let o=i.marks();if(!o.find(t=>(null==t?void 0:t.type.name)===n.name))return!1;let a=o.find(t=>(null==t?void 0:t.type.name)===n.name);return a&&r.removeStoredMark(a),r.insertText(" ",i.pos),t.view.dispatch(r),!0}return!1}};class ene{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=eeg(eec(this,"addOptions",{name:this.name}))),this.storage=eeg(eec(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new ene(t)}configure(t={}){let n=this.extend();return n.options=eeE(this.options,t),n.storage=eeg(eec(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){let n=new ene(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=eeg(eec(n,"addOptions",{name:n.name})),n.storage=eeg(eec(n,"addStorage",{name:n.name,options:n.options})),n}}class ent{constructor(t,n,r){this.isDragging=!1,this.component=t,this.editor=n.editor,this.options={stopEvent:null,ignoreMutation:null,...r},this.extension=n.extension,this.node=n.node,this.decorations=n.decorations,this.getPos=n.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(t){var n,r,i,o,a,u,s;let{view:c}=this.editor,l=t.target,f=3===l.nodeType?null===(n=l.parentElement)||void 0===n?void 0:n.closest("[data-drag-handle]"):l.closest("[data-drag-handle]");if(!this.dom||!(null===(r=this.contentDOM)||void 0===r)&&r.contains(l)||!f)return;let d=0,p=0;if(this.dom!==f){let h=this.dom.getBoundingClientRect(),m=f.getBoundingClientRect(),g=null!==(i=t.offsetX)&&void 0!==i?i:null===(o=t.nativeEvent)||void 0===o?void 0:o.offsetX,y=null!==(a=t.offsetY)&&void 0!==a?a:null===(u=t.nativeEvent)||void 0===u?void 0:u.offsetY;d=m.x-h.x+g,p=m.y-h.y+y}null===(s=t.dataTransfer)||void 0===s||s.setDragImage(this.dom,d,p);let v=YY.create(c.state.doc,this.getPos()),b=c.state.tr.setSelection(v);c.dispatch(b)}stopEvent(t){var n;if(!this.dom)return!1;if("function"==typeof this.options.stopEvent)return this.options.stopEvent({event:t});let r=t.target;if(!(this.dom.contains(r)&&!(!(null===(n=this.contentDOM)||void 0===n)&&n.contains(r))))return!1;let i=t.type.startsWith("drag"),o="drop"===t.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!o&&!i)return!0;let{isEditable:a}=this.editor,{isDragging:u}=this,s=!!this.node.type.spec.draggable,c=YY.isSelectable(this.node),l="copy"===t.type,f="paste"===t.type,d="cut"===t.type,p="mousedown"===t.type;if(!s&&c&&i&&t.preventDefault(),s&&i&&!u)return t.preventDefault(),!1;if(s&&a&&!u&&p){let h=r.closest("[data-drag-handle]");h&&(this.dom===h||this.dom.contains(h))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(u||o||l||f||d||p&&c)}ignoreMutation(t){return!this.dom||!this.contentDOM||("function"==typeof this.options.ignoreMutation?this.options.ignoreMutation({mutation:t}):!!this.node.isLeaf||!!this.node.isAtom||!("selection"===t.type||this.dom.contains(t.target)&&"childList"===t.type&&ee3()&&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 enn(t){return new eeI({find:t.find,handler({state:n,range:r,match:i}){let o=eeg(t.getAttributes,void 0,i);if(!1===o||null===o)return null;let{tr:a}=n,u=i[i.length-1],s=i[0],c=r.to;if(u){let l=s.search(/\S/),f=r.from+s.indexOf(u),d=f+u.length;if(etk(r.from,r.to,n.doc).filter(n=>n.mark.type.excluded.find(r=>r===t.type&&r!==n.mark.type)).filter(t=>t.to>f).length)return null;d<r.to&&a.delete(d,r.to),f>r.from&&a.delete(r.from+l,f),c=r.from+l+u.length,a.addMark(r.from+l,c,t.type.create(o||{})),a.removeStoredMark(t.type)}}})}var enr="bottom",eni="right",eno="left",ena="auto",enu=["top",enr,eni,eno],ens="start",enc="viewport",enl="popper",enf=enu.reduce(function(t,n){return t.concat([n+"-"+ens,n+"-end"])},[]),end=[].concat(enu,[ena]).reduce(function(t,n){return t.concat([n,n+"-"+ens,n+"-end"])},[]),enp=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function enh(t){return t?(t.nodeName||"").toLowerCase():null}function enm(t){if(null==t)return window;if("[object Window]"!==t.toString()){var n=t.ownerDocument;return n&&n.defaultView||window}return t}function eng(t){var n=enm(t).Element;return t instanceof n||t instanceof Element}function eny(t){var n=enm(t).HTMLElement;return t instanceof n||t instanceof HTMLElement}function env(t){if(typeof ShadowRoot>"u")return!1;var n=enm(t).ShadowRoot;return t instanceof n||t instanceof ShadowRoot}let enb={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];eny(o)&&enh(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},{});eny(i)&&enh(i)&&(Object.assign(i.style,a),Object.keys(o).forEach(function(t){i.removeAttribute(t)}))})}},requires:["computeStyles"]};function enx(t){return t.split("-")[0]}var en_=Math.max,enS=Math.min,enT=Math.round;function enw(){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 enO(){return!/^((?!chrome|android).)*safari/i.test(enw())}function enk(t,n,r){void 0===n&&(n=!1),void 0===r&&(r=!1);var i=t.getBoundingClientRect(),o=1,a=1;n&&eny(t)&&(o=t.offsetWidth>0&&enT(i.width)/t.offsetWidth||1,a=t.offsetHeight>0&&enT(i.height)/t.offsetHeight||1);var u=(eng(t)?enm(t):window).visualViewport,s=!enO()&&r,c=(i.left+(s&&u?u.offsetLeft:0))/o,l=(i.top+(s&&u?u.offsetTop:0))/a,f=i.width/o,d=i.height/a;return{width:f,height:d,top:l,right:c+f,bottom:l+d,left:c,x:c,y:l}}function enI(t){var n=enk(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 enC(t,n){var r=n.getRootNode&&n.getRootNode();if(t.contains(n))return!0;if(r&&env(r)){var i=n;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function enM(t){return enm(t).getComputedStyle(t)}function enR(t){return["table","td","th"].indexOf(enh(t))>=0}function enE(t){return((eng(t)?t.ownerDocument:t.document)||window.document).documentElement}function enj(t){return"html"===enh(t)?t:t.assignedSlot||t.parentNode||(env(t)?t.host:null)||enE(t)}function enN(t){return eny(t)&&"fixed"!==enM(t).position?t.offsetParent:null}function enA(t){for(var n=enm(t),r=enN(t);r&&enR(r)&&"static"===enM(r).position;)r=enN(r);return r&&("html"===enh(r)||"body"===enh(r)&&"static"===enM(r).position)?n:r||function(t){var n=/firefox/i.test(enw());if(/Trident/i.test(enw())&&eny(t)&&"fixed"===enM(t).position)return null;var r=enj(t);for(env(r)&&(r=r.host);eny(r)&&0>["html","body"].indexOf(enh(r));){var i=enM(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 enP(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function enL(t,n,r){return en_(t,enS(n,r))}function enD(){return{top:0,right:0,bottom:0,left:0}}function enF(t){return Object.assign({},enD(),t)}function enW(t,n){return n.reduce(function(n,r){return n[r]=t,n},{})}function enU(t){return t.split("-")[1]}var enz={top:"auto",right:"auto",bottom:"auto",left:"auto"};function enB(t){var n,r,i=t.popper,o=t.popperRect,a=t.placement,u=t.variation,s=t.offsets,c=t.position,l=t.gpuAcceleration,f=t.adaptive,d=t.roundOffsets,p=t.isFixed,h=s.x,m=void 0===h?0:h,g=s.y,y=void 0===g?0:g,v="function"==typeof d?d({x:m,y:y}):{x:m,y:y};m=v.x,y=v.y;var b=s.hasOwnProperty("x"),x=s.hasOwnProperty("y"),_=eno,S="top",T=window;if(f){var w=enA(i),O="clientHeight",k="clientWidth";w===enm(i)&&(w=enE(i),"static"!==enM(w).position&&"absolute"===c&&(O="scrollHeight",k="scrollWidth")),("top"===a||(a===eno||a===eni)&&"end"===u)&&(S=enr,y-=(p&&w===T&&T.visualViewport?T.visualViewport.height:w[O])-o.height,y*=l?1:-1),(a===eno||("top"===a||a===enr)&&"end"===u)&&(_=eni,m-=(p&&w===T&&T.visualViewport?T.visualViewport.width:w[k])-o.width,m*=l?1:-1)}var I,C,M,R,E,j=Object.assign({position:c},f&&enz),N=!0===d?(I={x:m,y:y},C=enm(i),M=I.x,R=I.y,{x:enT(M*(E=C.devicePixelRatio||1))/E||0,y:enT(R*E)/E||0}):{x:m,y:y};return(m=N.x,y=N.y,l)?Object.assign({},j,((n={})[S]=x?"0":"",n[_]=b?"0":"",n.transform=1>=(T.devicePixelRatio||1)?"translate("+m+"px, "+y+"px)":"translate3d("+m+"px, "+y+"px, 0)",n)):Object.assign({},j,((r={})[S]=x?y+"px":"",r[_]=b?m+"px":"",r.transform="",r))}var enV={passive:!0},en$={left:"right",right:"left",bottom:"top",top:"bottom"};function enq(t){return t.replace(/left|right|bottom|top/g,function(t){return en$[t]})}var enK={start:"end",end:"start"};function enH(t){return t.replace(/start|end/g,function(t){return enK[t]})}function enZ(t){var n,r=enm(t);return{scrollLeft:r.pageXOffset,scrollTop:r.pageYOffset}}function enG(t){return enk(enE(t)).left+enZ(t).scrollLeft}function enY(t){var n=enM(t),r=n.overflow,i=n.overflowX,o=n.overflowY;return/auto|scroll|overlay|hidden/.test(r+o+i)}function enJ(t,n){void 0===n&&(n=[]);var r,i=function t(n){return["html","body","#document"].indexOf(enh(n))>=0?n.ownerDocument.body:eny(n)&&enY(n)?n:t(enj(n))}(t),o=i===(null==(r=t.ownerDocument)?void 0:r.body),a=enm(i),u=o?[a].concat(a.visualViewport||[],enY(i)?i:[]):i,s=n.concat(u);return o?s:s.concat(enJ(enj(u)))}function enQ(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function enX(t,n,r){var i,o,a,u,s,c,l,f,d,p,h,m;return n===enc?enQ(function(t,n){var r=enm(t),i=enE(t),o=r.visualViewport,a=i.clientWidth,u=i.clientHeight,s=0,c=0;if(o){a=o.width,u=o.height;var l=enO();(l||!l&&"fixed"===n)&&(s=o.offsetLeft,c=o.offsetTop)}return{width:a,height:u,x:s+enG(t),y:c}}(t,r)):eng(n)?((a=enk(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):enQ((u=enE(t),c=enE(u),l=enZ(u),f=null==(s=u.ownerDocument)?void 0:s.body,d=en_(c.scrollWidth,c.clientWidth,f?f.scrollWidth:0,f?f.clientWidth:0),p=en_(c.scrollHeight,c.clientHeight,f?f.scrollHeight:0,f?f.clientHeight:0),h=-l.scrollLeft+enG(u),m=-l.scrollTop,"rtl"===enM(f||c).direction&&(h+=en_(c.clientWidth,f?f.clientWidth:0)-d),{width:d,height:p,x:h,y:m}))}function en0(t){var n,r=t.reference,i=t.element,o=t.placement,a=o?enx(o):null,u=o?enU(o):null,s=r.x+r.width/2-i.width/2,c=r.y+r.height/2-i.height/2;switch(a){case"top":n={x:s,y:r.y-i.height};break;case enr:n={x:s,y:r.y+r.height};break;case eni:n={x:r.x+r.width,y:c};break;case eno:n={x:r.x-i.width,y:c};break;default:n={x:r.x,y:r.y}}var l=a?enP(a):null;if(null!=l){var f="y"===l?"height":"width";switch(u){case ens:n[l]=n[l]-(r[f]/2-i[f]/2);break;case"end":n[l]=n[l]+(r[f]/2-i[f]/2)}}return n}function en1(t,n){void 0===n&&(n={});var r,i,o,a,u,s,c,l,f,d,p=n,h=p.placement,m=void 0===h?t.placement:h,g=p.strategy,y=void 0===g?t.strategy:g,v=p.boundary,b=p.rootBoundary,x=p.elementContext,_=void 0===x?enl:x,S=p.altBoundary,T=p.padding,w=void 0===T?0:T,O=enF("number"!=typeof w?w:enW(w,enu)),k=t.rects.popper,I=t.elements[void 0!==S&&S?_===enl?"reference":enl:_],C=(r=eng(I)?I:I.contextElement||enE(t.elements.popper),f=(l=[].concat("clippingParents"===(i=void 0===v?"clippingParents":v)?(s=enJ(enj(r)),c=["absolute","fixed"].indexOf(enM(r).position)>=0&&eny(r)?enA(r):r,eng(c)?s.filter(function(t){return eng(t)&&enC(t,c)&&"body"!==enh(t)}):[]):[].concat(i),[void 0===b?enc:b]))[0],(d=l.reduce(function(t,n){var i=enX(r,n,y);return t.top=en_(i.top,t.top),t.right=enS(i.right,t.right),t.bottom=enS(i.bottom,t.bottom),t.left=en_(i.left,t.left),t},enX(r,f,y))).width=d.right-d.left,d.height=d.bottom-d.top,d.x=d.left,d.y=d.top,d),M=enk(t.elements.reference),R=en0({reference:M,element:k,strategy:"absolute",placement:m}),E=enQ(Object.assign({},k,R)),j=_===enl?E:M,N={top:C.top-j.top+O.top,bottom:j.bottom-C.bottom+O.bottom,left:C.left-j.left+O.left,right:j.right-C.right+O.right},A=t.modifiersData.offset;if(_===enl&&A){var P=A[m];Object.keys(N).forEach(function(t){var n=[eni,enr].indexOf(t)>=0?1:-1,r=["top",enr].indexOf(t)>=0?"y":"x";N[t]+=P[r]*n})}return N}function en2(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 en3(t){return["top",eni,enr,eno].some(function(n){return t[n]>=0})}var en4={placement:"bottom",modifiers:[],strategy:"absolute"};function en5(){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 en9,en6,en8,en7,ere,ert,ern=(en9={defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var n=t.state,r=t.instance,i=t.options,o=i.scroll,a=void 0===o||o,u=i.resize,s=void 0===u||u,c=enm(n.elements.popper),l=[].concat(n.scrollParents.reference,n.scrollParents.popper);return a&&l.forEach(function(t){t.addEventListener("scroll",r.update,enV)}),s&&c.addEventListener("resize",r.update,enV),function(){a&&l.forEach(function(t){t.removeEventListener("scroll",r.update,enV)}),s&&c.removeEventListener("resize",r.update,enV)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var n=t.state,r=t.name;n.modifiersData[r]=en0({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:enx(n.placement),variation:enU(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,enB(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,enB(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:{}},enb,{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=end.reduce(function(t,r){var i,o,u,s,c,l,f,d;return t[r]=(o=n.rects,c=[eno,"top"].indexOf(s=enx(r))>=0?-1:1,f=(l="function"==typeof a?a(Object.assign({},o,{placement:r})):a)[0],d=l[1],f=f||0,d=(d||0)*c,[eno,eni].indexOf(s)>=0?{x:d,y:f}:{x:f,y:d}),t},{}),s=u[n.placement],c=s.x,l=s.y;null!=n.modifiersData.popperOffsets&&(n.modifiersData.popperOffsets.x+=c,n.modifiersData.popperOffsets.y+=l),n.modifiersData[i]=u}},{name:"flip",enabled:!0,phase:"main",fn:function(t){var n=t.state,r=t.options,i=t.name;if(!n.modifiersData[i]._skip){for(var o=r.mainAxis,a=void 0===o||o,u=r.altAxis,s=void 0===u||u,c=r.fallbackPlacements,l=r.padding,f=r.boundary,d=r.rootBoundary,p=r.altBoundary,h=r.flipVariations,m=void 0===h||h,g=r.allowedAutoPlacements,y=n.options.placement,v=enx(y),b=c||(v!==y&&m?function(t){if(enx(t)===ena)return[];var n=enq(t);return[enH(t),n,enH(n)]}(y):[enq(y)]),x=[y].concat(b).reduce(function(t,r){var i,o,a,u,s,c,p,h,y,v,b,x,_,S;return t.concat(enx(r)===ena?(o={placement:r,boundary:f,rootBoundary:d,padding:l,flipVariations:m,allowedAutoPlacements:g},u=(a=o).placement,s=a.boundary,c=a.rootBoundary,p=a.padding,h=a.flipVariations,v=void 0===(y=a.allowedAutoPlacements)?end:y,0===(_=(x=(b=enU(u))?h?enf:enf.filter(function(t){return enU(t)===b}):enu).filter(function(t){return v.indexOf(t)>=0})).length&&(_=x),Object.keys(S=_.reduce(function(t,r){return t[r]=en1(n,{placement:r,boundary:s,rootBoundary:c,padding:p})[enx(r)],t},{})).sort(function(t,n){return S[t]-S[n]})):r)},[]),_=n.rects.reference,S=n.rects.popper,T=new Map,w=!0,O=x[0],k=0;k<x.length;k++){var I=x[k],C=enx(I),M=enU(I)===ens,R=["top",enr].indexOf(C)>=0,E=R?"width":"height",j=en1(n,{placement:I,boundary:f,rootBoundary:d,altBoundary:p,padding:l}),N=R?M?eni:eno:M?enr:"top";_[E]>S[E]&&(N=enq(N));var A=enq(N),P=[];if(a&&P.push(j[C]<=0),s&&P.push(j[N]<=0,j[A]<=0),P.every(function(t){return t})){O=I,w=!1;break}T.set(I,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,c=i.rootBoundary,l=i.altBoundary,f=i.padding,d=i.tether,p=void 0===d||d,h=i.tetherOffset,m=void 0===h?0:h,g=en1(r,{boundary:s,rootBoundary:c,padding:f,altBoundary:l}),y=enx(r.placement),v=enU(r.placement),b=!v,x=enP(y),_="x"===x?"y":"x",S=r.modifiersData.popperOffsets,T=r.rects.reference,w=r.rects.popper,O="function"==typeof m?m(Object.assign({},r.rects,{placement:r.placement})):m,k="number"==typeof O?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),I=r.modifiersData.offset?r.modifiersData.offset[r.placement]:null,C={x:0,y:0};if(S){if(void 0===a||a){var M,R="y"===x?"top":eno,E="y"===x?enr:eni,j="y"===x?"height":"width",N=S[x],A=N+g[R],P=N-g[E],L=p?-w[j]/2:0,D=v===ens?T[j]:w[j],F=v===ens?-w[j]:-T[j],W=r.elements.arrow,U=p&&W?enI(W):{width:0,height:0},z=r.modifiersData["arrow#persistent"]?r.modifiersData["arrow#persistent"].padding:enD(),B=z[R],V=z[E],$=enL(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&&enA(r.elements.arrow),Z=H?"y"===x?H.clientTop||0:H.clientLeft||0:0,G=null!=(M=null==I?void 0:I[x])?M:0,Y=enL(p?enS(A,N+q-G-Z):A,N,p?en_(P,N+K-G):P);S[x]=Y,C[x]=Y-N}if(void 0!==u&&u){var J,Q,X,ee,et,en=S[_],er="y"===_?"height":"width",ei=en+g["x"===x?"top":eno],eo=en-g["x"===x?enr:eni],ea=-1!==["top",eno].indexOf(y),eu=null!=(et=null==I?void 0:I[_])?et:0,es=ea?ei:en-T[er]-w[er]-eu+k.altAxis,ec=ea?en+T[er]+w[er]-eu-k.altAxis:eo,el=p&&ea?(ee=enL(es,en,ec))>ec?ec:ee:enL(p?es:ei,en,p?ec:eo);S[_]=el,C[_]=el-en}r.modifiersData[o]=C}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(t){var n,r=t.state,i=t.name,o=t.options,a=r.elements.arrow,u=r.modifiersData.popperOffsets,s=enx(r.placement),c=enP(s),l=[eno,eni].indexOf(s)>=0?"height":"width";if(!(!a||!u)){var f,d,p=enF("number"!=typeof(f="function"==typeof(f=o.padding)?f(Object.assign({},r.rects,{placement:r.placement})):f)?f:enW(f,enu)),h=enI(a),m=r.rects.reference[l]+r.rects.reference[c]-u[c]-r.rects.popper[l],g=u[c]-r.rects.reference[c],y=enA(a),v=y?"y"===c?y.clientHeight||0:y.clientWidth||0:0,b=p["y"===c?"top":eno],x=v-h[l]-p["y"===c?enr:eni],_=v/2-h[l]/2+(m/2-g/2),S=enL(b,_,x);r.modifiersData[i]=((n={})[c]=S,n.centerOffset=S-_,n)}},effect:function(t){var n=t.state,r=t.options.element,i=void 0===r?"[data-popper-arrow]":r;null==i||("string"!=typeof i||(i=n.elements.popper.querySelector(i)))&&enC(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=en1(n,{elementContext:"reference"}),s=en1(n,{altBoundary:!0}),c=en2(u,i),l=en2(s,o,a),f=en3(c),d=en3(l);n.modifiersData[r]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:f,hasPopperEscaped:d},n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":d})}}]},en7=void 0===(en8=(en6=en9).defaultModifiers)?[]:en8,ert=void 0===(ere=en6.defaultOptions)?en4:ere,function(t,n,r){void 0===r&&(r=ert);var i,o,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},en4,ert),modifiersData:{},elements:{reference:t,popper:n},attributes:{},styles:{}},u=[],s=!1,c={state:a,setOptions:function(r){var i,o,s,f,d,p,h,m,g="function"==typeof r?r(a.options):r;l(),a.options=Object.assign({},ert,a.options,g),a.scrollParents={reference:eng(t)?enJ(t):t.contextElement?enJ(t.contextElement):[],popper:enJ(n)};var y=(s=Object.keys(o=(i=[].concat(en7,a.options.modifiers)).reduce(function(t,n){var r=t[n.name];return t[n.name]=r?Object.assign({},r,n,{options:Object.assign({},r.options,n.options),data:Object.assign({},r.data,n.data)}):n,t},{})).map(function(t){return o[t]}),d=new Map,p=new Set,h=[],s.forEach(function(t){d.set(t.name,t)}),s.forEach(function(t){p.has(t.name)||function t(n){p.add(n.name),[].concat(n.requires||[],n.requiresIfExists||[]).forEach(function(n){if(!p.has(n)){var r=d.get(n);r&&t(r)}}),h.push(n)}(t)}),enp.reduce(function(t,n){return t.concat(h.filter(function(t){return t.phase===n}))},[]));return a.orderedModifiers=y.filter(function(t){return t.enabled}),a.orderedModifiers.forEach(function(t){var n=t.name,r=t.options,i=t.effect;if("function"==typeof i){var o=i({state:a,name:n,instance:c,options:void 0===r?{}:r}),s=function(){};u.push(o||s)}}),c.update()},forceUpdate:function(){if(!s){var t,n,r,i,o,u,l,f,d,p,h,m,g,y,v,b=a.elements,x=b.reference,_=b.popper;if(en5(x,_)){a.rects={reference:(t=x,n=enA(_),r="fixed"===a.options.strategy,f=eny(n),d=eny(n)&&(u=enT((o=(i=n).getBoundingClientRect()).width)/i.offsetWidth||1,l=enT(o.height)/i.offsetHeight||1,1!==u||1!==l),p=enE(n),h=enk(t,d,r),m={scrollLeft:0,scrollTop:0},g={x:0,y:0},(f||!f&&!r)&&(("body"!==enh(n)||enY(p))&&(m=(y=n)!==enm(y)&&eny(y)?{scrollLeft:(v=y).scrollLeft,scrollTop:v.scrollTop}:enZ(y)),eny(n)?(g=enk(n,!0),g.x+=n.clientLeft,g.y+=n.clientTop):p&&(g.x=enG(p))),{x:h.left+m.scrollLeft-g.x,y:h.top+m.scrollTop-g.y,width:h.width,height:h.height}),popper:enI(_)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach(function(t){return a.modifiersData[t.name]=Object.assign({},t.data)});for(var S=0;S<a.orderedModifiers.length;S++){if(!0===a.reset){a.reset=!1,S=-1;continue}var T=a.orderedModifiers[S],w=T.fn,O=T.options,k=void 0===O?{}:O,I=T.name;"function"==typeof w&&(a=w({state:a,options:k,name:I,instance:c})||a)}}}},update:function(){return o||(o=new Promise(function(t){Promise.resolve().then(function(){o=void 0,t(new Promise(function(t){c.forceUpdate(),t(a)}))})})),o},destroy:function(){l(),s=!0}};if(!en5(t,n))return c;function l(){u.forEach(function(t){return t()}),u=[]}return c.setOptions(r).then(function(t){!s&&r.onFirstUpdate&&r.onFirstUpdate(t)}),c}),err="tippy-content",eri="tippy-arrow",ero="tippy-svg-arrow",era={passive:!0,capture:!0},eru=function(){return document.body};function ers(t,n,r){return Array.isArray(t)?t[n]??(Array.isArray(r)?r[n]:r):t}function erc(t,n){var r=({}).toString.call(t);return 0===r.indexOf("[object")&&r.indexOf(n+"]")>-1}function erl(t,n){return"function"==typeof t?t.apply(void 0,n):t}function erf(t,n){var r;return 0===n?t:function(i){clearTimeout(r),r=setTimeout(function(){t(i)},n)}}function erd(t){return[].concat(t)}function erp(t,n){-1===t.indexOf(n)&&t.push(n)}function erh(t){return[].slice.call(t)}function erm(t){return Object.keys(t).reduce(function(n,r){return void 0!==t[r]&&(n[r]=t[r]),n},{})}function erg(){return document.createElement("div")}function ery(t){return["Element","Fragment"].some(function(n){return erc(t,n)})}function erv(t,n){t.forEach(function(t){t&&(t.style.transitionDuration=n+"ms")})}function erb(t,n){t.forEach(function(t){t&&t.setAttribute("data-state",n)})}function erx(t,n,r){var i=n+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(n){t[i](n,r)})}function er_(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 erS={isTouch:!1},erT=0;function erw(){erS.isTouch||(erS.isTouch=!0,window.performance&&document.addEventListener("mousemove",erO))}function erO(){var t=performance.now();t-erT<20&&(erS.isTouch=!1,document.removeEventListener("mousemove",erO)),erT=t}function erk(){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 erI=!!("u">typeof window&&"u">typeof document)&&!!window.msCrypto,erC=Object.assign({appendTo:eru,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}),erM=Object.keys(erC),erR=function(t){Object.keys(t).forEach(function(n){erC[n]=t[n]})};function erE(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=erC[o])?i:a),n},{});return Object.assign({},t,n)}function erj(t,n){var r,i,o=Object.assign({},n,{content:erl(n.content,[t])},n.ignoreAttributes?{}:((i=n.plugins)?Object.keys(erE(Object.assign({},erC,{plugins:i}))):erM).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({},erC.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 erN=function(){return"innerHTML"};function erA(t,n){t[erN()]=n}function erP(t){var n=erg();return!0===t?n.className=eri:(n.className=ero,ery(t)?n.appendChild(t):erA(n,t)),n}function erL(t,n){ery(n.content)?(erA(t,""),t.appendChild(n.content)):"function"!=typeof n.content&&(n.allowHTML?erA(t,n.content):t.textContent=n.content)}function erD(t){var n=t.firstElementChild,r=erh(n.children);return{box:n,content:r.find(function(t){return t.classList.contains(err)}),arrow:r.find(function(t){return t.classList.contains(eri)||t.classList.contains(ero)}),backdrop:r.find(function(t){return t.classList.contains("tippy-backdrop")})}}function erF(t){var n=erg(),r=erg();r.className="tippy-box",r.setAttribute("data-state","hidden"),r.setAttribute("tabindex","-1");var i=erg();function o(r,i){var o=erD(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)&&erL(u,t.props),i.arrow?s?r.arrow!==i.arrow&&(a.removeChild(s),a.appendChild(erP(i.arrow))):a.appendChild(erP(i.arrow)):s&&a.removeChild(s)}return i.className=err,i.setAttribute("data-state","hidden"),erL(i,t.props),n.appendChild(r),r.appendChild(i),o(t.props,t.props),{popper:n,onUpdate:o}}erF.$$tippy=!0;var erW=1,erU=[],erz=[];function erB(t,n){void 0===n&&(n={});var r,i,o=erC.plugins.concat(n.plugins||[]);document.addEventListener("touchstart",erw,era),window.addEventListener("blur",erk);var a,u=Object.assign({},n,{plugins:o}),s=(ery(t)?[t]:erc(t,"NodeList")?erh(t):Array.isArray(t)?t:erh(document.querySelectorAll(t))).reduce(function(t,n){var r=n&&function(t,n){var r,i,o,a,u,s,c,l,f=erj(t,Object.assign({},erC,erE(erm(n)))),d=!1,p=!1,h=!1,m=!1,g=[],y=erf(Z,f.interactiveDebounce),v=erW++,b=(r=f.plugins).filter(function(t,n){return r.indexOf(t)===n}),x={id:v,reference:t,popper:erg(),popperInstance:null,props:f,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:b,clearDelayTimeouts:function(){clearTimeout(i),clearTimeout(o),cancelAnimationFrame(a)},setProps:function(n){if(!x.state.isDestroyed){A("onBeforeUpdate",[x,n]),K();var r=x.props,i=erj(t,Object.assign({},r,erm(n),{ignoreAttributes:!0}));x.props=i,q(),r.interactiveDebounce!==i.interactiveDebounce&&(D(),y=erf(Z,i.interactiveDebounce)),r.triggerTarget&&!i.triggerTarget?erd(r.triggerTarget).forEach(function(t){t.removeAttribute("aria-expanded")}):i.triggerTarget&&t.removeAttribute("aria-expanded"),L(),N(),T&&T(r,i),x.popperInstance&&(Q(),ee().forEach(function(t){requestAnimationFrame(t._tippy.popperInstance.forceUpdate)})),A("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=erS.isTouch&&!x.props.touch,o=ers(x.props.duration,0,erC.duration);if(!(t||n||r||i)&&!M().hasAttribute("disabled")&&(A("onShow",[x],!1),!1!==x.props.onShow(x))){if(x.state.isVisible=!0,C()&&(S.style.visibility="visible"),N(),z(),x.state.isMounted||(S.style.transition="none"),C()){var a,u,s,l,f=E();erv([f.box,f.content],0)}c=function(){var t;if(!(!x.state.isVisible||m)){if(m=!0,S.offsetHeight,S.style.transition=x.props.moveTransition,C()&&x.props.animation){var n,r,i=E(),a=i.box,u=i.content;erv([a,u],o),erb([a,u],"visible")}P(),L(),erp(erz,x),null==(t=x.popperInstance)||t.forceUpdate(),A("onMount",[x]),x.props.animation&&C()&&V(o,r=function(){x.state.isShown=!0,A("onShown",[x])})}},u=x.props.appendTo,s=M(),(a=x.props.interactive&&u===eru||"parent"===u?s.parentNode:erl(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=ers(x.props.duration,1,erC.duration);if(!(t||n||r)&&(A("onHide",[x],!1),!1!==x.props.onHide(x))){if(x.state.isVisible=!1,x.state.isShown=!1,m=!1,d=!1,C()&&(S.style.visibility="hidden"),D(),B(),N(!0),C()){var o,a,u=E(),s=u.box,c=u.content;x.props.animation&&(erv([s,c],i),erb([s,c],"hidden"))}P(),L(),x.props.animation?C()&&(a=x.unmount,V(i,function(){!x.state.isVisible&&S.parentNode&&S.parentNode.contains(S)&&a()})):x.unmount()}},hideWithInteractivity:function(t){R().addEventListener("mousemove",y),erp(erU,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),erz=erz.filter(function(t){return t!==x}),x.state.isMounted=!1,A("onHidden",[x]))},destroy:function(){x.state.isDestroyed||(x.clearDelayTimeouts(),x.unmount(),K(),delete t._tippy,x.state.isDestroyed=!0,A("onDestroy",[x]))}};if(!f.render)return x;var _=f.render(x),S=_.popper,T=_.onUpdate;S.setAttribute("data-tippy-root",""),S.id="tippy-"+x.id,x.popper=S,t._tippy=x,S._tippy=x;var w=b.map(function(t){return t.fn(x)}),O=t.hasAttribute("aria-expanded");return q(),L(),N(),A("onCreate",[x]),f.showOnCreate&&et(),S.addEventListener("mouseenter",function(){x.props.interactive&&x.state.isVisible&&x.clearDelayTimeouts()}),S.addEventListener("mouseleave",function(){x.props.interactive&&x.props.trigger.indexOf("mouseenter")>=0&&R().addEventListener("mousemove",y)}),x;function k(){var t=x.props.touch;return Array.isArray(t)?t:[t,0]}function I(){return"hold"===k()[0]}function C(){var t;return!!(null!=(t=x.props.render)&&t.$$tippy)}function M(){return l||t}function R(){var t,n,r,i=M().parentNode;return i&&null!=(r=erd(i)[0])&&null!=(n=r.ownerDocument)&&n.body?r.ownerDocument:document}function E(){return erD(S)}function j(t){return x.state.isMounted&&!x.state.isVisible||erS.isTouch||u&&"focus"===u.type?0:ers(x.props.delay,t?0:1,erC.delay)}function N(t){void 0===t&&(t=!1),S.style.pointerEvents=x.props.interactive&&!t?"":"none",S.style.zIndex=""+x.props.zIndex}function A(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;erd(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)&&erd(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),erU=erU.filter(function(t){return t!==y})}function F(n){if(!(erS.isTouch&&(h||"mousedown"===n.type))){var r=n.composedPath&&n.composedPath()[0]||n.target;if(!(x.props.interactive&&er_(S,r))){if(erd(x.props.triggerTarget||t).some(function(t){return er_(t,r)})){if(erS.isTouch||x.state.isVisible&&x.props.trigger.indexOf("click")>=0)return}else A("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,era),t.addEventListener("touchstart",U,era),t.addEventListener("touchmove",W,era)}function B(){var t=R();t.removeEventListener("mousedown",F,!0),t.removeEventListener("touchend",F,era),t.removeEventListener("touchstart",U,era),t.removeEventListener("touchmove",W,era)}function V(t,n){var r=E().box;function i(t){t.target===r&&(erx(r,"remove",i),n())}if(0===t)return n();erx(r,"remove",s),erx(r,"add",i),s=i}function $(n,r,i){void 0===i&&(i=!1),erd(x.props.triggerTarget||t).forEach(function(t){t.addEventListener(n,r,i),g.push({node:t,eventType:n,handler:r,options:i})})}function q(){var t;I()&&($("touchstart",H,{passive:!0}),$("touchend",G,{passive:!0})),(t=x.props.trigger).split(/\s+/).filter(Boolean).forEach(function(t){if("manual"!==t)switch($(t,H),t){case"mouseenter":$("mouseleave",G);break;case"focus":$(erI?"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,l=t.currentTarget,L(),!x.state.isVisible&&erc(t,"MouseEvent")&&erU.forEach(function(n){return n(t)}),"click"===t.type&&(0>x.props.trigger.indexOf("mouseenter")||d)&&!1!==x.props.hideOnClick&&x.state.isVisible?r=!0:et(t),"click"===t.type&&(d=!r),r&&!o&&en(t)}}function Z(t){var n,r,i,o,a=t.target,u=M().contains(a)||S.contains(a);!("mousemove"===t.type&&u)&&(n=ee().concat(S).map(function(t){var n,r=null==(n=t._tippy.popperInstance)?void 0:n.state;return r?{popperRect:t.getBoundingClientRect(),popperState:r,props:f}:null}).filter(Boolean),i=(r=t).clientX,o=r.clientY,n.every(function(t){var n,r=t.popperRect,a=t.popperState,u=t.props.interactiveBorder,s=(n=a.placement).split("-")[0],c=a.modifiersData.offset;if(!c)return!0;var l="bottom"===s?c.top.y:0,f="top"===s?c.bottom.y:0,d="right"===s?c.left.x:0,p="left"===s?c.right.x:0,h=r.top-o+l>u,m=o-r.bottom-f>u,g=r.left-i+d>u,y=i-r.right-p>u;return h||m||g||y})&&(D(),en(t)))}function G(t){if(!(J(t)||x.props.trigger.indexOf("click")>=0&&d)){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!!erS.isTouch&&I()!==t.type.indexOf("touch")>=0}function Q(){X();var n=x.props,r=n.popperOptions,i=n.placement,o=n.offset,a=n.getReferenceClientRect,u=n.moveTransition,s=C()?erD(S).arrow:null,l=a?{getBoundingClientRect:a,contextElement:a.contextElement||M()}:t,f=[{name:"offset",options:{offset:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!u}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(t){var n=t.state;if(C()){var r=E().box;["placement","reference-hidden","escaped"].forEach(function(t){"placement"===t?r.setAttribute("data-placement",n.placement):n.attributes.popper["data-popper-"+t]?r.setAttribute("data-"+t,""):r.removeAttribute("data-"+t)}),n.attributes.popper={}}}}];C()&&s&&f.push({name:"arrow",options:{element:s,padding:3}}),f.push.apply(f,(null==r?void 0:r.modifiers)||[]),x.popperInstance=ern(l,S,Object.assign({},r,{placement:i,onFirstUpdate:c,modifiers:f}))}function X(){x.popperInstance&&(x.popperInstance.destroy(),x.popperInstance=null)}function ee(){return erh(S.querySelectorAll("[data-tippy-root]"))}function et(t){x.clearDelayTimeouts(),t&&A("onTrigger",[x,t]),z();var n=j(!0),r=k(),o=r[0],a=r[1];erS.isTouch&&"hold"===o&&a&&(n=a),n?i=setTimeout(function(){x.show()},n):x.show()}function en(t){if(x.clearDelayTimeouts(),A("onUntrigger",[x,t]),!x.state.isVisible){B();return}if(!(x.props.trigger.indexOf("mouseenter")>=0&&x.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(t.type)>=0&&d)){var n=j(!1);n?o=setTimeout(function(){x.state.isVisible&&x.hide()},n):a=requestAnimationFrame(function(){x.hide()})}}}(n,u);return r&&t.push(r),t},[]);return ery(t)?s[0]:s}erB.defaultProps=erC,erB.setDefaultProps=erR,erB.currentInput=erS,Object.assign({},enb,{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)}}),erB.setDefaultProps({render:erF});class erV{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&&ee0(n.selection),c=this.element.contains(document.activeElement);return!(!(t.hasFocus()||c)||u||s||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:t})=>{var n;if(this.preventHide){this.preventHide=!1;return}null!=t&&t.relatedTarget&&!(null===(n=this.element.parentNode)||void 0===n)&&n.contains(t.relatedTarget)||this.hide()},this.tippyBlurHandler=t=>{this.blurHandler({event:t})},this.handleDebouncedUpdate=(t,n)=>{let r=!(null!=n&&n.selection.eq(t.state.selection)),i=!(null!=n&&n.doc.eq(t.state.doc));(r||i)&&(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(t,r,i,n)},this.updateDelay))},this.updateHandler=(t,n,r,i)=>{var o,a,u;let{state:s,composing:c}=t,{selection:l}=s;if(c||!n&&!r)return;this.createTooltip();let{ranges:f}=l,d=Math.min(...f.map(t=>t.$from.pos)),p=Math.max(...f.map(t=>t.$to.pos));if(!(null===(o=this.shouldShow)||void 0===o?void 0:o.call(this,{editor:this.editor,view:t,state:s,oldState:i,from:d,to:p}))){this.hide();return}null===(a=this.tippy)||void 0===a||a.setProps({getReferenceClientRect:(null===(u=this.tippyOptions)||void 0===u?void 0:u.getReferenceClientRect)||(()=>{var n;if((n=s.selection)instanceof YY){let r=t.nodeDOM(d),i=r.dataset.nodeViewWrapper?r:r.querySelector("[data-node-view-wrapper]");if(i&&(r=i.firstChild),r)return r.getBoundingClientRect()}return function(t,n,r){let i=t.state.doc.content.size,o=ee1(n,0,i),a=ee1(r,0,i),u=t.coordsAtPos(o),s=t.coordsAtPos(a,-1),c=Math.min(u.top,s.top),l=Math.max(u.bottom,s.bottom),f=Math.min(u.left,s.left),d=Math.max(u.right,s.right),p={top:c,bottom:l,left:f,right:d,width:d-f,height:l-c,x:f,y:c};return{...p,toJSON:()=>p}}(t,d,p)})}),this.show()},this.editor=t,this.element=n,this.view=r,this.updateDelay=o,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){let{element:t}=this.editor.options,n=!!t.parentElement;this.tippy||!n||(this.tippy=erB(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 er$=t=>new Y8({key:"string"==typeof t.pluginKey?new Jt(t.pluginKey):t.pluginKey,view:n=>new erV({view:n,...t})});eej.create({name:"bubbleMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[er$({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});let erq=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=er$({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 erK extends et5{constructor(){super(...arguments),this.contentComponent=null}}let erH=({renderers:t})=>o.createElement(o.Fragment,null,Object.entries(t).map(([t,n])=>v.createPortal(n.reactElement,n.element,t)));class erZ 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,v.flushSync)(t):t()}setRenderer(t,n){this.maybeFlushSync(()=>{this.setState(({renderers:r})=>({renderers:{...r,[t]:n}}))})}removeRenderer(t){this.maybeFlushSync(()=>{this.setState(({renderers:n})=>{let r={...n};return delete r[t],{renderers:r}})})}componentWillUnmount(){let{editor:t}=this.props;if(!t||(this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null,!t.options.element.firstChild))return;let n=document.createElement("div");n.append(...t.options.element.childNodes),t.setOptions({element:n})}render(){let{editor:t,...n}=this.props;return o.createElement(o.Fragment,null,o.createElement("div",{ref:this.editorContentRef,...n}),o.createElement(erH,{renderers:this.state.renderers}))}}let erG=o.memo(erZ),erY=(0,o.createContext)({onDragStart:void 0}),erJ=()=>(0,o.useContext)(erY),erQ=o.forwardRef((t,n)=>{let{onDragStart:r}=erJ(),i=t.as||"div";return o.createElement(i,{...t,ref:n,"data-node-view-wrapper":"",onDragStart:r,style:{whiteSpace:"normal",...t.style}})});class erX{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 er0 extends ent{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(erY.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 erX(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 er1(t,n){return r=>r.editor.contentComponent?new er0(t,r,n):{}}function er2(t){return setTimeout(()=>{t()})}function er3(t){let{debouncedUrl:n,content:r,onContentChange:i,selected:a}=t,c=(0,o.useRef)(null),[l,f]=(0,o.useState)(!1);return(0,s.pQ)(n,()=>{var t;l&&(f(!1),null==(t=c.current)||t.reset())}),(0,p.ju)(n)?n===(null==r?void 0:r.embed_url)?C.jsx(er5,{content:r,selected:a}):C.jsx(u.SV,{ref:c,renderError:er4,onError:function(){f(!0),i(void 0)},children:C.jsx(o.Suspense,{fallback:r&&C.jsx(er5,{content:r,selected:a}),children:C.jsx(er9,{url:n,selected:a,onContentChange:i})})}):null}function er4(){return C.jsx(u.yO,{title:"There is no embed data available."})}function er5(t){let{content:n,selected:r}=t;return C.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 er9(t){let{url:n,onContentChange:r,selected:i}=t,a=function(t){let{url:n,onContentChange:r}=t,{embedsUrl:i}=tI(),a=(0,d.QT)(er6,[n,i]),u=(0,s.R9)(r);return(0,o.useEffect)(()=>{let t=er2(()=>u(a));return()=>{clearTimeout(t)}},[a,u]),a}({url:n,onContentChange:r});return C.jsx(er5,{content:a,selected:i})}function er6(t,n){var r;let i=new URL(n);return i.search=new URLSearchParams({url:t}).toString(),(0,f.WY)(i.toString(),{okType:(r=t,tO.object({type:tO.string(),version:tO.string().or(tO.number()).nullish(),title:tO.string().nullish(),author_name:tO.string().nullish(),author_url:tO.string().nullish(),provider_name:tO.string().nullish(),provider_url:tO.string().nullish(),cache_age:tO.string().or(tO.number()).nullish(),thumbnail_url:tO.string().nullish(),thumbnail_width:tO.number().nullish(),thumbnail_height:tO.number().nullish(),html:tO.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 er8(t){let{id:n,readOnly:r,field:i,content:a,onContentChange:c}=t,l=(0,s.$P)({initialState:(null==a?void 0:a.embed_url)??"",startTransition:o.startTransition});function f(t){l.set(t),(0,p.ju)(t)||c(void 0)}return C.jsxs(u.gN,{footer:(0,p.ju)(l.value)&&C.jsx(u.mS,{children:C.jsx(er3,{debouncedUrl:l.debouncedValue,content:a,onContentChange:c})}),children:[C.jsx(u.fw,{name:"cloud"}),C.jsx(u.Qy,{htmlFor:n,children:Gl(i)}),C.jsx(u.JO,{children:C.jsx(u.oi,{id:n,readOnly:r,placeholder:Gf(i),value:l.value,onValueChange:f,variant:(0,p.ju)(l.value)?"link":"normal",endAdornment:C.jsx(u.zx,{startIcon:"close",variant:"secondary",size:"small",disabled:!l,onClick:()=>f("")})})})]})}function er7(t){return!(t.lat>85||t.lat<-85||t.lng>180||t.lng<-180)}function eie(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(er7(o))return o}function eit(t){return t?`${t.lat}, ${t.lng}`:""}function ein(t){let n=t.match(/\(?([\d|.|-]*)[\s+]*,[\s]*([\d|.|-]*)\)?/);if(!n)return eie(t);let r=parseFloat(n[1]??""),i=parseFloat(n[2]??"");if(isNaN(r)||isNaN(i))return eie(t);let o={lat:r,lng:i};return er7(o)?o:eie(t)}function eir(t){let{field:n,id:r,readOnly:i,...a}=t,{onValueChange:s,displayedValue:c,onBlur:l,clearValue:f,isValidCoordinates:d}=function(t){let{content:n,onContentChange:r}=t,i=eit(null==n?void 0:n.position),[a,u]=(0,o.useState)(i),s=Boolean(ein(a));return{displayedValue:a,isValidCoordinates:s,onValueChange:u,onBlur:function(){let t=ein(a);if(!t)return u(""),r(void 0);let{lat:n,lng:i}=t;u(eit({lat:n,lng:i})),r({__TYPE__:"GeoPointContent",position:{lat:n,lng:i}})},clearValue:function(){u(""),r(void 0)}}}(a);return C.jsxs(u.gN,{children:[C.jsx(u.fw,{name:"place"}),C.jsx(u.Qy,{htmlFor:r,children:Gl(n)}),C.jsx(u.JO,{children:C.jsx(u.oi,{id:r,onValueChange:s,placeholder:"...",readOnly:i,value:c,onBlur:l,variant:d?"link":"normal",endAdornment:C.jsx(u.zx,{startIcon:"close",variant:"secondary",size:"small",disabled:!c,onClick:f})})})]})}function eii(t){let{open:n,onOpenChange:r}=t,[i,a]=(0,o.useState)("media");return C.jsxs(u.Vq,{open:n,onOpenChange:r,size:{width:1216,height:868},children:[C.jsx(u.fK,{icon:"image",title:"Add a media"}),C.jsxs(u.Zp,{value:i,onValueChange:function(t){if("media"!==t&&"unsplash"!==t)throw Error(`Invalid option ${t}.`);a(t)},padding:"small",width:"auto",children:[C.jsx(u.T9,{value:"media",icon:"photo"}),C.jsx(u.T9,{value:"unsplash",icon:"unsplash"})]}),C.jsx(u.cZ,{children:C.jsxs(u.xu,{overflow:"hidden",backgroundColor:"grey3",padding:{top:16,right:16,left:16},minHeight:"100%",children:["media"===i&&C.jsx(tU,{}),"unsplash"===i&&C.jsx(u.xu,{children:"Unsplash Library"})]})}),C.jsx(u.kX,{asFooter:!0,ok:{text:"Add to page",onClick(){},disabled:!1},cancel:{text:"Cancel"}})]})}function eio(){return new URL(location.href).searchParams.has("mediaLib")}let eia="__MAIN_THUMBNAIL__";function eiu(t,n,r){let i=t.name===eia?void 0:t.name,o;return[i,(o=n?(0,l.$)(r)?[r.width,r.height]:(0,l.$)(t.width)||(0,l.$)(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 eis(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 eic(t,n,r,i,o){let a=new URL(t);if(o){let{x:u,y:s,width:c,height:l}=n;a.searchParams.set("rect",[u,s,c,l].join(",")),a.searchParams.set("w",r.toString()),a.searchParams.set("h",i.toString())}return a.toString()}function eil(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 eif(t){let n=new URL(t);return n.searchParams.delete("q"),n.searchParams.delete("fm"),n.searchParams.set("w","300"),n.searchParams.set("auto","compress,format"),n.toString()}function eid(t){return null!=t&&t.url?eil(t.url):void 0}function eip(t){let{onFilesSelected:n}=t,[r,i]=(0,o.useTransition)(),a=(0,s.$P)({initialState:r,ms:100});return C.jsx(u.SV,{renderError:eib,children:C.jsx(o.Suspense,{children:C.jsxs(u.Zz,{onFilesSelected:n,overlay:C.jsx(eig,{}),children:[C.jsx(eih,{...t,startTransition:i}),C.jsx(u.xu,{position:"relative",width:"100%",justifyContent:"center",children:C.jsx(u.FN,{anchor:C.jsx(u.xu,{position:"fixed",bottom:72}),loadingIndicator:!0,open:a.debouncedValue,title:"Loading media ...",seconds:1})})]})})})}function eih(t){let{uploadingFiles:n,isUploading:r,onFilesSelected:i,onMediaSelected:a,startTransition:c,onRetry:l,assetType:f}=t,{media:d,limit:p,onHasReachedBottom:h,response:m,updateMedia:g}=tN({assetType:f});return(0,s.pQ)(n,()=>{if(r)return;let t=n.flatMap(t=>"success"!==t.status?[]:d.find(n=>n.id===t.id)?[]:[t.response]);t.length>0&&g(t)}),0===d.length?C.jsx(eim,{onFilesSelected:i}):C.jsxs(eiy,{onScrollToBottom:function(){m.total===p&&c(h)},children:[C.jsx(u.Fp,{enterDuration:400,exitDuration:400,children:n.length?C.jsx(u.xu,{flexDirection:"column",gap:6,children:n.map((t,n)=>C.jsx(u.tK,{file:t.file,status:t.status,onRetry:0!==n||r?void 0:l},t.id))},n.length):null}),C.jsx(u.Rk,{items:d,getItemInfo:eiv,children:t=>C.jsxs(o.Suspense,{fallback:C.jsx(u.Od,{width:"100%",height:"100%"}),children:["pdf"!==t.extension&&C.jsx(u.P0,{url:eif(t.url),onClick:()=>a({...t,width:t.width??2e3,height:t.height??2e3})}),"pdf"===t.extension&&C.jsx(u.Ti,{extension:t.extension,filename:t.filename,onClick:()=>a(t)})]})})]})}function eim(t){let{onFilesSelected:n}=t;return C.jsx(u.xu,{justifyContent:"center",flexDirection:"column",height:"100%",padding:24,children:C.jsx(u.xu,{justifyContent:"center",flexDirection:"column",height:"100%",backgroundColor:"grey2",borderRadius:4,padding:{inline:80},children:C.jsxs(u.R$,{children:[C.jsx(u.av,{name:"cloudUpload",lineColor:"purple10",backgroundColor:"purple3"}),C.jsx(u._T,{size:"big",children:"Drop files here or"}),C.jsx(u.nf,{children:C.jsxs(u.xv,{color:"grey11",align:"center",variant:"normal",children:["Explore our documentation to find out the"," ",C.jsx(u.hh,{underline:!0,color:"grey11",href:" https://prismic.io/docs/guides/manage-images#maximum-file-size",children:"maximum size"})," ","and"," ",C.jsx(u.hh,{underline:!0,color:"grey11",href:" https://prismic.io/docs/guides/manage-images#supported-media",children:"supported image formats"})," ","for uploads in the media library."]})}),C.jsx(u.Qj,{children:C.jsx(u.ZD,{title:"Upload Media",onFilesSelected:n})})]})})})}function eig(){return C.jsx(u.xu,{justifyContent:"center",flexDirection:"column",height:"100%",children:C.jsxs(u.R$,{children:[C.jsx(u.av,{name:"cloudUpload",lineColor:"purple10",backgroundColor:"purple3"}),C.jsx(u._T,{size:"big",children:"Drop files here"}),C.jsx(u.nf,{children:"Drop your files to upload them instantly to your media library"})]})})}function eiy(t){let{children:n,onScrollToBottom:r}=t;return C.jsx(u.xr,{style:{height:"100%",paddingInline:u.TV.space[24],paddingBlock:u.TV.space[16],gap:u.TV.space[16]},onScrollToBottom:r,children:n})}function eiv(t){return"pdf"===t.extension?{key:t.id,aspectRatio:193/154}:{key:t.id,aspectRatio:(t.width??2e3)/(t.height??2e3)}}function eib(){return C.jsx(u.xu,{height:"100%",flexDirection:"column",alignItems:"center",justifyContent:"center",children:C.jsx(u.Iq,{title:"Request failed",description:"An error occurred while searching for your image.",errorImageSrc:u.Os})})}let eix,ei_=new Uint8Array(16);function eiS(){if(!eix&&!(eix="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 eix(ei_)}let eiT=[];for(let eiw=0;eiw<256;++eiw)eiT.push((eiw+256).toString(16).slice(1));let eiO="u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),eik={randomUUID:eiO},eiI=tn({id:eQ(),width:eX(),height:eX(),urls:tn({full:eQ(),small:eQ().transform(eif)}),alt_description:eQ().optional()}),eiC=tn({results:tt(eiI)}).transform(t=>t.results);function eiM(t,n){let r=new URLSearchParams({page:"1",per_page:"30",query:n});return(0,f.WY)(`${t}/search/photos?${r.toString()}`,{okType:eiC})}d.Fs.registerFetcherConfig(eiM,{cacheCapacity:5,revalidationStrategy:{type:"never"}});let eiR=t=>{let{onMediaSelected:n}=t,[r,i]=(0,o.useTransition)(),a=(0,s.$P)({initialState:"",ms:200,startTransition:i});return C.jsxs(C.Fragment,{children:[C.jsx(u.xu,{padding:{inline:24,top:16},flexDirection:"column",children:C.jsx(u.Mj,{value:a.value,placeholder:"Search on Unsplash.com",onValueChange:a.set})}),C.jsx(eij,{children:C.jsx(u.SV,{renderError:eiA,children:C.jsx(o.Suspense,{fallback:C.jsx(u.DW,{}),children:C.jsx(eiE,{term:a.debouncedValue,isUpdating:r,onMediaSelected:n})})})})]})},eiE=t=>{var n,r,i;let{term:o,isUpdating:a,onMediaSelected:s}=t,c=tI(),l=(n=c.unsplashUrl,(0,d.QT)(eiM,[n,o||"fruit"])),f=(i=a,{opacity:i?.4:1,transitionProperty:i?"opacity":"none",transitionDuration:u.TV.transitionDuration[300],transitionTimingFunction:u.TV.transitionTimingFunction.easeInOut});return l.length?C.jsx(u.Rk,{items:l,getItemInfo:eiN,style:f,children:t=>C.jsx(u.P0,{url:t.urls.small,onClick:()=>s({id:t.id,url:t.urls.full,width:t.width,height:t.height,alt:t.alt_description})})}):C.jsxs(u.R$,{style:{marginTop:"auto",marginBottom:"auto",...f},children:[C.jsx(u.u2,{children:C.jsx("img",{src:u.Os,alt:"No results"})}),C.jsx(u._T,{size:"big",children:"Oh no ..."}),C.jsx(u.nf,{children:"The search returned no result."})]})},eij=({children:t})=>C.jsx(u.xr,{style:{height:"100%",paddingInline:u.TV.space[24],paddingTop:u.TV.space[4]},children:t});function eiN(t){return{key:t.id,aspectRatio:t.width/t.height}}function eiA(){return C.jsx(u.xu,{height:"100%",flexDirection:"column",alignItems:"center",justifyContent:"center",children:C.jsx(u.Iq,{title:"Request failed",description:"An error occurred while searching for your image.",errorImageSrc:u.Os})})}function eiP(t){let{onMediaSelected:n,assetType:r,open:i,onOpenChange:a}=t,s=tI(),[c,l]=(0,o.useState)(s.mediaLibrary?"media":"unsplash"),{uploadingFiles:d,isUploading:p,onFilesSelected:h,onRetry:m}=function(t){let[n,r]=(0,o.useState)([]),i=n.some(t=>"idle"===t.status||"uploading"===t.status),a=tI();return(0,o.useEffect)(function(){if(!n.length||n.some(t=>"uploading"===t.status)||n.every(t=>"error"===t.status)||!a.mediaLibrary)return;let t=n.find(t=>"idle"===t.status);if(!t){setTimeout(()=>{r(t=>t.filter(t=>"error"===t.status))},1e3);return}let{assetsUrl:i,repository:o,env:u}=a;r(n=>n.map(n=>n.id===t.id?{...n,status:"uploading"}:n)),(function(t){let{file:n,url:r,repository:i,env:o}=t,a=new FormData;return a.append(n.name,n),(0,f.WY)(r,{headers:{repository:i,"Content-Type":"multipart/form-data"},method:"POST",body:a,credentials:(0,f.xb)(o),okType:tR})})({file:t.file,url:i,repository:o,env:u}).then(n=>{r(r=>r.map(r=>r.id===t.id?{...r,status:"success",response:n}:r))}).catch(()=>{r(n=>n.map(n=>n.id===t.id?{...n,status:"error"}:n))})},[a,n]),!t&&n.length&&r([]),{uploadingFiles:n,isUploading:i,onFilesSelected:function(t){r(t.map(t=>({id:function(t,n,r){if(eik.randomUUID&&!n&&!t)return eik.randomUUID();t=t||{};let i=t.random||(t.rng||eiS)();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(eiT[t[n+0]]+eiT[t[n+1]]+eiT[t[n+2]]+eiT[t[n+3]]+"-"+eiT[t[n+4]]+eiT[t[n+5]]+"-"+eiT[t[n+6]]+eiT[t[n+7]]+"-"+eiT[t[n+8]]+eiT[t[n+9]]+"-"+eiT[t[n+10]]+eiT[t[n+11]]+eiT[t[n+12]]+eiT[t[n+13]]+eiT[t[n+14]]+eiT[t[n+15]]).toLowerCase()}(i)}(),file:t,status:"idle"})))},onRetry:function(){r(t=>t.map(t=>"error"===t.status?{...t,status:"idle"}:t))}}}(i),g=t=>{if("media"!==t&&"unsplash"!==t)throw Error(`Invalid option ${t}.`);l(t)};return C.jsxs(u.Vq,{open:i,onOpenChange:a,children:[C.jsx(u.fK,{icon:"folder",title:"Add an image"}),C.jsxs(u.Zp,{value:c,onValueChange:g,children:[s.mediaLibrary&&C.jsx(u.T9,{value:"media",title:"Media library",subtitle:"From Prismic",icon:"photo"}),C.jsx(u.T9,{value:"unsplash",title:"Unsplash",subtitle:"Source of free images",icon:"unsplash"}),s.mediaLibrary&&C.jsx(u.xu,{flexDirection:"column",justifyContent:"end",flexGrow:1,animation:{name:"fadeIn"},children:C.jsx(u.ZD,{startIcon:"cloudUpload",title:"Upload media",disabled:p,onFilesSelected:h})})]}),C.jsx(u.cZ,{children:C.jsx(eiL,{option:c,uploadingFiles:d,isUploading:p,onFilesSelected:h,onRetry:m,onMediaSelected(t){a(!1),null==n||n(t)},assetType:r})})]})}function eiL(t){let{option:n,onMediaSelected:r,assetType:i,...o}=t,a=tI();switch(n){case"media":return a.mediaLibrary?C.jsx(eip,{onMediaSelected:r,assetType:i,...o}):null;case"unsplash":return C.jsx(eiR,{onMediaSelected:r})}}function eiD(t){let{onMediaSelected:n,readOnly:r,isUpdating:i}=t,[a,s]=(0,o.useState)(!1),c=eio();return C.jsxs(u.aY,{children:[C.jsx(u.Zb,{color:"grey3",variant:"outlined",children:C.jsx(u.aY,{children:C.jsx(u.xu,{padding:{block:48},flexDirection:"column",children:C.jsxs(u.R$,{children:[C.jsx(u.av,{name:"cloudUpload"}),C.jsx(u._T,{children:i?"Preparing your image...":"You haven't selected an image"}),!r&&C.jsx(u.Qj,{children:C.jsx(u.zx,{disabled:i,onClick:()=>s(!0),children:"Select image"})})]})})})}),c?C.jsx(eii,{open:a,onOpenChange:s}):C.jsx(eiP,{open:a,onOpenChange:s,onMediaSelected:n,assetType:"image"})]})}function eiF(t){let{id:n,readOnly:r,altText:i,onValueChange:o,selected:a}=t;return C.jsxs(u.gN,{labelPosition:"side",selected:a,children:[C.jsx(u.Qy,{htmlFor:n,children:"Alt text"}),C.jsx(u.JO,{children:C.jsx(u.oi,{id:n,onValueChange:o,placeholder:"Short description for the visually impaired",readOnly:r,value:i})})]})}let eiW=({contentView:t,constraints:n,croppedImage:r})=>{let[i,o]=eis(t.origin,n),a=eic(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}}}},eiU=({field:t,content:n,thumbnail:r,croppedImage:i})=>{var o,a,u,s;if(r===eia){let c=eiW({contentView:n,constraints:null==(o=null==t?void 0:t.config)?void 0:o.constraint,croppedImage:i});return c.url===n.url?n:{...n,...c}}let l=null==(u=null==(a=null==t?void 0:t.config)?void 0:a.thumbnails)?void 0:u.find(t=>t.name===r),f=null==(s=n.thumbnails)?void 0:s[r];if(!l||!f)return n;let d=eiW({contentView:f,constraints:l,croppedImage:i});return d.url===f.url?n:{...n,thumbnails:{...n.thumbnails,[r]:d}}},eiz=({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)}},eiB=({contentView:t,constraints:n})=>{let r=eiz({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}},eiV={x:0,y:0,width:0,height:0,zoom:1},ei$=({selectedImage:{thumbnail:t,contentView:n}})=>t.width&&t.height?t.width/t.height:n?n.origin.width/n.origin.height:1,eiq=({trigger:t,initialImages:n,initialOption:r,onClose:i})=>{var a;let[s,c]=(0,o.useState)({}),[l,f]=(0,o.useState)({}),[d,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]??eiV;c({...s,[n]:{...r,zoom:t}})},x=t=>{if(!v)return;let n=v.thumbnail.name,r=s[n]??eiV;c({...s,[n]:{...r,...t}})},_=t=>{if(!v)return;let n=v.thumbnail.name,r=l[n];f({...l,[n]:{...r,crop:t}})},S=t=>{if(!v)return;let n=v.thumbnail.name,r=l[n]??{};f({...l,[n]:{...r,aspectRatio:t}})},T=s[(null==v?void 0:v.thumbnail.name)??""],w=d?T??((null==v?void 0:v.contentView)&&eiB({contentView:v.contentView,constraints:v.thumbnail})):void 0,O=l[(null==v?void 0:v.thumbnail.name)??""];return C.jsxs(u.Vq,{trigger:t,onAnimationEnd:()=>m(!0),open:d,onOpenChange(t){t?(y(r),c({}),f({})):(m(!1),i({option:g,croppedImages:s})),p(t)},children:[C.jsx(u.fK,{icon:"photo",title:"Image editor"}),C.jsx(u.Zp,{value:String(g),onValueChange:t=>y(Number(t)),children:n.map((t,n)=>C.jsx(u.T9,{value:String(n),icon:"photo",title:t.labels[0]??"Main",subtitle:t.labels[1]??""},t.thumbnail.name))}),v&&C.jsx(u.cZ,{children:h&&C.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:ei$({selectedImage:v,cropper:O}),onAspectRatioChange:S,initialCroppedArea:w,onCropAreaChange:x},v.thumbnail.name)})]})};function eiK(t){var n,r;let{content:i,selected:a,fieldLabel:s,readOnly:c,imageLabel:l,onMediaSelected:f,initialImages:d,initialOption:p=0,onCropperDialogClose:h,onClear:m,children:g}=t,[y,v]=(0,o.useState)(!1),b=eio(),x=(null==(r=null==(n=null==i?void 0:i.url)?void 0:n.split("?")[0])?void 0:r.slice(-4))===".svg",_=null!=i&&i.url&&!c?"visible":"hidden";return C.jsxs(u.Zb,{color:a?"indigo2":"grey2",variant:a?"selected":"dashed",children:[C.jsxs(u.Ol,{children:[C.jsxs(u.wP,{children:[s,0!==l.length&&C.jsx(u.xv,{color:"grey11",component:"span",noSelect:!0,children:` • ${l.join(" • ")}`})]}),C.jsxs(u.Pf,{sx:{visibility:_},children:[C.jsx(eiq,{trigger:C.jsx(u.zx,{startIcon:"crop",disabled:x,children:"Crop & Resize"}),initialImages:d,initialOption:p,onClose:h}),C.jsx(u.zx,{startIcon:"imageSearch",onClick:()=>v(!0),children:"Replace"}),C.jsx(u.zx,{onClick:m,startIcon:"delete",children:"Clear"})]})]}),g,b?C.jsx(eii,{open:y,onOpenChange:v}):C.jsx(eiP,{open:y,onOpenChange:v,onMediaSelected:f,assetType:"image"})]})}function eiH(t,n){let{width:r,height:i,rect:o}=function(t,n){let[r,i]=eis(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),a=Boolean((null==n?void 0:n.width)||(null==n?void 0:n.height));return{url:eic(t.url,o,r,i,a),alt:t.alt,origin:{id:t.id,url:t.url,width:t.width??2e3,height:t.height??2e3},width:r,height:i,edit:{background:"transparent",zoom:1,crop:{x:o.x,y:o.y}}}}function eiZ(t){let{content:n,field:r,id:i,onContentChange:u,readOnly:s}=t,c=n&&n.origin.url.length>0,{onCropperDialogClose:f,onPageChange:d,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,c]=(0,o.useState)(0),[l,f]=(0,o.useTransition)(),d=(n=u,(0,o.useMemo)(()=>{var t,r,i;return[{...null==(r=n.config)?void 0:r.constraint,name:eia}].concat((null==(i=n.config)?void 0:i.thumbnails)??[])},[n])),p=d[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(c(t),!r)return;let o=Object.entries(n).reduce((t,[n,r])=>eiU({field:u,content:t,thumbnail:n,croppedImage:r}),r);o!==r&&f(()=>i(o))},onPageChange:function(t){f(()=>c(t))},onMediaSelected:function(t){if(!p)return;let n=function(t,n,r,i){var o,u,s,c,l,f;if(!r){let d=null==(o=n.config)?void 0:o.thumbnails,p=d&&Object.fromEntries(d.map(t=>[t.name,eiH(i,t)]));return{__TYPE__:"ImageContent",...eiH(i,null==(u=n.config)?void 0:u.constraint),thumbnails:p}}if(t===eia){let h=eiH(i,null==(s=n.config)?void 0:s.constraint);return h.url===r.url?r:{...r,...h}}let m=null==(l=null==(c=n.config)?void 0:c.thumbnails)?void 0:l.find(n=>n.name===t);if(!m)return r;let g=null==(f=r.thumbnails)?void 0:f[t],y=eiH(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&&f(()=>i(n))},isUpdating:l,page:s,thumbnail:p,allThumbnails:d,allContentViews:h,contentView:m,onClear:function(){null==c||c(0),i(void 0)}}}({field:r,content:n,onContentChange:u}),_=Gl(r),S=y.map((t,r)=>{let i=null==v?void 0:v[r];return{thumbnail:t,contentView:i,labels:eiu(t,n,i)}}),T=g&&c?eiu(g,n,b).filter(l.$):[];return C.jsx(eiK,{content:n,fieldLabel:_,imageLabel:T,initialOption:m,initialImages:S,readOnly:s,onMediaSelected:p,onCropperDialogClose:f,onClear:x,children:C.jsx(o.Suspense,{fallback:C.jsx("div",{style:{height:466}}),children:g&&n&&c&&v?C.jsx(eiG,{allContentViews:v,content:n,contentView:b,id:i,onContentChange:u,onPageChange:d,page:m,readOnly:s,thumbnailName:g.name,isUpdating:h}):C.jsx(eiD,{onMediaSelected:p,readOnly:s,isUpdating:h})})})}function eiG(t){let{allContentViews:n,content:r,contentView:i,id:o,onContentChange:a,onPageChange:s,page:c,readOnly:l,thumbnailName:f,isUpdating:d}=t;return C.jsxs(u.aY,{children:[C.jsx(u.lr,{getItemSource:eid,items:n,onPageChange:s,page:c,style:{height:400},children:t=>(null==t?void 0:t.url)&&C.jsx(u.d$,{src:eil(t.url),alt:t.alt??void 0,isUpdating:d},`${f}_${t.url}`)}),C.jsx(eiF,{id:o,readOnly:l||!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===eia?{...n,alt:o}:{...n,thumbnails:{...n.thumbnails,[t]:{...r,alt:o}}}}(f,r,i,t))}})]})}function eiY(t){let{content:n,field:r,id:i,onContentChange:o,readOnly:a}=t;return C.jsxs(u.gN,{children:[C.jsx(u.fw,{name:"notes"}),C.jsx(u.Qy,{htmlFor:i,children:Gl(r)}),C.jsx(u.JO,{children:C.jsx(u.Kx,{id:i,placeholder:Gf(r),readOnly:a,value:(null==n?void 0:n.value)??"",onChange(t){var n;o((n=t,0===n.length?void 0:{__TYPE__:"FieldContent",type:"Text",value:n}))}})})]})}function eiJ(t,n,r,i){return(0,g.W7)(t,r,i,30,n)}function eiQ(){let t=tI();t.searchDocuments||tM("searchDocuments");let{coreApiUrl:n,env:r}=t,i=(0,d.QT)(g.Ag,[`${n}/repository`,r]);return new Set(i.languages.map(t=>({id:t.id,label:t.name})))}function eiX(){let t=tI();t.searchDocuments||tM("searchDocuments");let{coreApiUrl:n,env:r}=t,i=(0,d.QT)(ei2,[n,r]);return new Set(i.results.map(t=>({id:t,label:t})))}function ei0(){let t=tI();t.searchDocuments||tM("searchDocuments");let{customTypesApiUrl:n,env:r,repository:i}=t,o=(0,d.QT)(ei4,[n,r,i??""]);return new Set(o)}d.Fs.registerFetcherConfig(eiJ,{cacheCapacity:500,revalidationStrategy:{type:"never"}});let ei1=tn({results:tt(eQ())});function ei2(t,n){return(0,f.WY)(`${t}/repository/tags`,{credentials:(0,f.xb)(n),okType:ei1})}let ei3=tt(tn({id:eQ(),label:eQ()}));function ei4(t,n,r){return(0,f.WY)(`${t}/customtypes`,{headers:{repository:r},credentials:(0,f.xb)(n),okType:ei3})}function ei5(t){return t?(0,y.UI)(t,t=>({id:t,label:t})):new Set}function ei9(t){let{filteredLocales:n,setFilteredLocales:r,filteredTags:i,setFilteredTags:a,filteredCustomTypes:s,setFilteredCustomTypes:c,fixedTags:l,fixedCustomTypes:f}=t;return C.jsxs(C.Fragment,{children:[C.jsx(u.SV,{children:C.jsx(o.Suspense,{fallback:C.jsx(ei6,{selectedValues:n,onSelectedValuesChange:r,label:"Locale",icon:"public",fetchFilters:eiQ,multiple:!1}),children:C.jsx(ei7,{selectedValues:n,onSelectedValuesChange:r})})}),C.jsx(ei6,{selectedValues:i,fixedSelectedValues:ei5(l),onSelectedValuesChange:a,label:"Tags",icon:"label",fetchFilters:eiX}),C.jsx(ei6,{selectedValues:s,fixedSelectedValues:ei5(f),onSelectedValuesChange:c,label:"Type",icon:"description",fetchFilters:ei0})]})}function ei6(t){let[n,r]=(0,o.useState)(!1),i=(0,o.useContext)(d.Nk);return C.jsx(u.SV,{renderError:()=>C.jsx(u.R0,{mode:"error",onErrorRetry:null==i?void 0:i.reset,open:n,setOpen:r,values:new Set,...t}),children:C.jsx(o.Suspense,{fallback:C.jsx(u.R0,{mode:"loading",open:n,setOpen:r,values:new Set,...t}),children:C.jsx(ei8,{open:n,setOpen:r,...t})})})}function ei8(t){let{open:n,setOpen:r,onSelectedValuesChange:i,fixedSelectedValues:o,selectedValues:a,label:s,icon:c,fetchFilters:l,multiple:f}=t,d=l();return C.jsx(u.R0,{open:n,setOpen:r,label:s,icon:c,selectedValues:a,values:new Set(d),fixedSelectedValues:o,onSelectedValuesChange:i,multiple:f})}function ei7(t){let{selectedValues:n,onSelectedValuesChange:r}=t,[i,a]=(0,o.useState)((0,y.Ps)(n)),u=(0,y.sE)(eiQ(),t=>{var r;return t.id===(null==(r=(0,y.Ps)(n))?void 0:r.id)});return(null==u?void 0:u.label)!==(null==i?void 0:i.label)&&a(u),C.jsx(ei6,{selectedValues:new Set(i?[i]:[]),onSelectedValuesChange:function(t){r(t),a((0,y.Ps)(t))},label:"Locale",icon:"public",fetchFilters:eiQ,multiple:!1})}function eoe(t){let{onSelectDocument:n,fixedCustomTypes:r,fixedTags:i,...a}=t,c=tI(),{searchTerm:l,filteredTags:f,setFilteredTags:d,filteredCustomTypes:p,setFilteredCustomTypes:h,filteredLocales:m,setFilteredLocales:g,typesFilter:v,tagsFilter:b}=function(t,n){let r=tI(),i=(0,s.$P)({initialState:""}),[a,u]=(0,o.useState)(new Set),[c,l]=(0,o.useState)(new Set),[f,d]=(0,o.useState)(function(){return r.searchDocuments&&r.localeId?new Set([{id:r.localeId,label:r.localeId}]):new Set}),p=(0,y.G0)(c,ei5(t)),h=(0,y.G0)(a,ei5(n));return{searchTerm:i,filteredTags:a,setFilteredTags:u,filteredCustomTypes:c,setFilteredCustomTypes:l,filteredLocales:f,setFilteredLocales:d,typesFilter:p,tagsFilter:h}}(r,i),[x,_]=(0,o.useTransition)(),S=(0,s.$P)({initialState:x,ms:100}),{searchDocuments:T}=tI();return C.jsx(u.Vq,{size:{height:727,width:656},hasClose:!1,...a,children:C.jsx(u.cZ,{children:C.jsxs(u.xu,{flexDirection:"column",height:"100%",children:[C.jsxs(u.xu,{padding:{top:16,inline:16},flexDirection:"column",gap:12,children:[C.jsx(u.yt,{value:l.value,onValueChange:l.set,placeholder:"Search a page",icon:"search"}),T&&C.jsx(ei9,{filteredTags:f,setFilteredTags:d,filteredCustomTypes:p,setFilteredCustomTypes:h,filteredLocales:m,setFilteredLocales:g,fixedTags:i,fixedCustomTypes:r}),C.jsx(u.xv,{variant:"smallBold",color:"grey11",children:"Link to a document"})]}),c.searchDocuments?C.jsx(u.SV,{renderError:eon,children:C.jsx(o.Suspense,{children:C.jsx(eor,{searchTerm:l.debouncedValue,tagsFilter:b,typesFilter:v,localesFilter:m,startTransition:_,onSelectDocument:n})})}):C.jsx(eoi,{message:"Slice Machine does not yet support mock data for linked documents in the simulator."}),C.jsx(eot,{debouncedIsLoading:S.debouncedValue})]})})})}function eot(t){return C.jsx(u.FN,{anchor:C.jsx(u.xu,{position:"relative",width:"100%",justifyContent:"center",bottom:72}),loadingIndicator:!0,open:t.debouncedIsLoading,title:"Loading more results ...",seconds:1})}function eon(){return C.jsx(u.xu,{height:"100%",flexDirection:"column",alignItems:"center",justifyContent:"center",children:C.jsx(u.Iq,{title:"Request failed",description:"An error occurred while fetching documents.",errorImageSrc:u.Os})})}function eor(t){let{searchTerm:n,tagsFilter:r,typesFilter:i,localesFilter:a,startTransition:s,onSelectDocument:c}=t,{documents:l,onHasReachedBottom:f}=function(t){var n,r;let{searchTerm:i,tagsFilter:a,typesFilter:u,localesFilter:s}=t,c=tI();c.searchDocuments||tM("searchDocuments");let{coreApiUrl:l,env:f,status:p}=c,[m,v]=(0,o.useState)(""),[b,x]=(0,o.useState)([]),[_,S]=(0,o.useState)(""),T=new URLSearchParams((0,g.fW)([{name:"tags",values:[...(0,y.UI)(a,t=>t.id)]},{name:"customTypes",values:[...(0,y.UI)(u,t=>t.id)]},{name:"language",values:[...(0,y.UI)(s,t=>t.id)]},{name:"status",values:g.Vu[p]},{name:"term",values:[i]}])).toString(),w=(0,d.QT)(eiJ,[l,T===_?m:"",f,T]);return T!==_?(S(T),v(""),x(w.results)):w.results.length>0&&(null==(n=(0,h.Z$)(b))?void 0:n.id)!==(null==(r=(0,h.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}),p=tI();return C.jsx(u.xr,{onScrollToBottom:()=>s(f),style:{height:"100%",gap:u.TV.space[16],paddingTop:u.TV.space[10],paddingBottom:u.TV.space[16],paddingInline:u.TV.space[16]},children:C.jsxs(u.xu,{flexDirection:"column",gap:12,children:[0===l.length&&C.jsx(eoi,{}),l.map(t=>{var n,i,o,a,s,l,f,d,g,y;let v=(0,m.u)({documentId:t.id,versionId:(null==(n=t.versions[0])?void 0:n.status)==="archived"?null==(i=t.versions[0])?void 0:i.version_id:void 0,releaseId:(null==(o=t.versions[0])?void 0:o.status)==="release"?t.versions[0].release_id:void 0,status:null==(a=t.versions[0])?void 0:a.status,env:p.env}),b=function(t){let{tags:n,tagsFilter:r}=t,i=[...r].map(t=>t.label).reverse();return(0,h.DY)(n,t=>-i.indexOf(t))}({tags:(null==(s=t.versions[0])?void 0:s.tags)??[],tagsFilter:r});return C.jsx(u.z4,{documentType:(null==(l=t.versions[0])?void 0:l.custom_type_label)??"",documentURL:v,description:null==(f=t.versions[0])?void 0:f.preview_summary,tags:b,title:t.title,previewImageUrl:null==(d=t.versions[0])?void 0:d.preview_image,onSelect:()=>c(t.id),status:null==(g=t.versions[0])?void 0:g.status},`${t.id}-${(null==(y=t.versions[0])?void 0:y.status)??""}`)})]})})}function eoi(t){let{message:n="There are no versions matching this request"}=t;return C.jsxs(u.xu,{justifyContent:"center",flexDirection:"column",alignItems:"center",gap:16,children:[C.jsx(u.xu,{height:56,width:56,backgroundColor:"purple3",alignItems:"center",justifyContent:"center",borderRadius:"100%",children:C.jsx(u.I5,{name:"close",size:"large",color:"purple10"})}),C.jsx(u.xu,{maxWidth:204,children:C.jsx(u.xv,{color:"grey11",align:"center",children:n})})]})}function eoo(t){let{hasLink:n,onUnlink:r,selectEnabled:i,selectedType:o,onValueChange:a,openInNewTab:s=!0,setOpenInNewTab:c}=t;return C.jsxs(C.Fragment,{children:[c&&"web"===o&&C.jsx(u.zx,{startIcon:s?"checkBox":"checkBoxOutlinedBlank",variant:"secondary",size:"small",onClick:()=>c(!s),children:"Open in new tab"}),C.jsxs(u.Ph,{value:o,variant:"secondary",size:"small",startIcon:function(t){if(t)switch(t){case"document":return"description";case"web":return"public";case"media":return"image"}}(o),disabled:!i,onValueChange:a,placeholder:"Choose link type",children:[C.jsx(u.Ql,{value:"web",icon:"public",children:"Link to web page"}),C.jsx(u.Ql,{value:"document",icon:"description",children:"Link to Prismic page"}),C.jsx(u.Ql,{value:"media",icon:"image",children:"Link to media"})]}),C.jsx(u.zx,{startIcon:"close",variant:"secondary",size:"small",disabled:!n,onClick:r})]})}let eoa={DocumentLink:"document",ExternalLink:"web",FileLink:"media",ImageLink:"media"},eou={document:"DocumentLink",web:"ExternalLink",media:"FileLink"},eos=tn({id:eQ(),title:eQ()});function eoc(t,n,r){return(0,f.WY)(`${t}/documents/${r}`,{credentials:(0,f.xb)(n),okType:eos})}function eol(t){var n,r,i,o,a,u;let{media:s}=t,c="kind"in s;return c&&"pdf"===s.extension?{__TYPE__:"LinkContent",value:{__TYPE__:"FileLink",id:s.id,name:s.filename,kind:s.kind,url:s.url,size:s.size.toString(),date:(null==(n=s.last_modified)?void 0:n.toString())??""}}:c?{__TYPE__:"LinkContent",value:{__TYPE__:"ImageLink",id:s.id,name:s.filename,url:s.url,kind:s.kind,size:s.size.toString(),height:(null==(r=s.height)?void 0:r.toString())??"2000",width:(null==(i=s.width)?void 0:i.toString())??"2000",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 eof(t){var n,r;let{content:i,field:a,id:c,onContentChange:l,readOnly:f}=t,d=eio(),[h,m]=(0,o.useState)(!1),[g,y]=(0,o.useState)(!1),[v,b]=(0,o.useState)(!1),[x,_]=(0,o.useState)(!1),{contentType:S,fieldValue:T,errorBoundaryRef:w,onDocumentSelected:O,onError:k,onMediaSelected:I,...M}=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:"",[c,l]=(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__:eou[null==(n=r.config)?void 0:n.select]}),[f,d]=(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=c?eoa[c]:void 0;function y(t){if(!t)return a(void 0);switch(c){case"ExternalLink":return a({__TYPE__:"LinkContent",value:{__TYPE__:"ExternalLink",url:t,target:f}});case"DocumentLink":return a({__TYPE__:"LinkContent",value:{__TYPE__:"DocumentLink",id:t}});default:return a(void 0)}}function v(t){y(t)}return{contentType:c,selectType:g,fieldValue:u,onValueChange:y,onTypeChange:function(t){l(eou[t]),y("")},placeholder:Gf(r),isTypeSelectEnabled:!(null!=(n=r.config)&&n.select),onDocumentSelected:v,onError:function(){h(!0)},errorBoundaryRef:m,isTargetNewTab:"_blank"===f,updateWebLinkTarget:function(t){let n=t?"_blank":null;d(n),a({__TYPE__:"LinkContent",value:{__TYPE__:"ExternalLink",url:u,target:n}})},onMediaSelected:function(t){a(eol({media:t}))}}}({content:i,field:a,onContentChange:l}),R="ExternalLink"===S&&(0,p.ju)(T),E={id:c,contentType:S,onBlur:()=>m(!1),onFocus(){m(!0),"DocumentLink"===S&&b(!0),"FileLink"===S&&_(!0),"ImageLink"===S&&_(!0)},readOnly:f||!S,textType:R||"ImageLink"===S||"FileLink"===S?"link":"normal",value:T,...M},{searchDocuments:j}=tI();return C.jsxs(C.Fragment,{children:[C.jsxs(u.J2,{onMouseOverChange:y,open:h||g,align:"start",sideOffset:-3,openDelay:100,closeDelay:200,focusOnEnter:!1,anchor:C.jsxs(u.gN,{onMouseOverChange:m,children:[C.jsx(u.fw,{name:"link"}),C.jsx(u.Qy,{htmlFor:c,children:Gl(a)}),C.jsx(u.JO,{children:"DocumentLink"===S&&""!==T&&j?C.jsx(eoh,{errorBoundaryRef:w,onError:k,fallback:C.jsx(eod,{...E,value:"..."}),renderError(){var t;return t=E,C.jsx(eod,{...t,textType:"link"})},children:C.jsx(eop,{...E,documentId:T,openDocumentListModal:()=>b(!0)})}):C.jsx(eod,{...E})})]}),children:[R&&C.jsx(u.oZ,{url:R,title:(0,p.S$)(R)??"",subTitle:R.toString()}),(null==i?void 0:i.value.__TYPE__)==="ImageLink"&&C.jsx(u.Qi,{url:i.value.url,title:i.value.name,subTitle:`${i.value.width} x ${i.value.height} pixels`})]}),d?C.jsx(eii,{open:x,onOpenChange:_}):C.jsx(eiP,{open:x,onOpenChange:_,onMediaSelected:I}),C.jsx(eoe,{open:v,onOpenChange:b,onSelectDocument(t){b(!1),O(t)},fixedCustomTypes:new Set(null==(n=a.config)?void 0:n.customtypes),fixedTags:new Set(null==(r=a.config)?void 0:r.tags)})]})}function eod(t){let{id:n,onValueChange:r,placeholder:i,readOnly:o,value:a,textType:s,onFocus:c,onBlur:l,contentType:f,isTypeSelectEnabled:d,selectType:p,onTypeChange:h,isTargetNewTab:m,updateWebLinkTarget:g}=t,y="DocumentLink"===f||"ImageLink"===f||"FileLink"===f;return C.jsx(u.oi,{id:n,onValueChange:r,placeholder:i,readOnly:o||y,value:a,variant:s,onFocus:c,onBlur:l,cursor:y?"pointer":"text",endAdornment:C.jsx(eoo,{hasLink:Boolean(a),onUnlink:()=>r(""),selectEnabled:d,selectedType:p,onValueChange:h,openInNewTab:m,setOpenInNewTab:g})})}function eop(t){let{id:n,documentId:r,openDocumentListModal:i,onValueChange:o,isTypeSelectEnabled:a,selectType:s,onTypeChange:c}=t,l=function(t){let n=tI();n.searchDocuments||tM("searchDocuments");let{coreApiUrl:r,env:i}=n;return(0,d.QT)(eoc,[r,i,t]).title}(r);return C.jsx(u.oi,{id:n,readOnly:!0,value:l,variant:"link",onFocus:i,cursor:"pointer",endAdornment:C.jsx(eoo,{hasLink:!0,onUnlink:()=>o(""),selectEnabled:a,selectedType:s,onValueChange:c})})}function eoh(t){let{errorBoundaryRef:n,onError:r,children:i,fallback:a,renderError:s}=t;return C.jsx(u.SV,{ref:n,onError:r,renderError:s,children:C.jsx(o.Suspense,{fallback:a,children:i})})}let eom=({content:t,field:n,id:r,onContentChange:i,readOnly:o})=>{var a,s;let c=Number(null==t?void 0:t.value),l=Number.isFinite(c)?c:void 0;return C.jsxs(u.gN,{children:[C.jsx(u.fw,{name:"pin"}),C.jsx(u.Qy,{htmlFor:r,children:Gl(n)}),C.jsx(u.JO,{children:C.jsx(u.Y2,{id:r,value:l,min:null==(a=n.config)?void 0:a.min,max:null==(s=n.config)?void 0:s.max,placeholder:Gf(n),readOnly:o,onValueChange(t){var n;return i((n=t,void 0===n?void 0:{__TYPE__:"FieldContent",type:"Number",value:String(n)}))}})})]})};var eog=function(){};eog.prototype.append=function(t){return t.length?(t=eog.from(t),!this.length&&t||t.length<200&&this.leafAppend(t)||this.length<200&&t.leafPrepend(this)||this.appendInner(t)):this},eog.prototype.prepend=function(t){return t.length?eog.from(t).append(this):this},eog.prototype.appendInner=function(t){return new eov(this,t)},eog.prototype.slice=function(t,n){return void 0===t&&(t=0),void 0===n&&(n=this.length),t>=n?eog.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))},eog.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},eog.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)},eog.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},eog.from=function(t){return t instanceof eog?t:t&&t.length?new eoy(t):eog.empty};var eoy=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}(eog);eog.empty=new eoy([]);var eov=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}(eog);class eob{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(0==this.eventCount)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(o=(i=this.remapping(r,this.items.length)).maps.length);let a=t.tr,u,s,c=[],l=[];return this.items.forEach((t,n)=>{if(!t.step){i||(o=(i=this.remapping(r,n+1)).maps.length),o--,l.push(t);return}if(i){l.push(new eox(t.map));let f=t.step.map(i.slice(o)),d;f&&a.maybeStep(f).doc&&(d=a.mapping.maps[a.mapping.maps.length-1],c.push(new eox(d,void 0,void 0,c.length+l.length))),o--,d&&i.appendMap(d,o)}else a.maybeStep(t.step);if(t.selection)return u=i?t.selection.map(i.slice(o)):t.selection,s=new eob(this.items.slice(0,r).append(l.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:s,transform:a,selection:u}}addTransform(t,n,r,i){var o,a;let u=[],s=this.eventCount,c=this.items,l=!i&&c.length?c.get(c.length-1):null;for(let f=0;f<t.steps.length;f++){let d=t.steps[f].invert(t.docs[f]),p=new eox(t.mapping.maps[f],d,n),h;(h=l&&l.merge(p))&&(p=h,f?u.pop():c=c.slice(0,c.length-1)),u.push(p),n&&(s++,n=void 0),i||(l=p)}let m=s-r.depth,g;return m>eoS&&(o=c,a=m,c=(o.forEach((t,n)=>{if(t.selection&&0==a--)return g=n,!1}),o.slice(g)),s-=m),new eob(c.append(u),s)}remapping(t,n){let r=new Yc;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 eob(this.items.append(t.map(t=>new eox(t))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=t.mapping,a=t.steps.length,u=this.eventCount;this.items.forEach(t=>{t.selection&&u--},i);let s=n;this.items.forEach(n=>{let i=o.getMirror(--s);if(null==i)return;a=Math.min(a,i);let c=o.maps[i];if(n.step){let l=t.steps[i].invert(t.docs[i]),f=n.selection&&n.selection.map(o.slice(s+1,i));f&&u++,r.push(new eox(c,l,f))}else r.push(new eox(c))},i);let c=[];for(let l=n;l<a;l++)c.push(new eox(o.maps[l]));let f=this.items.slice(0,i).append(c).append(r),d=new eob(f,u);return d.emptyItemCount()>500&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],o=0;return this.items.forEach((a,u)=>{if(u>=t)i.push(a),a.selection&&o++;else if(a.step){let s=a.step.map(n.slice(r)),c=s&&s.getMap();if(r--,c&&n.appendMap(c,r),s){let l=a.selection&&a.selection.map(n.slice(r));l&&o++;let f=new eox(c.invert(),s,l),d,p=i.length-1;(d=i.length&&i[p].merge(f))?i[p]=d:i.push(f)}}else a.map&&r--},this.items.length,0),new eob(eog.from(i.reverse()),o)}}eob.empty=new eob(eog.empty,0);class eox{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 eox(n.getMap().invert(),n,this.selection)}}}class eo_{constructor(t,n,r,i,o){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}let eoS=20;function eoT(t){let n=[];return t.forEach((t,r,i,o)=>n.push(i,o)),n}function eow(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 eoO(t,n,r,i){let o=eoC(n),a=eoM.get(n).spec.config,u=(i?t.undone:t.done).popEvent(n,o);if(!u)return;let s=u.selection.resolve(u.transform.doc),c=(i?t.done:t.undone).addTransform(u.transform,n.selection.getBookmark(),a,o),l=new eo_(i?c:u.remaining,i?u.remaining:c,null,0,-1);r(u.transform.setSelection(s).setMeta(eoM,{redo:i,historyState:l}).scrollIntoView())}let eok=!1,eoI=null;function eoC(t){let n=t.plugins;if(eoI!=n){eok=!1,eoI=n;for(let r=0;r<n.length;r++)if(n[r].spec.historyPreserveItems){eok=!0;break}}return eok}let eoM=new Jt("history"),eoR=new Jt("closeHistory"),eoE=(t,n)=>{let r=eoM.getState(t);return!!r&&0!=r.done.eventCount&&(n&&eoO(r,t,n,!1),!0)},eoj=(t,n)=>{let r=eoM.getState(t);return!!r&&0!=r.undone.eventCount&&(n&&eoO(r,t,n,!0),!0)},eoN=eej.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:t,dispatch:n})=>eoE(t,n),redo:()=>({state:t,dispatch:n})=>eoj(t,n)}),addProseMirrorPlugins(){return[function(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Y8({key:eoM,state:{init:()=>new eo_(eob.empty,eob.empty,null,0,-1),apply:(n,r,i)=>(function(t,n,r,i){let o=r.getMeta(eoM),a;if(o)return o.historyState;r.getMeta(eoR)&&(t=new eo_(t.done,t.undone,null,0,-1));let u=r.getMeta("appendedTransaction");if(0==r.steps.length)return t;if(u&&u.getMeta(eoM))return u.getMeta(eoM).redo?new eo_(t.done.addTransform(r,void 0,i,eoC(n)),t.undone,eoT(r.mapping.maps[r.steps.length-1]),t.prevTime,t.prevComposition):new eo_(t.done,t.undone.addTransform(r,void 0,i,eoC(n)),null,t.prevTime,t.prevComposition);if(!1===r.getMeta("addToHistory")||u&&!1===u.getMeta("addToHistory"))return(a=r.getMeta("rebased"))?new eo_(t.done.rebased(r,a),t.undone.rebased(r,a),eow(t.prevRanges,r.mapping),t.prevTime,t.prevComposition):new eo_(t.done.addMaps(r.mapping.maps),t.undone.addMaps(r.mapping.maps),eow(t.prevRanges,r.mapping),t.prevTime,t.prevComposition);{let s=r.getMeta("composition"),c=0==t.prevTime||!u&&t.prevComposition!=s&&(t.prevTime<(r.time||0)-i.newGroupDelay||!function(t,n){if(!n)return!1;if(!t.docChanged)return!0;let r=!1;return t.mapping.maps[0].forEach((t,i)=>{for(let o=0;o<n.length;o+=2)t<=n[o+1]&&i>=n[o]&&(r=!0)}),r}(r,t.prevRanges)),l=u?eow(t.prevRanges,r.mapping):eoT(r.mapping.maps[r.steps.length-1]);return new eo_(t.done.addTransform(r,c?n.selection.getBookmark():void 0,i,eoC(n)),eob.empty,l,r.time,s??t.prevComposition)}})(r,i,n,t)},config:t,props:{handleDOMEvents:{beforeinput(t,n){let r=n.inputType,i="historyUndo"==r?eoE:"historyRedo"==r?eoj: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()}}}),eoA=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,eoP=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,eoL=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,eoD=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,eoF=et7.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",eep(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[et9({find:eoA,type:this.type}),et9({find:eoL,type:this.type})]},addPasteRules(){return[enn({find:eoP,type:this.type}),enn({find:eoD,type:this.type})]}});var eoW,eoU,eoz=((eoW=eoz||{}).Document="document",eoW.Mark="mark",eoW.Node="node",eoW),eoB=((eoU=eoB||{}).Text="text",eoU.Embed="embed",eoU.Image="image",eoU);class eoV{constructor(t,n,r,i,o,a=!1){S(this,"extType","node"),S(this,"nodeType","text"),this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i,this.placeholder=o,this.lockedFormat=a}}function eo$(t){return t instanceof eoV}class eoq extends eoV{constructor(t,n,r,i,o){super(t,"heading",n,i,o),this.levels=r}}class eoK extends eoV{constructor(t,n,r,i){super(t,n,r,i)}}function eoH(t){return t instanceof eoK}let eoZ=ene.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:t}){return["br",eep(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()}}}),eoG={isHardBreak:t=>t.type.name===eoZ.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 eoY(){return{extensions:es$(),defaultTextConverter:void 0}}let eoJ=eoF.extend({name:"bold"}),eoQ=new class{constructor(t,n,r){S(this,"extType",eoz.Mark),S(this,"richTextNodeTypes",qu.RichTextNodeType.strong),this.name=t,this.component=n,this.converter=r}}(eoJ.name,eoJ,{fromPrismic:t=>function(){var n;return null==(n=t.marks[eoJ.name])?void 0:n.create()},toPrismic(){}}),eoX=ene.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",eep(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)}}}),eo0=et7.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",eep(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:n})=>{let r=etO(t,this.type);return!!Object.entries(r).some(([,t])=>!!t)||n.unsetMark(this.name)}}}}),eo1=/^\s*([-+*])\s$/,eo2=ene.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:t}){return["ul",eep(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(eoX.name,this.editor.getAttributes(eo0.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=et8({find:eo1,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=et8({find:eo1,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(eo0.name),editor:this.editor})),[t]}}),eo3=ene.create({name:"doc",topNode:!0,content:"block+"}),eo4=ene.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",eep(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)}}}),eo5=eo4.extend({name:"listItem",content:"paragraph*",addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name)}}}),eo9={component:eo5,converter:{fromPrismic:t=>function(n){var r;let i=eu5.converter.fromPrismic(t)(n);if(i)return null==(r=t.nodes[eo5.name])?void 0:r.create({},i)},toPrismic:(t,n)=>eoG.children.reduce(t,(t,r)=>{let i=eu5.converter.toPrismic(r),o=i instanceof Array?i.map(t=>({...t,type:n})):i?[{...i,type:n}]:[];return[...t,...o]},[])},placeholder:"List"},eo6="document",eo8=t=>eo3.extend({name:eo6,content:t?"block+":"block"}),eo7=t=>({fromPrismic(n,r){function i(t,n){return!n&&r&&nl.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 eoB.Embed:return nl.EmbedBlock.is(r)?n.converter.fromPrismic(i)(r):void 0;case eoB.Text:return nl.TextBlock.is(r)?n.converter.fromPrismic(i)(r):void 0;case eoB.Image:return nl.ImageBlock.is(r)?n.converter.fromPrismic(i)(r):void 0;default:return}}({ext:a,block:o,schema:n}),s=r.slice(0,r.length-1),c=(0,h.Z$)(r),l=function(t){var n,r;let{node:i,block:o,nodeWithDefault:a,previousNode:u}=t;return i&&u?i.type.name===u.type.name&&(i.type.name===esi.name||i.type.name===esB.name)?{merged:!0,updatedNode:u.copy(u.content.append(i.content))}:{merged:!1,updatedNode:a(o,i)}:{merged:!1,updatedNode:i}}({node:u,block:o,nodeWithDefault:i,previousNode:c});return l.updatedNode?[...l.merged?s:r,l.updatedNode]:r},[]);return null==(o=n.nodes[eo6])?void 0:o.create({},a)}},toPrismic:n=>({__TYPE__:"StructuredTextContent",value:[...eoG.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},[])]})}),eae=new class{constructor(t,n,r){S(this,"extType","document"),this.name=t,this.component=n,this.converter=r}}(eo6,eo8,eo7),eat=eoZ.extend({name:"hard_break"}),ean=`
94
- `,ear={fromPrismic:t=>function(n){var r;if(n===ean)return null==(r=t.nodes[eat.name])?void 0:r.create({})},toPrismic(t){if(t.type.name===eat.name)return ean}},eai={isEmptyLine:t=>0===t.length,isFirst:t=>0===t},eao={name:eat.name,component:eat,converter:ear,splitTextToNodes:function(t,n){return function(r){let i=ear.fromPrismic(t)(ean);if(!i)return[r(n)];let o=n.split(ean);return 1===o.length?n.length?[r(n)]:[i]:o.reduce((t,n,o)=>eai.isFirst(o)?eai.isEmptyLine(n)?t:[...t,r(n)]:eai.isEmptyLine(n)?[...t,i]:[...t,i,r(n)],[])}}},eaa=eej.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new Y8({key:new Jt("placeholder"),props:{decorations:({doc:t,selection:n})=>{let r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=n,o=[];if(!r)return null;let a=t.type.createAndFill(),u=(null==a?void 0:a.sameMarkup(t))&&null===a.content.findDiffStart(t.content);return t.descendants((t,n)=>{let r=i>=n&&i<=n+t.nodeSize,a=!t.isLeaf&&!t.childCount;if((r||!this.options.showOnlyCurrent)&&a){let s=[this.options.emptyNodeClass];u&&s.push(this.options.emptyEditorClass);let c=Xc.node(n,n+t.nodeSize,{class:s.join(" "),"data-placeholder":"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:t,pos:n,hasAnchor:r}):this.options.placeholder});o.push(c)}return this.options.includeChildren}),Xd.create(t,o)}}})]}}),eau=t=>eaa.configure({includeChildren:!0,placeholder:n=>(function({props:t,params:n}){var r;let{editor:i,hasAnchor:o,node:a}=t,{placeholderByNodeType:u,unfocusedPlaceholder:s,nodeExtensions:c}=n,l=!eoG.children.exists(i.state.doc,t=>t===a),f=i.isEditable,d=i.isFocused&&o,p=a.type.name!==eu5.name,h=d||p||l,m=c.length>1,g=function(){if(l)return eo9.placeholder;let t=u[a.type.name];return"string"==typeof t?t:null==t?void 0:t(a.attrs)}();return s&&!d&&i.isEmpty?s:("Type '/' for commands"===g?f&&h&&m:f&&h)&&g||""})({props:n,params:t}),showOnlyCurrent:!1,showOnlyWhenEditable:!1});function eas(t){return t.split("-")[1]}function eac(t){return"y"===t?"height":"width"}function eal(t){return t.split("-")[0]}function eaf(t){return["top","bottom"].includes(eal(t))?"x":"y"}function ead(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=eaf(n),c=eac(s),l=i[c]/2-o[c]/2,f=eal(n),d="x"===s,p;switch(f){case"top":p={x:a,y:i.y-o.height};break;case"bottom":p={x:a,y:i.y+i.height};break;case"right":p={x:i.x+i.width,y:u};break;case"left":p={x:i.x-o.width,y:u};break;default:p={x:i.x,y:i.y}}switch(eas(n)){case"start":p[s]-=l*(r&&d?-1:1);break;case"end":p[s]+=l*(r&&d?-1:1)}return p}let eap=async(t,n,r)=>{let{placement:i="bottom",strategy:o="absolute",middleware:a=[],platform:u}=r,s=a.filter(Boolean),c=await (null==u.isRTL?void 0:u.isRTL(n)),l=await u.getElementRects({reference:t,floating:n,strategy:o}),{x:f,y:d}=ead(l,i,c),p=i,h={},m=0;for(let g=0;g<s.length;g++){let{name:y,fn:v}=s[g],{x:b,y:x,data:_,reset:S}=await v({x:f,y:d,initialPlacement:i,placement:p,strategy:o,middlewareData:h,rects:l,platform:u,elements:{reference:t,floating:n}});if(f=b??f,d=x??d,h={...h,[y]:{...h[y],..._}},S&&m<=50){m++,"object"==typeof S&&(S.placement&&(p=S.placement),S.rects&&(l=!0===S.rects?await u.getElementRects({reference:t,floating:n,strategy:o}):S.rects),{x:f,y:d}=ead(l,p,c)),g=-1;continue}}return{x:f,y:d,placement:p,strategy:o,middlewareData:h}};function eah(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}async function eam(t,n){var r,i,o;void 0===n&&(n={});let{x:a,y:u,platform:s,rects:c,elements:l,strategy:f}=t,{boundary:d="clippingAncestors",rootBoundary:p="viewport",elementContext:h="floating",altBoundary:m=!1,padding:g=0}=n,y="number"!=typeof g?{top:0,right:0,bottom:0,left:0,...g}:{top:g,right:g,bottom:g,left:g},v=l[m?"floating"===h?"reference":"floating":h],b=eah(await s.getClippingRect({element:null==(r=await (null==s.isElement?void 0:s.isElement(v)))||r?v:v.contextElement||await (null==s.getDocumentElement?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:p,strategy:f})),x="floating"===h?{...c.floating,x:a,y:u}:c.reference,_=await (null==s.getOffsetParent?void 0:s.getOffsetParent(l.floating)),S=await (null==s.isElement?void 0:s.isElement(_))&&await (null==s.getScale?void 0:s.getScale(_))||{x:1,y:1},T=eah(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:x,offsetParent:_,strategy:f}):x);return{top:(b.top-T.top+y.top)/S.y,bottom:(T.bottom-b.bottom+y.bottom)/S.y,left:(b.left-T.left+y.left)/S.x,right:(T.right-b.right+y.right)/S.x}}let eag=Math.min,eay=Math.max;function eav(t,n,r){return eay(t,eag(n,r))}let eab={left:"right",right:"left",bottom:"top",top:"bottom"};function eax(t){return t.replace(/left|right|bottom|top/g,t=>eab[t])}let ea_={start:"end",end:"start"};function eaS(t){return t.replace(/start|end/g,t=>ea_[t])}async function eaT(t,n){let{placement:r,platform:i,elements:o}=t,a=await (null==i.isRTL?void 0:i.isRTL(o.floating)),u=eal(r),s=eas(r),c="x"===eaf(r),l=["left","top"].includes(u)?-1:1,f=a&&c?-1:1,d="function"==typeof n?n(t):n,{mainAxis:p,crossAxis:h,alignmentAxis:m}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&"number"==typeof m&&(h="end"===s?-1*m:m),c?{x:h*f,y:p*l}:{x:p*l,y:h*f}}function eaw(t){return"x"===t?"y":"x"}function eaO(t){var n;return(null==(n=t.ownerDocument)?void 0:n.defaultView)||window}function eak(t){return eaO(t).getComputedStyle(t)}let eaI=Math.min,eaC=Math.max,eaM=Math.round;function eaR(t){let n=eak(t),r=parseFloat(n.width),i=parseFloat(n.height),o=t.offsetWidth,a=t.offsetHeight,u=eaM(r)!==o||eaM(i)!==a;return u&&(r=o,i=a),{width:r,height:i,fallback:u}}function eaE(t){return eaL(t)?(t.nodeName||"").toLowerCase():""}let eaj;function eaN(){if(eaj)return eaj;let t=navigator.userAgentData;return t&&Array.isArray(t.brands)?eaj=t.brands.map(t=>t.brand+"/"+t.version).join(" "):navigator.userAgent}function eaA(t){return t instanceof eaO(t).HTMLElement}function eaP(t){return t instanceof eaO(t).Element}function eaL(t){return t instanceof eaO(t).Node}function eaD(t){if(typeof ShadowRoot>"u")return!1;let n=eaO(t).ShadowRoot;return t instanceof n||t instanceof ShadowRoot}function eaF(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 eaW(t){return["table","td","th"].includes(eaE(t))}function eaU(t){let n=/firefox/i.test(eaN()),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 eaz(){return/^((?!chrome|android).)*safari/i.test(eaN())}function eaB(t){return["html","body","#document"].includes(eaE(t))}function eaV(t){return eaP(t)?t:t.contextElement}let ea$={x:1,y:1};function eaq(t){let n=eaV(t);if(!eaA(n))return ea$;let r=n.getBoundingClientRect(),{width:i,height:o,fallback:a}=eaR(n),u=(a?eaM(r.width):r.width)/i,s=(a?eaM(r.height):r.height)/o;return u&&Number.isFinite(u)||(u=1),s&&Number.isFinite(s)||(s=1),{x:u,y:s}}function eaK(t,n,r,i){var o,a;void 0===n&&(n=!1),void 0===r&&(r=!1);let u=t.getBoundingClientRect(),s=eaV(t),c=ea$;n&&(i?eaP(i)&&(c=eaq(i)):c=eaq(t));let l=s?eaO(s):window,f=eaz()&&r,d=(u.left+(f&&(null==(o=l.visualViewport)?void 0:o.offsetLeft)||0))/c.x,p=(u.top+(f&&(null==(a=l.visualViewport)?void 0:a.offsetTop)||0))/c.y,h=u.width/c.x,m=u.height/c.y;if(s){let g=eaO(s),y=i&&eaP(i)?eaO(i):i,v=g.frameElement;for(;v&&i&&y!==g;){let b=eaq(v),x=v.getBoundingClientRect(),_=getComputedStyle(v);x.x+=(v.clientLeft+parseFloat(_.paddingLeft))*b.x,x.y+=(v.clientTop+parseFloat(_.paddingTop))*b.y,d*=b.x,p*=b.y,h*=b.x,m*=b.y,d+=x.x,p+=x.y,v=eaO(v).frameElement}}return{width:h,height:m,top:p,right:d+h,bottom:p+m,left:d,x:d,y:p}}function eaH(t){return((eaL(t)?t.ownerDocument:t.document)||window.document).documentElement}function eaZ(t){return eaP(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function eaG(t){return eaK(eaH(t)).left+eaZ(t).scrollLeft}function eaY(t){if("html"===eaE(t))return t;let n=t.assignedSlot||t.parentNode||eaD(t)&&t.host||eaH(t);return eaD(n)?n.host:n}function eaJ(t,n){var r;void 0===n&&(n=[]);let i=function t(n){let r=eaY(n);return eaB(r)?r.ownerDocument.body:eaA(r)&&eaF(r)?r:t(r)}(t),o=i===(null==(r=t.ownerDocument)?void 0:r.body),a=eaO(i);return o?n.concat(a,a.visualViewport||[],eaF(i)?i:[]):n.concat(i,eaJ(i))}function eaQ(t,n,r){let i;if("viewport"===n)i=function(t,n){let r=eaO(t),i=eaH(t),o=r.visualViewport,a=i.clientWidth,u=i.clientHeight,s=0,c=0;if(o){a=o.width,u=o.height;let l=eaz();(!l||l&&"fixed"===n)&&(s=o.offsetLeft,c=o.offsetTop)}return{width:a,height:u,x:s,y:c}}(t,r);else if("document"===n)i=function(t){let n=eaH(t),r=eaZ(t),i=t.ownerDocument.body,o=eaC(n.scrollWidth,n.clientWidth,i.scrollWidth,i.clientWidth),a=eaC(n.scrollHeight,n.clientHeight,i.scrollHeight,i.clientHeight),u=-r.scrollLeft+eaG(t),s=-r.scrollTop;return"rtl"===eak(i).direction&&(u+=eaC(n.clientWidth,i.clientWidth)-o),{width:o,height:a,x:u,y:s}}(eaH(t));else if(eaP(n))i=function(t,n){let r=eaK(t,!0,"fixed"===n),i=r.top+t.clientTop,o=r.left+t.clientLeft,a=eaA(t)?eaq(t):{x:1,y:1},u=t.clientWidth*a.x,s=t.clientHeight*a.y,c=o*a.x,l=i*a.y;return{width:u,height:s,x:c,y:l}}(n,r);else{let o={...n};if(eaz()){var a,u;let s=eaO(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 eah(i)}function eaX(t,n){return eaA(t)&&"fixed"!==eak(t).position?n?n(t):t.offsetParent:null}function ea0(t,n){let r=eaO(t),i=eaX(t,n);for(;i&&eaW(i)&&"static"===eak(i).position;)i=eaX(i,n);return i&&("html"===eaE(i)||"body"===eaE(i)&&"static"===eak(i).position&&!eaU(i))?r:i||function(t){let n=eaY(t);for(;eaA(n)&&!eaB(n);){if(eaU(n))return n;n=eaY(n)}return null}(t)||r}let ea1={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=eaJ(t).filter(t=>eaP(t)&&"body"!==eaE(t)),o=null,a="fixed"===eak(t).position,u=a?eaY(t):t;for(;eaP(u)&&!eaB(u);){let s=eak(u),c=eaU(u);"fixed"===s.position?o=null:(a?c||o:!(!c&&"static"===s.position&&o&&["absolute","fixed"].includes(o.position)))?o=s:i=i.filter(t=>t!==u),u=eaY(u)}return n.set(t,i),i}(n,this._c):[].concat(r),i],u=a[0],s=a.reduce((t,r)=>{let i=eaQ(n,r,o);return t.top=eaC(i.top,t.top),t.right=eaI(i.right,t.right),t.bottom=eaI(i.bottom,t.bottom),t.left=eaC(i.left,t.left),t},eaQ(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=eaA(r),a=eaH(r);if(r===a)return n;let u={scrollLeft:0,scrollTop:0},s={x:1,y:1},c={x:0,y:0};if((o||!o&&"fixed"!==i)&&(("body"!==eaE(r)||eaF(a))&&(u=eaZ(r)),eaA(r))){let l=eaK(r);s=eaq(r),c.x=l.x+r.clientLeft,c.y=l.y+r.clientTop}return{width:n.width*s.x,height:n.height*s.y,x:n.x*s.x-u.scrollLeft*s.x+c.x,y:n.y*s.y-u.scrollTop*s.y+c.y}},isElement:eaP,getDimensions:function(t){return eaA(t)?eaR(t):t.getBoundingClientRect()},getOffsetParent:ea0,getDocumentElement:eaH,getScale:eaq,async getElementRects(t){let{reference:n,floating:r,strategy:i}=t,o=this.getOffsetParent||ea0,a=this.getDimensions;return{reference:function(t,n,r){let i=eaA(n),o=eaH(n),a=eaK(t,!0,"fixed"===r,n),u={scrollLeft:0,scrollTop:0},s={x:0,y:0};if(i||!i&&"fixed"!==r){if(("body"!==eaE(n)||eaF(o))&&(u=eaZ(n)),eaA(n)){let c=eaK(n,!0);s.x=c.x+n.clientLeft,s.y=c.y+n.clientTop}else o&&(s.x=eaG(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 ea2(t,n,r,i){void 0===i&&(i={});let{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:u=!0,animationFrame:s=!1}=i,c=o&&!s,l=c||a?[...eaP(t)?eaJ(t):t.contextElement?eaJ(t.contextElement):[],...eaJ(n)]:[];l.forEach(t=>{c&&t.addEventListener("scroll",r,{passive:!0}),a&&t.addEventListener("resize",r)});let f=null;if(u){let d=!0;f=new ResizeObserver(()=>{d||r(),d=!1}),eaP(t)&&!s&&f.observe(t),eaP(t)||!t.contextElement||s||f.observe(t.contextElement),f.observe(n)}let p,h=s?eaK(t):null;return s&&function n(){let i=eaK(t);h&&(i.x!==h.x||i.y!==h.y||i.width!==h.width||i.height!==h.height)&&r(),h=i,p=requestAnimationFrame(n)}(),r(),()=>{var t;l.forEach(t=>{c&&t.removeEventListener("scroll",r),a&&t.removeEventListener("resize",r)}),null==(t=f)||t.disconnect(),f=null,s&&cancelAnimationFrame(p)}}let ea3=(t,n,r)=>{let i=new Map,o={platform:ea1,...r},a={...o.platform,_c:i};return eap(t,n,{...o,platform:a})};var ea4="u">typeof document?o.useLayoutEffect:o.useEffect;function ea5(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(!ea5(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)&&!ea5(t[a],n[a]))return!1}return!0}return t!=t&&n!=n}function ea9(t){let n=o.useRef(t);return ea4(()=>{n.current=t}),n}var ea6="u">typeof document?o.useLayoutEffect:o.useEffect;let ea8=!1,ea7=0,eue=()=>"floating-ui-"+ea7++,eut=(Hh||(Hh=r.t(o,2)))["useId".toString()],eun=eut??function(){let[t,n]=o.useState(()=>ea8?eue():void 0);return ea6(()=>{null==t&&n(eue())},[]),o.useEffect(()=>{ea8||(ea8=!0)},[]),t},eur=o.createContext(null),eui=o.createContext(null),euo=()=>{var t,n;return null!=(t=null==(n=o.useContext(eur))?void 0:n.id)?t:null},eua=()=>o.useContext(eui);function euu(t){var n;return null!=(n=null==t?void 0:t.ownerDocument)?n:document}function eus(t){var n;return null!=(n=euu(t).defaultView)?n:window}function euc(t){return!!t&&t instanceof eus(t).Element}let eul=(Hh||(Hh=r.t(o,2)))["useInsertionEffect".toString()];function euf(t){let n=o.useRef(()=>{});return eul?eul(()=>{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 eud(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 eup(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 euh(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 eum(t){t.preventDefault(),t.stopPropagation()}function eug(t){let n=(0,o.useRef)();return ea6(()=>{n.current=t},[t]),n.current}let euy=function(t,n){let{open:r}=t,{enabled:i=!0,role:o="dialog"}=void 0===n?{}:n,a=eun(),u=eun(),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 euv(t,n){return null!=n&&("composedPath"in t?t.composedPath().includes(n):null!=t.target&&n.contains(t.target))}let eub=function(t,n){let{open:r,onOpenChange:i,refs:a,events:u,nodeId:s}=t,{enabled:c=!0,escapeKey:l=!0,outsidePointerDown:f=!0,referencePointerDown:d=!1,ancestorScroll:p=!1,bubbles:h=!0}=void 0===n?{}:n,m=eua(),g=null!=euo(),y=o.useRef(!1);return o.useEffect(()=>{if(!r||!c)return;function t(t){"Escape"!==t.key||!h&&m&&eup(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 c="composedPath"in t?t.composedPath()[0]:t.target;if(euc(c)&&a.floating.current){let l=null!=(r=a.floating.current.ownerDocument.defaultView)?r:window,f=c.scrollWidth>c.clientWidth,d=c.scrollHeight>c.clientHeight,p=d&&t.offsetX>c.clientWidth;if(d&&"rtl"===l.getComputedStyle(c).direction&&(p=t.offsetX<=c.offsetWidth-c.clientWidth),p||f&&t.offsetY>c.clientHeight)return}let v=m&&eup(m.nodesRef.current,s).some(n=>{var r;return euv(t,null==(r=n.context)?void 0:r.refs.floating.current)});euv(t,a.floating.current)||euv(t,a.domReference.current)||v||!h&&m&&eup(m.nodesRef.current,s).length>0||(u.emit("dismiss",!!g&&{preventScroll:!0}),i(!1))}function o(){i(!1)}let d=euu(a.floating.current);l&&d.addEventListener("keydown",t),f&&d.addEventListener("pointerdown",n);let v=(p?[...euc(a.reference.current)?eaJ(a.reference.current):[],...euc(a.floating.current)?eaJ(a.floating.current):[]]:[]).filter(t=>{var n;return t!==(null==(n=d.defaultView)?void 0:n.visualViewport)});return v.forEach(t=>t.addEventListener("scroll",o,{passive:!0})),()=>{l&&d.removeEventListener("keydown",t),f&&d.removeEventListener("pointerdown",n),v.forEach(t=>t.removeEventListener("scroll",o))}},[l,f,u,m,s,r,i,p,c,h,a,g]),c?{reference:{onPointerDown(){d&&(u.emit("dismiss"),i(!1))}},floating:{onPointerDownCapture(){y.current=!0}}}:{}},eux="ArrowUp",eu_="ArrowDown",euS="ArrowLeft",euT="ArrowRight";function euw(t,n,r){return Math.floor(t/n)!==r}function euO(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 c,l;s+=i?-a:a}while(s>=0&&s<=u.length-1&&(o?o.includes(s):null==u[s]||null!=(c=u[s])&&c.hasAttribute("disabled")||(null==(l=u[s])?void 0:l.getAttribute("aria-disabled"))==="true"));return s}function euI(t,n,r){switch(t){case"vertical":return n;case"horizontal":return r;default:return n||r}}function euC(t,n){return euI(n,t===eux||t===eu_,t===euS||t===euT)}function euM(t,n,r){return euI(n,t===eu_,r?t===euS:t===euT)||"Enter"===t||" "==t||""===t}function euR(t,n){return euk(t,{disabledIndices:n})}function euE(t,n){return euk(t,{decrement:!0,startingIndex:t.current.length,disabledIndices:n})}let euj=function(t,n){let{open:r,onOpenChange:i,refs:a}=t,{listRef:u,activeIndex:s,onNavigate:c=()=>{},enabled:l=!0,selectedIndex:f=null,allowEscape:d=!1,loop:p=!1,nested:h=!1,rtl:m=!1,virtual:g=!1,focusItemOnOpen:y="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:b=!0,disabledIndices:x,orientation:_="vertical",cols:S=1}=void 0===n?{listRef:{current:[]},activeIndex:null,onNavigate(){}}:n,T=euo(),w=eua(),O=eug(r),k=euf(c),I=euf(eug(c)),C=o.useRef(y),M=o.useRef(f??-1),R=o.useRef(null),E=function(t){let n=(0,o.useRef)(t);return ea6(()=>{n.current=t}),n}(x),j=o.useRef(!1),N=o.useRef(-1),[A,P]=o.useState(),L=o.useCallback((t,n)=>{N.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,c;if(j.current=!0,h&&(n=t.key,euI(_,m?n===euT:n===euS,n===eux))){eum(t),i(!1),(c=a.domReference.current)&&c instanceof eus(c).HTMLElement&&a.domReference.current.focus();return}let l=M.current,f=euR(u,x),y=euE(u,x);if("Home"===t.key&&(M.current=f,k(M.current)),"End"===t.key&&(M.current=y,k(M.current)),S>1){let v=M.current;if(t.key===eux){if(eum(t),-1===v)M.current=y;else if(M.current=euk(u,{startingIndex:v,amount:S,decrement:!0,disabledIndices:x}),p&&(v-S<f||M.current<0)){let b=v%S,T=y%S,w=y-(T-b);T===b?M.current=y:M.current=T>b?w:w-S}euO(u,M.current)&&(M.current=v),k(M.current)}if(t.key===eu_&&(eum(t),-1===v?M.current=f:(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}))),euO(u,M.current)&&(M.current=v),k(M.current)),"both"===_){let O=Math.floor(v/S);t.key===euT&&(eum(t),v%S!=S-1?(M.current=euk(u,{startingIndex:v,disabledIndices:x}),p&&euw(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})),euw(M.current,S,O)&&(M.current=v)),t.key===euS&&(eum(t),v%S!=0?(M.current=euk(u,{startingIndex:v,disabledIndices:x,decrement:!0}),p&&euw(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})),euw(M.current,S,O)&&(M.current=v)),euO(u,M.current)&&(p&&Math.floor(y/S)===O?M.current=t.key===euS?y:euk(u,{startingIndex:v-v%S-1,disabledIndices:x}):M.current=v),k(M.current);return}}if(euC(t.key,_)){if(eum(t),r&&!g&&euh(t.currentTarget.ownerDocument)===t.currentTarget){M.current=euM(t.key,_,m)?f:y,k(M.current);return}euM(t.key,_,m)?p?M.current=l>=y?d&&l!==u.current.length?-1:f:euk(u,{startingIndex:l,disabledIndices:x}):M.current=Math.min(y,euk(u,{startingIndex:l,disabledIndices:x})):p?M.current=l<=f?d&&-1!==l?u.current.length:y:euk(u,{startingIndex:l,decrement:!0,disabledIndices:x}):M.current=Math.max(f,euk(u,{startingIndex:l,decrement:!0,disabledIndices:x})),euO(u,M.current)?k(null):k(M.current)}}return ea6(()=>{l&&(!O&&r&&C.current&&null!=f&&k(f),O&&!r&&(cancelAnimationFrame(N.current),M.current=-1,I(null)))},[r,O,f,u,L,l,k,I]),ea6(()=>{l&&r&&(null==s?null==f&&(O&&(M.current=-1,L(u,M)),!O&&C.current&&(null!=R.current||!0===C.current&&null==R.current)&&(M.current=null==R.current||euM(R.current,_,m)||h?euR(u,E.current):euE(u,E.current),k(M.current),L(u,M))):euO(u,s)||(M.current=s,L(u,M)))},[r,O,s,f,h,u,k,L,l,d,_,m,g,E]),ea6(()=>{if(l&&!r&&O){var t,n;let i=null==w||null==(t=w.nodesRef.current.find(t=>t.id===T))||null==(n=t.context)?void 0:n.refs.floating.current;i&&!i.contains(euh(euu(i)))&&i.focus({preventScroll:!0})}},[l,r,O,w,T]),ea6(()=>{R.current=null}),l?{reference:{...g&&r&&null!=s&&{"aria-activedescendant":A},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,euI(_,m?n===euS:n===euT,n===eu_)&&(eum(t),r?(M.current=euR(u,x),k(M.current)):i(!0));return}euC(t.key,_)&&(null!=f&&(M.current=f),eum(t),!r&&b?i(!0):D(t),r&&k(M.current))}},floating:{"aria-orientation":"both"===_?void 0:_,...g&&null!=s&&{"aria-activedescendant":A},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})}}}}}:{}},euN=new Jt("suggestion");function euA(t){var n,r,i="";if("string"==typeof t||"number"==typeof t)i+=t;else if("object"==typeof t){if(Array.isArray(t))for(n=0;n<t.length;n++)t[n]&&(r=euA(t[n]))&&(i&&(i+=" "),i+=r);else for(n in t)t[n]&&(i&&(i+=" "),i+=n)}return i}function euP(){for(var t,n,r=0,i="";r<arguments.length;)(t=arguments[r++])&&(n=euA(t))&&(i&&(i+=" "),i+=n);return i}let euL=ene.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",eep(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),euD={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"},euF=()=>(++euF.i).toString();euF.i=0;let euW=t=>{let n=euB(t),r=[];for(let i=0;i<n.length;i++)r.push(euV(n[i]));return{key:euF(),children:r}},euU=(t,n=[])=>({key:euF(),type:t.type,text:"text"in t?t.text:void 0,node:t,children:n}),euz=t=>euU({type:euD.span,text:t,spans:[]}),euB=t=>{let n=t.slice(0);for(let r=0;r<n.length;r++){let i=n[r];if(i.type===euD.listItem||i.type===euD.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===euD.listItem?n[r]={type:euD.list,items:o}:n[r]={type:euD.oList,items:o}}}return n},euV=t=>{if("text"in t)return euU(t,eu$(t.spans,t));if("items"in t){let n=[];for(let r=0;r<t.items.length;r++)n.push(euV(t.items[r]));return euU(t,n)}return euU(t)},eu$=(t,n,r)=>{if(!t.length)return[euz(n.text)];let i=t.slice(0);i.sort((t,n)=>t.start-n.start||n.end-t.end);let o=[];for(let a=0;a<i.length;a++){let u=i[a],s=r&&r.start||0,c=u.start-s,l=u.end-s,f=n.text.slice(c,l),d=[];for(let p=a;p<i.length;p++){let h=i[p];h!==u&&h.start>=u.start&&h.end<=u.end&&(d.push(h),i.splice(p,1),p--)}0===a&&c>0&&o.push(euz(n.text.slice(0,c)));let m={...u,text:f};o.push(euU(m,eu$(d,{...n,text:f},u))),l<n.text.length&&o.push(euz(n.text.slice(l,i[a+1]?i[a+1].start-s:void 0)))}return o},euq=(t,n)=>euK(euW(t).children,n),euK=(t,n)=>{let r=[];for(let i=0;i<t.length;i++){let o=t[i],a=n(o.type,o.node,o.text,euK(o.children,n),o.key);null!=a&&r.push(a)}return r};euD.listItem,euD.oListItem,euD.list,euD.oList;let euH=ene.create({name:"text",group:"inline"}),euZ={groupBy:(t,n)=>t.reduce((t,r)=>{let i=n(r),o=(t.get(i)||[]).concat(r);return t.set(i,o)},new Map),sort:t=>[...t].sort((t,n)=>t.start-n.start),mergeOverlap(t){let n=this.groupBy(t,t=>t.type),r=Array.from(n.entries()).map(([t,n])=>(this.sort(n).reduce((t,n)=>{if(!t.length)return[n];let r=t.length-1,i=t[r];return i.end>=n.start?[...t.slice(0,r),{...i,end:n.end}]:[...t,n]},[]),n)).reduce((t,n)=>[...t,...n],[]);return this.sort(r)}},euG={fromPrismic:t=>n=>{switch(n.type){case"hyperlink":return esN.converter.fromPrismic(t)(n);case"em":return esE.converter.fromPrismic(t)(n);case"strong":return eoQ.converter.fromPrismic(t)(n);default:return}},toPrismic(t,n,r){let i=esV.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}}},euY=euH.extend({name:"text"}),euJ={name:euY.name,component:euY,converter:{fromPrismic:t=>function(n,r,i=!1){let o={type:n,text:r.content.text,spans:r.content.spans||[]};return euq([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=euG.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=eoG.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?eoG.marks.map(n,t=>euG.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:[...euZ.mergeOverlap(i.spans)].sort((t,n)=>t.type.localeCompare(n.type))},...r}}}};var euQ,euX=((euQ=euX||{}).LeftToRight="ltr",euQ.RightToLeft="rtl",euQ);let eu0=qu.RichTextNodeType.rtl,eu1=eej.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()}}}),eu2={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)}}},eu3=euL.extend({name:"paragraph",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",eep(this.options.HTMLAttributes,t),0]}}),eu4=new eoV([qu.RichTextNodeType.paragraph],eu3.name,eu3,{fromPrismic:t=>function(n){var r;let i=euJ.converter.fromPrismic(t)(eu3.name,n);return null==(r=t.nodes[eu3.name])?void 0:r.create(eu2.fromPrismic(n),i)},toPrismic:t=>euJ.converter.toPrismic(t,qu.RichTextNodeType.paragraph,eu2.toPrismic(t))},"Type '/' for commands"),eu5=eu4,eu9=["ArrowDown","ArrowUp","End","Home"],eu6=["Enter"],eu8=["Escape",...eu9,...eu6],eu7=eej.create({name:"slash-commands",addOptions:()=>({nodeTypes:[]}),addProseMirrorPlugins(){let t=esY(esq,this.options.nodeTypes);return t.length>1?[function({pluginKey:t=euN,editor:n,char:r="@",allowSpaces:i=!1,allowedPrefixes:o=[" "],startOfLine:a=!1,decorationTag:u="span",decorationClass:s="suggestion",command:c=()=>null,items:l=()=>[],render:f=()=>({}),allow:d=()=>!0}){let p,h=null==f?void 0:f(),m=new Y8({key:t,view(){return{update:async(t,r)=>{var i,o,a,u,s,f,d;let m=null===(i=this.key)||void 0===i?void 0:i.getState(r),g=null===(o=this.key)||void 0===o?void 0:o.getState(t.state),y=m.active&&g.active&&m.range.from!==g.range.from,v=!m.active&&g.active,b=m.active&&!g.active,x=!v&&!b&&m.query!==g.query,_=v||y,S=x&&!y,T=b||y;if(!_&&!S&&!T)return;let w=T&&!_?m:g,O=t.dom.querySelector(`[data-decoration-id="${w.decorationId}"]`);p={editor:n,range:w.range,query:w.query,text:w.text,items:[],command(t){c({editor:n,range:w.range,props:t})},decorationNode:O,clientRect:O?()=>{var r;let{decorationId:i}=null===(r=this.key)||void 0===r?void 0:r.getState(n.state),o=t.dom.querySelector(`[data-decoration-id="${i}"]`);return(null==o?void 0:o.getBoundingClientRect())||null}:null},_&&(null===(a=null==h?void 0:h.onBeforeStart)||void 0===a||a.call(h,p)),S&&(null===(u=null==h?void 0:h.onBeforeUpdate)||void 0===u||u.call(h,p)),(S||_)&&(p.items=await l({editor:n,query:w.query})),T&&(null===(s=null==h?void 0:h.onExit)||void 0===s||s.call(h,p)),S&&(null===(f=null==h?void 0:h.onUpdate)||void 0===f||f.call(h,p)),_&&(null===(d=null==h?void 0:h.onStart)||void 0===d||d.call(h,p))},destroy(){var t;p&&(null===(t=null==h?void 0:h.onExit)||void 0===t||t.call(h,p))}}},state:{init:()=>({active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}),apply(t,u,s,c){let{isEditable:l}=n,{composing:f}=n.view,{selection:p}=t,{empty:h,from:m}=p,g={...u};if(g.composing=f,l&&(h||n.view.composing)){(m<u.range.from||m>u.range.to)&&!f&&!u.composing&&(g.active=!1);let y=function(t){var n,r;let{char:i,allowSpaces:o,allowedPrefixes:a,startOfLine:u,$position:s}=t,c=i.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),l=RegExp(`\\s${c}$`),f=u?"^":"",d=o?RegExp(`${f}${c}.*?(?=\\s${c}|$)`,"gm"):RegExp(`${f}(?:^)?${c}[^\\s${c}]*`,"gm"),p=(null===(n=s.nodeBefore)||void 0===n?void 0:n.isText)&&s.nodeBefore.text;if(!p)return null;let h=s.pos-p.length,m=Array.from(p.matchAll(d)).pop();if(!m||void 0===m.input||void 0===m.index)return null;let g=m.input.slice(Math.max(0,m.index-1),m.index),y=RegExp(`^[${null==a?void 0:a.join("")}\0]?$`).test(g);if(null!==a&&!y)return null;let v=h+m.index,b=v+m[0].length;return o&&l.test(p.slice(b-1,b+1))&&(m[0]+=" ",b+=1),v<s.pos&&b>=s.pos?{range:{from:v,to:b},query:m[0].slice(i.length),text:m[0]}:null}({char:r,allowSpaces:i,allowedPrefixes:o,startOfLine:a,$position:p.$from}),v=`id_${Math.floor(4294967295*Math.random())}`;y&&d({editor:n,state:c,range:y.range})?(g.active=!0,g.decorationId=u.decorationId?u.decorationId:v,g.range=y.range,g.query=y.query,g.text=y.text):g.active=!1}else g.active=!1;return g.active||(g.decorationId=null,g.range={from:0,to:0},g.query=null,g.text=null),g}},props:{handleKeyDown(t,n){var r;let{active:i,range:o}=m.getState(t.state);return i&&(null===(r=null==h?void 0:h.onKeyDown)||void 0===r?void 0:r.call(h,{view:t,event:n,range:o}))||!1},decorations(t){let{active:n,range:r,decorationId:i}=m.getState(t);return n?Xd.create(t.doc,[Xc.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===eu5.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 erX(ese,{editor:n.editor,props:n}),document.body.appendChild(t.element)},onUpdate(n){null==t||t.updateProps(n)},onKeyDown({event:n}){var r;return Boolean(eu8.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()}}}})]:[]}}),ese=(0,o.forwardRef)(function({command:t,decorationNode:n,editor:r,items:i},a){var c,l,f,d,p;let[h,m]=(0,o.useState)(!0),g=parseFloat(u.TV.space[0]),{context:y,floating:b,reference:x,strategy:_,x:S,y:T}=function(t){let{open:n=!1,onOpenChange:r,whileElementsMounted:i,placement:a,middleware:u,strategy:s,nodeId:c}=void 0===t?{}:t,[l,f]=o.useState(null),d=eua(),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,[c,l]=o.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[f,d]=o.useState(i);ea5(f,i)||d(i);let p=o.useRef(null),h=o.useRef(null),m=o.useRef(c),g=ea9(u),y=ea9(a),[b,x]=o.useState(null),[_,S]=o.useState(null),T=o.useCallback(t=>{p.current!==t&&(p.current=t,x(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:f};y.current&&(t.platform=y.current),ea3(p.current,h.current,t).then(t=>{let n={...t,isPositioned:!0};k.current&&!ea5(m.current,n)&&(m.current=n,v.flushSync(()=>{l(n)}))})},[f,n,r,y]);ea4(()=>{!1===s&&m.current.isPositioned&&(m.current.isPositioned=!1,l(t=>({...t,isPositioned:!1})))},[s]);let k=o.useRef(!1);ea4(()=>(k.current=!0,()=>{k.current=!1}),[]),ea4(()=>{if(b&&_){if(g.current)return g.current(b,_,O);O()}},[b,_,O,g]);let I=o.useMemo(()=>({reference:p,floating:h,setReference:T,setFloating:w}),[T,w]),C=o.useMemo(()=>({reference:b,floating:_}),[b,_]);return o.useMemo(()=>({...c,update:O,refs:I,elements:C,reference:T,floating:w}),[c,O,I,C,T,w])}({placement:a,middleware:u,strategy:s,whileElementsMounted:i}),y=euf(r),b=o.useMemo(()=>({...g.refs,domReference:p}),[g.refs]),x=o.useMemo(()=>({...g,refs:b,dataRef:h,nodeId:c,events:m,open:n,onOpenChange:y,_:{domReference:l}}),[g,c,m,n,y,b,l]);ea6(()=>{let t=null==d?void 0:d.nodesRef.current.find(t=>t.id===c);t&&(t.context=x)});let{reference:_}=g,S=o.useCallback(t=>{(euc(t)||null===t)&&(x.refs.domReference.current=t,f(t)),_(t)},[_,x.refs]);return o.useMemo(()=>({...g,context:x,refs:b,reference:S}),[g,b,x,S])}({middleware:[(void 0===(c=g)&&(c=0),{name:"offset",options:c,async fn(t){let{x:n,y:r}=t,i=await eaT(t,c);return{x:n+i.x,y:r+i.y,data:i}}}),(void 0===l&&(l={}),{name:"flip",options:l,async fn(t){var n,r,i,o;let{placement:a,middlewareData:u,rects:s,initialPlacement:c,platform:f,elements:d}=t,{mainAxis:p=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:v=!0,...b}=l,x=eal(a),_=eal(c)===c,S=await (null==f.isRTL?void 0:f.isRTL(d.floating)),T=m||(_||!v?[eax(c)]:function(t){let n=eax(t);return[eaS(t),n,eaS(n)]}(c));m||"none"===y||T.push(...function(t,n,r,i){let o=eas(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[]}}(eal(t),"start"===r,i);return o&&(a=a.map(t=>t+"-"+o),n&&(a=a.concat(a.map(eaS)))),a}(c,v,y,S));let w=await eam(t,b),O=[],k=(null==(n=u.flip)?void 0:n.overflows)||[];if(p&&O.push(w[x]),h){let{main:I,cross:C}=function(t,n,r){void 0===r&&(r=!1);let i=eas(t),o=eaf(t),a=eac(o),u="x"===o?i===(r?"end":"start")?"right":"left":"start"===i?"bottom":"top";return n.reference[a]>n.floating[a]&&(u=eax(u)),{main:u,cross:eax(u)}}(a,s,S);O.push(w[I],w[C])}if(k=[...k,{placement:a,overflows:O}],!O.every(t=>t<=0)){let M=((null==(r=u.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==(i=k.filter(t=>t.overflows[0]<=0).sort((t,n)=>t.overflows[1]-n.overflows[1])[0])?void 0:i.placement;if(!E)switch(g){case"bestFit":{let j=null==(o=k.map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,n)=>t+n,0)]).sort((t,n)=>t[1]-n[1])[0])?void 0:o[0];j&&(E=j);break}case"initialPlacement":E=c}if(a!==E)return{reset:{placement:E}}}return{}}}),(d={limiter:(void 0===f&&(f={}),{options:f,fn(t){let{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:u=0,mainAxis:s=!0,crossAxis:c=!0}=f,l={x:n,y:r},d=eaf(i),p=eaw(d),h=l[d],m=l[p],g="function"==typeof u?u(t):u,y="number"==typeof g?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(s){let v="y"===d?"height":"width",b=o.reference[d]-o.floating[v]+y.mainAxis,x=o.reference[d]+o.reference[v]-y.mainAxis;h<b?h=b:h>x&&(h=x)}if(c){var _,S;let T="y"===d?"width":"height",w=["top","left"].includes(eal(i)),O=o.reference[p]-o.floating[T]+(w&&(null==(_=a.offset)?void 0:_[p])||0)+(w?0:y.crossAxis),k=o.reference[p]+o.reference[T]+(w?0:(null==(S=a.offset)?void 0:S[p])||0)-(w?y.crossAxis:0);m<O?m=O:m>k&&(m=k)}return{[d]:h,[p]:m}}})},{name:"shift",options:d,async fn(t){let{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:u={fn(t){let{x:n,y:r}=t;return{x:n,y:r}}},...s}=d,c={x:n,y:r},l=await eam(t,s),f=eaf(eal(i)),p=eaw(f),h=c[f],m=c[p];if(o){let g=h+l["y"===f?"top":"left"],y=h-l["y"===f?"bottom":"right"];h=eav(g,h,y)}if(a){let v=m+l["y"===p?"top":"left"],b=m-l["y"===p?"bottom":"right"];m=eav(v,m,b)}let x=u.fn({...t,[f]:h,[p]:m});return{...x,data:{x:x.x-n,y:x.y-r}}}})],onOpenChange:m,open:h,placement:"top-start",strategy:"fixed",whileElementsMounted:ea2});(0,o.useLayoutEffect)(()=>{x(n)},[x,n]),(0,o.useEffect)(()=>{let t,n=()=>{t=window.setTimeout(()=>{m(!0)})},i=()=>{m(!1)};return r.on("focus",n).on("blur",i),()=>{r.off("focus",n).off("blur",i),clearTimeout(t)}},[r]);let[w,O]=(0,o.useState)(0),k=(0,o.useRef)([]);(0,s.pQ)(i,()=>{O(0),k.current=[]});let{getFloatingProps:I,getItemProps:M,getReferenceProps:R}=(p=[eub(y,{outsidePointerDown:!1}),euj(y,{activeIndex:w,listRef:k,onNavigate(t){O(n=>t??n)},openOnArrowKeyDown:!1,virtual:!0}),euy(y,{role:"menu"})],{getReferenceProps:t=>eud(t,p,"reference"),getFloatingProps:t=>eud(t,p,"floating"),getItemProps:t=>eud(t,p,"item")}),E=R().onKeyDown;(0,o.useImperativeHandle)(a,()=>({handleKeyDown(n){if(!h)return!1;if(eu9.includes(n.key)&&E(n),eu6.includes(n.key)){let r=i[w];void 0!==r&&t(r)}return!0}}),[w,t,i,E,h]);let j=(0,o.useId)();return h?C.jsxs("div",{...I(),className:u._s.content,ref:b,style:{top:parseFloat(u.TV.space[0]),left:parseFloat(u.TV.space[0]),minWidth:256,position:_,transform:null!==S&&null!==T?`translate3d(${Math.round(S)}px, ${Math.round(T)}px, 0)`:"translate3d(0, -200%, 0)"},children:[i.map((n,r)=>(0,o.createElement)(est,{...M({onClick(){t(n)},onPointerDown(t){t.preventDefault()}}),"data-highlighted":r===w?"":void 0,id:`${j}[${r}]`,key:n.nodeType,ref(t){k.current[r]=t},shortcut:`/${n.shortText??""}`,startIcon:n.icon},n.text)),0===i.length?C.jsx(est,{...M({onPointerDown(t){t.preventDefault()}}),disabled:!0,id:`${j}[0]`,ref(t){k.current[0]=t},children:"No results"}):null]}):null}),est=(0,o.forwardRef)(function({children:t,disabled:n,shortcut:r,startIcon:i,...a},s){return C.jsxs("div",{...a,...n?{"aria-disabled":!0,"data-disabled":!0}:{},className:u._s.item,ref:s,role:"menuitem",children:[(0,o.isValidElement)(i)?(0,o.cloneElement)(i,{className:euP(i.props.className,u._s.itemStartIcon)}):null,C.jsx(u.xv,{className:euP(u._s.itemText,u._s.itemTextColor.grey),component:"span",children:t}),r?C.jsx(u.xv,{className:u._s.itemShortcut,color:"inherit",component:"span",variant:"inherit",children:r}):null]})}),esn=eo2.extend({name:"bulletList",parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:t}){return["ul",eep(this.options.HTMLAttributes,t),0]}}).configure({itemTypeName:"listItem"}),esr=new eoK([qu.RichTextNodeType.list],esn.name,esn,{fromPrismic:t=>function(n){var r;let i=eo9.converter.fromPrismic(t)(n);if(i)return null==(r=t.nodes[esn.name])?void 0:r.create(eu2.fromPrismic(n),i)},toPrismic:t=>eoG.children.map(t,t=>eo9.converter.toPrismic(t,qu.RichTextNodeType.list).filter(l.$)).flat()}),esi=esr,eso=/^```([a-z]+)?[\s\n]$/,esa=/^~~~([a-z]+)?[\s\n]$/,esu=ene.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:t=>{var n;let{languageClassPrefix:r}=this.options,i=[...(null===(n=t.firstElementChild)||void 0===n?void 0:n.classList)||[]].filter(t=>t.startsWith(r)).map(t=>t.replace(r,""))[0];return i||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:t,HTMLAttributes:n}){return["pre",eep(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[et6({find:eso,type:this.type,getAttributes:t=>({language:t[1]})}),et6({find:esa,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Y8({key:new Jt("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(YZ.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}}})]}}),ess=esu.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",eep(this.options.HTMLAttributes),["code",t,0]]}}).configure({exitOnTripleEnter:!1}),esc=new eoV([qu.RichTextNodeType.preformatted],ess.name,ess,{fromPrismic:t=>function(n){var r;let i=euJ.converter.fromPrismic(t)(ess.name,n,!0);return null==(r=t.nodes[ess.name])?void 0:r.create(eu2.fromPrismic(n),i)},toPrismic:t=>euJ.converter.toPrismic(t,qu.RichTextNodeType.preformatted,eu2.toPrismic(t))},"",!0);function esl(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 esf(t){let n=(0,o.useRef)(null),r=(0,o.useRef)(null),{onKeyDown:i,url:a,urlChanged:c,onContentChange:l,debouncedUrl:f,content:d}=function(t,n,r){let{node:i}=t,a=i.attrs.content,u=(0,s.R9)(t.updateAttributes),c=(0,s.$P)({initialState:(null==a?void 0:a.embed_url)??"",startTransition:o.startTransition});function l(t){u({content:t})}let{onKeyDown:f}=function(t,n,r,i){let{editor:a,getPos:u,node:s}=t,[c,l]=(0,o.useState)(!0);return(0,o.useEffect)(()=>{c&&t.editor.isFocused&&er2(()=>{var t;return null==(t=r.current)?void 0:t.focus()})},[r,c,t.editor.isFocused]),{containerRef:i,inputRef:r,onKeyDown:function(t){let r=u(),i=u()+s.nodeSize;"Enter"===t.code&&(l(!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&&(l(!1),a.chain().focus(r-1).run()),"ArrowDown"===t.code&&(l(!1),a.chain().focus(i+1).run())}}}(t,c.value,n,r);return{inputRef:n,containerRef:r,onKeyDown:f,url:c.value,urlChanged:function(t){c.set(t),(0,p.ju)(t)||l(void 0)},onContentChange:l,debouncedUrl:c.debouncedValue,content:t.node.attrs.content}}(t,n,r),{selected:h}=esl(t);return C.jsx(erQ,{className:"custom-embed",children:C.jsx("div",{contentEditable:"false",suppressContentEditableWarning:!0,children:C.jsxs(u.xu,{flexDirection:"column",children:[C.jsxs(u.xu,{flexGrow:1,alignItems:"center",children:[C.jsx(u.I5,{size:"small",name:"cloud",color:"grey11"}),C.jsx(u.xu,{flexGrow:1,flexDirection:"column",ref:r,children:C.jsx(u.oi,{id:"id",ref:n,value:a,variant:(0,p.ju)(a)?"link":"normal",placeholder:"Paste your link here",onValueChange:c,onKeyDown:i})})]}),(0,p.ju)(a)&&C.jsx(er3,{selected:h,debouncedUrl:f,onContentChange:l,content:d})]})})})}let esd=ene.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:()=>er1(esf)}),esp=new class{constructor(t,n,r,i){S(this,"extType","node"),S(this,"nodeType","embed"),this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}([qu.RichTextNodeType.embed],esd.name,esd,{fromPrismic:t=>function(n){var r;return null==(r=t.nodes[esd.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}}}),esh=ene.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:n}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,eep(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=>et6({find:RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),esm="heading",esg={byLevel(t){switch(t){case 1:return qu.RichTextNodeType.heading1;case 2:return qu.RichTextNodeType.heading2;case 3:return qu.RichTextNodeType.heading3;case 4:return qu.RichTextNodeType.heading4;case 5:return qu.RichTextNodeType.heading5;case 6:return qu.RichTextNodeType.heading6}},default(t){return{fullName:this.byLevel(t),level:t}},fromPrismic(t,n=[1,2,3,4,5,6]){let r=RegExp(`^heading([${n.join(",")}]){1}$`),i=t.match(r);if(!i||!i[1])return;let o=parseInt(i[1]);return{fullName:esg.byLevel(o),level:o}},fromProsemirror(t,n){let r=t.level;if(n.includes(r))return{fullName:esg.byLevel(r),level:r}}},esy=t=>esh.extend({name:esm,addAttributes:()=>({level:{default:t[0]},label:{default:null}}),addOptions:()=>({levels:[...t],HTMLAttributes:{}}),parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`}))},renderHTML({node:t,HTMLAttributes:n}){let r=t.attrs.level,i={...t.attrs.label?{label:t.attrs.label}:{}};return[`h${r}`,eep(this.options.HTMLAttributes,n,i),0]}}),esv=t=>{let n=t[0]??1;return{fromPrismic:r=>function(i){var o;let a=euJ.converter.fromPrismic(r)(esm,i),u=esg.fromPrismic(i.type,t)||esg.default(n);return null==(o=r.nodes[esm])?void 0:o.create({level:u.level,...eu2.fromPrismic(i)},a)},toPrismic(r){let{fullName:i}=esg.fromProsemirror(r.attrs,t)||esg.default(n);return euJ.converter.toPrismic(r,i,eu2.toPrismic(r))}}},esb={name:esm,build(t){var n;let r=t?t.size?Array.from(t.values()).reduce((t,n)=>{let r=esg.fromPrismic(n);return r?[...t,r.level]:t},[]).sort((t,n)=>t-n):[]:[1,2,3,4,5,6];if(!r)return;let i=r.map(t=>esg.byLevel(t));return new eoq(i,esy(r),r,esv(r),t=>{let n=esg.fromProsemirror(t,r);return n&&`Heading ${n.level}`})}};function esx(t){let{node:n}=t,r=n.attrs.content,{selected:i}=esl(t),a={width:null==r?void 0:r.width,height:null==r?void 0:r.height,name:eia},{onMediaSelected:s,onCropperDialogClose:c,isUpdating:l,updateContent:f,onClear:d}=function(t){let{content:n,thumbnail:r,imageViewProps:{getPos:i,updateAttributes:a,editor:u,node:s}}=t,[c,l]=(0,o.useTransition)();function f(t){l(()=>a({content:t}))}return{onMediaSelected:function(t){let r=eiH(t),o=i()+s.nodeSize;f({__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=eiU({content:n,thumbnail:r.name,croppedImage:i});o!==n&&f(o)},isUpdating:c,updateContent:f,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:eiu(a,r,r)};return C.jsx(erQ,{className:"custom-image",children:C.jsx("div",{contentEditable:"false",suppressContentEditableWarning:!0,children:C.jsx(eiK,{content:r,selected:i,fieldLabel:"Feature image",imageLabel:h,initialImages:[g],readOnly:!1,onMediaSelected:s,onCropperDialogClose:c,onClear:d,children:C.jsx(o.Suspense,{fallback:es_,children:null!=r&&r.url?C.jsxs(u.aY,{children:[C.jsx(u.hM,{children:C.jsx(u.xu,{flexDirection:"column",alignItems:"center",position:"relative",height:400,children:C.jsx(u.xu,{justifyContent:"center",flexGrow:1,maxHeight:"100%",maxWidth:"100%",children:C.jsx(u.kg,{src:eil(r.url),alt:m,sizing:"contain"})})})}),C.jsx(eiF,{onValueChange(t){f({...r,alt:t})},altText:m,readOnly:!r,selected:i})]}):C.jsx(eiD,{isUpdating:l,readOnly:!1,onMediaSelected:s})})})})})}let es_=C.jsx("div",{style:{height:468}}),esS=ene.create({name:"image",group:"block",atom:!0,addAttributes:()=>({content:{default:void 0}}),addCommands(){return{setImage:()=>t=>{let{dispatch:n,tr:r}=t,i=this.type.create();return n&&r.replaceSelectionWith(i),!0}}},parseHTML:()=>[{tag:"image"}],renderHTML:({HTMLAttributes:t})=>["image",eep(t)],addNodeView:()=>er1(esx)}),esT=new class{constructor(t,n,r,i){S(this,"extType","node"),S(this,"nodeType","image"),this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}([qu.RichTextNodeType.image],esS.name,esS,{fromPrismic:t=>function(n){var r;return null==(r=t.nodes[esS.name])?void 0:r.create({content:n.data})},toPrismic(t){if(void 0!==t.attrs.content)return{type:"image",data:{...t.attrs.content}}}}),esw=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,esO=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,esk=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,esI=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,esC=et7.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",eep(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[et9({find:esw,type:this.type}),et9({find:esk,type:this.type})]},addPasteRules(){return[enn({find:esO,type:this.type}),enn({find:esI,type:this.type})]}}),esM=esC.extend({name:"em"}),esR=new class{constructor(t,n,r){S(this,"extType",eoz.Mark),S(this,"richTextNodeTypes",qu.RichTextNodeType.em),this.name=t,this.component=n,this.converter=r}}(esM.name,esM,{fromPrismic:t=>function(){var n;return null==(n=t.marks[esM.name])?void 0:n.create()},toPrismic(){}}),esE=esR,esj=et7.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",eep(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=esA(eol({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()}}}),esN=new class{constructor(t,n,r){S(this,"extType",eoz.Mark),S(this,"richTextNodeTypes",qu.RichTextNodeType.hyperlink),this.name=t,this.component=n,this.converter=r}}(esj.name,esj,{fromPrismic:t=>function(n){var r,i,o,a;let u=n.data;if("DocumentLink"===u.__TYPE__){let s={type:esj.name,id:u.id};return null==(r=t.marks[esj.name])?void 0:r.create(s)}if("ImageLink"===u.__TYPE__){let c={type:esj.name,media:esA(u)};return null==(i=t.marks[esj.name])?void 0:i.create(c)}if("FileLink"===u.__TYPE__){let l={type:esj.name,media:esA(u)};return null==(o=t.marks[esj.name])?void 0:o.create(l)}if("ExternalLink"===u.__TYPE__){let f={type:esj.name,url:u.url,href:u.url,target:u.target};return null==(a=t.marks[esj.name])?void 0:a.create(f)}},toPrismic:t=>t.attrs.media?esP(t.attrs.media):t.attrs.id?{__TYPE__:"DocumentLink",id:t.attrs.id}:{__TYPE__:"ExternalLink",url:t.attrs.href,target:t.attrs.target}});function esA(t){return JSON.stringify(t)}function esP(t){return JSON.parse(t)}let esL=ene.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",eep(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)}}}),esD=et7.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",eep(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:n})=>{let r=etO(t,this.type);return!!Object.entries(r).some(([,t])=>!!t)||n.unsetMark(this.name)}}}}),esF=/^(\d+)\.\s$/,esW=ene.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:t}){let{start:n,...r}=t;return 1===n?["ol",eep(this.options.HTMLAttributes,r),0]:["ol",eep(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(esL.name,this.editor.getAttributes(esD.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=et8({find:esF,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=et8({find:esF,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(esD.name)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[t]}}),esU=esW.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",eep(this.options.HTMLAttributes,r),0]:["ol",eep(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"}),esz=new eoK([qu.RichTextNodeType.orderedList],esU.name,esU,{fromPrismic:t=>function(n){var r;let i=eo9.converter.fromPrismic(t)(n);if(i)return null==(r=t.nodes[esU.name])?void 0:r.create(eu2.fromPrismic(n),i)},toPrismic:t=>eoG.children.map(t,t=>eo9.converter.toPrismic(t,qu.RichTextNodeType.orderedList).filter(l.$)).flat()}),esB=esz,esV=[eoQ,esE,esN];function es$(t){return[eu5,esi,esB,esb.build(t),esc,esp,esT,...esV].filter(l.$)}let esq=[{nodeType:qu.RichTextNodeType.paragraph,icon:"textFields",isActive:t=>t.isActive(eu5.name)&&!t.isActive(esi.name)&&!t.isActive(esB.name),runCommands:esZ((t,n)=>t.clearNodes().setDirection(esG(n))),shortText:"par",text:"Paragraph"},{nodeType:qu.RichTextNodeType.heading1,icon:"looks1",isActive:t=>t.isActive(esb.name,{level:1}),runCommands:esZ((t,n)=>t.setHeading({level:1}).setDirection(esG(n))),shortText:"h1",text:"Heading 1"},{nodeType:qu.RichTextNodeType.heading2,icon:"looks2",isActive:t=>t.isActive(esb.name,{level:2}),runCommands:esZ((t,n)=>t.setHeading({level:2}).setDirection(esG(n))),shortText:"h2",text:"Heading 2"},{nodeType:qu.RichTextNodeType.heading3,icon:"looks3",isActive:t=>t.isActive(esb.name,{level:3}),runCommands:esZ((t,n)=>t.setHeading({level:3}).setDirection(esG(n))),shortText:"h3",text:"Heading 3"},{nodeType:qu.RichTextNodeType.heading4,icon:"looks4",isActive:t=>t.isActive(esb.name,{level:4}),runCommands:esZ((t,n)=>t.setHeading({level:4}).setDirection(esG(n))),shortText:"h4",text:"Heading 4"},{nodeType:qu.RichTextNodeType.heading5,icon:"looks5",isActive:t=>t.isActive(esb.name,{level:5}),runCommands:esZ((t,n)=>t.setHeading({level:5}).setDirection(esG(n))),shortText:"h5",text:"Heading 5"},{nodeType:qu.RichTextNodeType.heading6,icon:"looks6",isActive:t=>t.isActive(esb.name,{level:6}),runCommands:esZ((t,n)=>t.setHeading({level:6}).setDirection(esG(n))),shortText:"h6",text:"Heading 6"},{nodeType:qu.RichTextNodeType.list,icon:"formatListBulleted",isActive:t=>t.isActive(esi.name),runCommands:esZ((t,n)=>t.toggleBulletList().setDirection(esG(n))),shortText:"bull",text:"Bulleted list"},{nodeType:qu.RichTextNodeType.orderedList,icon:"formatListNumbered",isActive:t=>t.isActive(esB.name),runCommands:esZ((t,n)=>t.toggleOrderedList().setDirection(esG(n))),shortText:"num",text:"Numbered list"},{nodeType:qu.RichTextNodeType.preformatted,icon:"dataObject",isActive:t=>t.isActive(esc.name),runCommands:esZ((t,n)=>t.setCodeBlock().setDirection(esG(n))),shortText:"code",text:"Code"},{nodeType:qu.RichTextNodeType.embed,icon:"cloud",isActive:t=>t.isActive(esp.name),runCommands:esZ(t=>t.setEmbed()),shortText:"emb",text:"Embed"},{nodeType:qu.RichTextNodeType.image,icon:"image",isActive:t=>t.isActive(esT.name),runCommands:esZ(t=>t.setImage()),shortText:"img",text:"Image"}],esK=[{nodeType:qu.RichTextNodeType.strong,icon:"formatBold",isActive:t=>t.isActive(eoQ.name),runCommands:esZ(t=>t.toggleBold())},{nodeType:qu.RichTextNodeType.em,icon:"formatItalic",isActive:t=>t.isActive(esE.name),runCommands:esZ(t=>t.toggleItalic())}],esH=[{nodeType:qu.RichTextNodeType.rtl,icon:"formatTextDirectionRToL",isActive:t=>t.isActive({dir:euX.RightToLeft}),runCommands:esZ((t,n)=>t.toggleDirection(esG(n)))}];function esZ(t){return(n,r={})=>{let i=!0===r.can?n.can().chain():n.chain().focus();return void 0!==r.deleteRange&&(i=i.deleteRange(r.deleteRange)),t(i,n).run()}}function esG(t){let n=t.state.selection.$from.parent.attrs;return eu2.parseNodeAttrsDirection(n)}function esY(t,n){return t.filter(t=>n.includes(t.nodeType))}function esJ(t){let{items:n,editor:r}=t;return 0===n.length?null:C.jsxs(C.Fragment,{children:[C.jsx(u.Jf,{}),n.map(t=>C.jsx(u.r8,{disabled:!t.runCommands(r,{can:!0}),onPressedChange(){t.runCommands(r)},pressed:t.isActive(r),startIcon:t.icon},t.nodeType))]})}function esQ(t){let{bubbleMenuContainerRef:n}=t,{disabled:r,showWebLinkModal:i,showDocumentsLinkModal:o,showMediaLinkModal:a}=function(t){let{editor:n,setModal:r}=t;return{disabled:!esZ(t=>t.setWebLink({href:""}))(n,{can:!0}),showWebLinkModal:function(){r("webLink")},showDocumentsLinkModal:function(){r("documentLink")},showMediaLinkModal:function(){r("mediaLink")}}}(t);return C.jsxs(C.Fragment,{children:[C.jsx(u.Jf,{}),C.jsxs(u.yM,{density:"compact",children:[C.jsx(u.hA,{disabled:r,startIcon:"link",onClick:i},qu.RichTextNodeType.hyperlink),C.jsxs(u.h_,{children:[C.jsx(u.$F,{children:C.jsx(u.hA,{startIcon:"arrowDropDown"})}),C.jsxs(u.AW,{align:"end",containerRef:n,children:[C.jsx(u.Xi,{startIcon:C.jsx(u.I5,{name:"public"}),onSelect:i,children:"Link to web page"}),C.jsx(u.Xi,{startIcon:C.jsx(u.I5,{name:"description"}),onSelect:o,children:"Link to document"}),C.jsx(u.Xi,{startIcon:C.jsx(u.I5,{name:"image"}),onSelect:a,children:"Link to media"})]})]})]})]})}function esX(t){let{docId:n,onEdit:r,onUnlink:i}=t,o=function(t){let n=tI();n.searchDocuments||tM("searchDocuments");let{coreApiUrl:r,env:i}=n;return(0,d.QT)(g.EK,[r,i,t])}(n),a=tI();if(!o)return null;let s=o.versions[0],c=(0,m.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}),l=(null==s?void 0:s.preview_summary)??"",f=(null==s?void 0:s.custom_type_label)??"";return C.jsx(u.oZ,{url:c,title:o.title,subTitle:f,description:l,onEdit:r,onUnlink:i,largeIconName:"description"})}function es0(t){let{editor:n}=t,{searchDocuments:r}=tI(),i=n.getAttributes(qu.RichTextNodeType.hyperlink);if(i.id&&r){let o=i.id;return C.jsx(es1,{docId:o,...t})}if(i.href){let a=i.href;return C.jsx(es2,{url:a,...t})}if(i.media){let u=esP(i.media);return C.jsx(es3,{media:u,...t})}return null}function es1(t){let{editor:n,onEditDocumentLink:r,docId:i}=t;return C.jsx(u.SV,{renderError:()=>C.jsx(u.oZ,{url:"",title:"Failed to Load Linked Document Data",subTitle:"",error:!0,onEdit:r,onUnlink:()=>es4(n)}),children:C.jsx(o.Suspense,{fallback:C.jsx(u.oZ,{url:"",title:"",subTitle:"",loading:!0,onEdit:r,onUnlink:()=>es4(n)}),children:C.jsx(esX,{docId:i,onEdit:r,onUnlink:()=>es4(n)})})})}function es2(t){let{url:n,editor:r,onEditWebLink:i}=t,o=(0,p.ju)(n);return o?C.jsx(u.oZ,{url:n,title:(0,p.S$)(o),subTitle:n,onEdit:i,onUnlink:()=>es4(r)}):C.jsx(u.oZ,{url:n,title:"",subTitle:n,onEdit:i,onUnlink:()=>es4(r)})}function es3(t){let{media:n,editor:r,onEditMediaLink:i}=t;return"ImageLink"===n.__TYPE__?C.jsx(u.Qi,{url:n.url,title:n.name,subTitle:`${n.width} x ${n.height} pixels`,onEdit:i,onUnlink:()=>es4(r)}):"FileLink"===n.__TYPE__?C.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:()=>es4(r),largeIconName:"insertDriveFile"}):null}function es4(t){esZ(t=>t.unsetLink())(t)}function es5(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){esZ(n=>n.extendMarkRange(qu.RichTextNodeType.hyperlink).setDocumentLink({id:t}))(n),r(!1)},onOpenChange:i}}(t);return C.jsx(eoe,{open:n,onOpenChange:r,onSelectDocument:i})}function es9(t){let{open:n}=t,{onOpenChange:r,onSelectMedia:i}=function(t){let{editor:n,setOpen:r}=t;return{onSelectMedia:function(t){esZ(n=>n.extendMarkRange(qu.RichTextNodeType.hyperlink).setMediaLink({media:t}))(n),r(!1)},onOpenChange:r}}(t);return eio()?C.jsx(eii,{open:n,onOpenChange:r}):C.jsx(eiP,{open:n,onOpenChange:r,onMediaSelected:i})}function es6(t){let{open:n}=t,{url:r,setUrl:i,onOpenChange:a,onKeyDown:s,openInNewTab:c,setOpenInNewTab:l,onSetUrl:f,selectionUrl:d,selectionUrlTitle:h}=function(t){var n;let{editor:r,setOpen:i}=t,[a,u]=(0,o.useState)(""),[s,c]=(0,o.useState)(!1),l=function(t){let n=t.getAttributes(qu.RichTextNodeType.hyperlink);return n.href?n.href:void 0}(r),f=(n=r,"_blank"===n.getAttributes(qu.RichTextNodeType.hyperlink).target);(0,o.useEffect)(()=>{u(l??"")},[l]),(0,o.useEffect)(()=>{c(f??!1)},[f]);let d=l?(0,p.ju)(l):void 0,h=d?(0,p.S$)(d):"";function m(t){let n=s?"_blank":"_self";esZ(r=>r.extendMarkRange(qu.RichTextNodeType.hyperlink).setWebLink({href:t,target:n}))(r),i(!1)}return{url:a,setUrl:u,onSetUrl:m,selectionUrl:l,selectionUrlTitle:h,openInNewTab:s,selectionOpenInNewTab:f,setOpenInNewTab:c,onKeyDown:function(t){"Enter"===t.key&&m(a)},onOpenChange:function(t){u(""),c(!1),i(t)}}}(t);return C.jsx(u.Vq,{open:n,onOpenChange:a,hasClose:!1,size:"small",children:C.jsx(u.cZ,{children:C.jsxs(u.xu,{flexDirection:"column",children:[C.jsxs(u.xu,{flexDirection:"column",height:"100%",padding:16,gap:4,children:[C.jsx(u.yt,{value:r,onValueChange:i,placeholder:"Paste URL",icon:"public",onKeyDown:s}),d&&C.jsxs(u.xu,{flexDirection:"column",padding:{top:8},gap:4,children:[C.jsx(u.xv,{variant:"smallBold",color:"grey11",children:"Linked to"}),C.jsxs(u.xu,{backgroundColor:"grey4",borderRadius:6,padding:8,alignItems:"center",gap:8,children:[C.jsx(u.pI,{largeIconName:"public",smallIconName:"link"}),C.jsxs(u.xu,{flexDirection:"column",children:[C.jsx(u.xv,{variant:"bold",color:"grey12",children:h}),C.jsx(u.xv,{color:"grey11",variant:"small",children:"Web page"})]})]})]})]}),r&&C.jsxs(u.xu,{flexDirection:"column",padding:{block:8},border:{top:!0},children:[C.jsx(u.UN,{onSelect:()=>l(!c),icon:c?"checkBox":"checkBoxOutlinedBlank",textContent:"Open in new tab"}),C.jsx(u.UN,{onSelect:()=>f(r),icon:"link",textContent:"Link to URL"})]})]})})})}function es8(t){let{items:n,editor:r}=t;return 0===n.length?null:C.jsxs(C.Fragment,{children:[C.jsx(u.Jf,{}),C.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=>C.jsx(u.nG,{disabled:!t.runCommands(r,{can:!0}),startIcon:t.icon,value:t.nodeType},t.nodeType))},"mark")]})}function es7(t){var n;let{items:r,editor:i}=t;return 0===r.length?null:C.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=>C.jsx(u.KG,{value:t.nodeType,children:t.text},t.nodeType))})}let ece={duration:100,hideOnClick:!0,offset:[-48,parseFloat(u.TV.space[8])],placement:"top-start",zIndex:parseFloat(u.TV.zIndex.toolbar)};function ect(t){let{editor:n,nodeTypes:r}=t,[i,a]=(0,o.useState)(),u=r.includes(qu.RichTextNodeType.hyperlink),s=!i,{shouldShowBubbleMenu:c,shouldShowLinkPopover:l}=function(t){let{editor:n}=t;return{shouldShowBubbleMenu:function(t){let{view:r,state:i,from:o,to:a}=t;if(!r.hasFocus())return!1;let{doc:u,selection:s}=i;return!(n.isActive(qu.RichTextNodeType.preformatted)||s.empty||0===u.textBetween(o,a).length)},shouldShowLinkPopover:function(t){let{view:n,state:r,from:i,to:o}=t,a=n.state.doc.nodeAt(i),{doc:u,selection:s}=r;return!!s.empty&&!(u.textBetween(i,o).length>0)&&!!(null!=a&&a.marks.some(t=>"hyperlink"===t.type.name))}}}({editor:n}),f=(0,o.useRef)(null);return C.jsxs(C.Fragment,{children:[C.jsx(erq,{editor:n,tippyOptions:ece,shouldShow:c,children:s&&C.jsx("div",{ref:f,children:C.jsx(ecn,{...t,bubbleMenuContainerRef:f,setModal:a})})}),C.jsx(erq,{editor:n,tippyOptions:ece,shouldShow:l,children:s&&C.jsx(es0,{editor:n,onEditWebLink:()=>a("webLink"),onEditDocumentLink:()=>a("documentLink"),onEditMediaLink:()=>a("mediaLink")})}),u&&C.jsxs(C.Fragment,{children:[C.jsx(es6,{open:"webLink"===i,setOpen:function(t){a(t?"webLink":void 0)},editor:n}),C.jsx(es5,{open:"documentLink"===i,setOpen:function(t){a(t?"documentLink":void 0)},editor:n}),C.jsx(es9,{open:"mediaLink"===i,setOpen:function(t){a(t?"mediaLink":void 0)},editor:n})]})]})}function ecn(t){let{editor:n,nodeTypes:r}=t,i=r.includes("hyperlink"),o=esY(esq,r),a=esY(esK,r),s=esY(esH,r),c=o.length+a.length+s.length+Number(i);return 0===c?null:C.jsxs(u.o8,{children:[C.jsx(es7,{items:o,editor:n}),C.jsx(es8,{items:a,editor:n}),i&&C.jsx(esQ,{...t}),C.jsx(esJ,{items:s,editor:n}),c>1&&C.jsxs(C.Fragment,{children:[C.jsx(u.Jf,{}),C.jsx(u.hA,{onClick(){n.chain().focus().clearNodes().unsetAllMarks().run()},startIcon:"formatClear"},"clear")]})]})}function ecr(t){var n,r;let{content:i,field:a,id:c,readOnly:f}=t,d=(r=a,(0,o.useMemo)(()=>{let{extensions:t,defaultTextConverter:n}=function(t){var n;if(!t||!(null!=t&&t.single)&&!(null!=t&&t.multi))return eoY();let r=function(t){let n=(t.single||t.multi||"").split(/\s*,\s*/).map(t=>{let n=qu.RichTextNodeTypeCodec.decode(t);return"Right"===n._tag?n.right:void 0}).filter(l.$);return new Set(n)}(t);if(!(null!=r&&r.size))return eoY();let i=(n=r,es$(n).filter(t=>(0,y.G)(n,n=>t.richTextNodeTypes.includes(n)))),o=function(t){let n=new Set(t);return(0,y.G)(n,eoH)&&n.add(eu5),(0,y.G)(n,eo$)||n.add(eu5),[...n]}(i);return{extensions:o,defaultTextConverter:function(t){let n=t.find(eo$)??eu5;return function(t){return r=>n.converter.fromPrismic(t)({...r,type:n.richTextNodeTypes[0]??"heading1"})}}(o)}}(r.config),i=t.filter(eci),o=t.flatMap(t=>t.richTextNodeTypes),a=t.map(t=>t.component),u=t.filter(eco).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===eoB.Text&&(t[n.name]=n.placeholder),t),{})),unfocusedPlaceholder:null==(r=t.config)?void 0:r.placeholder,nodeExtensions:n},s=a.includes(qu.RichTextNodeType.orderedList)||a.includes(qu.RichTextNodeType.list);return[eae.component((null==(i=t.config)?void 0:i.single)===void 0),euJ.component,eao.component,eau(u),s?eo9.component:void 0,eu7.configure({nodeTypes:a})].filter(l.$)}(r,i),eu1.configure({supportedExtensionNames:u}),eoN],c=s.map(t=>t.name),f=function(t,n){let r=eeM.resolve(t);return eeb(r,void 0)}(s);return{allComponents:s,extensionNames:c,defaultTextConverter:n,nodeExtensions:i,names:o,schema:f}},[r])),p=i&&eae.converter(d.nodeExtensions).fromPrismic(d.schema,null==(n=d.defaultTextConverter)?void 0:n.call(d,d.schema))(i),h=(0,s.R9)(t.onContentChange),m=function(t={},n=[]){let{onUpdate:r}=t,[i,a]=(0,o.useState)(),u=(0,o.useRef)(r),c=(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 erK(t);return er2(()=>a(r)),r.on("transaction",()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{n&&c()})})}),()=>{n=!1}},n),(0,o.useEffect)(()=>()=>{er2(()=>null==i?void 0:i.destroy())},[i]),i}({content:null==p?void 0:p.toJSON(),editable:!f,editorProps:{attributes:{class:u.rk,id:c,tabIndex:"0"}},extensions:d.allComponents,injectCSS:!1,onUpdate({editor:t}){if(t.isEmpty)return h(void 0);let n=eae.converter(d.nodeExtensions).toPrismic(t.state.doc);h(n)}},[d,f]);return C.jsxs(u.gN,{children:[C.jsx(u.Qy,{htmlFor:c,children:Gl(a)}),C.jsxs(u.JO,{children:[C.jsx(erG,{editor:m??null,style:{flex:1}}),(null==m?void 0:m.isEditable)&&C.jsx(ect,{editor:m,nodeTypes:d.names.concat(eu0)})]})]})}function eci(t){return t.extType===eoz.Node}function eco(t){return!(t.extType!==eoz.Node||t.nodeType!==eoB.Text||t.lockedFormat)}function eca(t){var n,r,i,o,a;let{content:s,field:c,id:l,onContentChange:f,readOnly:d}=t,p=Gf(c),h=(i=c,(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 C.jsxs(u.gN,{children:[C.jsx(u.fw,{name:"arrowDropDownCircle"}),C.jsx(u.Qy,{htmlFor:l,children:Gl(c)}),C.jsx(u.JO,{children:C.jsx(u.Ph,{id:l,size:"large",endIcon:"unfoldMore",variant:"secondary",placeholder:p,value:m,onValueChange(t){var n;d||f((n=t,0===n.length?void 0:{__TYPE__:"FieldContent",type:"Select",value:n}))},children:null==(r=null==(n=c.config)?void 0:n.options)?void 0:r.map(t=>C.jsx(u.Ql,{value:t,children:t},t))})})]})}function ecu(t){let{id:n,readOnly:r,field:i,content:o,onContentChange:a}=t,s=null!=o&&o.value?(0,c._O)(o.value):void 0;return C.jsxs(u.gN,{children:[C.jsx(u.fw,{name:"event"}),C.jsx(u.Qy,{id:n,children:Gl(i)}),C.jsx(u.JO,{children:C.jsx(u.xu,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:C.jsx(u.Wr,{mode:"date-time","aria-labelledby":n,readOnly: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 ecs(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?C.jsx(Gd,{...t,field:a,content:nl.isBooleanContent(i)?i:void 0}):"Date"===a.type?C.jsx(Gh,{...t,field:a,content:nl.isDateContent(i)?i:void 0}):"Timestamp"===a.type?C.jsx(ecu,{...t,field:a,content:nl.isTimestampContent(i)?i:void 0}):"Image"===a.type?C.jsx(eiZ,{...t,field:a,content:nl.isImageContent(i)?i:void 0}):"Link"===a.type?C.jsx(eof,{...t,field:a,content:nl.isLinkContent(i)?i:void 0}):"Number"===a.type?C.jsx(eom,{...t,field:a,content:nl.isNumberContent(i)?i:void 0}):"StructuredText"===a.type?C.jsx(ecr,{...t,field:a,content:nl.isRichTextContent(i)?i:void 0}):"Select"===a.type?C.jsx(eca,{...t,field:a,content:nl.isSelectContent(i)?i:void 0}):"Text"===a.type?C.jsx(eiY,{...t,field:a,content:nl.isTextContent(i)?i:void 0}):"Embed"===a.type?C.jsx(er8,{...t,field:a,content:nl.isEmbedContent(i)?i:void 0}):"Color"===a.type?C.jsx(Gp,{...t,field:a,content:nl.isColorContent(i)?i:void 0}):"GeoPoint"===a.type?C.jsx(eir,{...t,field:a,content:nl.isGeoPointContent(i)?i:void 0}):null},[i,n,a,u,r])}function ecc(t){let{content:n,id:r,nonRepeatableZone:i,onContentChange:u,readOnly:s}=t,c=(0,o.useMemo)(()=>Object.entries(i),[i]);return C.jsx(C.Fragment,{children:c.map(([t,i])=>{let o=n[t];return C.jsx(ecs,{id:`${r}.${t}`,readOnly:s,nestableWidget:i,content:nl.isNestableContent(o)?o:void 0,onContentChange(r){var i,o,s;u((i=n,o=t,s=r,void 0===s?(0,a.ud)(i,o):{...i,[o]:s}))}},t)})})}function ecl(t){let{id:n,title:r,content:i,onContentChange:a,readOnly:s,repeatableZone:c}=t,l=(0,o.useMemo)(()=>Object.entries(c),[c]),f=i??[ecf],d=(0,o.useRef)(new Map);function p(t){return d.current.get(t)??"!bugged!"}function m(t){let{index:n,offset:r}=t;a((0,h.pB)(f,n,n+r))}function g(t){let{index:n}=t;a((0,h.$E)(f,n))}return!function(t,n){let r=new Set(n);n.forEach(n=>{t.has(n)||t.set(n,(0,b.d)())}),(0,o.useLayoutEffect)(()=>{for(let[n]of t)r.has(n)||t.delete(n)})}(d.current,f),0===Object.keys(c).length?null:C.jsx(u.ZA,{title:"Repeatable zone"+(r?` • ${r}`:""),addItemButtonTitle:"Add item in group",items:f,getItemKey:p,onAddItem:function(){a(f.concat(ecd()))},children(t,r){let i=new Map(t.value),o=p(t);return C.jsx(u.MN,{index:r,title:"Item",onMove:m,onDelete:g,children:l.map(([u,c])=>{let l=i.get(u),p=nl.isNestableContent(l)?l:void 0;return C.jsx(ecs,{id:`${n}[${o}].${u}`,content:p,nestableWidget:c,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 ecd(o)}let a=Array.from(new Map(t.value).set(r,i));return ecd(a)}(t,[r,i]),u=function(t,n){let[r,i]=n;return i?t.map((t,n)=>n===r?i:t):t.filter((t,n)=>n!==r)}(f,[n,o]);(function(t,n,r){let i=t.get(n);void 0!==i&&t.set(r,i)})(d.current,t,o),a(u)})(t,r,u,n),readOnly:s},u)})})}})}let ecf={__TYPE__:"GroupItemContent",value:[]};function ecd(t=[]){return{__TYPE__:"GroupItemContent",value:t}}function ecp(t){var n,r,i,a;let{config:s,content:c,sliceKey:l,readOnly:f=!1,sharedSlice:d,onContentChange:p,...h}=t,m=(n=d,r=c.variation,(0,o.useMemo)(()=>n.variations.find(t=>t.id===r),[n,r])),g=(0,o.useId)(),y={id:h.id??g,readOnly:f},{selected:v,selectionId:b,selection:x}=function(t){let{sliceKey:n}=t||{},r=(0,o.useContext)(Gc),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:l}),_=()=>{l&&x.update("sliceFieldSet",l)};return void 0===m?null:C.jsx(tk.Provider,{value:s,children:C.jsxs(u.C3,{id:b,selected:v,onFocus:_,children:[C.jsx(u.ax,{children:(i=d,a=m,[i.name,a.name].join(" • "))}),C.jsxs(u.En,{heightEstimate:400,box:{gap:u.jM},children:[C.jsx(ecc,{...y,nonRepeatableZone:m.primary??{},content:c.primary,onContentChange(t){p({...c,primary:t})}}),C.jsx(ecl,{...y,repeatableZone:m.items??{},content:c.items,onContentChange(t){p({...c,items:t})}})]})]})})}(0,o.createContext)({isDirty:!1,markDirty(){}})}}]);