slice-machine-ui 1.22.3-beta.1 → 1.22.3-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/DeleteVariationModal/index.tsx +12 -11
- package/components/Forms/CreateSliceModal/CreateSliceModal.tsx +2 -5
- package/components/Forms/RenameCustomTypeModal/RenameCustomTypeModal.tsx +9 -5
- package/components/Forms/RenameVariationModal/RenameVariationModal.tsx +12 -11
- package/components/ItemHeader/index.tsx +1 -0
- package/components/ListItem/index.tsx +5 -2
- package/components/ScreenshotChangesModal/VariationDropZone.tsx +31 -9
- package/components/ScreenshotChangesModal/index.tsx +3 -0
- package/components/ScreenshotChangesModal/useCustomScreenshot.tsx +5 -5
- package/components/Simulator/index.tsx +9 -3
- package/lib/builders/CustomTypeBuilder/SliceZone/SlicesTemplatesModal.tsx +2 -2
- package/lib/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModal.tsx +2 -2
- package/lib/builders/CustomTypeBuilder/SliceZone/index.tsx +12 -20
- package/lib/builders/CustomTypeBuilder/TabModal/update.tsx +3 -1
- package/lib/builders/CustomTypeBuilder/TabZone/index.tsx +119 -52
- package/lib/builders/CustomTypeBuilder/index.tsx +39 -42
- package/lib/builders/SliceBuilder/FieldZones/index.tsx +81 -56
- package/lib/builders/SliceBuilder/Sidebar/AddVariationModal.tsx +24 -16
- package/lib/builders/SliceBuilder/Sidebar/index.tsx +44 -46
- package/lib/builders/SliceBuilder/SimulatorButton/index.tsx +4 -28
- package/lib/builders/SliceBuilder/index.tsx +10 -96
- package/lib/builders/common/Zone/Card/components/Hints/CodeBlock.tsx +5 -1
- package/lib/builders/common/Zone/Card/components/NewField.tsx +16 -15
- package/lib/builders/common/Zone/Card/index.jsx +2 -0
- package/lib/builders/common/Zone/index.jsx +3 -1
- package/lib/models/common/ComponentUI.ts +0 -14
- package/lib/models/common/CustomType/sliceZone.ts +0 -29
- package/lib/models/common/CustomType/tab.ts +10 -142
- package/lib/models/common/widgets/Group/ListItem/index.jsx +61 -23
- package/out/404.html +1 -1
- package/out/_next/static/chunks/065a3ddb-9a38ca0d60f0bf2f.js +1 -0
- package/out/_next/static/chunks/183-4feb6bb3eddbc768.js +1 -0
- package/out/_next/static/chunks/18539003-7b2711e6c51d6fac.js +97 -0
- package/out/_next/static/chunks/1cc2734a-2c5b6c0367fcde86.js +1 -0
- package/out/_next/static/chunks/25-8fedd33ad9b6de5b.js +1 -0
- package/out/_next/static/chunks/318-541db69860d31138.js +1 -0
- package/out/_next/static/chunks/{505-3f1cf09a086dcba8.js → 376-0ed5822f8afcaa7c.js} +3 -3
- package/out/_next/static/chunks/4c744e84-e3161d754618373f.js +1 -0
- package/out/_next/static/chunks/50-cfc2514205b86001.js +1 -0
- package/out/_next/static/chunks/543-f8766685f7f451e2.js +1 -0
- package/out/_next/static/chunks/59b4e022-7a3b5554b806349f.js +1 -0
- package/out/_next/static/chunks/696-b12edad30a3617e5.js +31 -0
- package/out/_next/static/chunks/727-15cf3f2fea9a37e5.js +1 -0
- package/out/_next/static/chunks/731-501990ebe6a71b32.js +1 -0
- package/out/_next/static/chunks/787-727e3aef5d2a10a8.js +1 -0
- package/out/_next/static/chunks/904-ccd8ca3368ce29fc.js +1 -0
- package/out/_next/static/chunks/{918-38d08f1e885b222d.js → 918-5bb55fb464e34768.js} +1 -1
- package/out/_next/static/chunks/f36c6662-03bb5e9d9aa0b0aa.js +1 -0
- package/out/_next/static/chunks/pages/_app-20876abeebe0fda7.js +430 -0
- package/out/_next/static/chunks/pages/changelog-68d115a14f1423d7.js +1 -0
- package/out/_next/static/chunks/pages/changes-6f62ae7b6243a1c7.js +1 -0
- package/out/_next/static/chunks/pages/custom-types/{[customTypeId]-3a37eb3373bb8823.js → [customTypeId]-3f862ad6111a1fc0.js} +1 -1
- package/out/_next/static/chunks/pages/{custom-types-2f5664d9492b13fb.js → custom-types-94b8f8dbf7727412.js} +1 -1
- package/out/_next/static/chunks/pages/{index-d8e3a2c0d712904f.js → index-64cfb8b0948ba8ef.js} +1 -1
- package/out/_next/static/chunks/pages/page-types/{[pageTypeId]-733f3890c0466a05.js → [pageTypeId]-d1ffca11c42f2603.js} +1 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-897ca93c114a1435.js +1 -0
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-e89e2e6f772a3454.js +1 -0
- package/out/_next/static/chunks/pages/slices-9628f8aa54968d6a.js +1 -0
- package/out/_next/static/css/{1bbf650dfd37ce69.css → 1aa04669758c24f4.css} +1 -1
- package/out/_next/static/j_voPTrYzsuLCERqtl3Hn/_buildManifest.js +1 -0
- package/out/changelog.html +1 -1
- package/out/changes.html +1 -1
- package/out/custom-types/[customTypeId].html +1 -1
- package/out/custom-types.html +1 -1
- package/out/index.html +1 -1
- package/out/labs.html +1 -1
- package/out/page-types/[pageTypeId].html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
- package/out/slices.html +1 -1
- package/package.json +6 -6
- package/pages/slices/[lib]/[sliceName]/[variation]/index.tsx +25 -11
- package/pages/slices/[lib]/[sliceName]/[variation]/simulator.tsx +12 -9
- package/src/apiClient.ts +7 -6
- package/src/components/CodeBlock/CodeBlock.tsx +1 -0
- package/src/components/Window/Window.tsx +7 -1
- package/src/domain/__tests__/customType.test.ts +785 -0
- package/src/domain/customType.ts +519 -6
- package/src/domain/slice.ts +166 -1
- package/src/features/autoSave/AutoSaveStatusIndicator.tsx +43 -0
- package/src/features/autoSave/useAutoSave.tsx +177 -0
- package/src/features/customTypes/EditDropdown.tsx +3 -0
- package/src/features/customTypes/actions/convertCustomToPageType.ts +2 -4
- package/src/features/customTypes/customTypesBuilder/CustomTypeProvider.tsx +90 -0
- package/src/features/customTypes/customTypesBuilder/CustomTypesBuilderPage.tsx +46 -79
- package/src/features/customTypes/customTypesMessages.ts +4 -0
- package/src/features/slices/actions/addSlicesToSliceZone.ts +2 -7
- package/src/features/slices/actions/uploadSliceScreenshot.ts +45 -0
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewVariationDialog.tsx +5 -5
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceButton.tsx +4 -10
- package/src/features/slices/sliceBuilder/SliceBuilderProvider.tsx +110 -0
- package/src/features/slices/sliceBuilder/actions/deleteVariation.ts +8 -24
- package/src/features/slices/sliceBuilder/actions/renameVariation.ts +8 -24
- package/src/features/slices/sliceCards/SharedSliceCard.tsx +1 -0
- package/src/hooks/useCurrentSlice.tsx +4 -16
- package/src/hooks/useScreenshotChangesModal.ts +1 -0
- package/src/hooks/useServerState.ts +1 -58
- package/src/modules/availableCustomTypes/index.ts +8 -3
- package/src/modules/simulator/index.ts +0 -2
- package/src/modules/slices/index.ts +32 -25
- package/src/modules/slices/selector.ts +30 -0
- package/src/modules/useSliceMachineActions.ts +20 -270
- package/src/redux/reducer.ts +0 -4
- package/src/redux/saga.ts +0 -6
- package/src/redux/type.ts +0 -4
- package/test/src/modules/availableCustomTypes/index.test.ts +8 -10
- package/test/src/modules/simulator.test.ts +0 -2
- package/lib/models/common/CustomType/group.ts +0 -80
- package/lib/models/common/Variation.ts +0 -100
- package/out/_next/static/ZrWICkLApT4ZATA_akn-2/_buildManifest.js +0 -1
- package/out/_next/static/chunks/18539003-4460ccbfe3109578.js +0 -97
- package/out/_next/static/chunks/482-34cee2a2071c235f.js +0 -1
- package/out/_next/static/chunks/550-c80fd46fb64d1eef.js +0 -1
- package/out/_next/static/chunks/80-7b8a97d0122ff74a.js +0 -1
- package/out/_next/static/chunks/840-163f8a1040e6820d.js +0 -1
- package/out/_next/static/chunks/904-519dbf0f7e8c6243.js +0 -1
- package/out/_next/static/chunks/958-8aca174b80cb0c35.js +0 -1
- package/out/_next/static/chunks/pages/_app-132564608e9a9502.js +0 -458
- package/out/_next/static/chunks/pages/changelog-4d0f2f1222e403fe.js +0 -1
- package/out/_next/static/chunks/pages/changes-52c9d917808d1461.js +0 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-7b17cb59d0db03b5.js +0 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-ef11594ce026b650.js +0 -1
- package/out/_next/static/chunks/pages/slices-884a936a9a062a65.js +0 -1
- package/src/domain/__tests__/CustomTypeModel.test.ts +0 -247
- package/src/layouts/WithSlice.tsx +0 -26
- package/src/modules/screenshots/actions.ts +0 -21
- package/src/modules/screenshots/sagas.ts +0 -70
- package/src/modules/selectedCustomType/actions.ts +0 -147
- package/src/modules/selectedCustomType/index.ts +0 -11
- package/src/modules/selectedCustomType/reducer.ts +0 -287
- package/src/modules/selectedCustomType/sagas.ts +0 -72
- package/src/modules/selectedCustomType/selectors.ts +0 -33
- package/src/modules/selectedCustomType/stateHelpers.ts +0 -42
- package/src/modules/selectedCustomType/types.ts +0 -9
- package/src/modules/selectedSlice/actions.ts +0 -106
- package/src/modules/selectedSlice/reducer.ts +0 -175
- package/src/modules/selectedSlice/sagas.ts +0 -72
- package/src/modules/selectedSlice/selectors.ts +0 -55
- package/src/modules/selectedSlice/types.ts +0 -3
- package/src/modules/toaster/utils.tsx +0 -23
- package/test/lib/models/common/CustomType/sliceZone.test.ts +0 -49
- package/test/pages/custom-types.test.tsx +0 -625
- package/test/src/modules/selectedCustomType/__fixtures__/model.json +0 -119
- package/test/src/modules/selectedCustomType/reducer.test.ts +0 -322
- package/test/src/modules/selectedCustomType/sagas.test.ts +0 -89
- package/test/src/modules/selectedCustomType/selectors.test.ts +0 -54
- package/test/src/modules/selectedSlice/__fixtures__/mocks.json +0 -171
- package/test/src/modules/selectedSlice/__fixtures__/model.json +0 -35
- package/test/src/modules/selectedSlice/__testutils__/getRefreshStateCreatorPayloadData.ts +0 -72
- package/test/src/modules/selectedSlice/__testutils__/getSelectedSliceDummyData.ts +0 -30
- package/test/src/modules/selectedSlice/reducer.test.ts +0 -170
- package/test/src/modules/selectedSlice/sagas.test.ts +0 -82
- package/test/src/modules/toaster/utils.test.ts +0 -50
- /package/out/_next/static/{ZrWICkLApT4ZATA_akn-2 → j_voPTrYzsuLCERqtl3Hn}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[851],{71463:function(t,n,r){r.d(n,{kS:function(){return ec_}});var i,o=r(2784),a=r(98863),u=r(22715),s=r(74217),c=r(50054),l=r(86579),d=r(1611),f=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,M=(t,n,r)=>n in t?x(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,T=(t,n,r)=>(M(t,"symbol"!=typeof n?n+"":n,r),r);let S={unclassified:{title:"Draft",color:"amber"},published:{title:"Live",color:"green"},release:{title:"Planned",color:"purple"},archived:{title:"Archived",color:"grey"}};var w="u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof r.g?r.g:"u">typeof self?self:{};function I(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,C={},N={get exports(){return C},set exports(e){C=e}},j={};(_=N).exports=function(){if(qN)return j;qN=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,d=null;for(s in void 0!==u&&(l=""+u),void 0!==o.key&&(l=""+o.key),void 0!==o.ref&&(d=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:d,props:c,_owner:i.current}}return j.Fragment=n,j.jsx=u,j.jsxs=u,j}(),(O=qj||(qj={})).assertEqual=t=>t,O.assertIs=function(t){},O.assertNever=function(t){throw Error()},O.arrayToEnum=t=>{let n={};for(let r of t)n[r]=r;return n},O.getValidEnumValues=t=>{let n=O.objectKeys(t).filter(n=>"number"!=typeof t[t[n]]),r={};for(let i of n)r[i]=t[i];return O.objectValues(r)},O.objectValues=t=>O.objectKeys(t).map(function(n){return t[n]}),O.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},O.find=(t,n)=>{for(let r of t)if(n(r))return r},O.isInteger="function"==typeof Number.isInteger?t=>Number.isInteger(t):t=>"number"==typeof t&&isFinite(t)&&Math.floor(t)===t,O.joinValues=function(t,n=" | "){return t.map(t=>"string"==typeof t?`'${t}'`:t).join(n)},O.jsonStringifyReplacer=(t,n)=>"bigint"==typeof n?n.toString():n,(k=qE||(qE={})).mergeShapes=(t,n)=>({...t,...n});let E=qj.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),R=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}},D=qj.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 L 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,qj.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()}}L.create=t=>new L(t);let P=(t,n)=>{let r;switch(t.code){case D.invalid_type:r=t.received===E.undefined?"Required":`Expected ${t.expected}, received ${t.received}`;break;case D.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,qj.jsonStringifyReplacer)}`;break;case D.unrecognized_keys:r=`Unrecognized key(s) in object: ${qj.joinValues(t.keys,", ")}`;break;case D.invalid_union:r="Invalid input";break;case D.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${qj.joinValues(t.options)}`;break;case D.invalid_enum_value:r=`Invalid enum value. Expected ${qj.joinValues(t.options)}, received '${t.received}'`;break;case D.invalid_arguments:r="Invalid function arguments";break;case D.invalid_return_type:r="Invalid function return type";break;case D.invalid_date:r="Invalid date";break;case D.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}"`:qj.assertNever(t.validation):r="regex"!==t.validation?`Invalid ${t.validation}`:"Invalid";break;case D.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 D.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 D.custom:r="Invalid input";break;case D.invalid_intersection_types:r="Intersection results could not be merged";break;case D.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case D.not_finite:r="Number must be finite";break;default:r=n.defaultError,qj.assertNever(t)}return{message:r}},F=P;function z(t){F=t}function U(){return F}let W=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 B(t,n){let r=W({issueData:n,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,F,P].filter(t=>!!t)});t.common.issues.push(r)}class V{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 $;"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 V.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 $;"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 $=Object.freeze({status:"aborted"}),K=t=>({status:"dirty",value:t}),Y=t=>({status:"valid",value:t}),q=t=>"aborted"===t.status,G=t=>"dirty"===t.status,Z=t=>"valid"===t.status,Q=t=>"u">typeof Promise&&t instanceof Promise;(t4=qR||(qR={})).errToObj=t=>"string"==typeof t?{message:t}:t||{},t4.toString=t=>"string"==typeof t?t:null==t?void 0:t.message;class H{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 L(t.common.issues);return this._error=r,this._error}}};function X(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 ee{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 R(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:R(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new V,ctx:{common:t.parent.common,data:t.data,parsedType:R(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(Q(n))throw Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;let i={common:{issues:[],async:null!==(r=null==n?void 0:n.async)&&void 0!==r&&r,contextualErrorMap:null==n?void 0:n.errorMap},path:(null==n?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:R(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:R(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await (Q(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:D.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 eW({schema:this,typeName:qD.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return eB.create(this,this._def)}nullable(){return eV.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ew.create(this,this._def)}promise(){return eU.create(this,this._def)}or(t){return e_.create([this,t],this._def)}and(t){return eC.create(this,t,this._def)}transform(t){return new eW({...X(this._def),schema:this,typeName:qD.ZodEffects,effect:{type:"transform",transform:t}})}default(t){return new e$({...X(this._def),innerType:this,defaultValue:"function"==typeof t?t:()=>t,typeName:qD.ZodDefault})}brand(){return new eG({typeName:qD.ZodBranded,type:this,...X(this._def)})}catch(t){return new eK({...X(this._def),innerType:this,catchValue:"function"==typeof t?t:()=>t,typeName:qD.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 et=/^c[^\s-]{8,}$/i,en=/^[a-z][a-z0-9]*$/,er=/[0-9A-HJKMNP-TV-Z]{26}/,ei=/^([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,eo=/^(([^<>()[\]\\.,;:\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,})+))$/,ea=/^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u,eu=/^(((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=/^(([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})))$/,ec=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 el(t,n){return!!(("v4"===n||!n)&&eu.test(t)||("v6"===n||!n)&&es.test(t))}class ed extends ee{constructor(){super(...arguments),this._regex=(t,n,r)=>this.refinement(n=>t.test(n),{validation:n,code:D.invalid_string,...qR.errToObj(r)}),this.nonempty=t=>this.min(1,qR.errToObj(t)),this.trim=()=>new ed({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new ed({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new ed({...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 B(n,{code:D.invalid_type,expected:E.string,received:n.parsedType}),$}let r=new V,i;for(let o of this._def.checks)if("min"===o.kind)t.data.length<o.value&&(B(i=this._getOrReturnCtx(t,i),{code:D.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&&(B(i=this._getOrReturnCtx(t,i),{code:D.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?B(i,{code:D.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):u&&B(i,{code:D.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if("email"===o.kind)eo.test(t.data)||(B(i=this._getOrReturnCtx(t,i),{validation:"email",code:D.invalid_string,message:o.message}),r.dirty());else if("emoji"===o.kind)ea.test(t.data)||(B(i=this._getOrReturnCtx(t,i),{validation:"emoji",code:D.invalid_string,message:o.message}),r.dirty());else if("uuid"===o.kind)ei.test(t.data)||(B(i=this._getOrReturnCtx(t,i),{validation:"uuid",code:D.invalid_string,message:o.message}),r.dirty());else if("cuid"===o.kind)et.test(t.data)||(B(i=this._getOrReturnCtx(t,i),{validation:"cuid",code:D.invalid_string,message:o.message}),r.dirty());else if("cuid2"===o.kind)en.test(t.data)||(B(i=this._getOrReturnCtx(t,i),{validation:"cuid2",code:D.invalid_string,message:o.message}),r.dirty());else if("ulid"===o.kind)er.test(t.data)||(B(i=this._getOrReturnCtx(t,i),{validation:"ulid",code:D.invalid_string,message:o.message}),r.dirty());else if("url"===o.kind)try{new URL(t.data)}catch{B(i=this._getOrReturnCtx(t,i),{validation:"url",code:D.invalid_string,message:o.message}),r.dirty()}else"regex"===o.kind?(o.regex.lastIndex=0,o.regex.test(t.data)||(B(i=this._getOrReturnCtx(t,i),{validation:"regex",code:D.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)||(B(i=this._getOrReturnCtx(t,i),{code:D.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)||(B(i=this._getOrReturnCtx(t,i),{code:D.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):"endsWith"===o.kind?t.data.endsWith(o.value)||(B(i=this._getOrReturnCtx(t,i),{code:D.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):"datetime"===o.kind?ec(o).test(t.data)||(B(i=this._getOrReturnCtx(t,i),{code:D.invalid_string,validation:"datetime",message:o.message}),r.dirty()):"ip"===o.kind?el(t.data,o.version)||(B(i=this._getOrReturnCtx(t,i),{validation:"ip",code:D.invalid_string,message:o.message}),r.dirty()):qj.assertNever(o);return{status:r.value,value:t.data}}_addCheck(t){return new ed({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...qR.errToObj(t)})}url(t){return this._addCheck({kind:"url",...qR.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...qR.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...qR.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...qR.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...qR.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...qR.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...qR.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,...qR.errToObj(null==t?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...qR.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:null==n?void 0:n.position,...qR.errToObj(null==n?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...qR.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...qR.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...qR.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...qR.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...qR.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)}ed.create=t=>{var n;return new ed({checks:[],typeName:qD.ZodString,coerce:null!==(n=null==t?void 0:t.coerce)&&void 0!==n&&n,...X(t)})};class ep extends ee{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 B(n,{code:D.invalid_type,expected:E.number,received:n.parsedType}),$}let r,i=new V;for(let o of this._def.checks)"int"===o.kind?qj.isInteger(t.data)||(B(r=this._getOrReturnCtx(t,r),{code:D.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):"min"===o.kind?(o.inclusive?t.data<o.value:t.data<=o.value)&&(B(r=this._getOrReturnCtx(t,r),{code:D.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)&&(B(r=this._getOrReturnCtx(t,r),{code:D.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)&&(B(r=this._getOrReturnCtx(t,r),{code:D.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):"finite"===o.kind?Number.isFinite(t.data)||(B(r=this._getOrReturnCtx(t,r),{code:D.not_finite,message:o.message}),i.dirty()):qj.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,qR.toString(n))}gt(t,n){return this.setLimit("min",t,!1,qR.toString(n))}lte(t,n){return this.setLimit("max",t,!0,qR.toString(n))}lt(t,n){return this.setLimit("max",t,!1,qR.toString(n))}setLimit(t,n,r,i){return new ep({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:qR.toString(i)}]})}_addCheck(t){return new ep({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:qR.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:qR.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:qR.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:qR.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:qR.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:qR.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:qR.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:qR.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:qR.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&&qj.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)}}ep.create=t=>new ep({checks:[],typeName:qD.ZodNumber,coerce:(null==t?void 0:t.coerce)||!1,...X(t)});class eh extends ee{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 B(n,{code:D.invalid_type,expected:E.bigint,received:n.parsedType}),$}let r,i=new V;for(let o of this._def.checks)"min"===o.kind?(o.inclusive?t.data<o.value:t.data<=o.value)&&(B(r=this._getOrReturnCtx(t,r),{code:D.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)&&(B(r=this._getOrReturnCtx(t,r),{code:D.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):"multipleOf"===o.kind?t.data%o.value!==BigInt(0)&&(B(r=this._getOrReturnCtx(t,r),{code:D.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):qj.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,qR.toString(n))}gt(t,n){return this.setLimit("min",t,!1,qR.toString(n))}lte(t,n){return this.setLimit("max",t,!0,qR.toString(n))}lt(t,n){return this.setLimit("max",t,!1,qR.toString(n))}setLimit(t,n,r,i){return new eh({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:qR.toString(i)}]})}_addCheck(t){return new eh({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:qR.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:qR.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:qR.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:qR.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:qR.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}}eh.create=t=>{var n;return new eh({checks:[],typeName:qD.ZodBigInt,coerce:null!==(n=null==t?void 0:t.coerce)&&void 0!==n&&n,...X(t)})};class em extends ee{_parse(t){if(this._def.coerce&&(t.data=Boolean(t.data)),this._getType(t)!==E.boolean){let n=this._getOrReturnCtx(t);return B(n,{code:D.invalid_type,expected:E.boolean,received:n.parsedType}),$}return Y(t.data)}}em.create=t=>new em({typeName:qD.ZodBoolean,coerce:(null==t?void 0:t.coerce)||!1,...X(t)});class eg extends ee{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==E.date){let n=this._getOrReturnCtx(t);return B(n,{code:D.invalid_type,expected:E.date,received:n.parsedType}),$}if(isNaN(t.data.getTime())){let r=this._getOrReturnCtx(t);return B(r,{code:D.invalid_date}),$}let i=new V,o;for(let a of this._def.checks)"min"===a.kind?t.data.getTime()<a.value&&(B(o=this._getOrReturnCtx(t,o),{code:D.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),i.dirty()):"max"===a.kind?t.data.getTime()>a.value&&(B(o=this._getOrReturnCtx(t,o),{code:D.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),i.dirty()):qj.assertNever(a);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new eg({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:qR.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:qR.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}}eg.create=t=>new eg({checks:[],coerce:(null==t?void 0:t.coerce)||!1,typeName:qD.ZodDate,...X(t)});class ey extends ee{_parse(t){if(this._getType(t)!==E.symbol){let n=this._getOrReturnCtx(t);return B(n,{code:D.invalid_type,expected:E.symbol,received:n.parsedType}),$}return Y(t.data)}}ey.create=t=>new ey({typeName:qD.ZodSymbol,...X(t)});class ev extends ee{_parse(t){if(this._getType(t)!==E.undefined){let n=this._getOrReturnCtx(t);return B(n,{code:D.invalid_type,expected:E.undefined,received:n.parsedType}),$}return Y(t.data)}}ev.create=t=>new ev({typeName:qD.ZodUndefined,...X(t)});class eb extends ee{_parse(t){if(this._getType(t)!==E.null){let n=this._getOrReturnCtx(t);return B(n,{code:D.invalid_type,expected:E.null,received:n.parsedType}),$}return Y(t.data)}}eb.create=t=>new eb({typeName:qD.ZodNull,...X(t)});class ex extends ee{constructor(){super(...arguments),this._any=!0}_parse(t){return Y(t.data)}}ex.create=t=>new ex({typeName:qD.ZodAny,...X(t)});class eM extends ee{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Y(t.data)}}eM.create=t=>new eM({typeName:qD.ZodUnknown,...X(t)});class eT extends ee{_parse(t){let n=this._getOrReturnCtx(t);return B(n,{code:D.invalid_type,expected:E.never,received:n.parsedType}),$}}eT.create=t=>new eT({typeName:qD.ZodNever,...X(t)});class eS extends ee{_parse(t){if(this._getType(t)!==E.undefined){let n=this._getOrReturnCtx(t);return B(n,{code:D.invalid_type,expected:E.void,received:n.parsedType}),$}return Y(t.data)}}eS.create=t=>new eS({typeName:qD.ZodVoid,...X(t)});class ew extends ee{_parse(t){let{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==E.array)return B(n,{code:D.invalid_type,expected:E.array,received:n.parsedType}),$;if(null!==i.exactLength){let o=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(o||a)&&(B(n,{code:o?D.too_big:D.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&&(B(n,{code:D.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&&(B(n,{code:D.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 H(n,t,n.path,r)))).then(t=>V.mergeArray(r,t));let u=[...n.data].map((t,r)=>i.type._parseSync(new H(n,t,n.path,r)));return V.mergeArray(r,u)}get element(){return this._def.type}min(t,n){return new ew({...this._def,minLength:{value:t,message:qR.toString(n)}})}max(t,n){return new ew({...this._def,maxLength:{value:t,message:qR.toString(n)}})}length(t,n){return new ew({...this._def,exactLength:{value:t,message:qR.toString(n)}})}nonempty(t){return this.min(1,t)}}ew.create=(t,n)=>new ew({type:t,minLength:null,maxLength:null,exactLength:null,typeName:qD.ZodArray,...X(n)});class eI extends ee{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=qj.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==E.object){let n=this._getOrReturnCtx(t);return B(n,{code:D.invalid_type,expected:E.object,received:n.parsedType}),$}let{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),u=[];if(!(this._def.catchall instanceof eT&&"strip"===this._def.unknownKeys))for(let s in i.data)a.includes(s)||u.push(s);let c=[];for(let l of a){let d=o[l],f=i.data[l];c.push({key:{status:"valid",value:l},value:d._parse(new H(i,f,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof eT){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&&(B(i,{code:D.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 H(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=>V.mergeObjectSync(r,t)):V.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(t){return qR.errToObj,new eI({...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=qR.errToObj(t).message)&&void 0!==u?u:s}:{message:s}}}:{}})}strip(){return new eI({...this._def,unknownKeys:"strip"})}passthrough(){return new eI({...this._def,unknownKeys:"passthrough"})}extend(t){return new eI({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new eI({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:qD.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new eI({...this._def,catchall:t})}pick(t){let n={};return qj.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new eI({...this._def,shape:()=>n})}omit(t){let n={};return qj.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new eI({...this._def,shape:()=>n})}deepPartial(){return function t(n){if(!(n instanceof eI))return n instanceof ew?new ew({...n._def,type:t(n.element)}):n instanceof eB?eB.create(t(n.unwrap())):n instanceof eV?eV.create(t(n.unwrap())):n instanceof eN?eN.create(n.items.map(n=>t(n))):n;{let r={};for(let i in n.shape){let o=n.shape[i];r[i]=eB.create(t(o))}return new eI({...n._def,shape:()=>r})}}(this)}partial(t){let n={};return qj.objectKeys(this.shape).forEach(r=>{let i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new eI({...this._def,shape:()=>n})}required(t){let n={};return qj.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof eB;)i=i._def.innerType;n[r]=i}}),new eI({...this._def,shape:()=>n})}keyof(){return eP(qj.objectKeys(this.shape))}}eI.create=(t,n)=>new eI({shape:()=>t,unknownKeys:"strip",catchall:eT.create(),typeName:qD.ZodObject,...X(n)}),eI.strictCreate=(t,n)=>new eI({shape:()=>t,unknownKeys:"strict",catchall:eT.create(),typeName:qD.ZodObject,...X(n)}),eI.lazycreate=(t,n)=>new eI({shape:t,unknownKeys:"strip",catchall:eT.create(),typeName:qD.ZodObject,...X(n)});class e_ extends ee{_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 L(t.ctx.common.issues));return B(n,{code:D.invalid_union,unionErrors:o}),$});{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 L(t));return B(n,{code:D.invalid_union,unionErrors:c}),$}}get options(){return this._def.options}}e_.create=(t,n)=>new e_({options:t,typeName:qD.ZodUnion,...X(n)});let eO=t=>t instanceof eA?eO(t.schema):t instanceof eW?eO(t.innerType()):t instanceof eL?[t.value]:t instanceof eF?t.options:t instanceof ez?Object.keys(t.enum):t instanceof e$?eO(t._def.innerType):t instanceof ev?[void 0]:t instanceof eb?[null]:null;class ek extends ee{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==E.object)return B(n,{code:D.invalid_type,expected:E.object,received:n.parsedType}),$;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}):(B(n,{code:D.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),$)}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=eO(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 ek({typeName:qD.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...X(r)})}}class eC extends ee{_parse(t){let{status:n,ctx:r}=this._processInputParams(t),i=(t,i)=>{if(q(t)||q(i))return $;let o=function t(n,r){let i=R(n),o=R(r);if(n===r)return{valid:!0,data:n};if(i===E.object&&o===E.object){let a=qj.objectKeys(r),u=qj.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 d=[];for(let f=0;f<n.length;f++){let p=n[f],h=r[f],m=t(p,h);if(!m.valid)return{valid:!1};d.push(m.data)}return{valid:!0,data:d}}}(t.value,i.value);return o.valid?((G(t)||G(i))&&n.dirty(),{status:n.value,value:o.data}):(B(r,{code:D.invalid_intersection_types}),$)};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:qD.ZodIntersection,...X(r)});class eN extends ee{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==E.array)return B(r,{code:D.invalid_type,expected:E.array,received:r.parsedType}),$;if(r.data.length<this._def.items.length)return B(r,{code:D.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),$;!this._def.rest&&r.data.length>this._def.items.length&&(B(r,{code:D.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 H(r,t,r.path,n)):null}).filter(t=>!!t);return r.common.async?Promise.all(i).then(t=>V.mergeArray(n,t)):V.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new eN({...this._def,rest:t})}}eN.create=(t,n)=>{if(!Array.isArray(t))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new eN({items:t,typeName:qD.ZodTuple,rest:null,...X(n)})};class ej extends ee{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 B(r,{code:D.invalid_type,expected:E.object,received:r.parsedType}),$;let i=[],o=this._def.keyType,a=this._def.valueType;for(let u in r.data)i.push({key:o._parse(new H(r,u,r.path,u)),value:a._parse(new H(r,r.data[u],r.path,u))});return r.common.async?V.mergeObjectAsync(n,i):V.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return new ej(n instanceof ee?{keyType:t,valueType:n,typeName:qD.ZodRecord,...X(r)}:{keyType:ed.create(),valueType:t,typeName:qD.ZodRecord,...X(n)})}}class eE extends ee{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==E.map)return B(r,{code:D.invalid_type,expected:E.map,received:r.parsedType}),$;let i=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([t,n],a)=>({key:i._parse(new H(r,t,r.path,[a,"key"])),value:o._parse(new H(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 $;("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,d=c.value;if("aborted"===l.status||"aborted"===d.status)return $;("dirty"===l.status||"dirty"===d.status)&&n.dirty(),s.set(l.value,d.value)}return{status:n.value,value:s}}}}eE.create=(t,n,r)=>new eE({valueType:n,keyType:t,typeName:qD.ZodMap,...X(r)});class eR extends ee{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==E.set)return B(r,{code:D.invalid_type,expected:E.set,received:r.parsedType}),$;let i=this._def;null!==i.minSize&&r.data.size<i.minSize.value&&(B(r,{code:D.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&&(B(r,{code:D.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 $;"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 H(r,t,r.path,n)));return r.common.async?Promise.all(u).then(t=>a(t)):a(u)}min(t,n){return new eR({...this._def,minSize:{value:t,message:qR.toString(n)}})}max(t,n){return new eR({...this._def,maxSize:{value:t,message:qR.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}eR.create=(t,n)=>new eR({valueType:t,minSize:null,maxSize:null,typeName:qD.ZodSet,...X(n)});class eD extends ee{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==E.function)return B(n,{code:D.invalid_type,expected:E.function,received:n.parsedType}),$;function r(t,r){return W({data:t,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,F,P].filter(t=>!!t),issueData:{code:D.invalid_arguments,argumentsError:r}})}function i(t,r){return W({data:t,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,F,P].filter(t=>!!t),issueData:{code:D.invalid_return_type,returnTypeError:r}})}let o={errorMap:n.common.contextualErrorMap},a=n.data;return this._def.returns instanceof eU?Y(async(...t)=>{let n=new L([]),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})}):Y((...t)=>{let n=this._def.args.safeParse(t,o);if(!n.success)throw new L([r(t,n.error)]);let u=a(...n.data),s=this._def.returns.safeParse(u,o);if(!s.success)throw new L([i(u,s.error)]);return s.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new eD({...this._def,args:eN.create(t).rest(eM.create())})}returns(t){return new eD({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new eD({args:t||eN.create([]).rest(eM.create()),returns:n||eM.create(),typeName:qD.ZodFunction,...X(r)})}}class eA extends ee{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:qD.ZodLazy,...X(n)});class eL extends ee{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return B(n,{received:n.data,code:D.invalid_literal,expected:this._def.value}),$}return{status:"valid",value:t.data}}get value(){return this._def.value}}function eP(t,n){return new eF({values:t,typeName:qD.ZodEnum,...X(n)})}eL.create=(t,n)=>new eL({value:t,typeName:qD.ZodLiteral,...X(n)});class eF extends ee{_parse(t){if("string"!=typeof t.data){let n=this._getOrReturnCtx(t),r=this._def.values;return B(n,{expected:qj.joinValues(r),received:n.parsedType,code:D.invalid_type}),$}if(-1===this._def.values.indexOf(t.data)){let i=this._getOrReturnCtx(t),o=this._def.values;return B(i,{received:i.data,code:D.invalid_enum_value,options:o}),$}return Y(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 eF.create(t)}exclude(t){return eF.create(this.options.filter(n=>!t.includes(n)))}}eF.create=eP;class ez extends ee{_parse(t){let n=qj.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==E.string&&r.parsedType!==E.number){let i=qj.objectValues(n);return B(r,{expected:qj.joinValues(i),received:r.parsedType,code:D.invalid_type}),$}if(-1===n.indexOf(t.data)){let o=qj.objectValues(n);return B(r,{received:r.data,code:D.invalid_enum_value,options:o}),$}return Y(t.data)}get enum(){return this._def.values}}ez.create=(t,n)=>new ez({values:t,typeName:qD.ZodNativeEnum,...X(n)});class eU extends ee{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==E.promise&&!1===n.common.async)return B(n,{code:D.invalid_type,expected:E.promise,received:n.parsedType}),$;let r=n.parsedType===E.promise?n.data:Promise.resolve(n.data);return Y(r.then(t=>this._def.type.parseAsync(t,{path:n.path,errorMap:n.common.contextualErrorMap})))}}eU.create=(t,n)=>new eU({type:t,typeName:qD.ZodPromise,...X(n)});class eW extends ee{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===qD.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){B(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?$:("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?$:("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}}}qj.assertNever(i)}}eW.create=(t,n,r)=>new eW({schema:t,typeName:qD.ZodEffects,effect:n,...X(r)}),eW.createWithPreprocess=(t,n,r)=>new eW({schema:n,effect:{type:"preprocess",transform:t},typeName:qD.ZodEffects,...X(r)});class eB extends ee{_parse(t){return this._getType(t)===E.undefined?Y(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}eB.create=(t,n)=>new eB({innerType:t,typeName:qD.ZodOptional,...X(n)});class eV extends ee{_parse(t){return this._getType(t)===E.null?Y(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}eV.create=(t,n)=>new eV({innerType:t,typeName:qD.ZodNullable,...X(n)});class e$ extends ee{_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}}e$.create=(t,n)=>new e$({innerType:t,typeName:qD.ZodDefault,defaultValue:"function"==typeof n.default?n.default:()=>n.default,...X(n)});class eK extends ee{_parse(t){let{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Q(i)?i.then(t=>({status:"valid",value:"valid"===t.status?t.value:this._def.catchValue({get error(){return new L(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===i.status?i.value:this._def.catchValue({get error(){return new L(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}eK.create=(t,n)=>new eK({innerType:t,typeName:qD.ZodCatch,catchValue:"function"==typeof n.catch?n.catch:()=>n.catch,...X(n)});class eY extends ee{_parse(t){if(this._getType(t)!==E.nan){let n=this._getOrReturnCtx(t);return B(n,{code:D.invalid_type,expected:E.nan,received:n.parsedType}),$}return{status:"valid",value:t.data}}}eY.create=t=>new eY({typeName:qD.ZodNaN,...X(t)});let eq=Symbol("zod_brand");class eG extends ee{_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 ee{_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?$:"dirty"===t.status?(n.dirty(),K(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?$:"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:qD.ZodPipeline})}}let eQ=(t,n={},r)=>t?ex.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})}}):ex.create(),eH={object:eI.lazycreate};(t3=qD||(qD={})).ZodString="ZodString",t3.ZodNumber="ZodNumber",t3.ZodNaN="ZodNaN",t3.ZodBigInt="ZodBigInt",t3.ZodBoolean="ZodBoolean",t3.ZodDate="ZodDate",t3.ZodSymbol="ZodSymbol",t3.ZodUndefined="ZodUndefined",t3.ZodNull="ZodNull",t3.ZodAny="ZodAny",t3.ZodUnknown="ZodUnknown",t3.ZodNever="ZodNever",t3.ZodVoid="ZodVoid",t3.ZodArray="ZodArray",t3.ZodObject="ZodObject",t3.ZodUnion="ZodUnion",t3.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t3.ZodIntersection="ZodIntersection",t3.ZodTuple="ZodTuple",t3.ZodRecord="ZodRecord",t3.ZodMap="ZodMap",t3.ZodSet="ZodSet",t3.ZodFunction="ZodFunction",t3.ZodLazy="ZodLazy",t3.ZodLiteral="ZodLiteral",t3.ZodEnum="ZodEnum",t3.ZodEffects="ZodEffects",t3.ZodNativeEnum="ZodNativeEnum",t3.ZodOptional="ZodOptional",t3.ZodNullable="ZodNullable",t3.ZodDefault="ZodDefault",t3.ZodCatch="ZodCatch",t3.ZodPromise="ZodPromise",t3.ZodBranded="ZodBranded",t3.ZodPipeline="ZodPipeline";let eJ=(t,n={message:`Input not instance of ${t.name}`})=>eQ(n=>n instanceof t,n),eX=ed.create,e0=ep.create,e1=eY.create,e2=eh.create,e4=em.create,e3=eg.create,e5=ey.create,e9=ev.create,e8=eb.create,e6=ex.create,e7=eM.create,te=eT.create,tt=eS.create,tn=ew.create,tr=eI.create,ti=eI.strictCreate,to=e_.create,ta=ek.create,tu=eC.create,ts=eN.create,tc=ej.create,tl=eE.create,td=eR.create,tf=eD.create,tp=eA.create,th=eL.create,tm=eF.create,tg=ez.create,ty=eU.create,tv=eW.create,tb=eB.create,tx=eV.create,tM=eW.createWithPreprocess,tT=eZ.create,tS=()=>eX().optional(),tw=()=>e0().optional(),tI=()=>e4().optional();var t_=Object.freeze({__proto__:null,defaultErrorMap:P,setErrorMap:z,getErrorMap:U,makeIssue:W,EMPTY_PATH:[],addIssueToContext:B,ParseStatus:V,INVALID:$,DIRTY:K,OK:Y,isAborted:q,isDirty:G,isValid:Z,isAsync:Q,get util(){return qj},get objectUtil(){return qE},ZodParsedType:E,getParsedType:R,ZodType:ee,ZodString:ed,ZodNumber:ep,ZodBigInt:eh,ZodBoolean:em,ZodDate:eg,ZodSymbol:ey,ZodUndefined:ev,ZodNull:eb,ZodAny:ex,ZodUnknown:eM,ZodNever:eT,ZodVoid:eS,ZodArray:ew,ZodObject:eI,ZodUnion:e_,ZodDiscriminatedUnion:ek,ZodIntersection:eC,ZodTuple:eN,ZodRecord:ej,ZodMap:eE,ZodSet:eR,ZodFunction:eD,ZodLazy:eA,ZodLiteral:eL,ZodEnum:eF,ZodNativeEnum:ez,ZodPromise:eU,ZodEffects:eW,ZodTransformer:eW,ZodOptional:eB,ZodNullable:eV,ZodDefault:e$,ZodCatch:eK,ZodNaN:eY,BRAND:eq,ZodBranded:eG,ZodPipeline:eZ,custom:eQ,Schema:ee,ZodSchema:ee,late:eH,get ZodFirstPartyTypeKind(){return qD},coerce:{string:t=>ed.create({...t,coerce:!0}),number:t=>ep.create({...t,coerce:!0}),boolean:t=>em.create({...t,coerce:!0}),bigint:t=>eh.create({...t,coerce:!0}),date:t=>eg.create({...t,coerce:!0})},any:e6,array:tn,bigint:e2,boolean:e4,date:e3,discriminatedUnion:ta,effect:tv,enum:tm,function:tf,instanceof:eJ,intersection:tu,lazy:tp,literal:th,map:tl,nan:e1,nativeEnum:tg,never:te,null:e8,nullable:tx,number:e0,object:tr,oboolean:tI,onumber:tw,optional:tb,ostring:tS,pipeline:tT,preprocess:tM,promise:ty,record:tc,set:td,strictObject:ti,string:eX,symbol:e5,transformer:tv,tuple:ts,undefined:e9,union:to,unknown:e7,void:tt,NEVER:$,ZodIssueCode:D,quotelessJson:A,ZodError:L});let tO=(0,o.createContext)(void 0);function tk(){let t=(0,o.useContext)(tO);if(!t)throw Error("Missing EditorConfigContext.Provider");return t}class tC extends Error{}function tN(t){throw new tC(`Missing EditorConfig.${t}`)}let tj=tr({id:eX(),kind:eX(),extension:eX(),filename:eX(),width:e0().optional(),height:e0().optional(),last_modified:e0(),url:eX(),alt:eX().optional(),size:e0()}),tE=tr({total:e0(),cursor:eX().optional(),items:tn(tj)});function tR(t,n,r,i="all",o){let a=new URLSearchParams({assetType:i,limit:"30",...o&&{cursor:o}});return(0,d.WY)(`${t}?${a.toString()}`,{headers:{repository:n},credentials:(0,d.xb)(r),okType:tE})}function tD(t){let{assetType:n}=t,r=tk(),[i,a]=(0,o.useState)(),[u,s]=(0,o.useState)([]),[c,l]=(0,o.useState)(u);r.mediaLibrary||tN("mediaLibrary");let{assetsUrl:d,repository:p}=r,h=(0,f.QT)(tR,[d,p,r.env,n,i]);function m(t){s([]),(0,f.VA)(tR,[d,p,r.env,n,i],n=>({items:t,total:t.length,cursor:(null==n?void 0:n.cursor)??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){m([...t,...u])},replaceMedia:function(t){let n=u.flatMap(n=>{let r=t.find(t=>t.id===n.id);return r?void 0===r.response?[]:r.response:n});m(n)}}}f.Fs.registerFetcherConfig(tR,{cacheCapacity:100,revalidationStrategy:{type:"never"}});let tA,tL=new Uint8Array(16);function tP(){if(!tA&&!(tA="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 tA(tL)}let tF=[];for(let tz=0;tz<256;++tz)tF.push((tz+256).toString(16).slice(1));let tU="u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),tW={randomUUID:tU};function tB(t,n,r){if(tW.randomUUID&&!n&&!t)return tW.randomUUID();t=t||{};let i=t.random||(t.rng||tP)();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(tF[t[n+0]]+tF[t[n+1]]+tF[t[n+2]]+tF[t[n+3]]+"-"+tF[t[n+4]]+tF[t[n+5]]+"-"+tF[t[n+6]]+tF[t[n+7]]+"-"+tF[t[n+8]]+tF[t[n+9]]+"-"+tF[t[n+10]]+tF[t[n+11]]+tF[t[n+12]]+tF[t[n+13]]+tF[t[n+14]]+tF[t[n+15]]).toLowerCase()}(i)}let tV=(0,o.createContext)(void 0);function t$(t){let{children:n,assetType:r="all",onSelectedChange:i,actionContainerRef:a}=t,[u,s]=(0,o.useState)(new Set),[c,l]=(0,o.useTransition)(),{media:f,onHasReachedBottom:p,updateMedia:h,replaceMedia:m}=tD({assetType:r}),{isUploading:g,onFilesSelected:y,uploadingFiles:v}=function(t){let{onBeforeUpload:n,onComplete:r,onError:i}=t,[a,u]=(0,o.useState)([]),s=a.some(t=>"idle"===t.status||"uploading"===t.status),c=tk();function l(t){u(n=>(null==t||t(n),n))}return(0,o.useEffect)(function(){if(!a.length||a.some(t=>"uploading"===t.status)||a.every(t=>"error"===t.status))return;let t=a.find(t=>"idle"===t.status);if(!t){setTimeout(()=>{l(r),u(t=>t.filter(t=>"error"===t.status))},1e3);return}u(n=>n.map(n=>n.id===t.id?{...n,status:"uploading"}:n)),(function(t){let{file:n,config:r}=t;if(!r.mediaLibrary)throw Error("Media Library not configured.");let{assetsUrl:i,repository:o,env:a}=r,u=new FormData;return u.append(n.name,n),(0,d.WY)(i,{headers:{repository:o,"Content-Type":"multipart/form-data"},method:"POST",body:u,credentials:(0,d.xb)(a),okType:tj})})({file:t.file,config:c}).then(n=>{u(r=>r.map(r=>r.id===t.id?{...r,status:"success",response:n}:r))}).catch(()=>{u(n=>n.map(n=>n.id===t.id?{...n,status:"error"}:n)),l(i)})},[c,a,r,i]),{isUploading:s,uploadingFiles:a,onFilesSelected:function(t){let r=t.map(t=>({id:tB(),file:t,status:"idle"}));u(r),l(n)},onRetry:function(){u(t=>t.map(t=>"error"===t.status?{...t,status:"idle"}:t))}}}({onBeforeUpload(t){h(t.map(t=>({id:t.id,url:URL.createObjectURL(t.file),filename:t.file.name,size:t.file.size,extension:t.file.type,kind:t.file.type,last_modified:t.file.lastModified})))},onComplete(t){let n=t.flatMap(t=>{var n;return"success"===t.status?{id:t.id,response:{...t.response,url:(null==(n=f.find(n=>n.id===t.id))?void 0:n.url)??t.response.url}}:{id:t.id,response:void 0}});m(n)},onError(t){let n=t.flatMap(t=>"error"===t.status?{id:t.id,response:void 0}:[]);setTimeout(()=>m(n),2e3)}});function b(t,n){s(r=>{let o=new Set(r);o[n](t);let a=Array.from(o).flatMap(t=>f.find(n=>n.id===t)??[]);return null==i||i(a),o})}return C.jsx(tV.Provider,{value:{isFetchingMedia:c,media:f,onScrollToBottom:function(){l(p)},selectedMediaIds:u,actionContainerRef:a,onFilesUpload:function(t){g||y(t)},isUploading:g,uploadingFiles:v,addMediaItem:function(t){b(t,"add")},removeMediaItem:function(t){b(t,"delete")},resetMediaSelection:function(){s(new Set)}},children:n})}function tK(){let t=(0,o.useContext)(tV);if(!t)throw Error("useMediaLibrary must be used within a MediaLibraryProvider");return t}function tY(){let{isFetchingMedia:t}=tK();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})}let tq={warning:{uploadWhileUploading:{title:"Hang tight!",description:"Your current images are still being uploaded. Once they're all set, you'll be free to upload more."}}};function tG(){let{actionContainerRef:t,isUploading:n,onFilesUpload:r}=tK(),i=null==t?void 0:t.current,a=i?u.Uv:o.Fragment;return C.jsx(a,{...i?{container:t.current,asChild:!0}:{},children:C.jsxs(u.xu,{justifyContent:"space-between",width:"100%",flexGrow:1,children:[C.jsx("div",{}),C.jsx(u.u,{title:tq.warning.uploadWhileUploading.title,content:tq.warning.uploadWhileUploading.description,visible:n,stableMount:!0,children:C.jsx(u.KH,{disabled:n,onFilesSelected:r,startIcon:"cloudUpload",color:i?"purple":"grey",size:"large",children:"Upload media"})})]})})}function tZ(t){let{children:n}=t,{onFilesUpload:r}=tK();return C.jsx(u.Zz,{overlay:C.jsx(tQ,{}),overlayVariant:"simple",onFilesSelected:r,children:n})}function tQ(){let{isUploading:t}=tK(),n=t?tq.warning.uploadWhileUploading.title:"Drop files here",r=t?tq.warning.uploadWhileUploading.description:"Drop your files to upload them instantly to the media library.";return C.jsx(u.xu,{justifyContent:"center",flexDirection:"column",height:"100%",backgroundColor:"grey3",children:C.jsxs(u.R$,{children:[C.jsx(u.av,{name:t?"block":"cloudUpload",lineColor:t?"tomato11":"purple10",backgroundColor:t?"tomato2":"purple3",borderColor:t?"tomato6":"purple6",borderStyle:"dashed",size:"large"}),C.jsx(u._T,{size:"big",children:n}),C.jsx(u.nf,{width:360,children:r})]})})}function tH(){return C.jsx(u.Iq,{title:"Oops! Something went wrong",description:"An error occurred while searching for your image.",errorImageSrc:u.Os,sx:{marginBlock:"auto",marginInline:"auto"}})}function tJ(){var t;let{onScrollToBottom:n,media:r,selectedMediaIds:i,addMediaItem:a,removeMediaItem:s,resetMediaSelection:c,isUploading:l,uploadingFiles:d}=tK(),f=(0,o.useRef)(null);function p(t){if(i.has(t))return s(t);c(),a(t)}return l&&(null==(t=f.current)||t.scrollTo({top:0,behavior:"instant"})),C.jsx(u.xr,{ref:f,style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 250px), 1fr))",gap:16,paddingBottom:16,position:"relative"},onScrollToBottom:n,threshold:500,children:null==r?void 0:r.map(t=>{var n;return C.jsx(u.PB,{...t,status:null==(n=d.find(n=>n.id===t.id))?void 0:n.status,selected:i.has(t.id),onCardClick:()=>p(t.id),onCheckedChange:()=>p(t.id)},t.id)})})}function tX(){let{onFilesUpload:t,isUploading:n}=tK();return C.jsxs(u.xu,{display:"grid",alignItems:"center",gridColumn:"1fr",gridTemplateRows:"1fr 1fr 1fr",children:[C.jsx(u.xu,{gridColumn:"1",gridRow:"1 / 3",children:C.jsx(u.Ee,{sizing:"contain",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzODUiIGhlaWdodD0iNDg1IiB2aWV3Qm94PSIwIDAgMzg1IDQ4NSIgZmlsbD0ibm9uZSI+CiAgPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00MTMuNTQgNDUuNjA4NEw0MDQuNjMzIDUwLjc1NDZMMzE3LjUyIDAuNDc5NDkySDMxNS4zNDFMNDAzLjU0MyA1MS4zODM5TDI5My4yNCAxMTUuMTFMMTgyLjUwNyA1MS4yMDI5TDI3MC4zMDQgMC40Nzk0OTJIMjY4LjEyNkwxODEuNDE4IDUwLjU3NDFMOTQuNjE3OSAwLjQ3OTQ5Mkg5Mi40MzgyTDE4MC4zMjggNTEuMjAzNEw3MC4wMjUxIDExNC45M0wtNDAuNzA4MSA1MS4wMjI0TDQ2Ljc3NjMgMC40Nzk0OTJINDQuNTk4M0wtNDEuNzk3NiA1MC4zOTM1TC01MC41NjA1IDQ1LjMzNjJWNDYuNTk0MkwtNDIuODg2OSA1MS4wMjI5TC01MC41NjA1IDU1LjQ1NjJWNTYuNzE0NUwtNDEuNzk3MyA1MS42NTE3TDY4LjkzNTggMTE1LjU1OUwtNDEuMzY3NSAxNzkuMjg1TC01MC41NjA1IDE3My45OFYxNzUuMjM4TC00Mi40NTY4IDE3OS45MTRMLTUwLjU2MDUgMTg0LjU5NlYxODUuODU1TC00MS4zNjcyIDE4MC41NDNMNjkuMzY1OSAyNDQuNDUxTC00MC45MzczIDMwOC4xNzdMLTUwLjU2MDUgMzAyLjYyM1YzMDMuODgxTC00Mi4wMjY2IDMwOC44MDZMLTUwLjU2MDUgMzEzLjczNlYzMTQuOTk1TC00MC45MzcgMzA5LjQzNUw2OS43OTYxIDM3My4zNDJMLTQwLjUwNzEgNDM3LjA2OEwtNTAuNTYwNSA0MzEuMjY2VjQzMi41MjRMLTQxLjU5NjQgNDM3LjY5OEwtNTAuNTYwNSA0NDIuODc2VjQ0NC4xMzVMLTQwLjUwNjkgNDM4LjMyNkwzOS4wNTgyIDQ4NC4yNDZINDEuMjM3OUwtMzkuNDE3NiA0MzcuNjk3TDcwLjg4NTYgMzczLjk3MUwxODEuNjE5IDQzNy44NzhMMTAxLjM2MiA0ODQuMjQ2SDEwMy41MzlMMTgyLjcwOCA0MzguNTA3TDI2MS45NiA0ODQuMjQ2SDI2NC4xNEwxODMuNzk4IDQzNy44NzhMMjk0LjEwMSAzNzQuMTUxTDQxMy41NCA0NDMuMDgzVjQ0MS44MjVMMjk1LjE5IDM3My41MjJMNDA1LjQ5MyAzMDkuNzk2TDQxMy41NCAzMTQuNDRWMzEzLjE4Mkw0MDYuNTgzIDMwOS4xNjdMNDEzLjU0IDMwNS4xNDdWMzAzLjg4OUw0MDUuNDkzIDMwOC41MzhMMjk0Ljc2IDI0NC42MzFMNDA1LjA2MyAxODAuOTA0TDQxMy41NCAxODUuNzk3VjE4NC41MzlMNDA2LjE1MiAxODAuMjc1TDQxMy41NCAxNzYuMDA3VjE3NC43NDlMNDA1LjA2MyAxNzkuNjQ2TDI5NC4zMyAxMTUuNzM5TDQwNC42MzMgNTIuMDEyN0w0MTMuNTQgNTcuMTUzM1Y1NS44OTU0TDQwNS43MjIgNTEuMzgzNUw0MTMuNTQgNDYuODY2OFY0NS42MDg0Wk0yOTIuMTUxIDExNS43MzlMMTgxLjg0OCAxNzkuNDY2TDcxLjExNDYgMTE1LjU1OEwxODEuNDE4IDUxLjgzMjJMMjkyLjE1MSAxMTUuNzM5Wk03MC4wMjU0IDExNi4xODhMMTgwLjc1OCAxODAuMDk1TDcwLjQ1NTIgMjQzLjgyMUwtNDAuMjc3OSAxNzkuOTE0TDcwLjAyNTQgMTE2LjE4OFpNMTgxLjg0OCAxODAuNzI0TDcxLjU0NDggMjQ0LjQ1TDE4Mi4yNzggMzA4LjM1N0wyOTIuNTgxIDI0NC42MzFMMTgxLjg0OCAxODAuNzI0Wk0tMzkuODQ3NyAzMDguODA2TDcwLjQ1NTUgMjQ1LjA3OUwxODEuMTg5IDMwOC45ODdMNzAuODg1NCAzNzIuNzEzTC0zOS44NDc3IDMwOC44MDZaTTE4Mi4yNzggMzA5LjYxNUwyOTMuMDExIDM3My41MjNMMTgyLjcwOCA0MzcuMjQ5TDcxLjk3NDkgMzczLjM0MkwxODIuMjc4IDMwOS42MTVaTTQwNC40MDQgMzA5LjE2N0wyOTMuNjcxIDI0NS4yNkwxODMuMzY3IDMwOC45ODZMMjk0LjEgMzcyLjg5M0w0MDQuNDA0IDMwOS4xNjdaTTE4Mi45MzcgMTgwLjA5NEwyOTMuNjcgMjQ0LjAwMkw0MDMuOTc0IDE4MC4yNzZMMjkzLjI0MSAxMTYuMzY4TDE4Mi45MzcgMTgwLjA5NFoiIGZpbGw9InVybCgjcGFpbnQwX2xpbmVhcl8xNjYyMF82NjEzKSIvPgogIDxwYXRoIGQ9Ik00MTMuNTQgNDQ1LjA3N1Y0NDMuODE5TDM0My41NjYgNDg0LjI0NkgzNDUuNzQ0TDQxMy41NCA0NDUuMDc3WiIgZmlsbD0idXJsKCNwYWludDFfbGluZWFyXzE2NjIwXzY2MTMpIi8+CiAgPGRlZnM+CiAgICA8bGluZWFyR3JhZGllbnQgaWQ9InBhaW50MF9saW5lYXJfMTY2MjBfNjYxMyIgeDE9IjE4MS40OSIgeTE9IjAuNDc5NDkyIiB4Mj0iMTgxIiB5Mj0iNjI0IiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+CiAgICAgIDxzdG9wIHN0b3AtY29sb3I9IiNFREVDRUUiIHN0b3Atb3BhY2l0eT0iMCIvPgogICAgICA8c3RvcCBvZmZzZXQ9IjAuNTQzMDM1IiBzdG9wLWNvbG9yPSIjRURFQ0VFIi8+CiAgICAgIDxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI0VERUNFRSIgc3RvcC1vcGFjaXR5PSIwIi8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogICAgPGxpbmVhckdyYWRpZW50IGlkPSJwYWludDFfbGluZWFyXzE2NjIwXzY2MTMiIHgxPSIxODEuNDkiIHkxPSIwLjQ3OTQ5MiIgeDI9IjE4MSIgeTI9IjYyNCIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgogICAgICA8c3RvcCBzdG9wLWNvbG9yPSIjRURFQ0VFIiBzdG9wLW9wYWNpdHk9IjAiLz4KICAgICAgPHN0b3Agb2Zmc2V0PSIwLjU0MzAzNSIgc3RvcC1jb2xvcj0iI0VERUNFRSIvPgogICAgICA8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNFREVDRUUiIHN0b3Atb3BhY2l0eT0iMCIvPgogICAgPC9saW5lYXJHcmFkaWVudD4KICA8L2RlZnM+Cjwvc3ZnPg==",alt:"media placeholder",background:"transparent"})}),C.jsx(u.xu,{gridColumn:"1",gridRow:"1",flexDirection:"column",justifyContent:"end",height:"100%",padding:16,children:C.jsx(u.Ee,{sizing:"contain",src:"data:image/svg+xml;base64,Cjxzdmcgd2lkdGg9IjM0NSIgaGVpZ2h0PSIxMjMiIHZpZXdCb3g9IjAgMCAzNDUgMTIzIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8ZyBvcGFjaXR5PSIwLjYiPgo8ZWxsaXBzZSBjeD0iMTcyLjUiIGN5PSI3Mi41IiByeD0iMTcyLjUiIHJ5PSI1MC41IiBmaWxsPSIjNkY2RTc3Ii8+CjxwYXRoIGQ9Ik0zNDQuNSA2MkMzNDQuNSA2OC4zNjc0IDMzOS44NTcgNzQuNTUwNCAzMzEuMTY5IDgwLjI2NjFDMzIyLjUwMiA4NS45Njg0IDMwOS45MjYgOTEuMTIyOSAyOTQuMzQyIDk1LjQ1OTRDMjYzLjE4IDEwNC4xMyAyMjAuMTAzIDEwOS41IDE3Mi41IDEwOS41QzEyNC44OTcgMTA5LjUgODEuODE5NiAxMDQuMTMgNTAuNjU4MSA5NS40NTk0QzM1LjA3MzkgOTEuMTIyOSAyMi40OTg0IDg1Ljk2ODQgMTMuODMwNyA4MC4yNjYxQzUuMTQyODIgNzQuNTUwNCAwLjUgNjguMzY3NCAwLjUgNjJDMC41IDU1LjYzMjYgNS4xNDI4MiA0OS40NDk2IDEzLjgzMDcgNDMuNzMzOUMyMi40OTg0IDM4LjAzMTYgMzUuMDczOSAzMi44NzcxIDUwLjY1ODEgMjguNTQwNkM4MS44MTk2IDE5Ljg2OTUgMTI0Ljg5NyAxNC41IDE3Mi41IDE0LjVDMjIwLjEwMyAxNC41IDI2My4xOCAxOS44Njk1IDI5NC4zNDIgMjguNTQwNkMzMDkuOTI2IDMyLjg3NzEgMzIyLjUwMiAzOC4wMzE2IDMzMS4xNjkgNDMuNzMzOUMzMzkuODU3IDQ5LjQ0OTYgMzQ0LjUgNTUuNjMyNiAzNDQuNSA2MloiIGZpbGw9IiNGNEYyRjQiIHN0cm9rZT0iIzZGNkU3NyIvPgo8bWFzayBpZD0icGF0aC0zLWluc2lkZS0xXzE2NjIwXzY2MTciIGZpbGw9IndoaXRlIj4KPHBhdGggZD0iTTEzOS40OTQgOTMuODI0Mkw2Mi4yNCA0OS4yMjE1VjU3LjA4NjJMMTM5LjQ5NCAxMDEuNjg5VjkzLjgyNDJaIi8+CjwvbWFzaz4KPHBhdGggZD0iTTEzOS40OTQgOTMuODI0Mkw2Mi4yNCA0OS4yMjE1VjU3LjA4NjJMMTM5LjQ5NCAxMDEuNjg5VjkzLjgyNDJaIiBmaWxsPSIjNkY2RTc3Ii8+CjxwYXRoIGQ9Ik02Mi4yNCA1Ny4wODYyVjU4LjIwMTNMNjEuMjc0NCA1Ny42NDM3VjU2LjUyODdMNjIuMjQgNTcuMDg2MlpNMTM5LjQ5NCAxMDEuNjg5TDE0MC40NiAxMDIuMjQ2VjEwMy4zNjFMMTM5LjQ5NCAxMDIuODA0VjEwMS42ODlaTTYzLjIwNTcgNDkuNzc5MVY1Ny42NDM3TDYxLjI3NDQgNTYuNTI4N1Y0OC42NjRMNjMuMjA1NyA0OS43NzkxWk02Mi4yNCA1NS45NzExTDEzOS40OTQgMTAwLjU3NFYxMDIuODA0TDYyLjI0IDU4LjIwMTNWNTUuOTcxMVpNMTM4LjUyOCAxMDEuMTMxTDEzOC41MjggOTMuMjY2N0wxNDAuNDYgOTQuMzgxOFYxMDIuMjQ2TDEzOC41MjggMTAxLjEzMVoiIGZpbGw9IiM2RjZFNzciIG1hc2s9InVybCgjcGF0aC0zLWluc2lkZS0xXzE2NjIwXzY2MTcpIi8+CjxyZWN0IHk9IjAuNTU3NTM0IiB3aWR0aD0iNjEuMzI4NyIgaGVpZ2h0PSI4OC4wOTAzIiB0cmFuc2Zvcm09Im1hdHJpeCgtMC44NjYwMjUgMC41IDAuODY2MDI1IDAuNSAxMTUuNTk1IDE4LjI3ODgpIiBmaWxsPSIjRjRGMkY0IiBzdHJva2U9IiM2RjZFNzciIHN0cm9rZS13aWR0aD0iMS4xMTUwNyIvPgo8ZyBjbGlwLXBhdGg9InVybCgjY2xpcDBfMTY2MjBfNjYxNykiPgo8cGF0aCBkPSJNMTUyLjU0MyA3MC4zMjk1TDE2OS4zNTMgNjAuNDI4OEwxNzIuNzQ5IDYyLjM0OTlMMTU1LjkzOSA3Mi4yNTA2TDE1Mi41NDMgNzAuMzI5NVpNMTI4Ljg3NCA2OC41ODUzTDE1NS43NjkgNTIuNzQ0MkwxNTkuMTY1IDU0LjY2NTNMMTMyLjI3IDcwLjUwNjRMMTI4Ljg3NCA2OC41ODUzWk0xNjUuOTU3IDU4LjUwNzZMMTM5LjA2MiA3NC4zNDg3TDEzNS42NjYgNzIuNDI3NkwxNjIuNTYxIDU2LjU4NjVMMTY1Ljk1NyA1OC41MDc2Wk0xNDguOTc3IDQ4LjkwMTlMMTUyLjM3MyA1MC44MjNMMTI1LjQ3OCA2Ni42NjQxTDEyMi4wODIgNjQuNzQzTDE0OC45NzcgNDguOTAxOVoiIGZpbGw9IiM2RjZFNzciLz4KPC9nPgo8ZyBjbGlwLXBhdGg9InVybCgjY2xpcDFfMTY2MjBfNjYxNykiPgo8cGF0aCBkPSJNMTcyLjI1MyA2MS44MTUyTDE2OS4zNTYgNjAuMTc1OEwxNTMuMDM5IDY5Ljc4NjFMMTU1LjkzNyA3MS40MjU0TDE3Mi4yNTMgNjEuODE1MlpNMTU4LjY3IDU0LjEzMDZMMTU1Ljc3MiA1Mi40OTEyTDEyOS4zNyA2OC4wNDE5TDEzMi4yNjggNjkuNjgxMkwxNTguNjcgNTQuMTMwNlpNMTM2LjE2MiA3MS44ODQyTDEzOS4wNiA3My41MjM1TDE2NS40NjIgNTcuOTcyOUwxNjIuNTY0IDU2LjMzMzVMMTM2LjE2MiA3MS44ODQyWk0xMjUuNDc2IDY1LjgzODlMMTUxLjg3OCA1MC4yODgzTDE0OC45OCA0OC42NDg5TDEyMi41NzggNjQuMTk5NkwxMjUuNDc2IDY1LjgzODlaIiBmaWxsPSIjRjRGMkY0IiBzdHJva2U9IiM2RjZFNzciIHN0cm9rZS13aWR0aD0iMC41NzIzMzUiLz4KPC9nPgo8ZyBjbGlwLXBhdGg9InVybCgjY2xpcDJfMTY2MjBfNjYxNykiPgo8cGF0aCBkPSJNMTI0LjgxNiA1NC45NTU5TDE0MS42MjUgNDUuMDU1MkwxNDUuMDIxIDQ2Ljk3NjRMMTI4LjIxMiA1Ni44NzcxTDEyNC44MTYgNTQuOTU1OVpNMTAxLjE0NiA1My4yMTE3TDEyOC4wNDEgMzcuMzcwNkwxMzEuNDM3IDM5LjI5MThMMTA0LjU0MiA1NS4xMzI5TDEwMS4xNDYgNTMuMjExN1pNMTM4LjIyOSA0My4xMzQxTDExMS4zMzQgNTguOTc1MkwxMDcuOTM4IDU3LjA1NEwxMzQuODMzIDQxLjIxMjlMMTM4LjIyOSA0My4xMzQxWk0xMjEuMjUgMzMuNTI4M0wxMjQuNjQ1IDM1LjQ0OTVMOTcuNzUwNCA1MS4yOTA2TDk0LjM1NDQgNDkuMzY5NEwxMjEuMjUgMzMuNTI4M1oiIGZpbGw9IiM2RjZFNzciLz4KPC9nPgo8ZyBjbGlwLXBhdGg9InVybCgjY2xpcDNfMTY2MjBfNjYxNykiPgo8cGF0aCBkPSJNMTQ0LjUyNSA0Ni40Mzc3TDE0MS42MjggNDQuNzk4NEwxMjUuMzExIDU0LjQwODZMMTI4LjIwOSA1Ni4wNDhMMTQ0LjUyNSA0Ni40Mzc3Wk0xMzAuOTQyIDM4Ljc1MzFMMTI4LjA0NCAzNy4xMTM4TDEwMS42NDIgNTIuNjY0NEwxMDQuNTQgNTQuMzAzOEwxMzAuOTQyIDM4Ljc1MzFaTTEwOC40MzQgNTYuNTA2N0wxMTEuMzMyIDU4LjE0NjFMMTM3LjczNCA0Mi41OTU0TDEzNC44MzYgNDAuOTU2MUwxMDguNDM0IDU2LjUwNjdaTTk3Ljc0NzkgNTAuNDYxNUwxMjQuMTUgMzQuOTEwOEwxMjEuMjUyIDMzLjI3MTVMOTQuODUwMSA0OC44MjIxTDk3Ljc0NzkgNTAuNDYxNVoiIGZpbGw9IiNGNEYyRjQiIHN0cm9rZT0iIzZGNkU3NyIgc3Ryb2tlLXdpZHRoPSIwLjU3MjMzNSIvPgo8L2c+CjxyZWN0IHg9Ii0wLjQ4MjgzOCIgeT0iMC44MzYzIiB3aWR0aD0iNjEuMjA2IiBoZWlnaHQ9IjQuNjAxMDkiIHRyYW5zZm9ybT0ibWF0cml4KC0wLjg2NjAyNSAwLjUgMCAxIDE5Mi40MzEgNjIuODQzNSkiIGZpbGw9IiM2RjZFNzciIHN0cm9rZT0iIzZGNkU3NyIgc3Ryb2tlLXdpZHRoPSIxLjExNTA3Ii8+CjxtYXNrIGlkPSJwYXRoLTExLWluc2lkZS0yXzE2NjIwXzY2MTciIGZpbGw9IndoaXRlIj4KPHBhdGggZD0iTTIzOS4yNTQgOTQuNjU3MkwxNjIgNDUuNDQ3NVY1My4xNDgxTDIzOS4yNTQgMTAyLjM1OFY5NC42NTcyWiIvPgo8L21hc2s+CjxwYXRoIGQ9Ik0yMzkuMjU0IDk0LjY1NzJMMTYyIDQ1LjQ0NzVWNTMuMTQ4MUwyMzkuMjU0IDEwMi4zNThWOTQuNjU3MloiIGZpbGw9IiNGNEYyRjQiLz4KPHBhdGggZD0iTTE2MiA1My4xNDgxVjU0LjI2MzJMMTYxLjA2IDUzLjY2NDFWNTIuNTQ5MUwxNjIgNTMuMTQ4MVpNMjM5LjI1NCAxMDIuMzU4TDI0MC4xOTUgMTAyLjk1N1YxMDQuMDcyTDIzOS4yNTQgMTAzLjQ3M1YxMDIuMzU4Wk0xNjIuOTQxIDQ2LjA0NjZWNTMuNzQ3MkwxNjEuMDYgNTIuNTQ5MVY0NC44NDg1TDE2Mi45NDEgNDYuMDQ2NlpNMTYyIDUyLjAzMzFMMjM5LjI1NCAxMDEuMjQzVjEwMy40NzNMMTYyIDU0LjI2MzJWNTIuMDMzMVpNMjM4LjMxNCAxMDEuNzU5Vjk0LjA1ODJMMjQwLjE5NSA5NS4yNTYzVjEwMi45NTdMMjM4LjMxNCAxMDEuNzU5WiIgZmlsbD0iIzZGNkU3NyIgbWFzaz0idXJsKCNwYXRoLTExLWluc2lkZS0yXzE2NjIwXzY2MTcpIi8+CjxyZWN0IHk9IjAuNTk5MDY4IiB3aWR0aD0iNjMuMDAyIiBoZWlnaHQ9IjkwLjQ4MDgiIHRyYW5zZm9ybT0ibWF0cml4KC0wLjg0MzQyNCAwLjUzNzI0OCAwLjg0MzQyNCAwLjUzNzI0OCAyMTUuNjQ3IDExLjI3NzIpIiBmaWxsPSIjRjRGMkY0IiBzdHJva2U9IiM2RjZFNzciIHN0cm9rZS13aWR0aD0iMS4xMTUwNyIvPgo8ZyBjbGlwLXBhdGg9InVybCgjY2xpcDRfMTY2MjBfNjYxNykiPgo8cGF0aCBkPSJNMjAwLjgyNCA0My40NzQ2TDIwNy4xMSAzOS40MTQ1TDIwNy4wOTggMzcuNDA1N0wyMTEuODEyIDM0LjM2MDdDMjEyLjY3NyAzMy44MDI1IDIxNC4wODggMzMuNzk4IDIxNC45NTggMzQuMzQ0NUwyMjQuNDYxIDQwLjMwMkMyMjUuMzMxIDQwLjg0ODYgMjI1LjMzNiA0MS43NTI1IDIyNC40NzIgNDIuMzEwOEwyMTEuMjk2IDUwLjgyMTZDMjEwLjc2MiA1MS4xNjY3IDIwOS44ODcgNTEuMTY3NiAyMDkuMzU3IDUwLjgzNDdMMjAwLjgzNSA0NS40ODMzQzE5OS45NjUgNDQuOTM2OCAxOTkuOTYgNDQuMDMyOCAyMDAuODI0IDQzLjQ3NDZaTTIxMC4zMTkgNDkuNDM3MUwyMjIuODkgNDEuMzE3TDIxMy4zOTUgMzUuMzU0NUwyMDkuMzMzIDM3Ljk3ODNMMjA5LjM0NCAzOS45ODdMMjAyLjQwNyA0NC40NjgzTDIxMC4zMTkgNDkuNDM3MVpNMjA3LjUzNCA0Mi45MjExTDIxNC4xMTYgMzguODkzNEwyMTQuOTg5IDM4LjM1N0wyMDcuMDk4IDQzLjIwNzNMMjA3LjUzNCA0Mi45MjExWk0yMTMuODMgNDMuNDkzNUwyMTguMTUzIDQwLjYzMThMMjE4LjE1MyA0MC4zNDQ1TDIxMy4yNTcgNDMuMjA3M0wyMTMuODMgNDMuNDkzNVoiIGZpbGw9IiM2RjZFNzciLz4KPC9nPgo8ZyBjbGlwLXBhdGg9InVybCgjY2xpcDVfMTY2MjBfNjYxNykiPgo8cGF0aCBkPSJNMjA3LjQ1IDM4Ljg2OTdMMjA3LjQ1MSAzOC45NTk4TDIwNy4zNTEgMzkuMDI0MUwyMDEuMDY2IDQzLjA4NDJDMjAwLjMzNCA0My41NTY2IDIwMC4zMzkgNDQuMzIyOSAyMDEuMDc1IDQ0Ljc4NTVMMjA5LjU5NyA1MC4xMzY5QzIwOS45OTUgNTAuMzg2NiAyMTAuNjU0IDUwLjM4NTUgMjExLjA1NCA1MC4xMjdMMjI0LjIzIDQxLjYxNjJDMjI0Ljk2MSA0MS4xNDM3IDIyNC45NTcgNDAuMzc3NSAyMjQuMjIgMzkuOTE0OUMyMjQuMjIgMzkuOTE0OSAyMjQuMjIgMzkuOTE0OSAyMjQuMjIgMzkuOTE0OUwyMTQuNzE4IDMzLjk1NzVMMjE0LjcxNyAzMy45NTc0QzIxMy45NzkgMzMuNDkzOSAyMTIuNzg0IDMzLjQ5ODkgMjEyLjA1NCAzMy45NzAzTDIwNy40NCAzNi45NTFMMjA3LjQ1IDM4Ljg2OTdaTTIxMC41NjEgNDkuMDQ2N0wyMTAuMzIgNDkuMjAyMUwyMTAuMDc4IDQ5LjA1TDIwMi4xNjYgNDQuMDgxMkwyMDEuOTIzIDQzLjkyOTFMMjAyLjE2NCA0My43NzM3TDIwOS4wMDIgMzkuMzU2OEwyMDguOTkxIDM3LjQzODFMMjA4Ljk5MSAzNy4zNDhMMjA5LjA5IDM3LjI4MzdMMjEzLjE1MiAzNC42NTk5TDIxMy4zOTMgMzQuNTA0NUwyMTMuNjM1IDM0LjY1NjZMMjIzLjEzIDQwLjYxOTJMMjIzLjM3MiA0MC43NzEzTDIyMy4xMzEgNDAuOTI2NkwyMTAuNTYxIDQ5LjA0NjdaTTIwNy4xNDEgNDQuNTkwOUwyMTYuMDg4IDM4LjgxMTVMMjE0Ljk5IDM4LjEyMkwyMDYuMDQzIDQzLjkwMTNMMjA3LjE0MSA0NC41OTA5Wk0yMTkuMjUzIDQwLjc5OUwyMTguMTU1IDQwLjEwOTVMMjEyLjM1IDQzLjg1ODhMMjEzLjQ0OCA0NC41NDg0TDIxOS4yNTMgNDAuNzk5WiIgZmlsbD0iI0Y0RjJGNCIgc3Ryb2tlPSIjNkY2RTc3IiBzdHJva2Utd2lkdGg9IjAuNTcyMzM1Ii8+CjwvZz4KPHJlY3QgeD0iLTAuNDcwMjM3IiB5PSIwLjg1NzA2OCIgd2lkdGg9IjYyLjg3NjEiIGhlaWdodD0iNi43NDA5MiIgdHJhbnNmb3JtPSJtYXRyaXgoLTAuODQzNDI0IDAuNTM3MjQ4IDAgMSAyOTIuMjI1IDYwLjQ2MjYpIiBmaWxsPSIjNkY2RTc3IiBzdHJva2U9IiM2RjZFNzciIHN0cm9rZS13aWR0aD0iMS4xMTUwNyIvPgo8bWFzayBpZD0icGF0aC0xNy1pbnNpZGUtM18xNjYyMF82NjE3IiBmaWxsPSJ3aGl0ZSI+CjxwYXRoIGQ9Ik0xNDIuNjQ4IDEwMC40MDFMMjA5LjQyIDM1Ljk4MzVMMjEwLjc3OCA0My40MjI5TDE0NC4wMDYgMTA3Ljg0TDE0Mi42NDggMTAwLjQwMVoiLz4KPC9tYXNrPgo8cGF0aCBkPSJNMTQyLjY0OCAxMDAuNDAxTDIwOS40MiAzNS45ODM1TDIxMC43NzggNDMuNDIyOUwxNDQuMDA2IDEwNy44NEwxNDIuNjQ4IDEwMC40MDFaIiBmaWxsPSIjRjRGMkY0Ii8+CjxwYXRoIGQ9Ik0yMTAuNzc4IDQzLjQyMjlMMjEwLjk3OCA0NC41MTk4TDIxMS43ODEgNDMuNzQ1NkwyMTEuNTggNDIuNjQ4N0wyMTAuNzc4IDQzLjQyMjlaTTE0NC4wMDYgMTA3Ljg0TDE0My4yMDMgMTA4LjYxNEwxNDMuNDA0IDEwOS43MTFMMTQ0LjIwNiAxMDguOTM3TDE0NC4wMDYgMTA3Ljg0Wk0yMDguNjE3IDM2Ljc1NzdMMjA5Ljk3NSA0NC4xOTcxTDIxMS41OCA0Mi42NDg3TDIxMC4yMjIgMzUuMjA5M0wyMDguNjE3IDM2Ljc1NzdaTTIxMC41NzggNDIuMzI1OUwxNDMuODA2IDEwNi43NDNMMTQ0LjIwNiAxMDguOTM3TDIxMC45NzggNDQuNTE5OEwyMTAuNTc4IDQyLjMyNTlaTTE0NC44MDggMTA3LjA2NkwxNDMuNDUgOTkuNjI2N0wxNDEuODQ1IDEwMS4xNzVMMTQzLjIwMyAxMDguNjE0TDE0NC44MDggMTA3LjA2NloiIGZpbGw9IiM2RjZFNzciIG1hc2s9InVybCgjcGF0aC0xNy1pbnNpZGUtM18xNjYyMF82NjE3KSIvPgo8cmVjdCB4PSIwLjExMDg4NiIgeT0iMC42MDc0NjkiIHdpZHRoPSI2My44MzA4IiBoZWlnaHQ9IjkxLjY2NDgiIHRyYW5zZm9ybT0ibWF0cml4KDAuOTE4NTY5IDAuMzk1MjYxIC0wLjcxOTY4MiAwLjY5NDMwNCAxNTAuNDQ1IDEwLjQxMDQpIiBmaWxsPSIjRjRGMkY0IiBzdHJva2U9IiM2RjZFNzciIHN0cm9rZS13aWR0aD0iMS4xMTUwNyIvPgo8ZyBjbGlwLXBhdGg9InVybCgjY2xpcDZfMTY2MjBfNjYxNykiPgo8cGF0aCBkPSJNMTcyLjUyMiAzNy42MjM3TDE2Mi44ODIgNDYuNzUyMUwxNTAuNzcxIDQxLjQwODNMMTYwLjQxMSAzMi4yNzk5TDE3Mi41MjIgMzcuNjIzN1pNMTczLjg5OSAzNi4zMTk2TDE2MS43ODkgMzAuOTc1OEMxNjAuODM3IDMwLjU1NTkgMTU5LjQzOSAzMC43OTkyIDE1OC42ODEgMzEuNTE2NUwxNDkuMDQxIDQwLjY0NDlDMTQ4LjI4NCA0MS4zNjIxIDE0OC40NDMgNDIuMjkyNSAxNDkuMzk0IDQyLjcxMjRMMTYxLjUwNSA0OC4wNTYyQzE2Mi40NTYgNDguNDc2IDE2My44NTQgNDguMjMyNyAxNjQuNjEyIDQ3LjUxNTVMMTc0LjI1MiAzOC4zODcxQzE3NS4wMSAzNy42Njk4IDE3NC44NTEgMzYuNzM5NSAxNzMuODk5IDM2LjMxOTZaIiBmaWxsPSIjNkY2RTc3Ii8+CjxwYXRoIGQ9Ik0xNTguMTY2IDQxLjI4NTNMMTYzLjMyIDQwLjA3OUwxNjMuMzk2IDQ0LjczNTRMMTUyLjgwNyA0MC4wNjMyTDE1Ny45NTYgMzguODYzTDE1OC4xNjYgNDEuMjg1M1oiIGZpbGw9IiM2RjZFNzciLz4KPHBhdGggZD0iTTE3Mi43MzggMzcuMTk5N0wxNzIuOTQ0IDM3LjAwNUwxNzIuNjggMzYuODg4NEwxNjAuNTY5IDMxLjU0NDdMMTYwLjMwNSAzMS40MjgxTDE2MC4xIDMxLjYyMjhMMTUwLjQ1OSA0MC43NTEyTDE1MC4yNTQgNDAuOTQ1OUwxNTAuNTE4IDQxLjA2MjVMMTYyLjYyOCA0Ni40MDYzTDE2Mi44OTMgNDYuNTIyOEwxNjMuMDk4IDQ2LjMyODFMMTcyLjczOCAzNy4xOTk3Wk0xNTMuNzA0IDM5Ljk4NTdMMTU3Ljg5MiAzOC44OTIxTDE1Ny45NTIgNDEuMTExTDE1Ny45NiA0MS4zOThMMTU4LjM3MyA0MS4yODk4TDE2My4xOTkgNDAuMDI1MUwxNjMuMDMgNDQuMTAwOUwxNTMuNzA0IDM5Ljk4NTdaTTE2MS41MzUgMzAuNjNMMTczLjY0NiAzNS45NzM4QzE3NC40NDYgMzYuMzI2OCAxNzQuNTg4IDM3LjExNjEgMTczLjk0IDM3LjczTDE2NC4zIDQ2Ljg1ODRDMTYzLjY1MiA0Ny40NzIzIDE2Mi40NjMgNDcuNjc0IDE2MS42NjIgNDcuMzIwOUwxNDkuNTUyIDQxLjk3NzFDMTQ4Ljc1MiA0MS42MjQxIDE0OC42MDkgNDAuODM0OCAxNDkuMjU3IDQwLjIyMDlMMTU4Ljg5OCAzMS4wOTI1QzE1OS41NDYgMzAuNDc4NiAxNjAuNzM1IDMwLjI3NjkgMTYxLjUzNSAzMC42M1oiIGZpbGw9IiNGNEYyRjQiIHN0cm9rZT0iIzZGNkU3NyIgc3Ryb2tlLXdpZHRoPSIwLjU3MjMzNSIvPgo8L2c+CjxyZWN0IHg9IjAuNjEyMjUiIHk9IjAuNzY4ODQyIiB3aWR0aD0iNjMuNzAzMyIgaGVpZ2h0PSI2LjYwOTUiIHRyYW5zZm9ybT0ibWF0cml4KDAuOTE4NTY5IDAuMzk1MjYxIDAuMTc5NTcxIDAuOTgzNzQ1IDgzLjEzODQgNzQuNDU3KSIgZmlsbD0iIzZGNkU3NyIgc3Ryb2tlPSIjNkY2RTc3IiBzdHJva2Utd2lkdGg9IjEuMTE1MDciLz4KPC9nPgo8ZGVmcz4KPGNsaXBQYXRoIGlkPSJjbGlwMF8xNjYyMF82NjE3Ij4KPHJlY3Qgd2lkdGg9IjQ2LjgyMDMiIGhlaWdodD0iNDYuODIwMyIgZmlsbD0id2hpdGUiIHRyYW5zZm9ybT0ibWF0cml4KC0wLjg2MTY0NyAwLjUwNzUwOCAwLjg3MDM3NSAwLjQ5MjM4OSAxNDcuMjExIDQwLjEzOTIpIi8+CjwvY2xpcFBhdGg+CjxjbGlwUGF0aCBpZD0iY2xpcDFfMTY2MjBfNjYxNyI+CjxyZWN0IHdpZHRoPSI0Ni44MjAzIiBoZWlnaHQ9IjQ2LjgyMDMiIGZpbGw9IndoaXRlIiB0cmFuc2Zvcm09Im1hdHJpeCgtMC44NjE2NDcgMC41MDc1MDggMC44NzAzNzUgMC40OTIzODkgMTQ3LjIxMSAzOS42MDAxKSIvPgo8L2NsaXBQYXRoPgo8Y2xpcFBhdGggaWQ9ImNsaXAyXzE2NjIwXzY2MTciPgo8cmVjdCB3aWR0aD0iNDYuODIwMyIgaGVpZ2h0PSI0Ni44MjAzIiBmaWxsPSJ3aGl0ZSIgdHJhbnNmb3JtPSJtYXRyaXgoLTAuODYxNjQ3IDAuNTA3NTA4IDAuODcwMzc1IDAuNDkyMzg5IDExOS40ODMgMjQuNzY1NikiLz4KPC9jbGlwUGF0aD4KPGNsaXBQYXRoIGlkPSJjbGlwM18xNjYyMF82NjE3Ij4KPHJlY3Qgd2lkdGg9IjQ2LjgyMDMiIGhlaWdodD0iNDYuODIwMyIgZmlsbD0id2hpdGUiIHRyYW5zZm9ybT0ibWF0cml4KC0wLjg2MTY0NyAwLjUwNzUwOCAwLjg3MDM3NSAwLjQ5MjM4OSAxMTkuNDgzIDI0LjIyMjcpIi8+CjwvY2xpcFBhdGg+CjxjbGlwUGF0aCBpZD0iY2xpcDRfMTY2MjBfNjYxNyI+CjxyZWN0IHdpZHRoPSIyMi40MzU4IiBoZWlnaHQ9IjIyLjQzNTgiIGZpbGw9IndoaXRlIiB0cmFuc2Zvcm09Im1hdHJpeCgtMC44NDA0NTQgMC41NDI4ODkgMC44NDY0MDIgMC41MzE1MiAyMTEuNzkgMzAuOTE1NSkiLz4KPC9jbGlwUGF0aD4KPGNsaXBQYXRoIGlkPSJjbGlwNV8xNjYyMF82NjE3Ij4KPHJlY3Qgd2lkdGg9IjIyLjQzNTgiIGhlaWdodD0iMjIuNDM1OCIgZmlsbD0id2hpdGUiIHRyYW5zZm9ybT0ibWF0cml4KC0wLjg0MDQ1NCAwLjU0Mjg4OSAwLjg0NjQwMiAwLjUzMTUyIDIxMS43OSAyOS44MDAzKSIvPgo8L2NsaXBQYXRoPgo8Y2xpcFBhdGggaWQ9ImNsaXA2XzE2NjIwXzY2MTciPgo8cmVjdCB3aWR0aD0iMjIuNDkyMSIgaGVpZ2h0PSIyMy4wMDIiIGZpbGw9IndoaXRlIiB0cmFuc2Zvcm09Im1hdHJpeCgwLjkyMzAzNSAwLjQwNzI4OSAtMC43MTg0NjcgMC42ODAzMjEgMTU5LjQ4MSAyNi41NzA4KSIvPgo8L2NsaXBQYXRoPgo8L2RlZnM+Cjwvc3ZnPgo=",alt:"media placeholder",background:"transparent"})}),C.jsx(u.xu,{gridColumn:"1",gridRow:"2",flexDirection:"column",padding:16,children:C.jsx(u.xu,{flexDirection:"column",alignItems:"center",children:C.jsxs(u.xv,{color:"grey12",variant:"h5",children:["Select a media or"," ",C.jsx(u.KH,{disabled:n,onFilesSelected:t,renderButton:t=>C.jsx(u.u,{title:tq.warning.uploadWhileUploading.title,content:tq.warning.uploadWhileUploading.description,visible:n,children:C.jsx(u.iC,{disabled:n,onClick:t,buttonText:"upload",inline:!0})})})," ","new ones."]})})})]})}function t0(){let{selectedMediaIds:t}=tK();return 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:0===t.size&&C.jsx(tX,{})})}function t1(t){let{assetType:n,onSelectedChange:r,actionContainerRef:i}=t;return C.jsx(u.SV,{renderError:()=>C.jsx(tH,{}),children:C.jsx(o.Suspense,{children:C.jsx(t$,{assetType:n,actionContainerRef:i,onSelectedChange:r,children:C.jsx(tZ,{children:C.jsx(t2,{})})})})})}function t2(){let{media:t}=tK();return C.jsxs(u.xu,{display:"grid",gridTemplateRows:"1fr 1fr",gridTemplateColumns:"1fr 292px",width:"100%",height:"100%",gap:16,children:[C.jsxs(u.xu,{position:"relative",display:"grid",gap:16,overflow:"hidden",gridColumn:"1",gridRow:"1 / -1",children:[C.jsx(tG,{}),C.jsx(u.xu,{width:"100%",children:C.jsxs(u.xv,{variant:"bold",children:[t.length," Medias"]})}),C.jsx(tJ,{}),C.jsx(tY,{})]}),C.jsx(t0,{})]})}var t4,t3,t5,t9,t8,t6,t7,ne,nt,nn,nr,ni,no,na,nu,ns,nc,nl,nd,nf,np,nh,nm,ng,ny,nv,nb,nx,nM,nT,nS,nw,nI={},n_={};t5={get exports(){return n_},set exports(e){n_=e}},function(t){var n="object"==typeof w?w:"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(t5.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])};t9=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)},t8=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},t6=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},t7=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},ne=function(t,n){return function(r,i){n(r,i,t)}},nt=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",d=!n&&t?i.static?t:t.prototype:null,f=n||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),p=!1,h=r.length-1;h>=0;h--){var m={};for(var g in i)m[g]="access"===g?{}:i[g];for(var g in i.access)m.access[g]=i.access[g];m.addInitializer=function(t){if(p)throw TypeError("Cannot add initializers after decoration has completed");a.push(u(t||null))};var y=(0,r[h])("accessor"===c?{get:f.get,set:f.set}:f[l],m);if("accessor"===c){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw TypeError("Object expected");(s=u(y.get))&&(f.get=s),(s=u(y.set))&&(f.set=s),(s=u(y.init))&&o.push(s)}else(s=u(y))&&("field"===c?o.push(s):f[l]=s)}d&&Object.defineProperty(d,i.name,f),p=!0},nn=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},nr=function(t){return"symbol"==typeof t?t:"".concat(t)},ni=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})},no=function(t,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,n)},na=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())})},nu=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])}}},ns=function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||nw(n,t,r)},nw=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]},nc=function(t){var n="function"==typeof Symbol&&Symbol.iterator,r=n&&t[n],i=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")},nl=function(t,n){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,o,a=r.call(t),u=[];try{for(;(void 0===n||n-- >0)&&!(i=a.next()).done;)u.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return u},nd=function(){for(var t=[],n=0;n<arguments.length;n++)t=t.concat(nl(arguments[n]));return t},nf=function(){for(var t=0,n=0,r=arguments.length;n<r;n++)t+=arguments[n].length;for(var i=Array(t),o=0,n=0;n<r;n++)for(var a=arguments[n],u=0,s=a.length;u<s;u++,o++)i[o]=a[u];return i},np=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))},nh=function(t){return this instanceof nh?(this.v=t,this):new nh(t)},nm=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 nh?Promise.resolve(r.value.v).then(c,l):d(a[0][2],r)}catch(i){d(a[0][3],i)}}function c(t){s("next",t)}function l(t){s("throw",t)}function d(t,n){t(n),a.shift(),a.length&&s(a[0][0],a[0][1])}},ng=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:nh(t[i](n)),done:!1}:o?o(n):n}:o}},ny=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 nc?nc(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)})}}},nv=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};nb=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)&&nw(n,t,i);return r(n,t),n},nx=function(t){return t&&t.__esModule?t:{default:t}},nM=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)},nT=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",t9),t("__assign",t8),t("__rest",t6),t("__decorate",t7),t("__param",ne),t("__esDecorate",nt),t("__runInitializers",nn),t("__propKey",nr),t("__setFunctionName",ni),t("__metadata",no),t("__awaiter",na),t("__generator",nu),t("__exportStar",ns),t("__createBinding",nw),t("__values",nc),t("__read",nl),t("__spread",nd),t("__spreadArrays",nf),t("__spreadArray",np),t("__await",nh),t("__asyncGenerator",nm),t("__asyncDelegator",ng),t("__asyncValues",ny),t("__makeTemplateObject",nv),t("__importStar",nb),t("__importDefault",nx),t("__classPrivateFieldGet",nM),t("__classPrivateFieldSet",nT),t("__classPrivateFieldIn",nS)});var nO={};function nk(t){return function(n){return function(r){return r.reduce(function(n,r){return t.alt(n,function(){return r})},n)}}}let nC=Object.freeze(Object.defineProperty({__proto__:null,altAll:nk},Symbol.toStringTag,{value:"Module"})),nN=Object.freeze(Object.defineProperty({__proto__:null,altAll:function(t){return nk(t)(t.zero())}},Symbol.toStringTag,{value:"Module"}));var nj=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))}}}}},nE=function(t){return function(){return{concat:function(n,r){return function(i){return t.concat(n(i),r(i))}}}}},nR=function(t){var n=nE(t);return function(){return{concat:n().concat,empty:function(){return t.empty}}}},nD=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}}},nA=function(t){var n=nD(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))}}}},nL=function(t){return function(n){return n(t)}};function nP(t){return t}function nF(t){return function(){return t}}var nz=nF(!0),nU=nF(!1),nW=nF(null),nB=nF(void 0);function nV(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 n$(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t}function nK(t){return t+1}function nY(t){return t-1}function nq(t){throw Error("Called `absurd` function which should be uncallable")}function nG(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],d=1;d<arguments.length;d++)l=arguments[d](l);return l}}var nZ=function(t,n){return n},nQ=function(){return{concat:function(t,n){return nV(t,n)},empty:nP}};let nH=Object.freeze(Object.defineProperty({__proto__:null,SK:nZ,absurd:nq,apply:nL,constFalse:nU,constNull:nW,constTrue:nz,constUndefined:nB,constVoid:nB,constant:nF,decrement:nY,flip:function(t){return function(n,r){return t(r,n)}},flow:nV,getBooleanAlgebra:nj,getEndomorphismMonoid:nQ,getMonoid:nR,getRing:nA,getSemigroup:nE,getSemiring:nD,hole:nq,identity:nP,increment:nK,not:function(t){return function(n){return!t(n)}},pipe:nG,tuple:n$,tupled:function(t){return function(n){return t.apply(void 0,n)}},unsafeCoerce:nP,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 nJ=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))},nX=function(t){return"None"===t._tag},n0=function(t){return"Some"===t._tag},n1={_tag:"None"},n2=function(t){return{_tag:"Some",value:t}},n4=function(t){return"Left"===t._tag},n3=function(t){return"Right"===t._tag},n5=function(t){return{_tag:"Left",left:t}},n9=function(t){return{_tag:"Right",right:t}},n8=function(t){return[t]},n6=function(t){return t.length>0},n7=function(t){return t[0]},re=function(t){return t.slice(1)},rt=[],rn={},rr=Object.prototype.hasOwnProperty,ri=function(t){return nJ([t[0]],t.slice(1),!0)};function ro(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 ra(t){return function(n){return function(r){return t.ap(t.map(r,function(t){return function(){return t}}),n)}}}function ru(t){return function(n){return function(r){return t.ap(t.map(r,function(){return function(t){return t}}),n)}}}function rs(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 rc(t){return function(n){return{concat:function(r,i){return t.ap(t.map(r,function(t){return function(r){return n.concat(t,r)}}),i)}}}}function rl(t,n,r){return function(i){for(var o=Array(r.length+1),a=0;a<r.length;a++)o[a]=r[a];return o[r.length]=i,0===n?t.apply(null,o):rl(t,n-1,o)}}var rd={1:function(t){return[t]},2:function(t){return function(n){return[t,n]}},3:function(t){return function(n){return function(r){return[t,n,r]}}},4:function(t){return function(n){return function(r){return function(i){return[t,n,r,i]}}}},5:function(t){return function(n){return function(r){return function(i){return function(o){return[t,n,r,i,o]}}}}}};function rf(t){return rr.call(rd,t)||(rd[t]=rl(n$,t-1,[])),rd[t]}function rp(t){var n=t.length;switch(n){case 1:return function(n){var r;return(r={})[t[0]]=n,r};case 2:return function(n){return function(r){var i;return(i={})[t[0]]=n,i[t[1]]=r,i}};case 3:return function(n){return function(r){return function(i){var o;return(o={})[t[0]]=n,o[t[1]]=r,o[t[2]]=i,o}}};case 4:return function(n){return function(r){return function(i){return function(o){var a;return(a={})[t[0]]=n,a[t[1]]=r,a[t[2]]=i,a[t[3]]=o,a}}}};case 5:return function(n){return function(r){return function(i){return function(o){return function(a){var u;return(u={})[t[0]]=n,u[t[1]]=r,u[t[2]]=i,u[t[3]]=o,u[t[4]]=a,u}}}}};default:return rl(function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];for(var o={},a=0;a<n;a++)o[t[a]]=r[a];return o},n-1,[])}}let rh=Object.freeze(Object.defineProperty({__proto__:null,ap:ro,apFirst:ra,apS:rs,apSecond:ru,getApplySemigroup:rc,sequenceS:function(t){return function(n){for(var r=Object.keys(n),i=r.length,o=rp(r),a=t.map(n[r[0]],o),u=1;u<i;u++)a=t.ap(a,n[r[u]]);return a}},sequenceT:function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i=n.length,o=rf(i),a=t.map(n[0],o),u=1;u<i;u++)a=t.ap(a,n[u]);return a}}},Symbol.toStringTag,{value:"Module"}));function rm(t,n){return function(r){return function(i){return t.map(i,function(t){return n.map(t,r)})}}}function rg(t){return function(n){return function(r){return t.map(r,function(t){return t(n)})}}}function ry(t){return function(n){return function(r){return t.map(r,function(t){var r;return(r={})[n]=t,r})}}}function rv(t,n){var r=rm(t,n);return{map:function(t,n){return nG(t,r(n))}}}let rb=Object.freeze(Object.defineProperty({__proto__:null,bindTo:ry,flap:rg,getFunctorComposition:rv,map:rm},Symbol.toStringTag,{value:"Module"}));function rx(t){var n=rc(t);return function(r){return{concat:n(r).concat,empty:t.of(r.empty)}}}function rM(t,n){var r=rv(t,n).map,i=ro(t,n);return{map:r,of:function(r){return t.of(n.of(r))},ap:function(t,n){return nG(t,i(n))}}}let rT=Object.freeze(Object.defineProperty({__proto__:null,getApplicativeComposition:rM,getApplicativeMonoid:rx},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 rw(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 rI=Object.freeze(Object.defineProperty({__proto__:null,bind:rw,chainFirst:rS},Symbol.toStringTag,{value:"Module"}));function r_(t){return function(n){return function(r){return t.fromEither(nX(r)?n5(n()):n9(r.value))}}}function rO(t){return function(n,r){return function(i){return t.fromEither(n(i)?n9(i):n5(r(i)))}}}function rk(t){var n=r_(t);return function(t){var r=n(t);return function(t){return nV(t,r)}}}function rC(t,n){var r=rk(t);return function(t){var i=r(t);return function(t){return function(r){return n.chain(r,i(t))}}}}function rN(t){return function(n){return nV(n,t.fromEither)}}function rj(t,n){var r=rN(t);return function(t){return function(i){return n.chain(i,r(t))}}}function rE(t,n){return nV(rN(t),rS(n))}function rR(t,n){return function(r,i){return function(o){return n.chain(o,function(n){return t.fromEither(r(n)?n9(n):n5(i(n)))})}}}let rD=Object.freeze(Object.defineProperty({__proto__:null,chainEitherK:rj,chainFirstEitherK:rE,chainOptionK:rC,filterOrElse:rR,fromEitherK:rN,fromOption:r_,fromOptionK:rk,fromPredicate:rO},Symbol.toStringTag,{value:"Module"}));var rA=function(t){return{equals:function(n,r){return n===r||t(n,r)}}},rL=function(t){return rA(function(n,r){for(var i in t)if(!t[i].equals(n[i],r[i]))return!1;return!0})},rP=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return rA(function(n,r){return t.every(function(t,i){return t.equals(n[i],r[i])})})},rF=function(t){return function(n){return rA(function(r,i){return n.equals(t(r),t(i))})}},rz={equals:function(t,n){return t===n}},rU={equals:function(){return!0}},rW=function(){return{concat:function(t,n){return rA(function(r,i){return t.equals(r,i)&&n.equals(r,i)})}}},rB=function(){return{concat:rW().concat,empty:rU}},rV={URI:"Eq",contramap:function(t,n){return nG(t,rF(n))}},r$=rz.equals;let rK=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:rV,URI:"Eq",contramap:rF,eq:rV,eqBoolean:rz,eqDate:{equals:function(t,n){return t.valueOf()===n.valueOf()}},eqNumber:rz,eqStrict:rz,eqString:rz,fromEquals:rA,getMonoid:rB,getSemigroup:rW,getStructEq:rL,getTupleEq:rP,strictEqual:r$,struct:rL,tuple:rP},Symbol.toStringTag,{value:"Module"}));var rY=function(t){return function(n,r){return n===r||0===t(n,r)}},rq=function(t){return{equals:rY(t),compare:function(n,r){return n===r?0:t(n,r)}}},rG=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return rq(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])})},rZ=function(t){return rq(function(n,r){return t.compare(r,n)})},rQ=function(t){return function(n){return rq(function(r,i){return n.compare(t(r),t(i))})}},rH=function(){return{concat:function(t,n){return rq(function(r,i){var o=t.compare(r,i);return 0!==o?o:n.compare(r,i)})}}},rJ=function(){return{concat:rH().concat,empty:rq(function(){return 0})}},rX={URI:"Ord",contramap:function(t,n){return nG(t,rQ(n))}},r0={equals:nz,compare:nF(0)},r1=function(t){return function(n){return function(r){return r===n||0===t.compare(r,n)}}},r2=function(t){return function(n,r){return -1===t.compare(n,r)}},r4=function(t){return function(n,r){return 1===t.compare(n,r)}},r3=function(t){return function(n,r){return 1!==t.compare(n,r)}},r5=function(t){return function(n,r){return -1!==t.compare(n,r)}},r9=function(t){return function(n,r){return n===r||1>t.compare(n,r)?n:r}},r8=function(t){return function(n,r){return n===r||t.compare(n,r)>-1?n:r}},r6=function(t){var n=r9(t),r=r8(t);return function(t,i){return function(o){return r(n(o,i),t)}}},r7=function(t){var n=r2(t),r=r4(t);return function(t,i){return function(o){return!(n(o,t)||r(o,i))}}},ie={equals:rz.equals,compare:function(t,n){return t<n?-1:t>n?1:0}},it=nG(ie,rQ(function(t){return t.valueOf()}));let ir=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:rX,URI:"Ord",between:r7,clamp:r6,contramap:rQ,equals:r1,equalsDefault:rY,fromCompare:rq,geq:r5,getDualOrd:rZ,getMonoid:rJ,getSemigroup:rH,getTupleOrd:rG,gt:r4,leq:r3,lt:r2,max:r8,min:r9,ord:rX,ordBoolean:ie,ordDate:it,ordNumber:ie,ordString:ie,reverse:rZ,trivial:r0,tuple:rG},Symbol.toStringTag,{value:"Module"}));var ii=function(t){return{concat:function(n,r){return t.concat(r,n)}}},io=function(t){return function(n){return{concat:function(r,i){return t(r)?n.concat(r,i):i}}}},ia=function(t){return function(n){return{concat:function(r,i){return t(i)?n.concat(r,i):r}}}},iu=function(t){return function(n){return{concat:function(r,i){return n.concat(t(r),t(i))}}}},is=function(t){return function(n){return function(r){return r.reduce(function(n,r){return t.concat(n,r)},n)}}};let ic=Object.freeze(Object.defineProperty({__proto__:null,concatAll:is,endo:iu,filterFirst:io,filterSecond:ia,reverse:ii},Symbol.toStringTag,{value:"Module"}));var il=function(t){return{concat:r9(t)}},id=function(t){return{concat:r8(t)}},ip=function(t){return{concat:function(){return t}}},ih=function(t){return{concat:function(n,r){var i={};for(var o in t)rr.call(t,o)&&(i[o]=t[o].concat(n[o],r[o]));return i}}},im=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])})}}},ig=function(t){return function(n){return{concat:function(r,i){return n.concat(r,n.concat(t,i))}}}},iy=function(){return{concat:nP}},iv=function(){return{concat:function(t,n){return n}}},ib=ip(void 0),ix=function(){return{concat:function(t,n){return Object.assign({},t,n)}}},iM={concat:function(t,n){return t&&n}},iT={concat:function(t,n){return t||n}},iS={concat:function(t,n){return t+n}},iw={concat:function(t,n){return t+n}},iI={concat:function(t,n){return t*n}};let i_=Object.freeze(Object.defineProperty({__proto__:null,concatAll:is,constant:ip,first:iy,fold:function(t){var n=is(t);return function(t,r){return void 0===r?n(t):n(t)(r)}},getDualSemigroup:ii,getFirstSemigroup:iy,getFunctionSemigroup:nE,getIntercalateSemigroup:ig,getJoinSemigroup:id,getLastSemigroup:iv,getMeetSemigroup:il,getObjectSemigroup:ix,getStructSemigroup:ih,getTupleSemigroup:im,intercalate:ig,last:iv,max:id,min:il,reverse:ii,semigroupAll:iM,semigroupAny:iT,semigroupProduct:iI,semigroupString:iS,semigroupSum:iw,semigroupVoid:ib,struct:ih,tuple:im},Symbol.toStringTag,{value:"Module"}));var iO=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))},ik=function(t,n){return t<0||t>=n.length},iC=function(t){return function(n){return iO([t],n,!0)}},iN=function(t){return function(n){return iO(iO([],n,!0),[t],!1)}},ij=function(t,n,r){if(n6(r)){var i=ri(r);return i.splice(t,0,n),i}return[n]},iE=function(t,n,r){if(r[t]===n)return r;var i=ri(r);return i[t]=n,i},iR=function(t){return function(n){if(1===n.length)return n;for(var r=[oK(n)],i=oY(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}},iD=function(t){if(n6(t)){var n=rJ();return iZ(t.reduce(n.concat,n.empty))}return nP},iA=function(t){var n=iR(t);return function(t){return function(r){return n(nG(r,iK(t)))}}},iL=function(t){return function(n){var r=n.length,i=Math.round(t)%r;if(ik(Math.abs(i),n)||0===i)return n;if(!(i<0))return iL(i-r)(n);var o=i3(-i)(n),a=o[0];return nG(o[1],iK(a))}},iP=function(t){return n6(t)?n2(t):n1},iF=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}},iz=function(t){return iF(function(){return t})},iU=function(t,n){return t<=n?iF(function(n){return t+n})(n-t+1):[t]},iW=function(t){return[oK(t),oY(t)]},iB=function(t){return[oG(t),oq(t)]},iV=function(t){return iP(t.slice())};function i$(t){return function(n){return n.concat(t)}}function iK(t,n){return n?t.concat(n):function(n){return n.concat(t)}}var iY=function(t){return 1===t.length?t:iO([oq(t)],t.slice(0,-1).reverse(),!0)};function iq(t){return function(n){var r=n.length;if(0===r)return rt;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 iG=function(t){return function(n){for(var r={},i=0;i<n.length;i++){var o=n[i],a=t(o);rr.call(r,a)?r[a].push(o):r[a]=[o]}return r}},iZ=function(t){return function(n){return 1===n.length?n:n.slice().sort(t.compare)}},iQ=function(t,n){return iH(t,function(){return n})},iH=function(t,n){return function(r){return ik(t,r)?n1:n2(iE(t,n(r[t]),r))}},iJ=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},iX=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]},i0=function(t){return function(n){for(var r=[t,n[0]],i=1;i<n.length;i++)r.push(t,n[i]);return r}},i1=function(t){return function(n){var r=oY(n);return n6(r)?nG(r,i0(t),iC(oK(n))):n}},i2=function(t){return function(n){for(var r=ri(t(0,oK(n))),i=1;i<n.length;i++)r.push.apply(r,t(i,n[i]));return r}},i4=function(t){return function(n){for(var r=t(n),i=r[0],o=r[1],a=[i],u=o;n6(u);){var s=t(u),c=s[0],l=s[1];a.push(c),u=l}return a}},i3=function(t){return function(n){var r=Math.max(1,t);return r>=n.length?[n,rt]:[nG(n.slice(1,r),iC(oK(n))),n.slice(r)]}},i5=function(t){return i4(i3(t))},i9=function(t,n){return nG(t,ov(n))},i8=function(t,n){return nG(t,ob(n))},i6=function(t,n){return nG(t,op(n))},i7=function(t,n){return nG(t,oh(n))},oe=function(t,n){return nG(t,om(n))},ot=function(t,n,r){return nG(t,ox(n,r))},on=function(t){var n=oM(t);return function(t,r){return nG(t,n(r))}},or=function(t,n,r){return nG(t,oT(n,r))},oi=function(t){var n=o_(t);return function(t,r){return nG(t,n(r))}},oo=function(t,n){return nG(t,of(n))},oa=function(t,n,r){return nG(t,oS(n,r))},ou=function(t){var n=ow(t);return function(t,r){return nG(t,n(r))}},oc=function(t,n,r){return nG(t,oI(n,r))},ol=function(t){var n=ok(t);return function(t,r){return nG(t,n(r))}},od=function(t){return function(n){return nG(n,i$(t()))}},of=od,op=function(t){return oh(function(n){return nG(t,ov(n))})},oh=function(t){return i2(function(n,r){return t(r)})},om=function(t){return function(n){for(var r=oY(n),i=[t(n)];n6(r);)i.push(t(r)),r=oY(r);return i}},og=om(nP),oy=oh(nP),ov=function(t){return ob(function(n,r){return t(r)})},ob=function(t){return function(n){for(var r=[t(0,oK(n))],i=1;i<n.length;i++)r.push(t(i,n[i]));return r}},ox=function(t,n){return oS(t,function(t,r,i){return n(r,i)})},oM=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]))}}},oT=function(t,n){return oI(t,function(t,r,i){return n(r,i)})},oS=function(t,n){return function(r){return r.reduce(function(t,r,i){return n(i,t,r)},t)}},ow=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]))}}},oI=function(t,n){return function(r){return r.reduceRight(function(t,r,i){return n(i,r,t)},t)}},o_=function(t){var n=ok(t);return function(t){return n(function(n,r){return t(r)})}},oO=function(t){return ok(t)(nZ)},ok=function(t){return function(n){return function(r){for(var i=t.map(n(0,oK(r)),n8),o=1;o<r.length;o++)i=t.ap(t.map(i,function(t){return function(n){return nG(t,iN(n))}}),n(o,r[o]));return i}}},oC="ReadonlyNonEmptyArray",oN=function(t){return{show:function(n){return"[".concat(n.map(t.show).join(", "),"]")}}},oj=function(){return{concat:iK}},oE=function(t){return rA(function(n,r){return n.length===r.length&&n.every(function(n,i){return t.equals(n,r[i])})})},oR=function(t){var n=iA(t);return{concat:function(t,r){return n(r)(t)}}},oD={URI:oC,map:i9},oA=rg(oD),oL={URI:oC,map:i9,ap:i6},oP=ra(oL),oF=ru(oL),oz={URI:oC,map:i9,ap:i6,chain:i7},oU=rS(oz),oW=n8(rn),oB=ry(oD),oV=rw(oz),o$=rs(oL),oK=n7,oY=re,oq=function(t){return t[t.length-1]},oG=function(t){return t.slice(0,-1)},oZ=function(t){var n=il(t);return function(t){return t.reduce(n.concat)}},oQ=function(t){var n=id(t);return function(t){return t.reduce(n.concat)}},oH=function(t){return function(n){return n.reduce(t.concat)}},oJ=function(t){return function(n){return t(oK(n),oY(n))}},oX=function(t){return function(n){return t(oG(n),oq(n))}},o0=function(t){return function(n){return iO([t(oK(n))],oY(n),!0)}},o1=function(t){return o0(function(){return t})},o2=function(t){return function(n){return nG(oG(n),iN(t(oq(n))))}},o4=function(t){return o2(function(){return t})},o3=function(t){var n=oH(t);return function(t){return nV(i1(t),n)}},o5=function(t){return function(n){return iP(n.filter(function(n,r){return t(r,n)}))}};function o9(t,n){return void 0===n?iC(t):nG(n,iC(t))}var o8=function(t,n){return nG(t,iK([n]))},o6=function(t,n){return function(r){return t<0||t>r.length?n1:n2(ij(t,n,r))}};let o7=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:oC,map:i9,alt:oo},Applicative:{URI:oC,map:i9,ap:i6,of:n8},Apply:oL,Chain:oz,Comonad:{URI:oC,map:i9,extend:oe,extract:n7},Do:oW,Foldable:{URI:oC,reduce:ot,foldMap:on,reduceRight:or},FoldableWithIndex:{URI:oC,reduce:ot,foldMap:on,reduceRight:or,reduceWithIndex:oa,foldMapWithIndex:ou,reduceRightWithIndex:oc},Functor:oD,FunctorWithIndex:{URI:oC,map:i9,mapWithIndex:i8},Monad:{URI:oC,map:i9,ap:i6,of:n8,chain:i7},Pointed:{URI:oC,of:n8},Traversable:{URI:oC,map:i9,reduce:ot,foldMap:on,reduceRight:or,traverse:oi,sequence:oO},TraversableWithIndex:{URI:oC,map:i9,mapWithIndex:i8,reduce:ot,foldMap:on,reduceRight:or,traverse:oi,sequence:oO,reduceWithIndex:oa,foldMapWithIndex:ou,reduceRightWithIndex:oc,traverseWithIndex:ol},URI:oC,alt:of,altW:od,ap:op,apFirst:oP,apS:o$,apSecond:oF,append:iN,appendW:iN,bind:oV,bindTo:oB,chain:oh,chainFirst:oU,chainWithIndex:i2,chop:i4,chunksOf:i5,concat:iK,concatAll:oH,concatW:i$,cons:o9,duplicate:og,empty:rt,extend:om,extract:n7,filter:function(t){return o5(function(n,r){return t(r)})},filterWithIndex:o5,flap:oA,flatten:oy,fold:oH,foldMap:oM,foldMapWithIndex:ow,fromArray:iV,fromReadonlyArray:iP,getEq:oE,getSemigroup:oj,getShow:oN,getUnionSemigroup:oR,group:iq,groupBy:iG,groupSort:function(t){var n=iZ(t),r=iq(t);return function(t){return n6(t)?r(n(t)):rt}},head:oK,init:oG,insertAt:o6,intercalate:o3,intersperse:i1,isNonEmpty:n6,isOutOfBound:ik,last:oq,makeBy:iF,map:ov,mapWithIndex:ob,matchLeft:oJ,matchRight:oX,max:oQ,min:oZ,modifyAt:iH,modifyHead:o0,modifyLast:o2,of:n8,prepend:iC,prependAll:i0,prependToAll:i0,prependW:iC,range:iU,readonlyNonEmptyArray:{URI:oC,of:n8,map:i9,mapWithIndex:i8,ap:i6,chain:i7,extend:oe,extract:n7,reduce:ot,foldMap:on,reduceRight:or,traverse:oi,sequence:oO,reduceWithIndex:oa,foldMapWithIndex:ou,reduceRightWithIndex:oc,traverseWithIndex:ol,alt:oo},reduce:ox,reduceRight:oT,reduceRightWithIndex:oI,reduceWithIndex:oS,replicate:iz,reverse:iY,rotate:iL,sequence:oO,snoc:o8,sort:iZ,sortBy:iD,splitAt:i3,tail:oY,traverse:o_,traverseWithIndex:ok,unappend:iB,uncons:iW,union:iA,uniq:iR,unprepend:iW,unsafeInsertAt:ij,unsafeUpdateAt:iE,unsnoc:iB,unzip:iX,updateAt:iQ,updateHead:o1,updateLast:o4,zip:function t(n,r){return void 0===r?function(r){return t(r,n)}:iJ(n,r,function(t,n){return[t,n]})},zipWith:iJ},Symbol.toStringTag,{value:"Module"}));var ae=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))},at=function(t){return t.length>0},an=function(t,n){return t<0||t>=n.length},ar=function(t){return function(n){return ae([t],n,!0)}},ai=function(t){return function(n){return ae(ae([],n,!0),[t],!1)}},ao=function(t,n,r){if(at(r)){var i=ad(r);return i.splice(t,0,n),i}return[n]},aa=function(t,n,r){var i=ad(r);return i[t]=n,i},au=function(t){return function(n){if(1===n.length)return aO(n);for(var r=[uy(n)],i=uv(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}},as=function(t){if(at(t)){var n=rJ();return aS(t.reduce(n.concat,n.empty))}return aO},ac=function(t){var n=au(t);return function(t){return function(r){return n(nG(r,ab(t)))}}},al=function(t){return function(n){var r=n.length,i=Math.round(t)%r;if(an(Math.abs(i),n)||0===i)return aO(n);if(!(i<0))return al(i-r)(n);var o=aA(-i)(n),a=o[0];return nG(o[1],ab(a))}},ad=ri,af=function(t){return at(t)?n2(t):n1},ap=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}},ah=function(t){return ap(function(){return t})},am=function(t,n){return t<=n?ap(function(n){return t+n})(n-t+1):[t]},ag=function(t){return[uy(t),uv(t)]},ay=function(t){return[ux(t),ub(t)]};function av(t){return function(n){return n.concat(t)}}function ab(t,n){return n?t.concat(n):function(n){return n.concat(t)}}var ax=function(t){return ae([ub(t)],t.slice(0,-1).reverse(),!0)};function aM(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 aT=function(t){return function(n){for(var r={},i=0;i<n.length;i++){var o=n[i],a=t(o);rr.call(r,a)?r[a].push(o):r[a]=[o]}return r}},aS=function(t){return function(n){return n.slice().sort(t.compare)}},aw=function(t,n){return function(r){return t<0||t>r.length?n1:n2(ao(t,n,r))}},aI=function(t,n){return a_(t,function(){return n})},a_=function(t,n){return function(r){return an(t,r)?n1:n2(aa(t,n(r[t]),r))}},aO=ad,ak=function(t){return[t]},aC=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},aN=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]},aj=function(t){return function(n){for(var r=[t,n[0]],i=1;i<n.length;i++)r.push(t,n[i]);return r}},aE=function(t){return function(n){var r=uv(n);return at(r)?nG(r,aj(t),ar(uy(n))):aO(n)}},aR=function(t){return function(n){for(var r=ad(t(0,uy(n))),i=1;i<n.length;i++)r.push.apply(r,t(i,n[i]));return r}},aD=function(t){return function(n){for(var r=t(n),i=r[0],o=r[1],a=[i],u=o;at(u);){var s=t(u),c=s[0],l=s[1];a.push(c),u=l}return a}},aA=function(t){return function(n){var r=Math.max(1,t);return r>=n.length?[aO(n),[]]:[nG(n.slice(1,r),ar(uy(n))),n.slice(r)]}},aL=function(t){return aD(aA(t))},aP=function(t,n){return nG(t,a3(n))},aF=function(t,n){return nG(t,a5(n))},az=function(t,n){return nG(t,aX(n))},aU=function(t,n){return nG(t,a0(n))},aW=function(t,n){return nG(t,a1(n))},aB=function(t,n,r){return nG(t,a9(n,r))},aV=function(t){var n=oM(t);return function(t,r){return nG(t,n(r))}},a$=function(t,n,r){return nG(t,a6(n,r))},aK=function(t){var n=ue(t);return function(t,r){return nG(t,n(r))}},aY=function(t,n){return nG(t,aJ(n))},aq=function(t,n,r){return nG(t,a8(n,r))},aG=function(t){var n=ow(t);return function(t,r){return nG(t,n(r))}},aZ=function(t,n,r){return nG(t,a7(n,r))},aQ=function(t){var n=un(t);return function(t,r){return nG(t,n(r))}},aH=function(t){return function(n){return nG(n,av(t()))}},aJ=aH,aX=function(t){return a0(function(n){return nG(t,a3(n))})},a0=function(t){return aR(function(n,r){return t(r)})},a1=function(t){return function(n){for(var r=uv(n),i=[t(n)];at(r);)i.push(t(r)),r=uv(r);return i}},a2=a1(nP),a4=a0(nP),a3=function(t){return a5(function(n,r){return t(r)})},a5=function(t){return function(n){for(var r=[t(0,uy(n))],i=1;i<n.length;i++)r.push(t(i,n[i]));return r}},a9=ox,a8=oS,a6=oT,a7=oI,ue=function(t){var n=un(t);return function(t){return n(function(n,r){return t(r)})}},ut=function(t){return un(t)(function(t,n){return n})},un=function(t){return function(n){return function(r){for(var i=t.map(n(0,uy(r)),ak),o=1;o<r.length;o++)i=t.ap(t.map(i,function(t){return function(n){return nG(t,ai(n))}}),n(o,r[o]));return i}}},ur="NonEmptyArray",ui=function(){return{concat:ab}},uo=function(t){var n=ac(t);return{concat:function(t,r){return n(r)(t)}}},ua={URI:ur,map:aP},uu=rg(ua),us={URI:ur,map:aP,ap:az},uc=ra(us),ul=ru(us),ud={URI:ur,map:aP,ap:az,chain:aU},uf=rS(ud),up=ak(rn),uh=ry(ua),um=rw(ud),ug=rs(us),uy=oK,uv=function(t){return t.slice(1)},ub=oq,ux=function(t){return t.slice(0,-1)},uM=function(t){return function(n){return n.reduce(t.concat)}},uT=function(t){return function(n){return t(uy(n),uv(n))}},uS=function(t){return function(n){return t(ux(n),ub(n))}},uw=function(t){return function(n){return ae([t(uy(n))],uv(n),!0)}},uI=function(t){return uw(function(){return t})},u_=function(t){return function(n){return nG(ux(n),ai(t(ub(n))))}},uO=function(t){return u_(function(){return t})},uk=function(t){return function(n){return af(n.filter(function(n,r){return t(r,n)}))}};function uC(t,n){return void 0===n?ar(t):nG(n,ar(t))}var uN=function(t,n){return nG(t,ai(n))};let uj=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:ur,map:aP,alt:aY},Applicative:{URI:ur,map:aP,ap:az,of:ak},Apply:us,Chain:ud,Comonad:{URI:ur,map:aP,extend:aW,extract:oK},Do:up,Foldable:{URI:ur,reduce:aB,foldMap:aV,reduceRight:a$},FoldableWithIndex:{URI:ur,reduce:aB,foldMap:aV,reduceRight:a$,reduceWithIndex:aq,foldMapWithIndex:aG,reduceRightWithIndex:aZ},Functor:ua,FunctorWithIndex:{URI:ur,map:aP,mapWithIndex:aF},Monad:{URI:ur,map:aP,ap:az,of:ak,chain:aU},Pointed:{URI:ur,of:ak},Traversable:{URI:ur,map:aP,reduce:aB,foldMap:aV,reduceRight:a$,traverse:aK,sequence:ut},TraversableWithIndex:{URI:ur,map:aP,mapWithIndex:aF,reduce:aB,foldMap:aV,reduceRight:a$,traverse:aK,sequence:ut,reduceWithIndex:aq,foldMapWithIndex:aG,reduceRightWithIndex:aZ,traverseWithIndex:aQ},URI:ur,alt:aJ,altW:aH,ap:aX,apFirst:uc,apS:ug,apSecond:ul,append:ai,appendW:ai,bind:um,bindTo:uh,chain:a0,chainFirst:uf,chainWithIndex:aR,chop:aD,chunksOf:aL,concat:ab,concatAll:uM,concatW:av,cons:uC,copy:aO,duplicate:a2,extend:a1,extract:oK,filter:function(t){return uk(function(n,r){return t(r)})},filterWithIndex:uk,flap:uu,flatten:a4,fold:oH,foldMap:oM,foldMapWithIndex:ow,fromArray:af,fromReadonlyNonEmptyArray:ad,getEq:oE,getSemigroup:ui,getShow:oN,getUnionSemigroup:uo,group:aM,groupBy:aT,groupSort:function(t){var n=aS(t),r=aM(t);return function(t){return at(t)?r(n(t)):[]}},head:uy,init:ux,insertAt:aw,intercalate:o3,intersperse:aE,isNonEmpty:at,isOutOfBound:an,last:ub,makeBy:ap,map:a3,mapWithIndex:a5,matchLeft:uT,matchRight:uS,max:oQ,min:oZ,modifyAt:a_,modifyHead:uw,modifyLast:u_,nonEmptyArray:{URI:ur,of:ak,map:aP,mapWithIndex:aF,ap:az,chain:aU,extend:aW,extract:oK,reduce:aB,foldMap:aV,reduceRight:a$,traverse:aK,sequence:ut,reduceWithIndex:aq,foldMapWithIndex:aG,reduceRightWithIndex:aZ,traverseWithIndex:aQ,alt:aY},of:ak,prepend:ar,prependAll:aj,prependToAll:aj,prependW:ar,range:am,reduce:a9,reduceRight:a6,reduceRightWithIndex:a7,reduceWithIndex:a8,replicate:ah,reverse:ax,rotate:al,sequence:ut,snoc:uN,sort:aS,sortBy:as,splitAt:aA,tail:uv,traverse:ue,traverseWithIndex:un,unappend:ay,uncons:ag,union:ac,uniq:au,unprepend:ag,unsafeInsertAt:ao,unsafeUpdateAt:aa,unsnoc:ay,unzip:aN,updateAt:aI,updateHead:uI,updateLast:uO,zip:function t(n,r){return void 0===r?function(r){return t(r,n)}:aC(n,r,function(t,n){return[t,n]})},zipWith:aC},Symbol.toStringTag,{value:"Module"}));var uE=function(t){return"number"==typeof t},uR={equals:function(t,n){return t===n}},uD={equals:uR.equals,compare:function(t,n){return t<n?-1:t>n?1:0}},uA={equals:uR.equals,compare:uD.compare,top:1/0,bottom:-1/0},uL={concat:function(t,n){return t-n}},uP={concat:function(t,n){return t+n}},uF={concat:function(t,n){return t*n}},uz={concat:uP.concat,empty:0},uU={concat:uF.concat,empty:1},uW={add:uP.concat,zero:0,mul:uF.concat,one:1,sub:uL.concat,degree:function(t){return 1},div:function(t,n){return t/n},mod:function(t,n){return t%n}};let uB=Object.freeze(Object.defineProperty({__proto__:null,Bounded:uA,Eq:uR,Field:uW,MagmaSub:uL,MonoidProduct:uU,MonoidSum:uz,Ord:uD,SemigroupProduct:uF,SemigroupSum:uP,Show:{show:function(t){return JSON.stringify(t)}},isNumber:uE},Symbol.toStringTag,{value:"Module"}));var uV=function(t,n){return{left:t,right:n}},u$=function(t,n){return nG(t,uq(n))},uK=function(t,n,r){return nG(t,uG(n,r))},uY=function(t){return function(n){return uV(uJ(n),t(uX(n)))}},uq=function(t){return function(n){return uV(t(uJ(n)),uX(n))}},uG=function(t,n){return function(r){return uV(t(uJ(r)),n(uX(r)))}},uZ="Separated",uQ={URI:uZ,map:function(t,n){return nG(t,uY(n))}},uH=rg(uQ),uJ=function(t){return t.left},uX=function(t){return t.right};let u0=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:{URI:uZ,mapLeft:u$,bimap:uK},Functor:uQ,URI:uZ,bimap:uG,flap:uH,left:uJ,map:uY,mapLeft:uq,right:uX,separated:uV},Symbol.toStringTag,{value:"Module"}));function u1(t,n){return function(r){var i=t.traverse(r);return function(t,o){return r.map(i(t,o),n.separate)}}}function u2(t,n){return function(r){var i=t.traverse(r);return function(t,o){return r.map(i(t,o),n.compact)}}}function u4(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?n2(r):n1})})}}}}let u3=Object.freeze(Object.defineProperty({__proto__:null,filterE:u4,wiltDefault:u1,witherDefault:u2},Symbol.toStringTag,{value:"Module"}));function u5(t,n){return function(r){return r?n.of(void 0):t.zero()}}let u9=Object.freeze(Object.defineProperty({__proto__:null,guard:u5},Symbol.toStringTag,{value:"Module"}));var 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))},u6=function(t){return 0===t.length},u7=function(t,n){return t<=0?lf:iF(n)(t)},se=function(t,n){return u7(t,function(){return n})},st=function(t){return nX(t)?lf:[t.value]},sn=function(t){return n4(t)?lf:[t.right]},sr=function(t,n){return function(r){return n6(r)?n(r):t()}},si=function(t,n){return function(r){return n6(r)?n(oK(r),oY(r)):t()}},so=function(t,n){return function(r){return n6(r)?n(oG(r),oq(r)):t()}},sa=function(t){return function(n){if(u6(n))return lf;for(var r=[],i=0;i<n.length;i++)r.push.apply(r,t(i,n[i]));return r}},su=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}},ss=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}},sc=function(t){return t.length};function sl(t,n){return void 0===n?function(n){return sl(t,n)}:ik(t,n)?n1:n2(n[t])}var sd=function(t){return n6(t)?n2(oK(t)):n1},sf=function(t){return n6(t)?n2(oq(t)):n1},sp=function(t){return n6(t)?n2(oY(t)):n1},sh=function(t){return n6(t)?n2(oG(t)):n1},sm=function(t){return function(n){return ik(t,n)?n:0===t?lf:n.slice(0,t)}},sg=function(t){return function(n){return ik(t,n)?n:0===t?lf:n.slice(-t)}},sy=function(t,n){for(var r=t.length,i=0;i<r&&n(t[i]);i++);return i},sv=function(t){return function(n){return t<=0||u6(n)?n:t>=n.length?lf:n.slice(t,n.length)}},sb=function(t){return function(n){return t<=0||u6(n)?n:t>=n.length?lf:n.slice(0,n.length-t)}},sx=function(t){return function(n){for(var r=0;r<n.length;r++)if(t(n[r]))return n2(r);return n1}};function sM(t){return function(n){for(var r=0;r<n.length;r++)if(t(n[r]))return n2(n[r]);return n1}}var sT=function(t){return function(n){for(var r=0;r<n.length;r++){var i=t(n[r]);if(n0(i))return i}return n1}};function sS(t){return function(n){for(var r=n.length-1;r>=0;r--)if(t(n[r]))return n2(n[r]);return n1}}var sw=function(t){return function(n){for(var r=n.length-1;r>=0;r--){var i=t(n[r]);if(n0(i))return i}return n1}},sI=function(t){return function(n){for(var r=n.length-1;r>=0;r--)if(t(n[r]))return n2(r);return n1}},s_=function(t,n){return function(r){return t<0||t>r.length?n1:n2(ij(t,n,r))}},sO=function(t,n){return sC(t,function(){return n})},sk=function(t){return function(n){return ik(t,n)?n1:n2(lc(t,n))}},sC=function(t,n){return function(r){return ik(t,r)?n1:n2(ls(t,n(r[t]),r))}},sN=function(t){return t.length<=1?t:t.slice().reverse()},sj=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r];"Right"===i._tag&&n.push(i.right)}return n},sE=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r];"Left"===i._tag&&n.push(i.left)}return n},sR=function(t){return function(n){return n.length<=1?n:n.slice().sort(t.compare)}},sD=function(t,n,r){for(var i=[],o=Math.min(t.length,n.length),a=0;a<o;a++)i[a]=r(t[a],n[a]);return i},sA=function(t){for(var n=[],r=[],i=0;i<t.length;i++)n[i]=t[i][0],r[i]=t[i][1];return[n,r]},sL=function(t){var n=i0(t);return function(t){return n6(t)?n(t):t}},sP=function(t){var n=i1(t);return function(t){return n6(t)?n(t):t}},sF=function(t){var n=iL(t);return function(t){return n6(t)?n(t):t}};function sz(t){return function(n,r){if(void 0===r){var i,o=sz(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 sU=function(t){var n=iR(t);return function(t){return n6(t)?n(t):t}},sW=function(t){var n=iD(t);return function(t){return n6(t)?n(t):t}},sB=function(t){var n=i4(t);return function(t){return n6(t)?n(t):lf}},sV=function(t){return function(n){return t>=1&&n6(n)?i3(t)(n):u6(n)?[n,lf]:[lf,n]}},s$=function(t){var n=i5(t);return function(t){return n6(t)?n(t):lf}},sK=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return st(t.apply(void 0,n))}},sY=function(t){return function(n){return u6(n)?t:u6(t)?n:n.concat(t)}};function sq(t){var n=iA(t);return function(r,i){if(void 0===i){var o=sq(t);return function(t){return o(t,r)}}return n6(r)&&n6(i)?n(i)(r):n6(r)?r:i}}function sG(t){var n=sz(t);return function(r,i){if(void 0===i){var o=sG(t);return function(t){return o(t,r)}}return r.filter(function(t){return n(t,i)})}}function sZ(t){var n=sz(t);return function(r,i){if(void 0===i){var o=sZ(t);return function(t){return o(t,r)}}return r.filter(function(t){return!n(t,i)})}}var sQ=function(t,n){return nG(t,cg(n))},sH=function(t,n){return nG(t,cy(n))},sJ=function(t,n){return nG(t,cp(n))},sX=function(t,n){return nG(t,ch(n))},s0=function(t,n){return nG(t,cb(n))},s1=function(t,n){return nG(t,cM(n))},s2=function(t,n){return nG(t,cS(n))},s4=function(t,n){return nG(t,cI(n))},s3=function(t,n){return nG(t,cw(n))},s5=function(t,n){return nG(t,c_(n))},s9=function(t,n){return nG(t,cf(n))},s8=function(t,n,r){return nG(t,cj(n,r))},s6=function(t){var n=cE(t);return function(t,r){return nG(t,n(r))}},s7=function(t,n,r){return nG(t,cD(n,r))},ce=function(t,n,r){return nG(t,cR(n,r))},ct=function(t){var n=cN(t);return function(t,r){return nG(t,n(r))}},cn=function(t,n,r){return nG(t,cA(n,r))},cr=function(t,n){return nG(t,cx(n))},ci=function(t,n){return nG(t,cO(n))},co=function(t,n){return nG(t,ck(n))},ca=function(t){var n=cL(t);return function(t,r){return nG(t,n(r))}},cu=function(t){var n=cF(t);return function(t,r){return nG(t,n(r))}},cs=function(t,n){return nG(t,le(n))},cc=function(t,n){return nG(t,lt(n))},cl=function(){return lf},cd=function(t){return function(n){return n.concat(t())}},cf=cd,cp=function(t){return ch(function(n){return nG(t,cg(n))})},ch=function(t){return function(n){return nG(n,sa(function(n,r){return t(r)}))}},cm=ch(nP),cg=function(t){return function(n){return n.map(function(n){return t(n)})}},cy=function(t){return function(n){return n.map(function(n,r){return t(r,n)})}},cv=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 uV(n,r)},cb=function(t){return function(n){return n.filter(t)}},cx=function(t){return function(n){for(var r=[],i=0;i<n.length;i++){var o=t(i,n[i]);n0(o)&&r.push(o.value)}return r}},cM=function(t){return cx(function(n,r){return t(r)})},cT=cM(nP),cS=function(t){return cw(function(n,r){return t(r)})},cw=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 uV(r,i)}},cI=function(t){return c_(function(n,r){return t(r)})},c_=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 uV(r,i)}},cO=function(t){return function(n){return n.filter(function(n,r){return t(r,n)})}},ck=function(t){return function(n){return n.map(function(r,i){return t(n.slice(i))})}},cC=ck(nP),cN=function(t){return function(n){return function(r){return r.reduce(function(r,i,o){return t.concat(r,n(o,i))},t.empty)}}},cj=function(t,n){return cR(t,function(t,r,i){return n(r,i)})},cE=function(t){var n=cN(t);return function(t){return n(function(n,r){return t(r)})}},cR=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}},cD=function(t,n){return cA(t,function(t,r,i){return n(r,i)})},cA=function(t,n){return function(r){return r.reduceRight(function(t,r,i){return n(i,r,t)},t)}},cL=function(t){var n=cF(t);return function(t){return n(function(n,r){return t(r)})}},cP=function(t){return function(n){return s8(n,t.of(cl()),function(n,r){return t.ap(t.map(n,function(t){return function(n){return nG(t,iN(n))}}),r)})}},cF=function(t){return function(n){return cR(t.of(cl()),function(r,i,o){return t.ap(t.map(i,function(t){return function(n){return nG(t,iN(n))}}),n(r,o))})}},cz=function(t){var n=ln(t);return function(t){return function(r){return n(r,t)}}},cU=function(t){var n=lr(t);return function(t){return function(r){return n(r,t)}}},cW=function(t,n){for(var r=[],i=t;;){var o=n(i);if(n0(o)){var a=o.value,u=a[0],s=a[1];r.push(u),i=s}else break}return r},cB="ReadonlyArray",cV=function(t){return{show:function(n){return"[".concat(n.map(t.show).join(", "),"]")}}},c$=function(){return{concat:function(t,n){return u6(t)?n:u6(n)?t:t.concat(n)}}},cK=function(){return{concat:c$().concat,empty:lf}},cY=function(t){return rA(function(n,r){return n.length===r.length&&n.every(function(n,i){return t.equals(n,r[i])})})},cq=function(t){return rq(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 uD.compare(i,o)})},cG=function(t){var n=sq(t);return{concat:function(t,r){return n(r)(t)}}},cZ=function(t){return{concat:cG(t).concat,empty:lf}},cQ=function(t){var n=sG(t);return{concat:function(t,r){return n(r)(t)}}},cH=function(t){var n=sZ(t);return{concat:function(t,r){return n(r)(t)}}},cJ={URI:cB,map:sQ},cX=rg(cJ),c0={URI:cB,of:n8},c1={URI:cB,map:sQ,ap:sJ},c2=ra(c1),c4=ru(c1),c3={URI:cB,map:sQ,ap:sJ,chain:sX},c5=rS(c3),c9={URI:cB,zero:cl},c8=u5(c9,c0),c6={URI:cB,compact:cT,separate:cv},c7={URI:cB,map:sQ,reduce:s8,foldMap:s6,reduceRight:s7,traverse:ca,sequence:cP},le=function(t){return function(n){for(var r=u8([],t(n),!0),i=[];r.length>0;){var o=r.shift();n4(o)?r.unshift.apply(r,t(o.left)):i.push(o.right)}return i}},lt=function(t){return function(n){var r=t(n),i=[],o=[];function a(n){n4(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}},ln=u2(c7,c6),lr=u1(c7,c6),li={URI:cB,map:sQ,compact:cT,separate:cv,filter:s0,filterMap:s1,partition:s2,partitionMap:s4,reduce:s8,foldMap:s6,reduceRight:s7,traverse:ca,sequence:cP,wither:ln,wilt:lr},lo=u4(li),la={URI:cB,fromEither:sn},lu=rN(la),ls=function(t,n,r){return n6(r)?iE(t,n,r):r},lc=function(t,n){var r=n.slice();return r.splice(t,1),r},ll=function(t){return t.slice()},ld=function(t){return u6(t)?lf:t.slice()},lf=rt;function lp(t){return function(n){return n.every(t)}}var lh=function(t){return function(n){return n.some(t)}},lm=function(t){var n=o3(t);return function(r){return sr(function(){return t.empty},n(r))}},lg=n8(rn),ly=ry(cJ),lv=rw(c3),lb=rs(c1);let lx=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:cB,map:sQ,alt:s9},Alternative:{URI:cB,map:sQ,ap:sJ,of:n8,alt:s9,zero:cl},Applicative:{URI:cB,map:sQ,ap:sJ,of:n8},Apply:c1,Chain:c3,ChainRecBreadthFirst:{URI:cB,map:sQ,ap:sJ,chain:sX,chainRec:cc},ChainRecDepthFirst:{URI:cB,map:sQ,ap:sJ,chain:sX,chainRec:cs},Compactable:c6,Do:lg,Extend:{URI:cB,map:sQ,extend:co},Filterable:{URI:cB,map:sQ,compact:cT,separate:cv,filter:s0,filterMap:s1,partition:s2,partitionMap:s4},FilterableWithIndex:{URI:cB,map:sQ,mapWithIndex:sH,compact:cT,separate:cv,filter:s0,filterMap:s1,partition:s2,partitionMap:s4,partitionMapWithIndex:s5,partitionWithIndex:s3,filterMapWithIndex:cr,filterWithIndex:ci},Foldable:{URI:cB,reduce:s8,foldMap:s6,reduceRight:s7},FoldableWithIndex:{URI:cB,reduce:s8,foldMap:s6,reduceRight:s7,reduceWithIndex:ce,foldMapWithIndex:ct,reduceRightWithIndex:cn},FromEither:la,Functor:cJ,FunctorWithIndex:{URI:cB,map:sQ,mapWithIndex:sH},Monad:{URI:cB,map:sQ,ap:sJ,of:n8,chain:sX},Pointed:c0,Traversable:c7,TraversableWithIndex:{URI:cB,map:sQ,mapWithIndex:sH,reduce:s8,foldMap:s6,reduceRight:s7,reduceWithIndex:ce,foldMapWithIndex:ct,reduceRightWithIndex:cn,traverse:ca,sequence:cP,traverseWithIndex:cu},URI:cB,Unfoldable:{URI:cB,unfold:cW},Witherable:li,Zero:c9,_chainRecBreadthFirst:cc,_chainRecDepthFirst:cs,alt:cf,altW:cd,ap:cp,apFirst:c2,apS:lb,apSecond:c4,append:iN,appendW:iN,bind:lv,bindTo:ly,chain:ch,chainFirst:c5,chainRecBreadthFirst:lt,chainRecDepthFirst:le,chainWithIndex:sa,chop:sB,chunksOf:s$,compact:cT,comprehension:function(t,n,r){void 0===r&&(r=function(){return!0});var i=function(t,o){return n6(o)?nG(oK(o),ch(function(n){return i(nG(t,iN(n)),oY(o))})):r.apply(void 0,t)?[n.apply(void 0,t)]:lf};return i(lf,t)},concat:sY,concatW:sY,cons:o9,deleteAt:sk,difference:sZ,dropLeft:sv,dropLeftWhile:function(t){return function(n){var r=sy(n,t);return 0===r?n:r===n.length?lf:n.slice(r)}},dropRight:sb,duplicate:cC,elem:sz,empty:lf,every:lp,exists:lh,extend:ck,filter:cb,filterE:lo,filterMap:cM,filterMapWithIndex:cx,filterWithIndex:cO,findFirst:sM,findFirstMap:sT,findIndex:sx,findLast:sS,findLastIndex:sI,findLastMap:sw,flap:cX,flatten:cm,foldLeft:si,foldMap:cE,foldMapWithIndex:cN,foldRight:so,fromArray:ld,fromEither:sn,fromEitherK:lu,fromOption:st,fromOptionK:sK,fromPredicate:function(t){return function(n){return t(n)?[n]:lf}},getDifferenceMagma:cH,getEq:cY,getIntersectionSemigroup:cQ,getMonoid:cK,getOrd:cq,getSemigroup:c$,getShow:cV,getUnionMonoid:cZ,getUnionSemigroup:cG,guard:c8,head:sd,init:sh,insertAt:s_,intercalate:lm,intersection:sG,intersperse:sP,isEmpty:u6,isNonEmpty:n6,isOutOfBound:ik,last:sf,lefts:sE,lookup:sl,makeBy:u7,map:cg,mapWithIndex:cy,match:sr,matchLeft:si,matchLeftW:si,matchRight:so,matchRightW:so,matchW:sr,modifyAt:sC,of:n8,partition:cS,partitionMap:cI,partitionMapWithIndex:c_,partitionWithIndex:cw,prepend:iC,prependAll:sL,prependToAll:sL,prependW:iC,range:iU,readonlyArray:{URI:cB,compact:cT,separate:cv,map:sQ,ap:sJ,of:n8,chain:sX,filter:s0,filterMap:s1,partition:s2,partitionMap:s4,mapWithIndex:sH,partitionMapWithIndex:s5,partitionWithIndex:s3,filterMapWithIndex:cr,filterWithIndex:ci,alt:s9,zero:cl,unfold:cW,reduce:s8,foldMap:s6,reduceRight:s7,traverse:ca,sequence:cP,reduceWithIndex:ce,foldMapWithIndex:ct,reduceRightWithIndex:cn,traverseWithIndex:cu,extend:co,wither:ln,wilt:lr},reduce:cj,reduceRight:cD,reduceRightWithIndex:cA,reduceWithIndex:cR,replicate:se,reverse:sN,rights:sj,rotate:sF,scanLeft:su,scanRight:ss,separate:cv,sequence:cP,size:sc,snoc:o8,some:lh,sort:sR,sortBy:sW,spanLeft:function(t){return function(n){var r,i=sV(sy(n,t))(n);return{init:i[0],rest:i[1]}}},splitAt:sV,tail:sp,takeLeft:sm,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?lf:r}},takeRight:sg,toArray:ll,traverse:cL,traverseWithIndex:cF,unfold:cW,union:sq,uniq:sU,unsafeDeleteAt:lc,unsafeInsertAt:ij,unsafeUpdateAt:ls,unzip:sA,updateAt:sO,wilt:cU,wither:cz,zero:cl,zip:function t(n,r){return void 0===r?function(r){return t(r,n)}:sD(n,r,function(t,n){return[t,n]})},zipWith:sD},Symbol.toStringTag,{value:"Module"}));var lM=function(t){return 0===t.length},lT=function(t,n){return t<=0?[]:ap(n)(t)},lS=function(t,n){return lT(t,function(){return n})},lw=function(t){return nX(t)?[]:[t.value]},lI=function(t){return n4(t)?[]:[t.right]},l_=function(t,n){return function(r){return at(r)?n(r):t()}},lO=function(t,n){return function(r){return at(r)?n(uy(r),uv(r)):t()}},lk=function(t,n){return function(r){return at(r)?n(ux(r),ub(r)):t()}},lC=function(t){return function(n){for(var r=[],i=0;i<n.length;i++)r.push.apply(r,t(i,n[i]));return r}},lN=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}},lj=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}},lE=function(t){return t.length},lR=function(t){return at(t)?n2(uv(t)):n1},lD=function(t){return at(t)?n2(ux(t)):n1},lA=function(t){return function(n){return an(t,n)?lB(n):n.slice(0,t)}},lL=function(t){return function(n){return an(t,n)?lB(n):0===t?[]:n.slice(-t)}},lP=function(t,n){for(var r=t.length,i=0;i<r&&n(t[i]);i++);return i},lF=function(t){return function(n){return t<=0||lM(n)?lB(n):t>=n.length?[]:n.slice(t,n.length)}},lz=function(t){return function(n){return t<=0||lM(n)?lB(n):t>=n.length?[]:n.slice(0,n.length-t)}};function lU(t){return sM(t)}function lW(t){return sS(t)}var lB=function(t){return t.slice()},lV=function(t,n){return function(r){return t<0||t>r.length?n1:n2(fb(t,n,r))}},l$=function(t,n){return lY(t,function(){return n})},lK=function(t){return function(n){return an(t,n)?n1:n2(fM(t,n))}},lY=function(t,n){return function(r){return an(t,r)?n1:n2(fx(t,n(r[t]),r))}},lq=function(t){return lM(t)?[]:t.slice().reverse()},lG=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r];"Right"===i._tag&&n.push(i.right)}return n},lZ=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r];"Left"===i._tag&&n.push(i.left)}return n},lQ=function(t){return function(n){return n.length<=1?lB(n):n.slice().sort(t.compare)}},lH=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},lJ=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]},lX=function(t){var n=aj(t);return function(t){return at(t)?n(t):[]}},l0=function(t){var n=aE(t);return function(t){return at(t)?n(t):lB(t)}},l1=function(t){var n=al(t);return function(t){return at(t)?n(t):lB(t)}},l2=function(t){var n=au(t);return function(t){return at(t)?n(t):lB(t)}},l4=function(t){var n=as(t);return function(t){return at(t)?n(t):lB(t)}},l3=function(t){var n=aD(t);return function(t){return at(t)?n(t):[]}},l5=function(t){return function(n){return t>=1&&at(n)?aA(t)(n):lM(n)?[lB(n),[]]:[[],lB(n)]}},l9=function(t){var n=aL(t);return function(t){return at(t)?n(t):[]}},l8=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return lw(t.apply(void 0,n))}},l6=function(t){return function(n){return lM(n)?lB(t):lM(t)?lB(n):n.concat(t)}};function l7(t){var n=ac(t);return function(r,i){if(void 0===i){var o=l7(t);return function(t){return o(t,r)}}return at(r)&&at(i)?n(i)(r):at(r)?lB(r):lB(i)}}function de(t){var n=sz(t);return function(r,i){if(void 0===i){var o=de(t);return function(t){return o(t,r)}}return r.filter(function(t){return n(t,i)})}}function dt(t){var n=sz(t);return function(r,i){if(void 0===i){var o=dt(t);return function(t){return o(t,r)}}return r.filter(function(t){return!n(t,i)})}}var dn=function(t,n){return nG(t,d_(n))},dr=function(t,n){return nG(t,dN(n))},di=function(t,n){return nG(t,dO(n))},da=function(t,n){return nG(t,dk(n))},du=function(t,n){return nG(t,dA(n))},ds=function(t,n){return nG(t,dE(n))},dc=function(t,n){return nG(t,dL(n))},dl=function(t,n){return nG(t,dF(n))},dd=function(t,n){return nG(t,dP(n))},df=function(t,n){return nG(t,dz(n))},dp=function(t,n){return nG(t,dW(n))},dh=function(t,n,r){return nG(t,dq(n,r))},dm=function(t){var n=dK(t);return function(t,r){return nG(t,n(r))}},dg=function(t,n,r){return nG(t,dZ(n,r))},dy=function(t,n,r){return nG(t,dG(n,r))},dv=function(t){var n=dY(t);return function(t,r){return nG(t,n(r))}},db=function(t,n,r){return nG(t,dQ(n,r))},dx=function(t,n){return nG(t,dj(n))},dM=function(t,n){return nG(t,dB(n))},dT=function(t,n){return nG(t,dV(n))},dS=function(t){var n=dH(t);return function(t,r){return nG(t,n(r))}},dw=function(t){var n=dX(t);return function(t,r){return nG(t,n(r))}},dI=function(){return[]},d_=function(t){return function(n){return n.map(function(n){return t(n)})}},dO=function(t){return dk(function(n){return nG(t,d_(n))})},dk=function(t){return function(n){return nG(n,lC(function(n,r){return t(r)}))}},dC=dk(nP),dN=function(t){return function(n){return n.map(function(n,r){return t(r,n)})}},dj=function(t){return function(n){for(var r=[],i=0;i<n.length;i++){var o=t(i,n[i]);n0(o)&&r.push(o.value)}return r}},dE=function(t){return dj(function(n,r){return t(r)})},dR=dE(nP),dD=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 uV(n,r)},dA=function(t){return function(n){return n.filter(t)}},dL=function(t){return dP(function(n,r){return t(r)})},dP=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 uV(r,i)}},dF=function(t){return dz(function(n,r){return t(r)})},dz=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 uV(r,i)}},dU=function(t){return function(n){return n.concat(t())}},dW=dU,dB=function(t){return function(n){return n.filter(function(n,r){return t(r,n)})}},dV=function(t){return function(n){return n.map(function(r,i){return t(n.slice(i))})}},d$=dV(nP),dK=cE,dY=cN,dq=cj,dG=cR,dZ=cD,dQ=cA,dH=function(t){var n=dX(t);return function(t){return n(function(n,r){return t(r)})}},dJ=function(t){return function(n){return dh(n,t.of(dI()),function(n,r){return t.ap(t.map(n,function(t){return function(n){return nG(t,ai(n))}}),r)})}},dX=function(t){return function(n){return dG(t.of(dI()),function(r,i,o){return t.ap(t.map(i,function(t){return function(n){return nG(t,ai(n))}}),n(r,o))})}},d0=function(t){var n=fp(t);return function(t){return function(r){return n(r,t)}}},d1=function(t){var n=fh(t);return function(t){return function(r){return n(r,t)}}},d2=function(t,n){for(var r=[],i=t;;){var o=n(i);if(n0(o)){var a=o.value,u=a[0],s=a[1];r.push(u),i=s}else break}return r},d4="Array",d3=function(){return{concat:function(t,n){return t.concat(n)}}},d5=function(){return{concat:d3().concat,empty:[]}},d9=function(t){var n=l7(t);return{concat:function(t,r){return n(r)(t)}}},d8=function(t){return{concat:d9(t).concat,empty:[]}},d6=function(t){var n=de(t);return{concat:function(t,r){return n(r)(t)}}},d7=function(t){var n=dt(t);return{concat:function(t,r){return n(r)(t)}}},fe={URI:d4,map:dn},ft=rg(fe),fn={URI:d4,of:ak},fr={URI:d4,map:dn,ap:di},fi=ra(fr),fo=ru(fr),fa={URI:d4,map:dn,ap:di,chain:da},fu=rS(fa),fs={URI:d4,zero:dI},fc=u5(fs,fn),fl={URI:d4,compact:dR,separate:dD},fd={URI:d4,reduce:dh,foldMap:dm,reduceRight:dg},ff={URI:d4,map:dn,reduce:dh,foldMap:dm,reduceRight:dg,traverse:dS,sequence:dJ},fp=u2(ff,fl),fh=u1(ff,fl),fm={URI:d4,map:dn,compact:dR,separate:dD,filter:du,filterMap:ds,partition:dc,partitionMap:dl,reduce:dh,foldMap:dm,reduceRight:dg,traverse:dS,sequence:dJ,wither:fp,wilt:fh},fg=u4(fm),fy={URI:d4,fromEither:lI},fv=rN(fy),fb=ao,fx=function(t,n,r){return at(r)?aa(t,n,r):[]},fM=function(t,n){var r=n.slice();return r.splice(t,1),r},fT=function(t){return function(n){return n.some(t)}},fS=ak(rn),fw=ry(fe),fI=rw(fa),f_=rs(fr);let fO=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:d4,map:dn,alt:dp},Alternative:{URI:d4,map:dn,ap:di,of:ak,alt:dp,zero:dI},Applicative:{URI:d4,map:dn,ap:di,of:ak},Apply:fr,Chain:fa,ChainRecBreadthFirst:{URI:d4,map:dn,ap:di,chain:da,chainRec:cc},ChainRecDepthFirst:{URI:d4,map:dn,ap:di,chain:da,chainRec:cs},Compactable:fl,Do:fS,Extend:{URI:d4,map:dn,extend:dT},Filterable:{URI:d4,map:dn,compact:dR,separate:dD,filter:du,filterMap:ds,partition:dc,partitionMap:dl},FilterableWithIndex:{URI:d4,map:dn,mapWithIndex:dr,compact:dR,separate:dD,filter:du,filterMap:ds,partition:dc,partitionMap:dl,partitionMapWithIndex:df,partitionWithIndex:dd,filterMapWithIndex:dx,filterWithIndex:dM},Foldable:fd,FoldableWithIndex:{URI:d4,reduce:dh,foldMap:dm,reduceRight:dg,reduceWithIndex:dy,foldMapWithIndex:dv,reduceRightWithIndex:db},FromEither:fy,Functor:fe,FunctorWithIndex:{URI:d4,map:dn,mapWithIndex:dr},Monad:{URI:d4,map:dn,ap:di,of:ak,chain:da},Pointed:fn,Traversable:ff,TraversableWithIndex:{URI:d4,map:dn,mapWithIndex:dr,reduce:dh,foldMap:dm,reduceRight:dg,reduceWithIndex:dy,foldMapWithIndex:dv,reduceRightWithIndex:db,traverse:dS,sequence:dJ,traverseWithIndex:dw},URI:d4,Unfoldable:{URI:d4,unfold:d2},Witherable:fm,Zero:fs,alt:dW,altW:dU,ap:dO,apFirst:fi,apS:f_,apSecond:fo,append:ai,appendW:ai,array:{URI:d4,compact:dR,separate:dD,map:dn,ap:di,of:ak,chain:da,filter:du,filterMap:ds,partition:dc,partitionMap:dl,mapWithIndex:dr,partitionMapWithIndex:df,partitionWithIndex:dd,filterMapWithIndex:dx,filterWithIndex:dM,alt:dp,zero:dI,unfold:d2,reduce:dh,foldMap:dm,reduceRight:dg,traverse:dS,sequence:dJ,reduceWithIndex:dy,foldMapWithIndex:dv,reduceRightWithIndex:db,traverseWithIndex:dw,extend:dT,wither:fp,wilt:fh},bind:fI,bindTo:fw,chain:dk,chainFirst:fu,chainRecBreadthFirst:lt,chainRecDepthFirst:le,chainWithIndex:lC,chop:l3,chunksOf:l9,compact:dR,comprehension:function(t,n,r){void 0===r&&(r=function(){return!0});var i=function(t,o){return at(o)?nG(uy(o),dk(function(n){return i(nG(t,ai(n)),uv(o))})):r.apply(void 0,t)?[n.apply(void 0,t)]:[]};return i([],t)},concat:l6,concatW:l6,cons:uC,copy:lB,deleteAt:lK,difference:dt,dropLeft:lF,dropLeftWhile:function(t){return function(n){return n.slice(lP(n,t))}},dropRight:lz,duplicate:d$,elem:sz,empty:[],every:lp,exists:fT,extend:dV,filter:dA,filterE:fg,filterMap:dE,filterMapWithIndex:dj,filterWithIndex:dB,findFirst:lU,findFirstMap:sT,findIndex:sx,findLast:lW,findLastIndex:sI,findLastMap:sw,flap:ft,flatten:dC,foldLeft:lO,foldMap:dK,foldMapWithIndex:dY,foldRight:lk,fromEither:lI,fromEitherK:fv,fromOption:lw,fromOptionK:l8,fromPredicate:function(t){return function(n){return t(n)?[n]:[]}},getDifferenceMagma:d7,getEq:cY,getIntersectionSemigroup:d6,getMonoid:d5,getOrd:cq,getSemigroup:d3,getShow:cV,getUnionMonoid:d8,getUnionSemigroup:d9,guard:fc,head:sd,init:lD,insertAt:lV,intercalate:lm,intersection:de,intersperse:l0,isEmpty:lM,isNonEmpty:at,isOutOfBound:an,last:sf,lefts:lZ,lookup:sl,makeBy:lT,map:d_,mapWithIndex:dN,match:l_,matchLeft:lO,matchLeftW:lO,matchRight:lk,matchRightW:lk,matchW:l_,modifyAt:lY,of:ak,partition:dL,partitionMap:dF,partitionMapWithIndex:dz,partitionWithIndex:dP,prepend:ar,prependAll:lX,prependToAll:lX,prependW:ar,range:am,reduce:dq,reduceRight:dZ,reduceRightWithIndex:dQ,reduceWithIndex:dG,replicate:lS,reverse:lq,rights:lG,rotate:l1,scanLeft:lN,scanRight:lj,separate:dD,sequence:dJ,size:lE,snoc:uN,some:fT,sort:lQ,sortBy:l4,spanLeft:function(t){return function(n){var r,i=l5(lP(n,t))(n);return{init:i[0],rest:i[1]}}},splitAt:l5,tail:lR,takeLeft:lA,takeLeftWhile:function(t){return function(n){for(var r=[],i=0;i<n.length;i++){var o=n[i];if(!t(o))break;r.push(o)}return r}},takeRight:lL,traverse:dH,traverseWithIndex:dX,unfold:d2,union:l7,uniq:l2,unsafeDeleteAt:fM,unsafeInsertAt:fb,unsafeUpdateAt:fx,unzip:lJ,updateAt:l$,wilt:d1,wither:d0,zero:dI,zip:function t(n,r){return void 0===r?function(r){return t(r,n)}:lH(n,r,function(t,n){return[t,n]})},zipWith:lH},Symbol.toStringTag,{value:"Module"})),fk=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var fC=function(t){return"boolean"==typeof t},fN=function(t,n){return function(r){return r?n():t()}},fj={equals:function(t,n){return t===n}},fE={concat:function(t,n){return t&&n}},fR={concat:function(t,n){return t||n}},fD={concat:fE.concat,empty:!0},fA={concat:fR.concat,empty:!1},fL={equals:fj.equals,compare:function(t,n){return t<n?-1:t>n?1:0}};let fP=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:fj,MonoidAll:fD,MonoidAny:fA,Ord:fL,SemigroupAll:fE,SemigroupAny:fR,Show:{show:function(t){return JSON.stringify(t)}},fold:fN,foldW:fN,isBoolean:fC,match:fN,matchW:fN},Symbol.toStringTag,{value:"Module"}));var fF=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 fz=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:fF,getFunctionBooleanAlgebra:nj,reverse:fF},Symbol.toStringTag,{value:"Module"}));var fU=function(t){return r6(t)(t.bottom,t.top)},fW=function(t){var n=rZ(t);return{equals:n.equals,compare:n.compare,top:t.bottom,bottom:t.top}},fB={equals:ie.equals,compare:ie.compare,top:1/0,bottom:-1/0};let fV=Object.freeze(Object.defineProperty({__proto__:null,boundedNumber:fB,clamp:fU,reverse:fW},Symbol.toStringTag,{value:"Module"}));function f$(t){return{meet:r9(t),join:r8(t)}}let fK=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxDistributiveLattice:f$},Symbol.toStringTag,{value:"Module"})),fY=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxBoundedDistributiveLattice:function(t){var n=f$(t);return function(t,r){return{join:n.join,meet:n.meet,zero:t,one:r}}}},Symbol.toStringTag,{value:"Module"})),fq=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),fG=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),fZ=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),fQ=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var fH=function(t,n){for(var r=n(t);"Left"===r._tag;)r=n(r.left);return r.right};let fJ=Object.freeze(Object.defineProperty({__proto__:null,tailRec:fH},Symbol.toStringTag,{value:"Module"}));function fX(t,n){return function(r,i){return n.compose(t.right(i),t.left(r))}}function f0(t,n){var r=fX(t,n);return function(i,o){return n.compose(t.promap(n.id(),function(t){return"Left"===t._tag?t.left:t.right},nP),r(i,o))}}let f1=Object.freeze(Object.defineProperty({__proto__:null,fanIn:f0,fanin:function(t){return f0(t,t)},split:fX,splitChoice:function(t){return fX(t,t)}},Symbol.toStringTag,{value:"Module"})),f2=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var f4=function(t,n){return nG(t,f3(n))},f3=function(t){return function(n){return nV(t,n)}},f5="Predicate",f9=function(){return{concat:function(t,n){return nG(t,pt(n))}}},f8=function(){return{concat:f9().concat,empty:nU}},f6=function(){return{concat:function(t,n){return nG(t,pn(n))}}},f7=function(){return{concat:f6().concat,empty:nz}},pe=function(t){return function(n){return!t(n)}},pt=function(t){return function(n){return function(r){return n(r)||t(r)}}},pn=function(t){return function(n){return function(r){return n(r)&&t(r)}}};let pr=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:{URI:f5,contramap:f4},URI:f5,and:pn,contramap:f3,getMonoidAll:f7,getMonoidAny:f8,getSemigroupAll:f6,getSemigroupAny:f9,not:pe,or:pt},Symbol.toStringTag,{value:"Module"}));function pi(t){return function(n){return t(n)?n2(n):n1}}var po=function(t){return"Right"===t._tag?n1:n2(t.left)},pa=function(t){return"Left"===t._tag?n1:n2(t.right)},pu=function(t,n){return nG(t,pI(n))},ps=function(t,n){return nG(t,pk(n))},pc=function(t,n){return nG(t,pj(n))},pl=function(t,n,r){return nG(t,pR(n,r))},pd=function(t){var n=pD(t);return function(t,r){return nG(t,n(r))}},pf=function(t,n,r){return nG(t,pA(n,r))},pp=function(t){var n=pH(t);return function(t,r){return nG(t,n(r))}},ph=function(t,n){return nG(t,pP(n))},pm=function(t,n){return nG(t,pY(n))},pg=function(t,n){return nG(t,pq(n))},py=function(t,n){return nG(t,pW(n))},pv=function(t,n){return nG(t,pG(n))},pb=function(t,n){return nG(t,pZ(n))},px="Option",pM=function(t){return{show:function(n){return p8(n)?"none":"some(".concat(t.show(n.value),")")}}},pT=function(t){return{equals:function(n,r){return n===r||(p8(n)?p8(r):!p8(r)&&t.equals(n.value,r.value))}}},pS=function(t){return{equals:pT(t).equals,compare:function(n,r){return n===r?0:p9(n)?p9(r)?t.compare(n.value,r.value):1:-1}}},pw=function(t){return{concat:function(n,r){return p8(n)?r:p8(r)?n:n2(t.concat(n.value,r.value))},empty:n1}},pI=function(t){return function(n){return p8(n)?n1:n2(t(n.value))}},p_={URI:px,map:pu},pO={URI:px,of:n2},pk=function(t){return function(n){return p8(n)||p8(t)?n1:n2(n.value(t.value))}},pC={URI:px,map:pu,ap:ps},pN={URI:px,map:pu,ap:ps,of:n2},pj=function(t){return function(n){return p8(n)?n1:t(n.value)}},pE={URI:px,map:pu,ap:ps,chain:pc},pR=function(t,n){return function(r){return p8(r)?t:n(t,r.value)}},pD=function(t){return function(n){return function(r){return p8(r)?t.empty:n(r.value)}}},pA=function(t,n){return function(r){return p8(r)?t:n(r.value,t)}},pL=function(t){return function(n){return p8(n)?t():n}},pP=pL,pF=function(){return n1},pz={URI:px,zero:pF},pU=u5(pz,pO),pW=function(t){return function(n){return p8(n)?n1:n2(t(n))}},pB=pj(nP),pV=uV(n1,n1),p$=function(t){return p8(t)?pV:uV(po(t.value),pa(t.value))},pK={URI:px,compact:pB,separate:p$},pY=function(t){return function(n){return p8(n)?n1:t(n.value)?n:n1}},pq=function(t){return function(n){return p8(n)?n1:t(n.value)}},pG=function(t){return function(n){return uV(pm(n,pe(t)),pm(n,t))}},pZ=function(t){return nV(pI(t),p$)},pQ={URI:px,map:pu,compact:pB,separate:p$,filter:pm,filterMap:pg,partition:pv,partitionMap:pb},pH=function(t){return function(n){return function(r){return p8(r)?t.of(n1):t.map(n(r.value),n2)}}},pJ=function(t){return function(n){return p8(n)?t.of(n1):t.map(n.value,n2)}},pX={URI:px,map:pu,reduce:pl,foldMap:pd,reduceRight:pf,traverse:pp,sequence:pJ},p0=u2(pX,pK),p1=u1(pX,pK),p2=function(t){var n=p0(t);return function(t){return function(r){return n(r,t)}}},p4=function(t){var n=p1(t);return function(t){return function(r){return n(r,t)}}},p3=function(){return n1},p5={URI:px,fromEither:pa},p9=n0,p8=function(t){return"None"===t._tag},p6=function(t,n){return function(r){return p8(r)?t():n(r.value)}},p7=function(t){return function(n){return p8(n)?t():n.value}},he=rg(p_),ht=ra(pC),hn=ru(pC),hr=rS(pE),hi=pW(nP),ho=rN(p5),ha=rj(p5,pE),hu=rE(p5,pE),hs=function(t){return null==t?n1:n2(t)},hc=function(t){try{return n2(t())}catch{return n1}},hl=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return hc(function(){return t.apply(void 0,n)})}},hd=function(t){return nV(t,hs)},hf=function(t){return function(n){return p8(n)?n1:hs(t(n.value))}},hp=p6(nW,nP),hh=p6(nB,nP),hm=function(t){return function(n){return!p8(n)&&t(n.value)}},hg=n2(rn),hy=ry(p_),hv=rw(pE),hb=rs(pC),hx=n2(rt),hM=function(t){return function(n){var r=t(0,n7(n));if(p8(r))return n1;for(var i=[r.value],o=1;o<n.length;o++){var a=t(o,n[o]);if(p8(a))return n1;i.push(a.value)}return n2(i)}},hT=function(t){var n=hM(t);return function(t){return n6(t)?n(t):hx}},hS=function(t){return hT(function(n,r){return t(r)})},hw=hS(nP),hI={URI:px,map:pu,of:n2,ap:ps,chain:pc,reduce:pl,foldMap:pd,reduceRight:pf,traverse:pp,sequence:pJ,zero:pF,alt:ph,extend:py,compact:pB,separate:p$,filter:pm,filterMap:pg,partition:pv,partitionMap:pb,wither:p0,wilt:p1,throwError:p3},h_=rc(pC),hO=rx(pN),hk=function(){return pw(iy())},hC=function(){return pw(iv())};let hN=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:px,map:pu,alt:ph},Alternative:{URI:px,map:pu,ap:ps,of:n2,alt:ph,zero:pF},ApT:hx,Applicative:pN,Apply:pC,Chain:pE,Compactable:pK,Do:hg,Extend:{URI:px,map:pu,extend:py},Filterable:pQ,Foldable:{URI:px,reduce:pl,foldMap:pd,reduceRight:pf},FromEither:p5,Functor:p_,Monad:{URI:px,map:pu,ap:ps,of:n2,chain:pc},MonadThrow:{URI:px,map:pu,ap:ps,of:n2,chain:pc,throwError:p3},Pointed:pO,Traversable:pX,URI:px,Witherable:{URI:px,map:pu,reduce:pl,foldMap:pd,reduceRight:pf,traverse:pp,sequence:pJ,compact:pB,separate:p$,filter:pm,filterMap:pg,partition:pv,partitionMap:pb,wither:p0,wilt:p1},Zero:pz,alt:pP,altW:pL,ap:pk,apFirst:ht,apS:hb,apSecond:hn,bind:hv,bindTo:hy,chain:pj,chainEitherK:ha,chainFirst:hr,chainFirstEitherK:hu,chainNullableK:hf,compact:pB,duplicate:hi,elem:function t(n){return function(r,i){if(void 0===i){var o=t(n);return function(t){return o(r,t)}}return!p8(i)&&n.equals(r,i.value)}},exists:hm,extend:pW,filter:pY,filterMap:pq,flap:he,flatten:pB,fold:p6,foldMap:pD,foldW:p6,fromEither:pa,fromEitherK:ho,fromNullable:hs,fromNullableK:hd,fromPredicate:pi,getApplyMonoid:hO,getApplySemigroup:h_,getEq:pT,getFirstMonoid:hk,getLastMonoid:hC,getLeft:po,getMonoid:pw,getOrElse:p7,getOrElseW:p7,getOrd:pS,getRefinement:function(t){return function(n){return p9(t(n))}},getRight:pa,getShow:pM,guard:pU,isNone:p8,isSome:p9,map:pI,mapNullable:hf,match:p6,matchW:p6,none:n1,of:n2,option:hI,partition:pG,partitionMap:pZ,reduce:pR,reduceRight:pA,separate:p$,sequence:pJ,sequenceArray:hw,some:n2,throwError:p3,toNullable:hp,toUndefined:hh,traverse:pH,traverseArray:hS,traverseArrayWithIndex:hT,traverseReadonlyArrayWithIndex:hT,traverseReadonlyNonEmptyArrayWithIndex:hM,tryCatch:hc,tryCatchK:hl,wilt:p4,wither:p2,zero:pF},Symbol.toStringTag,{value:"Module"}));function hj(t,n){return function(r){return t.map(r,n.compact)}}function hE(t,n,r){var i=hj(t,n),o=rm(t,r);return function(t){return uV(i(nG(t,o(po))),i(nG(t,o(pa))))}}let hR=Object.freeze(Object.defineProperty({__proto__:null,compact:hj,getCompactableComposition:function(t,n){return{map:rv(t,n).map,compact:hj(t,n),separate:hE(t,n,n)}},separate:hE},Symbol.toStringTag,{value:"Module"}));var hD=function(t){return function(){return console.log(t)}},hA=function(t){return function(){return console.warn(t)}},hL=function(t){return function(){return console.error(t)}},hP=function(t){return function(){return console.info(t)}};let hF=Object.freeze(Object.defineProperty({__proto__:null,error:hL,info:hP,log:hD,warn:hA},Symbol.toStringTag,{value:"Module"}));function hz(t){return{URI:hZ,_E:void 0,map:hB,ap:function(n,r){return nP(t.concat(n,r))}}}function hU(t){var n=hz(t);return{URI:hZ,_E:void 0,map:n.map,ap:n.ap,of:function(){return nP(t.empty)}}}var hW=function(t,n){return nG(t,hK())},hB=function(t,n){return nG(t,hY())},hV=function(t,n,r){return nG(t,hq(n))},h$=function(t,n){return nG(t,hG(n))},hK=function(){return nP},hY=function(){return nP},hq=function(t){return function(n){return nP(t(n))}},hG=function(t){return function(n){return nP(t(n))}},hZ="Const",hQ={URI:hZ,map:hB},hH=rg(hQ);let hJ=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:{URI:hZ,bimap:hV,mapLeft:h$},Contravariant:{URI:hZ,contramap:hW},Functor:hQ,URI:hZ,bimap:hq,const_:{URI:hZ,map:hB,contramap:hW,bimap:hV,mapLeft:h$},contramap:hK,flap:hH,getApplicative:hU,getApply:hz,getBooleanAlgebra:nP,getBounded:nP,getEq:nP,getHeytingAlgebra:nP,getMonoid:nP,getOrd:nP,getRing:nP,getSemigroup:nP,getSemiring:nP,getShow:function(t){return{show:function(n){return"make(".concat(t.show(n),")")}}},make:nP,map:hY,mapLeft:hG},Symbol.toStringTag,{value:"Module"})),hX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var h0=nG(uD,rQ(function(t){return t.valueOf()})),h1=function(){return new Date},h2=function(){return new Date().getTime()};let h4=Object.freeze(Object.defineProperty({__proto__:null,Eq:{equals:function(t,n){return t.valueOf()===n.valueOf()}},Ord:h0,create:h1,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:h2},Symbol.toStringTag,{value:"Module"}));var h3=function(t,n){return nG(t,mm(n))},h5=function(t,n){return nG(t,mb(n))},h9=function(t,n){return nG(t,mS(n))},h8=function(t,n,r){return nG(t,mI(n,r))},h6=function(t){return function(n,r){var i=m_(t);return nG(n,i(r))}},h7=function(t,n,r){return nG(t,mO(n,r))},me=function(t){var n=mk(t);return function(t,r){return nG(t,n(r))}},mt=function(t,n,r){return nG(t,mj(n,r))},mn=function(t,n){return nG(t,mE(n))},mr=function(t,n){return nG(t,mD(n))},mi=function(t,n){return nG(t,mA(n))},mo=function(t,n){return fH(n(t),function(t){return mz(t)?n9(n5(t.left)):mz(t.right)?n5(n(t.right.left)):n9(n9(t.right.right))})},ma="Either",mu=function(t,n){return{show:function(r){return mz(r)?"left(".concat(t.show(r.left),")"):"right(".concat(n.show(r.right),")")}}},ms=function(t,n){return{equals:function(r,i){return r===i||(mz(r)?mz(i)&&t.equals(r.left,i.left):mU(i)&&n.equals(r.right,i.right))}}},mc=function(t){return{concat:function(n,r){return mz(r)?n:mz(n)?r:n9(t.concat(n.right,r.right))}}},ml=function(t){var n=n5(t.empty);return{URI:ma,_E:void 0,compact:function(t){return mz(t)?t:"None"===t.right._tag?n:n9(t.right.value)},separate:function(t){return mz(t)?uV(t,t):mz(t.right)?uV(n9(t.right.left),n):uV(n,n9(t.right.right))}}},md=function(t){var n,r=n5(t.empty),i=ml(t),o=i.compact;return{URI:ma,_E:void 0,map:h3,compact:o,separate:i.separate,filter:function(t,n){return mz(t)||n(t.right)?t:r},filterMap:function(t,n){if(mz(t))return t;var i=n(t.right);return"None"===i._tag?r:n9(i.value)},partition:function(t,n){return mz(t)?uV(t,t):n(t.right)?uV(r,n9(t.right)):uV(n9(t.right),r)},partitionMap:function(t,n){if(mz(t))return uV(t,t);var i=n(t.right);return mz(i)?uV(n9(i.left),r):uV(r,n9(i.right))}}},mf=function(t){var n=md(t),r=ml(t);return{URI:ma,_E:void 0,map:h3,compact:n.compact,separate:n.separate,filter:n.filter,filterMap:n.filterMap,partition:n.partition,partitionMap:n.partitionMap,traverse:me,sequence:mC,reduce:h8,foldMap:h6,reduceRight:h7,wither:u2(mN,r),wilt:u1(mN,r)}},mp=function(t){return{URI:ma,_E:void 0,map:h3,ap:function(n,r){return mz(n)?mz(r)?n5(t.concat(n.left,r.left)):n:mz(r)?r:n9(n.right(r.right))},of:my}},mh=function(t){return{URI:ma,_E:void 0,map:h3,alt:function(n,r){if(mU(n))return n;var i=r();return mz(i)?n5(t.concat(n.left,i.left)):i}}},mm=function(t){return function(n){return mz(n)?n:n9(t(n.right))}},mg={URI:ma,map:h3},my=n9,mv=function(t){return function(n){return mz(n)?n:mz(t)?t:n9(n.right(t.right))}},mb=mv,mx={URI:ma,map:h3,ap:h5},mM={URI:ma,map:h3,ap:h5,of:my},mT=function(t){return function(n){return mz(n)?n:t(n.right)}},mS=mT,mw={URI:ma,map:h3,ap:h5,chain:h9},mI=function(t,n){return function(r){return mz(r)?t:n(t,r.right)}},m_=function(t){return function(n){return function(r){return mz(r)?t.empty:n(r.right)}}},mO=function(t,n){return function(r){return mz(r)?t:n(r.right,t)}},mk=function(t){return function(n){return function(r){return mz(r)?t.of(n5(r.left)):t.map(n(r.right),n9)}}},mC=function(t){return function(n){return mz(n)?t.of(n5(n.left)):t.map(n.right,n9)}},mN={URI:ma,map:h3,reduce:h8,foldMap:h6,reduceRight:h7,traverse:me,sequence:mC},mj=function(t,n){return function(r){return mz(r)?n5(t(r.left)):n9(n(r.right))}},mE=function(t){return function(n){return mz(n)?n5(t(n.left)):n}},mR=function(t){return function(n){return mz(n)?t():n}},mD=mR,mA=function(t){return function(n){return mz(n)?n:n9(t(n))}},mL={URI:ma,fromEither:nP},mP=rO(mL),mF=r_(mL),mz=n4,mU=n3,mW=function(t,n){return function(r){return mz(r)?t(r.left):n(r.right)}},mB=function(t){return function(n){return mz(n)?t(n.left):n.right}},mV=rg(mg),m$=ra(mx),mK=ru(mx),mY=rS(mw),mq=mT(nP),mG=mA(nP),mZ=rk(mL),mQ=rC(mL,mw),mH=rR(mL,mw),mJ=function(t){return mz(t)?n9(t.left):n5(t.right)},mX=function(t){return function(n){return mz(n)?t(n.left):n}},m0=function(t){return function(n){return null==n?n5(t):n9(n)}},m1=function(t,n){try{return n9(t())}catch(r){return n5(n(r))}},m2=function(t,n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return m1(function(){return t.apply(void 0,r)},n)}},m4=function(t){var n=m0(t);return function(t){return nV(t,n)}},m3=function(t){var n=m4(t);return function(t){return mS(n(t))}},m5=mW(nP,nP),m9=function(t){return function(n){return!mz(n)&&t(n.right)}},m8=my(rn),m6=ry(mg),m7=rw(mw),ge=rs(mx),gt=my(rt),gn=function(t){return function(n){var r=t(0,n7(n));if(mz(r))return r;for(var i=[r.right],o=1;o<n.length;o++){var a=t(o,n[o]);if(mz(a))return a;i.push(a.right)}return n9(i)}},gr=function(t){var n=gn(t);return function(t){return n6(t)?n(t):gt}},gi=function(t){return gr(function(n,r){return t(r)})},go=gi(nP),ga=function(t,n){return m1(function(){var n=JSON.stringify(t);if("string"!=typeof n)throw Error("Converting unsupported structure to JSON");return n},n)},gu=rc(mx),gs=rx(mM),gc=function(t,n){return rc(mp(t))(n)},gl=function(t,n){return rx(mp(t))(n)};let gd=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:ma,map:h3,alt:mr},ApT:gt,Applicative:mM,Apply:mx,Bifunctor:{URI:ma,bimap:mt,mapLeft:mn},Chain:mw,ChainRec:{URI:ma,map:h3,ap:h5,chain:h9,chainRec:mo},Do:m8,Extend:{URI:ma,map:h3,extend:mi},Foldable:{URI:ma,reduce:h8,foldMap:h6,reduceRight:h7},FromEither:mL,Functor:mg,Monad:{URI:ma,map:h3,ap:h5,of:my,chain:h9},MonadThrow:{URI:ma,map:h3,ap:h5,of:my,chain:h9,throwError:n5},Pointed:{URI:ma,of:my},Traversable:mN,URI:ma,alt:mD,altW:mR,ap:mb,apFirst:m$,apFirstW:m$,apS:ge,apSW:ge,apSecond:mK,apSecondW:mK,apW:mv,bimap:mj,bind:m7,bindTo:m6,bindW:m7,chain:mS,chainFirst:mY,chainFirstW:mY,chainNullableK:m3,chainOptionK:mQ,chainW:mT,duplicate:mG,either:{URI:ma,map:h3,of:my,ap:h5,chain:h9,reduce:h8,foldMap:h6,reduceRight:h7,traverse:me,sequence:mC,bimap:mt,mapLeft:mn,alt:mr,extend:mi,chainRec:mo,throwError:n5},elem:function t(n){return function(r,i){if(void 0===i){var o=t(n);return function(t){return o(r,t)}}return!mz(i)&&n.equals(r,i.right)}},exists:m9,extend:mA,filterOrElse:mH,filterOrElseW:mH,flap:mV,flatten:mq,flattenW:mq,fold:mW,foldMap:m_,foldW:mW,fromNullable:m0,fromNullableK:m4,fromOption:mF,fromOptionK:mZ,fromPredicate:mP,getAltValidation:mh,getApplicativeValidation:mp,getApplyMonoid:gs,getApplySemigroup:gu,getCompactable:ml,getEq:ms,getFilterable:md,getOrElse:mB,getOrElseW:mB,getSemigroup:mc,getShow:mu,getValidation:function(t){var n=mp(t).ap,r=mh(t).alt;return{URI:ma,_E:void 0,map:h3,of:my,chain:h9,bimap:mt,mapLeft:mn,reduce:h8,foldMap:h6,reduceRight:h7,extend:mi,traverse:me,sequence:mC,chainRec:mo,throwError:n5,ap:n,alt:r}},getValidationMonoid:gl,getValidationSemigroup:gc,getWitherable:mf,isLeft:mz,isRight:mU,left:n5,map:mm,mapLeft:mE,match:mW,matchW:mW,of:my,orElse:mX,orElseW:mX,parseJSON:function(t,n){return m1(function(){return JSON.parse(t)},n)},reduce:mI,reduceRight:mO,right:n9,sequence:mC,sequenceArray:go,stringifyJSON:ga,swap:mJ,throwError:n5,toError:function(t){return t instanceof Error?t:Error(String(t))},toUnion:m5,traverse:mk,traverseArray:gi,traverseArrayWithIndex:gr,traverseReadonlyArrayWithIndex:gr,traverseReadonlyNonEmptyArrayWithIndex:gn,tryCatch:m1,tryCatchK:m2},Symbol.toStringTag,{value:"Module"}));function gf(t){return nV(n9,t.of)}function gp(t){return nV(n5,t.of)}function gh(t){return function(n){return t.map(n,n9)}}function gm(t){return function(n){return t.map(n,n5)}}function gg(t){return function(n){return nV(m0(n),t.of)}}function gy(t){var n=gg(t);return function(t){var r=n(t);return function(t){return nV(t,r)}}}function gv(t){var n=gM(t),r=gy(t);return function(t){var i=r(t);return function(t){return n(i(t))}}}function gb(t){return rm(t,mg)}function gx(t){return ro(t,mx)}function gM(t){return function(n){return function(r){return t.chain(r,function(r){return mz(r)?t.of(r):n(r.right)})}}}function gT(t){return function(n){return function(r){return t.chain(r,function(r){return mz(r)?n():t.of(r)})}}}function gS(t){return function(n,r){return function(i){return t.map(i,mj(n,r))}}}function gw(t){return function(n){return function(r){return t.map(r,mE(n))}}}function gI(t,n){return function(r){return function(i){return t.chain(i,mW(function(i){return t.map(r(),mE(function(t){return n.concat(i,t)}))},gf(t)))}}}function g_(t){return function(n,r){return function(i){return t.map(i,mW(n,r))}}}function gO(t){return function(n,r){return function(i){return t.chain(i,mW(n,r))}}}function gk(t){return function(n){return function(r){return t.chain(r,mW(n,t.of))}}}function gC(t){return function(n){return function(r){return t.chain(r,function(r){return mz(r)?n(r.left):t.of(r)})}}}function gN(t){var n=gC(t);return function(r){return n(function(n){return t.map(r(n),function(t){return mz(t)?t:n5(n)})})}}function gj(t){return function(n){return function(r){return t.chain(r,mW(function(r){return t.map(n(r),n5)},function(n){return t.of(n9(n))}))}}}function gE(t){return function(n){return t.map(n,mJ)}}function gR(t){return function(n){return t.map(n,m5)}}let gD=Object.freeze(Object.defineProperty({__proto__:null,alt:gT,altValidation:gI,ap:gx,bimap:gS,chain:gM,chainNullableK:gv,fromNullable:gg,fromNullableK:gy,getEitherM:function(t){var n=gx(t),r=gb(t),i=gM(t),o=gT(t),a=gS(t),u=gw(t),s=gO(t),c=gk(t),l=gC(t);return{map:function(t,n){return nG(t,r(n))},ap:function(t,r){return nG(t,n(r))},of:gf(t),chain:function(t,n){return nG(t,i(n))},alt:function(t,n){return nG(t,o(n))},bimap:function(t,n,r){return nG(t,a(n,r))},mapLeft:function(t,n){return nG(t,u(n))},fold:function(t,n,r){return nG(t,s(n,r))},getOrElse:function(t,n){return nG(t,c(n))},orElse:function(t,n){return nG(t,l(n))},swap:gE(t),rightM:gh(t),leftM:gm(t),left:gp(t)}},getOrElse:gk,left:gp,leftF:gm,map:gb,mapLeft:gw,match:g_,matchE:gO,orElse:gC,orElseFirst:gN,orLeft:gj,right:gf,rightF:gh,swap:gE,toUnion:gR},Symbol.toStringTag,{value:"Module"}));var gA=function(){return{concat:function(t,n){return nV(t,n)}}},gL=function(){return{concat:gA().concat,empty:nP}};let gP=Object.freeze(Object.defineProperty({__proto__:null,URI:"Endomorphism",getMonoid:gL,getSemigroup:gA},Symbol.toStringTag,{value:"Module"})),gF=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function gz(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 gU=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:gz,lcm:function(t,n){var r=n.zero,i=gz(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 gW(t,n){return function(r){return function(i){return t.map(i,function(t){return n.filter(t,r)})}}}function gB(t,n){return function(r){return function(i){return t.map(i,function(t){return n.filterMap(t,r)})}}}function gV(t,n){var r=gW(t,n);return function(t){var n=r(pe(t)),i=r(t);return function(t){return uV(n(t),i(t))}}}function g$(t,n){var r=gB(t,n);return function(t){return function(n){return uV(nG(n,r(function(n){return po(t(n))})),nG(n,r(function(n){return pa(t(n))})))}}}let gK=Object.freeze(Object.defineProperty({__proto__:null,filter:gW,filterMap:gB,getFilterableComposition:function(t,n){var r=rv(t,n).map,i=hj(t,n),o=hE(t,n,n),a=gW(t,n),u=gB(t,n),s=gV(t,n),c=g$(t,n);return{map:r,compact:i,separate:o,filter:function(t,n){return nG(t,a(n))},filterMap:function(t,n){return nG(t,u(n))},partition:function(t,n){return nG(t,s(n))},partitionMap:function(t,n){return nG(t,c(n))}}},partition:gV,partitionMap:g$},Symbol.toStringTag,{value:"Module"})),gY=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function gq(t,n){return function(r,i){return function(o){return t.reduce(o,r,function(t,r){return n.reduce(r,t,i)})}}}function gG(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 gZ(t,n){return function(r,i){return function(o){return t.reduceRight(o,r,function(t,r){return n.reduceRight(t,r,i)})}}}function gQ(t){return function(n){return t.reduce(n,[],function(t,n){return t.push(n),t})}}function gH(t,n){var r=gq(t,n),i=gG(t,n),o=gZ(t,n);return{reduce:function(t,n,i){return nG(t,r(n,i))},foldMap:function(t){var n=i(t);return function(t,r){return nG(t,n(r))}},reduceRight:function(t,n,r){return nG(t,o(n,r))}}}let gJ=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:gG,getFoldableComposition:gH,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:gq,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:gZ,toArray:gQ,toReadonlyArray:gQ,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,nF),a)})}}},Symbol.toStringTag,{value:"Module"}));function gX(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 g0(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 g1(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 g2=Object.freeze(Object.defineProperty({__proto__:null,foldMapWithIndex:g0,getFoldableWithIndexComposition:function(t,n){var r=gH(t,n),i=gX(t,n),o=g0(t,n),a=g1(t,n);return{reduce:r.reduce,foldMap:r.foldMap,reduceRight:r.reduceRight,reduceWithIndex:function(t,n,r){return nG(t,i(n,r))},foldMapWithIndex:function(t){var n=o(t);return function(t,r){return nG(t,n(r))}},reduceRightWithIndex:function(t,n,r){return nG(t,a(n,r))}}},reduceRightWithIndex:g1,reduceWithIndex:gX},Symbol.toStringTag,{value:"Module"}));function g4(t){return function(n){return nV(n,t.fromIO)}}function g3(t,n){return function(r){var i=nV(r,t.fromIO);return function(t){return n.chain(t,i)}}}function g5(t,n){var r=rS(n);return function(n){return r(nV(n,t.fromIO))}}let g9=Object.freeze(Object.defineProperty({__proto__:null,chainFirstIOK:g5,chainIOK:g3,fromIOK:g4},Symbol.toStringTag,{value:"Module"}));var g8=function(){return nP},g6=function(t){return function(n){return function(r){return n(t(r))}}},g7=function(t){return function(n){return t(n)(n)}},ye=function(t,n){return nG(t,yo(n))},yt=function(t,n){return nG(t,yu(n))},yn=function(t,n){return nG(t,yc(n))},yr=function(t,n){return nG(t,yd(n))},yi=function(t,n,r){return nG(t,yf(n,r))},yo=function(t){return function(n){return function(r){return t(n(r))}}},ya=function(t){return function(n){return function(r){return n(r)(t(r))}}},yu=ya,ys=function(t){return function(n){return function(r){return t(n(r))(r)}}},yc=ys,yl=ys(nP),yd=function(t){return function(n){return nV(t,n)}},yf=function(t,n){return function(r){return function(i){return n(r(t(i)))}}},yp=function(){return nP},yh=function(t){return function(n){var r=n[0],i=n[1];return[t(r),i]}},ym=function(t){return function(n){var r;return[n[0],t(n[1])]}},yg=function(t){return mW(function(n){return n5(t(n))},n9)},yy=function(t){return mW(n5,function(n){return n9(t(n))})},yv="Reader",yb={URI:yv,map:ye},yx=rg(yb),yM={URI:yv,of:nF},yT={URI:yv,map:ye,ap:yt},yS=ra(yT),yw=ru(yT),yI={URI:yv,map:ye,ap:yt,of:nF},y_={URI:yv,map:ye,ap:yt,chain:yn},yO={URI:yv,map:ye,of:nF,ap:yt,chain:yn},yk=rS(y_),yC=ry(yb),yN=rw(y_),yj=nF(rn),yE=rs(yT),yR=nF(rt),yD=function(t){return function(n){return function(r){for(var i=[t(0,n7(n))(r)],o=1;o<n.length;o++)i.push(t(o,n[o])(r));return i}}},yA=function(t){var n=yD(t);return function(t){return n6(t)?n(t):yR}},yL=function(t){return yA(function(n,r){return t(r)})},yP=yL(nP),yF=rc(yT),yz=rx(yI);let yU=Object.freeze(Object.defineProperty({__proto__:null,ApT:yR,Applicative:yI,Apply:yT,Category:{URI:yv,compose:yr,id:yp},Chain:y_,Choice:{URI:yv,map:ye,promap:yi,left:yg,right:yy},Do:yj,Functor:yb,Monad:yO,Pointed:yM,Profunctor:{URI:yv,map:ye,promap:yi},Strong:{URI:yv,map:ye,promap:yi,first:yh,second:ym},URI:yv,ap:yu,apFirst:yS,apFirstW:yS,apS:yE,apSW:yE,apSecond:yw,apSecondW:yw,apW:ya,ask:g8,asks:nP,asksReader:g7,asksReaderW:g7,bind:yN,bindTo:yC,bindW:yN,chain:yc,chainFirst:yk,chainFirstW:yk,chainW:ys,compose:yd,first:yh,flap:yx,flatten:yl,flattenW:yl,getMonoid:yz,getSemigroup:yF,id:yp,left:yg,local:g6,map:yo,of:nF,promap:yf,reader:{URI:yv,map:ye,of:nF,ap:yt,chain:yn,promap:yi,compose:yr,id:yp,first:yh,second:ym,left:yg,right:yy},right:yy,second:ym,sequenceArray:yP,traverseArray:yL,traverseArrayWithIndex:yA,traverseReadonlyArrayWithIndex:yA,traverseReadonlyNonEmptyArrayWithIndex:yD},Symbol.toStringTag,{value:"Module"}));function yW(t){return function(){return t.fromReader(g8())}}function yB(t){return t.fromReader}function yV(t){return function(n){return nV(n,t.fromReader)}}function y$(t,n){var r=yV(t);return function(t){return function(i){return n.chain(i,r(t))}}}function yK(t,n){return nV(yV(t),rS(n))}let yY=Object.freeze(Object.defineProperty({__proto__:null,ask:yW,asks:yB,chainFirstReaderK:yK,chainReaderK:y$,fromReaderK:yV},Symbol.toStringTag,{value:"Module"}));var yq=function(){return function(t){return[t,t]}},yG=function(t){return function(){return[void 0,t]}},yZ=function(t){return function(n){return[void 0,t(n)]}},yQ=function(t){return function(n){return[t(n),n]}},yH=function(t,n){return nG(t,y0(n))},yJ=function(t,n){return nG(t,y1(n))},yX=function(t,n){return nG(t,y4(n))},y0=function(t){return function(n){return function(r){var i=n(r),o=i[0],a=i[1];return[t(o),a]}}},y1=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]}}},y2=function(t){return function(n){return[t,n]}},y4=function(t){return function(n){return function(r){var i=n(r),o=i[0],a=i[1];return t(o)(a)}}},y3=y4(nP),y5="State",y9={URI:y5,map:yH},y8=rg(y9),y6={URI:y5,map:yH,ap:yJ},y7=ra(y6),ve=ru(y6),vt={URI:y5,map:yH,ap:yJ,chain:yX},vn={URI:y5,map:yH,ap:yJ,of:y2,chain:yX},vr=rS(vt),vi=function(t){return function(n){return n(t)[0]}},vo=function(t){return function(n){return n(t)[1]}},va=ry(y9),vu=rw(vt),vs=rs(y6),vc=function(t){return function(n){return function(r){for(var i=t(0,n7(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),d=l[0],f=l[1];u.push(d),s=f}return[u,s]}}},vl=function(t){var n=vc(t);return function(t){return n6(t)?n(t):y2(rt)}},vd=function(t){return vl(function(n,r){return t(r)})},vf=vd(nP),vp=function(t,n){return t(n)[0]},vh=function(t,n){return t(n)[1]};let vm=Object.freeze(Object.defineProperty({__proto__:null,Applicative:{URI:y5,map:yH,ap:yJ,of:y2},Apply:y6,Chain:vt,FromState:{URI:y5,fromState:nP},Functor:y9,Monad:vn,Pointed:{URI:y5,of:y2},URI:y5,ap:y1,apFirst:y7,apS:vs,apSecond:ve,bind:vu,bindTo:va,chain:y4,chainFirst:vr,evalState:vp,evaluate:vi,execState:vh,execute:vo,flap:y8,flatten:y3,get:yq,gets:yQ,map:y0,modify:yZ,of:y2,put:yG,sequenceArray:vf,state:vn,traverseArray:vd,traverseArrayWithIndex:vl,traverseReadonlyArrayWithIndex:vl,traverseReadonlyNonEmptyArrayWithIndex:vc},Symbol.toStringTag,{value:"Module"}));function vg(t){return function(){return t.fromState(yq())}}function vy(t){return function(n){return t.fromState(yG(n))}}function vv(t){return nV(yZ,t.fromState)}function vb(t){return nV(yQ,t.fromState)}function vx(t){return function(n){return nV(n,t.fromState)}}function vM(t,n){var r=vx(t);return function(t){return function(i){return n.chain(i,r(t))}}}let vT=Object.freeze(Object.defineProperty({__proto__:null,chainStateK:vM,fromStateK:vx,get:vg,gets:vb,modify:vv,put:vy},Symbol.toStringTag,{value:"Module"}));function vS(t){return function(n){return nV(n,t.fromTask)}}function vw(t,n){return function(r){var i=nV(r,t.fromTask);return function(t){return n.chain(t,i)}}}function vI(t,n){var r=rS(n);return function(n){return r(nV(n,t.fromTask))}}let v_=Object.freeze(Object.defineProperty({__proto__:null,chainFirstTaskK:vI,chainTaskK:vw,fromTaskK:vS},Symbol.toStringTag,{value:"Module"}));function vO(t){return function(n){return nV(n,t.fromThese)}}let vk=Object.freeze(Object.defineProperty({__proto__:null,fromTheseK:vO},Symbol.toStringTag,{value:"Module"}));function vC(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 vN=Object.freeze(Object.defineProperty({__proto__:null,getFunctorWithIndexComposition:function(t,n){var r=rv(t,n).map,i=vC(t,n);return{map:r,mapWithIndex:function(t,n){return nG(t,i(n))}}},mapWithIndex:vC},Symbol.toStringTag,{value:"Module"})),vj=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),vE=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),vR=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var vD=function(t,n){return nG(t,vV(n))},vA=function(t,n){return nG(t,v$(n))},vL=function(t,n){return nG(t,vK(n))},vP=function(t,n,r){return nG(t,vZ(n,r))},vF=function(t){return function(t,n){return nG(t,vQ()(n))}},vz=function(t,n,r){return nG(t,vH(n,r))},vU=function(t,n){return nG(t,v1())},vW=function(t,n){return nG(t,vY(n))},vB=function(t){var n=vJ(t);return function(t,r){return nG(t,n(r))}},vV=function(t){return function(n){return t(n)}},v$=function(t){return function(n){return n(t)}},vK=function(t){return function(n){return t(n)}},vY=function(t){return function(n){return t(n)}},vq=vY(nP),vG=vK(nP),vZ=function(t,n){return function(r){return n(t,r)}},vQ=function(){return function(t){return function(n){return t(n)}}},vH=function(t,n){return function(r){return n(r,t)}},vJ=function(t){return function(n){return function(r){return t.map(n(r),nP)}}},vX=function(t){return function(n){return t.map(n,nP)}},v0=function(){return nP},v1=v0,v2="Identity",v4={URI:v2,map:vD},v3=rg(v4),v5={URI:v2,map:vD,ap:vA},v9=ra(v5),v8=ru(v5),v6={URI:v2,map:vD,ap:vA,chain:vL},v7=rS(v6),be=nP(rn),bt=ry(v4),bn=rw(v6),br=rs(v5);let bi=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:v2,map:vD,alt:vU},Applicative:{URI:v2,map:vD,ap:vA,of:nP},Apply:v5,Chain:v6,ChainRec:{URI:v2,map:vD,ap:vA,chain:vL,chainRec:fH},Comonad:{URI:v2,map:vD,extend:vW,extract:nP},Do:be,Foldable:{URI:v2,reduce:vP,foldMap:vF,reduceRight:vz},Functor:v4,Monad:{URI:v2,map:vD,ap:vA,of:nP,chain:vL},Pointed:{URI:v2,of:nP},Traversable:{URI:v2,map:vD,reduce:vP,foldMap:vF,reduceRight:vz,traverse:vB,sequence:vX},URI:v2,alt:v1,altW:v0,ap:v$,apFirst:v9,apS:br,apSecond:v8,bind:bn,bindTo:bt,chain:vK,chainFirst:v7,duplicate:vq,extend:vY,extract:nP,flap:v3,flatten:vG,foldMap:vQ,getEq:nP,getShow:nP,identity:{URI:v2,map:vD,ap:vA,of:nP,chain:vL,reduce:vP,foldMap:vF,reduceRight:vz,traverse:vB,sequence:vX,alt:vU,extract:nP,extend:vW,chainRec:fH},map:vV,of:nP,reduce:vZ,reduceRight:vH,sequence:vX,traverse:vJ},Symbol.toStringTag,{value:"Module"})),bo=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var ba=function(t,n){return function(){return n(t())}},bu=function(t,n){return function(){return t()(n())}},bs=function(t,n){return function(){return n(t())()}},bc=function(t,n){return function(){for(var r=n(t)();"Left"===r._tag;)r=n(r.left)();return r.right}},bl=function(t){return function(n){return ba(n,t)}},bd=function(t){return function(n){return bu(n,t)}},bf=function(t){return function(n){return bs(n,t)}},bp=bf(nP),bh={URI:"IO",map:ba},bm=rg(bh),bg={URI:"IO",of:nF},by={URI:"IO",map:ba,ap:bu},bv=ra(by),bb=ru(by),bx={URI:"IO",map:ba,ap:bu,of:nF},bM={URI:"IO",map:ba,ap:bu,chain:bs},bT={URI:"IO",map:ba,ap:bu,of:nF,chain:bs},bS=rS(bM),bw=nF(rn),bI=ry(bh),b_=rw(bM),bO=rs(by),bk=nF(rt),bC=function(t){return function(n){return function(){for(var r=[t(0,n7(n))()],i=1;i<n.length;i++)r.push(t(i,n[i])());return r}}},bN=function(t){var n=bC(t);return function(t){return n6(t)?n(t):bk}},bj=function(t){return bN(function(n,r){return t(r)})},bE=bj(nP),bR=rc(by),bD=rx(bx);let bA=Object.freeze(Object.defineProperty({__proto__:null,ApT:bk,Applicative:bx,Apply:by,Chain:bM,ChainRec:{URI:"IO",map:ba,ap:bu,chain:bs,chainRec:bc},Do:bw,FromIO:{URI:"IO",fromIO:nP},Functor:bh,Monad:bT,MonadIO:{URI:"IO",map:ba,ap:bu,of:nF,chain:bs,fromIO:nP},Pointed:bg,URI:"IO",ap:bd,apFirst:bv,apS:bO,apSecond:bb,bind:b_,bindTo:bI,chain:bf,chainFirst:bS,flap:bm,flatten:bp,fromIO:nP,getMonoid:bD,getSemigroup:bR,io:{URI:"IO",map:ba,of:nF,ap:bu,chain:bs,fromIO:nP,chainRec:bc},map:bl,of:nF,sequenceArray:bE,traverseArray:bj,traverseArrayWithIndex:bN,traverseReadonlyArrayWithIndex:bN,traverseReadonlyNonEmptyArrayWithIndex:bC},Symbol.toStringTag,{value:"Module"}));var bL=gp(bg),bP=gf(bg),bF=gh(bh),bz=gm(bh),bU=g_(bh),bW=gO(bT),bB=gk(bT),bV=function(t,n){return function(){return m1(t,n)}},b$=function(t,n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return bV(function(){return t.apply(void 0,r)},n)}},bK=gR(bh),bY=gC(bT),bq=gN(bT),bG=function(t){return bq(xh(t))},bZ=gj(bT),bQ=gE(bh),bH=function(t,n){return nG(t,b3(n))},bJ=function(t,n){return nG(t,b8(n))},bX=function(t,n){return nG(t,b6(function(t){return nG(n,b3(t))}))},b0=function(t,n){return nG(t,b6(n))},b1=function(t,n,r){return nG(t,b5(n,r))},b2=function(t,n){return nG(t,b9(n))},b4=function(t,n){return nG(t,xe(n))},b3=gb(bh),b5=gS(bh),b9=gw(bh),b8=gx(by),b6=gM(bT),b7=b6(nP),xe=gT(bT),xt="IOEither";function xn(t){var n=ro(by,mp(t));return{URI:xt,_E:void 0,map:bH,ap:function(t,r){return nG(t,n(r))},of:bP}}function xr(t){var n=gI(bT,t);return{URI:xt,_E:void 0,map:bH,alt:function(t,r){return nG(t,n(r))}}}var xi=function(t){var n=ml(t);return{URI:xt,_E:void 0,compact:hj(bh,n),separate:hE(bh,n,mg)}},xo={URI:xt,map:bH},xa=rg(xo),xu={URI:xt,map:bH,ap:bJ},xs=ra(xu),xc=ru(xu),xl={URI:xt,map:bH,ap:bJ,of:bP},xd={URI:xt,map:bH,ap:bJ,chain:b0},xf=rS(xd),xp={URI:xt,fromIO:bF},xh=g4(xp),xm=g3(xp,xd),xg=g5(xp,xd),xy={URI:xt,fromEither:nF},xv=r_(xy),xb=rk(xy),xx=rC(xy,xd),xM=rj(xy,xd),xT=rE(xy,xd),xS=rO(xy),xw=rR(xy,xd),xI=rN(xy),x_=function(t,n,r){return xO(t,n,r)},xO=function(t,n,r){return nG(t,b6(function(t){return nG(n(t),bf(function(n){return nG(r(t,n),b6(function(){return nF(n)}))}))}))},xk=bP(rn),xC=ry(xo),xN=rw(xd),xj=rs(xu),xE=bP(rt),xR=function(t){return nV(bC(t),bl(gn(nZ)))},xD=function(t){var n=xR(t);return function(t){return n6(t)?n(t):xE}},xA=function(t){return function(n){return function(){var r=t(0,n7(n))();if(n4(r))return r;for(var i=[r.right],o=1;o<n.length;o++){var a=t(o,n[o])();if(n4(a))return a;i.push(a.right)}return n9(i)}}},xL=function(t){var n=xA(t);return function(t){return n6(t)?n(t):xE}},xP=function(t){return xD(function(n,r){return t(r)})},xF=xP(nP),xz=function(t){return xL(function(n,r){return t(r)})},xU=xz(nP),xW=rc(xu),xB=rx(xl),xV=function(t){return rc(by)(mc(t))};let x$=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:xt,map:bH,alt:b4},ApT:xE,Applicative:xl,ApplicativePar:xl,ApplicativeSeq:{URI:xt,map:bH,ap:bX,of:bP},ApplyPar:xu,Bifunctor:{URI:xt,bimap:b1,mapLeft:b2},Chain:xd,Do:xk,FromEither:xy,FromIO:xp,Functor:xo,Monad:{URI:xt,map:bH,ap:bJ,of:bP,chain:b0},MonadIO:{URI:xt,map:bH,ap:bJ,of:bP,chain:b0,fromIO:bF},MonadThrow:{URI:xt,map:bH,ap:bJ,of:bP,chain:b0,throwError:bL},Pointed:{URI:xt,of:bP},URI:xt,alt:xe,altW:xe,ap:b8,apFirst:xs,apFirstW:xs,apS:xj,apSW:xj,apSecond:xc,apSecondW:xc,apW:b8,bimap:b5,bind:xN,bindTo:xC,bindW:xN,bracket:x_,bracketW:xO,chain:b6,chainEitherK:xM,chainEitherKW:xM,chainFirst:xf,chainFirstEitherK:xT,chainFirstEitherKW:xT,chainFirstIOK:xg,chainFirstW:xf,chainIOK:xm,chainOptionK:xx,chainW:b6,filterOrElse:xw,filterOrElseW:xw,flap:xa,flatten:b7,flattenW:b7,fold:bW,foldW:bW,fromEither:nF,fromEitherK:xI,fromIO:bF,fromIOK:xh,fromOption:xv,fromOptionK:xb,fromPredicate:xS,getAltIOValidation:xr,getApplicativeIOValidation:xn,getApplyMonoid:xB,getApplySemigroup:xW,getCompactable:xi,getFilterable:function(t){var n=md(t),r=xi(t),i=gW(bh,n),o=gB(bh,n),a=gV(bh,n),u=g$(bh,n);return{URI:xt,_E:void 0,map:bH,compact:r.compact,separate:r.separate,filter:function(t,n){return nG(t,i(n))},filterMap:function(t,n){return nG(t,o(n))},partition:function(t,n){return nG(t,a(n))},partitionMap:function(t,n){return nG(t,u(n))}}},getIOValidation:function(t){var n=xn(t),r=xr(t);return{URI:xt,_E:void 0,map:bH,ap:n.ap,of:bP,chain:b0,bimap:b1,mapLeft:b2,alt:r.alt,fromIO:bF,throwError:bL}},getOrElse:bB,getOrElseW:bB,getSemigroup:xV,ioEither:{URI:xt,bimap:b1,mapLeft:b2,map:bH,of:bP,ap:bJ,chain:b0,alt:b4,fromIO:bF,throwError:bL},left:bL,leftIO:bz,map:b3,mapLeft:b9,match:bU,matchE:bW,matchEW:bW,matchW:bU,of:bP,orElse:bY,orElseFirst:bq,orElseFirstIOK:bG,orElseFirstW:bq,orElseW:bY,orLeft:bZ,right:bP,rightIO:bF,sequenceArray:xF,sequenceSeqArray:xU,swap:bQ,throwError:bL,toUnion:bK,traverseArray:xP,traverseArrayWithIndex:xD,traverseReadonlyArrayWithIndex:xD,traverseReadonlyArrayWithIndexSeq:xL,traverseReadonlyNonEmptyArrayWithIndex:xR,traverseReadonlyNonEmptyArrayWithIndexSeq:xA,traverseSeqArray:xz,traverseSeqArrayWithIndex:xL,tryCatch:bV,tryCatchK:b$},Symbol.toStringTag,{value:"Module"}));function xK(t){return nV(n2,t.of)}function xY(t){return nF(t.of(n1))}function xq(t){return function(n){return t.map(n,n2)}}function xG(t){return nV(hs,t.of)}function xZ(t){var n=xG(t);return function(t){return nV(t,n)}}function xQ(t){var n=x9(t),r=xZ(t);return function(t){return n(r(t))}}function xH(t){return function(n){return nV(n,t.of)}}function xJ(t){var n=x9(t),r=xH(t);return function(t){return n(r(t))}}function xX(t){return function(n){return function(r){return t.of(pi(n)(r))}}}function x0(t){return nV(pa,t.of)}function x1(t){return function(n,r){return function(i){return t.map(i,p6(n,r))}}}function x2(t){return function(n,r){return function(i){return t.chain(i,p6(n,r))}}}function x4(t){return function(n){return function(r){return t.chain(r,p6(n,t.of))}}}function x3(t){return rm(t,p_)}function x5(t){return ro(t,pC)}function x9(t){var n=xY(t);return function(r){return function(i){return t.chain(i,p6(function(){return n()},r))}}}function x8(t){var n=xK(t);return function(r){return function(i){return t.chain(i,p6(r,n))}}}let x6=Object.freeze(Object.defineProperty({__proto__:null,alt:x8,ap:x5,chain:x9,chainNullableK:xQ,chainOptionK:xJ,fromEither:x0,fromF:xq,fromNullable:xG,fromNullableK:xZ,fromOptionK:xH,fromPredicate:xX,getOptionM:function(t){var n=x5(t),r=x3(t),i=x9(t),o=x8(t),a=x2(t),u=x4(t),s=xY(t);return{map:function(t,n){return nG(t,r(n))},ap:function(t,r){return nG(t,n(r))},of:xK(t),chain:function(t,n){return nG(t,i(n))},alt:function(t,n){return nG(t,o(n))},fold:function(t,n,r){return nG(t,a(n,r))},getOrElse:function(t,n){return nG(t,u(n))},fromM:xq(t),none:function(){return s()}}},getOrElse:x4,map:x3,match:x1,matchE:x2,some:xK,zero:xY},Symbol.toStringTag,{value:"Module"}));var x7=xK(bg),Me=xX(bg),Mt=x0(bg),Mn=xq(bh),Mr=bl(pa),Mi=x1(bh),Mo=x2(bM),Ma=x4(bT),Mu=bl(hh),Ms=bl(hp),Mc=xG(bg),Ml=xZ(bg),Md=xQ(bT),Mf=xH(bg),Mp=xJ(bT),Mh=x3(bh),Mm=x5(by),Mg=x9(bT),My=Mg(nP),Mv=x8(bT),Mb=xY(bg),Mx=Mb(),MM=hj(bh,pK),MT=hE(bh,pK,p_),MS=gW(bh,pQ),Mw=gB(bh,pQ),MI=gV(bh,pQ),M_=g$(bh,pQ),MO=function(t,n){return nG(t,Mh(n))},Mk=function(t,n){return nG(t,Mm(n))},MC=function(t,n){return nG(t,Mg(n))},MN=function(t,n){return nG(t,Mv(n))},Mj=function(t,n){return nG(t,MS(n))},ME=function(t,n){return nG(t,Mw(n))},MR=function(t,n){return nG(t,MI(n))},MD=function(t,n){return nG(t,M_(n))},MA="IOOption",ML={URI:MA,map:MO},MP=rg(ML),MF={URI:MA,of:x7},Mz={URI:MA,map:MO,ap:Mk},MU=ra(Mz),MW=ru(Mz),MB={URI:MA,map:MO,ap:Mk,chain:MC},MV=rS(MB),M$={URI:MA,zero:Mb},MK=u5(M$,MF),MY={URI:MA,fromIO:Mn},Mq=g4(MY),MG=g3(MY,MB),MZ=g5(MY,MB),MQ={URI:MA,fromEither:Mt},MH=rN(MQ),MJ=rj(MQ,MB),MX=rE(MQ,MB),M0=x7(rn),M1=ry(ML),M2=rw(MB),M4=rs(Mz),M3=x7(rt),M5=function(t){return nV(bC(t),bl(hM(nZ)))},M9=function(t){var n=M5(t);return function(t){return n6(t)?n(t):M3}};let M8=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:MA,map:MO,alt:MN},Alternative:{URI:MA,map:MO,ap:Mk,of:x7,alt:MN,zero:Mb},ApT:M3,Applicative:{URI:MA,map:MO,ap:Mk,of:x7},Apply:Mz,Chain:MB,Compactable:{URI:MA,compact:MM,separate:MT},Do:M0,Filterable:{URI:MA,map:MO,compact:MM,separate:MT,filter:Mj,filterMap:ME,partition:MR,partitionMap:MD},FromEither:MQ,FromIO:MY,Functor:ML,Monad:{URI:MA,map:MO,ap:Mk,of:x7,chain:MC},MonadIO:{URI:MA,map:MO,ap:Mk,of:x7,chain:MC,fromIO:Mn},Pointed:MF,Zero:M$,alt:Mv,altW:Mv,ap:Mm,apFirst:MU,apS:M4,apSecond:MW,bind:M2,bindTo:M1,chain:Mg,chainEitherK:MJ,chainFirst:MV,chainFirstEitherK:MX,chainFirstIOK:MZ,chainIOK:MG,chainNullableK:Md,chainOptionK:Mp,compact:MM,filter:MS,filterMap:Mw,flap:MP,flatten:My,fold:Mo,fromEither:Mt,fromEitherK:MH,fromIO:Mn,fromIOEither:Mr,fromIOK:Mq,fromNullable:Mc,fromNullableK:Ml,fromOption:nF,fromOptionK:Mf,fromPredicate:Me,getOrElse:Ma,getOrElseW:Ma,guard:MK,map:Mh,match:Mi,matchE:Mo,matchEW:Mo,matchW:Mi,none:Mx,of:x7,partition:MI,partitionMap:M_,separate:MT,some:x7,toNullable:Ms,toUndefined:Mu,traverseReadonlyArrayWithIndex:M9,traverseReadonlyNonEmptyArrayWithIndex:M5,zero:Mb},Symbol.toStringTag,{value:"Module"}));var M6=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 M7=Object.freeze(Object.defineProperty({__proto__:null,IORef:M6,newIORef:function(t){return function(){return new M6(t)}}},Symbol.toStringTag,{value:"Module"})),Te=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Tt=function(t){return m1(function(){return JSON.parse(t)},nP)},Tn=function(t){return m1(function(){var n=JSON.stringify(t);if("string"!=typeof n)throw Error("Converting unsupported structure to JSON");return n},nP)};let Tr=Object.freeze(Object.defineProperty({__proto__:null,parse:Tt,stringify:Tn},Symbol.toStringTag,{value:"Module"})),Ti=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var To=function(t){return new Map(t)};function Ta(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 Tu=function(t){return t.size},Ts=function(t){return 0===t.size};function Tc(t){var n=Tx(t);return function(r,i){if(void 0===i){var o=Tc(t);return function(t){return o(r,t)}}return n0(n(r,i))}}function Tl(t){return function(n,r){if(void 0===r){var i=Tl(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 Td=function(t){return function(n){return Array.from(n.keys()).sort(t.compare)}},Tf=function(t){return function(n){return Array.from(n.values()).sort(t.compare)}};function Tp(t){var n=Td(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 Th=function(t){return Tp(t)(function(t,n){return[t,n]})},Tm=function(t){var n=Tb(t);return function(t,r){var i=n(t);return function(n){var o=i(n);if(nX(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}}},Tg=function(t){var n=Tb(t);return function(t){return function(r){var i=n(t,r);if(n0(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},Ty=function(t){var n=Tv(t);return function(t,r){return n(t,function(){return r})}},Tv=function(t){var n=Tb(t);return function(t,r){return function(i){var o=n(t,i);if(nX(o))return n1;var a=o.value,u=a[0],s=a[1],c=r(s);if(c===s)return n2(i);var l=new Map(i);return l.set(u,c),n2(l)}}};function Tb(t){return function(n,r){if(void 0===r){var i=Tb(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 n2([s,c])}return n1}}function Tx(t){var n=Tb(t);return function(r,i){if(void 0===i){var o=Tx(t);return function(t){return o(r,t)}}return nG(n(r,i),pI(function(t){return t[0],t[1]}))}}function TM(t,n){var r=Tb(t);return function(i,o){if(void 0===o){var a=TM(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],d=c[1],f=r(l,o);if(nX(f)||!t.equals(l,f.value[0])||!n.equals(d,f.value[1]))return!1}return!0}}var TT=new Map;function TS(t,n){var r=TM(t,n);return rA(function(t,n){return r(t,n)&&r(n,t)})}var Tw=function(t,n){return new Map([[t,n]])},TI=function(t,n){for(var r,i=new Map,o=t.entries();!(r=o.next()).done;){var a=r.value,u=a[0],s=a[1];i.set(u,n(u,s))}return i},T_=function(t){return function(n){for(var r,i=new Map,o=new Map,a=n.entries();!(r=a.next()).done;){var u=r.value,s=u[0],c=t(s,u[1]);n4(c)?i.set(s,c.left):o.set(s,c.right)}return uV(i,o)}};function TO(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 uV(i,o)}}var Tk=function(t){return function(n){for(var r,i=new Map,o=n.entries();!(r=o.next()).done;){var a=r.value,u=a[0],s=t(u,a[1]);n0(s)&&i.set(u,s.value)}return i}};function TC(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 TN=function(t,n){return TI(t,function(t,r){return n(r)})},Tj=function(t,n){return TA(t,function(t,r){return n(r)})},TE=function(t,n){return TL(t,function(t,r){return n(r)})},TR=function(t,n){return TP(t,function(t,r){return n(r)})},TD=function(t,n){return TF(t,function(t,r){return n(r)})},TA=function(t,n){return nG(t,TC(n))},TL=function(t,n){return nG(t,Tk(n))},TP=function(t,n){return nG(t,TO(n))},TF=function(t,n){return nG(t,T_(n))},Tz=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];n0(u)&&r.set(a,u.value)}return r},TU=function(t){return function(n){return Tj(n,t)}},TW=function(t){return function(n){return TE(n,t)}},TB=function(t){return function(n){return TN(n,t)}},TV=function(t){return function(n){return TI(n,t)}},T$=function(t){return function(n){return TR(n,t)}},TK=function(t){return function(n){return TD(n,t)}},TY=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];n4(s)?r.set(u,s.left):i.set(u,s.right)}return uV(r,i)},Tq="ReadonlyMap",TG=function(t,n){var r=Sn(t,n);return{concat:function(t,n){return r(n)(t)}}},TZ=function(t,n){return{concat:TG(t,n).concat,empty:TT}},TQ=function(t,n){var r=Sr(t,n);return{concat:function(t,n){return r(n)(t)}}},TH=function(t){return function(){var n=Si(t);return{concat:function(t,r){return n(r)(t)}}}},TJ={URI:Tq,map:TN},TX=rg(TJ),T0=function(){return{URI:Tq,_E:void 0,map:TN,mapWithIndex:TI}},T1={URI:Tq,compact:Tz,separate:TY},T2=function(t){var n=T9(t);return function(t,r){return n(t,function(t,n,i){return r(n,i)})}},T4=function(t){var n=T8(t);return function(t){var r=n(t);return function(t){return r(function(n,r){return t(r)})}}},T3=function(t){var n=T6(t);return function(t,r){return n(t,function(t,n,i){return r(n,i)})}},T5=function(t){var n=T2(t),r=T4(t),i=T3(t);return{URI:Tq,_E:void 0,reduce:function(t,r,i){return nG(t,n(r,i))},foldMap:function(t){var n=r(t);return function(t,r){return nG(t,n(r))}},reduceRight:function(t,n,r){return nG(t,i(n,r))}}},T9=function(t){var n=Td(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}}},T8=function(t){var n=Td(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}}}},T6=function(t){var n=Td(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}}},T7=function(t){var n=T5(t),r=T9(t),i=T8(t),o=T6(t);return{URI:Tq,_E:void 0,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:function(t,n,i){return nG(t,r(n,i))},foldMapWithIndex:function(t){var n=i(t);return function(t,r){return nG(t,n(r))}},reduceRightWithIndex:function(t,n,r){return nG(t,o(n,r))}}},Se=function(t){var n=St(t),r=T5(t);return{URI:Tq,_E:void 0,map:TN,reduce:r.reduce,foldMap:r.foldMap,reduceRight:r.reduceRight,traverse:n.traverse,sequence:n.sequence}},St=function(t){var n=T7(t),r=Td(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,nZ)}};return{URI:Tq,_E:void 0,map:TN,mapWithIndex:TI,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:n.reduceWithIndex,foldMapWithIndex:n.foldMapWithIndex,reduceRightWithIndex:n.reduceRightWithIndex,traverse:o,sequence:a,traverseWithIndex:i}},Sn=function(t,n){var r=Tx(t);return function(t){return function(i){if(Ts(i))return t;if(Ts(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],d=r(c)(t);n0(d)?a.set(c,n.concat(l,d.value)):a.set(c,l)}for(var f=t.entries();!(o=f.next()).done;){var p=o.value,c=p[0],l=p[1],d=r(c)(a);nX(d)&&a.set(c,l)}return a}}},Sr=function(t,n){var r=Tx(t);return function(t){return function(i){if(Ts(i)||Ts(t))return TT;for(var o,a=new Map,u=i.entries();!(o=u.next()).done;){var s=o.value,c=s[0],l=s[1],d=r(c)(t);n0(d)&&a.set(c,n.concat(l,d.value))}return a}}},Si=function(t){var n=Tc(t);return function(t){return function(r){if(Ts(r))return t;if(Ts(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 d=i.value,s=d[0],c=d[1];n(s)(r)||o.set(s,c)}return o}}};let So=Object.freeze(Object.defineProperty({__proto__:null,Compactable:T1,Filterable:{URI:Tq,map:TN,compact:Tz,separate:TY,filter:Tj,filterMap:TE,partition:TR,partitionMap:TD},Functor:TJ,URI:Tq,collect:Tp,compact:Tz,deleteAt:Tg,difference:Si,elem:Tl,empty:TT,filter:TU,filterMap:TW,filterMapWithIndex:Tk,filterWithIndex:TC,flap:TX,foldMap:T4,foldMapWithIndex:T8,fromFoldable:function(t,n,r){return function(i){var o=Tb(t);return r.reduce(i,new Map,function(t,r){var i=r[0],a=r[1],u=o(i,t);return n0(u)?t.set(u.value[0],n.concat(u.value[1],a)):t.set(i,a),t})}},fromMap:To,getDifferenceMagma:TH,getEq:TS,getFilterableWithIndex:function(){return{URI:Tq,_E:void 0,map:TN,mapWithIndex:TI,compact:Tz,separate:TY,filter:Tj,filterMap:TE,partition:TR,partitionMap:TD,partitionMapWithIndex:TF,partitionWithIndex:TP,filterMapWithIndex:TL,filterWithIndex:TA}},getFoldable:T5,getFoldableWithIndex:T7,getFunctorWithIndex:T0,getIntersectionSemigroup:TQ,getMonoid:function(t,n){var r=Tb(t);return{concat:function(t,i){if(Ts(t))return i;if(Ts(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],d=r(c,t);n0(d)?a.set(d.value[0],n.concat(d.value[1],l)):a.set(c,l)}return a},empty:TT}},getShow:Ta,getTraversable:Se,getTraversableWithIndex:St,getUnionMonoid:TZ,getUnionSemigroup:TG,getWitherable:function(t){var n=St(t);return{URI:Tq,_E:void 0,map:TN,compact:Tz,separate:TY,filter:Tj,filterMap:TE,partition:TR,partitionMap:TD,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,traverse:n.traverse,sequence:n.sequence,mapWithIndex:TI,reduceWithIndex:n.reduceWithIndex,foldMapWithIndex:n.foldMapWithIndex,reduceRightWithIndex:n.reduceRightWithIndex,traverseWithIndex:n.traverseWithIndex,wilt:u1(n,T1),wither:u2(n,T1)}},insertAt:Tm,intersection:Sr,isEmpty:Ts,isSubmap:TM,keys:Td,lookup:Tx,lookupWithKey:Tb,map:TB,mapWithIndex:TV,member:Tc,modifyAt:Tv,partition:T$,partitionMap:TK,partitionMapWithIndex:T_,partitionWithIndex:TO,pop:function(t){var n=Tx(t),r=Tg(t);return function(t){var i=r(t);return function(r){return nG(n(t,r),pI(function(t){return[t,i(r)]}))}}},readonlyMap:{URI:Tq,map:TN,compact:Tz,separate:TY,filter:Tj,filterMap:TE,partition:TR,partitionMap:TD},reduce:T2,reduceRight:T3,reduceRightWithIndex:T6,reduceWithIndex:T9,separate:TY,singleton:Tw,size:Tu,toMap:function(t){return new Map(t)},toReadonlyArray:Th,toUnfoldable:function(t,n){var r=Th(t);return function(t){var i=r(t),o=i.length;return n.unfold(0,function(t){return t<o?n2([i[t],t+1]):n1})}},union:Sn,updateAt:Ty,upsertAt:Tm,values:Tf},Symbol.toStringTag,{value:"Module"}));var Sa=globalThis&&globalThis.__assign||function(){return(Sa=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)},Su=function(t){return function(n){return Array.from(n.keys()).sort(t.compare)}},Ss=function(t){return function(n){return Array.from(n.values()).sort(t.compare)}};function Sc(t){var n=Su(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 Sl(t){return Sc(t)(function(t,n){return[t,n]})}var Sd=function(t){var n=Sm(t);return function(t,r){var i=n(t);return function(n){var o=i(n);if(nX(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}}},Sf=function(t){var n=Sm(t);return function(t){return function(r){var i=n(t,r);if(n0(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},Sp=function(t){var n=Sh(t);return function(t,r){return n(t,function(){return r})}},Sh=function(t){var n=Sm(t);return function(t,r){return function(i){var o=n(t,i);if(nX(o))return n1;var a=new Map(i);return a.set(o.value[0],r(o.value[1])),n2(a)}}};function Sm(t){return function(n,r){if(void 0===r){var i=Sm(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 n2([s,c])}return n1}}var Sg=function(t,n){return new Map([[t,n]])},Sy=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},Sv=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]);n4(c)?i.set(s,c.left):o.set(s,c.right)}return uV(i,o)}};function Sb(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 uV(i,o)}}var Sx=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]);n0(s)&&i.set(u,s.value)}return i}};function SM(t){return function(n){for(var r,i=new Map,o=n.entries();!(r=o.next()).done;){var a=r.value,u=a[0],s=a[1];t(u,s)&&i.set(u,s)}return i}}var ST=function(t,n){return Sy(t,function(t,r){return n(r)})},SS=function(t,n){return SO(t,function(t,r){return n(r)})},Sw=function(t,n){return Sk(t,function(t,r){return n(r)})},SI=function(t,n){return SC(t,function(t,r){return n(r)})},S_=function(t,n){return SN(t,function(t,r){return n(r)})},SO=function(t,n){return nG(t,SM(n))},Sk=function(t,n){return nG(t,Sx(n))},SC=function(t,n){return nG(t,Sb(n))},SN=function(t,n){return nG(t,Sv(n))},Sj=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];n0(u)&&r.set(a,u.value)}return r},SE=function(t){return function(n){return SS(n,t)}},SR=function(t){return function(n){return Sw(n,t)}},SD=function(t){return function(n){return ST(n,t)}},SA=function(t){return function(n){return Sy(n,t)}},SL=function(t){return function(n){return SI(n,t)}},SP=function(t){return function(n){return S_(n,t)}},SF=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];n4(s)?r.set(u,s.left):i.set(u,s.right)}return uV(r,i)},Sz=function(t,n){var r=SH(t,n);return{concat:function(t,n){return r(n)(t)}}},SU=function(t,n){return{concat:Sz(t,n).concat,empty:new Map}},SW=function(t,n){var r=SJ(t,n);return{concat:function(t,n){return r(n)(t)}}},SB=function(t){return function(){var n=SX(t);return{concat:function(t,r){return n(r)(t)}}}},SV=function(t){return Sa(Sa({},T5(t)),{URI:"Map"})},S$=function(t){return Sa(Sa({},T7(t)),{URI:"Map"})},SK=function(t){var n=S$(t),r=Su(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:ST,mapWithIndex:Sy,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:n.reduceWithIndex,foldMapWithIndex:n.foldMapWithIndex,reduceRightWithIndex:n.reduceRightWithIndex,traverse:o,sequence:a,traverseWithIndex:i}},SY={URI:"Map",map:ST},Sq=rg(SY),SG={URI:"Map",compact:Sj,separate:SF},SZ={URI:"Map",map:ST,compact:Sj,separate:SF,filter:SS,filterMap:Sw,partition:SI,partitionMap:S_},SQ=function(t){return new Map(t)},SH=function(t,n){var r=Sn(t,n);return function(t){return function(n){return Ts(n)?SQ(t):Ts(t)?SQ(n):r(t)(n)}}},SJ=function(t,n){var r=Sr(t,n);return function(t){return function(n){return Ts(n)||Ts(t)?new Map:r(t)(n)}}},SX=function(t){var n=Si(t);return function(t){return function(r){return Ts(r)?SQ(t):Ts(t)?SQ(r):n(t)(r)}}},S0=new Map;let S1=Object.freeze(Object.defineProperty({__proto__:null,Compactable:SG,Filterable:SZ,Functor:SY,URI:"Map",collect:Sc,compact:Sj,deleteAt:Sf,difference:SX,elem:Tl,empty:S0,filter:SE,filterMap:SR,filterMapWithIndex:Sx,filterWithIndex:SM,flap:Sq,foldMap:T4,foldMapWithIndex:T8,fromFoldable:function(t,n,r){return function(i){var o=Sm(t);return r.reduce(i,new Map,function(t,r){var i=r[0],a=r[1],u=o(i,t);return n0(u)?t.set(u.value[0],n.concat(u.value[1],a)):t.set(i,a),t})}},getDifferenceMagma:SB,getEq:TS,getFilterableWithIndex:function(){return{URI:"Map",_E:void 0,map:ST,mapWithIndex:Sy,compact:Sj,separate:SF,filter:SS,filterMap:Sw,partition:SI,partitionMap:S_,partitionMapWithIndex:SN,partitionWithIndex:SC,filterMapWithIndex:Sk,filterWithIndex:SO}},getFoldable:SV,getFoldableWithIndex:S$,getIntersectionSemigroup:SW,getMonoid:function(t,n){var r=Sm(t);return{concat:function(t,i){if(Ts(t))return i;if(Ts(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],d=r(c,t);n0(d)?a.set(d.value[0],n.concat(d.value[1],l)):a.set(c,l)}return a},empty:new Map}},getShow:Ta,getTraversableWithIndex:SK,getUnionMonoid:SU,getUnionSemigroup:Sz,getWitherable:function(t){var n=SK(t);return{URI:"Map",_E:void 0,map:ST,compact:Sj,separate:SF,filter:SS,filterMap:Sw,partition:SI,partitionMap:S_,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,traverse:n.traverse,sequence:n.sequence,mapWithIndex:Sy,reduceWithIndex:n.reduceWithIndex,foldMapWithIndex:n.foldMapWithIndex,reduceRightWithIndex:n.reduceRightWithIndex,traverseWithIndex:n.traverseWithIndex,wilt:u1(n,SG),wither:u2(n,SG)}},insertAt:Sd,intersection:SJ,isEmpty:Ts,isSubmap:TM,keys:Su,lookup:Tx,lookupWithKey:Sm,map:SD,mapWithIndex:SA,map_:SZ,member:Tc,modifyAt:Sh,partition:SL,partitionMap:SP,partitionMapWithIndex:Sv,partitionWithIndex:Sb,pop:function(t){var n=Tx(t),r=Sf(t);return function(t){var i=r(t);return function(r){return nG(n(t,r),pI(function(t){return[t,i(r)]}))}}},reduce:T2,reduceRight:T3,reduceRightWithIndex:T6,reduceWithIndex:T9,separate:SF,singleton:Sg,size:Tu,toArray:Sl,toUnfoldable:function(t,n){var r=Sl(t);return function(t){var i=r(t),o=i.length;return n.unfold(0,function(t){return t<o?n2([i[t],t+1]):n1})}},union:SH,updateAt:Sp,upsertAt:Sd,values:Ss},Symbol.toStringTag,{value:"Module"})),S2=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),S4=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),S3=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),S5=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),S9=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var S8=function(t){return{concat:il(t).concat,empty:t.top}},S6=function(t){return{concat:id(t).concat,empty:t.bottom}},S7=function(t){return{concat:ii(t).concat,empty:t.empty}},we=function(t){var n={};for(var r in t)rr.call(t,r)&&(n[r]=t[r].empty);return{concat:ih(t).concat,empty:n}},wt=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return{concat:im.apply(i_,t).concat,empty:t.map(function(t){return t.empty})}},wn=function(t){return is(t)(t.empty)},wr={concat:ib.concat,empty:void 0},wi={concat:iM.concat,empty:!0},wo={concat:iT.concat,empty:!1},wa=function(){return S7(gL())},wu={concat:iS.concat,empty:""},ws={concat:iw.concat,empty:0},wc={concat:iI.concat,empty:1};let wl=Object.freeze(Object.defineProperty({__proto__:null,concatAll:wn,fold:wn,getDualMonoid:S7,getEndomorphismMonoid:wa,getFunctionMonoid:nR,getJoinMonoid:S6,getMeetMonoid:S8,getStructMonoid:we,getTupleMonoid:wt,max:S6,min:S8,monoidAll:wi,monoidAny:wo,monoidProduct:wc,monoidString:wu,monoidSum:ws,monoidVoid:wr,reverse:S7,struct:we,tuple:wt},Symbol.toStringTag,{value:"Module"})),wd=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var wf=function(t,n,r){return function(i){return -1===i?t():0===i?n():r()}},wp=function(t){return -1===t?1:1===t?-1:0},wh={equals:function(t,n){return t===n}},wm={concat:function(t,n){return 0!==t?t:n}},wg={concat:wm.concat,empty:0},wy=function(t){return t<=-1?-1:t>=1?1:0};let wv=Object.freeze(Object.defineProperty({__proto__:null,Eq:wh,Monoid:wg,Semigroup:wm,eqOrdering:wh,invert:wp,match:wf,matchW:wf,monoidOrdering:wg,reverse:wp,semigroupOrdering:wm,sign:wy},Symbol.toStringTag,{value:"Module"})),wb=Object.freeze(Object.defineProperty({__proto__:null,pipe:nG,pipeable:function(t){var n,r,i,o,a,u,s,c,l,d,f,p,h,m,g,y={};if("function"==typeof t.map){var v=function(n){return function(r){return t.map(r,n)}};y.map=v}if("function"==typeof t.contramap){var b=function(n){return function(r){return t.contramap(r,n)}};y.contramap=b}if("function"==typeof t.mapWithIndex){var x=function(n){return function(r){return t.mapWithIndex(r,n)}};y.mapWithIndex=x}if("function"==typeof t.ap){var M=function(n){return function(r){return t.ap(r,n)}},T=function(n){return function(r){return t.ap(t.map(r,function(t){return function(){return t}}),n)}};y.ap=M,y.apFirst=T,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 S=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})})}},I=function(n){return t.chain(n,nP)};y.chain=S,y.chainFirst=w,y.flatten=I}if("function"==typeof t.bimap){var _=function(n,r){return function(i){return t.bimap(i,n,r)}},O=function(n){return function(r){return t.mapLeft(r,n)}};y.bimap=_,y.mapLeft=O}if("function"==typeof t.extend){var k=function(n){return function(r){return t.extend(r,n)}},C=function(n){return t.extend(n,nP)};y.extend=k,y.duplicate=C}if("function"==typeof t.reduce){var N=function(n,r){return function(i){return t.reduce(i,n,r)}},j=function(n){var r=t.foldMap(n);return function(t){return function(n){return r(n,t)}}},E=function(n,r){return function(i){return t.reduceRight(i,n,r)}};y.reduce=N,y.foldMap=j,y.reduceRight=E}if("function"==typeof t.reduceWithIndex){var R=function(n,r){return function(i){return t.reduceWithIndex(i,n,r)}},D=function(n){var r=t.foldMapWithIndex(n);return function(t){return function(n){return r(n,t)}}},A=function(n,r){return function(i){return t.reduceRightWithIndex(i,n,r)}};y.reduceWithIndex=R,y.foldMapWithIndex=D,y.reduceRightWithIndex=A}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 P=function(n){return function(r){return t.filter(r,n)}},F=function(n){return function(r){return t.filterMap(r,n)}},z=function(n){return function(r){return t.partition(r,n)}},U=function(n){return function(r){return t.partitionMap(r,n)}};y.filter=P,y.filterMap=F,y.partition=z,y.partitionMap=U}if("function"==typeof t.filterWithIndex){var W=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=W,y.filterMapWithIndex=B,y.partitionWithIndex=V,y.partitionMapWithIndex=$}if("function"==typeof t.promap){var K=function(n,r){return function(i){return t.promap(i,n,r)}};y.promap=K}if("function"==typeof t.compose){var Y=function(n){return function(r){return t.compose(r,n)}};y.compose=Y}if("function"==typeof t.throwError){var q=function(n){return function(r){return"None"===r._tag?t.throwError(n()):t.of(r.value)}},G=function(n){return"Left"===n._tag?t.throwError(n.left):t.of(n.right)},Z=function(n,r){return function(i){return n(i)?t.of(i):t.throwError(r(i))}},Q=function(n,r){return function(i){return t.chain(i,function(i){return n(i)?t.of(i):t.throwError(r(i))})}};y.fromOption=q,y.fromEither=G,y.fromPredicate=Z,y.filterOrElse=Q}return y}},Symbol.toStringTag,{value:"Module"})),wx=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),wM=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var wT=function(){return Math.random()};function wS(t,n){return nG(wT,bl(function(r){return Math.floor((n-t+1)*r+t)}))}var ww=nG(wT,bl(function(t){return t<.5})),wI=function(t){return nG(wS(0,t.length-1),bl(function(n){return t[n]}))};let w_=Object.freeze(Object.defineProperty({__proto__:null,random:wT,randomBool:ww,randomElem:wI,randomInt:wS,randomRange:function(t,n){return nG(wT,bl(function(r){return(n-t)*r+t}))}},Symbol.toStringTag,{value:"Module"}));var wO=gp(yM),wk=gf(yM),wC=gh(yb),wN=gm(yb),wj=g_(yb),wE=gO(yO),wR=gk(yO),wD=gR(yb),wA=gC(yO),wL=gN(yO),wP=gj(yO),wF=gE(yb),wz=function(t,n){return nG(t,wK(n))},wU=function(t,n,r){return nG(t,wY(n,r))},wW=function(t,n){return nG(t,wq(n))},wB=function(t,n){return nG(t,wG(n))},wV=function(t,n){return nG(t,wZ(n))},w$=function(t,n){return nG(t,wH(n))},wK=gb(yb),wY=gS(yb),wq=gw(yb),wG=gx(yT),wZ=gM(yO),wQ=wZ(nP),wH=gT(yO),wJ="ReaderEither",wX=function(t){var n=ml(t);return{URI:wJ,_E:void 0,compact:hj(yb,n),separate:hE(yb,n,mg)}};function w0(t){var n=ro(yT,mp(t));return{URI:wJ,_E:void 0,map:wz,ap:function(t,r){return nG(t,n(r))},of:wk}}function w1(t){var n=gI(yO,t);return{URI:wJ,_E:void 0,map:wz,alt:function(t,r){return nG(t,n(r))}}}var w2={URI:wJ,map:wz},w4=rg(w2),w3={URI:wJ,map:wz,ap:wB},w5=ra(w3),w9=ru(w3),w8={URI:wJ,map:wz,ap:wB,of:wk},w6={URI:wJ,map:wz,ap:wB,chain:wV},w7=rS(w6),Ie={URI:wJ,fromReader:wC},It=yW(Ie),In=yB(Ie),Ir=yV(Ie),Ii=y$(Ie,w6),Io=yK(Ie,w6),Ia={URI:wJ,fromEither:nF},Iu=r_(Ia),Is=rk(Ia),Ic=rC(Ia,w6),Il=rj(Ia,w6),Id=rE(Ia,w6),If=rO(Ia),Ip=rR(Ia,w6),Ih=rN(Ia),Im=wk(rn),Ig=ry(w2),Iy=rw(w6),Iv=rs(w3),Ib=wk(rt),Ix=function(t){return nV(yD(t),yo(gn(nZ)))},IM=function(t){var n=Ix(t);return function(t){return n6(t)?n(t):Ib}},IT=function(t){return IM(function(n,r){return t(r)})},IS=IT(nP),Iw=rc(w3),II=rx(w8),I_=function(t){return rc(yT)(mc(t))};let IO=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:wJ,map:wz,alt:w$},ApT:Ib,Applicative:w8,Apply:w3,Bifunctor:{URI:wJ,bimap:wU,mapLeft:wW},Chain:w6,Do:Im,FromEither:Ia,FromReader:Ie,Functor:w2,Monad:{URI:wJ,map:wz,ap:wB,of:wk,chain:wV},MonadThrow:{URI:wJ,map:wz,ap:wB,of:wk,chain:wV,throwError:wO},Pointed:{URI:wJ,of:wk},URI:wJ,alt:wH,altW:wH,ap:wG,apFirst:w5,apFirstW:w5,apS:Iv,apSW:Iv,apSecond:w9,apSecondW:w9,apW:wG,ask:It,asks:In,asksReaderEither:g7,asksReaderEitherW:g7,bimap:wY,bind:Iy,bindTo:Ig,bindW:Iy,chain:wZ,chainEitherK:Il,chainEitherKW:Il,chainFirst:w7,chainFirstEitherK:Id,chainFirstEitherKW:Id,chainFirstReaderK:Io,chainFirstReaderKW:Io,chainFirstW:w7,chainOptionK:Ic,chainReaderK:Ii,chainReaderKW:Ii,chainW:wZ,filterOrElse:Ip,filterOrElseW:Ip,flap:w4,flatten:wQ,flattenW:wQ,fold:wE,foldW:wE,fromEither:nF,fromEitherK:Ih,fromOption:Iu,fromOptionK:Is,fromPredicate:If,fromReader:wC,fromReaderK:Ir,getAltReaderValidation:w1,getApplicativeReaderValidation:w0,getApplyMonoid:II,getApplySemigroup:Iw,getCompactable:wX,getFilterable:function(t){var n=md(t),r=wX(t),i=gW(yb,n),o=gB(yb,n),a=gV(yb,n),u=g$(yb,n);return{URI:wJ,_E:void 0,map:wz,compact:r.compact,separate:r.separate,filter:function(t,n){return nG(t,i(n))},filterMap:function(t,n){return nG(t,o(n))},partition:function(t,n){return nG(t,a(n))},partitionMap:function(t,n){return nG(t,u(n))}}},getOrElse:wR,getOrElseW:wR,getReaderValidation:function(t){var n=w0(t),r=w1(t);return{URI:wJ,_E:void 0,map:wz,ap:n.ap,of:wk,chain:wV,bimap:wU,mapLeft:wW,alt:r.alt,throwError:wO}},getSemigroup:I_,left:wO,leftReader:wN,local:g6,map:wK,mapLeft:wq,match:wj,matchE:wE,matchEW:wE,matchW:wj,of:wk,orElse:wA,orElseFirst:wL,orElseFirstW:wL,orElseW:wA,orLeft:wP,readerEither:{URI:wJ,bimap:wU,mapLeft:wW,map:wz,of:wk,ap:wB,chain:wV,alt:w$,throwError:wO},right:wk,rightReader:wC,sequenceArray:IS,swap:wF,throwError:wO,toUnion:wD,traverseArray:IT,traverseArrayWithIndex:IM,traverseReadonlyArrayWithIndex:IM,traverseReadonlyNonEmptyArrayWithIndex:Ix},Symbol.toStringTag,{value:"Module"}));function Ik(t){return function(n){return function(){return t.of(n)}}}function IC(t){return function(n){return function(r){return function(i){return t.map(r(i),n)}}}}function IN(t){return function(n){return function(r){return function(i){return t.ap(r(i),n(i))}}}}function Ij(t){return function(n){return function(r){return function(i){return t.chain(r(i),function(t){return n(t)(i)})}}}}function IE(t){return function(n){return nV(n,t.of)}}let IR=Object.freeze(Object.defineProperty({__proto__:null,ap:IN,chain:Ij,fromNaturalTransformation:function(t){return function(n){return nV(n,t)}},fromReader:IE,getReaderM:function(t){var n=IN(t),r=IC(t),i=Ij(t);return{map:function(t,n){return nG(t,r(n))},ap:function(t,r){return nG(t,n(r))},of:Ik(t),chain:function(t,n){return nG(t,i(n))},ask:function(){return t.of},asks:function(n){return nV(n,t.of)},local:function(t,n){return function(r){return t(n(r))}},fromReader:IE(t),fromM:function(t){return function(){return t}}}},map:IC,of:Ik},Symbol.toStringTag,{value:"Module"}));var ID=function(t){return function(){return Promise.resolve().then(t)}},IA=function(t,n){return nG(t,Iz(n))},IL=function(t,n){return nG(t,IU(n))},IP=function(t,n){return nG(t,IB(function(t){return nG(n,Iz(t))}))},IF=function(t,n){return nG(t,IB(n))},Iz=function(t){return function(n){return function(){return Promise.resolve().then(n).then(t)}}},IU=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])})}}},IW=function(t){return function(){return Promise.resolve(t)}},IB=function(t){return function(n){return function(){return Promise.resolve().then(n).then(function(n){return t(n)()})}}},IV=IB(nP),I$="Task",IK={URI:I$,map:IA},IY=rg(IK),Iq={URI:I$,of:IW},IG={URI:I$,map:IA,ap:IL},IZ=ra(IG),IQ=ru(IG),IH={URI:I$,map:IA,ap:IL,of:IW},IJ={URI:I$,map:IA,ap:IP},IX={URI:I$,map:IA,ap:IP,of:IW},I0={URI:I$,map:IA,ap:IL,chain:IF},I1={URI:I$,map:IA,of:IW,ap:IL,chain:IF},I2=rS(I0),I4={URI:I$,fromIO:ID},I3=g4(I4),I5=g3(I4,I0),I9=g5(I4,I0),I8=function(){return new Promise(function(t){})},I6=IW(rn),I7=ry(IK),_e=rw(I0),_t=rs(IG),_n=IW(rt),_r=function(t){return function(n){return function(){return Promise.all(n.map(function(n,r){return Promise.resolve().then(function(){return t(r,n)()})}))}}},_i=function(t){var n=_r(t);return function(t){return n6(t)?n(t):_n}},_o=function(t){return function(n){return function(){return re(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,n7(n))).then(n8))}}},_a=function(t){var n=_o(t);return function(t){return n6(t)?n(t):_n}},_u=function(t){return _i(function(n,r){return t(r)})},_s=_u(nP),_c=function(t){return _a(function(n,r){return t(r)})},_l=_c(nP),_d=rc(IJ),_f=rx(IX);let _p=Object.freeze(Object.defineProperty({__proto__:null,ApT:_n,ApplicativePar:IH,ApplicativeSeq:IX,ApplyPar:IG,ApplySeq:IJ,Chain:I0,Do:I6,FromIO:I4,FromTask:{URI:I$,fromIO:ID,fromTask:nP},Functor:IK,Monad:I1,MonadIO:{URI:I$,map:IA,of:IW,ap:IL,chain:IF,fromIO:ID},MonadTask:{URI:I$,map:IA,of:IW,ap:IL,chain:IF,fromIO:ID,fromTask:nP},Pointed:Iq,URI:I$,ap:IU,apFirst:IZ,apS:_t,apSecond:IQ,bind:_e,bindTo:I7,chain:IB,chainFirst:I2,chainFirstIOK:I9,chainIOK:I5,delay:function(t){return function(n){return function(){return new Promise(function(r){setTimeout(function(){Promise.resolve().then(n).then(r)},t)})}}},flap:IY,flatten:IV,fromIO:ID,fromIOK:I3,fromTask:nP,getMonoid:_f,getRaceMonoid:function(){return{concat:function(t,n){return function(){return Promise.race([Promise.resolve().then(t),Promise.resolve().then(n)])}},empty:I8}},getSemigroup:_d,map:Iz,never:I8,of:IW,sequenceArray:_s,sequenceSeqArray:_l,task:{URI:I$,map:IA,of:IW,ap:IL,chain:IF,fromIO:ID,fromTask:nP},taskSeq:{URI:I$,map:IA,of:IW,ap:IP,chain:IF,fromIO:ID,fromTask:nP},traverseArray:_u,traverseArrayWithIndex:_i,traverseReadonlyArrayWithIndex:_i,traverseReadonlyArrayWithIndexSeq:_a,traverseReadonlyNonEmptyArrayWithIndex:_r,traverseReadonlyNonEmptyArrayWithIndexSeq:_o,traverseSeqArray:_c,traverseSeqArrayWithIndex:_a},Symbol.toStringTag,{value:"Module"}));var _h=IE(Iq),_m=nV(ID,nF),_g=function(t,n){return nG(t,_x(n))},_y=function(t,n){return nG(t,_M(n))},_v=function(t,n){return nG(t,_S(function(t){return nG(n,_x(t))}))},_b=function(t,n){return nG(t,_S(n))},_x=IC(IK),_M=IN(IG),_T=Ik(Iq),_S=Ij(I1),_w=_S(nP),_I="ReaderTask",__={URI:_I,map:_g},_O=rg(__),_k={URI:_I,of:_T},_C={URI:_I,map:_g,ap:_y},_N=ra(_C),_j=ru(_C),_E={URI:_I,map:_g,ap:_v},_R={URI:_I,map:_g,ap:_v,of:_T},_D={URI:_I,map:_g,ap:_y,chain:_b},_A={URI:_I,map:_g,of:_T,ap:_y,chain:_b},_L=rS(_D),_P={URI:_I,fromIO:_m},_F=g4(_P),_z=g3(_P,_D),_U=g5(_P,_D),_W={URI:_I,fromReader:_h},_B=yW(_W),_V=yB(_W),_$=yV(_W),_K=y$(_W,_D),_Y=yK(_W,_D),_q={URI:_I,fromIO:_m,fromTask:nF},_G=vS(_q),_Z=vw(_q,_D),_Q=vI(_q,_D),_H=_T(rn),_J=ry(__),_X=rw(_D),_0=rs(_C),_1=_T(rt),_2=function(t){return nV(yD(t),yo(_r(nZ)))},_4=function(t){var n=_2(t);return function(t){return n6(t)?n(t):_1}},_3=function(t){return nV(yD(t),yo(_o(nZ)))},_5=function(t){var n=_3(t);return function(t){return n6(t)?n(t):_1}},_9=function(t){return _4(function(n,r){return t(r)})},_8=_9(nP),_6=function(t){return _5(function(n,r){return t(r)})},_7=_6(nP),Oe=rc(_E),Ot=rx(_R);function On(t,n){return t(n)()}let Or=Object.freeze(Object.defineProperty({__proto__:null,ApT:_1,ApplicativePar:{URI:_I,map:_g,ap:_y,of:_T},ApplicativeSeq:_R,ApplyPar:_C,ApplySeq:_E,Chain:_D,Do:_H,FromIO:_P,FromReader:_W,FromTask:_q,Functor:__,Monad:_A,MonadIO:{URI:_I,map:_g,of:_T,ap:_y,chain:_b,fromIO:_m},MonadTask:{URI:_I,map:_g,of:_T,ap:_y,chain:_b,fromIO:_m,fromTask:nF},Pointed:_k,URI:_I,ap:_M,apFirst:_N,apS:_0,apSW:_0,apSecond:_j,apW:_M,ask:_B,asks:_V,asksReaderTask:g7,asksReaderTaskW:g7,bind:_X,bindTo:_J,bindW:_X,chain:_S,chainFirst:_L,chainFirstIOK:_U,chainFirstReaderK:_Y,chainFirstReaderKW:_Y,chainFirstTaskK:_Q,chainFirstW:_L,chainIOK:_z,chainReaderK:_K,chainReaderKW:_K,chainTaskK:_Z,chainW:_S,flap:_O,flatten:_w,flattenW:_w,fromIO:_m,fromIOK:_F,fromReader:_h,fromReaderK:_$,fromTask:nF,fromTaskK:_G,getMonoid:Ot,getSemigroup:Oe,local:g6,map:_x,of:_T,readerTask:{URI:_I,map:_g,of:_T,ap:_y,chain:_b,fromIO:_m,fromTask:nF},readerTaskSeq:{URI:_I,map:_g,of:_T,ap:_v,chain:_b,fromIO:_m,fromTask:nF},run:On,sequenceArray:_8,sequenceSeqArray:_7,traverseArray:_9,traverseArrayWithIndex:_4,traverseReadonlyArrayWithIndex:_4,traverseReadonlyArrayWithIndexSeq:_5,traverseReadonlyNonEmptyArrayWithIndex:_2,traverseReadonlyNonEmptyArrayWithIndexSeq:_3,traverseSeqArray:_6,traverseSeqArrayWithIndex:_5},Symbol.toStringTag,{value:"Module"}));var Oi=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())})},Oo=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])}}},Oa=gp(Iq),Ou=gf(Iq),Os=gh(IK),Oc=gm(IK),Ol=nV(ID,Os),Od=nV(ID,Oc),Of=function(t){return Iz(mF(t))},Op=g_(IK),Oh=gO(I1),Om=gk(I1),Og=function(t,n){return function(){return Oi(void 0,void 0,void 0,function(){var r;return Oo(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,t().then(n9)];case 1:return[2,r.sent()];case 2:return[2,n5(n(r.sent()))];case 3:return[2]}})})}},Oy=function(t,n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return Og(function(){return t.apply(void 0,r)},n)}},Ov=gR(IK),Ob=gg(Iq),Ox=gy(Iq),OM=gv(I1),OT=gC(I1),OS=gN(I1),Ow=function(t){return OS(ka(t))},OI=function(t){return OS(kl(t))},O_=gj(I1),OO=gE(IK),Ok=function(t){var n=Of(t);return function(t){return nV(t,n)}},OC=function(t){return function(n){return function(r){return nG(r,OV(Ok(t)(n)))}}},ON=function(t){return nV(t,ID)},Oj=function(t){return O$(ON(t))},OE=function(t,n){return nG(t,Oz(n))},OR=function(t,n){return nG(t,OB(n))},OD=function(t,n){return nG(t,OV(function(t){return nG(n,Oz(t))}))},OA=function(t,n){return nG(t,OV(n))},OL=function(t,n,r){return nG(t,OU(n,r))},OP=function(t,n){return nG(t,OW(n))},OF=function(t,n){return nG(t,OY(n))},Oz=gb(IK),OU=gS(IK),OW=gw(IK),OB=gx(IG),OV=gM(I1),O$=OV,OK=O$(nP),OY=gT(I1),Oq="TaskEither";function OG(t,n){var r=ro(t,mp(n));return{URI:Oq,_E:void 0,map:OE,ap:function(t,n){return nG(t,r(n))},of:Ou}}function OZ(t){var n=gI(I1,t);return{URI:Oq,_E:void 0,map:OE,alt:function(t,r){return nG(t,n(r))}}}var OQ=function(t){var n=ml(t);return{URI:Oq,_E:void 0,compact:hj(IK,n),separate:hE(IK,n,mg)}},OH={URI:Oq,map:OE},OJ=rg(OH),OX={URI:Oq,map:OE,ap:OR},O0=ra(OX),O1=ru(OX),O2={URI:Oq,map:OE,ap:OD},O4={URI:Oq,map:OE,ap:OD,of:Ou},O3={URI:Oq,map:OE,ap:OR,chain:OA},O5=rS(O3),O9={URI:Oq,fromEither:IW},O8=r_(O9),O6=rk(O9),O7=rC(O9,O3),ke=rj(O9,O3),kt=rE(O9,O3),kn=rO(O9),kr=rR(O9,O3),ki=rN(O9),ko={URI:Oq,fromIO:Ol},ka=g4(ko),ku=g3(ko,O3),ks=g5(ko,O3),kc={URI:Oq,fromIO:Ol,fromTask:Os},kl=vS(kc),kd=vw(kc,O3),kf=vI(kc,O3),kp=function(t,n,r){return kh(t,n,r)},kh=function(t,n,r){return nG(t,O$(function(t){return nG(n(t),IB(function(n){return nG(r(t,n),O$(function(){return IW(n)}))}))}))},km=Ou(rn),kg=ry(OH),ky=rw(O3),kv=rs(OX),kb=Ou(rt),kx=function(t){return nV(_r(t),Iz(gn(nZ)))},kM=function(t){var n=kx(t);return function(t){return n6(t)?n(t):kb}},kT=function(t){return function(n){return function(){return re(n).reduce(function(n,r,i){return n.then(function(o){return n4(o)?n:t(i+1,r)().then(function(t){return n4(t)?t:(o.right.push(t.right),o)})})},t(0,n7(n))().then(mm(n8)))}}},kS=function(t){var n=kT(t);return function(t){return n6(t)?n(t):kb}},kw=function(t){return kM(function(n,r){return t(r)})},kI=kw(nP),k_=function(t){return kS(function(n,r){return t(r)})},kO=k_(nP),kk=rc(O2),kC=rx(O4),kN=function(t){return rc(IJ)(mc(t))};let kj=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:Oq,map:OE,alt:OF},ApT:kb,ApplicativePar:{URI:Oq,map:OE,ap:OR,of:Ou},ApplicativeSeq:O4,ApplyPar:OX,ApplySeq:O2,Bifunctor:{URI:Oq,bimap:OL,mapLeft:OP},Chain:O3,Do:km,FromEither:O9,FromIO:ko,FromTask:kc,Functor:OH,Monad:{URI:Oq,map:OE,ap:OR,chain:OA,of:Ou},MonadIO:{URI:Oq,map:OE,ap:OR,chain:OA,of:Ou,fromIO:Ol},MonadTask:{URI:Oq,map:OE,ap:OR,chain:OA,of:Ou,fromIO:Ol,fromTask:Os},MonadThrow:{URI:Oq,map:OE,ap:OR,chain:OA,of:Ou,throwError:Oa},Pointed:{URI:Oq,of:Ou},URI:Oq,alt:OY,altW:OY,ap:OB,apFirst:O0,apFirstW:O0,apS:kv,apSW:kv,apSecond:O1,apSecondW:O1,apW:OB,bimap:OU,bind:ky,bindTo:kg,bindW:ky,bracket:kp,bracketW:kh,chain:OV,chainEitherK:ke,chainEitherKW:ke,chainFirst:O5,chainFirstEitherK:kt,chainFirstEitherKW:kt,chainFirstIOK:ks,chainFirstTaskK:kf,chainFirstW:O5,chainIOEitherK:Oj,chainIOEitherKW:Oj,chainIOK:ku,chainNullableK:OM,chainOptionK:O7,chainTaskK:kd,chainTaskOptionK:OC,chainTaskOptionKW:OC,chainW:O$,filterOrElse:kr,filterOrElseW:kr,flap:OJ,flatten:OK,flattenW:OK,fold:Oh,foldW:Oh,fromEither:IW,fromEitherK:ki,fromIO:Ol,fromIOEither:ID,fromIOEitherK:ON,fromIOK:ka,fromNullable:Ob,fromNullableK:Ox,fromOption:O8,fromOptionK:O6,fromPredicate:kn,fromTask:Os,fromTaskK:kl,fromTaskOption:Of,fromTaskOptionK:Ok,getAltTaskValidation:OZ,getApplicativeTaskValidation:OG,getApplyMonoid:kC,getApplySemigroup:kk,getCompactable:OQ,getFilterable:function(t){var n=md(t),r=OQ(t),i=gW(IK,n),o=gB(IK,n),a=gV(IK,n),u=g$(IK,n);return{URI:Oq,_E:void 0,map:OE,compact:r.compact,separate:r.separate,filter:function(t,n){return nG(t,i(n))},filterMap:function(t,n){return nG(t,o(n))},partition:function(t,n){return nG(t,a(n))},partitionMap:function(t,n){return nG(t,u(n))}}},getOrElse:Om,getOrElseW:Om,getSemigroup:kN,getTaskValidation:function(t){var n=OG(IH,t),r=OZ(t);return{URI:Oq,_E:void 0,map:OE,ap:n.ap,of:Ou,chain:OA,bimap:OL,mapLeft:OP,alt:r.alt,fromIO:Ol,fromTask:Os,throwError:Oa}},left:Oa,leftIO:Od,leftTask:Oc,map:Oz,mapLeft:OW,match:Op,matchE:Oh,matchEW:Oh,matchW:Op,of:Ou,orElse:OT,orElseFirst:OS,orElseFirstIOK:Ow,orElseFirstTaskK:OI,orElseFirstW:OS,orElseW:OT,orLeft:O_,right:Ou,rightIO:Ol,rightTask:Os,sequenceArray:kI,sequenceSeqArray:kO,swap:OO,taskEither:{URI:Oq,bimap:OL,mapLeft:OP,map:OE,of:Ou,ap:OR,chain:OA,alt:OF,fromIO:Ol,fromTask:Os,throwError:Oa},taskEitherSeq:{URI:Oq,bimap:OL,mapLeft:OP,map:OE,of:Ou,ap:OD,chain:OA,alt:OF,fromIO:Ol,fromTask:Os,throwError:Oa},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(n5(t)):r(n9(n))};t.apply(null,n.concat(i))})}}},throwError:Oa,toUnion:Ov,traverseArray:kw,traverseArrayWithIndex:kM,traverseReadonlyArrayWithIndex:kM,traverseReadonlyArrayWithIndexSeq:kS,traverseReadonlyNonEmptyArrayWithIndex:kx,traverseReadonlyNonEmptyArrayWithIndexSeq:kT,traverseSeqArray:k_,traverseSeqArrayWithIndex:kS,tryCatch:Og,tryCatchK:Oy},Symbol.toStringTag,{value:"Module"}));var kE=gp(_k),kR=gf(_k),kD=nV(Os,nF),kA=nV(Oc,nF),kL=function(t){return nV(t,Ou)},kP=function(t){return nV(t,Oa)},kF=gh(__),kz=gm(__),kU=nV(Ol,nF),kW=nV(Od,nF),kB=nV(ID,nF),kV=function(t){return nV(t,IW)},k$=g_(__),kK=gO(_D),kY=gk(_A),kq=gR(__),kG=gg(_k),kZ=gy(_k),kQ=gv(_A),kH=gC(_A),kJ=gN(_A),kX=gj(_A),k0=gE(__),k1=function(t){return nV(t,kB)},k2=function(t){return Cd(k1(t))},k4=function(t){return nV(t,nF)},k3=function(t){return Cd(k4(t))},k5=function(t){return Ck(k4(t))},k9=function(t){return nV(t,kV)},k8=function(t){return Cd(k9(t))},k6=function(t){return Ck(k9(t))},k7=function(t,n){return nG(t,Ca(n))},Ce=function(t,n){return nG(t,Cc(n))},Ct=function(t,n){return nG(t,Cl(function(t){return nG(n,Ca(t))}))},Cn=function(t,n){return nG(t,Cl(n))},Cr=function(t,n){return nG(t,Cp(n))},Ci=function(t,n,r){return nG(t,Cu(n,r))},Co=function(t,n){return nG(t,Cs(n))},Ca=gb(__),Cu=gS(__),Cs=gw(__),Cc=gx(_C),Cl=gM(_A),Cd=Cl,Cf=Cd(nP),Cp=gT(_A),Ch="ReaderTaskEither",Cm=function(t){var n=ml(t);return{URI:Ch,_E:void 0,compact:hj(__,n),separate:hE(__,n,mg)}};function Cg(t,n){var r=ro(yT,OG(t,n));return{URI:Ch,_E:void 0,map:k7,ap:function(t,n){return nG(t,r(n))},of:kR}}function Cy(t){var n=gI(_A,t);return{URI:Ch,_E:void 0,map:k7,alt:function(t,r){return nG(t,n(r))}}}var Cv={URI:Ch,map:k7},Cb=rg(Cv),Cx={URI:Ch,of:kR},CM={URI:Ch,map:k7,ap:Ce},CT=ra(CM),CS=ru(CM),Cw={URI:Ch,map:k7,ap:Ct},CI={URI:Ch,map:k7,ap:Ct,of:kR},C_={URI:Ch,map:k7,ap:Ce,chain:Cn},CO=rS(C_),Ck=CO,CC={URI:Ch,fromReader:kL},CN=yW(CC),Cj=yB(CC),CE=yV(CC),CR=y$(CC,C_),CD=yK(CC,C_),CA=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return kF(t.apply(void 0,n))}},CL=function(t){return Cd(CA(t))},CP=function(t){return Ck(CA(t))},CF={URI:Ch,fromEither:_T},Cz=r_(CF),CU=rk(CF),CW=rC(CF,C_),CB=rj(CF,C_),CV=rE(CF,C_),C$=rO(CF),CK=rR(CF,C_),CY=rN(CF),Cq={URI:Ch,fromIO:kU},CG=g4(Cq),CZ=g3(Cq,C_),CQ=g5(Cq,C_),CH={URI:Ch,fromIO:kU,fromTask:kD},CJ=vS(CH),CX=vw(CH,C_),C0=vI(CH,C_);function C1(t,n,r){return C2(t,n,r)}function C2(t,n,r){return function(i){return kh(t(i),function(t){return n(t)(i)},function(t,n){return r(t,n)(i)})}}var C4=kR(rn),C3=ry(Cv),C5=rw(C_),C9=rs(CM),C8=kR(rt),C6=function(t){return nV(yD(t),yo(kx(nZ)))},C7=function(t){var n=C6(t);return function(t){return n6(t)?n(t):C8}},Ne=function(t){return nV(yD(t),yo(kT(nZ)))},Nt=function(t){var n=Ne(t);return function(t){return n6(t)?n(t):C8}},Nn=function(t){return C7(function(n,r){return t(r)})},Nr=Nn(nP),Ni=function(t){return Nt(function(n,r){return t(r)})},No=Ni(nP),Na=rc(Cw),Nu=rx(CI),Ns=function(t){return rc(_E)(mc(t))};function Nc(t,n){return t(n)()}let Nl=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:Ch,map:k7,alt:Cr},ApT:C8,ApplicativePar:{URI:Ch,map:k7,ap:Ce,of:kR},ApplicativeSeq:CI,ApplyPar:CM,ApplySeq:Cw,Bifunctor:{URI:Ch,bimap:Ci,mapLeft:Co},Chain:C_,Do:C4,FromEither:CF,FromIO:Cq,FromReader:CC,FromTask:CH,Functor:Cv,Monad:{URI:Ch,map:k7,ap:Ce,chain:Cn,of:kR},MonadIO:{URI:Ch,map:k7,ap:Ce,chain:Cn,of:kR,fromIO:kU},MonadTask:{URI:Ch,map:k7,ap:Ce,chain:Cn,of:kR,fromIO:kU,fromTask:kD},MonadThrow:{URI:Ch,map:k7,ap:Ce,chain:Cn,of:kR,throwError:kE},Pointed:Cx,URI:Ch,alt:Cp,altW:Cp,ap:Cc,apFirst:CT,apFirstW:CT,apS:C9,apSW:C9,apSecond:CS,apSecondW:CS,apW:Cc,ask:CN,asks:Cj,asksReaderTaskEither:g7,asksReaderTaskEitherW:g7,bimap:Cu,bind:C5,bindTo:C3,bindW:C5,bracket:C1,bracketW:C2,chain:Cl,chainEitherK:CB,chainEitherKW:CB,chainFirst:CO,chainFirstEitherK:CV,chainFirstEitherKW:CV,chainFirstIOK:CQ,chainFirstReaderEitherK:k6,chainFirstReaderEitherKW:k6,chainFirstReaderK:CD,chainFirstReaderKW:CD,chainFirstReaderTaskK:CP,chainFirstReaderTaskKW:CP,chainFirstTaskEitherK:k5,chainFirstTaskEitherKW:k5,chainFirstTaskK:C0,chainFirstW:Ck,chainIOEitherK:k2,chainIOEitherKW:k2,chainIOK:CZ,chainNullableK:kQ,chainOptionK:CW,chainReaderEitherK:k8,chainReaderEitherKW:k8,chainReaderK:CR,chainReaderKW:CR,chainReaderTaskK:CL,chainReaderTaskKW:CL,chainTaskEitherK:k3,chainTaskEitherKW:k3,chainTaskK:CX,chainW:Cd,filterOrElse:CK,filterOrElseW:CK,flap:Cb,flatten:Cf,flattenW:Cf,fold:kK,foldW:kK,fromEither:_T,fromEitherK:CY,fromIO:kU,fromIOEither:kB,fromIOEitherK:k1,fromIOK:CG,fromNullable:kG,fromNullableK:kZ,fromOption:Cz,fromOptionK:CU,fromPredicate:C$,fromReader:kL,fromReaderEither:kV,fromReaderEitherK:k9,fromReaderK:CE,fromReaderTaskK:CA,fromTask:kD,fromTaskEither:nF,fromTaskEitherK:k4,fromTaskK:CJ,getAltReaderTaskValidation:Cy,getApplicativeReaderTaskValidation:Cg,getApplyMonoid:Nu,getApplySemigroup:Na,getCompactable:Cm,getFilterable:function(t){var n=md(t),r=Cm(t),i=gW(__,n),o=gB(__,n),a=gV(__,n),u=g$(__,n);return{URI:Ch,_E:void 0,map:k7,compact:r.compact,separate:r.separate,filter:function(t,n){return nG(t,i(n))},filterMap:function(t,n){return nG(t,o(n))},partition:function(t,n){return nG(t,a(n))},partitionMap:function(t,n){return nG(t,u(n))}}},getOrElse:kY,getOrElseW:kY,getReaderTaskValidation:function(t){var n=Cg(IH,t),r=Cy(t);return{URI:Ch,_E:void 0,map:k7,of:kR,chain:Cn,bimap:Ci,mapLeft:Co,ap:n.ap,alt:r.alt,fromIO:kU,fromTask:kD,throwError:kE}},getSemigroup:Ns,left:kE,leftIO:kW,leftReader:kP,leftReaderTask:kz,leftTask:kA,local:g6,map:Ca,mapLeft:Cs,match:k$,matchE:kK,matchEW:kK,matchW:k$,of:kR,orElse:kH,orElseFirst:kJ,orElseFirstW:kJ,orElseW:kH,orLeft:kX,readerTaskEither:{URI:Ch,map:k7,of:kR,ap:Ce,chain:Cn,alt:Cr,bimap:Ci,mapLeft:Co,fromIO:kU,fromTask:kD,throwError:kE},readerTaskEitherSeq:{URI:Ch,map:k7,of:kR,ap:Ct,chain:Cn,alt:Cr,bimap:Ci,mapLeft:Co,fromIO:kU,fromTask:kD,throwError:kE},right:kR,rightIO:kU,rightReader:kL,rightReaderTask:kF,rightTask:kD,run:Nc,sequenceArray:Nr,sequenceSeqArray:No,swap:k0,throwError:kE,toUnion:kq,traverseArray:Nn,traverseArrayWithIndex:C7,traverseReadonlyArrayWithIndex:C7,traverseReadonlyArrayWithIndexSeq:Nt,traverseReadonlyNonEmptyArrayWithIndex:C6,traverseReadonlyNonEmptyArrayWithIndexSeq:Ne,traverseSeqArray:Ni,traverseSeqArrayWithIndex:Nt},Symbol.toStringTag,{value:"Module"}));var Nd={equals:function(t,n){return t===n}},Nf={concat:function(t,n){return t+n}},Np={concat:Nf.concat,empty:""},Nh={equals:Nd.equals,compare:function(t,n){return t<n?-1:t>n?1:0}},Nm=function(t){return"string"==typeof t},Ng=function(t){return t.toUpperCase()},Ny=function(t){return t.toLowerCase()},Nv=function(t,n){return function(r){return r.replace(t,n)}},Nb=function(t){return t.trim()},Nx=function(t){return t.trimLeft()},NM=function(t){return t.trimRight()},NT=function(t,n){return function(r){return r.slice(t,n)}},NS=function(t){return 0===t.length},Nw=function(t){return t.length},NI=function(t){return function(n){var r=n.split(t);return n6(r)?r:[n]}},N_=function(t,n){return function(r){return r.includes(t,n)}},NO=function(t,n){return function(r){return r.startsWith(t,n)}},Nk=function(t,n){return function(r){return r.endsWith(t,n)}};let NC=Object.freeze(Object.defineProperty({__proto__:null,Eq:Nd,Monoid:Np,Ord:Nh,Semigroup:Nf,Show:{show:function(t){return JSON.stringify(t)}},empty:"",endsWith:Nk,includes:N_,isEmpty:NS,isString:Nm,replace:Nv,size:Nw,slice:NT,split:NI,startsWith:NO,toLowerCase:Ny,toUpperCase:Ng,trim:Nb,trimLeft:Nx,trimRight:NM},Symbol.toStringTag,{value:"Module"}));var NN=function(t){return Object.assign({},t)},Nj=function(t){return Object.assign({},t)},NE=function(t){return Object.keys(t).length},NR=function(t){for(var n in t)if(rr.call(t,n))return!1;return!0},ND=function(t){return function(n){return Object.keys(n).sort(t.compare)}},NA=ND(Nh);function NL(t){if("function"==typeof t)return NL(Nh)(t);var n=ND(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 NP=NL(Nh)(function(t,n){return[t,n]}),NF=function(t,n){return function(r){if(rr.call(r,t)&&r[t]===n)return r;var i=Object.assign({},r);return i[t]=n,i}},Nz=function(t,n){return rr.call(n,t)};function NU(t){return function(n){if(!rr.call(n,t))return n;var r=Object.assign({},n);return delete r[t],r}}var NW=function(t,n){return function(r){if(!Nz(t,r))return n1;if(r[t]===n)return n2(r);var i=Object.assign({},r);return i[t]=n,n2(i)}},NB=function(t,n){return function(r){if(!Nz(t,r))return n1;var i=n(r[t]);if(i===r[t])return n2(r);var o=Object.assign({},r);return o[t]=i,n2(o)}};function NV(t){return function(n,r){if(void 0===r){var i=NV(t);return function(t){return i(t,n)}}for(var o in n)if(!rr.call(r,o)||!t.equals(n[o],r[o]))return!1;return!0}}function N$(t,n){return void 0===n?function(n){return N$(t,n)}:rr.call(n,t)?n2(n[t]):n1}var NK={};function NY(t){return function(n){var r={};for(var i in n)rr.call(n,i)&&(r[i]=t(i,n[i]));return r}}function Nq(t){return NY(function(n,r){return t(r)})}function NG(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(2===t.length)return NG(Nh).apply(void 0,t);var r=ND(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 NZ(t){if("compare"in t){var n=ND(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 NZ(Nh)(t)}function NQ(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(2===t.length)return NQ(Nh).apply(void 0,t);var r=ND(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 NH=function(t,n){var r;return(r={})[t]=n,r};function NJ(t){var n=jw(Nh)(t);return function(t){return function(r){return n(r,t)}}}function NX(t){var n=jT(Nh)(t);return function(t){return function(r){return n(r,t)}}}function N0(t){return jS(Nh)(t)}var N1=function(t){var n=NX(t);return function(r){return function(i){return t.map(nG(i,n(r)),jE)}}},N2=function(t){var n=NX(t);return function(r){return function(i){return t.map(nG(i,n(r)),jR)}}};function N4(t){return function(n){var r={},i={};for(var o in n)if(rr.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 uV(r,i)}}function N3(t){return function(n){var r={},i={};for(var o in n)if(rr.call(n,o)){var a=n[o];t(o,a)?i[o]=a:r[o]=a}return uV(r,i)}}function N5(t){return function(n){var r={};for(var i in n)if(rr.call(n,i)){var o=t(i,n[i]);n0(o)&&(r[i]=o.value)}return r}}function N9(t){return function(n){var r={},i=!1;for(var o in n)if(rr.call(n,o)){var a=n[o];t(o,a)?r[o]=a:i=!0}return i?r:n}}function N8(t,n){var r=N6(t,n);return function(t){return r(t,nP)}}function N6(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]=rr.call(n,a)?t.concat(n[a],u):u,n})}}var N7=function(t){for(var n={},r=0;r<t.length;r++){var i=t[r];n[i[0]]=i[1]}return n};function je(t){return function(n){for(var r in n)if(!t(n[r]))return!1;return!0}}function jt(t){return function(n){for(var r in n)if(t(n[r]))return!0;return!1}}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 in r)if(t.equals(r[o],n))return!0;return!1}}var jr=function(t){return function(n){return function(r){if(NR(r))return n;if(NR(n))return r;var i={};for(var o in r)Nz(o,n)?i[o]=t.concat(r[o],n[o]):i[o]=r[o];for(var o in n)Nz(o,i)||(i[o]=n[o]);return i}}},ji=function(t){return function(n){return function(r){if(NR(r)||NR(n))return NK;var i={};for(var o in r)Nz(o,n)&&(i[o]=t.concat(r[o],n[o]));return i}}},jo=function(t){return function(n){if(NR(n))return t;if(NR(t))return n;var r={};for(var i in n)Nz(i,t)||(r[i]=n[i]);for(var i in t)Nz(i,n)||(r[i]=t[i]);return r}},ja=function(t,n){return nG(t,Nq(n))},ju=function(t,n){return nG(t,NY(n))},js=function(t){var n=jC(t);return function(t,r,i){return nG(t,n(r,i))}},jc=function(t){return function(n){var r=jN(t)(n);return function(t,n){return nG(t,r(n))}}},jl=function(t){var n=jj(t);return function(t,r,i){return nG(t,n(r,i))}},jd=function(t,n){return nG(t,jI(n))},jf=function(t,n){return nG(t,j_(n))},jp=function(t,n){return nG(t,jO(n))},jh=function(t,n){return nG(t,jk(n))},jm=function(t){var n=NG(t);return function(t,r,i){return nG(t,n(r,i))}},jg=function(t){var n=NZ(t);return function(t){var r=n(t);return function(t,n){return nG(t,r(n))}}},jy=function(t){var n=NQ(t);return function(t,r,i){return nG(t,n(r,i))}},jv=function(t,n){return nG(t,N4(n))},jb=function(t,n){return nG(t,N3(n))},jx=function(t,n){return nG(t,N5(n))},jM=function(t,n){return nG(t,N9(n))},jT=function(t){var n=jw(t);return function(t){var r=n(t);return function(t,n){return r(t,nV(nZ,n))}}},jS=function(t){var n=jT(t);return function(t){var r=n(t);return function(t){return r(t,nP)}}},jw=function(t){return function(n){var r=ND(t);return function(t,i){var o=r(t);if(0===o.length)return n.of(NK);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}}},jI=function(t){return N9(function(n,r){return t(r)})},j_=function(t){return N5(function(n,r){return t(r)})},jO=function(t){return N3(function(n,r){return t(r)})},jk=function(t){return N4(function(n,r){return t(r)})};function jC(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(1===t.length){var r=NG(t[0]);return function(t,n){return r(t,function(t,r,i){return n(r,i)})}}return jC(Nh).apply(void 0,t)}function jN(t){if("compare"in t){var n=NZ(t);return function(t){var r=n(t);return function(t){return r(function(n,r){return t(r)})}}}return jN(Nh)(t)}function jj(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(1===t.length){var r=NQ(t[0]);return function(t,n){return r(t,function(t,r,i){return n(r,i)})}}return jj(Nh).apply(void 0,t)}var jE=function(t){var n={};for(var r in t)if(rr.call(t,r)){var i=t[r];n0(i)&&(n[r]=i.value)}return n},jR=function(t){var n={},r={};for(var i in t)if(rr.call(t,i)){var o=t[i];n4(o)?n[i]=o.left:r[i]=o.right}return uV(n,r)},jD="ReadonlyRecord";function jA(t){return"compare"in t?function(n){return{show:function(r){var i=NL(t)(function(t,r){return"".concat(JSON.stringify(t),": ").concat(n.show(r))})(r).join(", ");return""===i?"{}":"{ ".concat(i," }")}}}:jA(Nh)(t)}function jL(t){var n=NV(t);return rA(function(t,r){return n(t)(r)&&n(r)(t)})}function jP(t){return{concat:function(n,r){if(NR(n))return r;if(NR(r))return n;var i=Object.assign({},n);for(var o in r)rr.call(r,o)&&(i[o]=rr.call(n,o)?t.concat(n[o],r[o]):r[o]);return i},empty:NK}}var jF={URI:jD,map:ja},jz=rg(jF),jU=function(t){return{URI:jD,reduce:js(t),foldMap:jc(t),reduceRight:jl(t)}},jW=function(t){return{URI:jD,reduce:js(t),foldMap:jc(t),reduceRight:jl(t),reduceWithIndex:jm(t),foldMapWithIndex:jg(t),reduceRightWithIndex:jy(t)}},jB={URI:jD,compact:jE,separate:jR},jV=function(t){return{URI:jD,map:ja,reduce:js(t),foldMap:jc(t),reduceRight:jl(t),traverse:jT(t),sequence:jS(t)}},j$=function(t){return{URI:jD,map:ja,mapWithIndex:ju,reduce:js(t),foldMap:jc(t),reduceRight:jl(t),reduceWithIndex:jm(t),foldMapWithIndex:jg(t),reduceRightWithIndex:jy(t),traverse:jT(t),sequence:jS(t),traverseWithIndex:jw(t)}},jK=function(t){var n=jV(t);return{URI:jD,map:ja,reduce:js(t),foldMap:jc(t),reduceRight:jl(t),traverse:n.traverse,sequence:n.sequence,compact:jE,separate:jR,filter:jd,filterMap:jf,partition:jp,partitionMap:jh,wither:u2(n,jB),wilt:u1(n,jB)}},jY=function(t){var n=jr(t);return{concat:function(t,r){return n(r)(t)}}},jq=function(t){return{concat:jY(t).concat,empty:NK}},jG=function(t){var n=ji(t);return{concat:function(t,r){return n(r)(t)}}},jZ=function(){return{concat:function(t,n){return jo(n)(t)}}},jQ={URI:jD,reduce:js(Nh),foldMap:jc(Nh),reduceRight:jl(Nh)},jH={URI:jD,reduce:js(Nh),foldMap:jc(Nh),reduceRight:jl(Nh),reduceWithIndex:jm(Nh),foldMapWithIndex:jg(Nh),reduceRightWithIndex:jy(Nh)},jJ={URI:jD,map:ja,reduce:js(Nh),foldMap:jc(Nh),reduceRight:jl(Nh),traverse:jT(Nh),sequence:N0},jX={URI:jD,map:ja,mapWithIndex:ju,reduce:js(Nh),foldMap:jc(Nh),reduceRight:jl(Nh),reduceWithIndex:jm(Nh),foldMapWithIndex:jg(Nh),reduceRightWithIndex:jy(Nh),traverse:jT(Nh),sequence:N0,traverseWithIndex:jw(Nh)},j0=u2(jJ,jB),j1=u1(jJ,jB),j2={URI:jD,map:ja,reduce:js(Nh),foldMap:jc(Nh),reduceRight:jl(Nh),traverse:jT(Nh),sequence:N0,compact:jE,separate:jR,filter:jd,filterMap:jf,partition:jp,partitionMap:jh,wither:j0,wilt:j1};function j4(t,n){return rr.call(void 0===n?this:n,t)}var j3={URI:jD,map:ja,reduce:js(Nh),foldMap:jc(Nh),reduceRight:jl(Nh),traverse:jT(Nh),sequence:N0,compact:jE,separate:jR,filter:jd,filterMap:jf,partition:jp,partitionMap:jh,mapWithIndex:ju,reduceWithIndex:jm(Nh),foldMapWithIndex:jg(Nh),reduceRightWithIndex:jy(Nh),filterMapWithIndex:jx,filterWithIndex:jM,partitionMapWithIndex:jv,partitionWithIndex:jb,traverseWithIndex:jw(Nh),wither:j0,wilt:j1};let j5=Object.freeze(Object.defineProperty({__proto__:null,Compactable:jB,Filterable:{URI:jD,map:ja,compact:jE,separate:jR,filter:jd,filterMap:jf,partition:jp,partitionMap:jh},FilterableWithIndex:{URI:jD,map:ja,mapWithIndex:ju,compact:jE,separate:jR,filter:jd,filterMap:jf,partition:jp,partitionMap:jh,filterMapWithIndex:jx,filterWithIndex:jM,partitionMapWithIndex:jv,partitionWithIndex:jb},Foldable:jQ,FoldableWithIndex:jH,Functor:jF,FunctorWithIndex:{URI:jD,map:ja,mapWithIndex:ju},Traversable:jJ,TraversableWithIndex:jX,URI:jD,Witherable:j2,_filter:jd,_filterMap:jf,_filterMapWithIndex:jx,_filterWithIndex:jM,_foldMap:jc,_foldMapWithIndex:jg,_map:ja,_mapWithIndex:ju,_partition:jp,_partitionMap:jh,_partitionMapWithIndex:jv,_partitionWithIndex:jb,_reduce:js,_reduceRight:jl,_reduceRightWithIndex:jy,_reduceWithIndex:jm,_sequence:jS,_traverse:jT,collect:NL,compact:jE,deleteAt:NU,difference:jo,elem:jn,empty:NK,every:je,filter:jI,filterMap:j_,filterMapWithIndex:N5,filterWithIndex:N9,flap:jz,foldMap:jN,foldMapWithIndex:NZ,fromEntries:N7,fromFoldable:N8,fromFoldableMap:N6,fromRecord:NN,getDifferenceMagma:jZ,getEq:jL,getFoldable:jU,getFoldableWithIndex:jW,getIntersectionSemigroup:jG,getMonoid:jP,getShow:jA,getTraversable:jV,getTraversableWithIndex:j$,getUnionMonoid:jq,getUnionSemigroup:jY,getWitherable:jK,has:Nz,hasOwnProperty:j4,insertAt:NF,intersection:ji,isEmpty:NR,isSubrecord:NV,keys:NA,lookup:N$,map:Nq,mapWithIndex:NY,modifyAt:NB,partition:jO,partitionMap:jk,partitionMapWithIndex:N4,partitionWithIndex:N3,pop:function(t){var n=NU(t);return function(r){var i=N$(t,r);return nX(i)?n1:n2([i.value,n(r)])}},readonlyRecord:j3,reduce:jC,reduceRight:jj,reduceRightWithIndex:NQ,reduceWithIndex:NG,separate:jR,sequence:N0,singleton:NH,size:NE,some:jt,toEntries:NP,toReadonlyArray:NP,toRecord:Nj,toUnfoldable:function(t){return function(n){var r=NP(n),i=r.length;return t.unfold(0,function(t){return t<i?n2([r[t],t+1]):n1})}},traverse:NX,traverseWithIndex:NJ,union:jr,updateAt:NW,upsertAt:NF,wilt:N2,wither:N1},Symbol.toStringTag,{value:"Module"}));var j9=function(t){return new Set(t)},j8=function(t){return new Set([t])},j6=function(t){return function(n){for(var r=n.length,i=new Set,o=Ey(t),a=0;a<r;a++){var u=n[a];o(u,i)||i.add(u)}return i}};function j7(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 Ee(t){var n=Ey(t);return function(r,i){if(void 0===i){var o=Ee(t);return function(t){return o(r,t)}}if(Ef(r))return i;if(Ef(i))return r;var a=new Set(r);return i.forEach(function(t){n(t,a)||a.add(t)}),a}}function Et(t){var n=Ey(t);return function(r,i){if(void 0===i){var o=Et(t);return function(t){return o(t,r)}}if(Ef(r)||Ef(i))return Ed;var a=new Set;return r.forEach(function(t){n(t,i)&&a.add(t)}),a}}function En(t){var n=Ey(t);return function(r,i){if(void 0===i){var o=En(t);return function(t){return o(t,r)}}return j7(function(t){return!n(t,i)})(r)}}function Er(t){var n=Ev(t);return function(t,r){return function(i){return n(i).reduce(r,t)}}}function Ei(t,n){var r=Ev(t);return function(t){return function(i){return r(i).reduce(function(r,i){return n.concat(r,t(i))},n.empty)}}}var Eo=function(t){var n=Ev(t);return function(t,r){return function(i){return n(i).reduceRight(function(t,n){return r(n,t)},t)}}};function Ea(t){var n=Ey(t);return function(t){return function(r){if(n(t)(r))return r;var i=new Set(r);return i.add(t),i}}}var Eu=function(t){return function(n){return function(r){return j7(function(r){return!t.equals(n,r)})(r)}}},Es=function(t){var n=Ey(t),r=Eu(t),i=Ea(t);return function(t){return function(o){return(n(t,o)?r:i)(t)(o)}}},Ec=function(t){return El(t)(nP)};function El(t){var n=Ey(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 Ed=new Set,Ef=function(t){return 0===t.size},Ep=function(t){return t.size},Eh=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 Em(t){return pe(Eh(pe(t)))}function Eg(t){var n=Ey(t);return function(r,i){if(void 0===i){var o=Eg(t);return function(t){return o(t,r)}}return Em(function(t){return n(t,i)})(r)}}function Ey(t){return function(n,r){if(void 0===r){var i=Ey(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 Ev=function(t){return function(n){var r=[];return n.forEach(function(t){return r.push(t)}),r.sort(t.compare)}};function Eb(t){return{show:function(n){var r=[];return n.forEach(function(n){r.push(t.show(n))}),"new Set([".concat(r.sort().join(", "),"])")}}}function Ex(t){var n=Eg(t);return rA(function(t,r){return n(t,r)&&n(r,t)})}var EM=function(t){return{concat:Ee(t)}},ET=function(t){return{concat:EM(t).concat,empty:Ed}},ES=function(t){return{concat:Et(t)}},Ew=function(t){return{concat:En(t)}};let EI=Object.freeze(Object.defineProperty({__proto__:null,URI:"ReadonlySet",chain:function(t){var n=Ey(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:Ec,difference:En,elem:Ey,empty:Ed,every:Em,filter:j7,filterMap:El,foldMap:Ei,fromArray:j6,fromReadonlyArray:j6,fromSet:j9,getDifferenceMagma:Ew,getEq:Ex,getIntersectionSemigroup:ES,getShow:Eb,getUnionMonoid:ET,getUnionSemigroup:EM,insert:Ea,intersection:Et,isEmpty:Ef,isSubset:Eg,map:function(t){var n=Ey(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 uV(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=Ey(t),l=Ey(n);!(o=a.next()).done;){var d=r(o.value);switch(d._tag){case"Left":c(d.left,u)||u.add(d.left);break;case"Right":l(d.right,s)||s.add(d.right)}}return uV(u,s)}}},reduce:Er,reduceRight:Eo,remove:Eu,separate:function(t,n){return function(r){var i=Ey(t),o=Ey(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)}}),uV(a,u)}},singleton:j8,size:Ep,some:Eh,toReadonlyArray:Ev,toSet:function(t){return new Set(t)},toggle:Es,union:Ee},Symbol.toStringTag,{value:"Module"}));function E_(t){return t[0]}function EO(t){return t[1]}var Ek=function(t){var n;return[EO(t),t[0]]};function EC(t){return{URI:EJ,_E:void 0,map:ER,ap:function(n,r){var i,o;return[(0,n[0])(r[0]),t.concat(EO(n),EO(r))]}}}var EN=function(t){return function(n){return[n,t.empty]}};function Ej(t){var n=EC(t);return{URI:EJ,_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(EO(n),u)]}}}var EE=function(t,n){return nG(t,E$(n))},ER=function(t,n){return nG(t,EB(n))},ED=function(t,n,r){return nG(t,EW(n,r))},EA=function(t,n){return nG(t,EV(n))},EL=function(t,n){return nG(t,EK(n))},EP=function(t,n,r){return nG(t,Eq(n,r))},EF=function(t){var n=EG();return function(t,r){return nG(t,n(r))}},Ez=function(t,n,r){return nG(t,EZ(n,r))},EU=function(t){var n=EQ(t);return function(t,r){return nG(t,n(r))}},EW=function(t,n){return function(r){var i;return[n(r[0]),t(EO(r))]}},EB=function(t){return function(n){var r;return[t(n[0]),EO(n)]}},EV=function(t){return function(n){var r;return[n[0],t(EO(n))]}},E$=function(t){return function(n){var r;return[n[0],EO(t)]}},EK=function(t){return function(n){return[t(n),EO(n)]}},EY=EK(nP),Eq=function(t,n){return function(r){var i;return n(t,r[0])}},EG=function(){return function(t){return function(n){var r;return t(n[0])}}},EZ=function(t,n){return function(r){var i;return n(r[0],t)}},EQ=function(t){return function(n){return function(r){var i;return t.map(n(r[0]),function(t){return[t,EO(r)]})}}},EH=function(t){return function(n){var r;return t.map(n[0],function(t){return[t,EO(n)]})}},EJ="ReadonlyTuple",EX={URI:EJ,map:ER},E0=rg(EX);let E1=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:{URI:EJ,bimap:ED,mapLeft:EA},Comonad:{URI:EJ,map:ER,extend:EL,extract:E_},Foldable:{URI:EJ,reduce:EP,foldMap:EF,reduceRight:Ez},Functor:EX,Semigroupoid:{URI:EJ,compose:EE},Traversable:{URI:EJ,map:ER,reduce:EP,foldMap:EF,reduceRight:Ez,traverse:EU,sequence:EH},URI:EJ,bimap:EW,compose:E$,duplicate:EY,extend:EK,extract:E_,flap:E0,foldMap:EG,fst:E_,getApplicative:function(t){var n=EC(t);return{URI:EJ,_E:void 0,map:n.map,ap:n.ap,of:EN(t)}},getApply:EC,getChain:Ej,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,EO(a)),s=(a=r(s.left))[0];return[s.right,t.concat(u,EO(a))]},r=Ej(t);return{URI:EJ,_E:void 0,map:r.map,ap:r.ap,chain:r.chain,chainRec:n}},getMonad:function(t){var n=Ej(t);return{URI:EJ,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,of:EN(t)}},map:EB,mapFst:EB,mapLeft:EV,mapSnd:EV,readonlyTuple:{URI:EJ,compose:EE,map:ER,bimap:ED,mapLeft:EA,extract:E_,extend:EL,reduce:EP,foldMap:EF,reduceRight:Ez,traverse:EU,sequence:EH},reduce:Eq,reduceRight:EZ,sequence:EH,snd:EO,swap:Ek,traverse:EQ},Symbol.toStringTag,{value:"Module"}));var E2=globalThis&&globalThis.__assign||function(){return(E2=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)},E4=function(t){return function(n){return Object.keys(n).sort(t.compare)}},E3=E4(Nh);function E5(t){if("function"==typeof t)return E5(Nh)(t);var n=E4(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 E9=E5(Nh)(function(t,n){return[t,n]});function E8(t){return function(n){if(!rr.call(n,t))return n;var r=Object.assign({},n);return delete r[t],r}}var E6=function(t,n){return E7(t,function(){return n})},E7=function(t,n){return function(r){if(!Nz(t,r))return n1;var i=Object.assign({},r);return i[t]=n(r[t]),n2(i)}};function Re(t){return NJ(t)}function Rt(t){return NX(t)}function Rn(t){return N0(t)}var Rr=function(t){var n,r=NX(t);return function(n){return function(i){return t.map(nG(i,r(n)),Rh)}}},Ri=function(t){var n,r=NX(t);return function(n){return function(i){return t.map(nG(i,r(n)),Rm)}}};function Ro(t){return N3(t)}function Ra(t){return N9(t)}function Ru(t,n){return N8(t,n)}var Rs=function(t){var n,r;return(n=iv(),N8(n,fd))(t)};function Rc(t,n){return N6(t,n)}var Rl=function(t){var n=jr(t);return function(t){return function(r){return NR(r)?E2({},t):NR(t)?E2({},r):n(t)(r)}}},Rd=function(t){return function(n){return function(r){return NR(r)||NR(n)?{}:ji(t)(n)(r)}}},Rf=function(t){return function(n){return NR(n)?E2({},t):NR(t)?E2({},n):jo(t)(n)}},Rp=function(t){return function(n){var r=E4(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}}},Rh=jE,Rm=jR,Rg="Record",Ry={URI:Rg,map:ja},Rv=rg(Ry),Rb=function(t){return{URI:Rg,reduce:js(t),foldMap:jc(t),reduceRight:jl(t)}},Rx=function(t){return{URI:Rg,reduce:js(t),foldMap:jc(t),reduceRight:jl(t),reduceWithIndex:jm(t),foldMapWithIndex:jg(t),reduceRightWithIndex:jy(t)}},RM={URI:Rg,compact:Rh,separate:Rm},RT=function(t){return{URI:Rg,map:ja,reduce:js(t),foldMap:jc(t),reduceRight:jl(t),traverse:jT(t),sequence:jS(t)}},RS=function(t){return{URI:Rg,map:ja,mapWithIndex:ju,reduce:js(t),foldMap:jc(t),reduceRight:jl(t),reduceWithIndex:jm(t),foldMapWithIndex:jg(t),reduceRightWithIndex:jy(t),traverse:jT(t),sequence:jS(t),traverseWithIndex:Rp(t)}},Rw=function(t){var n=RT(t);return{URI:Rg,map:ja,reduce:js(t),foldMap:jc(t),reduceRight:jl(t),traverse:n.traverse,sequence:n.sequence,compact:Rh,separate:Rm,filter:jd,filterMap:jf,partition:jp,partitionMap:jh,wither:u2(n,RM),wilt:u1(n,RM)}},RI=function(t){var n=Rl(t);return{concat:function(t,r){return n(r)(t)}}},R_=function(t){return{concat:RI(t).concat,empty:{}}},RO=function(t){var n=Rd(t);return{concat:function(t,r){return n(r)(t)}}},Rk=function(){return{concat:function(t,n){return Rf(n)(t)}}},RC={URI:Rg,reduce:js(Nh),foldMap:jc(Nh),reduceRight:jl(Nh)},RN={URI:Rg,reduce:js(Nh),foldMap:jc(Nh),reduceRight:jl(Nh),reduceWithIndex:jm(Nh),foldMapWithIndex:jg(Nh),reduceRightWithIndex:jy(Nh)},Rj={URI:Rg,map:ja,reduce:js(Nh),foldMap:jc(Nh),reduceRight:jl(Nh),traverse:jT(Nh),sequence:Rn},RE={URI:Rg,map:ja,mapWithIndex:ju,reduce:js(Nh),foldMap:jc(Nh),reduceRight:jl(Nh),reduceWithIndex:jm(Nh),foldMapWithIndex:jg(Nh),reduceRightWithIndex:jy(Nh),traverse:jT(Nh),sequence:Rn,traverseWithIndex:Rp(Nh)},RR=u2(Rj,RM),RD=u1(Rj,RM),RA={URI:Rg,map:ja,reduce:js(Nh),foldMap:jc(Nh),reduceRight:jl(Nh),traverse:jT(Nh),sequence:Rn,compact:Rh,separate:Rm,filter:jd,filterMap:jf,partition:jp,partitionMap:jh,wither:RR,wilt:RD},RL={URI:Rg,map:ja,reduce:js(Nh),foldMap:jc(Nh),reduceRight:jl(Nh),traverse:jT(Nh),sequence:Rn,compact:Rh,separate:Rm,filter:jd,filterMap:jf,partition:jp,partitionMap:jh,mapWithIndex:ju,reduceWithIndex:jm(Nh),foldMapWithIndex:jg(Nh),reduceRightWithIndex:jy(Nh),filterMapWithIndex:jx,filterWithIndex:jM,partitionMapWithIndex:jv,partitionWithIndex:jb,traverseWithIndex:Rp(Nh),wither:RR,wilt:RD};let RP=Object.freeze(Object.defineProperty({__proto__:null,Compactable:RM,Filterable:{URI:Rg,map:ja,compact:Rh,separate:Rm,filter:jd,filterMap:jf,partition:jp,partitionMap:jh},FilterableWithIndex:{URI:Rg,map:ja,mapWithIndex:ju,compact:Rh,separate:Rm,filter:jd,filterMap:jf,partition:jp,partitionMap:jh,filterMapWithIndex:jx,filterWithIndex:jM,partitionMapWithIndex:jv,partitionWithIndex:jb},Foldable:RC,FoldableWithIndex:RN,Functor:Ry,FunctorWithIndex:{URI:Rg,map:ja,mapWithIndex:ju},Traversable:Rj,TraversableWithIndex:RE,URI:Rg,Witherable:RA,collect:E5,compact:Rh,deleteAt:E8,difference:Rf,elem:jn,empty:{},every:je,filter:jI,filterMap:j_,filterMapWithIndex:N5,filterWithIndex:Ra,flap:Rv,foldMap:function(t){return"compare"in t?jN(t):jN(Nh)(t)},foldMapWithIndex:function(t){return"compare"in t?NZ(t):NZ(Nh)(t)},fromEntries:Rs,fromFoldable:Ru,fromFoldableMap:Rc,getDifferenceMagma:Rk,getEq:jL,getFoldable:Rb,getFoldableWithIndex:Rx,getIntersectionSemigroup:RO,getMonoid:jP,getShow:function(t){return"compare"in t?jA(t):jA(Nh)(t)},getTraversable:RT,getTraversableWithIndex:RS,getUnionMonoid:R_,getUnionSemigroup:RI,getWitherable:Rw,has:Nz,hasOwnProperty:j4,insertAt:NF,intersection:Rd,isEmpty:NR,isSubrecord:NV,keys:E3,lookup:N$,map:Nq,mapWithIndex:NY,modifyAt:E7,partition:jO,partitionMap:jk,partitionMapWithIndex:N4,partitionWithIndex:Ro,pop:function(t){var n=E8(t);return function(r){var i=N$(t,r);return nX(i)?n1:n2([i.value,n(r)])}},record:RL,reduce:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length?jC(t[0]):jC(Nh).apply(void 0,t)},reduceRight:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length?jj(t[0]):jj(Nh).apply(void 0,t)},reduceRightWithIndex:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length?NQ(t[0]):NQ(Nh).apply(void 0,t)},reduceWithIndex:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length?NG(t[0]):NG(Nh).apply(void 0,t)},separate:Rm,sequence:Rn,singleton:NH,size:NE,some:jt,toArray:E9,toEntries:E9,toUnfoldable:function(t){return function(n){var r=E9(n),i=r.length;return t.unfold(0,function(t){return t<i?n2([r[t],t+1]):n1})}},traverse:Rt,traverseWithIndex:Re,union:Rl,updateAt:E6,upsertAt:NF,wilt:Ri,wither:Rr},Symbol.toStringTag,{value:"Module"}));var RF=function(t){return function(n){return n0(t(n))}},Rz=function(t){return function(n){return n3(t(n))}},RU=function(){return function(t){return!0}},RW=function(t){return function(n){return!t(n)}},RB=function(t){return function(n){return function(r){return n(r)||t(r)}}},RV=function(t){return function(n){return function(r){return n(r)&&t(r)}}},R$=function(){return function(t){return!1}},RK=function(t){return function(n){return function(r){return n(r)&&t(r)}}};let RY=Object.freeze(Object.defineProperty({__proto__:null,and:RV,compose:RK,fromEitherK:Rz,fromOptionK:RF,id:RU,not:RW,or:RB,zero:R$},Symbol.toStringTag,{value:"Module"}));var Rq=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])})}}},RG=function(t){return function(n){return t.sub(t.zero,n)}};let RZ=Object.freeze(Object.defineProperty({__proto__:null,getFunctionRing:nA,getTupleRing:Rq,negate:RG,tuple:Rq},Symbol.toStringTag,{value:"Module"})),RQ=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),RH=Object.freeze(Object.defineProperty({__proto__:null,getFunctionSemiring:nD},Symbol.toStringTag,{value:"Module"}));function RJ(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 RX(t){var n=Da(t);return function(r,i){if(void 0===i){var o=RX(t);return function(t){return o(r,t)}}if(Di(r))return i;if(Di(i))return r;var a=new Set(r);return i.forEach(function(t){n(t,a)||a.add(t)}),a}}function R0(t){var n=Da(t);return function(r,i){if(void 0===i){var o=R0(t);return function(t){return o(t,r)}}if(Di(r)||Di(i))return new Set;var a=new Set;return r.forEach(function(t){n(t,i)&&a.add(t)}),a}}function R1(t){var n=Da(t);return function(r,i){if(void 0===i){var o=R1(t);return function(t){return o(t,r)}}return RJ(function(t){return!n(t,i)})(r)}}var R2=function(t){return{concat:RX(t)}},R4=function(t){return{concat:R2(t).concat,empty:new Set}},R3=function(t){return{concat:R0(t)}},R5=function(t){return{concat:R1(t)}},R9=function(t){return new Set([t])};function R8(t){var n=Da(t);return function(t){return function(r){if(n(t)(r))return r;var i=new Set(r);return i.add(t),i}}}var R6=function(t){return function(n){return function(r){return RJ(function(r){return!t.equals(n,r)})(r)}}},R7=function(t){var n=Da(t),r=R6(t),i=R8(t);return function(t){return function(o){return(n(t,o)?r:i)(t)(o)}}},De=function(t){return function(n){for(var r=n.length,i=new Set,o=Da(t),a=0;a<r;a++){var u=n[a];o(u,i)||i.add(u)}return i}},Dt=function(t){return Dn(t)(nP)};function Dn(t){var n=Da(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 Dr=new Set,Di=function(t){return 0===t.size},Do=function(t){return t.size},Da=Ey,Du=function(t){return function(n){var r=[];return n.forEach(function(t){return r.push(t)}),r.sort(t.compare)}};let Ds=Object.freeze(Object.defineProperty({__proto__:null,chain:function(t){var n=Da(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:Dt,difference:R1,elem:Da,empty:Dr,every:Em,filter:RJ,filterMap:Dn,foldMap:Ei,fromArray:De,getDifferenceMagma:R5,getEq:Ex,getIntersectionSemigroup:R3,getShow:Eb,getUnionMonoid:R4,getUnionSemigroup:R2,insert:R8,intersection:R0,isEmpty:Di,isSubset:Eg,map:function(t){var n=Da(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 uV(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=Da(t),l=Da(n);!(o=a.next()).done;){var d=r(o.value);switch(d._tag){case"Left":c(d.left,u)||u.add(d.left);break;case"Right":l(d.right,s)||s.add(d.right)}}return uV(u,s)}}},reduce:Er,reduceRight:Eo,remove:R6,separate:function(t,n){return function(r){var i=Da(t),o=Da(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)}}),uV(a,u)}},singleton:R9,size:Do,some:Eh,subset:Eg,toArray:Du,toggle:R7,union:RX},Symbol.toStringTag,{value:"Module"}));var Dc=function(t){return{show:function(n){var r="{";for(var i in t)rr.call(t,i)&&(r+=" ".concat(i,": ").concat(t[i].show(n[i]),","));return r.length>1&&(r=r.slice(0,-1)+" "),r+="}"}}},Dl=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 Dd=Object.freeze(Object.defineProperty({__proto__:null,getStructShow:Dc,getTupleShow:Dl,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:Dc,tuple:Dl},Symbol.toStringTag,{value:"Module"}));function Df(t){return function(n){return function(r){return t.of([n,r])}}}function Dp(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 Dh(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 Dm(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 Dg(t){return function(n){return function(r){return t.of(n(r))}}}function Dy(t){return function(n){return function(r){return t.map(n,function(t){return[t,r]})}}}function Dv(t){return function(n){return function(r){return t.map(r(n),function(t){return t[0]})}}}function Db(t){return function(n){return function(r){return t.map(r(n),EO)}}}let Dx=Object.freeze(Object.defineProperty({__proto__:null,ap:Dh,chain:Dm,evaluate:Dv,execute:Db,fromF:Dy,fromState:Dg,getStateM:function(t){var n=Dh(t),r=Dp(t),i=Dm(t),o=Dv(t),a=Db(t);return{map:function(t,n){return nG(t,r(n))},ap:function(t,r){return nG(t,n(r))},of:Df(t),chain:function(t,n){return nG(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:Dg(t),fromM:Dy(t),evalState:function(t,n){return nG(t,o(n))},execState:function(t,n){return nG(t,a(n))}}},map:Dp,of:Df},Symbol.toStringTag,{value:"Module"}));var DM=function(t){return function(){return kE(t)}},DT=Df(Cx);function DS(t){return DR(kD(t))}function Dw(t){return DR(kL(t))}function DI(t){return DR(kU(t))}var D_=function(t){return nV(t,kR)},DO=function(t){return function(n){return kE(t(n)[0])}},Dk=mW(function(t){return DM(t)},DT),DC=Dg(Cx),DN=function(t){return DR(nF(t))},Dj=function(t){return DR(kB(t))},DE=function(t){return DR(kV(t))},DR=Dy(Cv),DD=function(t){return function(n){return nV(n,g6(t))}},DA=function(t){return function(n){return function(r){return t(r)(n)(r)}}},DL=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return Dj(t.apply(void 0,n))}},DP=function(t){return function(n){return nG(n,DX(DL(t)))}},DF=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return DN(t.apply(void 0,n))}},Dz=function(t){return function(n){return nG(n,DX(DF(t)))}},DU=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return DR(t.apply(void 0,n))}},DW=function(t){return function(n){return nG(n,DX(DU(t)))}},DB=function(t,n){return nG(t,DG(n))},DV=function(t,n){return nG(t,DH(n))},D$=function(t,n){return nG(t,DJ(n))},DK=function(t,n){return function(r){return nG(t(r),Cp(function(){return n()(r)}))}},DY=function(t,n,r){return function(i){return nG(t(i),Cu(n,function(t){var n=t[0],i=t[1];return[r(n),i]}))}},Dq=function(t,n){return function(r){return nG(t(r),Cs(n))}},DG=Dp(Cv),DZ=function(t,n){return function(r){return DY(r,t,n)}},DQ=function(t){return function(n){return Dq(n,t)}},DH=Dh(C_),DJ=Dm(C_),DX=DJ,D0=DX(nP),D1=function(t){return function(n){return function(r){return nG(n(r),Cp(function(){return t()(r)}))}}},D2="StateReaderTaskEither",D4={URI:D2,map:DB},D3=rg(D4),D5={URI:D2,map:DB,ap:DV},D9=ra(D5),D8=ru(D5),D6={URI:D2,map:DB,ap:DV,chain:D$},D7={URI:D2,fromState:DC},Ae=vg(D7),At=vy(D7),An=vv(D7),Ar=vb(D7),Ai=vx(D7),Ao=vM(D7,D6),Aa=rS(D6),Au={URI:D2,fromReader:Dw},As=yW(Au),Ac=yB(Au),Al=yV(Au),Ad=y$(Au,D6),Af=yK(Au,D6),Ap={URI:D2,fromEither:Dk},Ah=r_(Ap),Am=rk(Ap),Ag=rC(Ap,D6),Ay=rj(Ap,D6),Av=rE(Ap,D6),Ab=rO(Ap),Ax=rR(Ap,D6),AM=rN(Ap),AT={URI:D2,fromIO:DI},AS=g4(AT),Aw=g3(AT,D6),AI=g5(AT,D6),A_={URI:D2,fromIO:DI,fromTask:DS},AO=vS(A_),Ak=vw(A_,D6),AC=vI(A_,D6),AN=Dv(Cv),Aj=Db(Cv),AE=ry(D4),AR=rw(D6),AD=rs(D5),AA=function(t){return function(n){return function(r){return function(i){return function(){return re(n).reduce(function(n,r,o){return n.then(function(a){return n4(a)?n:t(o+1,r)(a.right[1])(i)().then(function(t){if(n4(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,n7(n))(r)(i)().then(mm(function(t){var n;return[[t[0]],t[1]]})))}}}}},AL=function(t){var n=AA(t);return function(t){return n6(t)?n(t):DT(rt)}},AP=function(t){return AL(function(n,r){return t(r)})},AF=AP(nP),Az=function(t,n){return nG(t(n),Ca(function(t){return t[0]}))},AU=function(t,n){return nG(t(n),Ca(function(t){return t[0],t[1]}))};let AW=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:D2,map:DB,alt:DK},Applicative:{URI:D2,map:DB,ap:DV,of:DT},Apply:D5,Bifunctor:{URI:D2,bimap:DY,mapLeft:Dq},Chain:D6,FromEither:Ap,FromIO:AT,FromReader:Au,FromState:D7,FromTask:A_,Functor:D4,Monad:{URI:D2,map:DB,ap:DV,of:DT,chain:D$},MonadIO:{URI:D2,map:DB,ap:DV,of:DT,chain:D$,fromIO:DI},MonadTask:{URI:D2,map:DB,ap:DV,of:DT,chain:D$,fromIO:DI,fromTask:DS},MonadThrow:{URI:D2,map:DB,ap:DV,of:DT,chain:D$,throwError:DM},Pointed:{URI:D2,of:DT},URI:D2,alt:D1,altW:D1,ap:DH,apFirst:D9,apFirstW:D9,apS:AD,apSW:AD,apSecond:D8,apSecondW:D8,apW:DH,ask:As,asks:Ac,asksStateReaderTaskEither:DA,asksStateReaderTaskEitherW:DA,bimap:DZ,bind:AR,bindTo:AE,bindW:AR,chain:DJ,chainEitherK:Ay,chainEitherKW:Ay,chainFirst:Aa,chainFirstEitherK:Av,chainFirstEitherKW:Av,chainFirstIOK:AI,chainFirstReaderK:Af,chainFirstReaderKW:Af,chainFirstTaskK:AC,chainFirstW:Aa,chainIOEitherK:DP,chainIOEitherKW:DP,chainIOK:Aw,chainOptionK:Ag,chainReaderK:Ad,chainReaderKW:Ad,chainReaderTaskEitherK:DW,chainReaderTaskEitherKW:DW,chainStateK:Ao,chainTaskEitherK:Dz,chainTaskEitherKW:Dz,chainTaskK:Ak,chainW:DX,evalState:Az,evaluate:AN,execState:AU,execute:Aj,filterOrElse:Ax,filterOrElseW:Ax,flap:D3,flatten:D0,flattenW:D0,fromEither:Dk,fromEitherK:AM,fromIO:DI,fromIOEither:Dj,fromIOEitherK:DL,fromIOK:AS,fromOption:Ah,fromOptionK:Am,fromPredicate:Ab,fromReader:Dw,fromReaderEither:DE,fromReaderK:Al,fromReaderTaskEither:DR,fromReaderTaskEitherK:DU,fromState:DC,fromStateK:Ai,fromTask:DS,fromTaskEither:DN,fromTaskEitherK:DF,fromTaskK:AO,get:Ae,gets:Ar,left:DM,leftIO:function(t){return DR(kW(t))},leftReader:function(t){return DR(kP(t))},leftState:DO,leftTask:function(t){return DR(kA(t))},local:DD,map:DG,mapLeft:DQ,modify:An,of:DT,put:At,right:DT,rightIO:DI,rightReader:Dw,rightState:D_,rightTask:DS,run:function(t,n,r){return t(n)(r)()},sequenceArray:AF,stateReaderTaskEither:{URI:D2,map:DB,of:DT,ap:DV,chain:D$,bimap:DY,mapLeft:Dq,alt:DK,fromIO:DI,fromTask:DS,throwError:DM},stateReaderTaskEitherSeq:{URI:D2,map:DB,of:DT,ap:DV,chain:D$,bimap:DY,mapLeft:Dq,alt:DK,fromIO:DI,fromTask:DS,throwError:DM},throwError:DM,traverseArray:AP,traverseArrayWithIndex:AL,traverseReadonlyArrayWithIndex:AL,traverseReadonlyNonEmptyArrayWithIndex:AA},Symbol.toStringTag,{value:"Module"}));var AB=function(t,n){return nG(t,Aq(n))},AV=function(t,n){return nG(t,A$(n))},A$=function(t){return function(n){return{peek:function(r){return t({peek:n.peek,pos:r})},pos:n.pos}}},AK=function(t){return t.peek(t.pos)},AY=A$(nP),Aq=function(t){return function(n){return{peek:function(r){return t(n.peek(r))},pos:n.pos}}},AG="Store",AZ={URI:AG,map:AB},AQ=rg(AZ),AH={URI:AG,map:AB,extend:AV,extract:AK};let AJ=Object.freeze(Object.defineProperty({__proto__:null,Comonad:AH,Functor:AZ,URI:AG,duplicate:AY,experiment:function(t){return function(n){return function(r){return t.map(n(r.pos),function(t){return r.peek(t)})}}},extend:A$,extract:AK,flap:AQ,map:Aq,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:AH},Symbol.toStringTag,{value:"Module"}));function AX(t,n){return function(r,i){return n.compose(t.second(i),t.first(r))}}function A0(t,n){var r=AX(t,n);return function(i,o){return n.compose(r(i,o),t.promap(n.id(),nP,function(t){return[t,t]}))}}let A1=Object.freeze(Object.defineProperty({__proto__:null,fanOut:A0,fanout:function(t){return A0(t,t)},split:AX,splitStrong:function(t){return AX(t,t)}},Symbol.toStringTag,{value:"Module"}));var A2=function(){return{concat:function(t,n){return Object.assign({},t,n)}}},A4=function(t){return function(n){var r={};for(var i in n)rr.call(n,i)&&(r[i]=t[i](n[i]));return r}};let A3=Object.freeze(Object.defineProperty({__proto__:null,evolve:A4,getAssignSemigroup:A2},Symbol.toStringTag,{value:"Module"}));var A5=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())})},A9=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])}}},A8=xK(Iq),A6=xX(Iq),A7=x0(Iq),Le=function(t){return Lt(ID(t))},Lt=xq(IK),Ln=Iz(pa),Lr=x1(IK),Li=x2(I0),Lo=x4(I1),La=xG(Iq),Lu=function(t){return function(){return A5(void 0,void 0,void 0,function(){return A9(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,t().then(n2)];case 1:return[2,n.sent()];case 2:return n.sent(),[2,n1];case 3:return[2]}})})}},Ls=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return Lu(function(){return t.apply(void 0,n)})}},Lc=xZ(Iq),Ll=xQ(I1),Ld=xH(Iq),Lf=xJ(I1),Lp=x3(IK),Lh=x5(IG),Lm=x9(I1),Lg=Lm(nP),Ly=x8(I1),Lv=xY(Iq),Lb=Lv(),Lx=hj(IK,pK),LM=hE(IK,pK,p_),LT=gW(IK,pQ),LS=gB(IK,pQ),Lw=gV(IK,pQ),LI=g$(IK,pQ),L_=function(t,n){return nG(t,Lp(n))},LO=function(t,n){return nG(t,Lh(n))},Lk=function(t,n){return nG(t,Lm(n))},LC=function(t,n){return nG(t,Ly(n))},LN=function(t,n){return nG(t,LT(n))},Lj=function(t,n){return nG(t,LS(n))},LE=function(t,n){return nG(t,Lw(n))},LR=function(t,n){return nG(t,LI(n))},LD="TaskOption",LA={URI:LD,map:L_},LL=rg(LA),LP={URI:LD,of:A8},LF={URI:LD,map:L_,ap:LO},Lz=ra(LF),LU=ru(LF),LW=function(t,n){return nG(t,Lm(function(t){return nG(n,Lp(t))}))},LB={URI:LD,map:L_,ap:LO,chain:Lk},LV=rS(LB),L$={URI:LD,zero:Lv},LK=u5(L$,LP),LY={URI:LD,fromIO:Le},Lq=g4(LY),LG=g3(LY,LB),LZ=g5(LY,LB),LQ={URI:LD,fromEither:A7},LH=rN(LQ),LJ=rj(LQ,LB),LX=rE(LQ,LB),L0={URI:LD,fromIO:Le,fromTask:Lt},L1=vS(L0),L2=vw(L0,LB),L4=vI(L0,LB),L3=A8(rn),L5=ry(LA),L9=rw(LB),L8=rs(LF),L6=A8(rt),L7=function(t){return nV(_r(t),Iz(hM(nZ)))},Pe=function(t){var n=L7(t);return function(t){return n6(t)?n(t):L6}},Pt=function(t){return function(n){return function(){return re(n).reduce(function(n,r,i){return n.then(function(o){return nX(o)?n:t(i+1,r)().then(function(t){return nX(t)?t:(o.value.push(t.value),o)})})},t(0,n7(n))().then(pI(n8)))}}},Pn=function(t){var n=Pt(t);return function(t){return n6(t)?n(t):L6}},Pr=function(t){return Pe(function(n,r){return t(r)})},Pi=Pr(nP),Po=function(t){return Pn(function(n,r){return t(r)})},Pa=Po(nP);let Pu=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:LD,map:L_,alt:LC},Alternative:{URI:LD,map:L_,ap:LO,of:A8,alt:LC,zero:Lv},ApT:L6,ApplicativePar:{URI:LD,map:L_,ap:LO,of:A8},ApplicativeSeq:{URI:LD,map:L_,ap:LW,of:A8},ApplyPar:LF,ApplySeq:{URI:LD,map:L_,ap:LW},Chain:LB,Compactable:{URI:LD,compact:Lx,separate:LM},Do:L3,Filterable:{URI:LD,map:L_,compact:Lx,separate:LM,filter:LN,filterMap:Lj,partition:LE,partitionMap:LR},FromEither:LQ,FromIO:LY,FromTask:L0,Functor:LA,Monad:{URI:LD,map:L_,ap:LO,of:A8,chain:Lk},MonadIO:{URI:LD,map:L_,ap:LO,of:A8,chain:Lk,fromIO:Le},MonadTask:{URI:LD,map:L_,ap:LO,of:A8,chain:Lk,fromIO:Le,fromTask:Lt},Pointed:LP,Zero:L$,alt:Ly,altW:Ly,ap:Lh,apFirst:Lz,apS:L8,apSecond:LU,bind:L9,bindTo:L5,chain:Lm,chainEitherK:LJ,chainFirst:LV,chainFirstEitherK:LX,chainFirstIOK:LZ,chainFirstTaskK:L4,chainIOK:LG,chainNullableK:Ll,chainOptionK:Lf,chainTaskK:L2,compact:Lx,filter:LT,filterMap:LS,flap:LL,flatten:Lg,fold:Li,foldW:Li,fromEither:A7,fromEitherK:LH,fromIO:Le,fromIOK:Lq,fromNullable:La,fromNullableK:Lc,fromOption:IW,fromOptionK:Ld,fromPredicate:A6,fromTask:Lt,fromTaskEither:Ln,fromTaskK:L1,getOrElse:Lo,getOrElseW:Lo,guard:LK,map:Lp,match:Lr,matchE:Li,matchEW:Li,matchW:Lr,none:Lb,of:A8,partition:Lw,partitionMap:LI,separate:LM,sequenceArray:Pi,sequenceSeqArray:Pa,some:A8,traverseArray:Pr,traverseArrayWithIndex:Pe,traverseReadonlyArrayWithIndex:Pe,traverseReadonlyArrayWithIndexSeq:Pn,traverseReadonlyNonEmptyArrayWithIndex:L7,traverseReadonlyNonEmptyArrayWithIndexSeq:Pt,traverseSeqArray:Po,traverseSeqArrayWithIndex:Pn,tryCatch:Lu,tryCatchK:Ls,zero:Lv},Symbol.toStringTag,{value:"Module"}));var Ps=function(t){return"Left"===t._tag},Pc=function(t){return"Right"===t._tag};function Pl(t){return"Both"===t._tag}function Pd(t){return{_tag:"Left",left:t}}function Pf(t){return{_tag:"Right",right:t}}function Pp(t,n){return{_tag:"Both",left:t,right:n}}var Ph=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)}}},Pm=Ph(Pf,Pd,function(t,n){return Pp(n,t)});function Pg(t,n){return{concat:function(r,i){return Ps(r)?Ps(i)?Pd(t.concat(r.left,i.left)):Pc(i)?Pp(r.left,i.right):Pp(t.concat(r.left,i.left),i.right):Pc(r)?Ps(i)?Pp(i.left,r.right):Pc(i)?Pf(n.concat(r.right,i.right)):Pp(i.left,n.concat(r.right,i.right)):Ps(i)?Pp(t.concat(r.left,i.left),r.right):Pc(i)?Pp(r.left,n.concat(r.right,i.right)):Pp(t.concat(r.left,i.left),n.concat(r.right,i.right))}}}var Py=function(t){return{URI:PA,_E:void 0,map:Px,ap:function(n,r){return Ps(n)?Ps(r)?Pd(t.concat(n.left,r.left)):Pc(r)?Pd(n.left):Pd(t.concat(n.left,r.left)):Pc(n)?Ps(r)?Pd(r.left):Pc(r)?Pf(n.right(r.right)):Pp(r.left,n.right(r.right)):Ps(r)?Pd(t.concat(n.left,r.left)):Pc(r)?Pp(n.left,n.right(r.right)):Pp(t.concat(n.left,r.left),n.right(r.right))}}};function Pv(t){var n=Py(t),r=function(n,r){if(Ps(n))return n;if(Pc(n))return r(n.right);var i=r(n.right);return Ps(i)?Pd(t.concat(n.left,i.left)):Pc(i)?Pp(n.left,i.right):Pp(t.concat(n.left,i.left),i.right)};return{URI:PA,_E:void 0,map:Px,ap:n.ap,chain:r}}var Pb=function(t,n){return nX(t)?nX(n)?n1:n2(Pf(n.value)):nX(n)?n2(Pd(t.value)):n2(Pp(t.value,n.value))},Px=function(t,n){return nG(t,PC(n))},PM=function(t,n,r){return nG(t,PO(n,r))},PT=function(t,n){return nG(t,Pk(n))},PS=function(t,n,r){return nG(t,PN(n,r))},Pw=function(t){var n=Pj(t);return function(t,r){return nG(t,n(r))}},PI=function(t,n,r){return nG(t,PE(n,r))},P_=function(t){var n=PR(t);return function(t,r){return nG(t,n(r))}},PO=function(t,n){return function(r){return Ps(r)?Pd(t(r.left)):Pc(r)?Pf(n(r.right)):Pp(t(r.left),n(r.right))}},Pk=function(t){return function(n){return Ps(n)?Pd(t(n.left)):Pl(n)?Pp(t(n.left),n.right):n}},PC=function(t){return function(n){return Ps(n)?n:Pc(n)?Pf(t(n.right)):Pp(n.left,t(n.right))}},PN=function(t,n){return function(r){return Ps(r)?t:n(t,r.right)}},Pj=function(t){return function(n){return function(r){return Ps(r)?t.empty:n(r.right)}}},PE=function(t,n){return function(r){return Ps(r)?t:n(r.right,t)}},PR=function(t){return function(n){return function(r){return Ps(r)?t.of(r):Pc(r)?t.map(n(r.right),Pf):t.map(n(r.right),function(t){return Pp(r.left,t)})}}},PD=function(t){return function(n){return Ps(n)?t.of(n):Pc(n)?t.map(n.right,Pf):t.map(n.right,function(t){return Pp(n.left,t)})}},PA="These",PL={URI:PA,map:Px},PP=rg(PL),PF={URI:PA,fromEither:nP},Pz=r_(PF),PU=rk(PF),PW=function(t){return function(n){return function(r){return!Ps(r)&&t.equals(n,r.right)}}},PB=function(t){return function(n){return!Ps(n)&&t(n.right)}},PV=function(t,n){return function(r){return Ps(r)?[r.left,n()]:Pc(r)?[t(),r.right]:[r.left,r.right]}},P$=function(t,n){return PV(function(){return t},function(){return n})},PK=Pf(rt),PY=function(t){return function(n){return function(r){var i=n1,o=n(0,n7(r));if(Ps(o))return o;Pl(o)&&(i=n2(o.left));for(var a=[o.right],u=1;u<r.length;u++){var s=n(u,r[u]);if(Ps(s))return s;Pl(s)&&(i=nX(i)?n2(s.left):n2(t.concat(i.value,s.left))),a.push(s.right)}return nX(i)?Pf(a):Pp(i.value,a)}}},Pq=function(t){return function(n){var r=PY(t)(n);return function(t){return n6(t)?r(t):PK}}};let PG=Object.freeze(Object.defineProperty({__proto__:null,ApT:PK,Bifunctor:{URI:PA,bimap:PM,mapLeft:PT},Foldable:{URI:PA,reduce:PS,foldMap:Pw,reduceRight:PI},FromEither:PF,FromThese:{URI:PA,fromThese:nP},Functor:PL,Pointed:{URI:PA,of:Pf},Traversable:{URI:PA,map:Px,reduce:PS,foldMap:Pw,reduceRight:PI,traverse:P_,sequence:PD},URI:PA,bimap:PO,both:Pp,elem:PW,exists:PB,flap:PP,fold:Ph,foldMap:Pj,foldW:Ph,fromOption:Pz,fromOptionK:PU,fromOptions:Pb,getApplicative:function(t){var n=Py(t);return{URI:PA,_E:void 0,map:Px,ap:n.ap,of:Pf}},getApply:Py,getChain:Pv,getEq:function(t,n){return rA(function(r,i){return Ps(r)?Ps(i)&&t.equals(r.left,i.left):Pc(r)?Pc(i)&&n.equals(r.right,i.right):Pl(i)&&t.equals(r.left,i.left)&&n.equals(r.right,i.right)})},getLeft:function(t){return Ps(t)?n2(t.left):Pc(t)?n1:n2(t.left)},getLeftOnly:function(t){return Ps(t)?n2(t.left):n1},getMonad:function(t){var n=Pv(t);return{URI:PA,_E:void 0,map:Px,of:Pf,ap:n.ap,chain:n.chain,throwError:Pd}},getRight:function(t){return Ps(t)?n1:(Pc(t),n2(t.right))},getRightOnly:function(t){return Pc(t)?n2(t.right):n1},getSemigroup:Pg,getShow:function(t,n){return{show:Ph(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:Pl,isLeft:Ps,isRight:Pc,left:Pd,leftOrBoth:function(t){return function(n){return nX(n)?Pd(t):Pp(t,n.value)}},map:PC,mapLeft:Pk,match:Ph,matchW:Ph,of:Pf,reduce:PN,reduceRight:PE,right:Pf,rightOrBoth:function(t){return function(n){return nX(n)?Pf(t):Pp(n.value,t)}},sequence:PD,swap:Pm,these:{URI:PA,map:Px,bimap:PM,mapLeft:PT,reduce:PS,foldMap:Pw,reduceRight:PI,traverse:P_,sequence:PD},toTuple:P$,toTuple2:PV,traverse:PR,traverseReadonlyArrayWithIndex:Pq,traverseReadonlyNonEmptyArrayWithIndex:PY},Symbol.toStringTag,{value:"Module"}));function PZ(t){return nV(Pf,t.of)}function PQ(t){return nV(Pd,t.of)}function PH(t){return nV(Pp,t.of)}function PJ(t){return function(n){return t.map(n,Pf)}}function PX(t){return function(n){return t.map(n,Pd)}}function P0(t){return rm(t,PL)}function P1(t,n){return ro(t,Py(n))}function P2(t,n){var r=PQ(t);return function(i){return function(o){return t.chain(o,Ph(r,i,function(r,o){return t.map(i(o),Ph(function(t){return Pd(n.concat(r,t))},function(t){return Pp(r,t)},function(t,i){return Pp(n.concat(r,t),i)}))}))}}}function P4(t){return function(n,r){return function(i){return t.map(i,PO(n,r))}}}function P3(t){return function(n){return function(r){return t.map(r,Pk(n))}}}function P5(t){return function(n,r,i){return function(o){return t.map(o,Ph(n,r,i))}}}function P9(t){return function(n,r,i){return function(o){return t.chain(o,Ph(n,r,i))}}}function P8(t){return function(n){return t.map(n,Pm)}}function P6(t){return function(n,r){return function(i){return t.map(i,PV(n,r))}}}let P7=Object.freeze(Object.defineProperty({__proto__:null,ap:P1,bimap:P4,both:PH,chain:P2,getTheseM:function(t){var n=P0(t),r=P4(t),i=P3(t),o=P9(t),a=P6(t),u=PZ(t),s=function(t,r){return nG(t,n(r))};return{map:s,bimap:function(t,n,i){return nG(t,r(n,i))},mapLeft:function(t,n){return nG(t,i(n))},fold:function(t,n,r,i){return nG(t,o(n,r,i))},swap:P8(t),rightM:PJ(t),leftM:PX(t),left:PQ(t),right:PZ(t),both:PH(t),toTuple:function(t,n,r){return nG(t,a(function(){return n},function(){return r}))},getMonad:function(n){var r=P1(t,n),i=P2(t,n);return{_E:void 0,map:s,of:u,ap:function(t,n){return nG(t,r(n))},chain:function(t,n){return nG(t,i(n))}}}}},left:PQ,leftF:PX,map:P0,mapLeft:P3,match:P5,matchE:P9,right:PZ,rightF:PJ,swap:P8,toTuple2:P6},Symbol.toStringTag,{value:"Module"}));var Fe=PQ(Iq),Ft=PZ(Iq),Fn=PH(Iq),Fr=PJ(IK),Fi=PX(IK),Fo=nV(ID,Fr),Fa=nV(ID,Fi),Fu=P5(IK),Fs=P9(I1),Fc=P8(IK),Fl=function(t,n){return nG(t,Fp(n))},Fd=function(t,n,r){return nG(t,Fh(n,r))},Ff=function(t,n){return nG(t,Fm(n))},Fp=P0(IK),Fh=P4(IK),Fm=P3(IK),Fg="TaskThese",Fy=function(t,n){var r=P1(t,n);return{URI:Fg,_E:void 0,map:Fl,ap:function(t,n){return nG(t,r(n))}}};function Fv(t,n){var r=Fy(t,n).ap;return{URI:Fg,_E:void 0,map:Fl,ap:r,of:Ft}}function Fb(t){var n=Fy(IH,t),r=P2(I1,t);return{URI:Fg,_E:void 0,map:Fl,ap:n.ap,chain:function(t,n){return nG(t,r(n))}}}var Fx={URI:Fg,map:Fl},FM=rg(Fx),FT={URI:Fg,fromEither:IW},FS=r_(FT),Fw=rk(FT),FI=rO(FT),F_={URI:Fg,fromThese:IW},FO=vO(F_),Fk={URI:Fg,fromIO:Fo},FC=g4(Fk),FN={URI:Fg,fromIO:Fo,fromTask:Fr},Fj=vS(FN),FE=P6(IK),FR=Ft(rt),FD=function(t){var n=PY(t);return function(t){return nV(_r(t),Iz(n(nZ)))}},FA=function(t){return function(n){var r=FD(t)(n);return function(t){return n6(t)?r(t):FR}}},FL=function(t){return function(n){return function(r){return function(){return re(r).reduce(function(r,i,o){return r.then(function(a){return Ps(a)?r:n(o+1,i)().then(function(n){if(Ps(n))return n;if(Pl(n)){var r=a.right;return r.push(n.right),Pl(a)?Pp(t.concat(a.left,n.left),r):Pp(n.left,r)}return a.right.push(n.right),a})})},n(0,n7(r))().then(PC(n8)))}}}},FP=function(t){return function(n){var r=FL(t)(n);return function(t){return n6(t)?r(t):FR}}},FF=function(t,n){return FE(function(){return t},function(){return n})},Fz=function(t,n){return rc(IJ)(Pg(t,n))};let FU=Object.freeze(Object.defineProperty({__proto__:null,ApT:FR,Bifunctor:{URI:Fg,bimap:Fd,mapLeft:Ff},FromEither:FT,FromIO:Fk,FromTask:FN,FromThese:F_,Functor:Fx,Pointed:{URI:Fg,of:Ft},URI:Fg,bifunctorTaskThese:{URI:Fg,bimap:Fd,mapLeft:Ff},bimap:Fh,both:Fn,flap:FM,fold:Fs,foldW:Fs,fromEither:IW,fromIO:Fo,fromIOEither:ID,fromIOK:FC,fromOption:FS,fromOptionK:Fw,fromPredicate:FI,fromTask:Fr,fromTaskK:Fj,fromThese:IW,fromTheseK:FO,functorTaskThese:{URI:Fg,map:Fl},getApplicative:Fv,getApply:Fy,getChain:Fb,getMonad:function(t){var n=Fv(IH,t),r=Fb(t);return{URI:Fg,_E:void 0,map:Fl,ap:n.ap,of:Ft,chain:r.chain,fromIO:Fo,fromTask:Fr}},getSemigroup:Fz,left:Fe,leftIO:Fa,leftTask:Fi,map:Fp,mapLeft:Fm,match:Fu,matchE:Fs,matchEW:Fs,matchW:Fu,of:Ft,right:Ft,rightIO:Fo,rightTask:Fr,swap:Fc,taskThese:{URI:Fg,map:Fl,bimap:Fd,mapLeft:Ff},toTuple:FF,toTuple2:FE,traverseReadonlyArrayWithIndex:FA,traverseReadonlyArrayWithIndexSeq:FP,traverseReadonlyNonEmptyArrayWithIndex:FD,traverseReadonlyNonEmptyArrayWithIndexSeq:FL},Symbol.toStringTag,{value:"Module"}));var FW=function(t,n){return nG(t,FB(n))},FB=function(t){return function(n){return function(r){return t(n(r))}}},FV="Traced",F$={URI:FV,map:FW},FK=rg(F$);let FY=Object.freeze(Object.defineProperty({__proto__:null,Functor:F$,URI:FV,censor:function(t){return function(n){return function(r){return n(t(r))}}},flap:FK,getComonad:function(t){return{URI:FV,_E:void 0,map:FW,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:FB,traced:F$,tracks:function(t,n){return function(r){return r(n(r(t.empty)))}}},Symbol.toStringTag,{value:"Module"}));function Fq(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 FG(t,n){return function(r){var i=t.sequence(r),o=n.sequence(r);return function(n){return i(t.map(n,o))}}}let FZ=Object.freeze(Object.defineProperty({__proto__:null,getTraversableComposition:function(t,n){var r=rv(t,n).map,i=gH(t,n),o=Fq(t,n),a=FG(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 nG(t,n(r))}},sequence:function(t){var n=a(t);return function(t){return nG(t,n)}}}},sequence:FG,traverse:Fq},Symbol.toStringTag,{value:"Module"})),FQ=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function FH(t,n){return void 0===n&&(n=[]),{value:t,forest:n}}var FJ=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+=FJ(t+(o>1&&!u?"│ ":" "),r.forest)}return i};function FX(t){return FJ(`
|
|
2
|
+
`,t)}function F0(t,n){var r,i=n(t);return{value:i[0],forest:F1(i[1],n)}}function F1(t,n){return t.map(function(t){return F0(t,n)})}function F2(t){var n=F4(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 F4(t){var n=dH(t);return function(r,i){return nG(r,n(function(n){return F2(t)(n,i)}))}}var F3=function(t,n){return nG(t,zu(n))},F5=function(t,n){return nG(t,zr(function(t){return nG(n,zu(t))}))},F9=function(t,n){return nG(t,zr(n))},F8=function(t,n,r){return nG(t,zs(n,r))},F6=function(t){var n=zc(t);return function(t,r){return nG(t,n(r))}},F7=function(t,n,r){return nG(t,zl(n,r))},ze=function(t,n){return nG(t,zi(n))},zt=function(t){var n=zf(t);return function(t,r){return nG(t,n(r))}},zn=function(t){return function(n){return F5(n,t)}},zr=function(t){return function(n){var r=t(n.value),i=r.value,o=r.forest,a=d5().concat;return{value:i,forest:a(o,n.forest.map(zr(t)))}}},zi=function(t){return function(n){return{value:t(n),forest:n.forest.map(zi(t))}}},zo=zi(nP),za=zr(nP),zu=function(t){return function(n){return{value:t(n.value),forest:n.forest.map(zu(t))}}},zs=function(t,n){return function(r){for(var i=n(t,r.value),o=r.forest.length,a=0;a<o;a++)i=nG(r.forest[a],zs(i,n));return i}},zc=function(t){return function(n){return zs(t.empty,function(r,i){return t.concat(r,n(i))})}},zl=function(t,n){return function(r){for(var i=t,o=r.forest.length,a=o-1;a>=0;a--)i=nG(r.forest[a],zl(i,n));return n(r.value,i)}},zd=function(t){return t.value},zf=function(t){var n=dH(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}}}),nG(o.forest,n(r(i))))}};return r},zp=function(t){return zf(t)(nP)},zh=function(t){return FH(t)},zm="Tree",zg={URI:zm,map:F3},zy=rg(zg),zv={URI:zm,map:F3,ap:F5},zb=ra(zv),zx=ru(zv),zM={URI:zm,map:F3,ap:F5,chain:F9},zT=rS(zM),zS=zh(rn),zw=ry(zg),zI=rw(zM),z_=rs(zv),zO=function(t){return function(n){return t(n.value)||n.forest.some(zO(t))}};let zk=Object.freeze(Object.defineProperty({__proto__:null,Applicative:{URI:zm,map:F3,ap:F5,of:zh},Apply:zv,Chain:zM,Comonad:{URI:zm,map:F3,extend:ze,extract:zd},Do:zS,Foldable:{URI:zm,reduce:F8,foldMap:F6,reduceRight:F7},Functor:zg,Monad:{URI:zm,map:F3,ap:F5,of:zh,chain:F9},Pointed:{URI:zm,of:zh},Traversable:{URI:zm,map:F3,reduce:F8,foldMap:F6,reduceRight:F7,traverse:zt,sequence:zp},URI:zm,ap:zn,apFirst:zb,apS:z_,apSecond:zx,bind:zI,bindTo:zw,chain:zr,chainFirst:zT,drawForest:FX,drawTree:function(t){return t.value+FX(t.forest)},duplicate:zo,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:zO,extend:zi,extract:zd,flap:zy,flatten:za,fold:function(t){var n=function(r){return t(r.value,r.forest.map(n))};return n},foldMap:zc,getEq:function(t){var n,r=rA(function(r,i){return t.equals(r.value,i.value)&&n.equals(r.forest,i.forest)});return n=cY(r),r},getShow:function(t){var n=function(r){return lM(r.forest)?"make(".concat(t.show(r.value),")"):"make(".concat(t.show(r.value),", [").concat(r.forest.map(n).join(", "),"])")};return{show:n}},make:FH,map:zu,of:zh,reduce:zs,reduceRight:zl,sequence:zp,traverse:zf,tree:{URI:zm,map:F3,of:zh,ap:F5,chain:F9,reduce:F8,foldMap:F6,reduceRight:F7,traverse:zt,sequence:zp,extract:zd,extend:ze},unfoldForest:F1,unfoldForestM:F4,unfoldTree:F0,unfoldTreeM:F2},Symbol.toStringTag,{value:"Module"}));var zC=function(t){var n;return[EO(t),(n=t,n[0])]};function zN(t){return{URI:zX,_E:void 0,map:zD,ap:function(n,r){var i,o;return[(i=n,i[0])((o=r,o[0])),t.concat(EO(n),EO(r))]}}}var zj=function(t){return function(n){return[n,t.empty]}};function zE(t){var n=zN(t);return{URI:zX,_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(EO(n),u)]}}}var zR=function(t,n){return nG(t,zK(n))},zD=function(t,n){return nG(t,zV(n))},zA=function(t,n,r){return nG(t,zB(n,r))},zL=function(t,n){return nG(t,z$(n))},zP=function(t,n){return nG(t,zY(n))},zF=function(t,n,r){return nG(t,zZ(n,r))},zz=function(t){var n=zG();return function(t,r){return nG(t,n(r))}},zU=function(t,n,r){return nG(t,zQ(n,r))};function zW(t){var n=zH(t);return function(t,r){return nG(t,n(r))}}var zB=function(t,n){return function(r){var i;return[n((i=r,i[0])),t(EO(r))]}},zV=function(t){return function(n){var r;return[t((r=n,r[0])),EO(n)]}},z$=function(t){return function(n){var r;return[(r=n,r[0]),t(EO(n))]}},zK=function(t){return function(n){var r;return[(r=n,r[0]),EO(t)]}},zY=function(t){return function(n){return[t(n),EO(n)]}},zq=zY(nP),zG=EG,zZ=Eq,zQ=EZ,zH=function(t){return function(n){return function(r){var i;return t.map(n((i=r,i[0])),function(t){return[t,EO(r)]})}}},zJ=function(t){return function(n){var r;return t.map((r=n,r[0]),function(t){return[t,EO(n)]})}},zX="Tuple",z0={URI:zX,map:zD},z1=rg(z0);let z2=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:{URI:zX,bimap:zA,mapLeft:zL},Comonad:{URI:zX,map:zD,extend:zP,extract:E_},Foldable:{URI:zX,reduce:zF,foldMap:zz,reduceRight:zU},Functor:z0,Semigroupoid:{URI:zX,compose:zR},Traversable:{URI:zX,map:zD,reduce:zF,foldMap:zz,reduceRight:zU,traverse:zW,sequence:zJ},URI:zX,bimap:zB,compose:zK,duplicate:zq,extend:zY,extract:E_,flap:z1,foldMap:zG,fst:E_,getApplicative:function(t){var n=zN(t);return{URI:zX,_E:void 0,map:n.map,ap:n.ap,of:zj(t)}},getApply:zN,getChain:zE,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,EO(a)),s=(o=a=r(s.left))[0]}return[s.right,t.concat(u,EO(a))]},r=zE(t);return{URI:zX,_E:void 0,map:r.map,ap:r.ap,chain:r.chain,chainRec:n}},getMonad:function(t){var n=zE(t);return{URI:zX,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,of:zj(t)}},map:zV,mapFst:zV,mapLeft:z$,mapSnd:z$,reduce:zZ,reduceRight:zQ,sequence:zJ,snd:EO,swap:zC,traverse:zH,tuple:{URI:zX,compose:zR,map:zD,bimap:zA,mapLeft:zL,extract:E_,extend:zP,reduce:zF,foldMap:zz,reduceRight:zU,traverse:zW,sequence:zJ}},Symbol.toStringTag,{value:"Module"})),z4=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),z3=Object.freeze(Object.defineProperty({__proto__:null,getValidationM:function(t,n){var r=rM(n,mp(t));return{map:r.map,ap:r.ap,of:r.of,chain:function(t,r){return n.chain(t,function(t){return n4(t)?n.of(n5(t.left)):r(t.right)})},alt:function(r,i){return n.chain(r,function(r){return n3(r)?n.of(r):n.map(i(),function(n){return n4(n)?n5(t.concat(r.left,n.left)):n})})}}}},Symbol.toStringTag,{value:"Module"}));var z5=ip(void 0),z9={concat:z5.concat,empty:void 0};let z8=Object.freeze(Object.defineProperty({__proto__:null,Monoid:z9,Semigroup:z5},Symbol.toStringTag,{value:"Module"}));var z6=function(t){return function(){return[void 0,t]}},z7=function(t){return function(){var n=t(),r=n[0],i=n[1];return[[r,i],i]}},Ue=function(t){return function(){var n,r=t(),i=r[0],o=i[0];return[o,(0,i[1])(r[1])]}},Ut=function(t){return function(n){return function(){var r=n(),i=r[0],o=r[1];return[[i,t(o)],o]}}},Un=function(t){return function(n){return function(){var r,i=n();return[i[0],t(i[1])]}}},Ur=function(t,n){return nG(t,Ui(n))},Ui=function(t){return function(n){return function(){var r=n(),i=r[0],o=r[1];return[t(i),o]}}},Uo="Writer",Ua=function(t){return{URI:Uo,_E:void 0,of:function(n){return function(){return[n,t.empty]}}}},Uu=function(t){return{URI:Uo,_E:void 0,map:Ur,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)]}}}},Us=function(t){var n=Uu(t),r=Ua(t);return{URI:Uo,_E:void 0,map:Ur,ap:n.ap,of:r.of}};function Uc(t){var n=Uu(t);return{URI:Uo,_E:void 0,map:Ur,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 Ul={URI:Uo,map:Ur},Ud=rg(Ul),Uf=function(t){return t()[0]},Up=function(t){return t()[1]},Uh=function(t){return t()[0]},Um=function(t){return t()[1]};let Ug=Object.freeze(Object.defineProperty({__proto__:null,Functor:Ul,URI:Uo,censor:Un,evalWriter:Uh,evaluate:Uf,execWriter:Um,execute:Up,flap:Ud,getApplicative:Us,getApply:Uu,getChain:Uc,getMonad:function(t){var n=Us(t),r=Uc(t);return{URI:Uo,_E:void 0,map:Ur,ap:n.ap,of:n.of,chain:r.chain}},getPointed:Ua,listen:z7,listens:Ut,map:Ui,pass:Ue,tell:z6,writer:Ul},Symbol.toStringTag,{value:"Module"})),Uy=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"})),Uv=Object.freeze(Object.defineProperty({__proto__:null,alt:nC,alternative:nN,applicative:rT,apply:rh,array:fO,bifunctor:fk,boolean:fP,booleanAlgebra:fz,bounded:fV,boundedDistributiveLattice:fY,boundedJoinSemilattice:fq,boundedLattice:fG,boundedMeetSemilattice:fZ,category:fQ,chain:rI,chainRec:fJ,choice:f1,comonad:f2,compactable:hR,console:hF,const:hJ,contravariant:hX,date:h4,distributiveLattice:fK,either:gd,eitherT:gD,endomorphism:gP,eq:rK,extend:gF,field:gU,filterable:gK,filterableWithIndex:gY,foldable:gJ,foldableWithIndex:g2,fromEither:rD,fromIO:g9,fromReader:yY,fromState:vT,fromTask:v_,fromThese:vk,function:nH,functor:rb,functorWithIndex:vN,group:vj,heytingAlgebra:vE,hkt:vR,identity:bi,invariant:bo,io:bA,ioEither:x$,ioOption:M8,ioRef:M7,joinSemilattice:Te,json:Tr,lattice:Ti,magma:ic,map:S1,meetSemilattice:S2,monad:S4,monadIO:S3,monadTask:S5,monadThrow:S9,monoid:wl,naturalTransformation:wd,nonEmptyArray:uj,number:uB,option:hN,optionT:x6,ord:ir,ordering:wv,pipeable:wb,pointed:wx,predicate:pr,profunctor:wM,random:w_,reader:yU,readerEither:IO,readerT:IR,readerTask:Or,readerTaskEither:Nl,readonlyArray:lx,readonlyMap:So,readonlyNonEmptyArray:o7,readonlyRecord:j5,readonlySet:EI,readonlyTuple:E1,record:RP,refinement:RY,ring:RZ,semigroup:i_,semigroupoid:RQ,semiring:RH,separated:u0,set:Ds,show:Dd,state:vm,stateReaderTaskEither:AW,stateT:Dx,store:AJ,string:NC,strong:A1,struct:A3,task:_p,taskEither:kj,taskOption:Pu,taskThese:FU,these:PG,theseT:P7,traced:FY,traversable:FZ,traversableWithIndex:FQ,tree:zk,tuple:z2,unfoldable:z4,validationT:z3,void:z8,witherable:u3,writer:Ug,writerT:Uy,zero:u9},Symbol.toStringTag,{value:"Module"})),Ub=I(Uv);var Ux={},UM={},UT={},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 d(t){return t+1}function f(t){return t-1}function p(t){throw Error("Called `absurd` function which should be uncallable")}t.apply=u,t.identity=s,t.unsafeCoerce=s,t.constant=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=d,t.decrement=f,t.absurd=p,t.tupled=function(t){return function(n){return t.apply(void 0,n)}},t.untupled=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(n)}},t.pipe=function(t,n,r,i,o,a,u,s,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],d=1;d<arguments.length;d++)l=arguments[d](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 Uw={},UI=w&&w.__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(Uw,"__esModule",{value:!0}),Uw.fromReadonlyNonEmptyArray=Uw.has=Uw.emptyRecord=Uw.emptyReadonlyArray=Uw.tail=Uw.head=Uw.isNonEmpty=Uw.singleton=Uw.right=Uw.left=Uw.isRight=Uw.isLeft=Uw.some=Uw.none=Uw.isSome=Uw.isNone=void 0;var U_=function(t){return"None"===t._tag};Uw.isNone=U_;var UO=function(t){return"Some"===t._tag};Uw.isSome=UO,Uw.none={_tag:"None"};var Uk=function(t){return{_tag:"Some",value:t}};Uw.some=Uk;var UC=function(t){return"Left"===t._tag};Uw.isLeft=UC;var UN=function(t){return"Right"===t._tag};Uw.isRight=UN;var Uj=function(t){return{_tag:"Left",left:t}};Uw.left=Uj;var UE=function(t){return{_tag:"Right",right:t}};Uw.right=UE;var UR=function(t){return[t]};Uw.singleton=UR;var UD=function(t){return t.length>0};Uw.isNonEmpty=UD;var UA=function(t){return t[0]};Uw.head=UA;var UL=function(t){return t.slice(1)};Uw.tail=UL,Uw.emptyReadonlyArray=[],Uw.emptyRecord={},Uw.has=Object.prototype.hasOwnProperty;var UP=function(t){return UI([t[0]],t.slice(1),!0)};Uw.fromReadonlyNonEmptyArray=UP;var UF=w&&w.__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]}),Uz=w&&w.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),UU=w&&w.__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)&&UF(n,t,r);return Uz(n,t),n};Object.defineProperty(UT,"__esModule",{value:!0}),UT.sequenceS=UT.sequenceT=UT.getApplySemigroup=UT.apS=UT.apSecond=UT.apFirst=UT.ap=void 0;var UW=UU(Uw);function UB(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):UB(t,n-1,o)}}UT.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)}}},UT.apFirst=function(t){return function(n){return function(r){return t.ap(t.map(r,function(t){return function(){return t}}),n)}}},UT.apSecond=function(t){return function(n){return function(r){return t.ap(t.map(r,function(){return function(t){return t}}),n)}}},UT.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)}}},UT.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 UV={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 U$(t){return UW.has.call(UV,t)||(UV[t]=UB(US.tuple,t-1,[])),UV[t]}function UK(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 UB(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,[])}}UT.sequenceT=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i=n.length,o=U$(i),a=t.map(n[0],o),u=1;u<i;u++)a=t.ap(a,n[u]);return a}},UT.sequenceS=function(t){return function(n){for(var r=Object.keys(n),i=r.length,o=UK(r),a=t.map(n[r[0]],o),u=1;u<i;u++)a=t.ap(a,n[r[u]]);return a}};var UY={};function Uq(t,n){return function(r){return function(i){return t.map(i,function(t){return n.map(t,r)})}}}Object.defineProperty(UY,"__esModule",{value:!0}),UY.getFunctorComposition=UY.bindTo=UY.flap=UY.map=void 0,UY.map=Uq,UY.flap=function(t){return function(n){return function(r){return t.map(r,function(t){return t(n)})}}},UY.bindTo=function(t){return function(n){return function(r){return t.map(r,function(t){var r;return(r={})[n]=t,r})}}},UY.getFunctorComposition=function(t,n){var r=Uq(t,n);return{map:function(t,n){return(0,US.pipe)(t,r(n))}}},Object.defineProperty(UM,"__esModule",{value:!0}),UM.getApplicativeComposition=UM.getApplicativeMonoid=void 0,UM.getApplicativeMonoid=function(t){var n=(0,UT.getApplySemigroup)(t);return function(r){return{concat:n(r).concat,empty:t.of(r.empty)}}},UM.getApplicativeComposition=function(t,n){var r=(0,UY.getFunctorComposition)(t,n).map,i=(0,UT.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 UG={};Object.defineProperty(UG,"__esModule",{value:!0}),UG.bind=UG.chainFirst=void 0,UG.chainFirst=function(t){return function(n){return function(r){return t.chain(r,function(r){return t.map(n(r),function(){return r})})}}},UG.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 UZ={};Object.defineProperty(UZ,"__esModule",{value:!0}),UZ.tailRec=void 0;var UQ=function(t,n){for(var r=n(t);"Left"===r._tag;)r=n(r.left);return r.right};UZ.tailRec=UQ;var UH={},UJ=w&&w.__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]}),UX=w&&w.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),U0=w&&w.__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)&&UJ(n,t,r);return UX(n,t),n};Object.defineProperty(UH,"__esModule",{value:!0}),UH.filterOrElse=UH.chainFirstEitherK=UH.chainEitherK=UH.fromEitherK=UH.chainOptionK=UH.fromOptionK=UH.fromPredicate=UH.fromOption=void 0;var U1=U0(Uw);function U2(t){return function(n){return function(r){return t.fromEither(U1.isNone(r)?U1.left(n()):U1.right(r.value))}}}function U4(t){var n=U2(t);return function(t){var r=n(t);return function(t){return(0,US.flow)(t,r)}}}function U3(t){return function(n){return(0,US.flow)(n,t.fromEither)}}UH.fromOption=U2,UH.fromPredicate=function(t){return function(n,r){return function(i){return t.fromEither(n(i)?U1.right(i):U1.left(r(i)))}}},UH.fromOptionK=U4,UH.chainOptionK=function(t,n){var r=U4(t);return function(t){var i=r(t);return function(t){return function(r){return n.chain(r,i(t))}}}},UH.fromEitherK=U3,UH.chainEitherK=function(t,n){var r=U3(t);return function(t){return function(i){return n.chain(i,r(t))}}},UH.chainFirstEitherK=function(t,n){return(0,US.flow)(U3(t),(0,UG.chainFirst)(n))},UH.filterOrElse=function(t,n){return function(r,i){return function(o){return n.chain(o,function(n){return t.fromEither(r(n)?U1.right(n):U1.left(i(n)))})}}};var U5,U9,U8,U6,U7,We,Wt,Wn,Wr,Wi,Wo={};Object.defineProperty(U5=Wo,"__esModule",{value:!0}),U5.right=U5.left=U5.flap=U5.Functor=U5.Bifunctor=U5.URI=U5.bimap=U5.mapLeft=U5.map=U5.separated=void 0,U9=function(t,n){return{left:t,right:n}},U5.separated=U9,U8=function(t,n){return(0,US.pipe)(t,(0,U5.map)(n))},U6=function(t,n){return(0,US.pipe)(t,(0,U5.mapLeft)(n))},U7=function(t,n,r){return(0,US.pipe)(t,(0,U5.bimap)(n,r))},We=function(t){return function(n){return(0,U5.separated)((0,U5.left)(n),t((0,U5.right)(n)))}},U5.map=We,Wt=function(t){return function(n){return(0,U5.separated)(t((0,U5.left)(n)),(0,U5.right)(n))}},U5.mapLeft=Wt,Wn=function(t,n){return function(r){return(0,U5.separated)(t((0,U5.left)(r)),n((0,U5.right)(r)))}},U5.bimap=Wn,U5.URI="Separated",U5.Bifunctor={URI:U5.URI,mapLeft:U6,bimap:U7},U5.Functor={URI:U5.URI,map:U8},U5.flap=(0,UY.flap)(U5.Functor),Wr=function(t){return t.left},U5.left=Wr,Wi=function(t){return t.right},U5.right=Wi;var Wa={},Wu=w&&w.__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]}),Ws=w&&w.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),Wc=w&&w.__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)&&Wu(n,t,r);return Ws(n,t),n};Object.defineProperty(Wa,"__esModule",{value:!0}),Wa.filterE=Wa.witherDefault=Wa.wiltDefault=void 0;var Wl=Wc(Uw);Wa.wiltDefault=function(t,n){return function(r){var i=t.traverse(r);return function(t,o){return r.map(i(t,o),n.separate)}}},Wa.witherDefault=function(t,n){return function(r){var i=t.traverse(r);return function(t,o){return r.map(i(t,o),n.compact)}}},Wa.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?Wl.some(r):Wl.none})})}}}},Be=Ux,Bt=w&&w.__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]}),Bn=w&&w.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),Br=w&&w.__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)&&Bt(n,t,r);return Bn(n,t),n},Object.defineProperty(Be,"__esModule",{value:!0}),Be.fold=Be.match=Be.foldW=Be.matchW=Be.isRight=Be.isLeft=Be.fromOption=Be.fromPredicate=Be.FromEither=Be.MonadThrow=Be.throwError=Be.ChainRec=Be.Extend=Be.extend=Be.Alt=Be.alt=Be.altW=Be.Bifunctor=Be.mapLeft=Be.bimap=Be.Traversable=Be.sequence=Be.traverse=Be.Foldable=Be.reduceRight=Be.foldMap=Be.reduce=Be.Monad=Be.Chain=Be.chain=Be.chainW=Be.Applicative=Be.Apply=Be.ap=Be.apW=Be.Pointed=Be.of=Be.Functor=Be.map=Be.getAltValidation=Be.getApplicativeValidation=Be.getWitherable=Be.getFilterable=Be.getCompactable=Be.getSemigroup=Be.getEq=Be.getShow=Be.URI=Be.right=Be.left=void 0,Be.getValidation=Be.getValidationMonoid=Be.getValidationSemigroup=Be.getApplyMonoid=Be.getApplySemigroup=Be.either=Be.stringifyJSON=Be.parseJSON=Be.sequenceArray=Be.traverseArray=Be.traverseArrayWithIndex=Be.traverseReadonlyArrayWithIndex=Be.traverseReadonlyNonEmptyArrayWithIndex=Be.ApT=Be.apSW=Be.apS=Be.bindW=Be.bind=Be.bindTo=Be.Do=Be.exists=Be.elem=Be.toError=Be.toUnion=Be.chainNullableK=Be.fromNullableK=Be.tryCatchK=Be.tryCatch=Be.fromNullable=Be.orElse=Be.orElseW=Be.swap=Be.filterOrElseW=Be.filterOrElse=Be.chainOptionK=Be.fromOptionK=Be.duplicate=Be.flatten=Be.flattenW=Be.chainFirstW=Be.chainFirst=Be.apSecondW=Be.apSecond=Be.apFirstW=Be.apFirst=Be.flap=Be.getOrElse=Be.getOrElseW=void 0,Bi=Br(Uw),Be.left=Bi.left,Be.right=Bi.right,Bo=function(t,n){return(0,US.pipe)(t,(0,Be.map)(n))},Ba=function(t,n){return(0,US.pipe)(t,(0,Be.ap)(n))},Bu=function(t,n){return(0,US.pipe)(t,(0,Be.chain)(n))},Bs=function(t,n,r){return(0,US.pipe)(t,(0,Be.reduce)(n,r))},Bc=function(t){return function(n,r){var i=(0,Be.foldMap)(t);return(0,US.pipe)(n,i(r))}},Bl=function(t,n,r){return(0,US.pipe)(t,(0,Be.reduceRight)(n,r))},Bd=function(t){var n=(0,Be.traverse)(t);return function(t,r){return(0,US.pipe)(t,n(r))}},Bf=function(t,n,r){return(0,US.pipe)(t,(0,Be.bimap)(n,r))},Bp=function(t,n){return(0,US.pipe)(t,(0,Be.mapLeft)(n))},Bh=function(t,n){return(0,US.pipe)(t,(0,Be.alt)(n))},Bm=function(t,n){return(0,US.pipe)(t,(0,Be.extend)(n))},Bg=function(t,n){return(0,UZ.tailRec)(n(t),function(t){return(0,Be.isLeft)(t)?(0,Be.right)((0,Be.left)(t.left)):(0,Be.isLeft)(t.right)?(0,Be.left)(n(t.right.left)):(0,Be.right)((0,Be.right)(t.right.right))})},Be.URI="Either",By=function(t,n){return{show:function(r){return(0,Be.isLeft)(r)?"left(".concat(t.show(r.left),")"):"right(".concat(n.show(r.right),")")}}},Be.getShow=By,Bv=function(t,n){return{equals:function(r,i){return r===i||((0,Be.isLeft)(r)?(0,Be.isLeft)(i)&&t.equals(r.left,i.left):(0,Be.isRight)(i)&&n.equals(r.right,i.right))}}},Be.getEq=Bv,Bb=function(t){return{concat:function(n,r){return(0,Be.isLeft)(r)?n:(0,Be.isLeft)(n)?r:(0,Be.right)(t.concat(n.right,r.right))}}},Be.getSemigroup=Bb,Bx=function(t){var n=(0,Be.left)(t.empty);return{URI:Be.URI,_E:void 0,compact:function(t){return(0,Be.isLeft)(t)?t:"None"===t.right._tag?n:(0,Be.right)(t.right.value)},separate:function(t){return(0,Be.isLeft)(t)?(0,Wo.separated)(t,t):(0,Be.isLeft)(t.right)?(0,Wo.separated)((0,Be.right)(t.right.left),n):(0,Wo.separated)(n,(0,Be.right)(t.right.right))}}},Be.getCompactable=Bx,BM=function(t){var n=(0,Be.left)(t.empty),r=(0,Be.getCompactable)(t),i=r.compact,o=r.separate,a=function(t,r){return(0,Be.isLeft)(t)||r(t.right)?t:n},u=function(t,r){return(0,Be.isLeft)(t)?(0,Wo.separated)(t,t):r(t.right)?(0,Wo.separated)(n,(0,Be.right)(t.right)):(0,Wo.separated)((0,Be.right)(t.right),n)};return{URI:Be.URI,_E:void 0,map:Bo,compact:i,separate:o,filter:a,filterMap:function(t,r){if((0,Be.isLeft)(t))return t;var i=r(t.right);return"None"===i._tag?n:(0,Be.right)(i.value)},partition:u,partitionMap:function(t,r){if((0,Be.isLeft)(t))return(0,Wo.separated)(t,t);var i=r(t.right);return(0,Be.isLeft)(i)?(0,Wo.separated)((0,Be.right)(i.left),n):(0,Wo.separated)(n,(0,Be.right)(i.right))}}},Be.getFilterable=BM,BT=function(t){var n=(0,Be.getFilterable)(t),r=(0,Be.getCompactable)(t);return{URI:Be.URI,_E:void 0,map:Bo,compact:n.compact,separate:n.separate,filter:n.filter,filterMap:n.filterMap,partition:n.partition,partitionMap:n.partitionMap,traverse:Bd,sequence:Be.sequence,reduce:Bs,foldMap:Bc,reduceRight:Bl,wither:(0,Wa.witherDefault)(Be.Traversable,r),wilt:(0,Wa.wiltDefault)(Be.Traversable,r)}},Be.getWitherable=BT,BS=function(t){return{URI:Be.URI,_E:void 0,map:Bo,ap:function(n,r){return(0,Be.isLeft)(n)?(0,Be.isLeft)(r)?(0,Be.left)(t.concat(n.left,r.left)):n:(0,Be.isLeft)(r)?r:(0,Be.right)(n.right(r.right))},of:Be.of}},Be.getApplicativeValidation=BS,Bw=function(t){return{URI:Be.URI,_E:void 0,map:Bo,alt:function(n,r){if((0,Be.isRight)(n))return n;var i=r();return(0,Be.isLeft)(i)?(0,Be.left)(t.concat(n.left,i.left)):i}}},Be.getAltValidation=Bw,BI=function(t){return function(n){return(0,Be.isLeft)(n)?n:(0,Be.right)(t(n.right))}},Be.map=BI,Be.Functor={URI:Be.URI,map:Bo},Be.of=Be.right,Be.Pointed={URI:Be.URI,of:Be.of},B_=function(t){return function(n){return(0,Be.isLeft)(n)?n:(0,Be.isLeft)(t)?t:(0,Be.right)(n.right(t.right))}},Be.apW=B_,Be.ap=Be.apW,Be.Apply={URI:Be.URI,map:Bo,ap:Ba},Be.Applicative={URI:Be.URI,map:Bo,ap:Ba,of:Be.of},BO=function(t){return function(n){return(0,Be.isLeft)(n)?n:t(n.right)}},Be.chainW=BO,Be.chain=Be.chainW,Be.Chain={URI:Be.URI,map:Bo,ap:Ba,chain:Bu},Be.Monad={URI:Be.URI,map:Bo,ap:Ba,of:Be.of,chain:Bu},Bk=function(t,n){return function(r){return(0,Be.isLeft)(r)?t:n(t,r.right)}},Be.reduce=Bk,BC=function(t){return function(n){return function(r){return(0,Be.isLeft)(r)?t.empty:n(r.right)}}},Be.foldMap=BC,BN=function(t,n){return function(r){return(0,Be.isLeft)(r)?t:n(r.right,t)}},Be.reduceRight=BN,Be.Foldable={URI:Be.URI,reduce:Bs,foldMap:Bc,reduceRight:Bl},Bj=function(t){return function(n){return function(r){return(0,Be.isLeft)(r)?t.of((0,Be.left)(r.left)):t.map(n(r.right),Be.right)}}},Be.traverse=Bj,BE=function(t){return function(n){return(0,Be.isLeft)(n)?t.of((0,Be.left)(n.left)):t.map(n.right,Be.right)}},Be.sequence=BE,Be.Traversable={URI:Be.URI,map:Bo,reduce:Bs,foldMap:Bc,reduceRight:Bl,traverse:Bd,sequence:Be.sequence},BR=function(t,n){return function(r){return(0,Be.isLeft)(r)?(0,Be.left)(t(r.left)):(0,Be.right)(n(r.right))}},Be.bimap=BR,BD=function(t){return function(n){return(0,Be.isLeft)(n)?(0,Be.left)(t(n.left)):n}},Be.mapLeft=BD,Be.Bifunctor={URI:Be.URI,bimap:Bf,mapLeft:Bp},BA=function(t){return function(n){return(0,Be.isLeft)(n)?t():n}},Be.altW=BA,Be.alt=Be.altW,Be.Alt={URI:Be.URI,map:Bo,alt:Bh},BL=function(t){return function(n){return(0,Be.isLeft)(n)?n:(0,Be.right)(t(n))}},Be.extend=BL,Be.Extend={URI:Be.URI,map:Bo,extend:Bm},Be.ChainRec={URI:Be.URI,map:Bo,ap:Ba,chain:Bu,chainRec:Bg},Be.throwError=Be.left,Be.MonadThrow={URI:Be.URI,map:Bo,ap:Ba,of:Be.of,chain:Bu,throwError:Be.throwError},Be.FromEither={URI:Be.URI,fromEither:US.identity},Be.fromPredicate=(0,UH.fromPredicate)(Be.FromEither),Be.fromOption=(0,UH.fromOption)(Be.FromEither),Be.isLeft=Bi.isLeft,Be.isRight=Bi.isRight,BP=function(t,n){return function(r){return(0,Be.isLeft)(r)?t(r.left):n(r.right)}},Be.matchW=BP,Be.foldW=Be.matchW,Be.match=Be.matchW,Be.fold=Be.match,BF=function(t){return function(n){return(0,Be.isLeft)(n)?t(n.left):n.right}},Be.getOrElseW=BF,Be.getOrElse=Be.getOrElseW,Be.flap=(0,UY.flap)(Be.Functor),Be.apFirst=(0,UT.apFirst)(Be.Apply),Be.apFirstW=Be.apFirst,Be.apSecond=(0,UT.apSecond)(Be.Apply),Be.apSecondW=Be.apSecond,Be.chainFirst=(0,UG.chainFirst)(Be.Chain),Be.chainFirstW=Be.chainFirst,Be.flattenW=(0,Be.chainW)(US.identity),Be.flatten=Be.flattenW,Be.duplicate=(0,Be.extend)(US.identity),Be.fromOptionK=(0,UH.fromOptionK)(Be.FromEither),Be.chainOptionK=(0,UH.chainOptionK)(Be.FromEither,Be.Chain),Be.filterOrElse=(0,UH.filterOrElse)(Be.FromEither,Be.Chain),Be.filterOrElseW=Be.filterOrElse,Bz=function(t){return(0,Be.isLeft)(t)?(0,Be.right)(t.left):(0,Be.left)(t.right)},Be.swap=Bz,BU=function(t){return function(n){return(0,Be.isLeft)(n)?t(n.left):n}},Be.orElseW=BU,Be.orElse=Be.orElseW,BW=function(t){return function(n){return null==n?(0,Be.left)(t):(0,Be.right)(n)}},Be.fromNullable=BW,BB=function(t,n){try{return(0,Be.right)(t())}catch(r){return(0,Be.left)(n(r))}},Be.tryCatch=BB,BV=function(t,n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return(0,Be.tryCatch)(function(){return t.apply(void 0,r)},n)}},Be.tryCatchK=BV,B$=function(t){var n=(0,Be.fromNullable)(t);return function(t){return(0,US.flow)(t,n)}},Be.fromNullableK=B$,BK=function(t){var n=(0,Be.fromNullableK)(t);return function(t){return(0,Be.chain)(n(t))}},Be.chainNullableK=BK,Be.toUnion=(0,Be.foldW)(US.identity,US.identity),Be.toError=function(t){return t instanceof Error?t:Error(String(t))},Be.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,Be.isLeft)(i)&&n.equals(r,i.right)}},BY=function(t){return function(n){return!(0,Be.isLeft)(n)&&t(n.right)}},Be.exists=BY,Be.Do=(0,Be.of)(Bi.emptyRecord),Be.bindTo=(0,UY.bindTo)(Be.Functor),Be.bind=(0,UG.bind)(Be.Chain),Be.bindW=Be.bind,Be.apS=(0,UT.apS)(Be.Apply),Be.apSW=Be.apS,Be.ApT=(0,Be.of)(Bi.emptyReadonlyArray),Bq=function(t){return function(n){var r=t(0,Bi.head(n));if((0,Be.isLeft)(r))return r;for(var i=[r.right],o=1;o<n.length;o++){var a=t(o,n[o]);if((0,Be.isLeft)(a))return a;i.push(a.right)}return(0,Be.right)(i)}},Be.traverseReadonlyNonEmptyArrayWithIndex=Bq,BG=function(t){var n=(0,Be.traverseReadonlyNonEmptyArrayWithIndex)(t);return function(t){return Bi.isNonEmpty(t)?n(t):Be.ApT}},Be.traverseReadonlyArrayWithIndex=BG,Be.traverseArrayWithIndex=Be.traverseReadonlyArrayWithIndex,BZ=function(t){return(0,Be.traverseReadonlyArrayWithIndex)(function(n,r){return t(r)})},Be.traverseArray=BZ,Be.sequenceArray=(0,Be.traverseArray)(US.identity),Be.parseJSON=function(t,n){return(0,Be.tryCatch)(function(){return JSON.parse(t)},n)},BQ=function(t,n){return(0,Be.tryCatch)(function(){var n=JSON.stringify(t);if("string"!=typeof n)throw Error("Converting unsupported structure to JSON");return n},n)},Be.stringifyJSON=BQ,Be.either={URI:Be.URI,map:Bo,of:Be.of,ap:Ba,chain:Bu,reduce:Bs,foldMap:Bc,reduceRight:Bl,traverse:Bd,sequence:Be.sequence,bimap:Bf,mapLeft:Bp,alt:Bh,extend:Bm,chainRec:Bg,throwError:Be.throwError},Be.getApplySemigroup=(0,UT.getApplySemigroup)(Be.Apply),Be.getApplyMonoid=(0,UM.getApplicativeMonoid)(Be.Applicative),BH=function(t,n){return(0,UT.getApplySemigroup)((0,Be.getApplicativeValidation)(t))(n)},Be.getValidationSemigroup=BH,BJ=function(t,n){return(0,UM.getApplicativeMonoid)((0,Be.getApplicativeValidation)(t))(n)},Be.getValidationMonoid=BJ,Be.getValidation=function(t){var n=(0,Be.getApplicativeValidation)(t).ap,r=(0,Be.getAltValidation)(t).alt;return{URI:Be.URI,_E:void 0,map:Bo,of:Be.of,chain:Bu,bimap:Bf,mapLeft:Bp,reduce:Bs,foldMap:Bc,reduceRight:Bl,extend:Bm,traverse:Bd,sequence:Be.sequence,chainRec:Bg,throwError:Be.throwError,ap:n,alt:r}};var Wd=globalThis&&globalThis.__extends||(BX=function(t,n){return(BX=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}BX(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}),Wf=globalThis&&globalThis.__assign||function(){return(Wf=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)},Wp=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))},Wh=function(t,n,r){return n5([{value:t,context:n,message:r}])},Wm=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 mz(o)?o:n.validate(o.right,r)},this.encode===Wg&&n.encode===Wg?Wg: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}(),Wg=function(t){return t};function Wy(t){return t.displayName||t.name||"<function".concat(t.length,">")}function Wv(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 Wb(t,n){for(var r=n.length,i=0;i<r;i++)t.push(n[i])}var Wx=Object.prototype.hasOwnProperty;function WM(t){return Object.keys(t).map(function(n){return"".concat(n,": ").concat(t[n].name)}).join(", ")}function WT(t){for(var n=0;n<t.length;n++)if(t[n].encode!==Wg)return!1;return!0}function WS(t){return"{ ".concat(WM(t)," }")}function Ww(t){return"Partial<".concat(t,">")}function WI(t){if(WR(t)){var n,r,i=t.value;if(WG.is(i))return(n={})[i]=null,n}else{if(r=t,"KeyofType"===r._tag)return t.keys;if(WA(t)){var o=t.types.map(function(t){return WI(t)});return o.some(WB.is)?void 0:Object.assign.apply(Object,Wp([{}],o,!1))}}}function W_(t){return"("+t.map(function(t){return t.name}).join(" | ")+")"}function WO(t,n){for(var r=!0,i=!0,o=!W3.is(t),a=0;a<n.length;a++){var u=n[a];u!==t&&(r=!1),W3.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)(!Wx.call(s,l)||o||u[l]!==t[l])&&(s[l]=u[l])}return s}function Wk(t,n){for(var r=Object.getOwnPropertyNames(t),i=!1,o={},a=0;a<r.length;a++){var u=r[a];Wx.call(n,u)?o[u]=t[u]:i=!0}return i?o:t}function WC(t){return t.length>0}var WN={};function Wj(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 WE(t){return"AnyType"===t._tag}function WR(t){return"LiteralType"===t._tag}function WD(t){return"InterfaceType"===t._tag}function WA(t){return"UnionType"===t._tag}var WL=[];function WP(t){if(-1!==WL.indexOf(t))return WN;if(WD(t)||"StrictType"===(n=t)._tag){var n,r,i,o,a,u=WN;for(var s in t.props){var c=t.props[s];WR(c)&&(u===WN&&(u={}),u[s]=[c.value])}return u}if("ExactType"===t._tag||"RefinementType"===t._tag)return WP(t.type);if("IntersectionType"===t._tag)return t.types.reduce(function(t,n){return function(t,n){if(t===WN)return n;if(n===WN)return t;var r=Object.assign({},t);for(var i in n)if(Wx.call(t,i)){var o=Wj(t[i],n[i]);if(WC(o))r[i]=o;else{r=WN;break}}else r[i]=n[i];return r}(t,WP(n))},WN);if(WA(t))return t.types.slice(1).reduce(function(t,n){return function(t,n){if(t===WN||n===WN)return WN;var r=WN;for(var i in t)Wx.call(n,i)&&0===Wj(t[i],n[i]).length&&(r===WN&&(r={}),r[i]=t[i].concat(n[i]));return r}(t,WP(n))},WP(t.types[0]));if("RecursiveType"===t._tag){WL.push(t);var l=WP(t.type);return WL.pop(),l}return WN}function WF(t){var n=WP(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=WP(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 Wz=function(t){function n(){var n=t.call(this,"null",function(t){return null===t},function(t,r){return n.is(t)?n9(t):Wh(t,r)},Wg)||this;return n._tag="NullType",n}return Wd(n,t),n}(Wm),WU=new Wz,WW=function(t){function n(){var n=t.call(this,"undefined",function(t){return void 0===t},function(t,r){return n.is(t)?n9(t):Wh(t,r)},Wg)||this;return n._tag="UndefinedType",n}return Wd(n,t),n}(Wm),WB=new WW,WV=function(t){function n(){var n=t.call(this,"void",WB.is,WB.validate,Wg)||this;return n._tag="VoidType",n}return Wd(n,t),n}(Wm),W$=new WV,WK=function(t){function n(){var n=t.call(this,"unknown",function(t){return!0},n9,Wg)||this;return n._tag="UnknownType",n}return Wd(n,t),n}(Wm),WY=new WK,Wq=function(t){function n(){var n=t.call(this,"string",function(t){return"string"==typeof t},function(t,r){return n.is(t)?n9(t):Wh(t,r)},Wg)||this;return n._tag="StringType",n}return Wd(n,t),n}(Wm),WG=new Wq,WZ=function(t){function n(){var n=t.call(this,"number",function(t){return"number"==typeof t},function(t,r){return n.is(t)?n9(t):Wh(t,r)},Wg)||this;return n._tag="NumberType",n}return Wd(n,t),n}(Wm),WQ=new WZ,WH=function(t){function n(){var n=t.call(this,"bigint",function(t){return"bigint"==typeof t},function(t,r){return n.is(t)?n9(t):Wh(t,r)},Wg)||this;return n._tag="BigIntType",n}return Wd(n,t),n}(Wm),WJ=new WH,WX=function(t){function n(){var n=t.call(this,"boolean",function(t){return"boolean"==typeof t},function(t,r){return n.is(t)?n9(t):Wh(t,r)},Wg)||this;return n._tag="BooleanType",n}return Wd(n,t),n}(Wm),W0=new WX,W1=function(t){function n(){var n=t.call(this,"UnknownArray",Array.isArray,function(t,r){return n.is(t)?n9(t):Wh(t,r)},Wg)||this;return n._tag="AnyArrayType",n}return Wd(n,t),n}(Wm),W2=new W1,W4=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)?n9(t):Wh(t,r)},Wg)||this;return n._tag="AnyDictionaryType",n}return Wd(n,t),n}(Wm),W3=new W4,W5=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 Wd(n,t),n}(Wm);function W9(t,n){void 0===n&&(n=JSON.stringify(t));var r=function(n){return n===t};return new W5(n,r,function(n,i){return r(n)?n9(t):Wh(n,i)},Wg,t)}var W8=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 Wd(n,t),n}(Wm),W6=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 Wd(n,t),n}(Wm);function W7(t,n,r){return Vw(t,n,r)}var Be,Bt,Bn,Br,Bi,Bo,Ba,Bu,Bs,Bc,Bl,Bd,Bf,Bp,Bh,Bm,Bg,By,Bv,Bb,Bx,BM,BT,BS,Bw,BI,B_,BO,Bk,BC,BN,Bj,BE,BR,BD,BA,BL,BP,BF,Bz,BU,BW,BB,BV,B$,BK,BY,Bq,BG,BZ,BQ,BH,BJ,BX,B0,B1,B2=Vw(WQ,B1=function(t){return Number.isInteger(t)},"Int"),B4=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 Wd(n,t),n}(Wm);function B3(t,n){var r,i=function(){return r||((r=n(o)).name=t),r},o=new B4(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(B4.prototype,"type",{get:function(){return this.runDefinition()},enumerable:!0,configurable:!0});var 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="ArrayType",u}return Wd(n,t),n}(Wm);function B9(t,n){return void 0===n&&(n="Array<".concat(t.name,">")),new B5(n,function(n){return W2.is(n)&&n.every(t.is)},function(n,r){var i=W2.validate(n,r);if(mz(i))return i;for(var o=i.right,a=o.length,u=o,s=[],c=0;c<a;c++){var l=o[c],d=t.validate(l,Wv(r,String(c),t,l));if(mz(d))Wb(s,d.left);else{var f=d.right;f!==l&&(u===o&&(u=o.slice()),u[c]=f)}}return s.length>0?n5(s):n9(u)},t.encode===Wg?Wg:function(n){return n.map(t.encode)},t)}var B8=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 Wd(n,t),n}(Wm);function B6(t,n){void 0===n&&(n=WS(t));var r=Object.keys(t),i=r.map(function(n){return t[n]}),o=r.length;return new B8(n,function(t){if(W3.is(t)){for(var n=0;n<o;n++){var a=r[n],u=t[a];if(void 0===u&&!Wx.call(t,a)||!i[n].is(u))return!1}return!0}return!1},function(t,n){var a=W3.validate(t,n);if(mz(a))return a;for(var u=a.right,s=u,c=[],l=0;l<o;l++){var d=r[l],f=s[d],p=i[l],h=p.validate(f,Wv(n,d,p,f));if(mz(h))Wb(c,h.left);else{var m=h.right;m===f&&(void 0!==m||Wx.call(s,d))||(s===u&&(s=Wf({},u)),s[d]=m)}}return c.length>0?n5(c):n9(s)},WT(i)?Wg:function(t){for(var n=Wf({},t),a=0;a<o;a++){var u=r[a],s=i[a].encode;s!==Wg&&(n[u]=s(t[u]))}return n},t)}var B7=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 Wd(n,t),n}(Wm),Ve=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 Wd(n,t),n}(Wm);function Vt(t,n,r){var i,o,a,u,s,c,l,d,f=WI(t);return f?(i=Object.keys(f),void 0===(u=r)&&(u="{ [K in ".concat(t.name,"]: ").concat(n.name," }")),s=i.length,new Ve(u,function(t){return W3.is(t)&&i.every(function(r){return n.is(t[r])})},function(t,r){var o=W3.validate(t,r);if(mz(o))return o;for(var a=o.right,u={},c=[],l=!1,d=0;d<s;d++){var f=i[d],p=a[f],h=n.validate(p,Wv(r,f,n,p));if(mz(h))Wb(c,h.left);else{var m=h.right;l=l||m!==p,u[f]=m}}return c.length>0?n5(c):n9(l||Object.keys(a).length!==s?u:a)},n.encode===Wg?Wg: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===(d=r)&&(d="{ [K in ".concat(c.name,"]: ").concat(n.name," }")),new Ve(d,function(t){return W3.is(t)?Object.keys(t).every(function(r){return c.is(r)&&n.is(t[r])}):WE(n)&&Array.isArray(t)},function(t,r){if(W3.is(t)){for(var i={},o=[],a=Object.keys(t),u=a.length,s=!1,l=0;l<u;l++){var d=a[l],f=t[d],p=c.validate(d,Wv(r,d,c,d));if(mz(p))Wb(o,p.left);else{var h=p.right;s=s||h!==d,d=h;var m=n.validate(f,Wv(r,d,n,f));if(mz(m))Wb(o,m.left);else{var g=m.right;s=s||g!==f,i[d]=g}}}return o.length>0?n5(o):n9(s?i:t)}return WE(n)&&Array.isArray(t)?n9(t):Wh(t,r)},c.encode===Wg&&n.encode===Wg?Wg: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 Vn=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 Wd(n,t),n}(Wm);function Vr(t,n){void 0===n&&(n=W_(t));var r=WF(t);if(void 0===r||!(t.length>0))return new Vn(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,Wv(r,String(o),a,n));if(!mz(u))return n9(u.right);Wb(i,u.left)}return n5(i)},WT(t)?Wg: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 Vh(n,function(n){if(W3.is(n)){var r=u(n[i]);return void 0!==r&&t[r].is(n)}return!1},function(n,r){var o=W3.validate(n,r);if(mz(o))return o;var a=o.right,s=u(a[i]);if(void 0===s)return Wh(n,r);var c=t[s];return c.validate(a,Wv(r,String(s),c,a))},WT(t)?Wg: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 Vi=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.types=a,u._tag="IntersectionType",u}return Wd(n,t),n}(Wm),Vo=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 Wd(n,t),n}(Wm),Va=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.type=a,u._tag="ReadonlyType",u}return Wd(n,t),n}(Wm),Vu=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 Wd(n,t),n}(Wm);function Vs(t,n){void 0===n&&(n="ReadonlyArray<".concat(t.name,">"));var r=B9(t);return new Vu(n,r.is,r.validate,r.encode,t)}var Vc=function(t,n){return Vd(B6(t),n)},Vl=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.type=a,u._tag="ExactType",u}return Wd(n,t),n}(Wm);function Vd(t,n){void 0===n&&(n=WD(i=t)?"{| ".concat(WM(i.props)," |}"):(r=i,"PartialType"===r._tag)?Ww("{| ".concat(WM(i.props)," |}")):"Exact<".concat(i.name,">"));var r,i,o=function t(n){switch(n._tag){case"RefinementType":case"ReadonlyType":return t(n.type);case"InterfaceType":case"StrictType":case"PartialType":return n.props;case"IntersectionType":return n.types.reduce(function(n,r){return Object.assign(n,t(r))},{})}}(t);return new Vl(n,t.is,function(n,r){var i=W3.validate(n,r);if(mz(i))return i;var a=t.validate(n,r);return mz(a)?a:n9(Wk(a.right,o))},function(n){return t.encode(Wk(n,o))},t)}var Vf=function(t){function n(){var n=t.call(this,"Function",function(t){return"function"==typeof t},function(t,r){return n.is(t)?n9(t):Wh(t,r)},Wg)||this;return n._tag="FunctionType",n}return Wd(n,t),n}(Wm),Vp=new Vf,Vh=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 Wd(n,t),n}(Vn),Vm=function(t,n,r){void 0===r&&(r=W_(n));var i=Vr(n,r);return i instanceof Vh?i:(console.warn("[io-ts] Cannot build a tagged union for ".concat(r,", returning a de-optimized union")),new Vh(r,i.is,i.validate,i.encode,n,t))},Vg=function(t,n){return{value:t,context:n}},Vy=function(t){return[{key:"",type:t}]},Vv=function(t){function n(){var n=t.call(this,"never",function(t){return!1},function(t,n){return Wh(t,n)},function(){throw Error("cannot encode never")})||this;return n._tag="NeverType",n}return Wd(n,t),n}(Wm),Vb=new Vv,Vx=function(t){function n(){var n=t.call(this,"any",function(t){return!0},n9,Wg)||this;return n._tag="AnyType",n}return Wd(n,t),n}(Wm),VM=new Vx,VT=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)?n9(t):Wh(t,r)},Wg)||this;return n._tag="ObjectType",n}return Wd(n,t),n}(Wm),VS=new VT;function Vw(t,n,r){return void 0===r&&(r="(".concat(t.name," | ").concat(Wy(n),")")),new W6(r,function(r){return t.is(r)&&n(r)},function(r,i){var o=t.validate(r,i);if(mz(o))return o;var a=o.right;return n(a)?n9(a):Wh(a,i)},t.encode,t,n)}var VI=Vw(WQ,Number.isInteger,"Integer"),V_=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 Wd(n,t),n}(Wm);function VO(t){return t}let Vk=Object.freeze(Object.defineProperty({__proto__:null,AnyArrayType:W1,AnyDictionaryType:W4,AnyType:Vx,Array:W2,ArrayType:B5,BigIntType:WH,BooleanType:WX,Dictionary:W3,DictionaryType:Ve,ExactType:Vl,Function:Vp,FunctionType:Vf,Int:B2,Integer:VI,InterfaceType:B8,IntersectionType:Vi,KeyofType:W8,LiteralType:W5,NeverType:Vv,NullType:Wz,NumberType:WZ,ObjectType:VT,PartialType:B7,ReadonlyArrayType:Vu,ReadonlyType:Va,RecursiveType:B4,RefinementType:W6,StrictType:V_,StringType:Wq,TaggedUnionType:Vh,TupleType:Vo,Type:Wm,UndefinedType:WW,UnionType:Vn,UnknownArray:W2,UnknownRecord:W3,UnknownType:WK,VoidType:WV,alias:function(t){return function(){return t}},any:VM,appendContext:Wv,array:B9,bigint:WJ,boolean:W0,brand:W7,clean:VO,dictionary:Vt,emptyTags:WN,exact:Vd,failure:Wh,failures:n5,getContextEntry:function(t,n){return{key:t,type:n}},getDefaultContext:Vy,getDomainKeys:WI,getFunctionName:Wy,getIndex:WF,getTags:WP,getValidationError:Vg,identity:Wg,interface:B6,intersection:function(t,n){void 0===n&&(n="(".concat(t.map(function(t){return t.name}).join(" & "),")"));var r=t.length;return new Vi(n,function(n){return t.every(function(t){return t.is(n)})},0===t.length?n9:function(n,i){for(var o=[],a=[],u=0;u<r;u++){var s=t[u],c=s.validate(n,Wv(i,String(u),s,n));mz(c)?Wb(a,c.left):o.push(c.right)}return a.length>0?n5(a):n9(WO(n,o))},0===t.length?Wg:function(n){return WO(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 WG.is(n)&&Wx.call(t,n)};return new W8(n,r,function(t,n){return r(t)?n9(t):Wh(t,n)},Wg,t)},literal:W9,mergeAll:WO,never:Vb,null:WU,nullType:WU,number:WQ,object:VS,partial:function(t,n){void 0===n&&(n=Ww(WS(t)));var r=Object.keys(t),i=r.map(function(n){return t[n]}),o=r.length;return new B7(n,function(n){if(W3.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=W3.validate(n,i);if(mz(a))return a;for(var u=a.right,s=u,c=[],l=0;l<o;l++){var d=r[l],f=s[d],p=t[d],h=p.validate(f,Wv(i,d,p,f));if(mz(h))void 0!==f&&Wb(c,h.left);else{var m=h.right;m!==f&&(s===u&&(s=Wf({},u)),s[d]=m)}}return c.length>0?n5(c):n9(s)},WT(i)?Wg:function(t){for(var n=Wf({},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 Va(n,t.is,t.validate,t.encode,t)},readonlyArray:Vs,record:Vt,recursion:B3,refinement:Vw,strict:Vc,string:WG,success:n9,taggedUnion:Vm,tuple:function(t,n){void 0===n&&(n="[".concat(t.map(function(t){return t.name}).join(", "),"]"));var r=t.length;return new Vo(n,function(n){return W2.is(n)&&n.length===r&&t.every(function(t,r){return t.is(n[r])})},function(n,i){var o=W2.validate(n,i);if(mz(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],d=t[c],f=d.validate(l,Wv(i,String(c),d,l));if(mz(f))Wb(s,f.left);else{var p=f.right;p!==l&&(u===a&&(u=a.slice()),u[c]=p)}}return s.length>0?n5(s):n9(u)},WT(t)?Wg:function(n){return t.map(function(t,r){return t.encode(n[r])})},t)},type:B6,undefined:WB,union:Vr,unknown:WY,void:W$,voidType:W$},Symbol.toStringTag,{value:"Module"})),VC=I(Vk);var VN={};Object.defineProperty(VN,"__esModule",{value:!0}),VN.ContentPath=void 0,VN.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 Vj={},VE={};Object.defineProperty(VE,"__esModule",{value:!0}),VE.getAssetOrThrow=void 0;let VR=t=>n=>{let r=t[n];if(!r)throw Error(`Missing asset with id '${n}'!`);return r};VE.getAssetOrThrow=VR;var VD={};Object.defineProperty(VD,"__esModule",{value:!0}),VD.getEmbedOrThrow=void 0;let VA=t=>n=>{let r=t[n];if(!r)throw Error(`Missing embed with url '${n}'`);return r};VD.getEmbedOrThrow=VA;var VL={},VP={};let VF=I(nH);function Vz(t,n,r){return void 0===r&&(r=t.name),new Wm(r,t.is,t.validate,function(r){return n(t.encode(r))})}let VU=Object.freeze(Object.defineProperty({__proto__:null,mapOutput:Vz},Symbol.toStringTag,{value:"Module"}));var VW,VB,VV,V$=Vw(WG,VB=function(t){return t.length>0},"NonEmptyString");function VK(t,n){void 0===n&&(n="NonEmptyArray<"+t.name+">");var r=B9(t);return new Wm(n,function(t){return r.is(t)&&at(t)},function(t,n){return nG(r.validate(t,n),mS(function(r){var i=af(r);return p8(i)?Wh(t,n):n9(i.value)}))},function(t){return r.encode(t)})}function VY(t,n,r){void 0===r&&(r="Set<"+t.name+">");var i=B9(t),o=Du(n),a=De(n);return new Wm(r,function(n){return n instanceof Set&&Em(t.is)(n)},function(t,n){return nG(i.validate(t,n),mS(function(r){var i=a(r);return i.size!==r.length?Wh(t,n):n9(i)}))},function(t){return i.encode(o(t))})}function Vq(t,n){return new Wm(t,n,function(t,r){return n(t)?n9(t):Wh(t,r)},Wg)}var VG=Vq("Date",function(t){return t instanceof Date}),VZ=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))},VQ=function(t,n){return{get:t,reverseGet:n}},VH=function(t){return V1(t.get,nV(t.reverseGet,nF))},VJ=function(t){return $n(nV(t.get,n2),t.reverseGet)},VX=function(t){return $u(nV(t.get,n2),nV(t.reverseGet,nF))},V0=function(t){return $p(function(n){return function(r){return function(i){return n.map(r(t.get(i)),function(n){return t.reverseGet(n)})}}})},V1=function(t,n){return{get:t,set:n}},V2=function(t){return $u(nV(t.get,n2),t.set)},V4=function(t){return $p(function(n){return function(r){return function(i){return n.map(r(t.get(i)),function(n){return t.set(n)(i)})}}})},V3=function(t){return function(n){return V1(function(r){return t.get(n.get(r))},function(r){return function(i){return n.set(t.set(r)(n.get(i)))(i)}})}},V5=function(t){return function(n){return $n(nV(n.getOption,pj(t.getOption)),nV(t.reverseGet,n.reverseGet))}},V9=function(t){return function(n){return $d($r(t))(V2(n))}},V8=function(){return V1(nP,nF)},V6=function(t){return function(n){return V1(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)}})}},V7=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return function(n){return V1(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}})}},$e=function(t){return function(n){return V1(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)}})}},$t=function(t){return function(n){var r;return nG(n,V3(({at:r=function(t){return V1(function(n){return N$(t,n)},p6(function(){return NU(t)},function(n){return NF(t,n)}))}}).at(t)))}},$n=function(t,n){return{getOption:t,reverseGet:n}},$r=function(t){return $u(t.getOption,function(n){return $o(n)(t)})},$i=function(t){return $p(function(n){return function(r){return function(i){return nG(t.getOption(i),p6(function(){return n.of(i)},function(o){return n.map(r(o),function(n){return $o(n)(t)(i)})}))}}})},$o=function(t){var n;return n=function(){return t},function(t){var r,i,o=(r=t,function(t){return nG(r.getOption(t),pI(function(i){var o=n(i);return o===i?t:r.reverseGet(o)}))});return function(t){return nG(o(t),p7(function(){return t}))}}},$a=function(t){return $n(pi(t),nP)},$u=function(t,n){return{getOption:t,set:n}},$s=function(t){return $p(function(n){return function(r){return function(i){return nG(t.getOption(i),p6(function(){return n.of(i)},function(o){return n.map(r(o),function(n){return t.set(n)(i)})}))}}})},$c=function(t){return function(n){return function(r){return nG(n.getOption(r),pI(function(i){var o=t(i);return o===i?r:n.set(o)(r)}))}}},$l=function(t){return function(n){var r=$c(t)(n);return function(t){return nG(r(t),p7(function(){return t}))}}},$d=function(t){return function(n){return $u(nV(n.getOption,pj(t.getOption)),function(r){return $l(t.set(r))(n)})}},$f=function(t,n,r){if(r[t]===n)return r;var i=VZ([r[0]],r.slice(1),!0);return i[t]=n,i},$p=function(t){return{modifyF:t}};function $h(t){return function(n){return $p(function(r){return function(i){return n.modifyF(r)(t.modifyF(r)(i))}})}}var $m={URI:"Identity",map:function(t,n){return n(t)},of:nP,ap:function(t,n){return t(n)}},$g=function(t){return{index:t}},$y=nV(VH,V3),$v=function(t){return nV(V2,$d(t))},$b=function(t){return nV(V4,$h(t))},$x=function(t){return function(n){return function(r){var i=n.get(r),o=t(i);return i===o?r:n.set(o)(r)}}},$M=function(t){return V9($n(hs,nP))(t)},$T=function(t){var n;return nV(V2,function(n){return nG(n,$d($g(function(t){return $u(function(n){return sl(t,n)},function(n){return function(r){return nG(sl(t,r),p6(function(){return r},function(){return ls(t,n,r)}))}})}).index(t)))})},$S=function(t){var n;return nV(V2,function(n){return nG(n,$d($g(function(t){return $u(function(n){return sl(t,n)},function(n){return function(r){return nG(sl(t,r),p6(function(){return r},function(){return $f(t,n,r)}))}})}).index(t)))})},$w=function(t){var n;return nV(V2,function(n){return nG(n,$d($g(function(t){return $u(function(n){return N$(t,n)},function(n){return function(r){return r[t]===n||p8(N$(t,r))?r:NF(t,n)(r)}})}).index(t)))})},$I=V9($n(nP,n2)),$_=V9($n(pa,n9)),$O=V9($n(function(t){return mz(t)?n2(t.left):n1},n5)),$k=function(t,n){return function(r){return $C(r,t,n)}},$C=function(t,n,r){return V1(nV(t.get,n),nV(r,t.set))},$N="monocle-ts/Lens",$j={URI:$N,compose:function(t,n){return V3(t)(n)}},$E={URI:$N,compose:$j.compose,id:V8};let $R=Object.freeze(Object.defineProperty({__proto__:null,Category:$E,Invariant:{URI:$N,imap:$C},Semigroupoid:$j,URI:$N,asOptional:V2,asTraversal:V4,atKey:$t,component:$e,compose:V3,composeIso:$y,composeLens:V3,composeOptional:$v,composePrism:V9,composeTraversal:$b,filter:function(t){return V9($a(t))},findFirst:function(t){var n;return $v($u(sM(t),function(n){return function(r){return nG(sx(t)(r),p6(function(){return r},function(t){return ls(t,n,r)}))}}))},findFirstNonEmpty:function(t){var n;return $v($u(sM(t),function(n){return function(r){return nG(sx(t)(r),p6(function(){return r},function(t){return $f(t,n,r)}))}}))},fromNullable:$M,id:V8,imap:$k,index:$T,indexNonEmpty:$S,key:$w,left:$O,lens:V1,modify:$x,modifyF:function(t){return function(n){return function(r){return function(i){return nG(r.get(i),n,function(n){return t.map(n,function(t){return r.set(t)(i)})})}}}},prop:V6,props:V7,right:$_,some:$I,traverse:function(t){var n,r;return nV(V4,$h($p(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 $D=function(t){return function(n){return n.modifyF($m)(t)}},$A=function(t){return new $W(t.get,t.reverseGet)},$L=function(t){return new $B(t.get,t.set)},$P=function(t){return new $V(t.getOption,t.reverseGet)},$F=function(t){return new $K(t.getOption,t.set)},$z=function(t){return new $Y(t.modifyF)},$U=function(t,n,r){var i;return r===t[n]?t:Object.assign({},t,((i={})[n]=r,i))},$W=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 $A(VQ(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 $L(VH(this))},t.prototype.asPrism=function(){return $P(VJ(this))},t.prototype.asOptional=function(){return $F(VX(this))},t.prototype.asTraversal=function(){return $z(V0(this))},t.prototype.asFold=function(){var t=this;return new $G(function(){return function(n){return function(r){return n(t.get(r))}}})},t.prototype.asGetter=function(){var t=this;return new $q(function(n){return t.get(n)})},t.prototype.asSetter=function(){var t=this;return new $Z(function(n){return t.modify(n)})},t.prototype.compose=function(t){var n,r;return $A((r=this,VQ(nV(r.get,t.get),nV(t.reverseGet,r.reverseGet))))},t.prototype.composeIso=function(t){return this.compose(t)},t.prototype.composeLens=function(t){return $L(nG(this,VH,V3(t)))},t.prototype.composePrism=function(t){return $P(nG(this,VJ,V5(t)))},t.prototype.composeOptional=function(t){return $F(nG(this,VX,$d(t)))},t.prototype.composeTraversal=function(t){return $z(nG(this,V0,$h(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}(),$B=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 $L(nG(V8(),V6(t)))}},t.fromProps=function(){return function(t){return $L(nG(V8(),V7.apply($R,t)))}},t.fromNullableProp=function(){return function(n,r){return new t(function(t){var i=hs(t[n]);return p8(i)?r:i.value},function(t){return function(r){return $U(r,n,t)}})}},t.prototype.modify=function(t){return $x(t)(this)},t.prototype.asOptional=function(){return $F(V2(this))},t.prototype.asTraversal=function(){return $z(V4(this))},t.prototype.asSetter=function(){var t=this;return new $Z(function(n){return t.modify(n)})},t.prototype.asGetter=function(){var t=this;return new $q(function(n){return t.get(n)})},t.prototype.asFold=function(){var t=this;return new $G(function(){return function(n){return function(r){return n(t.get(r))}}})},t.prototype.compose=function(t){return $L(V3(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 $F(nG(this,V2,$d(t)))},t.prototype.composeTraversal=function(t){return $z(nG(this,V4,$h(t)))},t.prototype.composeSetter=function(t){return this.asSetter().compose(t)},t.prototype.composeIso=function(t){return $L(nG(this,V3(nG(t,VH))))},t.prototype.composePrism=function(t){return $F(V9(t)(this))},t}(),$V=function(){function t(t,n){this.getOption=t,this.reverseGet=n,this._tag="Prism"}return t.fromPredicate=function(t){return $P($a(t))},t.some=function(){return $$},t.prototype.modify=function(t){var n=this;return function(r){var i=n.modifyOption(t)(r);return p8(i)?r:i.value}},t.prototype.modifyOption=function(t){var n=this;return function(r){return hI.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 $F($r(this))},t.prototype.asTraversal=function(){return $z($i(this))},t.prototype.asSetter=function(){var t=this;return new $Z(function(n){return t.modify(n)})},t.prototype.asFold=function(){var t=this;return new $G(function(n){return function(r){return function(i){var o=t.getOption(i);return p8(o)?n.empty:r(o.value)}}})},t.prototype.compose=function(t){return $P(V5(t)(this))},t.prototype.composePrism=function(t){return this.compose(t)},t.prototype.composeOptional=function(t){return $F(nG(this,$r,$d(t)))},t.prototype.composeTraversal=function(t){return $z(nG(this,$i,$h(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 $P(nG(this,V5(nG(t,VJ))))},t.prototype.composeLens=function(t){var n;return $F((n=t,function(t){return $d(V2(n))($r(t))})(this))},t.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},t}(),$$=new $V(nP,n2),$K=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 hs(t[n])},function(t){return function(r){return null==r[n]?r:$U(r,n,t)}})}},t.fromOptionProp=function(){var t=$B.fromProp();return function(n){return t(n).composePrism($$)}},t.prototype.modify=function(t){return $l(t)(this)},t.prototype.modifyOption=function(t){return $c(t)(this)},t.prototype.asTraversal=function(){return $z($s(this))},t.prototype.asFold=function(){var t=this;return new $G(function(n){return function(r){return function(i){var o=t.getOption(i);return p8(o)?n.empty:r(o.value)}}})},t.prototype.asSetter=function(){var t=this;return new $Z(function(n){return t.modify(n)})},t.prototype.compose=function(t){return $F($d(t)(this))},t.prototype.composeOptional=function(t){return this.compose(t)},t.prototype.composeTraversal=function(t){return $z(nG(this,$s,$h(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 $F(nG(this,$d(nG(t,V2))))},t.prototype.composePrism=function(t){return $F(nG(this,$d(nG(t,$r))))},t.prototype.composeIso=function(t){return $F(nG(this,$d(nG(t,VX))))},t.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},t}(),$Y=function(){function t(t){this.modifyF=t,this._tag="Traversal"}return t.prototype.modify=function(t){return $D(t)(this)},t.prototype.set=function(t){var n;return $D(function(){return t})(this)},t.prototype.filter=function(t){var n;return $z($h($i($a(t)))(this))},t.prototype.asFold=function(){var t=this;return new $G(function(n){return function(r){return t.modifyF(hU(n))(function(t){return nP(r(t))})}})},t.prototype.asSetter=function(){var t=this;return new $Z(function(n){return t.modify(n)})},t.prototype.compose=function(t){return $z($h(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 $z(nG(this,$h(nG(t,V4))))},t.prototype.composePrism=function(t){return $z(nG(this,$h(nG(t,$i))))},t.prototype.composeIso=function(t){return $z(nG(this,$h(nG(t,V0))))},t.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},t}(),$q=function(){function t(t){this.get=t,this._tag="Getter"}return t.prototype.asFold=function(){var t=this;return new $G(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}(),$G=function(){function t(t){this.foldMap=t,this._tag="Fold",this.getAll=t(d5())(ak),this.exist=t(wo),this.all=t(wi),this.foldMapFirst=t(hk())}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(pi(t))},t.prototype.headOption=function(t){return this.find(function(){return!0})(t)},t}(),$Z=function(){function t(t){this.modify=t,this._tag="Setter"}return t.prototype.set=function(t){return this.modify(nF(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}(),$Q=new $W(nP,nP),$H=Vc({_tag:W9("None")}),$J=W9("Some");function $X(t,n){return void 0===n&&(n="Option<"+t.name+">"),Vr([$H,Vc({_tag:$J,value:t},"Some<"+t.name+">")],n)}var $0=new Wm("DateFromISOString",function(t){return t instanceof Date},function(t,n){return nG(WG.validate(t,n),mS(function(r){var i=new Date(r);return isNaN(i.getTime())?Wh(t,n):n9(i)}))},function(t){return t.toISOString()});function $1(t){var n=Object.create(Object.getPrototypeOf(t));return Object.assign(n,t),n}var $2=new Wm("DateFromNumber",function(t){return t instanceof Date},function(t,n){return nG(WQ.validate(t,n),mS(function(r){var i=new Date(r);return isNaN(i.getTime())?Wh(t,n):n9(i)}))},function(t){return t.getTime()});function $4(t,n,r){void 0===r&&(r=t.name);var i=$1(t);return i.validate=n,i.decode=function(t){return n(t,Vy(i))},i.name=r,i}var $3,$5,$9,$8=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,$6=Vw(WG,$5=function(t){return $8.test(t)},"UUID"),$7=new Wm("BooleanFromString",W0.is,function(t,n){return nG(WG.validate(t,n),mS(function(r){return"true"===r?n9(!0):"false"===r?n9(!1):Wh(t,n)}))},String);function Ke(t){switch(t._tag){case"InterfaceType":return t.props;case"ExactType":return Ke(t.type)}}var Kt=$B.fromProp(),Kn=Vq("RegExp",function(t){return"[object RegExp]"===Object.prototype.toString.call(t)}),Kr=new Wm("DateFromUnixTime",function(t){return t instanceof Date},function(t,n){return nG(B2.validate(t,n),mS(function(r){var i=new Date(1e3*r);return isNaN(i.getTime())?Wh(t,n):n9(i)}))},function(t){return Math.floor(t.getTime()/1e3)}),Ki=new Wm("NumberFromString",WQ.is,function(t,n){return nG(WG.validate(t,n),mS(function(r){var i=+r;return isNaN(i)||""===r.trim()?Wh(t,n):n9(i)}))},String),Ko=new Wm("IntFromString",B2.is,function(t,n){return nG(Ki.validate(t,n),mS(function(r){return B2.is(r)?n9(r):Wh(t,n)}))},Ki.encode),Ka=B3("JsonArray",function(){return Vs(Ks)}),Ku=B3("JsonRecord",function(){return Vt(WG,Ks)}),Ks=Vr([W0,WQ,WG,WU,Ka,Ku],"Json"),Kc=new Wm("JsonFromString",Ks.is,function(t,n){try{return n9(JSON.parse(t))}catch{return Wh(t,n)}},function(t){return JSON.stringify(t)}),Kl=W9("Left"),Kd=W9("Right"),Kf=new Wm("BigIntFromString",function(t){return"bigint"==typeof t},function(t,n){return nG(WG.validate(t,n),mS(function(r){if(!V$.is(r.trim()))return Wh(t,n);try{return n9(BigInt(r))}catch{return Wh(t,n)}}))},String),Kp=new Wm("BooleanFromNumber",W0.is,function(t,n){return nG(WQ.validate(t,n),mm(function(t){return 0!==t}))},Number);let Kh=Object.freeze(Object.defineProperty({__proto__:null,BigIntFromString:Kf,BooleanFromNumber:Kp,BooleanFromString:$7,DateFromISOString:$0,DateFromNumber:$2,DateFromUnixTime:Kr,IntFromString:Ko,Json:Ks,JsonArray:Ka,JsonFromString:Kc,JsonRecord:Ku,NonEmptyString:V$,NumberFromString:Ki,UUID:$6,clone:$1,date:VG,either:function(t,n,r){return void 0===r&&(r="Either<"+t.name+", "+n.name+">"),Vr([Vc({_tag:Kl,left:t},"Left<"+t.name+">"),Vc({_tag:Kd,right:n},"Right<"+t.name+">")],r)},fromNewtype:function(t,n){return void 0===n&&(n="fromNewtype("+t.name+")"),new Wm(n,function(n){return t.is(n)},function(n,r){return nG(t.validate(n,r),mm($Q.wrap))},function(n){return t.encode($Q.unwrap(n))})},fromNullable:function(t,n,r){return void 0===r&&(r="fromNullable("+t.name+")"),$4(t,function(r,i){return null==r?n9(n):t.validate(r,i)},r)},fromRefinement:Vq,getLenses:function(t){var n={};for(var r in Ke(t))n[r]=Kt(r);return n},mapOutput:Vz,nonEmptyArray:VK,option:$X,optionFromNullable:function(t,n){return void 0===n&&(n="Option<"+t.name+">"),new Wm(n,$X(t).is,function(n,r){return null==n?n9(n1):nG(t.validate(n,r),mm(n2))},function(n){return hp(nG(n,pI(t.encode)))})},readonlyNonEmptyArray:function(t,n){return void 0===n&&(n="ReadonlyNonEmptyArray<"+t.name+">"),VK(t,n)},readonlySetFromArray:function(t,n,r){return void 0===r&&(r="ReadonlySet<"+t.name+">"),VY(t,n,r)},regexp:Kn,setFromArray:VY,withEncode:function(t,n,r){return void 0===r&&(r=t.name),new Wm(r,t.is,t.validate,n)},withFallback:function(t,n,r){return void 0===r&&(r="withFallback("+t.name+")"),$4(t,function(r,i){return mX(function(){return n9(n)})(t.validate(r,i))},r)},withMessage:function(t,n){return $4(t,function(r,i){return mE(function(){return[{value:r,context:i,message:n(r,i),actual:r}]})(t.validate(r,i))})},withValidate:$4},Symbol.toStringTag,{value:"Module"})),Km=I(Kh),Kg=I(VU);Object.defineProperty(VP,"__esModule",{value:!0}),VP.withCustomError=VP.addType=VP.isEmpty=VP.objectToMap=VP.grouped=VP.formatDate=VP.formatDateTime=VP.filterDouble=VP.refineType=VP.nullable=void 0;let Ky=n_,Kv=(0,Ky.__importStar)(VC);VP.nullable=function(t){return Kv.union([t,Kv.null,Kv.undefined])},VP.refineType=function(t,n,r){return new Kv.Type(n,t.is,(n,i)=>(0,VF.pipe)(t.validate(n,i),Ub.either.chain(t=>r(t)?Kv.success(t):Kv.failure(n,i))),t.encode)},VP.filterDouble=function(t){if(""===t)return null;let n=Number(t);return Number.isNaN(n)?null:n},VP.formatDateTime=function(t){return t.toISOString().replace(/\.\d{3}Z$/,"+0000")},VP.formatDate=function(t){return t.toISOString().replace(/T.*/,"")},VP.grouped=function(t,n){return t.reduce((t,r,i)=>(i%n==0?t.push([r]):t[Math.floor(i/n)].push(r),t),[])},VP.objectToMap=function(t){return new Map(Object.entries(t))},VP.isEmpty=function(t){for(let n in t)return!1;return!0},VP.addType=function(t,n){return(0,Kg.mapOutput)(t,t=>({...t,__TYPE__:n}))},VP.withCustomError=function(t,n){return(0,Km.withValidate)(t,(r,i)=>Ub.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(VL,"__esModule",{value:!0}),VL.WidgetKey=void 0;let Kb=n_,Kx=(0,Kb.__importStar)(VC),KM=RegExp("^[^<>]+$");VL.WidgetKey=(0,VP.refineType)(Kx.string,"WidgetKey",t=>0===t.length||KM.test(t)),function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=n_;(0,n.__exportStar)(VE,t),(0,n.__exportStar)(VD,t),(0,n.__exportStar)(VL,t)}(Vj);var KT={},KS={},Kw={},KI={},K_={};Object.defineProperty(K_,"__esModule",{value:!0}),K_.clone=void 0,K_.clone=function(t){var n=Object.create(Object.getPrototypeOf(t));return Object.assign(n,t),n};var KO=w&&w.__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]}),Kk=w&&w.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),KC=w&&w.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&KO(n,t,r);return Kk(n,t),n};Object.defineProperty(KI,"__esModule",{value:!0}),KI.withValidate=void 0;var KN=KC(VC);KI.withValidate=function(t,n,r){void 0===r&&(r=t.name);var i=K_.clone(t);return i.validate=n,i.decode=function(t){return n(t,KN.getDefaultContext(i))},i.name=r,i};var Kj=w&&w.__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]}),KE=w&&w.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),KR=w&&w.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&Kj(n,t,r);return KE(n,t),n};Object.defineProperty(Kw,"__esModule",{value:!0}),Kw.withFallback=void 0;var KD=KR(VC);Kw.withFallback=function(t,n,r){return void 0===r&&(r="withFallback("+t.name+")"),KI.withValidate(t,function(r,i){return Ux.orElse(function(){return KD.success(n)})(t.validate(r,i))},r)};var KA={},KL={};Object.defineProperty(KL,"__esModule",{value:!0}),KL.EmptyArray=KL.EmptyObject=KL.Boolean=KL.NumberOrNull=KL.Number=KL.StringOrNull=KL.String=void 0;let KP=n_,KF=(0,KP.__importStar)(VC);KL.String=(0,VP.withCustomError)(KF.string,()=>"The value must be a string"),KL.StringOrNull=(0,VP.withCustomError)(KF.union([KF.string,KF.null]),()=>"The value must be a string or null"),KL.Number=(0,VP.withCustomError)(KF.number,()=>"The value must be a number"),KL.NumberOrNull=(0,VP.withCustomError)(KF.union([KF.number,KF.null]),()=>"The value must be a number or null"),KL.Boolean=(0,VP.withCustomError)(KF.boolean,()=>"The value must be a boolean"),KL.EmptyObject=KF.UnknownRecord.pipe(new KF.Type("emptyObject",t=>KF.UnknownRecord.is(t),(t,n)=>Object.keys(t).length>0?KF.failure(t,n,"The object is not empty."):KF.success({}),KF.identity)),KL.EmptyArray=new KF.Type("emptyArray",t=>KF.UnknownArray.is(t)&&0===t.length,(t,n)=>(0,US.pipe)(KF.UnknownArray.decode(t),Ub.either.chain(r=>r.length>0?KF.failure(t,n,"The array is not empty."):KF.success([]))),()=>[]);var Kz={};let KU=I(gd);var KW={};Object.defineProperty(KW,"__esModule",{value:!0});let KB=n_,KV=(0,KB.__importStar)(VC);KW.default=new KV.Type("dateFromStringOrNumber",t=>t instanceof Date,(t,n)=>(0,VF.pipe)(KV.union([KV.number,KV.string]).validate(t,n),(0,KU.chain)(r=>{let i=new Date(r);return isNaN(i.getTime())?KV.failure(t,n):KV.success(i)})),t=>t);var K$={};Object.defineProperty(K$,"__esModule",{value:!0});let KK=n_,KY=(0,KK.__importStar)(VC);K$.default=new KY.Type("dateFromTsMs",t=>t instanceof Date,(t,n)=>(0,VF.pipe)(KY.number.validate(t,n),(0,KU.chain)(r=>{let i=new Date(r);return isNaN(i.getTime())?KY.failure(t,n):KY.success(i)})),t=>t.getTime());var Kq={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.EmptyArrayOrElse=t.EmptyObjectOrElse=t.NullOrElse=t.DefaultOrElse=void 0;let n=n_,r=(0,n.__importStar)(VC),i=t=>n=>new r.Type(`DefaultOrElse<${t.name}, ${n.name}>`,t=>null===t||n.is(t),(i,o)=>(0,Ux.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)(KL.EmptyObject)(n);t.EmptyObjectOrElse=a;let u=n=>(0,t.DefaultOrElse)(KL.EmptyArray)(n);t.EmptyArrayOrElse=u}(Kq);var KG={};Object.defineProperty(KG,"__esModule",{value:!0});let KZ=n_,KQ=(0,KZ.__importStar)(VC);KG.default=new KQ.Type("IntFromNumber",KQ.Int.is,(t,n)=>(0,VF.pipe)(KQ.number.validate(t,n),(0,KU.chain)(t=>KQ.Int.is(t)?KQ.success(t):KQ.success(Math.round(t)))),KQ.Int.encode);var KH={};Object.defineProperty(KH,"__esModule",{value:!0});let KJ=n_,KX=(0,KJ.__importStar)(VC),K0=/^([0-9]+)px$/;KH.default=new KX.Type("IntFromPixels",KX.Int.is,(t,n)=>(0,VF.pipe)(KX.string.validate(t,n),(0,KU.chain)(r=>{try{let i=r.match(K0);if(!i)return KX.failure(t,n);let o=parseInt(i[1]);return KX.success(o)}catch{return KX.failure(t,n)}})),String);var K1={};Object.defineProperty(K1,"__esModule",{value:!0});let K2=n_,K4=(0,K2.__importStar)(VC);K1.default=(0,VP.withCustomError)((0,VP.refineType)(K4.string,"nonEmptyString",t=>t.trim().length>0),()=>"The value must be a non-empty string");var K3={},K5={};Object.defineProperty(K5,"__esModule",{value:!0});let K9=n_,K8=(0,K9.__importStar)(VC);K5.default=(0,VP.nullable)(K8.string),Object.defineProperty(K3,"__esModule",{value:!0});let K6=n_,K7=(0,K6.__importDefault)(K5);K3.default=new VC.Type("nonEmptyStringOrNull",t=>"string"==typeof t||null===t,(t,n)=>(0,VF.pipe)(K7.default.validate(t,n),(0,KU.chain)(t=>"string"==typeof t&&t.length>0?(0,VC.success)(t):(0,VC.success)(null))),t=>t);var Ye={};Object.defineProperty(Ye,"__esModule",{value:!0});let Yt=n_,Yn=(0,Yt.__importStar)(VC);Ye.default=(0,VP.nullable)(Yn.number);var Yr={};Object.defineProperty(Yr,"__esModule",{value:!0});let Yi=n_,Yo=(0,Yi.__importStar)(VC);Yr.default=(t,n,r)=>KL.Number.pipe(new Yo.Type("numberInRange",t=>KL.Number.is(t),(i,o)=>i>n||i<t?Yo.failure(i,o,`${r} must be a number between ${t} and ${n}`):Yo.success(i),Yo.identity));var Ya={};Object.defineProperty(Ya,"__esModule",{value:!0});let Yu=n_,Ys=(0,Yu.__importStar)(VC);Ya.default=new Ys.Type("StringFromInt",Ys.string.is,(t,n)=>(0,VF.pipe)(Ys.boolean.validate(t,n),(0,KU.chain)(t=>Ys.success(t.toString()))),t=>t);var Yc={};Object.defineProperty(Yc,"__esModule",{value:!0});let Yl=n_,Yd=(0,Yl.__importStar)(VC);function Yf(){return qL||(qL=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=n_;(0,n.__exportStar)(KL,t);var r=function(){if(qA)return Kz;qA=1,Object.defineProperty(Kz,"__esModule",{value:!0});let t=n_,n=(0,t.__importStar)(VC),r=Yf();return Kz.default=new n.Type("dateFromString",t=>t instanceof Date,(t,i)=>(0,VF.pipe)(r.String.validate(t,i),(0,KU.chain)(r=>{let o=new Date(r);return isNaN(o.getTime())?n.failure(t,i):n.success(o)})),t=>t.toISOString()),Kz}();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)(KW).default}}),Object.defineProperty(t,"DateFromTsMs",{enumerable:!0,get:function(){return(0,n.__importDefault)(K$).default}}),(0,n.__exportStar)(Kq,t),t.Function=(0,n.__importStar)(VP),Object.defineProperty(t,"IntFromNumber",{enumerable:!0,get:function(){return(0,n.__importDefault)(KG).default}}),Object.defineProperty(t,"IntFromPixels",{enumerable:!0,get:function(){return(0,n.__importDefault)(KH).default}}),Object.defineProperty(t,"NonEmptyString",{enumerable:!0,get:function(){return(0,n.__importDefault)(K1).default}}),Object.defineProperty(t,"NonEmptyStringOrNull",{enumerable:!0,get:function(){return(0,n.__importDefault)(K3).default}}),Object.defineProperty(t,"NumberOrNull",{enumerable:!0,get:function(){return(0,n.__importDefault)(Ye).default}}),Object.defineProperty(t,"NumberRange",{enumerable:!0,get:function(){return(0,n.__importDefault)(Yr).default}}),Object.defineProperty(t,"StringFromBoolean",{enumerable:!0,get:function(){return(0,n.__importDefault)(Ya).default}}),Object.defineProperty(t,"StringFromNumber",{enumerable:!0,get:function(){return(0,n.__importDefault)(Yc).default}}),Object.defineProperty(t,"StringOrNull",{enumerable:!0,get:function(){return(0,n.__importDefault)(K5).default}})}(KA)),KA}Yc.default=new Yd.Type("StringFromInt",Yd.string.is,(t,n)=>(0,VF.pipe)(Yd.number.validate(t,n),(0,KU.chain)(t=>Yd.success(t.toString()))),t=>t);var Yp={},Yh={},Ym={},Yg={},Yy={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanField=t.BooleanConfig=t.BooleanFieldType=void 0;let n=(0,n_.__importStar)(VC),r=Yf();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})]))}(Yy);var Yv={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Color=t.ColorConfig=t.ColorFieldType=void 0;let n=(0,n_.__importStar)(VC),r=Yf();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})]))}(Yv);var Yb={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Date=t.DateConfig=t.DateFieldType=void 0;let n=(0,n_.__importStar)(VC),r=Yf();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})]))}(Yb);var Yx={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Embed=t.EmbedConfig=t.EmbedFieldType=void 0;let n=(0,n_.__importStar)(VC),r=Yf();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})]))}(Yx);var YM={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.GeoPoint=t.GeoPointConfig=t.GeoPointFieldType=void 0;let n=(0,n_.__importStar)(VC),r=Yf();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})]))}(YM);var YT={},YS={},Yw={},YI={},Y_={};Object.defineProperty(Y_,"__esModule",{value:!0}),Y_.pipe=Y_.pipeable=void 0,Y_.pipeable=function(t){var n,r,i,o,a,u,s,c,l,d,f,p,h,m,g,y={};if("function"==typeof t.map){var v=function(n){return function(r){return t.map(r,n)}};y.map=v}if("function"==typeof t.contramap){var b=function(n){return function(r){return t.contramap(r,n)}};y.contramap=b}if("function"==typeof t.mapWithIndex){var x=function(n){return function(r){return t.mapWithIndex(r,n)}};y.mapWithIndex=x}if("function"==typeof t.ap){var M=function(n){return function(r){return t.ap(r,n)}},T=function(n){return function(r){return t.ap(t.map(r,function(t){return function(){return t}}),n)}};y.ap=M,y.apFirst=T,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 S=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})})}},I=function(n){return t.chain(n,US.identity)};y.chain=S,y.chainFirst=w,y.flatten=I}if("function"==typeof t.bimap){var _=function(n,r){return function(i){return t.bimap(i,n,r)}},O=function(n){return function(r){return t.mapLeft(r,n)}};y.bimap=_,y.mapLeft=O}if("function"==typeof t.extend){var k=function(n){return function(r){return t.extend(r,n)}},C=function(n){return t.extend(n,US.identity)};y.extend=k,y.duplicate=C}if("function"==typeof t.reduce){var N=function(n,r){return function(i){return t.reduce(i,n,r)}},j=function(n){var r=t.foldMap(n);return function(t){return function(n){return r(n,t)}}},E=function(n,r){return function(i){return t.reduceRight(i,n,r)}};y.reduce=N,y.foldMap=j,y.reduceRight=E}if("function"==typeof t.reduceWithIndex){var R=function(n,r){return function(i){return t.reduceWithIndex(i,n,r)}},D=function(n){var r=t.foldMapWithIndex(n);return function(t){return function(n){return r(n,t)}}},A=function(n,r){return function(i){return t.reduceRightWithIndex(i,n,r)}};y.reduceWithIndex=R,y.foldMapWithIndex=D,y.reduceRightWithIndex=A}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 P=function(n){return function(r){return t.filter(r,n)}},F=function(n){return function(r){return t.filterMap(r,n)}},z=function(n){return function(r){return t.partition(r,n)}},U=function(n){return function(r){return t.partitionMap(r,n)}};y.filter=P,y.filterMap=F,y.partition=z,y.partitionMap=U}if("function"==typeof t.filterWithIndex){var W=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=W,y.filterMapWithIndex=B,y.partitionWithIndex=V,y.partitionMapWithIndex=$}if("function"==typeof t.promap){var K=function(n,r){return function(i){return t.promap(i,n,r)}};y.promap=K}if("function"==typeof t.compose){var Y=function(n){return function(r){return t.compose(r,n)}};y.compose=Y}if("function"==typeof t.throwError){var q=function(n){return function(r){return"None"===r._tag?t.throwError(n()):t.of(r.value)}},G=function(n){return"Left"===n._tag?t.throwError(n.left):t.of(n.right)},Z=function(n,r){return function(i){return n(i)?t.of(i):t.throwError(r(i))}},Q=function(n,r){return function(i){return t.chain(i,function(i){return n(i)?t.of(i):t.throwError(r(i))})}};y.fromOption=q,y.fromEither=G,y.fromPredicate=Z,y.filterOrElse=Q}return y},Y_.pipe=US.pipe;var YO=w&&w.__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]}),Yk=w&&w.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),YC=w&&w.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&YO(n,t,r);return Yk(n,t),n};Object.defineProperty(YI,"__esModule",{value:!0}),YI.NumberFromString=void 0;var YN=YC(VC);YI.NumberFromString=new YN.Type("NumberFromString",YN.number.is,function(t,n){return Y_.pipe(YN.string.validate(t,n),Ux.chain(function(r){var i=+r;return isNaN(i)||""===r.trim()?YN.failure(t,n):YN.success(i)}))},String);var Yj=w&&w.__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]}),YE=w&&w.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),YR=w&&w.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&Yj(n,t,r);return YE(n,t),n};Object.defineProperty(Yw,"__esModule",{value:!0}),Yw.IntFromString=void 0;var YD=YR(VC);Yw.IntFromString=new YD.Type("IntFromString",YD.Int.is,function(t,n){return Y_.pipe(YI.NumberFromString.validate(t,n),Ux.chain(function(r){return YD.Int.is(r)?YD.success(r):YD.failure(t,n)}))},YI.NumberFromString.encode),Object.defineProperty(YS,"__esModule",{value:!0});let YA=n_,YL=(0,YA.__importStar)(VC),YP=Yf(),YF=new YL.Type("SideConstraints",t=>!t||"number"==typeof t,(t,n)=>Ux.either.chain(YL.union([YL.literal("auto"),YL.literal(""),YL.Int,Yw.IntFromString,YP.IntFromNumber,YP.IntFromPixels,YL.null]).validate(t,n),t=>"auto"===t||""===t?YL.success(null):YL.success(t)),t=>t),Yz=YL.partial({width:YF,height:YF});YS.default=Yz,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Image=t.ImageConfig=t.Thumbnail=t.ImageFieldType=void 0;let n=n_,r=(0,n.__importStar)(VC),i=Yf(),o=(0,n.__importDefault)(YS);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})]))}(YT);var YU={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.IntegrationField=t.IntegrationFieldConfig=t.IntegrationFieldType=void 0;let n=(0,n_.__importStar)(VC),r=Yf();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})]))}(YU);var YW={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Link=t.LinkConfig=t.LinkFieldType=void 0;let n=n_,r=(0,n.__importStar)(VC),i=Yf(),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)=>Ux.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,Kw.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})]))}(YW);var YB={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Number=t.NumberConfig=t.NumberFieldType=void 0;let n=(0,n_.__importStar)(VC),r=Yf();t.NumberFieldType="Number",t.NumberConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,min:n.union([n.number,YI.NumberFromString]),max:n.union([n.number,YI.NumberFromString]),step:n.union([n.number,YI.NumberFromString])})),t.Number=n.exact(n.intersection([n.type({type:n.literal(t.NumberFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.NumberConfig})]))}(YB);var YV={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Range=t.RangeConfig=t.RangeFieldType=void 0;let n=(0,n_.__importStar)(VC),r=Yf();t.RangeFieldType="Range",t.RangeConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,min:n.union([n.number,YI.NumberFromString]),max:n.union([n.number,YI.NumberFromString]),step:n.union([n.number,YI.NumberFromString])})),t.Range=n.exact(n.intersection([n.type({type:n.literal(t.RangeFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.RangeConfig})]))}(YV);var Y$={};!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=n_,r=(0,n.__importStar)(VC),i=Yf(),o=(0,n.__importDefault)(YS);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),Ub.either.map(n=>{if(!n)return t.DEFAULT_OPTION;let r=n.split(",").map(t=>t.trim()).filter(n=>(0,Ux.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])},d=new r.Type("RichTextLabels",t=>t instanceof Array,(t,n)=>{let i=r.record(r.string,r.readonlyArray(r.record(r.literal("name"),r.string))),o=r.readonlyArray(r.string);return(0,US.pipe)(r.union([i,o,r.string,r.null]).decode(t),Ub.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:d,allowTargetBlank:r.boolean})),t.RichText=r.exact(r.intersection([r.type({type:r.literal(t.RichTextFieldType)}),r.partial({fieldset:i.StringOrNull,config:t.RichTextConfig})]))}(Y$);var YK={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Select=t.SelectConfig=t.SelectFieldType=void 0;let n=(0,n_.__importStar)(VC),r=Yf();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})]))}(YK);var YY={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Separator=t.SeparatorConfig=t.SeparatorFieldType=void 0;let n=(0,n_.__importStar)(VC),r=Yf();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})]))}(YY);var Yq={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Text=t.TextConfig=t.TextFieldType=void 0;let n=(0,n_.__importStar)(VC),r=Yf();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})]))}(Yq);var YG={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Timestamp=t.TimestampConfig=t.TimestampFieldType=void 0;let n=(0,n_.__importStar)(VC),r=Yf();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})]))}(YG),Object.defineProperty(Yg,"__esModule",{value:!0}),Yg.NestableWidget=void 0;let YZ=n_,YQ=(0,YZ.__importStar)(VC);Yg.NestableWidget=YQ.union([Yv.Color,Yy.BooleanField,Yx.Embed,YM.GeoPoint,Yb.Date,YB.Number,YV.Range,Y$.RichText,YK.Select,YY.Separator,Yq.Text,YG.Timestamp,YW.Link,YT.Image,YU.IntegrationField]),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Group=t.GroupConfig=t.GroupFieldType=void 0;let n=(0,n_.__importStar)(VC),r=Yf();t.GroupFieldType="Group",t.GroupConfig=n.exact(n.partial({label:r.StringOrNull,repeat:n.boolean,fields:n.record(Vj.WidgetKey,Yg.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})]))}(Ym);var YH={};!function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=n_;(0,n.__exportStar)(Yy,t),(0,n.__exportStar)(Yv,t),(0,n.__exportStar)(Yb,t),(0,n.__exportStar)(Yx,t),(0,n.__exportStar)(YM,t),(0,n.__exportStar)(YT,t),(0,n.__exportStar)(YU,t),(0,n.__exportStar)(YW,t),(0,n.__exportStar)(Yg,t),(0,n.__exportStar)(YB,t),(0,n.__exportStar)(YV,t),(0,n.__exportStar)(Y$,t),(0,n.__exportStar)(YK,t),(0,n.__exportStar)(YY,t),(0,n.__exportStar)(Yq,t),(0,n.__exportStar)(YG,t)}(YH);var YJ={},YX={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.isCompositeSlice=t.CompositeSlice=t.CompositeSliceConfig=t.CompositeSliceType=void 0;let n=(0,n_.__importStar)(VC),r=Yf();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(Vj.WidgetKey,Yg.NestableWidget),repeat:n.record(Vj.WidgetKey,Yg.NestableWidget),config:t.CompositeSliceConfig})])),t.isCompositeSlice=function(t){return"Slice"===t.type}}(YX);var Y0={};Object.defineProperty(Y0,"__esModule",{value:!0}),Y0.isLegacySlice=Y0.LegacySlice=void 0;let Y1=n_,Y2=(0,Y1.__importStar)(VC);Y0.LegacySlice=Y2.union([Yg.NestableWidget,Ym.Group]),Y0.isLegacySlice=function(t){return"Slice"!==t.type&&"SharedSlice"!==t.type};var Y4={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.isDynamicSharedSlice=t.isStaticSharedSlice=t.SharedSlice=t.SharedSliceType=t.Variation=void 0;let n=(0,n_.__importStar)(VC);t.Variation=n.exact(n.intersection([n.type({id:n.string,name:n.string,description:n.string,imageUrl:(0,Kw.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(Vj.WidgetKey,Yg.NestableWidget),items:n.record(Vj.WidgetKey,Yg.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}}(Y4);var Y3={};Object.defineProperty(Y3,"__esModule",{value:!0}),Y3.SharedSliceRef=void 0;let Y5=n_,Y9=(0,Y5.__importStar)(VC);Y3.SharedSliceRef=Y9.exact(Y9.type({type:Y9.literal(Y4.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,n_.__importStar)(VC),r=Yf();function i(i){return n.exact(n.partial({label:r.StringOrNull,labels:t.SlicesLabels,choices:n.record(Vj.WidgetKey,n.union([Y0.LegacySlice,YX.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(Y4.SharedSlice),t.DynamicSlicesConfig=i(Y3.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}}(YJ);var Y8={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.UID=t.UIDConfig=t.UIDFieldType=void 0;let n=(0,n_.__importStar)(VC),r=Yf();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})]))}(Y8),Object.defineProperty(Yh,"__esModule",{value:!0}),Yh.Widgets=Yh.FieldType=Yh.DynamicWidget=Yh.StaticWidget=Yh.widgetReader=void 0;let Y6=n_,Y7=(0,Y6.__importStar)(VC);function qe(t){return Y7.union([Y8.UID,Yg.NestableWidget,Ym.Group,t])}Yh.widgetReader=qe,Yh.StaticWidget=qe(YJ.StaticSlices),Yh.DynamicWidget=qe(YJ.DynamicSlices),Yh.FieldType=Y7.keyof({[YH.ColorFieldType]:null,[YH.BooleanFieldType]:null,[YH.NumberFieldType]:null,[YH.EmbedFieldType]:null,[YH.GeoPointFieldType]:null,[YH.DateFieldType]:null,[YH.RangeFieldType]:null,[YH.RichTextFieldType]:null,[YH.SelectFieldType]:null,[YH.SeparatorFieldType]:null,[YH.TextFieldType]:null,[YH.TimestampFieldType]:null,[YH.LinkFieldType]:null,[YH.ImageFieldType]:null,[YH.IntegrationFieldType]:null,[Y8.UIDFieldType]:null,[Ym.GroupFieldType]:null,[YJ.SlicesFieldType]:null,[YJ.LegacySlicesFieldType]:null}),Yh.Widgets={toStatic(t,n){switch(t.type){case"Choice":case"Slices":return YJ.Slices.toStatic(t,n);default:return t}}},Object.defineProperty(Yp,"__esModule",{value:!0}),Yp.Sections=Yp.DynamicSection=Yp.StaticSection=Yp.sectionReader=void 0;let qt=n_,qn=(0,qt.__importStar)(VC);function qr(t){return qn.record(Vj.WidgetKey,t)}Yp.sectionReader=qr,Yp.StaticSection=qr(Yh.StaticWidget),Yp.DynamicSection=qr(Yh.DynamicWidget),Yp.Sections={toStatic:(t,n)=>Object.entries(t).reduce((t,[r,i])=>({...t,[r]:Yh.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=n_,r=(0,n.__importStar)(VC),i=Yf();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,Kw.withFallback)(r.boolean,!0),json:r.record(r.string,n),status:(0,Kw.withFallback)(r.boolean,!0)}),r.partial({hash:r.string,format:(0,Kw.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(Yp.StaticSection),t.CustomType=a(Yp.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]:Yp.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,Ux.left)(new o(r)):(0,Ux.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},{})}}(KS);var qi,qo,qa={},qu={};Object.defineProperty(qi=qu,"__esModule",{value:!0}),qi.DiffOperation=void 0,(qo=qi.DiffOperation||(qi.DiffOperation={})).Added="added",qo.Removed="removed",qo.Updated="updated";var qs={},qc={},ql={};Object.defineProperty(ql,"__esModule",{value:!0}),ql.HexaColor=void 0;let qd=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;ql.HexaColor={is:t=>qd.test(t)};var qf={};Object.defineProperty(qf,"__esModule",{value:!0}),qf.toRecord=void 0,qf.toRecord=function(t,n){return t.reduce((t,r)=>{let i=n(r);return{...t,[i]:r}},{})};var qp={};Object.defineProperty(qp,"__esModule",{value:!0}),qp.mapValues=qp.isObject=qp.withOptionals=qp.isNotEmpty=qp.zipObjects=void 0;let qh=n_,qm=(0,qh.__importStar)(VC);qp.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}}},{})},qp.isNotEmpty=function(t){return Boolean(Object.keys(t).length)},qp.withOptionals=function(t,n){return{...t,...n.reduce((t,[n,r])=>r?{...t,[n]:r}:t,{})}};let qg=qm.record(qm.string,qm.unknown);qp.isObject=function(t){return(0,Ux.isRight)(qg.decode(t))},qp.mapValues=function(t,n){return Object.entries(t).reduce((t,[r,i])=>({...t,[r]:n(i,r)}),{})},Object.defineProperty(qc,"__esModule",{value:!0}),qc.Objects=qc.Arrays=qc.HexaColorCode=void 0;let qy=n_;qc.HexaColorCode=(0,qy.__importStar)(ql),qc.Arrays=(0,qy.__importStar)(qf),qc.Objects=(0,qy.__importStar)(qp);var qv={};function qb(t,n){let r=qc.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:qu.DiffOperation.Removed}:!(null!=r&&r.left)&&null!=r&&r.right?{op:qu.DiffOperation.Added,value:r.right}:{op:qu.DiffOperation.Updated,value:r.right}})();return i?{...t,[n]:i}:t},{});return qc.Objects.isNotEmpty(i)?i:void 0}Object.defineProperty(qv,"__esModule",{value:!0}),qv.VariationComparator=void 0,qv.VariationComparator={compare(t,n){if(t&&!n)return{op:qu.DiffOperation.Removed};if(!t&&n)return{op:qu.DiffOperation.Added,value:n};let r=function(t,n){let r=qc.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=qb(null==t?void 0:t.primary,null==n?void 0:n.primary),o=qb(null==t?void 0:t.items,null==n?void 0:n.items),a={...r,...i?{primary:i}:{},...o?{items:o}:{}};if(qc.Objects.isNotEmpty(a))return{op:qu.DiffOperation.Updated,value:a}}},Object.defineProperty(qs,"__esModule",{value:!0}),qs.SliceComparator=void 0,qs.SliceComparator={compare(t,n){if(!t&&n)return{op:qu.DiffOperation.Added,value:n};if(t&&!n)return{op:qu.DiffOperation.Removed};let r=function(t,n){let r=qc.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=qc.Objects.zipObjects(t&&qc.Arrays.toRecord(t.variations,t=>t.id),n&&qc.Arrays.toRecord(n.variations,t=>t.id)),o=Object.entries(i).reduce((t,[n,r])=>{if(!r)return t;let i=qv.VariationComparator.compare(r.left,r.right);return i?{...t,[n]:i}:t},{}),a={...r,...qc.Objects.isNotEmpty(o)?{variations:o}:{}};if(qc.Objects.isNotEmpty(a))return{op:qu.DiffOperation.Updated,value:a}}},function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=n_;(0,n.__exportStar)(qu,t),(0,n.__exportStar)(qs,t),(0,n.__exportStar)(qv,t)}(qa);var qx,qM,qT={},qS={};qx=qS,qM=w&&w.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},Object.defineProperty(qx,"__esModule",{value:!0}),qx.ImageConstraint=void 0,Object.defineProperty(qx,"ImageConstraint",{enumerable:!0,get:function(){return qM(YS).default}});var qw={},qI={};Object.defineProperty(qI,"__esModule",{value:!0});var q_={};Object.defineProperty(q_,"__esModule",{value:!0}),q_.SlicesTypes=void 0;let qO=n_,qk=(0,qO.__importStar)(VC);q_.SlicesTypes=qk.keyof({[YX.CompositeSliceType]:null,[Y4.SharedSliceType]:null}),function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=n_;(0,n.__exportStar)(YX,t),(0,n.__exportStar)(Y0,t),(0,n.__exportStar)(Y4,t),(0,n.__exportStar)(Y3,t),(0,n.__exportStar)(qI,t),(0,n.__exportStar)(YJ,t),(0,n.__exportStar)(q_,t)}(qw),function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=n_;(0,n.__exportStar)(Ym,t),(0,n.__exportStar)(YH,t),(0,n.__exportStar)(qS,t),(0,n.__exportStar)(qw,t),(0,n.__exportStar)(Y8,t),(0,n.__exportStar)(Yh,t)}(qT),function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=n_;(0,n.__exportStar)(KS,t),(0,n.__exportStar)(qa,t),(0,n.__exportStar)(Yp,t),(0,n.__exportStar)(qT,t)}(KT);var qC,qN,qj,qE,qR,qD,qA,qL,qP,qF={},qz={},qU={};function qW(){if(qP)return qU;qP=1,Object.defineProperty(qU,"__esModule",{value:!0}),qU.hasContentType=qU.hasFieldContentType=void 0;let t=Zh();function n(t){return"object"==typeof t&&null!==t&&"__TYPE__"in t}return qU.hasFieldContentType=function(r){return n(r)&&r.__TYPE__===t.FieldContentType&&(null==r?void 0:r.type)!==void 0&&"string"==typeof r.type&&(0,Ux.isRight)(t.FieldType.decode(r.type))},qU.hasContentType=n,qU}function qB(){return qG||(qG=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.EmptyContent=t.EmptyLegacy=t.isEmptyContent=t.EmptyContentType=void 0;let n=n_,r=(0,n.__importStar)(VC),i=qW();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),Ub.either.map(()=>({type:n,__TYPE__:t.EmptyContentType}))),()=>null);t.EmptyLegacy=u,t.EmptyContent=r.strict({type:r.string,__TYPE__:r.literal(t.EmptyContentType)})}(qz)),qz}var qV={},q$={};Object.defineProperty(q$,"__esModule",{value:!0}),q$.defaultCtx=q$.getFieldCtx=q$.LegacyContentCtx=q$.FieldOrSliceType=void 0;let qK=n_,qY=(0,qK.__importStar)(VC);q$.FieldOrSliceType=qY.union([qT.FieldType,qT.SlicesTypes]);class qq{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)}}q$.LegacyContentCtx=qq,q$.getFieldCtx=function(t,n,r){return new qq(t,[...n.fieldPath,n.fieldKey,...r||[]],n.allTypes)},q$.defaultCtx=function(t,n=new Map){return new qq(t,[],n)};var qG,qZ,qQ={},qH={};function qJ(){return qZ||(qZ=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanContentDefaultValue=t.BooleanContent=t.BooleanLegacy=t.isBooleanContent=t.BooleanContentType=void 0;let n=n_,r=(0,n.__importStar)(VC),i=qW();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),Ub.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}(qH)),qH}var qX,q0={};function q1(){return qX||(qX=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.EmbedContent=t.EmbedLegacy=t.EmbedContentLegacy=t.isEmbedContent=t.EmbedContentType=void 0;let n=n_,r=(0,n.__importStar)(VC),i=Yf(),o=qW();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),Ub.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})])}(q0)),q0}var q2={},q4={},q3={};Object.defineProperty(q3,"__esModule",{value:!0});let q5=n_,q9=(0,q5.__importStar)(VC);q3.default=new q9.Type("TrimmedString",q9.string.is,(t,n)=>(0,VF.pipe)(q9.string.validate(t,n),(0,KU.chain)(t=>q9.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 q8={};function q6(){return q7||(q7=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ColorContent=t.ColorLegacy=t.isColorContent=void 0;let n=n_,r=(0,n.__importStar)(VC),i=(0,n.__importDefault)(q3),o=qW(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===q8.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),Ub.either.map(n=>t.ColorContent.encode({value:n,type:qT.ColorFieldType,__TYPE__:q8.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:qT.ColorFieldType}}));t.ColorLegacy=u,t.ColorContent=r.strict({type:r.literal(qT.ColorFieldType),value:i.default,__TYPE__:r.literal(q8.FieldContentType)})}(q4)),q4}Object.defineProperty(q8,"__esModule",{value:!0}),q8.FieldContentType=void 0,q8.FieldContentType="FieldContent";var q7,Ge,Gt={};function Gn(){return Ge||(Ge=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DateContent=t.DateLegacy=t.isDateContent=void 0;let n=n_,r=(0,n.__importStar)(VC),i=(0,n.__importDefault)(q3),o=qW(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===q8.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),Ub.either.map(n=>t.DateContent.encode({value:n,type:qT.DateFieldType,__TYPE__:q8.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:qT.DateFieldType}}));t.DateLegacy=u,t.DateContent=r.strict({type:r.literal(qT.DateFieldType),value:i.default,__TYPE__:r.literal(q8.FieldContentType)})}(Gt)),Gt}var Gr,Gi={};function Go(){return Gr||(Gr=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.NumberContent=t.NumberLegacy=t.isNumberContent=void 0;let n=n_,r=(0,n.__importStar)(VC),i=(0,n.__importDefault)(q3),o=qW(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===q8.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),Ub.either.map(n=>t.NumberContent.encode({value:n,type:qT.NumberFieldType,__TYPE__:q8.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:qT.NumberFieldType}}));t.NumberLegacy=u,t.NumberContent=r.strict({type:r.literal(qT.NumberFieldType),value:i.default,__TYPE__:r.literal(q8.FieldContentType)})}(Gi)),Gi}var Ga,Gu={};function Gs(){return Ga||(Ga=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RangeContent=t.RangeLegacy=t.isRangeContent=void 0;let n=n_,r=(0,n.__importStar)(VC),i=(0,n.__importDefault)(q3),o=qW(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===q8.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),Ub.either.map(n=>t.RangeContent.encode({value:n,type:qT.RangeFieldType,__TYPE__:q8.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:qT.RangeFieldType}}));t.RangeLegacy=u,t.RangeContent=r.strict({type:r.literal(qT.RangeFieldType),value:i.default,__TYPE__:r.literal(q8.FieldContentType)})}(Gu)),Gu}var Gc,Gl={};function Gd(){return Gc||(Gc=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SelectContentDefaultValue=t.SelectContent=t.SelectLegacy=t.isSelectContent=void 0;let n=n_,r=(0,n.__importStar)(VC),i=(0,n.__importDefault)(q3),o=qW(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===q8.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),Ub.either.map(n=>t.SelectContent.encode({value:n,type:qT.SelectFieldType,__TYPE__:q8.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:qT.SelectFieldType}}));t.SelectLegacy=u,t.SelectContent=r.strict({type:r.literal(qT.SelectFieldType),value:i.default,__TYPE__:r.literal(q8.FieldContentType)});let s=t=>{var n;return!(null===(n=t.config)||void 0===n)&&n.default_value?{__TYPE__:q8.FieldContentType,type:qT.SelectFieldType,value:t.config.default_value||""}:void 0};t.SelectContentDefaultValue=s}(Gl)),Gl}var Gf,Gp={};function Gh(){return Gf||(Gf=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TextContent=t.TextLegacy=t.isTextContent=void 0;let n=n_,r=(0,n.__importStar)(VC),i=(0,n.__importDefault)(q3),o=qW(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===q8.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),Ub.either.map(n=>t.TextContent.encode({value:n,type:qT.TextFieldType,__TYPE__:q8.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:qT.TextFieldType}}));t.TextLegacy=u,t.TextContent=r.strict({type:r.literal(qT.TextFieldType),value:i.default,__TYPE__:r.literal(q8.FieldContentType)})}(Gp)),Gp}var Gm,Gg={};function Gy(){return Gm||(Gm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TimestampContent=t.TimestampLegacy=t.isTimestampContent=void 0;let n=n_,r=(0,n.__importStar)(VC),i=(0,n.__importDefault)(q3),o=qW(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===q8.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),Ub.either.map(n=>t.TimestampContent.encode({value:n,type:qT.TimestampFieldType,__TYPE__:q8.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:qT.TimestampFieldType}}));t.TimestampLegacy=u,t.TimestampContent=r.strict({type:r.literal(qT.TimestampFieldType),value:i.default,__TYPE__:r.literal(q8.FieldContentType)})}(Gg)),Gg}function Gv(){return Gb||(Gb=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.FieldContent=t.FieldType=void 0;let n=n_,r=(0,n.__importStar)(VC),i=q6(),o=Gn(),a=Go(),u=Gs(),s=Gd(),c=Gh(),l=Gy();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)(q6(),t),(0,n.__exportStar)(q8,t),(0,n.__exportStar)(Gn(),t),(0,n.__exportStar)(Go(),t),(0,n.__exportStar)(Gs(),t),(0,n.__exportStar)(Gd(),t),(0,n.__exportStar)(Gh(),t),(0,n.__exportStar)(Gy(),t)}(q2)),q2}var Gb,Gx,GM={};function GT(){return Gx||(Gx=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.GeoPointContent=t.GeoPointLegacy=t.isGeoPointContent=t.GeoPointContentType=void 0;let n=n_,r=(0,n.__importStar)(VC),i=qW();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,VF.pipe)(a.decode(n),Ub.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)})])}(GM)),GM}var GS,Gw={};function GI(){return GS||(GS=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ImageContent=t.ImageLegacy=t.ImageContentView=t.isImageContent=t.ImageContentType=void 0;let n=n_,r=(0,n.__importStar)(VC),i=Yf(),o=qW();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),Ub.either.map(n=>t.ImageContent.encode({...n,__TYPE__:t.ImageContentType}))),t=>({content:(0,qp.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)})])}(Gw)),Gw}var G_,GO={};function Gk(){return G_||(G_=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.IntegrationFieldContent=t.IntegrationFieldLegacy=t.isIntegrationFieldContent=t.IntegrationFieldContentType=void 0;let n=n_,r=(0,n.__importStar)(VC),i=qW();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),Ub.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})}(GO)),GO}var GC,GN={};function Gj(){return GC||(GC=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=n_,r=(0,n.__importStar)(VC),i=Yf(),o=qW();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),Ub.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,Km.withFallback)(r.string,"0")}),r.partial({date:(0,VP.nullable)(r.string)})])),c=new r.Type("FileLink",n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.FileLinkType,n=>(0,US.pipe)(s.decode(n),Ub.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,Km.withFallback)(r.string,"0")})]))]),t.DocumentLinkType="DocumentLink";let l=r.strict({id:i.NonEmptyString}),d=new r.Type("DocumentLink",n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.DocumentLinkType,n=>(0,US.pipe)(l.decode(n),Ub.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 f=r.exact(r.intersection([r.type({url:r.string}),r.partial({kind:r.literal("web"),target:i.StringOrNull,preview:(0,VP.nullable)(r.partial({title:r.string}))})])),p=new r.Type("ExternalLink",n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.ExternalLinkType,n=>(0,US.pipe)(f.decode(n),Ub.either.map(n=>t.ExternalLinkContent.encode({...n,__TYPE__:t.ExternalLinkType}))),t=>f.encode(t));t.ExternalLinkContent=r.intersection([r.strict({__TYPE__:r.literal(t.ExternalLinkType)}),f]),t.LinkContentType="LinkContent";let h=n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.LinkContentType;t.isLinkContent=h,t.LinkLegacy=r.union([u,c,d,p]);let m=n=>new r.Type("LinkLegacy",t.isLinkContent,n=>(0,US.pipe)(t.LinkLegacy.decode(n),Ub.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})}(GN)),GN}var GE,GR={},GD={},GA={};function GL(){return GE||(GE=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=n_,r=(0,n.__importStar)(VC),i=Yf(),o=q1(),a=GI(),u=Gj(),s=t=>r.strict({data:t,start:r.number,end:r.number,type:r.literal(YH.RichTextNodeType.hyperlink)}),c=r.strict({data:(0,Km.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({[YH.RichTextNodeType.strong]:null,[YH.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 d=t=>new r.Type("ValidatedSpans",n=>Array.isArray(n)&&n.every(t.is),(n,i)=>{if(!Array.isArray(n))return r.failure(n,i);{let o=n.reduce((n,r)=>{let i=t.decode(r);return(0,Ux.isLeft)(i)?n:[...n,i.right]},[]).sort((t,n)=>t.start-n.start);return r.success(o)}},n=>n.reduce((n,r)=>{let i=t.encode(r);return[...n,i]},[]));t.ValidatedSpans=d;let f=t=>r.exact(r.intersection([r.type({type:r.literal(YH.RichTextNodeType.image),data:r.intersection([a.ImageContentView,r.partial({linkTo:(0,VP.nullable)(t)})])}),r.partial({label:i.StringOrNull,direction:i.StringOrNull})]));t.ImageBlock=f(u.Link);let p=f(u.LinkLegacy);t.checkImageBlock=function(t){return t.type===YH.RichTextNodeType.image};let h=r.exact(r.intersection([r.type({type:r.literal(YH.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),Ub.either.chain(t=>Ub.either.map(n=>[t,n])(o.EmbedContentLegacy.decode(t.data))),Ub.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(YH.RichTextNodeType.embed),data:o.EmbedContent}),r.partial({label:i.StringOrNull,direction:i.StringOrNull})])),t.checkEmbedBlock=function(t){return t.type===YH.RichTextNodeType.embed};let g=n=>r.exact(r.intersection([r.type({type:(0,VP.refineType)(YH.RichTextNodeTypeCodec,`string which isn't ${YH.RichTextNodeType.image} ${YH.RichTextNodeType.embed}`,t=>t!==YH.RichTextNodeType.image&&t!==YH.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])}(GA)),GA}function GP(){return GF||(GF=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RichTextLegacy=t.RichTextContent=t.isRichTextContent=t.RichTextContentType=void 0;let n=n_,r=(0,n.__importStar)(VC),i=qW(),o=GL();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)(GL(),t);let s=n=>new r.Type("RichTextLegacy",t.isRichTextContent,n=>(0,US.pipe)(u.decode(n),Ub.either.map(n=>({value:n,__TYPE__:t.RichTextContentType}))),t=>({content:u.encode(t.value),types:{[n.keyOfType]:"StructuredText"}}));t.RichTextLegacy=s}(GD)),GD}var GF,Gz,GU={};function GW(){return Gz||(Gz=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SeparatorContent=t.SeparatorLegacy=t.isSeparatorContent=t.SeparatorContentType=void 0;let n=(0,n_.__importStar)(VC),r=qW();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)})}(GU)),GU}function GB(){return G$||(G$=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=n_;(0,n.__exportStar)(qJ(),t),(0,n.__exportStar)(q1(),t),(0,n.__exportStar)(Gv(),t),(0,n.__exportStar)(GT(),t),(0,n.__exportStar)(GI(),t),(0,n.__exportStar)(Gk(),t),(0,n.__exportStar)(Gj(),t),(0,n.__exportStar)(function(){if(GV)return GR;GV=1,Object.defineProperty(GR,"__esModule",{value:!0}),GR.NestableLegacy=GR.isNestableContent=GR.NestableContentDefaultValue=GR.NestableContent=void 0;let t=n_,n=(0,t.__importStar)(VC),r=qB(),i=qJ(),o=q1(),a=Gv(),u=GT(),s=GI(),c=Gk(),l=Gj(),d=GP(),f=GW();GR.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,d.RichTextContent,f.SeparatorContent]);let p=t=>{switch(t.type){case"Boolean":return(0,i.BooleanContentDefaultValue)(t);case"Select":return(0,a.SelectContentDefaultValue)(t);default:return}};GR.NestableContentDefaultValue=p;let h=t=>(0,a.isTextContent)(t)||(0,a.isColorContent)(t)||(0,a.isDateContent)(t)||(0,a.isTimestampContent)(t)||(0,a.isNumberContent)(t)||(0,a.isRangeContent)(t)||(0,a.isSelectContent)(t)||(0,u.isGeoPointContent)(t)||(0,d.isRichTextContent)(t)||(0,i.isBooleanContent)(t)||(0,o.isEmbedContent)(t)||(0,s.isImageContent)(t)||(0,c.isIntegrationFieldContent)(t)||(0,l.isLinkContent)(t)||(0,f.isSeparatorContent)(t)||(0,r.isEmptyContent)(t);GR.isNestableContent=h;let m=t=>({decode(n){if(!t.fieldType)return;let p=(0,r.EmptyLegacy)(t.fieldType).decode(n);if((0,Ux.isRight)(p))return p;let h=(()=>{switch(t.fieldType){case"Text":return(0,a.TextLegacy)(t);case"Color":return(0,a.ColorLegacy)(t);case"Date":return(0,a.DateLegacy)(t);case"Timestamp":return(0,a.TimestampLegacy)(t);case"Number":return(0,a.NumberLegacy)(t);case"Range":return(0,a.RangeLegacy)(t);case"Select":return(0,a.SelectLegacy)(t);case"GeoPoint":return(0,u.GeoPointLegacy)(t);case"StructuredText":return(0,d.RichTextLegacy)(t);case"Boolean":return(0,i.BooleanLegacy)(t);case"Embed":return(0,o.EmbedLegacy)(t);case"Image":return(0,s.ImageLegacy)(t);case"IntegrationFields":return(0,c.IntegrationFieldLegacy)(t);case"Link":return(0,l.LinkContentLegacy)(t);case"Separator":return(0,f.SeparatorLegacy)(t);default:return}})();if(h)return h.decode(n)},encode(n){switch(n.__TYPE__){case q8.FieldContentType:return"Text"===n.type?(0,a.TextLegacy)(t).encode(n):"Color"===n.type?(0,a.ColorLegacy)(t).encode(n):"Range"===n.type?(0,a.RangeLegacy)(t).encode(n):"Date"===n.type?(0,a.DateLegacy)(t).encode(n):"Number"===n.type?(0,a.NumberLegacy)(t).encode(n):"Timestamp"===n.type?(0,a.TimestampLegacy)(t).encode(n):"Select"===n.type?(0,a.SelectLegacy)(t).encode(n):void 0;case u.GeoPointContentType:return(0,u.GeoPointLegacy)(t).encode(n);case d.RichTextContentType:return(0,d.RichTextLegacy)(t).encode(n);case o.EmbedContentType:return(0,o.EmbedLegacy)(t).encode(n);case i.BooleanContentType:return(0,i.BooleanLegacy)(t).encode(n);case s.ImageContentType:return(0,s.ImageLegacy)(t).encode(n);case c.IntegrationFieldContentType:return(0,c.IntegrationFieldLegacy)(t).encode(n);case l.LinkContentType:return(0,l.LinkContentLegacy)(t).encode(n);case f.SeparatorContentType:return(0,f.SeparatorLegacy)(t).encode(n);default:return}}});return GR.NestableLegacy=m,GR}(),t),(0,n.__exportStar)(GP(),t),(0,n.__exportStar)(GW(),t)}(qQ)),qQ}var GV,G$,GK,GY={};function Gq(){if(GK)return GY;GK=1,Object.defineProperty(GY,"__esModule",{value:!0}),GY.repeatableContentWithDefaultNestableContentValues=GY.withDefaultNestableContentValues=void 0;let t=GB();return GY.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)},GY.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))},GY}function GG(){return GZ||(GZ=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=n_,r=(0,n.__importStar)(VC),i=qW(),o=GB(),a=Gq();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),Ub.either.map(r=>({value:Object.entries(r).reduce((t,[r,i])=>{let a=(0,q$.getFieldCtx)(r,n),u=(0,o.NestableLegacy)(a).decode(i);return!u||(0,Ux.isLeft)(u)?t:[...t,[r,u.right]]},[]),__TYPE__:t.GroupItemContentType}))),t=>t.value.reduce((t,[r,i])=>{let a=(0,q$.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),Ub.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 d({path:t,model:n,content:r}){return i=>r.map((r,a)=>{let u=t.concat([{key:a.toString(),type:"GroupItem"}]),s=r.value.reduce((t,[r,a])=>{let s=null==n?void 0:n[r],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=d({path:t,model:null===(u=null==i?void 0:i.config)||void 0===u?void 0:u.fields,content:o.value})(a);return a({path:t,key:n,apiId:r,model:i,content:{__TYPE__:o.__TYPE__,value:s}})}},t.traverseGroupItemsContent=d}(qV)),qV}var GZ,GQ,GH={},GJ={},GX={},G0={};function G1(){if(GQ)return G0;GQ=1,Object.defineProperty(G0,"__esModule",{value:!0}),G0.RepeatableWidgets=G0.RepeatableWidgetsLegacy=void 0;let t=(0,n_.__importStar)(VC),n=GG(),r=GB(),i=r=>t.array((0,n.GroupItemLegacy)(r));G0.RepeatableWidgetsLegacy=i;let o=t.tuple([t.string,r.NestableContent]),a=t.strict({__TYPE__:t.literal(n.GroupItemContentType),value:t.array(o)});return G0.RepeatableWidgets=t.array(a),G0}function G2(){return G4||(G4=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=n_,r=(0,n.__importStar)(VC),i=qW(),o=GG(),a=GB(),u=Gq(),s=G1();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})),d=n=>new r.Type("CompositeSliceLegacy",t.isCompositeSliceContent,r=>(0,US.pipe)(l.decode(r),Ub.either.map(r=>{let i=(()=>{let t=(0,q$.getFieldCtx)("repeat",n),i=(0,s.RepeatableWidgetsLegacy)(t).decode(r.repeat);if(!(!i||(0,Ux.isLeft)(i)))return i.right})()||[];return{nonRepeat:Object.entries(r["non-repeat"]||{}).reduce((t,[r,i])=>{let o=(0,q$.getFieldCtx)(r,n,["non-repeat"]);if(!o)return t;let u=(0,a.NestableLegacy)(o).decode(i);return!u||(0,Ux.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,q$.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,q$.getFieldCtx)("repeat",n);return(0,s.RepeatableWidgetsLegacy)(r).encode(t.repeat)})()||[];return{content:{"non-repeat":r.content,repeat:i.map(t=>t.content)},types:{[n.keyOfType]:"Slice",...r.types,...i.reduce((t,n)=>({...t,...n.types}),{})}}});t.CompositeSliceLegacy=d,t.CompositeSliceContent=r.strict({__TYPE__:r.literal(t.CompositeSliceContentType),nonRepeat:r.record(r.string,a.NestableContent),repeat:s.RepeatableWidgets}),t.compositeSliceContentWithDefaultValues=function(t,n){var r,i;let o=(0,u.withDefaultNestableContentValues)(null!==(r=t["non-repeat"])&&void 0!==r?r:{},n.nonRepeat),a=(0,u.repeatableContentWithDefaultNestableContentValues)(null!==(i=t.repeat)&&void 0!==i?i:{},n.repeat);return{...n,nonRepeat:o,repeat:a}},t.traverseCompositeSliceContent=function({path:t,sliceKey:n,sliceName:r,model:i,content:u}){return(s,c)=>{let l=Object.entries(u.widget.nonRepeat).reduce((o,[u,c])=>{var l,d,f;let p=(null==i?void 0:i.type)==="SharedSlice"?null===(d=null===(l=null==i?void 0:i.fields)||void 0===l?void 0:l.primary)||void 0===d?void 0:d[u]:null===(f=null==i?void 0:i["non-repeat"])||void 0===f?void 0:f[u],h=s({path:t.concat([{key:"non-repeat",type:"primary"},{key:u,type:"Widget"}]),key:u,apiId:r,model:p,content: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},{}),d=(0,o.traverseGroupItemsContent)({path:t.concat([{key:"repeat",type:"items"}]),model:(null==i?void 0:i.type)==="SharedSlice"?null==i?void 0:i.fields.items:null==i?void 0:i.repeat,content:u.widget.repeat})(s);return c({key:n,apiId:r,path:t,model:i,content:{...u,widget:{__TYPE__:"CompositeSliceContent",repeat:d,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)},[])}),[])}}}}(GX)),GX}var G4,G3,G5={};function G9(){return G3||(G3=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=n_,r=(0,n.__importStar)(VC),i=qW(),o=GG(),a=GB(),u=Gq(),s=G1();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,Km.withFallback)(r.array(r.unknown),[]),primary:(0,Km.withFallback)(r.UnknownRecord,{})})),d=n=>new r.Type("SharedSliceLegacy",t.isSharedSliceContent,r=>(0,US.pipe)(l.decode(r),Ub.either.map(r=>{let i=(()=>{let t=(0,q$.getFieldCtx)("items",n,["variations",r.variation]),i=(0,s.RepeatableWidgetsLegacy)(t).decode(r.items);if(!(!i||(0,Ux.isLeft)(i)))return i.right})()||[],o=Object.entries(r.primary).reduce((t,[i,o])=>{let u=(0,q$.getFieldCtx)(i,n,["variations",r.variation,"primary"]),s=(0,a.NestableLegacy)(u).decode(o);return!s||(0,Ux.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,q$.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,q$.getFieldCtx)("items",n,["variations",t.variation]);return(0,s.RepeatableWidgetsLegacy)(r).encode(t.items)})()||[];return{content:{primary:r.content,items:i.map(t=>t.content),variation:t.variation},types:{[n.keyOfType]:"SharedSlice",...r.types,...i.reduce((t,n)=>({...t,...n.types}),{})}}});t.SharedSliceLegacy=d,t.SharedSliceContent=r.strict({__TYPE__:r.literal(t.SharedSliceContentType),variation:r.string,primary:r.record(r.string,a.NestableContent),items:s.RepeatableWidgets}),t.sharedSliceContentWithDefaultValues=function(t,n){var r,i;let o=t.variations.find(t=>t.id===n.variation),a=null!==(r=null==o?void 0:o.primary)&&void 0!==r?r:{},s=null!==(i=null==o?void 0:o.items)&&void 0!==i?i:{},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,d;let f=null===(d=null===(l=null==i?void 0:i.fields)||void 0===l?void 0:l.primary)||void 0===d?void 0:d[u],p=s({path:t.concat([{key:"primary",type:"primary"},{key:u,type:"Widget"}]),key:u,apiId:r,model:f,content: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},{}),d=(0,o.traverseGroupItemsContent)({path:t.concat([{key:"items",type:"items"}]),model:null==i?void 0:i.fields.items,content:u.widget.items})(s);return c({key:n,apiId:r,path:t,model:i,content:{...u,widget:{__TYPE__:"SharedSliceContent",variation:u.widget.variation,primary:l,items:d}}})}}}(G5)),G5}var G8,G6={};function G7(){if(G8)return G6;G8=1,Object.defineProperty(G6,"__esModule",{value:!0}),G6.migrateSimpleSlice=G6.traverseSimpleSliceContent=G6.SimpleSliceLegacy=G6.isSimpleSliceContent=G6.SimpleSliceContent=void 0;let t=(0,n_.__importStar)(VC),n=GG(),r=GB();G6.SimpleSliceContent=t.union([r.NestableContent,n.GroupContent]);let i=t=>(0,r.isNestableContent)(t)||(0,n.isGroupContent)(t);G6.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 G6.SimpleSliceLegacy=o,G6.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 d=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 d&&s({key:r,apiId:i,path:t,model:o,content:{...a,widget:d}})}},G6.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:[]}}},G6}function Ze(){return Zt||(Zt=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SliceContent=t.SliceLegacy=void 0;let n=n_,r=(0,n.__importStar)(VC),i=G2(),o=G9(),a=G7(),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)(G2(),t),(0,n.__exportStar)(G9(),t),(0,n.__exportStar)(G7(),t)}(GJ)),GJ}var Zt,Zn,Zr={};function Zi(){if(Zn)return Zr;Zn=1,Object.defineProperty(Zr,"__esModule",{value:!0}),Zr.migrateSliceItem=Zr.SlicesItemLegacy=Zr.sliceItemContentWithDefaultValues=Zr.isSimpleSliceItemContent=Zr.isCompositeSliceItemContent=Zr.isSharedSliceItemContent=Zr.SliceItemContent=void 0;let t=n_,n=(0,t.__importStar)(VC),r=GG(),i=GB(),o=Gq(),a=Ze(),u=G2(),s=G9(),c=G7();function l(t){return(0,u.isCompositeSliceContent)(t.widget)}function d(t){return(0,r.isGroupContent)(t.widget)||(0,i.isNestableContent)(t.widget)}Zr.SliceItemContent=n.type({key:n.string,name:n.string,maybeLabel:n.union([n.string,n.undefined]),widget:a.SliceContent}),Zr.isSharedSliceItemContent=function(t){return(0,s.isSharedSliceContent)(t.widget)},Zr.isCompositeSliceItemContent=l,Zr.isSimpleSliceItemContent=d,Zr.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 f=n.exact(n.intersection([n.type({key:n.string,value:n.unknown}),n.partial({label:(0,VP.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)(f.decode(r),Ub.either.chain(o=>{var u;let s=o.key.indexOf("$"),c=o.key.substring(0,s>0?s:void 0),l=(0,q$.getFieldCtx)(c,t),d=(0,a.SliceLegacy)(l).decode(o.value);return!d||(0,Ux.isLeft)(d)?n.failure(r,i):n.success({key:o.key,name:c,maybeLabel:null!==(u=o.label)&&void 0!==u?u:void 0,widget:d.right})})),n=>{let r=(0,q$.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)||{}}});Zr.SlicesItemLegacy=p;let h=({model:t,content:n})=>l(n)&&(null==t?void 0:t.type)==="SharedSlice"?(0,u.migrateCompositeSlice)(t,n):d(n)&&(null==t?void 0:t.type)==="SharedSlice"?(0,c.migrateSimpleSlice)(t,n):n;return Zr.migrateSliceItem=h,Zr}var Zo,Za={};function Zu(){return Zs||(Zs=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=n_;(0,n.__exportStar)(Ze(),t),(0,n.__exportStar)(Zi(),t),(0,n.__exportStar)((Zo||(Zo=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=n_,r=(0,n.__importStar)(VC),i=qW(),o=G2(),a=G9(),u=G7(),s=Zi();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),Ub.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 d=i.value.reduce((n,i)=>{let d=r&&function(t,n,r){var i,o;let a=null===(o=null===(i=null==n?void 0:n.config)||void 0===i?void 0:i.choices)||void 0===o?void 0:o[r.name];return(()=>{if((0,s.isSharedSliceItemContent)(r)&&a&&(0,KT.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=VN.ContentPath.append(VN.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,KT.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,KT.isCompositeSlice)(a))return{type:"Slice","non-repeat":a["non-repeat"]||{},repeat:a.repeat||{}};if((0,KT.isLegacySlice)(a))return a}})()}(t,r,i),f=(0,s.isSharedSliceItemContent)(i)?(0,a.traverseSharedSliceContent)({path:t.concat({key:i.key,type:"SharedSlice"}),sliceKey:i.key,sliceName:i.name,model:(null==d?void 0:d.type)==="SharedSlice"?d:void 0,content:i})(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==d?void 0:d.type)==="Slice"||(null==d?void 0:d.type)==="SharedSlice"?d: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:d&&(null==d?void 0:d.type)!=="Slice"?d:void 0,content:i})(c,l):void 0;return f?n.concat(f):n},[]);return c({path:t,key:n,apiId:n,model:r,content:{__TYPE__:i.__TYPE__,value:d}})}}}(Za)),Za),t)}(GH)),GH}var Zs,Zc,Zl={};function Zd(){return Zc||(Zc=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.UIDContent=t.UIDLegacy=t.isUIDContent=t.UIDContentType=void 0;let n=n_,r=(0,n.__importStar)(VC),i=qW();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),Ub.either.map(n=>t.UIDContent.encode({value:n,__TYPE__:t.UIDContentType}))),t=>({content:t.value,types:{[n.keyOfType]:"UID"}}));t.UIDLegacy=a,t.UIDContent=r.type({__TYPE__:r.literal(t.UIDContentType),value:r.string})}(Zl)),Zl}var Zf,Zp={};function Zh(){return i||(i=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=n_;(0,n.__exportStar)(qB(),t),(0,n.__exportStar)(GG(),t),(0,n.__exportStar)(GB(),t),(0,n.__exportStar)(Zu(),t),(0,n.__exportStar)(Zd(),t),(0,n.__exportStar)(function(){if(Zf)return Zp;Zf=1,Object.defineProperty(Zp,"__esModule",{value:!0}),Zp.WidgetLegacy=Zp.isWidgetContent=Zp.WidgetContent=void 0;let t=(0,n_.__importStar)(VC),n=GG(),r=GB(),i=Zu(),o=Zd();Zp.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);Zp.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 Zp.WidgetLegacy=u,Zp}(),t)}(qF)),qF}Object.defineProperty(nO,"__esModule",{value:!0}),nO.migrateDocument=nO.collectWidgets=nO.traverseDocument=nO.fillDocumentWithDefaultValues=nO.DocumentLegacy=nO.Document=void 0;let Zm=n_,Zg=(0,Zm.__importStar)(VC),Zy=Zh();nO.Document=Zg.record(Vj.WidgetKey,Zy.WidgetContent);let Zv=Zg.record(Vj.WidgetKey,Zg.unknown),Zb=t=>new Zg.Type("Document",t=>!!t&&"object"==typeof t,n=>(0,US.pipe)(Zv.decode(n),Ub.either.map(n=>Object.entries(n).reduce((n,[r,i])=>{let o=(0,q$.defaultCtx)(r,t),a=(0,Zy.WidgetLegacy)(o).decode(i);return!a||(0,Ux.isLeft)(a)?n:{...n,[r]:a.right}},{}))),n=>Object.entries(n).reduce((n,[r,i])=>{let o=(0,q$.defaultCtx)(r,t),a=(0,Zy.WidgetLegacy)(o).encode(i);return a?{content:{...n.content,[r]:a.content},types:{...n.types,...a.types}}:n},{content:{},types:{}}));function Zx(t){let n=Object.entries(t),{types:r,widgets:i}=n.reduce((t,[n,r])=>{if(n.endsWith("_TYPE")){let i=q$.FieldOrSliceType.decode(r);if((0,Ux.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 ZM(t){return{customTypeId:null==t?void 0:t.id,fields:Object.fromEntries((0,KT.flattenSections)(t))}}function ZT({document:t,customType:n}){let r=n&&KT.StaticCustomType.is(n)?ZM(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=VN.ContentPath.make([{key:null==r?void 0:r.customTypeId,type:"CustomType"},{key:a,type:"Widget"}]),l=(()=>{switch(u.__TYPE__){case"SliceContentType":return(0,Zy.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,Zy.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 ZS(t,n){let r=KT.StaticCustomType.is(n)?ZM(n):n;return Object.values((0,KT.collectSharedSlices)(r)).some(t=>Boolean(t.legacyPaths))?ZT({document:t,customType:n})({transformSlice:Zy.migrateSliceItem}):t}nO.DocumentLegacy={_codec:Zb,extractMetadata:Zx,parse:function(t,n){let r=(0,US.pipe)(Zg.record(Vj.WidgetKey,Zg.unknown).decode(t),Ub.either.chain(t=>{let{types:n,widgets:r}=Zx(t);return Zb(n).decode(r)}));return(0,Ux.isLeft)(r)?void 0:ZS(r.right,n)},encode:function(t){let n=Zb().encode(t);return{...n.content,...n.types}}},nO.fillDocumentWithDefaultValues=function(t,n){let{fields:r}=t&&KT.StaticCustomType.is(t)?ZM(t):t;return Object.entries(r).reduce((t,[r,i])=>{let o=n[r],a=(()=>{switch(i.type){case"Group":return(0,Zy.isGroupContent)(o)?(0,Zy.groupContentWithDefaultValues)(i,o):o;case"Choice":case"Slices":return(0,Zy.isSlicesContent)(o)?(0,Zy.slicesContentWithDefaultValues)(i,o):o;default:return void 0===o&&KT.NestableWidget.is(i)?(0,Zy.NestableContentDefaultValue)(i):o}})();return a?{...t,[r]:a}:t},n)},nO.traverseDocument=ZT,nO.collectWidgets=function(t,n){let r={};return ZT({document:t})({transformWidget({content:t,path:i}){let o=VN.ContentPath.serialize(i);return n(t,i)&&(r[o]=t),t}}),r},nO.migrateDocument=ZS,function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=n_;(0,n.__exportStar)(nO,t),(0,n.__exportStar)(Zh(),t),(0,n.__exportStar)(q$,t)}(nI);let Zw=(0,o.createContext)({update(){}});function ZI(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 Z_(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 ZO(t){var n;let{content:r,field:i,id:o,readOnly:a,onContentChange: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:ZI(i)}),C.jsxs(u.JO,{children:[C.jsx(u.xu,{padding:4,alignItems:"center",children:C.jsx(u.xv,{children:Z_(i,c)})}),C.jsx(u.rs,{id:o,sx:{alignSelf:"center",marginLeft:"auto",marginRight:12},checked:c,onCheckedChange(t){var n;a||s((n=t,{__TYPE__:"BooleanContent",value:n}))}})]})]})}function Zk(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:ZI(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:Z_(r)})})})]})}function ZC(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:ZI(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,disabled:r,value:s,onValueChange:t=>a(function(t){if(t)return{__TYPE__:"FieldContent",type:"Date",value:function(t){let n=`${t.getFullYear()}`.padStart(4,"0"),r=`${t.getMonth()+1}`.padStart(2,"0"),i=`${t.getDate()}`.padStart(2,"0");return`${n}-${r}-${i}`}(t)}}(t))})})})]})}function ZN(t){return C.jsx(u.oi,{...t,padding:Zj})}let Zj={input:{inline:4},adornment:{inline:12}};function ZE(t){this.content=t}ZE.prototype={constructor:ZE,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 ZE(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 ZE(r)},addToStart:function(t,n){return new ZE([t,n].concat(this.remove(t).content))},addToEnd:function(t,n){var r=this.remove(t).content.slice();return r.push(t,n),new ZE(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 ZE(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=ZE.from(t)).size?new ZE(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=ZE.from(t)).size?new ZE(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var n=this;t=ZE.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}},ZE.from=function(t){if(t instanceof ZE)return t;var n=[];if(t)for(var r in t)n.push(r,t[r]);return new ZE(n)};class ZR{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 ZR(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 ZR(r,i)}cutByIndex(t,n){return t==n?ZR.empty:0==t&&n==this.content.length?this:new ZR(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 ZR(i,o)}addToStart(t){return new ZR([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new ZR(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 d=0,f=Math.min(s.text.length,c.text.length);for(;d<f&&s.text[s.text.length-d-1]==c.text[c.text.length-d-1];)d++,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 ZA(0,t);if(t==this.size)return ZA(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?ZA(r+1,o):ZA(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 ZR.empty;if(!Array.isArray(n))throw RangeError("Invalid input for Fragment.fromJSON");return new ZR(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return ZR.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 ZR(n||t,r)}static from(t){if(!t)return ZR.empty;if(t instanceof ZR)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new ZR([t],t.nodeSize);throw RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}ZR.empty=new ZR([],0);let ZD={index:0,offset:0};function ZA(t,n){return ZD.index=t,ZD.offset=n,ZD}function ZL(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(!ZL(t[i],n[i]))return!1}else{for(let o in t)if(!(o in n)||!ZL(t[o],n[o]))return!1;for(let a in n)if(!(a in t))return!1}return!0}let ZP=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&&ZL(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}};ZP.none=[];class ZF extends Error{}class Zz{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 Zz(r,this.openStart,this.openEnd)}removeBetween(t,n){return new Zz(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 Zz.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 Zz(ZR.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 Zz(t,r,i)}}function ZU(t,n){if(!n.type.compatibleContent(t.type))throw new ZF("Cannot join "+n.type.name+" onto "+t.type.name)}function ZW(t,n,r){let i=t.node(r);return ZU(i,n.node(r)),i}function ZB(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 ZV(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&&(ZB(t.nodeAfter,i),a++));for(let s=a;s<u;s++)ZB(o.child(s),i);n&&n.depth==r&&n.textOffset&&ZB(n.nodeBefore,i)}function Z$(t,n){return t.type.checkContent(n),t.copy(n)}function ZK(t,n,r){let i=[];return ZV(null,t,r,i),t.depth>r&&ZB(Z$(ZW(t,n,r+1),ZK(t,n,r+1)),i),ZV(n,null,r,i),new ZR(i)}Zz.empty=new Zz(ZR.empty,0,0);class ZY{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 ZP.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 ZQ(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 ZY(n,r,o)}static resolveCached(t,n){for(let r=0;r<Zq.length;r++){let i=Zq[r];if(i.pos==n&&i.doc==t)return i}let o=Zq[ZG]=ZY.resolve(t,n);return ZG=(ZG+1)%ZZ,o}}let Zq=[],ZG=0,ZZ=12;class ZQ{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 ZH=Object.create(null),ZJ=class t{constructor(t,n,r,i=ZP.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||ZR.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&&ZL(this.attrs,n||t.defaultAttrs||ZH)&&ZP.sameSet(this.marks,r||ZP.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 Zz.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 Zz(s,i.depth-a,o.depth-a)}replace(t,n,r){return function(t,n,r){if(r.openStart>t.depth)throw new ZF("Inserted content deeper than insertion position");if(t.depth-r.openStart!=n.depth-r.openEnd)throw new ZF("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 Z$(u,ZK(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(ZR.from(i));return{start:i.resolveNoCache(t.openStart+r),end:i.resolveNoCache(i.content.size-t.openEnd-r)}}(i,n);return Z$(u,function t(n,r,i,o,a){let u=n.depth>a&&ZW(n,r,a+1),s=o.depth>a&&ZW(i,o,a+1),c=[];return ZV(null,n,a,c),u&&s&&r.index(a)==i.index(a)?(ZU(u,s),ZB(Z$(u,t(n,r,i,o,a+1)),c)):(u&&ZB(Z$(u,ZK(n,r,a+1)),c),ZV(r,i,a,c),s&&ZB(Z$(s,ZK(i,o,a+1)),c)),ZV(o,null,a,c),new ZR(c)}(n,c,l,r,o))}{let d=n.parent,f=d.content;return Z$(d,f.cut(0,n.parentOffset).append(i.content).append(f.cut(r.parentOffset)))}}(t,n,r,0)}(this.resolve(t),this.resolve(n),r)}nodeAt(t){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(t);if(!(n=n.maybeChild(r)))return null;if(i==t||n.isText)return n;t-=i+1}}childAfter(t){let{index:n,offset:r}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(t){if(0==t)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(t);if(r<t)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(t){return ZY.resolveCached(this,t)}resolveNoCache(t){return ZY.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()+")"),Z0(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=ZR.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=ZP.none;for(let n=0;n<this.marks.length;n++)t=this.marks[n].addToSet(t);if(!ZP.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=ZR.fromJSON(t,n.content);return t.nodeType(n.type).create(n.attrs,i,r)}};ZJ.prototype.text=void 0;class ZX extends ZJ{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):Z0(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 ZX(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new ZX(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 Z0(t,n){for(let r=t.length-1;r>=0;r--)n=t[r].type.name+"("+n+")";return n}class Z1{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){var r;let i=new Z2(t,n);if(null==i.next)return Z1.empty;let o=Z4(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 d=n;for(let f=0;f<t.min;f++){let p=r();o(a(t.expr,d),p),d=p}if(-1==t.max)o(a(t.expr,d),d);else for(let h=t.min;h<t.max;h++){let m=r();i(d,m),o(a(t.expr,d),m),d=m}return[i(d)]}if("name"==t.type)return[i(n,void 0,t.value)];throw Error("Unknown expr type")}}}(o),a=Object.create(null),function t(n){let i=[];n.forEach(t=>{r[t].forEach(({term:t,to:n})=>{if(!t)return;let o;for(let a=0;a<i.length;a++)i[a][0]==t&&(o=i[a][1]);Qe(r,n).forEach(n=>{o||i.push([t,o=[]]),-1==o.indexOf(n)&&o.push(n)})})});let o=a[n.join(",")]=new Z1(n.indexOf(r.length-1)>-1);for(let u=0;u<i.length;u++){let s=i[u][1].sort(Z7);o.next.push({type:i[u][0],next:a[s.join(",")]||t(s)})}return o}(Qe(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 ZR.from(u.map(t=>t.createAndFill()));for(let c=0;c<a.next.length;c++){let{type:l,next:d}=a.next[c];if(!(l.isText||l.hasRequiredAttrs())&&-1==i.indexOf(d)){i.push(d);let f=o(d,u.concat(l));if(f)return f}}return null}(this,[])}findWrapping(t){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==t)return this.wrapCache[n+1];let r=this.computeWrapping(t);return this.wrapCache.push(t,r),r}computeWrapping(t){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(t)){let a=[];for(let u=i;u.type;u=u.via)a.push(u.type);return a.reverse()}for(let s=0;s<o.next.length;s++){let{type: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
|
+
`)}}Z1.empty=new Z1(!0);class Z2{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 Z4(t){let n=[];do n.push(Z3(t));while(t.eat("|"));return 1==n.length?n[0]:{type:"choice",exprs:n}}function Z3(t){let n=[];do n.push(Z5(t));while(t.next&&")"!=t.next&&"|"!=t.next);return 1==n.length?n[0]:{type:"seq",exprs:n}}function Z5(t){let n=Z6(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=Z8(t,n);else break;return n}function Z9(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let n=Number(t.next);return t.pos++,n}function Z8(t,n){let r=Z9(t),i=r;return t.eat(",")&&(i="}"!=t.next?Z9(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:r,max:i,expr:n}}function Z6(t){if(t.eat("(")){let n=Z4(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 Z7(t,n){return n-t}function Qe(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(Z7)}function Qt(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 Qn(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 Qr(t){let n=Object.create(null);if(t)for(let r in t)n[r]=new Qo(t[r]);return n}let Qi=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=Qr(r.attrs),this.defaultAttrs=Qt(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==Z1.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:Qn(this.attrs,t)}create(t=null,n,r){if(this.isText)throw Error("NodeType.create can't construct text nodes");return new ZJ(this,this.computeAttrs(t),ZR.from(n),ZP.setFrom(r))}createChecked(t=null,n,r){return n=ZR.from(n),this.checkContent(n),new ZJ(this,this.computeAttrs(t),n,ZP.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),(n=ZR.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(ZR.empty,!0);return a?new ZJ(this,t,n.append(a),ZP.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:ZP.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 Qo{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class Qa{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=Qr(i.attrs),this.excluded=null;let o=Qt(this.attrs);this.instance=o?new ZP(this,o):null}create(t=null){return!t&&this.instance?this.instance:new ZP(this,Qn(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,o)=>r[t]=new Qa(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 Qu{constructor(t){this.cached=Object.create(null);let n=this.spec={};for(let r in t)n[r]=t[r];n.nodes=ZE.from(t.nodes),n.marks=ZE.from(t.marks||{}),this.nodes=Qi.compile(this.spec.nodes,this),this.marks=Qa.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]=Z1.parse(u,this.nodes)),a.inlineContent=a.contentMatch.inlineContent,a.markSet="_"==s?null:s?Qs(this,s.split(" ")):""!=s&&a.inlineContent?null:[]}for(let c in this.marks){let l=this.marks[c],d=l.spec.excludes;l.excluded=null==d?[l]:""==d?[]:Qs(this,d.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,r,i){if("string"==typeof t)t=this.nodeType(t);else if(t instanceof Qi){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 ZX(r,r.defaultAttrs,t,ZP.setFrom(n))}mark(t,n){return"string"==typeof t&&(t=this.marks[t]),t.create(n)}nodeFromJSON(t){return ZJ.fromJSON(this,t)}markFromJSON(t){return ZP.fromJSON(this,t)}nodeType(t){let n=this.nodes[t];if(!n)throw RangeError("Unknown node type: "+t);return n}}function Qs(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 Qc{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 Qm(this,n,!1);return r.addAll(t,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new Qm(this,n,!0);return r.addAll(t,n.from,n.to),Zz.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(Qg(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=Qy(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=Qy(t)),t.node||t.ignore||t.mark||(t.node=a)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new Qc(t,Qc.schemaRules(t)))}}let Ql={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},Qd={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Qf={ol:!0,ul:!0};function Qp(t,n,r){return null!=n?(n?1:0)|("full"===n?2:0):t&&"pre"==t.whitespace?3:-5&r}class Qh{constructor(t,n,r,i,o,a,u){this.type=t,this.attrs=n,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=u,this.content=[],this.activeMarks=ZP.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(ZR.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=ZR.from(this.content);return!t&&this.match&&(i=i.append(this.match.fillBefore(ZR.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):Qv(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&&!Ql.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class Qm{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0;let i=n.topNode,o,a=Qp(null,n.preserveWhitespace,0)|(r?4:0);o=i?new Qh(i.type,i.attrs,ZP.none,ZP.none,!0,n.topMatch||i.type.contentMatch,a):r?new Qh(null,null,ZP.none,ZP.none,!0,null,a):new Qh(t.schema.topNodeType,null,ZP.none,ZP.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;Qf.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&&Qf.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:Qd.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(Ql.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=ZP.none,r=ZP.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=Qp(t,i,o.options);4&o.options&&0==o.content.length&&(a|=4),this.nodes.push(new Qh(t,n,o.activeMarks,o.pendingMarks,r,null,a)),this.open++}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(t){for(let n=this.open;n>=0;n--)if(this.nodes[n]==t)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)t+=r[i].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==t&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)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 Qg(t,n){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,n)}function Qy(t){let n={};for(let r in t)n[r]=t[r];return n}function Qv(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 Qb{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=QM(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}=Qb.renderSpec(QM(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&&Qb.renderSpec(QM(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 d=l.indexOf(" ");d>0?u.setAttributeNS(l.slice(0,d),l.slice(d+1),s[l]):u.setAttribute(l,s[l])}}for(let f=c;f<n.length;f++){let p=n[f];if(0===p){if(f<n.length-1||f>c)throw RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}{let{dom:h,contentDOM:m}=Qb.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 Qb(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=Qx(t.nodes);return n.text||(n.text=t=>t.text),n}static marksFromSchema(t){return Qx(t.marks)}}function Qx(t){let n={};for(let r in t){let i=t[r].spec.toDOM;i&&(n[r]=i)}return n}function QM(t){return t.document||window.document}function QT(t,n){return t+65536*n}function QS(t){return 65535&t}class Qw{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 QI{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&QI.empty)return QI.empty}recover(t){var n;let r=0,i=QS(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],d=s+c;if(t<=d){let f=c?t==s?-1:t==d?1:n:n,p=s+i+(f<0?0:l);if(r)return p;let h=t==(n<0?s:d)?null:QT(u/3,t-s),m=t==s?2:t==d?1:4;return(n<0?t!=s:t!=d)&&(m|=8),new Qw(p,m,h)}i+=l-c}return r?t+i:new Qw(t+i,0,null)}touches(t,n){let r=0,i=QS(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 QI(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?QI.empty:new QI(t<0?[0,-t,0]:[0,0,t])}}QI.empty=new QI([]);class Q_{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 Q_(this.maps,this.mirror,t,n)}copy(){return new Q_(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 Q_;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 Qw(t,i,null)}}let QO=Object.create(null);class Qk{getMap(){return QI.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw RangeError("Invalid input for Step.fromJSON");let r=QO[n.stepType];if(!r)throw RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in QO)throw RangeError("Duplicate use of step JSON ID "+t);return QO[t]=n,n.prototype.jsonID=t,n}}class QC{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new QC(t,null)}static fail(t){return new QC(null,t)}static fromReplace(t,n,r,i){try{return QC.ok(t.replace(n,r,i))}catch(o){if(o instanceof ZF)return QC.fail(o.message);throw o}}}function QN(t,n,r){let i=[];for(let o=0;o<t.childCount;o++){let a=t.child(o);a.content.size&&(a=a.copy(QN(a.content,n,a))),a.isInline&&(a=n(a,r,o)),i.push(a)}return ZR.fromArray(i)}class Qj extends Qk{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 Zz(QN(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 QC.fromReplace(t,this.from,this.to,o)}invert(){return new QE(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 Qj(n.pos,r.pos,this.mark)}merge(t){return t instanceof Qj&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Qj(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 Qj(n.from,n.to,t.markFromJSON(n.mark))}}Qk.jsonID("addMark",Qj);class QE extends Qk{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 Zz(QN(n.content,t=>t.mark(this.mark.removeFromSet(t.marks)),t),n.openStart,n.openEnd);return QC.fromReplace(t,this.from,this.to,r)}invert(){return new Qj(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 QE(n.pos,r.pos,this.mark)}merge(t){return t instanceof QE&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new QE(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 QE(n.from,n.to,t.markFromJSON(n.mark))}}Qk.jsonID("removeMark",QE);class QR extends Qk{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return QC.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return QC.fromReplace(t,this.pos,this.pos+1,new Zz(ZR.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 QR(this.pos,n.marks[i]);return new QR(this.pos,this.mark)}}return new QD(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new QR(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 QR(n.pos,t.markFromJSON(n.mark))}}Qk.jsonID("addNodeMark",QR);class QD extends Qk{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return QC.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return QC.fromReplace(t,this.pos,this.pos+1,new Zz(ZR.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return n&&this.mark.isInSet(n.marks)?new QR(this.pos,this.mark):this}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new QD(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 QD(n.pos,t.markFromJSON(n.mark))}}Qk.jsonID("removeNodeMark",QD);class QA extends Qk{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&QP(t,this.from,this.to)?QC.fail("Structure replace would overwrite content"):QC.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new QI([this.from,this.to-this.from,this.slice.size])}invert(t){return new QA(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 QA(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof QA)||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?Zz.empty:new Zz(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new QA(t.from,this.to,n,this.structure)}}{let r=this.slice.size+t.slice.size==0?Zz.empty:new Zz(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new QA(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 QA(n.from,n.to,Zz.fromJSON(t,n.slice),!!n.structure)}}Qk.jsonID("replace",QA);class QL extends Qk{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&&(QP(t,this.from,this.gapFrom)||QP(t,this.gapTo,this.to)))return QC.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return QC.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?QC.fromReplace(t,this.from,this.to,r):QC.fail("Content does not fit in gap")}getMap(){return new QI([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 QL(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 QL(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 QL(n.from,n.to,n.gapFrom,n.gapTo,Zz.fromJSON(t,n.slice),n.insert,!!n.structure)}}function QP(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 QF(t,n,r){return(0==n||t.canReplace(n,t.childCount))&&(r==t.childCount||t.canReplace(0,r))}function Qz(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||!QF(i,o,a))break}return null}function QU(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(QW).concat({type:n,attrs:r}).concat(a.map(QW)):null}function QW(t){return{type:t,attrs:null}}function QB(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),d=o.index(s);if(l.type.spec.isolating)return!1;let f=l.content.cutByIndex(d,l.childCount),p=i&&i[c+1];p&&(f=f.replaceChild(0,p.type.create(p.attrs)));let h=i&&i[c]||l;if(!l.canReplace(d+1,l.childCount)||!h.type.validContent(f))return!1}let m=o.indexAfter(a),g=i&&i[0];return o.node(a).canReplaceWith(m,m,g?g.type:o.node(a+1).type)}function QV(t,n){let r=t.resolve(n),i=r.index();return Q$(r.nodeBefore,r.nodeAfter)&&r.parent.canReplace(i,i+1)}function Q$(t,n){return!!(t&&n&&!t.isLeaf&&t.canAppend(n))}function QK(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&&Q$(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 QY(t,n,r=n,i=Zz.empty){if(n==r&&!i.size)return null;let o=t.resolve(n),a=t.resolve(r);return Qq(o,a,i)?new QA(n,r,i):new QG(o,a,i).fit()}function Qq(t,n,r){return!r.openStart&&!r.openEnd&&t.start()==n.start()&&t.parent.canReplace(t.index(),n.index(),r.content)}Qk.jsonID("replaceAround",QL);class QG{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=ZR.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=ZR.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 Zz(a,u,s);return n>-1?new QL(i.pos,n,this.$to.pos,this.$to.end(),c,r):c.size||i.pos!=this.$to.pos?new QA(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=QH(this.unplaced.content,u-1).firstChild).content:this.unplaced.content).firstChild;for(let d=this.depth;d>=0;d--){let{type:f,match:p}=this.frontier[d],h,m=null;if(1==a&&(l?p.matchType(l.type)||(m=p.fillBefore(ZR.from(l),!1)):c&&f.compatibleContent(c.type)))return{sliceDepth:u,frontierDepth:d,parent:c,inject:m};if(2==a&&l&&(h=p.findWrapping(l.type)))return{sliceDepth:u,frontierDepth:d,parent:c,wrap:h};if(c&&p.matchType(c.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=QH(t,n);return!!i.childCount&&!i.firstChild.isLeaf&&(this.unplaced=new Zz(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=QH(t,n);if(i.childCount<=1&&n>0){let o=t.size-n<=n+i.size;this.unplaced=new Zz(QZ(t,n-1,1),n-1,o?n-1:r)}else this.unplaced=new Zz(QZ(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,d=[],{match:f,type:p}=this.frontier[n];if(i){for(let h=0;h<i.childCount;h++)d.push(i.child(h));f=f.matchFragment(i)}let m=s.size+t-(u.content.size-u.openEnd);for(;l<s.childCount;){let g=s.child(l),y=f.matchType(g.type);if(!y)break;(++l>1||0==c||g.content.size)&&(f=y,d.push(QJ(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=QQ(this.placed,n,ZR.from(d)),this.frontier[n].match=f,v&&m<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let b=0,x=s;b<m;b++){let M=x.lastChild;this.frontier.push({type:M.type,match:M.contentMatchAt(M.childCount)}),x=M.content}this.unplaced=v?0==t?Zz.empty:new Zz(QZ(u.content,t-1,1),t-1,m<0?u.openEnd:t-1):new Zz(QZ(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||!QX(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=QX(t,n,i,r,o);if(a){for(let u=n-1;u>=0;u--){let{match:s,type:c}=this.frontier[u],l=QX(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=QQ(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=QQ(this.placed,this.depth,ZR.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(ZR.empty,!0);t.childCount&&(this.placed=QQ(this.placed,this.frontier.length,t))}}function QZ(t,n,r){return 0==n?t.cutByIndex(r,t.childCount):t.replaceChild(0,t.firstChild.copy(QZ(t.firstChild.content,n-1,r)))}function QQ(t,n,r){return 0==n?t.append(r):t.replaceChild(t.childCount-1,t.lastChild.copy(QQ(t.lastChild.content,n-1,r)))}function QH(t,n){for(let r=0;r<n;r++)t=t.firstChild.content;return t}function QJ(t,n,r){if(n<=0)return t;let i=t.content;return n>1&&(i=i.replaceChild(0,QJ(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(ZR.empty,!0)))),t.copy(i)}function QX(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 Q0(t){return t.spec.defining||t.spec.definingForContent}function Q1(t,n,r,i,o){if(n<r){let a=t.firstChild;t=t.replaceChild(0,a.copy(Q1(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(ZR.empty,!0))}return t}function Q2(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 Q4 extends Qk{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 QC.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 QC.fromReplace(t,this.pos,this.pos+1,new Zz(ZR.from(o),0,n.isLeaf?0:1))}getMap(){return QI.empty}invert(t){return new Q4(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 Q4(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 Q4(n.pos,n.attr,n.value)}}Qk.jsonID("attr",Q4);let Q3=class extends Error{};(Q3=function t(n){let r=Error.call(this,n);return r.__proto__=t.prototype,r}).prototype=Object.create(Error.prototype),Q3.prototype.constructor=Q3,Q3.prototype.name="TransformError";class Q5{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new Q_}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new Q3(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=Zz.empty){let i=QY(this.doc,t,n,r);return i&&this.step(i),this}replaceWith(t,n,r){return this.replace(t,n,new Zz(ZR.from(r),0,0))}delete(t,n){return this.replace(t,n,Zz.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(Qq(o,a,i))return t.step(new QA(n,r,i));let u=Q2(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 d=o.node(c).type.spec;if(d.defining||d.definingAsContext||d.isolating)break;u.indexOf(c)>-1?s=c:o.before(c)==l&&u.splice(1,0,-c)}let f=u.indexOf(s),p=[],h=i.openStart;for(let m=i.content,g=0;;g++){let y=m.firstChild;if(p.push(y),g==i.openStart)break;m=y.content}for(let v=h-1;v>=0;v--){let b=p[v].type,x=Q0(b);if(x&&o.node(f).type!=b)h=v;else if(x||!b.isTextblock)break}for(let M=i.openStart;M>=0;M--){let T=(M+h+1)%(i.openStart+1),S=p[T];if(S)for(let w=0;w<u.length;w++){let I=u[(w+f)%u.length],_=!0;I<0&&(_=!1,I=-I);let O=o.node(I-1),k=o.index(I-1);if(O.canReplaceWith(k,k,S.type,S.marks))return t.replace(o.before(I),_?a.after(I):r,new Zz(Q1(i.content,0,i.openStart,T),T,i.openEnd))}}let C=t.steps.length;for(let N=u.length-1;N>=0&&(t.replace(n,r,i),!(t.steps.length>C));N--){let j=u[N];j<0||(n=o.before(j),r=a.after(j))}}(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 Zz(ZR.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=Q2(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,d=ZR.empty,f=0;for(let p=a,h=!1;p>r;p--)h||i.index(p)>0?(h=!0,d=ZR.from(i.node(p).copy(d)),f++):c--;let m=ZR.empty,g=0;for(let y=a,v=!1;y>r;y--)v||o.after(y+1)<o.end(y)?(v=!0,m=ZR.from(o.node(y).copy(m)),g++):l++;t.step(new QL(c,l,u,s,new Zz(d.append(m),f,g),d.size-f,!0))}(this,t,n),this}join(t,n=1){return function(t,n,r){let i=new QA(n-r,n+r,Zz.empty,!0);t.step(i)}(this,t,n),this}wrap(t,n){return function(t,n,r){let i=ZR.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=ZR.from(r[o].type.create(r[o].attrs,i))}let u=n.start,s=n.end;t.step(new QL(u,s,u,s,new Zz(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,d;if(n.isTextblock&&!n.hasMarkup(i,o)&&(u=t.doc,s=t.mapping.slice(a).map(r),c=i,l=u.resolve(s),d=l.index(),l.parent.canReplaceWith(d,d+1,c))){t.clearIncompatible(t.mapping.slice(a).map(r,1),i);let f=t.mapping.slice(a),p=f.map(r,1),h=f.map(r+n.nodeSize,1);return t.step(new QL(p,h,p+1,h-1,new Zz(ZR.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 QL(n,n+a.nodeSize,n+1,n+a.nodeSize-1,new Zz(ZR.from(u),0,0),1,!0))}(this,t,n,r,i),this}setNodeAttribute(t,n,r){return this.step(new Q4(t,n,r)),this}addNodeMark(t,n){return this.step(new QR(t,n)),this}removeNodeMark(t,n){if(!(n instanceof ZP)){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 QD(t,n)),this}split(t,n=1,r){return function(t,n,r=1,i){let o=t.doc.resolve(n),a=ZR.empty,u=ZR.empty;for(let s=o.depth,c=o.depth-r,l=r-1;s>c;s--,l--){a=ZR.from(o.node(s).copy(a));let d=i&&i[l];u=ZR.from(d?d.type.create(d.attrs,u):o.node(s).copy(u))}t.step(new QA(n,n,new Zz(a.append(u),r,r),!0))}(this,t,n,r),this}addMark(t,n,r){var i,o,a,u;let s,c,l,d;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 f=Math.max(o,t),p=Math.min(o+i.nodeSize,n),h=r.addToSet(u);for(let m=0;m<u.length;m++)u[m].isInSet(h)||(l&&l.to==f&&l.mark.eq(u[m])?l.to=p:s.push(l=new QE(f,p,u[m])));d&&d.to==f?d.to=p:c.push(d=new Qj(f,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 Qa){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 d=Math.min(o+i.nodeSize,n);for(let f=0;f<a.length;f++){let p=a[f],h;for(let m=0;m<s.length;m++){let g=s[m];g.step==c-1&&p.eq(s[m].style)&&(h=g)}h?(h.to=d,h.step=c):s.push({style:p,from:Math.max(o,t),to:d,step:c})}}}),s.forEach(t=>i.step(new QE(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,d=i.matchType(c.type);if(d){i=d;for(let f=0;f<c.marks.length;f++)r.allowsMarkType(c.marks[f].type)||t.step(new QE(u,l,c.marks[f]))}else a.push(new QA(u,l,Zz.empty));u=l}if(!i.validEnd){let p=i.fillBefore(ZR.empty,!0);t.replace(u,u,new Zz(p,0,0))}for(let h=a.length-1;h>=0;h--)t.step(a[h])}(this,t,n,r),this}}let Q9=Object.create(null);class Q8{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new Q6(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=Zz.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],d=t.mapping.slice(a);t.replaceRange(d.map(c.pos),d.map(l.pos),s?Zz.empty:n),0==s&&Hs(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),Hs(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let i=t.parent.inlineContent?new Ht(t):Hu(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?Hu(t.node(0),t.node(o),t.before(o+1),t.index(o),n,r):Hu(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 Ho(t.node(0))}static atStart(t){return Hu(t,t,0,0,1)||new Ho(t)}static atEnd(t){return Hu(t,t,t.content.size,t.childCount,-1)||new Ho(t)}static fromJSON(t,n){if(!n||!n.type)throw RangeError("Invalid input for Selection.fromJSON");let r=Q9[n.type];if(!r)throw RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in Q9)throw RangeError("Duplicate use of selection JSON ID "+t);return Q9[t]=n,n.prototype.jsonID=t,n}getBookmark(){return Ht.between(this.$anchor,this.$head).getBookmark()}}Q8.prototype.visible=!0;class Q6{constructor(t,n){this.$from=t,this.$to=n}}let Q7=!1;function He(t){Q7||t.parent.inlineContent||(Q7=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Ht extends Q8{constructor(t,n=t){He(t),He(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 Q8.near(r);let i=t.resolve(n.map(this.anchor));return new Ht(i.parent.inlineContent?i:r,r)}replace(t,n=Zz.empty){if(super.replace(t,n),n==Zz.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof Ht&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Hn(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 Ht(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=Q8.findFrom(n,r,!0)||Q8.findFrom(n,-r,!0);if(!o)return Q8.near(n,r);n=o.$head}return t.parent.inlineContent||(0==i?t=n:(t=(Q8.findFrom(t,-r,!0)||Q8.findFrom(t,r,!0)).$anchor).pos<n.pos!=i<0&&(t=n)),new Ht(t,n)}}Q8.jsonID("text",Ht);class Hn{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Hn(t.map(this.anchor),t.map(this.head))}resolve(t){return Ht.between(t.resolve(this.anchor),t.resolve(this.head))}}class Hr extends Q8{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?Q8.near(o):new Hr(o)}content(){return new Zz(ZR.from(this.node),0,0)}eq(t){return t instanceof Hr&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Hi(this.anchor)}static fromJSON(t,n){if("number"!=typeof n.anchor)throw RangeError("Invalid input for NodeSelection.fromJSON");return new Hr(t.resolve(n.anchor))}static create(t,n){return new Hr(t.resolve(n))}static isSelectable(t){return!t.isText&&!1!==t.type.spec.selectable}}Hr.prototype.visible=!1,Q8.jsonID("node",Hr);class Hi{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new Hn(r,r):new Hi(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&Hr.isSelectable(r)?new Hr(n):Q8.near(n)}}class Ho extends Q8{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=Zz.empty){if(n==Zz.empty){t.delete(0,t.doc.content.size);let r=Q8.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new Ho(t)}map(t){return new Ho(t)}eq(t){return t instanceof Ho}getBookmark(){return Ha}}Q8.jsonID("all",Ho);let Ha={map(){return this},resolve:t=>new Ho(t)};function Hu(t,n,r,i,o,a=!1){if(n.inlineContent)return Ht.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&&Hr.isSelectable(s))return Hr.create(t,r-(o<0?s.nodeSize:0))}else{let c=Hu(t,s,r+o,o<0?s.childCount:0,o,a);if(c)return c}r+=s.nodeSize*o}return null}function Hs(t,n,r){let i=t.steps.length-1;if(i<n)return;let o=t.steps[i];if(!(o instanceof QA||o instanceof QL))return;let a;t.mapping.maps[i].forEach((t,n,r,i)=>{null==a&&(a=i)}),t.setSelection(Q8.near(t.doc.resolve(a),r))}class Hc extends Q5{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 ZP.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)||ZP.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(Q8.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 Hl(t,n){return n&&t?t.bind(n):t}class Hd{constructor(t,n,r){this.name=t,this.init=Hl(n.init,r),this.apply=Hl(n.apply,r)}}let Hf=[new Hd("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new Hd("selection",{init:(t,n)=>t.selection||Q8.atStart(n.doc),apply:t=>t.selection}),new Hd("storedMarks",{init:t=>t.storedMarks||null,apply:(t,n,r,i)=>i.selection.$cursor?t.storedMarks:null}),new Hd("scrollToSelection",{init:()=>0,apply:(t,n)=>t.scrolledIntoView?n+1:n})];class Hp{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Hf.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 Hd(t.key,t.spec.state,t))})}}class Hh{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 d=0;d<this.config.plugins.length;d++)i.push(d<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 Hh(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 Hc(this)}static create(t){let n=new Hp(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new Hh(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 Hp(this.schema,t.plugins),r=n.fields,i=new Hh(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 Hp(t.schema,t.plugins),o=new Hh(i);return i.fields.forEach(i=>{if("doc"==i.name)o.doc=ZJ.fromJSON(t.schema,n.doc);else if("selection"==i.name)o.selection=Q8.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 Hm{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:Hy("plugin")}getState(t){return t[this.key]}}let Hg=Object.create(null);function Hy(t){return t in Hg?t+"$"+ ++Hg[t]:(Hg[t]=0,t+"$")}class Hv{constructor(t="key"){this.key=Hy(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}let Hb=function(t){for(var n=0;;n++)if(!(t=t.previousSibling))return n},Hx=function(t){let n=t.assignedSlot||t.parentNode;return n&&11==n.nodeType?n.host:n},HM=null,HT=function(t,n,r){let i=HM||(HM=document.createRange());return i.setEnd(t,r??t.nodeValue.length),i.setStart(t,n||0),i},HS=function(t,n,r,i){return r&&(HI(t,n,r,i,-1)||HI(t,n,r,i,1))},Hw=/^(img|br|input|textarea|hr)$/i;function HI(t,n,r,i,o){for(;;){if(t==r&&n==i)return!0;if(n==(o<0?0:H_(t))){let a=t.parentNode;if(!a||1!=a.nodeType||HO(t)||Hw.test(t.nodeName)||"false"==t.contentEditable)return!1;n=Hb(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?H_(t):0}}}function H_(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function HO(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 Hk=function(t){return t.focusNode&&HS(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function HC(t,n){let r=document.createEvent("Event");return r.initEvent("keydown",!0,!0),r.keyCode=t,r.key=r.code=n,r}function HN(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 Hj="u">typeof navigator?navigator:null,HE="u">typeof document?document:null,HR=Hj&&Hj.userAgent||"",HD=/Edge\/(\d+)/.exec(HR),HA=/MSIE \d/.exec(HR),HL=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(HR),HP=!!(HA||HL||HD),HF=HA?document.documentMode:HL?+HL[1]:HD?+HD[1]:0,Hz=!HP&&/gecko\/(\d+)/i.test(HR);Hz&&(/Firefox\/(\d+)/.exec(HR)||[0,0])[1];let HU=!HP&&/Chrome\/(\d+)/.exec(HR),HW=!!HU,HB=HU?+HU[1]:0,HV=!HP&&!!Hj&&/Apple Computer/.test(Hj.vendor),H$=HV&&(/Mobile\/\w+/.test(HR)||!!Hj&&Hj.maxTouchPoints>2),HK=H$||!!Hj&&/Mac/.test(Hj.platform),HY=!!Hj&&/Win/.test(Hj.platform),Hq=/Android \d/.test(HR),HG=!!HE&&"webkitFontSmoothing"in HE.documentElement.style,HZ=HG?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function HQ(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function HH(t,n){return"number"==typeof t?t:t[n]}function HJ(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 HX(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=Hx(u)){if(1!=u.nodeType)continue;let s=u,c=s==a.body,l=c?HQ(a):HJ(s),d=0,f=0;if(n.top<l.top+HH(i,"top")?f=-(l.top-n.top+HH(o,"top")):n.bottom>l.bottom-HH(i,"bottom")&&(f=n.bottom-l.bottom+HH(o,"bottom")),n.left<l.left+HH(i,"left")?d=-(l.left-n.left+HH(o,"left")):n.right>l.right-HH(i,"right")&&(d=n.right-l.right+HH(o,"right")),d||f){if(c)a.defaultView.scrollBy(d,f);else{let p=s.scrollLeft,h=s.scrollTop;f&&(s.scrollTop+=f),d&&(s.scrollLeft+=d);let m=s.scrollLeft-p,g=s.scrollTop-h;n={left:n.left-m,top:n.top-g,right:n.right-m,bottom:n.bottom-g}}}if(c)break}}function H0(t){let n=[],r=t.ownerDocument;for(let i=t;i&&(n.push({dom:i,top:i.scrollTop,left:i.scrollLeft}),t!=r);i=Hx(i));return n}function H1(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 H2=null;function H4(t,n){return t.left>=n.left-1&&t.left<=n.right+1&&t.top>=n.top-1&&t.top<=n.bottom+1}function H3(t){return t.top<t.bottom||t.left<t.right}function H5(t,n){let r=t.getClientRects();if(r.length){let i=r[n<0?0:r.length-1];if(H3(i))return i}return Array.prototype.find.call(r,H3)||t.getBoundingClientRect()}let H9=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function H8(t,n,r){let{node:i,offset:o,atom:a}=t.docView.domFromPos(n,r<0?-1:1),u=HG||Hz;if(3==i.nodeType){if(u&&(H9.test(i.nodeValue)||(r<0?!o:o==i.nodeValue.length))){let s=H5(HT(i,o,o),r);if(Hz&&o&&/\s/.test(i.nodeValue[o-1])&&o<i.nodeValue.length){let c=H5(HT(i,o-1,o-1),-1);if(c.top==s.top){let l=H5(HT(i,o,o+1),-1);if(l.top!=s.top)return H6(l,l.left<c.left)}}return s}{let d=o,f=o,p=r<0?1:-1;return r<0&&!o?(f++,p=-1):r>=0&&o==i.nodeValue.length?(d--,p=1):r<0?d--:f++,H6(H5(HT(i,d,f),p),p<0)}}if(!t.state.doc.resolve(n-(a||0)).parent.inlineContent){if(null==a&&o&&(r<0||o==H_(i))){let h=i.childNodes[o-1];if(1==h.nodeType)return H7(h.getBoundingClientRect(),!1)}if(null==a&&o<H_(i)){let m=i.childNodes[o];if(1==m.nodeType)return H7(m.getBoundingClientRect(),!0)}return H7(i.getBoundingClientRect(),r>=0)}if(null==a&&o&&(r<0||o==H_(i))){let g=i.childNodes[o-1],y=3==g.nodeType?HT(g,H_(g)-(u?0:1)):1!=g.nodeType||"BR"==g.nodeName&&g.nextSibling?null:g;if(y)return H6(H5(y,1),!1)}if(null==a&&o<H_(i)){let v=i.childNodes[o];for(;v.pmViewDesc&&v.pmViewDesc.ignoreForCoords;)v=v.nextSibling;let b=v?3==v.nodeType?HT(v,0,u?0:1):1==v.nodeType?v:null:null;if(b)return H6(H5(b,-1),!0)}return H6(H5(3==i.nodeType?HT(i):i,-r),r>=0)}function H6(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 H7(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 Je(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 Jt=/[\u0590-\u08ac]/,Jn=null,Jr=null,Ji=!1;class Jo{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>Hb(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 Jf){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 Ja&&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?Hb(c.dom)+1:0}}{let d,f=!0;for(;!(!(d=r<this.children.length?this.children[r]:null)||d.dom.parentNode==this.contentDOM);r++,f=!1);return d&&f&&!d.border&&!d.domAtom?d.domFromPos(0,n):{node:this.contentDOM,offset:d?Hb(d.dom):this.contentDOM.childNodes.length}}}parseRange(t,n,r=0){if(0==this.children.length)return{node:this.contentDOM,from:t,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let a=r,u=0;;u++){let s=this.children[u],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 d=u;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){i=Hb(f.dom)+1;break}t-=f.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=Hb(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 d=this.domFromPos(t,t?-1:1),f=n==t?d:this.domFromPos(n,n?-1:1),p=r.getSelection(),h=!1;if((Hz||HV)&&t==n){let{node:m,offset:g}=d;if(3==m.nodeType){if((h=!!(g&&m.nodeValue[g-1]==`
|
|
9
|
+
`))&&g==m.nodeValue.length)for(let y=m,v;y;y=y.parentNode){if(v=y.nextSibling){"BR"==v.nodeName&&(d=f={node:v.parentNode,offset:Hb(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(Hz&&p.focusNode&&p.focusNode!=f.node&&1==p.focusNode.nodeType){let M=p.focusNode.childNodes[p.focusOffset];M&&"false"==M.contentEditable&&(i=!0)}if(!(i||h&&HV)&&HS(d.node,d.offset,p.anchorNode,p.anchorOffset)&&HS(f.node,f.offset,p.focusNode,p.focusOffset))return;let T=!1;if((p.extend||t==n)&&!h){p.collapse(d.node,d.offset);try{t!=n&&p.extend(f.node,f.offset),T=!0}catch{}}if(!T){if(t>n){let S=d;d=f,f=S}let w=document.createRange();w.setEnd(f.node,f.offset),w.setStart(d.node,d.offset),p.removeAllRanges(),p.addRange(w)}}ignoreMutation(t){return!this.contentDOM&&"selection"!=t.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,n){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],a=r+o.size;if(r==a?t<=a&&n>=r:t<a&&n>r){let u=r+o.border,s=a-o.border;if(t>=u&&n<=s){this.dirty=t==r||n==a?2:1,t==u&&n==s&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=3:o.markDirty(t-u,n-u);return}o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}r=a}this.dirty=2}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=1==t?2:1;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class Ja extends Jo{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 Ju extends Jo{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 Js extends Jo{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=Qb.renderSpec(document,n.type.spec.toDOM(n,r))),new Js(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=Js.create(this.parent,this.mark,!0,r),o=this.children,a=this.size;n<a&&(o=Jw(o,n,a,r)),t>0&&(o=Jw(o,0,t,r));for(let u=0;u<o.length;u++)o[u].parent=i;return i.children=o,i}}class Jc extends Jo{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,d=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:d}=Qb.renderSpec(document,n.type.spec.toDOM(n)));d||n.isText||"BR"==l.nodeName||(l.hasAttribute("contenteditable")||(l.contentEditable="false"),n.type.spec.draggable&&(l.draggable=!0));let f=l;return l=Jb(l,r,n),c?s=new Jp(t,n,r,i,l,d||null,f,c,o,a+1):n.isText?new Jd(t,n,r,i,l,f,o):new Jc(t,n,r,i,l,d||null,f,o,a+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(t.preserveWhitespace="full"),this.contentDOM){if(this.contentLost){for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=()=>ZR.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)&&Jx(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 JT(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=[],d=null;for(let f=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(JS);for(let m=0;m<h.length;m++)r(h[m],f,!!d)}else r(p,f,!!d)}let g,y;if(d)y=-1,g=d,d=null;else if(f<t.childCount)y=f,g=t.child(f++);else break;for(let v=0;v<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 M=0;M<l.length;M++)l[M].to<x&&(x=l[M].to);x<b&&(d=g.cut(x-a),g=g.cut(0,x-a),b=x,y=-1)}let T=g.isInline&&!g.isLeaf?l.filter(t=>!t.inline):l.slice();i(g,T,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?ZP.none:this.node.child(o).marks,r,t),s.placeWidget(n,t,i)},(n,a,c,l)=>{s.syncToMarks(n.marks,r,t);let d;s.findNodeMatch(n,a,c,l)||u&&t.state.selection.from>i&&t.state.selection.to<i+n.nodeSize&&(d=s.findIndexWithChild(o.node))>-1&&s.updateNodeAt(n,a,c,d,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=JM(o),a=!0;o=o.nextSibling}else a=!0,n.insertBefore(c,o);if(s instanceof Js){let l=o?o.previousSibling:n.lastChild;t(s.contentDOM,s.children,i),o=l?l.nextSibling:n.firstChild}}for(;o;)o=JM(o),a=!0;a&&i.trackWrites==n&&(i.trackWrites=null)}(this.contentDOM,this.children,t),H$&&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 Ht)||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=H_(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 Ju(this,o,n,i);t.input.compositionNodes.push(a),this.children=Jw(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(Jx(t,this.outerDeco))return;let n=1!=this.nodeDOM.nodeType,r=this.dom;this.dom=Jy(this.dom,this.nodeDOM,Jg(this.outerDeco,this.node,n),Jg(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 Jl(t,n,r,i,o){Jb(i,n,t);let a=new Jc(void 0,t,n,r,i,i,i,o,0);return a.contentDOM&&a.updateChildren(o,0),a}class Jd extends Jc{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 Jd(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 Jf extends Jo{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 Jp extends Jc{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 Jh=function(t){t&&(this.nodeName=t)};Jh.prototype=Object.create(null);let Jm=[new Jh];function Jg(t,n,r){if(0==t.length)return Jm;let i=r?Jm[0]:new Jh,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 Jh(u.nodeName)),u){let c=u[s];null!=c&&(r&&1==o.length&&o.push(i=new Jh(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 Jy(t,n,r,i){if(r==Jm&&i==Jm)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=Jm[0]),o=c}Jv(o,s||Jm[0],u)}return o}function Jv(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,d;for(;d=l.exec(n.style);)t.style.removeProperty(d[1])}r.style&&(t.style.cssText+=r.style)}}function Jb(t,n,r){return Jy(t,t,Jm,Jg(n,r,1!=t.nodeType))}function Jx(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 JM(t){let n=t.nextSibling;return t.parentNode.removeChild(t),n}class JT{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 Js)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=Js.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 Jc){let c=this.preMatch.matched.get(s);if(null!=c&&c!=o)return!1;let l=s.dom,d,f=this.isLocked(l)&&!(t.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==t.text&&3!=s.dirty&&Jx(n,s.outerDeco));if(!f&&s.update(t,n,r,i))return this.destroyBetween(this.index,u),s.dom!=l&&(this.changed=!0),this.index++,!0;if(!f&&(d=this.recreateWrapper(s,t,n,r,i,a)))return this.top.children[this.index]=d,d.dirty=2,d.updateChildren(i,a+1),d.dirty=0,this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(t,n,r,i,o,a){if(t.dirty||n.isAtom||!t.children.length||!t.node.content.eq(n.content))return null;let u=Jc.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=Jc.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 Ja(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 Js;)t=(n=t).children[n.children.length-1];(!t||!(t instanceof Jd)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((HV||HW)&&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 Jf(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 JS(t,n){return t.type.side-n.type.side}function Jw(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 JI(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(Hk(r)){for(c=s;o&&!o.node;)o=o.parent;let d=o.node;if(o&&d.isAtom&&Hr.isSelectable(d)&&o.parent&&!(d.isInline&&function(t,n,r){for(let i=0==n,o=n==H_(t);i||o;){if(t==r)return!0;let a=Hb(t);if(!(t=t.parentNode))return!1;i=i&&0==a,o=o&&a==H_(t)}}(r.focusNode,r.focusOffset,o.dom))){let f=o.posBefore;l=new Hr(u==f?s:i.resolve(f))}}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=JD(t,c,s,h)}return l}function J_(t){return t.editable?t.hasFocus():JL(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function JO(t,n=!1){let r=t.state.selection;if(JE(t,r),J_(t)){var i,o;if(!n&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&HW){let a=t.domSelectionRange(),u=t.domObserver.currentSelection;if(a.anchorNode&&u.anchorNode&&HS(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,d;i=t,s=i.domSelection(),c=document.createRange(),l=i.cursorWrapper.dom,d="IMG"==l.nodeName,d?c.setEnd(l.parentNode,Hb(l)+1):c.setEnd(l,0),c.collapse(!1),s.removeAllRanges(),s.addRange(c),!d&&!i.state.selection.visible&&HP&&HF<=11&&(l.disabled=!0,l.disabled=!1)}else{let{anchor:f,head:p}=r,h,m,g,y,v,b;!Jk||r instanceof Ht||(r.$from.parent.inlineContent||(h=JC(t,r.from)),r.empty||r.$from.parent.inlineContent||(m=JC(t,r.to))),t.docView.setSelection(f,p,t.root,n),Jk&&(h&&Jj(h),m&&Jj(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(()=>{(!J_(o)||o.state.selection.visible)&&o.dom.classList.remove("ProseMirror-hideselection")},20))})))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}let Jk=HV||HW&&HB<63;function JC(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(HV&&o&&"false"==o.contentEditable)return JN(o);if((!o||"false"==o.contentEditable)&&(!a||"false"==a.contentEditable)){if(o)return JN(o);if(a)return JN(a)}}function JN(t){return t.contentEditable="true",HV&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Jj(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function JE(t,n){if(n instanceof Hr){let r=t.docView.descAt(n.from);r!=t.lastSelectedViewDesc&&(JR(t),r&&r.selectNode(),t.lastSelectedViewDesc=r)}else JR(t)}function JR(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function JD(t,n,r,i){return t.someProp("createSelectionBetween",i=>i(t,n,r))||Ht.between(n,r,i)}function JA(t){return(!t.editable||!!t.hasFocus())&&JL(t)}function JL(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 JP(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&&Q8.findFrom(a,n)}function JF(t,n){return t.dispatch(t.state.tr.setSelection(n).scrollIntoView()),!0}function Jz(t,n,r){let i=t.state.selection;if(i instanceof Ht){if(!i.empty||r.indexOf("s")>-1)return!1;if(t.endOfTextblock(n>0?"forward":"backward")){let o=JP(t.state,n);return!!o&&o instanceof Hr&&JF(t,o)}if(!(HK&&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)&&(Hr.isSelectable(u)?JF(t,new Hr(n<0?t.state.doc.resolve(a.pos-u.nodeSize):a)):!!HG&&JF(t,new Ht(t.state.doc.resolve(n<0?c:c+u.nodeSize))))}}else{if(i instanceof Hr&&i.node.isInline)return JF(t,new Ht(n>0?i.$to:i.$from));{let l=JP(t.state,n);return!!l&&JF(t,l)}}}function JU(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function JW(t){let n=t.pmViewDesc;return n&&0==n.size&&(t.nextSibling||"BR"!=t.nodeName)}function JB(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(Hz&&1==r.nodeType&&i<JU(r)&&JW(r.childNodes[i])&&(u=!0);;)if(i>0){if(1!=r.nodeType)break;{let s=r.childNodes[i-1];if(JW(s))o=r,a=--i;else if(3==s.nodeType)i=(r=s).nodeValue.length;else break}}else{if(J$(r))break;{let c=r.previousSibling;for(;c&&JW(c);)o=r.parentNode,a=Hb(c),c=c.previousSibling;if(c)i=JU(r=c);else{if((r=r.parentNode)==t.dom)break;i=0}}}u?JK(t,r,i):o&&JK(t,o,a)}(t):JV(t)}function JV(t){let n=t.domSelectionRange(),r=n.focusNode,i=n.focusOffset;if(!r)return;let o=JU(r),a,u;for(;;)if(i<o){if(1!=r.nodeType)break;if(JW(r.childNodes[i]))a=r,u=++i;else break}else{if(J$(r))break;{let s=r.nextSibling;for(;s&&JW(s);)a=s.parentNode,u=Hb(s)+1,s=s.nextSibling;if(s)i=0,o=JU(r=s);else{if((r=r.parentNode)==t.dom)break;i=o=0}}}a&&JK(t,a,u)}function J$(t){let n=t.pmViewDesc;return n&&n.node&&n.node.isBlock}function JK(t,n,r){let i=t.domSelection();if(Hk(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&&JO(t)},50)}function JY(t,n){let r=t.state.doc.resolve(n);if(!(HW||HY)&&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 Jq(t,n,r){let i=t.state.selection;if(i instanceof Ht&&!i.empty||r.indexOf("s")>-1||HK&&r.indexOf("m")>-1)return!1;let{$from:o,$to:a}=i;if(!o.parent.inlineContent||t.endOfTextblock(n<0?"up":"down")){let u=JP(t.state,n);if(u&&u instanceof Hr)return JF(t,u)}if(!o.parent.inlineContent){let s=n<0?o:a,c=i instanceof Ho?Q8.near(s,n):Q8.findFrom(s,n);return!!c&&JF(t,c)}return!1}function JG(t,n){if(!(t.state.selection instanceof Ht))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 JZ(t,n,r){t.domObserver.stop(),n.contentEditable=r,t.domObserver.start()}function JQ(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")||Qb.fromSchema(t.state.schema),c=J9(),l=c.createElement("div");l.appendChild(s.serializeFragment(i,{document:c}));let d=l.firstChild,f,p=0;for(;d&&1==d.nodeType&&(f=J3[d.nodeName.toLowerCase()]);){for(let h=f.length-1;h>=0;h--){let m=c.createElement(f[h]);for(;l.firstChild;)m.appendChild(l.firstChild);l.appendChild(m),p++}d=l.firstChild}return d&&1==d.nodeType&&d.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 JH(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 Zz(ZR.from(t.state.schema.text(n.replace(/\r\n?/g,`
|
|
12
|
+
`))),0,0):Zz.empty;let l=t.someProp("clipboardTextParser",r=>r(n,o,i,t));if(l)s=l;else{let d=o.marks(),{schema:f}=t.state,p=Qb.fromSchema(f);u=document.createElement("div"),n.split(/(?:\r\n?|\n)+/).forEach(t=>{let n=u.appendChild(document.createElement("p"));t&&n.appendChild(p.serializeNode(f.text(t,d)))})}}else t.someProp("transformPastedHTML",n=>{r=n(r,t)}),u=function(t){let n=/^(\s*<meta [^>]*>)*/.exec(t);n&&(t=t.slice(n[0].length));let r=J9().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(t),o;if((o=i&&J3[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),HG&&function(t){let n=t.querySelectorAll(HW?"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")||Qc.fromSchema(t.state.schema)).parseSlice(u,{preserveWhitespace:!!(c||m),context:o,ruleFromNode:t=>"BR"!=t.nodeName||t.nextSibling||!t.parentNode||JJ.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=ZR.from(c.create(i[s+1],o)),a++,u++}return new Zz(o,a,u)}(J4(s,+m[1],+m[2]),m[4]);else if((s=Zz.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&&J0(n,o,t,a[a.length-1],0))a[a.length-1]=r;else{a.length&&(a[a.length-1]=J1(a[a.length-1],o.length));let u=JX(t,n);a.push(u),i=i.matchType(u.type),o=n}}),a)return ZR.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 M=s.content.lastChild;b<s.openEnd&&!M.type.spec.isolating;b++,M=M.lastChild);s=J4(s,v,b)}return t.someProp("transformPasted",n=>{s=n(s,t)}),s}let JJ=/^(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 JX(t,n,r=0){for(let i=n.length-1;i>=r;i--)t=n[i].create(null,ZR.from(t));return t}function J0(t,n,r,i,o){if(o<t.length&&o<n.length&&t[o]==n[o]){let a=J0(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(ZR.from(JX(r,t,o+1))))}}function J1(t,n){if(0==n)return t;let r=t.content.replaceChild(t.childCount-1,J1(t.lastChild,n-1)),i=t.contentMatchAt(t.childCount).fillBefore(ZR.empty,!0);return t.copy(r.append(i))}function J2(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=J2(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(ZR.empty,!0))),t.replaceChild(n<0?0:t.childCount-1,u.copy(s))}function J4(t,n,r){return n<t.openStart&&(t=new Zz(J2(t.content,-1,n,t.openStart,0,t.openEnd),n,t.openEnd)),r<t.openEnd&&(t=new Zz(J2(t.content,1,r,t.openEnd,0,0),t.openStart,r)),t}let J3={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},J5=null;function J9(){return J5||(J5=document.implementation.createHTMLDocument("title"))}let J8={},J6={},J7={touchstart:!0,touchmove:!0};class Xe{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 Xt(t,n){t.input.lastSelectionOrigin=n,t.input.lastSelectionTime=Date.now()}function Xn(t){t.someProp("handleDOMEvents",n=>{for(let r in n)t.input.eventHandlers[r]||t.dom.addEventListener(r,t.input.eventHandlers[r]=n=>Xr(t,n))})}function Xr(t,n){return t.someProp("handleDOMEvents",r=>{let i=r[n.type];return!!i&&(i(t,n)||n.defaultPrevented)})}function Xi(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 Xo(t){return{left:t.clientX,top:t.clientY}}function Xa(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 Xu(t,n,r){t.focused||t.focus();let i=t.state.tr.setSelection(n);"pointer"==r&&i.setMeta("pointer",!0),t.dispatch(i)}function Xs(t,n,r,i){return Xa(t,"handleDoubleClickOn",n,r,i)||t.someProp("handleDoubleClick",r=>r(t,n,i))}function Xc(t,n,r,i){return Xa(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&&(Xu(t,Ht.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)Xu(t,Ht.create(i,s+1,s+1+u.content.size),"pointer");else{if(!Hr.isSelectable(u))continue;Xu(t,Hr.create(i,s),"pointer")}return!0}}(t,r,i)}J6.keydown=(t,n)=>{if(t.input.shiftKey=16==n.keyCode||n.shiftKey,!Xf(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Hq&&HW&&13==n.keyCode))){if(229!=n.keyCode&&t.domObserver.forceFlush(),!H$||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||HK&&72==o&&"c"==a)return JG(t,-1)||JB(t,-1);if(46==o&&!n.shiftKey||HK&&68==o&&"c"==a)return JG(t,1)||JB(t,1);if(13==o||27==o)return!0;if(37==o||HK&&66==o&&"c"==a){let u=37==o?"ltr"==JY(t,t.state.selection.from)?-1:1:-1;return Jz(t,u,a)||JB(t,u)}if(39==o||HK&&70==o&&"c"==a){let s=39==o?"ltr"==JY(t,t.state.selection.from)?1:-1:1;return Jz(t,s,a)||JB(t,s)}return 38==o||HK&&80==o&&"c"==a?Jq(t,-1,a)||JB(t,-1):40==o||HK&&78==o&&"c"==a?function(t){if(!HV||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;JZ(t,i,"true"),setTimeout(()=>JZ(t,i,"false"),20)}return!1}(t)||Jq(t,1,a)||JV(t):a==(HK?"m":"c")&&(66==o||73==o||89==o||90==o)}(t,n)?n.preventDefault():Xt(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,HC(13,"Enter"))),t.input.lastIOSEnter=0)},200)}}},J6.keyup=(t,n)=>{16==n.keyCode&&(t.input.shiftKey=!1)},J6.keypress=(t,n)=>{if(Xf(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||HK&&n.metaKey)return;if(t.someProp("handleKeyPress",r=>r(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof Ht)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);/[\r\n]/.test(i)||t.someProp("handleTextInput",n=>n(t,r.$from.pos,r.$to.pos,i))||t.dispatch(t.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};let Xl=HK?"metaKey":"ctrlKey";J8.mousedown=(t,n)=>{var r,i,o;t.input.shiftKey=n.shiftKey;let a=Xg(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[Xl]&&("singleClick"==t.input.lastClick.type?s="doubleClick":"doubleClick"==t.input.lastClick.type&&(s="tripleClick")),t.input.lastClick={time:u,x:n.clientX,y:n.clientY,type:s};let d=t.posAtCoords(Xo(n));d&&("singleClick"==s?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new Xd(t,d,n,!!a)):("doubleClick"==s?Xs:Xc)(t,d.pos,d.inside,n)?n.preventDefault():Xt(t,"pointer"))};class Xd{constructor(t,n,r,i){this.view=t,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!r[Xl],this.allowDefault=r.shiftKey;let o,a;if(n.inside>-1)o=t.state.doc.nodeAt(n.inside),a=n.inside;else{let u=t.state.doc.resolve(n.pos);o=u.parent,a=u.depth?u.before():0}let s=i?null:r.target,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 Hr&&l.from<=a&&l.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Hz&&!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)),Xt(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(()=>JO(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(Xo(t))),this.updateAllowDefault(t),this.allowDefault||!u?Xt(this.view,"pointer"):(n=this.view,r=u.pos,i=u.inside,a=this.selectNode,Xa(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 Hr&&(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(Hr.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&&(Xu(t,Hr.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&&Hr.isSelectable(i))&&(Xu(t,new Hr(r),"pointer"),!0)}(n,i)))?t.preventDefault():0==t.button&&(this.flushed||HV&&this.mightDrag&&!this.mightDrag.node.isAtom||HW&&!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)))?(Xu(this.view,Q8.near(this.view.state.doc.resolve(u.pos)),"pointer"),t.preventDefault()):Xt(this.view,"pointer")}move(t){this.updateAllowDefault(t),Xt(this.view,"pointer"),0==t.buttons&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}function Xf(t,n){return!!t.composing||!!(HV&&500>Math.abs(n.timeStamp-t.input.compositionEndedAt))&&(t.input.compositionEndedAt=-2e8,!0)}J8.touchstart=t=>{t.input.lastTouch=Date.now(),Xg(t),Xt(t,"pointer")},J8.touchmove=t=>{t.input.lastTouch=Date.now(),Xt(t,"pointer")},J8.contextmenu=t=>{var n;return Xg(t)};let Xp=Hq?5e3:-1;function Xh(t,n){clearTimeout(t.input.composingTimeout),n>-1&&(t.input.composingTimeout=setTimeout(()=>Xg(t),n))}function Xm(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 Xg(t,n=!1){if(!(Hq&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Xm(t),n||t.docView&&t.docView.dirty){let r=JI(t);return r&&!r.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(r)):t.updateState(t.state),!0}return!1}}J6.compositionstart=J6.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(),Xg(t,!0),t.markCursor=null;else if(Xg(t),Hz&&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}Xh(t,Xp)},J6.compositionend=(t,n)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=n.timeStamp,t.input.compositionID++,Xh(t,20))};let Xy=HP&&HF<15||H$&&HZ<604;function Xv(t,n,r,i,o){var a;let u=JH(t,n,r,i,t.state.selection.$from);if(t.someProp("handlePaste",n=>n(t,o,u||Zz.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}J8.copy=J6.cut=(t,n)=>{let r=t.state.selection,i="cut"==n.type;if(r.empty)return;let o=Xy?null:n.clipboardData,{dom:a,text:u}=JQ(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"))},J6.paste=(t,n)=>{if(t.composing&&!Hq)return;let r=Xy?null:n.clipboardData,i=t.input.shiftKey&&45!=t.input.lastKeyCode;r&&Xv(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?Xv(t,i.value,null,o,n):Xv(t,i.textContent,i.innerHTML,o,n)},50)}(t,n)};class Xb{constructor(t,n){this.slice=t,this.move=n}}let Xx=HK?"altKey":"ctrlKey";for(let XM in J8.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(Xo(r));if(!(a&&a.pos>=o.from&&a.pos<=(o instanceof Hr?o.to-1:o.to))){if(i&&i.mightDrag)t.dispatch(t.state.tr.setSelection(Hr.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(Hr.create(t.state.doc,u.posBefore)))}}let s=t.state.selection.content(),{dom:c,text:l}=JQ(t,s);r.dataTransfer.clearData(),r.dataTransfer.setData(Xy?"Text":"text/html",c.innerHTML),r.dataTransfer.effectAllowed="copyMove",Xy||r.dataTransfer.setData("text/plain",l),t.dragging=new Xb(s,!r[Xx])},J8.dragend=t=>{let n=t.dragging;window.setTimeout(()=>{t.dragging==n&&(t.dragging=null)},50)},J6.dragover=J6.dragenter=(t,n)=>n.preventDefault(),J6.drop=(t,n)=>{let r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(Xo(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=JH(t,n.dataTransfer.getData(Xy?"Text":"text/plain"),Xy?null:n.dataTransfer.getData("text/html"),!1,o);let u=!!(r&&!n[Xx]);if(t.someProp("handleDrop",r=>r(t,n,a||Zz.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),d=i.node(s),f=!1;if(1==u)f=d.canReplace(l,l,o);else{let p=d.contentMatchAt(l).findWrapping(o.firstChild.type);f=p&&d.canReplaceWith(l,l,p[0])}if(f)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),d=0==a.openStart&&0==a.openEnd&&1==a.content.childCount,f=c.doc;if(d?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(f))return;let p=c.doc.resolve(l);if(d&&Hr.isSelectable(a.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new Hr(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(JD(t,p,c.doc.resolve(h)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))},J8.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())&&JO(t)},20))},J8.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)},J8.beforeinput=(t,n)=>{if(HW&&Hq&&"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,HC(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)}},J6)J8[XM]=J6[XM];function XT(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 XS{constructor(t,n){this.toDOM=t,this.spec=n||Xk,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 X_(o-r,o-r,this)}valid(){return!0}eq(t){return this==t||t instanceof XS&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&XT(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Xw{constructor(t,n){this.attrs=t,this.spec=n||Xk}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 X_(o,a,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof Xw&&XT(this.attrs,t.attrs)&&XT(this.spec,t.spec)}static is(t){return t.type instanceof Xw}destroy(){}}let XI=class t{constructor(t,n){this.attrs=t,this.spec=n||Xk}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 X_(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&&XT(this.attrs,n.attrs)&&XT(this.spec,n.spec)}destroy(){}};class X_{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new X_(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 X_(t,t,new XS(n,r))}static inline(t,n,r,i){return new X_(t,n,new Xw(r,i))}static node(t,n,r,i){return new X_(t,n,new XI(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Xw}}let XO=[],Xk={};class XC{constructor(t,n){this.local=t.length?t:XO,this.children=n.length?n:XO}static create(t,n){return n.length?XA(n,t,0,Xk):XN}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==XN||0==t.maps.length?this:this.mapInner(t,n,0,0,r||Xk)}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 d=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-d)continue;let f=s[u]+l-d;n>=f?s[u+1]=t<=f?-2:-1:r>=o&&a&&(s[u]+=a,s[u+1]+=a)}d+=a}),l=r.maps[c].map(l,-1)}let f=!1;for(let p=0;p<s.length;p+=3)if(s[p+1]<0){if(-2==s[p+1]){f=!0,s[p+1]=-1;continue}let h=r.map(t[p]+a),m=h-o;if(m<0||m>=i.content.size){f=!0;continue}let g=r.map(t[p+1]+a,-1)-o,{index:y,offset:v}=i.content.findIndex(m),b=i.maybeChild(y);if(b&&v==m&&v+b.nodeSize==g){let x=s[p+2].mapInner(r,b,h+1,t[p]+a+1,u);x!=XN?(s[p]=m,s[p+1]=g,s[p+2]=x):(s[p+1]=-2,f=!0)}else f=!0}if(f){let M=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),T=XA(M,i,0,u);n=T.local;for(let S=0;S<s.length;S+=3)s[S+1]<0&&(s.splice(S,3),S-=3);for(let w=0,I=0;w<T.children.length;w+=3){let _=T.children[w];for(;I<s.length&&s[I]<_;)I+=3;s.splice(I,0,T.children[w],T.children[w+1],T.children[w+2])}}return new XC(n.sort(XL),s)}(this.children,a||[],t,n,r,i,o):a?new XC(a.sort(XL),XO):XN}add(t,n){return n.length?this==XN?XC.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=XR(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,XA(s,t,u+1,Xk)),o+=3}});let a=XE(o?XD(n):n,-r);for(let u=0;u<a.length;u++)a[u].type.valid(t,a[u])||a.splice(u--,1);return new XC(a.length?this.local.concat(a).sort(XL):this.local,i||this.children)}remove(t){return 0==t.length||this==XN?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 d=r[o+2].removeInner(a,u+1);d!=XN?r[o+2]=d:(r.splice(o,3),o-=3)}if(i.length){for(let f=0,p;f<t.length;f++)if(p=t[f])for(let h=0;h<i.length;h++)i[h].eq(p,n)&&(i==this.local&&(i=this.local.slice()),i.splice(h--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new XC(i,r):XN}forChild(t,n){if(this==XN)return this;if(n.isLeaf)return XC.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 Xw){let l=Math.max(a,c.from)-a,d=Math.min(u,c.to)-a;l<d&&(i||(i=[])).push(c.copy(l,d))}}if(i){let f=new XC(i.sort(XL),XO);return r?new Xj([f,r]):f}return r||XN}eq(t){if(this==t)return!0;if(!(t instanceof XC)||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 XP(this.localsInner(t))}localsInner(t){if(this==XN)return XO;if(t.inlineContent||!this.local.some(Xw.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Xw||n.push(this.local[r]);return n}}XC.empty=new XC([],[]),XC.removeOverlap=XP;let XN=XC.empty;class Xj{constructor(t){this.members=t}map(t,n){let r=this.members.map(r=>r.map(t,n,Xk));return Xj.from(r)}forChild(t,n){if(n.isLeaf)return XC.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(t,n);o!=XN&&(o instanceof Xj?r=r.concat(o.members):r.push(o))}return Xj.from(r)}eq(t){if(!(t instanceof Xj)||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?XP(r?n:n.sort(XL)):XO}static from(t){switch(t.length){case 0:return XN;case 1:return t[0];default:return new Xj(t.every(t=>t instanceof XC)?t:t.reduce((t,n)=>t.concat(n instanceof XC?n:n.members),[]))}}}function XE(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 X_(o.from+n,o.to+n,o.type))}return r}function XR(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 XD(t){let n=[];for(let r=0;r<t.length;r++)null!=t[r]&&n.push(t[r]);return n}function XA(t,n,r,i){let o=[],a=!1;n.forEach((n,u)=>{let s=XR(t,n,u+r);if(s){a=!0;let c=XA(s,n,r+u+1,i);c!=XN&&o.push(u,u+n.nodeSize,c)}});let u=XE(a?XD(t):t,-r).sort(XL);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 XC(u,o):XN}function XL(t,n){return t.from-n.from||t.to-n.to}function XP(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),XF(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),XF(n,o,i.copy(a.from,i.to)));break}}return n}function XF(t,n,r){for(;n<t.length&&XL(r,t[n])>0;)n++;t.splice(n,0,r)}function Xz(t){let n=[];return t.someProp("decorations",r=>{let i=r(t.state);i&&i!=XN&&n.push(i)}),t.cursorWrapper&&n.push(XC.create(t.state.doc,[t.cursorWrapper.deco])),Xj.from(n)}let XU={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},XW=HP&&HF<=11;class XB{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 XV{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new XB,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]);HP&&HF<=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,XU)),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(JA(this.view)){if(this.suppressingSelectionUpdates)return JO(this.view);if(HP&&HF<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&HS(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=Hx(i))n.add(i);for(let o=t.anchorNode;o;o=Hx(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)&&JA(n)&&!this.ignoreSelectionChange(i),a=-1,u=-1,s=!1,c=[];if(n.editable)for(let l=0;l<r.length;l++){let d=this.registerMutation(r[l],c);d&&(a=a<0?d.from:Math.min(d.from,a),u=u<0?d.to:Math.max(d.to,u),d.typeOver&&(s=!0))}if(Hz&&c.length>1){let f=c.filter(t=>"BR"==t.nodeName);if(2==f.length){let p=f[0],h=f[1];p.parentNode&&p.parentNode.parentNode==h.parentNode?h.remove():p.remove()}}let m=null;a<0&&o&&n.input.lastFocus>Date.now()-200&&Math.max(n.input.lastTouch,n.input.lastClick.time)<Date.now()-300&&Hk(i)&&(m=JI(n))&&m.eq(Q8.near(n.state.doc.resolve(0),1))?(n.input.lastFocus=0,JO(n),this.currentSelection.set(i),n.scrollToSelection()):(a>-1||o)&&(a>-1&&(n.docView.markDirty(a,u),t=n,X$.has(t)||(X$.set(t,null),-1===["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace))||(t.requiresGeckoHackNode=Hz,XK||(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."),XK=!0))),this.handleDOMChange(a,u,s,c),n.docView&&n.docView.dirty?n.updateState(n.state):this.currentSelection.eq(i)||JO(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(HP&&HF<=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?Hb(o)+1:0,d=r.localPosFromDOM(t.target,l,-1),f=a&&a.parentNode==t.target?Hb(a):t.target.childNodes.length,p=r.localPosFromDOM(t.target,f,1);return{from:d,to:p}}}}let X$=new WeakMap,XK=!1;function XY(t){let n=t.pmViewDesc;if(n)return n.parseRule();if("BR"==t.nodeName&&t.parentNode){if(HV&&/^(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||HV&&/^(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 Xq=/^(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 XG(t,n,r){return Math.max(r.anchor,r.head)>n.content.size?null:JD(t,n.resolve(r.anchor),n.resolve(r.head))}function XZ(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 XQ{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 Xe,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(X1),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=XX(this),XJ(this),this.nodeViews=X0(this),this.docView=Jl(this.state.doc,XH(this),Xz(this),this.dom,this),this.domObserver=new XV(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=JI(t,a);if(u&&!t.state.selection.eq(u)){if(HW&&Hq&&13===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",n=>n(t,HC(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 d=t.state.selection,f=function(t,n,r){let{node:i,fromOffset:o,toOffset:a,from:u,to:s}=t.docView.parseRange(n,r),c=t.domSelectionRange(),l,d=c.anchorNode;if(d&&t.dom.contains(1==d.nodeType?d:d.parentNode)&&(l=[{node:d,offset:c.anchorOffset}],Hk(c)||l.push({node:c.focusNode,offset:c.focusOffset})),HW&&8===t.input.lastKeyCode)for(let f=a;f>o;f--){let p=i.childNodes[f-1],h=p.pmViewDesc;if("BR"==p.nodeName&&!h){a=f;break}if(!h||h.size)break}let m=t.state.doc,g=t.someProp("domParser")||Qc.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:XY,context:y});if(l&&null!=l[0].pos){let x=l[0].pos,M=l[1]&&l[1].pos;null==M&&(M=x),v={anchor:x+u,head:M+u}}return{doc:b,sel:v,from:u,to:s}}(t,n,r),p=t.state.doc,h=p.slice(f.from,f.to),m,g;8===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime?(m=t.state.selection.to,g="end"):(m=t.state.selection.from,g="start"),t.input.lastKeyCode=null;let y=function(t,n,r,i,o){let a=t.findDiffStart(n,r);if(null==a)return null;let{a:u,b:s}=t.findDiffEnd(n,r+t.size,r+n.size);if("end"==o){let 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 d=i<=a&&i>=s?a-i:0;a-=d,u=a+(u-s),s=a}return{start:a,endA:u,endB:s}}(h.content,f.doc.content,f.from,m,g);if((H$&&t.input.lastIOSEnter>Date.now()-225||Hq)&&o.some(t=>1==t.nodeType&&!Xq.test(t.nodeName))&&(!y||y.endA>=y.endB)&&t.someProp("handleKeyDown",n=>n(t,HC(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!y){if(i&&d instanceof Ht&&!d.empty&&d.$head.sameParent(d.$anchor)&&!t.composing&&!(f.sel&&f.sel.anchor!=f.sel.head))y={start:d.from,endA:d.to,endB:d.to};else{if(f.sel){let v=XG(t,t.state.doc,f.sel);if(v&&!v.eq(t.state.selection)){let b=t.state.tr.setSelection(v);t.composing&&b.setMeta("composition",t.input.compositionID),t.dispatch(b)}}return}}if(HW&&t.cursorWrapper&&f.sel&&f.sel.anchor==t.cursorWrapper.deco.from&&f.sel.head==f.sel.anchor){let x=y.endB-y.start;f.sel={anchor:f.sel.anchor+x,head:f.sel.anchor+x}}t.input.domChangeCount++,t.state.selection.from<t.state.selection.to&&y.start==y.endB&&t.state.selection instanceof Ht&&(y.start>t.state.selection.from&&y.start<=t.state.selection.from+2&&t.state.selection.from>=f.from?y.start=t.state.selection.from:y.endA<t.state.selection.to&&y.endA>=t.state.selection.to-2&&t.state.selection.to<=f.to&&(y.endB+=t.state.selection.to-y.endA,y.endA=t.state.selection.to)),HP&&HF<=11&&y.endB==y.start+1&&y.endA==y.start&&y.start>f.from&&" \xa0"==f.doc.textBetween(y.start-f.from-1,y.start-f.from+1)&&(y.start--,y.endA--,y.endB--);let M=f.doc.resolveNoCache(y.start-f.from),T=f.doc.resolveNoCache(y.endB-f.from),S=p.resolve(y.start),w=M.sameParent(T)&&M.parent.inlineContent&&S.end()>=y.endA,I;if((H$&&t.input.lastIOSEnter>Date.now()-225&&(!w||o.some(t=>"DIV"==t.nodeName||"P"==t.nodeName))||!w&&M.pos<f.doc.content.size&&!M.sameParent(T)&&(I=Q8.findFrom(f.doc.resolve(M.pos+1),1,!0))&&I.head==T.pos)&&t.someProp("handleKeyDown",n=>n(t,HC(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||XZ(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(XZ(a,!0,!0));return!(!u.parent.isTextblock||u.pos>r||XZ(u,!0,!1)<r)&&i.parent.content.cut(i.parentOffset).eq(u.parent.content)}(p,y.start,y.endA,M,T)&&t.someProp("handleKeyDown",n=>n(t,HC(8,"Backspace")))){Hq&&HW&&t.domObserver.suppressSelectionUpdates();return}HW&&Hq&&y.endB==y.start&&(t.input.lastAndroidDelete=Date.now()),Hq&&!w&&M.start()!=T.start()&&0==T.parentOffset&&M.depth==T.depth&&f.sel&&f.sel.anchor==f.sel.head&&f.sel.head==y.endA&&(y.endB-=2,T=f.doc.resolveNoCache(y.endB-f.from),setTimeout(()=>{t.someProp("handleKeyDown",function(n){return n(t,HC(13,"Enter"))})},20));let _=y.start,O=y.endA,k,C,N;if(w){if(M.pos==T.pos)HP&&HF<=11&&0==M.parentOffset&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>JO(t),20)),k=t.state.tr.delete(_,O),C=p.resolve(y.start).marksAcross(p.resolve(y.endA));else if(y.endA==y.endB&&(N=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 d=0;d<r.length;d++)a=r[d].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 f=[];for(let p=0;p<n.childCount;p++)f.push(c(n.child(p)));if(ZR.from(f).eq(t))return{mark:s,type:u}}(M.parent.content.cut(M.parentOffset,T.parentOffset),S.parent.content.cut(S.parentOffset,y.endA-S.start()))))k=t.state.tr,"add"==N.type?k.addMark(_,O,N.mark):k.removeMark(_,O,N.mark);else if(M.parent.child(M.index()).isText&&M.index()==T.index()-(T.textOffset?0:1)){let j=M.parent.textBetween(M.parentOffset,T.parentOffset);if(t.someProp("handleTextInput",n=>n(t,_,O,j)))return;k=t.state.tr.insertText(j,_,O)}}if(k||(k=t.state.tr.replace(_,O,f.doc.slice(y.start-f.from,y.endB-f.from))),f.sel){let E=XG(t,k.doc,f.sel);E&&!(HW&&Hq&&t.composing&&E.empty&&(y.start!=y.endB||t.input.lastAndroidDelete<Date.now()-100)&&(E.head==_||E.head==k.mapping.map(O)-1)||HP&&E.empty&&E.head==_)&&k.setSelection(E)}C&&k.ensureMarks(C),t.composing&&k.setMeta("composition",t.input.compositionID),t.dispatch(k.scrollIntoView())})(this,t,n,r,i)),this.domObserver.start(),function(t){for(let n in J8){let r=J8[n];t.dom.addEventListener(n,t.input.eventHandlers[n]=n=>{!Xi(t,n)||Xr(t,n)||!t.editable&&n.type in J6||r(t,n)},J7[n]?{passive:!0}:void 0)}HV&&t.dom.addEventListener("input",()=>null),Xn(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&&Xn(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(X1),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&&(Xm(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=X0(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)&&Xn(this),this.editable=XX(this),XJ(this);let s=Xz(this),c=XH(this),l=r.plugins==t.plugins||r.doc.eq(t.doc)?t.scrollToSelection>r.scrollToSelection?"to selection":"preserve":"reset",d=i||!this.docView.matchesNode(t.doc,c,s);(d||!t.selection.eq(r.selection))&&(o=!0);let f="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:H0(t.dom)}}(this);if(o){var p,h,m;this.domObserver.stop();let g,y=d&&(HP||HW)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&(h=r.selection,m=t.selection,g=Math.min(h.$anchor.sharedDepth(h.head),m.$anchor.sharedDepth(m.head)),h.$anchor.start(g)!=m.$anchor.start(g));if(d){let v=HW?this.trackWrites=this.domSelectionRange().focusNode:null;(i||!this.docView.update(t.doc,c,s,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Jl(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(),HS(b.node,b.offset,x.anchorNode,x.anchorOffset)))?JO(this,y):(JE(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),"reset"==l?this.dom.scrollTop=0:"to selection"==l?this.scrollToSelection():f&&function({refDOM:t,refTop:n,stack:r}){let i=t?t.getBoundingClientRect().top:0;H1(r,0==i?0:i-n)}(f)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",t=>t(this))){if(this.state.selection instanceof Hr){let n=this.docView.domAfterPos(this.state.selection.from);1==n.nodeType&&HX(this,n.getBoundingClientRect(),t)}else HX(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(HP){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(H2)return t.focus(H2);let n=H0(t);t.focus(null==H2?{get preventScroll(){return H2={preventScroll:!0},!0}}:void 0),H2||(H2=!1,H1(n,0))}(this.dom),JO(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=HN(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 d=t.dom.getBoundingClientRect();if(!H4(n,d)||!(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 d=c[l];if(H4(r,d))return t(s,r,d)}}if((u=(u+1)%o)==a)break}return n}(t.dom,n,d)))return null}if(HV)for(let f=c;a&&f;f=Hx(f))f.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(Hz&&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,d;for(let f=n.firstChild,p=0;f;f=f.nextSibling,p++){let h;if(1==f.nodeType)h=f.getClientRects();else{if(3!=f.nodeType)continue;h=HT(f).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=f,o=y,a=y&&3==i.nodeType?{left:g.right<r.left?g.right:g.left,top:r.top}:r,1==f.nodeType&&y&&(u=p+(r.left>=(g.left+g.right)/2?1:0));continue}}else g.top>r.top&&!l&&g.left<=r.left&&g.right>=r.left&&(l=f,d={left:Math.max(g.left,Math.min(g.right,r.left)),top:g.top});!i&&(r.left>=g.right&&r.top>=g.top||r.left>=g.left&&r.top>=g.bottom)&&(u=p+1)}}return!i&&l&&(i=l,a=d,o=0),i&&3==i.nodeType?function(t,n){let r=t.nodeValue.length,i=document.createRange();for(let o=0;o<r;o++){i.setEnd(t,o+1),i.setStart(t,o);let a=H5(i,1);if(a.top!=a.bottom&&H4(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 H8(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 Jn==(i=n||this.state)&&Jr==t?Ji:(Jn=i,Jr=t,Ji="up"==t||"down"==t?(a=this,c=i.selection,l="up"==t?c.$from:c.$to,Je(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=H8(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=HT(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 Jt.test(i.parent.textContent)&&u.modify?Je(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:d,focusOffset:f}=t.domSelectionRange(),p=d&&!l.contains(1==d.nodeType?d:d.parentNode)||n==d&&o==f;try{u.collapse(a,s),n&&(n!=a||o!=s)&&u.extend&&u.extend(n,o)}catch{}return null!=c&&(u.caretBidiLevel=c),p}):"left"==r||"backward"==r?!o:a}(this,i,t))}pasteHTML(t,n){return Xv(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return Xv(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,[],Xz(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;Xr(this,t)||!J8[t.type]||!this.editable&&t.type in J6||J8[t.type](this,t)}dispatch(t){let n=this._props.dispatchTransaction;n?n.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){return HV&&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 HS(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 XH(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"),[X_.node(0,t.state.doc.content.size,n)]}function XJ(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:X_.widget(t.state.selection.head,n,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function XX(t){return!t.someProp("editable",n=>!1===n(t.state))}function X0(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 X1(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 X2={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:"'"},X4={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},X3="u">typeof navigator&&/Mac/.test(navigator.platform),X5="u">typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),X9=0;X9<10;X9++)X2[48+X9]=X2[96+X9]=String(X9);for(var X9=1;X9<=24;X9++)X2[X9+111]="F"+X9;for(var X9=65;X9<=90;X9++)X2[X9]=String.fromCharCode(X9+32),X4[X9]=String.fromCharCode(X9);for(var X8 in X2)X4.hasOwnProperty(X8)||(X4[X8]=X2[X8]);let X6="u">typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function X7(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))X6?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 eee(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 eet=(t,n)=>!t.selection.empty&&(n&&n(t.tr.deleteSelection().scrollIntoView()),!0),een=(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=eeo(i);if(!o){let a=i.blockRange(),u=a&&Qz(a);return null!=u&&(n&&n(t.tr.lift(a,u).scrollIntoView()),!0)}let s=o.nodeBefore;if(!s.type.spec.isolating&&eev(t,o,n))return!0;if(0==i.parent.content.size&&(eer(s,"end")||Hr.isSelectable(s))){let c=QY(t.doc,i.before(),i.after(),Zz.empty);if(c&&c.slice.size<c.to-c.from){if(n){let l=t.tr.step(c);l.setSelection(eer(s,"end")?Q8.findFrom(l.doc.resolve(l.mapping.map(o.pos,-1)),-1):Hr.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 eer(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 eei=(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=eeo(i)}let u=a&&a.nodeBefore;return!!(u&&Hr.isSelectable(u))&&(n&&n(t.tr.setSelection(Hr.create(t.doc,a.pos-u.nodeSize)).scrollIntoView()),!0)};function eeo(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 eea=(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=ees(i);if(!o)return!1;let a=o.nodeAfter;if(eev(t,o,n))return!0;if(0==i.parent.content.size&&(eer(a,"start")||Hr.isSelectable(a))){let u=QY(t.doc,i.before(),i.after(),Zz.empty);if(u&&u.slice.size<u.to-u.from){if(n){let s=t.tr.step(u);s.setSelection(eer(a,"start")?Q8.findFrom(s.doc.resolve(s.mapping.map(o.pos)),1):Hr.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)},eeu=(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=ees(i)}let u=a&&a.nodeAfter;return!!(u&&Hr.isSelectable(u))&&(n&&n(t.tr.setSelection(Hr.create(t.doc,a.pos)).scrollIntoView()),!0)};function ees(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 eec=(t,n)=>{let r=t.selection,i=r instanceof Hr,o;if(i){if(r.node.isTextblock||!QV(t.doc,r.from))return!1;o=r.from}else if(null==(o=QK(t.doc,r.from,-1)))return!1;if(n){let a=t.tr.join(o);i&&a.setSelection(Hr.create(a.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),n(a.scrollIntoView())}return!0},eel=(t,n)=>{let r=t.selection,i;if(r instanceof Hr){if(r.node.isTextblock||!QV(t.doc,r.to))return!1;i=r.to}else if(null==(i=QK(t.doc,r.to,1)))return!1;return n&&n(t.tr.join(i).scrollIntoView()),!0},eed=(t,n)=>{let{$from:r,$to:i}=t.selection,o=r.blockRange(i),a=o&&Qz(o);return null!=a&&(n&&n(t.tr.lift(o,a).scrollIntoView()),!0)},eef=(t,n)=>{let{$head:r,$anchor:i}=t.selection;return!!(r.parent.type.spec.code&&r.sameParent(i))&&(n&&n(t.tr.insertText(`
|
|
13
|
+
`).scrollIntoView()),!0)};function eep(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 eeh=(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=eep(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(Q8.near(c.doc.resolve(s),1)),n(c.scrollIntoView())}return!0},eem=(t,n)=>{let r=t.selection,{$from:i,$to:o}=r;if(r instanceof Ho||i.parent.inlineContent||o.parent.inlineContent)return!1;let a=eep(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(Ht.create(s.doc,u+1)),n(s.scrollIntoView())}return!0},eeg=(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(QB(t.doc,i))return n&&n(t.tr.split(i).scrollIntoView()),!0}let o=r.blockRange(),a=o&&Qz(o);return null!=a&&(n&&n(t.tr.lift(o,a).scrollIntoView()),!0)},eey=(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(Hr.create(t.doc,o))),!0)};function eev(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 d,f,p;if(d=n.nodeBefore,f=n.nodeAfter,p=n.index(),d&&f&&d.type.compatibleContent(f.type)&&(!d.content.size&&n.parent.canReplace(p-1,p)?(r&&r(t.tr.delete(n.pos-d.nodeSize,n.pos).scrollIntoView()),!0):!!(n.parent.canReplace(p,p+1)&&(f.isTextblock||QV(t.doc,n.pos)))&&(r&&r(t.tr.clearIncompatible(n.pos,d.type,d.contentMatchAt(d.childCount)).join(n.pos).scrollIntoView()),!0)))return!0;let h=n.parent.canReplace(n.index(),n.index()+1);if(h&&(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=ZR.empty;for(let y=c.length-1;y>=0;y--)g=ZR.from(c[y].create(null,g));g=ZR.from(u.copy(g));let v=t.tr.step(new QL(n.pos-1,m,n.pos,m,new Zz(g,1,0),c.length,!0)),b=m+2*c.length;QV(v.doc,b)&&v.join(b),r(v.scrollIntoView())}return!0}let x=Q8.findFrom(n,1),M=x&&x.$from.blockRange(x.$to),T=M&&Qz(M);if(null!=T&&T>=n.depth)return r&&r(t.tr.lift(M,T).scrollIntoView()),!0;if(h&&eer(s,"start",!0)&&eer(u,"end")){let S=u,w=[];for(;w.push(S),!S.isTextblock;)S=S.lastChild;let I=s,_=1;for(;!I.isTextblock;I=I.firstChild)_++;if(S.canReplace(S.childCount,S.childCount,I.content)){if(r){let O=ZR.empty;for(let k=w.length-1;k>=0;k--)O=ZR.from(w[k].copy(O));let C=t.tr.step(new QL(n.pos-w.length,n.pos+s.nodeSize,n.pos+_,n.pos+s.nodeSize-_,new Zz(O,w.length,0),0,!0));r(C.scrollIntoView())}return!0}}return!1}function eeb(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(Ht.create(n.doc,t<0?o.start(a):o.end(a)))),!0)}}let eex=eeb(-1),eeM=eeb(1);function eeT(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:d},$to:{pos:f}}=r.selection.ranges[l];c.setBlockType(d,f,t,n)}i(c.scrollIntoView())}return!0}}function eeS(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 eew{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)),d={...Object.fromEntries(Object.entries(r).map(([t,r])=>[t,(...t)=>{let i=this.buildProps(c,n),o=r(...t)(i);return u.push(o),d}])),run:l};return d}createCan(t){let{rawCommands:n,state:r}=this,i=t||r.tr,o=this.buildProps(i,!1);return{...Object.fromEntries(Object.entries(n).map(([t,n])=>[t,(...t)=>n(...t)({...o,dispatch:void 0})])),chain:()=>this.createChain(i,!1)}}buildProps(t,n=!0){let{rawCommands:r,editor:i,state:o}=this,{view:a}=i;o.storedMarks&&t.setStoredMarks(o.storedMarks);let u={tr:t,editor:i,view:a,state:eeS({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 eeI{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 ee_(t,n,r){return void 0===t.config[n]&&t.parent?ee_(t.parent,n,r):"function"==typeof t.config[n]?t.config[n].bind({...r,parent:t.parent?ee_(t.parent,n,r):null}):t.config[n]}function eeO(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 eek(t){let n=[],{nodeExtensions:r,markExtensions:i}=eeO(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=ee_(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=ee_(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 eeC(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 eeN(...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 eej(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)=>eeN(t,n),{})}function eeE(t){return"function"==typeof t}function eeR(t,n,...r){return eeE(t)?n?t.bind(n)(...r):t(...r):t}function eeD(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 eeA(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 eeL(t,n){var r;let i=eek(t),{nodeExtensions:o,markExtensions:a}=eeO(t),u=null===(r=o.find(t=>ee_(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=ee_(n,"extendNodeSchema",a);return{...t,...i?i(r):{}}},{}),s=eeA({...u,content:eeR(ee_(r,"content",a)),marks:eeR(ee_(r,"marks",a)),group:eeR(ee_(r,"group",a)),inline:eeR(ee_(r,"inline",a)),atom:eeR(ee_(r,"atom",a)),selectable:eeR(ee_(r,"selectable",a)),draggable:eeR(ee_(r,"draggable",a)),code:eeR(ee_(r,"code",a)),defining:eeR(ee_(r,"defining",a)),isolating:eeR(ee_(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=eeR(ee_(r,"parseHTML",a));c&&(s.parseDOM=c.map(t=>eeD(t,o)));let l=ee_(r,"renderHTML",a);l&&(s.toDOM=t=>l({node:t,HTMLAttributes:eej(t,o)}));let d=ee_(r,"renderText",a);return d&&(s.toText=d),[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=ee_(n,"extendMarkSchema",a);return{...t,...i?i(r):{}}},{}),s=eeA({...u,inclusive:eeR(ee_(r,"inclusive",a)),excludes:eeR(ee_(r,"excludes",a)),group:eeR(ee_(r,"group",a)),spanning:eeR(ee_(r,"spanning",a)),code:eeR(ee_(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=eeR(ee_(r,"parseHTML",a));c&&(s.parseDOM=c.map(t=>eeD(t,o)));let l=ee_(r,"renderHTML",a);return l&&(s.toDOM=t=>l({mark:t,HTMLAttributes:eej(t,o)})),[r.name,s]}));return new Qu({topNode:u,nodes:s,marks:c})}function eeP(t,n){return n.nodes[t]||n.marks[t]||null}function eeF(t,n){return Array.isArray(n)?n.some(n=>("string"==typeof n?n:n.name)===t.name):n}let eez=(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 eeU(t){return"[object RegExp]"===Object.prototype.toString.call(t)}class eeW{constructor(t){this.find=t.find,this.handler=t.handler}}let eeB=(t,n)=>{if(eeU(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 eeV(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 d=!1,f=eez(l)+a;return u.forEach(t=>{if(d)return;let n=eeB(f,t.find);if(!n)return;let u=c.state.tr,l=eeS({state:c.state,transaction:u}),p={from:i-(n[0].length-a.length),to:o},{commands:h,chain:m,can:g}=new eew({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),d=!0)}),d}class ee${constructor(t){this.find=t.find,this.handler=t.handler}}let eeK=(t,n)=>{if(eeU(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 eeY{constructor(t,n){this.splittableMarks=[],this.editor=n,this.extensions=eeY.resolve(t),this.schema=eeL(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:eeP(t.name,this.schema)};"mark"===t.type&&(!(null!==(n=eeR(ee_(t,"keepOnSplit",r)))&&void 0!==n)||n)&&this.splittableMarks.push(t.name);let i=ee_(t,"onBeforeCreate",r);i&&this.editor.on("beforeCreate",i);let o=ee_(t,"onCreate",r);o&&this.editor.on("create",o);let a=ee_(t,"onUpdate",r);a&&this.editor.on("update",a);let u=ee_(t,"onSelectionUpdate",r);u&&this.editor.on("selectionUpdate",u);let s=ee_(t,"onTransaction",r);s&&this.editor.on("transaction",s);let c=ee_(t,"onFocus",r);c&&this.editor.on("focus",c);let l=ee_(t,"onBlur",r);l&&this.editor.on("blur",l);let d=ee_(t,"onDestroy",r);d&&this.editor.on("destroy",d)})}static resolve(t){let n=eeY.sort(eeY.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=ee_(t,"addExtensions",n);return r?[t,...this.flatten(r())]:t}).flat(10)}static sort(t){return t.sort((t,n)=>{let r=ee_(t,"priority")||100,i=ee_(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:eeP(n.name,this.schema)},i=ee_(n,"addCommands",r);return i?{...t,...i()}:t},{})}get plugins(){let{editor:t}=this,n=eeY.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:eeP(n.name,this.schema)},s=[],c=ee_(n,"addKeyboardShortcuts",u),l={};if("mark"===n.type&&n.config.exitable&&(l.ArrowRight=()=>eng.handleExit({editor:t,mark:n})),c){let d=Object.fromEntries(Object.entries(c()).map(([n,r])=>[n,()=>r({editor:t})]));l={...l,...d}}let f,p=(o=l,new Hm({props:{handleKeyDown:(a=o,f=function(t){let n=Object.create(null);for(let r in t)n[X7(r)]=t[r];return n}(a),function(t,n){var r,i;let o=("Esc"==(i=!(X3&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||X5&&n.shiftKey&&n.key&&1==n.key.length||"Unidentified"==n.key)&&n.key||(n.shiftKey?X4:X2)[n.keyCode]||n.key||"Unidentified")&&(i="Escape"),"Del"==i&&(i="Delete"),"Left"==i&&(i="ArrowLeft"),"Up"==i&&(i="ArrowUp"),"Right"==i&&(i="ArrowRight"),"Down"==i&&(i="ArrowDown"),i),a,u=f[eee(o,n)];if(u&&u(t.state,t.dispatch,t))return!0;if(1==o.length&&" "!=o){if(n.shiftKey){let s=f[eee(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=X2[n.keyCode])&&a!=o){let c=f[eee(a,n)];if(c&&c(t.state,t.dispatch,t))return!0}}return!1})}}));s.push(p);let h=ee_(n,"addInputRules",u);eeF(n,t.options.enableInputRules)&&h&&r.push(...h());let m=ee_(n,"addPasteRules",u);eeF(n,t.options.enablePasteRules)&&m&&i.push(...m());let g=ee_(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 Hm({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)=>eeV({editor:n,from:o,to:a,text:u,rules:r,plugin:i}),handleDOMEvents:{compositionend:t=>(setTimeout(()=>{let{$cursor:o}=t.state.selection;o&&eeV({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&&eeV({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 Hm({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,d="drop"===c.getMeta("uiEvent")&&!a;if(!l&&!d)return;let f=i.doc.content.findDiffStart(u.doc.content),p=i.doc.content.findDiffEnd(u.doc.content);if("number"!=typeof f||!p||f===p.b)return;let h=u.tr,m=eeS({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 eew({editor:n,state:r}),l=[];return r.doc.nodesBetween(i,o,(t,n)=>{if(!t.isTextblock||t.type.spec.code)return;let d=Math.max(i,n),f=Math.min(o,n+t.content.size),p=t.textBetween(d-n,f-n,void 0,"");eeK(p,a.find).forEach(t=>{if(void 0===t.index)return;let n=d+t.index+1,i=n+t[0].length,o={from:r.tr.mapping.map(n),to:r.tr.mapping.map(i)},f=a.handler({state:r,range:o,match:t,commands:u,chain:s,can:c});l.push(f)})}),l.every(t=>null!==t)}({editor:n,state:m,from:Math.max(f-1,0),to:p.b-1,rule:t})||!h.steps.length))return h}}))}({editor:t,rules:i}),...o]}get attributes(){return eek(this.extensions)}get nodeViews(){let{editor:t}=this,{nodeExtensions:n}=eeO(this.extensions);return Object.fromEntries(n.filter(t=>!!ee_(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:eeC(n.name,this.schema)},o=ee_(n,"addNodeView",i);if(!o)return[];let a=(i,a,u,s)=>{let c=eej(i,r);return o()({editor:t,node:i,getPos:u,decorations:s,HTMLAttributes:c,extension:n})};return[n.name,a]}))}}function eeq(t){var n;return"Object"===Object.prototype.toString.call(t).slice(8,-1)&&t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function eeG(t,n){let r={...t};return eeq(t)&&eeq(n)&&Object.keys(n).forEach(i=>{eeq(n[i])&&i in t?r[i]=eeG(t[i],n[i]):Object.assign(r,{[i]:n[i]})}),r}class eeZ{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=eeR(ee_(this,"addOptions",{name:this.name}))),this.storage=eeR(ee_(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new eeZ(t)}configure(t={}){let n=this.extend();return n.options=eeG(this.options,t),n.storage=eeR(ee_(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){let n=new eeZ(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=eeR(ee_(n,"addOptions",{name:n.name})),n.storage=eeR(ee_(n,"addStorage",{name:n.name,options:n.options})),n}}function eeQ(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,d)=>{var f;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:d,range:n}))):t.isText?(s+=null===(f=null==t?void 0:t.text)||void 0===f?void 0:f.slice(Math.max(i,r)-r,o-r),c=!1):t.isBlock&&!c&&(s+=a,c=!0)}),s}function eeH(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}let eeJ=eeZ.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Hm({key:new Hv("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=eeH(r);return eeQ(i,{from:u,to:s},{textSerializers:c})}}})]}}),eeX=()=>({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),ee0=(t=!1)=>({commands:n})=>n.setContent("",t),ee1=()=>({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=Qz(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},ee2=t=>n=>t(n),ee4=()=>({state:t,dispatch:n})=>eem(t,n),ee3=()=>({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},ee5=t=>({tr:n,state:r,dispatch:i})=>{let o=eeC(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},ee9=t=>({tr:n,dispatch:r})=>{let{from:i,to:o}=t;return r&&n.delete(i,o),!0},ee8=()=>({state:t,dispatch:n})=>eet(t,n),ee6=()=>({commands:t})=>t.keyboardShortcut("Enter"),ee7=()=>({state:t,dispatch:n})=>eeh(t,n);function ete(t,n,r={strict:!0}){let i=Object.keys(n);return!i.length||i.every(i=>r.strict?n[i]===t[i]:eeU(n[i])?n[i].test(t[i]):n[i]===t[i])}function ett(t,n,r={}){return t.find(t=>t.type===n&&ete(t.attrs,r))}function etn(t,n,r={}){return!!ett(t,n,r)}function etr(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=ett([...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(ett([...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&&etn([...t.parent.child(s).marks],n,r);)c+=t.parent.child(s).nodeSize,s+=1;return{from:u,to:c}}function eti(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 eto=(t,n={})=>({tr:r,state:i,dispatch:o})=>{let a=eti(t,i.schema),{doc:u,selection:s}=r,{$from:c,from:l,to:d}=s;if(o){let f=etr(c,a,n);if(f&&f.from<=l&&f.to>=d){let p=Ht.create(u,f.from,f.to);r.setSelection(p)}}return!0},eta=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 etu(t){return t instanceof Ht}function ets(t=0,n=0,r=0){return Math.min(Math.max(t,n),r)}function etc(t,n=null){if(!n)return null;let r=Q8.atStart(t),i=Q8.atEnd(t);if("start"===n||!0===n)return r;if("end"===n)return i;let o=r.from,a=i.to;return"all"===n?Ht.create(t,ets(0,o,a),ets(t.content.size,o,a)):Ht.create(t,ets(n,o,a),ets(n,o,a))}function etl(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}let etd=(t=null,n={})=>({editor:r,view:i,tr:o,dispatch:a})=>{n={scrollIntoView:!0,...n};let u=()=>{etl()&&i.dom.focus(),requestAnimationFrame(()=>{r.isDestroyed||(i.focus(),null!=n&&n.scrollIntoView&&r.commands.scrollIntoView())})};if(i.hasFocus()&&null===t||!1===t)return!0;if(a&&null===t&&!etu(r.state.selection))return u(),!0;let s=etc(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},etf=(t,n)=>r=>t.every((t,i)=>n(t,{...r,index:i})),etp=(t,n)=>({tr:r,commands:i})=>i.insertContentAt({from:r.selection.from,to:r.selection.to},t,n);function eth(t){let n=`<body>${t}</body>`;return new window.DOMParser().parseFromString(n,"text/html").body}function etm(t,n,r){if(r={slice:!0,parseOptions:{},...r},"object"==typeof t&&null!==t)try{return Array.isArray(t)&&t.length>0?ZR.fromArray(t.map(t=>n.nodeFromJSON(t))):n.nodeFromJSON(t)}catch(i){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",i),etm("",n,r)}if("string"==typeof t){let o=Qc.fromSchema(n);return r.slice?o.parseSlice(eth(t),r.parseOptions).content:o.parse(eth(t),r.parseOptions)}return etm("",n,r)}let etg=t=>t.toString().startsWith("<"),ety=(t,n,r)=>({tr:i,dispatch:o,editor:a})=>{if(o){r={parseOptions:{},updateSelection:!0,...r};let u=etm(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,d=!0;if((etg(u)?u:[u]).forEach(t=>{t.check(),l=!!l&&t.isText&&0===t.marks.length,d=!!d&&t.isBlock}),s===c&&d){let{parent:f}=i.doc.resolve(s);!f.isTextblock||f.type.spec.code||f.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 QA||o instanceof QL))return;let a=t.mapping.maps[i],u=0;a.forEach((t,n,r,i)=>{0===u&&(u=i)}),t.setSelection(Q8.near(t.doc.resolve(u),-1))}(i,i.steps.length-1,-1)}return!0},etv=()=>({state:t,dispatch:n})=>eec(t,n),etb=()=>({state:t,dispatch:n})=>eel(t,n),etx=()=>({state:t,dispatch:n})=>een(t,n),etM=()=>({state:t,dispatch:n})=>eea(t,n);function etT(){return"u">typeof navigator&&/Mac/.test(navigator.platform)}let etS=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))etl()||etT()?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 etw(t,n,r={}){let{from:i,to:o,empty:a}=t.selection,u=n?eeC(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=>ete(t.node.attrs,r,{strict:!1}));return a?!!c.length:c.reduce((t,n)=>t+n.to-n.from,0)>=o-i}let etI=(t,n={})=>({state:r,dispatch:i})=>{let o=eeC(t,r.schema);return!!etw(r,o,n)&&eed(r,i)},et_=()=>({state:t,dispatch:n})=>eeg(t,n),etO=t=>({state:n,dispatch:r})=>{var i;let o=eeC(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 QL(a-1,u,a,u,new Zz(ZR.from(r.create(null,i.parent.copy())),1,0),1,!0)),i=new ZQ(o.doc.resolve(i.$from.pos),o.doc.resolve(u),i.depth));let s=Qz(i);if(null==s)return!1;o.lift(i,s);let c=o.mapping.map(a,-1)-1;return QV(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 d=0==r.startIndex,f=r.endIndex==o.childCount,p=c.node(-1),h=c.index(-1);if(!p.canReplace(h+(d?0:1),h+1,l.content.append(f?ZR.empty:ZR.from(o))))return!1;let m=c.pos,g=m+l.nodeSize;return i.step(new QL(m-(d?1:0),g+(f?1:0),m+1,g-1,new Zz((d?ZR.empty:ZR.from(o.copy(ZR.empty))).append(f?ZR.empty:ZR.from(o.copy(ZR.empty))),d?0:1,f?0:1),d?0:1)),n(i.scrollIntoView()),!0}(t,n,a)))}(n,r)},etk=()=>({state:t,dispatch:n})=>eef(t,n);function etC(t,n){return n.nodes[t]?"node":n.marks[t]?"mark":null}function etN(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 etj=(t,n)=>({tr:r,state:i,dispatch:o})=>{let a=null,u=null,s=etC("string"==typeof t?t:t.name,i.schema);return!!s&&("node"===s&&(a=eeC(t,i.schema)),"mark"===s&&(u=eti(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,etN(t.attrs,n)),u&&t.marks.length&&t.marks.forEach(o=>{u===o.type&&r.addMark(i,i+t.nodeSize,u.create(etN(o.attrs,n)))})})}),!0)},etE=()=>({tr:t,dispatch:n})=>(n&&t.scrollIntoView(),!0),etR=()=>({tr:t,commands:n})=>n.setTextSelection({from:0,to:t.doc.content.size}),etD=()=>({state:t,dispatch:n})=>eei(t,n),etA=()=>({state:t,dispatch:n})=>eeu(t,n),etL=()=>({state:t,dispatch:n})=>eey(t,n),etP=()=>({state:t,dispatch:n})=>eeM(t,n),etF=()=>({state:t,dispatch:n})=>eex(t,n);function etz(t,n,r={}){return etm(t,n,{slice:!1,parseOptions:r})}let etU=(t,n=!1,r={})=>({tr:i,editor:o,dispatch:a})=>{let{doc:u}=i,s=etz(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 etB(t,n){let r=eti(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 etV(t,n,r){let i=[];return t===n?r.resolve(t).marks().forEach(n=>{let o=r.resolve(t-1),a=etr(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 et$(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 etK(t,n,r={}){let{empty:i,ranges:o}=t.selection,a=n?eti(n,t.schema):null;if(i)return!!(t.storedMarks||t.selection.$from.marks()).filter(t=>!a||a.name===t.type.name).find(t=>ete(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=>ete(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 etY(t,n){let{nodeExtensions:r}=eeO(n),i=r.find(n=>n.name===t);if(!i)return!1;let o={name:i.name,options:i.options,storage:i.storage},a=eeR(ee_(i,"group",o));return"string"==typeof a&&a.split(" ").includes("list")}let etq=(t,n={})=>({tr:r,state:i,dispatch:o})=>{let{selection:a}=r,{empty:u,ranges:s}=a,c=eti(t,i.schema);if(o){if(u){let l=etB(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(etu(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)},etG=(t,n)=>({tr:r})=>(r.setMeta(t,n),!0),etZ=(t,n={})=>({state:r,dispatch:i,chain:o})=>{let a=eeC(t,r.schema);return a.isTextblock?o().command(({commands:t})=>!!eeT(a,n)(r)||t.clearNodes()).command(({state:t})=>eeT(a,n)(t,i)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},etQ=t=>({tr:n,dispatch:r})=>{if(r){let{doc:i}=n,o=ets(t,0,i.content.size),a=Hr.create(i,o);n.setSelection(a)}return!0},etH=t=>({tr:n,dispatch:r})=>{if(r){let{doc:i}=n,{from:o,to:a}="number"==typeof t?{from:t,to:t}:t,u=Ht.atStart(i).from,s=Ht.atEnd(i).to,c=ets(o,u,s),l=ets(a,u,s),d=Ht.create(i,c,l);n.setSelection(d)}return!0},etJ=t=>({state:n,dispatch:r})=>{var i;let o=eeC(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,d=ZR.from(l?o.create():null),f=new Zz(ZR.from(o.create(null,ZR.from(s.type.create(null,d)))),l?3:1,0),p=a.start,h=a.end;n(t.tr.step(new QL(p-(l?3:1),h,p,h,f,1,!0)).scrollIntoView())}return!0}(n,r)};function etX(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 et0=({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,d=et$(l,s.node().type.name,s.node().attrs);if(a instanceof Hr&&a.node.isBlock)return!!(s.parentOffset&&QB(u,s.pos))&&(i&&(t&&etX(r,o.extensionManager.splittableMarks),n.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;if(i){let f=c.parentOffset===c.parent.content.size;a instanceof Ht&&n.deleteSelection();let p=0===s.depth?void 0:function(t){for(let n=0;n<t.edgeCount;n+=1){let{type:r}=t.edge(n);if(r.isTextblock&&!r.hasRequiredAttrs())return r}return null}(s.node(-1).contentMatchAt(s.indexAfter(-1))),h=f&&p?[{type:p,attrs:d}]:void 0,m=QB(n.doc,n.mapping.map(s.pos),1,h);if(!h&&!m&&QB(n.doc,n.mapping.map(s.pos),1,p?[{type:p}]:void 0)&&(m=!0,h=p?[{type:p,attrs:d}]:void 0),m&&(n.split(n.mapping.map(s.pos),1,h),p&&!f&&!s.parentOffset&&s.parent.type!==p)){let g=n.mapping.map(s.before()),y=n.doc.resolve(g);s.node(-1).canReplaceWith(y.index(),y.index()+1,p)&&n.setNodeMarkup(n.mapping.map(s.before()),p)}t&&etX(r,o.extensionManager.splittableMarks),n.scrollIntoView()}return!0},et1=t=>({tr:n,state:r,dispatch:i,editor:o})=>{var a;let u=eeC(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 d=s.node(-1);if(d.type!==u)return!1;let f=o.extensionManager.attributes;if(0===s.parent.content.size&&s.node(-1).childCount===s.indexAfter(-1)){if(2===s.depth||s.node(-3).type!==u||s.index(-2)!==s.node(-2).childCount-1)return!1;if(i){let p=ZR.empty,h=s.index(-1)?1:s.index(-2)?2:3;for(let m=s.depth-h;m>=s.depth-3;m-=1)p=ZR.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=et$(f,s.node().type.name,s.node().attrs),v=(null===(a=u.contentMatch.defaultType)||void 0===a?void 0:a.createAndFill(y))||void 0;p=p.append(ZR.from(u.createAndFill(null,v)||void 0));let b=s.before(s.depth-(h-1));n.replace(b,s.after(-g),new Zz(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(Ht.near(n.doc.resolve(x))),n.scrollIntoView()}return!0}let M=c.pos===s.end()?d.contentMatchAt(0).defaultType:null,T=et$(f,d.type.name,d.attrs),S=et$(f,s.node().type.name,s.node().attrs);if(n.delete(s.pos,c.pos),!QB(n.doc,s.pos,2))return!1;if(i){let{selection:w,storedMarks:I}=r,{splittableMarks:_}=o.extensionManager,O=I||w.$to.parentOffset&&w.$from.marks();if(n.split(s.pos,2,M?[{type:u,attrs:T},{type:M,attrs:S}]:[{type:u,attrs:T}]).scrollIntoView(),!O||!i)return!0;let k=O.filter(t=>_.includes(t.type.name));n.ensureMarks(k)}return!0},et2=(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)&&QV(t.doc,r.pos)&&t.join(r.pos),!0},et4=(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)&&QV(t.doc,i)&&t.join(i),!0},et3=(t,n,r,i={})=>({editor:o,tr:a,state:u,dispatch:s,chain:c,commands:l,can:d})=>{let{extensions:f,splittableMarks:p}=o.extensionManager,h=eeC(t,u.schema),m=eeC(n,u.schema),{selection:g,storedMarks:y}=u,{$from:v,$to:b}=g,x=v.blockRange(b),M=y||g.$to.parentOffset&&g.$from.marks();if(!x)return!1;let T=etW(t=>etY(t.type.name,f))(g);if(x.depth>=1&&T&&x.depth-T.depth<=1){if(T.node.type===h)return l.liftListItem(m);if(etY(T.node.type.name,f)&&h.validContent(T.node.content)&&s)return c().command(()=>(a.setNodeMarkup(T.pos,h),!0)).command(()=>et2(a,h)).command(()=>et4(a,h)).run()}return r&&M&&s?c().command(()=>{let t=d().wrapInList(h,i),n=M.filter(t=>p.includes(t.type.name));return a.ensureMarks(n),!!t||l.clearNodes()}).wrapInList(h,i).command(()=>et2(a,h)).command(()=>et4(a,h)).run():c().command(()=>!!d().wrapInList(h,i)||l.clearNodes()).wrapInList(h,i).command(()=>et2(a,h)).command(()=>et4(a,h)).run()},et5=(t,n={},r={})=>({state:i,commands:o})=>{let{extendEmptyMarkRange:a=!1}=r,u=eti(t,i.schema);return etK(i,u,n)?o.unsetMark(u,{extendEmptyMarkRange:a}):o.setMark(u,n)},et9=(t,n,r={})=>({state:i,commands:o})=>{let a=eeC(t,i.schema),u=eeC(n,i.schema);return etw(i,a,r)?o.setNode(u):o.setNode(a,r)},et8=(t,n={})=>({state:r,commands:i})=>{let o=eeC(t,r.schema);return etw(r,o,n)?i.lift(o):i.wrapIn(o,n)},et6=()=>({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},et7=()=>({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},ene=(t,n={})=>({tr:r,state:i,dispatch:o})=>{var a;let{extendEmptyMarkRange:u=!1}=n,{selection:s}=r,c=eti(t,i.schema),{$from:l,empty:d,ranges:f}=s;if(!o)return!0;if(d&&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=etr(l,c,m);g&&(p=g.from,h=g.to),r.removeMark(p,h,c)}else f.forEach(t=>{r.removeMark(t.$from.pos,t.$to.pos,c)});return r.removeStoredMark(c),!0},ent=(t,n={})=>({tr:r,state:i,dispatch:o})=>{let a=null,u=null,s=etC("string"==typeof t?t:t.name,i.schema);return!!s&&("node"===s&&(a=eeC(t,i.schema)),"mark"===s&&(u=eti(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)},enn=(t,n={})=>({state:r,dispatch:i})=>{let o=eeC(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&&QU(u,t,n);return!!s&&(i&&i(r.tr.wrap(u,s).scrollIntoView()),!0)}})(o,n)(r,i)},enr=(t,n={})=>({state:r,dispatch:i})=>{let o=eeC(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 ZQ(l,l,u.depth),u.endIndex<u.parent.childCount&&(u=new ZQ(o,r.doc.resolve(a.end(u.depth)),u.depth)),s=!0}let d=QU(c,t,n,u);return!!d&&(i&&i((function(t,n,r,i,o){let a=ZR.empty;for(let u=r.length-1;u>=0;u--)a=ZR.from(r[u].type.create(r[u].attrs,a));t.step(new QL(n.start-(i?2:0),n.end,n.start,n.end,new Zz(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,d=n.start+r.length-(i?2:0),f=n.parent;for(let p=n.startIndex,h=n.endIndex,m=!0;p<h;p++,m=!1)!m&&QB(t.doc,d,l)&&(t.split(d,l),d+=2*l),d+=f.child(p).nodeSize;return t})(r.tr,u,d,s,t).scrollIntoView()),!0)}})(o,n)(r,i)};var eni=Object.freeze({__proto__:null,blur:eeX,clearContent:ee0,clearNodes:ee1,command:ee2,createParagraphNear:ee4,deleteCurrentNode:ee3,deleteNode:ee5,deleteRange:ee9,deleteSelection:ee8,enter:ee6,exitCode:ee7,extendMarkRange:eto,first:eta,focus:etd,forEach:etf,insertContent:etp,insertContentAt:ety,joinUp:etv,joinDown:etb,joinBackward:etx,joinForward:etM,keyboardShortcut:etS,lift:etI,liftEmptyBlock:et_,liftListItem:etO,newlineInCode:etk,resetAttributes:etj,scrollIntoView:etE,selectAll:etR,selectNodeBackward:etD,selectNodeForward:etA,selectParentNode:etL,selectTextblockEnd:etP,selectTextblockStart:etF,setContent:etU,setMark:etq,setMeta:etG,setNode:etZ,setNodeSelection:etQ,setTextSelection:etH,sinkListItem:etJ,splitBlock:et0,splitListItem:et1,toggleList:et3,toggleMark:et5,toggleNode:et9,toggleWrap:et8,undoInputRule:et6,unsetAllMarks:et7,unsetMark:ene,updateAttributes:ent,wrapIn:enn,wrapInList:enr});let eno=eeZ.create({name:"commands",addCommands:()=>({...eni})}),ena=eeZ.create({name:"editable",addProseMirrorPlugins(){return[new Hm({key:new Hv("editable"),props:{editable:()=>this.editor.options.editable}})]}}),enu=eeZ.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:t}=this;return[new Hm({key:new Hv("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}}}})]}}),ens=eeZ.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=Q8.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 etl()||etT()?o:i},addProseMirrorPlugins(){return[new Hm({key:new Hv("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=Q8.atStart(n.doc).from,s=Q8.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=eeS({state:r,transaction:c}),{commands:d}=new eew({editor:this.editor,state:l});if(d.clearNodes(),c.steps.length)return c}})]}}),enc=eeZ.create({name:"tabindex",addProseMirrorPlugins(){return[new Hm({key:new Hv("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var enl=Object.freeze({__proto__:null,ClipboardTextSerializer:eeJ,Commands:eno,Editable:ena,FocusEvents:enu,Keymap:ens,Tabindex:enc});let end=`.ProseMirror {
|
|
17
|
+
position: relative;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.ProseMirror {
|
|
21
|
+
word-wrap: break-word;
|
|
22
|
+
white-space: pre-wrap;
|
|
23
|
+
white-space: break-spaces;
|
|
24
|
+
-webkit-font-variant-ligatures: none;
|
|
25
|
+
font-variant-ligatures: none;
|
|
26
|
+
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.ProseMirror [contenteditable="false"] {
|
|
30
|
+
white-space: normal;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
|
|
34
|
+
white-space: pre-wrap;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.ProseMirror pre {
|
|
38
|
+
white-space: pre-wrap;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
img.ProseMirror-separator {
|
|
42
|
+
display: inline !important;
|
|
43
|
+
border: none !important;
|
|
44
|
+
margin: 0 !important;
|
|
45
|
+
width: 1px !important;
|
|
46
|
+
height: 1px !important;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.ProseMirror-gapcursor {
|
|
50
|
+
display: none;
|
|
51
|
+
pointer-events: none;
|
|
52
|
+
position: absolute;
|
|
53
|
+
margin: 0;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.ProseMirror-gapcursor:after {
|
|
57
|
+
content: "";
|
|
58
|
+
display: block;
|
|
59
|
+
position: absolute;
|
|
60
|
+
top: -2px;
|
|
61
|
+
width: 20px;
|
|
62
|
+
border-top: 1px solid black;
|
|
63
|
+
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@keyframes ProseMirror-cursor-blink {
|
|
67
|
+
to {
|
|
68
|
+
visibility: hidden;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.ProseMirror-hideselection *::selection {
|
|
73
|
+
background: transparent;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.ProseMirror-hideselection *::-moz-selection {
|
|
77
|
+
background: transparent;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.ProseMirror-hideselection * {
|
|
81
|
+
caret-color: transparent;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
85
|
+
display: block;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.tippy-box[data-animation=fade][data-state=hidden] {
|
|
89
|
+
opacity: 0
|
|
90
|
+
}`,enf=class extends eeI{constructor(t={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=function(t,n){let r=document.querySelector("style[data-tiptap-style]");if(null!==r)return r;let i=document.createElement("style");return n&&i.setAttribute("nonce",n),i.setAttribute("data-tiptap-style",""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}(end,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},this.view&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,n=!0){this.setOptions({editable:t}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(t,n){let r=eeE(n)?n(t,[...this.state.plugins]):[...this.state.plugins,t],i=this.state.reconfigure({plugins:r});this.view.updateState(i)}unregisterPlugin(t){if(this.isDestroyed)return;let n="string"==typeof t?`${t}$`:t.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(t=>!t.key.startsWith(n))});this.view.updateState(r)}createExtensionManager(){let t=[...this.options.enableCoreExtensions?Object.values(enl):[],...this.options.extensions].filter(t=>["extension","node","mark"].includes(null==t?void 0:t.type));this.extensionManager=new eeY(t,this)}createCommandManager(){this.commandManager=new eew({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){let t=etz(this.options.content,this.schema,this.options.parseOptions),n=etc(t,this.options.autofocus);this.view=new XQ(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:Hh.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=etC("string"==typeof n?n:n.name,t.schema);return"node"===r?function(t,n){let r=eeC(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?etB(t,n):{}}(this.state,t)}isActive(t,n){return function(t,n,r={}){if(!n)return etw(t,null,r)||etK(t,null,r);let i=etC(n,t.schema);return"node"===i?etw(t,n,r):"mark"===i&&etK(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=Qb.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 eeQ(t,r,n)}(this.state.doc,{blockSeparator:n,textSerializers:{...eeH(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 enp(t){return new eeW({find:t.find,handler({state:n,range:r,match:i}){let o=eeR(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/),d=r.from+s.indexOf(u),f=d+u.length;if(etV(r.from,r.to,n.doc).filter(n=>n.mark.type.excluded.find(r=>r===t.type&&r!==n.mark.type)).filter(t=>t.to>d).length)return null;f<r.to&&a.delete(f,r.to),d>r.from&&a.delete(r.from+l,d),c=r.from+l+u.length,a.addMark(r.from+l,c,t.type.create(o||{})),a.removeStoredMark(t.type)}}})}function enh(t){return new eeW({find:t.find,handler({state:n,range:r,match:i}){let o=n.doc.resolve(r.from),a=eeR(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 enm(t){return new eeW({find:t.find,handler({state:n,range:r,match:i,chain:o}){let a=eeR(t.getAttributes,void 0,i)||{},u=n.tr.delete(r.from,r.to),s=u.doc.resolve(r.from).blockRange(),c=s&&QU(s,t.type,a);if(!c)return null;if(u.wrap(s,c),t.keepMarks&&t.editor){let{selection:l,storedMarks:d}=n,{splittableMarks:f}=t.editor.extensionManager,p=d||l.$to.parentOffset&&l.$from.marks();if(p){let h=p.filter(t=>f.includes(t.type.name));u.ensureMarks(h)}}if(t.keepAttributes){let m="bulletList"===t.type.name||"orderedList"===t.type.name?"listItem":"taskList";o().updateAttributes(m,a).run()}let g=u.doc.resolve(r.from-1).nodeBefore;g&&g.type===t.type&&QV(u.doc,r.from-1)&&(!t.joinPredicate||t.joinPredicate(i,g))&&u.join(r.from-1)}})}let eng=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=eeR(ee_(this,"addOptions",{name:this.name}))),this.storage=eeR(ee_(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(n={}){return new t(n)}configure(t={}){let n=this.extend();return n.options=eeG(this.options,t),n.storage=eeR(ee_(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=eeR(ee_(r,"addOptions",{name:r.name})),r.storage=eeR(ee_(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 eny{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=eeR(ee_(this,"addOptions",{name:this.name}))),this.storage=eeR(ee_(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new eny(t)}configure(t={}){let n=this.extend();return n.options=eeG(this.options,t),n.storage=eeR(ee_(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){let n=new eny(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=eeR(ee_(n,"addOptions",{name:n.name})),n.storage=eeR(ee_(n,"addStorage",{name:n.name,options:n.options})),n}}class env{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,d=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)||!d)return;let f=0,p=0;if(this.dom!==d){let h=this.dom.getBoundingClientRect(),m=d.getBoundingClientRect(),g=null!==(i=t.offsetX)&&void 0!==i?i:null===(o=t.nativeEvent)||void 0===o?void 0:o.offsetX,y=null!==(a=t.offsetY)&&void 0!==a?a:null===(u=t.nativeEvent)||void 0===u?void 0:u.offsetY;f=m.x-h.x+g,p=m.y-h.y+y}null===(s=t.dataTransfer)||void 0===s||s.setDragImage(this.dom,f,p);let v=Hr.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=Hr.isSelectable(this.node),l="copy"===t.type,d="paste"===t.type,f="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||d||f||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&&etl()&&this.editor.isFocused&&[...Array.from(t.addedNodes),...Array.from(t.removedNodes)].every(t=>t.isContentEditable))&&(this.contentDOM===t.target&&"attributes"===t.type||!this.contentDOM.contains(t.target)))}updateAttributes(t){this.editor.commands.command(({tr:n})=>{let r=this.getPos();return n.setNodeMarkup(r,void 0,{...this.node.attrs,...t}),!0})}deleteNode(){let t=this.getPos(),n=t+this.node.nodeSize;this.editor.commands.deleteRange({from:t,to:n})}}function enb(t){return new ee$({find:t.find,handler({state:n,range:r,match:i}){let o=eeR(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/),d=r.from+s.indexOf(u),f=d+u.length;if(etV(r.from,r.to,n.doc).filter(n=>n.mark.type.excluded.find(r=>r===t.type&&r!==n.mark.type)).filter(t=>t.to>d).length)return null;f<r.to&&a.delete(f,r.to),d>r.from&&a.delete(r.from+l,d),c=r.from+l+u.length,a.addMark(r.from+l,c,t.type.create(o||{})),a.removeStoredMark(t.type)}}})}var enx="bottom",enM="right",enT="left",enS="auto",enw=["top",enx,enM,enT],enI="start",en_="viewport",enO="popper",enk=enw.reduce(function(t,n){return t.concat([n+"-"+enI,n+"-end"])},[]),enC=[].concat(enw,[enS]).reduce(function(t,n){return t.concat([n,n+"-"+enI,n+"-end"])},[]),enN=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function enj(t){return t?(t.nodeName||"").toLowerCase():null}function enE(t){if(null==t)return window;if("[object Window]"!==t.toString()){var n=t.ownerDocument;return n&&n.defaultView||window}return t}function enR(t){var n=enE(t).Element;return t instanceof n||t instanceof Element}function enD(t){var n=enE(t).HTMLElement;return t instanceof n||t instanceof HTMLElement}function enA(t){if(typeof ShadowRoot>"u")return!1;var n=enE(t).ShadowRoot;return t instanceof n||t instanceof ShadowRoot}let enL={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];enD(o)&&enj(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},{});enD(i)&&enj(i)&&(Object.assign(i.style,a),Object.keys(o).forEach(function(t){i.removeAttribute(t)}))})}},requires:["computeStyles"]};function enP(t){return t.split("-")[0]}var enF=Math.max,enz=Math.min,enU=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 enB(){return!/^((?!chrome|android).)*safari/i.test(enW())}function enV(t,n,r){void 0===n&&(n=!1),void 0===r&&(r=!1);var i=t.getBoundingClientRect(),o=1,a=1;n&&enD(t)&&(o=t.offsetWidth>0&&enU(i.width)/t.offsetWidth||1,a=t.offsetHeight>0&&enU(i.height)/t.offsetHeight||1);var u=(enR(t)?enE(t):window).visualViewport,s=!enB()&&r,c=(i.left+(s&&u?u.offsetLeft:0))/o,l=(i.top+(s&&u?u.offsetTop:0))/a,d=i.width/o,f=i.height/a;return{width:d,height:f,top:l,right:c+d,bottom:l+f,left:c,x:c,y:l}}function en$(t){var n=enV(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 enK(t,n){var r=n.getRootNode&&n.getRootNode();if(t.contains(n))return!0;if(r&&enA(r)){var i=n;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function enY(t){return enE(t).getComputedStyle(t)}function enq(t){return["table","td","th"].indexOf(enj(t))>=0}function enG(t){return((enR(t)?t.ownerDocument:t.document)||window.document).documentElement}function enZ(t){return"html"===enj(t)?t:t.assignedSlot||t.parentNode||(enA(t)?t.host:null)||enG(t)}function enQ(t){return enD(t)&&"fixed"!==enY(t).position?t.offsetParent:null}function enH(t){for(var n=enE(t),r=enQ(t);r&&enq(r)&&"static"===enY(r).position;)r=enQ(r);return r&&("html"===enj(r)||"body"===enj(r)&&"static"===enY(r).position)?n:r||function(t){var n=/firefox/i.test(enW());if(/Trident/i.test(enW())&&enD(t)&&"fixed"===enY(t).position)return null;var r=enZ(t);for(enA(r)&&(r=r.host);enD(r)&&0>["html","body"].indexOf(enj(r));){var i=enY(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 enJ(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function enX(t,n,r){return enF(t,enz(n,r))}function en0(){return{top:0,right:0,bottom:0,left:0}}function en1(t){return Object.assign({},en0(),t)}function en2(t,n){return n.reduce(function(n,r){return n[r]=t,n},{})}function en4(t){return t.split("-")[1]}var en3={top:"auto",right:"auto",bottom:"auto",left:"auto"};function en5(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,d=t.adaptive,f=t.roundOffsets,p=t.isFixed,h=s.x,m=void 0===h?0:h,g=s.y,y=void 0===g?0:g,v="function"==typeof f?f({x:m,y:y}):{x:m,y:y};m=v.x,y=v.y;var b=s.hasOwnProperty("x"),x=s.hasOwnProperty("y"),M=enT,T="top",S=window;if(d){var w=enH(i),I="clientHeight",_="clientWidth";w===enE(i)&&(w=enG(i),"static"!==enY(w).position&&"absolute"===c&&(I="scrollHeight",_="scrollWidth")),("top"===a||(a===enT||a===enM)&&"end"===u)&&(T=enx,y-=(p&&w===S&&S.visualViewport?S.visualViewport.height:w[I])-o.height,y*=l?1:-1),(a===enT||("top"===a||a===enx)&&"end"===u)&&(M=enM,m-=(p&&w===S&&S.visualViewport?S.visualViewport.width:w[_])-o.width,m*=l?1:-1)}var O,k,C,N,j,E=Object.assign({position:c},d&&en3),R=!0===f?(O={x:m,y:y},k=enE(i),C=O.x,N=O.y,{x:enU(C*(j=k.devicePixelRatio||1))/j||0,y:enU(N*j)/j||0}):{x:m,y:y};return(m=R.x,y=R.y,l)?Object.assign({},E,((n={})[T]=x?"0":"",n[M]=b?"0":"",n.transform=1>=(S.devicePixelRatio||1)?"translate("+m+"px, "+y+"px)":"translate3d("+m+"px, "+y+"px, 0)",n)):Object.assign({},E,((r={})[T]=x?y+"px":"",r[M]=b?m+"px":"",r.transform="",r))}var en9={passive:!0},en8={left:"right",right:"left",bottom:"top",top:"bottom"};function en6(t){return t.replace(/left|right|bottom|top/g,function(t){return en8[t]})}var en7={start:"end",end:"start"};function ere(t){return t.replace(/start|end/g,function(t){return en7[t]})}function ert(t){var n,r=enE(t);return{scrollLeft:r.pageXOffset,scrollTop:r.pageYOffset}}function ern(t){return enV(enG(t)).left+ert(t).scrollLeft}function err(t){var n=enY(t),r=n.overflow,i=n.overflowX,o=n.overflowY;return/auto|scroll|overlay|hidden/.test(r+o+i)}function eri(t,n){void 0===n&&(n=[]);var r,i=function t(n){return["html","body","#document"].indexOf(enj(n))>=0?n.ownerDocument.body:enD(n)&&err(n)?n:t(enZ(n))}(t),o=i===(null==(r=t.ownerDocument)?void 0:r.body),a=enE(i),u=o?[a].concat(a.visualViewport||[],err(i)?i:[]):i,s=n.concat(u);return o?s:s.concat(eri(enZ(u)))}function ero(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function era(t,n,r){var i,o,a,u,s,c,l,d,f,p,h,m;return n===en_?ero(function(t,n){var r=enE(t),i=enG(t),o=r.visualViewport,a=i.clientWidth,u=i.clientHeight,s=0,c=0;if(o){a=o.width,u=o.height;var l=enB();(l||!l&&"fixed"===n)&&(s=o.offsetLeft,c=o.offsetTop)}return{width:a,height:u,x:s+ern(t),y:c}}(t,r)):enR(n)?((a=enV(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):ero((u=enG(t),c=enG(u),l=ert(u),d=null==(s=u.ownerDocument)?void 0:s.body,f=enF(c.scrollWidth,c.clientWidth,d?d.scrollWidth:0,d?d.clientWidth:0),p=enF(c.scrollHeight,c.clientHeight,d?d.scrollHeight:0,d?d.clientHeight:0),h=-l.scrollLeft+ern(u),m=-l.scrollTop,"rtl"===enY(d||c).direction&&(h+=enF(c.clientWidth,d?d.clientWidth:0)-f),{width:f,height:p,x:h,y:m}))}function eru(t){var n,r=t.reference,i=t.element,o=t.placement,a=o?enP(o):null,u=o?en4(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 enx:n={x:s,y:r.y+r.height};break;case enM:n={x:r.x+r.width,y:c};break;case enT:n={x:r.x-i.width,y:c};break;default:n={x:r.x,y:r.y}}var l=a?enJ(a):null;if(null!=l){var d="y"===l?"height":"width";switch(u){case enI:n[l]=n[l]-(r[d]/2-i[d]/2);break;case"end":n[l]=n[l]+(r[d]/2-i[d]/2)}}return n}function ers(t,n){void 0===n&&(n={});var r,i,o,a,u,s,c,l,d,f,p=n,h=p.placement,m=void 0===h?t.placement:h,g=p.strategy,y=void 0===g?t.strategy:g,v=p.boundary,b=p.rootBoundary,x=p.elementContext,M=void 0===x?enO:x,T=p.altBoundary,S=p.padding,w=void 0===S?0:S,I=en1("number"!=typeof w?w:en2(w,enw)),_=t.rects.popper,O=t.elements[void 0!==T&&T?M===enO?"reference":enO:M],k=(r=enR(O)?O:O.contextElement||enG(t.elements.popper),d=(l=[].concat("clippingParents"===(i=void 0===v?"clippingParents":v)?(s=eri(enZ(r)),c=["absolute","fixed"].indexOf(enY(r).position)>=0&&enD(r)?enH(r):r,enR(c)?s.filter(function(t){return enR(t)&&enK(t,c)&&"body"!==enj(t)}):[]):[].concat(i),[void 0===b?en_:b]))[0],(f=l.reduce(function(t,n){var i=era(r,n,y);return t.top=enF(i.top,t.top),t.right=enz(i.right,t.right),t.bottom=enz(i.bottom,t.bottom),t.left=enF(i.left,t.left),t},era(r,d,y))).width=f.right-f.left,f.height=f.bottom-f.top,f.x=f.left,f.y=f.top,f),C=enV(t.elements.reference),N=eru({reference:C,element:_,strategy:"absolute",placement:m}),j=ero(Object.assign({},_,N)),E=M===enO?j:C,R={top:k.top-E.top+I.top,bottom:E.bottom-k.bottom+I.bottom,left:k.left-E.left+I.left,right:E.right-k.right+I.right},D=t.modifiersData.offset;if(M===enO&&D){var A=D[m];Object.keys(R).forEach(function(t){var n=[enM,enx].indexOf(t)>=0?1:-1,r=["top",enx].indexOf(t)>=0?"y":"x";R[t]+=A[r]*n})}return R}function erc(t,n,r){return void 0===r&&(r={x:0,y:0}),{top:t.top-n.height-r.y,right:t.right-n.width+r.x,bottom:t.bottom-n.height+r.y,left:t.left-n.width-r.x}}function erl(t){return["top",enM,enx,enT].some(function(n){return t[n]>=0})}var erd={placement:"bottom",modifiers:[],strategy:"absolute"};function erf(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return!n.some(function(t){return!(t&&"function"==typeof t.getBoundingClientRect)})}var erp,erh,erm,erg,ery,erv,erb=(erp={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=enE(n.elements.popper),l=[].concat(n.scrollParents.reference,n.scrollParents.popper);return a&&l.forEach(function(t){t.addEventListener("scroll",r.update,en9)}),s&&c.addEventListener("resize",r.update,en9),function(){a&&l.forEach(function(t){t.removeEventListener("scroll",r.update,en9)}),s&&c.removeEventListener("resize",r.update,en9)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var n=t.state,r=t.name;n.modifiersData[r]=eru({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:enP(n.placement),variation:en4(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,en5(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,en5(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:{}},enL,{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=enC.reduce(function(t,r){var i,o,u,s,c,l,d,f;return t[r]=(o=n.rects,c=[enT,"top"].indexOf(s=enP(r))>=0?-1:1,d=(l="function"==typeof a?a(Object.assign({},o,{placement:r})):a)[0],f=l[1],d=d||0,f=(f||0)*c,[enT,enM].indexOf(s)>=0?{x:f,y:d}:{x:d,y:f}),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,d=r.boundary,f=r.rootBoundary,p=r.altBoundary,h=r.flipVariations,m=void 0===h||h,g=r.allowedAutoPlacements,y=n.options.placement,v=enP(y),b=c||(v!==y&&m?function(t){if(enP(t)===enS)return[];var n=en6(t);return[ere(t),n,ere(n)]}(y):[en6(y)]),x=[y].concat(b).reduce(function(t,r){var i,o,a,u,s,c,p,h,y,v,b,x,M,T;return t.concat(enP(r)===enS?(o={placement:r,boundary:d,rootBoundary:f,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)?enC:y,0===(M=(x=(b=en4(u))?h?enk:enk.filter(function(t){return en4(t)===b}):enw).filter(function(t){return v.indexOf(t)>=0})).length&&(M=x),Object.keys(T=M.reduce(function(t,r){return t[r]=ers(n,{placement:r,boundary:s,rootBoundary:c,padding:p})[enP(r)],t},{})).sort(function(t,n){return T[t]-T[n]})):r)},[]),M=n.rects.reference,T=n.rects.popper,S=new Map,w=!0,I=x[0],_=0;_<x.length;_++){var O=x[_],k=enP(O),C=en4(O)===enI,N=["top",enx].indexOf(k)>=0,j=N?"width":"height",E=ers(n,{placement:O,boundary:d,rootBoundary:f,altBoundary:p,padding:l}),R=N?C?enM:enT:C?enx:"top";M[j]>T[j]&&(R=en6(R));var D=en6(R),A=[];if(a&&A.push(E[k]<=0),s&&A.push(E[R]<=0,E[D]<=0),A.every(function(t){return t})){I=O,w=!1;break}S.set(O,A)}if(w)for(var L=m?3:1,P=function(t){var n=x.find(function(n){var r=S.get(n);if(r)return r.slice(0,t).every(function(t){return t})});if(n)return I=n,"break"},F=L;F>0&&"break"!==P(F);F--);n.placement!==I&&(n.modifiersData[i]._skip=!0,n.placement=I,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,d=i.padding,f=i.tether,p=void 0===f||f,h=i.tetherOffset,m=void 0===h?0:h,g=ers(r,{boundary:s,rootBoundary:c,padding:d,altBoundary:l}),y=enP(r.placement),v=en4(r.placement),b=!v,x=enJ(y),M="x"===x?"y":"x",T=r.modifiersData.popperOffsets,S=r.rects.reference,w=r.rects.popper,I="function"==typeof m?m(Object.assign({},r.rects,{placement:r.placement})):m,_="number"==typeof I?{mainAxis:I,altAxis:I}:Object.assign({mainAxis:0,altAxis:0},I),O=r.modifiersData.offset?r.modifiersData.offset[r.placement]:null,k={x:0,y:0};if(T){if(void 0===a||a){var C,N="y"===x?"top":enT,j="y"===x?enx:enM,E="y"===x?"height":"width",R=T[x],D=R+g[N],A=R-g[j],L=p?-w[E]/2:0,P=v===enI?S[E]:w[E],F=v===enI?-w[E]:-S[E],z=r.elements.arrow,U=p&&z?en$(z):{width:0,height:0},W=r.modifiersData["arrow#persistent"]?r.modifiersData["arrow#persistent"].padding:en0(),B=W[N],V=W[j],$=enX(0,S[E],U[E]),K=b?S[E]/2-L-$-B-_.mainAxis:P-$-B-_.mainAxis,Y=b?-S[E]/2+L+$+V+_.mainAxis:F+$+V+_.mainAxis,q=r.elements.arrow&&enH(r.elements.arrow),G=q?"y"===x?q.clientTop||0:q.clientLeft||0:0,Z=null!=(C=null==O?void 0:O[x])?C:0,Q=enX(p?enz(D,R+K-Z-G):D,R,p?enF(A,R+Y-Z):A);T[x]=Q,k[x]=Q-R}if(void 0!==u&&u){var H,J,X,ee,et,en=T[M],er="y"===M?"height":"width",ei=en+g["x"===x?"top":enT],eo=en-g["x"===x?enx:enM],ea=-1!==["top",enT].indexOf(y),eu=null!=(et=null==O?void 0:O[M])?et:0,es=ea?ei:en-S[er]-w[er]-eu+_.altAxis,ec=ea?en+S[er]+w[er]-eu-_.altAxis:eo,el=p&&ea?(ee=enX(es,en,ec))>ec?ec:ee:enX(p?es:ei,en,p?ec:eo);T[M]=el,k[M]=el-en}r.modifiersData[o]=k}},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=enP(r.placement),c=enJ(s),l=[enT,enM].indexOf(s)>=0?"height":"width";if(!(!a||!u)){var d,f,p=en1("number"!=typeof(d="function"==typeof(d=o.padding)?d(Object.assign({},r.rects,{placement:r.placement})):d)?d:en2(d,enw)),h=en$(a),m=r.rects.reference[l]+r.rects.reference[c]-u[c]-r.rects.popper[l],g=u[c]-r.rects.reference[c],y=enH(a),v=y?"y"===c?y.clientHeight||0:y.clientWidth||0:0,b=p["y"===c?"top":enT],x=v-h[l]-p["y"===c?enx:enM],M=v/2-h[l]/2+(m/2-g/2),T=enX(b,M,x);r.modifiersData[i]=((n={})[c]=T,n.centerOffset=T-M,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)))&&enK(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=ers(n,{elementContext:"reference"}),s=ers(n,{altBoundary:!0}),c=erc(u,i),l=erc(s,o,a),d=erl(c),f=erl(l);n.modifiersData[r]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:d,hasPopperEscaped:f},n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":f})}}]},erg=void 0===(erm=(erh=erp).defaultModifiers)?[]:erm,erv=void 0===(ery=erh.defaultOptions)?erd:ery,function(t,n,r){void 0===r&&(r=erv);var i,o,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},erd,erv),modifiersData:{},elements:{reference:t,popper:n},attributes:{},styles:{}},u=[],s=!1,c={state:a,setOptions:function(r){var i,o,s,d,f,p,h,m,g="function"==typeof r?r(a.options):r;l(),a.options=Object.assign({},erv,a.options,g),a.scrollParents={reference:enR(t)?eri(t):t.contextElement?eri(t.contextElement):[],popper:eri(n)};var y=(s=Object.keys(o=(i=[].concat(erg,a.options.modifiers)).reduce(function(t,n){var r=t[n.name];return t[n.name]=r?Object.assign({},r,n,{options:Object.assign({},r.options,n.options),data:Object.assign({},r.data,n.data)}):n,t},{})).map(function(t){return o[t]}),f=new Map,p=new Set,h=[],s.forEach(function(t){f.set(t.name,t)}),s.forEach(function(t){p.has(t.name)||function t(n){p.add(n.name),[].concat(n.requires||[],n.requiresIfExists||[]).forEach(function(n){if(!p.has(n)){var r=f.get(n);r&&t(r)}}),h.push(n)}(t)}),enN.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,d,f,p,h,m,g,y,v,b=a.elements,x=b.reference,M=b.popper;if(erf(x,M)){a.rects={reference:(t=x,n=enH(M),r="fixed"===a.options.strategy,d=enD(n),f=enD(n)&&(u=enU((o=(i=n).getBoundingClientRect()).width)/i.offsetWidth||1,l=enU(o.height)/i.offsetHeight||1,1!==u||1!==l),p=enG(n),h=enV(t,f,r),m={scrollLeft:0,scrollTop:0},g={x:0,y:0},(d||!d&&!r)&&(("body"!==enj(n)||err(p))&&(m=(y=n)!==enE(y)&&enD(y)?{scrollLeft:(v=y).scrollLeft,scrollTop:v.scrollTop}:ert(y)),enD(n)?(g=enV(n,!0),g.x+=n.clientLeft,g.y+=n.clientTop):p&&(g.x=ern(p))),{x:h.left+m.scrollLeft-g.x,y:h.top+m.scrollTop-g.y,width:h.width,height:h.height}),popper:en$(M)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach(function(t){return a.modifiersData[t.name]=Object.assign({},t.data)});for(var T=0;T<a.orderedModifiers.length;T++){if(!0===a.reset){a.reset=!1,T=-1;continue}var S=a.orderedModifiers[T],w=S.fn,I=S.options,_=void 0===I?{}:I,O=S.name;"function"==typeof w&&(a=w({state:a,options:_,name:O,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(!erf(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}),erx="tippy-content",erM="tippy-arrow",erT="tippy-svg-arrow",erS={passive:!0,capture:!0},erw=function(){return document.body};function erI(t,n,r){return Array.isArray(t)?t[n]??(Array.isArray(r)?r[n]:r):t}function er_(t,n){var r=({}).toString.call(t);return 0===r.indexOf("[object")&&r.indexOf(n+"]")>-1}function erO(t,n){return"function"==typeof t?t.apply(void 0,n):t}function erk(t,n){var r;return 0===n?t:function(i){clearTimeout(r),r=setTimeout(function(){t(i)},n)}}function erC(t){return[].concat(t)}function erN(t,n){-1===t.indexOf(n)&&t.push(n)}function erj(t){return[].slice.call(t)}function erE(t){return Object.keys(t).reduce(function(n,r){return void 0!==t[r]&&(n[r]=t[r]),n},{})}function erR(){return document.createElement("div")}function erD(t){return["Element","Fragment"].some(function(n){return er_(t,n)})}function erA(t,n){t.forEach(function(t){t&&(t.style.transitionDuration=n+"ms")})}function erL(t,n){t.forEach(function(t){t&&t.setAttribute("data-state",n)})}function erP(t,n,r){var i=n+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(n){t[i](n,r)})}function erF(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 erz={isTouch:!1},erU=0;function erW(){erz.isTouch||(erz.isTouch=!0,window.performance&&document.addEventListener("mousemove",erB))}function erB(){var t=performance.now();t-erU<20&&(erz.isTouch=!1,document.removeEventListener("mousemove",erB)),erU=t}function erV(){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 er$=!!("u">typeof window&&"u">typeof document)&&!!window.msCrypto,erK=Object.assign({appendTo:erw,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}),erY=Object.keys(erK),erq=function(t){Object.keys(t).forEach(function(n){erK[n]=t[n]})};function erG(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=erK[o])?i:a),n},{});return Object.assign({},t,n)}function erZ(t,n){var r,i,o=Object.assign({},n,{content:erO(n.content,[t])},n.ignoreAttributes?{}:((i=n.plugins)?Object.keys(erG(Object.assign({},erK,{plugins:i}))):erY).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({},erK.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 erQ=function(){return"innerHTML"};function erH(t,n){t[erQ()]=n}function erJ(t){var n=erR();return!0===t?n.className=erM:(n.className=erT,erD(t)?n.appendChild(t):erH(n,t)),n}function erX(t,n){erD(n.content)?(erH(t,""),t.appendChild(n.content)):"function"!=typeof n.content&&(n.allowHTML?erH(t,n.content):t.textContent=n.content)}function er0(t){var n=t.firstElementChild,r=erj(n.children);return{box:n,content:r.find(function(t){return t.classList.contains(erx)}),arrow:r.find(function(t){return t.classList.contains(erM)||t.classList.contains(erT)}),backdrop:r.find(function(t){return t.classList.contains("tippy-backdrop")})}}function er1(t){var n=erR(),r=erR();r.className="tippy-box",r.setAttribute("data-state","hidden"),r.setAttribute("tabindex","-1");var i=erR();function o(r,i){var o=er0(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)&&erX(u,t.props),i.arrow?s?r.arrow!==i.arrow&&(a.removeChild(s),a.appendChild(erJ(i.arrow))):a.appendChild(erJ(i.arrow)):s&&a.removeChild(s)}return i.className=erx,i.setAttribute("data-state","hidden"),erX(i,t.props),n.appendChild(r),r.appendChild(i),o(t.props,t.props),{popper:n,onUpdate:o}}er1.$$tippy=!0;var er2=1,er4=[],er3=[];function er5(t,n){void 0===n&&(n={});var r,i,o=erK.plugins.concat(n.plugins||[]);document.addEventListener("touchstart",erW,erS),window.addEventListener("blur",erV);var a,u=Object.assign({},n,{plugins:o}),s=(erD(t)?[t]:er_(t,"NodeList")?erj(t):Array.isArray(t)?t:erj(document.querySelectorAll(t))).reduce(function(t,n){var r=n&&function(t,n){var r,i,o,a,u,s,c,l,d=erZ(t,Object.assign({},erK,erG(erE(n)))),f=!1,p=!1,h=!1,m=!1,g=[],y=erk(G,d.interactiveDebounce),v=er2++,b=(r=d.plugins).filter(function(t,n){return r.indexOf(t)===n}),x={id:v,reference:t,popper:erR(),popperInstance:null,props:d,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:b,clearDelayTimeouts:function(){clearTimeout(i),clearTimeout(o),cancelAnimationFrame(a)},setProps:function(n){if(!x.state.isDestroyed){D("onBeforeUpdate",[x,n]),Y();var r=x.props,i=erZ(t,Object.assign({},r,erE(n),{ignoreAttributes:!0}));x.props=i,K(),r.interactiveDebounce!==i.interactiveDebounce&&(P(),y=erk(G,i.interactiveDebounce)),r.triggerTarget&&!i.triggerTarget?erC(r.triggerTarget).forEach(function(t){t.removeAttribute("aria-expanded")}):i.triggerTarget&&t.removeAttribute("aria-expanded"),L(),R(),S&&S(r,i),x.popperInstance&&(J(),ee().forEach(function(t){requestAnimationFrame(t._tippy.popperInstance.forceUpdate)})),D("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=erz.isTouch&&!x.props.touch,o=erI(x.props.duration,0,erK.duration);if(!(t||n||r||i)&&!C().hasAttribute("disabled")&&(D("onShow",[x],!1),!1!==x.props.onShow(x))){if(x.state.isVisible=!0,k()&&(T.style.visibility="visible"),R(),W(),x.state.isMounted||(T.style.transition="none"),k()){var a,u,s,l,d=j();erA([d.box,d.content],0)}c=function(){var t;if(!(!x.state.isVisible||m)){if(m=!0,T.offsetHeight,T.style.transition=x.props.moveTransition,k()&&x.props.animation){var n,r,i=j(),a=i.box,u=i.content;erA([a,u],o),erL([a,u],"visible")}A(),L(),erN(er3,x),null==(t=x.popperInstance)||t.forceUpdate(),D("onMount",[x]),x.props.animation&&k()&&V(o,r=function(){x.state.isShown=!0,D("onShown",[x])})}},u=x.props.appendTo,s=C(),(a=x.props.interactive&&u===erw||"parent"===u?s.parentNode:erO(u,[s])).contains(T)||a.appendChild(T),x.state.isMounted=!0,J()}},hide:function(){var t=!x.state.isVisible,n=x.state.isDestroyed,r=!x.state.isEnabled,i=erI(x.props.duration,1,erK.duration);if(!(t||n||r)&&(D("onHide",[x],!1),!1!==x.props.onHide(x))){if(x.state.isVisible=!1,x.state.isShown=!1,m=!1,f=!1,k()&&(T.style.visibility="hidden"),P(),B(),R(!0),k()){var o,a,u=j(),s=u.box,c=u.content;x.props.animation&&(erA([s,c],i),erL([s,c],"hidden"))}A(),L(),x.props.animation?k()&&(a=x.unmount,V(i,function(){!x.state.isVisible&&T.parentNode&&T.parentNode.contains(T)&&a()})):x.unmount()}},hideWithInteractivity:function(t){N().addEventListener("mousemove",y),erN(er4,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()}),T.parentNode&&T.parentNode.removeChild(T),er3=er3.filter(function(t){return t!==x}),x.state.isMounted=!1,D("onHidden",[x]))},destroy:function(){x.state.isDestroyed||(x.clearDelayTimeouts(),x.unmount(),Y(),delete t._tippy,x.state.isDestroyed=!0,D("onDestroy",[x]))}};if(!d.render)return x;var M=d.render(x),T=M.popper,S=M.onUpdate;T.setAttribute("data-tippy-root",""),T.id="tippy-"+x.id,x.popper=T,t._tippy=x,T._tippy=x;var w=b.map(function(t){return t.fn(x)}),I=t.hasAttribute("aria-expanded");return K(),L(),R(),D("onCreate",[x]),d.showOnCreate&&et(),T.addEventListener("mouseenter",function(){x.props.interactive&&x.state.isVisible&&x.clearDelayTimeouts()}),T.addEventListener("mouseleave",function(){x.props.interactive&&x.props.trigger.indexOf("mouseenter")>=0&&N().addEventListener("mousemove",y)}),x;function _(){var t=x.props.touch;return Array.isArray(t)?t:[t,0]}function O(){return"hold"===_()[0]}function k(){var t;return!!(null!=(t=x.props.render)&&t.$$tippy)}function C(){return l||t}function N(){var t,n,r,i=C().parentNode;return i&&null!=(r=erC(i)[0])&&null!=(n=r.ownerDocument)&&n.body?r.ownerDocument:document}function j(){return er0(T)}function E(t){return x.state.isMounted&&!x.state.isVisible||erz.isTouch||u&&"focus"===u.type?0:erI(x.props.delay,t?0:1,erK.delay)}function R(t){void 0===t&&(t=!1),T.style.pointerEvents=x.props.interactive&&!t?"":"none",T.style.zIndex=""+x.props.zIndex}function D(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 A(){var n=x.props.aria;if(n.content){var r="aria-"+n.content,i=T.id;erC(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(){!(I||!x.props.aria.expanded)&&erC(x.props.triggerTarget||t).forEach(function(t){x.props.interactive?t.setAttribute("aria-expanded",x.state.isVisible&&t===C()?"true":"false"):t.removeAttribute("aria-expanded")})}function P(){N().removeEventListener("mousemove",y),er4=er4.filter(function(t){return t!==y})}function F(n){if(!(erz.isTouch&&(h||"mousedown"===n.type))){var r=n.composedPath&&n.composedPath()[0]||n.target;if(!(x.props.interactive&&erF(T,r))){if(erC(x.props.triggerTarget||t).some(function(t){return erF(t,r)})){if(erz.isTouch||x.state.isVisible&&x.props.trigger.indexOf("click")>=0)return}else D("onClickOutside",[x,n]);!0===x.props.hideOnClick&&(x.clearDelayTimeouts(),x.hide(),p=!0,setTimeout(function(){p=!1}),x.state.isMounted||B())}}}function z(){h=!0}function U(){h=!1}function W(){var t=N();t.addEventListener("mousedown",F,!0),t.addEventListener("touchend",F,erS),t.addEventListener("touchstart",U,erS),t.addEventListener("touchmove",z,erS)}function B(){var t=N();t.removeEventListener("mousedown",F,!0),t.removeEventListener("touchend",F,erS),t.removeEventListener("touchstart",U,erS),t.removeEventListener("touchmove",z,erS)}function V(t,n){var r=j().box;function i(t){t.target===r&&(erP(r,"remove",i),n())}if(0===t)return n();erP(r,"remove",s),erP(r,"add",i),s=i}function $(n,r,i){void 0===i&&(i=!1),erC(x.props.triggerTarget||t).forEach(function(t){t.addEventListener(n,r,i),g.push({node:t,eventType:n,handler:r,options:i})})}function K(){var t;O()&&($("touchstart",q,{passive:!0}),$("touchend",Z,{passive:!0})),(t=x.props.trigger).split(/\s+/).filter(Boolean).forEach(function(t){if("manual"!==t)switch($(t,q),t){case"mouseenter":$("mouseleave",Z);break;case"focus":$(er$?"focusout":"blur",Q);break;case"focusin":$("focusout",Q)}})}function Y(){g.forEach(function(t){var n=t.node,r=t.eventType,i=t.handler,o=t.options;n.removeEventListener(r,i,o)}),g=[]}function q(t){var n,r=!1;if(!(!x.state.isEnabled||H(t)||p)){var i,o=(null==(n=u)?void 0:n.type)==="focus";u=t,l=t.currentTarget,L(),!x.state.isVisible&&er_(t,"MouseEvent")&&er4.forEach(function(n){return n(t)}),"click"===t.type&&(0>x.props.trigger.indexOf("mouseenter")||f)&&!1!==x.props.hideOnClick&&x.state.isVisible?r=!0:et(t),"click"===t.type&&(f=!r),r&&!o&&en(t)}}function G(t){var n,r,i,o,a=t.target,u=C().contains(a)||T.contains(a);!("mousemove"===t.type&&u)&&(n=ee().concat(T).map(function(t){var n,r=null==(n=t._tippy.popperInstance)?void 0:n.state;return r?{popperRect:t.getBoundingClientRect(),popperState:r,props:d}:null}).filter(Boolean),i=(r=t).clientX,o=r.clientY,n.every(function(t){var n,r=t.popperRect,a=t.popperState,u=t.props.interactiveBorder,s=(n=a.placement).split("-")[0],c=a.modifiersData.offset;if(!c)return!0;var l="bottom"===s?c.top.y:0,d="top"===s?c.bottom.y:0,f="right"===s?c.left.x:0,p="left"===s?c.right.x:0,h=r.top-o+l>u,m=o-r.bottom-d>u,g=r.left-i+f>u,y=i-r.right-p>u;return h||m||g||y})&&(P(),en(t)))}function Z(t){if(!(H(t)||x.props.trigger.indexOf("click")>=0&&f)){if(x.props.interactive){x.hideWithInteractivity(t);return}en(t)}}function Q(t){0>x.props.trigger.indexOf("focusin")&&t.target!==C()||x.props.interactive&&t.relatedTarget&&T.contains(t.relatedTarget)||en(t)}function H(t){return!!erz.isTouch&&O()!==t.type.indexOf("touch")>=0}function J(){X();var n=x.props,r=n.popperOptions,i=n.placement,o=n.offset,a=n.getReferenceClientRect,u=n.moveTransition,s=k()?er0(T).arrow:null,l=a?{getBoundingClientRect:a,contextElement:a.contextElement||C()}:t,d=[{name:"offset",options:{offset:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!u}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(t){var n=t.state;if(k()){var r=j().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={}}}}];k()&&s&&d.push({name:"arrow",options:{element:s,padding:3}}),d.push.apply(d,(null==r?void 0:r.modifiers)||[]),x.popperInstance=erb(l,T,Object.assign({},r,{placement:i,onFirstUpdate:c,modifiers:d}))}function X(){x.popperInstance&&(x.popperInstance.destroy(),x.popperInstance=null)}function ee(){return erj(T.querySelectorAll("[data-tippy-root]"))}function et(t){x.clearDelayTimeouts(),t&&D("onTrigger",[x,t]),W();var n=E(!0),r=_(),o=r[0],a=r[1];erz.isTouch&&"hold"===o&&a&&(n=a),n?i=setTimeout(function(){x.show()},n):x.show()}function en(t){if(x.clearDelayTimeouts(),D("onUntrigger",[x,t]),!x.state.isVisible){B();return}if(!(x.props.trigger.indexOf("mouseenter")>=0&&x.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(t.type)>=0&&f)){var n=E(!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 erD(t)?s[0]:s}er5.defaultProps=erK,er5.setDefaultProps=erq,er5.currentInput=erz,Object.assign({},enL,{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)}}),er5.setDefaultProps({render:er1});class er9{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&&etu(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:d}=l,f=Math.min(...d.map(t=>t.$from.pos)),p=Math.max(...d.map(t=>t.$to.pos));if(!(null===(o=this.shouldShow)||void 0===o?void 0:o.call(this,{editor:this.editor,view:t,state:s,oldState:i,from:f,to:p}))){this.hide();return}null===(a=this.tippy)||void 0===a||a.setProps({getReferenceClientRect:(null===(u=this.tippyOptions)||void 0===u?void 0:u.getReferenceClientRect)||(()=>{var n;if((n=s.selection)instanceof Hr){let r=t.nodeDOM(f),i=r.dataset.nodeViewWrapper?r:r.querySelector("[data-node-view-wrapper]");if(i&&(r=i.firstChild),r)return r.getBoundingClientRect()}return function(t,n,r){let i=t.state.doc.content.size,o=ets(n,0,i),a=ets(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),d=Math.min(u.left,s.left),f=Math.max(u.right,s.right),p={top:c,bottom:l,left:d,right:f,width:f-d,height:l-c,x:d,y:c};return{...p,toJSON:()=>p}}(t,f,p)})}),this.show()},this.editor=t,this.element=n,this.view=r,this.updateDelay=o,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){let{element:t}=this.editor.options,n=!!t.parentElement;this.tippy||!n||(this.tippy=er5(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 er8=t=>new Hm({key:"string"==typeof t.pluginKey?new Hv(t.pluginKey):t.pluginKey,view:n=>new er9({view:n,...t})});eeZ.create({name:"bubbleMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[er8({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});let er6=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=er8({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 er7 extends enf{constructor(){super(...arguments),this.contentComponent=null}}let eie=({renderers:t})=>o.createElement(o.Fragment,null,Object.entries(t).map(([t,n])=>v.createPortal(n.reactElement,n.element,t)));class eit 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(eie,{renderers:this.state.renderers}))}}let ein=o.memo(eit),eir=(0,o.createContext)({onDragStart:void 0}),eii=()=>(0,o.useContext)(eir),eio=o.forwardRef((t,n)=>{let{onDragStart:r}=eii(),i=t.as||"div";return o.createElement(i,{...t,ref:n,"data-node-view-wrapper":"",onDragStart:r,style:{whiteSpace:"normal",...t.style}})});class eia{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 eiu extends env{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(eir.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 eia(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 eis(t,n){return r=>r.editor.contentComponent?new eiu(t,r,n):{}}function eic(t){return setTimeout(()=>{t()})}function eil(t){let{debouncedUrl:n,content:r,onContentChange:i,selected:a}=t,c=(0,o.useRef)(null),[l,d]=(0,o.useState)(!1);return(0,s.pQ)(n,()=>{var t;l&&(d(!1),null==(t=c.current)||t.reset())}),(0,p.ju)(n)?n===(null==r?void 0:r.embed_url)?C.jsx(eif,{content:r,selected:a}):C.jsx(u.SV,{ref:c,renderError:eid,onError:function(){d(!0),i(void 0)},children:C.jsx(o.Suspense,{fallback:r&&C.jsx(eif,{content:r,selected:a}),children:C.jsx(eip,{url:n,selected:a,onContentChange:i})})}):null}function eid(){return C.jsx(u.yO,{title:"There is no embed data available."})}function eif(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 eip(t){let{url:n,onContentChange:r,selected:i}=t,a=function(t){let{url:n,onContentChange:r}=t,{embedsUrl:i}=tk(),a=(0,f.QT)(eih,[n,i]),u=(0,s.R9)(r);return(0,o.useEffect)(()=>{let t=eic(()=>u(a));return()=>{clearTimeout(t)}},[a,u]),a}({url:n,onContentChange:r});return C.jsx(eif,{content:a,selected:i})}function eih(t,n){var r;let i=new URL(n);return i.search=new URLSearchParams({url:t}).toString(),(0,d.WY)(i.toString(),{okType:(r=t,t_.object({type:t_.string(),version:t_.string().or(t_.number()).nullish(),title:t_.string().nullish(),author_name:t_.string().nullish(),author_url:t_.string().nullish(),provider_name:t_.string().nullish(),provider_url:t_.string().nullish(),cache_age:t_.string().or(t_.number()).nullish(),thumbnail_url:t_.string().nullish(),thumbnail_width:t_.number().nullish(),thumbnail_height:t_.number().nullish(),html:t_.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 eim(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 d(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(eil,{debouncedUrl:l.debouncedValue,content:a,onContentChange:c})}),children:[C.jsx(u.fw,{name:"cloud"}),C.jsx(u.Qy,{htmlFor:n,children:ZI(i)}),C.jsx(u.JO,{children:C.jsx(ZN,{id:n,readOnly:r,placeholder:Z_(i),value:l.value,onValueChange:d,variant:(0,p.ju)(l.value)?"link":"normal",endAdornment:C.jsx(u.zx,{startIcon:"close",color:"grey",size:"small",disabled:!l,onClick:()=>d("")})})})]})}function eig(t){return!(t.lat>85||t.lat<-85||t.lng>180||t.lng<-180)}function eiy(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(eig(o))return o}function eiv(t){return t?`${t.lat}, ${t.lng}`:""}function eib(t){let n=t.match(/\(?([\d|.|-]*)[\s+]*,[\s]*([\d|.|-]*)\)?/);if(!n)return eiy(t);let r=parseFloat(n[1]??""),i=parseFloat(n[2]??"");if(isNaN(r)||isNaN(i))return eiy(t);let o={lat:r,lng:i};return eig(o)?o:eiy(t)}function eix(t){let{field:n,id:r,readOnly:i,...a}=t,{onValueChange:s,displayedValue:c,onBlur:l,clearValue:d,isValidCoordinates:f}=function(t){let{content:n,onContentChange:r}=t,i=eiv(null==n?void 0:n.position),[a,u]=(0,o.useState)(i),s=Boolean(eib(a));return{displayedValue:a,isValidCoordinates:s,onValueChange:u,onBlur:function(){let t=eib(a);if(!t)return u(""),r(void 0);let{lat:n,lng:i}=t;u(eiv({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:ZI(n)}),C.jsx(u.JO,{children:C.jsx(ZN,{id:r,onValueChange:s,placeholder:"...",readOnly:i,value:c,onBlur:l,variant:f?"link":"normal",endAdornment:C.jsx(u.zx,{startIcon:"close",color:"grey",size:"small",disabled:!c,onClick:d})})})]})}let eiM="__MAIN_THUMBNAIL__";function eiT(t,n,r){let i=t.name===eiM?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 eiw(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 eiI(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 ei_(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 eiO(t){return null!=t&&t.url?eiI(t.url):void 0}let eik=tr({id:eX(),width:e0(),height:e0(),urls:tr({full:eX(),small:eX().transform(ei_)}),alt_description:eX().optional(),description:eX().nullable()}),eiC=tr({results:tn(eik)}).transform(t=>t.results);function eiN(t,n){let r=new URLSearchParams({page:"1",per_page:"28",query:n});return(0,d.WY)(`${t}/search/photos?${r.toString()}`,{okType:eiC})}function eij(t,n){return(0,f.QT)(eiN,[t,n])}function eiE(t){let{onSelectedChange:n}=t,[r,i]=(0,o.useTransition)(),a=(0,s.$P)({initialState:"",ms:300,startTransition:i});return C.jsxs(u.xu,{flexDirection:"column",gap:16,width:"100%",position:"relative",children:[C.jsx(u.CR,{value:a.value,placeholder:"Search on Unsplash.com",onValueChange:a.set}),C.jsx(u.SV,{renderError:()=>C.jsx(tH,{}),children:C.jsx(o.Suspense,{children:C.jsx(eiR,{onSelectedChange:n,term:a.debouncedValue})})}),C.jsx(eiD,{open:r})]})}function eiR(t){let{media:n,toggleSelected:r,selectedImageId:i}=function(t){var n;let{term:r,onSelectedChange:i}=t,a=tk(),u=eij(a.unsplashUrl,r||"citrus fruit"),s=null==(n=null==u?void 0:u[0])?void 0:n.id,[c,l]=(0,o.useState)();return(0,o.useEffect)(()=>{null==i||i([]),l(void 0)},[s,i]),{media:u,toggleSelected:function(t){if(t.id===c)return l(void 0),null==i?void 0:i([]);l(t.id),null==i||i([{...t,url:t.urls.full,alt:t.alt_description}])},selectedImageId:c}}(t);return C.jsx(u.xr,{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 250px), 1fr))",gap:16,paddingBottom:16,position:"relative",width:"100%"},children:null==n?void 0:n.map(t=>{let n=new URL(t.urls.full).searchParams.get("fm")??"jpg";return C.jsx(u.PB,{url:t.urls.small,filename:t.description??"Unsplash Image",selected:i===t.id,onCardClick:()=>r(t),extension:n,width:t.width,height:t.height},t.id)})})}function eiD(t){let{open:n}=t;return C.jsx(u.FN,{anchor:C.jsx(u.xu,{position:"absolute",justifyContent:"center",width:"100%",bottom:72}),loadingIndicator:!0,open:n,title:"Loading media ...",seconds:1})}function eiA(t){let{open:n,setIsOpen:r,onMediaSelected:i,assetType:a}=t,[s,c]=(0,o.useState)("media"),[l,d]=(0,o.useState)([]);function f(t){t||d([]),r(t)}return C.jsxs(u.Vq,{open:n,onOpenChange:f,size:{width:1216,height:868},children:[C.jsx(u.fK,{icon:"image",title:"Add a media"}),C.jsxs(u.Zp,{value:s,onValueChange:function(t){if("media"!==t&&"unsplash"!==t)throw Error(`Invalid option ${t}.`);c(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"===s&&C.jsx(t1,{assetType:a,onSelectedChange:d}),"unsplash"===s&&C.jsx(eiE,{onSelectedChange:d})]})}),C.jsx(u.kX,{asFooter:!0,ok:{text:"Add to page",onClick:function(){let[t]=l||[];t&&(i(t),f(!1))},disabled:(null==l?void 0:l.length)!==1,disabledTooltip:0===l.length?"Select a media item to add to the page":l.length>1?"Only one media item can be added to the page":void 0},cancel:{text:"Cancel"}})]})}function eiL(){let t=new URL(location.href),n=tk(),r=t.searchParams.has("medialib");return"dev"===n.env||r}function eiP(t){let{onFilesSelected:n,assetType:r}=t,[i,a]=(0,o.useTransition)(),c=(0,s.$P)({initialState:i,ms:100});return C.jsx(u.SV,{renderError:eiV,children:C.jsx(o.Suspense,{children:C.jsxs(u.Zz,{onFilesSelected:n,overlay:C.jsx(eiU,{}),assetType:r,children:[C.jsx(eiF,{...t,startTransition:a,assetType:r}),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:c.debouncedValue,title:"Loading media ...",seconds:1})})]})})})}function eiF(t){let{uploadingFiles:n,isUploading:r,onFilesSelected:i,onMediaSelected:a,startTransition:c,onRetry:l,assetType:d}=t,{media:f,limit:p,onHasReachedBottom:h,response:m,updateMedia:g}=tD({assetType:d});return(0,s.pQ)(n,()=>{if(r)return;let t=n.flatMap(t=>"success"!==t.status?[]:f.find(n=>n.id===t.id)?[]:[t.response]);t.length>0&&g(t)}),0===f.length?C.jsx(eiz,{onFilesSelected:i}):C.jsxs(eiW,{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:f,getItemInfo:eiB,children:t=>C.jsxs(o.Suspense,{fallback:C.jsx(u.Od,{width:"100%",height:"100%"}),children:["image"===t.kind&&C.jsx(u.P0,{url:ei_(t.url),onClick:()=>a({...t,width:t.width??2e3,height:t.height??2e3})}),"all"===t.kind&&C.jsx(u.Ti,{extension:t.extension,filename:t.filename,onClick:()=>a(t)})]})})]})}function eiz(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.KH,{onFilesSelected:n,children:"Upload Media"})})]})})})}function eiU(){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 eiW(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 eiB(t){return"pdf"===t.extension?{key:t.id,aspectRatio:193/154}:{key:t.id,aspectRatio:(t.width??2e3)/(t.height??2e3)}}function eiV(){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})})}f.Fs.registerFetcherConfig(eiN,{cacheCapacity:5,revalidationStrategy:{type:"never"}});let ei$=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.CR,{value:a.value,placeholder:"Search on Unsplash.com",onValueChange:a.set})}),C.jsx(eiY,{children:C.jsx(u.SV,{renderError:eiG,children:C.jsx(o.Suspense,{fallback:C.jsx(u.DW,{}),children:C.jsx(eiK,{term:a.debouncedValue,isUpdating:r,onMediaSelected:n})})})})]})},eiK=t=>{var n;let{term:r,isUpdating:i,onMediaSelected:o}=t,a=tk(),s=eij(a.unsplashUrl,r||"fruit"),c=(n=i,{opacity:n?.4:1,transitionProperty:n?"opacity":"none",transitionDuration:u.TV.transitionDuration[300],transitionTimingFunction:u.TV.transitionTimingFunction.easeInOut});return s.length?C.jsx(u.Rk,{items:s,getItemInfo:eiq,style:c,children:t=>C.jsx(u.P0,{url:t.urls.small,onClick:()=>o({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",...c},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."})]})},eiY=({children:t})=>C.jsx(u.xr,{style:{height:"100%",paddingInline:u.TV.space[24],paddingTop:u.TV.space[4]},children:t});function eiq(t){return{key:t.id,aspectRatio:t.width/t.height}}function eiG(){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 eiZ(t){let{onMediaSelected:n,assetType:r="all",open:i,onOpenChange:a}=t,s=tk(),[c,l]=(0,o.useState)(s.mediaLibrary?"media":"unsplash"),{uploadingFiles:f,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=tk();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,d.WY)(r,{headers:{repository:i,"Content-Type":"multipart/form-data"},method:"POST",body:a,credentials:(0,d.xb)(o),okType:tj})})({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:tB(),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.KH,{startIcon:"cloudUpload",disabled:p,onFilesSelected:h,size:"large",color:"grey",children:"Upload media"})})]}),C.jsx(u.cZ,{children:C.jsx(eiQ,{option:c,uploadingFiles:f,isUploading:p,onFilesSelected:h,onRetry:m,onMediaSelected(t){a(!1),null==n||n(t)},assetType:r})})]})}function eiQ(t){let{option:n,onMediaSelected:r,assetType:i,...o}=t,a=tk();switch(n){case"media":return a.mediaLibrary?C.jsx(eiP,{onMediaSelected:r,assetType:i,...o}):null;case"unsplash":return C.jsx(ei$,{onMediaSelected:r})}}function eiH(t){let{onMediaSelected:n,readOnly:r,isUpdating:i}=t,[a,s]=(0,o.useState)(!1),c=eiL();return C.jsxs(u.aY,{children:[C.jsx(u.Zb,{color:"grey3",variant:"outlined",radius:4,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(eiA,{open:a,setIsOpen:s,onMediaSelected:n,assetType:"image"}):C.jsx(eiZ,{open:a,onOpenChange:s,onMediaSelected:n,assetType:"image"})]})}function eiJ(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,placeholder:"Short description for the visually impaired",readOnly:r,padding:{input:{inline:16}},value:i,onValueChange:o})})]})}let eiX=({contentView:t,constraints:n,croppedImage:r})=>{let[i,o]=eiS(t.origin,n),a=eiw(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}}}},ei0=({field:t,content:n,thumbnail:r,croppedImage:i})=>{var o,a,u,s;if(r===eiM){let c=eiX({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),d=null==(s=n.thumbnails)?void 0:s[r];if(!l||!d)return n;let f=eiX({contentView:d,constraints:l,croppedImage:i});return f.url===d.url?n:{...n,thumbnails:{...n.thumbnails,[r]:f}}},ei1=({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)}},ei2=({contentView:t,constraints:n})=>{let r=ei1({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}},ei4={x:0,y:0,width:0,height:0,zoom:1},ei3=({selectedImage:{thumbnail:t,contentView:n}})=>t.width&&t.height?t.width/t.height:n?n.origin.width/n.origin.height:1,ei5=({trigger:t,initialImages:n,initialOption:r,onClose:i})=>{var a;let[s,c]=(0,o.useState)({}),[l,d]=(0,o.useState)({}),[f,p]=(0,o.useState)(!1),[h,m]=(0,o.useState)(!1),[g,y]=(0,o.useState)(r),v=n[g],b=t=>{if(!v)return;let n=v.thumbnail.name,r=s[n]??ei4;c({...s,[n]:{...r,zoom:t}})},x=t=>{if(!v)return;let n=v.thumbnail.name,r=s[n]??ei4;c({...s,[n]:{...r,...t}})},M=t=>{if(!v)return;let n=v.thumbnail.name,r=l[n];d({...l,[n]:{...r,crop:t}})},T=t=>{if(!v)return;let n=v.thumbnail.name,r=l[n]??{};d({...l,[n]:{...r,aspectRatio:t}})},S=s[(null==v?void 0:v.thumbnail.name)??""],w=f?S??((null==v?void 0:v.contentView)&&ei2({contentView:v.contentView,constraints:v.thumbnail})):void 0,I=l[(null==v?void 0:v.thumbnail.name)??""];return C.jsxs(u.Vq,{trigger:t,onAnimationEnd:()=>m(!0),open:f,onOpenChange(t){t?(y(r),c({}),d({})):(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==I?void 0:I.crop)??{x:0,y:0},onCropChange:M,zoom:(null==S?void 0:S.zoom)??1,onZoomChange:b,aspectRatio:ei3({selectedImage:v,cropper:I}),onAspectRatioChange:T,initialCroppedArea:w,onCropAreaChange:x},v.thumbnail.name)})]})};function ei9(t){var n,r;let{content:i,selected:a,fieldLabel:s,readOnly:c,imageLabel:l,onMediaSelected:d,initialImages:f,initialOption:p=0,onCropperDialogClose:h,onClear:m,children:g}=t,[y,v]=(0,o.useState)(!1),b=eiL(),x=(null==(r=null==(n=null==i?void 0:i.url)?void 0:n.split("?")[0])?void 0:r.slice(-4))===".svg",M=null!=i&&i.url&&!c?"visible":"hidden";return C.jsxs(u.Zb,{color:a?"indigo2":"grey2",variant:a?"selected":"dashed",radius:4,children:[C.jsxs(u.Ol,{children:[C.jsxs(u.wP,{children:[s,0!==l.length&&C.jsx(u.xv,{color:"grey11",noSelect:!0,children:` • ${l.join(" • ")}`})]}),C.jsxs(u.Pf,{sx:{visibility:M},children:[C.jsx(ei5,{trigger:C.jsx(u.zx,{startIcon:"crop",disabled:x,children:"Crop & Resize"}),initialImages:f,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(eiA,{open:y,setIsOpen:v,onMediaSelected:d,assetType:"image"}):C.jsx(eiZ,{open:y,onOpenChange:v,onMediaSelected:d,assetType:"image"})]})}function ei8(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:eiw(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 ei6(t){let{content:n,field:r,id:i,onContentChange:u,readOnly:s}=t,c=n&&n.origin.url.length>0,{onCropperDialogClose:d,onPageChange:f,onMediaSelected:p,isUpdating:h,page:m,thumbnail:g,allThumbnails:y,allContentViews:v,contentView:b,onClear:x}=function(t){var n;let{content:r,onContentChange:i,field:u}=t,[s,c]=(0,o.useState)(0),[l,d]=(0,o.useTransition)(),f=(n=u,(0,o.useMemo)(()=>{var t,r,i;return[{...null==(r=n.config)?void 0:r.constraint,name:eiM}].concat((null==(i=n.config)?void 0:i.thumbnails)??[])},[n])),p=f[s],h=r?function(t,n){var r,i;let{__TYPE__:o,thumbnails:a,...u}=n,s=null==(i=null==(r=t.config)?void 0:r.thumbnails)?void 0:i.map(({name:t})=>null==a?void 0:a[t]);return[u,...s??[]]}(u,r):void 0,m=null==h?void 0:h[s];return{onCropperDialogClose:function({option:t,croppedImages:n}){if(c(t),!r)return;let o=Object.entries(n).reduce((t,[n,r])=>ei0({field:u,content:t,thumbnail:n,croppedImage:r}),r);o!==r&&d(()=>i(o))},onPageChange:function(t){d(()=>c(t))},onMediaSelected:function(t){if(!p)return;let n=function(t,n,r,i){var o,u,s,c,l,d;if(!r){let f=null==(o=n.config)?void 0:o.thumbnails,p=f&&Object.fromEntries(f.map(t=>[t.name,ei8(i,t)]));return{__TYPE__:"ImageContent",...ei8(i,null==(u=n.config)?void 0:u.constraint),thumbnails:p}}if(t===eiM){let h=ei8(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==(d=r.thumbnails)?void 0:d[t],y=ei8(i,m);return y.url===(null==g?void 0:g.url)?r:{...r,thumbnails:(0,a.Q8)(r.thumbnails??{},(n,r)=>r===t?y:n)}}(p.name,u,r,t);n!==r&&d(()=>i(n))},isUpdating:l,page:s,thumbnail:p,allThumbnails:f,allContentViews:h,contentView:m,onClear:function(){null==c||c(0),i(void 0)}}}({field:r,content:n,onContentChange:u}),M=ZI(r),T=y.map((t,r)=>{let i=null==v?void 0:v[r];return{thumbnail:t,contentView:i,labels:eiT(t,n,i)}}),S=g&&c?eiT(g,n,b).filter(l.$):[];return C.jsx(ei9,{content:n,fieldLabel:M,imageLabel:S,initialOption:m,initialImages:T,readOnly:s,onMediaSelected:p,onCropperDialogClose:d,onClear:x,children:C.jsx(o.Suspense,{fallback:C.jsx("div",{style:{height:466}}),children:g&&n&&c&&v?C.jsx(ei7,{allContentViews:v,content:n,contentView:b,id:i,onContentChange:u,onPageChange:f,page:m,readOnly:s,thumbnailName:g.name,isUpdating:h}):C.jsx(eiH,{onMediaSelected:p,readOnly:s,isUpdating:h})})})}function ei7(t){let{allContentViews:n,content:r,contentView:i,id:o,onContentChange:a,onPageChange:s,page:c,readOnly:l,thumbnailName:d,isUpdating:f}=t;return C.jsxs(u.aY,{children:[C.jsx(u.lr,{getItemSource:eiO,items:n,onPageChange:s,page:c,style:{height:400},children:t=>(null==t?void 0:t.url)&&C.jsx(u.d$,{src:eiI(t.url),alt:t.alt??void 0,isUpdating:f},`${d}_${t.url}`)}),C.jsx(eiJ,{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===eiM?{...n,alt:o}:{...n,thumbnails:{...n.thumbnails,[t]:{...r,alt:o}}}}(d,r,i,t))}})]})}function eoe(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:ZI(r)}),C.jsx(u.JO,{children:C.jsx(u.Kx,{id:i,placeholder:Z_(r),readOnly:a,paddingLeft:4,paddingRight:12,sx:{flexGrow:1},value:(null==n?void 0:n.value)??"",onChange(t){var n;o((n=t,0===n.length?void 0:{__TYPE__:"FieldContent",type:"Text",value:n}))}})})]})}function eot(t,n,r,i){return(0,g.W7)(t,r,i,30,n)}function eon(){let t=tk();t.searchDocuments||tN("searchDocuments");let{coreApiUrl:n,env:r}=t,i=`${n}/repository`,o=(0,f.QT)(g.Ag,[i,r]);return new Set(o.languages.map(t=>({id:t.id,label:t.name})))}function eor(){let t=tk();t.searchDocuments||tN("searchDocuments");let{coreApiUrl:n,env:r}=t,i=`${n}/repository`,o=(0,f.QT)(g.Mi,[i,r]);return new Set(o.results.map(t=>({id:t,label:t})))}function eoi(){let t=tk();t.searchDocuments||tN("searchDocuments");let{customTypesApiUrl:n,env:r,repository:i}=t,o=(0,f.QT)(g.JY,[n,i,r]);return new Set(o)}function eoo(t){return t?(0,y.UI)(t,t=>({id:t,label:t})):new Set}function eoa(t){let{filteredLocales:n,setFilteredLocales:r,filteredTags:i,setFilteredTags:a,filteredCustomTypes:s,setFilteredCustomTypes:c,fixedTags:l,fixedCustomTypes:d}=t;return C.jsxs(C.Fragment,{children:[C.jsx(u.SV,{children:C.jsx(o.Suspense,{fallback:C.jsx(eou,{selectedValues:n,onSelectedValuesChange:r,label:"Locale",icon:"public",fetchFilters:eon,multiple:!1}),children:C.jsx(eoc,{selectedValues:n,onSelectedValuesChange:r})})}),C.jsx(eou,{selectedValues:i,fixedSelectedValues:eoo(l),onSelectedValuesChange:a,label:"Tags",icon:"label",fetchFilters:eor}),C.jsx(eou,{selectedValues:s,fixedSelectedValues:eoo(d),onSelectedValuesChange:c,label:"Type",icon:"description",fetchFilters:eoi})]})}function eou(t){let[n,r]=(0,o.useState)(!1),i=(0,o.useContext)(f.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(eos,{open:n,setOpen:r,...t})})})}function eos(t){let{open:n,setOpen:r,onSelectedValuesChange:i,fixedSelectedValues:o,selectedValues:a,label:s,icon:c,fetchFilters:l,multiple:d}=t,f=l();return C.jsx(u.R0,{open:n,setOpen:r,label:s,icon:c,selectedValues:a,values:new Set(f),fixedSelectedValues:o,onSelectedValuesChange:i,multiple:d})}function eoc(t){let{selectedValues:n,onSelectedValuesChange:r}=t,[i,a]=(0,o.useState)((0,y.Ps)(n)),u=(0,y.sE)(eon(),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(eou,{selectedValues:new Set(i?[i]:[]),onSelectedValuesChange:function(t){r(t),a((0,y.Ps)(t))},label:"Locale",icon:"public",fetchFilters:eon,multiple:!1})}function eol(t){let{onSelectDocument:n,fixedCustomTypes:r,fixedTags:i,...a}=t,c=tk(),{searchTerm:l,filteredTags:d,setFilteredTags:f,filteredCustomTypes:p,setFilteredCustomTypes:h,filteredLocales:m,setFilteredLocales:g,typesFilter:v,tagsFilter:b}=function(t,n){let r=tk(),i=(0,s.$P)({initialState:""}),[a,u]=(0,o.useState)(new Set),[c,l]=(0,o.useState)(new Set),[d,f]=(0,o.useState)(function(){return r.searchDocuments&&r.localeId?new Set([{id:r.localeId,label:r.localeId}]):new Set}),p=(0,y.G0)(c,eoo(t)),h=(0,y.G0)(a,eoo(n));return{searchTerm:i,filteredTags:a,setFilteredTags:u,filteredCustomTypes:c,setFilteredCustomTypes:l,filteredLocales:d,setFilteredLocales:f,typesFilter:p,tagsFilter:h}}(r,i),[x,M]=(0,o.useTransition)(),T=(0,s.$P)({initialState:x,ms:100}),{searchDocuments:S}=tk();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"}),S&&C.jsx(eoa,{filteredTags:d,setFilteredTags:f,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:eof,children:C.jsx(o.Suspense,{children:C.jsx(eop,{searchTerm:l.debouncedValue,tagsFilter:b,typesFilter:v,localesFilter:m,startTransition:M,onSelectDocument:n})})}):C.jsx(eoh,{message:"Slice Machine does not yet support mock data for linked documents in the simulator."}),C.jsx(eod,{debouncedIsLoading:T.debouncedValue})]})})})}function eod(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 eof(){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 eop(t){let{searchTerm:n,tagsFilter:r,typesFilter:i,localesFilter:a,startTransition:s,onSelectDocument:c}=t,{documents:l,onHasReachedBottom:d}=function(t){var n,r;let{searchTerm:i,tagsFilter:a,typesFilter:u,localesFilter:s}=t,c=tk();c.searchDocuments||tN("searchDocuments");let{coreApiUrl:l,env:d,status:p}=c,[m,v]=(0,o.useState)(""),[b,x]=(0,o.useState)([]),[M,T]=(0,o.useState)(""),S=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,f.QT)(eot,[l,S===M?m:"",d,S]);return S!==M?(T(S),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=tk();return C.jsx(u.xr,{onScrollToBottom:()=>s(d),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(eoh,{}),l.map(t=>{let n=t.versions[0];if(!n)return null;let i=(0,m.u)({documentId:t.id,versionId:"archived"===n.status?n.version_id:void 0,releaseId:"release"===n.status?n.release_id:void 0,status:n.status,env:p.env}),o=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:n.tags,tagsFilter:r});return C.jsx(u.z4,{documentType:n.custom_type_label,documentURL:i,description:n.preview_summary,tags:o,title:t.title,previewImageUrl:n.preview_image,onSelect:()=>c(t.id),statusColor:S[n.status].color},`${t.id}-${n.status}`)})]})})}function eoh(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 eom(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",color:"grey",size:"small",onClick:()=>c(!s),children:"Open in new tab"}),C.jsxs(u.Ph,{value:o,color:"grey",size:"small",boldTriggerText:!0,startIcon:function(t){if(t)switch(t){case"document":return"description";case"web":return"public";case"media":return"image"}}(o),disabled:!i,onValueChange:a,placeholder:"Choose link type",children:[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",color:"grey",size:"small",disabled:!n,onClick:r})]})}f.Fs.registerFetcherConfig(eot,{cacheCapacity:500,revalidationStrategy:{type:"never"}});let eog={DocumentLink:"document",ExternalLink:"web",FileLink:"media",ImageLink:"media"},eoy={document:"DocumentLink",web:"ExternalLink",media:"FileLink"},eov=tr({id:eX(),title:eX()});function eob(t,n,r){return(0,d.WY)(`${t}/documents/${r}`,{credentials:(0,d.xb)(n),okType:eov})}function eox(t){var n,r,i,o,a,u;let{media:s}=t,c="kind"in s;return c&&"image"===s.kind?{__TYPE__:"LinkContent",value:{__TYPE__:"ImageLink",id:s.id,name:s.filename,url:s.url,kind:s.kind,size:s.size.toString(),height:(null==(n=s.height)?void 0:n.toString())??"2000",width:(null==(r=s.width)?void 0:r.toString())??"2000",date:(null==(i=s.last_modified)?void 0:i.toString())??""}}:c?{__TYPE__:"LinkContent",value:{__TYPE__:"FileLink",id:s.id,name:s.filename,kind:s.kind,url:s.url,size:s.size.toString(),date:(null==(o=s.last_modified)?void 0:o.toString())??""}}:{__TYPE__:"LinkContent",value:{__TYPE__:"ImageLink",id:s.id,name:(null==s?void 0:s.alt)??s.url,kind:"image",url:s.url,size:"0",height:(null==(a=s.height)?void 0:a.toString())??"2000",width:(null==(u=s.width)?void 0:u.toString())??"2000"}}}function eoM(t){var n,r;let{content:i,field:a,id:c,onContentChange:l,readOnly:d}=t,f=eiL(),[h,m]=(0,o.useState)(!1),[g,y]=(0,o.useState)(!1),[v,b]=(0,o.useState)(!1),[x,M]=(0,o.useState)(!1),{contentType:T,fieldValue:S,errorBoundaryRef:w,onDocumentSelected:I,onError:_,onMediaSelected:O,...k}=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__:eoy[null==(n=r.config)?void 0:n.select]}),[d,f]=(0,o.useState)(()=>(null==i?void 0:i.value.__TYPE__)==="ExternalLink"?i.value.target:""),[p,h]=(0,o.useState)(!1),m=(0,o.useRef)(null);(0,s.pQ)(u,function(){var t;p&&(h(!1),null==(t=m.current)||t.reset())});let g=c?eog[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:d}});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(eoy[t]),y("")},placeholder:Z_(r),isTypeSelectEnabled:!(null!=(n=r.config)&&n.select),onDocumentSelected:v,onError:function(){h(!0)},errorBoundaryRef:m,isTargetNewTab:"_blank"===d,updateWebLinkTarget:function(t){let n=t?"_blank":null;f(n),a({__TYPE__:"LinkContent",value:{__TYPE__:"ExternalLink",url:u,target:n}})},onMediaSelected:function(t){a(eox({media:t}))}}}({content:i,field:a,onContentChange:l}),N="ExternalLink"===T&&(0,p.ju)(S),j={id:c,contentType:T,onBlur:()=>m(!1),onFocus(){m(!0),"DocumentLink"===T&&b(!0),"FileLink"===T&&M(!0),"ImageLink"===T&&M(!0)},readOnly:d||!T,textType:N||"ImageLink"===T||"FileLink"===T?"link":"normal",value:S,...k},{searchDocuments:E}=tk();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:ZI(a)}),C.jsx(u.JO,{children:"DocumentLink"===T&&""!==S&&E?C.jsx(eow,{errorBoundaryRef:w,onError:_,fallback:C.jsx(eoT,{...j,value:"..."}),renderError(){var t;return t=j,C.jsx(eoT,{...t,textType:"link"})},children:C.jsx(eoS,{...j,documentId:S,openDocumentListModal:()=>b(!0)})}):C.jsx(eoT,{...j})})]}),children:[N&&C.jsx(u.oZ,{url:N,title:(0,p.S$)(N)??"",subTitle:N.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`})]}),f?C.jsx(eiA,{open:x,setIsOpen:M,onMediaSelected:O,assetType:"all"}):C.jsx(eiZ,{open:x,onOpenChange:M,onMediaSelected:O}),C.jsx(eol,{open:v,onOpenChange:b,onSelectDocument(t){b(!1),I(t)},fixedCustomTypes:new Set(null==(n=a.config)?void 0:n.customtypes),fixedTags:new Set(null==(r=a.config)?void 0:r.tags)})]})}function eoT(t){let{id:n,onValueChange:r,placeholder:i,readOnly:o,value:a,textType:u,onFocus:s,onBlur:c,contentType:l,isTypeSelectEnabled:d,selectType:f,onTypeChange:p,isTargetNewTab:h,updateWebLinkTarget:m}=t,g="DocumentLink"===l||"ImageLink"===l||"FileLink"===l;return C.jsx(ZN,{id:n,onValueChange:r,placeholder:i,readOnly:o||g,value:a,variant:u,onFocus:s,onBlur:c,cursor:g?"pointer":"text",endAdornment:C.jsx(eom,{hasLink:Boolean(a),onUnlink:()=>r(""),selectEnabled:d,selectedType:f,onValueChange:p,openInNewTab:h,setOpenInNewTab:m})})}function eoS(t){let{id:n,documentId:r,openDocumentListModal:i,onValueChange:o,isTypeSelectEnabled:a,selectType:u,onTypeChange:s}=t,c=function(t){let n=tk();n.searchDocuments||tN("searchDocuments");let{coreApiUrl:r,env:i}=n;return(0,f.QT)(eob,[r,i,t]).title}(r);return C.jsx(ZN,{id:n,readOnly:!0,value:c,variant:"link",onFocus:i,cursor:"pointer",endAdornment:C.jsx(eom,{hasLink:!0,onUnlink:()=>o(""),selectEnabled:a,selectedType:u,onValueChange:s})})}function eow(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 eoI=({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:ZI(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,padding:Zj,placeholder:Z_(n),readOnly:o,onValueChange(t){var n;return i((n=t,void 0===n?void 0:{__TYPE__:"FieldContent",type:"Number",value:String(n)}))}})})]})};var eo_=function(){};eo_.prototype.append=function(t){return t.length?(t=eo_.from(t),!this.length&&t||t.length<200&&this.leafAppend(t)||this.length<200&&t.leafPrepend(this)||this.appendInner(t)):this},eo_.prototype.prepend=function(t){return t.length?eo_.from(t).append(this):this},eo_.prototype.appendInner=function(t){return new eok(this,t)},eo_.prototype.slice=function(t,n){return void 0===t&&(t=0),void 0===n&&(n=this.length),t>=n?eo_.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))},eo_.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},eo_.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)},eo_.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},eo_.from=function(t){return t instanceof eo_?t:t&&t.length?new eoO(t):eo_.empty};var eoO=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}(eo_);eo_.empty=new eoO([]);var eok=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}(eo_);class eoC{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 eoN(t.map));let d=t.step.map(i.slice(o)),f;d&&a.maybeStep(d).doc&&(f=a.mapping.maps[a.mapping.maps.length-1],c.push(new eoN(f,void 0,void 0,c.length+l.length))),o--,f&&i.appendMap(f,o)}else a.maybeStep(t.step);if(t.selection)return u=i?t.selection.map(i.slice(o)):t.selection,s=new eoC(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 d=0;d<t.steps.length;d++){let f=t.steps[d].invert(t.docs[d]),p=new eoN(t.mapping.maps[d],f,n),h;(h=l&&l.merge(p))&&(p=h,d?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>eoE&&(o=c,a=m,c=(o.forEach((t,n)=>{if(t.selection&&0==a--)return g=n,!1}),o.slice(g)),s-=m),new eoC(c.append(u),s)}remapping(t,n){let r=new Q_;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 eoC(this.items.append(t.map(t=>new eoN(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]),d=n.selection&&n.selection.map(o.slice(s+1,i));d&&u++,r.push(new eoN(c,l,d))}else r.push(new eoN(c))},i);let c=[];for(let l=n;l<a;l++)c.push(new eoN(o.maps[l]));let d=this.items.slice(0,i).append(c).append(r),f=new eoC(d,u);return f.emptyItemCount()>500&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],o=0;return this.items.forEach((a,u)=>{if(u>=t)i.push(a),a.selection&&o++;else if(a.step){let s=a.step.map(n.slice(r)),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 d=new eoN(c.invert(),s,l),f,p=i.length-1;(f=i.length&&i[p].merge(d))?i[p]=f:i.push(d)}}else a.map&&r--},this.items.length,0),new eoC(eo_.from(i.reverse()),o)}}eoC.empty=new eoC(eo_.empty,0);class eoN{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 eoN(n.getMap().invert(),n,this.selection)}}}class eoj{constructor(t,n,r,i,o){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}let eoE=20;function eoR(t){let n=[];return t.forEach((t,r,i,o)=>n.push(i,o)),n}function eoD(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 eoA(t,n,r,i){let o=eoF(n),a=eoz.get(n).spec.config,u=(i?t.undone:t.done).popEvent(n,o);if(!u)return;let s=u.selection.resolve(u.transform.doc),c=(i?t.done:t.undone).addTransform(u.transform,n.selection.getBookmark(),a,o),l=new eoj(i?c:u.remaining,i?u.remaining:c,null,0,-1);r(u.transform.setSelection(s).setMeta(eoz,{redo:i,historyState:l}).scrollIntoView())}let eoL=!1,eoP=null;function eoF(t){let n=t.plugins;if(eoP!=n){eoL=!1,eoP=n;for(let r=0;r<n.length;r++)if(n[r].spec.historyPreserveItems){eoL=!0;break}}return eoL}let eoz=new Hv("history"),eoU=new Hv("closeHistory"),eoW=(t,n)=>{let r=eoz.getState(t);return!!r&&0!=r.done.eventCount&&(n&&eoA(r,t,n,!1),!0)},eoB=(t,n)=>{let r=eoz.getState(t);return!!r&&0!=r.undone.eventCount&&(n&&eoA(r,t,n,!0),!0)},eoV=eeZ.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:t,dispatch:n})=>eoW(t,n),redo:()=>({state:t,dispatch:n})=>eoB(t,n)}),addProseMirrorPlugins(){return[function(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Hm({key:eoz,state:{init:()=>new eoj(eoC.empty,eoC.empty,null,0,-1),apply:(n,r,i)=>(function(t,n,r,i){let o=r.getMeta(eoz),a;if(o)return o.historyState;r.getMeta(eoU)&&(t=new eoj(t.done,t.undone,null,0,-1));let u=r.getMeta("appendedTransaction");if(0==r.steps.length)return t;if(u&&u.getMeta(eoz))return u.getMeta(eoz).redo?new eoj(t.done.addTransform(r,void 0,i,eoF(n)),t.undone,eoR(r.mapping.maps[r.steps.length-1]),t.prevTime,t.prevComposition):new eoj(t.done,t.undone.addTransform(r,void 0,i,eoF(n)),null,t.prevTime,t.prevComposition);if(!1===r.getMeta("addToHistory")||u&&!1===u.getMeta("addToHistory"))return(a=r.getMeta("rebased"))?new eoj(t.done.rebased(r,a),t.undone.rebased(r,a),eoD(t.prevRanges,r.mapping),t.prevTime,t.prevComposition):new eoj(t.done.addMaps(r.mapping.maps),t.undone.addMaps(r.mapping.maps),eoD(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?eoD(t.prevRanges,r.mapping):eoR(r.mapping.maps[r.steps.length-1]);return new eoj(t.done.addTransform(r,c?n.selection.getBookmark():void 0,i,eoF(n)),eoC.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?eoW:"historyRedo"==r?eoB: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()}}}),eo$=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,eoK=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,eoY=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,eoq=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,eoG=eng.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",eeN(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[enp({find:eo$,type:this.type}),enp({find:eoY,type:this.type})]},addPasteRules(){return[enb({find:eoK,type:this.type}),enb({find:eoq,type:this.type})]}});var eoZ,eoQ,eoH=((eoZ=eoH||{}).Document="document",eoZ.Mark="mark",eoZ.Node="node",eoZ),eoJ=((eoQ=eoJ||{}).Text="text",eoQ.Embed="embed",eoQ.Image="image",eoQ);class eoX{constructor(t,n,r,i,o,a=!1){T(this,"extType","node"),T(this,"nodeType","text"),this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i,this.placeholder=o,this.lockedFormat=a}}function eo0(t){return t instanceof eoX}class eo1 extends eoX{constructor(t,n,r,i,o){super(t,"heading",n,i,o),this.levels=r}}class eo2 extends eoX{constructor(t,n,r,i){super(t,n,r,i)}}function eo4(t){return t instanceof eo2}let eo3=eny.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:t}){return["br",eeN(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()}}}),eo5={isHardBreak:t=>t.type.name===eo3.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 eo9(){return{extensions:es4(),defaultTextConverter:void 0}}let eo8=eoG.extend({name:"bold"}),eo6=new class{constructor(t,n,r){T(this,"extType",eoH.Mark),T(this,"richTextNodeTypes",KT.RichTextNodeType.strong),this.name=t,this.component=n,this.converter=r}}(eo8.name,eo8,{fromPrismic:t=>function(){var n;return null==(n=t.marks[eo8.name])?void 0:n.create()},toPrismic(){}}),eo7=eny.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",eeN(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)}}}),eae=eng.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",eeN(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:n})=>{let r=etB(t,this.type);return!!Object.entries(r).some(([,t])=>!!t)||n.unsetMark(this.name)}}}}),eat=/^\s*([-+*])\s$/,ean=eny.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",eeN(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(eo7.name,this.editor.getAttributes(eae.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=enm({find:eat,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=enm({find:eat,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(eae.name),editor:this.editor})),[t]}}),ear=eny.create({name:"doc",topNode:!0,content:"block+"}),eai=eny.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",eeN(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)}}}),eao=eai.extend({name:"listItem",content:"paragraph*",addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name)}}}),eaa={component:eao,converter:{fromPrismic:t=>function(n){var r;let i=eso.converter.fromPrismic(t)(n);if(i)return null==(r=t.nodes[eao.name])?void 0:r.create({},i)},toPrismic:(t,n)=>eo5.children.reduce(t,(t,r)=>{let i=eso.converter.toPrismic(r),o=i instanceof Array?i.map(t=>({...t,type:n})):i?[{...i,type:n}]:[];return[...t,...o]},[])},placeholder:"List"},eau="document",eas=t=>ear.extend({name:eau,content:t?"block+":"block"}),eac=t=>({fromPrismic(n,r){function i(t,n){return!n&&r&&nI.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 eoJ.Embed:return nI.EmbedBlock.is(r)?n.converter.fromPrismic(i)(r):void 0;case eoJ.Text:return nI.TextBlock.is(r)?n.converter.fromPrismic(i)(r):void 0;case eoJ.Image:return nI.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===esh.name||i.type.name===es1.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[eau])?void 0:o.create({},a)}},toPrismic:n=>({__TYPE__:"StructuredTextContent",value:[...eo5.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},[])]})}),eal=new class{constructor(t,n,r){T(this,"extType","document"),this.name=t,this.component=n,this.converter=r}}(eau,eas,eac),ead=eo3.extend({name:"hard_break"}),eaf=`
|
|
94
|
+
`,eap={fromPrismic:t=>function(n){var r;if(n===eaf)return null==(r=t.nodes[ead.name])?void 0:r.create({})},toPrismic(t){if(t.type.name===ead.name)return eaf}},eah={isEmptyLine:t=>0===t.length,isFirst:t=>0===t},eam={name:ead.name,component:ead,converter:eap,splitTextToNodes:function(t,n){return function(r){let i=eap.fromPrismic(t)(eaf);if(!i)return[r(n)];let o=n.split(eaf);return 1===o.length?n.length?[r(n)]:[i]:o.reduce((t,n,o)=>eah.isFirst(o)?eah.isEmptyLine(n)?t:[...t,r(n)]:eah.isEmptyLine(n)?[...t,i]:[...t,i,r(n)],[])}}},eag=eeZ.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new Hm({key:new Hv("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=X_.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}),XC.create(t,o)}}})]}}),eay=t=>eag.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=!eo5.children.exists(i.state.doc,t=>t===a),d=i.isEditable,f=i.isFocused&&o,p=a.type.name!==eso.name,h=f||p||l,m=c.length>1,g=function(){if(l)return eaa.placeholder;let t=u[a.type.name];return"string"==typeof t?t:null==t?void 0:t(a.attrs)}();return s&&!f&&i.isEmpty?s:("Type '/' for commands"===g?d&&h&&m:d&&h)&&g||""})({props:n,params:t}),showOnlyCurrent:!1,showOnlyWhenEditable:!1});function eav(t){return t.split("-")[1]}function eab(t){return"y"===t?"height":"width"}function eax(t){return t.split("-")[0]}function eaM(t){return["top","bottom"].includes(eax(t))?"x":"y"}function eaT(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=eaM(n),c=eab(s),l=i[c]/2-o[c]/2,d=eax(n),f="x"===s,p;switch(d){case"top":p={x:a,y:i.y-o.height};break;case"bottom":p={x:a,y:i.y+i.height};break;case"right":p={x:i.x+i.width,y:u};break;case"left":p={x:i.x-o.width,y:u};break;default:p={x:i.x,y:i.y}}switch(eav(n)){case"start":p[s]-=l*(r&&f?-1:1);break;case"end":p[s]+=l*(r&&f?-1:1)}return p}let eaS=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:d,y:f}=eaT(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:M,reset:T}=await v({x:d,y:f,initialPlacement:i,placement:p,strategy:o,middlewareData:h,rects:l,platform:u,elements:{reference:t,floating:n}});if(d=b??d,f=x??f,h={...h,[y]:{...h[y],...M}},T&&m<=50){m++,"object"==typeof T&&(T.placement&&(p=T.placement),T.rects&&(l=!0===T.rects?await u.getElementRects({reference:t,floating:n,strategy:o}):T.rects),{x:d,y:f}=eaT(l,p,c)),g=-1;continue}}return{x:d,y:f,placement:p,strategy:o,middlewareData:h}};function eaw(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}async function eaI(t,n){var r,i,o;void 0===n&&(n={});let{x:a,y:u,platform:s,rects:c,elements:l,strategy:d}=t,{boundary:f="clippingAncestors",rootBoundary:p="viewport",elementContext:h="floating",altBoundary:m=!1,padding:g=0}=n,y="number"!=typeof g?{top:0,right:0,bottom:0,left:0,...g}:{top:g,right:g,bottom:g,left:g},v=l[m?"floating"===h?"reference":"floating":h],b=eaw(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:f,rootBoundary:p,strategy:d})),x="floating"===h?{...c.floating,x:a,y:u}:c.reference,M=await (null==s.getOffsetParent?void 0:s.getOffsetParent(l.floating)),T=await (null==s.isElement?void 0:s.isElement(M))&&await (null==s.getScale?void 0:s.getScale(M))||{x:1,y:1},S=eaw(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:x,offsetParent:M,strategy:d}):x);return{top:(b.top-S.top+y.top)/T.y,bottom:(S.bottom-b.bottom+y.bottom)/T.y,left:(b.left-S.left+y.left)/T.x,right:(S.right-b.right+y.right)/T.x}}let ea_=Math.min,eaO=Math.max;function eak(t,n,r){return eaO(t,ea_(n,r))}let eaC={left:"right",right:"left",bottom:"top",top:"bottom"};function eaN(t){return t.replace(/left|right|bottom|top/g,t=>eaC[t])}let eaj={start:"end",end:"start"};function eaE(t){return t.replace(/start|end/g,t=>eaj[t])}async function eaR(t,n){let{placement:r,platform:i,elements:o}=t,a=await (null==i.isRTL?void 0:i.isRTL(o.floating)),u=eax(r),s=eav(r),c="x"===eaM(r),l=["left","top"].includes(u)?-1:1,d=a&&c?-1:1,f="function"==typeof n?n(t):n,{mainAxis:p,crossAxis:h,alignmentAxis:m}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return s&&"number"==typeof m&&(h="end"===s?-1*m:m),c?{x:h*d,y:p*l}:{x:p*l,y:h*d}}function eaD(t){return"x"===t?"y":"x"}function eaA(t){var n;return(null==(n=t.ownerDocument)?void 0:n.defaultView)||window}function eaL(t){return eaA(t).getComputedStyle(t)}let eaP=Math.min,eaF=Math.max,eaz=Math.round;function eaU(t){let n=eaL(t),r=parseFloat(n.width),i=parseFloat(n.height),o=t.offsetWidth,a=t.offsetHeight,u=eaz(r)!==o||eaz(i)!==a;return u&&(r=o,i=a),{width:r,height:i,fallback:u}}function eaW(t){return eaY(t)?(t.nodeName||"").toLowerCase():""}let eaB;function eaV(){if(eaB)return eaB;let t=navigator.userAgentData;return t&&Array.isArray(t.brands)?eaB=t.brands.map(t=>t.brand+"/"+t.version).join(" "):navigator.userAgent}function ea$(t){return t instanceof eaA(t).HTMLElement}function eaK(t){return t instanceof eaA(t).Element}function eaY(t){return t instanceof eaA(t).Node}function eaq(t){if(typeof ShadowRoot>"u")return!1;let n=eaA(t).ShadowRoot;return t instanceof n||t instanceof ShadowRoot}function eaG(t){let{overflow:n,overflowX:r,overflowY:i,display:o}=eaL(t);return/auto|scroll|overlay|hidden|clip/.test(n+i+r)&&!["inline","contents"].includes(o)}function eaZ(t){return["table","td","th"].includes(eaW(t))}function eaQ(t){let n=/firefox/i.test(eaV()),r=eaL(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 eaH(){return/^((?!chrome|android).)*safari/i.test(eaV())}function eaJ(t){return["html","body","#document"].includes(eaW(t))}function eaX(t){return eaK(t)?t:t.contextElement}let ea0={x:1,y:1};function ea1(t){let n=eaX(t);if(!ea$(n))return ea0;let r=n.getBoundingClientRect(),{width:i,height:o,fallback:a}=eaU(n),u=(a?eaz(r.width):r.width)/i,s=(a?eaz(r.height):r.height)/o;return u&&Number.isFinite(u)||(u=1),s&&Number.isFinite(s)||(s=1),{x:u,y:s}}function ea2(t,n,r,i){var o,a;void 0===n&&(n=!1),void 0===r&&(r=!1);let u=t.getBoundingClientRect(),s=eaX(t),c=ea0;n&&(i?eaK(i)&&(c=ea1(i)):c=ea1(t));let l=s?eaA(s):window,d=eaH()&&r,f=(u.left+(d&&(null==(o=l.visualViewport)?void 0:o.offsetLeft)||0))/c.x,p=(u.top+(d&&(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=eaA(s),y=i&&eaK(i)?eaA(i):i,v=g.frameElement;for(;v&&i&&y!==g;){let b=ea1(v),x=v.getBoundingClientRect(),M=getComputedStyle(v);x.x+=(v.clientLeft+parseFloat(M.paddingLeft))*b.x,x.y+=(v.clientTop+parseFloat(M.paddingTop))*b.y,f*=b.x,p*=b.y,h*=b.x,m*=b.y,f+=x.x,p+=x.y,v=eaA(v).frameElement}}return{width:h,height:m,top:p,right:f+h,bottom:p+m,left:f,x:f,y:p}}function ea4(t){return((eaY(t)?t.ownerDocument:t.document)||window.document).documentElement}function ea3(t){return eaK(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function ea5(t){return ea2(ea4(t)).left+ea3(t).scrollLeft}function ea9(t){if("html"===eaW(t))return t;let n=t.assignedSlot||t.parentNode||eaq(t)&&t.host||ea4(t);return eaq(n)?n.host:n}function ea8(t,n){var r;void 0===n&&(n=[]);let i=function t(n){let r=ea9(n);return eaJ(r)?r.ownerDocument.body:ea$(r)&&eaG(r)?r:t(r)}(t),o=i===(null==(r=t.ownerDocument)?void 0:r.body),a=eaA(i);return o?n.concat(a,a.visualViewport||[],eaG(i)?i:[]):n.concat(i,ea8(i))}function ea6(t,n,r){let i;if("viewport"===n)i=function(t,n){let r=eaA(t),i=ea4(t),o=r.visualViewport,a=i.clientWidth,u=i.clientHeight,s=0,c=0;if(o){a=o.width,u=o.height;let l=eaH();(!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=ea4(t),r=ea3(t),i=t.ownerDocument.body,o=eaF(n.scrollWidth,n.clientWidth,i.scrollWidth,i.clientWidth),a=eaF(n.scrollHeight,n.clientHeight,i.scrollHeight,i.clientHeight),u=-r.scrollLeft+ea5(t),s=-r.scrollTop;return"rtl"===eaL(i).direction&&(u+=eaF(n.clientWidth,i.clientWidth)-o),{width:o,height:a,x:u,y:s}}(ea4(t));else if(eaK(n))i=function(t,n){let r=ea2(t,!0,"fixed"===n),i=r.top+t.clientTop,o=r.left+t.clientLeft,a=ea$(t)?ea1(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(eaH()){var a,u;let s=eaA(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 eaw(i)}function ea7(t,n){return ea$(t)&&"fixed"!==eaL(t).position?n?n(t):t.offsetParent:null}function eue(t,n){let r=eaA(t),i=ea7(t,n);for(;i&&eaZ(i)&&"static"===eaL(i).position;)i=ea7(i,n);return i&&("html"===eaW(i)||"body"===eaW(i)&&"static"===eaL(i).position&&!eaQ(i))?r:i||function(t){let n=ea9(t);for(;ea$(n)&&!eaJ(n);){if(eaQ(n))return n;n=ea9(n)}return null}(t)||r}let eut={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=ea8(t).filter(t=>eaK(t)&&"body"!==eaW(t)),o=null,a="fixed"===eaL(t).position,u=a?ea9(t):t;for(;eaK(u)&&!eaJ(u);){let s=eaL(u),c=eaQ(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=ea9(u)}return n.set(t,i),i}(n,this._c):[].concat(r),i],u=a[0],s=a.reduce((t,r)=>{let i=ea6(n,r,o);return t.top=eaF(i.top,t.top),t.right=eaP(i.right,t.right),t.bottom=eaP(i.bottom,t.bottom),t.left=eaF(i.left,t.left),t},ea6(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=ea$(r),a=ea4(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"!==eaW(r)||eaG(a))&&(u=ea3(r)),ea$(r))){let l=ea2(r);s=ea1(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:eaK,getDimensions:function(t){return ea$(t)?eaU(t):t.getBoundingClientRect()},getOffsetParent:eue,getDocumentElement:ea4,getScale:ea1,async getElementRects(t){let{reference:n,floating:r,strategy:i}=t,o=this.getOffsetParent||eue,a=this.getDimensions;return{reference:function(t,n,r){let i=ea$(n),o=ea4(n),a=ea2(t,!0,"fixed"===r,n),u={scrollLeft:0,scrollTop:0},s={x:0,y:0};if(i||!i&&"fixed"!==r){if(("body"!==eaW(n)||eaG(o))&&(u=ea3(n)),ea$(n)){let c=ea2(n,!0);s.x=c.x+n.clientLeft,s.y=c.y+n.clientTop}else o&&(s.x=ea5(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"===eaL(t).direction};function eun(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?[...eaK(t)?ea8(t):t.contextElement?ea8(t.contextElement):[],...ea8(n)]:[];l.forEach(t=>{c&&t.addEventListener("scroll",r,{passive:!0}),a&&t.addEventListener("resize",r)});let d=null;if(u){let f=!0;d=new ResizeObserver(()=>{f||r(),f=!1}),eaK(t)&&!s&&d.observe(t),eaK(t)||!t.contextElement||s||d.observe(t.contextElement),d.observe(n)}let p,h=s?ea2(t):null;return s&&function n(){let i=ea2(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=d)||t.disconnect(),d=null,s&&cancelAnimationFrame(p)}}let eur=(t,n,r)=>{let i=new Map,o={platform:eut,...r},a={...o.platform,_c:i};return eaS(t,n,{...o,platform:a})};var eui="u">typeof document?o.useLayoutEffect:o.useEffect;function euo(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(!euo(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)&&!euo(t[a],n[a]))return!1}return!0}return t!=t&&n!=n}function eua(t){let n=o.useRef(t);return eui(()=>{n.current=t}),n}var euu="u">typeof document?o.useLayoutEffect:o.useEffect;let eus=!1,euc=0,eul=()=>"floating-ui-"+euc++,eud=(qC||(qC=r.t(o,2)))["useId".toString()],euf=eud??function(){let[t,n]=o.useState(()=>eus?eul():void 0);return euu(()=>{null==t&&n(eul())},[]),o.useEffect(()=>{eus||(eus=!0)},[]),t},eup=o.createContext(null),euh=o.createContext(null),eum=()=>{var t,n;return null!=(t=null==(n=o.useContext(eup))?void 0:n.id)?t:null},eug=()=>o.useContext(euh);function euy(t){var n;return null!=(n=null==t?void 0:t.ownerDocument)?n:document}function euv(t){var n;return null!=(n=euy(t).defaultView)?n:window}function eub(t){return!!t&&t instanceof euv(t).Element}let eux=(qC||(qC=r.t(o,2)))["useInsertionEffect".toString()];function euM(t){let n=o.useRef(()=>{});return eux?eux(()=>{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 euT(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 euS(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 euw(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 euI(t){t.preventDefault(),t.stopPropagation()}function eu_(t){let n=(0,o.useRef)();return euu(()=>{n.current=t},[t]),n.current}let euO=function(t,n){let{open:r}=t,{enabled:i=!0,role:o="dialog"}=void 0===n?{}:n,a=euf(),u=euf(),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 euk(t,n){return null!=n&&("composedPath"in t?t.composedPath().includes(n):null!=t.target&&n.contains(t.target))}let euC=function(t,n){let{open:r,onOpenChange:i,refs:a,events:u,nodeId:s}=t,{enabled:c=!0,escapeKey:l=!0,outsidePointerDown:d=!0,referencePointerDown:f=!1,ancestorScroll:p=!1,bubbles:h=!0}=void 0===n?{}:n,m=eug(),g=null!=eum(),y=o.useRef(!1);return o.useEffect(()=>{if(!r||!c)return;function t(t){"Escape"!==t.key||!h&&m&&euS(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(eub(c)&&a.floating.current){let l=null!=(r=a.floating.current.ownerDocument.defaultView)?r:window,d=c.scrollWidth>c.clientWidth,f=c.scrollHeight>c.clientHeight,p=f&&t.offsetX>c.clientWidth;if(f&&"rtl"===l.getComputedStyle(c).direction&&(p=t.offsetX<=c.offsetWidth-c.clientWidth),p||d&&t.offsetY>c.clientHeight)return}let v=m&&euS(m.nodesRef.current,s).some(n=>{var r;return euk(t,null==(r=n.context)?void 0:r.refs.floating.current)});euk(t,a.floating.current)||euk(t,a.domReference.current)||v||!h&&m&&euS(m.nodesRef.current,s).length>0||(u.emit("dismiss",!!g&&{preventScroll:!0}),i(!1))}function o(){i(!1)}let f=euy(a.floating.current);l&&f.addEventListener("keydown",t),d&&f.addEventListener("pointerdown",n);let v=(p?[...eub(a.reference.current)?ea8(a.reference.current):[],...eub(a.floating.current)?ea8(a.floating.current):[]]:[]).filter(t=>{var n;return t!==(null==(n=f.defaultView)?void 0:n.visualViewport)});return v.forEach(t=>t.addEventListener("scroll",o,{passive:!0})),()=>{l&&f.removeEventListener("keydown",t),d&&f.removeEventListener("pointerdown",n),v.forEach(t=>t.removeEventListener("scroll",o))}},[l,d,u,m,s,r,i,p,c,h,a,g]),c?{reference:{onPointerDown(){f&&(u.emit("dismiss"),i(!1))}},floating:{onPointerDownCapture(){y.current=!0}}}:{}},euN="ArrowUp",euj="ArrowDown",euE="ArrowLeft",euR="ArrowRight";function euD(t,n,r){return Math.floor(t/n)!==r}function euA(t,n){return n<0||n>=t.current.length}function euL(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 euP(t,n,r){switch(t){case"vertical":return n;case"horizontal":return r;default:return n||r}}function euF(t,n){return euP(n,t===euN||t===euj,t===euE||t===euR)}function euz(t,n,r){return euP(n,t===euj,r?t===euE:t===euR)||"Enter"===t||" "==t||""===t}function euU(t,n){return euL(t,{disabledIndices:n})}function euW(t,n){return euL(t,{decrement:!0,startingIndex:t.current.length,disabledIndices:n})}let euB=function(t,n){let{open:r,onOpenChange:i,refs:a}=t,{listRef:u,activeIndex:s,onNavigate:c=()=>{},enabled:l=!0,selectedIndex:d=null,allowEscape:f=!1,loop:p=!1,nested:h=!1,rtl:m=!1,virtual:g=!1,focusItemOnOpen:y="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:b=!0,disabledIndices:x,orientation:M="vertical",cols:T=1}=void 0===n?{listRef:{current:[]},activeIndex:null,onNavigate(){}}:n,S=eum(),w=eug(),I=eu_(r),_=euM(c),O=euM(eu_(c)),k=o.useRef(y),C=o.useRef(d??-1),N=o.useRef(null),j=function(t){let n=(0,o.useRef)(t);return euu(()=>{n.current=t}),n}(x),E=o.useRef(!1),R=o.useRef(-1),[D,A]=o.useState(),L=o.useCallback((t,n)=>{R.current=requestAnimationFrame(()=>{var r,i;g?A(null==(r=t.current[n.current])?void 0:r.id):null==(i=t.current[n.current])||i.focus({preventScroll:!0})})},[g]);function P(t){var n,o,s,c;if(E.current=!0,h&&(n=t.key,euP(M,m?n===euR:n===euE,n===euN))){euI(t),i(!1),(c=a.domReference.current)&&c instanceof euv(c).HTMLElement&&a.domReference.current.focus();return}let l=C.current,d=euU(u,x),y=euW(u,x);if("Home"===t.key&&(C.current=d,_(C.current)),"End"===t.key&&(C.current=y,_(C.current)),T>1){let v=C.current;if(t.key===euN){if(euI(t),-1===v)C.current=y;else if(C.current=euL(u,{startingIndex:v,amount:T,decrement:!0,disabledIndices:x}),p&&(v-T<d||C.current<0)){let b=v%T,S=y%T,w=y-(S-b);S===b?C.current=y:C.current=S>b?w:w-T}euA(u,C.current)&&(C.current=v),_(C.current)}if(t.key===euj&&(euI(t),-1===v?C.current=d:(C.current=euL(u,{startingIndex:v,amount:T,disabledIndices:x}),p&&v+T>y&&(C.current=euL(u,{startingIndex:v%T-T,amount:T,disabledIndices:x}))),euA(u,C.current)&&(C.current=v),_(C.current)),"both"===M){let I=Math.floor(v/T);t.key===euR&&(euI(t),v%T!=T-1?(C.current=euL(u,{startingIndex:v,disabledIndices:x}),p&&euD(C.current,T,I)&&(C.current=euL(u,{startingIndex:v-v%T-1,disabledIndices:x}))):p&&(C.current=euL(u,{startingIndex:v-v%T-1,disabledIndices:x})),euD(C.current,T,I)&&(C.current=v)),t.key===euE&&(euI(t),v%T!=0?(C.current=euL(u,{startingIndex:v,disabledIndices:x,decrement:!0}),p&&euD(C.current,T,I)&&(C.current=euL(u,{startingIndex:v+(T-v%T),decrement:!0,disabledIndices:x}))):p&&(C.current=euL(u,{startingIndex:v+(T-v%T),decrement:!0,disabledIndices:x})),euD(C.current,T,I)&&(C.current=v)),euA(u,C.current)&&(p&&Math.floor(y/T)===I?C.current=t.key===euE?y:euL(u,{startingIndex:v-v%T-1,disabledIndices:x}):C.current=v),_(C.current);return}}if(euF(t.key,M)){if(euI(t),r&&!g&&euw(t.currentTarget.ownerDocument)===t.currentTarget){C.current=euz(t.key,M,m)?d:y,_(C.current);return}euz(t.key,M,m)?p?C.current=l>=y?f&&l!==u.current.length?-1:d:euL(u,{startingIndex:l,disabledIndices:x}):C.current=Math.min(y,euL(u,{startingIndex:l,disabledIndices:x})):p?C.current=l<=d?f&&-1!==l?u.current.length:y:euL(u,{startingIndex:l,decrement:!0,disabledIndices:x}):C.current=Math.max(d,euL(u,{startingIndex:l,decrement:!0,disabledIndices:x})),euA(u,C.current)?_(null):_(C.current)}}return euu(()=>{l&&(!I&&r&&k.current&&null!=d&&_(d),I&&!r&&(cancelAnimationFrame(R.current),C.current=-1,O(null)))},[r,I,d,u,L,l,_,O]),euu(()=>{l&&r&&(null==s?null==d&&(I&&(C.current=-1,L(u,C)),!I&&k.current&&(null!=N.current||!0===k.current&&null==N.current)&&(C.current=null==N.current||euz(N.current,M,m)||h?euU(u,j.current):euW(u,j.current),_(C.current),L(u,C))):euA(u,s)||(C.current=s,L(u,C)))},[r,I,s,d,h,u,_,L,l,f,M,m,g,j]),euu(()=>{if(l&&!r&&I){var t,n;let i=null==w||null==(t=w.nodesRef.current.find(t=>t.id===S))||null==(n=t.context)?void 0:n.refs.floating.current;i&&!i.contains(euw(euy(i)))&&i.focus({preventScroll:!0})}},[l,r,I,w,S]),euu(()=>{N.current=null}),l?{reference:{...g&&r&&null!=s&&{"aria-activedescendant":D},onKeyDown(t){if(E.current=!0,g&&r)return P(t);if((0===t.key.indexOf("Arrow")||"Enter"===t.key||" "===t.key||""===t.key)&&(N.current=t.key),h){var n,o,a;n=t.key,euP(M,m?n===euE:n===euR,n===euj)&&(euI(t),r?(C.current=euU(u,x),_(C.current)):i(!0));return}euF(t.key,M)&&(null!=d&&(C.current=d),euI(t),!r&&b?i(!0):P(t),r&&_(C.current))}},floating:{"aria-orientation":"both"===M?void 0:M,...g&&null!=s&&{"aria-activedescendant":D},onKeyDown:P,onPointerMove(){E.current=!1}},item:{onFocus(t){let{currentTarget:n}=t,r=u.current.indexOf(n);-1!==r&&_(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&&_(r)}},onPointerLeave(){if(!E.current&&(C.current=-1,L(u,C),_(null),!g)){var t;null==(t=a.floating.current)||t.focus({preventScroll:!0})}}}}}:{}},euV=new Hv("suggestion");function eu$(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=eu$(t[n]))&&(i&&(i+=" "),i+=r);else for(n in t)t[n]&&(i&&(i+=" "),i+=n)}return i}function euK(){for(var t,n,r=0,i="";r<arguments.length;)(t=arguments[r++])&&(n=eu$(t))&&(i&&(i+=" "),i+=n);return i}let euY=eny.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",eeN(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),euq={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"},euG=()=>(++euG.i).toString();euG.i=0;let euZ=t=>{let n=euJ(t),r=[];for(let i=0;i<n.length;i++)r.push(euX(n[i]));return{key:euG(),children:r}},euQ=(t,n=[])=>({key:euG(),type:t.type,text:"text"in t?t.text:void 0,node:t,children:n}),euH=t=>euQ({type:euq.span,text:t,spans:[]}),euJ=t=>{let n=t.slice(0);for(let r=0;r<n.length;r++){let i=n[r];if(i.type===euq.listItem||i.type===euq.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===euq.listItem?n[r]={type:euq.list,items:o}:n[r]={type:euq.oList,items:o}}}return n},euX=t=>{if("text"in t)return euQ(t,eu0(t.spans,t));if("items"in t){let n=[];for(let r=0;r<t.items.length;r++)n.push(euX(t.items[r]));return euQ(t,n)}return euQ(t)},eu0=(t,n,r)=>{if(!t.length)return[euH(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,d=n.text.slice(c,l),f=[];for(let p=a;p<i.length;p++){let h=i[p];h!==u&&h.start>=u.start&&h.end<=u.end&&(f.push(h),i.splice(p,1),p--)}0===a&&c>0&&o.push(euH(n.text.slice(0,c)));let m={...u,text:d};o.push(euQ(m,eu0(f,{...n,text:d},u))),l<n.text.length&&o.push(euH(n.text.slice(l,i[a+1]?i[a+1].start-s:void 0)))}return o},eu1=(t,n)=>eu2(euZ(t).children,n),eu2=(t,n)=>{let r=[];for(let i=0;i<t.length;i++){let o=t[i],a=n(o.type,o.node,o.text,eu2(o.children,n),o.key);null!=a&&r.push(a)}return r};euq.listItem,euq.oListItem,euq.list,euq.oList;let eu4=eny.create({name:"text",group:"inline"}),eu3={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)}},eu5={fromPrismic:t=>n=>{switch(n.type){case"hyperlink":return esY.converter.fromPrismic(t)(n);case"em":return es$.converter.fromPrismic(t)(n);case"strong":return eo6.converter.fromPrismic(t)(n);default:return}},toPrismic(t,n,r){let i=es2.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}}},eu9=eu4.extend({name:"text"}),eu8={name:eu9.name,component:eu9,converter:{fromPrismic:t=>function(n,r,i=!1){let o={type:n,text:r.content.text,spans:r.content.spans||[]};return eu1([o],function(t,n=!1){return(r,i,o,a)=>{if("span"===r&&o&&o.length)return n?[t.text(o)]:eam.splitTextToNodes(t,o)(n=>t.text(n));{let u=eu5.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=eo5.children.reduce(t,(t,n)=>{let r=n.type.name===eam.name?eam.converter.toPrismic(n):n.textContent,i=r?t.text+r:t.text,o=t.text.length,a=i.length,u=n.marks.length?eo5.marks.map(n,t=>eu5.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:[...eu3.mergeOverlap(i.spans)].sort((t,n)=>t.type.localeCompare(n.type))},...r}}}};var eu6,eu7=((eu6=eu7||{}).LeftToRight="ltr",eu6.RightToLeft="rtl",eu6);let ese=KT.RichTextNodeType.rtl,est=eeZ.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()}}}),esn={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)}}},esr=euY.extend({name:"paragraph",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",eeN(this.options.HTMLAttributes,t),0]}}),esi=new eoX([KT.RichTextNodeType.paragraph],esr.name,esr,{fromPrismic:t=>function(n){var r;let i=eu8.converter.fromPrismic(t)(esr.name,n);return null==(r=t.nodes[esr.name])?void 0:r.create(esn.fromPrismic(n),i)},toPrismic:t=>eu8.converter.toPrismic(t,KT.RichTextNodeType.paragraph,esn.toPrismic(t))},"Type '/' for commands"),eso=esi,esa=["ArrowDown","ArrowUp","End","Home"],esu=["Enter"],ess=["Escape",...esa,...esu],esc=eeZ.create({name:"slash-commands",addOptions:()=>({nodeTypes:[]}),addProseMirrorPlugins(){let t=es7(es3,this.options.nodeTypes);return t.length>1?[function({pluginKey:t=euV,editor:n,char:r="@",allowSpaces:i=!1,allowedPrefixes:o=[" "],startOfLine:a=!1,decorationTag:u="span",decorationClass:s="suggestion",command:c=()=>null,items:l=()=>[],render:d=()=>({}),allow:f=()=>!0}){let p,h=null==d?void 0:d(),m=new Hm({key:t,view(){return{update:async(t,r)=>{var i,o,a,u,s,d,f;let m=null===(i=this.key)||void 0===i?void 0:i.getState(r),g=null===(o=this.key)||void 0===o?void 0:o.getState(t.state),y=m.active&&g.active&&m.range.from!==g.range.from,v=!m.active&&g.active,b=m.active&&!g.active,x=!v&&!b&&m.query!==g.query,M=v||y,T=x&&!y,S=b||y;if(!M&&!T&&!S)return;let w=S&&!M?m:g,I=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:I,clientRect:I?()=>{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},M&&(null===(a=null==h?void 0:h.onBeforeStart)||void 0===a||a.call(h,p)),T&&(null===(u=null==h?void 0:h.onBeforeUpdate)||void 0===u||u.call(h,p)),(T||M)&&(p.items=await l({editor:n,query:w.query})),S&&(null===(s=null==h?void 0:h.onExit)||void 0===s||s.call(h,p)),T&&(null===(d=null==h?void 0:h.onUpdate)||void 0===d||d.call(h,p)),M&&(null===(f=null==h?void 0:h.onStart)||void 0===f||f.call(h,p))},destroy(){var t;p&&(null===(t=null==h?void 0:h.onExit)||void 0===t||t.call(h,p))}}},state:{init:()=>({active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}),apply(t,u,s,c){let{isEditable:l}=n,{composing:d}=n.view,{selection:p}=t,{empty:h,from:m}=p,g={...u};if(g.composing=d,l&&(h||n.view.composing)){(m<u.range.from||m>u.range.to)&&!d&&!u.composing&&(g.active=!1);let y=function(t){var n,r;let{char:i,allowSpaces:o,allowedPrefixes:a,startOfLine:u,$position:s}=t,c=i.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),l=RegExp(`\\s${c}$`),d=u?"^":"",f=o?RegExp(`${d}${c}.*?(?=\\s${c}|$)`,"gm"):RegExp(`${d}(?:^)?${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(f)).pop();if(!m||void 0===m.input||void 0===m.index)return null;let g=m.input.slice(Math.max(0,m.index-1),m.index),y=RegExp(`^[${null==a?void 0:a.join("")}\0]?$`).test(g);if(null!==a&&!y)return null;let v=h+m.index,b=v+m[0].length;return o&&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&&f({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?XC.create(t.doc,[X_.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===eso.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 eia(esl,{editor:n.editor,props:n}),document.body.appendChild(t.element)},onUpdate(n){null==t||t.updateProps(n)},onKeyDown({event:n}){var r;return Boolean(ess.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()}}}})]:[]}}),esl=(0,o.forwardRef)(function({command:t,decorationNode:n,editor:r,items:i},a){var c,l,d,f,p;let[h,m]=(0,o.useState)(!0),g=parseFloat(u.TV.space[0]),{context:y,floating:b,reference:x,strategy:M,x:T,y:S}=function(t){let{open:n=!1,onOpenChange:r,whileElementsMounted:i,placement:a,middleware:u,strategy:s,nodeId:c}=void 0===t?{}:t,[l,d]=o.useState(null),f=eug(),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}),[d,f]=o.useState(i);euo(d,i)||f(i);let p=o.useRef(null),h=o.useRef(null),m=o.useRef(c),g=eua(u),y=eua(a),[b,x]=o.useState(null),[M,T]=o.useState(null),S=o.useCallback(t=>{p.current!==t&&(p.current=t,x(t))},[]),w=o.useCallback(t=>{h.current!==t&&(h.current=t,T(t))},[]),I=o.useCallback(()=>{if(!p.current||!h.current)return;let t={placement:n,strategy:r,middleware:d};y.current&&(t.platform=y.current),eur(p.current,h.current,t).then(t=>{let n={...t,isPositioned:!0};_.current&&!euo(m.current,n)&&(m.current=n,v.flushSync(()=>{l(n)}))})},[d,n,r,y]);eui(()=>{!1===s&&m.current.isPositioned&&(m.current.isPositioned=!1,l(t=>({...t,isPositioned:!1})))},[s]);let _=o.useRef(!1);eui(()=>(_.current=!0,()=>{_.current=!1}),[]),eui(()=>{if(b&&M){if(g.current)return g.current(b,M,I);I()}},[b,M,I,g]);let O=o.useMemo(()=>({reference:p,floating:h,setReference:S,setFloating:w}),[S,w]),k=o.useMemo(()=>({reference:b,floating:M}),[b,M]);return o.useMemo(()=>({...c,update:I,refs:O,elements:k,reference:S,floating:w}),[c,I,O,k,S,w])}({placement:a,middleware:u,strategy:s,whileElementsMounted:i}),y=euM(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]);euu(()=>{let t=null==f?void 0:f.nodesRef.current.find(t=>t.id===c);t&&(t.context=x)});let{reference:M}=g,T=o.useCallback(t=>{(eub(t)||null===t)&&(x.refs.domReference.current=t,d(t)),M(t)},[M,x.refs]);return o.useMemo(()=>({...g,context:x,refs:b,reference:T}),[g,b,x,T])}({middleware:[(void 0===(c=g)&&(c=0),{name:"offset",options:c,async fn(t){let{x:n,y:r}=t,i=await eaR(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:d,elements:f}=t,{mainAxis:p=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:v=!0,...b}=l,x=eax(a),M=eax(c)===c,T=await (null==d.isRTL?void 0:d.isRTL(f.floating)),S=m||(M||!v?[eaN(c)]:function(t){let n=eaN(t);return[eaE(t),n,eaE(n)]}(c));m||"none"===y||S.push(...function(t,n,r,i){let o=eav(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[]}}(eax(t),"start"===r,i);return o&&(a=a.map(t=>t+"-"+o),n&&(a=a.concat(a.map(eaE)))),a}(c,v,y,T));let w=await eaI(t,b),I=[],_=(null==(n=u.flip)?void 0:n.overflows)||[];if(p&&I.push(w[x]),h){let{main:O,cross:k}=function(t,n,r){void 0===r&&(r=!1);let i=eav(t),o=eaM(t),a=eab(o),u="x"===o?i===(r?"end":"start")?"right":"left":"start"===i?"bottom":"top";return n.reference[a]>n.floating[a]&&(u=eaN(u)),{main:u,cross:eaN(u)}}(a,s,T);I.push(w[O],w[k])}if(_=[..._,{placement:a,overflows:I}],!I.every(t=>t<=0)){let C=((null==(r=u.flip)?void 0:r.index)||0)+1,N=[c,...S][C];if(N)return{data:{index:C,overflows:_},reset:{placement:N}};let j=null==(i=_.filter(t=>t.overflows[0]<=0).sort((t,n)=>t.overflows[1]-n.overflows[1])[0])?void 0:i.placement;if(!j)switch(g){case"bestFit":{let E=null==(o=_.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];E&&(j=E);break}case"initialPlacement":j=c}if(a!==j)return{reset:{placement:j}}}return{}}}),(f={limiter:(void 0===d&&(d={}),{options:d,fn(t){let{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:u=0,mainAxis:s=!0,crossAxis:c=!0}=d,l={x:n,y:r},f=eaM(i),p=eaD(f),h=l[f],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"===f?"height":"width",b=o.reference[f]-o.floating[v]+y.mainAxis,x=o.reference[f]+o.reference[v]-y.mainAxis;h<b?h=b:h>x&&(h=x)}if(c){var M,T;let S="y"===f?"width":"height",w=["top","left"].includes(eax(i)),I=o.reference[p]-o.floating[S]+(w&&(null==(M=a.offset)?void 0:M[p])||0)+(w?0:y.crossAxis),_=o.reference[p]+o.reference[S]+(w?0:(null==(T=a.offset)?void 0:T[p])||0)-(w?y.crossAxis:0);m<I?m=I:m>_&&(m=_)}return{[f]:h,[p]:m}}})},{name:"shift",options:f,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}=f,c={x:n,y:r},l=await eaI(t,s),d=eaM(eax(i)),p=eaD(d),h=c[d],m=c[p];if(o){let g=h+l["y"===d?"top":"left"],y=h-l["y"===d?"bottom":"right"];h=eak(g,h,y)}if(a){let v=m+l["y"===p?"top":"left"],b=m-l["y"===p?"bottom":"right"];m=eak(v,m,b)}let x=u.fn({...t,[d]:h,[p]:m});return{...x,data:{x:x.x-n,y:x.y-r}}}})],onOpenChange:m,open:h,placement:"top-start",strategy:"fixed",whileElementsMounted:eun});(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,I]=(0,o.useState)(0),_=(0,o.useRef)([]);(0,s.pQ)(i,()=>{I(0),_.current=[]});let{getFloatingProps:O,getItemProps:k,getReferenceProps:N}=(p=[euC(y,{outsidePointerDown:!1}),euB(y,{activeIndex:w,listRef:_,onNavigate(t){I(n=>t??n)},openOnArrowKeyDown:!1,virtual:!0}),euO(y,{role:"menu"})],{getReferenceProps:t=>euT(t,p,"reference"),getFloatingProps:t=>euT(t,p,"floating"),getItemProps:t=>euT(t,p,"item")}),j=N().onKeyDown;(0,o.useImperativeHandle)(a,()=>({handleKeyDown(n){if(!h)return!1;if(esa.includes(n.key)&&j(n),esu.includes(n.key)){let r=i[w];void 0!==r&&t(r)}return!0}}),[w,t,i,j,h]);let E=(0,o.useId)();return h?C.jsxs("div",{...O(),className:u._s.content,ref:b,style:{top:parseFloat(u.TV.space[0]),left:parseFloat(u.TV.space[0]),minWidth:256,position:M,transform:null!==T&&null!==S?`translate3d(${Math.round(T)}px, ${Math.round(S)}px, 0)`:"translate3d(0, -200%, 0)"},children:[i.map((n,r)=>(0,o.createElement)(esd,{...k({onClick(){t(n)},onPointerDown(t){t.preventDefault()}}),"data-highlighted":r===w?"":void 0,id:`${E}[${r}]`,key:n.nodeType,ref(t){_.current[r]=t},shortcut:`/${n.shortText??""}`,startIcon:n.icon},n.text)),0===i.length?C.jsx(esd,{...k({onPointerDown(t){t.preventDefault()}}),disabled:!0,id:`${E}[0]`,ref(t){_.current[0]=t},children:"No results"}):null]}):null}),esd=(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:euK(i.props.className,u._s.itemStartIcon)}):null,C.jsx(u.xv,{className:euK(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]})}),esf=ean.extend({name:"bulletList",parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:t}){return["ul",eeN(this.options.HTMLAttributes,t),0]}}).configure({itemTypeName:"listItem"}),esp=new eo2([KT.RichTextNodeType.list],esf.name,esf,{fromPrismic:t=>function(n){var r;let i=eaa.converter.fromPrismic(t)(n);if(i)return null==(r=t.nodes[esf.name])?void 0:r.create(esn.fromPrismic(n),i)},toPrismic:t=>eo5.children.map(t,t=>eaa.converter.toPrismic(t,KT.RichTextNodeType.list).filter(l.$)).flat()}),esh=esp,esm=/^```([a-z]+)?[\s\n]$/,esg=/^~~~([a-z]+)?[\s\n]$/,esy=eny.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",eeN(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[enh({find:esm,type:this.type,getAttributes:t=>({language:t[1]})}),enh({find:esg,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Hm({key:new Hv("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(Ht.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}}})]}}),esv=esy.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",eeN(this.options.HTMLAttributes),["code",t,0]]}}).configure({exitOnTripleEnter:!1}),esb=new eoX([KT.RichTextNodeType.preformatted],esv.name,esv,{fromPrismic:t=>function(n){var r;let i=eu8.converter.fromPrismic(t)(esv.name,n,!0);return null==(r=t.nodes[esv.name])?void 0:r.create(esn.fromPrismic(n),i)},toPrismic:t=>eu8.converter.toPrismic(t,KT.RichTextNodeType.preformatted,esn.toPrismic(t))},"",!0);function esx(t){let{editor:n,getPos:r,node:i}=t,[a,u]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{function t(){let{from:t,to:o}=n.state.selection,a=r(),s=r()+i.nodeSize;u(t<=a&&o>=s)}function o(){u(!1)}return n.on("blur",o),n.on("selectionUpdate",t),()=>{n.off("blur",o),n.off("selectionUpdate",t)}},[n,r,i.nodeSize]),{selected:a}}function esM(t){let n=(0,o.useRef)(null),r=(0,o.useRef)(null),{onKeyDown:i,url:a,urlChanged:c,onContentChange:l,debouncedUrl:d,content:f}=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:d}=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&&eic(()=>{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:d,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}=esx(t);return C.jsx(eio,{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(eil,{selected:h,debouncedUrl:d,onContentChange:l,content:f})]})})})}let esT=eny.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:()=>eis(esM)}),esS=new class{constructor(t,n,r,i){T(this,"extType","node"),T(this,"nodeType","embed"),this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}([KT.RichTextNodeType.embed],esT.name,esT,{fromPrismic:t=>function(n){var r;return null==(r=t.nodes[esT.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}}}),esw=eny.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]}`,eeN(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=>enh({find:RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),esI="heading";function es_(t){switch(t){case 1:return KT.RichTextNodeType.heading1;case 2:return KT.RichTextNodeType.heading2;case 3:return KT.RichTextNodeType.heading3;case 4:return KT.RichTextNodeType.heading4;case 5:return KT.RichTextNodeType.heading5;case 6:return KT.RichTextNodeType.heading6}}function esO(t){return{fullName:es_(t),level:t}}let esk=[1,2,3,4,5,6];function esC(t,n=esk){let r=RegExp(`^heading([${n.join(",")}]){1}$`),i=t.match(r);if(!i||!i[1])return;let o=parseInt(i[1]);return{fullName:es_(o),level:o}}function esN(t,n){let r=t.level;if(n.includes(r))return{fullName:es_(r),level:r}}let esj=t=>{let n=t[0]??1;return{fromPrismic:r=>function(i){var o;let a=eu8.converter.fromPrismic(r)(esI,i),u=esC(i.type,t)||esO(n);return null==(o=r.nodes[esI])?void 0:o.create({level:u.level,...esn.fromPrismic(i)},a)},toPrismic(r){let{fullName:i}=esN(r.attrs,t)||esO(n);return eu8.converter.toPrismic(r,i,esn.toPrismic(r))}}},esE={name:esI,build(t){var n,r;let i=t?t.size?Array.from(t.values()).reduce((t,n)=>{let r=esC(n);return r?[...t,r.level]:t},[]).sort((t,n)=>t-n):[]:esk;if(!i)return;let o=i.map(t=>es_(t));return new eo1(o,esw.extend({name:"heading"}).configure({levels:i}),i,esj(i),t=>{let n=esN(t,i);return n&&`Heading ${n.level}`})}};function esR(t){let{node:n}=t,r=n.attrs.content,{selected:i}=esx(t),a={width:null==r?void 0:r.width,height:null==r?void 0:r.height,name:eiM},{onMediaSelected:s,onCropperDialogClose:c,isUpdating:l,updateContent:d,onClear:f}=function(t){let{content:n,thumbnail:r,imageViewProps:{getPos:i,updateAttributes:a,editor:u,node:s}}=t,[c,l]=(0,o.useTransition)();function d(t){l(()=>a({content:t}))}return{onMediaSelected:function(t){let r=ei8(t),o=i()+s.nodeSize;d({__TYPE__:"ImageContent",...n,...r}),u.chain().focus(o+1).run()},onCropperDialogClose:function({croppedImages:t}){if(!n)return;let i=t[r.name];if(!i)return;let o=ei0({content:n,thumbnail:r.name,croppedImage:i});o!==n&&d(o)},isUpdating:c,updateContent:d,onClear:function(){let t=i(),n=i()+s.nodeSize;u.chain().deleteRange({from:t,to:n}).focus(n).run()}}}({content:r,thumbnail:a,imageViewProps:t}),p=(null==r?void 0:r.width)===0&&(null==r?void 0:r.height)===0,h=r&&!p?[`${r.width}x${r.height}px`]:[],m=(null==r?void 0:r.alt)??"",g={thumbnail:a,contentView:r,labels:eiT(a,r,r)};return C.jsx(eio,{className:"custom-image",children:C.jsx("div",{contentEditable:"false",suppressContentEditableWarning:!0,children:C.jsx(ei9,{content:r,selected:i,fieldLabel:"Feature image",imageLabel:h,initialImages:[g],readOnly:!1,onMediaSelected:s,onCropperDialogClose:c,onClear:f,children:C.jsx(o.Suspense,{fallback:esD,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:eiI(r.url),alt:m,sizing:"contain"})})})}),C.jsx(eiJ,{onValueChange(t){d({...r,alt:t})},altText:m,readOnly:!r,selected:i})]}):C.jsx(eiH,{isUpdating:l,readOnly:!1,onMediaSelected:s})})})})})}let esD=C.jsx("div",{style:{height:468}}),esA=eny.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",eeN(t)],addNodeView:()=>eis(esR)}),esL=new class{constructor(t,n,r,i){T(this,"extType","node"),T(this,"nodeType","image"),this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}([KT.RichTextNodeType.image],esA.name,esA,{fromPrismic:t=>function(n){var r;return null==(r=t.nodes[esA.name])?void 0:r.create({content:n.data})},toPrismic(t){if(void 0!==t.attrs.content)return{type:"image",data:{...t.attrs.content}}}}),esP=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,esF=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,esz=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,esU=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,esW=eng.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",eeN(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[enp({find:esP,type:this.type}),enp({find:esz,type:this.type})]},addPasteRules(){return[enb({find:esF,type:this.type}),enb({find:esU,type:this.type})]}}),esB=esW.extend({name:"em"}),esV=new class{constructor(t,n,r){T(this,"extType",eoH.Mark),T(this,"richTextNodeTypes",KT.RichTextNodeType.em),this.name=t,this.component=n,this.converter=r}}(esB.name,esB,{fromPrismic:t=>function(){var n;return null==(n=t.marks[esB.name])?void 0:n.create()},toPrismic(){}}),es$=esV,esK=eng.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",eeN(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=esq(eox({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()}}}),esY=new class{constructor(t,n,r){T(this,"extType",eoH.Mark),T(this,"richTextNodeTypes",KT.RichTextNodeType.hyperlink),this.name=t,this.component=n,this.converter=r}}(esK.name,esK,{fromPrismic:t=>function(n){var r,i,o,a;let u=n.data;if("DocumentLink"===u.__TYPE__){let s={type:esK.name,id:u.id};return null==(r=t.marks[esK.name])?void 0:r.create(s)}if("ImageLink"===u.__TYPE__){let c={type:esK.name,media:esq(u)};return null==(i=t.marks[esK.name])?void 0:i.create(c)}if("FileLink"===u.__TYPE__){let l={type:esK.name,media:esq(u)};return null==(o=t.marks[esK.name])?void 0:o.create(l)}if("ExternalLink"===u.__TYPE__){let d={type:esK.name,url:u.url,href:u.url,target:u.target};return null==(a=t.marks[esK.name])?void 0:a.create(d)}},toPrismic:t=>t.attrs.media?esG(t.attrs.media):t.attrs.id?{__TYPE__:"DocumentLink",id:t.attrs.id}:{__TYPE__:"ExternalLink",url:t.attrs.href,target:t.attrs.target}});function esq(t){return JSON.stringify(t)}function esG(t){return JSON.parse(t)}let esZ=eny.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",eeN(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)}}}),esQ=eng.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",eeN(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:n})=>{let r=etB(t,this.type);return!!Object.entries(r).some(([,t])=>!!t)||n.unsetMark(this.name)}}}}),esH=/^(\d+)\.\s$/,esJ=eny.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",eeN(this.options.HTMLAttributes,r),0]:["ol",eeN(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(esZ.name,this.editor.getAttributes(esQ.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=enm({find:esH,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=enm({find:esH,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(esQ.name)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[t]}}),esX=esJ.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",eeN(this.options.HTMLAttributes,r),0]:["ol",eeN(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"}),es0=new eo2([KT.RichTextNodeType.orderedList],esX.name,esX,{fromPrismic:t=>function(n){var r;let i=eaa.converter.fromPrismic(t)(n);if(i)return null==(r=t.nodes[esX.name])?void 0:r.create(esn.fromPrismic(n),i)},toPrismic:t=>eo5.children.map(t,t=>eaa.converter.toPrismic(t,KT.RichTextNodeType.orderedList).filter(l.$)).flat()}),es1=es0,es2=[eo6,es$,esY];function es4(t){return[eso,esh,es1,esE.build(t),esb,esS,esL,...es2].filter(l.$)}let es3=[{nodeType:KT.RichTextNodeType.paragraph,icon:"textFields",isActive:t=>t.isActive(eso.name)&&!t.isActive(esh.name)&&!t.isActive(es1.name),runCommands:es8((t,n)=>t.clearNodes().setDirection(es6(n))),shortText:"par",text:"Paragraph"},{nodeType:KT.RichTextNodeType.heading1,icon:"looks1",isActive:t=>t.isActive(esE.name,{level:1}),runCommands:es8((t,n)=>t.setHeading({level:1}).setDirection(es6(n))),shortText:"h1",text:"Heading 1"},{nodeType:KT.RichTextNodeType.heading2,icon:"looks2",isActive:t=>t.isActive(esE.name,{level:2}),runCommands:es8((t,n)=>t.setHeading({level:2}).setDirection(es6(n))),shortText:"h2",text:"Heading 2"},{nodeType:KT.RichTextNodeType.heading3,icon:"looks3",isActive:t=>t.isActive(esE.name,{level:3}),runCommands:es8((t,n)=>t.setHeading({level:3}).setDirection(es6(n))),shortText:"h3",text:"Heading 3"},{nodeType:KT.RichTextNodeType.heading4,icon:"looks4",isActive:t=>t.isActive(esE.name,{level:4}),runCommands:es8((t,n)=>t.setHeading({level:4}).setDirection(es6(n))),shortText:"h4",text:"Heading 4"},{nodeType:KT.RichTextNodeType.heading5,icon:"looks5",isActive:t=>t.isActive(esE.name,{level:5}),runCommands:es8((t,n)=>t.setHeading({level:5}).setDirection(es6(n))),shortText:"h5",text:"Heading 5"},{nodeType:KT.RichTextNodeType.heading6,icon:"looks6",isActive:t=>t.isActive(esE.name,{level:6}),runCommands:es8((t,n)=>t.setHeading({level:6}).setDirection(es6(n))),shortText:"h6",text:"Heading 6"},{nodeType:KT.RichTextNodeType.list,icon:"formatListBulleted",isActive:t=>t.isActive(esh.name),runCommands:es8((t,n)=>t.toggleBulletList().setDirection(es6(n))),shortText:"bull",text:"Bulleted list"},{nodeType:KT.RichTextNodeType.orderedList,icon:"formatListNumbered",isActive:t=>t.isActive(es1.name),runCommands:es8((t,n)=>t.toggleOrderedList().setDirection(es6(n))),shortText:"num",text:"Numbered list"},{nodeType:KT.RichTextNodeType.preformatted,icon:"dataObject",isActive:t=>t.isActive(esb.name),runCommands:es8((t,n)=>t.setCodeBlock().setDirection(es6(n))),shortText:"code",text:"Code"},{nodeType:KT.RichTextNodeType.embed,icon:"cloud",isActive:t=>t.isActive(esS.name),runCommands:es8(t=>t.setEmbed()),shortText:"emb",text:"Embed"},{nodeType:KT.RichTextNodeType.image,icon:"image",isActive:t=>t.isActive(esL.name),runCommands:es8(t=>t.setImage()),shortText:"img",text:"Image"}],es5=[{nodeType:KT.RichTextNodeType.strong,icon:"formatBold",isActive:t=>t.isActive(eo6.name),runCommands:es8(t=>t.toggleBold())},{nodeType:KT.RichTextNodeType.em,icon:"formatItalic",isActive:t=>t.isActive(es$.name),runCommands:es8(t=>t.toggleItalic())}],es9=[{nodeType:KT.RichTextNodeType.rtl,icon:"formatTextDirectionRToL",isActive:t=>t.isActive({dir:eu7.RightToLeft}),runCommands:es8((t,n)=>t.toggleDirection(es6(n)))}];function es8(t){return(n,r={})=>{let i=!0===r.can?n.can().chain():n.chain().focus();return void 0!==r.deleteRange&&(i=i.deleteRange(r.deleteRange)),r.can?function(t,n,r){try{return r(n,t).run()}catch{return!1}}(n,i,t):t(i,n).run()}}function es6(t){let n=t.state.selection.$from.parent.attrs;return esn.parseNodeAttrsDirection(n)}function es7(t,n){return t.filter(t=>n.includes(t.nodeType))}function ece(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 ect(t){let{disabled:n,showWebLinkModal:r,showDocumentsLinkModal:i,showMediaLinkModal:o}=function(t){let{editor:n,setModal:r}=t;return{disabled:!es8(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:n,startIcon:"link",onClick:r},KT.RichTextNodeType.hyperlink),C.jsxs(u.h_,{children:[C.jsx(u.$F,{children:C.jsx(u.hA,{startIcon:"arrowDropDown"})}),C.jsxs(u.AW,{align:"end",asPortal:!1,children:[C.jsx(u.Xi,{startIcon:C.jsx(u.I5,{name:"public"}),onSelect:r,children:"Link to web page"}),C.jsx(u.Xi,{startIcon:C.jsx(u.I5,{name:"description"}),onSelect:i,children:"Link to document"}),C.jsx(u.Xi,{startIcon:C.jsx(u.I5,{name:"image"}),onSelect:o,children:"Link to media"})]})]})]})]})}function ecn(t){let{docId:n,onEdit:r,onUnlink:i}=t,o=function(t){let n=tk();n.searchDocuments||tN("searchDocuments");let{coreApiUrl:r,env:i}=n;return(0,f.QT)(g.EK,[r,i,t])}(n),a=tk();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)??"",d=(null==s?void 0:s.custom_type_label)??"";return C.jsx(u.oZ,{url:c,title:o.title,subTitle:d,description:l,onEdit:r,onUnlink:i,largeIconName:"description"})}function ecr(t){let{editor:n}=t,{searchDocuments:r}=tk(),i=n.getAttributes(KT.RichTextNodeType.hyperlink);if(i.id&&r){let o=i.id;return C.jsx(eci,{docId:o,...t})}if(i.href){let a=i.href;return C.jsx(eco,{url:a,...t})}if(i.media){let u=esG(i.media);return C.jsx(eca,{media:u,...t})}return null}function eci(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:()=>ecu(n)}),children:C.jsx(o.Suspense,{fallback:C.jsx(u.oZ,{url:"",title:"",subTitle:"",loading:!0,onEdit:r,onUnlink:()=>ecu(n)}),children:C.jsx(ecn,{docId:i,onEdit:r,onUnlink:()=>ecu(n)})})})}function eco(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:()=>ecu(r)}):C.jsx(u.oZ,{url:n,title:"",subTitle:n,onEdit:i,onUnlink:()=>ecu(r)})}function eca(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:()=>ecu(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:()=>ecu(r),largeIconName:"insertDriveFile"}):null}function ecu(t){es8(t=>t.unsetLink())(t)}function ecs(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){es8(n=>n.extendMarkRange(KT.RichTextNodeType.hyperlink).setDocumentLink({id:t}))(n),r(!1)},onOpenChange:i}}(t);return C.jsx(eol,{open:n,onOpenChange:r,onSelectDocument:i})}function ecc(t){let{open:n}=t,{onOpenChange:r,onMediaSelected:i}=function(t){let{editor:n,setOpen:r}=t;return{onMediaSelected:function(t){es8(n=>n.extendMarkRange(KT.RichTextNodeType.hyperlink).setMediaLink({media:t}))(n),r(!1)},onOpenChange:r}}(t);return eiL()?C.jsx(eiA,{open:n,setIsOpen:r,onMediaSelected:i,assetType:"all"}):C.jsx(eiZ,{open:n,onOpenChange:r,onMediaSelected:i})}function ecl(t){let{open:n}=t,{url:r,setUrl:i,onOpenChange:a,onKeyDown:s,openInNewTab:c,setOpenInNewTab:l,onSetUrl:d,selectionUrl:f,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(KT.RichTextNodeType.hyperlink);return n.href?n.href:void 0}(r),d=(n=r,"_blank"===n.getAttributes(KT.RichTextNodeType.hyperlink).target);(0,o.useEffect)(()=>{u(l??"")},[l]),(0,o.useEffect)(()=>{c(d??!1)},[d]);let f=l?(0,p.ju)(l):void 0,h=f?(0,p.S$)(f):"";function m(t){let n=s?"_blank":"_self";es8(r=>r.extendMarkRange(KT.RichTextNodeType.hyperlink).setWebLink({href:t,target:n}))(r),i(!1)}return{url:a,setUrl:u,onSetUrl:m,selectionUrl:l,selectionUrlTitle:h,openInNewTab:s,selectionOpenInNewTab:d,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}),f&&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:()=>d(r),icon:"link",textContent:"Link to URL"})]})]})})})}function ecd(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 ecf(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 ecp={duration:100,hideOnClick:!0,offset:[-48,8],placement:"top-start",zIndex:30};function ech(t){let{editor:n,nodeTypes:r}=t,[i,a]=(0,o.useState)(),u=r.includes(KT.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(KT.RichTextNodeType.preformatted)||s.empty||0===u.textBetween(o,a).length)},shouldShowLinkPopover:function(t){let{view:n,state:r,from:i,to:o}=t,a=n.state.doc.nodeAt(i),{doc:u,selection:s}=r;return!!s.empty&&!(u.textBetween(i,o).length>0)&&!!(null!=a&&a.marks.some(t=>"hyperlink"===t.type.name))}}}({editor:n});return C.jsxs(C.Fragment,{children:[C.jsx(er6,{editor:n,tippyOptions:ecp,shouldShow:c,children:s&&C.jsx(ecm,{...t,setModal:a})}),C.jsx(er6,{editor:n,tippyOptions:ecp,shouldShow:l,children:s&&C.jsx(ecr,{editor:n,onEditWebLink:()=>a("webLink"),onEditDocumentLink:()=>a("documentLink"),onEditMediaLink:()=>a("mediaLink")})}),u&&C.jsxs(C.Fragment,{children:[C.jsx(ecl,{open:"webLink"===i,setOpen:function(t){a(t?"webLink":void 0)},editor:n}),C.jsx(ecs,{open:"documentLink"===i,setOpen:function(t){a(t?"documentLink":void 0)},editor:n}),C.jsx(ecc,{open:"mediaLink"===i,setOpen:function(t){a(t?"mediaLink":void 0)},editor:n})]})]})}function ecm(t){let{editor:n,nodeTypes:r}=t,i=r.includes("hyperlink"),o=es7(es3,r),a=es7(es5,r),s=es7(es9,r),c=o.length+a.length+s.length+Number(i);return 0===c?null:C.jsxs(u.o8,{children:[C.jsx(ecf,{items:o,editor:n}),C.jsx(ecd,{items:a,editor:n}),i&&C.jsx(ect,{...t}),C.jsx(ece,{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 ecg(t){var n;let{content:r,field:i,id:a,readOnly:c}=t,d=function(t){var n,r;let i=`${null==(n=t.config)?void 0:n.multi}-${null==(r=t.config)?void 0:r.single}`;return(0,o.useMemo)(()=>{let{extensions:n,defaultTextConverter:r}=function(t){var n;if(!t||!(null!=t&&t.single)&&!(null!=t&&t.multi))return eo9();let r=function(t){let n=(t.single||t.multi||"").split(/\s*,\s*/).map(t=>{let n=KT.RichTextNodeTypeCodec.decode(t);return"Right"===n._tag?n.right:void 0}).filter(l.$);return new Set(n)}(t);if(!(null!=r&&r.size))return eo9();let i=(n=r,es4(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,eo4)&&n.add(eso),(0,y.G)(n,eo0)||n.add(eso),[...n]}(i);return{extensions:o,defaultTextConverter:function(t){let n=t.find(eo0)??eso;return function(t){return r=>n.converter.fromPrismic(t)({...r,type:n.richTextNodeTypes[0]??"heading1"})}}(o)}}(t.config),i=n.filter(ecy),o=n.flatMap(t=>t.richTextNodeTypes),a=n.map(t=>t.component),u=n.filter(ecv).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===eoJ.Text&&(t[n.name]=n.placeholder),t),{})),unfocusedPlaceholder:null==(r=t.config)?void 0:r.placeholder,nodeExtensions:n},s=a.includes(KT.RichTextNodeType.orderedList)||a.includes(KT.RichTextNodeType.list);return[eal.component((null==(i=t.config)?void 0:i.single)===void 0),eu8.component,eam.component,eay(u),s?eaa.component:void 0,esc.configure({nodeTypes:a})].filter(l.$)}(t,i),est.configure({supportedExtensionNames:u}),eoV],c=s.map(t=>t.name),d=function(t,n){let r=eeY.resolve(t);return eeL(r,void 0)}(s);return{allComponents:s,extensionNames:c,defaultTextConverter:r,nodeExtensions:i,names:o,schema:d}},[i])}(i),f=r&&eal.converter(d.nodeExtensions).fromPrismic(d.schema,null==(n=d.defaultTextConverter)?void 0:n.call(d,d.schema))(r),p=(0,s.R9)(t.onContentChange),h=function(t={},n=[]){let{onUpdate:r}=t,[i,a]=(0,o.useState)(),u=(0,o.useRef)(r),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 er7(t);return a(r),r.on("transaction",()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{n&&c()})})}),()=>{n=!1}},n),(0,o.useEffect)(()=>()=>{null==i||i.destroy()},[i]),i}({content:null==f?void 0:f.toJSON(),editable:!c,editorProps:{attributes:{class:u.rk,id:a,tabIndex:"0"}},extensions:d.allComponents,injectCSS:!1,onUpdate({editor:t}){if(t.isEmpty)return p(void 0);let n=eal.converter(d.nodeExtensions).toPrismic(t.state.doc);p(n)}},[d,c]);return C.jsxs(u.gN,{children:[C.jsx(u.Qy,{htmlFor:a,children:ZI(i)}),C.jsxs(u.JO,{children:[C.jsx(ein,{editor:h??null,style:{flex:1}}),(null==h?void 0:h.isEditable)&&C.jsx(ech,{editor:h,nodeTypes:d.names.concat(ese)})]})]})}function ecy(t){return t.extType===eoH.Node}function ecv(t){return!(t.extType!==eoH.Node||t.nodeType!==eoJ.Text||t.lockedFormat)}function ecb(t){var n,r,i,o,a;let{content:s,field:c,id:l,onContentChange:d,readOnly:f}=t,p=Z_(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:ZI(c)}),C.jsx(u.JO,{children:C.jsx(u.Ph,{id:l,size:"large",color:"grey",value:m,renderTrigger:()=>C.jsx(u.JF,{id:l,placeholder:p}),onValueChange(t){var n;f||d((n=t,0===n.length?void 0:{__TYPE__:"FieldContent",type:"Select",value:n}))},children:null==(r=null==(n=c.config)?void 0:n.options)?void 0:r.map(t=>C.jsx(u.Ql,{value:t,children:t},t))})})]})}function ecx(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:ZI(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,disabled:r,value:s,onValueChange:t=>a(function(t){if(t)return{__TYPE__:"FieldContent",type:"Timestamp",value:function(t){let n=`${t.getUTCFullYear()}`.padStart(4,"0"),r=`${t.getUTCMonth()+1}`.padStart(2,"0"),i=`${t.getUTCDate()}`.padStart(2,"0"),o=`${t.getUTCHours()}`.padStart(2,"0"),a=`${t.getUTCMinutes()}`.padStart(2,"0");return`${n}-${r}-${i}T${o}:${a}:00+00:00`}(t)}}(t))})})})]})}function ecM(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(ZO,{...t,field:a,content:nI.isBooleanContent(i)?i:void 0}):"Date"===a.type?C.jsx(ZC,{...t,field:a,content:nI.isDateContent(i)?i:void 0}):"Timestamp"===a.type?C.jsx(ecx,{...t,field:a,content:nI.isTimestampContent(i)?i:void 0}):"Image"===a.type?C.jsx(ei6,{...t,field:a,content:nI.isImageContent(i)?i:void 0}):"Link"===a.type?C.jsx(eoM,{...t,field:a,content:nI.isLinkContent(i)?i:void 0}):"Number"===a.type?C.jsx(eoI,{...t,field:a,content:nI.isNumberContent(i)?i:void 0}):"StructuredText"===a.type?C.jsx(ecg,{...t,field:a,content:nI.isRichTextContent(i)?i:void 0}):"Select"===a.type?C.jsx(ecb,{...t,field:a,content:nI.isSelectContent(i)?i:void 0}):"Text"===a.type?C.jsx(eoe,{...t,field:a,content:nI.isTextContent(i)?i:void 0}):"Embed"===a.type?C.jsx(eim,{...t,field:a,content:nI.isEmbedContent(i)?i:void 0}):"Color"===a.type?C.jsx(Zk,{...t,field:a,content:nI.isColorContent(i)?i:void 0}):"GeoPoint"===a.type?C.jsx(eix,{...t,field:a,content:nI.isGeoPointContent(i)?i:void 0}):null},[i,n,a,u,r])}function ecT(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(ecM,{id:`${r}.${t}`,readOnly:s,nestableWidget:i,content:nI.isNestableContent(o)?o:void 0,onContentChange(r){var i,o,s;u((i=n,o=t,s=r,s?{...i,[o]:s}:(0,a.ud)(i,o)))}},t)})})}function ecS(t){let{id:n,title:r,content:i,onContentChange:a,readOnly:s,repeatable:c=!0,repeatableZone:l}=t,d=(0,o.useMemo)(()=>Object.entries(l),[l]),f=i??[ecw];!c&&f.length>1&&(f=f.slice(0,1));let p=(0,o.useRef)(new Map);function m(t){return p.current.get(t)??"!bugged!"}function g(t){let{index:n,offset:r}=t;a((0,h.pB)(f,n,n+r))}function y(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)})}(p.current,f),0===Object.keys(l).length?null:C.jsx(u.ZA,{title:"Repeatable zone"+(r?` • ${r}`:""),addItemButtonTitle:"Add item in group",items:f,maxItems:c?void 0:1,getItemKey:m,onAddItem:function(){a(f.concat(ecI()))},children(t,r){let i=new Map(t.value),o=m(t);return C.jsx(u.MN,{index:r,title:"Item",onMove:g,onDelete:y,children:d.map(([u,c])=>{let l=i.get(u),d=nI.isNestableContent(l)?l:void 0;return C.jsx(ecM,{id:`${n}[${o}].${u}`,content:d,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 ecI(o)}let a=Array.from(new Map(t.value).set(r,i));return ecI(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)})(p.current,t,o),a(u)})(t,r,u,n),readOnly:s},u)})})}})}let ecw={__TYPE__:"GroupItemContent",value:[]};function ecI(t=[]){return{__TYPE__:"GroupItemContent",value:t}}function ec_(t){var n,r,i,a;let{config:s,content:c,sliceKey:l,readOnly:d=!1,sharedSlice:f,onContentChange:p,...h}=t,m=(n=f,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:d},{selected:v,selectionId:b,selection:x}=function(t){let{sliceKey:n}=t||{},r=(0,o.useContext)(Zw),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}),M=()=>{l&&x.update("sliceFieldSet",l)};return void 0===m?null:C.jsx(tO.Provider,{value:s,children:C.jsxs(u.C3,{id:b,selected:v,onFocus:M,children:[C.jsx(u.ax,{children:(i=f,a=m,[i.name,a.name].join(" • "))}),C.jsxs(u.En,{heightEstimate:400,box:{gap:u.jM},children:[C.jsx(ecT,{...y,nonRepeatableZone:m.primary??{},content:c.primary,onContentChange(t){p({...c,primary:t})}}),C.jsx(ecS,{...y,repeatableZone:m.items??{},content:c.items,onContentChange(t){p({...c,items:t})}})]})]})})}(0,o.createContext)({editedUID:!1,onEditUID(){}})}}]);
|