# elementor/4.3.2/assets/js/packages/editor-controls/editor-controls.js

Elementor Website Builder – more than just a page builder, version 4.3.2. 36,022 lines.

- Page: https://pluginprobe.com/plugins/elementor/4.3.2/code/assets/js/packages/editor-controls/editor-controls.js
- Raw: https://pluginprobe.com/plugins/elementor/4.3.2/raw/assets/js/packages/editor-controls/editor-controls.js
- Modified: 2026-09-17T09:04:38+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/elementor/4.3.2/code/assets/js/packages/editor-controls/editor-controls.js#L10-L20`.

````javascript
(function(react, _elementor_editor_props, _elementor_ui, _wordpress_i18n, _elementor_utils, _elementor_query, _elementor_http_client, _elementor_icons, _elementor_wp_media, _elementor_editor_ui, react_dom, _elementor_editor_responsive, _elementor_locations, _elementor_editor_elements, _elementor_editor_v1_adapters, _elementor_session, _elementor_editor_current_user, _elementor_env, _elementor_events, _elementor_schema) {

//#region \0rolldown/runtime.js
	var __create = Object.create;
	var __defProp$2 = Object.defineProperty;
	var __name = (target, value) => __defProp$2(target, "name", {
		value,
		configurable: true
	});
	var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
	var __getOwnPropNames = Object.getOwnPropertyNames;
	var __getProtoOf = Object.getPrototypeOf;
	var __hasOwnProp = Object.prototype.hasOwnProperty;
	var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
	var __exportAll = (all, no_symbols) => {
		let target = {};
		for (var name in all) {
			__defProp$2(target, name, {
				get: all[name],
				enumerable: true
			});
		}
		if (!no_symbols) {
			__defProp$2(target, Symbol.toStringTag, { value: "Module" });
		}
		return target;
	};
	var __copyProps = (to, from, except, desc) => {
		if (from && typeof from === "object" || typeof from === "function") {
			for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
				key = keys[i];
				if (!__hasOwnProp.call(to, key) && key !== except) {
					__defProp$2(to, key, {
						get: ((k) => from[k]).bind(null, key),
						enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
					});
				}
			}
		}
		return to;
	};
	var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp$2(target, "default", {
		value: mod,
		enumerable: true
	}) : target, mod));

//#endregion
let react$1 = __toESM(react, 1);
react = __toESM(react);
_elementor_icons = __toESM(_elementor_icons);
let react_dom$1 = __toESM(react_dom, 1);
react_dom = __toESM(react_dom);

//#region packages/packages/libs/editor-controls/src/bound-prop-context/errors.ts
	var MissingPropTypeError = (0, _elementor_utils.createError)({
		code: "missing_prop_provider_prop_type",
		message: "Prop type is missing"
	});
	var UnsupportedParentError = (0, _elementor_utils.createError)({
		code: "unsupported_prop_provider_prop_type",
		message: "Parent prop type is not supported"
	});
	var HookOutsideProviderError = (0, _elementor_utils.createError)({
		code: "hook_outside_provider",
		message: "Hook used outside of provider"
	});

//#endregion
//#region packages/packages/libs/editor-controls/src/bound-prop-context/prop-context.tsx
	var PropContext = (0, react.createContext)(null);
	var PropProvider = ({ children, value, setValue, propType, placeholder, baseValue, isDisabled }) => {
		return /* @__PURE__ */ react.createElement(PropContext.Provider, { value: {
			value,
			propType,
			setValue,
			placeholder,
			baseValue,
			isDisabled
		} }, children);
	};
	var usePropContext = () => {
		const context = (0, react.useContext)(PropContext);
		if (!context) throw new HookOutsideProviderError({ context: {
			hook: "usePropContext",
			provider: "PropProvider"
		} });
		return context;
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/bound-prop-context/prop-key-context.tsx
	var PropKeyContext = (0, react.createContext)(null);
	var PropKeyProvider = ({ children, bind }) => {
		const { propType } = usePropContext();
		if (!propType) throw new MissingPropTypeError({ context: { bind } });
		if (propType.kind === "array") return /* @__PURE__ */ react.createElement(ArrayPropKeyProvider, { bind }, children);
		if (propType.kind === "object") return /* @__PURE__ */ react.createElement(ObjectPropKeyProvider, { bind }, children);
		throw new UnsupportedParentError({ context: { propType } });
	};
	var ObjectPropKeyProvider = ({ children, bind }) => {
		const context = usePropContext();
		const { path } = (0, react.useContext)(PropKeyContext) ?? {};
		const setValue = (value2, options, meta) => {
			const newValue = {
				...context.value ?? context.baseValue,
				[bind]: value2
			};
			return context?.setValue(newValue, options, {
				...meta,
				bind
			});
		};
		const value = context.value?.[bind];
		const placeholder = context.placeholder?.[bind];
		const baseValue = context.baseValue?.[bind];
		const propType = context.propType.shape[bind];
		return /* @__PURE__ */ react.createElement(PropKeyContext.Provider, { value: {
			...context,
			value,
			setValue,
			placeholder,
			baseValue,
			bind,
			propType,
			path: [...path ?? [], bind]
		} }, children);
	};
	var ArrayPropKeyProvider = ({ children, bind }) => {
		const context = usePropContext();
		const { path } = (0, react.useContext)(PropKeyContext) ?? {};
		const setValue = (value2, options) => {
			const newValue = [...context.value ?? context.baseValue ?? []];
			newValue[Number(bind)] = value2;
			return context?.setValue(newValue, options, { bind });
		};
		const value = context.value?.[Number(bind)];
		const placeholder = context.placeholder?.[Number(bind)];
		const baseValue = context.baseValue?.[Number(bind)];
		const propType = context.propType.item_prop_type;
		return /* @__PURE__ */ react.createElement(PropKeyContext.Provider, { value: {
			...context,
			value,
			setValue,
			bind,
			propType,
			path: [...path ?? [], bind],
			placeholder: placeholder ?? void 0,
			baseValue: baseValue ?? void 0
		} }, children);
	};
	var usePropKeyContext = () => {
		const context = (0, react.useContext)(PropKeyContext);
		if (!context) throw new HookOutsideProviderError({ context: {
			hook: "usePropKeyContext",
			provider: "PropKeyProvider"
		} });
		return context;
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/bound-prop-context/use-bound-prop.ts
	function useBoundProp(propTypeUtil) {
		const propKeyContext = usePropKeyContext();
		const { isValid, validate, restoreValue } = useValidation(propKeyContext.propType);
		const disabled = propKeyContext.isDisabled?.(propKeyContext.propType);
		const resetValue = () => {
			propKeyContext.setValue(propKeyContext.propType.initial_value ?? null);
		};
		if (!propTypeUtil) return {
			...propKeyContext,
			disabled,
			resetValue
		};
		function setValue(value2, options, meta) {
			if (!validate(value2, meta?.validation)) return;
			if (value2 === null) return propKeyContext?.setValue(null, options, meta);
			return propKeyContext?.setValue(propTypeUtil?.create(value2, options), {}, meta);
		}
		const propType = resolveUnionPropType(propKeyContext.propType, propTypeUtil.key);
		const fallbackValue = propKeyContext.baseValue !== void 0 && propKeyContext.baseValue !== null ? null : propType.default;
		const value = propTypeUtil.extract(propKeyContext.value ?? fallbackValue ?? null);
		const baseValue = propTypeUtil.extract(propKeyContext.baseValue ?? null);
		const placeholder = propTypeUtil.extract(propKeyContext.placeholder ?? propKeyContext.baseValue ?? null);
		return {
			...propKeyContext,
			propType,
			setValue,
			value: isValid ? value : null,
			restoreValue,
			placeholder,
			baseValue,
			disabled,
			resetValue
		};
	}
	var useValidation = (propType) => {
		const [isValid, setIsValid] = (0, react.useState)(true);
		const validate = (value, validation) => {
			let valid = true;
			if (propType.settings.required && value === null) valid = false;
			if (validation && !validation(value)) valid = false;
			setIsValid(valid);
			return valid;
		};
		const restoreValue = () => setIsValid(true);
		return {
			isValid,
			setIsValid,
			validate,
			restoreValue
		};
	};
	var resolveUnionPropType = (propType, key) => {
		let resolvedPropType = propType;
		if (propType.kind === "union") resolvedPropType = propType.prop_types[key];
		if (!resolvedPropType) throw new MissingPropTypeError({ context: { key } });
		return resolvedPropType;
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/components/control-form-label.tsx
	var ControlFormLabel = (props) => {
		return /* @__PURE__ */ react.createElement(_elementor_ui.FormLabel, {
			size: "tiny",
			...props
		});
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/control-adornments/control-adornments-context.tsx
	var Context$1 = (0, react.createContext)(null);
	var ControlAdornmentsProvider = ({ children, items }) => /* @__PURE__ */ react.createElement(Context$1.Provider, { value: { items } }, children);
	var useControlAdornments = () => {
		return (0, react.useContext)(Context$1)?.items ?? [];
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/control-adornments/control-adornments.tsx
	function ControlAdornments({ customContext }) {
		const items = useControlAdornments();
		if (items?.length === 0) return null;
		return /* @__PURE__ */ react.createElement(react.Fragment, null, items.map(({ Adornment, id }) => /* @__PURE__ */ react.createElement(Adornment, {
			key: id,
			customContext
		})));
	}

//#endregion
//#region packages/packages/libs/editor-controls/src/components/control-label.tsx
	var ControlLabel = ({ children, ...props }) => {
		return /* @__PURE__ */ react.createElement(_elementor_ui.Stack, {
			direction: "row",
			alignItems: "center",
			justifyItems: "start",
			gap: .25
		}, /* @__PURE__ */ react.createElement(ControlFormLabel, { ...props }, children), /* @__PURE__ */ react.createElement(ControlAdornments, null));
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/control-replacements.tsx
	var ControlReplacementContext = (0, react.createContext)([]);
	var ControlReplacementsProvider = ({ replacements, children }) => {
		return /* @__PURE__ */ react.createElement(ControlReplacementContext.Provider, { value: replacements }, children);
	};
	var useControlReplacement = (OriginalComponent) => {
		const { value, placeholder } = useBoundProp();
		const replacements = (0, react.useContext)(ControlReplacementContext);
		try {
			const replacement = replacements.find((r) => r.condition({
				value,
				placeholder
			}));
			return {
				ControlToRender: replacement?.component ?? OriginalComponent,
				OriginalControl: OriginalComponent,
				isReplaced: !!replacement
			};
		} catch {
			return {
				ControlToRender: OriginalComponent,
				OriginalControl: OriginalComponent
			};
		}
	};
	var createControlReplacementsRegistry = () => {
		const controlReplacements = [];
		function registerControlReplacement2(replacement) {
			controlReplacements.push(replacement);
		}
		function getControlReplacements2() {
			return controlReplacements;
		}
		return {
			registerControlReplacement: registerControlReplacement2,
			getControlReplacements: getControlReplacements2
		};
	};
	var { registerControlReplacement, getControlReplacements } = createControlReplacementsRegistry();

//#endregion
//#region packages/packages/libs/editor-controls/src/create-control.tsx
	function createControl(Control) {
		return (props) => {
			const { ControlToRender, OriginalControl, isReplaced } = useControlReplacement(Control);
			const controlProps = isReplaced ? {
				...props,
				OriginalControl
			} : props;
			return /* @__PURE__ */ react.createElement(_elementor_ui.ErrorBoundary, { fallback: null }, /* @__PURE__ */ react.createElement(ControlToRender, { ...controlProps }));
		};
	}

//#endregion
//#region packages/packages/libs/editor-controls/src/api.ts
	var ELEMENTOR_SETTING_URL = "elementor/v1/settings";
	var apiClient = {
		getElementorSetting: (key) => (0, _elementor_http_client.httpService)().get(`${ELEMENTOR_SETTING_URL}/${key}`).then((res) => formatSettingResponse(res.data)),
		updateElementorSetting: (key, value) => (0, _elementor_http_client.httpService)().put(`${ELEMENTOR_SETTING_URL}/${key}`, { value })
	};
	var formatSettingResponse = (response) => response.data.value;

//#endregion
//#region packages/packages/libs/editor-controls/src/hooks/use-unfiltered-files-upload.ts
	var UNFILTERED_FILES_UPLOAD_KEY = "elementor_unfiltered_files_upload";
	var unfilteredFilesQueryKey = { queryKey: [UNFILTERED_FILES_UPLOAD_KEY] };
	var useUnfilteredFilesUpload = () => (0, _elementor_query.useQuery)({
		...unfilteredFilesQueryKey,
		queryFn: () => apiClient.getElementorSetting(UNFILTERED_FILES_UPLOAD_KEY).then((res) => {
			return formatResponse(res);
		}),
		staleTime: Infinity
	});
	function useUpdateUnfilteredFilesUpload() {
		const queryClient = (0, _elementor_query.useQueryClient)();
		return (0, _elementor_query.useMutation)({
			mutationFn: ({ allowUnfilteredFilesUpload }) => apiClient.updateElementorSetting(UNFILTERED_FILES_UPLOAD_KEY, allowUnfilteredFilesUpload ? "1" : "0"),
			onSuccess: () => queryClient.invalidateQueries(unfilteredFilesQueryKey)
		});
	}
	var formatResponse = (response) => {
		return Boolean(response === "1");
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/control-actions/control-actions-context.tsx
	var Context = (0, react.createContext)(null);
	var ControlActionsProvider = ({ children, items }) => /* @__PURE__ */ react.createElement(Context.Provider, { value: { items } }, children);
	var useControlActions = () => {
		const context = (0, react.useContext)(Context);
		if (!context) throw new Error("useControlActions must be used within a ControlActionsProvider");
		return context;
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/control-actions/control-actions.tsx
	function ControlActions({ children }) {
		const { items } = useControlActions();
		const { disabled } = useBoundProp();
		if (items.length === 0 || disabled) return children;
		const menuItems = items.map(({ MenuItem, id }) => /* @__PURE__ */ react.createElement(MenuItem, { key: id }));
		return /* @__PURE__ */ react.createElement(_elementor_editor_ui.FloatingActionsBar, { actions: menuItems }, children);
	}

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/image-media-control.tsx
	var ImageMediaControl = createControl(({ mediaTypes = ["image"] }) => {
		const { value, setValue, propType, placeholder } = useBoundProp(_elementor_editor_props.imageSrcPropTypeUtil);
		const { id, url } = value ?? {};
		const { data: attachment, isFetching } = (0, _elementor_wp_media.useWpMediaAttachment)(id?.value || null);
		const { data: placeholderAttachment } = (0, _elementor_wp_media.useWpMediaAttachment)(placeholder?.id?.value || null);
		const src = attachment?.url ?? url?.value ?? placeholderAttachment?.url ?? null;
		const defaultUrl = _elementor_editor_props.imageSrcPropTypeUtil.extract(propType.default ?? null)?.url?.value;
		const currentUrlForModal = url?.value && url.value !== defaultUrl ? url.value : void 0;
		const currentAltForModal = value?.alt?.value;
		const { open } = (0, _elementor_wp_media.useWpMediaFrame)({
			mediaTypes,
			multiple: false,
			selected: id?.value || null,
			allowUrlImport: true,
			onSelect: (selectedAttachment) => {
				setValue({
					id: {
						$$type: "image-attachment-id",
						value: selectedAttachment.id
					},
					url: null
				});
			},
			onSelectUrl: (selectedUrl, alt) => {
				setValue({
					id: null,
					url: _elementor_editor_props.urlPropTypeUtil.create(selectedUrl),
					alt: alt ? _elementor_editor_props.stringPropTypeUtil.create(alt) : null
				});
			}
		});
		return /* @__PURE__ */ react.createElement(ControlActions, null, /* @__PURE__ */ react.createElement(_elementor_ui.Card, { variant: "outlined" }, /* @__PURE__ */ react.createElement(_elementor_ui.CardMedia, {
			image: src,
			sx: { height: propType.meta.isDynamic ? 134 : 150 }
		}, isFetching ? /* @__PURE__ */ react.createElement(_elementor_ui.Stack, {
			justifyContent: "center",
			alignItems: "center",
			width: "100%",
			height: "100%"
		}, /* @__PURE__ */ react.createElement(_elementor_ui.CircularProgress, null)) : /* @__PURE__ */ react.createElement(react.Fragment, null)), /* @__PURE__ */ react.createElement(_elementor_ui.CardOverlay, null, /* @__PURE__ */ react.createElement(_elementor_ui.Stack, { gap: 1 }, /* @__PURE__ */ react.createElement(_elementor_ui.Button, {
			size: "tiny",
			color: "inherit",
			variant: "outlined",
			onClick: () => open({ mode: "browse" })
		}, (0, _wordpress_i18n.__)("Select image", "elementor")), /* @__PURE__ */ react.createElement(_elementor_ui.Button, {
			size: "tiny",
			variant: "text",
			color: "inherit",
			startIcon: /* @__PURE__ */ react.createElement(_elementor_icons.UploadIcon, null),
			onClick: () => open({ mode: "upload" })
		}, (0, _wordpress_i18n.__)("Upload", "elementor")), /* @__PURE__ */ react.createElement(_elementor_ui.Button, {
			size: "tiny",
			variant: "text",
			color: "inherit",
			onClick: () => open({
				mode: "url",
				currentUrl: currentUrlForModal,
				currentAlt: currentAltForModal
			})
		}, (0, _wordpress_i18n.__)("Insert from URL", "elementor"))))));
	});

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/select-control.tsx
	var DEFAULT_MENU_PROPS = { MenuListProps: { sx: { maxHeight: "160px" } } };
	var SelectControl = createControl(({ options = [], groups = [], onChange, MenuProps = DEFAULT_MENU_PROPS, ariaLabel }) => {
		const { value, setValue, disabled, placeholder } = useBoundProp(_elementor_editor_props.stringPropTypeUtil);
		const handleChange = (event) => {
			const newValue = event.target.value || null;
			onChange?.(newValue, value);
			setValue(newValue);
		};
		const flatOptions = flattenGroupedOptions(options, groups);
		const isDisabled = disabled || flatOptions.length === 0;
		return /* @__PURE__ */ react.createElement(ControlActions, null, /* @__PURE__ */ react.createElement(_elementor_ui.Select, {
			sx: { overflow: "hidden" },
			displayEmpty: true,
			size: "tiny",
			MenuProps,
			"aria-label": ariaLabel || placeholder,
			renderValue: (selectedValue) => getSelectRenderValue(flatOptions, placeholder, selectedValue),
			value: value ?? "",
			onChange: handleChange,
			disabled: isDisabled,
			fullWidth: true
		}, groups.length ? groups.flatMap((group) => renderGroup(group)) : options.map((option) => renderOption(option))));
	});
	var GROUPED_OPTION_INDENT = 3.5;
	function renderGroup(group) {
		return [/* @__PURE__ */ react.createElement(_elementor_ui.MenuSubheader, {
			key: `group-${group.label}`,
			sx: {
				fontWeight: 400,
				color: "text.tertiary"
			}
		}, group.label), ...group.options.map((option) => renderOption(option, true))];
	}
	function renderOption({ label, ...props }, isGrouped = false) {
		return /* @__PURE__ */ react.createElement(_elementor_editor_ui.MenuListItem, {
			key: props.value,
			...props,
			value: props.value ?? "",
			sx: isGrouped ? { pl: GROUPED_OPTION_INDENT } : void 0
		}, label);
	}
	function flattenGroupedOptions(options, groups) {
		if (!groups.length) return options;
		return groups.flatMap((group) => group.options);
	}
	function getSelectRenderValue(options, placeholder, selectedValue) {
		const optionWithValue = (v) => options.find(({ value }) => value === v);
		if (!isUnsetSelectValue(selectedValue)) return optionWithValue(selectedValue)?.label ?? selectedValue;
		if (placeholder) {
			const text = optionWithValue(placeholder)?.label ?? placeholder;
			return /* @__PURE__ */ react.createElement(_elementor_ui.Typography, {
				component: "span",
				variant: "inherit",
				color: "text.tertiary"
			}, text);
		}
		return options.find(({ value }) => isUnsetSelectValue(value))?.label ?? "";
	}
	function isUnsetSelectValue(value) {
		return value === null || value === void 0 || value === "";
	}

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/image-control.tsx
	var ImageControl = createControl(({ sizes, label = (0, _wordpress_i18n.__)("Image", "elementor") }) => {
		const propContext = useBoundProp(_elementor_editor_props.imagePropTypeUtil);
		return /* @__PURE__ */ react.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ react.createElement(_elementor_ui.Stack, { gap: 1.5 }, /* @__PURE__ */ react.createElement(ControlLabel, null, label), /* @__PURE__ */ react.createElement(ImageSrcControl, null), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			container: true,
			gap: 1.5,
			alignItems: "center",
			flexWrap: "nowrap"
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6
		}, /* @__PURE__ */ react.createElement(ControlFormLabel, null, (0, _wordpress_i18n.__)("Resolution", "elementor"))), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6,
			sx: { overflow: "hidden" }
		}, /* @__PURE__ */ react.createElement(ImageSizeControl, { sizes })))));
	});
	var ImageSrcControl = () => {
		const { data: allowSvgUpload } = useUnfilteredFilesUpload();
		const mediaTypes = allowSvgUpload ? ["image", "svg"] : ["image"];
		return /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "src" }, /* @__PURE__ */ react.createElement(ImageMediaControl, { mediaTypes }));
	};
	var ImageSizeControl = ({ sizes }) => {
		return /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ react.createElement(SelectControl, { options: sizes }));
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/text-control.tsx
	var TextControl = createControl(({ placeholder: propPlaceholder, error, inputValue, inputDisabled, helperText, sx, ariaLabel }) => {
		const { value, setValue, disabled, placeholder: boundPlaceholder } = useBoundProp(_elementor_editor_props.stringPropTypeUtil);
		const handleChange = (event) => setValue(event.target.value);
		const placeholder = propPlaceholder ?? boundPlaceholder ?? void 0;
		return /* @__PURE__ */ react.createElement(ControlActions, null, /* @__PURE__ */ react.createElement(_elementor_ui.TextField, {
			size: "tiny",
			fullWidth: true,
			disabled: inputDisabled ?? disabled,
			value: inputValue ?? value ?? "",
			onChange: handleChange,
			placeholder,
			error,
			helperText,
			sx,
			inputProps: { ...ariaLabel ? { "aria-label": ariaLabel } : {} }
		}));
	});

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/text-area-control.tsx
	var TextAreaControl = createControl(({ placeholder: propPlaceholder, ariaLabel }) => {
		const { value, setValue, disabled, placeholder: boundPlaceholder } = useBoundProp(_elementor_editor_props.stringPropTypeUtil);
		const handleChange = (event) => {
			setValue(event.target.value);
		};
		const placeholder = propPlaceholder ?? boundPlaceholder ?? void 0;
		return /* @__PURE__ */ react.createElement(ControlActions, null, /* @__PURE__ */ react.createElement(_elementor_ui.TextField, {
			size: "tiny",
			multiline: true,
			fullWidth: true,
			minRows: 5,
			disabled,
			value: value ?? "",
			onChange: handleChange,
			placeholder,
			inputProps: { ...ariaLabel ? { "aria-label": ariaLabel } : {} }
		}));
	});

//#endregion
//#region node_modules/primereact/utils/utils.esm.js
	function _arrayWithHoles$5(r) {
		if (Array.isArray(r)) return r;
	}
	__name(_arrayWithHoles$5, "_arrayWithHoles");
	function _iterableToArrayLimit$5(r, l) {
		var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
		if (null != t) {
			var e;
			var n;
			var i;
			var u;
			var a = [];
			var f = !0;
			var o = !1;
			try {
				if (i = (t = t.call(r)).next, 0 === l) {
					if (Object(t) !== t) return;
					f = !1;
				} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
			} catch (r) {
				o = !0, n = r;
			} finally {
				try {
					if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
				} finally {
					if (o) throw n;
				}
			}
			return a;
		}
	}
	__name(_iterableToArrayLimit$5, "_iterableToArrayLimit");
	function _arrayLikeToArray$2$1(r, a) {
		(null == a || a > r.length) && (a = r.length);
		for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
		return n;
	}
	__name(_arrayLikeToArray$2$1, "_arrayLikeToArray$2");
	function _unsupportedIterableToArray$2$1(r, a) {
		if (r) {
			if ("string" == typeof r) return _arrayLikeToArray$2$1(r, a);
			var t = {}.toString.call(r).slice(8, -1);
			return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$2$1(r, a) : void 0;
		}
	}
	__name(_unsupportedIterableToArray$2$1, "_unsupportedIterableToArray$2");
	function _nonIterableRest$5() {
		throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
	}
	__name(_nonIterableRest$5, "_nonIterableRest");
	function _slicedToArray$5(r, e) {
		return _arrayWithHoles$5(r) || _iterableToArrayLimit$5(r, e) || _unsupportedIterableToArray$2$1(r, e) || _nonIterableRest$5();
	}
	__name(_slicedToArray$5, "_slicedToArray");
	function _typeof$6(o) {
		"@babel/helpers - typeof";
		return _typeof$6 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
			return typeof o;
		} : function(o) {
			return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
		}, _typeof$6(o);
	}
	__name(_typeof$6, "_typeof");
	function classNames() {
		for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
		if (args) {
			var classes = [];
			for (var i = 0; i < args.length; i++) {
				var className = args[i];
				if (!className) continue;
				var type = _typeof$6(className);
				if (type === "string" || type === "number") classes.push(className);
				else if (type === "object") {
					var _classes = Array.isArray(className) ? className : Object.entries(className).map(function(_ref) {
						var _ref2 = _slicedToArray$5(_ref, 2);
						var key = _ref2[0];
						return _ref2[1] ? key : null;
					});
					classes = _classes.length ? classes.concat(_classes.filter(function(c) {
						return !!c;
					})) : classes;
				}
			}
			return classes.join(" ").trim();
		}
	}
	function _arrayWithoutHoles$5(r) {
		if (Array.isArray(r)) return _arrayLikeToArray$2$1(r);
	}
	__name(_arrayWithoutHoles$5, "_arrayWithoutHoles");
	function _iterableToArray$5(r) {
		if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
	}
	__name(_iterableToArray$5, "_iterableToArray");
	function _nonIterableSpread$5() {
		throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
	}
	__name(_nonIterableSpread$5, "_nonIterableSpread");
	function _toConsumableArray$5(r) {
		return _arrayWithoutHoles$5(r) || _iterableToArray$5(r) || _unsupportedIterableToArray$2$1(r) || _nonIterableSpread$5();
	}
	__name(_toConsumableArray$5, "_toConsumableArray");
	function _classCallCheck$1(a, n) {
		if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
	}
	__name(_classCallCheck$1, "_classCallCheck");
	function toPrimitive$6(t, r) {
		if ("object" != _typeof$6(t) || !t) return t;
		var e = t[Symbol.toPrimitive];
		if (void 0 !== e) {
			var i = e.call(t, r || "default");
			if ("object" != _typeof$6(i)) return i;
			throw new TypeError("@@toPrimitive must return a primitive value.");
		}
		return ("string" === r ? String : Number)(t);
	}
	__name(toPrimitive$6, "toPrimitive");
	function toPropertyKey$6(t) {
		var i = toPrimitive$6(t, "string");
		return "symbol" == _typeof$6(i) ? i : i + "";
	}
	__name(toPropertyKey$6, "toPropertyKey");
	function _defineProperties$1(e, r) {
		for (var t = 0; t < r.length; t++) {
			var o = r[t];
			o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey$6(o.key), o);
		}
	}
	__name(_defineProperties$1, "_defineProperties");
	function _createClass$1(e, r, t) {
		return r && _defineProperties$1(e.prototype, r), t && _defineProperties$1(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e;
	}
	__name(_createClass$1, "_createClass");
	function _defineProperty$6(e, r, t) {
		return (r = toPropertyKey$6(r)) in e ? Object.defineProperty(e, r, {
			value: t,
			enumerable: !0,
			configurable: !0,
			writable: !0
		}) : e[r] = t, e;
	}
	__name(_defineProperty$6, "_defineProperty");
	function _createForOfIteratorHelper$1(r, e) {
		var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
		if (!t) {
			if (Array.isArray(r) || (t = _unsupportedIterableToArray$1$1(r)) || e && r && "number" == typeof r.length) {
				t && (r = t);
				var _n = 0;
				var F = function F() {};
				return {
					s: F,
					n: function n() {
						return _n >= r.length ? { done: !0 } : {
							done: !1,
							value: r[_n++]
						};
					},
					e: function e(r) {
						throw r;
					},
					f: F
				};
			}
			throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
		}
		var o;
		var a = !0;
		var u = !1;
		return {
			s: function s() {
				t = t.call(r);
			},
			n: function n() {
				var r = t.next();
				return a = r.done, r;
			},
			e: function e(r) {
				u = !0, o = r;
			},
			f: function f() {
				try {
					a || null == t["return"] || t["return"]();
				} finally {
					if (u) throw o;
				}
			}
		};
	}
	function _unsupportedIterableToArray$1$1(r, a) {
		if (r) {
			if ("string" == typeof r) return _arrayLikeToArray$1$1(r, a);
			var t = {}.toString.call(r).slice(8, -1);
			return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1$1(r, a) : void 0;
		}
	}
	__name(_unsupportedIterableToArray$1$1, "_unsupportedIterableToArray$1");
	function _arrayLikeToArray$1$1(r, a) {
		(null == a || a > r.length) && (a = r.length);
		for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
		return n;
	}
	__name(_arrayLikeToArray$1$1, "_arrayLikeToArray$1");
	var DomHandler = /*#__PURE__*/ function() {
		function DomHandler() {
			_classCallCheck$1(this, DomHandler);
		}
		return _createClass$1(DomHandler, null, [
			{
				key: "innerWidth",
				value: function innerWidth(el) {
					if (el) {
						var width = el.offsetWidth;
						var style = getComputedStyle(el);
						width = width + (parseFloat(style.paddingLeft) + parseFloat(style.paddingRight));
						return width;
					}
					return 0;
				}
			},
			{
				key: "width",
				value: function width(el) {
					if (el) {
						var _width = el.offsetWidth;
						var style = getComputedStyle(el);
						_width = _width - (parseFloat(style.paddingLeft) + parseFloat(style.paddingRight));
						return _width;
					}
					return 0;
				}
			},
			{
				key: "getBrowserLanguage",
				value: function getBrowserLanguage() {
					return navigator.userLanguage || navigator.languages && navigator.languages.length && navigator.languages[0] || navigator.language || navigator.browserLanguage || navigator.systemLanguage || "en";
				}
			},
			{
				key: "getWindowScrollTop",
				value: function getWindowScrollTop() {
					var doc = document.documentElement;
					return (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0);
				}
			},
			{
				key: "getWindowScrollLeft",
				value: function getWindowScrollLeft() {
					var doc = document.documentElement;
					return (window.pageXOffset || doc.scrollLeft) - (doc.clientLeft || 0);
				}
			},
			{
				key: "getOuterWidth",
				value: function getOuterWidth(el, margin) {
					if (el) {
						var width = el.getBoundingClientRect().width || el.offsetWidth;
						if (margin) {
							var style = getComputedStyle(el);
							width = width + (parseFloat(style.marginLeft) + parseFloat(style.marginRight));
						}
						return width;
					}
					return 0;
				}
			},
			{
				key: "getOuterHeight",
				value: function getOuterHeight(el, margin) {
					if (el) {
						var height = el.getBoundingClientRect().height || el.offsetHeight;
						if (margin) {
							var style = getComputedStyle(el);
							height = height + (parseFloat(style.marginTop) + parseFloat(style.marginBottom));
						}
						return height;
					}
					return 0;
				}
			},
			{
				key: "getClientHeight",
				value: function getClientHeight(el, margin) {
					if (el) {
						var height = el.clientHeight;
						if (margin) {
							var style = getComputedStyle(el);
							height = height + (parseFloat(style.marginTop) + parseFloat(style.marginBottom));
						}
						return height;
					}
					return 0;
				}
			},
			{
				key: "getClientWidth",
				value: function getClientWidth(el, margin) {
					if (el) {
						var width = el.clientWidth;
						if (margin) {
							var style = getComputedStyle(el);
							width = width + (parseFloat(style.marginLeft) + parseFloat(style.marginRight));
						}
						return width;
					}
					return 0;
				}
			},
			{
				key: "getViewport",
				value: function getViewport() {
					var win = window;
					var d = document;
					var e = d.documentElement;
					var g = d.getElementsByTagName("body")[0];
					return {
						width: win.innerWidth || e.clientWidth || g.clientWidth,
						height: win.innerHeight || e.clientHeight || g.clientHeight
					};
				}
			},
			{
				key: "getOffset",
				value: function getOffset(el) {
					if (el) {
						var rect = el.getBoundingClientRect();
						return {
							top: rect.top + (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0),
							left: rect.left + (window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0)
						};
					}
					return {
						top: "auto",
						left: "auto"
					};
				}
			},
			{
				key: "index",
				value: function index(element) {
					if (element) {
						var children = element.parentNode.childNodes;
						var num = 0;
						for (var i = 0; i < children.length; i++) {
							if (children[i] === element) return num;
							if (children[i].nodeType === 1) num++;
						}
					}
					return -1;
				}
			},
			{
				key: "addMultipleClasses",
				value: function addMultipleClasses(element, className) {
					if (element && className) if (element.classList) {
						var styles = className.split(" ");
						for (var i = 0; i < styles.length; i++) element.classList.add(styles[i]);
					} else {
						var _styles = className.split(" ");
						for (var _i = 0; _i < _styles.length; _i++) element.className = element.className + (" " + _styles[_i]);
					}
				}
			},
			{
				key: "removeMultipleClasses",
				value: function removeMultipleClasses(element, className) {
					if (element && className) if (element.classList) {
						var styles = className.split(" ");
						for (var i = 0; i < styles.length; i++) element.classList.remove(styles[i]);
					} else {
						var _styles2 = className.split(" ");
						for (var _i2 = 0; _i2 < _styles2.length; _i2++) element.className = element.className.replace(new RegExp("(^|\\b)" + _styles2[_i2].split(" ").join("|") + "(\\b|$)", "gi"), " ");
					}
				}
			},
			{
				key: "addClass",
				value: function addClass(element, className) {
					if (element && className) if (element.classList) element.classList.add(className);
					else element.className = element.className + (" " + className);
				}
			},
			{
				key: "removeClass",
				value: function removeClass(element, className) {
					if (element && className) if (element.classList) element.classList.remove(className);
					else element.className = element.className.replace(new RegExp("(^|\\b)" + className.split(" ").join("|") + "(\\b|$)", "gi"), " ");
				}
			},
			{
				key: "hasClass",
				value: function hasClass(element, className) {
					if (element) {
						if (element.classList) return element.classList.contains(className);
						return new RegExp("(^| )" + className + "( |$)", "gi").test(element.className);
					}
					return false;
				}
			},
			{
				key: "addStyles",
				value: function addStyles(element) {
					var styles = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
					if (element) Object.entries(styles).forEach(function(_ref) {
						var _ref2 = _slicedToArray$5(_ref, 2);
						var key = _ref2[0];
						var value = _ref2[1];
						return element.style[key] = value;
					});
				}
			},
			{
				key: "find",
				value: function find(element, selector) {
					return element ? Array.from(element.querySelectorAll(selector)) : [];
				}
			},
			{
				key: "findSingle",
				value: function findSingle(element, selector) {
					if (element) return element.querySelector(selector);
					return null;
				}
			},
			{
				key: "setAttributes",
				value: function setAttributes(element) {
					var _this = this;
					var attributes = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
					if (element) {
						var _computedStyles = function computedStyles(rule, value) {
							var _element$$attrs;
							var _element$$attrs2;
							var styles = element !== null && element !== void 0 && (_element$$attrs = element.$attrs) !== null && _element$$attrs !== void 0 && _element$$attrs[rule] ? [element === null || element === void 0 || (_element$$attrs2 = element.$attrs) === null || _element$$attrs2 === void 0 ? void 0 : _element$$attrs2[rule]] : [];
							return [value].flat().reduce(function(cv, v) {
								if (v !== null && v !== void 0) {
									var type = _typeof$6(v);
									if (type === "string" || type === "number") cv.push(v);
									else if (type === "object") {
										var _cv = Array.isArray(v) ? _computedStyles(rule, v) : Object.entries(v).map(function(_ref3) {
											var _ref4 = _slicedToArray$5(_ref3, 2);
											var _k = _ref4[0];
											var _v = _ref4[1];
											return rule === "style" && (!!_v || _v === 0) ? "".concat(_k.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(), ":").concat(_v) : _v ? _k : void 0;
										});
										cv = _cv.length ? cv.concat(_cv.filter(function(c) {
											return !!c;
										})) : cv;
									}
								}
								return cv;
							}, styles);
						};
						Object.entries(attributes).forEach(function(_ref5) {
							var _ref6 = _slicedToArray$5(_ref5, 2);
							var key = _ref6[0];
							var value = _ref6[1];
							if (value !== void 0 && value !== null) {
								var matchedEvent = key.match(/^on(.+)/);
								if (matchedEvent) element.addEventListener(matchedEvent[1].toLowerCase(), value);
								else if (key === "p-bind") _this.setAttributes(element, value);
								else {
									value = key === "class" ? _toConsumableArray$5(new Set(_computedStyles("class", value))).join(" ").trim() : key === "style" ? _computedStyles("style", value).join(";").trim() : value;
									(element.$attrs = element.$attrs || {}) && (element.$attrs[key] = value);
									element.setAttribute(key, value);
								}
							}
						});
					}
				}
			},
			{
				key: "getAttribute",
				value: function getAttribute(element, name) {
					if (element) {
						var value = element.getAttribute(name);
						if (!isNaN(value)) return +value;
						if (value === "true" || value === "false") return value === "true";
						return value;
					}
				}
			},
			{
				key: "isAttributeEquals",
				value: function isAttributeEquals(element, name, value) {
					return element ? this.getAttribute(element, name) === value : false;
				}
			},
			{
				key: "isAttributeNotEquals",
				value: function isAttributeNotEquals(element, name, value) {
					return !this.isAttributeEquals(element, name, value);
				}
			},
			{
				key: "getHeight",
				value: function getHeight(el) {
					if (el) {
						var height = el.offsetHeight;
						var style = getComputedStyle(el);
						height = height - (parseFloat(style.paddingTop) + parseFloat(style.paddingBottom) + parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth));
						return height;
					}
					return 0;
				}
			},
			{
				key: "getWidth",
				value: function getWidth(el) {
					if (el) {
						var width = el.offsetWidth;
						var style = getComputedStyle(el);
						width = width - (parseFloat(style.paddingLeft) + parseFloat(style.paddingRight) + parseFloat(style.borderLeftWidth) + parseFloat(style.borderRightWidth));
						return width;
					}
					return 0;
				}
			},
			{
				key: "alignOverlay",
				value: function alignOverlay(overlay, target, appendTo) {
					var calculateMinWidth = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true;
					if (overlay && target) if (appendTo === "self") this.relativePosition(overlay, target);
					else {
						calculateMinWidth && (overlay.style.minWidth = DomHandler.getOuterWidth(target) + "px");
						this.absolutePosition(overlay, target);
					}
				}
			},
			{
				key: "absolutePosition",
				value: function absolutePosition(element, target) {
					var align = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "left";
					if (element && target) {
						var elementDimensions = element.offsetParent ? {
							width: element.offsetWidth,
							height: element.offsetHeight
						} : this.getHiddenElementDimensions(element);
						var elementOuterHeight = elementDimensions.height;
						var elementOuterWidth = elementDimensions.width;
						var targetOuterHeight = target.offsetHeight;
						var targetOuterWidth = target.offsetWidth;
						var targetOffset = target.getBoundingClientRect();
						var windowScrollTop = this.getWindowScrollTop();
						var windowScrollLeft = this.getWindowScrollLeft();
						var viewport = this.getViewport();
						var top;
						var left;
						if (targetOffset.top + targetOuterHeight + elementOuterHeight > viewport.height) {
							top = targetOffset.top + windowScrollTop - elementOuterHeight;
							if (top < 0) top = windowScrollTop;
							element.style.transformOrigin = "bottom";
						} else {
							top = targetOuterHeight + targetOffset.top + windowScrollTop;
							element.style.transformOrigin = "top";
						}
						var targetOffsetPx = targetOffset.left;
						if (align === "left") if (targetOffsetPx + elementOuterWidth > viewport.width) left = Math.max(0, targetOffsetPx + windowScrollLeft + targetOuterWidth - elementOuterWidth);
						else left = targetOffsetPx + windowScrollLeft;
						else if (targetOffsetPx + targetOuterWidth - elementOuterWidth < 0) left = windowScrollLeft;
						else left = targetOffsetPx + targetOuterWidth - elementOuterWidth + windowScrollLeft;
						element.style.top = top + "px";
						element.style.left = left + "px";
					}
				}
			},
			{
				key: "relativePosition",
				value: function relativePosition(element, target) {
					if (element && target) {
						var elementDimensions = element.offsetParent ? {
							width: element.offsetWidth,
							height: element.offsetHeight
						} : this.getHiddenElementDimensions(element);
						var targetHeight = target.offsetHeight;
						var targetOffset = target.getBoundingClientRect();
						var viewport = this.getViewport();
						var top;
						var left;
						if (targetOffset.top + targetHeight + elementDimensions.height > viewport.height) {
							top = -1 * elementDimensions.height;
							if (targetOffset.top + top < 0) top = -1 * targetOffset.top;
							element.style.transformOrigin = "bottom";
						} else {
							top = targetHeight;
							element.style.transformOrigin = "top";
						}
						if (elementDimensions.width > viewport.width) left = targetOffset.left * -1;
						else if (targetOffset.left + elementDimensions.width > viewport.width) left = (targetOffset.left + elementDimensions.width - viewport.width) * -1;
						else left = 0;
						element.style.top = top + "px";
						element.style.left = left + "px";
					}
				}
			},
			{
				key: "flipfitCollision",
				value: function flipfitCollision(element, target) {
					var _this2 = this;
					var my = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "left top";
					var at = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "left bottom";
					var callback = arguments.length > 4 ? arguments[4] : void 0;
					if (element && target) {
						var targetOffset = target.getBoundingClientRect();
						var viewport = this.getViewport();
						var myArr = my.split(" ");
						var atArr = at.split(" ");
						var getPositionValue = function getPositionValue(arr, isOffset) {
							return isOffset ? +arr.substring(arr.search(/(\+|-)/g)) || 0 : arr.substring(0, arr.search(/(\+|-)/g)) || arr;
						};
						var position = {
							my: {
								x: getPositionValue(myArr[0]),
								y: getPositionValue(myArr[1] || myArr[0]),
								offsetX: getPositionValue(myArr[0], true),
								offsetY: getPositionValue(myArr[1] || myArr[0], true)
							},
							at: {
								x: getPositionValue(atArr[0]),
								y: getPositionValue(atArr[1] || atArr[0]),
								offsetX: getPositionValue(atArr[0], true),
								offsetY: getPositionValue(atArr[1] || atArr[0], true)
							}
						};
						var myOffset = {
							left: function left() {
								return position.my.offsetX + position.at.offsetX + targetOffset.left + (position.my.x === "left" ? 0 : -1 * (position.my.x === "center" ? _this2.getOuterWidth(element) / 2 : _this2.getOuterWidth(element)));
							},
							top: function top() {
								return position.my.offsetY + position.at.offsetY + targetOffset.top + (position.my.y === "top" ? 0 : -1 * (position.my.y === "center" ? _this2.getOuterHeight(element) / 2 : _this2.getOuterHeight(element)));
							}
						};
						var alignWithAt = {
							count: {
								x: 0,
								y: 0
							},
							left: function left() {
								var left = myOffset.left();
								var scrollLeft = DomHandler.getWindowScrollLeft();
								element.style.left = left + scrollLeft + "px";
								if (this.count.x === 2) {
									element.style.left = scrollLeft + "px";
									this.count.x = 0;
								} else if (left < 0) {
									this.count.x++;
									position.my.x = "left";
									position.at.x = "right";
									position.my.offsetX *= -1;
									position.at.offsetX *= -1;
									this.right();
								}
							},
							right: function right() {
								var left = myOffset.left() + DomHandler.getOuterWidth(target);
								var scrollLeft = DomHandler.getWindowScrollLeft();
								element.style.left = left + scrollLeft + "px";
								if (this.count.x === 2) {
									element.style.left = viewport.width - DomHandler.getOuterWidth(element) + scrollLeft + "px";
									this.count.x = 0;
								} else if (left + DomHandler.getOuterWidth(element) > viewport.width) {
									this.count.x++;
									position.my.x = "right";
									position.at.x = "left";
									position.my.offsetX *= -1;
									position.at.offsetX *= -1;
									this.left();
								}
							},
							top: function top() {
								var top = myOffset.top();
								var scrollTop = DomHandler.getWindowScrollTop();
								element.style.top = top + scrollTop + "px";
								if (this.count.y === 2) {
									element.style.left = scrollTop + "px";
									this.count.y = 0;
								} else if (top < 0) {
									this.count.y++;
									position.my.y = "top";
									position.at.y = "bottom";
									position.my.offsetY *= -1;
									position.at.offsetY *= -1;
									this.bottom();
								}
							},
							bottom: function bottom() {
								var top = myOffset.top() + DomHandler.getOuterHeight(target);
								var scrollTop = DomHandler.getWindowScrollTop();
								element.style.top = top + scrollTop + "px";
								if (this.count.y === 2) {
									element.style.left = viewport.height - DomHandler.getOuterHeight(element) + scrollTop + "px";
									this.count.y = 0;
								} else if (top + DomHandler.getOuterHeight(target) > viewport.height) {
									this.count.y++;
									position.my.y = "bottom";
									position.at.y = "top";
									position.my.offsetY *= -1;
									position.at.offsetY *= -1;
									this.top();
								}
							},
							center: function center(axis) {
								if (axis === "y") {
									var top = myOffset.top() + DomHandler.getOuterHeight(target) / 2;
									element.style.top = top + DomHandler.getWindowScrollTop() + "px";
									if (top < 0) this.bottom();
									else if (top + DomHandler.getOuterHeight(target) > viewport.height) this.top();
								} else {
									var left = myOffset.left() + DomHandler.getOuterWidth(target) / 2;
									element.style.left = left + DomHandler.getWindowScrollLeft() + "px";
									if (left < 0) this.left();
									else if (left + DomHandler.getOuterWidth(element) > viewport.width) this.right();
								}
							}
						};
						alignWithAt[position.at.x]("x");
						alignWithAt[position.at.y]("y");
						if (this.isFunction(callback)) callback(position);
					}
				}
			},
			{
				key: "findCollisionPosition",
				value: function findCollisionPosition(position) {
					if (position) {
						var isAxisY = position === "top" || position === "bottom";
						var myXPosition = position === "left" ? "right" : "left";
						var myYPosition = position === "top" ? "bottom" : "top";
						if (isAxisY) return {
							axis: "y",
							my: "center ".concat(myYPosition),
							at: "center ".concat(position)
						};
						return {
							axis: "x",
							my: "".concat(myXPosition, " center"),
							at: "".concat(position, " center")
						};
					}
				}
			},
			{
				key: "getParents",
				value: function getParents(element) {
					var parents = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
					return element.parentNode === null ? parents : this.getParents(element.parentNode, parents.concat([element.parentNode]));
				}
			},
			{
				key: "getScrollableParents",
				value: function getScrollableParents(element) {
					var _this3 = this;
					var scrollableParents = [];
					if (element) {
						var parents = this.getParents(element);
						var overflowRegex = /(auto|scroll)/;
						/**
						* Checks if an element has overflow scroll/auto in any direction
						* @param {HTMLElement} node - Element to check
						* @returns {boolean} True if element has overflow scroll/auto
						*/
						var overflowCheck = function overflowCheck(node) {
							var styleDeclaration = node ? getComputedStyle(node) : null;
							return styleDeclaration && (overflowRegex.test(styleDeclaration.getPropertyValue("overflow")) || overflowRegex.test(styleDeclaration.getPropertyValue("overflow-x")) || overflowRegex.test(styleDeclaration.getPropertyValue("overflow-y")));
						};
						/**
						* Adds a scrollable parent element to the collection
						* @param {HTMLElement} node - Element to add
						*/
						var addScrollableParent = function addScrollableParent(node) {
							scrollableParents.push(node.nodeName === "BODY" || node.nodeName === "HTML" || _this3.isDocument(node) ? window : node);
						};
						var _iterator = _createForOfIteratorHelper$1(parents);
						var _step;
						try {
							for (_iterator.s(); !(_step = _iterator.n()).done;) {
								var _parent$dataset;
								var parent = _step.value;
								var scrollSelectors = parent.nodeType === 1 && ((_parent$dataset = parent.dataset) === null || _parent$dataset === void 0 ? void 0 : _parent$dataset.scrollselectors);
								if (scrollSelectors) {
									var _iterator2 = _createForOfIteratorHelper$1(scrollSelectors.split(","));
									var _step2;
									try {
										for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
											var selector = _step2.value;
											var el = this.findSingle(parent, selector);
											if (el && overflowCheck(el)) addScrollableParent(el);
										}
									} catch (err) {
										_iterator2.e(err);
									} finally {
										_iterator2.f();
									}
								}
								if (parent.nodeType === 1 && overflowCheck(parent)) addScrollableParent(parent);
							}
						} catch (err) {
							_iterator.e(err);
						} finally {
							_iterator.f();
						}
					}
					return scrollableParents;
				}
			},
			{
				key: "getHiddenElementOuterHeight",
				value: function getHiddenElementOuterHeight(element) {
					if (element) {
						element.style.visibility = "hidden";
						element.style.display = "block";
						var elementHeight = element.offsetHeight;
						element.style.display = "none";
						element.style.visibility = "visible";
						return elementHeight;
					}
					return 0;
				}
			},
			{
				key: "getHiddenElementOuterWidth",
				value: function getHiddenElementOuterWidth(element) {
					if (element) {
						element.style.visibility = "hidden";
						element.style.display = "block";
						var elementWidth = element.offsetWidth;
						element.style.display = "none";
						element.style.visibility = "visible";
						return elementWidth;
					}
					return 0;
				}
			},
			{
				key: "getHiddenElementDimensions",
				value: function getHiddenElementDimensions(element) {
					var dimensions = {};
					if (element) {
						element.style.visibility = "hidden";
						element.style.display = "block";
						dimensions.width = element.offsetWidth;
						dimensions.height = element.offsetHeight;
						element.style.display = "none";
						element.style.visibility = "visible";
					}
					return dimensions;
				}
			},
			{
				key: "fadeIn",
				value: function fadeIn(element, duration) {
					if (element) {
						element.style.opacity = 0;
						var last = +/* @__PURE__ */ new Date();
						var opacity = 0;
						var _tick = function tick() {
							opacity = +element.style.opacity + ((/* @__PURE__ */ new Date()).getTime() - last) / duration;
							element.style.opacity = opacity;
							last = +/* @__PURE__ */ new Date();
							if (+opacity < 1) window.requestAnimationFrame && requestAnimationFrame(_tick) || setTimeout(_tick, 16);
						};
						_tick();
					}
				}
			},
			{
				key: "fadeOut",
				value: function fadeOut(element, duration) {
					if (element) {
						var opacity = 1;
						var interval = 50;
						var gap = interval / duration;
						var fading = setInterval(function() {
							opacity = opacity - gap;
							if (opacity <= 0) {
								opacity = 0;
								clearInterval(fading);
							}
							element.style.opacity = opacity;
						}, interval);
					}
				}
			},
			{
				key: "getUserAgent",
				value: function getUserAgent() {
					return navigator.userAgent;
				}
			},
			{
				key: "isIOS",
				value: function isIOS() {
					return /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
				}
			},
			{
				key: "isAndroid",
				value: function isAndroid() {
					return /(android)/i.test(navigator.userAgent);
				}
			},
			{
				key: "isChrome",
				value: function isChrome() {
					return /(chrome)/i.test(navigator.userAgent);
				}
			},
			{
				key: "isClient",
				value: function isClient() {
					return !!(typeof window !== "undefined" && window.document && window.document.createElement);
				}
			},
			{
				key: "isTouchDevice",
				value: function isTouchDevice() {
					return "ontouchstart" in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;
				}
			},
			{
				key: "isFunction",
				value: function isFunction(obj) {
					return !!(obj && obj.constructor && obj.call && obj.apply);
				}
			},
			{
				key: "appendChild",
				value: function appendChild(element, target) {
					if (this.isElement(target)) target.appendChild(element);
					else if (target.el && target.el.nativeElement) target.el.nativeElement.appendChild(element);
					else throw new Error("Cannot append " + target + " to " + element);
				}
			},
			{
				key: "removeChild",
				value: function removeChild(element, target) {
					if (this.isElement(target)) target.removeChild(element);
					else if (target.el && target.el.nativeElement) target.el.nativeElement.removeChild(element);
					else throw new Error("Cannot remove " + element + " from " + target);
				}
			},
			{
				key: "isElement",
				value: function isElement(obj) {
					return (typeof HTMLElement === "undefined" ? "undefined" : _typeof$6(HTMLElement)) === "object" ? obj instanceof HTMLElement : obj && _typeof$6(obj) === "object" && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === "string";
				}
			},
			{
				key: "isDocument",
				value: function isDocument(obj) {
					return (typeof Document === "undefined" ? "undefined" : _typeof$6(Document)) === "object" ? obj instanceof Document : obj && _typeof$6(obj) === "object" && obj !== null && obj.nodeType === 9;
				}
			},
			{
				key: "scrollInView",
				value: function scrollInView(container, item) {
					var borderTopValue = getComputedStyle(container).getPropertyValue("border-top-width");
					var borderTop = borderTopValue ? parseFloat(borderTopValue) : 0;
					var paddingTopValue = getComputedStyle(container).getPropertyValue("padding-top");
					var paddingTop = paddingTopValue ? parseFloat(paddingTopValue) : 0;
					var containerRect = container.getBoundingClientRect();
					var offset = item.getBoundingClientRect().top + document.body.scrollTop - (containerRect.top + document.body.scrollTop) - borderTop - paddingTop;
					var scroll = container.scrollTop;
					var elementHeight = container.clientHeight;
					var itemHeight = this.getOuterHeight(item);
					if (offset < 0) container.scrollTop = scroll + offset;
					else if (offset + itemHeight > elementHeight) container.scrollTop = scroll + offset - elementHeight + itemHeight;
				}
			},
			{
				key: "clearSelection",
				value: function clearSelection() {
					if (window.getSelection) {
						if (window.getSelection().empty) window.getSelection().empty();
						else if (window.getSelection().removeAllRanges && window.getSelection().rangeCount > 0 && window.getSelection().getRangeAt(0).getClientRects().length > 0) window.getSelection().removeAllRanges();
					} else if (document.selection && document.selection.empty) try {
						document.selection.empty();
					} catch (error) {}
				}
			},
			{
				key: "calculateScrollbarWidth",
				value: function calculateScrollbarWidth(el) {
					if (el) {
						var style = getComputedStyle(el);
						return el.offsetWidth - el.clientWidth - parseFloat(style.borderLeftWidth) - parseFloat(style.borderRightWidth);
					}
					if (this.calculatedScrollbarWidth != null) return this.calculatedScrollbarWidth;
					var scrollDiv = document.createElement("div");
					scrollDiv.className = "p-scrollbar-measure";
					document.body.appendChild(scrollDiv);
					var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
					document.body.removeChild(scrollDiv);
					this.calculatedScrollbarWidth = scrollbarWidth;
					return scrollbarWidth;
				}
			},
			{
				key: "calculateBodyScrollbarWidth",
				value: function calculateBodyScrollbarWidth() {
					return window.innerWidth - document.documentElement.offsetWidth;
				}
			},
			{
				key: "getBrowser",
				value: function getBrowser() {
					if (!this.browser) {
						var matched = this.resolveUserAgent();
						this.browser = {};
						if (matched.browser) {
							this.browser[matched.browser] = true;
							this.browser.version = matched.version;
						}
						if (this.browser.chrome) this.browser.webkit = true;
						else if (this.browser.webkit) this.browser.safari = true;
					}
					return this.browser;
				}
			},
			{
				key: "resolveUserAgent",
				value: function resolveUserAgent() {
					var ua = navigator.userAgent.toLowerCase();
					var match = /(chrome)[ ]([\w.]+)/.exec(ua) || /(webkit)[ ]([\w.]+)/.exec(ua) || /(opera)(?:.*version|)[ ]([\w.]+)/.exec(ua) || /(msie) ([\w.]+)/.exec(ua) || ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || [];
					return {
						browser: match[1] || "",
						version: match[2] || "0"
					};
				}
			},
			{
				key: "blockBodyScroll",
				value: function blockBodyScroll() {
					var className = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "p-overflow-hidden";
					!document.body.style.getPropertyValue("--scrollbar-width") && document.body.style.setProperty("--scrollbar-width", this.calculateBodyScrollbarWidth() + "px");
					this.addClass(document.body, className);
				}
			},
			{
				key: "unblockBodyScroll",
				value: function unblockBodyScroll() {
					var className = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "p-overflow-hidden";
					document.body.style.removeProperty("--scrollbar-width");
					this.removeClass(document.body, className);
				}
			},
			{
				key: "isVisible",
				value: function isVisible(element) {
					return element && (element.clientHeight !== 0 || element.getClientRects().length !== 0 || getComputedStyle(element).display !== "none");
				}
			},
			{
				key: "isExist",
				value: function isExist(element) {
					return !!(element !== null && typeof element !== "undefined" && element.nodeName && element.parentNode);
				}
			},
			{
				key: "getFocusableElements",
				value: function getFocusableElements(element) {
					var selector = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
					var focusableElements = DomHandler.find(element, "button:not([tabindex = \"-1\"]):not([disabled]):not([style*=\"display:none\"]):not([hidden])".concat(selector, ",\n                [href][clientHeight][clientWidth]:not([tabindex = \"-1\"]):not([disabled]):not([style*=\"display:none\"]):not([hidden])").concat(selector, ",\n                input:not([tabindex = \"-1\"]):not([disabled]):not([style*=\"display:none\"]):not([hidden])").concat(selector, ",\n                select:not([tabindex = \"-1\"]):not([disabled]):not([style*=\"display:none\"]):not([hidden])").concat(selector, ",\n                textarea:not([tabindex = \"-1\"]):not([disabled]):not([style*=\"display:none\"]):not([hidden])").concat(selector, ",\n                [tabIndex]:not([tabIndex = \"-1\"]):not([disabled]):not([style*=\"display:none\"]):not([hidden])").concat(selector, ",\n                [contenteditable]:not([tabIndex = \"-1\"]):not([disabled]):not([style*=\"display:none\"]):not([hidden])").concat(selector));
					var visibleFocusableElements = [];
					var _iterator3 = _createForOfIteratorHelper$1(focusableElements);
					var _step3;
					try {
						for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
							var focusableElement = _step3.value;
							if (getComputedStyle(focusableElement).display !== "none" && getComputedStyle(focusableElement).visibility !== "hidden") visibleFocusableElements.push(focusableElement);
						}
					} catch (err) {
						_iterator3.e(err);
					} finally {
						_iterator3.f();
					}
					return visibleFocusableElements;
				}
			},
			{
				key: "getFirstFocusableElement",
				value: function getFirstFocusableElement(element, selector) {
					var focusableElements = DomHandler.getFocusableElements(element, selector);
					return focusableElements.length > 0 ? focusableElements[0] : null;
				}
			},
			{
				key: "getLastFocusableElement",
				value: function getLastFocusableElement(element, selector) {
					var focusableElements = DomHandler.getFocusableElements(element, selector);
					return focusableElements.length > 0 ? focusableElements[focusableElements.length - 1] : null;
				}
			},
			{
				key: "focus",
				value: function focus(el, scrollTo) {
					var preventScroll = scrollTo === void 0 ? true : !scrollTo;
					el && document.activeElement !== el && el.focus({ preventScroll });
				}
			},
			{
				key: "focusFirstElement",
				value: function focusFirstElement(el, scrollTo) {
					if (!el) return;
					var firstFocusableElement = DomHandler.getFirstFocusableElement(el);
					firstFocusableElement && DomHandler.focus(firstFocusableElement, scrollTo);
					return firstFocusableElement;
				}
			},
			{
				key: "getCursorOffset",
				value: function getCursorOffset(el, prevText, nextText, currentText) {
					if (el) {
						var style = getComputedStyle(el);
						var ghostDiv = document.createElement("div");
						ghostDiv.style.position = "absolute";
						ghostDiv.style.top = "0px";
						ghostDiv.style.left = "0px";
						ghostDiv.style.visibility = "hidden";
						ghostDiv.style.pointerEvents = "none";
						ghostDiv.style.overflow = style.overflow;
						ghostDiv.style.width = style.width;
						ghostDiv.style.height = style.height;
						ghostDiv.style.padding = style.padding;
						ghostDiv.style.border = style.border;
						ghostDiv.style.overflowWrap = style.overflowWrap;
						ghostDiv.style.whiteSpace = style.whiteSpace;
						ghostDiv.style.lineHeight = style.lineHeight;
						ghostDiv.innerHTML = prevText.replace(/\r\n|\r|\n/g, "<br />");
						var ghostSpan = document.createElement("span");
						ghostSpan.textContent = currentText;
						ghostDiv.appendChild(ghostSpan);
						var text = document.createTextNode(nextText);
						ghostDiv.appendChild(text);
						document.body.appendChild(ghostDiv);
						var offsetLeft = ghostSpan.offsetLeft;
						var offsetTop = ghostSpan.offsetTop;
						var clientHeight = ghostSpan.clientHeight;
						document.body.removeChild(ghostDiv);
						return {
							left: Math.abs(offsetLeft - el.scrollLeft),
							top: Math.abs(offsetTop - el.scrollTop) + clientHeight
						};
					}
					return {
						top: "auto",
						left: "auto"
					};
				}
			},
			{
				key: "invokeElementMethod",
				value: function invokeElementMethod(element, methodName, args) {
					element[methodName].apply(element, args);
				}
			},
			{
				key: "isClickable",
				value: function isClickable(element) {
					var targetNode = element.nodeName;
					var parentNode = element.parentElement && element.parentElement.nodeName;
					return targetNode === "INPUT" || targetNode === "TEXTAREA" || targetNode === "BUTTON" || targetNode === "A" || parentNode === "INPUT" || parentNode === "TEXTAREA" || parentNode === "BUTTON" || parentNode === "A" || this.hasClass(element, "p-button") || this.hasClass(element.parentElement, "p-button") || this.hasClass(element.parentElement, "p-checkbox") || this.hasClass(element.parentElement, "p-radiobutton");
				}
			},
			{
				key: "applyStyle",
				value: function applyStyle(element, style) {
					if (typeof style === "string") element.style.cssText = style;
					else for (var prop in style) element.style[prop] = style[prop];
				}
			},
			{
				key: "exportCSV",
				value: function exportCSV(csv, filename) {
					var blob = new Blob([csv], { type: "application/csv;charset=utf-8;" });
					if (window.navigator.msSaveOrOpenBlob) navigator.msSaveOrOpenBlob(blob, filename + ".csv");
					else if (!DomHandler.saveAs({
						name: filename + ".csv",
						src: URL.createObjectURL(blob)
					})) {
						csv = "data:text/csv;charset=utf-8," + csv;
						window.open(encodeURI(csv));
					}
				}
			},
			{
				key: "saveAs",
				value: function saveAs(file) {
					if (file) {
						var link = document.createElement("a");
						if (link.download !== void 0) {
							var name = file.name;
							var src = file.src;
							link.setAttribute("href", src);
							link.setAttribute("download", name);
							link.style.display = "none";
							document.body.appendChild(link);
							link.click();
							document.body.removeChild(link);
							return true;
						}
					}
					return false;
				}
			},
			{
				key: "createInlineStyle",
				value: function createInlineStyle(nonce, styleContainer) {
					var styleElement = document.createElement("style");
					DomHandler.addNonce(styleElement, nonce);
					if (!styleContainer) styleContainer = document.head;
					styleContainer.appendChild(styleElement);
					return styleElement;
				}
			},
			{
				key: "removeInlineStyle",
				value: function removeInlineStyle(styleElement) {
					if (this.isExist(styleElement)) {
						try {
							styleElement.parentNode.removeChild(styleElement);
						} catch (error) {}
						styleElement = null;
					}
					return styleElement;
				}
			},
			{
				key: "addNonce",
				value: function addNonce(styleElement, nonce) {
					try {
						if (!nonce) nonce = {}.REACT_APP_CSS_NONCE;
					} catch (error) {}
					nonce && styleElement.setAttribute("nonce", nonce);
				}
			},
			{
				key: "getTargetElement",
				value: function getTargetElement(target) {
					if (!target) return null;
					if (target === "document") return document;
					else if (target === "window") return window;
					else if (_typeof$6(target) === "object" && target.hasOwnProperty("current")) return this.isExist(target.current) ? target.current : null;
					var element = function isFunction(obj) {
						return !!(obj && obj.constructor && obj.call && obj.apply);
					}(target) ? target() : target;
					return this.isDocument(element) || this.isExist(element) ? element : null;
				}
			},
			{
				key: "getAttributeNames",
				value: function getAttributeNames(node) {
					var index;
					var rv;
					var attrs;
					rv = [];
					attrs = node.attributes;
					for (index = 0; index < attrs.length; ++index) rv.push(attrs[index].nodeName);
					rv.sort();
					return rv;
				}
			},
			{
				key: "isEqualElement",
				value: function isEqualElement(elm1, elm2) {
					var attrs1;
					var attrs2;
					var name;
					var node1;
					var node2;
					attrs1 = DomHandler.getAttributeNames(elm1);
					attrs2 = DomHandler.getAttributeNames(elm2);
					if (attrs1.join(",") !== attrs2.join(",")) return false;
					for (var index = 0; index < attrs1.length; ++index) {
						name = attrs1[index];
						if (name === "style") {
							var astyle = elm1.style;
							var bstyle = elm2.style;
							var rexDigitsOnly = /^\d+$/;
							for (var _i3 = 0, _Object$keys = Object.keys(astyle); _i3 < _Object$keys.length; _i3++) {
								var key = _Object$keys[_i3];
								if (!rexDigitsOnly.test(key) && astyle[key] !== bstyle[key]) return false;
							}
						} else if (elm1.getAttribute(name) !== elm2.getAttribute(name)) return false;
					}
					for (node1 = elm1.firstChild, node2 = elm2.firstChild; node1 && node2; node1 = node1.nextSibling, node2 = node2.nextSibling) {
						if (node1.nodeType !== node2.nodeType) return false;
						if (node1.nodeType === 1) {
							if (!DomHandler.isEqualElement(node1, node2)) return false;
						} else if (node1.nodeValue !== node2.nodeValue) return false;
					}
					if (node1 || node2) return false;
					return true;
				}
			},
			{
				key: "hasCSSAnimation",
				value: function hasCSSAnimation(element) {
					if (element) {
						var style = getComputedStyle(element);
						return parseFloat(style.getPropertyValue("animation-duration") || "0") > 0;
					}
					return false;
				}
			},
			{
				key: "hasCSSTransition",
				value: function hasCSSTransition(element) {
					if (element) {
						var style = getComputedStyle(element);
						return parseFloat(style.getPropertyValue("transition-duration") || "0") > 0;
					}
					return false;
				}
			}
		]);
	}();
	/**
	* All data- properties like data-test-id
	*/
	_defineProperty$6(DomHandler, "DATA_PROPS", ["data-"]);
	/**
	* All ARIA properties like aria-label and focus-target for https://www.npmjs.com/package/@q42/floating-focus-a11y
	*/
	_defineProperty$6(DomHandler, "ARIA_PROPS", ["aria", "focus-target"]);
	function EventBus$1() {
		var allHandlers = /* @__PURE__ */ new Map();
		return {
			on: function on(type, handler) {
				var handlers = allHandlers.get(type);
				if (!handlers) handlers = [handler];
				else handlers.push(handler);
				allHandlers.set(type, handlers);
			},
			off: function off(type, handler) {
				var handlers = allHandlers.get(type);
				handlers && handlers.splice(handlers.indexOf(handler) >>> 0, 1);
			},
			emit: function emit(type, evt) {
				var handlers = allHandlers.get(type);
				handlers && handlers.slice().forEach(function(handler) {
					return handler(evt);
				});
			}
		};
	}
	__name(EventBus$1, "EventBus");
	function _createForOfIteratorHelper(r, e) {
		var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
		if (!t) {
			if (Array.isArray(r) || (t = _unsupportedIterableToArray$7(r)) || e && r && "number" == typeof r.length) {
				t && (r = t);
				var _n = 0;
				var F = function F() {};
				return {
					s: F,
					n: function n() {
						return _n >= r.length ? { done: !0 } : {
							done: !1,
							value: r[_n++]
						};
					},
					e: function e(r) {
						throw r;
					},
					f: F
				};
			}
			throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
		}
		var o;
		var a = !0;
		var u = !1;
		return {
			s: function s() {
				t = t.call(r);
			},
			n: function n() {
				var r = t.next();
				return a = r.done, r;
			},
			e: function e(r) {
				u = !0, o = r;
			},
			f: function f() {
				try {
					a || null == t["return"] || t["return"]();
				} finally {
					if (u) throw o;
				}
			}
		};
	}
	function _unsupportedIterableToArray$7(r, a) {
		if (r) {
			if ("string" == typeof r) return _arrayLikeToArray$7(r, a);
			var t = {}.toString.call(r).slice(8, -1);
			return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$7(r, a) : void 0;
		}
	}
	__name(_unsupportedIterableToArray$7, "_unsupportedIterableToArray");
	function _arrayLikeToArray$7(r, a) {
		(null == a || a > r.length) && (a = r.length);
		for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
		return n;
	}
	__name(_arrayLikeToArray$7, "_arrayLikeToArray");
	var ObjectUtils = /*#__PURE__*/ function() {
		function ObjectUtils() {
			_classCallCheck$1(this, ObjectUtils);
		}
		return _createClass$1(ObjectUtils, null, [
			{
				key: "equals",
				value: function equals(obj1, obj2, field) {
					if (field && obj1 && _typeof$6(obj1) === "object" && obj2 && _typeof$6(obj2) === "object") return this.deepEquals(this.resolveFieldData(obj1, field), this.resolveFieldData(obj2, field));
					return this.deepEquals(obj1, obj2);
				}
			},
			{
				key: "deepEquals",
				value: function deepEquals(a, b) {
					if (a === b) return true;
					if (a && b && _typeof$6(a) === "object" && _typeof$6(b) === "object") {
						var arrA = Array.isArray(a);
						var arrB = Array.isArray(b);
						var i;
						var length;
						var key;
						if (arrA && arrB) {
							length = a.length;
							if (length !== b.length) return false;
							for (i = length; i-- !== 0;) if (!this.deepEquals(a[i], b[i])) return false;
							return true;
						}
						if (arrA !== arrB) return false;
						var dateA = a instanceof Date;
						var dateB = b instanceof Date;
						if (dateA !== dateB) return false;
						if (dateA && dateB) return a.getTime() === b.getTime();
						var regexpA = a instanceof RegExp;
						var regexpB = b instanceof RegExp;
						if (regexpA !== regexpB) return false;
						if (regexpA && regexpB) return a.toString() === b.toString();
						var keys = Object.keys(a);
						length = keys.length;
						if (length !== Object.keys(b).length) return false;
						for (i = length; i-- !== 0;) if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
						for (i = length; i-- !== 0;) {
							key = keys[i];
							if (!this.deepEquals(a[key], b[key])) return false;
						}
						return true;
					}
					return a !== a && b !== b;
				}
			},
			{
				key: "resolveFieldData",
				value: function resolveFieldData(data, field) {
					if (!data || !field) return null;
					try {
						var value = data[field];
						if (this.isNotEmpty(value)) return value;
					} catch (_unused) {}
					if (Object.keys(data).length) {
						if (this.isFunction(field)) return field(data);
						else if (this.isNotEmpty(data[field])) return data[field];
						else if (field.indexOf(".") === -1) return data[field];
						var fields = field.split(".");
						var _value = data;
						for (var i = 0, len = fields.length; i < len; ++i) {
							if (_value == null) return null;
							_value = _value[fields[i]];
						}
						return _value;
					}
					return null;
				}
			},
			{
				key: "findDiffKeys",
				value: function findDiffKeys(obj1, obj2) {
					if (!obj1 || !obj2) return {};
					return Object.keys(obj1).filter(function(key) {
						return !obj2.hasOwnProperty(key);
					}).reduce(function(result, current) {
						result[current] = obj1[current];
						return result;
					}, {});
				}
			},
			{
				key: "reduceKeys",
				value: function reduceKeys(obj, startsWiths) {
					var result = {};
					if (!obj || !startsWiths || startsWiths.length === 0) return result;
					Object.keys(obj).filter(function(key) {
						return startsWiths.some(function(value) {
							return key.startsWith(value);
						});
					}).forEach(function(key) {
						result[key] = obj[key];
						delete obj[key];
					});
					return result;
				}
			},
			{
				key: "reorderArray",
				value: function reorderArray(value, from, to) {
					if (value && from !== to) {
						if (to >= value.length) {
							to = to % value.length;
							from = from % value.length;
						}
						value.splice(to, 0, value.splice(from, 1)[0]);
					}
				}
			},
			{
				key: "findIndexInList",
				value: function findIndexInList(value, list, dataKey) {
					var _this = this;
					if (list) return dataKey ? list.findIndex(function(item) {
						return _this.equals(item, value, dataKey);
					}) : list.findIndex(function(item) {
						return item === value;
					});
					return -1;
				}
			},
			{
				key: "getJSXElement",
				value: function getJSXElement(obj) {
					for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) params[_key - 1] = arguments[_key];
					return this.isFunction(obj) ? obj.apply(void 0, params) : obj;
				}
			},
			{
				key: "getItemValue",
				value: function getItemValue(obj) {
					for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) params[_key2 - 1] = arguments[_key2];
					return this.isFunction(obj) ? obj.apply(void 0, params) : obj;
				}
			},
			{
				key: "getProp",
				value: function getProp(props) {
					var prop = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
					var defaultProps = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
					var value = props ? props[prop] : void 0;
					return value === void 0 ? defaultProps[prop] : value;
				}
			},
			{
				key: "getPropCaseInsensitive",
				value: function getPropCaseInsensitive(props, prop) {
					var defaultProps = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
					var fkey = this.toFlatCase(prop);
					for (var key in props) if (props.hasOwnProperty(key) && this.toFlatCase(key) === fkey) return props[key];
					for (var _key3 in defaultProps) if (defaultProps.hasOwnProperty(_key3) && this.toFlatCase(_key3) === fkey) return defaultProps[_key3];
				}
			},
			{
				key: "getMergedProps",
				value: function getMergedProps(props, defaultProps) {
					return Object.assign({}, defaultProps, props);
				}
			},
			{
				key: "getDiffProps",
				value: function getDiffProps(props, defaultProps) {
					return this.findDiffKeys(props, defaultProps);
				}
			},
			{
				key: "getPropValue",
				value: function getPropValue(obj) {
					if (!this.isFunction(obj)) return obj;
					for (var _len3 = arguments.length, params = new Array(_len3 > 1 ? _len3 - 1 : 0), _key4 = 1; _key4 < _len3; _key4++) params[_key4 - 1] = arguments[_key4];
					if (params.length === 1) {
						var param = params[0];
						return obj(Array.isArray(param) ? param[0] : param);
					}
					return obj.apply(void 0, params);
				}
			},
			{
				key: "getComponentProp",
				value: function getComponentProp(component) {
					var prop = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
					var defaultProps = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
					return this.isNotEmpty(component) ? this.getProp(component.props, prop, defaultProps) : void 0;
				}
			},
			{
				key: "getComponentProps",
				value: function getComponentProps(component, defaultProps) {
					return this.isNotEmpty(component) ? this.getMergedProps(component.props, defaultProps) : void 0;
				}
			},
			{
				key: "getComponentDiffProps",
				value: function getComponentDiffProps(component, defaultProps) {
					return this.isNotEmpty(component) ? this.getDiffProps(component.props, defaultProps) : void 0;
				}
			},
			{
				key: "isValidChild",
				value: function isValidChild(child, type, validTypes) {
					if (child) {
						var _child$type;
						var childType = this.getComponentProp(child, "__TYPE") || (child.type ? child.type.displayName : void 0);
						if (!childType && child !== null && child !== void 0 && (_child$type = child.type) !== null && _child$type !== void 0 && (_child$type = _child$type._payload) !== null && _child$type !== void 0 && _child$type.value) childType = child.type._payload.value.find(function(v) {
							return v === type;
						});
						return childType === type;
					}
					return false;
				}
			},
			{
				key: "getRefElement",
				value: function getRefElement(ref) {
					if (ref) return _typeof$6(ref) === "object" && ref.hasOwnProperty("current") ? ref.current : ref;
					return null;
				}
			},
			{
				key: "combinedRefs",
				value: function combinedRefs(innerRef, forwardRef) {
					if (innerRef && forwardRef) if (typeof forwardRef === "function") forwardRef(innerRef.current);
					else forwardRef.current = innerRef.current;
				}
			},
			{
				key: "removeAccents",
				value: function removeAccents(str) {
					if (str && str.search(/[\xC0-\xFF]/g) > -1) str = str.replace(/[\xC0-\xC5]/g, "A").replace(/[\xC6]/g, "AE").replace(/[\xC7]/g, "C").replace(/[\xC8-\xCB]/g, "E").replace(/[\xCC-\xCF]/g, "I").replace(/[\xD0]/g, "D").replace(/[\xD1]/g, "N").replace(/[\xD2-\xD6\xD8]/g, "O").replace(/[\xD9-\xDC]/g, "U").replace(/[\xDD]/g, "Y").replace(/[\xDE]/g, "P").replace(/[\xE0-\xE5]/g, "a").replace(/[\xE6]/g, "ae").replace(/[\xE7]/g, "c").replace(/[\xE8-\xEB]/g, "e").replace(/[\xEC-\xEF]/g, "i").replace(/[\xF1]/g, "n").replace(/[\xF2-\xF6\xF8]/g, "o").replace(/[\xF9-\xFC]/g, "u").replace(/[\xFE]/g, "p").replace(/[\xFD\xFF]/g, "y");
					return str;
				}
			},
			{
				key: "toFlatCase",
				value: function toFlatCase(str) {
					return this.isNotEmpty(str) && this.isString(str) ? str.replace(/(-|_)/g, "").toLowerCase() : str;
				}
			},
			{
				key: "toCapitalCase",
				value: function toCapitalCase(str) {
					return this.isNotEmpty(str) && this.isString(str) ? str[0].toUpperCase() + str.slice(1) : str;
				}
			},
			{
				key: "trim",
				value: function trim(value) {
					return this.isNotEmpty(value) && this.isString(value) ? value.trim() : value;
				}
			},
			{
				key: "isEmpty",
				value: function isEmpty(value) {
					return value === null || value === void 0 || value === "" || Array.isArray(value) && value.length === 0 || !(value instanceof Date) && _typeof$6(value) === "object" && Object.keys(value).length === 0;
				}
			},
			{
				key: "isNotEmpty",
				value: function isNotEmpty(value) {
					return !this.isEmpty(value);
				}
			},
			{
				key: "isFunction",
				value: function isFunction(value) {
					return !!(value && value.constructor && value.call && value.apply);
				}
			},
			{
				key: "isObject",
				value: function isObject(value) {
					return value !== null && value instanceof Object && value.constructor === Object;
				}
			},
			{
				key: "isDate",
				value: function isDate(value) {
					return value !== null && value instanceof Date && value.constructor === Date;
				}
			},
			{
				key: "isArray",
				value: function isArray(value) {
					return value !== null && Array.isArray(value);
				}
			},
			{
				key: "isString",
				value: function isString(value) {
					return value !== null && typeof value === "string";
				}
			},
			{
				key: "isPrintableCharacter",
				value: function isPrintableCharacter() {
					var _char = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
					return this.isNotEmpty(_char) && _char.length === 1 && _char.match(/\S| /);
				}
			},
			{
				key: "isLetter",
				value: function isLetter(_char2) {
					return /^[a-zA-Z\u00C0-\u017F]$/.test(_char2);
				}
			},
			{
				key: "isScalar",
				value: function isScalar(value) {
					return value != null && (typeof value === "string" || typeof value === "number" || typeof value === "bigint" || typeof value === "boolean");
				}
			},
			{
				key: "findLast",
				value: function findLast(arr, callback) {
					var item;
					if (this.isNotEmpty(arr)) try {
						item = arr.findLast(callback);
					} catch (_unused2) {
						item = _toConsumableArray$5(arr).reverse().find(callback);
					}
					return item;
				}
			},
			{
				key: "findLastIndex",
				value: function findLastIndex(arr, callback) {
					var index = -1;
					if (this.isNotEmpty(arr)) try {
						index = arr.findLastIndex(callback);
					} catch (_unused3) {
						index = arr.lastIndexOf(_toConsumableArray$5(arr).reverse().find(callback));
					}
					return index;
				}
			},
			{
				key: "sort",
				value: function sort(value1, value2) {
					var order = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1;
					var comparator = arguments.length > 3 ? arguments[3] : void 0;
					var nullSortOrder = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : 1;
					var result = this.compare(value1, value2, comparator, order);
					var finalSortOrder = order;
					if (this.isEmpty(value1) || this.isEmpty(value2)) finalSortOrder = nullSortOrder === 1 ? order : nullSortOrder;
					return finalSortOrder * result;
				}
			},
			{
				key: "compare",
				value: function compare(value1, value2, comparator) {
					var order = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 1;
					var result = -1;
					var emptyValue1 = this.isEmpty(value1);
					var emptyValue2 = this.isEmpty(value2);
					if (emptyValue1 && emptyValue2) result = 0;
					else if (emptyValue1) result = order;
					else if (emptyValue2) result = -order;
					else if (typeof value1 === "string" && typeof value2 === "string") result = comparator(value1, value2);
					else result = value1 < value2 ? -1 : value1 > value2 ? 1 : 0;
					return result;
				}
			},
			{
				key: "localeComparator",
				value: function localeComparator(locale) {
					return new Intl.Collator(locale, { numeric: true }).compare;
				}
			},
			{
				key: "findChildrenByKey",
				value: function findChildrenByKey(data, key) {
					var _iterator = _createForOfIteratorHelper(data);
					var _step;
					try {
						for (_iterator.s(); !(_step = _iterator.n()).done;) {
							var item = _step.value;
							if (item.key === key) return item.children || [];
							else if (item.children) {
								var result = this.findChildrenByKey(item.children, key);
								if (result.length > 0) return result;
							}
						}
					} catch (err) {
						_iterator.e(err);
					} finally {
						_iterator.f();
					}
					return [];
				}
			},
			{
				key: "mutateFieldData",
				value: function mutateFieldData(data, field, value) {
					if (_typeof$6(data) !== "object" || typeof field !== "string") return;
					var fields = field.split(".");
					var obj = data;
					for (var i = 0, len = fields.length; i < len; ++i) {
						if (i + 1 - len === 0) {
							obj[fields[i]] = value;
							break;
						}
						if (!obj[fields[i]]) obj[fields[i]] = {};
						obj = obj[fields[i]];
					}
				}
			},
			{
				key: "getNestedValue",
				value: function getNestedValue(obj, path) {
					return path.split(".").reduce(function(acc, part) {
						return acc && acc[part] !== void 0 ? acc[part] : void 0;
					}, obj);
				}
			},
			{
				key: "absoluteCompare",
				value: function absoluteCompare(objA, objB) {
					var maxDepth = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1;
					var currentDepth = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0;
					if (!objA || !objB) return true;
					if (currentDepth > maxDepth) return true;
					if (_typeof$6(objA) !== _typeof$6(objB)) return false;
					var aKeys = Object.keys(objA);
					var bKeys = Object.keys(objB);
					if (aKeys.length !== bKeys.length) return false;
					for (var _i = 0, _aKeys = aKeys; _i < _aKeys.length; _i++) {
						var key = _aKeys[_i];
						var aValue = objA[key];
						var bValue = objB[key];
						var isObject = ObjectUtils.isObject(aValue) && ObjectUtils.isObject(bValue);
						var isFunction = ObjectUtils.isFunction(aValue) && ObjectUtils.isFunction(bValue);
						if ((isObject || isFunction) && !this.absoluteCompare(aValue, bValue, maxDepth, currentDepth + 1)) return false;
						if (!isObject && aValue !== bValue) return false;
					}
					return true;
				}
			},
			{
				key: "selectiveCompare",
				value: function selectiveCompare(a, b, keysToCompare) {
					var maxDepth = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 1;
					if (a === b) return true;
					if (!a || !b || _typeof$6(a) !== "object" || _typeof$6(b) !== "object") return false;
					if (!keysToCompare) return this.absoluteCompare(a, b, 1);
					var _iterator2 = _createForOfIteratorHelper(keysToCompare);
					var _step2;
					try {
						for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
							var key = _step2.value;
							var aValue = this.getNestedValue(a, key);
							var bValue = this.getNestedValue(b, key);
							var isObject = _typeof$6(aValue) === "object" && aValue !== null && _typeof$6(bValue) === "object" && bValue !== null;
							if (isObject && !this.absoluteCompare(aValue, bValue, maxDepth)) return false;
							if (!isObject && aValue !== bValue) return false;
						}
					} catch (err) {
						_iterator2.e(err);
					} finally {
						_iterator2.f();
					}
					return true;
				}
			}
		]);
	}();
	var lastId = 0;
	function UniqueComponentId() {
		var prefix = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "pr_id_";
		lastId++;
		return "".concat(prefix).concat(lastId);
	}
	function ownKeys$6(e, r) {
		var t = Object.keys(e);
		if (Object.getOwnPropertySymbols) {
			var o = Object.getOwnPropertySymbols(e);
			r && (o = o.filter(function(r) {
				return Object.getOwnPropertyDescriptor(e, r).enumerable;
			})), t.push.apply(t, o);
		}
		return t;
	}
	__name(ownKeys$6, "ownKeys");
	function _objectSpread$6(e) {
		for (var r = 1; r < arguments.length; r++) {
			var t = null != arguments[r] ? arguments[r] : {};
			r % 2 ? ownKeys$6(Object(t), !0).forEach(function(r) {
				_defineProperty$6(e, r, t[r]);
			}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$6(Object(t)).forEach(function(r) {
				Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
			});
		}
		return e;
	}
	__name(_objectSpread$6, "_objectSpread");
	/**
	* Merges properties together taking an Array of props and merging into one single set of
	* properties. The options can contain a "classNameMergeFunction" which can be something
	* like Tailwind Merge for properly merging Tailwind classes.
	*
	* @param {object[]} props the array of object properties to merge
	* @param {*} options either empty or could contain a custom merge function like TailwindMerge
	* @returns the single properties value after merging
	*/
	function mergeProps(props) {
		var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
		if (!props) return;
		var isFunction = function isFunction(obj) {
			return typeof obj === "function";
		};
		var classNameMergeFunction = options.classNameMergeFunction;
		var hasMergeFunction = isFunction(classNameMergeFunction);
		return props.reduce(function(merged, ps) {
			if (!ps) return merged;
			var _loop = function _loop() {
				var value = ps[key];
				if (key === "style") merged.style = _objectSpread$6(_objectSpread$6({}, merged.style), ps.style);
				else if (key === "className") {
					var newClassName = "";
					if (hasMergeFunction) newClassName = classNameMergeFunction(merged.className, ps.className);
					else newClassName = [merged.className, ps.className].join(" ").trim();
					merged.className = newClassName || void 0;
				} else if (isFunction(value)) {
					var existingFn = merged[key];
					merged[key] = existingFn ? function() {
						existingFn.apply(void 0, arguments);
						value.apply(void 0, arguments);
					} : value;
				} else merged[key] = value;
			};
			for (var key in ps) _loop();
			return merged;
		}, {});
	}
	function handler() {
		var zIndexes = [];
		var generateZIndex = function generateZIndex(key, autoZIndex) {
			var baseZIndex = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 999;
			var lastZIndex = getLastZIndex(key, autoZIndex, baseZIndex);
			var newZIndex = lastZIndex.value + (lastZIndex.key === key ? 0 : baseZIndex) + 1;
			zIndexes.push({
				key,
				value: newZIndex
			});
			return newZIndex;
		};
		var revertZIndex = function revertZIndex(zIndex) {
			zIndexes = zIndexes.filter(function(obj) {
				return obj.value !== zIndex;
			});
		};
		var getCurrentZIndex = function getCurrentZIndex(key, autoZIndex) {
			return getLastZIndex(key, autoZIndex).value;
		};
		var getLastZIndex = function getLastZIndex(key, autoZIndex) {
			var baseZIndex = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;
			return _toConsumableArray$5(zIndexes).reverse().find(function(obj) {
				return autoZIndex ? true : obj.key === key;
			}) || {
				key,
				value: baseZIndex
			};
		};
		return {
			get: function getZIndex(el) {
				return el ? parseInt(el.style.zIndex, 10) || 0 : 0;
			},
			set: function set(key, el, autoZIndex, baseZIndex) {
				if (el) el.style.zIndex = String(generateZIndex(key, autoZIndex, baseZIndex));
			},
			clear: function clear(el) {
				if (el) {
					revertZIndex(ZIndexUtils.get(el));
					el.style.zIndex = "";
				}
			},
			getCurrent: function getCurrent(key, autoZIndex) {
				return getCurrentZIndex(key, autoZIndex);
			}
		};
	}
	var ZIndexUtils = handler();

//#endregion
//#region node_modules/primereact/api/api.esm.js
	var FilterMatchMode = Object.freeze({
		STARTS_WITH: "startsWith",
		CONTAINS: "contains",
		NOT_CONTAINS: "notContains",
		ENDS_WITH: "endsWith",
		EQUALS: "equals",
		NOT_EQUALS: "notEquals",
		IN: "in",
		NOT_IN: "notIn",
		LESS_THAN: "lt",
		LESS_THAN_OR_EQUAL_TO: "lte",
		GREATER_THAN: "gt",
		GREATER_THAN_OR_EQUAL_TO: "gte",
		BETWEEN: "between",
		DATE_IS: "dateIs",
		DATE_IS_NOT: "dateIsNot",
		DATE_BEFORE: "dateBefore",
		DATE_AFTER: "dateAfter",
		CUSTOM: "custom"
	});
	var FilterOperator = Object.freeze({
		AND: "and",
		OR: "or"
	});
	function _typeof$5(o) {
		"@babel/helpers - typeof";
		return _typeof$5 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
			return typeof o;
		} : function(o) {
			return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
		}, _typeof$5(o);
	}
	__name(_typeof$5, "_typeof");
	function toPrimitive$5(t, r) {
		if ("object" != _typeof$5(t) || !t) return t;
		var e = t[Symbol.toPrimitive];
		if (void 0 !== e) {
			var i = e.call(t, r || "default");
			if ("object" != _typeof$5(i)) return i;
			throw new TypeError("@@toPrimitive must return a primitive value.");
		}
		return ("string" === r ? String : Number)(t);
	}
	__name(toPrimitive$5, "toPrimitive");
	function toPropertyKey$5(t) {
		var i = toPrimitive$5(t, "string");
		return "symbol" == _typeof$5(i) ? i : i + "";
	}
	__name(toPropertyKey$5, "toPropertyKey");
	function _defineProperty$5(e, r, t) {
		return (r = toPropertyKey$5(r)) in e ? Object.defineProperty(e, r, {
			value: t,
			enumerable: !0,
			configurable: !0,
			writable: !0
		}) : e[r] = t, e;
	}
	__name(_defineProperty$5, "_defineProperty");
	function _defineProperties(e, r) {
		for (var t = 0; t < r.length; t++) {
			var o = r[t];
			o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey$5(o.key), o);
		}
	}
	function _createClass(e, r, t) {
		return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e;
	}
	function _classCallCheck(a, n) {
		if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
	}
	/**
	* @deprecated please use PrimeReactContext
	*/
	var PrimeReact$1 = /*#__PURE__*/ _createClass(function PrimeReact() {
		_classCallCheck(this, PrimeReact);
	});
	_defineProperty$5(PrimeReact$1, "ripple", false);
	_defineProperty$5(PrimeReact$1, "inputStyle", "outlined");
	_defineProperty$5(PrimeReact$1, "locale", "en");
	_defineProperty$5(PrimeReact$1, "appendTo", null);
	_defineProperty$5(PrimeReact$1, "cssTransition", true);
	_defineProperty$5(PrimeReact$1, "autoZIndex", true);
	_defineProperty$5(PrimeReact$1, "hideOverlaysOnDocumentScrolling", false);
	_defineProperty$5(PrimeReact$1, "nonce", null);
	_defineProperty$5(PrimeReact$1, "nullSortOrder", 1);
	_defineProperty$5(PrimeReact$1, "zIndex", {
		modal: 1100,
		overlay: 1e3,
		menu: 1e3,
		tooltip: 1100,
		toast: 1200
	});
	_defineProperty$5(PrimeReact$1, "pt", void 0);
	_defineProperty$5(PrimeReact$1, "filterMatchModeOptions", {
		text: [
			FilterMatchMode.STARTS_WITH,
			FilterMatchMode.CONTAINS,
			FilterMatchMode.NOT_CONTAINS,
			FilterMatchMode.ENDS_WITH,
			FilterMatchMode.EQUALS,
			FilterMatchMode.NOT_EQUALS
		],
		numeric: [
			FilterMatchMode.EQUALS,
			FilterMatchMode.NOT_EQUALS,
			FilterMatchMode.LESS_THAN,
			FilterMatchMode.LESS_THAN_OR_EQUAL_TO,
			FilterMatchMode.GREATER_THAN,
			FilterMatchMode.GREATER_THAN_OR_EQUAL_TO
		],
		date: [
			FilterMatchMode.DATE_IS,
			FilterMatchMode.DATE_IS_NOT,
			FilterMatchMode.DATE_BEFORE,
			FilterMatchMode.DATE_AFTER
		]
	});
	_defineProperty$5(PrimeReact$1, "changeTheme", function(currentTheme, newTheme, linkElementId, callback) {
		var _linkElement$parentNo;
		var linkElement = document.getElementById(linkElementId);
		if (!linkElement) throw Error("Element with id ".concat(linkElementId, " not found."));
		var newThemeUrl = linkElement.getAttribute("href").replace(currentTheme, newTheme);
		var newLinkElement = document.createElement("link");
		newLinkElement.setAttribute("rel", "stylesheet");
		newLinkElement.setAttribute("id", linkElementId);
		newLinkElement.setAttribute("href", newThemeUrl);
		newLinkElement.addEventListener("load", function() {
			if (callback) callback();
		});
		(_linkElement$parentNo = linkElement.parentNode) === null || _linkElement$parentNo === void 0 || _linkElement$parentNo.replaceChild(newLinkElement, linkElement);
	});
	var MessageSeverity = Object.freeze({
		SUCCESS: "success",
		INFO: "info",
		WARN: "warn",
		ERROR: "error",
		SECONDARY: "secondary",
		CONTRAST: "contrast"
	});
	var PrimeIcons = Object.freeze({
		ADDRESS_BOOK: "pi pi-address-book",
		ALIGN_CENTER: "pi pi-align-center",
		ALIGN_JUSTIFY: "pi pi-align-justify",
		ALIGN_LEFT: "pi pi-align-left",
		ALIGN_RIGHT: "pi pi-align-right",
		AMAZON: "pi pi-amazon",
		ANDROID: "pi pi-android",
		ANGLE_DOUBLE_DOWN: "pi pi-angle-double-down",
		ANGLE_DOUBLE_LEFT: "pi pi-angle-double-left",
		ANGLE_DOUBLE_RIGHT: "pi pi-angle-double-right",
		ANGLE_DOUBLE_UP: "pi pi-angle-double-up",
		ANGLE_DOWN: "pi pi-angle-down",
		ANGLE_LEFT: "pi pi-angle-left",
		ANGLE_RIGHT: "pi pi-angle-right",
		ANGLE_UP: "pi pi-angle-up",
		APPLE: "pi pi-apple",
		ARROW_CIRCLE_DOWN: "pi pi-arrow-circle-down",
		ARROW_CIRCLE_LEFT: "pi pi-arrow-circle-left",
		ARROW_CIRCLE_RIGHT: "pi pi-arrow-circle-right",
		ARROW_CIRCLE_UP: "pi pi-arrow-circle-up",
		ARROW_DOWN_LEFT_AND_ARROW_UP_RIGHT_TO_CENTER: "pi pi-arrow-down-left-and-arrow-up-right-to-center",
		ARROW_DOWN_LEFT: "pi pi-arrow-down-left",
		ARROW_DOWN_RIGHT: "pi pi-arrow-down-right",
		ARROW_DOWN: "pi pi-arrow-down",
		ARROW_LEFT: "pi pi-arrow-left",
		ARROW_RIGHT_ARROW_LEFT: "pi pi-arrow-right-arrow-left",
		ARROW_RIGHT: "pi pi-arrow-right",
		ARROW_UP_LEFT: "pi pi-arrow-up-left",
		ARROW_UP_RIGHT_AND_ARROW_DOWN_LEFT_FROM_CENTER: "pi pi-arrow-up-right-and-arrow-down-left-from-center",
		ARROW_UP_RIGHT: "pi pi-arrow-up-right",
		ARROW_UP: "pi pi-arrow-up",
		ARROWS_ALT: "pi pi-arrows-alt",
		ARROWS_H: "pi pi-arrows-h",
		ARROWS_V: "pi pi-arrows-v",
		ASTERISK: "pi pi-asterisk",
		AT: "pi pi-at",
		BACKWARD: "pi pi-backward",
		BAN: "pi pi-ban",
		BARCODE: "pi pi-barcode",
		BARS: "pi pi-bars",
		BELL_SLASH: "pi pi-bell-slash",
		BELL: "pi pi-bell",
		BITCOIN: "pi pi-bitcoin",
		BOLT: "pi pi-bolt",
		BOOK: "pi pi-book",
		BOOKMARK_FILL: "pi pi-bookmark-fill",
		BOOKMARK: "pi pi-bookmark",
		BOX: "pi pi-box",
		BRIEFCASE: "pi pi-briefcase",
		BUILDING_COLUMNS: "pi pi-building-columns",
		BUILDING: "pi pi-building",
		BULLSEYE: "pi pi-bullseye",
		CALCULATOR: "pi pi-calculator",
		CALENDAR_CLOCK: "pi pi-calendar-clock",
		CALENDAR_MINUS: "pi pi-calendar-minus",
		CALENDAR_PLUS: "pi pi-calendar-plus",
		CALENDAR_TIMES: "pi pi-calendar-times",
		CALENDAR: "pi pi-calendar",
		CAMERA: "pi pi-camera",
		CAR: "pi pi-car",
		CARET_DOWN: "pi pi-caret-down",
		CARET_LEFT: "pi pi-caret-left",
		CARET_RIGHT: "pi pi-caret-right",
		CARET_UP: "pi pi-caret-up",
		CART_ARROW_DOWN: "pi pi-cart-arrow-down",
		CART_MINUS: "pi pi-cart-minus",
		CART_PLUS: "pi pi-cart-plus",
		CHART_BAR: "pi pi-chart-bar",
		CHART_LINE: "pi pi-chart-line",
		CHART_PIE: "pi pi-chart-pie",
		CHART_SCATTER: "pi pi-chart-scatter",
		CHECK_CIRCLE: "pi pi-check-circle",
		CHECK_SQUARE: "pi pi-check-square",
		CHECK: "pi pi-check",
		CHEVRON_CIRCLE_DOWN: "pi pi-chevron-circle-down",
		CHEVRON_CIRCLE_LEFT: "pi pi-chevron-circle-left",
		CHEVRON_CIRCLE_RIGHT: "pi pi-chevron-circle-right",
		CHEVRON_CIRCLE_UP: "pi pi-chevron-circle-up",
		CHEVRON_DOWN: "pi pi-chevron-down",
		CHEVRON_LEFT: "pi pi-chevron-left",
		CHEVRON_RIGHT: "pi pi-chevron-right",
		CHEVRON_UP: "pi pi-chevron-up",
		CIRCLE_FILL: "pi pi-circle-fill",
		CIRCLE_OFF: "pi pi-circle-off",
		CIRCLE_ON: "pi pi-circle-on",
		CIRCLE: "pi pi-circle",
		CLIPBOARD: "pi pi-clipboard",
		CLOCK: "pi pi-clock",
		CLONE: "pi pi-clone",
		CLOUD_DOWNLOAD: "pi pi-cloud-download",
		CLOUD_UPLOAD: "pi pi-cloud-upload",
		CLOUD: "pi pi-cloud",
		CODE: "pi pi-code",
		COG: "pi pi-cog",
		COMMENT: "pi pi-comment",
		COMMENTS: "pi pi-comments",
		COMPASS: "pi pi-compass",
		COPY: "pi pi-copy",
		CREDIT_CARD: "pi pi-credit-card",
		CROWN: "pi pi-crown",
		DATABASE: "pi pi-database",
		DELETE_LEFT: "pi pi-delete-left",
		DESKTOP: "pi pi-desktop",
		DIRECTIONS_ALT: "pi pi-directions-alt",
		DIRECTIONS: "pi pi-directions",
		DISCORD: "pi pi-discord",
		DOLLAR: "pi pi-dollar",
		DOWNLOAD: "pi pi-download",
		EJECT: "pi pi-eject",
		ELLIPSIS_H: "pi pi-ellipsis-h",
		ELLIPSIS_V: "pi pi-ellipsis-v",
		ENVELOPE: "pi pi-envelope",
		EQUALS: "pi pi-equals",
		ERASER: "pi pi-eraser",
		ETHEREUM: "pi pi-ethereum",
		EURO: "pi pi-euro",
		EXCLAMATION_CIRCLE: "pi pi-exclamation-circle",
		EXCLAMATION_TRIANGLE: "pi pi-exclamation-triangle",
		EXPAND: "pi pi-expand",
		EXTERNAL_LINK: "pi pi-external-link",
		EYE_SLASH: "pi pi-eye-slash",
		EYE: "pi pi-eye",
		FACE_SMILE: "pi pi-face-smile",
		FACEBOOK: "pi pi-facebook",
		FAST_BACKWARD: "pi pi-fast-backward",
		FAST_FORWARD: "pi pi-fast-forward",
		FILE_ARROW_UP: "pi pi-file-arrow-up",
		FILE_CHECK: "pi pi-file-check",
		FILE_EDIT: "pi pi-file-edit",
		FILE_EXCEL: "pi pi-file-excel",
		FILE_EXPORT: "pi pi-file-export",
		FILE_IMPORT: "pi pi-file-import",
		FILE_O: "pi pi-file-o",
		FILE_PDF: "pi pi-file-pdf",
		FILE_PLUS: "pi pi-file-plus",
		FILE_WORD: "pi pi-file-word",
		FILE: "pi pi-file",
		FILTER_FILL: "pi pi-filter-fill",
		FILTER_SLASH: "pi pi-filter-slash",
		FILTER: "pi pi-filter",
		FLAG_FILL: "pi pi-flag-fill",
		FLAG: "pi pi-flag",
		FOLDER_OPEN: "pi pi-folder-open",
		FOLDER_PLUS: "pi pi-folder-plus",
		FOLDER: "pi pi-folder",
		FORWARD: "pi pi-forward",
		GAUGE: "pi pi-gauge",
		GIFT: "pi pi-gift",
		GITHUB: "pi pi-github",
		GLOBE: "pi pi-globe",
		GOOGLE: "pi pi-google",
		GRADUATION_CAP: "pi pi-graduation-cap",
		HAMMER: "pi pi-hammer",
		HASHTAG: "pi pi-hashtag",
		HEADPHONES: "pi pi-headphones",
		HEART_FILL: "pi pi-heart-fill",
		HEART: "pi pi-heart",
		HISTORY: "pi pi-history",
		HOME: "pi pi-home",
		HOURGLASS: "pi pi-hourglass",
		ID_CARD: "pi pi-id-card",
		IMAGE: "pi pi-image",
		IMAGES: "pi pi-images",
		INBOX: "pi pi-inbox",
		INDIAN_RUPEE: "pi pi-indian-rupee",
		INFO_CIRCLE: "pi pi-info-circle",
		INFO: "pi pi-info",
		INSTAGRAM: "pi pi-instagram",
		KEY: "pi pi-key",
		LANGUAGE: "pi pi-language",
		LIGHTBULB: "pi pi-lightbulb",
		LINK: "pi pi-link",
		LINKEDIN: "pi pi-linkedin",
		LIST_CHECK: "pi pi-list-check",
		LIST: "pi pi-list",
		LOCK_OPEN: "pi pi-lock-open",
		LOCK: "pi pi-lock",
		MAP_MARKER: "pi pi-map-marker",
		MAP: "pi pi-map",
		MARS: "pi pi-mars",
		MEGAPHONE: "pi pi-megaphone",
		MICROCHIP_AI: "pi pi-microchip-ai",
		MICROCHIP: "pi pi-microchip",
		MICROPHONE: "pi pi-microphone",
		MICROSOFT: "pi pi-microsoft",
		MINUS_CIRCLE: "pi pi-minus-circle",
		MINUS: "pi pi-minus",
		MOBILE: "pi pi-mobile",
		MONEY_BILL: "pi pi-money-bill",
		MOON: "pi pi-moon",
		OBJECTS_COLUMN: "pi pi-objects-column",
		PALETTE: "pi pi-palette",
		PAPERCLIP: "pi pi-paperclip",
		PAUSE_CIRCLE: "pi pi-pause-circle",
		PAUSE: "pi pi-pause",
		PAYPAL: "pi pi-paypal",
		PEN_TO_SQUARE: "pi pi-pen-to-square",
		PENCIL: "pi pi-pencil",
		PERCENTAGE: "pi pi-percentage",
		PHONE: "pi pi-phone",
		PINTEREST: "pi pi-pinterest",
		PLAY_CIRCLE: "pi pi-play-circle",
		PLAY: "pi pi-play",
		PLUS_CIRCLE: "pi pi-plus-circle",
		PLUS: "pi pi-plus",
		POUND: "pi pi-pound",
		POWER_OFF: "pi pi-power-off",
		PRIME: "pi pi-prime",
		PRINT: "pi pi-print",
		QRCODE: "pi pi-qrcode",
		QUESTION_CIRCLE: "pi pi-question-circle",
		QUESTION: "pi pi-question",
		RECEIPT: "pi pi-receipt",
		REDDIT: "pi pi-reddit",
		REFRESH: "pi pi-refresh",
		REPLAY: "pi pi-replay",
		REPLY: "pi pi-reply",
		SAVE: "pi pi-save",
		SEARCH_MINUS: "pi pi-search-minus",
		SEARCH_PLUS: "pi pi-search-plus",
		SEARCH: "pi pi-search",
		SEND: "pi pi-send",
		SERVER: "pi pi-server",
		SHARE_ALT: "pi pi-share-alt",
		SHIELD: "pi pi-shield",
		SHOP: "pi pi-shop",
		SHOPPING_BAG: "pi pi-shopping-bag",
		SHOPPING_CART: "pi pi-shopping-cart",
		SIGN_IN: "pi pi-sign-in",
		SIGN_OUT: "pi pi-sign-out",
		SITEMAP: "pi pi-sitemap",
		SLACK: "pi pi-slack",
		SLIDERS_H: "pi pi-sliders-h",
		SLIDERS_V: "pi pi-sliders-v",
		SORT_ALPHA_DOWN_ALT: "pi pi-sort-alpha-down-alt",
		SORT_ALPHA_DOWN: "pi pi-sort-alpha-down",
		SORT_ALPHA_UP_ALT: "pi pi-sort-alpha-up-alt",
		SORT_ALPHA_UP: "pi pi-sort-alpha-up",
		SORT_ALT_SLASH: "pi pi-sort-alt-slash",
		SORT_ALT: "pi pi-sort-alt",
		SORT_AMOUNT_DOWN_ALT: "pi pi-sort-amount-down-alt",
		SORT_AMOUNT_DOWN: "pi pi-sort-amount-down",
		SORT_AMOUNT_UP_ALT: "pi pi-sort-amount-up-alt",
		SORT_AMOUNT_UP: "pi pi-sort-amount-up",
		SORT_DOWN_FILL: "pi pi-sort-down-fill",
		SORT_DOWN: "pi pi-sort-down",
		SORT_NUMERIC_DOWN_ALT: "pi pi-sort-numeric-down-alt",
		SORT_NUMERIC_DOWN: "pi pi-sort-numeric-down",
		SORT_NUMERIC_UP_ALT: "pi pi-sort-numeric-up-alt",
		SORT_NUMERIC_UP: "pi pi-sort-numeric-up",
		SORT_UP_FILL: "pi pi-sort-up-fill",
		SORT_UP: "pi pi-sort-up",
		SORT: "pi pi-sort",
		SPARKLES: "pi pi-sparkles",
		SPINNER_DOTTED: "pi pi-spinner-dotted",
		SPINNER: "pi pi-spinner",
		STAR_FILL: "pi pi-star-fill",
		STAR_HALF_FILL: "pi pi-star-half-fill",
		STAR_HALF: "pi pi-star-half",
		STAR: "pi pi-star",
		STEP_BACKWARD_ALT: "pi pi-step-backward-alt",
		STEP_BACKWARD: "pi pi-step-backward",
		STEP_FORWARD_ALT: "pi pi-step-forward-alt",
		STEP_FORWARD: "pi pi-step-forward",
		STOP_CIRCLE: "pi pi-stop-circle",
		STOP: "pi pi-stop",
		STOPWATCH: "pi pi-stopwatch",
		SUN: "pi pi-sun",
		SYNC: "pi pi-sync",
		TABLE: "pi pi-table",
		TABLET: "pi pi-tablet",
		TAG: "pi pi-tag",
		TAGS: "pi pi-tags",
		TELEGRAM: "pi pi-telegram",
		TH_LARGE: "pi pi-th-large",
		THUMBS_DOWN_FILL: "pi pi-thumbs-down-fill",
		THUMBS_DOWN: "pi pi-thumbs-down",
		THUMBS_UP_FILL: "pi pi-thumbs-up-fill",
		THUMBS_UP: "pi pi-thumbs-up",
		THUMBTACK: "pi pi-thumbtack",
		TICKET: "pi pi-ticket",
		TIKTOK: "pi pi-tiktok",
		TIMES_CIRCLE: "pi pi-times-circle",
		TIMES: "pi pi-times",
		TRASH: "pi pi-trash",
		TROPHY: "pi pi-trophy",
		TRUCK: "pi pi-truck",
		TURKISH_LIRA: "pi pi-turkish-lira",
		TWITCH: "pi pi-twitch",
		TWITTER: "pi pi-twitter",
		UNDO: "pi pi-undo",
		UNLOCK: "pi pi-unlock",
		UPLOAD: "pi pi-upload",
		USER_EDIT: "pi pi-user-edit",
		USER_MINUS: "pi pi-user-minus",
		USER_PLUS: "pi pi-user-plus",
		USER: "pi pi-user",
		USERS: "pi pi-users",
		VENUS: "pi pi-venus",
		VERIFIED: "pi pi-verified",
		VIDEO: "pi pi-video",
		VIMEO: "pi pi-vimeo",
		VOLUME_DOWN: "pi pi-volume-down",
		VOLUME_OFF: "pi pi-volume-off",
		VOLUME_UP: "pi pi-volume-up",
		WALLET: "pi pi-wallet",
		WAREHOUSE: "pi pi-warehouse",
		WAVE_PULSE: "pi pi-wave-pulse",
		WHATSAPP: "pi pi-whatsapp",
		WIFI: "pi pi-wifi",
		WINDOW_MAXIMIZE: "pi pi-window-maximize",
		WINDOW_MINIMIZE: "pi pi-window-minimize",
		WRENCH: "pi pi-wrench",
		YOUTUBE: "pi pi-youtube"
	});
	var SortOrder = Object.freeze({
		DESC: -1,
		UNSORTED: 0,
		ASC: 1
	});
	var PrimeReactContext = /*#__PURE__*/ react.default.createContext();
	var PrimeReact = PrimeReact$1;

//#endregion
//#region node_modules/primereact/hooks/hooks.esm.js
	function _arrayWithHoles$4(r) {
		if (Array.isArray(r)) return r;
	}
	__name(_arrayWithHoles$4, "_arrayWithHoles");
	function _iterableToArrayLimit$4(r, l) {
		var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
		if (null != t) {
			var e;
			var n;
			var i;
			var u;
			var a = [];
			var f = !0;
			var o = !1;
			try {
				if (i = (t = t.call(r)).next, 0 === l) {
					if (Object(t) !== t) return;
					f = !1;
				} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
			} catch (r) {
				o = !0, n = r;
			} finally {
				try {
					if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
				} finally {
					if (o) throw n;
				}
			}
			return a;
		}
	}
	__name(_iterableToArrayLimit$4, "_iterableToArrayLimit");
	function _arrayLikeToArray$6(r, a) {
		(null == a || a > r.length) && (a = r.length);
		for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
		return n;
	}
	__name(_arrayLikeToArray$6, "_arrayLikeToArray");
	function _unsupportedIterableToArray$6(r, a) {
		if (r) {
			if ("string" == typeof r) return _arrayLikeToArray$6(r, a);
			var t = {}.toString.call(r).slice(8, -1);
			return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$6(r, a) : void 0;
		}
	}
	__name(_unsupportedIterableToArray$6, "_unsupportedIterableToArray");
	function _nonIterableRest$4() {
		throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
	}
	__name(_nonIterableRest$4, "_nonIterableRest");
	function _slicedToArray$4(r, e) {
		return _arrayWithHoles$4(r) || _iterableToArrayLimit$4(r, e) || _unsupportedIterableToArray$6(r, e) || _nonIterableRest$4();
	}
	__name(_slicedToArray$4, "_slicedToArray");
	var usePrevious = function usePrevious(newValue) {
		var ref = react.useRef(null);
		react.useEffect(function() {
			ref.current = newValue;
			return function() {
				ref.current = null;
			};
		}, [newValue]);
		return ref.current;
	};
	var useUnmountEffect = function useUnmountEffect(fn) {
		return react.useEffect(function() {
			return fn;
		}, []);
	};
	var useEventListener = function useEventListener(_ref) {
		var _ref$target = _ref.target;
		var target = _ref$target === void 0 ? "document" : _ref$target;
		var type = _ref.type;
		var listener = _ref.listener;
		var options = _ref.options;
		var _ref$when = _ref.when;
		var when = _ref$when === void 0 ? true : _ref$when;
		var targetRef = react.useRef(null);
		var listenerRef = react.useRef(null);
		var prevListener = usePrevious(listener);
		var prevOptions = usePrevious(options);
		var bind = function bind() {
			var bindOptions = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
			var bindTarget = bindOptions.target;
			if (ObjectUtils.isNotEmpty(bindTarget)) {
				unbind();
				(bindOptions.when || when) && (targetRef.current = DomHandler.getTargetElement(bindTarget));
			}
			if (!listenerRef.current && targetRef.current) {
				listenerRef.current = function(event) {
					return listener && listener(event);
				};
				targetRef.current.addEventListener(type, listenerRef.current, options);
			}
		};
		var unbind = function unbind() {
			if (listenerRef.current) {
				targetRef.current.removeEventListener(type, listenerRef.current, options);
				listenerRef.current = null;
			}
		};
		var dispose = function dispose() {
			unbind();
			prevListener = null;
			prevOptions = null;
		};
		var updateTarget = react.useCallback(function() {
			if (when) targetRef.current = DomHandler.getTargetElement(target);
			else {
				unbind();
				targetRef.current = null;
			}
		}, [target, when]);
		react.useEffect(function() {
			updateTarget();
		}, [updateTarget]);
		react.useEffect(function() {
			var listenerChanged = "".concat(prevListener) !== "".concat(listener);
			var optionsChanged = prevOptions !== options;
			var listenerExists = listenerRef.current;
			if (listenerExists && (listenerChanged || optionsChanged)) {
				unbind();
				when && bind();
			} else if (!listenerExists) dispose();
		}, [
			listener,
			options,
			when
		]);
		useUnmountEffect(function() {
			dispose();
		});
		return [bind, unbind];
	};
	var groupToDisplayedElements = {};
	var useDisplayOrder = function useDisplayOrder(group) {
		var isVisible = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
		var uid = _slicedToArray$4(react.useState(function() {
			return UniqueComponentId();
		}), 1)[0];
		var _React$useState4 = _slicedToArray$4(react.useState(0), 2);
		var displayOrder = _React$useState4[0];
		var setDisplayOrder = _React$useState4[1];
		react.useEffect(function() {
			if (isVisible) {
				if (!groupToDisplayedElements[group]) groupToDisplayedElements[group] = [];
				var newDisplayOrder = groupToDisplayedElements[group].push(uid);
				setDisplayOrder(newDisplayOrder);
				return function() {
					delete groupToDisplayedElements[group][newDisplayOrder - 1];
					var lastIndex = groupToDisplayedElements[group].length - 1;
					var lastOrder = ObjectUtils.findLastIndex(groupToDisplayedElements[group], function(el) {
						return el !== void 0;
					});
					if (lastOrder !== lastIndex) groupToDisplayedElements[group].splice(lastOrder + 1);
					setDisplayOrder(void 0);
				};
			}
		}, [
			group,
			uid,
			isVisible
		]);
		return displayOrder;
	};
	function _arrayWithoutHoles$4(r) {
		if (Array.isArray(r)) return _arrayLikeToArray$6(r);
	}
	__name(_arrayWithoutHoles$4, "_arrayWithoutHoles");
	function _iterableToArray$4(r) {
		if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
	}
	__name(_iterableToArray$4, "_iterableToArray");
	function _nonIterableSpread$4() {
		throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
	}
	__name(_nonIterableSpread$4, "_nonIterableSpread");
	function _toConsumableArray$4(r) {
		return _arrayWithoutHoles$4(r) || _iterableToArray$4(r) || _unsupportedIterableToArray$6(r) || _nonIterableSpread$4();
	}
	__name(_toConsumableArray$4, "_toConsumableArray");
	/**
	* Priorities of different components (bigger number handled first)
	*/
	var ESC_KEY_HANDLING_PRIORITIES = {
		SIDEBAR: 100,
		SLIDE_MENU: 200,
		DIALOG: 300,
		IMAGE: 400,
		MENU: 500,
		OVERLAY_PANEL: 600,
		PASSWORD: 700,
		CASCADE_SELECT: 800,
		SPLIT_BUTTON: 900,
		SPEED_DIAL: 1e3,
		TOOLTIP: 1200
	};
	/**
	* Object, that manages global escape key handling logic
	*/
	var globalEscKeyHandlingLogic = {
		/**
		* Mapping from ESC_KEY_HANDLING_PRIORITY to array of related listeners, grouped by priority
		* @example
		* Map<{
		*     [ESC_KEY_HANDLING_PRIORITIES.SIDEBAR]: Map<{
		*         1: () => {...},
		*         2: () => {...}
		*     }>,
		*     [ESC_KEY_HANDLING_PRIORITIES.DIALOG]: Map<{
		*         1: () => {...},
		*         2: () => {...}
		*     }>
		* }>;
		*/
		escKeyListeners: /* @__PURE__ */ new Map(),
		/**
		* Keydown handler (attached to any keydown)
		*/
		onGlobalKeyDown: function onGlobalKeyDown(event) {
			if (event.code !== "Escape") return;
			var escKeyListeners = globalEscKeyHandlingLogic.escKeyListeners;
			var maxPrimaryPriority = Math.max.apply(Math, _toConsumableArray$4(escKeyListeners.keys()));
			var theMostImportantEscHandlersSet = escKeyListeners.get(maxPrimaryPriority);
			var maxSecondaryPriority = Math.max.apply(Math, _toConsumableArray$4(theMostImportantEscHandlersSet.keys()));
			theMostImportantEscHandlersSet.get(maxSecondaryPriority)(event);
		},
		/**
		* Attach global keydown listener if there are any "esc" key handlers assigned,
		* otherwise detach.
		*/
		refreshGlobalKeyDownListener: function refreshGlobalKeyDownListener() {
			var document = DomHandler.getTargetElement("document");
			if (this.escKeyListeners.size > 0) document.addEventListener("keydown", this.onGlobalKeyDown);
			else document.removeEventListener("keydown", this.onGlobalKeyDown);
		},
		/**
		* Add "Esc" key handler
		*/
		addListener: function addListener(callback, _ref) {
			var _this = this;
			var _ref2 = _slicedToArray$4(_ref, 2);
			var primaryPriority = _ref2[0];
			var secondaryPriority = _ref2[1];
			var escKeyListeners = this.escKeyListeners;
			if (!escKeyListeners.has(primaryPriority)) escKeyListeners.set(primaryPriority, /* @__PURE__ */ new Map());
			var primaryPriorityListeners = escKeyListeners.get(primaryPriority);
			if (primaryPriorityListeners.has(secondaryPriority)) throw new Error("Unexpected: global esc key listener with priority [".concat(primaryPriority, ", ").concat(secondaryPriority, "] already exists."));
			primaryPriorityListeners.set(secondaryPriority, callback);
			this.refreshGlobalKeyDownListener();
			return function() {
				primaryPriorityListeners["delete"](secondaryPriority);
				if (primaryPriorityListeners.size === 0) escKeyListeners["delete"](primaryPriority);
				_this.refreshGlobalKeyDownListener();
			};
		}
	};
	var useGlobalOnEscapeKey = function useGlobalOnEscapeKey(_ref3) {
		var callback = _ref3.callback;
		var when = _ref3.when;
		var priority = _ref3.priority;
		(0, react.useEffect)(function() {
			if (!when) return;
			return globalEscKeyHandlingLogic.addListener(callback, priority);
		}, [
			callback,
			when,
			priority
		]);
	};
	/**
	* Hook to merge properties including custom merge function for things like Tailwind merge.
	*/
	var useMergeProps = function useMergeProps() {
		var context = (0, react.useContext)(PrimeReactContext);
		return function() {
			for (var _len = arguments.length, props = new Array(_len), _key = 0; _key < _len; _key++) props[_key] = arguments[_key];
			return mergeProps(props, context === null || context === void 0 ? void 0 : context.ptOptions);
		};
	};
	/**
	* Custom hook to run a mount effect only once.
	* @param {*} fn the callback function
	* @returns the hook
	*/
	var useMountEffect = function useMountEffect(fn) {
		var mounted = react.useRef(false);
		return react.useEffect(function() {
			if (!mounted.current) {
				mounted.current = true;
				return fn && fn();
			}
		}, []);
	};
	var useOverlayScrollListener = function useOverlayScrollListener(_ref) {
		var target = _ref.target;
		var listener = _ref.listener;
		var options = _ref.options;
		var _ref$when = _ref.when;
		var when = _ref$when === void 0 ? true : _ref$when;
		var context = react.useContext(PrimeReactContext);
		var targetRef = react.useRef(null);
		var listenerRef = react.useRef(null);
		var scrollableParentsRef = react.useRef([]);
		var prevListener = usePrevious(listener);
		var prevOptions = usePrevious(options);
		var bind = function bind() {
			var bindOptions = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
			if (ObjectUtils.isNotEmpty(bindOptions.target)) {
				unbind();
				(bindOptions.when || when) && (targetRef.current = DomHandler.getTargetElement(bindOptions.target));
			}
			if (!listenerRef.current && targetRef.current) {
				var hideOnScroll = context ? context.hideOverlaysOnDocumentScrolling : PrimeReact.hideOverlaysOnDocumentScrolling;
				var nodes = scrollableParentsRef.current = DomHandler.getScrollableParents(targetRef.current);
				if (!nodes.some(function(node) {
					return node === document.body || node === window;
				})) nodes.push(hideOnScroll ? window : document.body);
				listenerRef.current = function(event) {
					return listener && listener(event);
				};
				nodes.forEach(function(node) {
					return node.addEventListener("scroll", listenerRef.current, options);
				});
			}
		};
		var unbind = function unbind() {
			if (listenerRef.current) {
				scrollableParentsRef.current.forEach(function(node) {
					return node.removeEventListener("scroll", listenerRef.current, options);
				});
				listenerRef.current = null;
			}
		};
		var dispose = function dispose() {
			unbind();
			scrollableParentsRef.current = null;
			prevListener = null;
			prevOptions = null;
		};
		var updateTarget = react.useCallback(function() {
			if (when) targetRef.current = DomHandler.getTargetElement(target);
			else {
				unbind();
				targetRef.current = null;
			}
		}, [target, when]);
		react.useEffect(function() {
			updateTarget();
		}, [updateTarget]);
		react.useEffect(function() {
			var listenerChanged = "".concat(prevListener) !== "".concat(listener);
			var optionsChanged = prevOptions !== options;
			var listenerExists = listenerRef.current;
			if (listenerExists && (listenerChanged || optionsChanged)) {
				unbind();
				when && bind();
			} else if (!listenerExists) dispose();
		}, [
			listener,
			options,
			when
		]);
		useUnmountEffect(function() {
			dispose();
		});
		return [bind, unbind];
	};
	var useResizeListener = function useResizeListener(_ref) {
		var listener = _ref.listener;
		var _ref$when = _ref.when;
		return useEventListener({
			target: "window",
			type: "resize",
			listener,
			when: _ref$when === void 0 ? true : _ref$when
		});
	};
	var useOverlayListener = function useOverlayListener(_ref) {
		var target = _ref.target;
		var overlay = _ref.overlay;
		var _listener = _ref.listener;
		var _ref$when = _ref.when;
		var when = _ref$when === void 0 ? true : _ref$when;
		var _ref$type = _ref.type;
		var type = _ref$type === void 0 ? "click" : _ref$type;
		var targetRef = react.useRef(null);
		var overlayRef = react.useRef(null);
		/**
		* The parameters of the 'listener' method in the following event handlers;
		* @param {Event} event A click event of the document.
		* @param {string} options.type The custom type to detect event.
		* @param {boolean} options.valid It is controlled by PrimeReact. It is determined whether it is valid or not according to some custom validation.
		*/
		var _useEventListener2 = _slicedToArray$4(useEventListener({
			target: "window",
			type,
			listener: function listener(event) {
				_listener && _listener(event, {
					type: "outside",
					valid: event.which !== 3 && isOutsideClicked(event)
				});
			},
			when
		}), 2);
		var bindDocumentClickListener = _useEventListener2[0];
		var unbindDocumentClickListener = _useEventListener2[1];
		var _useResizeListener2 = _slicedToArray$4(useResizeListener({
			listener: function listener(event) {
				_listener && _listener(event, {
					type: "resize",
					valid: !DomHandler.isTouchDevice()
				});
			},
			when
		}), 2);
		var bindWindowResizeListener = _useResizeListener2[0];
		var unbindWindowResizeListener = _useResizeListener2[1];
		var _useEventListener4 = _slicedToArray$4(useEventListener({
			target: "window",
			type: "orientationchange",
			listener: function listener(event) {
				_listener && _listener(event, {
					type: "orientationchange",
					valid: true
				});
			},
			when
		}), 2);
		var bindWindowOrientationChangeListener = _useEventListener4[0];
		var unbindWindowOrientationChangeListener = _useEventListener4[1];
		var _useOverlayScrollList2 = _slicedToArray$4(useOverlayScrollListener({
			target,
			listener: function listener(event) {
				_listener && _listener(event, {
					type: "scroll",
					valid: true
				});
			},
			when
		}), 2);
		var bindOverlayScrollListener = _useOverlayScrollList2[0];
		var unbindOverlayScrollListener = _useOverlayScrollList2[1];
		var isOutsideClicked = function isOutsideClicked(event) {
			return targetRef.current && !(targetRef.current.isSameNode(event.target) || targetRef.current.contains(event.target) || overlayRef.current && overlayRef.current.contains(event.target));
		};
		var bind = function bind() {
			bindDocumentClickListener();
			bindWindowResizeListener();
			bindWindowOrientationChangeListener();
			bindOverlayScrollListener();
		};
		var unbind = function unbind() {
			unbindDocumentClickListener();
			unbindWindowResizeListener();
			unbindWindowOrientationChangeListener();
			unbindOverlayScrollListener();
		};
		react.useEffect(function() {
			if (when) {
				targetRef.current = DomHandler.getTargetElement(target);
				overlayRef.current = DomHandler.getTargetElement(overlay);
			} else {
				unbind();
				targetRef.current = overlayRef.current = null;
			}
		}, [
			target,
			overlay,
			when
		]);
		useUnmountEffect(function() {
			unbind();
		});
		return [bind, unbind];
	};
	var _id = 0;
	var useStyle = function useStyle(css) {
		var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
		var _useState2 = _slicedToArray$4((0, react.useState)(false), 2);
		var isLoaded = _useState2[0];
		var setIsLoaded = _useState2[1];
		var styleRef = (0, react.useRef)(null);
		var context = (0, react.useContext)(PrimeReactContext);
		var defaultDocument = DomHandler.isClient() ? window.document : void 0;
		var _options$document = options.document;
		var document = _options$document === void 0 ? defaultDocument : _options$document;
		var _options$manual = options.manual;
		var manual = _options$manual === void 0 ? false : _options$manual;
		var _options$name = options.name;
		var name = _options$name === void 0 ? "style_".concat(++_id) : _options$name;
		var _options$id = options.id;
		var id = _options$id === void 0 ? void 0 : _options$id;
		var _options$media = options.media;
		var media = _options$media === void 0 ? void 0 : _options$media;
		var getCurrentStyleRef = function getCurrentStyleRef(styleContainer) {
			var existingStyle = styleContainer.querySelector("style[data-primereact-style-id=\"".concat(name, "\"]"));
			if (existingStyle) return existingStyle;
			if (id !== void 0) {
				var existingElement = document.getElementById(id);
				if (existingElement) return existingElement;
			}
			return document.createElement("style");
		};
		var update = function update(newCSS) {
			isLoaded && css !== newCSS && (styleRef.current.textContent = newCSS);
		};
		var load = function load() {
			if (!document || isLoaded) return;
			var styleContainer = (context === null || context === void 0 ? void 0 : context.styleContainer) || document.head;
			styleRef.current = getCurrentStyleRef(styleContainer);
			if (!styleRef.current.isConnected) {
				styleRef.current.type = "text/css";
				if (id) styleRef.current.id = id;
				if (media) styleRef.current.media = media;
				DomHandler.addNonce(styleRef.current, context && context.nonce || PrimeReact.nonce);
				styleContainer.appendChild(styleRef.current);
				if (name) styleRef.current.setAttribute("data-primereact-style-id", name);
			}
			styleRef.current.textContent = css;
			setIsLoaded(true);
		};
		var unload = function unload() {
			if (!document || !styleRef.current) return;
			DomHandler.removeInlineStyle(styleRef.current);
			setIsLoaded(false);
		};
		(0, react.useEffect)(function() {
			if (!manual) load();
		}, [manual]);
		return {
			id,
			name,
			update,
			unload,
			load,
			isLoaded
		};
	};
	var useUpdateEffect = function useUpdateEffect(fn, deps) {
		var mounted = react.useRef(false);
		return react.useEffect(function() {
			if (!mounted.current) {
				mounted.current = true;
				return;
			}
			return fn && fn();
		}, deps);
	};

//#endregion
//#region node_modules/primereact/componentbase/componentbase.esm.js
	function _arrayLikeToArray$5(r, a) {
		(null == a || a > r.length) && (a = r.length);
		for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
		return n;
	}
	__name(_arrayLikeToArray$5, "_arrayLikeToArray");
	function _arrayWithoutHoles$3(r) {
		if (Array.isArray(r)) return _arrayLikeToArray$5(r);
	}
	__name(_arrayWithoutHoles$3, "_arrayWithoutHoles");
	function _iterableToArray$3(r) {
		if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
	}
	__name(_iterableToArray$3, "_iterableToArray");
	function _unsupportedIterableToArray$5(r, a) {
		if (r) {
			if ("string" == typeof r) return _arrayLikeToArray$5(r, a);
			var t = {}.toString.call(r).slice(8, -1);
			return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$5(r, a) : void 0;
		}
	}
	__name(_unsupportedIterableToArray$5, "_unsupportedIterableToArray");
	function _nonIterableSpread$3() {
		throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
	}
	__name(_nonIterableSpread$3, "_nonIterableSpread");
	function _toConsumableArray$3(r) {
		return _arrayWithoutHoles$3(r) || _iterableToArray$3(r) || _unsupportedIterableToArray$5(r) || _nonIterableSpread$3();
	}
	__name(_toConsumableArray$3, "_toConsumableArray");
	function _typeof$4(o) {
		"@babel/helpers - typeof";
		return _typeof$4 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
			return typeof o;
		} : function(o) {
			return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
		}, _typeof$4(o);
	}
	__name(_typeof$4, "_typeof");
	function toPrimitive$4(t, r) {
		if ("object" != _typeof$4(t) || !t) return t;
		var e = t[Symbol.toPrimitive];
		if (void 0 !== e) {
			var i = e.call(t, r || "default");
			if ("object" != _typeof$4(i)) return i;
			throw new TypeError("@@toPrimitive must return a primitive value.");
		}
		return ("string" === r ? String : Number)(t);
	}
	__name(toPrimitive$4, "toPrimitive");
	function toPropertyKey$4(t) {
		var i = toPrimitive$4(t, "string");
		return "symbol" == _typeof$4(i) ? i : i + "";
	}
	__name(toPropertyKey$4, "toPropertyKey");
	function _defineProperty$4(e, r, t) {
		return (r = toPropertyKey$4(r)) in e ? Object.defineProperty(e, r, {
			value: t,
			enumerable: !0,
			configurable: !0,
			writable: !0
		}) : e[r] = t, e;
	}
	__name(_defineProperty$4, "_defineProperty");
	function ownKeys$5(e, r) {
		var t = Object.keys(e);
		if (Object.getOwnPropertySymbols) {
			var o = Object.getOwnPropertySymbols(e);
			r && (o = o.filter(function(r) {
				return Object.getOwnPropertyDescriptor(e, r).enumerable;
			})), t.push.apply(t, o);
		}
		return t;
	}
	__name(ownKeys$5, "ownKeys");
	function _objectSpread$5(e) {
		for (var r = 1; r < arguments.length; r++) {
			var t = null != arguments[r] ? arguments[r] : {};
			r % 2 ? ownKeys$5(Object(t), !0).forEach(function(r) {
				_defineProperty$4(e, r, t[r]);
			}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function(r) {
				Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
			});
		}
		return e;
	}
	__name(_objectSpread$5, "_objectSpread");
	var baseStyle = "\n.p-hidden-accessible {\n    border: 0;\n    clip: rect(0 0 0 0);\n    height: 1px;\n    margin: -1px;\n    opacity: 0;\n    overflow: hidden;\n    padding: 0;\n    pointer-events: none;\n    position: absolute;\n    white-space: nowrap;\n    width: 1px;\n}\n\n.p-overflow-hidden {\n    overflow: hidden;\n    padding-right: var(--scrollbar-width);\n}\n";
	var commonStyle = "\n@layer primereact {\n    .p-component, .p-component * {\n        box-sizing: border-box;\n    }\n\n    .p-hidden {\n        display: none;\n    }\n\n    .p-hidden-space {\n        visibility: hidden;\n    }\n\n    .p-reset {\n        margin: 0;\n        padding: 0;\n        border: 0;\n        outline: 0;\n        text-decoration: none;\n        font-size: 100%;\n        list-style: none;\n    }\n\n    .p-disabled, .p-disabled * {\n        cursor: default;\n        pointer-events: none;\n        user-select: none;\n    }\n\n    .p-component-overlay {\n        position: fixed;\n        top: 0;\n        left: 0;\n        width: 100%;\n        height: 100%;\n    }\n\n    .p-unselectable-text {\n        user-select: none;\n    }\n\n    .p-scrollbar-measure {\n        width: 100px;\n        height: 100px;\n        overflow: scroll;\n        position: absolute;\n        top: -9999px;\n    }\n\n    @-webkit-keyframes p-fadein {\n      0%   { opacity: 0; }\n      100% { opacity: 1; }\n    }\n    @keyframes p-fadein {\n      0%   { opacity: 0; }\n      100% { opacity: 1; }\n    }\n\n    .p-link {\n        text-align: left;\n        background-color: transparent;\n        margin: 0;\n        padding: 0;\n        border: none;\n        cursor: pointer;\n        user-select: none;\n    }\n\n    .p-link:disabled {\n        cursor: default;\n    }\n\n    /* Non react overlay animations */\n    .p-connected-overlay {\n        opacity: 0;\n        transform: scaleY(0.8);\n        transition: transform .12s cubic-bezier(0, 0, 0.2, 1), opacity .12s cubic-bezier(0, 0, 0.2, 1);\n    }\n\n    .p-connected-overlay-visible {\n        opacity: 1;\n        transform: scaleY(1);\n    }\n\n    .p-connected-overlay-hidden {\n        opacity: 0;\n        transform: scaleY(1);\n        transition: opacity .1s linear;\n    }\n\n    /* React based overlay animations */\n    .p-connected-overlay-enter {\n        opacity: 0;\n        transform: scaleY(0.8);\n    }\n\n    .p-connected-overlay-enter-active {\n        opacity: 1;\n        transform: scaleY(1);\n        transition: transform .12s cubic-bezier(0, 0, 0.2, 1), opacity .12s cubic-bezier(0, 0, 0.2, 1);\n    }\n\n    .p-connected-overlay-enter-done {\n        transform: none;\n    }\n\n    .p-connected-overlay-exit {\n        opacity: 1;\n    }\n\n    .p-connected-overlay-exit-active {\n        opacity: 0;\n        transition: opacity .1s linear;\n    }\n\n    /* Toggleable Content */\n    .p-toggleable-content-enter {\n        max-height: 0;\n    }\n\n    .p-toggleable-content-enter-active {\n        overflow: hidden;\n        max-height: 1000px;\n        transition: max-height 1s ease-in-out;\n    }\n\n    .p-toggleable-content-enter-done {\n        transform: none;\n    }\n\n    .p-toggleable-content-exit {\n        max-height: 1000px;\n    }\n\n    .p-toggleable-content-exit-active {\n        overflow: hidden;\n        max-height: 0;\n        transition: max-height 0.45s cubic-bezier(0, 1, 0, 1);\n    }\n\n    /* @todo Refactor */\n    .p-menu .p-menuitem-link {\n        cursor: pointer;\n        display: flex;\n        align-items: center;\n        text-decoration: none;\n        overflow: hidden;\n        position: relative;\n    }\n\n    ".concat("\n.p-button {\n    margin: 0;\n    display: inline-flex;\n    cursor: pointer;\n    user-select: none;\n    align-items: center;\n    vertical-align: bottom;\n    text-align: center;\n    overflow: hidden;\n    position: relative;\n}\n\n.p-button-label {\n    flex: 1 1 auto;\n}\n\n.p-button-icon {\n    pointer-events: none;\n}\n\n.p-button-icon-right {\n    order: 1;\n}\n\n.p-button:disabled {\n    cursor: default;\n}\n\n.p-button-icon-only {\n    justify-content: center;\n}\n\n.p-button-icon-only .p-button-label {\n    visibility: hidden;\n    width: 0;\n    flex: 0 0 auto;\n}\n\n.p-button-vertical {\n    flex-direction: column;\n}\n\n.p-button-icon-bottom {\n    order: 2;\n}\n\n.p-button-group .p-button {\n    margin: 0;\n}\n\n.p-button-group .p-button:not(:last-child) {\n    border-right: 0 none;\n}\n\n.p-button-group .p-button:not(:first-of-type):not(:last-of-type) {\n    border-radius: 0;\n}\n\n.p-button-group .p-button:first-of-type {\n    border-top-right-radius: 0;\n    border-bottom-right-radius: 0;\n}\n\n.p-button-group .p-button:last-of-type {\n    border-top-left-radius: 0;\n    border-bottom-left-radius: 0;\n}\n\n.p-button-group .p-button:focus {\n    position: relative;\n    z-index: 1;\n}\n\n.p-button-group-single .p-button:first-of-type {\n    border-top-right-radius: var(--border-radius) !important;\n    border-bottom-right-radius: var(--border-radius) !important;\n}\n\n.p-button-group-single .p-button:last-of-type {\n    border-top-left-radius: var(--border-radius) !important;\n    border-bottom-left-radius: var(--border-radius) !important;\n}\n", "\n    ").concat("\n.p-inputtext {\n    margin: 0;\n}\n\n.p-fluid .p-inputtext {\n    width: 100%;\n}\n\n/* InputGroup */\n.p-inputgroup {\n    display: flex;\n    align-items: stretch;\n    width: 100%;\n}\n\n.p-inputgroup-addon {\n    display: flex;\n    align-items: center;\n    justify-content: center;\n}\n\n.p-inputgroup .p-float-label {\n    display: flex;\n    align-items: stretch;\n    width: 100%;\n}\n\n.p-inputgroup .p-inputtext,\n.p-fluid .p-inputgroup .p-inputtext,\n.p-inputgroup .p-inputwrapper,\n.p-fluid .p-inputgroup .p-input {\n    flex: 1 1 auto;\n    width: 1%;\n}\n\n/* Floating Label */\n.p-float-label {\n    display: block;\n    position: relative;\n}\n\n.p-float-label label {\n    position: absolute;\n    pointer-events: none;\n    top: 50%;\n    margin-top: -0.5rem;\n    transition-property: all;\n    transition-timing-function: ease;\n    line-height: 1;\n}\n\n.p-float-label textarea ~ label,\n.p-float-label .p-mention ~ label {\n    top: 1rem;\n}\n\n.p-float-label input:focus ~ label,\n.p-float-label input:-webkit-autofill ~ label,\n.p-float-label input.p-filled ~ label,\n.p-float-label textarea:focus ~ label,\n.p-float-label textarea.p-filled ~ label,\n.p-float-label .p-inputwrapper-focus ~ label,\n.p-float-label .p-inputwrapper-filled ~ label,\n.p-float-label .p-tooltip-target-wrapper ~ label {\n    top: -0.75rem;\n    font-size: 12px;\n}\n\n.p-float-label .p-placeholder,\n.p-float-label input::placeholder,\n.p-float-label .p-inputtext::placeholder {\n    opacity: 0;\n    transition-property: all;\n    transition-timing-function: ease;\n}\n\n.p-float-label .p-focus .p-placeholder,\n.p-float-label input:focus::placeholder,\n.p-float-label .p-inputtext:focus::placeholder {\n    opacity: 1;\n    transition-property: all;\n    transition-timing-function: ease;\n}\n\n.p-input-icon-left,\n.p-input-icon-right {\n    position: relative;\n    display: inline-block;\n}\n\n.p-input-icon-left > i,\n.p-input-icon-right > i,\n.p-input-icon-left > svg,\n.p-input-icon-right > svg,\n.p-input-icon-left > .p-input-prefix,\n.p-input-icon-right > .p-input-suffix {\n    position: absolute;\n    top: 50%;\n    margin-top: -0.5rem;\n}\n\n.p-fluid .p-input-icon-left,\n.p-fluid .p-input-icon-right {\n    display: block;\n    width: 100%;\n}\n", "\n    ").concat("\n.p-icon {\n    display: inline-block;\n}\n\n.p-icon-spin {\n    -webkit-animation: p-icon-spin 2s infinite linear;\n    animation: p-icon-spin 2s infinite linear;\n}\n\nsvg.p-icon {\n    pointer-events: auto;\n}\n\nsvg.p-icon g,\n.p-disabled svg.p-icon {\n    pointer-events: none;\n}\n\n@-webkit-keyframes p-icon-spin {\n    0% {\n        -webkit-transform: rotate(0deg);\n        transform: rotate(0deg);\n    }\n    100% {\n        -webkit-transform: rotate(359deg);\n        transform: rotate(359deg);\n    }\n}\n\n@keyframes p-icon-spin {\n    0% {\n        -webkit-transform: rotate(0deg);\n        transform: rotate(0deg);\n    }\n    100% {\n        -webkit-transform: rotate(359deg);\n        transform: rotate(359deg);\n    }\n}\n", "\n}\n");
	var ComponentBase = {
		cProps: void 0,
		cParams: void 0,
		cName: void 0,
		defaultProps: {
			pt: void 0,
			ptOptions: void 0,
			unstyled: false
		},
		context: {},
		globalCSS: void 0,
		classes: {},
		styles: "",
		extend: function extend() {
			var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
			var css = props.css;
			var defaultProps = _objectSpread$5(_objectSpread$5({}, props.defaultProps), ComponentBase.defaultProps);
			var inlineStyles = {};
			var getProps = function getProps(props) {
				ComponentBase.context = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
				ComponentBase.cProps = props;
				return ObjectUtils.getMergedProps(props, defaultProps);
			};
			var getOtherProps = function getOtherProps(props) {
				return ObjectUtils.getDiffProps(props, defaultProps);
			};
			var getPTValue = function getPTValue() {
				var _ComponentBase$contex;
				var obj = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
				var key = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
				var params = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
				var searchInDefaultPT = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true;
				if (obj.hasOwnProperty("pt") && obj.pt !== void 0) obj = obj.pt;
				var originalkey = key;
				var isNestedParam = /./g.test(originalkey) && !!params[originalkey.split(".")[0]];
				var fkey = isNestedParam ? ObjectUtils.toFlatCase(originalkey.split(".")[1]) : ObjectUtils.toFlatCase(originalkey);
				var componentName = params.hostName && ObjectUtils.toFlatCase(params.hostName) || params.props && params.props.__TYPE && ObjectUtils.toFlatCase(params.props.__TYPE) || "";
				var isTransition = fkey === "transition";
				var datasetPrefix = "data-pc-";
				var _getHostInstance = function getHostInstance(params) {
					return params !== null && params !== void 0 && params.props ? params.hostName ? params.props.__TYPE === params.hostName ? params.props : _getHostInstance(params.parent) : params.parent : void 0;
				};
				var getPropValue = function getPropValue(name) {
					var _params$props;
					var _getHostInstance2;
					return ((_params$props = params.props) === null || _params$props === void 0 ? void 0 : _params$props[name]) || ((_getHostInstance2 = _getHostInstance(params)) === null || _getHostInstance2 === void 0 ? void 0 : _getHostInstance2[name]);
				};
				ComponentBase.cParams = params;
				ComponentBase.cName = componentName;
				var _ref = getPropValue("ptOptions") || ComponentBase.context.ptOptions || {};
				var _ref$mergeSections = _ref.mergeSections;
				var mergeSections = _ref$mergeSections === void 0 ? true : _ref$mergeSections;
				var _ref$mergeProps = _ref.mergeProps;
				var useMergeProps = _ref$mergeProps === void 0 ? false : _ref$mergeProps;
				var getPTClassValue = function getPTClassValue() {
					var value = _getOptionValue.apply(void 0, arguments);
					if (Array.isArray(value)) return { className: classNames.apply(void 0, _toConsumableArray$3(value)) };
					if (ObjectUtils.isString(value)) return { className: value };
					if (value !== null && value !== void 0 && value.hasOwnProperty("className") && Array.isArray(value.className)) return { className: classNames.apply(void 0, _toConsumableArray$3(value.className)) };
					return value;
				};
				var globalPT = searchInDefaultPT ? isNestedParam ? _useGlobalPT(getPTClassValue, originalkey, params) : _useDefaultPT(getPTClassValue, originalkey, params) : void 0;
				var self = isNestedParam ? void 0 : _usePT(_getPT(obj, componentName), getPTClassValue, originalkey, params);
				var datasetProps = !isTransition && _objectSpread$5(_objectSpread$5({}, fkey === "root" && _defineProperty$4({}, "".concat(datasetPrefix, "name"), params.props && params.props.__parentMetadata ? ObjectUtils.toFlatCase(params.props.__TYPE) : componentName)), {}, _defineProperty$4({}, "".concat(datasetPrefix, "section"), fkey));
				return mergeSections || !mergeSections && self ? useMergeProps ? mergeProps([
					globalPT,
					self,
					Object.keys(datasetProps).length ? datasetProps : {}
				], { classNameMergeFunction: (_ComponentBase$contex = ComponentBase.context.ptOptions) === null || _ComponentBase$contex === void 0 ? void 0 : _ComponentBase$contex.classNameMergeFunction }) : _objectSpread$5(_objectSpread$5(_objectSpread$5({}, globalPT), self), Object.keys(datasetProps).length ? datasetProps : {}) : _objectSpread$5(_objectSpread$5({}, self), Object.keys(datasetProps).length ? datasetProps : {});
			};
			return _objectSpread$5(_objectSpread$5({
				getProps,
				getOtherProps,
				setMetaData: function setMetaData() {
					var metadata = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
					var props = metadata.props;
					var state = metadata.state;
					var ptm = function ptm() {
						var key = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
						var params = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
						return getPTValue((props || {}).pt, key, _objectSpread$5(_objectSpread$5({}, metadata), params));
					};
					var ptmo = function ptmo() {
						return getPTValue(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, false);
					};
					var isUnstyled = function isUnstyled() {
						return ComponentBase.context.unstyled || PrimeReact.unstyled || props.unstyled;
					};
					return {
						ptm,
						ptmo,
						sx: function sx() {
							var key = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
							var params = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
							if (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true) {
								var _ComponentBase$contex2;
								var self = _getOptionValue(css && css.inlineStyles, key, _objectSpread$5({
									props,
									state
								}, params));
								return mergeProps([_getOptionValue(inlineStyles, key, _objectSpread$5({
									props,
									state
								}, params)), self], { classNameMergeFunction: (_ComponentBase$contex2 = ComponentBase.context.ptOptions) === null || _ComponentBase$contex2 === void 0 ? void 0 : _ComponentBase$contex2.classNameMergeFunction });
							}
						},
						cx: function cx() {
							var key = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
							var params = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
							return !isUnstyled() ? _getOptionValue(css && css.classes, key, _objectSpread$5({
								props,
								state
							}, params)) : void 0;
						},
						isUnstyled
					};
				}
			}, props), {}, { defaultProps });
		}
	};
	var _getOptionValue = function getOptionValue(obj) {
		var key = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
		var params = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
		var fKeys = String(ObjectUtils.toFlatCase(key)).split(".");
		var fKey = fKeys.shift();
		var matchedPTOption = ObjectUtils.isNotEmpty(obj) ? Object.keys(obj).find(function(k) {
			return ObjectUtils.toFlatCase(k) === fKey;
		}) : "";
		return fKey ? ObjectUtils.isObject(obj) ? _getOptionValue(ObjectUtils.getItemValue(obj[matchedPTOption], params), fKeys.join("."), params) : void 0 : ObjectUtils.getItemValue(obj, params);
	};
	var _getPT = function _getPT(pt) {
		var key = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
		var callback = arguments.length > 2 ? arguments[2] : void 0;
		var _usept = pt === null || pt === void 0 ? void 0 : pt._usept;
		var getValue = function getValue(value) {
			var _ref3;
			var checkSameKey = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
			var _value = callback ? callback(value) : value;
			var _key = ObjectUtils.toFlatCase(key);
			return (_ref3 = checkSameKey ? _key !== ComponentBase.cName ? _value === null || _value === void 0 ? void 0 : _value[_key] : void 0 : _value === null || _value === void 0 ? void 0 : _value[_key]) !== null && _ref3 !== void 0 ? _ref3 : _value;
		};
		return ObjectUtils.isNotEmpty(_usept) ? {
			_usept,
			originalValue: getValue(pt.originalValue),
			value: getValue(pt.value)
		} : getValue(pt, true);
	};
	var _usePT = function _usePT(pt, callback, key, params) {
		var fn = function fn(value) {
			return callback(value, key, params);
		};
		if (pt !== null && pt !== void 0 && pt.hasOwnProperty("_usept")) {
			var _ref4 = pt._usept || ComponentBase.context.ptOptions || {};
			var _ref4$mergeSections = _ref4.mergeSections;
			var mergeSections = _ref4$mergeSections === void 0 ? true : _ref4$mergeSections;
			var _ref4$mergeProps = _ref4.mergeProps;
			var useMergeProps = _ref4$mergeProps === void 0 ? false : _ref4$mergeProps;
			var classNameMergeFunction = _ref4.classNameMergeFunction;
			var originalValue = fn(pt.originalValue);
			var value = fn(pt.value);
			if (originalValue === void 0 && value === void 0) return;
			else if (ObjectUtils.isString(value)) return value;
			else if (ObjectUtils.isString(originalValue)) return originalValue;
			return mergeSections || !mergeSections && value ? useMergeProps ? mergeProps([originalValue, value], { classNameMergeFunction }) : _objectSpread$5(_objectSpread$5({}, originalValue), value) : value;
		}
		return fn(pt);
	};
	var getGlobalPT = function getGlobalPT() {
		return _getPT(ComponentBase.context.pt || PrimeReact.pt, void 0, function(value) {
			return ObjectUtils.getItemValue(value, ComponentBase.cParams);
		});
	};
	var getDefaultPT = function getDefaultPT() {
		return _getPT(ComponentBase.context.pt || PrimeReact.pt, void 0, function(value) {
			return _getOptionValue(value, ComponentBase.cName, ComponentBase.cParams) || ObjectUtils.getItemValue(value, ComponentBase.cParams);
		});
	};
	var _useGlobalPT = function _useGlobalPT(callback, key, params) {
		return _usePT(getGlobalPT(), callback, key, params);
	};
	var _useDefaultPT = function _useDefaultPT(callback, key, params) {
		return _usePT(getDefaultPT(), callback, key, params);
	};
	var useHandleStyle = function useHandleStyle(styles) {
		var _isUnstyled = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : function() {};
		var config = arguments.length > 2 ? arguments[2] : void 0;
		var name = config.name;
		var _config$styled = config.styled;
		var styled = _config$styled === void 0 ? false : _config$styled;
		var _config$hostName = config.hostName;
		var hostName = _config$hostName === void 0 ? "" : _config$hostName;
		var globalCSS = _useGlobalPT(_getOptionValue, "global.css", ComponentBase.cParams);
		var componentName = ObjectUtils.toFlatCase(name);
		var loadBaseStyle = useStyle(baseStyle, {
			name: "base",
			manual: true
		}).load;
		var loadCommonStyle = useStyle(commonStyle, {
			name: "common",
			manual: true
		}).load;
		var loadGlobalStyle = useStyle(globalCSS, {
			name: "global",
			manual: true
		}).load;
		var loadComponentStyle = useStyle(styles, {
			name,
			manual: true
		}).load;
		var hook = function hook(hookName) {
			if (!hostName) {
				var selfHook = _usePT(_getPT((ComponentBase.cProps || {}).pt, componentName), _getOptionValue, "hooks.".concat(hookName));
				var defaultHook = _useDefaultPT(_getOptionValue, "hooks.".concat(hookName));
				selfHook === null || selfHook === void 0 || selfHook();
				defaultHook === null || defaultHook === void 0 || defaultHook();
			}
		};
		hook("useMountEffect");
		useMountEffect(function() {
			loadBaseStyle();
			loadGlobalStyle();
			if (!_isUnstyled()) {
				loadCommonStyle();
				if (!styled) loadComponentStyle();
			}
		});
		useUpdateEffect(function() {
			hook("useUpdateEffect");
		});
		useUnmountEffect(function() {
			hook("useUnmountEffect");
		});
	};

//#endregion
//#region node_modules/@babel/runtime/helpers/esm/extends.js
	function _extends$3() {
		return _extends$3 = Object.assign ? Object.assign.bind() : function(n) {
			for (var e = 1; e < arguments.length; e++) {
				var t = arguments[e];
				for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
			}
			return n;
		}, _extends$3.apply(null, arguments);
	}
	__name(_extends$3, "_extends");

//#endregion
//#region node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
	function _objectWithoutPropertiesLoose(r, e) {
		if (null == r) return {};
		var t = {};
		for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
			if (-1 !== e.indexOf(n)) continue;
			t[n] = r[n];
		}
		return t;
	}

//#endregion
//#region node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
	function _setPrototypeOf(t, e) {
		return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) {
			return t.__proto__ = e, t;
		}, _setPrototypeOf(t, e);
	}

//#endregion
//#region node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
	function _inheritsLoose(t, o) {
		t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
	}

//#endregion
//#region node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js
/** @license React v16.13.1
	* react-is.development.js
	*
	* Copyright (c) Facebook, Inc. and its affiliates.
	*
	* This source code is licensed under the MIT license found in the
	* LICENSE file in the root directory of this source tree.
	*/
	var require_react_is_development = /* @__PURE__ */ __commonJSMin(((exports) => {
		(function() {
			"use strict";
			var hasSymbol = typeof Symbol === "function" && Symbol.for;
			var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103;
			var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106;
			var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107;
			var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108;
			var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114;
			var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109;
			var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110;
			var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for("react.async_mode") : 60111;
			var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for("react.concurrent_mode") : 60111;
			var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112;
			var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113;
			var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for("react.suspense_list") : 60120;
			var REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115;
			var REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116;
			var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121;
			var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for("react.fundamental") : 60117;
			var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for("react.responder") : 60118;
			var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for("react.scope") : 60119;
			function isValidElementType(type) {
				return typeof type === "string" || typeof type === "function" || type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
			}
			function typeOf(object) {
				if (typeof object === "object" && object !== null) {
					var $$typeof = object.$$typeof;
					switch ($$typeof) {
						case REACT_ELEMENT_TYPE:
							var type = object.type;
							switch (type) {
								case REACT_ASYNC_MODE_TYPE:
								case REACT_CONCURRENT_MODE_TYPE:
								case REACT_FRAGMENT_TYPE:
								case REACT_PROFILER_TYPE:
								case REACT_STRICT_MODE_TYPE:
								case REACT_SUSPENSE_TYPE: return type;
								default:
									var $$typeofType = type && type.$$typeof;
									switch ($$typeofType) {
										case REACT_CONTEXT_TYPE:
										case REACT_FORWARD_REF_TYPE:
										case REACT_LAZY_TYPE:
										case REACT_MEMO_TYPE:
										case REACT_PROVIDER_TYPE: return $$typeofType;
										default: return $$typeof;
									}
							}
						case REACT_PORTAL_TYPE: return $$typeof;
					}
				}
			}
			var AsyncMode = REACT_ASYNC_MODE_TYPE;
			var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
			var ContextConsumer = REACT_CONTEXT_TYPE;
			var ContextProvider = REACT_PROVIDER_TYPE;
			var Element = REACT_ELEMENT_TYPE;
			var ForwardRef = REACT_FORWARD_REF_TYPE;
			var Fragment = REACT_FRAGMENT_TYPE;
			var Lazy = REACT_LAZY_TYPE;
			var Memo = REACT_MEMO_TYPE;
			var Portal = REACT_PORTAL_TYPE;
			var Profiler = REACT_PROFILER_TYPE;
			var StrictMode = REACT_STRICT_MODE_TYPE;
			var Suspense = REACT_SUSPENSE_TYPE;
			var hasWarnedAboutDeprecatedIsAsyncMode = false;
			function isAsyncMode(object) {
				if (!hasWarnedAboutDeprecatedIsAsyncMode) {
					hasWarnedAboutDeprecatedIsAsyncMode = true;
					console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.");
				}
				return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
			}
			function isConcurrentMode(object) {
				return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
			}
			function isContextConsumer(object) {
				return typeOf(object) === REACT_CONTEXT_TYPE;
			}
			function isContextProvider(object) {
				return typeOf(object) === REACT_PROVIDER_TYPE;
			}
			function isElement(object) {
				return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
			}
			function isForwardRef(object) {
				return typeOf(object) === REACT_FORWARD_REF_TYPE;
			}
			function isFragment(object) {
				return typeOf(object) === REACT_FRAGMENT_TYPE;
			}
			function isLazy(object) {
				return typeOf(object) === REACT_LAZY_TYPE;
			}
			function isMemo(object) {
				return typeOf(object) === REACT_MEMO_TYPE;
			}
			function isPortal(object) {
				return typeOf(object) === REACT_PORTAL_TYPE;
			}
			function isProfiler(object) {
				return typeOf(object) === REACT_PROFILER_TYPE;
			}
			function isStrictMode(object) {
				return typeOf(object) === REACT_STRICT_MODE_TYPE;
			}
			function isSuspense(object) {
				return typeOf(object) === REACT_SUSPENSE_TYPE;
			}
			exports.AsyncMode = AsyncMode;
			exports.ConcurrentMode = ConcurrentMode;
			exports.ContextConsumer = ContextConsumer;
			exports.ContextProvider = ContextProvider;
			exports.Element = Element;
			exports.ForwardRef = ForwardRef;
			exports.Fragment = Fragment;
			exports.Lazy = Lazy;
			exports.Memo = Memo;
			exports.Portal = Portal;
			exports.Profiler = Profiler;
			exports.StrictMode = StrictMode;
			exports.Suspense = Suspense;
			exports.isAsyncMode = isAsyncMode;
			exports.isConcurrentMode = isConcurrentMode;
			exports.isContextConsumer = isContextConsumer;
			exports.isContextProvider = isContextProvider;
			exports.isElement = isElement;
			exports.isForwardRef = isForwardRef;
			exports.isFragment = isFragment;
			exports.isLazy = isLazy;
			exports.isMemo = isMemo;
			exports.isPortal = isPortal;
			exports.isProfiler = isProfiler;
			exports.isStrictMode = isStrictMode;
			exports.isSuspense = isSuspense;
			exports.isValidElementType = isValidElementType;
			exports.typeOf = typeOf;
		})();
	}));

//#endregion
//#region node_modules/prop-types/node_modules/react-is/index.js
	var require_react_is = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		module.exports = require_react_is_development();
	}));

//#endregion
//#region node_modules/object-assign/index.js
/*
	object-assign
	(c) Sindre Sorhus
	@license MIT
	*/
	var require_object_assign = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var getOwnPropertySymbols = Object.getOwnPropertySymbols;
		var hasOwnProperty = Object.prototype.hasOwnProperty;
		var propIsEnumerable = Object.prototype.propertyIsEnumerable;
		function toObject(val) {
			if (val === null || val === void 0) throw new TypeError("Object.assign cannot be called with null or undefined");
			return Object(val);
		}
		function shouldUseNative() {
			try {
				if (!Object.assign) return false;
				var test1 = /* @__PURE__ */ new String("abc");
				test1[5] = "de";
				if (Object.getOwnPropertyNames(test1)[0] === "5") return false;
				var test2 = {};
				for (var i = 0; i < 10; i++) test2["_" + String.fromCharCode(i)] = i;
				if (Object.getOwnPropertyNames(test2).map(function(n) {
					return test2[n];
				}).join("") !== "0123456789") return false;
				var test3 = {};
				"abcdefghijklmnopqrst".split("").forEach(function(letter) {
					test3[letter] = letter;
				});
				if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") return false;
				return true;
			} catch (err) {
				return false;
			}
		}
		module.exports = shouldUseNative() ? Object.assign : function(target, source) {
			var from;
			var to = toObject(target);
			var symbols;
			for (var s = 1; s < arguments.length; s++) {
				from = Object(arguments[s]);
				for (var key in from) if (hasOwnProperty.call(from, key)) to[key] = from[key];
				if (getOwnPropertySymbols) {
					symbols = getOwnPropertySymbols(from);
					for (var i = 0; i < symbols.length; i++) if (propIsEnumerable.call(from, symbols[i])) to[symbols[i]] = from[symbols[i]];
				}
			}
			return to;
		};
	}));

//#endregion
//#region node_modules/prop-types/lib/ReactPropTypesSecret.js
/**
	* Copyright (c) 2013-present, Facebook, Inc.
	*
	* This source code is licensed under the MIT license found in the
	* LICENSE file in the root directory of this source tree.
	*/
	var require_ReactPropTypesSecret = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
		module.exports = ReactPropTypesSecret;
	}));

//#endregion
//#region node_modules/prop-types/lib/has.js
	var require_has = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		module.exports = Function.call.bind(Object.prototype.hasOwnProperty);
	}));

//#endregion
//#region node_modules/prop-types/checkPropTypes.js
/**
	* Copyright (c) 2013-present, Facebook, Inc.
	*
	* This source code is licensed under the MIT license found in the
	* LICENSE file in the root directory of this source tree.
	*/
	var require_checkPropTypes = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var printWarning = function() {};
		var ReactPropTypesSecret = require_ReactPropTypesSecret();
		var loggedTypeFailures = {};
		var has = require_has();
		printWarning = function(text) {
			var message = "Warning: " + text;
			if (typeof console !== "undefined") console.error(message);
			try {
				throw new Error(message);
			} catch (x) {}
		};
		/**
		* Assert that the values match with the type specs.
		* Error messages are memorized and will only be shown once.
		*
		* @param {object} typeSpecs Map of name to a ReactPropType
		* @param {object} values Runtime values that need to be type-checked
		* @param {string} location e.g. "prop", "context", "child context"
		* @param {string} componentName Name of the component for error messages.
		* @param {?Function} getStack Returns the component stack.
		* @private
		*/
		function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
			for (var typeSpecName in typeSpecs) if (has(typeSpecs, typeSpecName)) {
				var error;
				try {
					if (typeof typeSpecs[typeSpecName] !== "function") {
						var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
						err.name = "Invariant Violation";
						throw err;
					}
					error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
				} catch (ex) {
					error = ex;
				}
				if (error && !(error instanceof Error)) printWarning((componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).");
				if (error instanceof Error && !(error.message in loggedTypeFailures)) {
					loggedTypeFailures[error.message] = true;
					var stack = getStack ? getStack() : "";
					printWarning("Failed " + location + " type: " + error.message + (stack != null ? stack : ""));
				}
			}
		}
		/**
		* Resets warning cache when testing.
		*
		* @private
		*/
		checkPropTypes.resetWarningCache = function() {
			loggedTypeFailures = {};
		};
		module.exports = checkPropTypes;
	}));

//#endregion
//#region node_modules/prop-types/factoryWithTypeCheckers.js
/**
	* Copyright (c) 2013-present, Facebook, Inc.
	*
	* This source code is licensed under the MIT license found in the
	* LICENSE file in the root directory of this source tree.
	*/
	var require_factoryWithTypeCheckers = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var ReactIs = require_react_is();
		var assign = require_object_assign();
		var ReactPropTypesSecret = require_ReactPropTypesSecret();
		var has = require_has();
		var checkPropTypes = require_checkPropTypes();
		var printWarning = function() {};
		printWarning = function(text) {
			var message = "Warning: " + text;
			if (typeof console !== "undefined") console.error(message);
			try {
				throw new Error(message);
			} catch (x) {}
		};
		function emptyFunctionThatReturnsNull() {
			return null;
		}
		module.exports = function(isValidElement, throwOnDirectAccess) {
			var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
			var FAUX_ITERATOR_SYMBOL = "@@iterator";
			/**
			* Returns the iterator method function contained on the iterable object.
			*
			* Be sure to invoke the function with the iterable as context:
			*
			*     var iteratorFn = getIteratorFn(myIterable);
			*     if (iteratorFn) {
			*       var iterator = iteratorFn.call(myIterable);
			*       ...
			*     }
			*
			* @param {?object} maybeIterable
			* @return {?function}
			*/
			function getIteratorFn(maybeIterable) {
				var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
				if (typeof iteratorFn === "function") return iteratorFn;
			}
			/**
			* Collection of methods that allow declaration and validation of props that are
			* supplied to React components. Example usage:
			*
			*   var Props = require('ReactPropTypes');
			*   var MyArticle = React.createClass({
			*     propTypes: {
			*       // An optional string prop named "description".
			*       description: Props.string,
			*
			*       // A required enum prop named "category".
			*       category: Props.oneOf(['News','Photos']).isRequired,
			*
			*       // A prop named "dialog" that requires an instance of Dialog.
			*       dialog: Props.instanceOf(Dialog).isRequired
			*     },
			*     render: function() { ... }
			*   });
			*
			* A more formal specification of how these methods are used:
			*
			*   type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
			*   decl := ReactPropTypes.{type}(.isRequired)?
			*
			* Each and every declaration produces a function with the same signature. This
			* allows the creation of custom validation functions. For example:
			*
			*  var MyLink = React.createClass({
			*    propTypes: {
			*      // An optional string or URI prop named "href".
			*      href: function(props, propName, componentName) {
			*        var propValue = props[propName];
			*        if (propValue != null && typeof propValue !== 'string' &&
			*            !(propValue instanceof URI)) {
			*          return new Error(
			*            'Expected a string or an URI for ' + propName + ' in ' +
			*            componentName
			*          );
			*        }
			*      }
			*    },
			*    render: function() {...}
			*  });
			*
			* @internal
			*/
			var ANONYMOUS = "<<anonymous>>";
			var ReactPropTypes = {
				array: createPrimitiveTypeChecker("array"),
				bigint: createPrimitiveTypeChecker("bigint"),
				bool: createPrimitiveTypeChecker("boolean"),
				func: createPrimitiveTypeChecker("function"),
				number: createPrimitiveTypeChecker("number"),
				object: createPrimitiveTypeChecker("object"),
				string: createPrimitiveTypeChecker("string"),
				symbol: createPrimitiveTypeChecker("symbol"),
				any: createAnyTypeChecker(),
				arrayOf: createArrayOfTypeChecker,
				element: createElementTypeChecker(),
				elementType: createElementTypeTypeChecker(),
				instanceOf: createInstanceTypeChecker,
				node: createNodeChecker(),
				objectOf: createObjectOfTypeChecker,
				oneOf: createEnumTypeChecker,
				oneOfType: createUnionTypeChecker,
				shape: createShapeTypeChecker,
				exact: createStrictShapeTypeChecker
			};
			/**
			* inlined Object.is polyfill to avoid requiring consumers ship their own
			* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
			*/
			function is(x, y) {
				if (x === y) return x !== 0 || 1 / x === 1 / y;
				else return x !== x && y !== y;
			}
			/**
			* We use an Error-like object for backward compatibility as people may call
			* PropTypes directly and inspect their output. However, we don't use real
			* Errors anymore. We don't inspect their stack anyway, and creating them
			* is prohibitively expensive if they are created too often, such as what
			* happens in oneOfType() for any type before the one that matched.
			*/
			function PropTypeError(message, data) {
				this.message = message;
				this.data = data && typeof data === "object" ? data : {};
				this.stack = "";
			}
			PropTypeError.prototype = Error.prototype;
			function createChainableTypeChecker(validate) {
				var manualPropTypeCallCache = {};
				var manualPropTypeWarningCount = 0;
				function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
					componentName = componentName || ANONYMOUS;
					propFullName = propFullName || propName;
					if (secret !== ReactPropTypesSecret) {
						if (throwOnDirectAccess) {
							var err = /* @__PURE__ */ new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");
							err.name = "Invariant Violation";
							throw err;
						} else if (typeof console !== "undefined") {
							var cacheKey = componentName + ":" + propName;
							if (!manualPropTypeCallCache[cacheKey] && manualPropTypeWarningCount < 3) {
								printWarning("You are manually calling a React.PropTypes validation function for the `" + propFullName + "` prop on `" + componentName + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.");
								manualPropTypeCallCache[cacheKey] = true;
								manualPropTypeWarningCount++;
							}
						}
					}
					if (props[propName] == null) {
						if (isRequired) {
							if (props[propName] === null) return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`."));
							return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`."));
						}
						return null;
					} else return validate(props, propName, componentName, location, propFullName);
				}
				var chainedCheckType = checkType.bind(null, false);
				chainedCheckType.isRequired = checkType.bind(null, true);
				return chainedCheckType;
			}
			function createPrimitiveTypeChecker(expectedType) {
				function validate(props, propName, componentName, location, propFullName, secret) {
					var propValue = props[propName];
					if (getPropType(propValue) !== expectedType) {
						var preciseType = getPreciseType(propValue);
						return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."), { expectedType });
					}
					return null;
				}
				return createChainableTypeChecker(validate);
			}
			function createAnyTypeChecker() {
				return createChainableTypeChecker(emptyFunctionThatReturnsNull);
			}
			function createArrayOfTypeChecker(typeChecker) {
				function validate(props, propName, componentName, location, propFullName) {
					if (typeof typeChecker !== "function") return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf.");
					var propValue = props[propName];
					if (!Array.isArray(propValue)) {
						var propType = getPropType(propValue);
						return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array."));
					}
					for (var i = 0; i < propValue.length; i++) {
						var error = typeChecker(propValue, i, componentName, location, propFullName + "[" + i + "]", ReactPropTypesSecret);
						if (error instanceof Error) return error;
					}
					return null;
				}
				return createChainableTypeChecker(validate);
			}
			function createElementTypeChecker() {
				function validate(props, propName, componentName, location, propFullName) {
					var propValue = props[propName];
					if (!isValidElement(propValue)) {
						var propType = getPropType(propValue);
						return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement."));
					}
					return null;
				}
				return createChainableTypeChecker(validate);
			}
			function createElementTypeTypeChecker() {
				function validate(props, propName, componentName, location, propFullName) {
					var propValue = props[propName];
					if (!ReactIs.isValidElementType(propValue)) {
						var propType = getPropType(propValue);
						return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement type."));
					}
					return null;
				}
				return createChainableTypeChecker(validate);
			}
			function createInstanceTypeChecker(expectedClass) {
				function validate(props, propName, componentName, location, propFullName) {
					if (!(props[propName] instanceof expectedClass)) {
						var expectedClassName = expectedClass.name || ANONYMOUS;
						var actualClassName = getClassName(props[propName]);
						return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`."));
					}
					return null;
				}
				return createChainableTypeChecker(validate);
			}
			function createEnumTypeChecker(expectedValues) {
				if (!Array.isArray(expectedValues)) {
					if (arguments.length > 1) printWarning("Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).");
					else printWarning("Invalid argument supplied to oneOf, expected an array.");
					return emptyFunctionThatReturnsNull;
				}
				function validate(props, propName, componentName, location, propFullName) {
					var propValue = props[propName];
					for (var i = 0; i < expectedValues.length; i++) if (is(propValue, expectedValues[i])) return null;
					var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
						if (getPreciseType(value) === "symbol") return String(value);
						return value;
					});
					return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + "."));
				}
				return createChainableTypeChecker(validate);
			}
			function createObjectOfTypeChecker(typeChecker) {
				function validate(props, propName, componentName, location, propFullName) {
					if (typeof typeChecker !== "function") return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf.");
					var propValue = props[propName];
					var propType = getPropType(propValue);
					if (propType !== "object") return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object."));
					for (var key in propValue) if (has(propValue, key)) {
						var error = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
						if (error instanceof Error) return error;
					}
					return null;
				}
				return createChainableTypeChecker(validate);
			}
			function createUnionTypeChecker(arrayOfTypeCheckers) {
				if (!Array.isArray(arrayOfTypeCheckers)) {
					printWarning("Invalid argument supplied to oneOfType, expected an instance of array.");
					return emptyFunctionThatReturnsNull;
				}
				for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
					var checker = arrayOfTypeCheckers[i];
					if (typeof checker !== "function") {
						printWarning("Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i + ".");
						return emptyFunctionThatReturnsNull;
					}
				}
				function validate(props, propName, componentName, location, propFullName) {
					var expectedTypes = [];
					for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
						var checker = arrayOfTypeCheckers[i];
						var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
						if (checkerResult == null) return null;
						if (checkerResult.data && has(checkerResult.data, "expectedType")) expectedTypes.push(checkerResult.data.expectedType);
					}
					var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : "";
					return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + "."));
				}
				return createChainableTypeChecker(validate);
			}
			function createNodeChecker() {
				function validate(props, propName, componentName, location, propFullName) {
					if (!isNode(props[propName])) return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode."));
					return null;
				}
				return createChainableTypeChecker(validate);
			}
			function invalidValidatorError(componentName, location, propFullName, key, type) {
				return new PropTypeError((componentName || "React class") + ": " + location + " type `" + propFullName + "." + key + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`.");
			}
			function createShapeTypeChecker(shapeTypes) {
				function validate(props, propName, componentName, location, propFullName) {
					var propValue = props[propName];
					var propType = getPropType(propValue);
					if (propType !== "object") return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
					for (var key in shapeTypes) {
						var checker = shapeTypes[key];
						if (typeof checker !== "function") return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
						var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
						if (error) return error;
					}
					return null;
				}
				return createChainableTypeChecker(validate);
			}
			function createStrictShapeTypeChecker(shapeTypes) {
				function validate(props, propName, componentName, location, propFullName) {
					var propValue = props[propName];
					var propType = getPropType(propValue);
					if (propType !== "object") return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
					for (var key in assign({}, props[propName], shapeTypes)) {
						var checker = shapeTypes[key];
						if (has(shapeTypes, key) && typeof checker !== "function") return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
						if (!checker) return new PropTypeError("Invalid " + location + " `" + propFullName + "` key `" + key + "` supplied to `" + componentName + "`.\nBad object: " + JSON.stringify(props[propName], null, "  ") + "\nValid keys: " + JSON.stringify(Object.keys(shapeTypes), null, "  "));
						var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
						if (error) return error;
					}
					return null;
				}
				return createChainableTypeChecker(validate);
			}
			function isNode(propValue) {
				switch (typeof propValue) {
					case "number":
					case "string":
					case "undefined": return true;
					case "boolean": return !propValue;
					case "object":
						if (Array.isArray(propValue)) return propValue.every(isNode);
						if (propValue === null || isValidElement(propValue)) return true;
						var iteratorFn = getIteratorFn(propValue);
						if (iteratorFn) {
							var iterator = iteratorFn.call(propValue);
							var step;
							if (iteratorFn !== propValue.entries) {
								while (!(step = iterator.next()).done) if (!isNode(step.value)) return false;
							} else while (!(step = iterator.next()).done) {
								var entry = step.value;
								if (entry) {
									if (!isNode(entry[1])) return false;
								}
							}
						} else return false;
						return true;
					default: return false;
				}
			}
			function isSymbol(propType, propValue) {
				if (propType === "symbol") return true;
				if (!propValue) return false;
				if (propValue["@@toStringTag"] === "Symbol") return true;
				if (typeof Symbol === "function" && propValue instanceof Symbol) return true;
				return false;
			}
			function getPropType(propValue) {
				var propType = typeof propValue;
				if (Array.isArray(propValue)) return "array";
				if (propValue instanceof RegExp) return "object";
				if (isSymbol(propType, propValue)) return "symbol";
				return propType;
			}
			function getPreciseType(propValue) {
				if (typeof propValue === "undefined" || propValue === null) return "" + propValue;
				var propType = getPropType(propValue);
				if (propType === "object") {
					if (propValue instanceof Date) return "date";
					else if (propValue instanceof RegExp) return "regexp";
				}
				return propType;
			}
			function getPostfixForTypeWarning(value) {
				var type = getPreciseType(value);
				switch (type) {
					case "array":
					case "object": return "an " + type;
					case "boolean":
					case "date":
					case "regexp": return "a " + type;
					default: return type;
				}
			}
			function getClassName(propValue) {
				if (!propValue.constructor || !propValue.constructor.name) return ANONYMOUS;
				return propValue.constructor.name;
			}
			ReactPropTypes.checkPropTypes = checkPropTypes;
			ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
			ReactPropTypes.PropTypes = ReactPropTypes;
			return ReactPropTypes;
		};
	}));

//#endregion
//#region node_modules/prop-types/index.js
	var require_prop_types = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var ReactIs = require_react_is();
		var throwOnDirectAccess = true;
		module.exports = require_factoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
	}));

//#endregion
//#region node_modules/dom-helpers/esm/hasClass.js
/**
	* Checks if a given element has a CSS class.
	* 
	* @param element the element
	* @param className the CSS class name
	*/
	function hasClass(element, className) {
		if (element.classList) return !!className && element.classList.contains(className);
		return (" " + (element.className.baseVal || element.className) + " ").indexOf(" " + className + " ") !== -1;
	}

//#endregion
//#region node_modules/dom-helpers/esm/addClass.js
/**
	* Adds a CSS class to a given element.
	* 
	* @param element the element
	* @param className the CSS class name
	*/
	function addClass(element, className) {
		if (element.classList) element.classList.add(className);
		else if (!hasClass(element, className)) if (typeof element.className === "string") element.className = element.className + " " + className;
		else element.setAttribute("class", (element.className && element.className.baseVal || "") + " " + className);
	}

//#endregion
//#region node_modules/dom-helpers/esm/removeClass.js
	function replaceClassName(origClass, classToRemove) {
		return origClass.replace(new RegExp("(^|\\s)" + classToRemove + "(?:\\s|$)", "g"), "$1").replace(/\s+/g, " ").replace(/^\s*|\s*$/g, "");
	}
	/**
	* Removes a CSS class from a given element.
	* 
	* @param element the element
	* @param className the CSS class name
	*/
	function removeClass$1(element, className) {
		if (element.classList) element.classList.remove(className);
		else if (typeof element.className === "string") element.className = replaceClassName(element.className, className);
		else element.setAttribute("class", replaceClassName(element.className && element.className.baseVal || "", className));
	}
	__name(removeClass$1, "removeClass");

//#endregion
//#region node_modules/react-transition-group/esm/config.js
	var config_default = { disabled: false };

//#endregion
//#region node_modules/react-transition-group/esm/utils/PropTypes.js
	var import_prop_types = /* @__PURE__ */ __toESM(require_prop_types());
	var timeoutsShape = import_prop_types.default.oneOfType([import_prop_types.default.number, import_prop_types.default.shape({
		enter: import_prop_types.default.number,
		exit: import_prop_types.default.number,
		appear: import_prop_types.default.number
	}).isRequired]);
	var classNamesShape = import_prop_types.default.oneOfType([
		import_prop_types.default.string,
		import_prop_types.default.shape({
			enter: import_prop_types.default.string,
			exit: import_prop_types.default.string,
			active: import_prop_types.default.string
		}),
		import_prop_types.default.shape({
			enter: import_prop_types.default.string,
			enterDone: import_prop_types.default.string,
			enterActive: import_prop_types.default.string,
			exit: import_prop_types.default.string,
			exitDone: import_prop_types.default.string,
			exitActive: import_prop_types.default.string
		})
	]);

//#endregion
//#region node_modules/react-transition-group/esm/TransitionGroupContext.js
	var TransitionGroupContext_default = react.default.createContext(null);

//#endregion
//#region node_modules/react-transition-group/esm/utils/reflow.js
	var forceReflow = function forceReflow(node) {
		return node.scrollTop;
	};

//#endregion
//#region node_modules/react-transition-group/esm/Transition.js
	var UNMOUNTED = "unmounted";
	var EXITED = "exited";
	var ENTERING = "entering";
	var ENTERED = "entered";
	var EXITING = "exiting";
	/**
	* The Transition component lets you describe a transition from one component
	* state to another _over time_ with a simple declarative API. Most commonly
	* it's used to animate the mounting and unmounting of a component, but can also
	* be used to describe in-place transition states as well.
	*
	* ---
	*
	* **Note**: `Transition` is a platform-agnostic base component. If you're using
	* transitions in CSS, you'll probably want to use
	* [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition)
	* instead. It inherits all the features of `Transition`, but contains
	* additional features necessary to play nice with CSS transitions (hence the
	* name of the component).
	*
	* ---
	*
	* By default the `Transition` component does not alter the behavior of the
	* component it renders, it only tracks "enter" and "exit" states for the
	* components. It's up to you to give meaning and effect to those states. For
	* example we can add styles to a component when it enters or exits:
	*
	* ```jsx
	* import { Transition } from 'react-transition-group';
	*
	* const duration = 300;
	*
	* const defaultStyle = {
	*   transition: `opacity ${duration}ms ease-in-out`,
	*   opacity: 0,
	* }
	*
	* const transitionStyles = {
	*   entering: { opacity: 1 },
	*   entered:  { opacity: 1 },
	*   exiting:  { opacity: 0 },
	*   exited:  { opacity: 0 },
	* };
	*
	* const Fade = ({ in: inProp }) => (
	*   <Transition in={inProp} timeout={duration}>
	*     {state => (
	*       <div style={{
	*         ...defaultStyle,
	*         ...transitionStyles[state]
	*       }}>
	*         I'm a fade Transition!
	*       </div>
	*     )}
	*   </Transition>
	* );
	* ```
	*
	* There are 4 main states a Transition can be in:
	*  - `'entering'`
	*  - `'entered'`
	*  - `'exiting'`
	*  - `'exited'`
	*
	* Transition state is toggled via the `in` prop. When `true` the component
	* begins the "Enter" stage. During this stage, the component will shift from
	* its current transition state, to `'entering'` for the duration of the
	* transition and then to the `'entered'` stage once it's complete. Let's take
	* the following example (we'll use the
	* [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):
	*
	* ```jsx
	* function App() {
	*   const [inProp, setInProp] = useState(false);
	*   return (
	*     <div>
	*       <Transition in={inProp} timeout={500}>
	*         {state => (
	*           // ...
	*         )}
	*       </Transition>
	*       <button onClick={() => setInProp(true)}>
	*         Click to Enter
	*       </button>
	*     </div>
	*   );
	* }
	* ```
	*
	* When the button is clicked the component will shift to the `'entering'` state
	* and stay there for 500ms (the value of `timeout`) before it finally switches
	* to `'entered'`.
	*
	* When `in` is `false` the same thing happens except the state moves from
	* `'exiting'` to `'exited'`.
	*/
	var Transition = /*#__PURE__*/ function(_React$Component) {
		_inheritsLoose(Transition, _React$Component);
		function Transition(props, context) {
			var _this = _React$Component.call(this, props, context) || this;
			var parentGroup = context;
			var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;
			var initialStatus;
			_this.appearStatus = null;
			if (props.in) if (appear) {
				initialStatus = EXITED;
				_this.appearStatus = ENTERING;
			} else initialStatus = ENTERED;
			else if (props.unmountOnExit || props.mountOnEnter) initialStatus = UNMOUNTED;
			else initialStatus = EXITED;
			_this.state = { status: initialStatus };
			_this.nextCallback = null;
			return _this;
		}
		Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {
			if (_ref.in && prevState.status === "unmounted") return { status: EXITED };
			return null;
		};
		var _proto = Transition.prototype;
		_proto.componentDidMount = function componentDidMount() {
			this.updateStatus(true, this.appearStatus);
		};
		_proto.componentDidUpdate = function componentDidUpdate(prevProps) {
			var nextStatus = null;
			if (prevProps !== this.props) {
				var status = this.state.status;
				if (this.props.in) {
					if (status !== "entering" && status !== "entered") nextStatus = ENTERING;
				} else if (status === "entering" || status === "entered") nextStatus = EXITING;
			}
			this.updateStatus(false, nextStatus);
		};
		_proto.componentWillUnmount = function componentWillUnmount() {
			this.cancelNextCallback();
		};
		_proto.getTimeouts = function getTimeouts() {
			var timeout = this.props.timeout;
			var exit = enter = appear = timeout;
			var enter;
			var appear;
			if (timeout != null && typeof timeout !== "number") {
				exit = timeout.exit;
				enter = timeout.enter;
				appear = timeout.appear !== void 0 ? timeout.appear : enter;
			}
			return {
				exit,
				enter,
				appear
			};
		};
		_proto.updateStatus = function updateStatus(mounting, nextStatus) {
			if (mounting === void 0) mounting = false;
			if (nextStatus !== null) {
				this.cancelNextCallback();
				if (nextStatus === "entering") {
					if (this.props.unmountOnExit || this.props.mountOnEnter) {
						var node = this.props.nodeRef ? this.props.nodeRef.current : react_dom.default.findDOMNode(this);
						if (node) forceReflow(node);
					}
					this.performEnter(mounting);
				} else this.performExit();
			} else if (this.props.unmountOnExit && this.state.status === "exited") this.setState({ status: UNMOUNTED });
		};
		_proto.performEnter = function performEnter(mounting) {
			var _this2 = this;
			var enter = this.props.enter;
			var appearing = this.context ? this.context.isMounting : mounting;
			var _ref2 = this.props.nodeRef ? [appearing] : [react_dom.default.findDOMNode(this), appearing];
			var maybeNode = _ref2[0];
			var maybeAppearing = _ref2[1];
			var timeouts = this.getTimeouts();
			var enterTimeout = appearing ? timeouts.appear : timeouts.enter;
			if (!mounting && !enter || config_default.disabled) {
				this.safeSetState({ status: ENTERED }, function() {
					_this2.props.onEntered(maybeNode);
				});
				return;
			}
			this.props.onEnter(maybeNode, maybeAppearing);
			this.safeSetState({ status: ENTERING }, function() {
				_this2.props.onEntering(maybeNode, maybeAppearing);
				_this2.onTransitionEnd(enterTimeout, function() {
					_this2.safeSetState({ status: ENTERED }, function() {
						_this2.props.onEntered(maybeNode, maybeAppearing);
					});
				});
			});
		};
		_proto.performExit = function performExit() {
			var _this3 = this;
			var exit = this.props.exit;
			var timeouts = this.getTimeouts();
			var maybeNode = this.props.nodeRef ? void 0 : react_dom.default.findDOMNode(this);
			if (!exit || config_default.disabled) {
				this.safeSetState({ status: EXITED }, function() {
					_this3.props.onExited(maybeNode);
				});
				return;
			}
			this.props.onExit(maybeNode);
			this.safeSetState({ status: EXITING }, function() {
				_this3.props.onExiting(maybeNode);
				_this3.onTransitionEnd(timeouts.exit, function() {
					_this3.safeSetState({ status: EXITED }, function() {
						_this3.props.onExited(maybeNode);
					});
				});
			});
		};
		_proto.cancelNextCallback = function cancelNextCallback() {
			if (this.nextCallback !== null) {
				this.nextCallback.cancel();
				this.nextCallback = null;
			}
		};
		_proto.safeSetState = function safeSetState(nextState, callback) {
			callback = this.setNextCallback(callback);
			this.setState(nextState, callback);
		};
		_proto.setNextCallback = function setNextCallback(callback) {
			var _this4 = this;
			var active = true;
			this.nextCallback = function(event) {
				if (active) {
					active = false;
					_this4.nextCallback = null;
					callback(event);
				}
			};
			this.nextCallback.cancel = function() {
				active = false;
			};
			return this.nextCallback;
		};
		_proto.onTransitionEnd = function onTransitionEnd(timeout, handler) {
			this.setNextCallback(handler);
			var node = this.props.nodeRef ? this.props.nodeRef.current : react_dom.default.findDOMNode(this);
			var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;
			if (!node || doesNotHaveTimeoutOrListener) {
				setTimeout(this.nextCallback, 0);
				return;
			}
			if (this.props.addEndListener) {
				var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node, this.nextCallback];
				var maybeNode = _ref3[0];
				var maybeNextCallback = _ref3[1];
				this.props.addEndListener(maybeNode, maybeNextCallback);
			}
			if (timeout != null) setTimeout(this.nextCallback, timeout);
		};
		_proto.render = function render() {
			var status = this.state.status;
			if (status === "unmounted") return null;
			var _this$props = this.props;
			var children = _this$props.children;
			_this$props.in;
			_this$props.mountOnEnter;
			_this$props.unmountOnExit;
			_this$props.appear;
			_this$props.enter;
			_this$props.exit;
			_this$props.timeout;
			_this$props.addEndListener;
			_this$props.onEnter;
			_this$props.onEntering;
			_this$props.onEntered;
			_this$props.onExit;
			_this$props.onExiting;
			_this$props.onExited;
			_this$props.nodeRef;
			var childProps = _objectWithoutPropertiesLoose(_this$props, [
				"children",
				"in",
				"mountOnEnter",
				"unmountOnExit",
				"appear",
				"enter",
				"exit",
				"timeout",
				"addEndListener",
				"onEnter",
				"onEntering",
				"onEntered",
				"onExit",
				"onExiting",
				"onExited",
				"nodeRef"
			]);
			return /*#__PURE__*/ react.default.createElement(TransitionGroupContext_default.Provider, { value: null }, typeof children === "function" ? children(status, childProps) : react.default.cloneElement(react.default.Children.only(children), childProps));
		};
		return Transition;
	}(react.default.Component);
	Transition.contextType = TransitionGroupContext_default;
	Transition.propTypes = {
		/**
		* A React reference to DOM element that need to transition:
		* https://stackoverflow.com/a/51127130/4671932
		*
		*   - When `nodeRef` prop is used, `node` is not passed to callback functions
		*      (e.g. `onEnter`) because user already has direct access to the node.
		*   - When changing `key` prop of `Transition` in a `TransitionGroup` a new
		*     `nodeRef` need to be provided to `Transition` with changed `key` prop
		*     (see
		*     [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).
		*/
		nodeRef: import_prop_types.default.shape({ current: typeof Element === "undefined" ? import_prop_types.default.any : function(propValue, key, componentName, location, propFullName, secret) {
			var value = propValue[key];
			return import_prop_types.default.instanceOf(value && "ownerDocument" in value ? value.ownerDocument.defaultView.Element : Element)(propValue, key, componentName, location, propFullName, secret);
		} }),
		/**
		* A `function` child can be used instead of a React element. This function is
		* called with the current transition status (`'entering'`, `'entered'`,
		* `'exiting'`, `'exited'`), which can be used to apply context
		* specific props to a component.
		*
		* ```jsx
		* <Transition in={this.state.in} timeout={150}>
		*   {state => (
		*     <MyComponent className={`fade fade-${state}`} />
		*   )}
		* </Transition>
		* ```
		*/
		children: import_prop_types.default.oneOfType([import_prop_types.default.func.isRequired, import_prop_types.default.element.isRequired]).isRequired,
		/**
		* Show the component; triggers the enter or exit states
		*/
		in: import_prop_types.default.bool,
		/**
		* By default the child component is mounted immediately along with
		* the parent `Transition` component. If you want to "lazy mount" the component on the
		* first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay
		* mounted, even on "exited", unless you also specify `unmountOnExit`.
		*/
		mountOnEnter: import_prop_types.default.bool,
		/**
		* By default the child component stays mounted after it reaches the `'exited'` state.
		* Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.
		*/
		unmountOnExit: import_prop_types.default.bool,
		/**
		* By default the child component does not perform the enter transition when
		* it first mounts, regardless of the value of `in`. If you want this
		* behavior, set both `appear` and `in` to `true`.
		*
		* > **Note**: there are no special appear states like `appearing`/`appeared`, this prop
		* > only adds an additional enter transition. However, in the
		* > `<CSSTransition>` component that first enter transition does result in
		* > additional `.appear-*` classes, that way you can choose to style it
		* > differently.
		*/
		appear: import_prop_types.default.bool,
		/**
		* Enable or disable enter transitions.
		*/
		enter: import_prop_types.default.bool,
		/**
		* Enable or disable exit transitions.
		*/
		exit: import_prop_types.default.bool,
		/**
		* The duration of the transition, in milliseconds.
		* Required unless `addEndListener` is provided.
		*
		* You may specify a single timeout for all transitions:
		*
		* ```jsx
		* timeout={500}
		* ```
		*
		* or individually:
		*
		* ```jsx
		* timeout={{
		*  appear: 500,
		*  enter: 300,
		*  exit: 500,
		* }}
		* ```
		*
		* - `appear` defaults to the value of `enter`
		* - `enter` defaults to `0`
		* - `exit` defaults to `0`
		*
		* @type {number | { enter?: number, exit?: number, appear?: number }}
		*/
		timeout: function timeout(props) {
			var pt = timeoutsShape;
			if (!props.addEndListener) pt = pt.isRequired;
			for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) args[_key - 1] = arguments[_key];
			return pt.apply(void 0, [props].concat(args));
		},
		/**
		* Add a custom transition end trigger. Called with the transitioning
		* DOM node and a `done` callback. Allows for more fine grained transition end
		* logic. Timeouts are still used as a fallback if provided.
		*
		* **Note**: when `nodeRef` prop is passed, `node` is not passed.
		*
		* ```jsx
		* addEndListener={(node, done) => {
		*   // use the css transitionend event to mark the finish of a transition
		*   node.addEventListener('transitionend', done, false);
		* }}
		* ```
		*/
		addEndListener: import_prop_types.default.func,
		/**
		* Callback fired before the "entering" status is applied. An extra parameter
		* `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
		*
		* **Note**: when `nodeRef` prop is passed, `node` is not passed.
		*
		* @type Function(node: HtmlElement, isAppearing: bool) -> void
		*/
		onEnter: import_prop_types.default.func,
		/**
		* Callback fired after the "entering" status is applied. An extra parameter
		* `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
		*
		* **Note**: when `nodeRef` prop is passed, `node` is not passed.
		*
		* @type Function(node: HtmlElement, isAppearing: bool)
		*/
		onEntering: import_prop_types.default.func,
		/**
		* Callback fired after the "entered" status is applied. An extra parameter
		* `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
		*
		* **Note**: when `nodeRef` prop is passed, `node` is not passed.
		*
		* @type Function(node: HtmlElement, isAppearing: bool) -> void
		*/
		onEntered: import_prop_types.default.func,
		/**
		* Callback fired before the "exiting" status is applied.
		*
		* **Note**: when `nodeRef` prop is passed, `node` is not passed.
		*
		* @type Function(node: HtmlElement) -> void
		*/
		onExit: import_prop_types.default.func,
		/**
		* Callback fired after the "exiting" status is applied.
		*
		* **Note**: when `nodeRef` prop is passed, `node` is not passed.
		*
		* @type Function(node: HtmlElement) -> void
		*/
		onExiting: import_prop_types.default.func,
		/**
		* Callback fired after the "exited" status is applied.
		*
		* **Note**: when `nodeRef` prop is passed, `node` is not passed
		*
		* @type Function(node: HtmlElement) -> void
		*/
		onExited: import_prop_types.default.func
	};
	function noop$1() {}
	__name(noop$1, "noop");
	Transition.defaultProps = {
		in: false,
		mountOnEnter: false,
		unmountOnExit: false,
		appear: false,
		enter: true,
		exit: true,
		onEnter: noop$1,
		onEntering: noop$1,
		onEntered: noop$1,
		onExit: noop$1,
		onExiting: noop$1,
		onExited: noop$1
	};
	Transition.UNMOUNTED = UNMOUNTED;
	Transition.EXITED = EXITED;
	Transition.ENTERING = ENTERING;
	Transition.ENTERED = ENTERED;
	Transition.EXITING = EXITING;

//#endregion
//#region node_modules/react-transition-group/esm/CSSTransition.js
	var _addClass = /* @__PURE__ */ __name(function addClass$1(node, classes) {
		return node && classes && classes.split(" ").forEach(function(c) {
			return addClass(node, c);
		});
	}, "addClass");
	var removeClass = function removeClass(node, classes) {
		return node && classes && classes.split(" ").forEach(function(c) {
			return removeClass$1(node, c);
		});
	};
	/**
	* A transition component inspired by the excellent
	* [ng-animate](https://docs.angularjs.org/api/ngAnimate) library, you should
	* use it if you're using CSS transitions or animations. It's built upon the
	* [`Transition`](https://reactcommunity.org/react-transition-group/transition)
	* component, so it inherits all of its props.
	*
	* `CSSTransition` applies a pair of class names during the `appear`, `enter`,
	* and `exit` states of the transition. The first class is applied and then a
	* second `*-active` class in order to activate the CSS transition. After the
	* transition, matching `*-done` class names are applied to persist the
	* transition state.
	*
	* ```jsx
	* function App() {
	*   const [inProp, setInProp] = useState(false);
	*   return (
	*     <div>
	*       <CSSTransition in={inProp} timeout={200} classNames="my-node">
	*         <div>
	*           {"I'll receive my-node-* classes"}
	*         </div>
	*       </CSSTransition>
	*       <button type="button" onClick={() => setInProp(true)}>
	*         Click to Enter
	*       </button>
	*     </div>
	*   );
	* }
	* ```
	*
	* When the `in` prop is set to `true`, the child component will first receive
	* the class `example-enter`, then the `example-enter-active` will be added in
	* the next tick. `CSSTransition` [forces a
	* reflow](https://github.com/reactjs/react-transition-group/blob/5007303e729a74be66a21c3e2205e4916821524b/src/CSSTransition.js#L208-L215)
	* between before adding the `example-enter-active`. This is an important trick
	* because it allows us to transition between `example-enter` and
	* `example-enter-active` even though they were added immediately one after
	* another. Most notably, this is what makes it possible for us to animate
	* _appearance_.
	*
	* ```css
	* .my-node-enter {
	*   opacity: 0;
	* }
	* .my-node-enter-active {
	*   opacity: 1;
	*   transition: opacity 200ms;
	* }
	* .my-node-exit {
	*   opacity: 1;
	* }
	* .my-node-exit-active {
	*   opacity: 0;
	*   transition: opacity 200ms;
	* }
	* ```
	*
	* `*-active` classes represent which styles you want to animate **to**, so it's
	* important to add `transition` declaration only to them, otherwise transitions
	* might not behave as intended! This might not be obvious when the transitions
	* are symmetrical, i.e. when `*-enter-active` is the same as `*-exit`, like in
	* the example above (minus `transition`), but it becomes apparent in more
	* complex transitions.
	*
	* **Note**: If you're using the
	* [`appear`](http://reactcommunity.org/react-transition-group/transition#Transition-prop-appear)
	* prop, make sure to define styles for `.appear-*` classes as well.
	*/
	var CSSTransition$1 = /*#__PURE__*/ function(_React$Component) {
		_inheritsLoose(CSSTransition, _React$Component);
		function CSSTransition() {
			var _this;
			for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
			_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
			_this.appliedClasses = {
				appear: {},
				enter: {},
				exit: {}
			};
			_this.onEnter = function(maybeNode, maybeAppearing) {
				var _this$resolveArgument = _this.resolveArguments(maybeNode, maybeAppearing);
				var node = _this$resolveArgument[0];
				var appearing = _this$resolveArgument[1];
				_this.removeClasses(node, "exit");
				_this.addClass(node, appearing ? "appear" : "enter", "base");
				if (_this.props.onEnter) _this.props.onEnter(maybeNode, maybeAppearing);
			};
			_this.onEntering = function(maybeNode, maybeAppearing) {
				var _this$resolveArgument2 = _this.resolveArguments(maybeNode, maybeAppearing);
				var node = _this$resolveArgument2[0];
				var type = _this$resolveArgument2[1] ? "appear" : "enter";
				_this.addClass(node, type, "active");
				if (_this.props.onEntering) _this.props.onEntering(maybeNode, maybeAppearing);
			};
			_this.onEntered = function(maybeNode, maybeAppearing) {
				var _this$resolveArgument3 = _this.resolveArguments(maybeNode, maybeAppearing);
				var node = _this$resolveArgument3[0];
				var type = _this$resolveArgument3[1] ? "appear" : "enter";
				_this.removeClasses(node, type);
				_this.addClass(node, type, "done");
				if (_this.props.onEntered) _this.props.onEntered(maybeNode, maybeAppearing);
			};
			_this.onExit = function(maybeNode) {
				var node = _this.resolveArguments(maybeNode)[0];
				_this.removeClasses(node, "appear");
				_this.removeClasses(node, "enter");
				_this.addClass(node, "exit", "base");
				if (_this.props.onExit) _this.props.onExit(maybeNode);
			};
			_this.onExiting = function(maybeNode) {
				var node = _this.resolveArguments(maybeNode)[0];
				_this.addClass(node, "exit", "active");
				if (_this.props.onExiting) _this.props.onExiting(maybeNode);
			};
			_this.onExited = function(maybeNode) {
				var node = _this.resolveArguments(maybeNode)[0];
				_this.removeClasses(node, "exit");
				_this.addClass(node, "exit", "done");
				if (_this.props.onExited) _this.props.onExited(maybeNode);
			};
			_this.resolveArguments = function(maybeNode, maybeAppearing) {
				return _this.props.nodeRef ? [_this.props.nodeRef.current, maybeNode] : [maybeNode, maybeAppearing];
			};
			_this.getClassNames = function(type) {
				var classNames = _this.props.classNames;
				var isStringClassNames = typeof classNames === "string";
				var prefix = isStringClassNames && classNames ? classNames + "-" : "";
				var baseClassName = isStringClassNames ? "" + prefix + type : classNames[type];
				return {
					baseClassName,
					activeClassName: isStringClassNames ? baseClassName + "-active" : classNames[type + "Active"],
					doneClassName: isStringClassNames ? baseClassName + "-done" : classNames[type + "Done"]
				};
			};
			return _this;
		}
		var _proto = CSSTransition.prototype;
		_proto.addClass = function addClass(node, type, phase) {
			var className = this.getClassNames(type)[phase + "ClassName"];
			var doneClassName = this.getClassNames("enter").doneClassName;
			if (type === "appear" && phase === "done" && doneClassName) className += " " + doneClassName;
			if (phase === "active") {
				if (node) forceReflow(node);
			}
			if (className) {
				this.appliedClasses[type][phase] = className;
				_addClass(node, className);
			}
		};
		_proto.removeClasses = function removeClasses(node, type) {
			var _this$appliedClasses$ = this.appliedClasses[type];
			var baseClassName = _this$appliedClasses$.base;
			var activeClassName = _this$appliedClasses$.active;
			var doneClassName = _this$appliedClasses$.done;
			this.appliedClasses[type] = {};
			if (baseClassName) removeClass(node, baseClassName);
			if (activeClassName) removeClass(node, activeClassName);
			if (doneClassName) removeClass(node, doneClassName);
		};
		_proto.render = function render() {
			var _this$props = this.props;
			_this$props.classNames;
			var props = _objectWithoutPropertiesLoose(_this$props, ["classNames"]);
			return /*#__PURE__*/ react.default.createElement(Transition, _extends$3({}, props, {
				onEnter: this.onEnter,
				onEntered: this.onEntered,
				onEntering: this.onEntering,
				onExit: this.onExit,
				onExiting: this.onExiting,
				onExited: this.onExited
			}));
		};
		return CSSTransition;
	}(react.default.Component);
	CSSTransition$1.defaultProps = { classNames: "" };
	CSSTransition$1.propTypes = _extends$3({}, Transition.propTypes, {
		/**
		* The animation classNames applied to the component as it appears, enters,
		* exits or has finished the transition. A single name can be provided, which
		* will be suffixed for each stage, e.g. `classNames="fade"` applies:
		*
		* - `fade-appear`, `fade-appear-active`, `fade-appear-done`
		* - `fade-enter`, `fade-enter-active`, `fade-enter-done`
		* - `fade-exit`, `fade-exit-active`, `fade-exit-done`
		*
		* A few details to note about how these classes are applied:
		*
		* 1. They are _joined_ with the ones that are already defined on the child
		*    component, so if you want to add some base styles, you can use
		*    `className` without worrying that it will be overridden.
		*
		* 2. If the transition component mounts with `in={false}`, no classes are
		*    applied yet. You might be expecting `*-exit-done`, but if you think
		*    about it, a component cannot finish exiting if it hasn't entered yet.
		*
		* 2. `fade-appear-done` and `fade-enter-done` will _both_ be applied. This
		*    allows you to define different behavior for when appearing is done and
		*    when regular entering is done, using selectors like
		*    `.fade-enter-done:not(.fade-appear-done)`. For example, you could apply
		*    an epic entrance animation when element first appears in the DOM using
		*    [Animate.css](https://daneden.github.io/animate.css/). Otherwise you can
		*    simply use `fade-enter-done` for defining both cases.
		*
		* Each individual classNames can also be specified independently like:
		*
		* ```js
		* classNames={{
		*  appear: 'my-appear',
		*  appearActive: 'my-active-appear',
		*  appearDone: 'my-done-appear',
		*  enter: 'my-enter',
		*  enterActive: 'my-active-enter',
		*  enterDone: 'my-done-enter',
		*  exit: 'my-exit',
		*  exitActive: 'my-active-exit',
		*  exitDone: 'my-done-exit',
		* }}
		* ```
		*
		* If you want to set these classes using CSS Modules:
		*
		* ```js
		* import styles from './styles.css';
		* ```
		*
		* you might want to use camelCase in your CSS file, that way could simply
		* spread them instead of listing them one by one:
		*
		* ```js
		* classNames={{ ...styles }}
		* ```
		*
		* @type {string | {
		*  appear?: string,
		*  appearActive?: string,
		*  appearDone?: string,
		*  enter?: string,
		*  enterActive?: string,
		*  enterDone?: string,
		*  exit?: string,
		*  exitActive?: string,
		*  exitDone?: string,
		* }}
		*/
		classNames: classNamesShape,
		/**
		* A `<Transition>` callback fired immediately after the 'enter' or 'appear' class is
		* applied.
		*
		* **Note**: when `nodeRef` prop is passed, `node` is not passed.
		*
		* @type Function(node: HtmlElement, isAppearing: bool)
		*/
		onEnter: import_prop_types.default.func,
		/**
		* A `<Transition>` callback fired immediately after the 'enter-active' or
		* 'appear-active' class is applied.
		*
		* **Note**: when `nodeRef` prop is passed, `node` is not passed.
		*
		* @type Function(node: HtmlElement, isAppearing: bool)
		*/
		onEntering: import_prop_types.default.func,
		/**
		* A `<Transition>` callback fired immediately after the 'enter' or
		* 'appear' classes are **removed** and the `done` class is added to the DOM node.
		*
		* **Note**: when `nodeRef` prop is passed, `node` is not passed.
		*
		* @type Function(node: HtmlElement, isAppearing: bool)
		*/
		onEntered: import_prop_types.default.func,
		/**
		* A `<Transition>` callback fired immediately after the 'exit' class is
		* applied.
		*
		* **Note**: when `nodeRef` prop is passed, `node` is not passed
		*
		* @type Function(node: HtmlElement)
		*/
		onExit: import_prop_types.default.func,
		/**
		* A `<Transition>` callback fired immediately after the 'exit-active' is applied.
		*
		* **Note**: when `nodeRef` prop is passed, `node` is not passed
		*
		* @type Function(node: HtmlElement)
		*/
		onExiting: import_prop_types.default.func,
		/**
		* A `<Transition>` callback fired immediately after the 'exit' classes
		* are **removed** and the `exit-done` class is added to the DOM node.
		*
		* **Note**: when `nodeRef` prop is passed, `node` is not passed
		*
		* @type Function(node: HtmlElement)
		*/
		onExited: import_prop_types.default.func
	});

//#endregion
//#region node_modules/primereact/csstransition/csstransition.esm.js
	function _typeof$3(o) {
		"@babel/helpers - typeof";
		return _typeof$3 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
			return typeof o;
		} : function(o) {
			return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
		}, _typeof$3(o);
	}
	__name(_typeof$3, "_typeof");
	function toPrimitive$3(t, r) {
		if ("object" != _typeof$3(t) || !t) return t;
		var e = t[Symbol.toPrimitive];
		if (void 0 !== e) {
			var i = e.call(t, r || "default");
			if ("object" != _typeof$3(i)) return i;
			throw new TypeError("@@toPrimitive must return a primitive value.");
		}
		return ("string" === r ? String : Number)(t);
	}
	__name(toPrimitive$3, "toPrimitive");
	function toPropertyKey$3(t) {
		var i = toPrimitive$3(t, "string");
		return "symbol" == _typeof$3(i) ? i : i + "";
	}
	__name(toPropertyKey$3, "toPropertyKey");
	function _defineProperty$3(e, r, t) {
		return (r = toPropertyKey$3(r)) in e ? Object.defineProperty(e, r, {
			value: t,
			enumerable: !0,
			configurable: !0,
			writable: !0
		}) : e[r] = t, e;
	}
	__name(_defineProperty$3, "_defineProperty");
	var CSSTransitionBase = {
		defaultProps: {
			__TYPE: "CSSTransition",
			children: void 0
		},
		getProps: function getProps(props) {
			return ObjectUtils.getMergedProps(props, CSSTransitionBase.defaultProps);
		},
		getOtherProps: function getOtherProps(props) {
			return ObjectUtils.getDiffProps(props, CSSTransitionBase.defaultProps);
		}
	};
	function ownKeys$4(e, r) {
		var t = Object.keys(e);
		if (Object.getOwnPropertySymbols) {
			var o = Object.getOwnPropertySymbols(e);
			r && (o = o.filter(function(r) {
				return Object.getOwnPropertyDescriptor(e, r).enumerable;
			})), t.push.apply(t, o);
		}
		return t;
	}
	__name(ownKeys$4, "ownKeys");
	function _objectSpread$4(e) {
		for (var r = 1; r < arguments.length; r++) {
			var t = null != arguments[r] ? arguments[r] : {};
			r % 2 ? ownKeys$4(Object(t), !0).forEach(function(r) {
				_defineProperty$3(e, r, t[r]);
			}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function(r) {
				Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
			});
		}
		return e;
	}
	__name(_objectSpread$4, "_objectSpread");
	var CSSTransition = /*#__PURE__*/ react.forwardRef(function(inProps, ref) {
		var props = CSSTransitionBase.getProps(inProps);
		var context = react.useContext(PrimeReactContext);
		var disabled = props.disabled || props.options && props.options.disabled || context && !context.cssTransition || !PrimeReact.cssTransition;
		var onEnter = function onEnter(node, isAppearing) {
			props.onEnter && props.onEnter(node, isAppearing);
			props.options && props.options.onEnter && props.options.onEnter(node, isAppearing);
		};
		var onEntering = function onEntering(node, isAppearing) {
			props.onEntering && props.onEntering(node, isAppearing);
			props.options && props.options.onEntering && props.options.onEntering(node, isAppearing);
		};
		var onEntered = function onEntered(node, isAppearing) {
			props.onEntered && props.onEntered(node, isAppearing);
			props.options && props.options.onEntered && props.options.onEntered(node, isAppearing);
		};
		var onExit = function onExit(node) {
			props.onExit && props.onExit(node);
			props.options && props.options.onExit && props.options.onExit(node);
		};
		var onExiting = function onExiting(node) {
			props.onExiting && props.onExiting(node);
			props.options && props.options.onExiting && props.options.onExiting(node);
		};
		var onExited = function onExited(node) {
			props.onExited && props.onExited(node);
			props.options && props.options.onExited && props.options.onExited(node);
		};
		useUpdateEffect(function() {
			if (disabled) {
				var node = ObjectUtils.getRefElement(props.nodeRef);
				if (props["in"]) {
					onEnter(node, true);
					onEntering(node, true);
					onEntered(node, true);
				} else {
					onExit(node);
					onExiting(node);
					onExited(node);
				}
			}
		}, [props["in"]]);
		if (disabled) return props["in"] ? props.children : null;
		var immutableProps = {
			nodeRef: props.nodeRef,
			"in": props["in"],
			appear: props.appear,
			onEnter,
			onEntering,
			onEntered,
			onExit,
			onExiting,
			onExited
		};
		var mergedProps = _objectSpread$4(_objectSpread$4(_objectSpread$4({}, {
			classNames: props.classNames,
			timeout: props.timeout,
			unmountOnExit: props.unmountOnExit
		}), props.options || {}), immutableProps);
		return /*#__PURE__*/ react.createElement(CSSTransition$1, mergedProps, props.children);
	});
	CSSTransition.displayName = "CSSTransition";

//#endregion
//#region node_modules/primereact/keyfilter/keyfilter.esm.js
	function _arrayLikeToArray$4(r, a) {
		(null == a || a > r.length) && (a = r.length);
		for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
		return n;
	}
	__name(_arrayLikeToArray$4, "_arrayLikeToArray");
	function _arrayWithoutHoles$2(r) {
		if (Array.isArray(r)) return _arrayLikeToArray$4(r);
	}
	__name(_arrayWithoutHoles$2, "_arrayWithoutHoles");
	function _iterableToArray$2(r) {
		if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
	}
	__name(_iterableToArray$2, "_iterableToArray");
	function _unsupportedIterableToArray$4(r, a) {
		if (r) {
			if ("string" == typeof r) return _arrayLikeToArray$4(r, a);
			var t = {}.toString.call(r).slice(8, -1);
			return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$4(r, a) : void 0;
		}
	}
	__name(_unsupportedIterableToArray$4, "_unsupportedIterableToArray");
	function _nonIterableSpread$2() {
		throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
	}
	__name(_nonIterableSpread$2, "_nonIterableSpread");
	function _toConsumableArray$2(r) {
		return _arrayWithoutHoles$2(r) || _iterableToArray$2(r) || _unsupportedIterableToArray$4(r) || _nonIterableSpread$2();
	}
	__name(_toConsumableArray$2, "_toConsumableArray");
	var KeyFilter = {
		DEFAULT_MASKS: {
			pint: /[\d]/,
			"int": /[\d\-]/,
			pnum: /[\d\.]/,
			money: /[\d\.\s,]/,
			num: /[\d\-\.]/,
			hex: /[0-9a-f]/i,
			email: /[a-z0-9_\.\-@]/i,
			alpha: /[a-z_]/i,
			alphanum: /[a-z0-9_]/i
		},
		getRegex: function getRegex(keyfilter) {
			return KeyFilter.DEFAULT_MASKS[keyfilter] ? KeyFilter.DEFAULT_MASKS[keyfilter] : keyfilter;
		},
		onBeforeInput: function onBeforeInput(e, keyfilter, validateOnly) {
			if (validateOnly || !DomHandler.isAndroid()) return;
			this.validateKey(e, e.data, keyfilter);
		},
		onKeyPress: function onKeyPress(e, keyfilter, validateOnly) {
			if (validateOnly || DomHandler.isAndroid()) return;
			if (e.ctrlKey || e.altKey || e.metaKey) return;
			this.validateKey(e, e.key, keyfilter);
		},
		onPaste: function onPaste(e, keyfilter, validateOnly) {
			if (validateOnly) return;
			var regex = this.getRegex(keyfilter);
			_toConsumableArray$2(e.clipboardData.getData("text")).forEach(function(c) {
				if (!regex.test(c)) {
					e.preventDefault();
					return false;
				}
			});
		},
		validateKey: function validateKey(e, key, keyfilter) {
			if (key === null || key === void 0) return;
			if (!(key.length <= 2)) return;
			if (!this.getRegex(keyfilter).test(key)) e.preventDefault();
		},
		validate: function validate(e, keyfilter) {
			var value = e.target.value;
			var validatePattern = true;
			var regex = this.getRegex(keyfilter);
			if (value && !regex.test(value)) validatePattern = false;
			return validatePattern;
		}
	};

//#endregion
//#region node_modules/primereact/portal/portal.esm.js
	function _arrayWithHoles$3(r) {
		if (Array.isArray(r)) return r;
	}
	__name(_arrayWithHoles$3, "_arrayWithHoles");
	function _iterableToArrayLimit$3(r, l) {
		var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
		if (null != t) {
			var e;
			var n;
			var i;
			var u;
			var a = [];
			var f = !0;
			var o = !1;
			try {
				if (i = (t = t.call(r)).next, 0 === l) {
					if (Object(t) !== t) return;
					f = !1;
				} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
			} catch (r) {
				o = !0, n = r;
			} finally {
				try {
					if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
				} finally {
					if (o) throw n;
				}
			}
			return a;
		}
	}
	__name(_iterableToArrayLimit$3, "_iterableToArrayLimit");
	function _arrayLikeToArray$3(r, a) {
		(null == a || a > r.length) && (a = r.length);
		for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
		return n;
	}
	__name(_arrayLikeToArray$3, "_arrayLikeToArray");
	function _unsupportedIterableToArray$3(r, a) {
		if (r) {
			if ("string" == typeof r) return _arrayLikeToArray$3(r, a);
			var t = {}.toString.call(r).slice(8, -1);
			return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$3(r, a) : void 0;
		}
	}
	__name(_unsupportedIterableToArray$3, "_unsupportedIterableToArray");
	function _nonIterableRest$3() {
		throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
	}
	__name(_nonIterableRest$3, "_nonIterableRest");
	function _slicedToArray$3(r, e) {
		return _arrayWithHoles$3(r) || _iterableToArrayLimit$3(r, e) || _unsupportedIterableToArray$3(r, e) || _nonIterableRest$3();
	}
	__name(_slicedToArray$3, "_slicedToArray");
	var PortalBase = {
		defaultProps: {
			__TYPE: "Portal",
			element: null,
			appendTo: null,
			visible: false,
			onMounted: null,
			onUnmounted: null,
			children: void 0
		},
		getProps: function getProps(props) {
			return ObjectUtils.getMergedProps(props, PortalBase.defaultProps);
		},
		getOtherProps: function getOtherProps(props) {
			return ObjectUtils.getDiffProps(props, PortalBase.defaultProps);
		}
	};
	var Portal = /*#__PURE__*/ react.memo(function(inProps) {
		var props = PortalBase.getProps(inProps);
		var context = react.useContext(PrimeReactContext);
		var _React$useState2 = _slicedToArray$3(react.useState(props.visible && DomHandler.isClient()), 2);
		var mountedState = _React$useState2[0];
		var setMountedState = _React$useState2[1];
		useMountEffect(function() {
			if (DomHandler.isClient() && !mountedState) {
				setMountedState(true);
				props.onMounted && props.onMounted();
			}
		});
		useUpdateEffect(function() {
			props.onMounted && props.onMounted();
		}, [mountedState]);
		useUnmountEffect(function() {
			props.onUnmounted && props.onUnmounted();
		});
		var element = props.element || props.children;
		if (element && mountedState) {
			var appendTo = props.appendTo || context && context.appendTo || PrimeReact.appendTo;
			if (ObjectUtils.isFunction(appendTo)) appendTo = appendTo();
			if (!appendTo) appendTo = document.body;
			return appendTo === "self" ? element : /*#__PURE__*/ react_dom.default.createPortal(element, appendTo);
		}
		return null;
	});
	Portal.displayName = "Portal";

//#endregion
//#region node_modules/primereact/tooltip/tooltip.esm.js
	function _extends$2() {
		return _extends$2 = Object.assign ? Object.assign.bind() : function(n) {
			for (var e = 1; e < arguments.length; e++) {
				var t = arguments[e];
				for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
			}
			return n;
		}, _extends$2.apply(null, arguments);
	}
	__name(_extends$2, "_extends");
	function _typeof$2(o) {
		"@babel/helpers - typeof";
		return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
			return typeof o;
		} : function(o) {
			return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
		}, _typeof$2(o);
	}
	__name(_typeof$2, "_typeof");
	function toPrimitive$2(t, r) {
		if ("object" != _typeof$2(t) || !t) return t;
		var e = t[Symbol.toPrimitive];
		if (void 0 !== e) {
			var i = e.call(t, r || "default");
			if ("object" != _typeof$2(i)) return i;
			throw new TypeError("@@toPrimitive must return a primitive value.");
		}
		return ("string" === r ? String : Number)(t);
	}
	__name(toPrimitive$2, "toPrimitive");
	function toPropertyKey$2(t) {
		var i = toPrimitive$2(t, "string");
		return "symbol" == _typeof$2(i) ? i : i + "";
	}
	__name(toPropertyKey$2, "toPropertyKey");
	function _defineProperty$2(e, r, t) {
		return (r = toPropertyKey$2(r)) in e ? Object.defineProperty(e, r, {
			value: t,
			enumerable: !0,
			configurable: !0,
			writable: !0
		}) : e[r] = t, e;
	}
	__name(_defineProperty$2, "_defineProperty");
	function _arrayLikeToArray$2(r, a) {
		(null == a || a > r.length) && (a = r.length);
		for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
		return n;
	}
	__name(_arrayLikeToArray$2, "_arrayLikeToArray");
	function _arrayWithoutHoles$1(r) {
		if (Array.isArray(r)) return _arrayLikeToArray$2(r);
	}
	__name(_arrayWithoutHoles$1, "_arrayWithoutHoles");
	function _iterableToArray$1(r) {
		if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
	}
	__name(_iterableToArray$1, "_iterableToArray");
	function _unsupportedIterableToArray$2(r, a) {
		if (r) {
			if ("string" == typeof r) return _arrayLikeToArray$2(r, a);
			var t = {}.toString.call(r).slice(8, -1);
			return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$2(r, a) : void 0;
		}
	}
	__name(_unsupportedIterableToArray$2, "_unsupportedIterableToArray");
	function _nonIterableSpread$1() {
		throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
	}
	__name(_nonIterableSpread$1, "_nonIterableSpread");
	function _toConsumableArray$1(r) {
		return _arrayWithoutHoles$1(r) || _iterableToArray$1(r) || _unsupportedIterableToArray$2(r) || _nonIterableSpread$1();
	}
	__name(_toConsumableArray$1, "_toConsumableArray");
	function _arrayWithHoles$2(r) {
		if (Array.isArray(r)) return r;
	}
	__name(_arrayWithHoles$2, "_arrayWithHoles");
	function _iterableToArrayLimit$2(r, l) {
		var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
		if (null != t) {
			var e;
			var n;
			var i;
			var u;
			var a = [];
			var f = !0;
			var o = !1;
			try {
				if (i = (t = t.call(r)).next, 0 === l) {
					if (Object(t) !== t) return;
					f = !1;
				} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
			} catch (r) {
				o = !0, n = r;
			} finally {
				try {
					if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
				} finally {
					if (o) throw n;
				}
			}
			return a;
		}
	}
	__name(_iterableToArrayLimit$2, "_iterableToArrayLimit");
	function _nonIterableRest$2() {
		throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
	}
	__name(_nonIterableRest$2, "_nonIterableRest");
	function _slicedToArray$2(r, e) {
		return _arrayWithHoles$2(r) || _iterableToArrayLimit$2(r, e) || _unsupportedIterableToArray$2(r, e) || _nonIterableRest$2();
	}
	__name(_slicedToArray$2, "_slicedToArray");
	var TooltipBase = ComponentBase.extend({
		defaultProps: {
			__TYPE: "Tooltip",
			appendTo: null,
			at: null,
			autoHide: true,
			autoZIndex: true,
			baseZIndex: 0,
			className: null,
			closeOnEscape: false,
			content: null,
			disabled: false,
			event: null,
			hideDelay: 0,
			hideEvent: "mouseleave",
			id: null,
			mouseTrack: false,
			mouseTrackLeft: 5,
			mouseTrackTop: 5,
			my: null,
			onBeforeHide: null,
			onBeforeShow: null,
			onHide: null,
			onShow: null,
			position: "right",
			showDelay: 0,
			showEvent: "mouseenter",
			showOnDisabled: false,
			style: null,
			target: null,
			updateDelay: 0,
			children: void 0
		},
		css: {
			classes: {
				root: function root(_ref) {
					var positionState = _ref.positionState;
					var classNameState = _ref.classNameState;
					return classNames("p-tooltip p-component", _defineProperty$2({}, "p-tooltip-".concat(positionState), true), classNameState);
				},
				arrow: "p-tooltip-arrow",
				text: "p-tooltip-text"
			},
			styles: "\n@layer primereact {\n    .p-tooltip {\n        position: absolute;\n        padding: .25em .5rem;\n        /* #3687: Tooltip prevent scrollbar flickering */\n        top: -9999px;\n        left: -9999px;\n    }\n    \n    .p-tooltip.p-tooltip-right,\n    .p-tooltip.p-tooltip-left {\n        padding: 0 .25rem;\n    }\n    \n    .p-tooltip.p-tooltip-top,\n    .p-tooltip.p-tooltip-bottom {\n        padding:.25em 0;\n    }\n    \n    .p-tooltip .p-tooltip-text {\n       white-space: pre-line;\n       word-break: break-word;\n    }\n    \n    .p-tooltip-arrow {\n        position: absolute;\n        width: 0;\n        height: 0;\n        border-color: transparent;\n        border-style: solid;\n    }\n    \n    .p-tooltip-right .p-tooltip-arrow {\n        top: 50%;\n        left: 0;\n        margin-top: -.25rem;\n        border-width: .25em .25em .25em 0;\n    }\n    \n    .p-tooltip-left .p-tooltip-arrow {\n        top: 50%;\n        right: 0;\n        margin-top: -.25rem;\n        border-width: .25em 0 .25em .25rem;\n    }\n    \n    .p-tooltip.p-tooltip-top {\n        padding: .25em 0;\n    }\n    \n    .p-tooltip-top .p-tooltip-arrow {\n        bottom: 0;\n        left: 50%;\n        margin-left: -.25rem;\n        border-width: .25em .25em 0;\n    }\n    \n    .p-tooltip-bottom .p-tooltip-arrow {\n        top: 0;\n        left: 50%;\n        margin-left: -.25rem;\n        border-width: 0 .25em .25rem;\n    }\n\n    .p-tooltip-target-wrapper {\n        display: inline-flex;\n    }\n}\n",
			inlineStyles: { arrow: function arrow(_ref2) {
				var context = _ref2.context;
				return {
					top: context.bottom ? "0" : context.right || context.left || !context.right && !context.left && !context.top && !context.bottom ? "50%" : null,
					bottom: context.top ? "0" : null,
					left: context.right || !context.right && !context.left && !context.top && !context.bottom ? "0" : context.top || context.bottom ? "50%" : null,
					right: context.left ? "0" : null
				};
			} }
		}
	});
	function ownKeys$3(e, r) {
		var t = Object.keys(e);
		if (Object.getOwnPropertySymbols) {
			var o = Object.getOwnPropertySymbols(e);
			r && (o = o.filter(function(r) {
				return Object.getOwnPropertyDescriptor(e, r).enumerable;
			})), t.push.apply(t, o);
		}
		return t;
	}
	__name(ownKeys$3, "ownKeys");
	function _objectSpread$3(e) {
		for (var r = 1; r < arguments.length; r++) {
			var t = null != arguments[r] ? arguments[r] : {};
			r % 2 ? ownKeys$3(Object(t), !0).forEach(function(r) {
				_defineProperty$2(e, r, t[r]);
			}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function(r) {
				Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
			});
		}
		return e;
	}
	__name(_objectSpread$3, "_objectSpread");
	var Tooltip$14 = /*#__PURE__*/ react.memo(/*#__PURE__*/ react.forwardRef(function(inProps, ref) {
		var mergeProps = useMergeProps();
		var context = react.useContext(PrimeReactContext);
		var props = TooltipBase.getProps(inProps, context);
		var _React$useState2 = _slicedToArray$2(react.useState(false), 2);
		var visibleState = _React$useState2[0];
		var setVisibleState = _React$useState2[1];
		var _React$useState4 = _slicedToArray$2(react.useState(props.position || "right"), 2);
		var positionState = _React$useState4[0];
		var setPositionState = _React$useState4[1];
		var _React$useState6 = _slicedToArray$2(react.useState(""), 2);
		var classNameState = _React$useState6[0];
		var setClassNameState = _React$useState6[1];
		var _React$useState8 = _slicedToArray$2(react.useState(false), 2);
		var multipleFocusEvents = _React$useState8[0];
		var setMultipleFocusEvents = _React$useState8[1];
		var isCloseOnEscape = visibleState && props.closeOnEscape;
		var overlayDisplayOrder = useDisplayOrder("tooltip", isCloseOnEscape);
		var metaData = {
			props,
			state: {
				visible: visibleState,
				position: positionState,
				className: classNameState
			},
			context: {
				right: positionState === "right",
				left: positionState === "left",
				top: positionState === "top",
				bottom: positionState === "bottom"
			}
		};
		var _TooltipBase$setMetaD = TooltipBase.setMetaData(metaData);
		var ptm = _TooltipBase$setMetaD.ptm;
		var cx = _TooltipBase$setMetaD.cx;
		var sx = _TooltipBase$setMetaD.sx;
		var isUnstyled = _TooltipBase$setMetaD.isUnstyled;
		useHandleStyle(TooltipBase.css.styles, isUnstyled, { name: "tooltip" });
		useGlobalOnEscapeKey({
			callback: function callback() {
				hide();
			},
			when: isCloseOnEscape,
			priority: [ESC_KEY_HANDLING_PRIORITIES.TOOLTIP, overlayDisplayOrder]
		});
		var elementRef = react.useRef(null);
		var textRef = react.useRef(null);
		var currentTargetRef = react.useRef(null);
		var containerSize = react.useRef(null);
		var allowHide = react.useRef(true);
		var timeouts = react.useRef({});
		var currentMouseEvent = react.useRef(null);
		var _useResizeListener2 = _slicedToArray$2(useResizeListener({ listener: function listener(event) {
			!DomHandler.isTouchDevice() && hide(event);
		} }), 2);
		var bindWindowResizeListener = _useResizeListener2[0];
		var unbindWindowResizeListener = _useResizeListener2[1];
		var _useOverlayScrollList2 = _slicedToArray$2(useOverlayScrollListener({
			target: currentTargetRef.current,
			listener: function listener(event) {
				hide(event);
			},
			when: visibleState
		}), 2);
		var bindOverlayScrollListener = _useOverlayScrollList2[0];
		var unbindOverlayScrollListener = _useOverlayScrollList2[1];
		var isTargetContentEmpty = function isTargetContentEmpty(target) {
			return !(props.content || getTargetOption(target, "tooltip"));
		};
		var isContentEmpty = function isContentEmpty(target) {
			return !(props.content || getTargetOption(target, "tooltip") || props.children);
		};
		var isMouseTrack = function isMouseTrack(target) {
			return getTargetOption(target, "mousetrack") || props.mouseTrack;
		};
		var isDisabled = function isDisabled(target) {
			return getTargetOption(target, "disabled") === "true" || hasTargetOption(target, "disabled") || props.disabled;
		};
		var isShowOnDisabled = function isShowOnDisabled(target) {
			return getTargetOption(target, "showondisabled") || props.showOnDisabled;
		};
		var isAutoHide = function isAutoHide() {
			return getTargetOption(currentTargetRef.current, "autohide") || props.autoHide;
		};
		var getTargetOption = function getTargetOption(target, option) {
			return hasTargetOption(target, "data-pr-".concat(option)) ? target.getAttribute("data-pr-".concat(option)) : null;
		};
		var hasTargetOption = function hasTargetOption(target, option) {
			return target && target.hasAttribute(option);
		};
		var getEvents = function getEvents(target) {
			var showEvents = [getTargetOption(target, "showevent") || props.showEvent];
			var hideEvents = [getTargetOption(target, "hideevent") || props.hideEvent];
			if (isMouseTrack(target)) {
				showEvents = ["mousemove"];
				hideEvents = ["mouseleave"];
			} else {
				var event = getTargetOption(target, "event") || props.event;
				if (event === "focus") {
					showEvents = ["focus"];
					hideEvents = ["blur"];
				}
				if (event === "both") {
					showEvents = ["focus", "mouseenter"];
					hideEvents = multipleFocusEvents ? ["blur"] : ["mouseleave", "blur"];
				}
			}
			return {
				showEvents,
				hideEvents
			};
		};
		var getPosition = function getPosition(target) {
			return getTargetOption(target, "position") || positionState;
		};
		var getMouseTrackPosition = function getMouseTrackPosition(target) {
			return {
				top: getTargetOption(target, "mousetracktop") || props.mouseTrackTop,
				left: getTargetOption(target, "mousetrackleft") || props.mouseTrackLeft
			};
		};
		var updateText = function updateText(target, callback) {
			if (textRef.current) {
				var content = getTargetOption(target, "tooltip") || props.content;
				if (content) {
					textRef.current.innerHTML = "";
					textRef.current.appendChild(document.createTextNode(content));
					callback();
				} else if (props.children) callback();
			}
		};
		var updateTooltipState = function updateTooltipState(position) {
			updateText(currentTargetRef.current, function() {
				var _currentMouseEvent$cu = currentMouseEvent.current;
				var x = _currentMouseEvent$cu.pageX;
				var y = _currentMouseEvent$cu.pageY;
				if (props.autoZIndex && !ZIndexUtils.get(elementRef.current)) ZIndexUtils.set("tooltip", elementRef.current, context && context.autoZIndex || PrimeReact.autoZIndex, props.baseZIndex || context && context.zIndex.tooltip || PrimeReact.zIndex.tooltip);
				elementRef.current.style.left = "";
				elementRef.current.style.top = "";
				if (isAutoHide()) elementRef.current.style.pointerEvents = "none";
				var mouseTrackCheck = isMouseTrack(currentTargetRef.current) || position === "mouse";
				if (mouseTrackCheck && !containerSize.current || mouseTrackCheck) containerSize.current = {
					width: DomHandler.getOuterWidth(elementRef.current),
					height: DomHandler.getOuterHeight(elementRef.current)
				};
				align(currentTargetRef.current, {
					x,
					y
				}, position);
			});
		};
		var show = function show(e) {
			if (e.type && e.type === "focus") setMultipleFocusEvents(true);
			currentTargetRef.current = e.currentTarget;
			var disabled = isDisabled(currentTargetRef.current);
			if (isContentEmpty(isShowOnDisabled(currentTargetRef.current) && disabled ? currentTargetRef.current.firstChild : currentTargetRef.current) || disabled) return;
			currentMouseEvent.current = e;
			if (visibleState) applyDelay("updateDelay", updateTooltipState);
			else if (sendCallback(props.onBeforeShow, {
				originalEvent: e,
				target: currentTargetRef.current
			})) applyDelay("showDelay", function() {
				setVisibleState(true);
				sendCallback(props.onShow, {
					originalEvent: e,
					target: currentTargetRef.current
				});
			});
		};
		var hide = function hide(e) {
			if (e && e.type === "blur") setMultipleFocusEvents(false);
			clearTimeouts();
			if (visibleState) {
				if (sendCallback(props.onBeforeHide, {
					originalEvent: e,
					target: currentTargetRef.current
				})) applyDelay("hideDelay", function() {
					if (!isAutoHide() && allowHide.current === false) return;
					ZIndexUtils.clear(elementRef.current);
					DomHandler.removeClass(elementRef.current, "p-tooltip-active");
					setVisibleState(false);
					sendCallback(props.onHide, {
						originalEvent: e,
						target: currentTargetRef.current
					});
				});
			} else if (!props.onBeforeHide && !getDelay("hideDelay")) setVisibleState(false);
		};
		var align = function align(target, coordinate, position) {
			var left = 0;
			var top = 0;
			var currentPosition = position || positionState;
			if ((isMouseTrack(target) || currentPosition == "mouse") && coordinate) {
				var _containerSize = {
					width: DomHandler.getOuterWidth(elementRef.current),
					height: DomHandler.getOuterHeight(elementRef.current)
				};
				left = coordinate.x;
				top = coordinate.y;
				var _getMouseTrackPositio = getMouseTrackPosition(target);
				var mouseTrackTop = _getMouseTrackPositio.top;
				var mouseTrackLeft = _getMouseTrackPositio.left;
				switch (currentPosition) {
					case "left":
						left = left - (_containerSize.width + mouseTrackLeft);
						top = top - (_containerSize.height / 2 - mouseTrackTop);
						break;
					case "right":
					case "mouse":
						left = left + mouseTrackLeft;
						top = top - (_containerSize.height / 2 - mouseTrackTop);
						break;
					case "top":
						left = left - (_containerSize.width / 2 - mouseTrackLeft);
						top = top - (_containerSize.height + mouseTrackTop);
						break;
					case "bottom":
						left = left - (_containerSize.width / 2 - mouseTrackLeft);
						top = top + mouseTrackTop;
						break;
				}
				if (left <= 0 || containerSize.current.width > _containerSize.width) {
					elementRef.current.style.left = "0px";
					elementRef.current.style.right = window.innerWidth - _containerSize.width - left + "px";
				} else {
					elementRef.current.style.right = "";
					elementRef.current.style.left = left + "px";
				}
				elementRef.current.style.top = top + "px";
				DomHandler.addClass(elementRef.current, "p-tooltip-active");
			} else {
				var pos = DomHandler.findCollisionPosition(currentPosition);
				var my = getTargetOption(target, "my") || props.my || pos.my;
				var at = getTargetOption(target, "at") || props.at || pos.at;
				elementRef.current.style.padding = "0px";
				DomHandler.flipfitCollision(elementRef.current, target, my, at, function(calculatedPosition) {
					var _calculatedPosition$a = calculatedPosition.at;
					var atX = _calculatedPosition$a.x;
					var atY = _calculatedPosition$a.y;
					var myX = calculatedPosition.my.x;
					var newPosition = props.at ? atX !== "center" && atX !== myX ? atX : atY : calculatedPosition.at["".concat(pos.axis)];
					elementRef.current.style.padding = "";
					setPositionState(newPosition);
					updateContainerPosition(newPosition);
					DomHandler.addClass(elementRef.current, "p-tooltip-active");
				});
			}
		};
		var updateContainerPosition = function updateContainerPosition(position) {
			if (elementRef.current) {
				var style = getComputedStyle(elementRef.current);
				if (position === "left") elementRef.current.style.left = parseFloat(style.left) - parseFloat(style.paddingLeft) * 2 + "px";
				else if (position === "top") elementRef.current.style.top = parseFloat(style.top) - parseFloat(style.paddingTop) * 2 + "px";
			}
		};
		var _onMouseEnter = function onMouseEnter() {
			if (!isAutoHide()) allowHide.current = false;
		};
		var _onMouseLeave = function onMouseLeave(e) {
			if (!isAutoHide()) {
				allowHide.current = true;
				hide(e);
			}
		};
		var bindTargetEvent = function bindTargetEvent(target) {
			if (target) {
				var _getEvents = getEvents(target);
				var showEvents = _getEvents.showEvents;
				var hideEvents = _getEvents.hideEvents;
				var currentTarget = getTarget(target);
				showEvents.forEach(function(event) {
					return currentTarget === null || currentTarget === void 0 ? void 0 : currentTarget.addEventListener(event, show);
				});
				hideEvents.forEach(function(event) {
					return currentTarget === null || currentTarget === void 0 ? void 0 : currentTarget.addEventListener(event, hide);
				});
			}
		};
		var unbindTargetEvent = function unbindTargetEvent(target) {
			if (target) {
				var _getEvents2 = getEvents(target);
				var showEvents = _getEvents2.showEvents;
				var hideEvents = _getEvents2.hideEvents;
				var currentTarget = getTarget(target);
				showEvents.forEach(function(event) {
					return currentTarget === null || currentTarget === void 0 ? void 0 : currentTarget.removeEventListener(event, show);
				});
				hideEvents.forEach(function(event) {
					return currentTarget === null || currentTarget === void 0 ? void 0 : currentTarget.removeEventListener(event, hide);
				});
			}
		};
		var getDelay = function getDelay(delayProp) {
			return getTargetOption(currentTargetRef.current, delayProp.toLowerCase()) || props[delayProp];
		};
		var applyDelay = function applyDelay(delayProp, callback) {
			clearTimeouts();
			var delay = getDelay(delayProp);
			delay ? timeouts.current["".concat(delayProp)] = setTimeout(function() {
				return callback();
			}, delay) : callback();
		};
		var sendCallback = function sendCallback(callback) {
			if (callback) {
				for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) params[_key - 1] = arguments[_key];
				var result = callback.apply(void 0, params);
				if (result === void 0) result = true;
				return result;
			}
			return true;
		};
		var clearTimeouts = function clearTimeouts() {
			Object.values(timeouts.current).forEach(function(t) {
				return clearTimeout(t);
			});
		};
		var getTarget = function getTarget(target) {
			if (target) {
				if (isShowOnDisabled(target)) {
					if (!target.hasWrapper) {
						var wrapper = document.createElement("div");
						if (target.nodeName === "INPUT") DomHandler.addMultipleClasses(wrapper, "p-tooltip-target-wrapper p-inputwrapper");
						else DomHandler.addClass(wrapper, "p-tooltip-target-wrapper");
						target.parentNode.insertBefore(wrapper, target);
						wrapper.appendChild(target);
						target.hasWrapper = true;
						return wrapper;
					}
					return target.parentElement;
				} else if (target.hasWrapper) {
					var _target$parentElement;
					(_target$parentElement = target.parentElement).replaceWith.apply(_target$parentElement, _toConsumableArray$1(target.parentElement.childNodes));
					delete target.hasWrapper;
				}
				return target;
			}
			return null;
		};
		var updateTargetEvents = function updateTargetEvents(target) {
			unloadTargetEvents(target);
			loadTargetEvents(target);
		};
		var loadTargetEvents = function loadTargetEvents(target) {
			setTargetEventOperations(target || props.target, bindTargetEvent);
		};
		var unloadTargetEvents = function unloadTargetEvents(target) {
			setTargetEventOperations(target || props.target, unbindTargetEvent);
		};
		var setTargetEventOperations = function setTargetEventOperations(target, operation) {
			target = ObjectUtils.getRefElement(target);
			if (target) if (DomHandler.isElement(target)) operation(target);
			else {
				var setEvent = function setEvent(target) {
					DomHandler.find(document, target).forEach(function(el) {
						operation(el);
					});
				};
				if (target instanceof Array) target.forEach(function(t) {
					setEvent(t);
				});
				else setEvent(target);
			}
		};
		useMountEffect(function() {
			if (visibleState && currentTargetRef.current && isDisabled(currentTargetRef.current)) hide();
		});
		useUpdateEffect(function() {
			loadTargetEvents();
			return function() {
				unloadTargetEvents();
			};
		}, [
			show,
			hide,
			props.target
		]);
		useUpdateEffect(function() {
			if (visibleState) {
				var position = getPosition(currentTargetRef.current);
				var classname = getTargetOption(currentTargetRef.current, "classname");
				setPositionState(position);
				setClassNameState(classname);
				updateTooltipState(position);
				bindWindowResizeListener();
				bindOverlayScrollListener();
			} else {
				setPositionState(props.position || "right");
				setClassNameState("");
				currentTargetRef.current = null;
				containerSize.current = null;
				allowHide.current = true;
			}
			return function() {
				unbindWindowResizeListener();
				unbindOverlayScrollListener();
			};
		}, [visibleState]);
		useUpdateEffect(function() {
			var position = getPosition(currentTargetRef.current);
			if (visibleState && position !== "mouse") applyDelay("updateDelay", function() {
				updateText(currentTargetRef.current, function() {
					align(currentTargetRef.current);
				});
			});
		}, [props.content]);
		useUnmountEffect(function() {
			hide();
			ZIndexUtils.clear(elementRef.current);
		});
		react.useImperativeHandle(ref, function() {
			return {
				props,
				updateTargetEvents,
				loadTargetEvents,
				unloadTargetEvents,
				show,
				hide,
				getElement: function getElement() {
					return elementRef.current;
				},
				getTarget: function getTarget() {
					return currentTargetRef.current;
				}
			};
		});
		var createElement = function createElement() {
			var empty = isTargetContentEmpty(currentTargetRef.current);
			var rootProps = mergeProps({
				id: props.id,
				className: classNames(props.className, cx("root", {
					positionState,
					classNameState
				})),
				style: props.style,
				role: "tooltip",
				"aria-hidden": visibleState,
				onMouseEnter: function onMouseEnter(e) {
					return _onMouseEnter();
				},
				onMouseLeave: function onMouseLeave(e) {
					return _onMouseLeave(e);
				}
			}, TooltipBase.getOtherProps(props), ptm("root"));
			var arrowProps = mergeProps({
				className: cx("arrow"),
				style: sx("arrow", _objectSpread$3({}, metaData))
			}, ptm("arrow"));
			var textProps = mergeProps({ className: cx("text") }, ptm("text"));
			return /*#__PURE__*/ react.createElement("div", _extends$2({ ref: elementRef }, rootProps), /*#__PURE__*/ react.createElement("div", arrowProps), /*#__PURE__*/ react.createElement("div", _extends$2({ ref: textRef }, textProps), empty && props.children));
		};
		if (visibleState) {
			var element = createElement();
			return /*#__PURE__*/ react.createElement(Portal, {
				element,
				appendTo: props.appendTo,
				visible: true
			});
		}
		return null;
	}));
	Tooltip$14.displayName = "Tooltip";

//#endregion
//#region node_modules/primereact/overlayservice/overlayservice.esm.js
	var OverlayService = EventBus$1();

//#endregion
//#region node_modules/primereact/ripple/ripple.esm.js
	function _extends$1() {
		return _extends$1 = Object.assign ? Object.assign.bind() : function(n) {
			for (var e = 1; e < arguments.length; e++) {
				var t = arguments[e];
				for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
			}
			return n;
		}, _extends$1.apply(null, arguments);
	}
	__name(_extends$1, "_extends");
	function _typeof$1(o) {
		"@babel/helpers - typeof";
		return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
			return typeof o;
		} : function(o) {
			return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
		}, _typeof$1(o);
	}
	__name(_typeof$1, "_typeof");
	function toPrimitive$1(t, r) {
		if ("object" != _typeof$1(t) || !t) return t;
		var e = t[Symbol.toPrimitive];
		if (void 0 !== e) {
			var i = e.call(t, r || "default");
			if ("object" != _typeof$1(i)) return i;
			throw new TypeError("@@toPrimitive must return a primitive value.");
		}
		return ("string" === r ? String : Number)(t);
	}
	__name(toPrimitive$1, "toPrimitive");
	function toPropertyKey$1(t) {
		var i = toPrimitive$1(t, "string");
		return "symbol" == _typeof$1(i) ? i : i + "";
	}
	__name(toPropertyKey$1, "toPropertyKey");
	function _defineProperty$1(e, r, t) {
		return (r = toPropertyKey$1(r)) in e ? Object.defineProperty(e, r, {
			value: t,
			enumerable: !0,
			configurable: !0,
			writable: !0
		}) : e[r] = t, e;
	}
	__name(_defineProperty$1, "_defineProperty");
	function _arrayWithHoles$1(r) {
		if (Array.isArray(r)) return r;
	}
	__name(_arrayWithHoles$1, "_arrayWithHoles");
	function _iterableToArrayLimit$1(r, l) {
		var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
		if (null != t) {
			var e;
			var n;
			var i;
			var u;
			var a = [];
			var f = !0;
			var o = !1;
			try {
				if (i = (t = t.call(r)).next, 0 === l) {
					if (Object(t) !== t) return;
					f = !1;
				} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
			} catch (r) {
				o = !0, n = r;
			} finally {
				try {
					if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
				} finally {
					if (o) throw n;
				}
			}
			return a;
		}
	}
	__name(_iterableToArrayLimit$1, "_iterableToArrayLimit");
	function _arrayLikeToArray$1(r, a) {
		(null == a || a > r.length) && (a = r.length);
		for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
		return n;
	}
	__name(_arrayLikeToArray$1, "_arrayLikeToArray");
	function _unsupportedIterableToArray$1(r, a) {
		if (r) {
			if ("string" == typeof r) return _arrayLikeToArray$1(r, a);
			var t = {}.toString.call(r).slice(8, -1);
			return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1(r, a) : void 0;
		}
	}
	__name(_unsupportedIterableToArray$1, "_unsupportedIterableToArray");
	function _nonIterableRest$1() {
		throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
	}
	__name(_nonIterableRest$1, "_nonIterableRest");
	function _slicedToArray$1(r, e) {
		return _arrayWithHoles$1(r) || _iterableToArrayLimit$1(r, e) || _unsupportedIterableToArray$1(r, e) || _nonIterableRest$1();
	}
	__name(_slicedToArray$1, "_slicedToArray");
	var RippleBase = ComponentBase.extend({
		defaultProps: {
			__TYPE: "Ripple",
			children: void 0
		},
		css: {
			styles: "\n@layer primereact {\n    .p-ripple {\n        overflow: hidden;\n        position: relative;\n    }\n    \n    .p-ink {\n        display: block;\n        position: absolute;\n        background: rgba(255, 255, 255, 0.5);\n        border-radius: 100%;\n        transform: scale(0);\n    }\n    \n    .p-ink-active {\n        animation: ripple 0.4s linear;\n    }\n    \n    .p-ripple-disabled .p-ink {\n        display: none;\n    }\n}\n\n@keyframes ripple {\n    100% {\n        opacity: 0;\n        transform: scale(2.5);\n    }\n}\n\n",
			classes: { root: "p-ink" }
		},
		getProps: function getProps(props) {
			return ObjectUtils.getMergedProps(props, RippleBase.defaultProps);
		},
		getOtherProps: function getOtherProps(props) {
			return ObjectUtils.getDiffProps(props, RippleBase.defaultProps);
		}
	});
	function ownKeys$2(e, r) {
		var t = Object.keys(e);
		if (Object.getOwnPropertySymbols) {
			var o = Object.getOwnPropertySymbols(e);
			r && (o = o.filter(function(r) {
				return Object.getOwnPropertyDescriptor(e, r).enumerable;
			})), t.push.apply(t, o);
		}
		return t;
	}
	__name(ownKeys$2, "ownKeys");
	function _objectSpread$2(e) {
		for (var r = 1; r < arguments.length; r++) {
			var t = null != arguments[r] ? arguments[r] : {};
			r % 2 ? ownKeys$2(Object(t), !0).forEach(function(r) {
				_defineProperty$1(e, r, t[r]);
			}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function(r) {
				Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
			});
		}
		return e;
	}
	__name(_objectSpread$2, "_objectSpread");
	var Ripple = /*#__PURE__*/ react.memo(/*#__PURE__*/ react.forwardRef(function(inProps, ref) {
		var _React$useState2 = _slicedToArray$1(react.useState(false), 2);
		var isMounted = _React$useState2[0];
		var setMounted = _React$useState2[1];
		var inkRef = react.useRef(null);
		var targetRef = react.useRef(null);
		var mergeProps = useMergeProps();
		var context = react.useContext(PrimeReactContext);
		var props = RippleBase.getProps(inProps, context);
		var isRippleActive = context && context.ripple || PrimeReact.ripple;
		var metaData = { props };
		useStyle(RippleBase.css.styles, {
			name: "ripple",
			manual: !isRippleActive
		});
		var _RippleBase$setMetaDa = RippleBase.setMetaData(_objectSpread$2({}, metaData));
		var ptm = _RippleBase$setMetaDa.ptm;
		var cx = _RippleBase$setMetaDa.cx;
		var getTarget = function getTarget() {
			return inkRef.current && inkRef.current.parentElement;
		};
		var bindEvents = function bindEvents() {
			if (targetRef.current) targetRef.current.addEventListener("pointerdown", onPointerDown);
		};
		var unbindEvents = function unbindEvents() {
			if (targetRef.current) targetRef.current.removeEventListener("pointerdown", onPointerDown);
		};
		var onPointerDown = function onPointerDown(event) {
			var offset = DomHandler.getOffset(targetRef.current);
			activateRipple(event.pageX - offset.left + document.body.scrollTop - DomHandler.getWidth(inkRef.current) / 2, event.pageY - offset.top + document.body.scrollLeft - DomHandler.getHeight(inkRef.current) / 2);
		};
		var activateRipple = function activateRipple(offsetX, offsetY) {
			if (!inkRef.current || getComputedStyle(inkRef.current, null).display === "none") return;
			DomHandler.removeClass(inkRef.current, "p-ink-active");
			setDimensions();
			inkRef.current.style.top = offsetY + "px";
			inkRef.current.style.left = offsetX + "px";
			DomHandler.addClass(inkRef.current, "p-ink-active");
		};
		var onAnimationEnd = function onAnimationEnd(event) {
			DomHandler.removeClass(event.currentTarget, "p-ink-active");
		};
		var setDimensions = function setDimensions() {
			if (inkRef.current && !DomHandler.getHeight(inkRef.current) && !DomHandler.getWidth(inkRef.current)) {
				var d = Math.max(DomHandler.getOuterWidth(targetRef.current), DomHandler.getOuterHeight(targetRef.current));
				inkRef.current.style.height = d + "px";
				inkRef.current.style.width = d + "px";
			}
		};
		react.useImperativeHandle(ref, function() {
			return {
				props,
				getInk: function getInk() {
					return inkRef.current;
				},
				getTarget: function getTarget() {
					return targetRef.current;
				}
			};
		});
		useMountEffect(function() {
			setMounted(true);
		});
		useUpdateEffect(function() {
			if (isMounted && inkRef.current) {
				targetRef.current = getTarget();
				setDimensions();
				bindEvents();
			}
		}, [isMounted]);
		useUpdateEffect(function() {
			if (inkRef.current && !targetRef.current) {
				targetRef.current = getTarget();
				setDimensions();
				bindEvents();
			}
		});
		useUnmountEffect(function() {
			if (inkRef.current) {
				targetRef.current = null;
				unbindEvents();
			}
		});
		if (!isRippleActive) return null;
		var rootProps = mergeProps({
			"aria-hidden": true,
			className: classNames(cx("root"))
		}, RippleBase.getOtherProps(props), ptm("root"));
		return /*#__PURE__*/ react.createElement("span", _extends$1({
			role: "presentation",
			ref: inkRef
		}, rootProps, { onAnimationEnd }));
	}));
	Ripple.displayName = "Ripple";

//#endregion
//#region node_modules/primereact/mention/mention.esm.js
	function _extends() {
		return _extends = Object.assign ? Object.assign.bind() : function(n) {
			for (var e = 1; e < arguments.length; e++) {
				var t = arguments[e];
				for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
			}
			return n;
		}, _extends.apply(null, arguments);
	}
	function _arrayLikeToArray(r, a) {
		(null == a || a > r.length) && (a = r.length);
		for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
		return n;
	}
	function _arrayWithoutHoles(r) {
		if (Array.isArray(r)) return _arrayLikeToArray(r);
	}
	function _iterableToArray(r) {
		if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
	}
	function _unsupportedIterableToArray(r, a) {
		if (r) {
			if ("string" == typeof r) return _arrayLikeToArray(r, a);
			var t = {}.toString.call(r).slice(8, -1);
			return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
		}
	}
	function _nonIterableSpread() {
		throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
	}
	function _toConsumableArray(r) {
		return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
	}
	function _typeof(o) {
		"@babel/helpers - typeof";
		return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
			return typeof o;
		} : function(o) {
			return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
		}, _typeof(o);
	}
	function toPrimitive(t, r) {
		if ("object" != _typeof(t) || !t) return t;
		var e = t[Symbol.toPrimitive];
		if (void 0 !== e) {
			var i = e.call(t, r || "default");
			if ("object" != _typeof(i)) return i;
			throw new TypeError("@@toPrimitive must return a primitive value.");
		}
		return ("string" === r ? String : Number)(t);
	}
	function toPropertyKey(t) {
		var i = toPrimitive(t, "string");
		return "symbol" == _typeof(i) ? i : i + "";
	}
	function _defineProperty(e, r, t) {
		return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
			value: t,
			enumerable: !0,
			configurable: !0,
			writable: !0
		}) : e[r] = t, e;
	}
	function _arrayWithHoles(r) {
		if (Array.isArray(r)) return r;
	}
	function _iterableToArrayLimit(r, l) {
		var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
		if (null != t) {
			var e;
			var n;
			var i;
			var u;
			var a = [];
			var f = !0;
			var o = !1;
			try {
				if (i = (t = t.call(r)).next, 0 === l) {
					if (Object(t) !== t) return;
					f = !1;
				} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
			} catch (r) {
				o = !0, n = r;
			} finally {
				try {
					if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
				} finally {
					if (o) throw n;
				}
			}
			return a;
		}
	}
	function _nonIterableRest() {
		throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
	}
	function _slicedToArray(r, e) {
		return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
	}
	var InputTextareaBase = ComponentBase.extend({
		defaultProps: {
			__TYPE: "InputTextarea",
			__parentMetadata: null,
			autoResize: false,
			invalid: false,
			variant: null,
			keyfilter: null,
			onBlur: null,
			onFocus: null,
			onBeforeInput: null,
			onInput: null,
			onKeyDown: null,
			onKeyUp: null,
			onPaste: null,
			tooltip: null,
			tooltipOptions: null,
			validateOnly: false,
			children: void 0,
			className: null
		},
		css: {
			classes: { root: function root(_ref) {
				var props = _ref.props;
				var context = _ref.context;
				var isFilled = _ref.isFilled;
				return classNames("p-inputtextarea p-inputtext p-component", {
					"p-disabled": props.disabled,
					"p-filled": isFilled,
					"p-inputtextarea-resizable": props.autoResize,
					"p-invalid": props.invalid,
					"p-variant-filled": props.variant ? props.variant === "filled" : context && context.inputStyle === "filled"
				});
			} },
			styles: "\n@layer primereact {\n    .p-inputtextarea-resizable {\n        overflow: hidden;\n        resize: none;\n    }\n    \n    .p-fluid .p-inputtextarea {\n        width: 100%;\n    }\n}\n"
		}
	});
	function ownKeys$1(e, r) {
		var t = Object.keys(e);
		if (Object.getOwnPropertySymbols) {
			var o = Object.getOwnPropertySymbols(e);
			r && (o = o.filter(function(r) {
				return Object.getOwnPropertyDescriptor(e, r).enumerable;
			})), t.push.apply(t, o);
		}
		return t;
	}
	function _objectSpread$1(e) {
		for (var r = 1; r < arguments.length; r++) {
			var t = null != arguments[r] ? arguments[r] : {};
			r % 2 ? ownKeys$1(Object(t), !0).forEach(function(r) {
				_defineProperty(e, r, t[r]);
			}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function(r) {
				Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
			});
		}
		return e;
	}
	var InputTextarea = /*#__PURE__*/ react.memo(/*#__PURE__*/ react.forwardRef(function(inProps, ref) {
		var mergeProps = useMergeProps();
		var context = react.useContext(PrimeReactContext);
		var props = InputTextareaBase.getProps(inProps, context);
		var elementRef = react.useRef(ref);
		var cachedScrollHeight = react.useRef(0);
		var _InputTextareaBase$se = InputTextareaBase.setMetaData(_objectSpread$1(_objectSpread$1({ props }, props.__parentMetadata), {}, { context: { disabled: props.disabled } }));
		var ptm = _InputTextareaBase$se.ptm;
		var cx = _InputTextareaBase$se.cx;
		var isUnstyled = _InputTextareaBase$se.isUnstyled;
		useHandleStyle(InputTextareaBase.css.styles, isUnstyled, { name: "inputtextarea" });
		var onFocus = function onFocus(event) {
			if (props.autoResize) resize();
			props.onFocus && props.onFocus(event);
		};
		var onBlur = function onBlur(event) {
			if (props.autoResize) resize();
			props.onBlur && props.onBlur(event);
		};
		var onKeyUp = function onKeyUp(event) {
			if (props.autoResize) resize();
			props.onKeyUp && props.onKeyUp(event);
		};
		var onKeyDown = function onKeyDown(event) {
			props.onKeyDown && props.onKeyDown(event);
			if (props.keyfilter) KeyFilter.onKeyPress(event, props.keyfilter, props.validateOnly);
		};
		var onBeforeInput = function onBeforeInput(event) {
			props.onBeforeInput && props.onBeforeInput(event);
			if (props.keyfilter) KeyFilter.onBeforeInput(event, props.keyfilter, props.validateOnly);
		};
		var onPaste = function onPaste(event) {
			props.onPaste && props.onPaste(event);
			if (props.keyfilter) KeyFilter.onPaste(event, props.keyfilter, props.validateOnly);
		};
		var onInput = function onInput(event) {
			var target = event.target;
			if (props.autoResize) resize(ObjectUtils.isEmpty(target.value));
			props.onInput && props.onInput(event);
			ObjectUtils.isNotEmpty(target.value) ? DomHandler.addClass(target, "p-filled") : DomHandler.removeClass(target, "p-filled");
		};
		var resize = function resize(initial) {
			var inputEl = elementRef.current;
			if (inputEl && isVisible()) {
				if (!cachedScrollHeight.current) {
					cachedScrollHeight.current = inputEl.scrollHeight;
					inputEl.style.overflow = "hidden";
				}
				if (cachedScrollHeight.current !== inputEl.scrollHeight || initial) {
					inputEl.style.height = "";
					inputEl.style.height = inputEl.scrollHeight + "px";
					if (parseFloat(inputEl.style.height) >= parseFloat(inputEl.style.maxHeight)) {
						inputEl.style.overflowY = "scroll";
						inputEl.style.height = inputEl.style.maxHeight;
					} else inputEl.style.overflow = "hidden";
					cachedScrollHeight.current = inputEl.scrollHeight;
				}
			}
		};
		var isVisible = function isVisible() {
			if (DomHandler.isVisible(elementRef.current)) {
				var rect = elementRef.current.getBoundingClientRect();
				return rect.width > 0 && rect.height > 0;
			}
			return false;
		};
		react.useEffect(function() {
			ObjectUtils.combinedRefs(elementRef, ref);
		}, [elementRef, ref]);
		react.useEffect(function() {
			if (props.autoResize) resize(true);
		}, [props.autoResize, props.value]);
		var isFilled = react.useMemo(function() {
			return ObjectUtils.isNotEmpty(props.value) || ObjectUtils.isNotEmpty(props.defaultValue);
		}, [props.value, props.defaultValue]);
		var hasTooltip = ObjectUtils.isNotEmpty(props.tooltip);
		var rootProps = mergeProps({
			ref: elementRef,
			className: classNames(props.className, cx("root", {
				context,
				isFilled
			})),
			onFocus,
			onBlur,
			onKeyUp,
			onKeyDown,
			onBeforeInput,
			onInput,
			onPaste
		}, InputTextareaBase.getOtherProps(props), ptm("root"));
		return /*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement("textarea", rootProps), hasTooltip && /*#__PURE__*/ react.createElement(Tooltip$14, _extends({
			target: elementRef,
			content: props.tooltip,
			pt: ptm("tooltip")
		}, props.tooltipOptions)));
	}));
	InputTextarea.displayName = "InputTextarea";
	var MentionBase = ComponentBase.extend({
		defaultProps: {
			__TYPE: "Mention",
			autoHighlight: true,
			autoResize: false,
			className: null,
			delay: 0,
			field: null,
			footerTemplate: null,
			headerTemplate: null,
			id: null,
			inputClassName: null,
			inputId: null,
			inputRef: null,
			inputStyle: null,
			itemTemplate: null,
			onBlur: null,
			onChange: null,
			onFocus: null,
			onHide: null,
			onInput: null,
			onSearch: null,
			onSelect: null,
			onShow: null,
			panelClassName: null,
			panelStyle: null,
			scrollHeight: "200px",
			style: null,
			suggestions: null,
			transitionOptions: null,
			trigger: "@",
			variant: null,
			children: void 0
		},
		css: {
			classes: {
				item: function item(_ref) {
					var isSelected = _ref.isSelected;
					return classNames("p-mention-item", { "p-highlight": isSelected });
				},
				items: "p-mention-items",
				panel: function panel(_ref2) {
					var props = _ref2.props;
					return classNames("p-mention-panel p-component", props.panelClassName);
				},
				input: function input(_ref3) {
					var props = _ref3.props;
					return classNames("p-mention-input", props.inputClassName);
				},
				root: function root(_ref4) {
					_ref4.props;
					var isFilled = _ref4.isFilled;
					var focusedState = _ref4.focusedState;
					return classNames("p-mention p-component p-inputwrapper", {
						"p-inputwrapper-filled": isFilled,
						"p-inputwrapper-focus": focusedState
					});
				},
				transition: "p-connected-overlay"
			},
			styles: "\n@layer primereact {\n    .p-mention {\n        display: inline-flex;\n        position: relative;\n    }\n    \n    .p-autocomplete-loader {\n        position: absolute;\n        top: 50%;\n        margin-top: -.5rem;\n    }\n    \n    .p-mention .p-mention-panel {\n        min-width: 100%;\n    }\n    \n    .p-mention-panel {\n        position: absolute;\n        top: 0;\n        left: 0;\n        overflow: auto;\n    }\n    \n    .p-mention-items {\n        margin: 0;\n        padding: 0;\n        list-style-type: none;\n    }\n    \n    .p-mention-item {\n        cursor: pointer;\n        white-space: nowrap;\n        position: relative;\n        overflow: hidden;\n    }\n    \n    .p-fluid .p-mention {\n        display: flex;\n    }\n}\n"
		}
	});
	function ownKeys(e, r) {
		var t = Object.keys(e);
		if (Object.getOwnPropertySymbols) {
			var o = Object.getOwnPropertySymbols(e);
			r && (o = o.filter(function(r) {
				return Object.getOwnPropertyDescriptor(e, r).enumerable;
			})), t.push.apply(t, o);
		}
		return t;
	}
	function _objectSpread(e) {
		for (var r = 1; r < arguments.length; r++) {
			var t = null != arguments[r] ? arguments[r] : {};
			r % 2 ? ownKeys(Object(t), !0).forEach(function(r) {
				_defineProperty(e, r, t[r]);
			}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) {
				Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
			});
		}
		return e;
	}
	var Mention = /*#__PURE__*/ react.memo(/*#__PURE__*/ react.forwardRef(function(inProps, ref) {
		var mergeProps = useMergeProps();
		var context = react.useContext(PrimeReactContext);
		var props = MentionBase.getProps(inProps, context);
		var _React$useState2 = _slicedToArray(react.useState(false), 2);
		var overlayVisibleState = _React$useState2[0];
		var setOverlayVisibleState = _React$useState2[1];
		var _React$useState4 = _slicedToArray(react.useState(false), 2);
		var focusedState = _React$useState4[0];
		var setFocusedState = _React$useState4[1];
		var _React$useState6 = _slicedToArray(react.useState(false), 2);
		var searchingState = _React$useState6[0];
		var setSearchingState = _React$useState6[1];
		var _React$useState8 = _slicedToArray(react.useState(null), 2);
		var triggerState = _React$useState8[0];
		var setTriggerState = _React$useState8[1];
		var _React$useState10 = _slicedToArray(react.useState([]), 2);
		var highlightState = _React$useState10[0];
		var setHighlightState = _React$useState10[1];
		var elementRef = react.useRef(null);
		var overlayRef = react.useRef(null);
		var inputRef = react.useRef(props.inputRef);
		var listRef = react.useRef(null);
		var timeout = react.useRef(null);
		var metaData = {
			props,
			state: {
				overlayVisible: overlayVisibleState,
				focused: focusedState,
				searching: searchingState,
				trigger: triggerState
			}
		};
		var _MentionBase$setMetaD = MentionBase.setMetaData(metaData);
		var ptm = _MentionBase$setMetaD.ptm;
		var cx = _MentionBase$setMetaD.cx;
		_MentionBase$setMetaD.sx;
		var isUnstyled = _MentionBase$setMetaD.isUnstyled;
		useHandleStyle(MentionBase.css.styles, isUnstyled, { name: "mention" });
		var getPTOptions = function getPTOptions(item, suggestion, options) {
			return ptm(suggestion, {
				context: { trigger: triggerState ? triggerState.key : "" },
				state: _objectSpread({}, options)
			});
		};
		var _useOverlayListener2 = _slicedToArray(useOverlayListener({
			target: elementRef,
			overlay: overlayRef,
			listener: function listener(event, _ref) {
				var valid = _ref.valid;
				var type = _ref.type;
				if (valid) {
					if (context.hideOverlaysOnDocumentScrolling || type === "outside") hide();
					else if (!DomHandler.isDocument(event.target)) alignOverlay();
				}
			},
			when: overlayVisibleState
		}), 2);
		var bindOverlayListener = _useOverlayListener2[0];
		var unbindOverlayListener = _useOverlayListener2[1];
		var show = function show() {
			setOverlayVisibleState(true);
		};
		var hide = function hide() {
			setOverlayVisibleState(false);
			setSearchingState(false);
			setTriggerState(null);
		};
		var onOverlayEnter = function onOverlayEnter() {
			ZIndexUtils.set("overlay", overlayRef.current, context && context.autoZIndex || PrimeReact.autoZIndex, context && context.zIndex.overlay || PrimeReact.zIndex.overlay);
			DomHandler.addStyles(overlayRef.current, {
				position: "absolute",
				top: "0",
				left: "0"
			});
			alignOverlay();
		};
		var onOverlayEntering = function onOverlayEntering() {
			if (props.autoHighlight && props.suggestions && props.suggestions.length) setHighlightState(function(prevState) {
				var newState = _toConsumableArray(prevState);
				newState[0] = true;
				return newState;
			});
		};
		var onOverlayEntered = function onOverlayEntered() {
			bindOverlayListener();
			props.onShow && props.onShow();
		};
		var onOverlayExit = function onOverlayExit() {
			unbindOverlayListener();
		};
		var onOverlayExited = function onOverlayExited() {
			ZIndexUtils.clear(overlayRef.current);
			props.onHide && props.onHide();
		};
		var alignOverlay = function alignOverlay() {
			if (triggerState) {
				var key = triggerState.key;
				var index = triggerState.index;
				var value = inputRef.current.value;
				var position = DomHandler.getCursorOffset(inputRef.current, value.substring(0, index - 1), value.substring(index), key);
				overlayRef.current.style.transformOrigin = "top";
				overlayRef.current.style.left = "calc(".concat(position.left, "px + 1rem)");
				overlayRef.current.style.top = "calc(".concat(position.top, "px + 1.2rem)");
			}
		};
		var onPanelClick = function onPanelClick(event) {
			OverlayService.emit("overlay-click", {
				originalEvent: event,
				target: elementRef.current
			});
		};
		var getTrigger = function getTrigger(value, key, start) {
			if (!triggerState) {
				var triggerKey = Array.isArray(props.trigger) ? props.trigger.find(function(t) {
					return t === key;
				}) : props.trigger === key ? props.trigger : null;
				if (triggerKey) return {
					key: triggerKey,
					index: start
				};
				var latestSpaceIndex = value.substring(0, start).lastIndexOf(" ");
				var latestTrigger = getLatestTrigger(value, start);
				if (latestTrigger.index > latestSpaceIndex) return latestTrigger;
			}
			return triggerState;
		};
		var getLatestTrigger = function getLatestTrigger(value, start) {
			if (Array.isArray(props.trigger)) {
				var latestTrigger = {};
				props.trigger.forEach(function(t) {
					var index = value.substring(0, start).lastIndexOf(t);
					if (index !== -1 && (index > latestTrigger.index || !latestTrigger.index)) latestTrigger = {
						key: t,
						index: index !== -1 ? index + 1 : -1
					};
				});
				return latestTrigger;
			}
			var index = value.substring(0, start).lastIndexOf(props.trigger);
			return {
				key: props.trigger,
				index: index !== -1 ? index + 1 : -1
			};
		};
		var onSearch = function onSearch(event) {
			if (timeout.current) clearTimeout(timeout.current);
			var _event$target = event.target;
			var value = _event$target.value;
			var selectionStart = _event$target.selectionStart;
			var key = value.substring(selectionStart - 1, selectionStart);
			if (key === " ") {
				hide();
				return;
			}
			var currentTrigger = getTrigger(value, key, selectionStart);
			if (currentTrigger && currentTrigger.index > -1) {
				var query = value.substring(currentTrigger.index, selectionStart);
				timeout.current = setTimeout(function() {
					search(event, query, currentTrigger);
				}, props.delay);
			}
		};
		var search = function search(event, query, trigger) {
			if (props.onSearch) {
				setSearchingState(true);
				setTriggerState(trigger);
				props.onSearch({
					originalEvent: event,
					trigger: trigger.key,
					query
				});
			}
		};
		var selectItem = function selectItem(event, suggestion) {
			var input = inputRef.current;
			var value = input.value;
			var selectionStart = input.selectionStart;
			var spaceIndex = value.indexOf(" ", triggerState.index);
			var currentText = value.substring(triggerState.index, spaceIndex > -1 ? spaceIndex : selectionStart);
			var selectedText = formatValue(suggestion).replace(/\s+/g, "");
			if (currentText.trim() !== selectedText) {
				var prevText = value.substring(0, triggerState.index);
				var nextText = value.substring(spaceIndex > -1 ? selectionStart : triggerState.index + currentText.length);
				inputRef.current.value = nextText[0] === " " ? "".concat(prevText).concat(selectedText).concat(nextText) : "".concat(prevText).concat(selectedText, " ").concat(nextText);
				event.target = inputRef.current;
				props.onChange && props.onChange(event);
			}
			var cursorStart = triggerState.index + selectedText.length + 1;
			inputRef.current.setSelectionRange(cursorStart, cursorStart);
			hide();
			props.onSelect && props.onSelect({
				originalEvent: event,
				suggestion
			});
		};
		var formatValue = function formatValue(value) {
			if (value) {
				var field = Array.isArray(props.field) ? props.field[props.trigger.findIndex(function(f) {
					return f === triggerState.key;
				})] : props.field;
				return field ? ObjectUtils.resolveFieldData(value, field) : value;
			}
			return "";
		};
		var onItemClick = function onItemClick(event, suggestion) {
			DomHandler.focus(inputRef.current);
			selectItem(event, suggestion);
		};
		var onFocus = function onFocus(event) {
			setFocusedState(true);
			props.onFocus && props.onFocus(event);
		};
		var onBlur = function onBlur(event) {
			setFocusedState(false);
			props.onBlur && props.onBlur(event);
		};
		var onInput = function onInput(event) {
			props.onInput && props.onInput(event);
			var isFilled = event.target.value.length > 0;
			if (isUnstyled()) DomHandler.setAttributes(elementRef.current, { "data-p-inputwrapper-filled": isFilled });
			else if (isFilled) DomHandler.addClass(elementRef.current, "p-inputwrapper-filled");
			else DomHandler.removeClass(elementRef.current, "p-inputwrapper-filled");
		};
		var onKeyUp = function onKeyUp(event) {
			if (event.which === 37 || event.which === 39) onSearch(event);
		};
		var onChange = function onChange(event) {
			props.onChange && props.onChange(event);
			onSearch(event);
		};
		var onKeyDown = function onKeyDown(event) {
			if (overlayVisibleState) {
				var highlightItem = DomHandler.findSingle(overlayRef.current, "li[data-p-highlight=\"true\"]");
				switch (event.which) {
					case 40:
						if (highlightItem) {
							var nextElement = highlightItem.nextElementSibling;
							if (nextElement) {
								var nextElementIndex = DomHandler.index(nextElement);
								var highlightItemIndex = DomHandler.index(highlightItem);
								setHighlightState(function(prevState) {
									var newState = _toConsumableArray(prevState);
									newState[nextElementIndex] = true;
									newState[highlightItemIndex] = false;
									return newState;
								});
								DomHandler.scrollInView(overlayRef.current, nextElement);
							}
						} else {
							highlightItem = DomHandler.findSingle(overlayRef.current, "li");
							if (highlightItem) {
								var _highlightItemIndex = DomHandler.index(highlightItem);
								setHighlightState(function(prevState) {
									var newState = _toConsumableArray(prevState);
									newState[_highlightItemIndex] = true;
									return newState;
								});
							}
						}
						event.preventDefault();
						break;
					case 38:
						if (highlightItem) {
							var previousElement = highlightItem.previousElementSibling;
							if (previousElement) {
								var previousElementIndex = DomHandler.index(previousElement);
								var _highlightItemIndex2 = DomHandler.index(highlightItem);
								setHighlightState(function(prevState) {
									var newState = _toConsumableArray(prevState);
									newState[previousElementIndex] = true;
									newState[_highlightItemIndex2] = false;
									return newState;
								});
								DomHandler.scrollInView(overlayRef.current, previousElement);
							}
						}
						event.preventDefault();
						break;
					case 8:
						var _event$target2 = event.target;
						var value = _event$target2.value;
						var selectionStart = _event$target2.selectionStart;
						if (value.substring(selectionStart - 1, selectionStart) === triggerState.key) hide();
						break;
					case 13:
						if (highlightItem) selectItem(event, props.suggestions[DomHandler.index(highlightItem)]);
						event.preventDefault();
						break;
					case 27:
						hide();
						event.preventDefault();
						break;
				}
			}
		};
		var currentValue = inputRef.current && inputRef.current.value;
		var isFilled = react.useMemo(function() {
			return ObjectUtils.isNotEmpty(props.value) || ObjectUtils.isNotEmpty(props.defaultValue) || ObjectUtils.isNotEmpty(currentValue);
		}, [
			props.value,
			props.defaultValue,
			currentValue
		]);
		react.useImperativeHandle(ref, function() {
			return {
				props,
				show,
				hide,
				focus: function focus() {
					return DomHandler.focus(inputRef.current);
				},
				getElement: function getElement() {
					return elementRef.current;
				},
				getOverlay: function getOverlay() {
					return overlayRef.current;
				},
				getInput: function getInput() {
					return inputRef.current;
				}
			};
		});
		react.useEffect(function() {
			ObjectUtils.combinedRefs(inputRef, props.inputRef);
		}, [inputRef, props.inputRef]);
		useUpdateEffect(function() {
			var hasSuggestions = props.suggestions && props.suggestions.length;
			if (hasSuggestions) setHighlightState(props.suggestions.map(function() {
				return false;
			}));
			if (searchingState) {
				hasSuggestions ? show() : hide();
				overlayVisibleState && alignOverlay();
				setSearchingState(false);
			}
		}, [props.suggestions]);
		useUpdateEffect(function() {
			var _isUnstyled = isUnstyled();
			var isInputWrapperFilled = _isUnstyled ? DomHandler.isAttributeEquals(elementRef.current, "data-p-inputwrapper-filled", true) : DomHandler.hasClass(elementRef.current, "p-inputwrapper-filled");
			if (!isFilled && isInputWrapperFilled) _isUnstyled ? DomHandler.setAttributes(elementRef.current, { "data-p-inputwrapper-filled": false }) : DomHandler.removeClass(elementRef.current, "p-inputwrapper-filled");
		}, [isFilled]);
		useUnmountEffect(function() {
			ZIndexUtils.clear(overlayRef.current);
		});
		var createItem = function createItem(suggestion, index) {
			var key = index + "_item";
			var content = props.itemTemplate ? ObjectUtils.getJSXElement(props.itemTemplate, suggestion, {
				trigger: triggerState ? triggerState.key : "",
				index
			}) : formatValue(suggestion);
			var isSelected = highlightState[index];
			var itemProps = mergeProps({
				className: cx("item", { isSelected }),
				onClick: function onClick(e) {
					return onItemClick(e, suggestion);
				},
				"data-p-highlight": isSelected
			}, getPTOptions(suggestion, "item", { selected: isSelected }));
			return /*#__PURE__*/ react.createElement("li", _extends({}, itemProps, { key }), content, /*#__PURE__*/ react.createElement(Ripple, null));
		};
		var createList = function createList() {
			var itemsProps = mergeProps({
				ref: listRef,
				className: cx("items")
			}, ptm("items"));
			if (props.suggestions) {
				var items = props.suggestions.map(createItem);
				return /*#__PURE__*/ react.createElement("ul", itemsProps, items);
			}
			return null;
		};
		var createPanel = function createPanel() {
			var header = ObjectUtils.getJSXElement(props.headerTemplate, props);
			var footer = ObjectUtils.getJSXElement(props.footerTemplate, props);
			var list = createList();
			var panelProps = mergeProps({
				ref: overlayRef,
				className: cx("panel"),
				style: _objectSpread({ maxHeight: props.scrollHeight }, props.panelStyle),
				onClick: onPanelClick
			}, ptm("panel"));
			var transitionProps = mergeProps({
				classNames: cx("transition"),
				"in": overlayVisibleState,
				timeout: {
					enter: 120,
					exit: 100
				},
				options: props.transitionOptions,
				unmountOnExit: true,
				onEnter: onOverlayEnter,
				onEntering: onOverlayEntering,
				onEntered: onOverlayEntered,
				onExit: onOverlayExit,
				onExited: onOverlayExited
			}, ptm("transition"));
			var panel = /*#__PURE__*/ react.createElement(CSSTransition, _extends({ nodeRef: overlayRef }, transitionProps), /*#__PURE__*/ react.createElement("div", panelProps, header, list, footer));
			return /*#__PURE__*/ react.createElement(Portal, {
				element: panel,
				appendTo: "self"
			});
		};
		var inputProps = MentionBase.getOtherProps(props);
		var panel = createPanel();
		var inputMentionProps = mergeProps(_objectSpread(_objectSpread({
			ref: inputRef,
			id: props.inputId,
			className: cx("input"),
			style: props.inputStyle
		}, inputProps), {}, {
			unstyled: props.unstyled,
			variant: props.variant,
			autoResize: props.autoResize,
			onFocus,
			onBlur,
			onKeyDown,
			onInput,
			onKeyUp,
			onChange,
			__parentMetadata: { parent: metaData }
		}), ptm("input"));
		var rootProps = mergeProps({
			ref: elementRef,
			id: props.id,
			className: classNames(props.className, cx("root", {
				focusedState,
				isFilled
			})),
			style: props.style
		}, MentionBase.getOtherProps(props), ptm("root"));
		return /*#__PURE__*/ react.createElement("div", rootProps, /*#__PURE__*/ react.createElement(InputTextarea, inputMentionProps), panel);
	}));
	Mention.displayName = "Mention";

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/mention-text-area-control.tsx
	var MentionWrapper = (0, _elementor_ui.styled)("div")(({ theme }) => ({
		position: "relative",
		"& .p-mention": {
			width: "100%",
			position: "relative"
		},
		"& textarea": {
			width: "100%",
			boxSizing: "border-box",
			fontFamily: "inherit",
			fontSize: theme.typography.pxToRem(12),
			lineHeight: 1.4375,
			padding: "4px 8px",
			borderRadius: theme.shape.borderRadius,
			border: `1px solid ${theme.palette.divider}`,
			backgroundColor: "transparent",
			color: "inherit",
			resize: "vertical",
			outline: "none",
			transition: "border-color 150ms ease-in-out",
			"&:hover": { borderColor: theme.palette.action.active },
			"&:focus": {
				borderColor: theme.palette.primary.main,
				borderWidth: 2,
				padding: "3px 7px"
			},
			"&:disabled": {
				opacity: .38,
				cursor: "default"
			},
			"&::placeholder": {
				color: "inherit",
				opacity: .5
			}
		},
		"& .p-mention-panel": {
			fontFamily: "inherit",
			fontSize: theme.typography.pxToRem(12),
			backgroundColor: theme.palette.background.paper,
			border: `1px solid ${theme.palette.divider}`,
			borderRadius: theme.shape.borderRadius,
			boxShadow: theme.shadows[4],
			maxHeight: "200px",
			overflow: "auto",
			zIndex: theme.zIndex.modal,
			maxWidth: "100%",
			right: 0,
			left: "auto !important"
		},
		"& .p-mention-items": {
			listStyle: "none",
			margin: 0,
			padding: "4px 0"
		},
		"& .p-mention-item": {
			padding: "6px 12px",
			cursor: "pointer",
			color: theme.palette.text.primary,
			"&:hover": { backgroundColor: theme.palette.action.hover },
			"&.p-highlight": { backgroundColor: theme.palette.action.selected }
		},
		"&[data-single-line=\"true\"] textarea": { resize: "none" }
	}));
	function createMentionPattern(value, triggerPosition) {
		const escaped = value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
		return new RegExp(`${"start" === triggerPosition ? "^" : ""}@${escaped}(?=\\s|$|[^a-zA-Z0-9_-])`, "g");
	}
	var MentionTextAreaControl = createControl(({ placeholder, ariaLabel, suggestions: allSuggestions, rows = 5, triggerPosition = "auto" }) => {
		const { value, setValue, disabled } = useBoundProp(_elementor_editor_props.stringPropTypeUtil);
		const [filteredSuggestions, setFilteredSuggestions] = (0, react.useState)([]);
		const transformMentionsToShortcodes = (0, react.useCallback)((text) => {
			let result = text;
			for (const suggestion of allSuggestions) {
				const pattern = createMentionPattern(suggestion.value, triggerPosition);
				result = result.replace(pattern, `[${suggestion.value}]`);
			}
			return result;
		}, [allSuggestions, triggerPosition]);
		const handleChange = (0, react.useCallback)((e) => {
			const rawValue = e.target.value;
			const transformed = transformMentionsToShortcodes(rawValue);
			setValue(transformed);
		}, [setValue, transformMentionsToShortcodes]);
		const handleSearch = (0, react.useCallback)((event) => {
			if ("start" === triggerPosition) {
				if (event.originalEvent.target.selectionStart - event.query.length - event.trigger.length !== 0) {
					setFilteredSuggestions([]);
					return;
				}
			}
			const query = event.query.toLowerCase();
			const filtered = allSuggestions.filter((item) => item.label.toLowerCase().includes(query) || item.value.toLowerCase().includes(query));
			setFilteredSuggestions(filtered);
		}, [allSuggestions, triggerPosition]);
		return /* @__PURE__ */ react.createElement(ControlActions, null, /* @__PURE__ */ react.createElement(MentionWrapper, { "data-single-line": rows === 1 ? "true" : void 0 }, /* @__PURE__ */ react.createElement(Mention, {
			value: value ?? "",
			onChange: handleChange,
			suggestions: filteredSuggestions,
			onSearch: handleSearch,
			field: "value",
			trigger: "@",
			rows,
			disabled,
			placeholder,
			itemTemplate: SuggestionItem,
			...ariaLabel ? { "aria-label": ariaLabel } : {}
		})));
	});
	var SuggestionItem = (suggestion) => /* @__PURE__ */ react.createElement("span", null, suggestion.label);

//#endregion
//#region packages/packages/libs/editor-controls/src/hooks/use-typing-buffer.ts
	function useTypingBuffer(options = {}) {
		const { limit = 3, timeout = 600 } = options;
		const inputBufferRef = (0, react.useRef)("");
		const timeoutRef = (0, react.useRef)(null);
		const appendKey = (key) => {
			inputBufferRef.current = (inputBufferRef.current + key).slice(-limit);
			if (timeoutRef.current) clearTimeout(timeoutRef.current);
			timeoutRef.current = setTimeout(() => {
				inputBufferRef.current = "";
				timeoutRef.current = null;
			}, timeout);
			return inputBufferRef.current;
		};
		const startsWith = (haystack, needle) => {
			if (3 < haystack.length && 2 > needle.length) return false;
			return haystack.startsWith(needle);
		};
		(0, react.useEffect)(() => {
			return () => {
				inputBufferRef.current = "";
				if (timeoutRef.current) {
					clearTimeout(timeoutRef.current);
					timeoutRef.current = null;
				}
			};
		}, []);
		return {
			buffer: inputBufferRef.current,
			appendKey,
			startsWith
		};
	}

//#endregion
//#region packages/packages/libs/editor-controls/src/utils/size-control.ts
	var lengthUnits = [
		"px",
		"%",
		"em",
		"rem",
		"vw",
		"vh",
		"ch"
	];
	var angleUnits = [
		"deg",
		"rad",
		"grad",
		"turn"
	];
	var timeUnits = ["s", "ms"];
	var DEFAULT_SIZE$2 = NaN;
	var extendedOptions = ["auto", "custom"];
	function isUnitExtendedOption(unit) {
		return extendedOptions.includes(unit);
	}

//#endregion
//#region packages/packages/libs/editor-controls/src/components/number-input.tsx
	var RESTRICTED_INPUT_KEYS = [
		"e",
		"E",
		"+"
	];
	var NumberInput = (0, react.forwardRef)((props, ref) => {
		const [key, setKey] = (0, react.useState)(0);
		const handleKeyDown = (event) => {
			blockRestrictedKeys(event, props.inputProps?.min);
			props.onKeyDown?.(event);
		};
		const handleBlur = (event) => {
			props.onBlur?.(event);
			const { valid } = event.target.validity;
			if (!valid) setKey((prev) => prev + 1);
		};
		return /* @__PURE__ */ react.createElement(_elementor_ui.TextField, {
			...props,
			ref,
			key,
			onKeyDown: handleKeyDown,
			onBlur: handleBlur
		});
	});
	function blockRestrictedKeys(event, min) {
		const restrictedInputKeys = [...RESTRICTED_INPUT_KEYS];
		if (min >= 0) restrictedInputKeys.push("-");
		if (restrictedInputKeys.includes(event.key)) event.preventDefault();
	}

//#endregion
//#region packages/packages/libs/editor-controls/src/components/size-control/text-field-inner-selection.tsx
	var TextFieldInnerSelection = (0, react.forwardRef)(({ placeholder, type, value, onChange, onBlur, onKeyDown, onKeyUp, InputProps, inputProps, disabled, isPopoverOpen, id }, ref) => {
		const { placeholder: boundPropPlaceholder } = useBoundProp(_elementor_editor_props.sizePropTypeUtil);
		const getCursorStyle = () => ({ input: { cursor: InputProps.readOnly ? "default !important" : void 0 } });
		return /* @__PURE__ */ react.createElement(NumberInput, {
			ref,
			sx: getCursorStyle(),
			size: "tiny",
			fullWidth: true,
			type,
			value,
			onInput: onChange,
			onKeyDown,
			onKeyUp,
			disabled,
			onBlur,
			focused: isPopoverOpen ? true : void 0,
			placeholder: placeholder ?? (String(boundPropPlaceholder?.size ?? "") || void 0),
			InputProps,
			inputProps,
			id
		});
	});
	var SelectionEndAdornment = ({ options, alternativeOptionLabels = {}, onClick, value, menuItemsAttributes = {}, disabled }) => {
		const popupState = (0, _elementor_ui.usePopupState)({
			variant: "popover",
			popupId: (0, react.useId)()
		});
		const handleMenuItemClick = (index) => {
			onClick(options[index]);
			popupState.close();
		};
		const { placeholder, showPrimaryColor } = useUnitPlaceholder(value);
		const itemStyles = {
			display: "flex",
			flexDirection: "column",
			justifyContent: "center"
		};
		return /* @__PURE__ */ react.createElement(_elementor_ui.InputAdornment, { position: "end" }, /* @__PURE__ */ react.createElement(StyledButton$2, {
			isPrimaryColor: showPrimaryColor,
			size: "small",
			disabled,
			...(0, _elementor_ui.bindTrigger)(popupState)
		}, placeholder ?? alternativeOptionLabels[value] ?? value), /* @__PURE__ */ react.createElement(_elementor_ui.Menu, {
			MenuListProps: { dense: true },
			...(0, _elementor_ui.bindMenu)(popupState)
		}, options.map((option, index) => /* @__PURE__ */ react.createElement(_elementor_editor_ui.MenuListItem, {
			key: option,
			onClick: () => handleMenuItemClick(index),
			...menuItemsAttributes?.[option],
			primaryTypographyProps: {
				variant: "caption",
				sx: {
					...itemStyles,
					lineHeight: "1"
				}
			},
			menuItemTextProps: { sx: itemStyles }
		}, alternativeOptionLabels[option] ?? option.toUpperCase()))));
	};
	function useUnitPlaceholder(value) {
		const { value: externalValue, placeholder } = useBoundProp(_elementor_editor_props.sizePropTypeUtil);
		const size = externalValue?.size;
		const unit = externalValue?.unit;
		const showPrimaryColor = value === "auto" || value === "custom" && Boolean(size) || Boolean(size);
		if (!placeholder) return {
			placeholder: null,
			showPrimaryColor
		};
		return {
			placeholder: !unit && value === "px" ? placeholder.unit : void 0,
			showPrimaryColor
		};
	}
	var StyledButton$2 = (0, _elementor_ui.styled)(_elementor_ui.Button, { shouldForwardProp: (prop) => prop !== "isPrimaryColor" })(({ isPrimaryColor, theme }) => ({
		color: isPrimaryColor ? theme.palette.text.primary : theme.palette.text.tertiary,
		font: "inherit",
		minWidth: "initial",
		textTransform: "uppercase"
	}));

//#endregion
//#region packages/packages/libs/editor-controls/src/components/size-control/size-input.tsx
	var SizeInput$1 = /* @__PURE__ */ __name(({ units, handleUnitChange, handleSizeChange, placeholder, startIcon, onBlur, onFocus, onClick, size, unit, popupState, disabled, min, id, ariaLabel }) => {
		const { appendKey, startsWith } = useTypingBuffer();
		const inputType = isUnitExtendedOption(unit) ? "text" : "number";
		const inputValue = !isUnitExtendedOption(unit) && Number.isNaN(size) ? "" : size ?? "";
		const handleKeyDown = (event) => {
			const { key, altKey, ctrlKey, metaKey } = event;
			if (altKey || ctrlKey || metaKey) return;
			if (isUnitExtendedOption(unit) && !isNaN(Number(key))) {
				const defaultUnit = units?.[0];
				if (defaultUnit) handleUnitChange(defaultUnit);
				return;
			}
			if (!/^[a-zA-Z%]$/.test(key)) return;
			event.preventDefault();
			const newChar = key.toLowerCase();
			const updatedBuffer = appendKey(newChar);
			const matchedUnit = units.find((u) => startsWith(u, updatedBuffer));
			if (matchedUnit) handleUnitChange(matchedUnit);
		};
		const popupAttributes = {
			"aria-controls": popupState.isOpen ? popupState.popupId : void 0,
			"aria-haspopup": true
		};
		const menuItemsAttributes = units.includes("custom") ? { custom: popupAttributes } : void 0;
		const alternativeOptionLabels = { custom: /* @__PURE__ */ react.createElement(_elementor_icons.MathFunctionIcon, { fontSize: "tiny" }) };
		const InputProps = {
			...popupAttributes,
			readOnly: isUnitExtendedOption(unit),
			autoComplete: "off",
			onClick,
			onFocus,
			startAdornment: startIcon ? /* @__PURE__ */ react.createElement(_elementor_ui.InputAdornment, {
				position: "start",
				disabled
			}, startIcon) : void 0,
			endAdornment: /* @__PURE__ */ react.createElement(SelectionEndAdornment, {
				disabled,
				options: units,
				onClick: handleUnitChange,
				value: unit,
				alternativeOptionLabels,
				menuItemsAttributes
			})
		};
		return /* @__PURE__ */ react.createElement(ControlActions, null, /* @__PURE__ */ react.createElement(_elementor_ui.Box, null, /* @__PURE__ */ react.createElement(TextFieldInnerSelection, {
			disabled,
			placeholder,
			type: inputType,
			value: inputValue,
			onChange: handleSizeChange,
			onKeyDown: handleKeyDown,
			onBlur,
			InputProps,
			inputProps: {
				min,
				step: "any",
				"aria-label": ariaLabel
			},
			isPopoverOpen: popupState.isOpen,
			id
		})));
	}, "SizeInput");

//#endregion
//#region packages/packages/libs/editor-controls/src/components/text-field-popover.tsx
	var SIZE$11 = "tiny";
	var TextFieldPopover$1 = /* @__PURE__ */ __name((props) => {
		const { popupState, restoreValue, anchorRef, value, onChange } = props;
		const inputRef = (0, react.useRef)(null);
		(0, react.useEffect)(() => {
			if (popupState.isOpen) requestAnimationFrame(() => {
				if (inputRef.current) inputRef.current.focus();
			});
		}, [popupState.isOpen]);
		const handleKeyPress = (event) => {
			if (event.key.toLowerCase() === "enter") handleClose();
		};
		const handleClose = () => {
			restoreValue();
			popupState.close();
		};
		return /* @__PURE__ */ react.createElement(_elementor_ui.Popover, {
			disablePortal: true,
			slotProps: { paper: { sx: {
				borderRadius: 2,
				width: anchorRef.current?.offsetWidth + "px"
			} } },
			...(0, _elementor_ui.bindPopover)(popupState),
			anchorOrigin: {
				vertical: "bottom",
				horizontal: "center"
			},
			transformOrigin: {
				vertical: "top",
				horizontal: "center"
			},
			onClose: handleClose
		}, /* @__PURE__ */ react.createElement(_elementor_editor_ui.PopoverHeader, {
			title: (0, _wordpress_i18n.__)("CSS function", "elementor"),
			onClose: handleClose,
			icon: /* @__PURE__ */ react.createElement(_elementor_icons.MathFunctionIcon, { fontSize: SIZE$11 })
		}), /* @__PURE__ */ react.createElement(_elementor_ui.TextField, {
			value,
			onChange,
			onKeyPress: handleKeyPress,
			size: "tiny",
			type: "text",
			fullWidth: true,
			inputProps: { ref: inputRef },
			sx: {
				pt: 0,
				pr: 1.5,
				pb: 1.5,
				pl: 1.5
			}
		}));
	}, "TextFieldPopover");

//#endregion
//#region packages/packages/libs/editor-controls/src/hooks/use-size-extended-options.ts
	function useSizeExtendedOptions(options, disableCustom) {
		return (0, react.useMemo)(() => {
			const extendedOptions = [...options];
			if (!disableCustom && !extendedOptions.includes("custom")) extendedOptions.push("custom");
			else if (options.includes("custom")) extendedOptions.splice(extendedOptions.indexOf("custom"), 1);
			return extendedOptions;
		}, [options, disableCustom]);
	}

//#endregion
//#region packages/packages/libs/editor-controls/src/hooks/use-sync-external-state.tsx
	var useSyncExternalState = ({ external, setExternal, persistWhen, fallback }) => {
		function toExternal(internalValue) {
			if (persistWhen(internalValue)) return internalValue;
			return null;
		}
		function toInternal(externalValue, internalValue) {
			if (!externalValue) return fallback(internalValue);
			return externalValue;
		}
		const [internal, setInternal] = (0, react.useState)(toInternal(external, null));
		(0, react.useEffect)(() => {
			setInternal((prevInternal) => toInternal(external, prevInternal));
		}, [external]);
		const setInternalValue = (setter, options, meta) => {
			const updated = (typeof setter === "function" ? setter : () => setter)(internal);
			setInternal(updated);
			setExternal(toExternal(updated), options, meta);
		};
		return [internal, setInternalValue];
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/size-control/utils/settings/get-prop-type-settings.ts
	var getPropTypeSettings = (propType) => {
		return propType.settings;
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/size-control.tsx
	var defaultSelectedUnit = {
		length: "px",
		angle: "deg",
		time: "ms"
	};
	var defaultUnits = {
		length: [...lengthUnits],
		angle: [...angleUnits],
		time: [...timeUnits]
	};
	var SizeControl = createControl(({ variant = "length", defaultUnit, units, placeholder, startIcon, anchorRef, extendedOptions, disableCustom, min = 0, enablePropTypeUnits = false, id, ariaLabel }) => {
		const { value: sizeValue, setValue: setSizeValue, disabled, restoreValue, placeholder: externalPlaceholder, propType } = useBoundProp(_elementor_editor_props.sizePropTypeUtil);
		const actualDefaultUnit = defaultUnit ?? externalPlaceholder?.unit ?? defaultSelectedUnit[variant];
		const activeBreakpoint = (0, _elementor_editor_responsive.useActiveBreakpoint)();
		const actualUnits = resolveUnits(propType, enablePropTypeUnits, variant, units, useSizeExtendedOptions(extendedOptions || [], disableCustom ?? false));
		const popupState = (0, _elementor_ui.usePopupState)({ variant: "popover" });
		const [state, setState] = useSyncExternalState({
			external: (0, react.useMemo)(() => createStateFromSizeProp(sizeValue, actualDefaultUnit), [sizeValue, actualDefaultUnit]),
			setExternal: (newState, options, meta) => setSizeValue(extractValueFromState(newState), options, meta),
			persistWhen: (newState) => !!extractValueFromState(newState),
			fallback: (newState) => ({
				unit: newState?.unit ?? actualDefaultUnit,
				numeric: newState?.numeric ?? NaN,
				custom: newState?.custom ?? ""
			})
		});
		const { size: controlSize = DEFAULT_SIZE$2, unit: controlUnit = actualDefaultUnit } = extractValueFromState(state, true) || {};
		const handleUnitChange = (newUnit) => {
			if (newUnit === "custom") popupState.open(anchorRef?.current);
			setState((prev) => ({
				...prev,
				unit: newUnit
			}));
		};
		const handleSizeChange = (event) => {
			const size = event.target.value;
			const isInputValid = event.target.validity.valid;
			if (controlUnit === "auto") {
				setState((prev) => ({
					...prev,
					unit: controlUnit
				}));
				return;
			}
			setState((prev) => ({
				...prev,
				[controlUnit === "custom" ? "custom" : "numeric"]: formatSize(size, controlUnit),
				unit: controlUnit
			}), void 0, { validation: () => isInputValid });
		};
		const onInputClick = (event) => {
			if (event.target.closest("input") && "custom" === state.unit) popupState.open(anchorRef?.current);
		};
		const maybeClosePopup = (0, react.useCallback)(() => {
			if (popupState && popupState.isOpen) popupState.close();
		}, [popupState]);
		(0, react.useEffect)(() => {
			maybeClosePopup();
		}, [activeBreakpoint]);
		return /* @__PURE__ */ react.createElement(react.Fragment, null, /* @__PURE__ */ react.createElement(SizeInput$1, {
			disabled,
			size: controlSize,
			unit: controlUnit,
			units: [...actualUnits],
			placeholder,
			startIcon,
			handleSizeChange,
			handleUnitChange,
			onBlur: restoreValue,
			onClick: onInputClick,
			popupState,
			min,
			id,
			ariaLabel
		}), anchorRef?.current && popupState.isOpen && /* @__PURE__ */ react.createElement(TextFieldPopover$1, {
			popupState,
			anchorRef,
			restoreValue,
			value: controlSize,
			onChange: handleSizeChange
		}));
	});
	function resolveUnits(propType, enablePropTypeUnits, variant, externalUnits, actualExtendedOptions) {
		const fallback = [...defaultUnits[variant]];
		if (!enablePropTypeUnits) return [...externalUnits ?? fallback, ...actualExtendedOptions || []];
		return getPropTypeSettings(propType)?.available_units ?? fallback;
	}
	function formatSize(size, unit) {
		if (isUnitExtendedOption(unit)) return unit === "auto" ? "" : String(size ?? "");
		return size || size === 0 ? Number(size) : NaN;
	}
	function createStateFromSizeProp(sizeValue, defaultUnit, defaultSize = "", customState = "") {
		const unit = sizeValue?.unit ?? defaultUnit;
		const size = sizeValue?.size ?? defaultSize;
		return {
			numeric: !isUnitExtendedOption(unit) && !isNaN(Number(size)) && (size || size === 0) ? Number(size) : DEFAULT_SIZE$2,
			custom: unit === "custom" ? String(size) : customState,
			unit
		};
	}
	function extractValueFromState(state, allowEmpty = false) {
		if (!state) return null;
		if (!state?.unit) return {
			size: DEFAULT_SIZE$2,
			unit: "px"
		};
		const { unit } = state;
		if (unit === "auto") return {
			size: "",
			unit
		};
		if (unit === "custom") return {
			size: state.custom ?? "",
			unit: "custom"
		};
		const numeric = state.numeric;
		if (!allowEmpty && (numeric === void 0 || numeric === null || Number.isNaN(numeric))) return null;
		return {
			size: numeric,
			unit
		};
	}

//#endregion
//#region packages/packages/libs/editor-controls/src/components/section-content.tsx
	var SectionContent = ({ gap = .5, sx, children }) => /* @__PURE__ */ react.createElement(_elementor_ui.Stack, {
		gap,
		sx: { ...sx }
	}, children);

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/color-control.tsx
	var ColorControl = createControl(({ propTypeUtil = _elementor_editor_props.colorPropTypeUtil, anchorEl, slotProps = {}, id, ...props }) => {
		const { value, setValue, placeholder: boundPropPlaceholder, disabled } = useBoundProp(propTypeUtil);
		const placeholder = props.placeholder ?? boundPropPlaceholder;
		const handleChange = (selectedColor) => {
			setValue(selectedColor || null);
		};
		return /* @__PURE__ */ react.createElement(ControlActions, null, /* @__PURE__ */ react.createElement(_elementor_ui.UnstableColorField, {
			id,
			size: "tiny",
			fullWidth: true,
			value: value ?? "",
			placeholder: placeholder ?? "",
			onChange: handleChange,
			...props,
			disabled,
			slotProps: {
				...slotProps,
				colorPicker: {
					anchorEl,
					anchorOrigin: {
						vertical: "top",
						horizontal: "right"
					},
					transformOrigin: {
						vertical: "top",
						horizontal: -10
					},
					slotProps: {
						colorIndicator: { value: value ?? placeholder ?? "" },
						colorBox: { value: value ?? placeholder ?? "" }
					}
				}
			}
		}));
	});

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/stroke-control.tsx
	var units = [
		"px",
		"em",
		"rem"
	];
	var StrokeControl = createControl(() => {
		const propContext = useBoundProp(_elementor_editor_props.strokePropTypeUtil);
		const rowRef = (0, react.useRef)(null);
		return /* @__PURE__ */ react.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ react.createElement(SectionContent, { gap: 2 }, /* @__PURE__ */ react.createElement(Control$3, {
			bind: "width",
			label: (0, _wordpress_i18n.__)("Stroke width", "elementor"),
			ref: rowRef
		}, /* @__PURE__ */ react.createElement(SizeControl, {
			units,
			anchorRef: rowRef
		})), /* @__PURE__ */ react.createElement(Control$3, {
			bind: "color",
			label: (0, _wordpress_i18n.__)("Stroke color", "elementor")
		}, /* @__PURE__ */ react.createElement(ColorControl, null))));
	});
	var Control$3 = (0, react.forwardRef)(({ bind, label, children }, ref) => /* @__PURE__ */ react.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
		container: true,
		gap: 2,
		alignItems: "center",
		flexWrap: "nowrap",
		ref
	}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
		item: true,
		xs: 6
	}, /* @__PURE__ */ react.createElement(ControlFormLabel, null, label)), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
		item: true,
		xs: 6
	}, children))));

//#endregion
//#region packages/packages/libs/editor-controls/src/hooks/use-repeater-popover-dismiss.ts
	var serializeBreakpoints = (breakpoints) => breakpoints.map((b) => [
		b.id,
		b.width ?? "",
		b.type ?? ""
	].join(":")).join("|");
	var usePopoverDismiss = ({ isOpen, onClose }) => {
		const onCloseRef = (0, react.useRef)(onClose);
		onCloseRef.current = onClose;
		const activeBreakpoint = (0, _elementor_editor_responsive.useActiveBreakpoint)();
		const breakpoints = (0, _elementor_editor_responsive.useBreakpoints)();
		const breakpointsSignature = (0, react.useMemo)(() => serializeBreakpoints(breakpoints), [breakpoints]);
		const prevActiveBreakpointRef = (0, react.useRef)(void 0);
		const prevBreakpointsSignatureRef = (0, react.useRef)(null);
		(0, react.useEffect)(() => {
			if (!isOpen) {
				prevActiveBreakpointRef.current = activeBreakpoint;
				prevBreakpointsSignatureRef.current = breakpointsSignature;
				return;
			}
			const previousBreakpoint = prevActiveBreakpointRef.current;
			const previousSignature = prevBreakpointsSignatureRef.current;
			if (previousBreakpoint !== void 0 && previousBreakpoint !== activeBreakpoint || previousSignature !== null && previousSignature !== breakpointsSignature) onCloseRef.current();
			prevActiveBreakpointRef.current = activeBreakpoint;
			prevBreakpointsSignatureRef.current = breakpointsSignature;
		}, [
			activeBreakpoint,
			breakpointsSignature,
			isOpen
		]);
		(0, react.useEffect)(() => {
			if (!isOpen) return;
			const onKeyDown = (event) => {
				if (event.key === "Escape" && !event.defaultPrevented) onCloseRef.current();
			};
			document.addEventListener("keydown", onKeyDown);
			return () => {
				document.removeEventListener("keydown", onKeyDown);
			};
		}, [isOpen]);
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/services/event-bus.ts
	var __defProp$1 = Object.defineProperty;
	var __defNormalProp = (obj, key, value) => key in obj ? __defProp$1(obj, key, {
		enumerable: true,
		configurable: true,
		writable: true,
		value
	}) : obj[key] = value;
	var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
	var EventBus = class {
		constructor() {
			__publicField(this, "listeners", /* @__PURE__ */ new Map());
		}
		subscribe(eventName, callback) {
			if (!this.listeners.has(eventName)) this.listeners.set(eventName, /* @__PURE__ */ new Set());
			const eventListeners = this.listeners.get(eventName);
			if (eventListeners) eventListeners.add(callback);
		}
		unsubscribe(eventName, callback) {
			const eventListeners = this.listeners.get(eventName);
			if (!eventListeners) return;
			eventListeners.delete(callback);
			if (eventListeners.size === 0) this.listeners.delete(eventName);
		}
		emit(eventName, data) {
			const eventListeners = this.listeners.get(eventName);
			if (eventListeners) eventListeners.forEach((callback) => callback(data));
		}
		clearAll() {
			this.listeners.clear();
		}
	};
	var eventBus = new EventBus();

//#endregion
//#region packages/packages/libs/editor-controls/src/components/control-repeater/context/item-context.tsx
	var ItemContext = (0, react.createContext)({
		index: -1,
		value: {}
	});

//#endregion
//#region packages/packages/libs/editor-controls/src/components/control-repeater/context/repeater-context.tsx
	var RepeaterContext = (0, react.createContext)(null);
	var EMPTY_OPEN_ITEM$1 = -1;
	var useRepeaterContext = () => {
		const context = (0, react.useContext)(RepeaterContext);
		const itemContext = (0, react.useContext)(ItemContext);
		if (!context) throw new Error("useRepeaterContext must be used within a RepeaterContextProvider");
		return {
			...context,
			...itemContext
		};
	};
	var RepeaterContextProvider = ({ children, initial, propTypeUtil, isItemDisabled = () => false }) => {
		const { value: repeaterValues, setValue: setRepeaterValues } = useBoundProp(propTypeUtil);
		const [items, setItems] = useSyncExternalState({
			external: repeaterValues,
			fallback: () => [],
			setExternal: setRepeaterValues,
			persistWhen: () => true
		});
		const [uniqueKeys, setUniqueKeys] = (0, react.useState)(() => {
			return items?.map(() => generateUniqueKey()) ?? [];
		});
		(0, react.useEffect)(() => {
			const nextLength = items?.length ?? 0;
			setUniqueKeys((prev) => {
				const prevLength = prev.length;
				if (prevLength === nextLength) return prev;
				if (prevLength > nextLength) return prev.slice(0, nextLength);
				return [...prev, ...Array.from({ length: nextLength - prevLength }, generateUniqueKey)];
			});
		}, [items?.length]);
		const itemsWithKeys = (0, react.useMemo)(() => uniqueKeys.map((key, index) => ({
			key,
			item: items[index]
		})).filter(({ item }) => item !== void 0), [uniqueKeys, items]);
		const handleSetItems = (newItemsWithKeys) => {
			setItems(newItemsWithKeys.map(({ item }) => item));
		};
		const [openItemIndex, setOpenItemIndex] = (0, react.useState)(-1);
		const [rowRef, setRowRef] = (0, react.useState)(null);
		const isOpen = openItemIndex !== -1;
		const popoverState = (0, _elementor_ui.usePopupState)({ variant: "popover" });
		const addItem = (ev, config) => {
			const item = config?.item ?? { ...initial };
			const newIndex = config?.index ?? items.length;
			const newKey = generateUniqueKey();
			const newItems = [...items];
			newItems.splice(newIndex, 0, item);
			setItems(newItems);
			setUniqueKeys([
				...uniqueKeys.slice(0, newIndex),
				newKey,
				...uniqueKeys.slice(newIndex)
			]);
			setOpenItemIndex(newIndex);
			popoverState.open(rowRef ?? ev);
			eventBus.emit(`${propTypeUtil.key}-item-added`, { itemValue: initial.value });
		};
		const removeItem = (index) => {
			const itemToRemove = items[index];
			setItems(items.filter((_, pos) => pos !== index));
			setUniqueKeys(uniqueKeys.filter((_, pos) => pos !== index));
			eventBus.emit(`${propTypeUtil.key}-item-removed`, { itemValue: itemToRemove?.value });
		};
		const updateItem = (updatedItem, index) => {
			const newItems = [
				...items.slice(0, index),
				updatedItem,
				...items.slice(index + 1)
			];
			setItems(newItems);
		};
		const closePopover = () => {
			if (!isOpen) return;
			setOpenItemIndex(-1);
			setRowRef(null);
			popoverState.close();
		};
		usePopoverDismiss({
			isOpen,
			onClose: closePopover
		});
		return /* @__PURE__ */ react.createElement(RepeaterContext.Provider, { value: {
			isOpen,
			openItemIndex,
			setOpenItemIndex,
			items: itemsWithKeys ?? [],
			setItems: handleSetItems,
			popoverState,
			initial,
			updateItem,
			addItem,
			removeItem,
			rowRef,
			setRowRef,
			isItemDisabled: (index) => isItemDisabled(itemsWithKeys[index].item)
		} }, children);
	};
	var generateUniqueKey = () => {
		return Date.now() + Math.floor(Math.random() * 1e6);
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/components/control-repeater/actions/tooltip-add-item-action.tsx
	var SIZE$10 = "tiny";
	var TooltipAddItemAction = ({ disabled = false, enableTooltip = false, tooltipContent = null, newItemIndex, ariaLabel }) => {
		const { addItem } = useRepeaterContext();
		const onClick = (ev) => addItem(ev, { index: newItemIndex });
		return /* @__PURE__ */ react.createElement(ConditionalToolTip, {
			content: tooltipContent,
			enable: enableTooltip
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Box, {
			component: "span",
			sx: { cursor: disabled ? "not-allowed" : "pointer" }
		}, /* @__PURE__ */ react.createElement(_elementor_ui.IconButton, {
			size: SIZE$10,
			disabled,
			onClick,
			"aria-label": (0, _wordpress_i18n.sprintf)((0, _wordpress_i18n.__)("Add %s item", "elementor"), ariaLabel?.toLowerCase())
		}, /* @__PURE__ */ react.createElement(_elementor_icons.PlusIcon, { fontSize: SIZE$10 }))));
	};
	var ConditionalToolTip = ({ children, enable, content }) => enable && content ? /* @__PURE__ */ react.createElement(_elementor_ui.Infotip, {
		placement: "right",
		color: "secondary",
		content
	}, children) : children;

//#endregion
//#region packages/packages/libs/editor-controls/src/components/repeater/sortable.tsx
	var SortableProvider = (props) => {
		return /* @__PURE__ */ react.createElement(_elementor_ui.List, { sx: {
			p: 0,
			my: -.5,
			mx: 0
		} }, /* @__PURE__ */ react.createElement(_elementor_ui.UnstableSortableProvider, {
			restrictAxis: true,
			disableDragOverlay: false,
			variant: "static",
			...props
		}));
	};
	var SortableItem = ({ id, children, disabled }) => {
		return /* @__PURE__ */ react.createElement(_elementor_ui.UnstableSortableItem, {
			id,
			disabled,
			render: ({ itemProps, triggerProps, itemStyle, triggerStyle, showDropIndication, dropIndicationStyle }) => {
				return /* @__PURE__ */ react.createElement(StyledListItem, {
					...itemProps,
					style: itemStyle,
					tabIndex: -1
				}, !disabled && /* @__PURE__ */ react.createElement(SortableTrigger, {
					...triggerProps,
					style: triggerStyle
				}), children, showDropIndication && /* @__PURE__ */ react.createElement(StyledDivider, { style: dropIndicationStyle }));
			}
		});
	};
	var StyledListItem = (0, _elementor_ui.styled)(_elementor_ui.ListItem)`
	position: relative;
	margin-inline: 0px;
	padding-inline: 0px;
	padding-block: ${({ theme }) => theme.spacing(.5)};

	& .class-item-sortable-trigger {
		color: ${({ theme }) => theme.palette.action.active};
		height: 100%;
		display: flex;
		align-items: center;
		visibility: hidden;
		position: absolute;
		top: 50%;
		padding-inline-end: ${({ theme }) => theme.spacing(.5)};
		transform: translate( -75%, -50% );
	}

	&[aria-describedby=''] > .MuiTag-root {
		background-color: ${({ theme }) => theme.palette.background.paper};
		box-shadow: ${({ theme }) => theme.shadows[3]};
	}

	&:hover,
	&:focus-within {
		& .class-item-sortable-trigger {
			visibility: visible;
		}
	}
`;
	var SortableTrigger = (props) => /* @__PURE__ */ react.createElement("div", {
		...props,
		role: "button",
		className: "class-item-sortable-trigger",
		tabIndex: 0,
		"aria-label": (0, _wordpress_i18n.__)("Drag item", "elementor")
	}, /* @__PURE__ */ react.createElement(_elementor_icons.GripVerticalIcon, { fontSize: "tiny" }));
	var StyledDivider = (0, _elementor_ui.styled)(_elementor_ui.Divider)`
	height: 0px;
	border: none;
	overflow: visible;

	&:after {
		--height: 2px;
		content: '';
		display: block;
		width: 100%;
		height: var( --height );
		margin-block: calc( -1 * var( --height ) / 2 );
		border-radius: ${({ theme }) => theme.spacing(.5)};
		background-color: ${({ theme }) => theme.palette.text.primary};
	}
`;

//#endregion
//#region packages/packages/libs/editor-controls/src/components/control-repeater/items/items-container.tsx
	var ItemsContainer = ({ isSortable = true, children }) => {
		const { items, setItems } = useRepeaterContext();
		const keys = items.map(({ key }) => key);
		if (!children) return null;
		const onChangeOrder = (newKeys) => {
			setItems(newKeys.map((key) => {
				const index = items.findIndex((item) => item.key === key);
				return items[index];
			}));
		};
		return /* @__PURE__ */ react.createElement(react.Fragment, null, /* @__PURE__ */ react.createElement(SortableProvider, {
			value: keys,
			onChange: onChangeOrder
		}, keys.map((key, index) => {
			const value = items[index].item;
			return /* @__PURE__ */ react.createElement(SortableItem, {
				id: key,
				key: `sortable-${key}`,
				disabled: !isSortable
			}, /* @__PURE__ */ react.createElement(ItemContext.Provider, { value: {
				index,
				value
			} }, children));
		})));
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/hooks/use-repeatable-control-context.ts
	var RepeatableControlContext = (0, react.createContext)(void 0);
	var useRepeatableControlContext = () => {
		const context = (0, react.useContext)(RepeatableControlContext);
		if (!context) throw new Error("useRepeatableControlContext must be used within RepeatableControl");
		return context;
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/components/repeater/repeater-tag.tsx
	var RepeaterTag = (0, react.forwardRef)((props, ref) => {
		return /* @__PURE__ */ react.createElement(_elementor_ui.UnstableTag, {
			ref,
			fullWidth: true,
			showActionsOnHover: true,
			variant: "outlined",
			sx: { minHeight: (theme) => theme.spacing(3.5) },
			...props
		});
	});

//#endregion
//#region packages/packages/libs/editor-controls/src/components/control-repeater/locations.ts
	var { Slot: RepeaterItemIconSlot, inject: injectIntoRepeaterItemIcon } = (0, _elementor_locations.createReplaceableLocation)();
	var { Slot: RepeaterItemLabelSlot, inject: injectIntoRepeaterItemLabel } = (0, _elementor_locations.createReplaceableLocation)();
	var { Slot: RepeaterItemActionsSlot, inject: injectIntoRepeaterItemActions } = (0, _elementor_locations.createLocation)();

//#endregion
//#region packages/packages/libs/editor-controls/src/components/control-repeater/items/item.tsx
	var Item = ({ Label, Icon, actions }) => {
		const { popoverState, setRowRef, openItemIndex, setOpenItemIndex, index = -1, value, isItemDisabled } = useRepeaterContext();
		const disableOpen = !!(0, react.useContext)(RepeatableControlContext)?.props?.readOnly;
		const triggerProps = (0, _elementor_ui.bindTrigger)(popoverState);
		const onClick = (ev) => {
			if (disableOpen || isItemDisabled(index)) return;
			triggerProps.onClick(ev);
			setOpenItemIndex(index);
		};
		const setRef = (ref) => {
			if (!ref || openItemIndex !== index || ref === popoverState.anchorEl) return;
			setRowRef(ref);
			popoverState.setAnchorEl(ref);
		};
		return /* @__PURE__ */ react.createElement(RepeaterTag, {
			ref: setRef,
			label: /* @__PURE__ */ react.createElement(RepeaterItemLabelSlot, { value }, /* @__PURE__ */ react.createElement(Label, { value })),
			"aria-label": (0, _wordpress_i18n.__)("Open item", "elementor"),
			...triggerProps,
			onClick,
			startIcon: /* @__PURE__ */ react.createElement(RepeaterItemIconSlot, { value }, /* @__PURE__ */ react.createElement(Icon, { value })),
			sx: {
				minHeight: (theme) => theme.spacing(3.5),
				...isItemDisabled(index) && { "[role=\"button\"]": { cursor: "not-allowed" } }
			},
			actions: /* @__PURE__ */ react.createElement(react.Fragment, null, /* @__PURE__ */ react.createElement(RepeaterItemActionsSlot, { index: index ?? -1 }), actions)
		});
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/components/control-repeater/control-repeater.tsx
	var ControlRepeater = ({ children, initial, propTypeUtil, isItemDisabled }) => {
		return /* @__PURE__ */ react.createElement(SectionContent, null, /* @__PURE__ */ react.createElement(RepeaterContextProvider, {
			initial,
			propTypeUtil,
			isItemDisabled
		}, children));
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/components/control-repeater/actions/disable-item-action.tsx
	var SIZE$9 = "tiny";
	var DisableItemAction = () => {
		const { items, updateItem, index = -1 } = useRepeaterContext();
		if (index === -1) return null;
		const propDisabled = items[index].item.disabled ?? false;
		const toggleLabel = propDisabled ? (0, _wordpress_i18n.__)("Show", "elementor") : (0, _wordpress_i18n.__)("Hide", "elementor");
		const onClick = () => {
			const self = structuredClone(items[index].item);
			self.disabled = !self.disabled;
			if (!self.disabled) delete self.disabled;
			updateItem(self, index);
		};
		return /* @__PURE__ */ react.createElement(_elementor_ui.Tooltip, {
			title: toggleLabel,
			placement: "top"
		}, /* @__PURE__ */ react.createElement(_elementor_ui.IconButton, {
			size: SIZE$9,
			onClick,
			"aria-label": toggleLabel
		}, propDisabled ? /* @__PURE__ */ react.createElement(_elementor_icons.EyeOffIcon, { fontSize: SIZE$9 }) : /* @__PURE__ */ react.createElement(_elementor_icons.EyeIcon, { fontSize: SIZE$9 })));
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/components/control-repeater/actions/duplicate-item-action.tsx
	var SIZE$8 = "tiny";
	var DuplicateItemAction = () => {
		const { items, addItem, index = -1, isItemDisabled } = useRepeaterContext();
		if (index === -1) return null;
		const duplicateLabel = (0, _wordpress_i18n.__)("Duplicate", "elementor");
		const item = items[index]?.item;
		const onClick = (ev) => {
			const newItem = structuredClone(item);
			addItem(ev, {
				item: newItem,
				index: index + 1
			});
		};
		return /* @__PURE__ */ react.createElement(_elementor_ui.Tooltip, {
			title: duplicateLabel,
			placement: "top"
		}, /* @__PURE__ */ react.createElement(_elementor_ui.IconButton, {
			size: SIZE$8,
			onClick,
			"aria-label": duplicateLabel,
			disabled: isItemDisabled(index)
		}, /* @__PURE__ */ react.createElement(_elementor_icons.CopyIcon, { fontSize: SIZE$8 })));
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/components/control-repeater/actions/remove-item-action.tsx
	var SIZE$7 = "tiny";
	var RemoveItemAction = () => {
		const { removeItem, index = -1 } = useRepeaterContext();
		if (index === -1) return null;
		const removeLabel = (0, _wordpress_i18n.__)("Remove", "elementor");
		const onClick = () => removeItem(index);
		return /* @__PURE__ */ react.createElement(_elementor_ui.Tooltip, {
			title: removeLabel,
			placement: "top"
		}, /* @__PURE__ */ react.createElement(_elementor_ui.IconButton, {
			size: SIZE$7,
			onClick,
			"aria-label": removeLabel
		}, /* @__PURE__ */ react.createElement(_elementor_icons.XIcon, { fontSize: SIZE$7 })));
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/components/repeater/repeater-popover.tsx
	var RepeaterPopover = ({ children, width, ...props }) => {
		return /* @__PURE__ */ react.createElement(_elementor_ui.Popover, {
			disablePortal: true,
			disableEnforceFocus: true,
			anchorOrigin: {
				vertical: "bottom",
				horizontal: "left"
			},
			slotProps: { paper: { sx: {
				marginBlockStart: .5,
				width,
				overflow: "visible"
			} } },
			...props
		}, children);
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/components/control-repeater/items/edit-item-popover.tsx
	var EditItemPopover = ({ children }) => {
		const { popoverState, openItemIndex, isOpen, rowRef, setOpenItemIndex, setRowRef } = useRepeaterContext();
		if (!isOpen || !rowRef) return null;
		const onClose = () => {
			setRowRef(null);
			popoverState.setAnchorEl(null);
			setOpenItemIndex(-1);
		};
		return /* @__PURE__ */ react.createElement(RepeaterPopover, {
			width: rowRef.offsetWidth,
			...(0, _elementor_ui.bindPopover)(popoverState),
			onClose
		}, /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: String(openItemIndex) }, /* @__PURE__ */ react.createElement(_elementor_ui.Box, null, children)));
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/components/popover-content.tsx
	var PopoverContent = ({ gap = 1.5, children, ...props }) => /* @__PURE__ */ react.createElement(_elementor_ui.Stack, {
		...props,
		gap
	}, children);

//#endregion
//#region packages/packages/libs/editor-controls/src/components/popover-grid-container.tsx
	var PopoverGridContainer = (0, react.forwardRef)(({ gap = 1.5, alignItems = "center", flexWrap = "nowrap", children }, ref) => /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
		container: true,
		gap,
		alignItems,
		flexWrap,
		ref
	}, children));

//#endregion
//#region packages/packages/libs/editor-controls/src/components/repeater/repeater-header.tsx
	var RepeaterHeader = (0, react.forwardRef)(({ label, children, adornment: Adornment = ControlAdornments }, ref) => {
		return /* @__PURE__ */ react.createElement(_elementor_ui.Stack, {
			direction: "row",
			alignItems: "center",
			gap: 1,
			sx: {
				marginInlineEnd: -.75,
				py: .25
			},
			ref
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Box, {
			display: "flex",
			alignItems: "center",
			gap: 1,
			sx: { flexGrow: 1 }
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Typography, {
			component: "label",
			variant: "caption",
			color: "text.secondary",
			sx: { lineHeight: 1 }
		}, label), /* @__PURE__ */ react.createElement(Adornment, null)), children);
	});

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/box-shadow-repeater-control.tsx
	var BoxShadowRepeaterControl = createControl(() => {
		const { propType, value, setValue, disabled } = useBoundProp(_elementor_editor_props.boxShadowPropTypeUtil);
		return /* @__PURE__ */ react.createElement(PropProvider, {
			propType,
			value,
			setValue,
			isDisabled: () => disabled
		}, /* @__PURE__ */ react.createElement(ControlRepeater, {
			initial: initialShadow,
			propTypeUtil: _elementor_editor_props.boxShadowPropTypeUtil
		}, /* @__PURE__ */ react.createElement(RepeaterHeader, { label: (0, _wordpress_i18n.__)("Box shadow", "elementor") }, /* @__PURE__ */ react.createElement(TooltipAddItemAction, {
			newItemIndex: 0,
			disabled,
			ariaLabel: "Box shadow"
		})), /* @__PURE__ */ react.createElement(ItemsContainer, null, /* @__PURE__ */ react.createElement(Item, {
			Icon: ItemIcon$2,
			Label: ItemLabel$3,
			actions: /* @__PURE__ */ react.createElement(react.Fragment, null, /* @__PURE__ */ react.createElement(DuplicateItemAction, null), /* @__PURE__ */ react.createElement(DisableItemAction, null), /* @__PURE__ */ react.createElement(RemoveItemAction, null))
		})), /* @__PURE__ */ react.createElement(EditItemPopover, null, /* @__PURE__ */ react.createElement(Content$1, null))));
	});
	var StyledUnstableColorIndicator$2 = (0, _elementor_ui.styled)(_elementor_ui.UnstableColorIndicator)(({ theme }) => ({
		height: "1rem",
		width: "1rem",
		borderRadius: `${theme.shape.borderRadius / 2}px`
	}));
	var ItemIcon$2 = /* @__PURE__ */ __name(({ value }) => /* @__PURE__ */ react.createElement(StyledUnstableColorIndicator$2, {
		size: "inherit",
		component: "span",
		value: value.value.color?.value
	}), "ItemIcon");
	var Content$1 = /* @__PURE__ */ __name(() => {
		const context = useBoundProp(_elementor_editor_props.shadowPropTypeUtil);
		const rowRef = [(0, react.useRef)(null), (0, react.useRef)(null)];
		const { rowRef: anchorEl } = useRepeaterContext();
		return /* @__PURE__ */ react.createElement(PropProvider, { ...context }, /* @__PURE__ */ react.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ react.createElement(PopoverGridContainer, null, /* @__PURE__ */ react.createElement(Control$2, {
			bind: "color",
			label: (0, _wordpress_i18n.__)("Color", "elementor")
		}, /* @__PURE__ */ react.createElement(ColorControl, { anchorEl })), /* @__PURE__ */ react.createElement(Control$2, {
			bind: "position",
			label: (0, _wordpress_i18n.__)("Position", "elementor"),
			sx: { overflow: "hidden" }
		}, /* @__PURE__ */ react.createElement(SelectControl, { options: [{
			label: (0, _wordpress_i18n.__)("Inset", "elementor"),
			value: "inset"
		}, {
			label: (0, _wordpress_i18n.__)("Outset", "elementor"),
			value: null
		}] }))), /* @__PURE__ */ react.createElement(PopoverGridContainer, { ref: rowRef[0] }, /* @__PURE__ */ react.createElement(Control$2, {
			bind: "hOffset",
			label: (0, _wordpress_i18n.__)("Horizontal", "elementor")
		}, /* @__PURE__ */ react.createElement(SizeControl, {
			anchorRef: rowRef[0],
			min: -Number.MAX_SAFE_INTEGER
		})), /* @__PURE__ */ react.createElement(Control$2, {
			bind: "vOffset",
			label: (0, _wordpress_i18n.__)("Vertical", "elementor")
		}, /* @__PURE__ */ react.createElement(SizeControl, {
			anchorRef: rowRef[0],
			min: -Number.MAX_SAFE_INTEGER
		}))), /* @__PURE__ */ react.createElement(PopoverGridContainer, { ref: rowRef[1] }, /* @__PURE__ */ react.createElement(Control$2, {
			bind: "blur",
			label: (0, _wordpress_i18n.__)("Blur", "elementor")
		}, /* @__PURE__ */ react.createElement(SizeControl, { anchorRef: rowRef[1] })), /* @__PURE__ */ react.createElement(Control$2, {
			bind: "spread",
			label: (0, _wordpress_i18n.__)("Spread", "elementor")
		}, /* @__PURE__ */ react.createElement(SizeControl, {
			anchorRef: rowRef[1],
			min: -Number.MAX_SAFE_INTEGER
		})))));
	}, "Content");
	var Control$2 = /* @__PURE__ */ __name(({ label, bind, children, sx }) => /* @__PURE__ */ react.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
		item: true,
		xs: 6,
		sx
	}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
		container: true,
		gap: .75,
		alignItems: "center"
	}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
		item: true,
		xs: 12
	}, /* @__PURE__ */ react.createElement(_elementor_ui.FormLabel, { size: "tiny" }, label)), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
		item: true,
		xs: 12
	}, children)))), "Control");
	var ItemLabel$3 = /* @__PURE__ */ __name(({ value }) => {
		const { position, hOffset, vOffset, blur, spread } = value.value;
		const { size: blurSize = "", unit: blurUnit = "" } = blur?.value || {};
		const { size: spreadSize = "", unit: spreadUnit = "" } = spread?.value || {};
		const { size: hOffsetSize = "unset", unit: hOffsetUnit = "" } = hOffset?.value || {};
		const { size: vOffsetSize = "unset", unit: vOffsetUnit = "" } = vOffset?.value || {};
		const positionLabel = position?.value || "outset";
		const sizes = [
			[hOffsetSize, hOffsetUnit],
			[vOffsetSize, vOffsetUnit],
			[blurSize, blurUnit],
			[spreadSize, spreadUnit]
		].map(([size, unit]) => {
			if (unit !== "custom") return size + unit;
			return !size ? "fx" : size;
		}).join(" ");
		return /* @__PURE__ */ react.createElement("span", { style: { textTransform: "capitalize" } }, positionLabel, ": ", sizes);
	}, "ItemLabel");
	var initialShadow = {
		$$type: "shadow",
		value: {
			hOffset: {
				$$type: "size",
				value: {
					unit: "px",
					size: 0
				}
			},
			vOffset: {
				$$type: "size",
				value: {
					unit: "px",
					size: 0
				}
			},
			blur: {
				$$type: "size",
				value: {
					unit: "px",
					size: 10
				}
			},
			spread: {
				$$type: "size",
				value: {
					unit: "px",
					size: 0
				}
			},
			color: {
				$$type: "color",
				value: "rgba(0, 0, 0, 1)"
			},
			position: null
		}
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/filter-control/configs.ts
	var FILTERS_BY_GROUP = {
		blur: { blur: {
			name: (0, _wordpress_i18n.__)("Blur", "elementor"),
			valueName: (0, _wordpress_i18n.__)("Radius", "elementor")
		} },
		intensity: {
			brightness: { name: (0, _wordpress_i18n.__)("Brightness", "elementor") },
			contrast: { name: (0, _wordpress_i18n.__)("Contrast", "elementor") },
			saturate: { name: (0, _wordpress_i18n.__)("Saturate", "elementor") }
		},
		"hue-rotate": { "hue-rotate": {
			name: (0, _wordpress_i18n.__)("Hue Rotate", "elementor"),
			valueName: (0, _wordpress_i18n.__)("Angle", "elementor")
		} },
		"color-tone": {
			grayscale: { name: (0, _wordpress_i18n.__)("Grayscale", "elementor") },
			invert: { name: (0, _wordpress_i18n.__)("Invert", "elementor") },
			sepia: { name: (0, _wordpress_i18n.__)("Sepia", "elementor") }
		},
		"drop-shadow": { "drop-shadow": {
			name: (0, _wordpress_i18n.__)("Drop shadow", "elementor"),
			valueName: (0, _wordpress_i18n.__)("Drop-shadow", "elementor")
		} }
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/filter-control/utils.ts
	var AMOUNT_VALUE_NAME = (0, _wordpress_i18n.__)("Amount", "elementor");
	var DEFAULT_FACTORIES = { "drop-shadow": (propType) => buildDropShadowDefault(propType) };
	function buildFilterConfig(cssFilterPropType) {
		function createEntry(filterFunctionGroup, filterFunction, { name, valueName }) {
			const propType = extractPropType(cssFilterPropType, filterFunctionGroup);
			const defaultValue = createDefaultValue({
				filterFunction,
				filterFunctionGroup,
				value: DEFAULT_FACTORIES[filterFunction]?.(propType) ?? buildSizeDefault(propType)
			});
			return [filterFunction, {
				name,
				valueName: valueName ?? AMOUNT_VALUE_NAME,
				defaultValue,
				filterFunctionGroup
			}];
		}
		const entries = Object.entries(FILTERS_BY_GROUP).flatMap(([filterFunctionGroup, group]) => Object.entries(group).map(([filterFunction, meta]) => createEntry(filterFunctionGroup, filterFunction, meta)));
		return Object.fromEntries(entries);
	}
	function createDefaultValue({ filterFunction, filterFunctionGroup, value }) {
		return {
			$$type: "css-filter-func",
			value: {
				func: {
					$$type: "string",
					value: filterFunction
				},
				args: {
					$$type: filterFunctionGroup,
					value
				}
			}
		};
	}
	function buildSizeDefault(propType) {
		return { size: (propType?.shape?.size)?.default };
	}
	function buildDropShadowDefault(propType) {
		const dropShadowPropType = propType.shape;
		return {
			blur: dropShadowPropType?.blur?.default,
			xAxis: dropShadowPropType?.xAxis?.default,
			yAxis: dropShadowPropType?.yAxis?.default,
			color: dropShadowPropType?.color?.default ?? (dropShadowPropType?.color).prop_types.color.default
		};
	}
	function extractPropType(propType, filterFunctionGroup) {
		return propType.shape?.args?.prop_types[filterFunctionGroup];
	}

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/filter-control/context/filter-config-context.tsx
	var FilterConfigContext = (0, react.createContext)(null);
	function FilterConfigProvider({ children }) {
		const propContext = useBoundProp(_elementor_editor_props.cssFilterFunctionPropUtil);
		const contextValue = (0, react.useMemo)(() => {
			const config = buildFilterConfig(propContext.propType.item_prop_type);
			return {
				config,
				filterOptions: Object.entries(config).map(([key, conf]) => ({
					value: key,
					label: conf.name
				})),
				getFilterFunctionConfig: (filterFunction) => config[filterFunction],
				getInitialValue: () => config.blur.defaultValue
			};
		}, [propContext.propType]);
		return /* @__PURE__ */ react.createElement(FilterConfigContext.Provider, { value: contextValue }, children);
	}
	function useFilterConfig() {
		const context = (0, react.useContext)(FilterConfigContext);
		if (!context) throw new Error("useFilterConfig must be used within FilterConfigProvider");
		return context;
	}

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/filter-control/drop-shadow/drop-shadow-item-content.tsx
	var items = [
		{
			bind: "xAxis",
			label: (0, _wordpress_i18n.__)("X-axis", "elementor"),
			rowIndex: 0
		},
		{
			bind: "yAxis",
			label: (0, _wordpress_i18n.__)("Y-axis", "elementor"),
			rowIndex: 0
		},
		{
			bind: "blur",
			label: (0, _wordpress_i18n.__)("Blur", "elementor"),
			rowIndex: 1
		},
		{
			bind: "color",
			label: (0, _wordpress_i18n.__)("Color", "elementor"),
			rowIndex: 1
		}
	];
	var DropShadowItemContent = ({ anchorEl }) => {
		const context = useBoundProp(_elementor_editor_props.dropShadowFilterPropTypeUtil);
		const rowRefs = [(0, react.useRef)(null), (0, react.useRef)(null)];
		return /* @__PURE__ */ react.createElement(PropProvider, { ...context }, items.map((item) => /* @__PURE__ */ react.createElement(PopoverGridContainer, {
			key: item.bind,
			ref: rowRefs[item.rowIndex] ?? null
		}, /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: item.bind }, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6
		}, /* @__PURE__ */ react.createElement(ControlFormLabel, null, item.label)), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6
		}, item.bind === "color" ? /* @__PURE__ */ react.createElement(ColorControl, { anchorEl }) : /* @__PURE__ */ react.createElement(SizeControl, {
			anchorRef: rowRefs[item.rowIndex],
			enablePropTypeUnits: true,
			min: item.bind === "blur" ? 0 : -Number.MAX_SAFE_INTEGER,
			defaultUnit: "px"
		}))))));
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/filter-control/single-size/single-size-item-content.tsx
	var propTypeMap = {
		blur: _elementor_editor_props.blurFilterPropTypeUtil,
		intensity: _elementor_editor_props.intensityFilterPropTypeUtil,
		"hue-rotate": _elementor_editor_props.hueRotateFilterPropTypeUtil,
		"color-tone": _elementor_editor_props.colorToneFilterPropTypeUtil
	};
	var SingleSizeItemContent = ({ filterFunc }) => {
		const rowRef = (0, react.useRef)(null);
		const { getFilterFunctionConfig } = useFilterConfig();
		const { valueName, filterFunctionGroup } = getFilterFunctionConfig(filterFunc);
		const context = useBoundProp(propTypeMap[filterFunctionGroup]);
		return /* @__PURE__ */ react.createElement(PropProvider, { ...context }, /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: filterFunctionGroup }, /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ react.createElement(PopoverGridContainer, { ref: rowRef }, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6
		}, /* @__PURE__ */ react.createElement(ControlFormLabel, null, valueName)), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6
		}, /* @__PURE__ */ react.createElement(SizeControl, {
			anchorRef: rowRef,
			enablePropTypeUnits: true
		}))))));
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/filter-control/filter-content.tsx
	var FilterContent = () => {
		const propContext = useBoundProp(_elementor_editor_props.cssFilterFunctionPropUtil);
		const { filterOptions, getFilterFunctionConfig } = useFilterConfig();
		const handleValueChange = (value, _, meta) => {
			let newValue = structuredClone(value);
			const funcConfig = getFilterFunctionConfig(newValue?.func.value);
			if (meta?.bind === "func") newValue = funcConfig.defaultValue.value;
			if (!newValue.args) return;
			propContext.setValue(newValue);
		};
		return /* @__PURE__ */ react.createElement(PropProvider, {
			...propContext,
			setValue: handleValueChange
		}, /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "css-filter-func" }, /* @__PURE__ */ react.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ react.createElement(PopoverGridContainer, null, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6
		}, /* @__PURE__ */ react.createElement(ControlFormLabel, null, (0, _wordpress_i18n.__)("Filter", "elementor"))), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6
		}, /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "func" }, /* @__PURE__ */ react.createElement(SelectControl, { options: filterOptions })))), /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "args" }, /* @__PURE__ */ react.createElement(FilterValueContent, null)))));
	};
	var FilterValueContent = () => {
		const { openItemIndex, items } = useRepeaterContext();
		const filterFunc = items[openItemIndex].item.value.func.value;
		if (filterFunc === "drop-shadow") return /* @__PURE__ */ react.createElement(DropShadowItemContent, null);
		return /* @__PURE__ */ react.createElement(SingleSizeItemContent, { filterFunc });
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/filter-control/filter-icon.tsx
	var FilterIcon = ({ value }) => {
		if (value.value.func.value !== "drop-shadow") return null;
		return /* @__PURE__ */ react.createElement(StyledUnstableColorIndicator$1, {
			size: "inherit",
			component: "span",
			value: value.value.args.value?.color.value
		});
	};
	var StyledUnstableColorIndicator$1 = (0, _elementor_ui.styled)(_elementor_ui.UnstableColorIndicator)(({ theme }) => ({ borderRadius: `${theme.shape.borderRadius / 2}px` }));

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/filter-control/drop-shadow/drop-shadow-item-label.tsx
	var DropShadowItemLabel = ({ value }) => {
		const values = value.value.args.value;
		const labels = [
			"xAxis",
			"yAxis",
			"blur"
		].map((key) => values[key]?.value?.unit !== "custom" ? `${values[key]?.value?.size ?? 0}${values[key]?.value?.unit ?? "px"}` : values[key]?.value?.size || "fx");
		return /* @__PURE__ */ react.createElement(_elementor_ui.Box, { component: "span" }, /* @__PURE__ */ react.createElement(_elementor_ui.Box, {
			component: "span",
			style: { textTransform: "capitalize" }
		}, (0, _wordpress_i18n.__)("Drop shadow:", "elementor")), ` ${labels.join(" ")}`);
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/filter-control/single-size/single-size-item-label.tsx
	var SingleSizeItemLabel = ({ value }) => {
		const { func, args } = value.value;
		const { getFilterFunctionConfig } = useFilterConfig();
		const { defaultValue } = getFilterFunctionConfig(func.value ?? "");
		const defaultUnit = defaultValue.value.args.value?.size?.value?.unit ?? lengthUnits[0];
		const { unit, size } = args.value.size?.value ?? {
			unit: defaultUnit,
			size: 0
		};
		const label = /* @__PURE__ */ react.createElement(_elementor_ui.Box, {
			component: "span",
			style: { textTransform: "capitalize" }
		}, func.value ?? "", ":");
		return /* @__PURE__ */ react.createElement(_elementor_ui.Box, { component: "span" }, label, " " + (unit !== "custom" ? `${size ?? 0}${unit ?? defaultUnit}` : size || "fx"));
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/filter-control/filter-label.tsx
	var FilterLabel = ({ value }) => {
		if (value.value.func.value === "drop-shadow") return /* @__PURE__ */ react.createElement(DropShadowItemLabel, { value });
		return /* @__PURE__ */ react.createElement(SingleSizeItemLabel, { value });
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/filter-control/filter-repeater-control.tsx
	var FILTER_CONFIG = {
		filter: {
			propTypeUtil: _elementor_editor_props.filterPropTypeUtil,
			label: (0, _wordpress_i18n.__)("Filters", "elementor")
		},
		"backdrop-filter": {
			propTypeUtil: _elementor_editor_props.backdropFilterPropTypeUtil,
			label: (0, _wordpress_i18n.__)("Backdrop filters", "elementor")
		}
	};
	var FilterRepeaterControl = createControl(({ filterPropName = "filter" }) => {
		const { propTypeUtil, label } = ensureFilterConfig(filterPropName);
		const { propType, value: filterValues, setValue } = useBoundProp(propTypeUtil);
		return /* @__PURE__ */ react.createElement(FilterConfigProvider, null, /* @__PURE__ */ react.createElement(PropProvider, {
			propType,
			value: filterValues,
			setValue
		}, /* @__PURE__ */ react.createElement(Repeater$2, {
			propTypeUtil,
			label,
			filterPropName
		})));
	});
	var Repeater$2 = /* @__PURE__ */ __name(({ propTypeUtil, label, filterPropName }) => {
		const { getInitialValue } = useFilterConfig();
		return /* @__PURE__ */ react.createElement(ControlRepeater, {
			initial: getInitialValue(),
			propTypeUtil
		}, /* @__PURE__ */ react.createElement(RepeaterHeader, { label }, /* @__PURE__ */ react.createElement(TooltipAddItemAction, {
			newItemIndex: 0,
			ariaLabel: filterPropName === "backdrop-filter" ? "backdrop filter" : "filter"
		})), /* @__PURE__ */ react.createElement(ItemsContainer, null, /* @__PURE__ */ react.createElement(Item, {
			Label: FilterLabel,
			Icon: FilterIcon,
			actions: /* @__PURE__ */ react.createElement(react.Fragment, null, /* @__PURE__ */ react.createElement(DuplicateItemAction, null), /* @__PURE__ */ react.createElement(DisableItemAction, null), /* @__PURE__ */ react.createElement(RemoveItemAction, null))
		})), /* @__PURE__ */ react.createElement(EditItemPopover, null, /* @__PURE__ */ react.createElement(FilterContent, null)));
	}, "Repeater");
	function ensureFilterConfig(name) {
		if (name && name in FILTER_CONFIG) return FILTER_CONFIG[name];
		return FILTER_CONFIG.filter;
	}

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/select-control-wrapper.tsx
	var getOffCanvasElements = () => {
		const extendedWindow = window;
		const documentId = extendedWindow.elementor.config.document.id;
		const offCanvasElements = extendedWindow.elementor.$previewContents[0].querySelectorAll(`[data-elementor-id="${documentId}"] .elementor-widget-off-canvas.elementor-element-edit-mode`);
		return Array.from(offCanvasElements).map((offCanvasElement) => {
			return {
				label: offCanvasElement.querySelector(".e-off-canvas")?.getAttribute("aria-label") ?? "",
				value: offCanvasElement.dataset.id
			};
		});
	};
	var getFormElements = () => {
		const extendedWindow = window;
		const documentId = extendedWindow.elementor.config.document.id;
		const selectors = [
			`[data-elementor-id="${documentId}"] input[id]:not([type="hidden"]):not([type="reset"]):not([type="button"])`,
			`[data-elementor-id="${documentId}"] select[id]`,
			`[data-elementor-id="${documentId}"] textarea[id]`
		];
		const formElements = extendedWindow.elementor.$previewContents[0].querySelectorAll(selectors.join(", "));
		return Array.from(formElements).map((formElement) => {
			const tagName = formElement.tagName.toLowerCase();
			return {
				label: `${formElement.id} (${tagName === "input" ? formElement.getAttribute("type") : tagName})`,
				value: formElement.id
			};
		});
	};
	var collectionMethods = {
		"off-canvas": getOffCanvasElements,
		"form-elements": getFormElements
	};
	var useDynamicOptions = (collectionId, initialOptions) => {
		const [options, setOptions] = (0, react.useState)(initialOptions ?? []);
		(0, react.useEffect)(() => {
			if (!collectionId || !collectionMethods[collectionId]) {
				setOptions(initialOptions ?? []);
				return;
			}
			setOptions(collectionMethods[collectionId]());
		}, [collectionId, initialOptions]);
		return options;
	};
	var SelectControlWrapper = createControl(({ collectionId, options, ...props }) => {
		const actualOptions = useDynamicOptions(collectionId, options);
		return /* @__PURE__ */ react.createElement(SelectControl, {
			options: actualOptions,
			...props
		});
	});

//#endregion
//#region packages/packages/libs/editor-controls/src/components/chips-list.tsx
	var CHIP_SIZE = "tiny";
	function ChipsList({ getLabel, getTagProps, values }) {
		return /* @__PURE__ */ react.createElement(react.Fragment, null, values.map((option, index) => {
			const { key, ...tagProps } = getTagProps({ index });
			return /* @__PURE__ */ react.createElement(_elementor_ui.Chip, {
				key,
				label: getLabel(option),
				size: CHIP_SIZE,
				...tagProps
			});
		}));
	}

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/chips-control.tsx
	var SIZE$6 = "tiny";
	var toChipsOption = (val, options) => options.find((opt) => opt.value === val) ?? {
		label: val,
		value: val
	};
	var ChipsControl = createControl(({ options, freeChips }) => {
		const { value, setValue, disabled } = useBoundProp(_elementor_editor_props.stringArrayPropTypeUtil);
		const selectedOptions = (value || []).map((item) => _elementor_editor_props.stringPropTypeUtil.extract(item)).filter((val) => val !== null).map((val) => toChipsOption(val, options));
		const handleChange = (_, newValue) => {
			setValue(newValue.map((option) => _elementor_editor_props.stringPropTypeUtil.create(typeof option === "string" ? option : option.value)));
		};
		return /* @__PURE__ */ react.createElement(ControlActions, null, /* @__PURE__ */ react.createElement(_elementor_ui.Autocomplete, {
			fullWidth: true,
			multiple: true,
			freeSolo: freeChips,
			size: SIZE$6,
			disabled,
			value: selectedOptions,
			filterSelectedOptions: true,
			onChange: handleChange,
			options,
			getOptionLabel: (option) => typeof option === "string" ? option : option.label,
			isOptionEqualToValue: (option, val) => option.value === val.value,
			renderInput: (params) => /* @__PURE__ */ react.createElement(_elementor_ui.TextField, { ...params }),
			renderTags: (tagValues, getTagProps) => /* @__PURE__ */ react.createElement(ChipsList, {
				getLabel: (option) => typeof option === "string" ? option : option.label,
				getTagProps,
				values: tagValues
			})
		}));
	});

//#endregion
//#region packages/packages/libs/editor-controls/src/components/conditional-tooltip.tsx
	var ConditionalTooltip = ({ showTooltip, children, label }) => {
		return showTooltip && label ? /* @__PURE__ */ react.createElement(_elementor_ui.Tooltip, {
			title: label,
			disableFocusListener: true,
			placement: "top"
		}, children) : children;
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/components/control-toggle-button-group.tsx
	var StyledToggleButtonGroup = (0, _elementor_ui.styled)(_elementor_ui.ToggleButtonGroup)`
	${({ justify }) => `justify-content: ${justify};`}
	button:not( :last-of-type ) {
		border-start-end-radius: 0;
		border-end-end-radius: 0;
	}
	button:not( :first-of-type ) {
		border-start-start-radius: 0;
		border-end-start-radius: 0;
	}
	button:last-of-type {
		border-start-end-radius: 8px;
		border-end-end-radius: 8px;
	}
`;
	var StyledToggleButton = (0, _elementor_ui.styled)(_elementor_ui.ToggleButton, { shouldForwardProp: (prop) => prop !== "isPlaceholder" })`
	${({ theme, isPlaceholder }) => isPlaceholder && `
		color: ${theme.palette.text.tertiary};
		background-color: ${theme.palette.mode === "dark" ? "rgba(255,255,255,0.04)" : "rgba(0,0,0,0.02)"};

		&:hover {
			background-color: ${theme.palette.mode === "dark" ? "rgba(255,255,255,0.08)" : "rgba(0,0,0,0.04)"};
		}
	`}
`;
	var ToggleButtonGroupUi = react.forwardRef(({ justify = "end", size = "tiny", value, onChange, items, maxItems, exclusive = false, fullWidth = false, disabled, placeholder }, ref) => {
		const shouldSliceItems = exclusive && maxItems !== void 0 && items.length > maxItems;
		const menuItems = shouldSliceItems ? items.slice(maxItems - 1) : [];
		const fixedItems = shouldSliceItems ? items.slice(0, maxItems - 1) : items;
		const isRtl = "rtl" === (0, _elementor_ui.useTheme)().direction;
		const handleChange = (_, newValue) => {
			onChange(newValue);
		};
		const getGridTemplateColumns = (0, react.useMemo)(() => {
			const isOffLimits = menuItems?.length;
			const itemsCount = isOffLimits ? fixedItems.length + 1 : fixedItems.length;
			const templateColumnsSuffix = isOffLimits ? "auto" : "";
			if (fullWidth) return `repeat(${itemsCount}, 1fr) ${templateColumnsSuffix}`;
			return `repeat(${itemsCount}, minmax(0, 25%)) ${templateColumnsSuffix}`;
		}, [
			menuItems?.length,
			fixedItems.length,
			fullWidth
		]);
		const shouldShowExclusivePlaceholder = exclusive && (value === null || value === void 0 || value === "");
		const nonExclusiveSelectedValues = !exclusive && Array.isArray(value) ? value.map((v) => typeof v === "string" ? v : "").join(" ").trim().split(/\s+/).filter(Boolean) : [];
		const shouldShowNonExclusivePlaceholder = !exclusive && nonExclusiveSelectedValues.length === 0;
		const getPlaceholderArray = (placeholderValue) => {
			if (Array.isArray(placeholderValue)) return placeholderValue.flatMap((p) => {
				if (typeof p === "string") return p.trim().split(/\s+/).filter(Boolean);
				return [];
			});
			if (typeof placeholderValue === "string") return placeholderValue.trim().split(/\s+/).filter(Boolean);
			return [];
		};
		const placeholderArray = getPlaceholderArray(placeholder);
		return /* @__PURE__ */ react.createElement(StyledToggleButtonGroup, {
			ref,
			justify,
			value,
			onChange: handleChange,
			exclusive,
			disabled,
			sx: {
				direction: isRtl ? "rtl /* @noflip */" : "ltr /* @noflip */",
				display: "grid",
				gridTemplateColumns: getGridTemplateColumns,
				width: `100%`
			}
		}, fixedItems.map(({ label, value: buttonValue, renderContent: Content, showTooltip, disabled: optionDisabled = false }) => {
			const isPlaceholder = placeholderArray.length > 0 && placeholderArray.includes(buttonValue) && (shouldShowExclusivePlaceholder || shouldShowNonExclusivePlaceholder);
			return /* @__PURE__ */ react.createElement(ConditionalTooltip, {
				key: buttonValue,
				label,
				showTooltip: showTooltip || false
			}, /* @__PURE__ */ react.createElement(StyledToggleButton, {
				value: buttonValue,
				"aria-label": label,
				size,
				fullWidth,
				isPlaceholder,
				disabled: optionDisabled
			}, /* @__PURE__ */ react.createElement(Content, { size })));
		}), menuItems.length && exclusive && /* @__PURE__ */ react.createElement(SplitButtonGroup, {
			size,
			value: value || null,
			onChange,
			items: menuItems,
			fullWidth
		}));
	});
	var ControlToggleButtonGroup = (props) => {
		return /* @__PURE__ */ react.createElement(ControlActions, null, /* @__PURE__ */ react.createElement(ToggleButtonGroupUi, { ...props }));
	};
	var SplitButtonGroup = ({ size = "tiny", onChange, items, fullWidth, value }) => {
		const previewButton = usePreviewButton(items, value);
		const [isMenuOpen, setIsMenuOpen] = (0, react.useState)(false);
		const menuButtonRef = (0, react.useRef)(null);
		const onMenuToggle = (ev) => {
			setIsMenuOpen((prev) => !prev);
			ev.preventDefault();
		};
		const onMenuItemClick = (newValue) => {
			setIsMenuOpen(false);
			onToggleItem(newValue);
		};
		const onToggleItem = (newValue) => {
			onChange(newValue === value ? null : newValue);
		};
		return /* @__PURE__ */ react.createElement(react.Fragment, null, /* @__PURE__ */ react.createElement(_elementor_ui.ToggleButton, {
			value: previewButton.value,
			"aria-label": previewButton.label,
			size,
			fullWidth,
			onClick: (ev) => {
				ev.preventDefault();
				onMenuItemClick(previewButton.value);
			}
		}, previewButton.renderContent({ size })), /* @__PURE__ */ react.createElement(_elementor_ui.ToggleButton, {
			size,
			"aria-expanded": isMenuOpen ? "true" : void 0,
			"aria-haspopup": "menu",
			"aria-pressed": void 0,
			onClick: onMenuToggle,
			ref: menuButtonRef,
			value: "__chevron-icon-button__"
		}, /* @__PURE__ */ react.createElement(_elementor_icons.ChevronDownIcon, { fontSize: size })), /* @__PURE__ */ react.createElement(_elementor_ui.Menu, {
			open: isMenuOpen,
			onClose: () => setIsMenuOpen(false),
			anchorEl: menuButtonRef.current,
			anchorOrigin: {
				vertical: "bottom",
				horizontal: "right"
			},
			transformOrigin: {
				vertical: "top",
				horizontal: "right"
			},
			sx: { mt: .5 }
		}, items.filter((item) => item.value !== previewButton.value).map(({ label, value: buttonValue }) => /* @__PURE__ */ react.createElement(_elementor_ui.MenuItem, {
			key: buttonValue,
			selected: buttonValue === value,
			onClick: () => onMenuItemClick(buttonValue)
		}, /* @__PURE__ */ react.createElement(_elementor_ui.ListItemText, null, /* @__PURE__ */ react.createElement(_elementor_ui.Typography, { sx: { fontSize: "14px" } }, label))))));
	};
	var usePreviewButton = (items, value) => {
		const [previewButton, setPreviewButton] = (0, react.useState)(items.find((item) => item.value === value) ?? items[0]);
		(0, react.useEffect)(() => {
			const selectedButton = items.find((item) => item.value === value);
			if (selectedButton) setPreviewButton(selectedButton);
		}, [items, value]);
		return previewButton;
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/utils/convert-toggle-options-to-atomic.tsx
	var convertToggleOptionsToAtomic = (options) => {
		return options.map((option) => {
			const IconComponent = _elementor_icons[option.icon];
			return {
				value: option.value,
				label: option.label,
				renderContent: ({ size }) => {
					if (IconComponent) return /* @__PURE__ */ react.createElement(IconComponent, { fontSize: size });
					return option.label;
				},
				showTooltip: option.showTooltip,
				exclusive: option.exclusive
			};
		});
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/toggle-control.tsx
	var ToggleControl = createControl(({ options, fullWidth = false, size = "tiny", exclusive = true, maxItems, convertOptions = false, allowEmpty = false }) => {
		const { value, setValue, placeholder, disabled } = useBoundProp(_elementor_editor_props.stringPropTypeUtil);
		const processedOptions = convertOptions ? convertToggleOptionsToAtomic(options) : options;
		const exclusiveValues = processedOptions.filter((option) => option.exclusive).map((option) => option.value);
		const handleNonExclusiveToggle = (selectedValues) => {
			const newSelectedValue = selectedValues[selectedValues.length - 1];
			const updatedValues = exclusiveValues.includes(newSelectedValue) ? [newSelectedValue] : selectedValues?.filter((val) => !exclusiveValues.includes(val));
			setValue(updatedValues?.join(" ") || null);
		};
		const toggleButtonGroupProps = {
			items: processedOptions,
			maxItems,
			fullWidth,
			size,
			placeholder
		};
		const handleExclusiveToggle = (selectedValue) => {
			if (allowEmpty && !selectedValue) {
				setValue("");
				return;
			}
			setValue(selectedValue);
		};
		return exclusive ? /* @__PURE__ */ react.createElement(ControlToggleButtonGroup, {
			...toggleButtonGroupProps,
			value: allowEmpty ? value || null : value ?? null,
			onChange: handleExclusiveToggle,
			disabled,
			exclusive: true
		}) : /* @__PURE__ */ react.createElement(ControlToggleButtonGroup, {
			...toggleButtonGroupProps,
			value: value?.split(" ") ?? [],
			onChange: handleNonExclusiveToggle,
			disabled,
			exclusive: false
		});
	});

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/number-control.tsx
	var isEmptyOrNaN = (value) => value === null || value === void 0 || value === "" || Number.isNaN(Number(value));
	var renderSuffix = (propType) => {
		if (propType.meta?.suffix) return /* @__PURE__ */ react.createElement(_elementor_ui.InputAdornment, { position: "end" }, /* @__PURE__ */ react.createElement(_elementor_ui.Typography, {
			variant: "caption",
			color: "text.secondary"
		}, propType.meta.suffix));
		return /* @__PURE__ */ react.createElement(react.Fragment, null);
	};
	var NumberControl = createControl(({ placeholder: labelPlaceholder, max = Number.MAX_SAFE_INTEGER, min = -Number.MAX_SAFE_INTEGER, step = 1, shouldForceInt = false, startIcon, disabled: inputDisabled }) => {
		const { value, setValue, placeholder, disabled, restoreValue, propType } = useBoundProp(_elementor_editor_props.numberPropTypeUtil);
		const handleChange = (event) => {
			const { value: eventValue, validity: { valid: isInputValid } } = event.target;
			let updatedValue;
			if (isEmptyOrNaN(eventValue)) updatedValue = null;
			else {
				const formattedValue = shouldForceInt ? +parseInt(eventValue) : Number(eventValue);
				updatedValue = Math.min(Math.max(formattedValue, min ?? Number.MIN_SAFE_INTEGER), max ?? Number.MAX_SAFE_INTEGER);
			}
			setValue(updatedValue, void 0, { validation: () => isInputValid });
		};
		return /* @__PURE__ */ react.createElement(ControlActions, null, /* @__PURE__ */ react.createElement(NumberInput, {
			size: "tiny",
			type: "number",
			fullWidth: true,
			disabled: inputDisabled ?? disabled,
			value: isEmptyOrNaN(value) ? "" : value,
			onInput: handleChange,
			onBlur: restoreValue,
			placeholder: labelPlaceholder ?? (isEmptyOrNaN(placeholder) ? "" : String(placeholder)),
			inputProps: {
				step,
				min
			},
			InputProps: {
				startAdornment: startIcon ? /* @__PURE__ */ react.createElement(_elementor_ui.InputAdornment, {
					position: "start",
					disabled: inputDisabled ?? disabled
				}, startIcon) : void 0,
				endAdornment: renderSuffix(propType)
			}
		}));
	});

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/equal-unequal-sizes-control.tsx
	function EqualUnequalSizesControl({ label, icon, tooltipLabel, items, multiSizePropTypeUtil }) {
		const popupState = (0, _elementor_ui.usePopupState)({
			variant: "popover",
			popupId: (0, react.useId)()
		});
		const rowRefs = [(0, react.useRef)(null), (0, react.useRef)(null)];
		const { propType: multiSizePropType, disabled: multiSizeDisabled } = useBoundProp(multiSizePropTypeUtil);
		const { value: masterValue, setValue: setMasterValue, placeholder: masterPlaceholder } = useBoundProp();
		const getMultiSizeValues = (sourceValue) => {
			if (multiSizePropTypeUtil.isValid(sourceValue)) return sourceValue.value;
			const propValue = {};
			items.forEach((item) => {
				propValue[item.bind] = sourceValue;
			});
			return multiSizePropTypeUtil.create(propValue)?.value;
		};
		const isShowingGeneralIndicator = !popupState.isOpen;
		const derivedValue = getMultiSizeValues(masterValue);
		const derivedPlaceholder = getMultiSizeValues(masterPlaceholder);
		const isEqualValues = (values) => {
			if (!values) return true;
			const multiSizeValue = multiSizePropTypeUtil.create(values);
			const propValue = {};
			items.forEach((item) => {
				propValue[item.bind] = multiSizeValue?.value?.[item.bind] ?? null;
			});
			const allValues = Object.values(propValue).map((value) => JSON.stringify(value));
			return allValues.every((value) => value === allValues[0]);
		};
		const isMixedPlaceholder = !masterValue && !isEqualValues(derivedPlaceholder);
		const isMixed = isMixedPlaceholder || !isEqualValues(derivedValue);
		const applyMultiSizeValue = (newValue) => {
			if (!isEqualValues(newValue)) {
				setMasterValue(multiSizePropTypeUtil.create(newValue));
				return;
			}
			setMasterValue(Object.values(newValue)?.pop() ?? null);
		};
		return /* @__PURE__ */ react.createElement(react.Fragment, null, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			container: true,
			gap: 2,
			alignItems: "center",
			flexWrap: "nowrap",
			ref: rowRefs[0]
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6
		}, !isShowingGeneralIndicator ? /* @__PURE__ */ react.createElement(ControlFormLabel, null, label) : /* @__PURE__ */ react.createElement(ControlLabel, null, label)), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Stack, {
			direction: "row",
			alignItems: "center",
			gap: 1
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Box, { flexGrow: 1 }, /* @__PURE__ */ react.createElement(SizeControl, {
			placeholder: isMixed ? (0, _wordpress_i18n.__)("Mixed", "elementor") : void 0,
			enablePropTypeUnits: !isMixed || !isMixedPlaceholder,
			anchorRef: rowRefs[0]
		})), /* @__PURE__ */ react.createElement(_elementor_ui.Tooltip, {
			title: tooltipLabel,
			placement: "top"
		}, /* @__PURE__ */ react.createElement(StyledToggleButton, {
			size: "tiny",
			value: "check",
			sx: { marginLeft: "auto" },
			...(0, _elementor_ui.bindToggle)(popupState),
			selected: popupState.isOpen,
			isPlaceholder: isMixedPlaceholder,
			"aria-label": tooltipLabel
		}, icon))))), /* @__PURE__ */ react.createElement(_elementor_ui.Popover, {
			disablePortal: true,
			disableScrollLock: true,
			anchorOrigin: {
				vertical: "bottom",
				horizontal: "right"
			},
			transformOrigin: {
				vertical: "top",
				horizontal: "right"
			},
			...(0, _elementor_ui.bindPopover)(popupState),
			slotProps: { paper: { sx: {
				mt: .5,
				width: rowRefs[0].current?.getBoundingClientRect().width
			} } }
		}, /* @__PURE__ */ react.createElement(PropProvider, {
			propType: multiSizePropType,
			value: derivedValue,
			placeholder: derivedPlaceholder,
			setValue: applyMultiSizeValue,
			isDisabled: () => multiSizeDisabled
		}, /* @__PURE__ */ react.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ react.createElement(PopoverGridContainer, { ref: rowRefs[1] }, /* @__PURE__ */ react.createElement(MultiSizeValueControl, {
			item: items[0],
			rowRef: rowRefs[1]
		}), /* @__PURE__ */ react.createElement(MultiSizeValueControl, {
			item: items[1],
			rowRef: rowRefs[1]
		})), /* @__PURE__ */ react.createElement(PopoverGridContainer, { ref: rowRefs[2] }, /* @__PURE__ */ react.createElement(MultiSizeValueControl, {
			item: items[2],
			rowRef: rowRefs[2]
		}), /* @__PURE__ */ react.createElement(MultiSizeValueControl, {
			item: items[3],
			rowRef: rowRefs[2]
		}))))));
	}
	var MultiSizeValueControl = ({ item, rowRef }) => {
		const { bind, label, icon, ariaLabel } = item;
		return /* @__PURE__ */ react.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			container: true,
			gap: .75,
			alignItems: "center"
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 12
		}, /* @__PURE__ */ react.createElement(ControlLabel, null, label)), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 12
		}, /* @__PURE__ */ react.createElement(SizeControl, {
			startIcon: icon,
			ariaLabel,
			anchorRef: rowRef
		})))));
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/size-control/sync/get-units.ts
	var getLengthUnits = () => {
		return window.elementor?.config?.size_units?.length ?? [];
	};
	var getAngleUnits = () => {
		return window.elementor?.config?.size_units?.angle ?? [];
	};
	var getTimeUnits = () => {
		return window.elementor?.config?.size_units?.time ?? [];
	};
	var getExtendedUnits = () => {
		return window.elementor?.config?.size_units?.extended_units ?? [];
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/size-control/utils/is-extended-unit.ts
	var isExtendedUnit = (unit) => {
		return getExtendedUnits().includes(unit);
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/size-control/hooks/use-size-unit-keyboard.tsx
	var UNIT_KEY_PATTERN = /^[a-zA-Z%]$/;
	var useSizeUnitKeyboard = ({ unit, units, onUnitChange }) => {
		const { appendKey, startsWith } = useTypingBuffer();
		const onUnitKeyDown = (event) => {
			if (units.length === 0) return;
			const { key, altKey, ctrlKey, metaKey } = event;
			if (altKey || ctrlKey || metaKey) return;
			if (isExtendedUnit(unit) && isNumericValue(key)) {
				const [defaultUnit] = units;
				if (defaultUnit) onUnitChange(defaultUnit);
				return;
			}
			if (!UNIT_KEY_PATTERN.test(key)) return;
			event.preventDefault();
			const updatedBuffer = appendKey(key.toLowerCase());
			const matchedUnit = units.find((u) => startsWith(u, updatedBuffer));
			if (matchedUnit) onUnitChange(matchedUnit);
		};
		return { onUnitKeyDown };
	};
	var isNumericValue = (value) => {
		if (typeof value === "number") return !isNaN(value);
		if (typeof value === "string") return value.trim() !== "" && !isNaN(Number(value));
		return false;
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/size-control/utils/resolve-size-value.ts
	var DEFAULT_SIZE$1 = "";
	var EXTENDED_UNITS = {
		auto: "auto",
		custom: "custom"
	};
	var resolveSizeValue = (value, context) => {
		if (!value) return value;
		const { units, defaultUnit } = context;
		const unit = resolveFallbackUnit(value.unit, units, defaultUnit);
		if (unit === EXTENDED_UNITS.auto) return {
			size: DEFAULT_SIZE$1,
			unit
		};
		if (unit === EXTENDED_UNITS.custom) return {
			size: String(value.size ?? DEFAULT_SIZE$1),
			unit
		};
		return {
			size: sanitizeSize(value.size) ?? DEFAULT_SIZE$1,
			unit
		};
	};
	var resolveSizeOnUnitChange = (size, unit) => {
		return isExtendedUnit(unit) ? DEFAULT_SIZE$1 : size;
	};
	var createDefaultSizeValue = (units, defaultUnit) => {
		let [unit] = units;
		if (defaultUnit !== void 0) unit = resolveFallbackUnit(defaultUnit, units);
		return {
			size: DEFAULT_SIZE$1,
			unit
		};
	};
	var resolveFallbackUnit = (unit, units, defaultUnit) => {
		if (units.includes(unit)) return unit;
		if (defaultUnit && units.includes(defaultUnit)) return defaultUnit;
		return units[0] ?? "";
	};
	var sanitizeSize = (size) => {
		if (typeof size === "number" && isNaN(size)) return DEFAULT_SIZE$1;
		return size;
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/size-control/hooks/use-unit-sync.ts
	var useUnitSync = ({ sizeValue, setUnit, persistWhen }) => {
		const [state, setState] = (0, react.useState)(sizeValue.unit);
		(0, react.useEffect)(() => {
			if (sizeValue.unit !== state) setState(sizeValue.unit);
		}, [sizeValue.unit, sizeValue.size]);
		const setInternalValue = (newUnit) => {
			setState(newUnit);
			if (isExtendedUnit(newUnit) || persistWhen()) setUnit(newUnit);
		};
		return [state, setInternalValue];
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/size-control/hooks/use-size-value.ts
	var useSizeValue$1 = /* @__PURE__ */ __name(({ value, setValue, units, defaultUnit }) => {
		const resolvedValue = (0, react.useMemo)(() => resolveSizeValue(value, {
			units,
			defaultUnit
		}), [
			value?.size,
			value?.unit,
			defaultUnit
		]);
		const [sizeValue, setSizeValue] = useSyncExternalState({
			external: resolvedValue,
			setExternal: (newState, options, meta) => {
				if (newState !== null) setValue(newState, options, meta);
			},
			persistWhen: (next) => hasChanged(next, resolvedValue),
			fallback: () => createDefaultSizeValue(units, defaultUnit)
		});
		const [unit, setUnit] = useUnitSync({
			sizeValue,
			setUnit: (newUnit) => {
				setSizeValue({
					unit: newUnit,
					size: resolveSizeOnUnitChange(sizeValue.size, newUnit)
				});
			},
			persistWhen: () => {
				return Boolean(sizeValue.size) || sizeValue.size !== "" || isExtendedUnit(sizeValue.unit);
			}
		});
		const setSize = (newSize, isInputValid = true) => {
			if (isExtendedUnit(unit)) return;
			const trimmed = newSize.trim();
			const parsed = Number(trimmed);
			setSizeValue({
				unit,
				size: trimmed && !isNaN(parsed) ? parsed : ""
			}, void 0, { validation: () => isInputValid });
		};
		return {
			size: sizeValue.size,
			setSize,
			unit,
			setUnit
		};
	}, "useSizeValue");
	var hasChanged = (next, current) => {
		return next?.size !== current?.size || next?.unit !== current?.unit;
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/size-control/ui/size-input.tsx
	var SizeInput = (0, react.forwardRef)(({ id, type, value, onBlur, onKeyUp, focused, disabled, onChange, onKeyDown, InputProps, inputProps, placeholder }, ref) => {
		return /* @__PURE__ */ react.createElement(NumberInput, {
			id,
			ref,
			size: "tiny",
			fullWidth: true,
			type,
			value,
			placeholder,
			onKeyUp,
			focused,
			disabled,
			onKeyDown,
			onInput: onChange,
			onBlur,
			InputProps,
			inputProps,
			sx: getCursorStyle$1(InputProps?.readOnly ?? false)
		});
	});
	var getCursorStyle$1 = /* @__PURE__ */ __name((readOnly) => ({ input: { cursor: readOnly ? "default !important" : void 0 } }), "getCursorStyle");

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/size-control/ui/unit-selector.tsx
	var menuItemContentStyles$1 = {
		display: "flex",
		flexDirection: "column",
		justifyContent: "center"
	};
	var UnitSelector = ({ value, isUnitHighlighted, onSelect, options, disabled, menuItemsAttributes = {}, optionLabelOverrides = {} }) => {
		const popupState = (0, _elementor_ui.usePopupState)({
			variant: "popover",
			popupId: (0, react.useId)()
		});
		const handleMenuItemClick = (option) => {
			onSelect(option);
			popupState.close();
		};
		return /* @__PURE__ */ react.createElement(react.Fragment, null, /* @__PURE__ */ react.createElement(StyledButton$1, {
			isHighlighted: isUnitHighlighted,
			disabled,
			size: "small",
			...(0, _elementor_ui.bindTrigger)(popupState)
		}, optionLabelOverrides[value] ?? value), /* @__PURE__ */ react.createElement(_elementor_ui.Menu, {
			MenuListProps: { dense: true },
			...(0, _elementor_ui.bindMenu)(popupState)
		}, options.map((option) => /* @__PURE__ */ react.createElement(_elementor_editor_ui.MenuListItem, {
			key: option,
			onClick: () => handleMenuItemClick(option),
			...menuItemsAttributes?.[option],
			primaryTypographyProps: {
				variant: "caption",
				sx: {
					...menuItemContentStyles$1,
					lineHeight: "1"
				}
			},
			menuItemTextProps: { sx: menuItemContentStyles$1 }
		}, optionLabelOverrides[option] ?? option.toUpperCase()))));
	};
	var StyledButton$1 = (0, _elementor_ui.styled)(_elementor_ui.Button, { shouldForwardProp: (prop) => prop !== "isHighlighted" })(({ isHighlighted, theme }) => ({
		color: isHighlighted ? theme.palette.text.primary : theme.palette.text.tertiary,
		font: "inherit",
		minWidth: "initial",
		textTransform: "uppercase"
	}));

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/size-control/size-field.tsx
	var UNIT_DISPLAY_LABELS_OVERRIDES = { custom: /* @__PURE__ */ react.createElement(_elementor_icons.MathFunctionIcon, { fontSize: "tiny" }) };
	var SizeField = ({ value, focused, disabled, InputProps, defaultUnit, placeholder, onUnitChange, startIcon, ariaLabel, onKeyDown, setValue, onBlur, units, min, unitSelectorProps }) => {
		const { size, unit, setSize, setUnit } = useSizeValue$1({
			value,
			setValue,
			units,
			defaultUnit
		});
		const handleUnitChange = (newUnit) => {
			setUnit(newUnit);
			onUnitChange?.(newUnit);
		};
		const { onUnitKeyDown } = useSizeUnitKeyboard({
			unit,
			onUnitChange: handleUnitChange,
			units
		});
		const handleKeyDown = (event) => {
			onUnitKeyDown(event);
			onKeyDown?.(event);
		};
		const handleChange = (event) => {
			const newSize = event.target.value;
			const isInputValid = event.target.validity.valid;
			setSize(newSize, isInputValid);
		};
		const inputType = isExtendedUnit(unit) ? "text" : "number";
		return /* @__PURE__ */ react.createElement(SizeInput, {
			disabled,
			focused,
			type: inputType,
			value: size,
			placeholder,
			onBlur,
			onKeyDown: handleKeyDown,
			onChange: handleChange,
			InputProps: {
				...InputProps,
				autoComplete: "off",
				readOnly: isExtendedUnit(unit),
				startAdornment: startIcon && /* @__PURE__ */ react.createElement(_elementor_ui.InputAdornment, {
					position: "start",
					disabled
				}, startIcon),
				endAdornment: /* @__PURE__ */ react.createElement(_elementor_ui.InputAdornment, { position: "end" }, /* @__PURE__ */ react.createElement(UnitSelector, {
					options: units,
					value: unit,
					onSelect: handleUnitChange,
					isUnitHighlighted: shouldHighlightUnit({
						size,
						unit
					}),
					...unitSelectorProps,
					optionLabelOverrides: UNIT_DISPLAY_LABELS_OVERRIDES
				}))
			},
			inputProps: {
				min,
				step: "any",
				"aria-label": ariaLabel
			}
		});
	};
	var shouldHighlightUnit = (value) => {
		if (!value) return false;
		if (value.unit === EXTENDED_UNITS.auto) return true;
		return Boolean(value.size) || value.size === 0;
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/size-control/ui/text-field-popover.tsx
	var SIZE$5 = "tiny";
	var TextFieldPopover = ({ popupState, anchorRef, value, onChange, onClose }) => {
		const inputRef = (0, react.useRef)(null);
		(0, react.useEffect)(() => {
			if (popupState.isOpen) requestAnimationFrame(() => {
				if (inputRef.current) inputRef.current.focus();
			});
		}, [popupState.isOpen]);
		const handleKeyDown = (event) => {
			if (event.key.toLowerCase() === "enter") handleClose();
		};
		const handleClose = () => {
			onClose?.();
			popupState.close();
		};
		return /* @__PURE__ */ react.createElement(_elementor_ui.Popover, {
			disablePortal: true,
			slotProps: { paper: { sx: {
				borderRadius: 2,
				width: anchorRef.current?.offsetWidth + "px"
			} } },
			...(0, _elementor_ui.bindPopover)(popupState),
			anchorOrigin: {
				vertical: "bottom",
				horizontal: "center"
			},
			transformOrigin: {
				vertical: "top",
				horizontal: "center"
			},
			onClose: handleClose
		}, /* @__PURE__ */ react.createElement(_elementor_editor_ui.PopoverHeader, {
			title: (0, _wordpress_i18n.__)("CSS function", "elementor"),
			onClose: handleClose,
			icon: /* @__PURE__ */ react.createElement(_elementor_icons.MathFunctionIcon, { fontSize: SIZE$5 })
		}), /* @__PURE__ */ react.createElement(_elementor_ui.TextField, {
			value,
			onChange,
			onKeyDown: handleKeyDown,
			size: "tiny",
			type: "text",
			fullWidth: true,
			inputProps: { ref: inputRef },
			sx: {
				pt: 0,
				pr: 1.5,
				pb: 1.5,
				pl: 1.5
			}
		}));
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/size-control/size-component.tsx
	var SizeComponent = ({ anchorRef, SizeFieldWrapper = react.Fragment, ...sizeFieldProps }) => {
		const popupState = (0, _elementor_ui.usePopupState)({ variant: "popover" });
		const activeBreakpoint = (0, _elementor_editor_responsive.useActiveBreakpoint)();
		const isCustomUnit = sizeFieldProps?.value?.unit === EXTENDED_UNITS.custom;
		const hasCustomUnitOption = sizeFieldProps.units.includes(EXTENDED_UNITS.custom);
		(0, react.useEffect)(() => {
			if (popupState && popupState.isOpen) popupState.close();
		}, [activeBreakpoint]);
		const handleCustomSizeChange = (event) => {
			sizeFieldProps.setValue({
				size: event.target.value,
				unit: EXTENDED_UNITS.custom
			});
		};
		const handleSizeFieldClick = (event) => {
			if (event.target.closest("input") && isCustomUnit) popupState.open(anchorRef?.current);
		};
		const handleUnitChange = (unit) => {
			if (unit === EXTENDED_UNITS.custom && anchorRef?.current) popupState.open(anchorRef.current);
		};
		const popupAttributes = {
			"aria-controls": popupState.isOpen ? popupState.popupId : void 0,
			"aria-haspopup": true
		};
		return /* @__PURE__ */ react.createElement(react.Fragment, null, /* @__PURE__ */ react.createElement(SizeFieldWrapper, null, /* @__PURE__ */ react.createElement(_elementor_ui.Box, null, /* @__PURE__ */ react.createElement(SizeField, {
			focused: popupState.isOpen ? true : void 0,
			onUnitChange: handleUnitChange,
			InputProps: {
				...popupAttributes,
				onClick: handleSizeFieldClick
			},
			unitSelectorProps: { menuItemsAttributes: hasCustomUnitOption ? { custom: popupAttributes } : void 0 },
			...sizeFieldProps
		}))), popupState.isOpen && anchorRef?.current && /* @__PURE__ */ react.createElement(TextFieldPopover, {
			popupState,
			anchorRef,
			value: String(sizeFieldProps?.value?.size ?? ""),
			onChange: handleCustomSizeChange,
			onClose: () => {}
		}));
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/size-control/utils/resolve-bound-prop-value.ts
	var resolveBoundPropValue = (value, boundPropPlaceholder, propPlaceholder) => {
		return {
			sizeValue: pickFirstValid([
				{
					candidate: value,
					resolve: (v) => v
				},
				{
					candidate: propPlaceholder,
					resolve: toUnitPlaceholder
				},
				{
					candidate: boundPropPlaceholder,
					resolve: toUnitPlaceholder
				}
			]),
			placeholder: Boolean(value) ? void 0 : resolvePlaceholder(propPlaceholder ?? boundPropPlaceholder)
		};
	};
	var toUnitPlaceholder = (v) => ({
		...v,
		size: ""
	});
	var pickFirstValid = (candidates) => {
		const found = candidates.find(({ candidate }) => validateSizeValue(candidate));
		return found ? found.resolve(found.candidate) : null;
	};
	var validateSizeValue = (value) => {
		if (!value || typeof value !== "object") return false;
		const sizePropValue = _elementor_editor_props.sizePropTypeUtil.create(value);
		return _elementor_editor_props.sizePropTypeUtil.isValid(sizePropValue);
	};
	var resolvePlaceholder = (placeholder) => {
		if (typeof placeholder === "string") return placeholder;
		const size = placeholder?.size;
		if (size === void 0) return;
		return typeof size === "number" ? size.toString() : size;
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/size-control/utils/settings/get-default-unit.ts
	var getDefaultUnit = (propType) => {
		return getPropTypeSettings(propType)?.default_unit;
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/size-control/utils/settings/get-size-units.ts
	var getVariantUnits = (variant) => {
		return {
			length: getLengthUnits,
			angle: getAngleUnits,
			time: getTimeUnits
		}[variant]();
	};
	var getSettingsUnits = (propType) => {
		return getPropTypeSettings(propType)?.available_units;
	};
	var getSizeUnits = (propType, variant) => {
		return getSettingsUnits(propType) ?? getVariantUnits(variant);
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/size-control/utils/should-nullify-value.ts
	var conditions = [
		(value) => Boolean(value),
		(value) => value?.size === null || value?.size === void 0 || value?.size === "",
		(value) => value?.unit !== EXTENDED_UNITS.auto,
		(value) => value?.unit !== EXTENDED_UNITS.custom
	];
	var shouldNullifyValue = (value) => {
		return conditions.every((condition) => condition(value));
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/size-control/unstable-size-control.tsx
	var UnstableSizeControl = createControl(({ variant = "length", placeholder: propPlaceholder, anchorRef, startIcon, ariaLabel, min }) => {
		const { value, setValue, propType, placeholder: boundPropPlaceholder, restoreValue } = useBoundProp(_elementor_editor_props.sizePropTypeUtil);
		const lastNonAutoValue = (0, react.useRef)(null);
		const { sizeValue, placeholder } = resolveBoundPropValue(value ?? lastNonAutoValue.current, boundPropPlaceholder, propPlaceholder);
		const units = getSizeUnits(propType, variant);
		const defaultUnit = getDefaultUnit(propType);
		const handleBlur = () => {
			const isRequired = propType.settings.required;
			if (shouldNullifyValue(value) && !isRequired) setValue(null);
			if (isRequired) restoreValue();
		};
		const handleChange = (newValue, options, meta) => {
			if (isTransitioningFromExtendedUnit(newValue, value)) {
				lastNonAutoValue.current = newValue;
				setValue(null);
				return;
			}
			setValue(newValue, options, {
				...meta,
				validation: () => {
					if (propType.settings.required) return newValue.size !== "";
					return meta?.validation ? meta.validation(newValue) : true;
				}
			});
		};
		return /* @__PURE__ */ react.createElement(SizeComponent, {
			units,
			value: sizeValue,
			anchorRef,
			placeholder,
			defaultUnit,
			onBlur: handleBlur,
			setValue: handleChange,
			SizeFieldWrapper: ControlActions,
			startIcon,
			ariaLabel,
			min
		});
	});
	var isTransitioningFromExtendedUnit = (nextValue, previousValue) => {
		return !isExtendedUnit(nextValue.unit) && isExtendedUnit(previousValue?.unit) && nextValue.size === "";
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/linked-dimensions-control.tsx
	var LinkedDimensionsControl = ({ label, isSiteRtl = false, min }) => {
		const gridRowRefs = [(0, react.useRef)(null), (0, react.useRef)(null)];
		const { disabled: sizeDisabled } = useBoundProp(_elementor_editor_props.sizePropTypeUtil);
		const { value: dimensionsValue, setValue: setDimensionsValue, propType, placeholder: dimensionsPlaceholder, disabled: dimensionsDisabled } = useBoundProp(_elementor_editor_props.dimensionsPropTypeUtil);
		const { value: masterValue, placeholder: masterPlaceholder, setValue: setMasterValue } = useBoundProp();
		const inferIsLinked = () => {
			if (_elementor_editor_props.dimensionsPropTypeUtil.isValid(masterValue)) return false;
			if (!masterValue && _elementor_editor_props.dimensionsPropTypeUtil.isValid(masterPlaceholder)) return false;
			return true;
		};
		const [isLinked, setIsLinked] = (0, react.useState)(() => inferIsLinked());
		(0, react.useLayoutEffect)(() => {
			setIsLinked(inferIsLinked);
		}, [(0, _elementor_editor_responsive.useActiveBreakpoint)(), _elementor_editor_props.dimensionsPropTypeUtil.isValid(masterValue ?? masterPlaceholder)]);
		const onLinkToggle = () => {
			setIsLinked((prev) => !prev);
			if (!_elementor_editor_props.dimensionsPropTypeUtil.isValid(masterValue)) {
				const value = masterValue ? masterValue : null;
				if (!value) {
					setMasterValue(null);
					return;
				}
				setMasterValue(_elementor_editor_props.dimensionsPropTypeUtil.create({
					"block-start": value,
					"block-end": value,
					"inline-start": value,
					"inline-end": value
				}));
				return;
			}
			const sizeValue = getFirstDefined(dimensionsValue) ?? null;
			if (!sizeValue) {
				setMasterValue(null);
				return;
			}
			setMasterValue(sizeValue);
		};
		const tooltipLabel = label.toLowerCase();
		const LinkedIcon = isLinked ? _elementor_icons.LinkIcon : _elementor_icons.DetachIcon;
		const linkedLabel = (0, _wordpress_i18n.__)("Link %s", "elementor").replace("%s", tooltipLabel);
		const unlinkedLabel = (0, _wordpress_i18n.__)("Unlink %s", "elementor").replace("%s", tooltipLabel);
		const disabled = sizeDisabled || dimensionsDisabled;
		const propProviderProps = {
			propType,
			value: dimensionsValue,
			placeholder: dimensionsPlaceholder ?? (!isLinked ? {
				"block-start": masterPlaceholder,
				"block-end": masterPlaceholder,
				"inline-start": masterPlaceholder,
				"inline-end": masterPlaceholder
			} : null),
			setValue: (dimensions) => {
				const filtered = Object.entries(dimensions).filter(([, value]) => Boolean(value));
				setDimensionsValue(filtered.length === 0 ? null : Object.fromEntries(filtered));
			},
			isDisabled: () => dimensionsDisabled
		};
		const hasPlaceholders = !masterValue && (dimensionsPlaceholder || masterPlaceholder);
		const getEffectivePlaceholder = (bind) => {
			if (isLinked) {
				const linkedPlaceholder = getFirstDefined(dimensionsPlaceholder);
				return _elementor_editor_props.sizePropTypeUtil.extract(linkedPlaceholder);
			}
			return _elementor_editor_props.sizePropTypeUtil.extract(dimensionsPlaceholder?.[bind]);
		};
		return /* @__PURE__ */ react.createElement(PropProvider, { ...propProviderProps }, /* @__PURE__ */ react.createElement(_elementor_ui.Stack, {
			direction: "row",
			gap: 2,
			flexWrap: "nowrap"
		}, /* @__PURE__ */ react.createElement(ControlFormLabel, null, label), /* @__PURE__ */ react.createElement(_elementor_ui.Tooltip, {
			title: isLinked ? unlinkedLabel : linkedLabel,
			placement: "top"
		}, /* @__PURE__ */ react.createElement(StyledToggleButton, {
			"aria-label": isLinked ? unlinkedLabel : linkedLabel,
			size: "tiny",
			value: "check",
			selected: isLinked,
			sx: { marginLeft: "auto" },
			onChange: onLinkToggle,
			disabled,
			isPlaceholder: hasPlaceholders
		}, /* @__PURE__ */ react.createElement(LinkedIcon, { fontSize: "tiny" })))), getCssDimensionProps(label, isSiteRtl).map((row, index) => /* @__PURE__ */ react.createElement(_elementor_ui.Stack, {
			direction: "row",
			gap: 2,
			flexWrap: "nowrap",
			key: index,
			ref: gridRowRefs[index]
		}, row.map(({ icon, ...props }) => /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			container: true,
			gap: .75,
			alignItems: "center",
			key: props.bind
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 12
		}, /* @__PURE__ */ react.createElement(Label$1, { ...props })), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 12
		}, /* @__PURE__ */ react.createElement(Control$1, {
			bind: props.bind,
			ariaLabel: props.ariaLabel,
			startIcon: icon,
			isLinked,
			placeholder: getEffectivePlaceholder(props.bind) ?? void 0,
			anchorRef: gridRowRefs[index],
			min
		})))))));
	};
	var Control$1 = /* @__PURE__ */ __name(({ bind, ariaLabel, startIcon, isLinked, placeholder, anchorRef, min }) => {
		if (isLinked) return /* @__PURE__ */ react.createElement(UnstableSizeControl, {
			ariaLabel,
			startIcon,
			anchorRef,
			placeholder,
			min
		});
		return /* @__PURE__ */ react.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ react.createElement(UnstableSizeControl, {
			ariaLabel,
			startIcon,
			anchorRef,
			min,
			placeholder
		}));
	}, "Control");
	var Label$1 = /* @__PURE__ */ __name(({ label, bind }) => {
		return /* @__PURE__ */ react.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ react.createElement(ControlLabel, null, label));
	}, "Label");
	var getFirstDefined = (dimensions) => {
		return dimensions?.["block-start"] ?? dimensions?.["inline-end"] ?? dimensions?.["block-end"] ?? dimensions?.["inline-start"];
	};
	function getCssDimensionProps(label, isSiteRtl) {
		return [[{
			bind: "block-start",
			label: (0, _wordpress_i18n.__)("Top", "elementor"),
			ariaLabel: (0, _wordpress_i18n.sprintf)((0, _wordpress_i18n.__)("%s top", "elementor"), label),
			icon: /* @__PURE__ */ react.createElement(_elementor_icons.SideTopIcon, { fontSize: "tiny" })
		}, {
			bind: "inline-end",
			label: isSiteRtl ? (0, _wordpress_i18n.__)("Left", "elementor") : (0, _wordpress_i18n.__)("Right", "elementor"),
			ariaLabel: isSiteRtl ? (0, _wordpress_i18n.sprintf)((0, _wordpress_i18n.__)("%s left", "elementor"), label) : (0, _wordpress_i18n.sprintf)((0, _wordpress_i18n.__)("%s right", "elementor"), label),
			icon: isSiteRtl ? /* @__PURE__ */ react.createElement(_elementor_icons.SideLeftIcon, { fontSize: "tiny" }) : /* @__PURE__ */ react.createElement(_elementor_icons.SideRightIcon, { fontSize: "tiny" })
		}], [{
			bind: "block-end",
			label: (0, _wordpress_i18n.__)("Bottom", "elementor"),
			ariaLabel: (0, _wordpress_i18n.sprintf)((0, _wordpress_i18n.__)("%s bottom", "elementor"), label),
			icon: /* @__PURE__ */ react.createElement(_elementor_icons.SideBottomIcon, { fontSize: "tiny" })
		}, {
			bind: "inline-start",
			label: isSiteRtl ? (0, _wordpress_i18n.__)("Right", "elementor") : (0, _wordpress_i18n.__)("Left", "elementor"),
			ariaLabel: isSiteRtl ? (0, _wordpress_i18n.sprintf)((0, _wordpress_i18n.__)("%s right", "elementor"), label) : (0, _wordpress_i18n.sprintf)((0, _wordpress_i18n.__)("%s left", "elementor"), label),
			icon: isSiteRtl ? /* @__PURE__ */ react.createElement(_elementor_icons.SideRightIcon, { fontSize: "tiny" }) : /* @__PURE__ */ react.createElement(_elementor_icons.SideLeftIcon, { fontSize: "tiny" })
		}]];
	}

//#endregion
//#region packages/packages/libs/editor-controls/src/hooks/use-filtered-items-list.ts
	var useFilteredItemsList = (itemsList, searchValue, disabledItems) => {
		return itemsList.reduce((acc, category) => {
			const filteredItems = category.items.filter((item) => item.toLowerCase().includes(searchValue.toLowerCase()));
			if (filteredItems.length) {
				acc.push({
					type: "category",
					value: category.label
				});
				filteredItems.forEach((item) => {
					acc.push({
						type: "item",
						value: item,
						disabled: disabledItems?.includes(item) ?? false
					});
				});
			}
			return acc;
		}, []);
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/components/item-selector.tsx
	var ItemSelector = ({ itemsList, selectedItem, onItemChange, onClose, sectionWidth, title, itemStyle = () => ({}), onDebounce = () => {}, icon, disabledItems, id = "item-selector", footer, categoryItemContentTemplate }) => {
		const [searchValue, setSearchValue] = (0, react.useState)("");
		const filteredItemsList = useFilteredItemsList(itemsList, searchValue, disabledItems);
		const IconComponent = icon;
		const handleSearch = (value) => {
			setSearchValue(value);
		};
		const handleClose = () => {
			setSearchValue("");
			onClose();
		};
		return /* @__PURE__ */ react.createElement(_elementor_editor_ui.PopoverBody, {
			width: sectionWidth,
			id
		}, /* @__PURE__ */ react.createElement(_elementor_editor_ui.PopoverHeader, {
			title,
			onClose: handleClose,
			icon: /* @__PURE__ */ react.createElement(IconComponent, { fontSize: "tiny" })
		}), /* @__PURE__ */ react.createElement(_elementor_editor_ui.SearchField, {
			value: searchValue,
			onSearch: handleSearch,
			placeholder: (0, _wordpress_i18n.__)("Search", "elementor"),
			id: id + "-search"
		}), /* @__PURE__ */ react.createElement(_elementor_ui.Divider, null), /* @__PURE__ */ react.createElement(_elementor_ui.Box, { sx: {
			flex: 1,
			overflow: "auto",
			minHeight: 0
		} }, filteredItemsList.length > 0 ? /* @__PURE__ */ react.createElement(ItemList, {
			itemListItems: filteredItemsList,
			setSelectedItem: onItemChange,
			handleClose,
			selectedItem,
			itemStyle,
			onDebounce,
			categoryItemContentTemplate
		}) : /* @__PURE__ */ react.createElement(_elementor_ui.Stack, {
			alignItems: "center",
			justifyContent: "center",
			height: "100%",
			p: 2.5,
			gap: 1.5,
			overflow: "hidden"
		}, /* @__PURE__ */ react.createElement(IconComponent, { fontSize: "large" }), /* @__PURE__ */ react.createElement(_elementor_ui.Box, { sx: {
			maxWidth: 160,
			overflow: "hidden"
		} }, /* @__PURE__ */ react.createElement(_elementor_ui.Typography, {
			align: "center",
			variant: "subtitle2",
			color: "text.secondary"
		}, (0, _wordpress_i18n.__)("Sorry, nothing matched", "elementor")), /* @__PURE__ */ react.createElement(_elementor_ui.Typography, {
			variant: "subtitle2",
			color: "text.secondary",
			sx: {
				display: "flex",
				width: "100%",
				justifyContent: "center"
			}
		}, /* @__PURE__ */ react.createElement("span", null, "“"), /* @__PURE__ */ react.createElement(_elementor_ui.Box, {
			component: "span",
			sx: {
				maxWidth: "80%",
				overflow: "hidden",
				textOverflow: "ellipsis"
			}
		}, searchValue), /* @__PURE__ */ react.createElement("span", null, "”."))), /* @__PURE__ */ react.createElement(_elementor_ui.Typography, {
			align: "center",
			variant: "caption",
			color: "text.secondary",
			sx: {
				display: "flex",
				flexDirection: "column"
			}
		}, (0, _wordpress_i18n.__)("Try something else.", "elementor"), /* @__PURE__ */ react.createElement(_elementor_ui.Link, {
			color: "secondary",
			variant: "caption",
			component: "button",
			onClick: () => setSearchValue("")
		}, (0, _wordpress_i18n.__)("Clear & try again", "elementor"))))), footer);
	};
	var ItemList = ({ itemListItems, setSelectedItem, handleClose, selectedItem, itemStyle = () => ({}), onDebounce = () => {}, categoryItemContentTemplate }) => {
		const selectedItemFound = itemListItems.find((item) => item.value === selectedItem);
		const debouncedVirtualizeChange = useDebounce((visibleItems) => {
			visibleItems.forEach((item) => {
				if (item && item.type === "item") onDebounce(item.value);
			});
		}, 100);
		const memoizedItemStyle = (0, react.useCallback)((item) => itemStyle(item), [itemStyle]);
		return /* @__PURE__ */ react.createElement(_elementor_editor_ui.PopoverMenuList, {
			items: itemListItems,
			selectedValue: selectedItemFound?.value,
			onChange: debouncedVirtualizeChange,
			onSelect: setSelectedItem,
			onClose: handleClose,
			itemStyle: memoizedItemStyle,
			"data-testid": "item-list",
			categoryItemContentTemplate
		});
	};
	var useDebounce = (fn, delay) => {
		const [debouncedFn] = (0, react.useState)(() => (0, _elementor_utils.debounce)(fn, delay));
		(0, react.useEffect)(() => () => debouncedFn.cancel(), [debouncedFn]);
		return debouncedFn;
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/font-family-control/enqueue-font.tsx
	var enqueueFont = (fontFamily, context = "editor") => {
		return window.elementor?.helpers?.enqueueFont?.(fontFamily, context) ?? null;
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/font-family-control/font-family-control.tsx
	var FontFamilyControl = createControl(({ fontFamilies, sectionWidth, ariaLabel }) => {
		const { value: fontFamily, setValue: setFontFamily, disabled, placeholder } = useBoundProp(_elementor_editor_props.fontFamilyPropTypeUtil);
		const popoverState = (0, _elementor_ui.usePopupState)({ variant: "popover" });
		const isShowingPlaceholder = !fontFamily && placeholder;
		const mapFontSubs = (0, react.useMemo)(() => {
			return fontFamilies.map(({ label, fonts }) => ({
				label,
				items: fonts
			}));
		}, [fontFamilies]);
		return /* @__PURE__ */ react.createElement(react.Fragment, null, /* @__PURE__ */ react.createElement(ControlActions, null, /* @__PURE__ */ react.createElement(_elementor_ui.UnstableTag, {
			id: "font-family-control",
			variant: "outlined",
			label: fontFamily || placeholder,
			endIcon: /* @__PURE__ */ react.createElement(_elementor_icons.ChevronDownIcon, { fontSize: "tiny" }),
			...(0, _elementor_ui.bindTrigger)(popoverState),
			fullWidth: true,
			disabled,
			"aria-label": ariaLabel,
			sx: isShowingPlaceholder ? {
				"& .MuiTag-label": { color: (theme) => theme.palette.text.tertiary },
				textTransform: "capitalize"
			} : void 0
		})), /* @__PURE__ */ react.createElement(_elementor_ui.Popover, {
			disablePortal: true,
			disableScrollLock: true,
			anchorOrigin: {
				vertical: "bottom",
				horizontal: "right"
			},
			transformOrigin: {
				vertical: "top",
				horizontal: "right"
			},
			sx: { my: 1.5 },
			...(0, _elementor_ui.bindPopover)(popoverState)
		}, /* @__PURE__ */ react.createElement(ItemSelector, {
			id: "font-family-selector",
			itemsList: mapFontSubs,
			selectedItem: fontFamily,
			onItemChange: setFontFamily,
			onClose: popoverState.close,
			sectionWidth,
			title: (0, _wordpress_i18n.__)("Font family", "elementor"),
			itemStyle: (item) => ({ fontFamily: item.value }),
			onDebounce: enqueueFont,
			icon: _elementor_icons.TextIcon
		})));
	});

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/url-control.tsx
	var UrlControl = createControl(({ placeholder: propPlaceholder, ariaLabel }) => {
		const { value, setValue, disabled, placeholder: boundPlaceholder } = useBoundProp(_elementor_editor_props.urlPropTypeUtil);
		const handleChange = (event) => setValue(event.target.value);
		const placeholder = propPlaceholder ?? boundPlaceholder ?? void 0;
		return /* @__PURE__ */ react.createElement(ControlActions, null, /* @__PURE__ */ react.createElement(_elementor_ui.TextField, {
			size: "tiny",
			fullWidth: true,
			value: value ?? "",
			disabled,
			onChange: handleChange,
			placeholder,
			inputProps: { ...ariaLabel ? { "aria-label": ariaLabel } : {} }
		}));
	});

//#endregion
//#region packages/packages/libs/editor-controls/src/components/restricted-link-infotip.tsx
	var learnMoreButton = {
		label: (0, _wordpress_i18n.__)("Learn More", "elementor"),
		href: "https://go.elementor.com/element-link-inside-link-infotip"
	};
	var INFOTIP_CONTENT = {
		descendant: (0, _wordpress_i18n.__)("To add a link or action to this element, first remove the link or action from the elements inside of it.", "elementor"),
		ancestor: (0, _wordpress_i18n.__)("To add a link or action to this container, first remove the link or action from its parent container.", "elementor")
	};
	function isTargetInCurrentDocument(elementId) {
		if (!elementId) return false;
		const el = (0, _elementor_editor_elements.getContainer)(elementId)?.view?.el;
		if (!el) return false;
		const targetDocId = el.closest("[data-elementor-id]")?.getAttribute("data-elementor-id");
		const currentDocId = String((0, _elementor_editor_elements.getCurrentDocumentId)() ?? "");
		return !!(targetDocId && currentDocId && targetDocId === currentDocId);
	}
	var RestrictedLinkInfotip = ({ linkInLinkRestriction, isVisible, children }) => {
		const { shouldRestrict, reason, elementId } = linkInLinkRestriction;
		const showTakeMeThereCta = !!(elementId && isTargetInCurrentDocument(elementId));
		const handleTakeMeClick = () => {
			if (elementId) (0, _elementor_editor_elements.selectElement)(elementId);
		};
		const content = /* @__PURE__ */ react.createElement(_elementor_ui.Alert, {
			color: "secondary",
			icon: /* @__PURE__ */ react.createElement(_elementor_icons.InfoCircleFilledIcon, null),
			size: "small",
			action: showTakeMeThereCta ? /* @__PURE__ */ react.createElement(_elementor_ui.AlertAction, {
				sx: { width: "fit-content" },
				variant: "contained",
				color: "secondary",
				onClick: handleTakeMeClick
			}, (0, _wordpress_i18n.__)("Take me there", "elementor")) : void 0
		}, /* @__PURE__ */ react.createElement(_elementor_ui.AlertTitle, null, (0, _wordpress_i18n.__)("Nested links", "elementor")), /* @__PURE__ */ react.createElement(_elementor_ui.Box, { component: "span" }, INFOTIP_CONTENT[reason ?? "descendant"], " ", /* @__PURE__ */ react.createElement(_elementor_ui.Link, {
			href: learnMoreButton.href,
			target: "_blank",
			color: "info.main"
		}, learnMoreButton.label)));
		return shouldRestrict && isVisible ? /* @__PURE__ */ react.createElement(_elementor_ui.Infotip, {
			placement: "right",
			content,
			color: "secondary",
			slotProps: { popper: { sx: { width: 300 } } }
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Box, null, children)) : /* @__PURE__ */ react.createElement(react.Fragment, null, children);
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/components/autocomplete.tsx
	var Autocomplete$2 = (0, react.forwardRef)((props, ref) => {
		const { options, onOptionChange, onTextChange, allowCustomValues = false, placeholder = "", minInputLength = 2, value = "", startAdornment, disablePortal = true, inputProps, ...restProps } = props;
		const optionKeys = factoryFilter(value, options, minInputLength).map(({ id }) => id);
		const allowClear = !!value;
		const isOptionEqualToValue = allowCustomValues || !!value?.toString()?.length ? void 0 : () => true;
		const isValueFromOptions = typeof value === "number" && !!findMatchingOption(options, value);
		const shouldOpen = (value?.toString()?.length ?? 0) >= minInputLength && (allowCustomValues ? optionKeys.length > 0 : true);
		return /* @__PURE__ */ react.createElement(_elementor_ui.Autocomplete, {
			...restProps,
			ref,
			forcePopupIcon: false,
			disablePortal,
			disableClearable: true,
			freeSolo: allowCustomValues,
			openOnFocus: false,
			open: shouldOpen,
			value: value?.toString() || "",
			size: "tiny",
			onChange: (_, newValue) => onOptionChange(Number(newValue)),
			readOnly: isValueFromOptions,
			options: optionKeys,
			getOptionKey: (optionId) => findMatchingOption(options, optionId)?.id || optionId,
			getOptionLabel: (optionId) => findMatchingOption(options, optionId)?.label || optionId.toString(),
			groupBy: isCategorizedOptionPool(options) ? (optionId) => findMatchingOption(options, optionId)?.groupLabel || optionId : void 0,
			isOptionEqualToValue,
			filterOptions: () => optionKeys,
			renderOption: (optionProps, optionId) => /* @__PURE__ */ react.createElement(_elementor_ui.Box, {
				component: "li",
				...optionProps,
				key: optionProps.id
			}, findMatchingOption(options, optionId)?.label ?? optionId),
			renderInput: (params) => /* @__PURE__ */ react.createElement(TextInput, {
				params,
				handleChange: (newValue) => onTextChange?.(newValue),
				allowClear,
				placeholder,
				hasSelectedValue: isValueFromOptions,
				startAdornment,
				extraInputProps: inputProps
			})
		});
	});
	var TextInput = ({ params, allowClear, placeholder, handleChange, hasSelectedValue, startAdornment, extraInputProps }) => {
		const onChange = (event) => {
			handleChange(event.target.value);
		};
		return /* @__PURE__ */ react.createElement(_elementor_ui.TextField, {
			...params,
			placeholder,
			onChange,
			inputProps: {
				...params.inputProps ?? {},
				...extraInputProps ?? {}
			},
			sx: { "& .MuiInputBase-input": { cursor: hasSelectedValue ? "default" : void 0 } },
			InputProps: {
				...params.InputProps,
				startAdornment: startAdornment || params.InputProps.startAdornment,
				endAdornment: /* @__PURE__ */ react.createElement(ClearButton, {
					params,
					allowClear,
					handleChange
				})
			}
		});
	};
	var ClearButton = ({ allowClear, handleChange, params }) => /* @__PURE__ */ react.createElement(_elementor_ui.InputAdornment, { position: "end" }, allowClear && /* @__PURE__ */ react.createElement(_elementor_ui.IconButton, {
		size: params.size,
		onClick: () => handleChange(null),
		sx: { cursor: "pointer" }
	}, /* @__PURE__ */ react.createElement(_elementor_icons.XIcon, { fontSize: params.size })));
	function findMatchingOption(options, optionId = null) {
		const formattedOption = (optionId || "").toString();
		return options.find(({ id }) => formattedOption === id.toString());
	}
	function isCategorizedOptionPool(options) {
		if (options.length <= 1) return false;
		return new Set(options.map((option) => option.groupLabel)).size > 1;
	}
	function factoryFilter(newValue, options, minInputLength) {
		if (null === newValue) return options;
		const formattedValue = String(newValue || "")?.toLowerCase();
		if (formattedValue.length < minInputLength) return new Array(0);
		return options.filter((option) => String(option.id).toLowerCase().includes(formattedValue) || option.label.toLowerCase().includes(formattedValue));
	}

//#endregion
//#region packages/packages/libs/editor-controls/src/hooks/use-query-autocomplete.ts
	function useQueryAutocomplete({ url, params = {}, minInputLength = 2, initialQueryValue = null, excludeIds }) {
		const excludeIdSet = (0, react.useMemo)(() => new Set((excludeIds ?? []).map(String)), [excludeIds]);
		const [options, setOptions] = (0, react.useState)(generateFirstLoadedOption(initialQueryValue));
		const debounceFetch = (0, react.useMemo)(() => (0, _elementor_utils.debounce)((queryParams) => fetchOptions(url, queryParams).then((newOptions) => {
			setOptions(formatOptions(filterExcludedOptions(newOptions, excludeIdSet)));
		}), 400), [url, excludeIdSet]);
		(0, react.useEffect)(() => {
			if (minInputLength === 0 && url) fetchOptions(url, {
				...params,
				term: ""
			}).then((newOptions) => {
				setOptions(formatOptions(filterExcludedOptions(newOptions, excludeIdSet)));
			});
		}, [
			url,
			minInputLength,
			excludeIdSet,
			params
		]);
		const updateOptions = (term) => {
			const termStr = term ?? "";
			if (!url || termStr.length < minInputLength) return;
			debounceFetch({
				...params,
				term: termStr
			});
		};
		return {
			options,
			updateOptions
		};
	}
	async function fetchOptions(ajaxUrl, params) {
		if (!params || !ajaxUrl) return [];
		try {
			const { data: response } = await (0, _elementor_http_client.httpService)().get(ajaxUrl, { params });
			return response.data.value;
		} catch {
			return [];
		}
	}
	function formatOptions(options) {
		const compareKey = isCategorizedOptionPool(options) ? "groupLabel" : "label";
		return options.sort((a, b) => a[compareKey] && b[compareKey] ? a[compareKey].localeCompare(b[compareKey]) : 0);
	}
	function filterExcludedOptions(options, excludeIdSet) {
		if (excludeIdSet.size === 0) return options;
		return options.filter((option) => !excludeIdSet.has(String(option.id)));
	}
	function extractFlatOptionFromQueryValue(queryValue) {
		const id = _elementor_editor_props.numberPropTypeUtil.extract(queryValue?.id);
		const label = _elementor_editor_props.stringPropTypeUtil.extract(queryValue?.label);
		if (id === null) return null;
		return {
			id: String(id),
			label: label || String(id)
		};
	}
	function generateFirstLoadedOption(queryValue) {
		const option = extractFlatOptionFromQueryValue(queryValue);
		return option ? [option] : [];
	}

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/query-control.tsx
	var QueryControl = createControl((props) => {
		const { value: queryValue, setValue: setQueryValue } = useBoundProp(_elementor_editor_props.queryPropTypeUtil);
		const { value: urlValue, setValue: setUrlValue, placeholder: urlPlaceholder } = useBoundProp(_elementor_editor_props.urlPropTypeUtil);
		const { allowCustomValues = true, queryOptions: { url, params = {} }, placeholder = (0, _wordpress_i18n.__)("Search", "elementor"), minInputLength = 2, onSetValue, ariaLabel } = props || {};
		const { options, updateOptions } = useQueryAutocomplete({
			url,
			params,
			minInputLength,
			initialQueryValue: queryValue
		});
		const onOptionChange = (newValue) => {
			if (newValue === null) {
				setQueryValue(null);
				onSetValue?.(null);
				return;
			}
			const newQueryValue = {
				id: _elementor_editor_props.numberPropTypeUtil.create(newValue),
				label: _elementor_editor_props.stringPropTypeUtil.create(findMatchingOption(options, newValue)?.label || null)
			};
			setQueryValue(newQueryValue);
			onSetValue?.(_elementor_editor_props.queryPropTypeUtil.create(newQueryValue));
		};
		const onTextChange = (newValue) => {
			const trimmedValue = newValue?.trim() || "";
			if (!trimmedValue) {
				setUrlValue(null);
				onSetValue?.(null);
				return;
			}
			setUrlValue(trimmedValue);
			onSetValue?.(_elementor_editor_props.urlPropTypeUtil.create(trimmedValue));
			updateOptions(newValue);
		};
		const displayValue = queryValue?.id?.value ?? urlValue;
		return /* @__PURE__ */ react.createElement(ControlActions, null, /* @__PURE__ */ react.createElement(Autocomplete$2, {
			options,
			allowCustomValues,
			placeholder: urlPlaceholder ?? placeholder,
			startAdornment: /* @__PURE__ */ react.createElement(_elementor_icons.SearchIcon, { fontSize: "tiny" }),
			value: displayValue,
			onOptionChange,
			onTextChange,
			minInputLength,
			disablePortal: false,
			inputProps: { ...ariaLabel ? { "aria-label": ariaLabel } : {} }
		}));
	});

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/switch-control.tsx
	var SwitchControl = createControl(() => {
		const { value, setValue, disabled, placeholder } = useBoundProp(_elementor_editor_props.booleanPropTypeUtil);
		const handleChange = (event) => {
			setValue(event.target.checked);
		};
		return /* @__PURE__ */ react.createElement(_elementor_ui.Box, { sx: {
			display: "flex",
			justifyContent: "flex-end"
		} }, /* @__PURE__ */ react.createElement(_elementor_ui.Switch, {
			checked: !!(value || placeholder),
			onChange: handleChange,
			size: "small",
			disabled,
			inputProps: { ...disabled ? { style: { opacity: 0 } } : {} }
		}));
	});

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/link-control.tsx
	var SIZE$4 = "tiny";
	var LinkControl = createControl((props) => {
		const { value, path, setValue, ...propContext } = useBoundProp(_elementor_editor_props.linkPropTypeUtil);
		const linkPlaceholder = propContext.placeholder;
		const [linkSessionValue, setLinkSessionValue] = (0, _elementor_session.useSessionStorage)(path.join("/"));
		const [isActive, setIsActive] = (0, react.useState)(!!value || !!linkPlaceholder);
		const { allowCustomValues = true, queryOptions, placeholder, minInputLength = 2, context: { elementId }, label = (0, _wordpress_i18n.__)("Link", "elementor"), ariaLabel } = props || {};
		const [linkInLinkRestriction, setLinkInLinkRestriction] = (0, react.useState)((0, _elementor_editor_elements.getLinkInLinkRestriction)(elementId, value ?? linkPlaceholder));
		const shouldDisableAddingLink = !isActive && linkInLinkRestriction.shouldRestrict;
		const debouncedCheckRestriction = (0, _elementor_utils.useDebouncedCallback)(() => {
			const newRestriction = (0, _elementor_editor_elements.getLinkInLinkRestriction)(elementId, value ?? linkPlaceholder);
			if (newRestriction.shouldRestrict && isActive && !linkPlaceholder) {
				setIsActive(false);
				if (value !== null) setValue(null);
			}
			setLinkInLinkRestriction((prev) => isSameRestriction(prev, newRestriction) ? prev : newRestriction);
		}, 300);
		(0, _elementor_editor_v1_adapters.__privateUseListenTo)((0, _elementor_editor_v1_adapters.commandEndEvent)("document/elements/set-settings"), () => {
			debouncedCheckRestriction();
		}, [debouncedCheckRestriction]);
		(0, react.useEffect)(() => {
			debouncedCheckRestriction();
			const handleInlineLinkChanged = () => {
				debouncedCheckRestriction();
			};
			window.addEventListener("elementor:inline-link-changed", handleInlineLinkChanged);
			return () => {
				window.removeEventListener("elementor:inline-link-changed", handleInlineLinkChanged);
			};
		}, [elementId, debouncedCheckRestriction]);
		const onEnabledChange = () => {
			setLinkInLinkRestriction((0, _elementor_editor_elements.getLinkInLinkRestriction)(elementId, value ?? linkPlaceholder));
			if (linkInLinkRestriction.shouldRestrict && !isActive) return;
			const newState = !isActive;
			setIsActive(newState);
			if (!newState && value !== null) setValue(null);
			if (newState && linkSessionValue?.value) setValue(linkSessionValue.value);
			setLinkSessionValue({
				value: linkSessionValue?.value,
				meta: { isEnabled: newState }
			});
		};
		const onSaveValueToSession = (newValue) => {
			const valueToSave = newValue ? {
				...value,
				destination: newValue
			} : null;
			setLinkSessionValue({
				...linkSessionValue,
				value: valueToSave
			});
		};
		return /* @__PURE__ */ react.createElement(PropProvider, {
			...propContext,
			value,
			setValue
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Stack, { gap: 1.5 }, /* @__PURE__ */ react.createElement(_elementor_ui.Stack, {
			direction: "row",
			sx: {
				justifyContent: "space-between",
				alignItems: "center",
				marginInlineEnd: -.75
			}
		}, /* @__PURE__ */ react.createElement(ControlLabel, null, label), /* @__PURE__ */ react.createElement(RestrictedLinkInfotip, {
			isVisible: !isActive,
			linkInLinkRestriction
		}, /* @__PURE__ */ react.createElement(_elementor_ui.IconButton, {
			size: SIZE$4,
			onClick: onEnabledChange,
			"aria-label": (0, _wordpress_i18n.__)("Toggle link", "elementor"),
			disabled: shouldDisableAddingLink
		}, isActive ? /* @__PURE__ */ react.createElement(_elementor_icons.MinusIcon, { fontSize: SIZE$4 }) : /* @__PURE__ */ react.createElement(_elementor_icons.PlusIcon, { fontSize: SIZE$4 })))), /* @__PURE__ */ react.createElement(_elementor_ui.Collapse, {
			in: isActive,
			timeout: "auto",
			unmountOnExit: true
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Stack, { gap: 1.5 }, /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "destination" }, /* @__PURE__ */ react.createElement(QueryControl, {
			queryOptions,
			allowCustomValues,
			minInputLength,
			placeholder,
			onSetValue: onSaveValueToSession,
			ariaLabel: ariaLabel || label
		})), /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "isTargetBlank" }, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			container: true,
			alignItems: "center",
			flexWrap: "nowrap",
			justifyContent: "space-between"
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, { item: true }, /* @__PURE__ */ react.createElement(ControlFormLabel, null, (0, _wordpress_i18n.__)("Open in a new tab", "elementor"))), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			sx: { marginInlineEnd: -1 }
		}, /* @__PURE__ */ react.createElement(SwitchControl, null))))))));
	});
	function isSameRestriction(a, b) {
		return a.shouldRestrict === b.shouldRestrict && a.reason === b.reason && a.elementId === b.elementId;
	}

//#endregion
//#region packages/packages/libs/editor-controls/src/components/conditional-control-infotip.tsx
	var DEFAULT_COLOR = "secondary";
	var ConditionalControlInfotip = react.forwardRef(({ children, title, description, alertProps, infotipProps, ...props }, ref) => {
		const isUiRtl = "rtl" === (0, _elementor_ui.useTheme)().direction;
		const isEnabled = props.isEnabled && (title || description);
		return /* @__PURE__ */ react.createElement(_elementor_ui.Box, { ref }, isEnabled ? /* @__PURE__ */ react.createElement(_elementor_ui.DirectionProvider, { rtl: isUiRtl }, /* @__PURE__ */ react.createElement(_elementor_ui.Infotip, {
			placement: "right",
			color: DEFAULT_COLOR,
			slotProps: { popper: { modifiers: [{
				name: "offset",
				options: { offset: [0, 10] }
			}] } },
			...infotipProps,
			content: /* @__PURE__ */ react.createElement(_elementor_editor_ui.InfoAlert, {
				color: DEFAULT_COLOR,
				sx: {
					width: 300,
					px: 1.5,
					py: 2
				},
				...alertProps
			}, /* @__PURE__ */ react.createElement(_elementor_ui.Box, { sx: {
				flexDirection: "column",
				display: "flex",
				gap: .5
			} }, /* @__PURE__ */ react.createElement(_elementor_ui.AlertTitle, null, title), /* @__PURE__ */ react.createElement(_elementor_ui.Box, null, description)))
		}, children)) : children);
	});

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/html-tag-control.tsx
	var StyledSelect = (0, _elementor_ui.styled)(_elementor_ui.Select)(() => ({ ".MuiSelect-select.Mui-disabled": { cursor: "not-allowed" } }));
	var HtmlTagControl = createControl((props) => {
		const { options, onChange, fallbackLabels = {}, context: { elementId } } = props;
		const { value, setValue, disabled, placeholder } = useBoundProp(_elementor_editor_props.stringPropTypeUtil);
		const handleChange = (event) => {
			const newValue = event.target.value || null;
			onChange?.(newValue, value);
			setValue(newValue);
		};
		const elementLabel = (0, _elementor_editor_elements.getElementLabel)(elementId) ?? "element";
		const infoTipProps = {
			title: (0, _wordpress_i18n.__)("HTML Tag", "elementor"),
			description: (0, _wordpress_i18n.__)(`The tag is locked to 'a' tag because this %s has a link. To pick a different tag, remove the link first.`, "elementor").replace("%s", elementLabel),
			isEnabled: !!disabled
		};
		const renderValue = (selectedValue) => {
			if (selectedValue) return findOptionByValue(selectedValue)?.label || fallbackLabels[selectedValue] || selectedValue;
			if (!placeholder) return "";
			const displayText = findOptionByValue(placeholder)?.label || placeholder;
			return /* @__PURE__ */ react.createElement(_elementor_ui.Typography, {
				component: "span",
				variant: "caption",
				color: "text.tertiary"
			}, displayText);
		};
		const findOptionByValue = (searchValue) => options.find((opt) => opt.value === searchValue);
		return /* @__PURE__ */ react.createElement(ControlActions, null, /* @__PURE__ */ react.createElement(ConditionalControlInfotip, { ...infoTipProps }, /* @__PURE__ */ react.createElement(StyledSelect, {
			sx: {
				overflow: "hidden",
				cursor: disabled ? "not-allowed" : void 0
			},
			displayEmpty: true,
			size: "tiny",
			renderValue,
			value: value ?? "",
			onChange: handleChange,
			disabled,
			fullWidth: true
		}, options.map(({ label, ...itemProps }) => /* @__PURE__ */ react.createElement(_elementor_editor_ui.MenuListItem, {
			key: itemProps.value,
			...itemProps,
			value: itemProps.value ?? ""
		}, label)))));
	});

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/query-chips-control.tsx
	var queryArrayPropTypeUtil = (0, _elementor_editor_props.createArrayPropUtils)(_elementor_editor_props.queryPropTypeUtil.key, _elementor_editor_props.queryPropTypeUtil.schema);
	var SIZE$3 = "tiny";
	var QueryChipsControl = createControl((props) => {
		const { queryOptions, placeholder, minInputLength = 2 } = props;
		const { value, setValue, disabled } = useBoundProp(queryArrayPropTypeUtil);
		const selectedChips = (0, react.useMemo)(() => extractChips(value), [value]);
		const excludeIds = (0, react.useMemo)(() => selectedChips.map((chip) => Number(chip.id)).filter((id) => Number.isFinite(id)), [selectedChips]);
		const { options, updateOptions } = useQueryAutocomplete({
			url: queryOptions.url,
			params: queryOptions.params,
			minInputLength,
			excludeIds
		});
		const handleChange = (_, newValue) => {
			setValue(newValue.map((option) => _elementor_editor_props.queryPropTypeUtil.create({
				id: _elementor_editor_props.numberPropTypeUtil.create(Number(option.id)),
				label: _elementor_editor_props.stringPropTypeUtil.create(option.label)
			})));
		};
		const handleInputChange = (_, term) => {
			updateOptions(term || null);
		};
		return /* @__PURE__ */ react.createElement(ControlActions, null, /* @__PURE__ */ react.createElement(_elementor_ui.Autocomplete, {
			multiple: true,
			fullWidth: true,
			disableClearable: true,
			forcePopupIcon: false,
			disabled,
			size: SIZE$3,
			value: selectedChips,
			options,
			onChange: handleChange,
			onInputChange: handleInputChange,
			getOptionLabel: (option) => option.label,
			isOptionEqualToValue: (option, val) => option.id === val.id,
			filterOptions: (opts) => opts,
			renderTags: (tagValues, getTagProps) => /* @__PURE__ */ react.createElement(ChipsList, {
				getLabel: (option) => option.label,
				getTagProps,
				values: tagValues
			}),
			renderInput: (params) => /* @__PURE__ */ react.createElement(_elementor_ui.TextField, {
				...params,
				placeholder: placeholder ?? (0, _wordpress_i18n.__)("Search", "elementor")
			})
		}));
	});
	function extractChips(value) {
		if (!value) return [];
		return value.map((item) => extractFlatOptionFromQueryValue(item?.value)).filter((chip) => chip !== null);
	}

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/query-filter-repeater-control.tsx
	var QueryFilterRepeaterControl = createControl(({ allowedKeys, keyConfig, label = (0, _wordpress_i18n.__)("Filter", "elementor"), chipsPlaceholder }) => {
		const { propType, value, setValue } = useBoundProp(_elementor_editor_props.queryFilterArrayPropTypeUtil);
		const { settings } = (0, _elementor_editor_elements.useSelectedElementSettings)();
		const visibleKeys = (0, react.useMemo)(() => allowedKeys.filter((key) => isKeyVisible(keyConfig[key]?.visibleWhen, settings)), [
			allowedKeys,
			keyConfig,
			settings
		]);
		const usedKeys = (0, react.useMemo)(() => getUsedKeys(value ?? []), [value]);
		const nextAvailableKey = (0, react.useMemo)(() => visibleKeys.find((key) => !usedKeys.has(key)) ?? null, [visibleKeys, usedKeys]);
		const getKeySelectOptions = (0, react.useMemo)(() => (currentKey) => visibleKeys.map((itemKey) => ({
			value: itemKey,
			label: keyConfig[itemKey]?.label ?? itemKey,
			disabled: itemKey !== currentKey && usedKeys.has(itemKey)
		})), [
			visibleKeys,
			keyConfig,
			usedKeys
		]);
		const initialFallback = (0, react.useMemo)(() => createItemForKey(visibleKeys[0] ?? ""), [visibleKeys]);
		return /* @__PURE__ */ react.createElement(PropProvider, {
			propType,
			value,
			setValue
		}, /* @__PURE__ */ react.createElement(ControlRepeater, {
			initial: initialFallback,
			propTypeUtil: _elementor_editor_props.queryFilterArrayPropTypeUtil
		}, /* @__PURE__ */ react.createElement(RepeaterHeader, { label }, /* @__PURE__ */ react.createElement(AddFilterItemAction, {
			nextAvailableKey,
			ariaLabel: label
		})), /* @__PURE__ */ react.createElement(ItemsContainer, { isSortable: false }, /* @__PURE__ */ react.createElement(Item, {
			Icon: EmptyIcon,
			actions: /* @__PURE__ */ react.createElement(RemoveItemAction, null),
			Label: ({ value: itemValue }) => /* @__PURE__ */ react.createElement(ItemLabel$2, {
				value: itemValue,
				keyConfig
			})
		})), /* @__PURE__ */ react.createElement(EditItemPopover, null, /* @__PURE__ */ react.createElement(ItemContent$1, {
			keyConfig,
			getKeySelectOptions,
			chipsPlaceholder
		}))));
	});
	var AddFilterItemAction = ({ nextAvailableKey, ariaLabel }) => {
		const { addItem } = useRepeaterContext();
		const disabled = nextAvailableKey === null;
		const onClick = (ev) => {
			if (!nextAvailableKey) return;
			addItem(ev, {
				item: createItemForKey(nextAvailableKey),
				index: 0
			});
		};
		return /* @__PURE__ */ react.createElement(_elementor_ui.Box, {
			component: "span",
			sx: { cursor: disabled ? "not-allowed" : "pointer" }
		}, /* @__PURE__ */ react.createElement(_elementor_ui.IconButton, {
			size: "tiny",
			disabled,
			onClick,
			"aria-label": (0, _wordpress_i18n.sprintf)((0, _wordpress_i18n.__)("Add %s item", "elementor"), ariaLabel.toLowerCase())
		}, /* @__PURE__ */ react.createElement(_elementor_icons.PlusIcon, { fontSize: "tiny" })));
	};
	var EmptyIcon = () => null;
	var ItemLabel$2 = /* @__PURE__ */ __name(({ value, keyConfig }) => {
		const itemKey = _elementor_editor_props.stringPropTypeUtil.extract(value?.value?.key);
		const label = itemKey && keyConfig[itemKey]?.label || (0, _wordpress_i18n.__)("Item", "elementor");
		const chipLabels = extractChipLabels(value?.value?.values);
		const taxonomyLabels = extractTaxonomyLabels(value?.value?.taxonomies, itemKey ? keyConfig[itemKey] : void 0);
		const allLabels = [...chipLabels, ...taxonomyLabels];
		const suffix = allLabels.length > 0 ? `: ${allLabels.join(", ")}` : "";
		return /* @__PURE__ */ react.createElement(_elementor_ui.Box, { component: "span" }, label, suffix);
	}, "ItemLabel");
	function extractChipLabels(chipsProp) {
		return (chipsProp?.value ?? []).map((chip) => _elementor_editor_props.stringPropTypeUtil.extract(chip?.value?.label)).filter((label) => !!label);
	}
	var ItemContent$1 = /* @__PURE__ */ __name(({ keyConfig, getKeySelectOptions, chipsPlaceholder }) => {
		const propContext = useBoundProp(_elementor_editor_props.queryFilterPropTypeUtil);
		const snapshotsByKeyRef = (0, react.useRef)({});
		const handleValueChange = (nextValue, options, meta) => {
			if (meta?.bind !== "key") {
				propContext.setValue(nextValue, options, meta);
				return;
			}
			const previousKey = _elementor_editor_props.stringPropTypeUtil.extract(propContext.value?.key);
			const newKey = _elementor_editor_props.stringPropTypeUtil.extract(nextValue?.key);
			if (previousKey) snapshotsByKeyRef.current[previousKey] = {
				values: propContext.value?.values ?? null,
				taxonomies: propContext.value?.taxonomies ?? null
			};
			const restored = newKey ? snapshotsByKeyRef.current[newKey] : void 0;
			propContext.setValue({
				...nextValue,
				values: restored?.values ?? null,
				taxonomies: restored?.taxonomies ?? null
			}, options, meta);
		};
		const currentKey = _elementor_editor_props.stringPropTypeUtil.extract(propContext.value?.key);
		const currentKeyConfig = currentKey ? keyConfig[currentKey] : void 0;
		const valueType = currentKeyConfig?.valueType ?? "chips";
		const keySelectOptions = (0, react.useMemo)(() => getKeySelectOptions(currentKey), [getKeySelectOptions, currentKey]);
		return /* @__PURE__ */ react.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ react.createElement(PropProvider, {
			...propContext,
			setValue: handleValueChange
		}, /* @__PURE__ */ react.createElement(PopoverGridContainer, { flexWrap: "wrap" }, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 12
		}, /* @__PURE__ */ react.createElement(ControlFormLabel, null, (0, _wordpress_i18n.__)("Type", "elementor"))), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 12
		}, /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "key" }, /* @__PURE__ */ react.createElement(SelectControl, { options: keySelectOptions })))), valueType === "taxonomies" && currentKeyConfig?.staticOptions && /* @__PURE__ */ react.createElement(PopoverGridContainer, { flexWrap: "wrap" }, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 12
		}, /* @__PURE__ */ react.createElement(ControlFormLabel, null, currentKeyConfig.label)), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 12
		}, /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "taxonomies" }, /* @__PURE__ */ react.createElement(ChipsControl, { options: currentKeyConfig.staticOptions })))), valueType !== "taxonomies" && currentKeyConfig?.queryEndpoint && /* @__PURE__ */ react.createElement(PopoverGridContainer, { flexWrap: "wrap" }, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 12
		}, /* @__PURE__ */ react.createElement(ControlFormLabel, null, currentKeyConfig.label)), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 12
		}, /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "values" }, /* @__PURE__ */ react.createElement(QueryChipsControl, {
			queryOptions: {
				url: currentKeyConfig.queryEndpoint.url,
				params: currentKeyConfig.queryEndpoint.params ?? {}
			},
			placeholder: currentKeyConfig.chipsPlaceholder ?? chipsPlaceholder
		}))))));
	}, "ItemContent");
	function isKeyVisible(rule, settings) {
		if (!rule) return true;
		if (!settings) return false;
		const extracted = _elementor_editor_props.stringPropTypeUtil.extract((0, _elementor_editor_props.extractValue)(rule.path, settings));
		return extracted !== null && rule.in.includes(extracted);
	}
	function extractTaxonomyLabels(taxonomiesProp, config) {
		const slugs = (_elementor_editor_props.stringArrayPropTypeUtil.extract(taxonomiesProp) ?? []).map((item) => _elementor_editor_props.stringPropTypeUtil.extract(item)).filter((slug) => !!slug);
		if (!slugs.length) return [];
		const options = config?.staticOptions ?? [];
		return slugs.map((slug) => options.find((opt) => opt.value === slug)?.label ?? slug);
	}
	function createItemForKey(key) {
		return _elementor_editor_props.queryFilterPropTypeUtil.create({
			key: _elementor_editor_props.stringPropTypeUtil.create(key),
			values: null,
			taxonomies: null
		});
	}
	function getUsedKeys(items) {
		const keys = items.map((item) => _elementor_editor_props.stringPropTypeUtil.extract(item?.value?.key)).filter((key) => !!key);
		return new Set(keys);
	}

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/gap-control.tsx
	var GapControl = ({ label }) => {
		const stackRef = (0, react.useRef)(null);
		const { disabled: sizeDisabled } = useBoundProp(_elementor_editor_props.sizePropTypeUtil);
		const { value: directionValue, setValue: setDirectionValue, propType, placeholder: directionPlaceholder, disabled: directionDisabled } = useBoundProp(_elementor_editor_props.layoutDirectionPropTypeUtil);
		const { value: masterValue, setValue: setMasterValue, placeholder: masterPlaceholder } = useBoundProp();
		const inferIsLinked = () => {
			if (_elementor_editor_props.layoutDirectionPropTypeUtil.isValid(masterValue)) return false;
			if (!masterValue && _elementor_editor_props.layoutDirectionPropTypeUtil.isValid(masterPlaceholder)) return false;
			return true;
		};
		const [isLinked, setIsLinked] = (0, react.useState)(() => inferIsLinked());
		const isCurrentlyDirection = _elementor_editor_props.layoutDirectionPropTypeUtil.isValid(masterValue ?? masterPlaceholder);
		(0, react.useLayoutEffect)(() => {
			setIsLinked(inferIsLinked());
		}, [(0, _elementor_editor_responsive.useActiveBreakpoint)(), isCurrentlyDirection]);
		const onLinkToggle = () => {
			setIsLinked((prev) => !prev);
			if (!_elementor_editor_props.layoutDirectionPropTypeUtil.isValid(masterValue)) {
				const currentValue2 = masterValue ? masterValue : null;
				if (!currentValue2) {
					setMasterValue(null);
					return;
				}
				setMasterValue(_elementor_editor_props.layoutDirectionPropTypeUtil.create({
					row: currentValue2,
					column: currentValue2
				}));
				return;
			}
			const currentValue = directionValue?.column ?? directionValue?.row ?? null;
			setMasterValue(currentValue);
		};
		const tooltipLabel = label.toLowerCase();
		const LinkedIcon = isLinked ? _elementor_icons.LinkIcon : _elementor_icons.DetachIcon;
		const linkedLabel = (0, _wordpress_i18n.__)("Link %s", "elementor").replace("%s", tooltipLabel);
		const unlinkedLabel = (0, _wordpress_i18n.__)("Unlink %s", "elementor").replace("%s", tooltipLabel);
		const disabled = sizeDisabled || directionDisabled;
		const propProviderProps = {
			propType,
			value: directionValue ?? (!isLinked ? {
				row: directionPlaceholder?.row,
				column: directionPlaceholder?.column
			} : null),
			setValue: (directions) => {
				const filtered = Object.entries(directions).filter(([, value]) => Boolean(value));
				setDirectionValue(filtered.length === 0 ? null : Object.fromEntries(filtered));
			},
			placeholder: directionPlaceholder
		};
		const hasPlaceholders = !masterValue && (directionPlaceholder || masterPlaceholder);
		const getEffectivePlaceholder = (bind) => {
			if (isLinked) {
				const linkedPlaceholder = directionPlaceholder?.column ?? directionPlaceholder?.row;
				return _elementor_editor_props.sizePropTypeUtil.extract(linkedPlaceholder);
			}
			return _elementor_editor_props.sizePropTypeUtil.extract(directionPlaceholder?.[bind]);
		};
		return /* @__PURE__ */ react.createElement(PropProvider, { ...propProviderProps }, /* @__PURE__ */ react.createElement(_elementor_ui.Stack, {
			direction: "row",
			gap: 2,
			flexWrap: "nowrap"
		}, /* @__PURE__ */ react.createElement(ControlLabel, null, label), /* @__PURE__ */ react.createElement(_elementor_ui.Tooltip, {
			title: isLinked ? unlinkedLabel : linkedLabel,
			placement: "top"
		}, /* @__PURE__ */ react.createElement(StyledToggleButton, {
			"aria-label": isLinked ? unlinkedLabel : linkedLabel,
			size: "tiny",
			value: "check",
			selected: isLinked,
			sx: { marginLeft: "auto" },
			onChange: onLinkToggle,
			disabled,
			isPlaceholder: hasPlaceholders
		}, /* @__PURE__ */ react.createElement(LinkedIcon, { fontSize: "tiny" })))), /* @__PURE__ */ react.createElement(_elementor_ui.Stack, {
			direction: "row",
			gap: 2,
			flexWrap: "nowrap",
			ref: stackRef
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			container: true,
			gap: .75,
			alignItems: "center"
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 12
		}, /* @__PURE__ */ react.createElement(ControlFormLabel, null, (0, _wordpress_i18n.__)("Column", "elementor"))), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 12
		}, /* @__PURE__ */ react.createElement(Control, {
			bind: "column",
			ariaLabel: (0, _wordpress_i18n.__)("Column gap", "elementor"),
			isLinked,
			anchorRef: stackRef,
			placeholder: getEffectivePlaceholder("column") ?? void 0
		}))), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			container: true,
			gap: .75,
			alignItems: "center"
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 12
		}, /* @__PURE__ */ react.createElement(ControlFormLabel, null, (0, _wordpress_i18n.__)("Row", "elementor"))), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 12
		}, /* @__PURE__ */ react.createElement(Control, {
			bind: "row",
			ariaLabel: (0, _wordpress_i18n.__)("Row gap", "elementor"),
			isLinked,
			anchorRef: stackRef,
			placeholder: getEffectivePlaceholder("row") ?? void 0
		})))));
	};
	var Control = ({ bind, ariaLabel, isLinked, anchorRef, placeholder }) => {
		if (isLinked) return /* @__PURE__ */ react.createElement(UnstableSizeControl, {
			anchorRef,
			placeholder,
			ariaLabel
		});
		return /* @__PURE__ */ react.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ react.createElement(UnstableSizeControl, {
			anchorRef,
			placeholder,
			ariaLabel
		}));
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/aspect-ratio-control.tsx
	var RATIO_OPTIONS = [
		{
			label: (0, _wordpress_i18n.__)("Auto", "elementor"),
			value: "auto"
		},
		{
			label: "1/1",
			value: "1/1"
		},
		{
			label: "4/3",
			value: "4/3"
		},
		{
			label: "3/4",
			value: "3/4"
		},
		{
			label: "16/9",
			value: "16/9"
		},
		{
			label: "9/16",
			value: "9/16"
		},
		{
			label: "3/2",
			value: "3/2"
		},
		{
			label: "2/3",
			value: "2/3"
		}
	];
	var CUSTOM_RATIO = "custom";
	var AspectRatioControl = createControl(({ label }) => {
		const { value: currentPropValue, setValue: setAspectRatioValue, disabled, placeholder: externalPlaceholder } = useBoundProp(_elementor_editor_props.stringPropTypeUtil);
		const aspectRatioValue = currentPropValue ?? externalPlaceholder;
		const isCustomSelected = aspectRatioValue && !RATIO_OPTIONS.some((option) => option.value === aspectRatioValue);
		const [initialWidth, initialHeight] = isCustomSelected ? aspectRatioValue.split("/") : ["", ""];
		const [isCustom, setIsCustom] = (0, react.useState)(isCustomSelected);
		const [customWidth, setCustomWidth] = (0, react.useState)(initialWidth);
		const [customHeight, setCustomHeight] = (0, react.useState)(initialHeight);
		const [selectedValue, setSelectedValue] = (0, react.useState)(isCustomSelected ? CUSTOM_RATIO : aspectRatioValue || "");
		(0, react.useEffect)(() => {
			if (aspectRatioValue && !RATIO_OPTIONS.some((option) => option.value === aspectRatioValue)) {
				const [width, height] = aspectRatioValue.split("/");
				setCustomWidth(width.trim() || "");
				setCustomHeight(height.trim() || "");
				setSelectedValue(CUSTOM_RATIO);
				setIsCustom(true);
			} else {
				setSelectedValue(aspectRatioValue || "");
				setIsCustom(false);
				setCustomWidth("");
				setCustomHeight("");
			}
		}, [aspectRatioValue]);
		const handleSelectChange = (event) => {
			const newValue = event.target.value;
			const isCustomRatio = newValue === CUSTOM_RATIO;
			setIsCustom(isCustomRatio);
			setSelectedValue(newValue);
			if (isCustomRatio) return;
			setAspectRatioValue(newValue);
		};
		const handleCustomWidthChange = (event) => {
			const newWidth = event.target.value;
			setCustomWidth(newWidth);
			if (newWidth && customHeight) setAspectRatioValue(`${newWidth}/${customHeight}`);
		};
		const handleCustomHeightChange = (event) => {
			const newHeight = event.target.value;
			setCustomHeight(newHeight);
			if (customWidth && newHeight) setAspectRatioValue(`${customWidth}/${newHeight}`);
		};
		const lookup = currentPropValue ?? externalPlaceholder;
		const selectedOption = RATIO_OPTIONS.find((option) => option.value === lookup);
		return /* @__PURE__ */ react.createElement(ControlActions, null, /* @__PURE__ */ react.createElement(_elementor_ui.Stack, {
			direction: "column",
			gap: 2
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			container: true,
			gap: 2,
			alignItems: "center",
			flexWrap: "nowrap"
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6
		}, /* @__PURE__ */ react.createElement(ControlLabel, null, label)), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Select, {
			size: "tiny",
			displayEmpty: true,
			sx: { overflow: "hidden" },
			disabled,
			value: selectedValue,
			onChange: handleSelectChange,
			renderValue: isCustomSelected ? void 0 : () => selectedOption?.label,
			fullWidth: true
		}, [...RATIO_OPTIONS, {
			label: (0, _wordpress_i18n.__)("Custom", "elementor"),
			value: CUSTOM_RATIO
		}].map(({ label: optionLabel, ...props }) => /* @__PURE__ */ react.createElement(_elementor_editor_ui.MenuListItem, {
			key: props.value,
			...props,
			value: props.value ?? ""
		}, optionLabel))))), isCustom && /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			container: true,
			gap: 2,
			alignItems: "center",
			flexWrap: "nowrap"
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6
		}, /* @__PURE__ */ react.createElement(_elementor_ui.TextField, {
			size: "tiny",
			type: "number",
			fullWidth: true,
			disabled,
			value: customWidth,
			onChange: handleCustomWidthChange,
			InputProps: { startAdornment: /* @__PURE__ */ react.createElement(_elementor_icons.ArrowsMoveHorizontalIcon, { fontSize: "tiny" }) }
		})), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6
		}, /* @__PURE__ */ react.createElement(_elementor_ui.TextField, {
			size: "tiny",
			type: "number",
			fullWidth: true,
			disabled,
			value: customHeight,
			onChange: handleCustomHeightChange,
			InputProps: { startAdornment: /* @__PURE__ */ react.createElement(_elementor_icons.ArrowsMoveVerticalIcon, { fontSize: "tiny" }) }
		})))));
	});

//#endregion
//#region packages/packages/libs/editor-controls/src/components/enable-unfiltered-modal.tsx
	var ADMIN_TITLE_TEXT = (0, _wordpress_i18n.__)("Enable Unfiltered Uploads", "elementor");
	var ADMIN_CONTENT_TEXT = (0, _wordpress_i18n.__)("Before you enable unfiltered files upload, note that such files include a security risk. Elementor does run a process to remove possible malicious code, but there is still risk involved when using such files.", "elementor");
	var ADMIN_FAILED_CONTENT_TEXT_PT1 = (0, _wordpress_i18n.__)("Failed to enable unfiltered files upload.", "elementor");
	var ADMIN_FAILED_CONTENT_TEXT_PT2 = (0, _wordpress_i18n.__)("You can try again, if the problem persists, please contact support.", "elementor");
	var WAIT_FOR_CLOSE_TIMEOUT_MS = 300;
	var EnableUnfilteredModal = (props) => {
		const { mutateAsync, isPending } = useUpdateUnfilteredFilesUpload();
		const [isError, setIsError] = (0, react.useState)(false);
		const onClose = (enabled) => {
			props.onClose(enabled);
			setTimeout(() => setIsError(false), WAIT_FOR_CLOSE_TIMEOUT_MS);
		};
		const handleEnable = async () => {
			try {
				if ((await mutateAsync({ allowUnfilteredFilesUpload: true }))?.data?.success === false) setIsError(true);
				else props.onClose(true);
			} catch {
				setIsError(true);
			}
		};
		const dialogProps = {
			...props,
			isPending,
			handleEnable,
			isError,
			onClose
		};
		return /* @__PURE__ */ react.createElement(AdminDialog, { ...dialogProps });
	};
	var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @__PURE__ */ react.createElement(_elementor_ui.Dialog, {
		open,
		maxWidth: "sm",
		onClose: () => onClose(false)
	}, /* @__PURE__ */ react.createElement(_elementor_ui.DialogHeader, { logo: false }, /* @__PURE__ */ react.createElement(_elementor_ui.DialogTitle, null, ADMIN_TITLE_TEXT)), /* @__PURE__ */ react.createElement(_elementor_ui.Divider, null), /* @__PURE__ */ react.createElement(_elementor_ui.DialogContent, null, /* @__PURE__ */ react.createElement(_elementor_ui.DialogContentText, null, isError ? /* @__PURE__ */ react.createElement(react.Fragment, null, ADMIN_FAILED_CONTENT_TEXT_PT1, " ", /* @__PURE__ */ react.createElement("br", null), " ", ADMIN_FAILED_CONTENT_TEXT_PT2) : ADMIN_CONTENT_TEXT)), /* @__PURE__ */ react.createElement(_elementor_ui.DialogActions, null, /* @__PURE__ */ react.createElement(_elementor_ui.Button, {
		size: "medium",
		color: "secondary",
		onClick: () => onClose(false)
	}, (0, _wordpress_i18n.__)("Cancel", "elementor")), /* @__PURE__ */ react.createElement(_elementor_ui.Button, {
		size: "medium",
		onClick: () => handleEnable(),
		variant: "contained",
		color: "primary",
		disabled: isPending
	}, isPending ? /* @__PURE__ */ react.createElement(_elementor_ui.CircularProgress, { size: 24 }) : (0, _wordpress_i18n.__)("Enable", "elementor"))));

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/open-icon-library.ts
	var SVG_ICON_LIBRARY = "svg";
	function isSvgLibrarySelection(icon) {
		return icon.library === "svg" && typeof icon.value === "object" && icon.value !== null;
	}
	function openIconLibrary({ selected, onSelect } = {}) {
		const iconManager = window.elementor?.iconManager;
		if (!iconManager) return;
		iconManager.loadIconLibraries();
		iconManager.show({ view: createIconManagerControlView(selected, onSelect) });
	}
	function enqueueIconFonts(library) {
		window.elementor?.helpers?.enqueueIconFonts?.(library);
	}
	function createIconManagerControlView(selected, onSelect) {
		return {
			model: { get: () => false },
			getControlValue: () => selected ?? {
				value: "",
				library: ""
			},
			setValue: (icon) => {
				onSelect?.(icon);
			},
			applySavedValue: () => void 0
		};
	}
	function createIconPropValue(icon, library) {
		return {
			value: _elementor_editor_props.stringPropTypeUtil.create(icon),
			library: _elementor_editor_props.stringPropTypeUtil.create(library)
		};
	}

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/svg-media-control.tsx
	var TILE_SIZE = 8;
	var TILE_WHITE = "transparent";
	var TILE_BLACK = "#c1c1c1";
	var ICON_PREVIEW_FONT_SIZE = 50;
	var TILES_GRADIENT_FORMULA = `linear-gradient(45deg, ${TILE_BLACK} 25%, ${TILE_WHITE} 0, ${TILE_WHITE} 75%, ${TILE_BLACK} 0, ${TILE_BLACK})`;
	var StyledCard = (0, _elementor_ui.styled)(_elementor_ui.Card)`
	background-color: white;
	background-image: ${TILES_GRADIENT_FORMULA}, ${TILES_GRADIENT_FORMULA};
	background-size: ${TILE_SIZE}px ${TILE_SIZE}px;
	background-position:
		0 0,
		${TILE_SIZE / 2}px ${TILE_SIZE / 2}px;
	border: none;
`;
	var StyledCardMediaContainer = (0, _elementor_ui.styled)(_elementor_ui.Stack)`
	position: relative;
	height: 140px;
	object-fit: contain;
	padding: 5px;
	justify-content: center;
	align-items: center;
	background-color: rgba( 255, 255, 255, 0.37 );
`;
	var MODE_BROWSE = { mode: "browse" };
	var MODE_UPLOAD = { mode: "upload" };
	var SvgMediaControl = createControl(({ showIconLibrary = false }) => {
		const { value: svgValue, setValue: setSvgValue } = useBoundProp(_elementor_editor_props.svgSrcPropTypeUtil);
		const { value: iconValue, setValue: setIconValue } = useBoundProp(_elementor_editor_props.iconPropTypeUtil);
		const id = svgValue?.id;
		const url = svgValue?.url;
		const { data: attachment, isFetching } = (0, _elementor_wp_media.useWpMediaAttachment)(id?.value || null);
		const src = attachment?.url ?? url?.value ?? null;
		const { data: allowSvgUpload } = useUnfilteredFilesUpload();
		const [unfilteredModalOpenState, setUnfilteredModalOpenState] = (0, react.useState)(false);
		const { isAdmin } = (0, _elementor_editor_current_user.useCurrentUserCapabilities)();
		const selectedIconClass = showIconLibrary && typeof iconValue?.value?.value === "string" ? iconValue.value.value : null;
		const selectedIconLibrary = showIconLibrary && typeof iconValue?.library?.value === "string" ? iconValue.library.value : null;
		const { open } = (0, _elementor_wp_media.useWpMediaFrame)({
			mediaTypes: ["svg"],
			multiple: false,
			selected: id?.value || null,
			onSelect: (selectedAttachment) => {
				setSvgValue({
					id: {
						$$type: "image-attachment-id",
						value: selectedAttachment.id
					},
					url: _elementor_editor_props.urlPropTypeUtil.create(selectedAttachment.url)
				});
			}
		});
		const onCloseUnfilteredModal = (enabled) => {
			setUnfilteredModalOpenState(false);
			if (enabled) open(MODE_UPLOAD);
		};
		const handleClick = (openOptions) => {
			if (!allowSvgUpload && openOptions === MODE_UPLOAD) setUnfilteredModalOpenState(true);
			else open(openOptions);
		};
		const handleIconLibrarySelect = (icon) => {
			if (!showIconLibrary) return;
			if (isSvgLibrarySelection(icon)) {
				setSvgValue({
					id: icon.value.id ? {
						$$type: "image-attachment-id",
						value: icon.value.id
					} : null,
					url: icon.value.url ? _elementor_editor_props.urlPropTypeUtil.create(icon.value.url) : null
				});
				return;
			}
			if (typeof icon.value === "string") setIconValue(createIconPropValue(icon.value, icon.library));
		};
		const infotipProps = {
			title: (0, _wordpress_i18n.__)("Sorry, you can't upload that file yet.", "elementor"),
			description: /* @__PURE__ */ react.createElement(react.Fragment, null, (0, _wordpress_i18n.__)("To upload them anyway, ask the site administrator to enable unfiltered", "elementor"), /* @__PURE__ */ react.createElement("br", null), (0, _wordpress_i18n.__)("file uploads.", "elementor")),
			isEnabled: !isAdmin
		};
		return /* @__PURE__ */ react.createElement(_elementor_ui.Stack, {
			gap: 1,
			"aria-label": "SVG Control"
		}, /* @__PURE__ */ react.createElement(EnableUnfilteredModal, {
			open: unfilteredModalOpenState,
			onClose: onCloseUnfilteredModal
		}), /* @__PURE__ */ react.createElement(ControlActions, null, /* @__PURE__ */ react.createElement(StyledCard, { variant: "outlined" }, /* @__PURE__ */ react.createElement(StyledCardMediaContainer, null, /* @__PURE__ */ react.createElement(SvgMediaPreview, {
			isFetching,
			src,
			iconClassName: selectedIconClass,
			iconLibrary: selectedIconLibrary
		})), /* @__PURE__ */ react.createElement(_elementor_ui.CardOverlay, { sx: { "&:hover": { backgroundColor: "rgba( 0, 0, 0, 0.75 )" } } }, /* @__PURE__ */ react.createElement(_elementor_ui.Stack, { gap: 1 }, /* @__PURE__ */ react.createElement(_elementor_ui.Button, {
			size: "tiny",
			color: "inherit",
			variant: "outlined",
			onClick: () => handleClick(MODE_BROWSE),
			"aria-label": "Select SVG"
		}, (0, _wordpress_i18n.__)("Select SVG", "elementor")), showIconLibrary ? /* @__PURE__ */ react.createElement(_elementor_ui.Button, {
			size: "tiny",
			variant: "text",
			color: "inherit",
			onClick: () => openIconLibrary({
				selected: selectedIconClass && selectedIconLibrary ? {
					value: selectedIconClass,
					library: selectedIconLibrary
				} : void 0,
				onSelect: handleIconLibrarySelect
			}),
			"aria-label": (0, _wordpress_i18n.__)("Icon library", "elementor")
		}, (0, _wordpress_i18n.__)("Icon library", "elementor")) : null, /* @__PURE__ */ react.createElement(ConditionalControlInfotip, { ...infotipProps }, /* @__PURE__ */ react.createElement("span", null, /* @__PURE__ */ react.createElement(_elementor_ui.ThemeProvider, { colorScheme: isAdmin ? "light" : "dark" }, /* @__PURE__ */ react.createElement(_elementor_ui.Button, {
			size: "tiny",
			variant: "text",
			color: "inherit",
			startIcon: /* @__PURE__ */ react.createElement(_elementor_icons.UploadIcon, null),
			disabled: !isAdmin,
			onClick: () => isAdmin && handleClick(MODE_UPLOAD),
			"aria-label": "Upload SVG"
		}, (0, _wordpress_i18n.__)("Upload", "elementor"))))))))));
	});
	function SvgMediaPreview({ isFetching, src, iconClassName, iconLibrary }) {
		(0, react.useEffect)(() => {
			if (iconLibrary) enqueueIconFonts(iconLibrary);
		}, [iconLibrary]);
		if (isFetching) return /* @__PURE__ */ react.createElement(_elementor_ui.CircularProgress, { role: "progressbar" });
		if (iconClassName) return /* @__PURE__ */ react.createElement(_elementor_ui.Box, {
			component: "i",
			className: iconClassName,
			"aria-label": (0, _wordpress_i18n.__)("Preview icon", "elementor"),
			sx: { fontSize: ICON_PREVIEW_FONT_SIZE }
		});
		return /* @__PURE__ */ react.createElement(_elementor_ui.CardMedia, {
			component: "img",
			image: src,
			alt: (0, _wordpress_i18n.__)("Preview SVG", "elementor"),
			sx: {
				maxHeight: "140px",
				width: `${ICON_PREVIEW_FONT_SIZE}px`
			}
		});
	}

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/video-media-control.tsx
	var PLACEHOLDER_IMAGE = window.elementorCommon?.config?.urls?.assets + "/shapes/play-triangle.svg";
	var VideoMediaControl = createControl(() => {
		const { value, setValue, propType } = useBoundProp(_elementor_editor_props.videoSrcPropTypeUtil);
		const { id, url } = value ?? {};
		const { data: attachment, isFetching } = (0, _elementor_wp_media.useWpMediaAttachment)(id?.value || null);
		const videoUrl = attachment?.url ?? url?.value ?? null;
		const defaultUrl = _elementor_editor_props.videoSrcPropTypeUtil.extract(propType.default ?? null)?.url?.value;
		const currentUrlForModal = url?.value && url.value !== defaultUrl ? url.value : void 0;
		const { open } = (0, _elementor_wp_media.useWpMediaFrame)({
			mediaTypes: ["video"],
			multiple: false,
			selected: id?.value || null,
			allowUrlImport: true,
			onSelect: (selectedAttachment) => {
				setValue({
					id: {
						$$type: "video-attachment-id",
						value: selectedAttachment.id
					},
					url: null
				});
			},
			onSelectUrl: (selectedUrl) => {
				setValue({
					id: null,
					url: _elementor_editor_props.urlPropTypeUtil.create(selectedUrl)
				});
			}
		});
		return /* @__PURE__ */ react.createElement(ControlActions, null, /* @__PURE__ */ react.createElement(_elementor_ui.Card, { variant: "outlined" }, /* @__PURE__ */ react.createElement(_elementor_ui.CardMedia, { sx: {
			height: 140,
			backgroundColor: "white",
			backgroundSize: "8px 8px",
			backgroundPosition: "0 0, 4px 4px",
			backgroundRepeat: "repeat",
			backgroundImage: `${TILES_GRADIENT_FORMULA}, ${TILES_GRADIENT_FORMULA}`,
			display: "flex",
			justifyContent: "center",
			alignItems: "center"
		} }, /* @__PURE__ */ react.createElement(VideoPreview, {
			isFetching,
			videoUrl
		})), /* @__PURE__ */ react.createElement(_elementor_ui.CardOverlay, null, /* @__PURE__ */ react.createElement(_elementor_ui.Stack, { gap: 1 }, /* @__PURE__ */ react.createElement(_elementor_ui.Button, {
			size: "tiny",
			color: "inherit",
			variant: "outlined",
			onClick: () => open({ mode: "browse" })
		}, (0, _wordpress_i18n.__)("Select video", "elementor")), /* @__PURE__ */ react.createElement(_elementor_ui.Button, {
			size: "tiny",
			variant: "text",
			color: "inherit",
			startIcon: /* @__PURE__ */ react.createElement(_elementor_icons.UploadIcon, null),
			onClick: () => open({ mode: "upload" })
		}, (0, _wordpress_i18n.__)("Upload", "elementor")), /* @__PURE__ */ react.createElement(_elementor_ui.Button, {
			size: "tiny",
			variant: "text",
			color: "inherit",
			onClick: () => open({
				mode: "url",
				currentUrl: currentUrlForModal
			})
		}, (0, _wordpress_i18n.__)("Insert from URL", "elementor"))))));
	});
	var VideoPreview = ({ isFetching = false, videoUrl }) => {
		if (isFetching) return /* @__PURE__ */ react.createElement(_elementor_ui.CircularProgress, null);
		if (videoUrl) return /* @__PURE__ */ react.createElement("video", {
			"aria-label": (0, _wordpress_i18n.__)("Video preview", "elementor"),
			src: videoUrl,
			muted: true,
			preload: "metadata",
			style: {
				width: "100%",
				height: "100%",
				objectFit: "cover",
				pointerEvents: "none"
			}
		});
		return /* @__PURE__ */ react.createElement("img", {
			src: PLACEHOLDER_IMAGE,
			alt: "No video selected"
		});
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/env.ts
	var { env } = (0, _elementor_env.parseEnv)("@elementor/editor-controls");

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/background-control/background-gradient-color-control.tsx
	var BackgroundGradientColorControl = createControl(() => {
		const { value, setValue } = useBoundProp(_elementor_editor_props.backgroundGradientOverlayPropTypeUtil);
		const handleChange = (newValue) => {
			const transformedValue = createTransformableValue(newValue);
			if (transformedValue.positions) transformedValue.positions = _elementor_editor_props.stringPropTypeUtil.create(newValue.positions.join(" "));
			setValue(transformedValue);
		};
		const createTransformableValue = (newValue) => ({
			...newValue,
			type: _elementor_editor_props.stringPropTypeUtil.create(newValue.type),
			angle: _elementor_editor_props.numberPropTypeUtil.create(newValue.angle),
			stops: _elementor_editor_props.gradientColorStopPropTypeUtil.create(newValue.stops.map(({ color, offset }) => _elementor_editor_props.colorStopPropTypeUtil.create({
				color: _elementor_editor_props.colorPropTypeUtil.create(color),
				offset: _elementor_editor_props.numberPropTypeUtil.create(offset)
			})))
		});
		const normalizeValue = () => {
			if (!value) return;
			const { type, angle, stops, positions } = value;
			return {
				type: type.value,
				angle: angle?.value || 0,
				stops: stops.value.map(({ value: { color, offset } }, index, arr) => ({
					color: color.value,
					offset: offset?.value ?? (arr.length > 1 ? index / (arr.length - 1) * 100 : 0)
				})),
				positions: positions?.value.split(" ")
			};
		};
		return /* @__PURE__ */ react.createElement(_elementor_ui.UnstableGradientBox, {
			sx: {
				width: "auto",
				padding: 1.5
			},
			value: normalizeValue(),
			onChange: handleChange
		});
	});
	var initialBackgroundGradientOverlay = _elementor_editor_props.backgroundGradientOverlayPropTypeUtil.create({
		type: _elementor_editor_props.stringPropTypeUtil.create("linear"),
		angle: _elementor_editor_props.numberPropTypeUtil.create(180),
		stops: _elementor_editor_props.gradientColorStopPropTypeUtil.create([_elementor_editor_props.colorStopPropTypeUtil.create({
			color: _elementor_editor_props.colorPropTypeUtil.create("rgb(0,0,0)"),
			offset: _elementor_editor_props.numberPropTypeUtil.create(0)
		}), _elementor_editor_props.colorStopPropTypeUtil.create({
			color: _elementor_editor_props.colorPropTypeUtil.create("rgb(255,255,255)"),
			offset: _elementor_editor_props.numberPropTypeUtil.create(100)
		})])
	});

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-attachment.tsx
	var attachmentControlOptions = [{
		value: "fixed",
		label: (0, _wordpress_i18n.__)("Fixed", "elementor"),
		renderContent: ({ size }) => /* @__PURE__ */ react.createElement(_elementor_icons.PinIcon, { fontSize: size }),
		showTooltip: true
	}, {
		value: "scroll",
		label: (0, _wordpress_i18n.__)("Scroll", "elementor"),
		renderContent: ({ size }) => /* @__PURE__ */ react.createElement(_elementor_icons.PinnedOffIcon, { fontSize: size }),
		showTooltip: true
	}];
	var BackgroundImageOverlayAttachment = () => {
		return /* @__PURE__ */ react.createElement(PopoverGridContainer, null, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6
		}, /* @__PURE__ */ react.createElement(ControlFormLabel, null, (0, _wordpress_i18n.__)("Attachment", "elementor"))), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6,
			sx: {
				display: "flex",
				justifyContent: "flex-end",
				overflow: "hidden"
			}
		}, /* @__PURE__ */ react.createElement(ToggleControl, { options: attachmentControlOptions })));
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx
	var backgroundPositionOptions = [
		{
			label: (0, _wordpress_i18n.__)("Center center", "elementor"),
			value: "center center"
		},
		{
			label: (0, _wordpress_i18n.__)("Center left", "elementor"),
			value: "center left"
		},
		{
			label: (0, _wordpress_i18n.__)("Center right", "elementor"),
			value: "center right"
		},
		{
			label: (0, _wordpress_i18n.__)("Top center", "elementor"),
			value: "top center"
		},
		{
			label: (0, _wordpress_i18n.__)("Top left", "elementor"),
			value: "top left"
		},
		{
			label: (0, _wordpress_i18n.__)("Top right", "elementor"),
			value: "top right"
		},
		{
			label: (0, _wordpress_i18n.__)("Bottom center", "elementor"),
			value: "bottom center"
		},
		{
			label: (0, _wordpress_i18n.__)("Bottom left", "elementor"),
			value: "bottom left"
		},
		{
			label: (0, _wordpress_i18n.__)("Bottom right", "elementor"),
			value: "bottom right"
		},
		{
			label: (0, _wordpress_i18n.__)("Custom", "elementor"),
			value: "custom"
		}
	];
	var BackgroundImageOverlayPosition = () => {
		const backgroundImageOffsetContext = useBoundProp(_elementor_editor_props.backgroundImagePositionOffsetPropTypeUtil);
		const stringPropContext = useBoundProp(_elementor_editor_props.stringPropTypeUtil);
		const isCustom = !!backgroundImageOffsetContext.value;
		const rowRef = (0, react.useRef)(null);
		const handlePositionChange = (event) => {
			const value = event.target.value || null;
			if (value === "custom") backgroundImageOffsetContext.setValue({
				x: null,
				y: null
			});
			else stringPropContext.setValue(value);
		};
		return /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			container: true,
			spacing: 1.5
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 12
		}, /* @__PURE__ */ react.createElement(PopoverGridContainer, null, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6
		}, /* @__PURE__ */ react.createElement(ControlFormLabel, null, (0, _wordpress_i18n.__)("Position", "elementor"))), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6,
			sx: {
				display: "flex",
				justifyContent: "flex-end",
				overflow: "hidden"
			}
		}, /* @__PURE__ */ react.createElement(ControlActions, null, /* @__PURE__ */ react.createElement(_elementor_ui.Select, {
			fullWidth: true,
			size: "tiny",
			onChange: handlePositionChange,
			disabled: stringPropContext.disabled,
			value: (backgroundImageOffsetContext.value ? "custom" : stringPropContext.value) ?? ""
		}, backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */ react.createElement(_elementor_editor_ui.MenuListItem, {
			key: value,
			value: value ?? ""
		}, label))))))), isCustom ? /* @__PURE__ */ react.createElement(PropProvider, { ...backgroundImageOffsetContext }, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 12
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			container: true,
			spacing: 1.5,
			ref: rowRef
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6
		}, /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "x" }, /* @__PURE__ */ react.createElement(SizeControl, {
			startIcon: /* @__PURE__ */ react.createElement(_elementor_icons.LetterXIcon, { fontSize: "tiny" }),
			anchorRef: rowRef,
			min: -Number.MAX_SAFE_INTEGER
		}))), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6
		}, /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "y" }, /* @__PURE__ */ react.createElement(SizeControl, {
			startIcon: /* @__PURE__ */ react.createElement(_elementor_icons.LetterYIcon, { fontSize: "tiny" }),
			anchorRef: rowRef,
			min: -Number.MAX_SAFE_INTEGER
		})))))) : null);
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-repeat.tsx
	var repeatControlOptions = [
		{
			value: "repeat",
			label: (0, _wordpress_i18n.__)("Repeat", "elementor"),
			renderContent: ({ size }) => /* @__PURE__ */ react.createElement(_elementor_icons.GridDotsIcon, { fontSize: size }),
			showTooltip: true
		},
		{
			value: "repeat-x",
			label: (0, _wordpress_i18n.__)("Repeat-x", "elementor"),
			renderContent: ({ size }) => /* @__PURE__ */ react.createElement(_elementor_icons.DotsHorizontalIcon, { fontSize: size }),
			showTooltip: true
		},
		{
			value: "repeat-y",
			label: (0, _wordpress_i18n.__)("Repeat-y", "elementor"),
			renderContent: ({ size }) => /* @__PURE__ */ react.createElement(_elementor_icons.DotsVerticalIcon, { fontSize: size }),
			showTooltip: true
		},
		{
			value: "no-repeat",
			label: (0, _wordpress_i18n.__)("No-repeat", "elementor"),
			renderContent: ({ size }) => /* @__PURE__ */ react.createElement(_elementor_icons.XIcon, { fontSize: size }),
			showTooltip: true
		}
	];
	var BackgroundImageOverlayRepeat = () => {
		return /* @__PURE__ */ react.createElement(PopoverGridContainer, null, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6
		}, /* @__PURE__ */ react.createElement(ControlFormLabel, null, (0, _wordpress_i18n.__)("Repeat", "elementor"))), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6,
			sx: {
				display: "flex",
				justifyContent: "flex-end"
			}
		}, /* @__PURE__ */ react.createElement(ToggleControl, { options: repeatControlOptions })));
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx
	var sizeControlOptions = [
		{
			value: "auto",
			label: (0, _wordpress_i18n.__)("Auto", "elementor"),
			renderContent: ({ size }) => /* @__PURE__ */ react.createElement(_elementor_icons.LetterAIcon, { fontSize: size }),
			showTooltip: true
		},
		{
			value: "cover",
			label: (0, _wordpress_i18n.__)("Cover", "elementor"),
			renderContent: ({ size }) => /* @__PURE__ */ react.createElement(_elementor_icons.ArrowsMaximizeIcon, { fontSize: size }),
			showTooltip: true
		},
		{
			value: "contain",
			label: (0, _wordpress_i18n.__)("Contain", "elementor"),
			renderContent: ({ size }) => /* @__PURE__ */ react.createElement(_elementor_icons.ArrowBarBothIcon, { fontSize: size }),
			showTooltip: true
		},
		{
			value: "custom",
			label: (0, _wordpress_i18n.__)("Custom", "elementor"),
			renderContent: ({ size }) => /* @__PURE__ */ react.createElement(_elementor_icons.PencilIcon, { fontSize: size }),
			showTooltip: true
		}
	];
	var BackgroundImageOverlaySize = () => {
		const backgroundImageScaleContext = useBoundProp(_elementor_editor_props.backgroundImageSizeScalePropTypeUtil);
		const stringPropContext = useBoundProp(_elementor_editor_props.stringPropTypeUtil);
		const isCustom = !!backgroundImageScaleContext.value;
		const rowRef = (0, react.useRef)(null);
		const handleSizeChange = (size) => {
			if (size === "custom") backgroundImageScaleContext.setValue({
				width: null,
				height: null
			});
			else stringPropContext.setValue(size);
		};
		return /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			container: true,
			spacing: 1.5
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 12
		}, /* @__PURE__ */ react.createElement(PopoverGridContainer, null, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6
		}, /* @__PURE__ */ react.createElement(ControlFormLabel, null, (0, _wordpress_i18n.__)("Size", "elementor"))), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6,
			sx: {
				display: "flex",
				justifyContent: "flex-end"
			}
		}, /* @__PURE__ */ react.createElement(ControlToggleButtonGroup, {
			exclusive: true,
			items: sizeControlOptions,
			onChange: handleSizeChange,
			disabled: stringPropContext.disabled,
			value: backgroundImageScaleContext.value ? "custom" : stringPropContext.value
		})))), isCustom ? /* @__PURE__ */ react.createElement(PropProvider, { ...backgroundImageScaleContext }, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 12,
			ref: rowRef
		}, /* @__PURE__ */ react.createElement(PopoverGridContainer, null, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6
		}, /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "width" }, /* @__PURE__ */ react.createElement(SizeControl, {
			startIcon: /* @__PURE__ */ react.createElement(_elementor_icons.ArrowsMoveHorizontalIcon, { fontSize: "tiny" }),
			extendedOptions: ["auto"],
			anchorRef: rowRef
		}))), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6
		}, /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "height" }, /* @__PURE__ */ react.createElement(SizeControl, {
			startIcon: /* @__PURE__ */ react.createElement(_elementor_icons.ArrowsMoveVerticalIcon, { fontSize: "tiny" }),
			extendedOptions: ["auto"],
			anchorRef: rowRef
		})))))) : null);
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/background-control/background-overlay/use-background-tabs-history.ts
	var useBackgroundTabsHistory = ({ color: initialBackgroundColorOverlay, image: initialBackgroundImageOverlay, gradient: initialBackgroundGradientOverlay }) => {
		const { value: imageValue, setValue: setImageValue } = useBoundProp(_elementor_editor_props.backgroundImageOverlayPropTypeUtil);
		const { value: colorValue, setValue: setColorValue } = useBoundProp(_elementor_editor_props.backgroundColorOverlayPropTypeUtil);
		const { value: gradientValue, setValue: setGradientValue } = useBoundProp(_elementor_editor_props.backgroundGradientOverlayPropTypeUtil);
		const getCurrentOverlayType = () => {
			if (colorValue) return "color";
			if (gradientValue) return "gradient";
			return "image";
		};
		const { getTabsProps, getTabProps, getTabPanelProps } = (0, _elementor_ui.useTabs)(getCurrentOverlayType());
		const valuesHistory = (0, react.useRef)({
			image: initialBackgroundImageOverlay,
			color: initialBackgroundColorOverlay,
			gradient: initialBackgroundGradientOverlay
		});
		const saveToHistory = (key, value) => {
			if (value) valuesHistory.current[key] = value;
		};
		const onTabChange = (e, tabName) => {
			switch (tabName) {
				case "image":
					setImageValue(valuesHistory.current.image);
					saveToHistory("color", colorValue);
					saveToHistory("gradient", gradientValue);
					break;
				case "gradient":
					setGradientValue(valuesHistory.current.gradient);
					saveToHistory("color", colorValue);
					saveToHistory("image", imageValue);
					break;
				case "color":
					setColorValue(valuesHistory.current.color);
					saveToHistory("image", imageValue);
					saveToHistory("gradient", gradientValue);
			}
			return getTabsProps().onChange(e, tabName);
		};
		return {
			getTabProps,
			getTabPanelProps,
			getTabsProps: () => ({
				...getTabsProps(),
				onChange: onTabChange
			})
		};
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
	var DEFAULT_BACKGROUND_COLOR_OVERLAY_COLOR = "#00000033";
	var initialBackgroundColorOverlay = _elementor_editor_props.backgroundColorOverlayPropTypeUtil.create({ color: _elementor_editor_props.colorPropTypeUtil.create(DEFAULT_BACKGROUND_COLOR_OVERLAY_COLOR) });
	var getInitialBackgroundOverlay = () => ({
		$$type: "background-image-overlay",
		value: { image: {
			$$type: "image",
			value: {
				src: {
					$$type: "image-src",
					value: {
						url: {
							$$type: "url",
							value: env.background_placeholder_image
						},
						id: null
					}
				},
				size: {
					$$type: "string",
					value: "large"
				}
			}
		} }
	});
	var backgroundResolutionOptions = [
		{
			label: (0, _wordpress_i18n.__)("Thumbnail - 150 x 150", "elementor"),
			value: "thumbnail"
		},
		{
			label: (0, _wordpress_i18n.__)("Medium - 300 x 300", "elementor"),
			value: "medium"
		},
		{
			label: (0, _wordpress_i18n.__)("Large 1024 x 1024", "elementor"),
			value: "large"
		},
		{
			label: (0, _wordpress_i18n.__)("Full", "elementor"),
			value: "full"
		}
	];
	var BackgroundOverlayRepeaterControl = createControl(() => {
		const { propType, value: overlayValues, setValue } = useBoundProp(_elementor_editor_props.backgroundOverlayPropTypeUtil);
		return /* @__PURE__ */ react.createElement(PropProvider, {
			propType,
			value: overlayValues,
			setValue
		}, /* @__PURE__ */ react.createElement(ControlRepeater, {
			initial: getInitialBackgroundOverlay(),
			propTypeUtil: _elementor_editor_props.backgroundOverlayPropTypeUtil
		}, /* @__PURE__ */ react.createElement(RepeaterHeader, { label: (0, _wordpress_i18n.__)("Overlay", "elementor") }, /* @__PURE__ */ react.createElement(TooltipAddItemAction, { newItemIndex: 0 })), /* @__PURE__ */ react.createElement(ItemsContainer, null, /* @__PURE__ */ react.createElement(Item, {
			Icon: ItemIcon$1,
			Label: ItemLabel$1,
			actions: /* @__PURE__ */ react.createElement(react.Fragment, null, /* @__PURE__ */ react.createElement(DuplicateItemAction, null), /* @__PURE__ */ react.createElement(DisableItemAction, null), /* @__PURE__ */ react.createElement(RemoveItemAction, null))
		})), /* @__PURE__ */ react.createElement(EditItemPopover, null, /* @__PURE__ */ react.createElement(ItemContent, null))));
	});
	var ItemContent = () => {
		const { getTabsProps, getTabProps, getTabPanelProps } = useBackgroundTabsHistory({
			image: getInitialBackgroundOverlay().value,
			color: initialBackgroundColorOverlay.value,
			gradient: initialBackgroundGradientOverlay.value
		});
		const { rowRef } = useRepeaterContext();
		return /* @__PURE__ */ react.createElement(_elementor_ui.Box, { sx: { width: "100%" } }, /* @__PURE__ */ react.createElement(_elementor_ui.Box, { sx: {
			borderBottom: 1,
			borderColor: "divider"
		} }, /* @__PURE__ */ react.createElement(_elementor_ui.Tabs, {
			size: "small",
			variant: "fullWidth",
			...getTabsProps(),
			"aria-label": (0, _wordpress_i18n.__)("Background Overlay", "elementor")
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Tab, {
			label: (0, _wordpress_i18n.__)("Image", "elementor"),
			...getTabProps("image")
		}), /* @__PURE__ */ react.createElement(_elementor_ui.Tab, {
			label: (0, _wordpress_i18n.__)("Gradient", "elementor"),
			...getTabProps("gradient")
		}), /* @__PURE__ */ react.createElement(_elementor_ui.Tab, {
			label: (0, _wordpress_i18n.__)("Color", "elementor"),
			...getTabProps("color")
		}))), /* @__PURE__ */ react.createElement(_elementor_ui.TabPanel, {
			sx: { p: 1.5 },
			...getTabPanelProps("image")
		}, /* @__PURE__ */ react.createElement(PopoverContent, null, /* @__PURE__ */ react.createElement(ImageOverlayContent, null))), /* @__PURE__ */ react.createElement(_elementor_ui.TabPanel, {
			sx: { p: 1.5 },
			...getTabPanelProps("gradient")
		}, /* @__PURE__ */ react.createElement(BackgroundGradientColorControl, null)), /* @__PURE__ */ react.createElement(_elementor_ui.TabPanel, {
			sx: { p: 1.5 },
			...getTabPanelProps("color")
		}, /* @__PURE__ */ react.createElement(PopoverContent, null, /* @__PURE__ */ react.createElement(ColorOverlayContent, { anchorEl: rowRef }))));
	};
	var ItemIcon$1 = /* @__PURE__ */ __name(({ value }) => {
		switch (value.$$type) {
			case "background-image-overlay": return /* @__PURE__ */ react.createElement(ItemIconImage, { value });
			case "background-color-overlay": return /* @__PURE__ */ react.createElement(ItemIconColor, { value });
			case "background-gradient-overlay": return /* @__PURE__ */ react.createElement(ItemIconGradient, { value });
			default: return null;
		}
	}, "ItemIcon");
	var extractColorFrom = (prop) => {
		if (prop?.value?.color?.value) return prop.value.color.value;
		return "";
	};
	var ItemIconColor = ({ value: prop }) => {
		const color = extractColorFrom(prop);
		return /* @__PURE__ */ react.createElement(StyledUnstableColorIndicator, {
			size: "inherit",
			component: "span",
			value: color
		});
	};
	var ItemIconImage = ({ value }) => {
		const { imageUrl } = useImage(value);
		return /* @__PURE__ */ react.createElement(_elementor_ui.CardMedia, {
			image: imageUrl,
			sx: (theme) => ({
				height: "1rem",
				width: "1rem",
				borderRadius: `${theme.shape.borderRadius / 2}px`,
				outline: `1px solid ${theme.palette.action.disabled}`
			})
		});
	};
	var ItemIconGradient = ({ value }) => {
		const gradient = getGradientValue(value);
		return /* @__PURE__ */ react.createElement(StyledUnstableColorIndicator, {
			size: "inherit",
			component: "span",
			value: gradient
		});
	};
	var ItemLabel$1 = /* @__PURE__ */ __name(({ value }) => {
		switch (value.$$type) {
			case "background-image-overlay": return /* @__PURE__ */ react.createElement(ItemLabelImage, { value });
			case "background-color-overlay": return /* @__PURE__ */ react.createElement(ItemLabelColor, { value });
			case "background-gradient-overlay": return /* @__PURE__ */ react.createElement(ItemLabelGradient, { value });
			default: return null;
		}
	}, "ItemLabel");
	var ItemLabelColor = ({ value: prop }) => {
		const color = extractColorFrom(prop);
		return /* @__PURE__ */ react.createElement("span", null, color);
	};
	var ItemLabelImage = ({ value }) => {
		const { imageTitle } = useImage(value);
		return /* @__PURE__ */ react.createElement("span", null, imageTitle);
	};
	var ItemLabelGradient = ({ value }) => {
		if (value.value.type.value === "linear") return /* @__PURE__ */ react.createElement("span", null, (0, _wordpress_i18n.__)("Linear Gradient", "elementor"));
		return /* @__PURE__ */ react.createElement("span", null, (0, _wordpress_i18n.__)("Radial Gradient", "elementor"));
	};
	var ColorOverlayContent = ({ anchorEl }) => {
		const propContext = useBoundProp(_elementor_editor_props.backgroundColorOverlayPropTypeUtil);
		return /* @__PURE__ */ react.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ react.createElement(ColorControl, { anchorEl })));
	};
	var ImageOverlayContent = () => {
		const propContext = useBoundProp(_elementor_editor_props.backgroundImageOverlayPropTypeUtil);
		return /* @__PURE__ */ react.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "image" }, /* @__PURE__ */ react.createElement(ImageControl, { sizes: backgroundResolutionOptions })), /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "position" }, /* @__PURE__ */ react.createElement(BackgroundImageOverlayPosition, null)), /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "repeat" }, /* @__PURE__ */ react.createElement(BackgroundImageOverlayRepeat, null)), /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ react.createElement(BackgroundImageOverlaySize, null)), /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "attachment" }, /* @__PURE__ */ react.createElement(BackgroundImageOverlayAttachment, null)));
	};
	var StyledUnstableColorIndicator = (0, _elementor_ui.styled)(_elementor_ui.UnstableColorIndicator)(({ theme }) => ({
		height: "1rem",
		width: "1rem",
		borderRadius: `${theme.shape.borderRadius / 2}px`
	}));
	var useImage = (image) => {
		let imageTitle;
		let imageUrl = null;
		const imageSrc = image?.value.image.value?.src.value;
		const { data: attachment } = (0, _elementor_wp_media.useWpMediaAttachment)(imageSrc.id?.value || null);
		if (imageSrc.id) {
			const imageFileTypeExtension = getFileExtensionFromFilename(attachment?.filename);
			imageTitle = `${attachment?.title}${imageFileTypeExtension}` || null;
			imageUrl = attachment?.url || null;
		} else if (imageSrc.url) {
			imageUrl = imageSrc.url.value;
			imageTitle = imageUrl?.substring(imageUrl.lastIndexOf("/") + 1) || null;
		}
		return {
			imageTitle,
			imageUrl
		};
	};
	var getFileExtensionFromFilename = (filename) => {
		if (!filename) return "";
		return `.${filename.substring(filename.lastIndexOf(".") + 1)}`;
	};
	var getGradientValue = (value) => {
		const gradient = value.value;
		const stops = gradient.stops.value?.map(({ value: { color, offset } }) => offset ? `${color.value} ${offset.value ?? 0}%` : `${color.value}`)?.join(",");
		if (gradient.type.value === "linear") return `linear-gradient(${gradient.angle.value}deg, ${stops})`;
		return `radial-gradient(circle at ${gradient.positions.value}, ${stops})`;
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/background-control/background-control.tsx
	var clipOptions = [
		{
			label: (0, _wordpress_i18n.__)("Full element", "elementor"),
			value: "border-box"
		},
		{
			label: (0, _wordpress_i18n.__)("Padding edges", "elementor"),
			value: "padding-box"
		},
		{
			label: (0, _wordpress_i18n.__)("Content edges", "elementor"),
			value: "content-box"
		},
		{
			label: (0, _wordpress_i18n.__)("Text", "elementor"),
			value: "text"
		}
	];
	var colorLabel = (0, _wordpress_i18n.__)("Color", "elementor");
	var clipLabel = (0, _wordpress_i18n.__)("Clipping", "elementor");
	var BackgroundControl = createControl(() => {
		const propContext = useBoundProp(_elementor_editor_props.backgroundPropTypeUtil);
		return /* @__PURE__ */ react.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "background-overlay" }, /* @__PURE__ */ react.createElement(BackgroundOverlayRepeaterControl, null)), /* @__PURE__ */ react.createElement(BackgroundColorField, null), /* @__PURE__ */ react.createElement(BackgroundClipField, null));
	});
	var BackgroundColorField = () => {
		return /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			container: true,
			gap: 2,
			alignItems: "center",
			flexWrap: "nowrap"
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6
		}, /* @__PURE__ */ react.createElement(ControlLabel, null, colorLabel)), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6
		}, /* @__PURE__ */ react.createElement(ColorControl, null))));
	};
	var BackgroundClipField = () => {
		return /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "clip" }, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			container: true,
			gap: 2,
			alignItems: "center",
			flexWrap: "nowrap"
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6
		}, /* @__PURE__ */ react.createElement(ControlLabel, null, clipLabel)), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6
		}, /* @__PURE__ */ react.createElement(SelectControl, { options: clipOptions }))));
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/repeatable-control.tsx
	var PLACEHOLDER_REGEX = /\$\{([^}]+)\}/g;
	var RepeatableControl = createControl(({ repeaterLabel, childControlConfig, showDuplicate, showToggle, initialValues, patternLabel, placeholder, propKey, isSortable, addItemTooltipProps }) => {
		const { propTypeUtil: childPropTypeUtil, isItemDisabled } = childControlConfig;
		if (!childPropTypeUtil) return null;
		const childArrayPropTypeUtil = (0, react.useMemo)(() => (0, _elementor_editor_props.createArrayPropUtils)(childPropTypeUtil.key, childPropTypeUtil.schema, propKey), [
			childPropTypeUtil.key,
			childPropTypeUtil.schema,
			propKey
		]);
		const contextValue = (0, react.useMemo)(() => ({
			...childControlConfig,
			placeholder: placeholder || "",
			patternLabel: patternLabel || ""
		}), [
			childControlConfig,
			placeholder,
			patternLabel
		]);
		const { propType, value, setValue } = useBoundProp(childArrayPropTypeUtil);
		const newItemIndex = addItemTooltipProps?.newItemIndex === null ? void 0 : 0;
		return /* @__PURE__ */ react.createElement(PropProvider, {
			propType,
			value,
			setValue
		}, /* @__PURE__ */ react.createElement(RepeatableControlContext.Provider, { value: contextValue }, /* @__PURE__ */ react.createElement(ControlRepeater, {
			initial: childPropTypeUtil.create(initialValues || null),
			propTypeUtil: childArrayPropTypeUtil,
			isItemDisabled
		}, /* @__PURE__ */ react.createElement(RepeaterHeader, { label: repeaterLabel }, /* @__PURE__ */ react.createElement(TooltipAddItemAction, {
			...addItemTooltipProps,
			newItemIndex,
			ariaLabel: repeaterLabel
		})), /* @__PURE__ */ react.createElement(ItemsContainer, { isSortable }, /* @__PURE__ */ react.createElement(Item, {
			Icon: ItemIcon,
			Label: ItemLabel,
			actions: /* @__PURE__ */ react.createElement(react.Fragment, null, showDuplicate && /* @__PURE__ */ react.createElement(DuplicateItemAction, null), showToggle && /* @__PURE__ */ react.createElement(DisableItemAction, null), /* @__PURE__ */ react.createElement(RemoveItemAction, null))
		})), /* @__PURE__ */ react.createElement(EditItemPopover, null, /* @__PURE__ */ react.createElement(Content, null)))));
	});
	var ItemIcon = () => /* @__PURE__ */ react.createElement(react.Fragment, null);
	var Content = () => {
		const { component: ChildControl, props = {} } = useRepeatableControlContext();
		return /* @__PURE__ */ react.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ react.createElement(PopoverGridContainer, null, /* @__PURE__ */ react.createElement(ChildControl, { ...props })));
	};
	var interpolate = (template, data) => {
		if (!data) return template;
		return template.replace(PLACEHOLDER_REGEX, (_, path) => {
			const value = getNestedValue(data, path);
			if (typeof value === "object" && value !== null && !Array.isArray(value)) {
				if ("name" in value && value.name) return value.name;
				return JSON.stringify(value);
			}
			if (Array.isArray(value)) return value.join(", ");
			return String(value ?? "");
		});
	};
	var getNestedValue = (obj, path) => {
		let parentObj = {};
		const pathKeys = path.split(".");
		const key = pathKeys.slice(-1)[0];
		let value = pathKeys.reduce((current, currentKey, currentIndex) => {
			if (currentIndex === pathKeys.length - 2) parentObj = current;
			if (current && typeof current === "object") return current[currentKey];
			return {};
		}, obj);
		value = !!value ? value : "";
		const propType = parentObj?.$$type;
		const propValue = parentObj?.value;
		if (!(key === "unit" && propType === "size" && propValue?.unit === "custom")) return value;
		return propValue?.size ? "" : "fx";
	};
	var isEmptyValue = (val) => {
		if (typeof val === "string") return val.trim() === "";
		if (Number.isNaN(val)) return true;
		if (Array.isArray(val)) return val.length === 0;
		if (typeof val === "object" && val !== null) return Object.keys(val).length === 0;
		return false;
	};
	var shouldShowPlaceholder = (pattern, data) => {
		const values = getAllProperties(pattern).map((path) => getNestedValue(data, path));
		if (values.length === 0) return false;
		if (values.some((value) => value === null || value === void 0)) return true;
		if (values.every(isEmptyValue)) return true;
		return false;
	};
	var getTextColor = (isReadOnly, showPlaceholder) => {
		if (isReadOnly) return "text.disabled";
		return showPlaceholder ? "text.tertiary" : "text.primary";
	};
	var ItemLabel = ({ value }) => {
		const { placeholder, patternLabel, props: childProps } = useRepeatableControlContext();
		const showPlaceholder = shouldShowPlaceholder(patternLabel, value);
		const label = showPlaceholder ? placeholder : interpolate(patternLabel, value);
		const isReadOnly = !!childProps?.readOnly;
		const color = getTextColor(isReadOnly, showPlaceholder);
		return /* @__PURE__ */ react.createElement(_elementor_ui.Box, {
			component: "span",
			color
		}, label);
	};
	var getAllProperties = (pattern) => {
		return pattern.match(PLACEHOLDER_REGEX)?.map((match) => match.slice(2, -1)) || [];
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/utils/escape-html-attr.ts
	var escapeHtmlAttr = (value) => {
		const specialChars = {
			"&": "&amp;",
			"<": "&lt;",
			">": "&gt;",
			"'": "&#39;",
			"\"": "&quot;"
		};
		return value.replace(/[&<>'"]/g, (char) => specialChars[char] || char);
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/key-value-control.tsx
	var getInitialFieldValue = (fieldValue) => {
		const transformableValue = fieldValue;
		if (!fieldValue || typeof fieldValue !== "object" || transformableValue.$$type === "dynamic") return "";
		return transformableValue.value || "";
	};
	var KeyValueControl = createControl((props = {}) => {
		const { value, setValue, ...propContext } = useBoundProp(_elementor_editor_props.keyValuePropTypeUtil);
		const [keyError, setKeyError] = (0, react.useState)("");
		const [valueError, setValueError] = (0, react.useState)("");
		const [sessionState, setSessionState] = (0, react.useState)({
			key: getInitialFieldValue(value?.key),
			value: getInitialFieldValue(value?.value)
		});
		const keyLabel = props.keyName || (0, _wordpress_i18n.__)("Key", "elementor");
		const valueLabel = props.valueName || (0, _wordpress_i18n.__)("Value", "elementor");
		const { keyHelper, valueHelper } = props.getHelperText?.(sessionState.key, sessionState.value) || {
			keyHelper: void 0,
			valueHelper: void 0
		};
		const [keyRegex, valueRegex, errMsg] = (0, react.useMemo)(() => [
			props.regexKey ? new RegExp(props.regexKey) : void 0,
			props.regexValue ? new RegExp(props.regexValue) : void 0,
			props.validationErrorMessage || (0, _wordpress_i18n.__)("Invalid Format", "elementor")
		], [
			props.regexKey,
			props.regexValue,
			props.validationErrorMessage
		]);
		const validate = (newValue, fieldType) => {
			if (fieldType === "key" && keyRegex) {
				const isValid = keyRegex.test(newValue);
				setKeyError(isValid ? "" : errMsg);
				return isValid;
			} else if (fieldType === "value" && valueRegex) {
				const isValid = valueRegex.test(newValue);
				setValueError(isValid ? "" : errMsg);
				return isValid;
			}
			return true;
		};
		const handleChange = (newValue, options, meta) => {
			const fieldType = meta?.bind;
			if (!fieldType) return;
			const newChangedValue = newValue[fieldType];
			if ((0, _elementor_editor_props.isTransformable)(newChangedValue) && newChangedValue.$$type === "dynamic") {
				setValue({
					...value,
					[fieldType]: newChangedValue
				});
				return;
			}
			const extractedValue = _elementor_editor_props.stringPropTypeUtil.extract(newChangedValue);
			setSessionState((prev) => ({
				...prev,
				[fieldType]: extractedValue
			}));
			if (extractedValue && validate(extractedValue, fieldType)) setValue({
				...value,
				[fieldType]: newChangedValue
			});
			else setValue({
				...value,
				[fieldType]: {
					value: "",
					$$type: "string"
				}
			});
		};
		return /* @__PURE__ */ react.createElement(PropProvider, {
			...propContext,
			value,
			setValue: handleChange
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			container: true,
			gap: 1.5
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 12,
			display: "flex",
			flexDirection: "column"
		}, /* @__PURE__ */ react.createElement(_elementor_ui.FormLabel, {
			size: "tiny",
			sx: { pb: 1 }
		}, keyLabel), /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "key" }, /* @__PURE__ */ react.createElement(TextControl, {
			inputValue: props.escapeHtml ? escapeHtmlAttr(sessionState.key) : sessionState.key,
			error: !!keyError,
			helperText: keyHelper
		})), !!keyError && /* @__PURE__ */ react.createElement(_elementor_ui.FormHelperText, { error: true }, keyError)), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 12,
			display: "flex",
			flexDirection: "column"
		}, /* @__PURE__ */ react.createElement(_elementor_ui.FormLabel, {
			size: "tiny",
			sx: { pb: 1 }
		}, valueLabel), /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "value" }, /* @__PURE__ */ react.createElement(TextControl, {
			inputValue: props.escapeHtml ? escapeHtmlAttr(sessionState.value) : sessionState.value,
			error: !!valueError,
			inputDisabled: !!keyError,
			helperText: valueHelper
		})), !!valueError && /* @__PURE__ */ react.createElement(_elementor_ui.FormHelperText, { error: true }, valueError))));
	});

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/position-control.tsx
	var positionOptions = [
		{
			label: (0, _wordpress_i18n.__)("Center center", "elementor"),
			value: "center center"
		},
		{
			label: (0, _wordpress_i18n.__)("Center left", "elementor"),
			value: "center left"
		},
		{
			label: (0, _wordpress_i18n.__)("Center right", "elementor"),
			value: "center right"
		},
		{
			label: (0, _wordpress_i18n.__)("Top center", "elementor"),
			value: "top center"
		},
		{
			label: (0, _wordpress_i18n.__)("Top left", "elementor"),
			value: "top left"
		},
		{
			label: (0, _wordpress_i18n.__)("Top right", "elementor"),
			value: "top right"
		},
		{
			label: (0, _wordpress_i18n.__)("Bottom center", "elementor"),
			value: "bottom center"
		},
		{
			label: (0, _wordpress_i18n.__)("Bottom left", "elementor"),
			value: "bottom left"
		},
		{
			label: (0, _wordpress_i18n.__)("Bottom right", "elementor"),
			value: "bottom right"
		},
		{
			label: (0, _wordpress_i18n.__)("Custom", "elementor"),
			value: "custom"
		}
	];
	var PositionControl = () => {
		const positionContext = useBoundProp(_elementor_editor_props.positionPropTypeUtil);
		const stringPropContext = useBoundProp(_elementor_editor_props.stringPropTypeUtil);
		const isCustom = !!positionContext.value;
		const placeholder = positionContext.placeholder ? "custom" : stringPropContext.placeholder ?? null;
		const handlePositionChange = (event) => {
			const value = event.target.value || null;
			if (value === "custom") positionContext.setValue({
				x: null,
				y: null
			});
			else stringPropContext.setValue(value);
		};
		return /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			container: true,
			spacing: 1.5
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 12
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			container: true,
			gap: 2,
			alignItems: "center",
			flexWrap: "nowrap"
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6
		}, /* @__PURE__ */ react.createElement(ControlFormLabel, null, (0, _wordpress_i18n.__)("Object position", "elementor"))), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6,
			sx: { overflow: "hidden" }
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Select, {
			size: "tiny",
			displayEmpty: true,
			disabled: stringPropContext.disabled,
			value: (positionContext.value ? "custom" : stringPropContext.value) ?? "",
			onChange: handlePositionChange,
			renderValue: (selectedValue) => getSelectRenderValue(positionOptions, placeholder, selectedValue),
			fullWidth: true
		}, positionOptions.map(({ label, value }) => /* @__PURE__ */ react.createElement(_elementor_editor_ui.MenuListItem, {
			key: value,
			value: value ?? ""
		}, label)))))), isCustom && /* @__PURE__ */ react.createElement(PropProvider, { ...positionContext }, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 12
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			container: true,
			spacing: 1.5
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6
		}, /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "x" }, /* @__PURE__ */ react.createElement(SizeControl, {
			startIcon: /* @__PURE__ */ react.createElement(_elementor_icons.LetterXIcon, { fontSize: "tiny" }),
			min: -Number.MAX_SAFE_INTEGER
		}))), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6
		}, /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "y" }, /* @__PURE__ */ react.createElement(SizeControl, {
			startIcon: /* @__PURE__ */ react.createElement(_elementor_icons.LetterYIcon, { fontSize: "tiny" }),
			min: -Number.MAX_SAFE_INTEGER
		})))))));
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/transform-control/initial-values.ts
	var TransformFunctionKeys = {
		move: "transform-move",
		scale: "transform-scale",
		rotate: "transform-rotate",
		skew: "transform-skew"
	};
	var defaultValues = {
		move: {
			size: 0,
			unit: "px"
		},
		scale: 1,
		rotate: {
			size: 0,
			unit: "deg"
		},
		skew: {
			size: 0,
			unit: "deg"
		}
	};
	var initialTransformValue = {
		$$type: TransformFunctionKeys.move,
		value: {
			x: {
				$$type: "size",
				value: {
					size: defaultValues.move.size,
					unit: defaultValues.move.unit
				}
			},
			y: {
				$$type: "size",
				value: {
					size: defaultValues.move.size,
					unit: defaultValues.move.unit
				}
			},
			z: {
				$$type: "size",
				value: {
					size: defaultValues.move.size,
					unit: defaultValues.move.unit
				}
			}
		}
	};
	var initialScaleValue = _elementor_editor_props.scaleTransformPropTypeUtil.create({
		x: _elementor_editor_props.numberPropTypeUtil.create(defaultValues.scale),
		y: _elementor_editor_props.numberPropTypeUtil.create(defaultValues.scale),
		z: _elementor_editor_props.numberPropTypeUtil.create(defaultValues.scale)
	});
	var initialRotateValue = _elementor_editor_props.rotateTransformPropTypeUtil.create({
		x: {
			$$type: "size",
			value: {
				size: defaultValues.rotate.size,
				unit: defaultValues.rotate.unit
			}
		},
		y: {
			$$type: "size",
			value: {
				size: defaultValues.rotate.size,
				unit: defaultValues.rotate.unit
			}
		},
		z: {
			$$type: "size",
			value: {
				size: defaultValues.rotate.size,
				unit: defaultValues.rotate.unit
			}
		}
	});
	var initialSkewValue = _elementor_editor_props.skewTransformPropTypeUtil.create({
		x: {
			$$type: "size",
			value: {
				size: defaultValues.skew.size,
				unit: defaultValues.skew.unit
			}
		},
		y: {
			$$type: "size",
			value: {
				size: defaultValues.skew.size,
				unit: defaultValues.skew.unit
			}
		}
	});

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/transform-control/functions/axis-row.tsx
	var AxisRow = ({ label, bind, startIcon, anchorRef, units, variant = "angle" }) => {
		const safeId = label.replace(/\s+/g, "-").toLowerCase();
		return /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 12
		}, /* @__PURE__ */ react.createElement(PopoverGridContainer, { ref: anchorRef }, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6
		}, /* @__PURE__ */ react.createElement(ControlLabel, { htmlFor: safeId }, label)), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6
		}, /* @__PURE__ */ react.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ react.createElement(SizeControl, {
			anchorRef,
			startIcon,
			units,
			variant,
			min: -Number.MAX_SAFE_INTEGER,
			id: safeId
		})))));
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/transform-control/functions/move.tsx
	var moveAxisControls = [
		{
			label: (0, _wordpress_i18n.__)("Move X", "elementor"),
			bind: "x",
			startIcon: /* @__PURE__ */ react.createElement(_elementor_icons.ArrowRightIcon, { fontSize: "tiny" }),
			units: [
				"px",
				"%",
				"em",
				"rem",
				"vw"
			]
		},
		{
			label: (0, _wordpress_i18n.__)("Move Y", "elementor"),
			bind: "y",
			startIcon: /* @__PURE__ */ react.createElement(_elementor_icons.ArrowDownSmallIcon, { fontSize: "tiny" }),
			units: [
				"px",
				"%",
				"em",
				"rem",
				"vh"
			]
		},
		{
			label: (0, _wordpress_i18n.__)("Move Z", "elementor"),
			bind: "z",
			startIcon: /* @__PURE__ */ react.createElement(_elementor_icons.ArrowDownLeftIcon, { fontSize: "tiny" }),
			units: [
				"px",
				"%",
				"em",
				"rem",
				"vw",
				"vh"
			]
		}
	];
	var Move = () => {
		const context = useBoundProp(_elementor_editor_props.moveTransformPropTypeUtil);
		const rowRefs = [
			(0, react.useRef)(null),
			(0, react.useRef)(null),
			(0, react.useRef)(null)
		];
		return /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			container: true,
			spacing: 1.5
		}, /* @__PURE__ */ react.createElement(PropProvider, { ...context }, /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: TransformFunctionKeys.move }, moveAxisControls.map((control, index) => /* @__PURE__ */ react.createElement(AxisRow, {
			key: control.bind,
			...control,
			anchorRef: rowRefs[index],
			units: control.units,
			variant: "length"
		})))));
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/transform-control/functions/rotate.tsx
	var rotateAxisControls = [
		{
			label: (0, _wordpress_i18n.__)("Rotate X", "elementor"),
			bind: "x",
			startIcon: /* @__PURE__ */ react.createElement(_elementor_icons.Arrow360Icon, { fontSize: "tiny" })
		},
		{
			label: (0, _wordpress_i18n.__)("Rotate Y", "elementor"),
			bind: "y",
			startIcon: /* @__PURE__ */ react.createElement(_elementor_icons.Arrow360Icon, {
				fontSize: "tiny",
				style: { transform: "scaleX(-1) rotate(-90deg)" }
			})
		},
		{
			label: (0, _wordpress_i18n.__)("Rotate Z", "elementor"),
			bind: "z",
			startIcon: /* @__PURE__ */ react.createElement(_elementor_icons.RotateClockwiseIcon, { fontSize: "tiny" })
		}
	];
	var rotateUnits = [
		"deg",
		"rad",
		"grad",
		"turn"
	];
	var Rotate = () => {
		const context = useBoundProp(_elementor_editor_props.rotateTransformPropTypeUtil);
		const rowRefs = [
			(0, react.useRef)(null),
			(0, react.useRef)(null),
			(0, react.useRef)(null)
		];
		return /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			container: true,
			spacing: 1.5
		}, /* @__PURE__ */ react.createElement(PropProvider, { ...context }, /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: TransformFunctionKeys.rotate }, rotateAxisControls.map((control, index) => /* @__PURE__ */ react.createElement(AxisRow, {
			key: control.bind,
			...control,
			anchorRef: rowRefs[index],
			units: rotateUnits
		})))));
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/transform-control/functions/scale-axis-row.tsx
	var ScaleAxisRow = ({ label, bind, startIcon, anchorRef }) => {
		return /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 12
		}, /* @__PURE__ */ react.createElement(PopoverGridContainer, { ref: anchorRef }, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6
		}, /* @__PURE__ */ react.createElement(ControlLabel, null, label)), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6
		}, /* @__PURE__ */ react.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ react.createElement(NumberControl, {
			step: .1,
			placeholder: "1",
			startIcon
		})))));
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/transform-control/functions/scale.tsx
	var scaleAxisControls = [
		{
			label: (0, _wordpress_i18n.__)("Scale X", "elementor"),
			bind: "x",
			startIcon: /* @__PURE__ */ react.createElement(_elementor_icons.ArrowRightIcon, { fontSize: "tiny" })
		},
		{
			label: (0, _wordpress_i18n.__)("Scale Y", "elementor"),
			bind: "y",
			startIcon: /* @__PURE__ */ react.createElement(_elementor_icons.ArrowDownSmallIcon, { fontSize: "tiny" })
		},
		{
			label: (0, _wordpress_i18n.__)("Scale Z", "elementor"),
			bind: "z",
			startIcon: /* @__PURE__ */ react.createElement(_elementor_icons.ArrowDownLeftIcon, { fontSize: "tiny" })
		}
	];
	var Scale = () => {
		const context = useBoundProp(_elementor_editor_props.scaleTransformPropTypeUtil);
		const rowRefs = [
			(0, react.useRef)(null),
			(0, react.useRef)(null),
			(0, react.useRef)(null)
		];
		return /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			container: true,
			spacing: 1.5
		}, /* @__PURE__ */ react.createElement(PropProvider, { ...context }, /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: TransformFunctionKeys.scale }, scaleAxisControls.map((control, index) => /* @__PURE__ */ react.createElement(ScaleAxisRow, {
			key: control.bind,
			...control,
			anchorRef: rowRefs[index]
		})))));
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/transform-control/functions/skew.tsx
	var skewAxisControls = [{
		label: (0, _wordpress_i18n.__)("Skew X", "elementor"),
		bind: "x",
		startIcon: /* @__PURE__ */ react.createElement(_elementor_icons.ArrowRightIcon, { fontSize: "tiny" })
	}, {
		label: (0, _wordpress_i18n.__)("Skew Y", "elementor"),
		bind: "y",
		startIcon: /* @__PURE__ */ react.createElement(_elementor_icons.ArrowLeftIcon, {
			fontSize: "tiny",
			style: { transform: "scaleX(-1) rotate(-90deg)" }
		})
	}];
	var skewUnits = [
		"deg",
		"rad",
		"grad",
		"turn"
	];
	var Skew = () => {
		const context = useBoundProp(_elementor_editor_props.skewTransformPropTypeUtil);
		const rowRefs = [
			(0, react.useRef)(null),
			(0, react.useRef)(null),
			(0, react.useRef)(null)
		];
		return /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			container: true,
			spacing: 1.5
		}, /* @__PURE__ */ react.createElement(PropProvider, { ...context }, /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: TransformFunctionKeys.skew }, skewAxisControls.map((control, index) => /* @__PURE__ */ react.createElement(AxisRow, {
			key: control.bind,
			...control,
			anchorRef: rowRefs[index],
			units: skewUnits
		})))));
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/transform-control/use-transform-tabs-history.tsx
	var useTransformTabsHistory = ({ move: initialMove, scale: initialScale, rotate: initialRotate, skew: initialSkew }) => {
		const { value: moveValue, setValue: setMoveValue } = useBoundProp(_elementor_editor_props.moveTransformPropTypeUtil);
		const { value: scaleValue, setValue: setScaleValue } = useBoundProp(_elementor_editor_props.scaleTransformPropTypeUtil);
		const { value: rotateValue, setValue: setRotateValue } = useBoundProp(_elementor_editor_props.rotateTransformPropTypeUtil);
		const { value: skewValue, setValue: setSkewValue } = useBoundProp(_elementor_editor_props.skewTransformPropTypeUtil);
		const { openItemIndex, items } = useRepeaterContext();
		const getCurrentTransformType = () => {
			switch (true) {
				case !!scaleValue: return TransformFunctionKeys.scale;
				case !!rotateValue: return TransformFunctionKeys.rotate;
				case !!skewValue: return TransformFunctionKeys.skew;
				default: return TransformFunctionKeys.move;
			}
		};
		const { getTabsProps, getTabProps, getTabPanelProps } = (0, _elementor_ui.useTabs)(getCurrentTransformType());
		const valuesHistory = (0, react.useRef)({
			move: initialMove,
			scale: initialScale,
			rotate: initialRotate,
			skew: initialSkew
		});
		const saveToHistory = (key, value) => {
			if (value) valuesHistory.current[key] = value;
		};
		const onTabChange = (e, tabName) => {
			switch (tabName) {
				case TransformFunctionKeys.move:
					setMoveValue(valuesHistory.current.move);
					saveToHistory("scale", scaleValue);
					saveToHistory("rotate", rotateValue);
					saveToHistory("skew", skewValue);
					break;
				case TransformFunctionKeys.scale:
					setScaleValue(valuesHistory.current.scale);
					saveToHistory("move", moveValue);
					saveToHistory("rotate", rotateValue);
					saveToHistory("skew", skewValue);
					break;
				case TransformFunctionKeys.rotate:
					setRotateValue(valuesHistory.current.rotate);
					saveToHistory("move", moveValue);
					saveToHistory("scale", scaleValue);
					saveToHistory("skew", skewValue);
					break;
				case TransformFunctionKeys.skew:
					setSkewValue(valuesHistory.current.skew);
					saveToHistory("move", moveValue);
					saveToHistory("scale", scaleValue);
					saveToHistory("rotate", rotateValue);
					break;
			}
			return getTabsProps().onChange(e, tabName);
		};
		const isTabDisabled = (tabKey) => {
			return !!items.find(({ item: { $$type: key } }, pos) => tabKey === key && pos !== openItemIndex);
		};
		return {
			getTabProps: (value) => ({
				...getTabProps(value),
				disabled: isTabDisabled(value)
			}),
			getTabPanelProps,
			getTabsProps: () => ({
				...getTabsProps(),
				onChange: onTabChange
			})
		};
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/transform-control/transform-content.tsx
	var TransformContent = () => {
		const { getTabsProps, getTabProps, getTabPanelProps } = useTransformTabsHistory({
			move: initialTransformValue.value,
			scale: initialScaleValue.value,
			rotate: initialRotateValue.value,
			skew: initialSkewValue.value
		});
		return /* @__PURE__ */ react.createElement(PopoverContent, null, /* @__PURE__ */ react.createElement(_elementor_ui.Box, { sx: { width: "100%" } }, /* @__PURE__ */ react.createElement(_elementor_ui.Box, { sx: {
			borderBottom: 1,
			borderColor: "divider"
		} }, /* @__PURE__ */ react.createElement(_elementor_ui.Tabs, {
			size: "small",
			variant: "fullWidth",
			sx: { "& .MuiTab-root": { minWidth: "62px" } },
			...getTabsProps(),
			"aria-label": (0, _wordpress_i18n.__)("Transform", "elementor")
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Tab, {
			label: (0, _wordpress_i18n.__)("Move", "elementor"),
			...getTabProps(TransformFunctionKeys.move)
		}), /* @__PURE__ */ react.createElement(_elementor_ui.Tab, {
			label: (0, _wordpress_i18n.__)("Scale", "elementor"),
			...getTabProps(TransformFunctionKeys.scale)
		}), /* @__PURE__ */ react.createElement(_elementor_ui.Tab, {
			label: (0, _wordpress_i18n.__)("Rotate", "elementor"),
			...getTabProps(TransformFunctionKeys.rotate)
		}), /* @__PURE__ */ react.createElement(_elementor_ui.Tab, {
			label: (0, _wordpress_i18n.__)("Skew", "elementor"),
			...getTabProps(TransformFunctionKeys.skew)
		}))), /* @__PURE__ */ react.createElement(_elementor_ui.TabPanel, {
			sx: { p: 1.5 },
			...getTabPanelProps(TransformFunctionKeys.move)
		}, /* @__PURE__ */ react.createElement(Move, null)), /* @__PURE__ */ react.createElement(_elementor_ui.TabPanel, {
			sx: { p: 1.5 },
			...getTabPanelProps(TransformFunctionKeys.scale)
		}, /* @__PURE__ */ react.createElement(Scale, null)), /* @__PURE__ */ react.createElement(_elementor_ui.TabPanel, {
			sx: { p: 1.5 },
			...getTabPanelProps(TransformFunctionKeys.rotate)
		}, /* @__PURE__ */ react.createElement(Rotate, null)), /* @__PURE__ */ react.createElement(_elementor_ui.TabPanel, {
			sx: { p: 1.5 },
			...getTabPanelProps(TransformFunctionKeys.skew)
		}, /* @__PURE__ */ react.createElement(Skew, null))));
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/transform-control/transform-icon.tsx
	var TransformIcon = ({ value }) => {
		switch (value.$$type) {
			case TransformFunctionKeys.move: return /* @__PURE__ */ react.createElement(_elementor_icons.ArrowsMaximizeIcon, { fontSize: "tiny" });
			case TransformFunctionKeys.scale: return /* @__PURE__ */ react.createElement(_elementor_icons.ArrowAutofitHeightIcon, { fontSize: "tiny" });
			case TransformFunctionKeys.rotate: return /* @__PURE__ */ react.createElement(_elementor_icons.RotateClockwise2Icon, { fontSize: "tiny" });
			case TransformFunctionKeys.skew: return /* @__PURE__ */ react.createElement(_elementor_icons.SkewXIcon, { fontSize: "tiny" });
			default: return null;
		}
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/transform-control/transform-label.tsx
	var orderedAxis = [
		"x",
		"y",
		"z"
	];
	var formatLabel = (value, functionType) => {
		return orderedAxis.map((axisKey) => {
			const axis = value[axisKey];
			if (functionType === "scale") return axis?.value || defaultValues[functionType];
			const defaults = defaultValues[functionType];
			const size = axis?.value?.size ?? defaults.size;
			const unit = axis?.value?.unit ?? defaults.unit;
			return unit === "custom" ? size || "fx" : `${size}${unit}`;
		}).join(", ");
	};
	var TransformLabel = (props) => {
		const { $$type, value } = props.value;
		switch ($$type) {
			case TransformFunctionKeys.move: return /* @__PURE__ */ react.createElement(Label, {
				label: (0, _wordpress_i18n.__)("Move", "elementor"),
				value: formatLabel(value, "move")
			});
			case TransformFunctionKeys.scale: return /* @__PURE__ */ react.createElement(Label, {
				label: (0, _wordpress_i18n.__)("Scale", "elementor"),
				value: formatLabel(value, "scale")
			});
			case TransformFunctionKeys.rotate: return /* @__PURE__ */ react.createElement(Label, {
				label: (0, _wordpress_i18n.__)("Rotate", "elementor"),
				value: formatLabel(value, "rotate")
			});
			case TransformFunctionKeys.skew: return /* @__PURE__ */ react.createElement(Label, {
				label: (0, _wordpress_i18n.__)("Skew", "elementor"),
				value: formatLabel(value, "skew")
			});
			default: return "";
		}
	};
	var Label = ({ label, value }) => {
		return /* @__PURE__ */ react.createElement(_elementor_ui.Box, { component: "span" }, label, ": ", value);
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/transform-control/transform-base-controls/children-perspective-control.tsx
	var ORIGIN_UNITS = [
		"px",
		"%",
		"em",
		"rem"
	];
	var PERSPECTIVE_CONTROL_FIELD = {
		label: (0, _wordpress_i18n.__)("Perspective", "elementor"),
		bind: "perspective",
		units: [
			"px",
			"em",
			"rem",
			"vw",
			"vh"
		]
	};
	var CHILDREN_PERSPECTIVE_FIELDS = [{
		label: (0, _wordpress_i18n.__)("Origin X", "elementor"),
		bind: "x",
		units: ORIGIN_UNITS
	}, {
		label: (0, _wordpress_i18n.__)("Origin Y", "elementor"),
		bind: "y",
		units: ORIGIN_UNITS
	}];
	var ChildrenPerspectiveControl = () => {
		return /* @__PURE__ */ react.createElement(_elementor_ui.Stack, {
			direction: "column",
			spacing: 1.5
		}, /* @__PURE__ */ react.createElement(ControlFormLabel, null, (0, _wordpress_i18n.__)("Children perspective", "elementor")), /* @__PURE__ */ react.createElement(PerspectiveControl, null), /* @__PURE__ */ react.createElement(PerspectiveOriginControl, null));
	};
	var PerspectiveControl = () => /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "perspective" }, /* @__PURE__ */ react.createElement(ControlFields$1, {
		control: PERSPECTIVE_CONTROL_FIELD,
		key: PERSPECTIVE_CONTROL_FIELD.bind
	}));
	var PerspectiveOriginControl = () => /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "perspective-origin" }, /* @__PURE__ */ react.createElement(PerspectiveOriginControlProvider, null));
	var PerspectiveOriginControlProvider = () => {
		const context = useBoundProp(_elementor_editor_props.perspectiveOriginPropTypeUtil);
		return /* @__PURE__ */ react.createElement(PropProvider, { ...context }, CHILDREN_PERSPECTIVE_FIELDS.map((control) => /* @__PURE__ */ react.createElement(PropKeyProvider, {
			bind: control.bind,
			key: control.bind
		}, /* @__PURE__ */ react.createElement(ControlFields$1, { control }))));
	};
	var ControlFields$1 = /* @__PURE__ */ __name(({ control }) => {
		const rowRef = (0, react.useRef)(null);
		return /* @__PURE__ */ react.createElement(PopoverGridContainer, { ref: rowRef }, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6
		}, /* @__PURE__ */ react.createElement(ControlFormLabel, null, control.label)), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6
		}, /* @__PURE__ */ react.createElement(SizeControl, {
			variant: "length",
			units: control.units,
			anchorRef: rowRef,
			disableCustom: true
		})));
	}, "ControlFields");

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/transform-control/transform-base-controls/transform-origin-control.tsx
	var TRANSFORM_ORIGIN_UNITS = [
		"px",
		"%",
		"em",
		"rem"
	];
	var TRANSFORM_ORIGIN_UNITS_Z_AXIS = TRANSFORM_ORIGIN_UNITS.filter((unit) => unit !== "%");
	var TRANSFORM_ORIGIN_FIELDS = [
		{
			label: (0, _wordpress_i18n.__)("Origin X", "elementor"),
			bind: "x",
			units: TRANSFORM_ORIGIN_UNITS
		},
		{
			label: (0, _wordpress_i18n.__)("Origin Y", "elementor"),
			bind: "y",
			units: TRANSFORM_ORIGIN_UNITS
		},
		{
			label: (0, _wordpress_i18n.__)("Origin Z", "elementor"),
			bind: "z",
			units: TRANSFORM_ORIGIN_UNITS_Z_AXIS
		}
	];
	var TransformOriginControl = () => {
		return /* @__PURE__ */ react.createElement(_elementor_ui.Stack, {
			direction: "column",
			spacing: 1.5
		}, /* @__PURE__ */ react.createElement(ControlFormLabel, null, (0, _wordpress_i18n.__)("Transform", "elementor")), TRANSFORM_ORIGIN_FIELDS.map((control) => /* @__PURE__ */ react.createElement(ControlFields, {
			control,
			key: control.bind
		})));
	};
	var ControlFields = ({ control }) => {
		const context = useBoundProp(_elementor_editor_props.transformOriginPropTypeUtil);
		const rowRef = (0, react.useRef)(null);
		return /* @__PURE__ */ react.createElement(PropProvider, { ...context }, /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: control.bind }, /* @__PURE__ */ react.createElement(PopoverGridContainer, { ref: rowRef }, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6
		}, /* @__PURE__ */ react.createElement(ControlFormLabel, null, control.label)), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6
		}, /* @__PURE__ */ react.createElement(SizeControl, {
			variant: "length",
			units: control.units,
			anchorRef: rowRef
		})))));
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/transform-control/transform-settings-control.tsx
	var SIZE$2 = "tiny";
	var TransformSettingsControl = ({ popupState, anchorRef, showChildrenPerspective }) => {
		const popupProps = (0, _elementor_ui.bindPopover)({
			...popupState,
			anchorEl: anchorRef.current ?? void 0
		});
		return /* @__PURE__ */ react.createElement(_elementor_ui.Popover, {
			disablePortal: true,
			anchorOrigin: {
				vertical: "bottom",
				horizontal: "left"
			},
			slotProps: { paper: { sx: {
				width: (anchorRef.current?.offsetWidth || 0) - 6 + "px",
				mt: .5
			} } },
			...popupProps
		}, /* @__PURE__ */ react.createElement(_elementor_editor_ui.PopoverHeader, {
			title: (0, _wordpress_i18n.__)("Transform settings", "elementor"),
			onClose: popupState.close,
			icon: /* @__PURE__ */ react.createElement(_elementor_icons.AdjustmentsIcon, { fontSize: SIZE$2 })
		}), /* @__PURE__ */ react.createElement(_elementor_ui.Divider, null), /* @__PURE__ */ react.createElement(PopoverContent, { sx: {
			px: 2,
			py: 1.5
		} }, /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "transform-origin" }, /* @__PURE__ */ react.createElement(TransformOriginControl, null)), showChildrenPerspective && /* @__PURE__ */ react.createElement(react.Fragment, null, /* @__PURE__ */ react.createElement(_elementor_ui.Box, { sx: { my: .5 } }, /* @__PURE__ */ react.createElement(_elementor_ui.Divider, null)), /* @__PURE__ */ react.createElement(ChildrenPerspectiveControl, null))));
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/transform-control/transform-repeater-control.tsx
	var SIZE$1 = "tiny";
	var TransformRepeaterControl = createControl(({ showChildrenPerspective }) => {
		const context = useBoundProp(_elementor_editor_props.transformPropTypeUtil);
		const headerRef = (0, react.useRef)(null);
		const popupState = (0, _elementor_ui.usePopupState)({ variant: "popover" });
		return /* @__PURE__ */ react.createElement(PropProvider, { ...context }, /* @__PURE__ */ react.createElement(TransformSettingsControl, {
			popupState,
			anchorRef: headerRef,
			showChildrenPerspective
		}), /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "transform-functions" }, /* @__PURE__ */ react.createElement(Repeater$1, {
			headerRef,
			propType: context.propType,
			popupState
		})));
	});
	var ToolTip = /* @__PURE__ */ react.createElement(_elementor_ui.Box, {
		component: "span",
		"aria-label": void 0,
		sx: {
			display: "flex",
			gap: .5,
			p: 2,
			width: 320,
			borderRadius: 1
		}
	}, /* @__PURE__ */ react.createElement(_elementor_icons.InfoCircleFilledIcon, { sx: { color: "secondary.main" } }), /* @__PURE__ */ react.createElement(_elementor_ui.Typography, {
		variant: "body2",
		color: "text.secondary",
		fontSize: "14px"
	}, (0, _wordpress_i18n.__)("You can use each kind of transform only once per element.", "elementor")));
	var Repeater$1 = /* @__PURE__ */ __name(({ headerRef, propType, popupState }) => {
		const transformFunctionsContext = useBoundProp(_elementor_editor_props.transformFunctionsPropTypeUtil);
		const availableValues = [
			initialTransformValue,
			initialScaleValue,
			initialRotateValue,
			initialSkewValue
		];
		const { value: transformValues, bind } = transformFunctionsContext;
		const getInitialValue = () => {
			return availableValues.find((value) => !transformValues?.some((item) => item.$$type === value.$$type));
		};
		const shouldDisableAddItem = !getInitialValue();
		return /* @__PURE__ */ react.createElement(PropProvider, { ...transformFunctionsContext }, /* @__PURE__ */ react.createElement(ControlRepeater, {
			initial: getInitialValue() ?? initialTransformValue,
			propTypeUtil: _elementor_editor_props.transformFunctionsPropTypeUtil
		}, /* @__PURE__ */ react.createElement(RepeaterHeader, {
			label: (0, _wordpress_i18n.__)("Transform", "elementor"),
			adornment: () => /* @__PURE__ */ react.createElement(ControlAdornments, { customContext: {
				path: ["transform"],
				propType
			} }),
			ref: headerRef
		}, /* @__PURE__ */ react.createElement(TransformBasePopoverTrigger, {
			popupState,
			repeaterBindKey: bind
		}), /* @__PURE__ */ react.createElement(TooltipAddItemAction, {
			disabled: shouldDisableAddItem,
			tooltipContent: ToolTip,
			enableTooltip: shouldDisableAddItem,
			ariaLabel: "transform"
		})), /* @__PURE__ */ react.createElement(ItemsContainer, null, /* @__PURE__ */ react.createElement(Item, {
			Icon: TransformIcon,
			Label: TransformLabel,
			actions: /* @__PURE__ */ react.createElement(react.Fragment, null, /* @__PURE__ */ react.createElement(DisableItemAction, null), /* @__PURE__ */ react.createElement(RemoveItemAction, null))
		})), /* @__PURE__ */ react.createElement(EditItemPopover, null, /* @__PURE__ */ react.createElement(TransformContent, null))));
	}, "Repeater");
	var TransformBasePopoverTrigger = ({ popupState, repeaterBindKey }) => {
		const { bind } = useBoundProp();
		const titleLabel = (0, _wordpress_i18n.__)("Transform settings", "elementor");
		return bind !== repeaterBindKey ? null : /* @__PURE__ */ react.createElement(_elementor_ui.Tooltip, {
			title: titleLabel,
			placement: "top"
		}, /* @__PURE__ */ react.createElement(_elementor_ui.IconButton, {
			size: SIZE$1,
			"aria-label": titleLabel,
			...(0, _elementor_ui.bindTrigger)(popupState)
		}, /* @__PURE__ */ react.createElement(_elementor_icons.AdjustmentsIcon, { fontSize: SIZE$1 })));
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/selection-size-control.tsx
	var SelectionSizeControl = createControl(({ selectionLabel, sizeLabel, selectionConfig, sizeConfigMap }) => {
		const { value, setValue, propType } = useBoundProp(_elementor_editor_props.selectionSizePropTypeUtil);
		const rowRef = (0, react.useRef)(null);
		const sizeFieldId = sizeLabel.replace(/\s+/g, "-").toLowerCase();
		const currentSizeConfig = (0, react.useMemo)(() => {
			switch (value.selection.$$type) {
				case "key-value": return sizeConfigMap[value?.selection?.value.value.value || ""];
				case "string": return sizeConfigMap[value?.selection?.value || ""];
				default: return null;
			}
		}, [value, sizeConfigMap]);
		const SelectionComponent = selectionConfig.component;
		return /* @__PURE__ */ react.createElement(PropProvider, {
			value,
			setValue,
			propType
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			container: true,
			spacing: 1.5,
			ref: rowRef
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6,
			sx: {
				display: "flex",
				alignItems: "center"
			}
		}, /* @__PURE__ */ react.createElement(ControlFormLabel, null, selectionLabel)), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6
		}, /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "selection" }, /* @__PURE__ */ react.createElement(SelectionComponent, { ...selectionConfig.props }))), currentSizeConfig && /* @__PURE__ */ react.createElement(react.Fragment, null, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6,
			sx: {
				display: "flex",
				alignItems: "center"
			}
		}, /* @__PURE__ */ react.createElement(ControlFormLabel, { htmlFor: sizeFieldId }, sizeLabel)), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 6
		}, /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ react.createElement(SizeControl, {
			anchorRef: rowRef,
			variant: currentSizeConfig.variant,
			units: currentSizeConfig.units,
			defaultUnit: currentSizeConfig.defaultUnit,
			id: sizeFieldId
		}))))));
	});

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/transition-control/data.ts
	var initialTransitionValue = {
		selection: {
			$$type: "key-value",
			value: {
				key: {
					value: (0, _wordpress_i18n.__)("All properties", "elementor"),
					$$type: "string"
				},
				value: {
					value: "all",
					$$type: "string"
				}
			}
		},
		size: {
			$$type: "size",
			value: {
				size: 200,
				unit: "ms"
			}
		}
	};
	var MIN_PRO_VERSION = "3.35";
	var getIsSiteRtl = () => {
		return !!window.elementorFrontend?.config?.is_rtl;
	};
	var shouldShowAllTransitionProperties = () => {
		if (!(0, _elementor_utils.hasProInstalled)()) return true;
		const proVersion = window.elementorPro?.config?.version;
		if (!proVersion) return false;
		return (0, _elementor_utils.isVersionGreaterOrEqual)(proVersion, MIN_PRO_VERSION);
	};
	var createTransitionPropertiesList = () => {
		const isSiteRtl = getIsSiteRtl();
		const baseProperties = [
			{
				label: (0, _wordpress_i18n.__)("Default", "elementor"),
				type: "category",
				properties: [{
					label: (0, _wordpress_i18n.__)("All properties", "elementor"),
					value: "all"
				}]
			},
			{
				label: (0, _wordpress_i18n.__)("Margin", "elementor"),
				type: "category",
				properties: [
					{
						label: (0, _wordpress_i18n.__)("Margin (all)", "elementor"),
						value: "margin",
						isDisabled: true
					},
					{
						label: (0, _wordpress_i18n.__)("Margin bottom", "elementor"),
						value: "margin-block-end",
						isDisabled: true
					},
					{
						label: isSiteRtl ? (0, _wordpress_i18n.__)("Margin right", "elementor") : (0, _wordpress_i18n.__)("Margin left", "elementor"),
						value: "margin-inline-start",
						isDisabled: true
					},
					{
						label: isSiteRtl ? (0, _wordpress_i18n.__)("Margin left", "elementor") : (0, _wordpress_i18n.__)("Margin right", "elementor"),
						value: "margin-inline-end",
						isDisabled: true
					},
					{
						label: (0, _wordpress_i18n.__)("Margin top", "elementor"),
						value: "margin-block-start",
						isDisabled: true
					}
				]
			},
			{
				label: (0, _wordpress_i18n.__)("Padding", "elementor"),
				type: "category",
				properties: [
					{
						label: (0, _wordpress_i18n.__)("Padding (all)", "elementor"),
						value: "padding",
						isDisabled: true
					},
					{
						label: (0, _wordpress_i18n.__)("Padding bottom", "elementor"),
						value: "padding-block-end",
						isDisabled: true
					},
					{
						label: isSiteRtl ? (0, _wordpress_i18n.__)("Padding right", "elementor") : (0, _wordpress_i18n.__)("Padding left", "elementor"),
						value: "padding-inline-start",
						isDisabled: true
					},
					{
						label: isSiteRtl ? (0, _wordpress_i18n.__)("Padding left", "elementor") : (0, _wordpress_i18n.__)("Padding right", "elementor"),
						value: "padding-inline-end",
						isDisabled: true
					},
					{
						label: (0, _wordpress_i18n.__)("Padding top", "elementor"),
						value: "padding-block-start",
						isDisabled: true
					}
				]
			},
			{
				label: (0, _wordpress_i18n.__)("Flex", "elementor"),
				type: "category",
				properties: [
					{
						label: (0, _wordpress_i18n.__)("Flex (all)", "elementor"),
						value: "flex",
						isDisabled: true
					},
					{
						label: (0, _wordpress_i18n.__)("Flex grow", "elementor"),
						value: "flex-grow",
						isDisabled: true
					},
					{
						label: (0, _wordpress_i18n.__)("Flex shrink", "elementor"),
						value: "flex-shrink",
						isDisabled: true
					},
					{
						label: (0, _wordpress_i18n.__)("Flex basis", "elementor"),
						value: "flex-basis",
						isDisabled: true
					}
				]
			},
			{
				label: (0, _wordpress_i18n.__)("Size", "elementor"),
				type: "category",
				properties: [
					{
						label: (0, _wordpress_i18n.__)("Width", "elementor"),
						value: "width",
						isDisabled: true
					},
					{
						label: (0, _wordpress_i18n.__)("Height", "elementor"),
						value: "height",
						isDisabled: true
					},
					{
						label: (0, _wordpress_i18n.__)("Max height", "elementor"),
						value: "max-height",
						isDisabled: true
					},
					{
						label: (0, _wordpress_i18n.__)("Max width", "elementor"),
						value: "max-width",
						isDisabled: true
					},
					{
						label: (0, _wordpress_i18n.__)("Min height", "elementor"),
						value: "min-height",
						isDisabled: true
					},
					{
						label: (0, _wordpress_i18n.__)("Min width", "elementor"),
						value: "min-width",
						isDisabled: true
					}
				]
			},
			{
				label: (0, _wordpress_i18n.__)("Position", "elementor"),
				type: "category",
				properties: [
					{
						label: (0, _wordpress_i18n.__)("Top", "elementor"),
						value: "inset-block-start",
						isDisabled: true
					},
					{
						label: isSiteRtl ? (0, _wordpress_i18n.__)("Right", "elementor") : (0, _wordpress_i18n.__)("Left", "elementor"),
						value: "inset-inline-start",
						isDisabled: true
					},
					{
						label: isSiteRtl ? (0, _wordpress_i18n.__)("Left", "elementor") : (0, _wordpress_i18n.__)("Right", "elementor"),
						value: "inset-inline-end",
						isDisabled: true
					},
					{
						label: (0, _wordpress_i18n.__)("Bottom", "elementor"),
						value: "inset-block-end",
						isDisabled: true
					},
					{
						label: (0, _wordpress_i18n.__)("Z-index", "elementor"),
						value: "z-index",
						isDisabled: true
					}
				]
			},
			{
				label: (0, _wordpress_i18n.__)("Typography", "elementor"),
				type: "category",
				properties: [
					{
						label: (0, _wordpress_i18n.__)("Font color", "elementor"),
						value: "color",
						isDisabled: true
					},
					{
						label: (0, _wordpress_i18n.__)("Font size", "elementor"),
						value: "font-size",
						isDisabled: true
					},
					{
						label: (0, _wordpress_i18n.__)("Line height", "elementor"),
						value: "line-height",
						isDisabled: true
					},
					{
						label: (0, _wordpress_i18n.__)("Letter spacing", "elementor"),
						value: "letter-spacing",
						isDisabled: true
					},
					{
						label: (0, _wordpress_i18n.__)("Word spacing", "elementor"),
						value: "word-spacing",
						isDisabled: true
					},
					{
						label: (0, _wordpress_i18n.__)("Font variations", "elementor"),
						value: "font-variation-settings",
						isDisabled: true
					},
					{
						label: (0, _wordpress_i18n.__)("Text stroke color", "elementor"),
						value: "-webkit-text-stroke-color",
						isDisabled: true
					}
				]
			},
			{
				label: (0, _wordpress_i18n.__)("Background", "elementor"),
				type: "category",
				properties: [
					{
						label: (0, _wordpress_i18n.__)("Background color", "elementor"),
						value: "background-color",
						isDisabled: true
					},
					{
						label: (0, _wordpress_i18n.__)("Background position", "elementor"),
						value: "background-position",
						isDisabled: true
					},
					{
						label: (0, _wordpress_i18n.__)("Box shadow", "elementor"),
						value: "box-shadow",
						isDisabled: true
					}
				]
			},
			{
				label: (0, _wordpress_i18n.__)("Border", "elementor"),
				type: "category",
				properties: [
					{
						label: (0, _wordpress_i18n.__)("Border (all)", "elementor"),
						value: "border",
						isDisabled: true
					},
					{
						label: (0, _wordpress_i18n.__)("Border radius", "elementor"),
						value: "border-radius",
						isDisabled: true
					},
					{
						label: (0, _wordpress_i18n.__)("Border color", "elementor"),
						value: "border-color",
						isDisabled: true
					},
					{
						label: (0, _wordpress_i18n.__)("Border width", "elementor"),
						value: "border-width",
						isDisabled: true
					}
				]
			},
			{
				label: (0, _wordpress_i18n.__)("Effects", "elementor"),
				type: "category",
				properties: [
					{
						label: (0, _wordpress_i18n.__)("Opacity", "elementor"),
						value: "opacity",
						isDisabled: true
					},
					{
						label: (0, _wordpress_i18n.__)("Transform (all)", "elementor"),
						value: "transform",
						isDisabled: true
					},
					{
						label: (0, _wordpress_i18n.__)("Filter (all)", "elementor"),
						value: "filter",
						isDisabled: true
					}
				]
			}
		];
		return shouldShowAllTransitionProperties() ? baseProperties : [baseProperties[0]];
	};
	var transitionProperties = createTransitionPropertiesList();
	var transitionsItemsList = transitionProperties.map((category) => ({
		label: category.label,
		items: category.properties.map((property) => property.label)
	}));

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/transition-control/trainsition-events.ts
	var transitionRepeaterMixpanelEvent = {
		eventName: "click_added_transition",
		location: "V4 Style Tab",
		secondaryLocation: "Transition control",
		trigger: "click"
	};
	function subscribeToTransitionEvent() {
		eventBus.subscribe("transition-item-added", (data) => {
			const value = data?.itemValue?.selection?.value?.value?.value;
			const widgetType = (0, _elementor_editor_elements.getSelectedElements)()[0]?.type ?? null;
			(0, _elementor_events.trackEvent)({
				transition_type: value ?? "unknown",
				...transitionRepeaterMixpanelEvent,
				widget_type: widgetType
			});
		});
	}

//#endregion
//#region packages/packages/libs/editor-controls/src/utils/tracking.ts
	var getBaseEventProperties = (data, config) => ({
		window_name: config?.appTypes?.editor ?? "editor",
		interaction_type: config?.triggers?.click ?? "Click",
		target_name: data.target_name,
		target_location: data.target_location ?? "widget_panel",
		location_l1: data.location_l1 ?? (0, _elementor_editor_elements.getSelectedElements)()[0]?.type ?? "",
		...data.location_l2 && { location_l2: data.location_l2 }
	});
	var dispatchPromotionEvent = (data, resolveOptions) => {
		const { dispatchEvent, config } = (0, _elementor_events.getMixpanel)();
		const { eventName, interactionResult, interactionDescription } = resolveOptions(config);
		if (!eventName) return;
		dispatchEvent?.(eventName, {
			...getBaseEventProperties(data, config),
			interaction_result: interactionResult,
			interaction_description: interactionDescription
		});
	};
	var trackViewPromotion = (data) => {
		dispatchPromotionEvent(data, (config) => ({
			eventName: config?.names?.promotions?.viewPromotion,
			interactionResult: config?.interactionResults?.promotionViewed ?? "promotion_viewed",
			interactionDescription: "user_viewed_promotion"
		}));
	};
	var trackUpgradePromotionClick = (data) => {
		dispatchPromotionEvent(data, (config) => ({
			eventName: config?.names?.promotions?.upgradePromotionClick,
			interactionResult: config?.interactionResults?.upgradeNow ?? "upgrade_now",
			interactionDescription: "user_clicked_upgrade_now"
		}));
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/transition-control/transition-selector.tsx
	var toTransitionSelectorValue = (label) => {
		for (const category of transitionProperties) {
			const property = category.properties.find((prop) => prop.label === label);
			if (property) return {
				key: {
					value: property.label,
					$$type: "string"
				},
				value: {
					value: property.value,
					$$type: "string"
				}
			};
		}
		return null;
	};
	function getTransitionPropertyByValue(item) {
		if (!item?.value) return null;
		for (const category of transitionProperties) for (const property of category.properties) if (property.value === item.value) return property;
		return null;
	}
	var includeCurrentValueInOptions = (value, disabledItems) => {
		return disabledItems.filter((item) => {
			return item !== value.key.value;
		});
	};
	var PRO_UPGRADE_URL = "https://go.elementor.com/go-pro-transitions-modal/";
	var TransitionSelector = ({ recentlyUsedList = [], disabledItems = [], showPromotion = false }) => {
		const { value, setValue } = useBoundProp(_elementor_editor_props.keyValuePropTypeUtil);
		const { key: { value: transitionLabel } } = value;
		const defaultRef = (0, react.useRef)(null);
		const popoverState = (0, _elementor_ui.usePopupState)({ variant: "popover" });
		const disabledCategories = (0, react.useMemo)(() => {
			return new Set(transitionProperties.filter((cat) => cat.properties.some((prop) => prop.isDisabled)).map((cat) => cat.label));
		}, []);
		const getItemList = () => {
			const recentItems = recentlyUsedList.map((item) => getTransitionPropertyByValue({
				value: item,
				$$type: "string"
			})?.label).filter((item) => !!item);
			const filteredItems = transitionsItemsList.map((category) => {
				return {
					...category,
					items: category.items.filter((item) => !recentItems.includes(item))
				};
			});
			if (recentItems.length === 0) return filteredItems;
			const [first, ...rest] = filteredItems;
			return [
				first,
				{
					label: (0, _wordpress_i18n.__)("Recently Used", "elementor"),
					items: recentItems
				},
				...rest
			];
		};
		const handleTransitionPropertyChange = (newLabel) => {
			const newValue = toTransitionSelectorValue(newLabel);
			if (!newValue) return;
			setValue(newValue);
			popoverState.close();
		};
		const getAnchorPosition = () => {
			if (!defaultRef.current) return;
			const rect = defaultRef.current.getBoundingClientRect();
			return {
				top: rect.top,
				left: rect.right + 36
			};
		};
		return /* @__PURE__ */ react.createElement(_elementor_ui.Box, { ref: defaultRef }, /* @__PURE__ */ react.createElement(ControlActions, null, /* @__PURE__ */ react.createElement(_elementor_ui.UnstableTag, {
			variant: "outlined",
			label: transitionLabel,
			endIcon: /* @__PURE__ */ react.createElement(_elementor_icons.ChevronDownIcon, { fontSize: "tiny" }),
			...(0, _elementor_ui.bindTrigger)(popoverState),
			fullWidth: true
		})), /* @__PURE__ */ react.createElement(_elementor_ui.Popover, {
			disablePortal: true,
			disableScrollLock: true,
			...(0, _elementor_ui.bindPopover)(popoverState),
			anchorReference: "anchorPosition",
			anchorPosition: getAnchorPosition(),
			anchorOrigin: {
				vertical: "top",
				horizontal: "right"
			},
			transformOrigin: {
				vertical: "top",
				horizontal: "left"
			}
		}, /* @__PURE__ */ react.createElement(ItemSelector, {
			itemsList: getItemList(),
			selectedItem: transitionLabel,
			onItemChange: handleTransitionPropertyChange,
			onClose: popoverState.close,
			sectionWidth: 268,
			title: (0, _wordpress_i18n.__)("Transition Property", "elementor"),
			icon: _elementor_icons.VariationsIcon,
			disabledItems: includeCurrentValueInOptions(value, disabledItems),
			categoryItemContentTemplate: (item) => /* @__PURE__ */ react.createElement(_elementor_ui.Box, { sx: {
				display: "flex",
				alignItems: "center",
				justifyContent: "space-between",
				width: "100%"
			} }, /* @__PURE__ */ react.createElement("span", null, item.value), showPromotion && disabledCategories.has(item.value) && /* @__PURE__ */ react.createElement(_elementor_editor_ui.PromotionChip, null)),
			footer: showPromotion ? /* @__PURE__ */ react.createElement(_elementor_editor_ui.PromotionAlert, {
				message: (0, _wordpress_i18n.__)("Upgrade to customize transition properties and control effects.", "elementor"),
				upgradeUrl: PRO_UPGRADE_URL,
				onCtaClick: () => trackUpgradePromotionClick({
					target_name: "transition_property",
					location_l2: "style"
				})
			}) : null
		})));
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/transition-control/transition-repeater-control.tsx
	var DURATION_CONFIG = {
		variant: "time",
		units: ["s", "ms"],
		defaultUnit: "ms"
	};
	var childArrayPropTypeUtil = (0, _elementor_editor_props.createArrayPropUtils)(_elementor_editor_props.selectionSizePropTypeUtil.key, _elementor_editor_props.selectionSizePropTypeUtil.schema, "transition");
	subscribeToTransitionEvent();
	var areAllPropertiesUsed = (value = []) => {
		return value?.length ? transitionProperties.every((category) => {
			return category.properties.every((property) => {
				return property.isDisabled || !!value?.find((item) => {
					return item.value?.selection?.value?.value?.value === property.value;
				});
			});
		}) : false;
	};
	var getSelectionSizeProps = (recentlyUsedList, disabledItems, showPromotion) => {
		return {
			selectionLabel: (0, _wordpress_i18n.__)("Type", "elementor"),
			sizeLabel: (0, _wordpress_i18n.__)("Duration", "elementor"),
			selectionConfig: {
				component: TransitionSelector,
				props: {
					recentlyUsedList,
					disabledItems,
					showPromotion
				}
			},
			sizeConfigMap: { ...transitionProperties.reduce((acc, category) => {
				category.properties.forEach((property) => {
					acc[property.value] = DURATION_CONFIG;
				});
				return acc;
			}, {}) }
		};
	};
	var isItemDisabled = (item) => {
		const property = getTransitionPropertyByValue(item.value.selection.value?.value);
		return !property ? false : !!property.isDisabled;
	};
	var getChildControlConfig = (recentlyUsedList, disabledItems, showPromotion) => {
		return {
			propTypeUtil: _elementor_editor_props.selectionSizePropTypeUtil,
			component: SelectionSizeControl,
			props: getSelectionSizeProps(recentlyUsedList, disabledItems, showPromotion),
			isItemDisabled
		};
	};
	var isPropertyUsed = (value, property) => {
		return (value ?? []).some((item) => {
			return item?.value?.selection?.value?.value?.value === property.value;
		});
	};
	var getDisabledItemLabels = (values = []) => {
		const selectedLabels = (values || []).map((item) => item.value?.selection?.value?.key?.value);
		const proDisabledLabels = [];
		transitionProperties.forEach((category) => {
			const disabledProperties = category.properties.filter((property) => property.isDisabled && !selectedLabels.includes(property.label)).map((property) => property.label);
			proDisabledLabels.push(...disabledProperties);
		});
		return {
			allDisabled: [...selectedLabels, ...proDisabledLabels],
			proDisabled: proDisabledLabels
		};
	};
	var getInitialValue = (values = []) => {
		if (!values?.length) return initialTransitionValue;
		for (const category of transitionProperties) for (const property of category.properties) {
			if (isPropertyUsed(values, property)) continue;
			return {
				...initialTransitionValue,
				selection: {
					$$type: "key-value",
					value: {
						key: {
							value: property.label,
							$$type: "string"
						},
						value: {
							value: property.value,
							$$type: "string"
						}
					}
				}
			};
		}
		return initialTransitionValue;
	};
	var disableAddItemTooltipContent = /* @__PURE__ */ react.createElement(_elementor_ui.Alert, {
		sx: {
			width: 280,
			gap: .5
		},
		color: "secondary",
		icon: /* @__PURE__ */ react.createElement(_elementor_icons.InfoCircleFilledIcon, null)
	}, /* @__PURE__ */ react.createElement(_elementor_ui.AlertTitle, null, (0, _wordpress_i18n.__)("Transitions", "elementor")), /* @__PURE__ */ react.createElement(_elementor_ui.Box, { component: "span" }, /* @__PURE__ */ react.createElement(_elementor_ui.Typography, { variant: "body2" }, (0, _wordpress_i18n.__)("Switch to 'Normal' state to add a transition.", "elementor"))));
	var TransitionRepeaterControl = createControl(({ recentlyUsedListGetter, currentStyleState }) => {
		const currentStyleIsNormal = currentStyleState === null;
		const [recentlyUsedList, setRecentlyUsedList] = (0, react.useState)([]);
		const proInstalled = (0, _elementor_utils.hasProInstalled)();
		const { value, setValue } = useBoundProp(childArrayPropTypeUtil);
		const { allDisabled: disabledItems, proDisabled: proDisabledItems } = (0, react.useMemo)(() => getDisabledItemLabels(value), [value]);
		const allowedTransitionSet = (0, react.useMemo)(() => {
			const set = /* @__PURE__ */ new Set();
			transitionProperties.forEach((category) => {
				category.properties.forEach((prop) => {
					if (!prop.isDisabled || proInstalled) set.add(prop.value);
				});
			});
			return set;
		}, [proInstalled]);
		(0, react.useEffect)(() => {
			if (!value || value.length === 0) return;
			const sanitized = value.filter((item) => {
				const selectionValue = item?.value?.selection?.value?.value?.value ?? "";
				return allowedTransitionSet.has(selectionValue);
			});
			if (sanitized.length !== value.length) setValue(sanitized);
		}, [allowedTransitionSet]);
		(0, react.useEffect)(() => {
			recentlyUsedListGetter().then(setRecentlyUsedList);
		}, [recentlyUsedListGetter]);
		const allPropertiesUsed = (0, react.useMemo)(() => areAllPropertiesUsed(value), [value]);
		const isAddItemDisabled = !currentStyleIsNormal || allPropertiesUsed;
		return /* @__PURE__ */ react.createElement(RepeatableControl, {
			label: (0, _wordpress_i18n.__)("Transitions", "elementor"),
			repeaterLabel: (0, _wordpress_i18n.__)("Transitions", "elementor"),
			patternLabel: "${value.selection.value.key.value}: ${value.size.value.size}${value.size.value.unit}",
			placeholder: (0, _wordpress_i18n.__)("Empty Transition", "elementor"),
			showDuplicate: false,
			showToggle: true,
			initialValues: getInitialValue(value),
			childControlConfig: getChildControlConfig(recentlyUsedList, disabledItems, proDisabledItems.length > 0),
			propKey: "transition",
			addItemTooltipProps: {
				disabled: isAddItemDisabled,
				enableTooltip: !currentStyleIsNormal,
				tooltipContent: disableAddItemTooltipContent
			}
		});
	});

//#endregion
//#region node_modules/dayjs/dayjs.min.js
	var require_dayjs_min = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		(function(t, e) {
			"object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs = e();
		})(exports, (function() {
			"use strict";
			var t = 1e3;
			var e = 6e4;
			var n = 36e5;
			var r = "millisecond";
			var i = "second";
			var s = "minute";
			var u = "hour";
			var a = "day";
			var o = "week";
			var c = "month";
			var f = "quarter";
			var h = "year";
			var d = "date";
			var l = "Invalid Date";
			var $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/;
			var y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g;
			var M = {
				name: "en",
				weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
				months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
				ordinal: function(t) {
					var e = [
						"th",
						"st",
						"nd",
						"rd"
					];
					var n = t % 100;
					return "[" + t + (e[(n - 20) % 10] || e[n] || e[0]) + "]";
				}
			};
			var m = function(t, e, n) {
				var r = String(t);
				return !r || r.length >= e ? t : "" + Array(e + 1 - r.length).join(n) + t;
			};
			var v = {
				s: m,
				z: function(t) {
					var e = -t.utcOffset();
					var n = Math.abs(e);
					var r = Math.floor(n / 60);
					var i = n % 60;
					return (e <= 0 ? "+" : "-") + m(r, 2, "0") + ":" + m(i, 2, "0");
				},
				m: function t(e, n) {
					if (e.date() < n.date()) return -t(n, e);
					var r = 12 * (n.year() - e.year()) + (n.month() - e.month());
					var i = e.clone().add(r, c);
					var s = n - i < 0;
					var u = e.clone().add(r + (s ? -1 : 1), c);
					return +(-(r + (n - i) / (s ? i - u : u - i)) || 0);
				},
				a: function(t) {
					return t < 0 ? Math.ceil(t) || 0 : Math.floor(t);
				},
				p: function(t) {
					return {
						M: c,
						y: h,
						w: o,
						d: a,
						D: d,
						h: u,
						m: s,
						s: i,
						ms: r,
						Q: f
					}[t] || String(t || "").toLowerCase().replace(/s$/, "");
				},
				u: function(t) {
					return void 0 === t;
				}
			};
			var g = "en";
			var D = {};
			D[g] = M;
			var p = "$isDayjsObject";
			var S = function(t) {
				return t instanceof _ || !(!t || !t[p]);
			};
			var w = function t(e, n, r) {
				var i;
				if (!e) return g;
				if ("string" == typeof e) {
					var s = e.toLowerCase();
					D[s] && (i = s), n && (D[s] = n, i = s);
					var u = e.split("-");
					if (!i && u.length > 1) return t(u[0]);
				} else {
					var a = e.name;
					D[a] = e, i = a;
				}
				return !r && i && (g = i), i || !r && g;
			};
			var O = function(t, e) {
				if (S(t)) return t.clone();
				var n = "object" == typeof e ? e : {};
				return n.date = t, n.args = arguments, new _(n);
			};
			var b = v;
			b.l = w, b.i = S, b.w = function(t, e) {
				return O(t, {
					locale: e.$L,
					utc: e.$u,
					x: e.$x,
					$offset: e.$offset
				});
			};
			var _ = function() {
				function M(t) {
					this.$L = w(t.locale, null, !0), this.parse(t), this.$x = this.$x || t.x || {}, this[p] = !0;
				}
				var m = M.prototype;
				return m.parse = function(t) {
					this.$d = function(t) {
						var e = t.date;
						var n = t.utc;
						if (null === e) return /* @__PURE__ */ new Date(NaN);
						if (b.u(e)) return /* @__PURE__ */ new Date();
						if (e instanceof Date) return new Date(e);
						if ("string" == typeof e && !/Z$/i.test(e)) {
							var r = e.match($);
							if (r) {
								var i = r[2] - 1 || 0;
								var s = (r[7] || "0").substring(0, 3);
								return n ? new Date(Date.UTC(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s)) : new Date(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s);
							}
						}
						return new Date(e);
					}(t), this.init();
				}, m.init = function() {
					var t = this.$d;
					this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(), this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds();
				}, m.$utils = function() {
					return b;
				}, m.isValid = function() {
					return !(this.$d.toString() === l);
				}, m.isSame = function(t, e) {
					var n = O(t);
					return this.startOf(e) <= n && n <= this.endOf(e);
				}, m.isAfter = function(t, e) {
					return O(t) < this.startOf(e);
				}, m.isBefore = function(t, e) {
					return this.endOf(e) < O(t);
				}, m.$g = function(t, e, n) {
					return b.u(t) ? this[e] : this.set(n, t);
				}, m.unix = function() {
					return Math.floor(this.valueOf() / 1e3);
				}, m.valueOf = function() {
					return this.$d.getTime();
				}, m.startOf = function(t, e) {
					var n = this;
					var r = !!b.u(e) || e;
					var f = b.p(t);
					var l = function(t, e) {
						var i = b.w(n.$u ? Date.UTC(n.$y, e, t) : new Date(n.$y, e, t), n);
						return r ? i : i.endOf(a);
					};
					var $ = function(t, e) {
						return b.w(n.toDate()[t].apply(n.toDate("s"), (r ? [
							0,
							0,
							0,
							0
						] : [
							23,
							59,
							59,
							999
						]).slice(e)), n);
					};
					var y = this.$W;
					var M = this.$M;
					var m = this.$D;
					var v = "set" + (this.$u ? "UTC" : "");
					switch (f) {
						case h: return r ? l(1, 0) : l(31, 11);
						case c: return r ? l(1, M) : l(0, M + 1);
						case o:
							var g = this.$locale().weekStart || 0;
							var D = (y < g ? y + 7 : y) - g;
							return l(r ? m - D : m + (6 - D), M);
						case a:
						case d: return $(v + "Hours", 0);
						case u: return $(v + "Minutes", 1);
						case s: return $(v + "Seconds", 2);
						case i: return $(v + "Milliseconds", 3);
						default: return this.clone();
					}
				}, m.endOf = function(t) {
					return this.startOf(t, !1);
				}, m.$set = function(t, e) {
					var n;
					var o = b.p(t);
					var f = "set" + (this.$u ? "UTC" : "");
					var l = (n = {}, n[a] = f + "Date", n[d] = f + "Date", n[c] = f + "Month", n[h] = f + "FullYear", n[u] = f + "Hours", n[s] = f + "Minutes", n[i] = f + "Seconds", n[r] = f + "Milliseconds", n)[o];
					var $ = o === a ? this.$D + (e - this.$W) : e;
					if (o === c || o === h) {
						var y = this.clone().set(d, 1);
						y.$d[l]($), y.init(), this.$d = y.set(d, Math.min(this.$D, y.daysInMonth())).$d;
					} else l && this.$d[l]($);
					return this.init(), this;
				}, m.set = function(t, e) {
					return this.clone().$set(t, e);
				}, m.get = function(t) {
					return this[b.p(t)]();
				}, m.add = function(r, f) {
					var d;
					var l = this;
					r = Number(r);
					var $ = b.p(f);
					var y = function(t) {
						var e = O(l);
						return b.w(e.date(e.date() + Math.round(t * r)), l);
					};
					if ($ === c) return this.set(c, this.$M + r);
					if ($ === h) return this.set(h, this.$y + r);
					if ($ === a) return y(1);
					if ($ === o) return y(7);
					var M = (d = {}, d[s] = e, d[u] = n, d[i] = t, d)[$] || 1;
					var m = this.$d.getTime() + r * M;
					return b.w(m, this);
				}, m.subtract = function(t, e) {
					return this.add(-1 * t, e);
				}, m.format = function(t) {
					var e = this;
					var n = this.$locale();
					if (!this.isValid()) return n.invalidDate || l;
					var r = t || "YYYY-MM-DDTHH:mm:ssZ";
					var i = b.z(this);
					var s = this.$H;
					var u = this.$m;
					var a = this.$M;
					var o = n.weekdays;
					var c = n.months;
					var f = n.meridiem;
					var h = function(t, n, i, s) {
						return t && (t[n] || t(e, r)) || i[n].slice(0, s);
					};
					var d = function(t) {
						return b.s(s % 12 || 12, t, "0");
					};
					var $ = f || function(t, e, n) {
						var r = t < 12 ? "AM" : "PM";
						return n ? r.toLowerCase() : r;
					};
					return r.replace(y, (function(t, r) {
						return r || function(t) {
							switch (t) {
								case "YY": return String(e.$y).slice(-2);
								case "YYYY": return b.s(e.$y, 4, "0");
								case "M": return a + 1;
								case "MM": return b.s(a + 1, 2, "0");
								case "MMM": return h(n.monthsShort, a, c, 3);
								case "MMMM": return h(c, a);
								case "D": return e.$D;
								case "DD": return b.s(e.$D, 2, "0");
								case "d": return String(e.$W);
								case "dd": return h(n.weekdaysMin, e.$W, o, 2);
								case "ddd": return h(n.weekdaysShort, e.$W, o, 3);
								case "dddd": return o[e.$W];
								case "H": return String(s);
								case "HH": return b.s(s, 2, "0");
								case "h": return d(1);
								case "hh": return d(2);
								case "a": return $(s, u, !0);
								case "A": return $(s, u, !1);
								case "m": return String(u);
								case "mm": return b.s(u, 2, "0");
								case "s": return String(e.$s);
								case "ss": return b.s(e.$s, 2, "0");
								case "SSS": return b.s(e.$ms, 3, "0");
								case "Z": return i;
							}
							return null;
						}(t) || i.replace(":", "");
					}));
				}, m.utcOffset = function() {
					return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
				}, m.diff = function(r, d, l) {
					var $;
					var y = this;
					var M = b.p(d);
					var m = O(r);
					var v = (m.utcOffset() - this.utcOffset()) * e;
					var g = this - m;
					var D = function() {
						return b.m(y, m);
					};
					switch (M) {
						case h:
							$ = D() / 12;
							break;
						case c:
							$ = D();
							break;
						case f:
							$ = D() / 3;
							break;
						case o:
							$ = (g - v) / 6048e5;
							break;
						case a:
							$ = (g - v) / 864e5;
							break;
						case u:
							$ = g / n;
							break;
						case s:
							$ = g / e;
							break;
						case i:
							$ = g / t;
							break;
						default: $ = g;
					}
					return l ? $ : b.a($);
				}, m.daysInMonth = function() {
					return this.endOf(c).$D;
				}, m.$locale = function() {
					return D[this.$L];
				}, m.locale = function(t, e) {
					if (!t) return this.$L;
					var n = this.clone();
					var r = w(t, e, !0);
					return r && (n.$L = r), n;
				}, m.clone = function() {
					return b.w(this.$d, this);
				}, m.toDate = function() {
					return new Date(this.valueOf());
				}, m.toJSON = function() {
					return this.isValid() ? this.toISOString() : null;
				}, m.toISOString = function() {
					return this.$d.toISOString();
				}, m.toString = function() {
					return this.$d.toUTCString();
				}, M;
			}();
			var k = _.prototype;
			return O.prototype = k, [
				["$ms", r],
				["$s", i],
				["$m", s],
				["$H", u],
				["$W", a],
				["$M", c],
				["$y", h],
				["$D", d]
			].forEach((function(t) {
				k[t[1]] = function(e) {
					return this.$g(e, t[0], t[1]);
				};
			})), O.extend = function(t, e) {
				return t.$i || (t(e, _, O), t.$i = !0), O;
			}, O.locale = w, O.isDayjs = S, O.unix = function(t) {
				return O(1e3 * t);
			}, O.en = D[g], O.Ls = D, O.p = {}, O;
		}));
	}));

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/date-time-control.tsx
	var import_dayjs_min = /* @__PURE__ */ __toESM(require_dayjs_min());
	var DATE_FORMAT$1 = "YYYY-MM-DD";
	var TIME_FORMAT$1 = "HH:mm";
	var DateTimeControl = createControl(({ inputDisabled }) => {
		const { value, setValue, ...propContext } = useBoundProp(_elementor_editor_props.DateTimePropTypeUtil);
		const handleChange = (newValue, meta) => {
			const field = meta.bind;
			const fieldValue = newValue[field];
			if ((0, _elementor_editor_props.isTransformable)(fieldValue)) return setValue({
				...value,
				[field]: fieldValue
			});
			let formattedValue = "";
			if (fieldValue) {
				const dayjsValue = fieldValue;
				formattedValue = field === "date" ? dayjsValue.format(DATE_FORMAT$1) : dayjsValue.format(TIME_FORMAT$1);
			}
			setValue({
				...value,
				[field]: {
					$$type: "string",
					value: formattedValue
				}
			});
		};
		const parseDateValue = (dateStr) => {
			if (!dateStr) return null;
			const d = import_dayjs_min.default(dateStr);
			return d && typeof d.isValid === "function" && d.isValid() ? d : null;
		};
		const parseTimeValue = (timeStr) => {
			if (!timeStr) return null;
			const [hours, minutes] = timeStr.split(":");
			const h = Number.parseInt(hours ?? "", 10);
			const m = Number.parseInt(minutes ?? "", 10);
			if (Number.isNaN(h) || Number.isNaN(m)) return null;
			return import_dayjs_min.default().hour(h).minute(m).second(0).millisecond(0);
		};
		return /* @__PURE__ */ react.createElement(PropProvider, {
			...propContext,
			value,
			setValue
		}, /* @__PURE__ */ react.createElement(ControlActions, null, /* @__PURE__ */ react.createElement(_elementor_ui.LocalizationProvider, null, /* @__PURE__ */ react.createElement(_elementor_ui.Box, {
			display: "flex",
			gap: 1,
			alignItems: "center"
		}, /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "date" }, /* @__PURE__ */ react.createElement(_elementor_ui.DatePicker, {
			value: parseDateValue(_elementor_editor_props.stringPropTypeUtil.extract(value?.date)),
			onChange: (v) => handleChange({ date: v }, { bind: "date" }),
			disabled: inputDisabled,
			slotProps: {
				textField: { size: "tiny" },
				openPickerButton: { size: "tiny" },
				openPickerIcon: { fontSize: "tiny" }
			}
		})), /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "time" }, /* @__PURE__ */ react.createElement(_elementor_ui.TimePicker, {
			value: parseTimeValue(_elementor_editor_props.stringPropTypeUtil.extract(value?.time)),
			onChange: (v) => handleChange({ time: v }, { bind: "time" }),
			disabled: inputDisabled,
			slotProps: {
				textField: { size: "tiny" },
				openPickerButton: { size: "tiny" },
				openPickerIcon: { fontSize: "tiny" }
			}
		}))))));
	});

//#endregion
//#region packages/packages/libs/editor-controls/src/utils/date-time.ts
	var DATE_FORMAT = "YYYY-MM-DD";
	var TIME_FORMAT = "HH:mm";
	function isValidDayjs(value) {
		return !!value && typeof value.isValid === "function" && value.isValid();
	}
	function parseDateString(raw) {
		if (!raw) return null;
		const parsed = import_dayjs_min.default(raw);
		return isValidDayjs(parsed) ? parsed : null;
	}
	function parseTimeString(raw) {
		if (!raw) return null;
		const [hours, minutes, seconds] = raw.split(":");
		const h = Number.parseInt(hours ?? "", 10);
		const m = Number.parseInt(minutes ?? "", 10);
		const s = Number.parseInt(seconds ?? "0", 10);
		if (Number.isNaN(h) || Number.isNaN(m)) return null;
		return import_dayjs_min.default().hour(h).minute(m).second(Number.isNaN(s) ? 0 : s).millisecond(0);
	}

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/date-string-control.tsx
	var DateStringControl = createControl(({ inputDisabled, ariaLabel, error, coerceInvalidToNull = false }) => {
		const { value, setValue, disabled } = useBoundProp(_elementor_editor_props.dateStringPropTypeUtil);
		const isDisabled = inputDisabled ?? disabled;
		const slotProps = {
			textField: {
				size: "tiny",
				fullWidth: true,
				error,
				inputProps: ariaLabel ? { "aria-label": ariaLabel } : void 0
			},
			openPickerButton: { size: "tiny" },
			openPickerIcon: { fontSize: "tiny" }
		};
		const handleChange = (newValue, format) => {
			if (!newValue) {
				setValue(null);
				return;
			}
			if (coerceInvalidToNull && !isValidDayjs(newValue)) {
				setValue(null);
				return;
			}
			setValue(newValue.format(format));
		};
		return /* @__PURE__ */ react.createElement(_elementor_ui.LocalizationProvider, null, /* @__PURE__ */ react.createElement(ControlActions, null, /* @__PURE__ */ react.createElement(_elementor_ui.DatePicker, {
			value: parseDateString(value ?? ""),
			onChange: (newValue) => handleChange(newValue, DATE_FORMAT),
			disabled: isDisabled,
			slotProps
		})));
	});

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/date-range-control.tsx
	var RANGE_LABELS$1 = {
		min: (0, _wordpress_i18n.__)("Min date", "elementor"),
		max: (0, _wordpress_i18n.__)("Max date", "elementor")
	};
	var isMaxBeforeMin = (minIso, maxIso) => {
		if (!minIso || !maxIso) return false;
		return maxIso < minIso;
	};
	var RANGE_ERROR_MESSAGE = (0, _wordpress_i18n.__)("Max date must be on or after Min date", "elementor");
	var DateRangeControl = createControl(() => {
		const { value, setValue, ...propContext } = useBoundProp(_elementor_editor_props.dateRangePropTypeUtil);
		const minString = _elementor_editor_props.dateStringPropTypeUtil.extract(value?.min);
		const maxString = _elementor_editor_props.dateStringPropTypeUtil.extract(value?.max);
		const hasInvalidRange = isMaxBeforeMin(minString, maxString);
		return /* @__PURE__ */ react.createElement(PropProvider, {
			...propContext,
			value,
			setValue
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Stack, { gap: .75 }, /* @__PURE__ */ react.createElement(_elementor_ui.Stack, {
			direction: "row",
			gap: 2,
			flexWrap: "nowrap"
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			container: true,
			gap: .75,
			alignItems: "center"
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 12
		}, /* @__PURE__ */ react.createElement(ControlFormLabel, null, RANGE_LABELS$1.min)), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 12
		}, /* @__PURE__ */ react.createElement(BoundDateStringControl, {
			bind: "min",
			ariaLabel: RANGE_LABELS$1.min,
			error: hasInvalidRange
		}))), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			container: true,
			gap: .75,
			alignItems: "center"
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 12
		}, /* @__PURE__ */ react.createElement(ControlFormLabel, null, RANGE_LABELS$1.max)), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 12
		}, /* @__PURE__ */ react.createElement(BoundDateStringControl, {
			bind: "max",
			ariaLabel: RANGE_LABELS$1.max,
			error: hasInvalidRange
		})))), hasInvalidRange && /* @__PURE__ */ react.createElement(_elementor_ui.FormHelperText, { error: true }, RANGE_ERROR_MESSAGE)));
	});
	var BoundDateStringControl = ({ bind, ariaLabel, error }) => {
		return /* @__PURE__ */ react.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ react.createElement(DateStringControl, {
			ariaLabel,
			error,
			coerceInvalidToNull: true
		}));
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/time-string-control.tsx
	var TimeStringControl = createControl(({ inputDisabled, ariaLabel, error, coerceInvalidToNull = false }) => {
		const { value, setValue, disabled } = useBoundProp(_elementor_editor_props.timeStringPropTypeUtil);
		const isDisabled = inputDisabled ?? disabled;
		const slotProps = {
			textField: {
				size: "tiny",
				fullWidth: true,
				error,
				inputProps: ariaLabel ? { "aria-label": ariaLabel } : void 0
			},
			openPickerButton: { size: "tiny" },
			openPickerIcon: { fontSize: "tiny" }
		};
		const handleChange = (newValue, format) => {
			if (!newValue) {
				setValue(null);
				return;
			}
			if (coerceInvalidToNull && !isValidDayjs(newValue)) {
				setValue(null);
				return;
			}
			setValue(newValue.format(format));
		};
		return /* @__PURE__ */ react.createElement(_elementor_ui.LocalizationProvider, null, /* @__PURE__ */ react.createElement(ControlActions, null, /* @__PURE__ */ react.createElement(_elementor_ui.TimePicker, {
			value: parseTimeString(value ?? ""),
			onChange: (newValue) => handleChange(newValue, TIME_FORMAT),
			disabled: isDisabled,
			slotProps
		})));
	});

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/time-range-control.tsx
	var RANGE_LABELS = {
		min: (0, _wordpress_i18n.__)("Start time", "elementor"),
		max: (0, _wordpress_i18n.__)("End time", "elementor")
	};
	var TimeRangeControl = createControl(() => {
		const { value, setValue, ...propContext } = useBoundProp(_elementor_editor_props.timeRangePropTypeUtil);
		return /* @__PURE__ */ react.createElement(PropProvider, {
			...propContext,
			value,
			setValue
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Stack, {
			direction: "row",
			gap: 2,
			flexWrap: "nowrap"
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			container: true,
			gap: .75,
			alignItems: "center"
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 12
		}, /* @__PURE__ */ react.createElement(ControlFormLabel, null, RANGE_LABELS.min)), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 12
		}, /* @__PURE__ */ react.createElement(BoundTimeStringControl, {
			bind: "min",
			ariaLabel: RANGE_LABELS.min
		}))), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			container: true,
			gap: .75,
			alignItems: "center"
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 12
		}, /* @__PURE__ */ react.createElement(ControlFormLabel, null, RANGE_LABELS.max)), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			item: true,
			xs: 12
		}, /* @__PURE__ */ react.createElement(BoundTimeStringControl, {
			bind: "max",
			ariaLabel: RANGE_LABELS.max
		})))));
	});
	var BoundTimeStringControl = ({ bind, ariaLabel }) => {
		return /* @__PURE__ */ react.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ react.createElement(TimeStringControl, {
			ariaLabel,
			coerceInvalidToNull: true
		}));
	};

//#endregion
//#region node_modules/orderedmap/dist/index.js
	function OrderedMap(content) {
		this.content = content;
	}
	OrderedMap.prototype = {
		constructor: OrderedMap,
		find: function(key) {
			for (var i = 0; i < this.content.length; i += 2) if (this.content[i] === key) return i;
			return -1;
		},
		get: function(key) {
			var found = this.find(key);
			return found == -1 ? void 0 : this.content[found + 1];
		},
		update: function(key, value, newKey) {
			var self = newKey && newKey != key ? this.remove(newKey) : this;
			var found = self.find(key);
			var content = self.content.slice();
			if (found == -1) content.push(newKey || key, value);
			else {
				content[found + 1] = value;
				if (newKey) content[found] = newKey;
			}
			return new OrderedMap(content);
		},
		remove: function(key) {
			var found = this.find(key);
			if (found == -1) return this;
			var content = this.content.slice();
			content.splice(found, 2);
			return new OrderedMap(content);
		},
		addToStart: function(key, value) {
			return new OrderedMap([key, value].concat(this.remove(key).content));
		},
		addToEnd: function(key, value) {
			var content = this.remove(key).content.slice();
			content.push(key, value);
			return new OrderedMap(content);
		},
		addBefore: function(place, key, value) {
			var without = this.remove(key);
			var content = without.content.slice();
			var found = without.find(place);
			content.splice(found == -1 ? content.length : found, 0, key, value);
			return new OrderedMap(content);
		},
		forEach: function(f) {
			for (var i = 0; i < this.content.length; i += 2) f(this.content[i], this.content[i + 1]);
		},
		prepend: function(map) {
			map = OrderedMap.from(map);
			if (!map.size) return this;
			return new OrderedMap(map.content.concat(this.subtract(map).content));
		},
		append: function(map) {
			map = OrderedMap.from(map);
			if (!map.size) return this;
			return new OrderedMap(this.subtract(map).content.concat(map.content));
		},
		subtract: function(map) {
			var result = this;
			map = OrderedMap.from(map);
			for (var i = 0; i < map.content.length; i += 2) result = result.remove(map.content[i]);
			return result;
		},
		toObject: function() {
			var result = {};
			this.forEach(function(key, value) {
				result[key] = value;
			});
			return result;
		},
		get size() {
			return this.content.length >> 1;
		}
	};
	OrderedMap.from = function(value) {
		if (value instanceof OrderedMap) return value;
		var content = [];
		if (value) for (var prop in value) content.push(prop, value[prop]);
		return new OrderedMap(content);
	};

//#endregion
//#region node_modules/prosemirror-model/dist/index.js
	function findDiffStart(a, b, pos) {
		for (let i = 0;; i++) {
			if (i == a.childCount || i == b.childCount) return a.childCount == b.childCount ? null : pos;
			let childA = a.child(i);
			let childB = b.child(i);
			if (childA == childB) {
				pos += childA.nodeSize;
				continue;
			}
			if (!childA.sameMarkup(childB)) return pos;
			if (childA.isText && childA.text != childB.text) {
				for (let j = 0; childA.text[j] == childB.text[j]; j++) pos++;
				return pos;
			}
			if (childA.content.size || childB.content.size) {
				let inner = findDiffStart(childA.content, childB.content, pos + 1);
				if (inner != null) return inner;
			}
			pos += childA.nodeSize;
		}
	}
	function findDiffEnd(a, b, posA, posB) {
		for (let iA = a.childCount, iB = b.childCount;;) {
			if (iA == 0 || iB == 0) return iA == iB ? null : {
				a: posA,
				b: posB
			};
			let childA = a.child(--iA);
			let childB = b.child(--iB);
			let size = childA.nodeSize;
			if (childA == childB) {
				posA -= size;
				posB -= size;
				continue;
			}
			if (!childA.sameMarkup(childB)) return {
				a: posA,
				b: posB
			};
			if (childA.isText && childA.text != childB.text) {
				let same = 0;
				let minSize = Math.min(childA.text.length, childB.text.length);
				while (same < minSize && childA.text[childA.text.length - same - 1] == childB.text[childB.text.length - same - 1]) {
					same++;
					posA--;
					posB--;
				}
				return {
					a: posA,
					b: posB
				};
			}
			if (childA.content.size || childB.content.size) {
				let inner = findDiffEnd(childA.content, childB.content, posA - 1, posB - 1);
				if (inner) return inner;
			}
			posA -= size;
			posB -= size;
		}
	}
	/**
	A fragment represents a node's collection of child nodes.
	
	Like nodes, fragments are persistent data structures, and you
	should not mutate them or their content. Rather, you create new
	instances whenever needed. The API tries to make this easy.
	*/
	var Fragment$1 = class Fragment$1 {
		static {
			__name(this, "Fragment");
		}
		/**
		@internal
		*/
		constructor(content, size) {
			this.content = content;
			this.size = size || 0;
			if (size == null) for (let i = 0; i < content.length; i++) this.size += content[i].nodeSize;
		}
		/**
		Invoke a callback for all descendant nodes between the given two
		positions (relative to start of this fragment). Doesn't descend
		into a node when the callback returns `false`.
		*/
		nodesBetween(from, to, f, nodeStart = 0, parent) {
			for (let i = 0, pos = 0; pos < to; i++) {
				let child = this.content[i];
				let end = pos + child.nodeSize;
				if (end > from && f(child, nodeStart + pos, parent || null, i) !== false && child.content.size) {
					let start = pos + 1;
					child.nodesBetween(Math.max(0, from - start), Math.min(child.content.size, to - start), f, nodeStart + start);
				}
				pos = end;
			}
		}
		/**
		Call the given callback for every descendant node. `pos` will be
		relative to the start of the fragment. The callback may return
		`false` to prevent traversal of a given node's children.
		*/
		descendants(f) {
			this.nodesBetween(0, this.size, f);
		}
		/**
		Extract the text between `from` and `to`. See the same method on
		[`Node`](https://prosemirror.net/docs/ref/#model.Node.textBetween).
		*/
		textBetween(from, to, blockSeparator, leafText) {
			let text = "";
			let first = true;
			this.nodesBetween(from, to, (node, pos) => {
				let nodeText = node.isText ? node.text.slice(Math.max(from, pos) - pos, to - pos) : !node.isLeaf ? "" : leafText ? typeof leafText === "function" ? leafText(node) : leafText : node.type.spec.leafText ? node.type.spec.leafText(node) : "";
				if (node.isBlock && (node.isLeaf && nodeText || node.isTextblock) && blockSeparator) if (first) first = false;
				else text += blockSeparator;
				text += nodeText;
			}, 0);
			return text;
		}
		/**
		Create a new fragment containing the combined content of this
		fragment and the other.
		*/
		append(other) {
			if (!other.size) return this;
			if (!this.size) return other;
			let last = this.lastChild;
			let first = other.firstChild;
			let content = this.content.slice();
			let i = 0;
			if (last.isText && last.sameMarkup(first)) {
				content[content.length - 1] = last.withText(last.text + first.text);
				i = 1;
			}
			for (; i < other.content.length; i++) content.push(other.content[i]);
			return new Fragment$1(content, this.size + other.size);
		}
		/**
		Cut out the sub-fragment between the two given positions.
		*/
		cut(from, to = this.size) {
			if (from == 0 && to == this.size) return this;
			let result = [];
			let size = 0;
			if (to > from) for (let i = 0, pos = 0; pos < to; i++) {
				let child = this.content[i];
				let end = pos + child.nodeSize;
				if (end > from) {
					if (pos < from || end > to) if (child.isText) child = child.cut(Math.max(0, from - pos), Math.min(child.text.length, to - pos));
					else child = child.cut(Math.max(0, from - pos - 1), Math.min(child.content.size, to - pos - 1));
					result.push(child);
					size += child.nodeSize;
				}
				pos = end;
			}
			return new Fragment$1(result, size);
		}
		/**
		@internal
		*/
		cutByIndex(from, to) {
			if (from == to) return Fragment$1.empty;
			if (from == 0 && to == this.content.length) return this;
			return new Fragment$1(this.content.slice(from, to));
		}
		/**
		Create a new fragment in which the node at the given index is
		replaced by the given node.
		*/
		replaceChild(index, node) {
			let current = this.content[index];
			if (current == node) return this;
			let copy = this.content.slice();
			let size = this.size + node.nodeSize - current.nodeSize;
			copy[index] = node;
			return new Fragment$1(copy, size);
		}
		/**
		Create a new fragment by prepending the given node to this
		fragment.
		*/
		addToStart(node) {
			return new Fragment$1([node].concat(this.content), this.size + node.nodeSize);
		}
		/**
		Create a new fragment by appending the given node to this
		fragment.
		*/
		addToEnd(node) {
			return new Fragment$1(this.content.concat(node), this.size + node.nodeSize);
		}
		/**
		Compare this fragment to another one.
		*/
		eq(other) {
			if (this.content.length != other.content.length) return false;
			for (let i = 0; i < this.content.length; i++) if (!this.content[i].eq(other.content[i])) return false;
			return true;
		}
		/**
		The first child of the fragment, or `null` if it is empty.
		*/
		get firstChild() {
			return this.content.length ? this.content[0] : null;
		}
		/**
		The last child of the fragment, or `null` if it is empty.
		*/
		get lastChild() {
			return this.content.length ? this.content[this.content.length - 1] : null;
		}
		/**
		The number of child nodes in this fragment.
		*/
		get childCount() {
			return this.content.length;
		}
		/**
		Get the child node at the given index. Raise an error when the
		index is out of range.
		*/
		child(index) {
			let found = this.content[index];
			if (!found) throw new RangeError("Index " + index + " out of range for " + this);
			return found;
		}
		/**
		Get the child node at the given index, if it exists.
		*/
		maybeChild(index) {
			return this.content[index] || null;
		}
		/**
		Call `f` for every child node, passing the node, its offset
		into this parent node, and its index.
		*/
		forEach(f) {
			for (let i = 0, p = 0; i < this.content.length; i++) {
				let child = this.content[i];
				f(child, p, i);
				p += child.nodeSize;
			}
		}
		/**
		Find the first position at which this fragment and another
		fragment differ, or `null` if they are the same.
		*/
		findDiffStart(other, pos = 0) {
			return findDiffStart(this, other, pos);
		}
		/**
		Find the first position, searching from the end, at which this
		fragment and the given fragment differ, or `null` if they are
		the same. Since this position will not be the same in both
		nodes, an object with two separate positions is returned.
		*/
		findDiffEnd(other, pos = this.size, otherPos = other.size) {
			return findDiffEnd(this, other, pos, otherPos);
		}
		/**
		Find the index and inner offset corresponding to a given relative
		position in this fragment. The result object will be reused
		(overwritten) the next time the function is called. @internal
		*/
		findIndex(pos) {
			if (pos == 0) return retIndex(0, pos);
			if (pos == this.size) return retIndex(this.content.length, pos);
			if (pos > this.size || pos < 0) throw new RangeError(`Position ${pos} outside of fragment (${this})`);
			for (let i = 0, curPos = 0;; i++) {
				let cur = this.child(i);
				let end = curPos + cur.nodeSize;
				if (end >= pos) {
					if (end == pos) return retIndex(i + 1, end);
					return retIndex(i, curPos);
				}
				curPos = end;
			}
		}
		/**
		Return a debugging string that describes this fragment.
		*/
		toString() {
			return "<" + this.toStringInner() + ">";
		}
		/**
		@internal
		*/
		toStringInner() {
			return this.content.join(", ");
		}
		/**
		Create a JSON-serializeable representation of this fragment.
		*/
		toJSON() {
			return this.content.length ? this.content.map((n) => n.toJSON()) : null;
		}
		/**
		Deserialize a fragment from its JSON representation.
		*/
		static fromJSON(schema, value) {
			if (!value) return Fragment$1.empty;
			if (!Array.isArray(value)) throw new RangeError("Invalid input for Fragment.fromJSON");
			return new Fragment$1(value.map(schema.nodeFromJSON));
		}
		/**
		Build a fragment from an array of nodes. Ensures that adjacent
		text nodes with the same marks are joined together.
		*/
		static fromArray(array) {
			if (!array.length) return Fragment$1.empty;
			let joined;
			let size = 0;
			for (let i = 0; i < array.length; i++) {
				let node = array[i];
				size += node.nodeSize;
				if (i && node.isText && array[i - 1].sameMarkup(node)) {
					if (!joined) joined = array.slice(0, i);
					joined[joined.length - 1] = node.withText(joined[joined.length - 1].text + node.text);
				} else if (joined) joined.push(node);
			}
			return new Fragment$1(joined || array, size);
		}
		/**
		Create a fragment from something that can be interpreted as a
		set of nodes. For `null`, it returns the empty fragment. For a
		fragment, the fragment itself. For a node or array of nodes, a
		fragment containing those nodes.
		*/
		static from(nodes) {
			if (!nodes) return Fragment$1.empty;
			if (nodes instanceof Fragment$1) return nodes;
			if (Array.isArray(nodes)) return this.fromArray(nodes);
			if (nodes.attrs) return new Fragment$1([nodes], nodes.nodeSize);
			throw new RangeError("Can not convert " + nodes + " to a Fragment" + (nodes.nodesBetween ? " (looks like multiple versions of prosemirror-model were loaded)" : ""));
		}
	};
	/**
	An empty fragment. Intended to be reused whenever a node doesn't
	contain anything (rather than allocating a new empty fragment for
	each leaf node).
	*/
	Fragment$1.empty = new Fragment$1([], 0);
	var found = {
		index: 0,
		offset: 0
	};
	function retIndex(index, offset) {
		found.index = index;
		found.offset = offset;
		return found;
	}
	function compareDeep(a, b) {
		if (a === b) return true;
		if (!(a && typeof a == "object") || !(b && typeof b == "object")) return false;
		let array = Array.isArray(a);
		if (Array.isArray(b) != array) return false;
		if (array) {
			if (a.length != b.length) return false;
			for (let i = 0; i < a.length; i++) if (!compareDeep(a[i], b[i])) return false;
		} else {
			for (let p in a) if (!(p in b) || !compareDeep(a[p], b[p])) return false;
			for (let p in b) if (!(p in a)) return false;
		}
		return true;
	}
	/**
	A mark is a piece of information that can be attached to a node,
	such as it being emphasized, in code font, or a link. It has a
	type and optionally a set of attributes that provide further
	information (such as the target of the link). Marks are created
	through a `Schema`, which controls which types exist and which
	attributes they have.
	*/
	var Mark$1 = class Mark$1 {
		static {
			__name(this, "Mark");
		}
		/**
		@internal
		*/
		constructor(type, attrs) {
			this.type = type;
			this.attrs = attrs;
		}
		/**
		Given a set of marks, create a new set which contains this one as
		well, in the right position. If this mark is already in the set,
		the set itself is returned. If any marks that are set to be
		[exclusive](https://prosemirror.net/docs/ref/#model.MarkSpec.excludes) with this mark are present,
		those are replaced by this one.
		*/
		addToSet(set) {
			let copy;
			let placed = false;
			for (let i = 0; i < set.length; i++) {
				let other = set[i];
				if (this.eq(other)) return set;
				if (this.type.excludes(other.type)) {
					if (!copy) copy = set.slice(0, i);
				} else if (other.type.excludes(this.type)) return set;
				else {
					if (!placed && other.type.rank > this.type.rank) {
						if (!copy) copy = set.slice(0, i);
						copy.push(this);
						placed = true;
					}
					if (copy) copy.push(other);
				}
			}
			if (!copy) copy = set.slice();
			if (!placed) copy.push(this);
			return copy;
		}
		/**
		Remove this mark from the given set, returning a new set. If this
		mark is not in the set, the set itself is returned.
		*/
		removeFromSet(set) {
			for (let i = 0; i < set.length; i++) if (this.eq(set[i])) return set.slice(0, i).concat(set.slice(i + 1));
			return set;
		}
		/**
		Test whether this mark is in the given set of marks.
		*/
		isInSet(set) {
			for (let i = 0; i < set.length; i++) if (this.eq(set[i])) return true;
			return false;
		}
		/**
		Test whether this mark has the same type and attributes as
		another mark.
		*/
		eq(other) {
			return this == other || this.type == other.type && compareDeep(this.attrs, other.attrs);
		}
		/**
		Convert this mark to a JSON-serializeable representation.
		*/
		toJSON() {
			let obj = { type: this.type.name };
			for (let _ in this.attrs) {
				obj.attrs = this.attrs;
				break;
			}
			return obj;
		}
		/**
		Deserialize a mark from JSON.
		*/
		static fromJSON(schema, json) {
			if (!json) throw new RangeError("Invalid input for Mark.fromJSON");
			let type = schema.marks[json.type];
			if (!type) throw new RangeError(`There is no mark type ${json.type} in this schema`);
			let mark = type.create(json.attrs);
			type.checkAttrs(mark.attrs);
			return mark;
		}
		/**
		Test whether two sets of marks are identical.
		*/
		static sameSet(a, b) {
			if (a == b) return true;
			if (a.length != b.length) return false;
			for (let i = 0; i < a.length; i++) if (!a[i].eq(b[i])) return false;
			return true;
		}
		/**
		Create a properly sorted mark set from null, a single mark, or an
		unsorted array of marks.
		*/
		static setFrom(marks) {
			if (!marks || Array.isArray(marks) && marks.length == 0) return Mark$1.none;
			if (marks instanceof Mark$1) return [marks];
			let copy = marks.slice();
			copy.sort((a, b) => a.type.rank - b.type.rank);
			return copy;
		}
	};
	/**
	The empty set of marks.
	*/
	Mark$1.none = [];
	/**
	Error type raised by [`Node.replace`](https://prosemirror.net/docs/ref/#model.Node.replace) when
	given an invalid replacement.
	*/
	var ReplaceError = class extends Error {};
	/**
	A slice represents a piece cut out of a larger document. It
	stores not only a fragment, but also the depth up to which nodes on
	both side are ‘open’ (cut through).
	*/
	var Slice = class Slice {
		/**
		Create a slice. When specifying a non-zero open depth, you must
		make sure that there are nodes of at least that depth at the
		appropriate side of the fragment—i.e. if the fragment is an
		empty paragraph node, `openStart` and `openEnd` can't be greater
		than 1.
		
		It is not necessary for the content of open nodes to conform to
		the schema's content constraints, though it should be a valid
		start/end/middle for such a node, depending on which sides are
		open.
		*/
		constructor(content, openStart, openEnd) {
			this.content = content;
			this.openStart = openStart;
			this.openEnd = openEnd;
		}
		/**
		The size this slice would add when inserted into a document.
		*/
		get size() {
			return this.content.size - this.openStart - this.openEnd;
		}
		/**
		@internal
		*/
		insertAt(pos, fragment) {
			let content = insertInto(this.content, pos + this.openStart, fragment);
			return content && new Slice(content, this.openStart, this.openEnd);
		}
		/**
		@internal
		*/
		removeBetween(from, to) {
			return new Slice(removeRange(this.content, from + this.openStart, to + this.openStart), this.openStart, this.openEnd);
		}
		/**
		Tests whether this slice is equal to another slice.
		*/
		eq(other) {
			return this.content.eq(other.content) && this.openStart == other.openStart && this.openEnd == other.openEnd;
		}
		/**
		@internal
		*/
		toString() {
			return this.content + "(" + this.openStart + "," + this.openEnd + ")";
		}
		/**
		Convert a slice to a JSON-serializable representation.
		*/
		toJSON() {
			if (!this.content.size) return null;
			let json = { content: this.content.toJSON() };
			if (this.openStart > 0) json.openStart = this.openStart;
			if (this.openEnd > 0) json.openEnd = this.openEnd;
			return json;
		}
		/**
		Deserialize a slice from its JSON representation.
		*/
		static fromJSON(schema, json) {
			if (!json) return Slice.empty;
			let openStart = json.openStart || 0;
			let openEnd = json.openEnd || 0;
			if (typeof openStart != "number" || typeof openEnd != "number") throw new RangeError("Invalid input for Slice.fromJSON");
			return new Slice(Fragment$1.fromJSON(schema, json.content), openStart, openEnd);
		}
		/**
		Create a slice from a fragment by taking the maximum possible
		open value on both side of the fragment.
		*/
		static maxOpen(fragment, openIsolating = true) {
			let openStart = 0;
			let openEnd = 0;
			for (let n = fragment.firstChild; n && !n.isLeaf && (openIsolating || !n.type.spec.isolating); n = n.firstChild) openStart++;
			for (let n = fragment.lastChild; n && !n.isLeaf && (openIsolating || !n.type.spec.isolating); n = n.lastChild) openEnd++;
			return new Slice(fragment, openStart, openEnd);
		}
	};
	/**
	The empty slice.
	*/
	Slice.empty = new Slice(Fragment$1.empty, 0, 0);
	function removeRange(content, from, to) {
		let { index, offset } = content.findIndex(from), child = content.maybeChild(index);
		let { index: indexTo, offset: offsetTo } = content.findIndex(to);
		if (offset == from || child.isText) {
			if (offsetTo != to && !content.child(indexTo).isText) throw new RangeError("Removing non-flat range");
			return content.cut(0, from).append(content.cut(to));
		}
		if (index != indexTo) throw new RangeError("Removing non-flat range");
		return content.replaceChild(index, child.copy(removeRange(child.content, from - offset - 1, to - offset - 1)));
	}
	function insertInto(content, dist, insert, parent) {
		let { index, offset } = content.findIndex(dist), child = content.maybeChild(index);
		if (offset == dist || child.isText) {
			if (parent && !parent.canReplace(index, index, insert)) return null;
			return content.cut(0, dist).append(insert).append(content.cut(dist));
		}
		let inner = insertInto(child.content, dist - offset - 1, insert, child);
		return inner && content.replaceChild(index, child.copy(inner));
	}
	function replace($from, $to, slice) {
		if (slice.openStart > $from.depth) throw new ReplaceError("Inserted content deeper than insertion position");
		if ($from.depth - slice.openStart != $to.depth - slice.openEnd) throw new ReplaceError("Inconsistent open depths");
		return replaceOuter($from, $to, slice, 0);
	}
	function replaceOuter($from, $to, slice, depth) {
		let index = $from.index(depth);
		let node = $from.node(depth);
		if (index == $to.index(depth) && depth < $from.depth - slice.openStart) {
			let inner = replaceOuter($from, $to, slice, depth + 1);
			return node.copy(node.content.replaceChild(index, inner));
		} else if (!slice.content.size) return close(node, replaceTwoWay($from, $to, depth));
		else if (!slice.openStart && !slice.openEnd && $from.depth == depth && $to.depth == depth) {
			let parent = $from.parent;
			let content = parent.content;
			return close(parent, content.cut(0, $from.parentOffset).append(slice.content).append(content.cut($to.parentOffset)));
		} else {
			let { start, end } = prepareSliceForReplace(slice, $from);
			return close(node, replaceThreeWay($from, start, end, $to, depth));
		}
	}
	function checkJoin(main, sub) {
		if (!sub.type.compatibleContent(main.type)) throw new ReplaceError("Cannot join " + sub.type.name + " onto " + main.type.name);
	}
	function joinable$1($before, $after, depth) {
		let node = $before.node(depth);
		checkJoin(node, $after.node(depth));
		return node;
	}
	__name(joinable$1, "joinable");
	function addNode(child, target) {
		let last = target.length - 1;
		if (last >= 0 && child.isText && child.sameMarkup(target[last])) target[last] = child.withText(target[last].text + child.text);
		else target.push(child);
	}
	function addRange($start, $end, depth, target) {
		let node = ($end || $start).node(depth);
		let startIndex = 0;
		let endIndex = $end ? $end.index(depth) : node.childCount;
		if ($start) {
			startIndex = $start.index(depth);
			if ($start.depth > depth) startIndex++;
			else if ($start.textOffset) {
				addNode($start.nodeAfter, target);
				startIndex++;
			}
		}
		for (let i = startIndex; i < endIndex; i++) addNode(node.child(i), target);
		if ($end && $end.depth == depth && $end.textOffset) addNode($end.nodeBefore, target);
	}
	function close(node, content) {
		node.type.checkContent(content);
		return node.copy(content);
	}
	function replaceThreeWay($from, $start, $end, $to, depth) {
		let openStart = $from.depth > depth && joinable$1($from, $start, depth + 1);
		let openEnd = $to.depth > depth && joinable$1($end, $to, depth + 1);
		let content = [];
		addRange(null, $from, depth, content);
		if (openStart && openEnd && $start.index(depth) == $end.index(depth)) {
			checkJoin(openStart, openEnd);
			addNode(close(openStart, replaceThreeWay($from, $start, $end, $to, depth + 1)), content);
		} else {
			if (openStart) addNode(close(openStart, replaceTwoWay($from, $start, depth + 1)), content);
			addRange($start, $end, depth, content);
			if (openEnd) addNode(close(openEnd, replaceTwoWay($end, $to, depth + 1)), content);
		}
		addRange($to, null, depth, content);
		return new Fragment$1(content);
	}
	function replaceTwoWay($from, $to, depth) {
		let content = [];
		addRange(null, $from, depth, content);
		if ($from.depth > depth) addNode(close(joinable$1($from, $to, depth + 1), replaceTwoWay($from, $to, depth + 1)), content);
		addRange($to, null, depth, content);
		return new Fragment$1(content);
	}
	function prepareSliceForReplace(slice, $along) {
		let extra = $along.depth - slice.openStart;
		let node = $along.node(extra).copy(slice.content);
		for (let i = extra - 1; i >= 0; i--) node = $along.node(i).copy(Fragment$1.from(node));
		return {
			start: node.resolveNoCache(slice.openStart + extra),
			end: node.resolveNoCache(node.content.size - slice.openEnd - extra)
		};
	}
	/**
	You can [_resolve_](https://prosemirror.net/docs/ref/#model.Node.resolve) a position to get more
	information about it. Objects of this class represent such a
	resolved position, providing various pieces of context
	information, and some helper methods.
	
	Throughout this interface, methods that take an optional `depth`
	parameter will interpret undefined as `this.depth` and negative
	numbers as `this.depth + value`.
	*/
	var ResolvedPos = class ResolvedPos {
		/**
		@internal
		*/
		constructor(pos, path, parentOffset) {
			this.pos = pos;
			this.path = path;
			this.parentOffset = parentOffset;
			this.depth = path.length / 3 - 1;
		}
		/**
		@internal
		*/
		resolveDepth(val) {
			if (val == null) return this.depth;
			if (val < 0) return this.depth + val;
			return val;
		}
		/**
		The parent node that the position points into. Note that even if
		a position points into a text node, that node is not considered
		the parent—text nodes are ‘flat’ in this model, and have no content.
		*/
		get parent() {
			return this.node(this.depth);
		}
		/**
		The root node in which the position was resolved.
		*/
		get doc() {
			return this.node(0);
		}
		/**
		The ancestor node at the given level. `p.node(p.depth)` is the
		same as `p.parent`.
		*/
		node(depth) {
			return this.path[this.resolveDepth(depth) * 3];
		}
		/**
		The index into the ancestor at the given level. If this points
		at the 3rd node in the 2nd paragraph on the top level, for
		example, `p.index(0)` is 1 and `p.index(1)` is 2.
		*/
		index(depth) {
			return this.path[this.resolveDepth(depth) * 3 + 1];
		}
		/**
		The index pointing after this position into the ancestor at the
		given level.
		*/
		indexAfter(depth) {
			depth = this.resolveDepth(depth);
			return this.index(depth) + (depth == this.depth && !this.textOffset ? 0 : 1);
		}
		/**
		The (absolute) position at the start of the node at the given
		level.
		*/
		start(depth) {
			depth = this.resolveDepth(depth);
			return depth == 0 ? 0 : this.path[depth * 3 - 1] + 1;
		}
		/**
		The (absolute) position at the end of the node at the given
		level.
		*/
		end(depth) {
			depth = this.resolveDepth(depth);
			return this.start(depth) + this.node(depth).content.size;
		}
		/**
		The (absolute) position directly before the wrapping node at the
		given level, or, when `depth` is `this.depth + 1`, the original
		position.
		*/
		before(depth) {
			depth = this.resolveDepth(depth);
			if (!depth) throw new RangeError("There is no position before the top-level node");
			return depth == this.depth + 1 ? this.pos : this.path[depth * 3 - 1];
		}
		/**
		The (absolute) position directly after the wrapping node at the
		given level, or the original position when `depth` is `this.depth + 1`.
		*/
		after(depth) {
			depth = this.resolveDepth(depth);
			if (!depth) throw new RangeError("There is no position after the top-level node");
			return depth == this.depth + 1 ? this.pos : this.path[depth * 3 - 1] + this.path[depth * 3].nodeSize;
		}
		/**
		When this position points into a text node, this returns the
		distance between the position and the start of the text node.
		Will be zero for positions that point between nodes.
		*/
		get textOffset() {
			return this.pos - this.path[this.path.length - 1];
		}
		/**
		Get the node directly after the position, if any. If the position
		points into a text node, only the part of that node after the
		position is returned.
		*/
		get nodeAfter() {
			let parent = this.parent;
			let index = this.index(this.depth);
			if (index == parent.childCount) return null;
			let dOff = this.pos - this.path[this.path.length - 1];
			let child = parent.child(index);
			return dOff ? parent.child(index).cut(dOff) : child;
		}
		/**
		Get the node directly before the position, if any. If the
		position points into a text node, only the part of that node
		before the position is returned.
		*/
		get nodeBefore() {
			let index = this.index(this.depth);
			let dOff = this.pos - this.path[this.path.length - 1];
			if (dOff) return this.parent.child(index).cut(0, dOff);
			return index == 0 ? null : this.parent.child(index - 1);
		}
		/**
		Get the position at the given index in the parent node at the
		given depth (which defaults to `this.depth`).
		*/
		posAtIndex(index, depth) {
			depth = this.resolveDepth(depth);
			let node = this.path[depth * 3];
			let pos = depth == 0 ? 0 : this.path[depth * 3 - 1] + 1;
			for (let i = 0; i < index; i++) pos += node.child(i).nodeSize;
			return pos;
		}
		/**
		Get the marks at this position, factoring in the surrounding
		marks' [`inclusive`](https://prosemirror.net/docs/ref/#model.MarkSpec.inclusive) property. If the
		position is at the start of a non-empty node, the marks of the
		node after it (if any) are returned.
		*/
		marks() {
			let parent = this.parent;
			let index = this.index();
			if (parent.content.size == 0) return Mark$1.none;
			if (this.textOffset) return parent.child(index).marks;
			let main = parent.maybeChild(index - 1);
			let other = parent.maybeChild(index);
			if (!main) {
				let tmp = main;
				main = other;
				other = tmp;
			}
			let marks = main.marks;
			for (var i = 0; i < marks.length; i++) if (marks[i].type.spec.inclusive === false && (!other || !marks[i].isInSet(other.marks))) marks = marks[i--].removeFromSet(marks);
			return marks;
		}
		/**
		Get the marks after the current position, if any, except those
		that are non-inclusive and not present at position `$end`. This
		is mostly useful for getting the set of marks to preserve after a
		deletion. Will return `null` if this position is at the end of
		its parent node or its parent node isn't a textblock (in which
		case no marks should be preserved).
		*/
		marksAcross($end) {
			let after = this.parent.maybeChild(this.index());
			if (!after || !after.isInline) return null;
			let marks = after.marks;
			let next = $end.parent.maybeChild($end.index());
			for (var i = 0; i < marks.length; i++) if (marks[i].type.spec.inclusive === false && (!next || !marks[i].isInSet(next.marks))) marks = marks[i--].removeFromSet(marks);
			return marks;
		}
		/**
		The depth up to which this position and the given (non-resolved)
		position share the same parent nodes.
		*/
		sharedDepth(pos) {
			for (let depth = this.depth; depth > 0; depth--) if (this.start(depth) <= pos && this.end(depth) >= pos) return depth;
			return 0;
		}
		/**
		Returns a range based on the place where this position and the
		given position diverge around block content. If both point into
		the same textblock, for example, a range around that textblock
		will be returned. If they point into different blocks, the range
		around those blocks in their shared ancestor is returned. You can
		pass in an optional predicate that will be called with a parent
		node to see if a range into that parent is acceptable.
		*/
		blockRange(other = this, pred) {
			if (other.pos < this.pos) return other.blockRange(this);
			for (let d = this.depth - (this.parent.inlineContent || this.pos == other.pos ? 1 : 0); d >= 0; d--) if (other.pos <= this.end(d) && (!pred || pred(this.node(d)))) return new NodeRange(this, other, d);
			return null;
		}
		/**
		Query whether the given position shares the same parent node.
		*/
		sameParent(other) {
			return this.pos - this.parentOffset == other.pos - other.parentOffset;
		}
		/**
		Return the greater of this and the given position.
		*/
		max(other) {
			return other.pos > this.pos ? other : this;
		}
		/**
		Return the smaller of this and the given position.
		*/
		min(other) {
			return other.pos < this.pos ? other : this;
		}
		/**
		@internal
		*/
		toString() {
			let str = "";
			for (let i = 1; i <= this.depth; i++) str += (str ? "/" : "") + this.node(i).type.name + "_" + this.index(i - 1);
			return str + ":" + this.parentOffset;
		}
		/**
		@internal
		*/
		static resolve(doc, pos) {
			if (!(pos >= 0 && pos <= doc.content.size)) throw new RangeError("Position " + pos + " out of range");
			let path = [];
			let start = 0;
			let parentOffset = pos;
			for (let node = doc;;) {
				let { index, offset } = node.content.findIndex(parentOffset);
				let rem = parentOffset - offset;
				path.push(node, index, start + offset);
				if (!rem) break;
				node = node.child(index);
				if (node.isText) break;
				parentOffset = rem - 1;
				start += offset + 1;
			}
			return new ResolvedPos(pos, path, parentOffset);
		}
		/**
		@internal
		*/
		static resolveCached(doc, pos) {
			let cache = resolveCache.get(doc);
			if (cache) for (let i = 0; i < cache.elts.length; i++) {
				let elt = cache.elts[i];
				if (elt.pos == pos) return elt;
			}
			else resolveCache.set(doc, cache = new ResolveCache());
			let result = cache.elts[cache.i] = ResolvedPos.resolve(doc, pos);
			cache.i = (cache.i + 1) % resolveCacheSize;
			return result;
		}
	};
	var ResolveCache = class {
		constructor() {
			this.elts = [];
			this.i = 0;
		}
	};
	var resolveCacheSize = 12;
	var resolveCache = /* @__PURE__ */ new WeakMap();
	/**
	Represents a flat range of content, i.e. one that starts and
	ends in the same node.
	*/
	var NodeRange = class {
		/**
		Construct a node range. `$from` and `$to` should point into the
		same node until at least the given `depth`, since a node range
		denotes an adjacent set of nodes in a single parent node.
		*/
		constructor($from, $to, depth) {
			this.$from = $from;
			this.$to = $to;
			this.depth = depth;
		}
		/**
		The position at the start of the range.
		*/
		get start() {
			return this.$from.before(this.depth + 1);
		}
		/**
		The position at the end of the range.
		*/
		get end() {
			return this.$to.after(this.depth + 1);
		}
		/**
		The parent node that the range points into.
		*/
		get parent() {
			return this.$from.node(this.depth);
		}
		/**
		The start index of the range in the parent node.
		*/
		get startIndex() {
			return this.$from.index(this.depth);
		}
		/**
		The end index of the range in the parent node.
		*/
		get endIndex() {
			return this.$to.indexAfter(this.depth);
		}
	};
	var emptyAttrs = Object.create(null);
	/**
	This class represents a node in the tree that makes up a
	ProseMirror document. So a document is an instance of `Node`, with
	children that are also instances of `Node`.
	
	Nodes are persistent data structures. Instead of changing them, you
	create new ones with the content you want. Old ones keep pointing
	at the old document shape. This is made cheaper by sharing
	structure between the old and new data as much as possible, which a
	tree shape like this (without back pointers) makes easy.
	
	**Do not** directly mutate the properties of a `Node` object. See
	[the guide](https://prosemirror.net/docs/guide/#doc) for more information.
	*/
	var Node = class Node {
		/**
		@internal
		*/
		constructor(type, attrs, content, marks = Mark$1.none) {
			this.type = type;
			this.attrs = attrs;
			this.marks = marks;
			this.content = content || Fragment$1.empty;
		}
		/**
		The array of this node's child nodes.
		*/
		get children() {
			return this.content.content;
		}
		/**
		The size of this node, as defined by the integer-based [indexing
		scheme](https://prosemirror.net/docs/guide/#doc.indexing). For text nodes, this is the
		amount of characters. For other leaf nodes, it is one. For
		non-leaf nodes, it is the size of the content plus two (the
		start and end token).
		*/
		get nodeSize() {
			return this.isLeaf ? 1 : 2 + this.content.size;
		}
		/**
		The number of children that the node has.
		*/
		get childCount() {
			return this.content.childCount;
		}
		/**
		Get the child node at the given index. Raises an error when the
		index is out of range.
		*/
		child(index) {
			return this.content.child(index);
		}
		/**
		Get the child node at the given index, if it exists.
		*/
		maybeChild(index) {
			return this.content.maybeChild(index);
		}
		/**
		Call `f` for every child node, passing the node, its offset
		into this parent node, and its index.
		*/
		forEach(f) {
			this.content.forEach(f);
		}
		/**
		Invoke a callback for all descendant nodes recursively between
		the given two positions that are relative to start of this
		node's content. The callback is invoked with the node, its
		position relative to the original node (method receiver),
		its parent node, and its child index. When the callback returns
		false for a given node, that node's children will not be
		recursed over. The last parameter can be used to specify a
		starting position to count from.
		*/
		nodesBetween(from, to, f, startPos = 0) {
			this.content.nodesBetween(from, to, f, startPos, this);
		}
		/**
		Call the given callback for every descendant node. Doesn't
		descend into a node when the callback returns `false`.
		*/
		descendants(f) {
			this.nodesBetween(0, this.content.size, f);
		}
		/**
		Concatenates all the text nodes found in this fragment and its
		children.
		*/
		get textContent() {
			return this.isLeaf && this.type.spec.leafText ? this.type.spec.leafText(this) : this.textBetween(0, this.content.size, "");
		}
		/**
		Get all text between positions `from` and `to`. When
		`blockSeparator` is given, it will be inserted to separate text
		from different block nodes. If `leafText` is given, it'll be
		inserted for every non-text leaf node encountered, otherwise
		[`leafText`](https://prosemirror.net/docs/ref/#model.NodeSpec.leafText) will be used.
		*/
		textBetween(from, to, blockSeparator, leafText) {
			return this.content.textBetween(from, to, blockSeparator, leafText);
		}
		/**
		Returns this node's first child, or `null` if there are no
		children.
		*/
		get firstChild() {
			return this.content.firstChild;
		}
		/**
		Returns this node's last child, or `null` if there are no
		children.
		*/
		get lastChild() {
			return this.content.lastChild;
		}
		/**
		Test whether two nodes represent the same piece of document.
		*/
		eq(other) {
			return this == other || this.sameMarkup(other) && this.content.eq(other.content);
		}
		/**
		Compare the markup (type, attributes, and marks) of this node to
		those of another. Returns `true` if both have the same markup.
		*/
		sameMarkup(other) {
			return this.hasMarkup(other.type, other.attrs, other.marks);
		}
		/**
		Check whether this node's markup correspond to the given type,
		attributes, and marks.
		*/
		hasMarkup(type, attrs, marks) {
			return this.type == type && compareDeep(this.attrs, attrs || type.defaultAttrs || emptyAttrs) && Mark$1.sameSet(this.marks, marks || Mark$1.none);
		}
		/**
		Create a new node with the same markup as this node, containing
		the given content (or empty, if no content is given).
		*/
		copy(content = null) {
			if (content == this.content) return this;
			return new Node(this.type, this.attrs, content, this.marks);
		}
		/**
		Create a copy of this node, with the given set of marks instead
		of the node's own marks.
		*/
		mark(marks) {
			return marks == this.marks ? this : new Node(this.type, this.attrs, this.content, marks);
		}
		/**
		Create a copy of this node with only the content between the
		given positions. If `to` is not given, it defaults to the end of
		the node.
		*/
		cut(from, to = this.content.size) {
			if (from == 0 && to == this.content.size) return this;
			return this.copy(this.content.cut(from, to));
		}
		/**
		Cut out the part of the document between the given positions, and
		return it as a `Slice` object.
		*/
		slice(from, to = this.content.size, includeParents = false) {
			if (from == to) return Slice.empty;
			let $from = this.resolve(from);
			let $to = this.resolve(to);
			let depth = includeParents ? 0 : $from.sharedDepth(to);
			let start = $from.start(depth);
			let content = $from.node(depth).content.cut($from.pos - start, $to.pos - start);
			return new Slice(content, $from.depth - depth, $to.depth - depth);
		}
		/**
		Replace the part of the document between the given positions with
		the given slice. The slice must 'fit', meaning its open sides
		must be able to connect to the surrounding content, and its
		content nodes must be valid children for the node they are placed
		into. If any of this is violated, an error of type
		[`ReplaceError`](https://prosemirror.net/docs/ref/#model.ReplaceError) is thrown.
		*/
		replace(from, to, slice) {
			return replace(this.resolve(from), this.resolve(to), slice);
		}
		/**
		Find the node directly after the given position.
		*/
		nodeAt(pos) {
			for (let node = this;;) {
				let { index, offset } = node.content.findIndex(pos);
				node = node.maybeChild(index);
				if (!node) return null;
				if (offset == pos || node.isText) return node;
				pos -= offset + 1;
			}
		}
		/**
		Find the (direct) child node after the given offset, if any,
		and return it along with its index and offset relative to this
		node.
		*/
		childAfter(pos) {
			let { index, offset } = this.content.findIndex(pos);
			return {
				node: this.content.maybeChild(index),
				index,
				offset
			};
		}
		/**
		Find the (direct) child node before the given offset, if any,
		and return it along with its index and offset relative to this
		node.
		*/
		childBefore(pos) {
			if (pos == 0) return {
				node: null,
				index: 0,
				offset: 0
			};
			let { index, offset } = this.content.findIndex(pos);
			if (offset < pos) return {
				node: this.content.child(index),
				index,
				offset
			};
			let node = this.content.child(index - 1);
			return {
				node,
				index: index - 1,
				offset: offset - node.nodeSize
			};
		}
		/**
		Resolve the given position in the document, returning an
		[object](https://prosemirror.net/docs/ref/#model.ResolvedPos) with information about its context.
		*/
		resolve(pos) {
			return ResolvedPos.resolveCached(this, pos);
		}
		/**
		@internal
		*/
		resolveNoCache(pos) {
			return ResolvedPos.resolve(this, pos);
		}
		/**
		Test whether a given mark or mark type occurs in this document
		between the two given positions.
		*/
		rangeHasMark(from, to, type) {
			let found = false;
			if (to > from) this.nodesBetween(from, to, (node) => {
				if (type.isInSet(node.marks)) found = true;
				return !found;
			});
			return found;
		}
		/**
		True when this is a block (non-inline node)
		*/
		get isBlock() {
			return this.type.isBlock;
		}
		/**
		True when this is a textblock node, a block node with inline
		content.
		*/
		get isTextblock() {
			return this.type.isTextblock;
		}
		/**
		True when this node allows inline content.
		*/
		get inlineContent() {
			return this.type.inlineContent;
		}
		/**
		True when this is an inline node (a text node or a node that can
		appear among text).
		*/
		get isInline() {
			return this.type.isInline;
		}
		/**
		True when this is a text node.
		*/
		get isText() {
			return this.type.isText;
		}
		/**
		True when this is a leaf node.
		*/
		get isLeaf() {
			return this.type.isLeaf;
		}
		/**
		True when this is an atom, i.e. when it does not have directly
		editable content. This is usually the same as `isLeaf`, but can
		be configured with the [`atom` property](https://prosemirror.net/docs/ref/#model.NodeSpec.atom)
		on a node's spec (typically used when the node is displayed as
		an uneditable [node view](https://prosemirror.net/docs/ref/#view.NodeView)).
		*/
		get isAtom() {
			return this.type.isAtom;
		}
		/**
		Return a string representation of this node for debugging
		purposes.
		*/
		toString() {
			if (this.type.spec.toDebugString) return this.type.spec.toDebugString(this);
			let name = this.type.name;
			if (this.content.size) name += "(" + this.content.toStringInner() + ")";
			return wrapMarks(this.marks, name);
		}
		/**
		Get the content match in this node at the given index.
		*/
		contentMatchAt(index) {
			let match = this.type.contentMatch.matchFragment(this.content, 0, index);
			if (!match) throw new Error("Called contentMatchAt on a node with invalid content");
			return match;
		}
		/**
		Test whether replacing the range between `from` and `to` (by
		child index) with the given replacement fragment (which defaults
		to the empty fragment) would leave the node's content valid. You
		can optionally pass `start` and `end` indices into the
		replacement fragment.
		*/
		canReplace(from, to, replacement = Fragment$1.empty, start = 0, end = replacement.childCount) {
			let one = this.contentMatchAt(from).matchFragment(replacement, start, end);
			let two = one && one.matchFragment(this.content, to);
			if (!two || !two.validEnd) return false;
			for (let i = start; i < end; i++) if (!this.type.allowsMarks(replacement.child(i).marks)) return false;
			return true;
		}
		/**
		Test whether replacing the range `from` to `to` (by index) with
		a node of the given type would leave the node's content valid.
		*/
		canReplaceWith(from, to, type, marks) {
			if (marks && !this.type.allowsMarks(marks)) return false;
			let start = this.contentMatchAt(from).matchType(type);
			let end = start && start.matchFragment(this.content, to);
			return end ? end.validEnd : false;
		}
		/**
		Test whether the given node's content could be appended to this
		node. If that node is empty, this will only return true if there
		is at least one node type that can appear in both nodes (to avoid
		merging completely incompatible nodes).
		*/
		canAppend(other) {
			if (other.content.size) return this.canReplace(this.childCount, this.childCount, other.content);
			else return this.type.compatibleContent(other.type);
		}
		/**
		Check whether this node and its descendants conform to the
		schema, and raise an exception when they do not.
		*/
		check() {
			this.type.checkContent(this.content);
			this.type.checkAttrs(this.attrs);
			let copy = Mark$1.none;
			for (let i = 0; i < this.marks.length; i++) {
				let mark = this.marks[i];
				mark.type.checkAttrs(mark.attrs);
				copy = mark.addToSet(copy);
			}
			if (!Mark$1.sameSet(copy, this.marks)) throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map((m) => m.type.name)}`);
			this.content.forEach((node) => node.check());
		}
		/**
		Return a JSON-serializeable representation of this node.
		*/
		toJSON() {
			let obj = { type: this.type.name };
			for (let _ in this.attrs) {
				obj.attrs = this.attrs;
				break;
			}
			if (this.content.size) obj.content = this.content.toJSON();
			if (this.marks.length) obj.marks = this.marks.map((n) => n.toJSON());
			return obj;
		}
		/**
		Deserialize a node from its JSON representation.
		*/
		static fromJSON(schema, json) {
			if (!json) throw new RangeError("Invalid input for Node.fromJSON");
			let marks = void 0;
			if (json.marks) {
				if (!Array.isArray(json.marks)) throw new RangeError("Invalid mark data for Node.fromJSON");
				marks = json.marks.map(schema.markFromJSON);
			}
			if (json.type == "text") {
				if (typeof json.text != "string") throw new RangeError("Invalid text node in JSON");
				return schema.text(json.text, marks);
			}
			let content = Fragment$1.fromJSON(schema, json.content);
			let node = schema.nodeType(json.type).create(json.attrs, content, marks);
			node.type.checkAttrs(node.attrs);
			return node;
		}
	};
	Node.prototype.text = void 0;
	var TextNode = class TextNode extends Node {
		/**
		@internal
		*/
		constructor(type, attrs, content, marks) {
			super(type, attrs, null, marks);
			if (!content) throw new RangeError("Empty text nodes are not allowed");
			this.text = content;
		}
		toString() {
			if (this.type.spec.toDebugString) return this.type.spec.toDebugString(this);
			return wrapMarks(this.marks, JSON.stringify(this.text));
		}
		get textContent() {
			return this.text;
		}
		textBetween(from, to) {
			return this.text.slice(from, to);
		}
		get nodeSize() {
			return this.text.length;
		}
		mark(marks) {
			return marks == this.marks ? this : new TextNode(this.type, this.attrs, this.text, marks);
		}
		withText(text) {
			if (text == this.text) return this;
			return new TextNode(this.type, this.attrs, text, this.marks);
		}
		cut(from = 0, to = this.text.length) {
			if (from == 0 && to == this.text.length) return this;
			return this.withText(this.text.slice(from, to));
		}
		eq(other) {
			return this.sameMarkup(other) && this.text == other.text;
		}
		toJSON() {
			let base = super.toJSON();
			base.text = this.text;
			return base;
		}
	};
	function wrapMarks(marks, str) {
		for (let i = marks.length - 1; i >= 0; i--) str = marks[i].type.name + "(" + str + ")";
		return str;
	}
	/**
	Instances of this class represent a match state of a node type's
	[content expression](https://prosemirror.net/docs/ref/#model.NodeSpec.content), and can be used to
	find out whether further content matches here, and whether a given
	position is a valid end of the node.
	*/
	var ContentMatch = class ContentMatch {
		/**
		@internal
		*/
		constructor(validEnd) {
			this.validEnd = validEnd;
			/**
			@internal
			*/
			this.next = [];
			/**
			@internal
			*/
			this.wrapCache = [];
		}
		/**
		@internal
		*/
		static parse(string, nodeTypes) {
			let stream = new TokenStream(string, nodeTypes);
			if (stream.next == null) return ContentMatch.empty;
			let expr = parseExpr(stream);
			if (stream.next) stream.err("Unexpected trailing text");
			let match = dfa(nfa(expr));
			checkForDeadEnds(match, stream);
			return match;
		}
		/**
		Match a node type, returning a match after that node if
		successful.
		*/
		matchType(type) {
			for (let i = 0; i < this.next.length; i++) if (this.next[i].type == type) return this.next[i].next;
			return null;
		}
		/**
		Try to match a fragment. Returns the resulting match when
		successful.
		*/
		matchFragment(frag, start = 0, end = frag.childCount) {
			let cur = this;
			for (let i = start; cur && i < end; i++) cur = cur.matchType(frag.child(i).type);
			return cur;
		}
		/**
		@internal
		*/
		get inlineContent() {
			return this.next.length != 0 && this.next[0].type.isInline;
		}
		/**
		Get the first matching node type at this match position that can
		be generated.
		*/
		get defaultType() {
			for (let i = 0; i < this.next.length; i++) {
				let { type } = this.next[i];
				if (!(type.isText || type.hasRequiredAttrs())) return type;
			}
			return null;
		}
		/**
		@internal
		*/
		compatible(other) {
			for (let i = 0; i < this.next.length; i++) for (let j = 0; j < other.next.length; j++) if (this.next[i].type == other.next[j].type) return true;
			return false;
		}
		/**
		Try to match the given fragment, and if that fails, see if it can
		be made to match by inserting nodes in front of it. When
		successful, return a fragment of inserted nodes (which may be
		empty if nothing had to be inserted). When `toEnd` is true, only
		return a fragment if the resulting match goes to the end of the
		content expression.
		*/
		fillBefore(after, toEnd = false, startIndex = 0) {
			let seen = [this];
			function search(match, types) {
				let finished = match.matchFragment(after, startIndex);
				if (finished && (!toEnd || finished.validEnd)) return Fragment$1.from(types.map((tp) => tp.createAndFill()));
				for (let i = 0; i < match.next.length; i++) {
					let { type, next } = match.next[i];
					if (!(type.isText || type.hasRequiredAttrs()) && seen.indexOf(next) == -1) {
						seen.push(next);
						let found = search(next, types.concat(type));
						if (found) return found;
					}
				}
				return null;
			}
			return search(this, []);
		}
		/**
		Find a set of wrapping node types that would allow a node of the
		given type to appear at this position. The result may be empty
		(when it fits directly) and will be null when no such wrapping
		exists.
		*/
		findWrapping(target) {
			for (let i = 0; i < this.wrapCache.length; i += 2) if (this.wrapCache[i] == target) return this.wrapCache[i + 1];
			let computed = this.computeWrapping(target);
			this.wrapCache.push(target, computed);
			return computed;
		}
		/**
		@internal
		*/
		computeWrapping(target) {
			let seen = Object.create(null);
			let active = [{
				match: this,
				type: null,
				via: null
			}];
			while (active.length) {
				let current = active.shift();
				let match = current.match;
				if (match.matchType(target)) {
					let result = [];
					for (let obj = current; obj.type; obj = obj.via) result.push(obj.type);
					return result.reverse();
				}
				for (let i = 0; i < match.next.length; i++) {
					let { type, next } = match.next[i];
					if (!type.isLeaf && !type.hasRequiredAttrs() && !(type.name in seen) && (!current.type || next.validEnd)) {
						active.push({
							match: type.contentMatch,
							type,
							via: current
						});
						seen[type.name] = true;
					}
				}
			}
			return null;
		}
		/**
		The number of outgoing edges this node has in the finite
		automaton that describes the content expression.
		*/
		get edgeCount() {
			return this.next.length;
		}
		/**
		Get the _n_​th outgoing edge from this node in the finite
		automaton that describes the content expression.
		*/
		edge(n) {
			if (n >= this.next.length) throw new RangeError(`There's no ${n}th edge in this content match`);
			return this.next[n];
		}
		/**
		@internal
		*/
		toString() {
			let seen = [];
			function scan(m) {
				seen.push(m);
				for (let i = 0; i < m.next.length; i++) if (seen.indexOf(m.next[i].next) == -1) scan(m.next[i].next);
			}
			scan(this);
			return seen.map((m, i) => {
				let out = i + (m.validEnd ? "*" : " ") + " ";
				for (let i = 0; i < m.next.length; i++) out += (i ? ", " : "") + m.next[i].type.name + "->" + seen.indexOf(m.next[i].next);
				return out;
			}).join("\n");
		}
	};
	/**
	@internal
	*/
	ContentMatch.empty = new ContentMatch(true);
	var TokenStream = class {
		constructor(string, nodeTypes) {
			this.string = string;
			this.nodeTypes = nodeTypes;
			this.inline = null;
			this.pos = 0;
			this.tokens = string.split(/\s*(?=\b|\W|$)/);
			if (this.tokens[this.tokens.length - 1] == "") this.tokens.pop();
			if (this.tokens[0] == "") this.tokens.shift();
		}
		get next() {
			return this.tokens[this.pos];
		}
		eat(tok) {
			return this.next == tok && (this.pos++ || true);
		}
		err(str) {
			throw new SyntaxError(str + " (in content expression '" + this.string + "')");
		}
	};
	function parseExpr(stream) {
		let exprs = [];
		do
			exprs.push(parseExprSeq(stream));
		while (stream.eat("|"));
		return exprs.length == 1 ? exprs[0] : {
			type: "choice",
			exprs
		};
	}
	function parseExprSeq(stream) {
		let exprs = [];
		do
			exprs.push(parseExprSubscript(stream));
		while (stream.next && stream.next != ")" && stream.next != "|");
		return exprs.length == 1 ? exprs[0] : {
			type: "seq",
			exprs
		};
	}
	function parseExprSubscript(stream) {
		let expr = parseExprAtom(stream);
		for (;;) if (stream.eat("+")) expr = {
			type: "plus",
			expr
		};
		else if (stream.eat("*")) expr = {
			type: "star",
			expr
		};
		else if (stream.eat("?")) expr = {
			type: "opt",
			expr
		};
		else if (stream.eat("{")) expr = parseExprRange(stream, expr);
		else break;
		return expr;
	}
	function parseNum(stream) {
		if (/\D/.test(stream.next)) stream.err("Expected number, got '" + stream.next + "'");
		let result = Number(stream.next);
		stream.pos++;
		return result;
	}
	function parseExprRange(stream, expr) {
		let min = parseNum(stream);
		let max = min;
		if (stream.eat(",")) if (stream.next != "}") max = parseNum(stream);
		else max = -1;
		if (!stream.eat("}")) stream.err("Unclosed braced range");
		return {
			type: "range",
			min,
			max,
			expr
		};
	}
	function resolveName(stream, name) {
		let types = stream.nodeTypes;
		let type = types[name];
		if (type) return [type];
		let result = [];
		for (let typeName in types) {
			let type = types[typeName];
			if (type.isInGroup(name)) result.push(type);
		}
		if (result.length == 0) stream.err("No node type or group '" + name + "' found");
		return result;
	}
	function parseExprAtom(stream) {
		if (stream.eat("(")) {
			let expr = parseExpr(stream);
			if (!stream.eat(")")) stream.err("Missing closing paren");
			return expr;
		} else if (!/\W/.test(stream.next)) {
			let exprs = resolveName(stream, stream.next).map((type) => {
				if (stream.inline == null) stream.inline = type.isInline;
				else if (stream.inline != type.isInline) stream.err("Mixing inline and block content");
				return {
					type: "name",
					value: type
				};
			});
			stream.pos++;
			return exprs.length == 1 ? exprs[0] : {
				type: "choice",
				exprs
			};
		} else stream.err("Unexpected token '" + stream.next + "'");
	}
	function nfa(expr) {
		let nfa = [[]];
		connect(compile(expr, 0), node());
		return nfa;
		function node() {
			return nfa.push([]) - 1;
		}
		function edge(from, to, term) {
			let edge = {
				term,
				to
			};
			nfa[from].push(edge);
			return edge;
		}
		function connect(edges, to) {
			edges.forEach((edge) => edge.to = to);
		}
		function compile(expr, from) {
			if (expr.type == "choice") return expr.exprs.reduce((out, expr) => out.concat(compile(expr, from)), []);
			else if (expr.type == "seq") for (let i = 0;; i++) {
				let next = compile(expr.exprs[i], from);
				if (i == expr.exprs.length - 1) return next;
				connect(next, from = node());
			}
			else if (expr.type == "star") {
				let loop = node();
				edge(from, loop);
				connect(compile(expr.expr, loop), loop);
				return [edge(loop)];
			} else if (expr.type == "plus") {
				let loop = node();
				connect(compile(expr.expr, from), loop);
				connect(compile(expr.expr, loop), loop);
				return [edge(loop)];
			} else if (expr.type == "opt") return [edge(from)].concat(compile(expr.expr, from));
			else if (expr.type == "range") {
				let cur = from;
				for (let i = 0; i < expr.min; i++) {
					let next = node();
					connect(compile(expr.expr, cur), next);
					cur = next;
				}
				if (expr.max == -1) connect(compile(expr.expr, cur), cur);
				else for (let i = expr.min; i < expr.max; i++) {
					let next = node();
					edge(cur, next);
					connect(compile(expr.expr, cur), next);
					cur = next;
				}
				return [edge(cur)];
			} else if (expr.type == "name") return [edge(from, void 0, expr.value)];
			else throw new Error("Unknown expr type");
		}
	}
	function cmp(a, b) {
		return b - a;
	}
	function nullFrom(nfa, node) {
		let result = [];
		scan(node);
		return result.sort(cmp);
		function scan(node) {
			let edges = nfa[node];
			if (edges.length == 1 && !edges[0].term) return scan(edges[0].to);
			result.push(node);
			for (let i = 0; i < edges.length; i++) {
				let { term, to } = edges[i];
				if (!term && result.indexOf(to) == -1) scan(to);
			}
		}
	}
	function dfa(nfa) {
		let labeled = Object.create(null);
		return explore(nullFrom(nfa, 0));
		function explore(states) {
			let out = [];
			states.forEach((node) => {
				nfa[node].forEach(({ term, to }) => {
					if (!term) return;
					let set;
					for (let i = 0; i < out.length; i++) if (out[i][0] == term) set = out[i][1];
					nullFrom(nfa, to).forEach((node) => {
						if (!set) out.push([term, set = []]);
						if (set.indexOf(node) == -1) set.push(node);
					});
				});
			});
			let state = labeled[states.join(",")] = new ContentMatch(states.indexOf(nfa.length - 1) > -1);
			for (let i = 0; i < out.length; i++) {
				let states = out[i][1].sort(cmp);
				state.next.push({
					type: out[i][0],
					next: labeled[states.join(",")] || explore(states)
				});
			}
			return state;
		}
	}
	function checkForDeadEnds(match, stream) {
		for (let i = 0, work = [match]; i < work.length; i++) {
			let state = work[i];
			let dead = !state.validEnd;
			let nodes = [];
			for (let j = 0; j < state.next.length; j++) {
				let { type, next } = state.next[j];
				nodes.push(type.name);
				if (dead && !(type.isText || type.hasRequiredAttrs())) dead = false;
				if (work.indexOf(next) == -1) work.push(next);
			}
			if (dead) stream.err("Only non-generatable nodes (" + nodes.join(", ") + ") in a required position (see https://prosemirror.net/docs/guide/#generatable)");
		}
	}
	function defaultAttrs(attrs) {
		let defaults = Object.create(null);
		for (let attrName in attrs) {
			let attr = attrs[attrName];
			if (!attr.hasDefault) return null;
			defaults[attrName] = attr.default;
		}
		return defaults;
	}
	function computeAttrs(attrs, value) {
		let built = Object.create(null);
		for (let name in attrs) {
			let given = value && value[name];
			if (given === void 0) {
				let attr = attrs[name];
				if (attr.hasDefault) given = attr.default;
				else throw new RangeError("No value supplied for attribute " + name);
			}
			built[name] = given;
		}
		return built;
	}
	function checkAttrs(attrs, values, type, name) {
		for (let name in values) if (!(name in attrs)) throw new RangeError(`Unsupported attribute ${name} for ${type} of type ${name}`);
		for (let name in attrs) {
			let attr = attrs[name];
			if (attr.validate) attr.validate(values[name]);
		}
	}
	function initAttrs(typeName, attrs) {
		let result = Object.create(null);
		if (attrs) for (let name in attrs) result[name] = new Attribute(typeName, name, attrs[name]);
		return result;
	}
	/**
	Node types are objects allocated once per `Schema` and used to
	[tag](https://prosemirror.net/docs/ref/#model.Node.type) `Node` instances. They contain information
	about the node type, such as its name and what kind of node it
	represents.
	*/
	var NodeType$1 = class NodeType$1 {
		static {
			__name(this, "NodeType");
		}
		/**
		@internal
		*/
		constructor(name, schema, spec) {
			this.name = name;
			this.schema = schema;
			this.spec = spec;
			/**
			The set of marks allowed in this node. `null` means all marks
			are allowed.
			*/
			this.markSet = null;
			this.groups = spec.group ? spec.group.split(" ") : [];
			this.attrs = initAttrs(name, spec.attrs);
			this.defaultAttrs = defaultAttrs(this.attrs);
			this.contentMatch = null;
			this.inlineContent = null;
			this.isBlock = !(spec.inline || name == "text");
			this.isText = name == "text";
		}
		/**
		True if this is an inline type.
		*/
		get isInline() {
			return !this.isBlock;
		}
		/**
		True if this is a textblock type, a block that contains inline
		content.
		*/
		get isTextblock() {
			return this.isBlock && this.inlineContent;
		}
		/**
		True for node types that allow no content.
		*/
		get isLeaf() {
			return this.contentMatch == ContentMatch.empty;
		}
		/**
		True when this node is an atom, i.e. when it does not have
		directly editable content.
		*/
		get isAtom() {
			return this.isLeaf || !!this.spec.atom;
		}
		/**
		Return true when this node type is part of the given
		[group](https://prosemirror.net/docs/ref/#model.NodeSpec.group).
		*/
		isInGroup(group) {
			return this.groups.indexOf(group) > -1;
		}
		/**
		The node type's [whitespace](https://prosemirror.net/docs/ref/#model.NodeSpec.whitespace) option.
		*/
		get whitespace() {
			return this.spec.whitespace || (this.spec.code ? "pre" : "normal");
		}
		/**
		Tells you whether this node type has any required attributes.
		*/
		hasRequiredAttrs() {
			for (let n in this.attrs) if (this.attrs[n].isRequired) return true;
			return false;
		}
		/**
		Indicates whether this node allows some of the same content as
		the given node type.
		*/
		compatibleContent(other) {
			return this == other || this.contentMatch.compatible(other.contentMatch);
		}
		/**
		@internal
		*/
		computeAttrs(attrs) {
			if (!attrs && this.defaultAttrs) return this.defaultAttrs;
			else return computeAttrs(this.attrs, attrs);
		}
		/**
		Create a `Node` of this type. The given attributes are
		checked and defaulted (you can pass `null` to use the type's
		defaults entirely, if no required attributes exist). `content`
		may be a `Fragment`, a node, an array of nodes, or
		`null`. Similarly `marks` may be `null` to default to the empty
		set of marks.
		*/
		create(attrs = null, content, marks) {
			if (this.isText) throw new Error("NodeType.create can't construct text nodes");
			return new Node(this, this.computeAttrs(attrs), Fragment$1.from(content), Mark$1.setFrom(marks));
		}
		/**
		Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but check the given content
		against the node type's content restrictions, and throw an error
		if it doesn't match.
		*/
		createChecked(attrs = null, content, marks) {
			content = Fragment$1.from(content);
			this.checkContent(content);
			return new Node(this, this.computeAttrs(attrs), content, Mark$1.setFrom(marks));
		}
		/**
		Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but see if it is
		necessary to add nodes to the start or end of the given fragment
		to make it fit the node. If no fitting wrapping can be found,
		return null. Note that, due to the fact that required nodes can
		always be created, this will always succeed if you pass null or
		`Fragment.empty` as content.
		*/
		createAndFill(attrs = null, content, marks) {
			attrs = this.computeAttrs(attrs);
			content = Fragment$1.from(content);
			if (content.size) {
				let before = this.contentMatch.fillBefore(content);
				if (!before) return null;
				content = before.append(content);
			}
			let matched = this.contentMatch.matchFragment(content);
			let after = matched && matched.fillBefore(Fragment$1.empty, true);
			if (!after) return null;
			return new Node(this, attrs, content.append(after), Mark$1.setFrom(marks));
		}
		/**
		Returns true if the given fragment is valid content for this node
		type.
		*/
		validContent(content) {
			let result = this.contentMatch.matchFragment(content);
			if (!result || !result.validEnd) return false;
			for (let i = 0; i < content.childCount; i++) if (!this.allowsMarks(content.child(i).marks)) return false;
			return true;
		}
		/**
		Throws a RangeError if the given fragment is not valid content for this
		node type.
		@internal
		*/
		checkContent(content) {
			if (!this.validContent(content)) throw new RangeError(`Invalid content for node ${this.name}: ${content.toString().slice(0, 50)}`);
		}
		/**
		@internal
		*/
		checkAttrs(attrs) {
			checkAttrs(this.attrs, attrs, "node", this.name);
		}
		/**
		Check whether the given mark type is allowed in this node.
		*/
		allowsMarkType(markType) {
			return this.markSet == null || this.markSet.indexOf(markType) > -1;
		}
		/**
		Test whether the given set of marks are allowed in this node.
		*/
		allowsMarks(marks) {
			if (this.markSet == null) return true;
			for (let i = 0; i < marks.length; i++) if (!this.allowsMarkType(marks[i].type)) return false;
			return true;
		}
		/**
		Removes the marks that are not allowed in this node from the given set.
		*/
		allowedMarks(marks) {
			if (this.markSet == null) return marks;
			let copy;
			for (let i = 0; i < marks.length; i++) if (!this.allowsMarkType(marks[i].type)) {
				if (!copy) copy = marks.slice(0, i);
			} else if (copy) copy.push(marks[i]);
			return !copy ? marks : copy.length ? copy : Mark$1.none;
		}
		/**
		@internal
		*/
		static compile(nodes, schema) {
			let result = Object.create(null);
			nodes.forEach((name, spec) => result[name] = new NodeType$1(name, schema, spec));
			let topType = schema.spec.topNode || "doc";
			if (!result[topType]) throw new RangeError("Schema is missing its top node type ('" + topType + "')");
			if (!result.text) throw new RangeError("Every schema needs a 'text' type");
			for (let _ in result.text.attrs) throw new RangeError("The text node type should not have attributes");
			return result;
		}
	};
	function validateType(typeName, attrName, type) {
		let types = type.split("|");
		return (value) => {
			let name = value === null ? "null" : typeof value;
			if (types.indexOf(name) < 0) throw new RangeError(`Expected value of type ${types} for attribute ${attrName} on type ${typeName}, got ${name}`);
		};
	}
	var Attribute = class {
		constructor(typeName, attrName, options) {
			this.hasDefault = Object.prototype.hasOwnProperty.call(options, "default");
			this.default = options.default;
			this.validate = typeof options.validate == "string" ? validateType(typeName, attrName, options.validate) : options.validate;
		}
		get isRequired() {
			return !this.hasDefault;
		}
	};
	/**
	Like nodes, marks (which are associated with nodes to signify
	things like emphasis or being part of a link) are
	[tagged](https://prosemirror.net/docs/ref/#model.Mark.type) with type objects, which are
	instantiated once per `Schema`.
	*/
	var MarkType = class MarkType {
		/**
		@internal
		*/
		constructor(name, rank, schema, spec) {
			this.name = name;
			this.rank = rank;
			this.schema = schema;
			this.spec = spec;
			this.attrs = initAttrs(name, spec.attrs);
			this.excluded = null;
			let defaults = defaultAttrs(this.attrs);
			this.instance = defaults ? new Mark$1(this, defaults) : null;
		}
		/**
		Create a mark of this type. `attrs` may be `null` or an object
		containing only some of the mark's attributes. The others, if
		they have defaults, will be added.
		*/
		create(attrs = null) {
			if (!attrs && this.instance) return this.instance;
			return new Mark$1(this, computeAttrs(this.attrs, attrs));
		}
		/**
		@internal
		*/
		static compile(marks, schema) {
			let result = Object.create(null);
			let rank = 0;
			marks.forEach((name, spec) => result[name] = new MarkType(name, rank++, schema, spec));
			return result;
		}
		/**
		When there is a mark of this type in the given set, a new set
		without it is returned. Otherwise, the input set is returned.
		*/
		removeFromSet(set) {
			for (var i = 0; i < set.length; i++) if (set[i].type == this) {
				set = set.slice(0, i).concat(set.slice(i + 1));
				i--;
			}
			return set;
		}
		/**
		Tests whether there is a mark of this type in the given set.
		*/
		isInSet(set) {
			for (let i = 0; i < set.length; i++) if (set[i].type == this) return set[i];
		}
		/**
		@internal
		*/
		checkAttrs(attrs) {
			checkAttrs(this.attrs, attrs, "mark", this.name);
		}
		/**
		Queries whether a given mark type is
		[excluded](https://prosemirror.net/docs/ref/#model.MarkSpec.excludes) by this one.
		*/
		excludes(other) {
			return this.excluded.indexOf(other) > -1;
		}
	};
	/**
	A document schema. Holds [node](https://prosemirror.net/docs/ref/#model.NodeType) and [mark
	type](https://prosemirror.net/docs/ref/#model.MarkType) objects for the nodes and marks that may
	occur in conforming documents, and provides functionality for
	creating and deserializing such documents.
	
	When given, the type parameters provide the names of the nodes and
	marks in this schema.
	*/
	var Schema = class {
		/**
		Construct a schema from a schema [specification](https://prosemirror.net/docs/ref/#model.SchemaSpec).
		*/
		constructor(spec) {
			/**
			The [linebreak
			replacement](https://prosemirror.net/docs/ref/#model.NodeSpec.linebreakReplacement) node defined
			in this schema, if any.
			*/
			this.linebreakReplacement = null;
			/**
			An object for storing whatever values modules may want to
			compute and cache per schema. (If you want to store something
			in it, try to use property names unlikely to clash.)
			*/
			this.cached = Object.create(null);
			let instanceSpec = this.spec = {};
			for (let prop in spec) instanceSpec[prop] = spec[prop];
			instanceSpec.nodes = OrderedMap.from(spec.nodes), instanceSpec.marks = OrderedMap.from(spec.marks || {}), this.nodes = NodeType$1.compile(this.spec.nodes, this);
			this.marks = MarkType.compile(this.spec.marks, this);
			let contentExprCache = Object.create(null);
			for (let prop in this.nodes) {
				if (prop in this.marks) throw new RangeError(prop + " can not be both a node and a mark");
				let type = this.nodes[prop];
				let contentExpr = type.spec.content || "";
				let markExpr = type.spec.marks;
				type.contentMatch = contentExprCache[contentExpr] || (contentExprCache[contentExpr] = ContentMatch.parse(contentExpr, this.nodes));
				type.inlineContent = type.contentMatch.inlineContent;
				if (type.spec.linebreakReplacement) {
					if (this.linebreakReplacement) throw new RangeError("Multiple linebreak nodes defined");
					if (!type.isInline || !type.isLeaf) throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");
					this.linebreakReplacement = type;
				}
				type.markSet = markExpr == "_" ? null : markExpr ? gatherMarks(this, markExpr.split(" ")) : markExpr == "" || !type.inlineContent ? [] : null;
			}
			for (let prop in this.marks) {
				let type = this.marks[prop];
				let excl = type.spec.excludes;
				type.excluded = excl == null ? [type] : excl == "" ? [] : gatherMarks(this, excl.split(" "));
			}
			this.nodeFromJSON = (json) => Node.fromJSON(this, json);
			this.markFromJSON = (json) => Mark$1.fromJSON(this, json);
			this.topNodeType = this.nodes[this.spec.topNode || "doc"];
			this.cached.wrappings = Object.create(null);
		}
		/**
		Create a node in this schema. The `type` may be a string or a
		`NodeType` instance. Attributes will be extended with defaults,
		`content` may be a `Fragment`, `null`, a `Node`, or an array of
		nodes.
		*/
		node(type, attrs = null, content, marks) {
			if (typeof type == "string") type = this.nodeType(type);
			else if (!(type instanceof NodeType$1)) throw new RangeError("Invalid node type: " + type);
			else if (type.schema != this) throw new RangeError("Node type from different schema used (" + type.name + ")");
			return type.createChecked(attrs, content, marks);
		}
		/**
		Create a text node in the schema. Empty text nodes are not
		allowed.
		*/
		text(text, marks) {
			let type = this.nodes.text;
			return new TextNode(type, type.defaultAttrs, text, Mark$1.setFrom(marks));
		}
		/**
		Create a mark with the given type and attributes.
		*/
		mark(type, attrs) {
			if (typeof type == "string") type = this.marks[type];
			return type.create(attrs);
		}
		/**
		@internal
		*/
		nodeType(name) {
			let found = this.nodes[name];
			if (!found) throw new RangeError("Unknown node type: " + name);
			return found;
		}
	};
	function gatherMarks(schema, marks) {
		let found = [];
		for (let i = 0; i < marks.length; i++) {
			let name = marks[i];
			let mark = schema.marks[name];
			let ok = mark;
			if (mark) found.push(mark);
			else for (let prop in schema.marks) {
				let mark = schema.marks[prop];
				if (name == "_" || mark.spec.group && mark.spec.group.split(" ").indexOf(name) > -1) found.push(ok = mark);
			}
			if (!ok) throw new SyntaxError("Unknown mark type: '" + marks[i] + "'");
		}
		return found;
	}
	function isTagRule(rule) {
		return rule.tag != null;
	}
	function isStyleRule(rule) {
		return rule.style != null;
	}
	/**
	A DOM parser represents a strategy for parsing DOM content into a
	ProseMirror document conforming to a given schema. Its behavior is
	defined by an array of [rules](https://prosemirror.net/docs/ref/#model.ParseRule).
	*/
	var DOMParser$1 = class DOMParser$1 {
		static {
			__name(this, "DOMParser");
		}
		/**
		Create a parser that targets the given schema, using the given
		parsing rules.
		*/
		constructor(schema, rules) {
			this.schema = schema;
			this.rules = rules;
			/**
			@internal
			*/
			this.tags = [];
			/**
			@internal
			*/
			this.styles = [];
			let matchedStyles = this.matchedStyles = [];
			rules.forEach((rule) => {
				if (isTagRule(rule)) this.tags.push(rule);
				else if (isStyleRule(rule)) {
					let prop = /[^=]*/.exec(rule.style)[0];
					if (matchedStyles.indexOf(prop) < 0) matchedStyles.push(prop);
					this.styles.push(rule);
				}
			});
			this.normalizeLists = !this.tags.some((r) => {
				if (!/^(ul|ol)\b/.test(r.tag) || !r.node) return false;
				let node = schema.nodes[r.node];
				return node.contentMatch.matchType(node);
			});
		}
		/**
		Parse a document from the content of a DOM node.
		*/
		parse(dom, options = {}) {
			let context = new ParseContext(this, options, false);
			context.addAll(dom, Mark$1.none, options.from, options.to);
			return context.finish();
		}
		/**
		Parses the content of the given DOM node, like
		[`parse`](https://prosemirror.net/docs/ref/#model.DOMParser.parse), and takes the same set of
		options. But unlike that method, which produces a whole node,
		this one returns a slice that is open at the sides, meaning that
		the schema constraints aren't applied to the start of nodes to
		the left of the input and the end of nodes at the end.
		*/
		parseSlice(dom, options = {}) {
			let context = new ParseContext(this, options, true);
			context.addAll(dom, Mark$1.none, options.from, options.to);
			return Slice.maxOpen(context.finish());
		}
		/**
		@internal
		*/
		matchTag(dom, context, after) {
			for (let i = after ? this.tags.indexOf(after) + 1 : 0; i < this.tags.length; i++) {
				let rule = this.tags[i];
				if (matches(dom, rule.tag) && (rule.namespace === void 0 || dom.namespaceURI == rule.namespace) && (!rule.context || context.matchesContext(rule.context))) {
					if (rule.getAttrs) {
						let result = rule.getAttrs(dom);
						if (result === false) continue;
						rule.attrs = result || void 0;
					}
					return rule;
				}
			}
		}
		/**
		@internal
		*/
		matchStyle(prop, value, context, after) {
			for (let i = after ? this.styles.indexOf(after) + 1 : 0; i < this.styles.length; i++) {
				let rule = this.styles[i];
				let style = rule.style;
				if (style.indexOf(prop) != 0 || rule.context && !context.matchesContext(rule.context) || style.length > prop.length && (style.charCodeAt(prop.length) != 61 || style.slice(prop.length + 1) != value)) continue;
				if (rule.getAttrs) {
					let result = rule.getAttrs(value);
					if (result === false) continue;
					rule.attrs = result || void 0;
				}
				return rule;
			}
		}
		/**
		@internal
		*/
		static schemaRules(schema) {
			let result = [];
			function insert(rule) {
				let priority = rule.priority == null ? 50 : rule.priority;
				let i = 0;
				for (; i < result.length; i++) {
					let next = result[i];
					if ((next.priority == null ? 50 : next.priority) < priority) break;
				}
				result.splice(i, 0, rule);
			}
			for (let name in schema.marks) {
				let rules = schema.marks[name].spec.parseDOM;
				if (rules) rules.forEach((rule) => {
					insert(rule = copy(rule));
					if (!(rule.mark || rule.ignore || rule.clearMark)) rule.mark = name;
				});
			}
			for (let name in schema.nodes) {
				let rules = schema.nodes[name].spec.parseDOM;
				if (rules) rules.forEach((rule) => {
					insert(rule = copy(rule));
					if (!(rule.node || rule.ignore || rule.mark)) rule.node = name;
				});
			}
			return result;
		}
		/**
		Construct a DOM parser using the parsing rules listed in a
		schema's [node specs](https://prosemirror.net/docs/ref/#model.NodeSpec.parseDOM), reordered by
		[priority](https://prosemirror.net/docs/ref/#model.GenericParseRule.priority).
		*/
		static fromSchema(schema) {
			return schema.cached.domParser || (schema.cached.domParser = new DOMParser$1(schema, DOMParser$1.schemaRules(schema)));
		}
	};
	var blockTags = {
		address: true,
		article: true,
		aside: true,
		blockquote: true,
		canvas: true,
		dd: true,
		div: true,
		dl: true,
		fieldset: true,
		figcaption: true,
		figure: true,
		footer: true,
		form: true,
		h1: true,
		h2: true,
		h3: true,
		h4: true,
		h5: true,
		h6: true,
		header: true,
		hgroup: true,
		hr: true,
		li: true,
		noscript: true,
		ol: true,
		output: true,
		p: true,
		pre: true,
		section: true,
		table: true,
		tfoot: true,
		ul: true
	};
	var ignoreTags = {
		head: true,
		noscript: true,
		object: true,
		script: true,
		style: true,
		title: true
	};
	var listTags = {
		ol: true,
		ul: true
	};
	var OPT_PRESERVE_WS = 1;
	var OPT_PRESERVE_WS_FULL = 2;
	var OPT_OPEN_LEFT = 4;
	function wsOptionsFor(type, preserveWhitespace, base) {
		if (preserveWhitespace != null) return (preserveWhitespace ? OPT_PRESERVE_WS : 0) | (preserveWhitespace === "full" ? OPT_PRESERVE_WS_FULL : 0);
		return type && type.whitespace == "pre" ? 3 : base & -5;
	}
	var NodeContext = class {
		constructor(type, attrs, marks, solid, match, options) {
			this.type = type;
			this.attrs = attrs;
			this.marks = marks;
			this.solid = solid;
			this.options = options;
			this.content = [];
			this.activeMarks = Mark$1.none;
			this.match = match || (options & OPT_OPEN_LEFT ? null : type.contentMatch);
		}
		findWrapping(node) {
			if (!this.match) {
				if (!this.type) return [];
				let fill = this.type.contentMatch.fillBefore(Fragment$1.from(node));
				if (fill) this.match = this.type.contentMatch.matchFragment(fill);
				else {
					let start = this.type.contentMatch;
					let wrap;
					if (wrap = start.findWrapping(node.type)) {
						this.match = start;
						return wrap;
					} else return null;
				}
			}
			return this.match.findWrapping(node.type);
		}
		finish(openEnd) {
			if (!(this.options & OPT_PRESERVE_WS)) {
				let last = this.content[this.content.length - 1];
				let m;
				if (last && last.isText && (m = /[ \t\r\n\u000c]+$/.exec(last.text))) {
					let text = last;
					if (last.text.length == m[0].length) this.content.pop();
					else this.content[this.content.length - 1] = text.withText(text.text.slice(0, text.text.length - m[0].length));
				}
			}
			let content = Fragment$1.from(this.content);
			if (!openEnd && this.match) content = content.append(this.match.fillBefore(Fragment$1.empty, true));
			return this.type ? this.type.create(this.attrs, content, this.marks) : content;
		}
		inlineContext(node) {
			if (this.type) return this.type.inlineContent;
			if (this.content.length) return this.content[0].isInline;
			return node.parentNode && !blockTags.hasOwnProperty(node.parentNode.nodeName.toLowerCase());
		}
	};
	var ParseContext = class {
		constructor(parser, options, isOpen) {
			this.parser = parser;
			this.options = options;
			this.isOpen = isOpen;
			this.open = 0;
			this.localPreserveWS = false;
			let topNode = options.topNode;
			let topContext;
			let topOptions = wsOptionsFor(null, options.preserveWhitespace, 0) | (isOpen ? OPT_OPEN_LEFT : 0);
			if (topNode) topContext = new NodeContext(topNode.type, topNode.attrs, Mark$1.none, true, options.topMatch || topNode.type.contentMatch, topOptions);
			else if (isOpen) topContext = new NodeContext(null, null, Mark$1.none, true, null, topOptions);
			else topContext = new NodeContext(parser.schema.topNodeType, null, Mark$1.none, true, null, topOptions);
			this.nodes = [topContext];
			this.find = options.findPositions;
			this.needsBlock = false;
		}
		get top() {
			return this.nodes[this.open];
		}
		addDOM(dom, marks) {
			if (dom.nodeType == 3) this.addTextNode(dom, marks);
			else if (dom.nodeType == 1) this.addElement(dom, marks);
		}
		addTextNode(dom, marks) {
			let value = dom.nodeValue;
			let top = this.top;
			let preserveWS = top.options & OPT_PRESERVE_WS_FULL ? "full" : this.localPreserveWS || (top.options & OPT_PRESERVE_WS) > 0;
			let { schema } = this.parser;
			if (preserveWS === "full" || top.inlineContext(dom) || /[^ \t\r\n\u000c]/.test(value)) {
				if (!preserveWS) {
					value = value.replace(/[ \t\r\n\u000c]+/g, " ");
					if (/^[ \t\r\n\u000c]/.test(value) && this.open == this.nodes.length - 1) {
						let nodeBefore = top.content[top.content.length - 1];
						let domNodeBefore = dom.previousSibling;
						if (!nodeBefore || domNodeBefore && domNodeBefore.nodeName == "BR" || nodeBefore.isText && /[ \t\r\n\u000c]$/.test(nodeBefore.text)) value = value.slice(1);
					}
				} else if (preserveWS === "full") value = value.replace(/\r\n?/g, "\n");
				else if (schema.linebreakReplacement && /[\r\n]/.test(value) && this.top.findWrapping(schema.linebreakReplacement.create())) {
					let lines = value.split(/\r?\n|\r/);
					for (let i = 0; i < lines.length; i++) {
						if (i) this.insertNode(schema.linebreakReplacement.create(), marks, true);
						if (lines[i]) this.insertNode(schema.text(lines[i]), marks, !/\S/.test(lines[i]));
					}
					value = "";
				} else value = value.replace(/\r?\n|\r/g, " ");
				if (value) this.insertNode(schema.text(value), marks, !/\S/.test(value));
				this.findInText(dom);
			} else this.findInside(dom);
		}
		addElement(dom, marks, matchAfter) {
			let outerWS = this.localPreserveWS;
			let top = this.top;
			if (dom.tagName == "PRE" || /pre/.test(dom.style && dom.style.whiteSpace)) this.localPreserveWS = true;
			let name = dom.nodeName.toLowerCase();
			let ruleID;
			if (listTags.hasOwnProperty(name) && this.parser.normalizeLists) normalizeList(dom);
			let rule = this.options.ruleFromNode && this.options.ruleFromNode(dom) || (ruleID = this.parser.matchTag(dom, this, matchAfter));
			out: if (rule ? rule.ignore : ignoreTags.hasOwnProperty(name)) {
				this.findInside(dom);
				this.ignoreFallback(dom, marks);
			} else if (!rule || rule.skip || rule.closeParent) {
				if (rule && rule.closeParent) this.open = Math.max(0, this.open - 1);
				else if (rule && rule.skip.nodeType) dom = rule.skip;
				let sync;
				let oldNeedsBlock = this.needsBlock;
				if (blockTags.hasOwnProperty(name)) {
					if (top.content.length && top.content[0].isInline && this.open) {
						this.open--;
						top = this.top;
					}
					sync = true;
					if (!top.type) this.needsBlock = true;
				} else if (!dom.firstChild) {
					this.leafFallback(dom, marks);
					break out;
				}
				let innerMarks = rule && rule.skip ? marks : this.readStyles(dom, marks);
				if (innerMarks) this.addAll(dom, innerMarks);
				if (sync) this.sync(top);
				this.needsBlock = oldNeedsBlock;
			} else {
				let innerMarks = this.readStyles(dom, marks);
				if (innerMarks) this.addElementByRule(dom, rule, innerMarks, rule.consuming === false ? ruleID : void 0);
			}
			this.localPreserveWS = outerWS;
		}
		leafFallback(dom, marks) {
			if (dom.nodeName == "BR" && this.top.type && this.top.type.inlineContent) this.addTextNode(dom.ownerDocument.createTextNode("\n"), marks);
		}
		ignoreFallback(dom, marks) {
			if (dom.nodeName == "BR" && (!this.top.type || !this.top.type.inlineContent)) this.findPlace(this.parser.schema.text("-"), marks, true);
		}
		readStyles(dom, marks) {
			let styles = dom.style;
			if (styles && styles.length) for (let i = 0; i < this.parser.matchedStyles.length; i++) {
				let name = this.parser.matchedStyles[i];
				let value = styles.getPropertyValue(name);
				if (value) for (let after = void 0;;) {
					let rule = this.parser.matchStyle(name, value, this, after);
					if (!rule) break;
					if (rule.ignore) return null;
					if (rule.clearMark) marks = marks.filter((m) => !rule.clearMark(m));
					else marks = marks.concat(this.parser.schema.marks[rule.mark].create(rule.attrs));
					if (rule.consuming === false) after = rule;
					else break;
				}
			}
			return marks;
		}
		addElementByRule(dom, rule, marks, continueAfter) {
			let sync;
			let nodeType;
			if (rule.node) {
				nodeType = this.parser.schema.nodes[rule.node];
				if (!nodeType.isLeaf) {
					let inner = this.enter(nodeType, rule.attrs || null, marks, rule.preserveWhitespace);
					if (inner) {
						sync = true;
						marks = inner;
					}
				} else if (!this.insertNode(nodeType.create(rule.attrs), marks, dom.nodeName == "BR")) this.leafFallback(dom, marks);
			} else {
				let markType = this.parser.schema.marks[rule.mark];
				marks = marks.concat(markType.create(rule.attrs));
			}
			let startIn = this.top;
			if (nodeType && nodeType.isLeaf) this.findInside(dom);
			else if (continueAfter) this.addElement(dom, marks, continueAfter);
			else if (rule.getContent) {
				this.findInside(dom);
				rule.getContent(dom, this.parser.schema).forEach((node) => this.insertNode(node, marks, false));
			} else {
				let contentDOM = dom;
				if (typeof rule.contentElement == "string") contentDOM = dom.querySelector(rule.contentElement);
				else if (typeof rule.contentElement == "function") contentDOM = rule.contentElement(dom);
				else if (rule.contentElement) contentDOM = rule.contentElement;
				this.findAround(dom, contentDOM, true);
				this.addAll(contentDOM, marks);
				this.findAround(dom, contentDOM, false);
			}
			if (sync && this.sync(startIn)) this.open--;
		}
		addAll(parent, marks, startIndex, endIndex) {
			let index = startIndex || 0;
			for (let dom = startIndex ? parent.childNodes[startIndex] : parent.firstChild, end = endIndex == null ? null : parent.childNodes[endIndex]; dom != end; dom = dom.nextSibling, ++index) {
				this.findAtPoint(parent, index);
				this.addDOM(dom, marks);
			}
			this.findAtPoint(parent, index);
		}
		findPlace(node, marks, cautious) {
			let route;
			let sync;
			for (let depth = this.open, penalty = 0; depth >= 0; depth--) {
				let cx = this.nodes[depth];
				let found = cx.findWrapping(node);
				if (found && (!route || route.length > found.length + penalty)) {
					route = found;
					sync = cx;
					if (!found.length) break;
				}
				if (cx.solid) {
					if (cautious) break;
					penalty += 2;
				}
			}
			if (!route) return null;
			this.sync(sync);
			for (let i = 0; i < route.length; i++) marks = this.enterInner(route[i], null, marks, false);
			return marks;
		}
		insertNode(node, marks, cautious) {
			if (node.isInline && this.needsBlock && !this.top.type) {
				let block = this.textblockFromContext();
				if (block) marks = this.enterInner(block, null, marks);
			}
			let innerMarks = this.findPlace(node, marks, cautious);
			if (innerMarks) {
				this.closeExtra();
				let top = this.top;
				if (top.match) top.match = top.match.matchType(node.type);
				let nodeMarks = Mark$1.none;
				for (let m of innerMarks.concat(node.marks)) if (top.type ? top.type.allowsMarkType(m.type) : markMayApply(m.type, node.type)) nodeMarks = m.addToSet(nodeMarks);
				top.content.push(node.mark(nodeMarks));
				return true;
			}
			return false;
		}
		enter(type, attrs, marks, preserveWS) {
			let innerMarks = this.findPlace(type.create(attrs), marks, false);
			if (innerMarks) innerMarks = this.enterInner(type, attrs, marks, true, preserveWS);
			return innerMarks;
		}
		enterInner(type, attrs, marks, solid = false, preserveWS) {
			this.closeExtra();
			let top = this.top;
			top.match = top.match && top.match.matchType(type);
			let options = wsOptionsFor(type, preserveWS, top.options);
			if (top.options & OPT_OPEN_LEFT && top.content.length == 0) options |= OPT_OPEN_LEFT;
			let applyMarks = Mark$1.none;
			marks = marks.filter((m) => {
				if (top.type ? top.type.allowsMarkType(m.type) : markMayApply(m.type, type)) {
					applyMarks = m.addToSet(applyMarks);
					return false;
				}
				return true;
			});
			this.nodes.push(new NodeContext(type, attrs, applyMarks, solid, null, options));
			this.open++;
			return marks;
		}
		closeExtra(openEnd = false) {
			let i = this.nodes.length - 1;
			if (i > this.open) {
				for (; i > this.open; i--) this.nodes[i - 1].content.push(this.nodes[i].finish(openEnd));
				this.nodes.length = this.open + 1;
			}
		}
		finish() {
			this.open = 0;
			this.closeExtra(this.isOpen);
			return this.nodes[0].finish(!!(this.isOpen || this.options.topOpen));
		}
		sync(to) {
			for (let i = this.open; i >= 0; i--) if (this.nodes[i] == to) {
				this.open = i;
				return true;
			} else if (this.localPreserveWS) this.nodes[i].options |= OPT_PRESERVE_WS;
			return false;
		}
		get currentPos() {
			this.closeExtra();
			let pos = 0;
			for (let i = this.open; i >= 0; i--) {
				let content = this.nodes[i].content;
				for (let j = content.length - 1; j >= 0; j--) pos += content[j].nodeSize;
				if (i) pos++;
			}
			return pos;
		}
		findAtPoint(parent, offset) {
			if (this.find) {
				for (let i = 0; i < this.find.length; i++) if (this.find[i].node == parent && this.find[i].offset == offset) this.find[i].pos = this.currentPos;
			}
		}
		findInside(parent) {
			if (this.find) {
				for (let i = 0; i < this.find.length; i++) if (this.find[i].pos == null && parent.nodeType == 1 && parent.contains(this.find[i].node)) this.find[i].pos = this.currentPos;
			}
		}
		findAround(parent, content, before) {
			if (parent != content && this.find) {
				for (let i = 0; i < this.find.length; i++) if (this.find[i].pos == null && parent.nodeType == 1 && parent.contains(this.find[i].node)) {
					if (content.compareDocumentPosition(this.find[i].node) & (before ? 2 : 4)) this.find[i].pos = this.currentPos;
				}
			}
		}
		findInText(textNode) {
			if (this.find) {
				for (let i = 0; i < this.find.length; i++) if (this.find[i].node == textNode) this.find[i].pos = this.currentPos - (textNode.nodeValue.length - this.find[i].offset);
			}
		}
		matchesContext(context) {
			if (context.indexOf("|") > -1) return context.split(/\s*\|\s*/).some(this.matchesContext, this);
			let parts = context.split("/");
			let option = this.options.context;
			let useRoot = !this.isOpen && (!option || option.parent.type == this.nodes[0].type);
			let minDepth = -(option ? option.depth + 1 : 0) + (useRoot ? 0 : 1);
			let match = (i, depth) => {
				for (; i >= 0; i--) {
					let part = parts[i];
					if (part == "") {
						if (i == parts.length - 1 || i == 0) continue;
						for (; depth >= minDepth; depth--) if (match(i - 1, depth)) return true;
						return false;
					} else {
						let next = depth > 0 || depth == 0 && useRoot ? this.nodes[depth].type : option && depth >= minDepth ? option.node(depth - minDepth).type : null;
						if (!next || next.name != part && !next.isInGroup(part)) return false;
						depth--;
					}
				}
				return true;
			};
			return match(parts.length - 1, this.open);
		}
		textblockFromContext() {
			let $context = this.options.context;
			if ($context) for (let d = $context.depth; d >= 0; d--) {
				let deflt = $context.node(d).contentMatchAt($context.indexAfter(d)).defaultType;
				if (deflt && deflt.isTextblock && deflt.defaultAttrs) return deflt;
			}
			for (let name in this.parser.schema.nodes) {
				let type = this.parser.schema.nodes[name];
				if (type.isTextblock && type.defaultAttrs) return type;
			}
		}
	};
	function normalizeList(dom) {
		for (let child = dom.firstChild, prevItem = null; child; child = child.nextSibling) {
			let name = child.nodeType == 1 ? child.nodeName.toLowerCase() : null;
			if (name && listTags.hasOwnProperty(name) && prevItem) {
				prevItem.appendChild(child);
				child = prevItem;
			} else if (name == "li") prevItem = child;
			else if (name) prevItem = null;
		}
	}
	function matches(dom, selector) {
		return (dom.matches || dom.msMatchesSelector || dom.webkitMatchesSelector || dom.mozMatchesSelector).call(dom, selector);
	}
	function copy(obj) {
		let copy = {};
		for (let prop in obj) copy[prop] = obj[prop];
		return copy;
	}
	function markMayApply(markType, nodeType) {
		let nodes = nodeType.schema.nodes;
		for (let name in nodes) {
			let parent = nodes[name];
			if (!parent.allowsMarkType(markType)) continue;
			let seen = [];
			let scan = (match) => {
				seen.push(match);
				for (let i = 0; i < match.edgeCount; i++) {
					let { type, next } = match.edge(i);
					if (type == nodeType) return true;
					if (seen.indexOf(next) < 0 && scan(next)) return true;
				}
			};
			if (scan(parent.contentMatch)) return true;
		}
	}
	/**
	A DOM serializer knows how to convert ProseMirror nodes and
	marks of various types to DOM nodes.
	*/
	var DOMSerializer = class DOMSerializer {
		/**
		Create a serializer. `nodes` should map node names to functions
		that take a node and return a description of the corresponding
		DOM. `marks` does the same for mark names, but also gets an
		argument that tells it whether the mark's content is block or
		inline content (for typical use, it'll always be inline). A mark
		serializer may be `null` to indicate that marks of that type
		should not be serialized.
		*/
		constructor(nodes, marks) {
			this.nodes = nodes;
			this.marks = marks;
		}
		/**
		Serialize the content of this fragment to a DOM fragment. When
		not in the browser, the `document` option, containing a DOM
		document, should be passed so that the serializer can create
		nodes.
		*/
		serializeFragment(fragment, options = {}, target) {
			if (!target) target = doc$1(options).createDocumentFragment();
			let top = target;
			let active = [];
			fragment.forEach((node) => {
				if (active.length || node.marks.length) {
					let keep = 0;
					let rendered = 0;
					while (keep < active.length && rendered < node.marks.length) {
						let next = node.marks[rendered];
						if (!this.marks[next.type.name]) {
							rendered++;
							continue;
						}
						if (!next.eq(active[keep][0]) || next.type.spec.spanning === false) break;
						keep++;
						rendered++;
					}
					while (keep < active.length) top = active.pop()[1];
					while (rendered < node.marks.length) {
						let add = node.marks[rendered++];
						let markDOM = this.serializeMark(add, node.isInline, options);
						if (markDOM) {
							active.push([add, top]);
							top.appendChild(markDOM.dom);
							top = markDOM.contentDOM || markDOM.dom;
						}
					}
				}
				top.appendChild(this.serializeNodeInner(node, options));
			});
			return target;
		}
		/**
		@internal
		*/
		serializeNodeInner(node, options) {
			let { dom, contentDOM } = renderSpec(doc$1(options), this.nodes[node.type.name](node), null, node.attrs);
			if (contentDOM) {
				if (node.isLeaf) throw new RangeError("Content hole not allowed in a leaf node spec");
				this.serializeFragment(node.content, options, contentDOM);
			}
			return dom;
		}
		/**
		Serialize this node to a DOM node. This can be useful when you
		need to serialize a part of a document, as opposed to the whole
		document. To serialize a whole document, use
		[`serializeFragment`](https://prosemirror.net/docs/ref/#model.DOMSerializer.serializeFragment) on
		its [content](https://prosemirror.net/docs/ref/#model.Node.content).
		*/
		serializeNode(node, options = {}) {
			let dom = this.serializeNodeInner(node, options);
			for (let i = node.marks.length - 1; i >= 0; i--) {
				let wrap = this.serializeMark(node.marks[i], node.isInline, options);
				if (wrap) {
					(wrap.contentDOM || wrap.dom).appendChild(dom);
					dom = wrap.dom;
				}
			}
			return dom;
		}
		/**
		@internal
		*/
		serializeMark(mark, inline, options = {}) {
			let toDOM = this.marks[mark.type.name];
			return toDOM && renderSpec(doc$1(options), toDOM(mark, inline), null, mark.attrs);
		}
		static renderSpec(doc, structure, xmlNS = null, blockArraysIn) {
			return renderSpec(doc, structure, xmlNS, blockArraysIn);
		}
		/**
		Build a serializer using the [`toDOM`](https://prosemirror.net/docs/ref/#model.NodeSpec.toDOM)
		properties in a schema's node and mark specs.
		*/
		static fromSchema(schema) {
			return schema.cached.domSerializer || (schema.cached.domSerializer = new DOMSerializer(this.nodesFromSchema(schema), this.marksFromSchema(schema)));
		}
		/**
		Gather the serializers in a schema's node specs into an object.
		This can be useful as a base to build a custom serializer from.
		*/
		static nodesFromSchema(schema) {
			let result = gatherToDOM(schema.nodes);
			if (!result.text) result.text = (node) => node.text;
			return result;
		}
		/**
		Gather the serializers in a schema's mark specs into an object.
		*/
		static marksFromSchema(schema) {
			return gatherToDOM(schema.marks);
		}
	};
	function gatherToDOM(obj) {
		let result = {};
		for (let name in obj) {
			let toDOM = obj[name].spec.toDOM;
			if (toDOM) result[name] = toDOM;
		}
		return result;
	}
	function doc$1(options) {
		return options.document || window.document;
	}
	__name(doc$1, "doc");
	var suspiciousAttributeCache = /* @__PURE__ */ new WeakMap();
	function suspiciousAttributes(attrs) {
		let value = suspiciousAttributeCache.get(attrs);
		if (value === void 0) suspiciousAttributeCache.set(attrs, value = suspiciousAttributesInner(attrs));
		return value;
	}
	function suspiciousAttributesInner(attrs) {
		let result = null;
		function scan(value) {
			if (value && typeof value == "object") if (Array.isArray(value)) if (typeof value[0] == "string") {
				if (!result) result = [];
				result.push(value);
			} else for (let i = 0; i < value.length; i++) scan(value[i]);
			else for (let prop in value) scan(value[prop]);
		}
		scan(attrs);
		return result;
	}
	function renderSpec(doc, structure, xmlNS, blockArraysIn) {
		if (typeof structure == "string") return { dom: doc.createTextNode(structure) };
		if (structure.nodeType != null) return { dom: structure };
		if (structure.dom && structure.dom.nodeType != null) return structure;
		let tagName = structure[0];
		let suspicious;
		if (typeof tagName != "string") throw new RangeError("Invalid array passed to renderSpec");
		if (blockArraysIn && (suspicious = suspiciousAttributes(blockArraysIn)) && suspicious.indexOf(structure) > -1) throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");
		let space = tagName.indexOf(" ");
		if (space > 0) {
			xmlNS = tagName.slice(0, space);
			tagName = tagName.slice(space + 1);
		}
		let contentDOM;
		let dom = xmlNS ? doc.createElementNS(xmlNS, tagName) : doc.createElement(tagName);
		let attrs = structure[1];
		let start = 1;
		if (attrs && typeof attrs == "object" && attrs.nodeType == null && !Array.isArray(attrs)) {
			start = 2;
			for (let name in attrs) if (attrs[name] != null) {
				let space = name.indexOf(" ");
				if (space > 0) dom.setAttributeNS(name.slice(0, space), name.slice(space + 1), attrs[name]);
				else if (name == "style" && dom.style) dom.style.cssText = attrs[name];
				else dom.setAttribute(name, attrs[name]);
			}
		}
		for (let i = start; i < structure.length; i++) {
			let child = structure[i];
			if (child === 0) {
				if (i < structure.length - 1 || i > start) throw new RangeError("Content hole must be the only child of its parent node");
				return {
					dom,
					contentDOM: dom
				};
			} else {
				let { dom: inner, contentDOM: innerContent } = renderSpec(doc, child, xmlNS, blockArraysIn);
				dom.appendChild(inner);
				if (innerContent) {
					if (contentDOM) throw new RangeError("Multiple content holes");
					contentDOM = innerContent;
				}
			}
		}
		return {
			dom,
			contentDOM
		};
	}

//#endregion
//#region node_modules/prosemirror-transform/dist/index.js
	var lower16 = 65535;
	var factor16 = Math.pow(2, 16);
	function makeRecover(index, offset) {
		return index + offset * factor16;
	}
	function recoverIndex(value) {
		return value & lower16;
	}
	function recoverOffset(value) {
		return (value - (value & lower16)) / factor16;
	}
	var DEL_BEFORE = 1;
	var DEL_AFTER = 2;
	var DEL_ACROSS = 4;
	var DEL_SIDE = 8;
	/**
	An object representing a mapped position with extra
	information.
	*/
	var MapResult = class {
		/**
		@internal
		*/
		constructor(pos, delInfo, recover) {
			this.pos = pos;
			this.delInfo = delInfo;
			this.recover = recover;
		}
		/**
		Tells you whether the position was deleted, that is, whether the
		step removed the token on the side queried (via the `assoc`)
		argument from the document.
		*/
		get deleted() {
			return (this.delInfo & DEL_SIDE) > 0;
		}
		/**
		Tells you whether the token before the mapped position was deleted.
		*/
		get deletedBefore() {
			return (this.delInfo & 5) > 0;
		}
		/**
		True when the token after the mapped position was deleted.
		*/
		get deletedAfter() {
			return (this.delInfo & 6) > 0;
		}
		/**
		Tells whether any of the steps mapped through deletes across the
		position (including both the token before and after the
		position).
		*/
		get deletedAcross() {
			return (this.delInfo & DEL_ACROSS) > 0;
		}
	};
	/**
	A map describing the deletions and insertions made by a step, which
	can be used to find the correspondence between positions in the
	pre-step version of a document and the same position in the
	post-step version.
	*/
	var StepMap = class StepMap {
		/**
		Create a position map. The modifications to the document are
		represented as an array of numbers, in which each group of three
		represents a modified chunk as `[start, oldSize, newSize]`.
		*/
		constructor(ranges, inverted = false) {
			this.ranges = ranges;
			this.inverted = inverted;
			if (!ranges.length && StepMap.empty) return StepMap.empty;
		}
		/**
		@internal
		*/
		recover(value) {
			let diff = 0;
			let index = recoverIndex(value);
			if (!this.inverted) for (let i = 0; i < index; i++) diff += this.ranges[i * 3 + 2] - this.ranges[i * 3 + 1];
			return this.ranges[index * 3] + diff + recoverOffset(value);
		}
		mapResult(pos, assoc = 1) {
			return this._map(pos, assoc, false);
		}
		map(pos, assoc = 1) {
			return this._map(pos, assoc, true);
		}
		/**
		@internal
		*/
		_map(pos, assoc, simple) {
			let diff = 0;
			let oldIndex = this.inverted ? 2 : 1;
			let newIndex = this.inverted ? 1 : 2;
			for (let i = 0; i < this.ranges.length; i += 3) {
				let start = this.ranges[i] - (this.inverted ? diff : 0);
				if (start > pos) break;
				let oldSize = this.ranges[i + oldIndex];
				let newSize = this.ranges[i + newIndex];
				let end = start + oldSize;
				if (pos <= end) {
					let side = !oldSize ? assoc : pos == start ? -1 : pos == end ? 1 : assoc;
					let result = start + diff + (side < 0 ? 0 : newSize);
					if (simple) return result;
					let recover = pos == (assoc < 0 ? start : end) ? null : makeRecover(i / 3, pos - start);
					let del = pos == start ? DEL_AFTER : pos == end ? DEL_BEFORE : DEL_ACROSS;
					if (assoc < 0 ? pos != start : pos != end) del |= DEL_SIDE;
					return new MapResult(result, del, recover);
				}
				diff += newSize - oldSize;
			}
			return simple ? pos + diff : new MapResult(pos + diff, 0, null);
		}
		/**
		@internal
		*/
		touches(pos, recover) {
			let diff = 0;
			let index = recoverIndex(recover);
			let oldIndex = this.inverted ? 2 : 1;
			let newIndex = this.inverted ? 1 : 2;
			for (let i = 0; i < this.ranges.length; i += 3) {
				let start = this.ranges[i] - (this.inverted ? diff : 0);
				if (start > pos) break;
				let oldSize = this.ranges[i + oldIndex];
				if (pos <= start + oldSize && i == index * 3) return true;
				diff += this.ranges[i + newIndex] - oldSize;
			}
			return false;
		}
		/**
		Calls the given function on each of the changed ranges included in
		this map.
		*/
		forEach(f) {
			let oldIndex = this.inverted ? 2 : 1;
			let newIndex = this.inverted ? 1 : 2;
			for (let i = 0, diff = 0; i < this.ranges.length; i += 3) {
				let start = this.ranges[i];
				let oldStart = start - (this.inverted ? diff : 0);
				let newStart = start + (this.inverted ? 0 : diff);
				let oldSize = this.ranges[i + oldIndex];
				let newSize = this.ranges[i + newIndex];
				f(oldStart, oldStart + oldSize, newStart, newStart + newSize);
				diff += newSize - oldSize;
			}
		}
		/**
		Create an inverted version of this map. The result can be used to
		map positions in the post-step document to the pre-step document.
		*/
		invert() {
			return new StepMap(this.ranges, !this.inverted);
		}
		/**
		@internal
		*/
		toString() {
			return (this.inverted ? "-" : "") + JSON.stringify(this.ranges);
		}
		/**
		Create a map that moves all positions by offset `n` (which may be
		negative). This can be useful when applying steps meant for a
		sub-document to a larger document, or vice-versa.
		*/
		static offset(n) {
			return n == 0 ? StepMap.empty : new StepMap(n < 0 ? [
				0,
				-n,
				0
			] : [
				0,
				0,
				n
			]);
		}
	};
	/**
	A StepMap that contains no changed ranges.
	*/
	StepMap.empty = new StepMap([]);
	/**
	A mapping represents a pipeline of zero or more [step
	maps](https://prosemirror.net/docs/ref/#transform.StepMap). It has special provisions for losslessly
	handling mapping positions through a series of steps in which some
	steps are inverted versions of earlier steps. (This comes up when
	‘[rebasing](https://prosemirror.net/docs/guide/#transform.rebasing)’ steps for
	collaboration or history management.)
	*/
	var Mapping = class Mapping {
		/**
		Create a new mapping with the given position maps.
		*/
		constructor(maps, mirror, from = 0, to = maps ? maps.length : 0) {
			this.mirror = mirror;
			this.from = from;
			this.to = to;
			this._maps = maps || [];
			this.ownData = !(maps || mirror);
		}
		/**
		The step maps in this mapping.
		*/
		get maps() {
			return this._maps;
		}
		/**
		Create a mapping that maps only through a part of this one.
		*/
		slice(from = 0, to = this.maps.length) {
			return new Mapping(this._maps, this.mirror, from, to);
		}
		/**
		Add a step map to the end of this mapping. If `mirrors` is
		given, it should be the index of the step map that is the mirror
		image of this one.
		*/
		appendMap(map, mirrors) {
			if (!this.ownData) {
				this._maps = this._maps.slice();
				this.mirror = this.mirror && this.mirror.slice();
				this.ownData = true;
			}
			this.to = this._maps.push(map);
			if (mirrors != null) this.setMirror(this._maps.length - 1, mirrors);
		}
		/**
		Add all the step maps in a given mapping to this one (preserving
		mirroring information).
		*/
		appendMapping(mapping) {
			for (let i = 0, startSize = this._maps.length; i < mapping._maps.length; i++) {
				let mirr = mapping.getMirror(i);
				this.appendMap(mapping._maps[i], mirr != null && mirr < i ? startSize + mirr : void 0);
			}
		}
		/**
		Finds the offset of the step map that mirrors the map at the
		given offset, in this mapping (as per the second argument to
		`appendMap`).
		*/
		getMirror(n) {
			if (this.mirror) {
				for (let i = 0; i < this.mirror.length; i++) if (this.mirror[i] == n) return this.mirror[i + (i % 2 ? -1 : 1)];
			}
		}
		/**
		@internal
		*/
		setMirror(n, m) {
			if (!this.mirror) this.mirror = [];
			this.mirror.push(n, m);
		}
		/**
		Append the inverse of the given mapping to this one.
		*/
		appendMappingInverted(mapping) {
			for (let i = mapping.maps.length - 1, totalSize = this._maps.length + mapping._maps.length; i >= 0; i--) {
				let mirr = mapping.getMirror(i);
				this.appendMap(mapping._maps[i].invert(), mirr != null && mirr > i ? totalSize - mirr - 1 : void 0);
			}
		}
		/**
		Create an inverted version of this mapping.
		*/
		invert() {
			let inverse = new Mapping();
			inverse.appendMappingInverted(this);
			return inverse;
		}
		/**
		Map a position through this mapping.
		*/
		map(pos, assoc = 1) {
			if (this.mirror) return this._map(pos, assoc, true);
			for (let i = this.from; i < this.to; i++) pos = this._maps[i].map(pos, assoc);
			return pos;
		}
		/**
		Map a position through this mapping, returning a mapping
		result.
		*/
		mapResult(pos, assoc = 1) {
			return this._map(pos, assoc, false);
		}
		/**
		@internal
		*/
		_map(pos, assoc, simple) {
			let delInfo = 0;
			for (let i = this.from; i < this.to; i++) {
				let result = this._maps[i].mapResult(pos, assoc);
				if (result.recover != null) {
					let corr = this.getMirror(i);
					if (corr != null && corr > i && corr < this.to) {
						i = corr;
						pos = this._maps[corr].recover(result.recover);
						continue;
					}
				}
				delInfo |= result.delInfo;
				pos = result.pos;
			}
			return simple ? pos : new MapResult(pos, delInfo, null);
		}
	};
	var stepsByID = Object.create(null);
	/**
	A step object represents an atomic change. It generally applies
	only to the document it was created for, since the positions
	stored in it will only make sense for that document.
	
	New steps are defined by creating classes that extend `Step`,
	overriding the `apply`, `invert`, `map`, `getMap` and `fromJSON`
	methods, and registering your class with a unique
	JSON-serialization identifier using
	[`Step.jsonID`](https://prosemirror.net/docs/ref/#transform.Step^jsonID).
	*/
	var Step = class {
		/**
		Get the step map that represents the changes made by this step,
		and which can be used to transform between positions in the old
		and the new document.
		*/
		getMap() {
			return StepMap.empty;
		}
		/**
		Try to merge this step with another one, to be applied directly
		after it. Returns the merged step when possible, null if the
		steps can't be merged.
		*/
		merge(other) {
			return null;
		}
		/**
		Deserialize a step from its JSON representation. Will call
		through to the step class' own implementation of this method.
		*/
		static fromJSON(schema, json) {
			if (!json || !json.stepType) throw new RangeError("Invalid input for Step.fromJSON");
			let type = stepsByID[json.stepType];
			if (!type) throw new RangeError(`No step type ${json.stepType} defined`);
			return type.fromJSON(schema, json);
		}
		/**
		To be able to serialize steps to JSON, each step needs a string
		ID to attach to its JSON representation. Use this method to
		register an ID for your step classes. Try to pick something
		that's unlikely to clash with steps from other modules.
		*/
		static jsonID(id, stepClass) {
			if (id in stepsByID) throw new RangeError("Duplicate use of step JSON ID " + id);
			stepsByID[id] = stepClass;
			stepClass.prototype.jsonID = id;
			return stepClass;
		}
	};
	/**
	The result of [applying](https://prosemirror.net/docs/ref/#transform.Step.apply) a step. Contains either a
	new document or a failure value.
	*/
	var StepResult = class StepResult {
		/**
		@internal
		*/
		constructor(doc, failed) {
			this.doc = doc;
			this.failed = failed;
		}
		/**
		Create a successful step result.
		*/
		static ok(doc) {
			return new StepResult(doc, null);
		}
		/**
		Create a failed step result.
		*/
		static fail(message) {
			return new StepResult(null, message);
		}
		/**
		Call [`Node.replace`](https://prosemirror.net/docs/ref/#model.Node.replace) with the given
		arguments. Create a successful result if it succeeds, and a
		failed one if it throws a `ReplaceError`.
		*/
		static fromReplace(doc, from, to, slice) {
			try {
				return StepResult.ok(doc.replace(from, to, slice));
			} catch (e) {
				if (e instanceof ReplaceError) return StepResult.fail(e.message);
				throw e;
			}
		}
	};
	function mapFragment(fragment, f, parent) {
		let mapped = [];
		for (let i = 0; i < fragment.childCount; i++) {
			let child = fragment.child(i);
			if (child.content.size) child = child.copy(mapFragment(child.content, f, child));
			if (child.isInline) child = f(child, parent, i);
			mapped.push(child);
		}
		return Fragment$1.fromArray(mapped);
	}
	/**
	Add a mark to all inline content between two positions.
	*/
	var AddMarkStep = class AddMarkStep extends Step {
		/**
		Create a mark step.
		*/
		constructor(from, to, mark) {
			super();
			this.from = from;
			this.to = to;
			this.mark = mark;
		}
		apply(doc) {
			let oldSlice = doc.slice(this.from, this.to);
			let $from = doc.resolve(this.from);
			let parent = $from.node($from.sharedDepth(this.to));
			let slice = new Slice(mapFragment(oldSlice.content, (node, parent) => {
				if (!node.isAtom || !parent.type.allowsMarkType(this.mark.type)) return node;
				return node.mark(this.mark.addToSet(node.marks));
			}, parent), oldSlice.openStart, oldSlice.openEnd);
			return StepResult.fromReplace(doc, this.from, this.to, slice);
		}
		invert() {
			return new RemoveMarkStep(this.from, this.to, this.mark);
		}
		map(mapping) {
			let from = mapping.mapResult(this.from, 1);
			let to = mapping.mapResult(this.to, -1);
			if (from.deleted && to.deleted || from.pos >= to.pos) return null;
			return new AddMarkStep(from.pos, to.pos, this.mark);
		}
		merge(other) {
			if (other instanceof AddMarkStep && other.mark.eq(this.mark) && this.from <= other.to && this.to >= other.from) return new AddMarkStep(Math.min(this.from, other.from), Math.max(this.to, other.to), this.mark);
			return null;
		}
		toJSON() {
			return {
				stepType: "addMark",
				mark: this.mark.toJSON(),
				from: this.from,
				to: this.to
			};
		}
		/**
		@internal
		*/
		static fromJSON(schema, json) {
			if (typeof json.from != "number" || typeof json.to != "number") throw new RangeError("Invalid input for AddMarkStep.fromJSON");
			return new AddMarkStep(json.from, json.to, schema.markFromJSON(json.mark));
		}
	};
	Step.jsonID("addMark", AddMarkStep);
	/**
	Remove a mark from all inline content between two positions.
	*/
	var RemoveMarkStep = class RemoveMarkStep extends Step {
		/**
		Create a mark-removing step.
		*/
		constructor(from, to, mark) {
			super();
			this.from = from;
			this.to = to;
			this.mark = mark;
		}
		apply(doc) {
			let oldSlice = doc.slice(this.from, this.to);
			let slice = new Slice(mapFragment(oldSlice.content, (node) => {
				return node.mark(this.mark.removeFromSet(node.marks));
			}, doc), oldSlice.openStart, oldSlice.openEnd);
			return StepResult.fromReplace(doc, this.from, this.to, slice);
		}
		invert() {
			return new AddMarkStep(this.from, this.to, this.mark);
		}
		map(mapping) {
			let from = mapping.mapResult(this.from, 1);
			let to = mapping.mapResult(this.to, -1);
			if (from.deleted && to.deleted || from.pos >= to.pos) return null;
			return new RemoveMarkStep(from.pos, to.pos, this.mark);
		}
		merge(other) {
			if (other instanceof RemoveMarkStep && other.mark.eq(this.mark) && this.from <= other.to && this.to >= other.from) return new RemoveMarkStep(Math.min(this.from, other.from), Math.max(this.to, other.to), this.mark);
			return null;
		}
		toJSON() {
			return {
				stepType: "removeMark",
				mark: this.mark.toJSON(),
				from: this.from,
				to: this.to
			};
		}
		/**
		@internal
		*/
		static fromJSON(schema, json) {
			if (typeof json.from != "number" || typeof json.to != "number") throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");
			return new RemoveMarkStep(json.from, json.to, schema.markFromJSON(json.mark));
		}
	};
	Step.jsonID("removeMark", RemoveMarkStep);
	/**
	Add a mark to a specific node.
	*/
	var AddNodeMarkStep = class AddNodeMarkStep extends Step {
		/**
		Create a node mark step.
		*/
		constructor(pos, mark) {
			super();
			this.pos = pos;
			this.mark = mark;
		}
		apply(doc) {
			let node = doc.nodeAt(this.pos);
			if (!node) return StepResult.fail("No node at mark step's position");
			let updated = node.type.create(node.attrs, null, this.mark.addToSet(node.marks));
			return StepResult.fromReplace(doc, this.pos, this.pos + 1, new Slice(Fragment$1.from(updated), 0, node.isLeaf ? 0 : 1));
		}
		invert(doc) {
			let node = doc.nodeAt(this.pos);
			if (node) {
				let newSet = this.mark.addToSet(node.marks);
				if (newSet.length == node.marks.length) {
					for (let i = 0; i < node.marks.length; i++) if (!node.marks[i].isInSet(newSet)) return new AddNodeMarkStep(this.pos, node.marks[i]);
					return new AddNodeMarkStep(this.pos, this.mark);
				}
			}
			return new RemoveNodeMarkStep(this.pos, this.mark);
		}
		map(mapping) {
			let pos = mapping.mapResult(this.pos, 1);
			return pos.deletedAfter ? null : new AddNodeMarkStep(pos.pos, this.mark);
		}
		toJSON() {
			return {
				stepType: "addNodeMark",
				pos: this.pos,
				mark: this.mark.toJSON()
			};
		}
		/**
		@internal
		*/
		static fromJSON(schema, json) {
			if (typeof json.pos != "number") throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");
			return new AddNodeMarkStep(json.pos, schema.markFromJSON(json.mark));
		}
	};
	Step.jsonID("addNodeMark", AddNodeMarkStep);
	/**
	Remove a mark from a specific node.
	*/
	var RemoveNodeMarkStep = class RemoveNodeMarkStep extends Step {
		/**
		Create a mark-removing step.
		*/
		constructor(pos, mark) {
			super();
			this.pos = pos;
			this.mark = mark;
		}
		apply(doc) {
			let node = doc.nodeAt(this.pos);
			if (!node) return StepResult.fail("No node at mark step's position");
			let updated = node.type.create(node.attrs, null, this.mark.removeFromSet(node.marks));
			return StepResult.fromReplace(doc, this.pos, this.pos + 1, new Slice(Fragment$1.from(updated), 0, node.isLeaf ? 0 : 1));
		}
		invert(doc) {
			let node = doc.nodeAt(this.pos);
			if (!node || !this.mark.isInSet(node.marks)) return this;
			return new AddNodeMarkStep(this.pos, this.mark);
		}
		map(mapping) {
			let pos = mapping.mapResult(this.pos, 1);
			return pos.deletedAfter ? null : new RemoveNodeMarkStep(pos.pos, this.mark);
		}
		toJSON() {
			return {
				stepType: "removeNodeMark",
				pos: this.pos,
				mark: this.mark.toJSON()
			};
		}
		/**
		@internal
		*/
		static fromJSON(schema, json) {
			if (typeof json.pos != "number") throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");
			return new RemoveNodeMarkStep(json.pos, schema.markFromJSON(json.mark));
		}
	};
	Step.jsonID("removeNodeMark", RemoveNodeMarkStep);
	/**
	Replace a part of the document with a slice of new content.
	*/
	var ReplaceStep = class ReplaceStep extends Step {
		/**
		The given `slice` should fit the 'gap' between `from` and
		`to`—the depths must line up, and the surrounding nodes must be
		able to be joined with the open sides of the slice. When
		`structure` is true, the step will fail if the content between
		from and to is not just a sequence of closing and then opening
		tokens (this is to guard against rebased replace steps
		overwriting something they weren't supposed to).
		*/
		constructor(from, to, slice, structure = false) {
			super();
			this.from = from;
			this.to = to;
			this.slice = slice;
			this.structure = structure;
		}
		apply(doc) {
			if (this.structure && contentBetween(doc, this.from, this.to)) return StepResult.fail("Structure replace would overwrite content");
			return StepResult.fromReplace(doc, this.from, this.to, this.slice);
		}
		getMap() {
			return new StepMap([
				this.from,
				this.to - this.from,
				this.slice.size
			]);
		}
		invert(doc) {
			return new ReplaceStep(this.from, this.from + this.slice.size, doc.slice(this.from, this.to));
		}
		map(mapping) {
			let from = mapping.mapResult(this.from, 1);
			let to = mapping.mapResult(this.to, -1);
			if (from.deletedAcross && to.deletedAcross) return null;
			return new ReplaceStep(from.pos, Math.max(from.pos, to.pos), this.slice, this.structure);
		}
		merge(other) {
			if (!(other instanceof ReplaceStep) || other.structure || this.structure) return null;
			if (this.from + this.slice.size == other.from && !this.slice.openEnd && !other.slice.openStart) {
				let slice = this.slice.size + other.slice.size == 0 ? Slice.empty : new Slice(this.slice.content.append(other.slice.content), this.slice.openStart, other.slice.openEnd);
				return new ReplaceStep(this.from, this.to + (other.to - other.from), slice, this.structure);
			} else if (other.to == this.from && !this.slice.openStart && !other.slice.openEnd) {
				let slice = this.slice.size + other.slice.size == 0 ? Slice.empty : new Slice(other.slice.content.append(this.slice.content), other.slice.openStart, this.slice.openEnd);
				return new ReplaceStep(other.from, this.to, slice, this.structure);
			} else return null;
		}
		toJSON() {
			let json = {
				stepType: "replace",
				from: this.from,
				to: this.to
			};
			if (this.slice.size) json.slice = this.slice.toJSON();
			if (this.structure) json.structure = true;
			return json;
		}
		/**
		@internal
		*/
		static fromJSON(schema, json) {
			if (typeof json.from != "number" || typeof json.to != "number") throw new RangeError("Invalid input for ReplaceStep.fromJSON");
			return new ReplaceStep(json.from, json.to, Slice.fromJSON(schema, json.slice), !!json.structure);
		}
	};
	Step.jsonID("replace", ReplaceStep);
	/**
	Replace a part of the document with a slice of content, but
	preserve a range of the replaced content by moving it into the
	slice.
	*/
	var ReplaceAroundStep = class ReplaceAroundStep extends Step {
		/**
		Create a replace-around step with the given range and gap.
		`insert` should be the point in the slice into which the content
		of the gap should be moved. `structure` has the same meaning as
		it has in the [`ReplaceStep`](https://prosemirror.net/docs/ref/#transform.ReplaceStep) class.
		*/
		constructor(from, to, gapFrom, gapTo, slice, insert, structure = false) {
			super();
			this.from = from;
			this.to = to;
			this.gapFrom = gapFrom;
			this.gapTo = gapTo;
			this.slice = slice;
			this.insert = insert;
			this.structure = structure;
		}
		apply(doc) {
			if (this.structure && (contentBetween(doc, this.from, this.gapFrom) || contentBetween(doc, this.gapTo, this.to))) return StepResult.fail("Structure gap-replace would overwrite content");
			let gap = doc.slice(this.gapFrom, this.gapTo);
			if (gap.openStart || gap.openEnd) return StepResult.fail("Gap is not a flat range");
			let inserted = this.slice.insertAt(this.insert, gap.content);
			if (!inserted) return StepResult.fail("Content does not fit in gap");
			return StepResult.fromReplace(doc, this.from, this.to, inserted);
		}
		getMap() {
			return new StepMap([
				this.from,
				this.gapFrom - this.from,
				this.insert,
				this.gapTo,
				this.to - this.gapTo,
				this.slice.size - this.insert
			]);
		}
		invert(doc) {
			let gap = this.gapTo - this.gapFrom;
			return new ReplaceAroundStep(this.from, this.from + this.slice.size + gap, this.from + this.insert, this.from + this.insert + gap, doc.slice(this.from, this.to).removeBetween(this.gapFrom - this.from, this.gapTo - this.from), this.gapFrom - this.from, this.structure);
		}
		map(mapping) {
			let from = mapping.mapResult(this.from, 1);
			let to = mapping.mapResult(this.to, -1);
			let gapFrom = this.from == this.gapFrom ? from.pos : mapping.map(this.gapFrom, -1);
			let gapTo = this.to == this.gapTo ? to.pos : mapping.map(this.gapTo, 1);
			if (from.deletedAcross && to.deletedAcross || gapFrom < from.pos || gapTo > to.pos) return null;
			return new ReplaceAroundStep(from.pos, to.pos, gapFrom, gapTo, this.slice, this.insert, this.structure);
		}
		toJSON() {
			let json = {
				stepType: "replaceAround",
				from: this.from,
				to: this.to,
				gapFrom: this.gapFrom,
				gapTo: this.gapTo,
				insert: this.insert
			};
			if (this.slice.size) json.slice = this.slice.toJSON();
			if (this.structure) json.structure = true;
			return json;
		}
		/**
		@internal
		*/
		static fromJSON(schema, json) {
			if (typeof json.from != "number" || typeof json.to != "number" || typeof json.gapFrom != "number" || typeof json.gapTo != "number" || typeof json.insert != "number") throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");
			return new ReplaceAroundStep(json.from, json.to, json.gapFrom, json.gapTo, Slice.fromJSON(schema, json.slice), json.insert, !!json.structure);
		}
	};
	Step.jsonID("replaceAround", ReplaceAroundStep);
	function contentBetween(doc, from, to) {
		let $from = doc.resolve(from);
		let dist = to - from;
		let depth = $from.depth;
		while (dist > 0 && depth > 0 && $from.indexAfter(depth) == $from.node(depth).childCount) {
			depth--;
			dist--;
		}
		if (dist > 0) {
			let next = $from.node(depth).maybeChild($from.indexAfter(depth));
			while (dist > 0) {
				if (!next || next.isLeaf) return true;
				next = next.firstChild;
				dist--;
			}
		}
		return false;
	}
	function addMark(tr, from, to, mark) {
		let removed = [];
		let added = [];
		let removing;
		let adding;
		tr.doc.nodesBetween(from, to, (node, pos, parent) => {
			if (!node.isInline) return;
			let marks = node.marks;
			if (!mark.isInSet(marks) && parent.type.allowsMarkType(mark.type)) {
				let start = Math.max(pos, from);
				let end = Math.min(pos + node.nodeSize, to);
				let newSet = mark.addToSet(marks);
				for (let i = 0; i < marks.length; i++) if (!marks[i].isInSet(newSet)) if (removing && removing.to == start && removing.mark.eq(marks[i])) removing.to = end;
				else removed.push(removing = new RemoveMarkStep(start, end, marks[i]));
				if (adding && adding.to == start) adding.to = end;
				else added.push(adding = new AddMarkStep(start, end, mark));
			}
		});
		removed.forEach((s) => tr.step(s));
		added.forEach((s) => tr.step(s));
	}
	function removeMark(tr, from, to, mark) {
		let matched = [];
		let step = 0;
		tr.doc.nodesBetween(from, to, (node, pos) => {
			if (!node.isInline) return;
			step++;
			let toRemove = null;
			if (mark instanceof MarkType) {
				let set = node.marks;
				let found;
				while (found = mark.isInSet(set)) {
					(toRemove || (toRemove = [])).push(found);
					set = found.removeFromSet(set);
				}
			} else if (mark) {
				if (mark.isInSet(node.marks)) toRemove = [mark];
			} else toRemove = node.marks;
			if (toRemove && toRemove.length) {
				let end = Math.min(pos + node.nodeSize, to);
				for (let i = 0; i < toRemove.length; i++) {
					let style = toRemove[i];
					let found;
					for (let j = 0; j < matched.length; j++) {
						let m = matched[j];
						if (m.step == step - 1 && style.eq(matched[j].style)) found = m;
					}
					if (found) {
						found.to = end;
						found.step = step;
					} else matched.push({
						style,
						from: Math.max(pos, from),
						to: end,
						step
					});
				}
			}
		});
		matched.forEach((m) => tr.step(new RemoveMarkStep(m.from, m.to, m.style)));
	}
	function clearIncompatible(tr, pos, parentType, match = parentType.contentMatch, clearNewlines = true) {
		let node = tr.doc.nodeAt(pos);
		let replSteps = [];
		let cur = pos + 1;
		for (let i = 0; i < node.childCount; i++) {
			let child = node.child(i);
			let end = cur + child.nodeSize;
			let allowed = match.matchType(child.type);
			if (!allowed) replSteps.push(new ReplaceStep(cur, end, Slice.empty));
			else {
				match = allowed;
				for (let j = 0; j < child.marks.length; j++) if (!parentType.allowsMarkType(child.marks[j].type)) tr.step(new RemoveMarkStep(cur, end, child.marks[j]));
				if (clearNewlines && child.isText && parentType.whitespace != "pre") {
					let m;
					let newline = /\r?\n|\r/g;
					let slice;
					while (m = newline.exec(child.text)) {
						if (!slice) slice = new Slice(Fragment$1.from(parentType.schema.text(" ", parentType.allowedMarks(child.marks))), 0, 0);
						replSteps.push(new ReplaceStep(cur + m.index, cur + m.index + m[0].length, slice));
					}
				}
			}
			cur = end;
		}
		if (!match.validEnd) {
			let fill = match.fillBefore(Fragment$1.empty, true);
			tr.replace(cur, cur, new Slice(fill, 0, 0));
		}
		for (let i = replSteps.length - 1; i >= 0; i--) tr.step(replSteps[i]);
	}
	function canCut(node, start, end) {
		return (start == 0 || node.canReplace(start, node.childCount)) && (end == node.childCount || node.canReplace(0, end));
	}
	/**
	Try to find a target depth to which the content in the given range
	can be lifted. Will not go across
	[isolating](https://prosemirror.net/docs/ref/#model.NodeSpec.isolating) parent nodes.
	*/
	function liftTarget(range) {
		let content = range.parent.content.cutByIndex(range.startIndex, range.endIndex);
		for (let depth = range.depth, contentBefore = 0, contentAfter = 0;; --depth) {
			let node = range.$from.node(depth);
			let index = range.$from.index(depth) + contentBefore;
			let endIndex = range.$to.indexAfter(depth) - contentAfter;
			if (depth < range.depth && node.canReplace(index, endIndex, content)) return depth;
			if (depth == 0 || node.type.spec.isolating || !canCut(node, index, endIndex)) break;
			if (index) contentBefore = 1;
			if (endIndex < node.childCount) contentAfter = 1;
		}
		return null;
	}
	function lift$2(tr, range, target) {
		let { $from, $to, depth } = range;
		let gapStart = $from.before(depth + 1);
		let gapEnd = $to.after(depth + 1);
		let start = gapStart;
		let end = gapEnd;
		let before = Fragment$1.empty;
		let openStart = 0;
		for (let d = depth, splitting = false; d > target; d--) if (splitting || $from.index(d) > 0) {
			splitting = true;
			before = Fragment$1.from($from.node(d).copy(before));
			openStart++;
		} else start--;
		let after = Fragment$1.empty;
		let openEnd = 0;
		for (let d = depth, splitting = false; d > target; d--) if (splitting || $to.after(d + 1) < $to.end(d)) {
			splitting = true;
			after = Fragment$1.from($to.node(d).copy(after));
			openEnd++;
		} else end++;
		tr.step(new ReplaceAroundStep(start, end, gapStart, gapEnd, new Slice(before.append(after), openStart, openEnd), before.size - openStart, true));
	}
	__name(lift$2, "lift");
	/**
	Try to find a valid way to wrap the content in the given range in a
	node of the given type. May introduce extra nodes around and inside
	the wrapper node, if necessary. Returns null if no valid wrapping
	could be found. When `innerRange` is given, that range's content is
	used as the content to fit into the wrapping, instead of the
	content of `range`.
	*/
	function findWrapping(range, nodeType, attrs = null, innerRange = range) {
		let around = findWrappingOutside(range, nodeType);
		let inner = around && findWrappingInside(innerRange, nodeType);
		if (!inner) return null;
		return around.map(withAttrs).concat({
			type: nodeType,
			attrs
		}).concat(inner.map(withAttrs));
	}
	function withAttrs(type) {
		return {
			type,
			attrs: null
		};
	}
	function findWrappingOutside(range, type) {
		let { parent, startIndex, endIndex } = range;
		let around = parent.contentMatchAt(startIndex).findWrapping(type);
		if (!around) return null;
		let outer = around.length ? around[0] : type;
		return parent.canReplaceWith(startIndex, endIndex, outer) ? around : null;
	}
	function findWrappingInside(range, type) {
		let { parent, startIndex, endIndex } = range;
		let inner = parent.child(startIndex);
		let inside = type.contentMatch.findWrapping(inner.type);
		if (!inside) return null;
		let innerMatch = (inside.length ? inside[inside.length - 1] : type).contentMatch;
		for (let i = startIndex; innerMatch && i < endIndex; i++) innerMatch = innerMatch.matchType(parent.child(i).type);
		if (!innerMatch || !innerMatch.validEnd) return null;
		return inside;
	}
	function wrap(tr, range, wrappers) {
		let content = Fragment$1.empty;
		for (let i = wrappers.length - 1; i >= 0; i--) {
			if (content.size) {
				let match = wrappers[i].type.contentMatch.matchFragment(content);
				if (!match || !match.validEnd) throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper");
			}
			content = Fragment$1.from(wrappers[i].type.create(wrappers[i].attrs, content));
		}
		let start = range.start;
		let end = range.end;
		tr.step(new ReplaceAroundStep(start, end, start, end, new Slice(content, 0, 0), wrappers.length, true));
	}
	function setBlockType$1(tr, from, to, type, attrs) {
		if (!type.isTextblock) throw new RangeError("Type given to setBlockType should be a textblock");
		let mapFrom = tr.steps.length;
		tr.doc.nodesBetween(from, to, (node, pos) => {
			let attrsHere = typeof attrs == "function" ? attrs(node) : attrs;
			if (node.isTextblock && !node.hasMarkup(type, attrsHere) && canChangeType(tr.doc, tr.mapping.slice(mapFrom).map(pos), type)) {
				let convertNewlines = null;
				if (type.schema.linebreakReplacement) {
					let pre = type.whitespace == "pre";
					let supportLinebreak = !!type.contentMatch.matchType(type.schema.linebreakReplacement);
					if (pre && !supportLinebreak) convertNewlines = false;
					else if (!pre && supportLinebreak) convertNewlines = true;
				}
				if (convertNewlines === false) replaceLinebreaks(tr, node, pos, mapFrom);
				clearIncompatible(tr, tr.mapping.slice(mapFrom).map(pos, 1), type, void 0, convertNewlines === null);
				let mapping = tr.mapping.slice(mapFrom);
				let startM = mapping.map(pos, 1);
				let endM = mapping.map(pos + node.nodeSize, 1);
				tr.step(new ReplaceAroundStep(startM, endM, startM + 1, endM - 1, new Slice(Fragment$1.from(type.create(attrsHere, null, node.marks)), 0, 0), 1, true));
				if (convertNewlines === true) replaceNewlines(tr, node, pos, mapFrom);
				return false;
			}
		});
	}
	__name(setBlockType$1, "setBlockType");
	function replaceNewlines(tr, node, pos, mapFrom) {
		node.forEach((child, offset) => {
			if (child.isText) {
				let m;
				let newline = /\r?\n|\r/g;
				while (m = newline.exec(child.text)) {
					let start = tr.mapping.slice(mapFrom).map(pos + 1 + offset + m.index);
					tr.replaceWith(start, start + 1, node.type.schema.linebreakReplacement.create());
				}
			}
		});
	}
	function replaceLinebreaks(tr, node, pos, mapFrom) {
		node.forEach((child, offset) => {
			if (child.type == child.type.schema.linebreakReplacement) {
				let start = tr.mapping.slice(mapFrom).map(pos + 1 + offset);
				tr.replaceWith(start, start + 1, node.type.schema.text("\n"));
			}
		});
	}
	function canChangeType(doc, pos, type) {
		let $pos = doc.resolve(pos);
		let index = $pos.index();
		return $pos.parent.canReplaceWith(index, index + 1, type);
	}
	/**
	Change the type, attributes, and/or marks of the node at `pos`.
	When `type` isn't given, the existing node type is preserved,
	*/
	function setNodeMarkup(tr, pos, type, attrs, marks) {
		let node = tr.doc.nodeAt(pos);
		if (!node) throw new RangeError("No node at given position");
		if (!type) type = node.type;
		let newNode = type.create(attrs, null, marks || node.marks);
		if (node.isLeaf) return tr.replaceWith(pos, pos + node.nodeSize, newNode);
		if (!type.validContent(node.content)) throw new RangeError("Invalid content for node type " + type.name);
		tr.step(new ReplaceAroundStep(pos, pos + node.nodeSize, pos + 1, pos + node.nodeSize - 1, new Slice(Fragment$1.from(newNode), 0, 0), 1, true));
	}
	/**
	Check whether splitting at the given position is allowed.
	*/
	function canSplit(doc, pos, depth = 1, typesAfter) {
		let $pos = doc.resolve(pos);
		let base = $pos.depth - depth;
		let innerType = typesAfter && typesAfter[typesAfter.length - 1] || $pos.parent;
		if (base < 0 || $pos.parent.type.spec.isolating || !$pos.parent.canReplace($pos.index(), $pos.parent.childCount) || !innerType.type.validContent($pos.parent.content.cutByIndex($pos.index(), $pos.parent.childCount))) return false;
		for (let d = $pos.depth - 1, i = depth - 2; d > base; d--, i--) {
			let node = $pos.node(d);
			let index = $pos.index(d);
			if (node.type.spec.isolating) return false;
			let rest = node.content.cutByIndex(index, node.childCount);
			let overrideChild = typesAfter && typesAfter[i + 1];
			if (overrideChild) rest = rest.replaceChild(0, overrideChild.type.create(overrideChild.attrs));
			let after = typesAfter && typesAfter[i] || node;
			if (!node.canReplace(index + 1, node.childCount) || !after.type.validContent(rest)) return false;
		}
		let index = $pos.indexAfter(base);
		let baseType = typesAfter && typesAfter[0];
		return $pos.node(base).canReplaceWith(index, index, baseType ? baseType.type : $pos.node(base + 1).type);
	}
	function split(tr, pos, depth = 1, typesAfter) {
		let $pos = tr.doc.resolve(pos);
		let before = Fragment$1.empty;
		let after = Fragment$1.empty;
		for (let d = $pos.depth, e = $pos.depth - depth, i = depth - 1; d > e; d--, i--) {
			before = Fragment$1.from($pos.node(d).copy(before));
			let typeAfter = typesAfter && typesAfter[i];
			after = Fragment$1.from(typeAfter ? typeAfter.type.create(typeAfter.attrs, after) : $pos.node(d).copy(after));
		}
		tr.step(new ReplaceStep(pos, pos, new Slice(before.append(after), depth, depth), true));
	}
	/**
	Test whether the blocks before and after a given position can be
	joined.
	*/
	function canJoin(doc, pos) {
		let $pos = doc.resolve(pos);
		let index = $pos.index();
		return joinable($pos.nodeBefore, $pos.nodeAfter) && $pos.parent.canReplace(index, index + 1);
	}
	function canAppendWithSubstitutedLinebreaks(a, b) {
		if (!b.content.size) a.type.compatibleContent(b.type);
		let match = a.contentMatchAt(a.childCount);
		let { linebreakReplacement } = a.type.schema;
		for (let i = 0; i < b.childCount; i++) {
			let child = b.child(i);
			let type = child.type == linebreakReplacement ? a.type.schema.nodes.text : child.type;
			match = match.matchType(type);
			if (!match) return false;
			if (!a.type.allowsMarks(child.marks)) return false;
		}
		return match.validEnd;
	}
	function joinable(a, b) {
		return !!(a && b && !a.isLeaf && canAppendWithSubstitutedLinebreaks(a, b));
	}
	/**
	Find an ancestor of the given position that can be joined to the
	block before (or after if `dir` is positive). Returns the joinable
	point, if any.
	*/
	function joinPoint(doc, pos, dir = -1) {
		let $pos = doc.resolve(pos);
		for (let d = $pos.depth;; d--) {
			let before;
			let after;
			let index = $pos.index(d);
			if (d == $pos.depth) {
				before = $pos.nodeBefore;
				after = $pos.nodeAfter;
			} else if (dir > 0) {
				before = $pos.node(d + 1);
				index++;
				after = $pos.node(d).maybeChild(index);
			} else {
				before = $pos.node(d).maybeChild(index - 1);
				after = $pos.node(d + 1);
			}
			if (before && !before.isTextblock && joinable(before, after) && $pos.node(d).canReplace(index, index + 1)) return pos;
			if (d == 0) break;
			pos = dir < 0 ? $pos.before(d) : $pos.after(d);
		}
	}
	function join(tr, pos, depth) {
		let convertNewlines = null;
		let { linebreakReplacement } = tr.doc.type.schema;
		let $before = tr.doc.resolve(pos - depth);
		let beforeType = $before.node().type;
		if (linebreakReplacement && beforeType.inlineContent) {
			let pre = beforeType.whitespace == "pre";
			let supportLinebreak = !!beforeType.contentMatch.matchType(linebreakReplacement);
			if (pre && !supportLinebreak) convertNewlines = false;
			else if (!pre && supportLinebreak) convertNewlines = true;
		}
		let mapFrom = tr.steps.length;
		if (convertNewlines === false) {
			let $after = tr.doc.resolve(pos + depth);
			replaceLinebreaks(tr, $after.node(), $after.before(), mapFrom);
		}
		if (beforeType.inlineContent) clearIncompatible(tr, pos + depth - 1, beforeType, $before.node().contentMatchAt($before.index()), convertNewlines == null);
		let mapping = tr.mapping.slice(mapFrom);
		let start = mapping.map(pos - depth);
		tr.step(new ReplaceStep(start, mapping.map(pos + depth, -1), Slice.empty, true));
		if (convertNewlines === true) {
			let $full = tr.doc.resolve(start);
			replaceNewlines(tr, $full.node(), $full.before(), tr.steps.length);
		}
		return tr;
	}
	/**
	Try to find a point where a node of the given type can be inserted
	near `pos`, by searching up the node hierarchy when `pos` itself
	isn't a valid place but is at the start or end of a node. Return
	null if no position was found.
	*/
	function insertPoint(doc, pos, nodeType) {
		let $pos = doc.resolve(pos);
		if ($pos.parent.canReplaceWith($pos.index(), $pos.index(), nodeType)) return pos;
		if ($pos.parentOffset == 0) for (let d = $pos.depth - 1; d >= 0; d--) {
			let index = $pos.index(d);
			if ($pos.node(d).canReplaceWith(index, index, nodeType)) return $pos.before(d + 1);
			if (index > 0) return null;
		}
		if ($pos.parentOffset == $pos.parent.content.size) for (let d = $pos.depth - 1; d >= 0; d--) {
			let index = $pos.indexAfter(d);
			if ($pos.node(d).canReplaceWith(index, index, nodeType)) return $pos.after(d + 1);
			if (index < $pos.node(d).childCount) return null;
		}
		return null;
	}
	/**
	Finds a position at or around the given position where the given
	slice can be inserted. Will look at parent nodes' nearest boundary
	and try there, even if the original position wasn't directly at the
	start or end of that node. Returns null when no position was found.
	*/
	function dropPoint(doc, pos, slice) {
		let $pos = doc.resolve(pos);
		if (!slice.content.size) return pos;
		let content = slice.content;
		for (let i = 0; i < slice.openStart; i++) content = content.firstChild.content;
		for (let pass = 1; pass <= (slice.openStart == 0 && slice.size ? 2 : 1); pass++) for (let d = $pos.depth; d >= 0; d--) {
			let bias = d == $pos.depth ? 0 : $pos.pos <= ($pos.start(d + 1) + $pos.end(d + 1)) / 2 ? -1 : 1;
			let insertPos = $pos.index(d) + (bias > 0 ? 1 : 0);
			let parent = $pos.node(d);
			let fits = false;
			if (pass == 1) fits = parent.canReplace(insertPos, insertPos, content);
			else {
				let wrapping = parent.contentMatchAt(insertPos).findWrapping(content.firstChild.type);
				fits = wrapping && parent.canReplaceWith(insertPos, insertPos, wrapping[0]);
			}
			if (fits) return bias == 0 ? $pos.pos : bias < 0 ? $pos.before(d + 1) : $pos.after(d + 1);
		}
		return null;
	}
	/**
	‘Fit’ a slice into a given position in the document, producing a
	[step](https://prosemirror.net/docs/ref/#transform.Step) that inserts it. Will return null if
	there's no meaningful way to insert the slice here, or inserting it
	would be a no-op (an empty slice over an empty range).
	*/
	function replaceStep(doc, from, to = from, slice = Slice.empty) {
		if (from == to && !slice.size) return null;
		let $from = doc.resolve(from);
		let $to = doc.resolve(to);
		if (fitsTrivially($from, $to, slice)) return new ReplaceStep(from, to, slice);
		return new Fitter($from, $to, slice).fit();
	}
	function fitsTrivially($from, $to, slice) {
		return !slice.openStart && !slice.openEnd && $from.start() == $to.start() && $from.parent.canReplace($from.index(), $to.index(), slice.content);
	}
	var Fitter = class {
		constructor($from, $to, unplaced) {
			this.$from = $from;
			this.$to = $to;
			this.unplaced = unplaced;
			this.frontier = [];
			this.placed = Fragment$1.empty;
			for (let i = 0; i <= $from.depth; i++) {
				let node = $from.node(i);
				this.frontier.push({
					type: node.type,
					match: node.contentMatchAt($from.indexAfter(i))
				});
			}
			for (let i = $from.depth; i > 0; i--) this.placed = Fragment$1.from($from.node(i).copy(this.placed));
		}
		get depth() {
			return this.frontier.length - 1;
		}
		fit() {
			while (this.unplaced.size) {
				let fit = this.findFittable();
				if (fit) this.placeNodes(fit);
				else this.openMore() || this.dropNode();
			}
			let moveInline = this.mustMoveInline();
			let placedSize = this.placed.size - this.depth - this.$from.depth;
			let $from = this.$from;
			let $to = this.close(moveInline < 0 ? this.$to : $from.doc.resolve(moveInline));
			if (!$to) return null;
			let content = this.placed;
			let openStart = $from.depth;
			let openEnd = $to.depth;
			while (openStart && openEnd && content.childCount == 1) {
				content = content.firstChild.content;
				openStart--;
				openEnd--;
			}
			let slice = new Slice(content, openStart, openEnd);
			if (moveInline > -1) return new ReplaceAroundStep($from.pos, moveInline, this.$to.pos, this.$to.end(), slice, placedSize);
			if (slice.size || $from.pos != this.$to.pos) return new ReplaceStep($from.pos, $to.pos, slice);
			return null;
		}
		findFittable() {
			let startDepth = this.unplaced.openStart;
			for (let cur = this.unplaced.content, d = 0, openEnd = this.unplaced.openEnd; d < startDepth; d++) {
				let node = cur.firstChild;
				if (cur.childCount > 1) openEnd = 0;
				if (node.type.spec.isolating && openEnd <= d) {
					startDepth = d;
					break;
				}
				cur = node.content;
			}
			for (let pass = 1; pass <= 2; pass++) for (let sliceDepth = pass == 1 ? startDepth : this.unplaced.openStart; sliceDepth >= 0; sliceDepth--) {
				let fragment;
				let parent = null;
				if (sliceDepth) {
					parent = contentAt(this.unplaced.content, sliceDepth - 1).firstChild;
					fragment = parent.content;
				} else fragment = this.unplaced.content;
				let first = fragment.firstChild;
				for (let frontierDepth = this.depth; frontierDepth >= 0; frontierDepth--) {
					let { type, match } = this.frontier[frontierDepth], wrap, inject = null;
					if (pass == 1 && (first ? match.matchType(first.type) || (inject = match.fillBefore(Fragment$1.from(first), false)) : parent && type.compatibleContent(parent.type))) return {
						sliceDepth,
						frontierDepth,
						parent,
						inject
					};
					else if (pass == 2 && first && (wrap = match.findWrapping(first.type))) return {
						sliceDepth,
						frontierDepth,
						parent,
						wrap
					};
					if (parent && match.matchType(parent.type)) break;
				}
			}
		}
		openMore() {
			let { content, openStart, openEnd } = this.unplaced;
			let inner = contentAt(content, openStart);
			if (!inner.childCount || inner.firstChild.isLeaf) return false;
			this.unplaced = new Slice(content, openStart + 1, Math.max(openEnd, inner.size + openStart >= content.size - openEnd ? openStart + 1 : 0));
			return true;
		}
		dropNode() {
			let { content, openStart, openEnd } = this.unplaced;
			let inner = contentAt(content, openStart);
			if (inner.childCount <= 1 && openStart > 0) {
				let openAtEnd = content.size - openStart <= openStart + inner.size;
				this.unplaced = new Slice(dropFromFragment(content, openStart - 1, 1), openStart - 1, openAtEnd ? openStart - 1 : openEnd);
			} else this.unplaced = new Slice(dropFromFragment(content, openStart, 1), openStart, openEnd);
		}
		placeNodes({ sliceDepth, frontierDepth, parent, inject, wrap }) {
			while (this.depth > frontierDepth) this.closeFrontierNode();
			if (wrap) for (let i = 0; i < wrap.length; i++) this.openFrontierNode(wrap[i]);
			let slice = this.unplaced;
			let fragment = parent ? parent.content : slice.content;
			let openStart = slice.openStart - sliceDepth;
			let taken = 0;
			let add = [];
			let { match, type } = this.frontier[frontierDepth];
			if (inject) {
				for (let i = 0; i < inject.childCount; i++) add.push(inject.child(i));
				match = match.matchFragment(inject);
			}
			let openEndCount = fragment.size + sliceDepth - (slice.content.size - slice.openEnd);
			while (taken < fragment.childCount) {
				let next = fragment.child(taken);
				let matches = match.matchType(next.type);
				if (!matches) break;
				taken++;
				if (taken > 1 || openStart == 0 || next.content.size) {
					match = matches;
					add.push(closeNodeStart(next.mark(type.allowedMarks(next.marks)), taken == 1 ? openStart : 0, taken == fragment.childCount ? openEndCount : -1));
				}
			}
			let toEnd = taken == fragment.childCount;
			if (!toEnd) openEndCount = -1;
			this.placed = addToFragment(this.placed, frontierDepth, Fragment$1.from(add));
			this.frontier[frontierDepth].match = match;
			if (toEnd && openEndCount < 0 && parent && parent.type == this.frontier[this.depth].type && this.frontier.length > 1) this.closeFrontierNode();
			for (let i = 0, cur = fragment; i < openEndCount; i++) {
				let node = cur.lastChild;
				this.frontier.push({
					type: node.type,
					match: node.contentMatchAt(node.childCount)
				});
				cur = node.content;
			}
			this.unplaced = !toEnd ? new Slice(dropFromFragment(slice.content, sliceDepth, taken), slice.openStart, slice.openEnd) : sliceDepth == 0 ? Slice.empty : new Slice(dropFromFragment(slice.content, sliceDepth - 1, 1), sliceDepth - 1, openEndCount < 0 ? slice.openEnd : sliceDepth - 1);
		}
		mustMoveInline() {
			if (!this.$to.parent.isTextblock) return -1;
			let top = this.frontier[this.depth];
			let level;
			if (!top.type.isTextblock || !contentAfterFits(this.$to, this.$to.depth, top.type, top.match, false) || this.$to.depth == this.depth && (level = this.findCloseLevel(this.$to)) && level.depth == this.depth) return -1;
			let { depth } = this.$to, after = this.$to.after(depth);
			while (depth > 1 && after == this.$to.end(--depth)) ++after;
			return after;
		}
		findCloseLevel($to) {
			scan: for (let i = Math.min(this.depth, $to.depth); i >= 0; i--) {
				let { match, type } = this.frontier[i];
				let dropInner = i < $to.depth && $to.end(i + 1) == $to.pos + ($to.depth - (i + 1));
				let fit = contentAfterFits($to, i, type, match, dropInner);
				if (!fit) continue;
				for (let d = i - 1; d >= 0; d--) {
					let { match, type } = this.frontier[d];
					let matches = contentAfterFits($to, d, type, match, true);
					if (!matches || matches.childCount) continue scan;
				}
				return {
					depth: i,
					fit,
					move: dropInner ? $to.doc.resolve($to.after(i + 1)) : $to
				};
			}
		}
		close($to) {
			let close = this.findCloseLevel($to);
			if (!close) return null;
			while (this.depth > close.depth) this.closeFrontierNode();
			if (close.fit.childCount) this.placed = addToFragment(this.placed, close.depth, close.fit);
			$to = close.move;
			for (let d = close.depth + 1; d <= $to.depth; d++) {
				let node = $to.node(d);
				let add = node.type.contentMatch.fillBefore(node.content, true, $to.index(d));
				this.openFrontierNode(node.type, node.attrs, add);
			}
			return $to;
		}
		openFrontierNode(type, attrs = null, content) {
			let top = this.frontier[this.depth];
			top.match = top.match.matchType(type);
			this.placed = addToFragment(this.placed, this.depth, Fragment$1.from(type.create(attrs, content)));
			this.frontier.push({
				type,
				match: type.contentMatch
			});
		}
		closeFrontierNode() {
			let add = this.frontier.pop().match.fillBefore(Fragment$1.empty, true);
			if (add.childCount) this.placed = addToFragment(this.placed, this.frontier.length, add);
		}
	};
	function dropFromFragment(fragment, depth, count) {
		if (depth == 0) return fragment.cutByIndex(count, fragment.childCount);
		return fragment.replaceChild(0, fragment.firstChild.copy(dropFromFragment(fragment.firstChild.content, depth - 1, count)));
	}
	function addToFragment(fragment, depth, content) {
		if (depth == 0) return fragment.append(content);
		return fragment.replaceChild(fragment.childCount - 1, fragment.lastChild.copy(addToFragment(fragment.lastChild.content, depth - 1, content)));
	}
	function contentAt(fragment, depth) {
		for (let i = 0; i < depth; i++) fragment = fragment.firstChild.content;
		return fragment;
	}
	function closeNodeStart(node, openStart, openEnd) {
		if (openStart <= 0) return node;
		let frag = node.content;
		if (openStart > 1) frag = frag.replaceChild(0, closeNodeStart(frag.firstChild, openStart - 1, frag.childCount == 1 ? openEnd - 1 : 0));
		if (openStart > 0) {
			frag = node.type.contentMatch.fillBefore(frag).append(frag);
			if (openEnd <= 0) frag = frag.append(node.type.contentMatch.matchFragment(frag).fillBefore(Fragment$1.empty, true));
		}
		return node.copy(frag);
	}
	function contentAfterFits($to, depth, type, match, open) {
		let node = $to.node(depth);
		let index = open ? $to.indexAfter(depth) : $to.index(depth);
		if (index == node.childCount && !type.compatibleContent(node.type)) return null;
		let fit = match.fillBefore(node.content, true, index);
		return fit && !invalidMarks(type, node.content, index) ? fit : null;
	}
	function invalidMarks(type, fragment, start) {
		for (let i = start; i < fragment.childCount; i++) if (!type.allowsMarks(fragment.child(i).marks)) return true;
		return false;
	}
	function definesContent(type) {
		return type.spec.defining || type.spec.definingForContent;
	}
	function replaceRange(tr, from, to, slice) {
		if (!slice.size) return tr.deleteRange(from, to);
		let $from = tr.doc.resolve(from);
		let $to = tr.doc.resolve(to);
		if (fitsTrivially($from, $to, slice)) return tr.step(new ReplaceStep(from, to, slice));
		let targetDepths = coveredDepths($from, $to);
		if (targetDepths[targetDepths.length - 1] == 0) targetDepths.pop();
		let preferredTarget = -($from.depth + 1);
		targetDepths.unshift(preferredTarget);
		for (let d = $from.depth, pos = $from.pos - 1; d > 0; d--, pos--) {
			let spec = $from.node(d).type.spec;
			if (spec.defining || spec.definingAsContext || spec.isolating) break;
			if (targetDepths.indexOf(d) > -1) preferredTarget = d;
			else if ($from.before(d) == pos) targetDepths.splice(1, 0, -d);
		}
		let preferredTargetIndex = targetDepths.indexOf(preferredTarget);
		let leftNodes = [];
		let preferredDepth = slice.openStart;
		for (let content = slice.content, i = 0;; i++) {
			let node = content.firstChild;
			leftNodes.push(node);
			if (i == slice.openStart) break;
			content = node.content;
		}
		for (let d = preferredDepth - 1; d >= 0; d--) {
			let leftNode = leftNodes[d];
			let def = definesContent(leftNode.type);
			if (def && !leftNode.sameMarkup($from.node(Math.abs(preferredTarget) - 1))) preferredDepth = d;
			else if (def || !leftNode.type.isTextblock) break;
		}
		for (let j = slice.openStart; j >= 0; j--) {
			let openDepth = (j + preferredDepth + 1) % (slice.openStart + 1);
			let insert = leftNodes[openDepth];
			if (!insert) continue;
			for (let i = 0; i < targetDepths.length; i++) {
				let targetDepth = targetDepths[(i + preferredTargetIndex) % targetDepths.length];
				let expand = true;
				if (targetDepth < 0) {
					expand = false;
					targetDepth = -targetDepth;
				}
				let parent = $from.node(targetDepth - 1);
				let index = $from.index(targetDepth - 1);
				if (parent.canReplaceWith(index, index, insert.type, insert.marks)) return tr.replace($from.before(targetDepth), expand ? $to.after(targetDepth) : to, new Slice(closeFragment(slice.content, 0, slice.openStart, openDepth), openDepth, slice.openEnd));
			}
		}
		let startSteps = tr.steps.length;
		for (let i = targetDepths.length - 1; i >= 0; i--) {
			tr.replace(from, to, slice);
			if (tr.steps.length > startSteps) break;
			let depth = targetDepths[i];
			if (depth < 0) continue;
			from = $from.before(depth);
			to = $to.after(depth);
		}
	}
	function closeFragment(fragment, depth, oldOpen, newOpen, parent) {
		if (depth < oldOpen) {
			let first = fragment.firstChild;
			fragment = fragment.replaceChild(0, first.copy(closeFragment(first.content, depth + 1, oldOpen, newOpen, first)));
		}
		if (depth > newOpen) {
			let match = parent.contentMatchAt(0);
			let start = match.fillBefore(fragment).append(fragment);
			fragment = start.append(match.matchFragment(start).fillBefore(Fragment$1.empty, true));
		}
		return fragment;
	}
	function replaceRangeWith(tr, from, to, node) {
		if (!node.isInline && from == to && tr.doc.resolve(from).parent.content.size) {
			let point = insertPoint(tr.doc, from, node.type);
			if (point != null) from = to = point;
		}
		tr.replaceRange(from, to, new Slice(Fragment$1.from(node), 0, 0));
	}
	function deleteRange$1(tr, from, to) {
		let $from = tr.doc.resolve(from);
		let $to = tr.doc.resolve(to);
		let covered = coveredDepths($from, $to);
		for (let i = 0; i < covered.length; i++) {
			let depth = covered[i];
			let last = i == covered.length - 1;
			if (last && depth == 0 || $from.node(depth).type.contentMatch.validEnd) return tr.delete($from.start(depth), $to.end(depth));
			if (depth > 0 && (last || $from.node(depth - 1).canReplace($from.index(depth - 1), $to.indexAfter(depth - 1)))) return tr.delete($from.before(depth), $to.after(depth));
		}
		for (let d = 1; d <= $from.depth && d <= $to.depth; d++) if (from - $from.start(d) == $from.depth - d && to > $from.end(d) && $to.end(d) - to != $to.depth - d && $from.start(d - 1) == $to.start(d - 1) && $from.node(d - 1).canReplace($from.index(d - 1), $to.index(d - 1))) return tr.delete($from.before(d), to);
		tr.delete(from, to);
	}
	__name(deleteRange$1, "deleteRange");
	function coveredDepths($from, $to) {
		let result = [];
		let minDepth = Math.min($from.depth, $to.depth);
		for (let d = minDepth; d >= 0; d--) {
			let start = $from.start(d);
			if (start < $from.pos - ($from.depth - d) || $to.end(d) > $to.pos + ($to.depth - d) || $from.node(d).type.spec.isolating || $to.node(d).type.spec.isolating) break;
			if (start == $to.start(d) || d == $from.depth && d == $to.depth && $from.parent.inlineContent && $to.parent.inlineContent && d && $to.start(d - 1) == start - 1) result.push(d);
		}
		return result;
	}
	/**
	Update an attribute in a specific node.
	*/
	var AttrStep = class AttrStep extends Step {
		/**
		Construct an attribute step.
		*/
		constructor(pos, attr, value) {
			super();
			this.pos = pos;
			this.attr = attr;
			this.value = value;
		}
		apply(doc) {
			let node = doc.nodeAt(this.pos);
			if (!node) return StepResult.fail("No node at attribute step's position");
			let attrs = Object.create(null);
			for (let name in node.attrs) attrs[name] = node.attrs[name];
			attrs[this.attr] = this.value;
			let updated = node.type.create(attrs, null, node.marks);
			return StepResult.fromReplace(doc, this.pos, this.pos + 1, new Slice(Fragment$1.from(updated), 0, node.isLeaf ? 0 : 1));
		}
		getMap() {
			return StepMap.empty;
		}
		invert(doc) {
			return new AttrStep(this.pos, this.attr, doc.nodeAt(this.pos).attrs[this.attr]);
		}
		map(mapping) {
			let pos = mapping.mapResult(this.pos, 1);
			return pos.deletedAfter ? null : new AttrStep(pos.pos, this.attr, this.value);
		}
		toJSON() {
			return {
				stepType: "attr",
				pos: this.pos,
				attr: this.attr,
				value: this.value
			};
		}
		static fromJSON(schema, json) {
			if (typeof json.pos != "number" || typeof json.attr != "string") throw new RangeError("Invalid input for AttrStep.fromJSON");
			return new AttrStep(json.pos, json.attr, json.value);
		}
	};
	Step.jsonID("attr", AttrStep);
	/**
	Update an attribute in the doc node.
	*/
	var DocAttrStep = class DocAttrStep extends Step {
		/**
		Construct an attribute step.
		*/
		constructor(attr, value) {
			super();
			this.attr = attr;
			this.value = value;
		}
		apply(doc) {
			let attrs = Object.create(null);
			for (let name in doc.attrs) attrs[name] = doc.attrs[name];
			attrs[this.attr] = this.value;
			let updated = doc.type.create(attrs, doc.content, doc.marks);
			return StepResult.ok(updated);
		}
		getMap() {
			return StepMap.empty;
		}
		invert(doc) {
			return new DocAttrStep(this.attr, doc.attrs[this.attr]);
		}
		map(mapping) {
			return this;
		}
		toJSON() {
			return {
				stepType: "docAttr",
				attr: this.attr,
				value: this.value
			};
		}
		static fromJSON(schema, json) {
			if (typeof json.attr != "string") throw new RangeError("Invalid input for DocAttrStep.fromJSON");
			return new DocAttrStep(json.attr, json.value);
		}
	};
	Step.jsonID("docAttr", DocAttrStep);
	/**
	@internal
	*/
	var TransformError = class extends Error {};
	TransformError = function TransformError(message) {
		let err = Error.call(this, message);
		err.__proto__ = TransformError.prototype;
		return err;
	};
	TransformError.prototype = Object.create(Error.prototype);
	TransformError.prototype.constructor = TransformError;
	TransformError.prototype.name = "TransformError";
	/**
	Abstraction to build up and track an array of
	[steps](https://prosemirror.net/docs/ref/#transform.Step) representing a document transformation.
	
	Most transforming methods return the `Transform` object itself, so
	that they can be chained.
	*/
	var Transform = class {
		/**
		Create a transform that starts with the given document.
		*/
		constructor(doc) {
			this.doc = doc;
			/**
			The steps in this transform.
			*/
			this.steps = [];
			/**
			The documents before each of the steps.
			*/
			this.docs = [];
			/**
			A mapping with the maps for each of the steps in this transform.
			*/
			this.mapping = new Mapping();
		}
		/**
		The starting document.
		*/
		get before() {
			return this.docs.length ? this.docs[0] : this.doc;
		}
		/**
		Apply a new step in this transform, saving the result. Throws an
		error when the step fails.
		*/
		step(step) {
			let result = this.maybeStep(step);
			if (result.failed) throw new TransformError(result.failed);
			return this;
		}
		/**
		Try to apply a step in this transformation, ignoring it if it
		fails. Returns the step result.
		*/
		maybeStep(step) {
			let result = step.apply(this.doc);
			if (!result.failed) this.addStep(step, result.doc);
			return result;
		}
		/**
		True when the document has been changed (when there are any
		steps).
		*/
		get docChanged() {
			return this.steps.length > 0;
		}
		/**
		Return a single range, in post-transform document positions,
		that covers all content changed by this transform. Returns null
		if no replacements are made. Note that this will ignore changes
		that add/remove marks without replacing the underlying content.
		*/
		changedRange() {
			let from = 1e9;
			let to = -1e9;
			for (let i = 0; i < this.mapping.maps.length; i++) {
				let map = this.mapping.maps[i];
				if (i) {
					from = map.map(from, 1);
					to = map.map(to, -1);
				}
				map.forEach((_f, _t, fromB, toB) => {
					from = Math.min(from, fromB);
					to = Math.max(to, toB);
				});
			}
			return from == 1e9 ? null : {
				from,
				to
			};
		}
		/**
		@internal
		*/
		addStep(step, doc) {
			this.docs.push(this.doc);
			this.steps.push(step);
			this.mapping.appendMap(step.getMap());
			this.doc = doc;
		}
		/**
		Replace the part of the document between `from` and `to` with the
		given `slice`.
		*/
		replace(from, to = from, slice = Slice.empty) {
			let step = replaceStep(this.doc, from, to, slice);
			if (step) this.step(step);
			return this;
		}
		/**
		Replace the given range with the given content, which may be a
		fragment, node, or array of nodes.
		*/
		replaceWith(from, to, content) {
			return this.replace(from, to, new Slice(Fragment$1.from(content), 0, 0));
		}
		/**
		Delete the content between the given positions.
		*/
		delete(from, to) {
			return this.replace(from, to, Slice.empty);
		}
		/**
		Insert the given content at the given position.
		*/
		insert(pos, content) {
			return this.replaceWith(pos, pos, content);
		}
		/**
		Replace a range of the document with a given slice, using
		`from`, `to`, and the slice's
		[`openStart`](https://prosemirror.net/docs/ref/#model.Slice.openStart) property as hints, rather
		than fixed start and end points. This method may grow the
		replaced area or close open nodes in the slice in order to get a
		fit that is more in line with WYSIWYG expectations, by dropping
		fully covered parent nodes of the replaced region when they are
		marked [non-defining as
		context](https://prosemirror.net/docs/ref/#model.NodeSpec.definingAsContext), or including an
		open parent node from the slice that _is_ marked as [defining
		its content](https://prosemirror.net/docs/ref/#model.NodeSpec.definingForContent).
		
		This is the method, for example, to handle paste. The similar
		[`replace`](https://prosemirror.net/docs/ref/#transform.Transform.replace) method is a more
		primitive tool which will _not_ move the start and end of its given
		range, and is useful in situations where you need more precise
		control over what happens.
		*/
		replaceRange(from, to, slice) {
			replaceRange(this, from, to, slice);
			return this;
		}
		/**
		Replace the given range with a node, but use `from` and `to` as
		hints, rather than precise positions. When from and to are the same
		and are at the start or end of a parent node in which the given
		node doesn't fit, this method may _move_ them out towards a parent
		that does allow the given node to be placed. When the given range
		completely covers a parent node, this method may completely replace
		that parent node.
		*/
		replaceRangeWith(from, to, node) {
			replaceRangeWith(this, from, to, node);
			return this;
		}
		/**
		Delete the given range, expanding it to cover fully covered
		parent nodes until a valid replace is found.
		*/
		deleteRange(from, to) {
			deleteRange$1(this, from, to);
			return this;
		}
		/**
		Split the content in the given range off from its parent, if there
		is sibling content before or after it, and move it up the tree to
		the depth specified by `target`. You'll probably want to use
		[`liftTarget`](https://prosemirror.net/docs/ref/#transform.liftTarget) to compute `target`, to make
		sure the lift is valid.
		*/
		lift(range, target) {
			lift$2(this, range, target);
			return this;
		}
		/**
		Join the blocks around the given position. If depth is 2, their
		last and first siblings are also joined, and so on.
		*/
		join(pos, depth = 1) {
			join(this, pos, depth);
			return this;
		}
		/**
		Wrap the given [range](https://prosemirror.net/docs/ref/#model.NodeRange) in the given set of wrappers.
		The wrappers are assumed to be valid in this position, and should
		probably be computed with [`findWrapping`](https://prosemirror.net/docs/ref/#transform.findWrapping).
		*/
		wrap(range, wrappers) {
			wrap(this, range, wrappers);
			return this;
		}
		/**
		Set the type of all textblocks (partly) between `from` and `to` to
		the given node type with the given attributes.
		*/
		setBlockType(from, to = from, type, attrs = null) {
			setBlockType$1(this, from, to, type, attrs);
			return this;
		}
		/**
		Change the type, attributes, and/or marks of the node at `pos`.
		When `type` isn't given, the existing node type is preserved,
		*/
		setNodeMarkup(pos, type, attrs = null, marks) {
			setNodeMarkup(this, pos, type, attrs, marks);
			return this;
		}
		/**
		Set a single attribute on a given node to a new value.
		The `pos` addresses the document content. Use `setDocAttribute`
		to set attributes on the document itself.
		*/
		setNodeAttribute(pos, attr, value) {
			this.step(new AttrStep(pos, attr, value));
			return this;
		}
		/**
		Set a single attribute on the document to a new value.
		*/
		setDocAttribute(attr, value) {
			this.step(new DocAttrStep(attr, value));
			return this;
		}
		/**
		Add a mark to the node at position `pos`.
		*/
		addNodeMark(pos, mark) {
			this.step(new AddNodeMarkStep(pos, mark));
			return this;
		}
		/**
		Remove a mark (or all marks of the given type) from the node at
		position `pos`.
		*/
		removeNodeMark(pos, mark) {
			let node = this.doc.nodeAt(pos);
			if (!node) throw new RangeError("No node at position " + pos);
			if (mark instanceof Mark$1) {
				if (mark.isInSet(node.marks)) this.step(new RemoveNodeMarkStep(pos, mark));
			} else {
				let set = node.marks;
				let found;
				let steps = [];
				while (found = mark.isInSet(set)) {
					steps.push(new RemoveNodeMarkStep(pos, found));
					set = found.removeFromSet(set);
				}
				for (let i = steps.length - 1; i >= 0; i--) this.step(steps[i]);
			}
			return this;
		}
		/**
		Split the node at the given position, and optionally, if `depth` is
		greater than one, any number of nodes above that. By default, the
		parts split off will inherit the node type of the original node.
		This can be changed by passing an array of types and attributes to
		use after the split (with the outermost nodes coming first).
		*/
		split(pos, depth = 1, typesAfter) {
			split(this, pos, depth, typesAfter);
			return this;
		}
		/**
		Add the given mark to the inline content between `from` and `to`.
		*/
		addMark(from, to, mark) {
			addMark(this, from, to, mark);
			return this;
		}
		/**
		Remove marks from inline nodes between `from` and `to`. When
		`mark` is a single mark, remove precisely that mark. When it is
		a mark type, remove all marks of that type. When it is null,
		remove all marks of any type.
		*/
		removeMark(from, to, mark) {
			removeMark(this, from, to, mark);
			return this;
		}
		/**
		Removes all marks and nodes from the content of the node at
		`pos` that don't match the given new parent node type. Accepts
		an optional starting [content match](https://prosemirror.net/docs/ref/#model.ContentMatch) as
		third argument.
		*/
		clearIncompatible(pos, parentType, match) {
			clearIncompatible(this, pos, parentType, match);
			return this;
		}
	};

//#endregion
//#region node_modules/prosemirror-state/dist/index.js
	var classesById = Object.create(null);
	/**
	Superclass for editor selections. Every selection type should
	extend this. Should not be instantiated directly.
	*/
	var Selection = class {
		/**
		Initialize a selection with the head and anchor and ranges. If no
		ranges are given, constructs a single range across `$anchor` and
		`$head`.
		*/
		constructor($anchor, $head, ranges) {
			this.$anchor = $anchor;
			this.$head = $head;
			this.ranges = ranges || [new SelectionRange($anchor.min($head), $anchor.max($head))];
		}
		/**
		The selection's anchor, as an unresolved position.
		*/
		get anchor() {
			return this.$anchor.pos;
		}
		/**
		The selection's head.
		*/
		get head() {
			return this.$head.pos;
		}
		/**
		The lower bound of the selection's main range.
		*/
		get from() {
			return this.$from.pos;
		}
		/**
		The upper bound of the selection's main range.
		*/
		get to() {
			return this.$to.pos;
		}
		/**
		The resolved lower  bound of the selection's main range.
		*/
		get $from() {
			return this.ranges[0].$from;
		}
		/**
		The resolved upper bound of the selection's main range.
		*/
		get $to() {
			return this.ranges[0].$to;
		}
		/**
		Indicates whether the selection contains any content.
		*/
		get empty() {
			let ranges = this.ranges;
			for (let i = 0; i < ranges.length; i++) if (ranges[i].$from.pos != ranges[i].$to.pos) return false;
			return true;
		}
		/**
		Get the content of this selection as a slice.
		*/
		content() {
			return this.$from.doc.slice(this.from, this.to, true);
		}
		/**
		Replace the selection with a slice or, if no slice is given,
		delete the selection. Will append to the given transaction.
		*/
		replace(tr, content = Slice.empty) {
			let lastNode = content.content.lastChild;
			let lastParent = null;
			for (let i = 0; i < content.openEnd; i++) {
				lastParent = lastNode;
				lastNode = lastNode.lastChild;
			}
			let mapFrom = tr.steps.length;
			let ranges = this.ranges;
			for (let i = 0; i < ranges.length; i++) {
				let { $from, $to } = ranges[i], mapping = tr.mapping.slice(mapFrom);
				tr.replaceRange(mapping.map($from.pos), mapping.map($to.pos), i ? Slice.empty : content);
				if (i == 0) selectionToInsertionEnd$1(tr, mapFrom, (lastNode ? lastNode.isInline : lastParent && lastParent.isTextblock) ? -1 : 1);
			}
		}
		/**
		Replace the selection with the given node, appending the changes
		to the given transaction.
		*/
		replaceWith(tr, node) {
			let mapFrom = tr.steps.length;
			let ranges = this.ranges;
			for (let i = 0; i < ranges.length; i++) {
				let { $from, $to } = ranges[i], mapping = tr.mapping.slice(mapFrom);
				let from = mapping.map($from.pos);
				let to = mapping.map($to.pos);
				if (i) tr.deleteRange(from, to);
				else {
					tr.replaceRangeWith(from, to, node);
					selectionToInsertionEnd$1(tr, mapFrom, node.isInline ? -1 : 1);
				}
			}
		}
		/**
		Find a valid cursor or leaf node selection starting at the given
		position and searching back if `dir` is negative, and forward if
		positive. When `textOnly` is true, only consider cursor
		selections. Will return null when no valid selection position is
		found.
		*/
		static findFrom($pos, dir, textOnly = false) {
			let inner = $pos.parent.inlineContent ? new TextSelection($pos) : findSelectionIn($pos.node(0), $pos.parent, $pos.pos, $pos.index(), dir, textOnly);
			if (inner) return inner;
			for (let depth = $pos.depth - 1; depth >= 0; depth--) {
				let found = dir < 0 ? findSelectionIn($pos.node(0), $pos.node(depth), $pos.before(depth + 1), $pos.index(depth), dir, textOnly) : findSelectionIn($pos.node(0), $pos.node(depth), $pos.after(depth + 1), $pos.index(depth) + 1, dir, textOnly);
				if (found) return found;
			}
			return null;
		}
		/**
		Find a valid cursor or leaf node selection near the given
		position. Searches forward first by default, but if `bias` is
		negative, it will search backwards first.
		*/
		static near($pos, bias = 1) {
			return this.findFrom($pos, bias) || this.findFrom($pos, -bias) || new AllSelection($pos.node(0));
		}
		/**
		Find the cursor or leaf node selection closest to the start of
		the given document. Will return an
		[`AllSelection`](https://prosemirror.net/docs/ref/#state.AllSelection) if no valid position
		exists.
		*/
		static atStart(doc) {
			return findSelectionIn(doc, doc, 0, 0, 1) || new AllSelection(doc);
		}
		/**
		Find the cursor or leaf node selection closest to the end of the
		given document.
		*/
		static atEnd(doc) {
			return findSelectionIn(doc, doc, doc.content.size, doc.childCount, -1) || new AllSelection(doc);
		}
		/**
		Deserialize the JSON representation of a selection. Must be
		implemented for custom classes (as a static class method).
		*/
		static fromJSON(doc, json) {
			if (!json || !json.type) throw new RangeError("Invalid input for Selection.fromJSON");
			let cls = classesById[json.type];
			if (!cls) throw new RangeError(`No selection type ${json.type} defined`);
			return cls.fromJSON(doc, json);
		}
		/**
		To be able to deserialize selections from JSON, custom selection
		classes must register themselves with an ID string, so that they
		can be disambiguated. Try to pick something that's unlikely to
		clash with classes from other modules.
		*/
		static jsonID(id, selectionClass) {
			if (id in classesById) throw new RangeError("Duplicate use of selection JSON ID " + id);
			classesById[id] = selectionClass;
			selectionClass.prototype.jsonID = id;
			return selectionClass;
		}
		/**
		Get a [bookmark](https://prosemirror.net/docs/ref/#state.SelectionBookmark) for this selection,
		which is a value that can be mapped without having access to a
		current document, and later resolved to a real selection for a
		given document again. (This is used mostly by the history to
		track and restore old selections.) The default implementation of
		this method just converts the selection to a text selection and
		returns the bookmark for that.
		*/
		getBookmark() {
			return TextSelection.between(this.$anchor, this.$head).getBookmark();
		}
	};
	Selection.prototype.visible = true;
	/**
	Represents a selected range in a document.
	*/
	var SelectionRange = class {
		/**
		Create a range.
		*/
		constructor($from, $to) {
			this.$from = $from;
			this.$to = $to;
		}
	};
	var warnedAboutTextSelection = false;
	function checkTextSelection($pos) {
		if (!warnedAboutTextSelection && !$pos.parent.inlineContent) {
			warnedAboutTextSelection = true;
			console["warn"]("TextSelection endpoint not pointing into a node with inline content (" + $pos.parent.type.name + ")");
		}
	}
	/**
	A text selection represents a classical editor selection, with a
	head (the moving side) and anchor (immobile side), both of which
	point into textblock nodes. It can be empty (a regular cursor
	position).
	*/
	var TextSelection = class TextSelection extends Selection {
		/**
		Construct a text selection between the given points.
		*/
		constructor($anchor, $head = $anchor) {
			checkTextSelection($anchor);
			checkTextSelection($head);
			super($anchor, $head);
		}
		/**
		Returns a resolved position if this is a cursor selection (an
		empty text selection), and null otherwise.
		*/
		get $cursor() {
			return this.$anchor.pos == this.$head.pos ? this.$head : null;
		}
		map(doc, mapping) {
			let $head = doc.resolve(mapping.map(this.head));
			if (!$head.parent.inlineContent) return Selection.near($head);
			let $anchor = doc.resolve(mapping.map(this.anchor));
			return new TextSelection($anchor.parent.inlineContent ? $anchor : $head, $head);
		}
		replace(tr, content = Slice.empty) {
			super.replace(tr, content);
			if (content == Slice.empty) {
				let marks = this.$from.marksAcross(this.$to);
				if (marks) tr.ensureMarks(marks);
			}
		}
		eq(other) {
			return other instanceof TextSelection && other.anchor == this.anchor && other.head == this.head;
		}
		getBookmark() {
			return new TextBookmark(this.anchor, this.head);
		}
		toJSON() {
			return {
				type: "text",
				anchor: this.anchor,
				head: this.head
			};
		}
		/**
		@internal
		*/
		static fromJSON(doc, json) {
			if (typeof json.anchor != "number" || typeof json.head != "number") throw new RangeError("Invalid input for TextSelection.fromJSON");
			return new TextSelection(doc.resolve(json.anchor), doc.resolve(json.head));
		}
		/**
		Create a text selection from non-resolved positions.
		*/
		static create(doc, anchor, head = anchor) {
			let $anchor = doc.resolve(anchor);
			return new this($anchor, head == anchor ? $anchor : doc.resolve(head));
		}
		/**
		Return a text selection that spans the given positions or, if
		they aren't text positions, find a text selection near them.
		`bias` determines whether the method searches forward (default)
		or backwards (negative number) first. Will fall back to calling
		[`Selection.near`](https://prosemirror.net/docs/ref/#state.Selection^near) when the document
		doesn't contain a valid text position.
		*/
		static between($anchor, $head, bias) {
			let dPos = $anchor.pos - $head.pos;
			if (!bias || dPos) bias = dPos >= 0 ? 1 : -1;
			if (!$head.parent.inlineContent) {
				let found = Selection.findFrom($head, bias, true) || Selection.findFrom($head, -bias, true);
				if (found) $head = found.$head;
				else return Selection.near($head, bias);
			}
			if (!$anchor.parent.inlineContent) if (dPos == 0) $anchor = $head;
			else {
				$anchor = (Selection.findFrom($anchor, -bias, true) || Selection.findFrom($anchor, bias, true)).$anchor;
				if ($anchor.pos < $head.pos != dPos < 0) $anchor = $head;
			}
			return new TextSelection($anchor, $head);
		}
	};
	Selection.jsonID("text", TextSelection);
	var TextBookmark = class TextBookmark {
		constructor(anchor, head) {
			this.anchor = anchor;
			this.head = head;
		}
		map(mapping) {
			return new TextBookmark(mapping.map(this.anchor), mapping.map(this.head));
		}
		resolve(doc) {
			return TextSelection.between(doc.resolve(this.anchor), doc.resolve(this.head));
		}
	};
	/**
	A node selection is a selection that points at a single node. All
	nodes marked [selectable](https://prosemirror.net/docs/ref/#model.NodeSpec.selectable) can be the
	target of a node selection. In such a selection, `from` and `to`
	point directly before and after the selected node, `anchor` equals
	`from`, and `head` equals `to`..
	*/
	var NodeSelection = class NodeSelection extends Selection {
		/**
		Create a node selection. Does not verify the validity of its
		argument.
		*/
		constructor($pos) {
			let node = $pos.nodeAfter;
			let $end = $pos.node(0).resolve($pos.pos + node.nodeSize);
			super($pos, $end);
			this.node = node;
		}
		map(doc, mapping) {
			let { deleted, pos } = mapping.mapResult(this.anchor);
			let $pos = doc.resolve(pos);
			if (deleted) return Selection.near($pos);
			return new NodeSelection($pos);
		}
		content() {
			return new Slice(Fragment$1.from(this.node), 0, 0);
		}
		eq(other) {
			return other instanceof NodeSelection && other.anchor == this.anchor;
		}
		toJSON() {
			return {
				type: "node",
				anchor: this.anchor
			};
		}
		getBookmark() {
			return new NodeBookmark(this.anchor);
		}
		/**
		@internal
		*/
		static fromJSON(doc, json) {
			if (typeof json.anchor != "number") throw new RangeError("Invalid input for NodeSelection.fromJSON");
			return new NodeSelection(doc.resolve(json.anchor));
		}
		/**
		Create a node selection from non-resolved positions.
		*/
		static create(doc, from) {
			return new NodeSelection(doc.resolve(from));
		}
		/**
		Determines whether the given node may be selected as a node
		selection.
		*/
		static isSelectable(node) {
			return !node.isText && node.type.spec.selectable !== false;
		}
	};
	NodeSelection.prototype.visible = false;
	Selection.jsonID("node", NodeSelection);
	var NodeBookmark = class NodeBookmark {
		constructor(anchor) {
			this.anchor = anchor;
		}
		map(mapping) {
			let { deleted, pos } = mapping.mapResult(this.anchor);
			return deleted ? new TextBookmark(pos, pos) : new NodeBookmark(pos);
		}
		resolve(doc) {
			let $pos = doc.resolve(this.anchor);
			let node = $pos.nodeAfter;
			if (node && NodeSelection.isSelectable(node)) return new NodeSelection($pos);
			return Selection.near($pos);
		}
	};
	/**
	A selection type that represents selecting the whole document
	(which can not necessarily be expressed with a text selection, when
	there are for example leaf block nodes at the start or end of the
	document).
	*/
	var AllSelection = class AllSelection extends Selection {
		/**
		Create an all-selection over the given document.
		*/
		constructor(doc) {
			super(doc.resolve(0), doc.resolve(doc.content.size));
		}
		replace(tr, content = Slice.empty) {
			if (content == Slice.empty) {
				tr.delete(0, tr.doc.content.size);
				let sel = Selection.atStart(tr.doc);
				if (!sel.eq(tr.selection)) tr.setSelection(sel);
			} else super.replace(tr, content);
		}
		toJSON() {
			return { type: "all" };
		}
		/**
		@internal
		*/
		static fromJSON(doc) {
			return new AllSelection(doc);
		}
		map(doc) {
			return new AllSelection(doc);
		}
		eq(other) {
			return other instanceof AllSelection;
		}
		getBookmark() {
			return AllBookmark;
		}
	};
	Selection.jsonID("all", AllSelection);
	var AllBookmark = {
		map() {
			return this;
		},
		resolve(doc) {
			return new AllSelection(doc);
		}
	};
	function findSelectionIn(doc, node, pos, index, dir, text = false) {
		if (node.inlineContent) return TextSelection.create(doc, pos);
		for (let i = index - (dir > 0 ? 0 : 1); dir > 0 ? i < node.childCount : i >= 0; i += dir) {
			let child = node.child(i);
			if (!child.isAtom) {
				let inner = findSelectionIn(doc, child, pos + dir, dir < 0 ? child.childCount : 0, dir, text);
				if (inner) return inner;
			} else if (!text && NodeSelection.isSelectable(child)) return NodeSelection.create(doc, pos - (dir < 0 ? child.nodeSize : 0));
			pos += child.nodeSize * dir;
		}
		return null;
	}
	function selectionToInsertionEnd$1(tr, startLen, bias) {
		let last = tr.steps.length - 1;
		if (last < startLen) return;
		let step = tr.steps[last];
		if (!(step instanceof ReplaceStep || step instanceof ReplaceAroundStep)) return;
		let map = tr.mapping.maps[last];
		let end;
		map.forEach((_from, _to, _newFrom, newTo) => {
			if (end == null) end = newTo;
		});
		tr.setSelection(Selection.near(tr.doc.resolve(end), bias));
	}
	__name(selectionToInsertionEnd$1, "selectionToInsertionEnd");
	var UPDATED_SEL = 1;
	var UPDATED_MARKS = 2;
	var UPDATED_SCROLL = 4;
	/**
	An editor state transaction, which can be applied to a state to
	create an updated state. Use
	[`EditorState.tr`](https://prosemirror.net/docs/ref/#state.EditorState.tr) to create an instance.
	
	Transactions track changes to the document (they are a subclass of
	[`Transform`](https://prosemirror.net/docs/ref/#transform.Transform)), but also other state changes,
	like selection updates and adjustments of the set of [stored
	marks](https://prosemirror.net/docs/ref/#state.EditorState.storedMarks). In addition, you can store
	metadata properties in a transaction, which are extra pieces of
	information that client code or plugins can use to describe what a
	transaction represents, so that they can update their [own
	state](https://prosemirror.net/docs/ref/#state.StateField) accordingly.
	
	The [editor view](https://prosemirror.net/docs/ref/#view.EditorView) uses a few metadata
	properties: it will attach a property `"pointer"` with the value
	`true` to selection transactions directly caused by mouse or touch
	input, a `"composition"` property holding an ID identifying the
	composition that caused it to transactions caused by composed DOM
	input, and a `"uiEvent"` property of that may be `"paste"`,
	`"cut"`, or `"drop"`.
	*/
	var Transaction = class extends Transform {
		/**
		@internal
		*/
		constructor(state) {
			super(state.doc);
			this.curSelectionFor = 0;
			this.updated = 0;
			this.meta = Object.create(null);
			this.time = Date.now();
			this.curSelection = state.selection;
			this.storedMarks = state.storedMarks;
		}
		/**
		The transaction's current selection. This defaults to the editor
		selection [mapped](https://prosemirror.net/docs/ref/#state.Selection.map) through the steps in the
		transaction, but can be overwritten with
		[`setSelection`](https://prosemirror.net/docs/ref/#state.Transaction.setSelection).
		*/
		get selection() {
			if (this.curSelectionFor < this.steps.length) {
				this.curSelection = this.curSelection.map(this.doc, this.mapping.slice(this.curSelectionFor));
				this.curSelectionFor = this.steps.length;
			}
			return this.curSelection;
		}
		/**
		Update the transaction's current selection. Will determine the
		selection that the editor gets when the transaction is applied.
		*/
		setSelection(selection) {
			if (selection.$from.doc != this.doc) throw new RangeError("Selection passed to setSelection must point at the current document");
			this.curSelection = selection;
			this.curSelectionFor = this.steps.length;
			this.updated = (this.updated | UPDATED_SEL) & -3;
			this.storedMarks = null;
			return this;
		}
		/**
		Whether the selection was explicitly updated by this transaction.
		*/
		get selectionSet() {
			return (this.updated & UPDATED_SEL) > 0;
		}
		/**
		Set the current stored marks.
		*/
		setStoredMarks(marks) {
			this.storedMarks = marks;
			this.updated |= UPDATED_MARKS;
			return this;
		}
		/**
		Make sure the current stored marks or, if that is null, the marks
		at the selection, match the given set of marks. Does nothing if
		this is already the case.
		*/
		ensureMarks(marks) {
			if (!Mark$1.sameSet(this.storedMarks || this.selection.$from.marks(), marks)) this.setStoredMarks(marks);
			return this;
		}
		/**
		Add a mark to the set of stored marks.
		*/
		addStoredMark(mark) {
			return this.ensureMarks(mark.addToSet(this.storedMarks || this.selection.$head.marks()));
		}
		/**
		Remove a mark or mark type from the set of stored marks.
		*/
		removeStoredMark(mark) {
			return this.ensureMarks(mark.removeFromSet(this.storedMarks || this.selection.$head.marks()));
		}
		/**
		Whether the stored marks were explicitly set for this transaction.
		*/
		get storedMarksSet() {
			return (this.updated & UPDATED_MARKS) > 0;
		}
		/**
		@internal
		*/
		addStep(step, doc) {
			super.addStep(step, doc);
			this.updated = this.updated & -3;
			this.storedMarks = null;
		}
		/**
		Update the timestamp for the transaction.
		*/
		setTime(time) {
			this.time = time;
			return this;
		}
		/**
		Replace the current selection with the given slice.
		*/
		replaceSelection(slice) {
			this.selection.replace(this, slice);
			return this;
		}
		/**
		Replace the selection with the given node. When `inheritMarks` is
		true and the content is inline, it inherits the marks from the
		place where it is inserted.
		*/
		replaceSelectionWith(node, inheritMarks = true) {
			let selection = this.selection;
			if (inheritMarks) node = node.mark(this.storedMarks || (selection.empty ? selection.$from.marks() : selection.$from.marksAcross(selection.$to) || Mark$1.none));
			selection.replaceWith(this, node);
			return this;
		}
		/**
		Delete the selection.
		*/
		deleteSelection() {
			this.selection.replace(this);
			return this;
		}
		/**
		Replace the given range, or the selection if no range is given,
		with a text node containing the given string.
		*/
		insertText(text, from, to) {
			let schema = this.doc.type.schema;
			if (from == null) {
				if (!text) return this.deleteSelection();
				return this.replaceSelectionWith(schema.text(text), true);
			} else {
				if (to == null) to = from;
				if (!text) return this.deleteRange(from, to);
				let marks = this.storedMarks;
				if (!marks) {
					let $from = this.doc.resolve(from);
					marks = to == from ? $from.marks() : $from.marksAcross(this.doc.resolve(to));
				}
				this.replaceRangeWith(from, to, schema.text(text, marks));
				if (!this.selection.empty && this.selection.to == from + text.length) this.setSelection(Selection.near(this.selection.$to));
				return this;
			}
		}
		/**
		Store a metadata property in this transaction, keyed either by
		name or by plugin.
		*/
		setMeta(key, value) {
			this.meta[typeof key == "string" ? key : key.key] = value;
			return this;
		}
		/**
		Retrieve a metadata property for a given name or plugin.
		*/
		getMeta(key) {
			return this.meta[typeof key == "string" ? key : key.key];
		}
		/**
		Returns true if this transaction doesn't contain any metadata,
		and can thus safely be extended.
		*/
		get isGeneric() {
			for (let _ in this.meta) return false;
			return true;
		}
		/**
		Indicate that the editor should scroll the selection into view
		when updated to the state produced by this transaction.
		*/
		scrollIntoView() {
			this.updated |= UPDATED_SCROLL;
			return this;
		}
		/**
		True when this transaction has had `scrollIntoView` called on it.
		*/
		get scrolledIntoView() {
			return (this.updated & UPDATED_SCROLL) > 0;
		}
	};
	function bind(f, self) {
		return !self || !f ? f : f.bind(self);
	}
	var FieldDesc = class {
		constructor(name, desc, self) {
			this.name = name;
			this.init = bind(desc.init, self);
			this.apply = bind(desc.apply, self);
		}
	};
	var baseFields = [
		new FieldDesc("doc", {
			init(config) {
				return config.doc || config.schema.topNodeType.createAndFill();
			},
			apply(tr) {
				return tr.doc;
			}
		}),
		new FieldDesc("selection", {
			init(config, instance) {
				return config.selection || Selection.atStart(instance.doc);
			},
			apply(tr) {
				return tr.selection;
			}
		}),
		new FieldDesc("storedMarks", {
			init(config) {
				return config.storedMarks || null;
			},
			apply(tr, _marks, _old, state) {
				return state.selection.$cursor ? tr.storedMarks : null;
			}
		}),
		new FieldDesc("scrollToSelection", {
			init() {
				return 0;
			},
			apply(tr, prev) {
				return tr.scrolledIntoView ? prev + 1 : prev;
			}
		})
	];
	var Configuration = class {
		constructor(schema, plugins) {
			this.schema = schema;
			this.plugins = [];
			this.pluginsByKey = Object.create(null);
			this.fields = baseFields.slice();
			if (plugins) plugins.forEach((plugin) => {
				if (this.pluginsByKey[plugin.key]) throw new RangeError("Adding different instances of a keyed plugin (" + plugin.key + ")");
				this.plugins.push(plugin);
				this.pluginsByKey[plugin.key] = plugin;
				if (plugin.spec.state) this.fields.push(new FieldDesc(plugin.key, plugin.spec.state, plugin));
			});
		}
	};
	/**
	The state of a ProseMirror editor is represented by an object of
	this type. A state is a persistent data structure—it isn't
	updated, but rather a new state value is computed from an old one
	using the [`apply`](https://prosemirror.net/docs/ref/#state.EditorState.apply) method.
	
	A state holds a number of built-in fields, and plugins can
	[define](https://prosemirror.net/docs/ref/#state.PluginSpec.state) additional fields.
	*/
	var EditorState = class EditorState {
		/**
		@internal
		*/
		constructor(config) {
			this.config = config;
		}
		/**
		The schema of the state's document.
		*/
		get schema() {
			return this.config.schema;
		}
		/**
		The plugins that are active in this state.
		*/
		get plugins() {
			return this.config.plugins;
		}
		/**
		Apply the given transaction to produce a new state.
		*/
		apply(tr) {
			return this.applyTransaction(tr).state;
		}
		/**
		@internal
		*/
		filterTransaction(tr, ignore = -1) {
			for (let i = 0; i < this.config.plugins.length; i++) if (i != ignore) {
				let plugin = this.config.plugins[i];
				if (plugin.spec.filterTransaction && !plugin.spec.filterTransaction.call(plugin, tr, this)) return false;
			}
			return true;
		}
		/**
		Verbose variant of [`apply`](https://prosemirror.net/docs/ref/#state.EditorState.apply) that
		returns the precise transactions that were applied (which might
		be influenced by the [transaction
		hooks](https://prosemirror.net/docs/ref/#state.PluginSpec.filterTransaction) of
		plugins) along with the new state.
		*/
		applyTransaction(rootTr) {
			if (!this.filterTransaction(rootTr)) return {
				state: this,
				transactions: []
			};
			let trs = [rootTr];
			let newState = this.applyInner(rootTr);
			let seen = null;
			for (;;) {
				let haveNew = false;
				for (let i = 0; i < this.config.plugins.length; i++) {
					let plugin = this.config.plugins[i];
					if (plugin.spec.appendTransaction) {
						let n = seen ? seen[i].n : 0;
						let oldState = seen ? seen[i].state : this;
						let tr = n < trs.length && plugin.spec.appendTransaction.call(plugin, n ? trs.slice(n) : trs, oldState, newState);
						if (tr && newState.filterTransaction(tr, i)) {
							tr.setMeta("appendedTransaction", rootTr);
							if (!seen) {
								seen = [];
								for (let j = 0; j < this.config.plugins.length; j++) seen.push(j < i ? {
									state: newState,
									n: trs.length
								} : {
									state: this,
									n: 0
								});
							}
							trs.push(tr);
							newState = newState.applyInner(tr);
							haveNew = true;
						}
						if (seen) seen[i] = {
							state: newState,
							n: trs.length
						};
					}
				}
				if (!haveNew) return {
					state: newState,
					transactions: trs
				};
			}
		}
		/**
		@internal
		*/
		applyInner(tr) {
			if (!tr.before.eq(this.doc)) throw new RangeError("Applying a mismatched transaction");
			let newInstance = new EditorState(this.config);
			let fields = this.config.fields;
			for (let i = 0; i < fields.length; i++) {
				let field = fields[i];
				newInstance[field.name] = field.apply(tr, this[field.name], this, newInstance);
			}
			return newInstance;
		}
		/**
		Accessor that constructs and returns a new [transaction](https://prosemirror.net/docs/ref/#state.Transaction) from this state.
		*/
		get tr() {
			return new Transaction(this);
		}
		/**
		Create a new state.
		*/
		static create(config) {
			let $config = new Configuration(config.doc ? config.doc.type.schema : config.schema, config.plugins);
			let instance = new EditorState($config);
			for (let i = 0; i < $config.fields.length; i++) instance[$config.fields[i].name] = $config.fields[i].init(config, instance);
			return instance;
		}
		/**
		Create a new state based on this one, but with an adjusted set
		of active plugins. State fields that exist in both sets of
		plugins are kept unchanged. Those that no longer exist are
		dropped, and those that are new are initialized using their
		[`init`](https://prosemirror.net/docs/ref/#state.StateField.init) method, passing in the new
		configuration object..
		*/
		reconfigure(config) {
			let $config = new Configuration(this.schema, config.plugins);
			let fields = $config.fields;
			let instance = new EditorState($config);
			for (let i = 0; i < fields.length; i++) {
				let name = fields[i].name;
				instance[name] = this.hasOwnProperty(name) ? this[name] : fields[i].init(config, instance);
			}
			return instance;
		}
		/**
		Serialize this state to JSON. If you want to serialize the state
		of plugins, pass an object mapping property names to use in the
		resulting JSON object to plugin objects. The argument may also be
		a string or number, in which case it is ignored, to support the
		way `JSON.stringify` calls `toString` methods.
		*/
		toJSON(pluginFields) {
			let result = {
				doc: this.doc.toJSON(),
				selection: this.selection.toJSON()
			};
			if (this.storedMarks) result.storedMarks = this.storedMarks.map((m) => m.toJSON());
			if (pluginFields && typeof pluginFields == "object") for (let prop in pluginFields) {
				if (prop == "doc" || prop == "selection") throw new RangeError("The JSON fields `doc` and `selection` are reserved");
				let plugin = pluginFields[prop];
				let state = plugin.spec.state;
				if (state && state.toJSON) result[prop] = state.toJSON.call(plugin, this[plugin.key]);
			}
			return result;
		}
		/**
		Deserialize a JSON representation of a state. `config` should
		have at least a `schema` field, and should contain array of
		plugins to initialize the state with. `pluginFields` can be used
		to deserialize the state of plugins, by associating plugin
		instances with the property names they use in the JSON object.
		*/
		static fromJSON(config, json, pluginFields) {
			if (!json) throw new RangeError("Invalid input for EditorState.fromJSON");
			if (!config.schema) throw new RangeError("Required config field 'schema' missing");
			let $config = new Configuration(config.schema, config.plugins);
			let instance = new EditorState($config);
			$config.fields.forEach((field) => {
				if (field.name == "doc") instance.doc = Node.fromJSON(config.schema, json.doc);
				else if (field.name == "selection") instance.selection = Selection.fromJSON(instance.doc, json.selection);
				else if (field.name == "storedMarks") {
					if (json.storedMarks) instance.storedMarks = json.storedMarks.map(config.schema.markFromJSON);
				} else {
					if (pluginFields) for (let prop in pluginFields) {
						let plugin = pluginFields[prop];
						let state = plugin.spec.state;
						if (plugin.key == field.name && state && state.fromJSON && Object.prototype.hasOwnProperty.call(json, prop)) {
							instance[field.name] = state.fromJSON.call(plugin, config, json[prop], instance);
							return;
						}
					}
					instance[field.name] = field.init(config, instance);
				}
			});
			return instance;
		}
	};
	function bindProps(obj, self, target) {
		for (let prop in obj) {
			let val = obj[prop];
			if (val instanceof Function) val = val.bind(self);
			else if (prop == "handleDOMEvents") val = bindProps(val, self, {});
			target[prop] = val;
		}
		return target;
	}
	/**
	Plugins bundle functionality that can be added to an editor.
	They are part of the [editor state](https://prosemirror.net/docs/ref/#state.EditorState) and
	may influence that state and the view that contains it.
	*/
	var Plugin = class {
		/**
		Create a plugin.
		*/
		constructor(spec) {
			this.spec = spec;
			/**
			The [props](https://prosemirror.net/docs/ref/#view.EditorProps) exported by this plugin.
			*/
			this.props = {};
			if (spec.props) bindProps(spec.props, this, this.props);
			this.key = spec.key ? spec.key.key : createKey("plugin");
		}
		/**
		Extract the plugin's state field from an editor state.
		*/
		getState(state) {
			return state[this.key];
		}
	};
	var keys$1 = Object.create(null);
	function createKey(name) {
		if (name in keys$1) return name + "$" + ++keys$1[name];
		keys$1[name] = 0;
		return name + "$";
	}
	/**
	A key is used to [tag](https://prosemirror.net/docs/ref/#state.PluginSpec.key) plugins in a way
	that makes it possible to find them, given an editor state.
	Assigning a key does mean only one plugin of that type can be
	active in a state.
	*/
	var PluginKey = class {
		/**
		Create a plugin key.
		*/
		constructor(name = "key") {
			this.key = createKey(name);
		}
		/**
		Get the active plugin with this key, if any, from an editor
		state.
		*/
		get(state) {
			return state.config.pluginsByKey[this.key];
		}
		/**
		Get the plugin's state from an editor state.
		*/
		getState(state) {
			return state[this.key];
		}
	};

//#endregion
//#region node_modules/prosemirror-commands/dist/index.js
/**
	Delete the selection, if there is one.
	*/
	var deleteSelection$1 = /* @__PURE__ */ __name((state, dispatch) => {
		if (state.selection.empty) return false;
		if (dispatch) dispatch(state.tr.deleteSelection().scrollIntoView());
		return true;
	}, "deleteSelection");
	function atBlockStart(state, view) {
		let { $cursor } = state.selection;
		if (!$cursor || (view ? !view.endOfTextblock("backward", state) : $cursor.parentOffset > 0)) return null;
		return $cursor;
	}
	/**
	If the selection is empty and at the start of a textblock, try to
	reduce the distance between that block and the one before it—if
	there's a block directly before it that can be joined, join them.
	If not, try to move the selected block closer to the next one in
	the document structure by lifting it out of its parent or moving it
	into a parent of the previous block. Will use the view for accurate
	(bidi-aware) start-of-textblock detection if given.
	*/
	var joinBackward$1 = /* @__PURE__ */ __name((state, dispatch, view) => {
		let $cursor = atBlockStart(state, view);
		if (!$cursor) return false;
		let $cut = findCutBefore($cursor);
		if (!$cut) {
			let range = $cursor.blockRange();
			let target = range && liftTarget(range);
			if (target == null) return false;
			if (dispatch) dispatch(state.tr.lift(range, target).scrollIntoView());
			return true;
		}
		let before = $cut.nodeBefore;
		if (deleteBarrier(state, $cut, dispatch, -1)) return true;
		if ($cursor.parent.content.size == 0 && (textblockAt(before, "end") || NodeSelection.isSelectable(before))) for (let depth = $cursor.depth;; depth--) {
			let delStep = replaceStep(state.doc, $cursor.before(depth), $cursor.after(depth), Slice.empty);
			if (delStep && delStep.slice.size < delStep.to - delStep.from) {
				if (dispatch) {
					let tr = state.tr.step(delStep);
					tr.setSelection(textblockAt(before, "end") ? Selection.findFrom(tr.doc.resolve(tr.mapping.map($cut.pos, -1)), -1) : NodeSelection.create(tr.doc, $cut.pos - before.nodeSize));
					dispatch(tr.scrollIntoView());
				}
				return true;
			}
			if (depth == 1 || $cursor.node(depth - 1).childCount > 1) break;
		}
		if (before.isAtom && $cut.depth == $cursor.depth - 1) {
			if (dispatch) dispatch(state.tr.delete($cut.pos - before.nodeSize, $cut.pos).scrollIntoView());
			return true;
		}
		return false;
	}, "joinBackward");
	/**
	A more limited form of [`joinBackward`](https://prosemirror.net/docs/ref/#commands.joinBackward)
	that only tries to join the current textblock to the one before
	it, if the cursor is at the start of a textblock.
	*/
	var joinTextblockBackward$1 = /* @__PURE__ */ __name((state, dispatch, view) => {
		let $cursor = atBlockStart(state, view);
		if (!$cursor) return false;
		let $cut = findCutBefore($cursor);
		return $cut ? joinTextblocksAround(state, $cut, dispatch) : false;
	}, "joinTextblockBackward");
	/**
	A more limited form of [`joinForward`](https://prosemirror.net/docs/ref/#commands.joinForward)
	that only tries to join the current textblock to the one after
	it, if the cursor is at the end of a textblock.
	*/
	var joinTextblockForward$1 = /* @__PURE__ */ __name((state, dispatch, view) => {
		let $cursor = atBlockEnd(state, view);
		if (!$cursor) return false;
		let $cut = findCutAfter($cursor);
		return $cut ? joinTextblocksAround(state, $cut, dispatch) : false;
	}, "joinTextblockForward");
	function joinTextblocksAround(state, $cut, dispatch) {
		let beforeText = $cut.nodeBefore;
		let beforePos = $cut.pos - 1;
		for (; !beforeText.isTextblock; beforePos--) {
			if (beforeText.type.spec.isolating) return false;
			let child = beforeText.lastChild;
			if (!child) return false;
			beforeText = child;
		}
		let afterText = $cut.nodeAfter;
		let afterPos = $cut.pos + 1;
		for (; !afterText.isTextblock; afterPos++) {
			if (afterText.type.spec.isolating) return false;
			let child = afterText.firstChild;
			if (!child) return false;
			afterText = child;
		}
		let step = replaceStep(state.doc, beforePos, afterPos, Slice.empty);
		if (!step || step.from != beforePos || step instanceof ReplaceStep && step.slice.size >= afterPos - beforePos) return false;
		if (dispatch) {
			let tr = state.tr.step(step);
			tr.setSelection(TextSelection.create(tr.doc, beforePos));
			dispatch(tr.scrollIntoView());
		}
		return true;
	}
	function textblockAt(node, side, only = false) {
		for (let scan = node; scan; scan = side == "start" ? scan.firstChild : scan.lastChild) {
			if (scan.isTextblock) return true;
			if (only && scan.childCount != 1) return false;
		}
		return false;
	}
	/**
	When the selection is empty and at the start of a textblock, select
	the node before that textblock, if possible. This is intended to be
	bound to keys like backspace, after
	[`joinBackward`](https://prosemirror.net/docs/ref/#commands.joinBackward) or other deleting
	commands, as a fall-back behavior when the schema doesn't allow
	deletion at the selected point.
	*/
	var selectNodeBackward$1 = /* @__PURE__ */ __name((state, dispatch, view) => {
		let { $head, empty } = state.selection, $cut = $head;
		if (!empty) return false;
		if ($head.parent.isTextblock) {
			if (view ? !view.endOfTextblock("backward", state) : $head.parentOffset > 0) return false;
			$cut = findCutBefore($head);
		}
		let node = $cut && $cut.nodeBefore;
		if (!node || !NodeSelection.isSelectable(node)) return false;
		if (dispatch) dispatch(state.tr.setSelection(NodeSelection.create(state.doc, $cut.pos - node.nodeSize)).scrollIntoView());
		return true;
	}, "selectNodeBackward");
	function findCutBefore($pos) {
		if (!$pos.parent.type.spec.isolating) for (let i = $pos.depth - 1; i >= 0; i--) {
			if ($pos.index(i) > 0) return $pos.doc.resolve($pos.before(i + 1));
			if ($pos.node(i).type.spec.isolating) break;
		}
		return null;
	}
	function atBlockEnd(state, view) {
		let { $cursor } = state.selection;
		if (!$cursor || (view ? !view.endOfTextblock("forward", state) : $cursor.parentOffset < $cursor.parent.content.size)) return null;
		return $cursor;
	}
	/**
	If the selection is empty and the cursor is at the end of a
	textblock, try to reduce or remove the boundary between that block
	and the one after it, either by joining them or by moving the other
	block closer to this one in the tree structure. Will use the view
	for accurate start-of-textblock detection if given.
	*/
	var joinForward$1 = /* @__PURE__ */ __name((state, dispatch, view) => {
		let $cursor = atBlockEnd(state, view);
		if (!$cursor) return false;
		let $cut = findCutAfter($cursor);
		if (!$cut) return false;
		let after = $cut.nodeAfter;
		if (deleteBarrier(state, $cut, dispatch, 1)) return true;
		if ($cursor.parent.content.size == 0 && (textblockAt(after, "start") || NodeSelection.isSelectable(after))) {
			let delStep = replaceStep(state.doc, $cursor.before(), $cursor.after(), Slice.empty);
			if (delStep && delStep.slice.size < delStep.to - delStep.from) {
				if (dispatch) {
					let tr = state.tr.step(delStep);
					tr.setSelection(textblockAt(after, "start") ? Selection.findFrom(tr.doc.resolve(tr.mapping.map($cut.pos)), 1) : NodeSelection.create(tr.doc, tr.mapping.map($cut.pos)));
					dispatch(tr.scrollIntoView());
				}
				return true;
			}
		}
		if (after.isAtom && $cut.depth == $cursor.depth - 1) {
			if (dispatch) dispatch(state.tr.delete($cut.pos, $cut.pos + after.nodeSize).scrollIntoView());
			return true;
		}
		return false;
	}, "joinForward");
	/**
	When the selection is empty and at the end of a textblock, select
	the node coming after that textblock, if possible. This is intended
	to be bound to keys like delete, after
	[`joinForward`](https://prosemirror.net/docs/ref/#commands.joinForward) and similar deleting
	commands, to provide a fall-back behavior when the schema doesn't
	allow deletion at the selected point.
	*/
	var selectNodeForward$1 = /* @__PURE__ */ __name((state, dispatch, view) => {
		let { $head, empty } = state.selection, $cut = $head;
		if (!empty) return false;
		if ($head.parent.isTextblock) {
			if (view ? !view.endOfTextblock("forward", state) : $head.parentOffset < $head.parent.content.size) return false;
			$cut = findCutAfter($head);
		}
		let node = $cut && $cut.nodeAfter;
		if (!node || !NodeSelection.isSelectable(node)) return false;
		if (dispatch) dispatch(state.tr.setSelection(NodeSelection.create(state.doc, $cut.pos)).scrollIntoView());
		return true;
	}, "selectNodeForward");
	function findCutAfter($pos) {
		if (!$pos.parent.type.spec.isolating) for (let i = $pos.depth - 1; i >= 0; i--) {
			let parent = $pos.node(i);
			if ($pos.index(i) + 1 < parent.childCount) return $pos.doc.resolve($pos.after(i + 1));
			if (parent.type.spec.isolating) break;
		}
		return null;
	}
	/**
	Join the selected block or, if there is a text selection, the
	closest ancestor block of the selection that can be joined, with
	the sibling above it.
	*/
	var joinUp$1 = /* @__PURE__ */ __name((state, dispatch) => {
		let sel = state.selection;
		let nodeSel = sel instanceof NodeSelection;
		let point;
		if (nodeSel) {
			if (sel.node.isTextblock || !canJoin(state.doc, sel.from)) return false;
			point = sel.from;
		} else {
			point = joinPoint(state.doc, sel.from, -1);
			if (point == null) return false;
		}
		if (dispatch) {
			let tr = state.tr.join(point);
			if (nodeSel) tr.setSelection(NodeSelection.create(tr.doc, point - state.doc.resolve(point).nodeBefore.nodeSize));
			dispatch(tr.scrollIntoView());
		}
		return true;
	}, "joinUp");
	/**
	Join the selected block, or the closest ancestor of the selection
	that can be joined, with the sibling after it.
	*/
	var joinDown$1 = /* @__PURE__ */ __name((state, dispatch) => {
		let sel = state.selection;
		let point;
		if (sel instanceof NodeSelection) {
			if (sel.node.isTextblock || !canJoin(state.doc, sel.to)) return false;
			point = sel.to;
		} else {
			point = joinPoint(state.doc, sel.to, 1);
			if (point == null) return false;
		}
		if (dispatch) dispatch(state.tr.join(point).scrollIntoView());
		return true;
	}, "joinDown");
	/**
	Lift the selected block, or the closest ancestor block of the
	selection that can be lifted, out of its parent node.
	*/
	var lift$1 = /* @__PURE__ */ __name((state, dispatch) => {
		let { $from, $to } = state.selection;
		let range = $from.blockRange($to);
		let target = range && liftTarget(range);
		if (target == null) return false;
		if (dispatch) dispatch(state.tr.lift(range, target).scrollIntoView());
		return true;
	}, "lift");
	/**
	If the selection is in a node whose type has a truthy
	[`code`](https://prosemirror.net/docs/ref/#model.NodeSpec.code) property in its spec, replace the
	selection with a newline character.
	*/
	var newlineInCode$1 = /* @__PURE__ */ __name((state, dispatch) => {
		let { $head, $anchor } = state.selection;
		if (!$head.parent.type.spec.code || !$head.sameParent($anchor)) return false;
		if (dispatch) dispatch(state.tr.insertText("\n").scrollIntoView());
		return true;
	}, "newlineInCode");
	function defaultBlockAt$1(match) {
		for (let i = 0; i < match.edgeCount; i++) {
			let { type } = match.edge(i);
			if (type.isTextblock && !type.hasRequiredAttrs()) return type;
		}
		return null;
	}
	__name(defaultBlockAt$1, "defaultBlockAt");
	/**
	When the selection is in a node with a truthy
	[`code`](https://prosemirror.net/docs/ref/#model.NodeSpec.code) property in its spec, create a
	default block after the code block, and move the cursor there.
	*/
	var exitCode$1 = /* @__PURE__ */ __name((state, dispatch) => {
		let { $head, $anchor } = state.selection;
		if (!$head.parent.type.spec.code || !$head.sameParent($anchor)) return false;
		let above = $head.node(-1);
		let after = $head.indexAfter(-1);
		let type = defaultBlockAt$1(above.contentMatchAt(after));
		if (!type || !above.canReplaceWith(after, after, type)) return false;
		if (dispatch) {
			let pos = $head.after();
			let tr = state.tr.replaceWith(pos, pos, type.createAndFill());
			tr.setSelection(Selection.near(tr.doc.resolve(pos), 1));
			dispatch(tr.scrollIntoView());
		}
		return true;
	}, "exitCode");
	/**
	If a block node is selected, create an empty paragraph before (if
	it is its parent's first child) or after it.
	*/
	var createParagraphNear$1 = /* @__PURE__ */ __name((state, dispatch) => {
		let sel = state.selection, { $from, $to } = sel;
		if (sel instanceof AllSelection || $from.parent.inlineContent || $to.parent.inlineContent) return false;
		let type = defaultBlockAt$1($to.parent.contentMatchAt($to.indexAfter()));
		if (!type || !type.isTextblock) return false;
		if (dispatch) {
			let side = (!$from.parentOffset && $to.index() < $to.parent.childCount ? $from : $to).pos;
			let tr = state.tr.insert(side, type.createAndFill());
			tr.setSelection(TextSelection.create(tr.doc, side + 1));
			dispatch(tr.scrollIntoView());
		}
		return true;
	}, "createParagraphNear");
	/**
	If the cursor is in an empty textblock that can be lifted, lift the
	block.
	*/
	var liftEmptyBlock$1 = /* @__PURE__ */ __name((state, dispatch) => {
		let { $cursor } = state.selection;
		if (!$cursor || $cursor.parent.content.size) return false;
		if ($cursor.depth > 1 && $cursor.after() != $cursor.end(-1)) {
			let before = $cursor.before();
			if (canSplit(state.doc, before)) {
				if (dispatch) dispatch(state.tr.split(before).scrollIntoView());
				return true;
			}
		}
		let range = $cursor.blockRange();
		let target = range && liftTarget(range);
		if (target == null) return false;
		if (dispatch) dispatch(state.tr.lift(range, target).scrollIntoView());
		return true;
	}, "liftEmptyBlock");
	/**
	Create a variant of [`splitBlock`](https://prosemirror.net/docs/ref/#commands.splitBlock) that uses
	a custom function to determine the type of the newly split off block.
	*/
	function splitBlockAs(splitNode) {
		return (state, dispatch) => {
			let { $from, $to } = state.selection;
			if (state.selection instanceof NodeSelection && state.selection.node.isBlock) {
				if (!$from.parentOffset || !canSplit(state.doc, $from.pos)) return false;
				if (dispatch) dispatch(state.tr.split($from.pos).scrollIntoView());
				return true;
			}
			if (!$from.depth) return false;
			let types = [];
			let splitDepth;
			let deflt;
			let atEnd = false;
			let atStart = false;
			for (let d = $from.depth;; d--) if ($from.node(d).isBlock) {
				atEnd = $from.end(d) == $from.pos + ($from.depth - d);
				atStart = $from.start(d) == $from.pos - ($from.depth - d);
				deflt = defaultBlockAt$1($from.node(d - 1).contentMatchAt($from.indexAfter(d - 1)));
				let splitType = splitNode && splitNode($to.parent, atEnd, $from);
				types.unshift(splitType || (atEnd && deflt ? { type: deflt } : null));
				splitDepth = d;
				break;
			} else {
				if (d == 1) return false;
				types.unshift(null);
			}
			let tr = state.tr;
			if (state.selection instanceof TextSelection || state.selection instanceof AllSelection) tr.deleteSelection();
			let splitPos = tr.mapping.map($from.pos);
			let can = canSplit(tr.doc, splitPos, types.length, types);
			if (!can) {
				types[0] = deflt ? { type: deflt } : null;
				can = canSplit(tr.doc, splitPos, types.length, types);
			}
			if (!can) return false;
			tr.split(splitPos, types.length, types);
			if (!atEnd && atStart && $from.node(splitDepth).type != deflt) {
				let first = tr.mapping.map($from.before(splitDepth));
				let $first = tr.doc.resolve(first);
				if (deflt && $from.node(splitDepth - 1).canReplaceWith($first.index(), $first.index() + 1, deflt)) tr.setNodeMarkup(tr.mapping.map($from.before(splitDepth)), deflt);
			}
			if (dispatch) dispatch(tr.scrollIntoView());
			return true;
		};
	}
	/**
	Split the parent block of the selection. If the selection is a text
	selection, also delete its content.
	*/
	var splitBlock$1 = splitBlockAs();
	/**
	Move the selection to the node wrapping the current selection, if
	any. (Will not select the document node.)
	*/
	var selectParentNode$1 = /* @__PURE__ */ __name((state, dispatch) => {
		let { $from, to } = state.selection, pos;
		let same = $from.sharedDepth(to);
		if (same == 0) return false;
		pos = $from.before(same);
		if (dispatch) dispatch(state.tr.setSelection(NodeSelection.create(state.doc, pos)));
		return true;
	}, "selectParentNode");
	/**
	Select the whole document.
	*/
	var selectAll$1 = /* @__PURE__ */ __name((state, dispatch) => {
		if (dispatch) dispatch(state.tr.setSelection(new AllSelection(state.doc)));
		return true;
	}, "selectAll");
	function joinMaybeClear(state, $pos, dispatch) {
		let before = $pos.nodeBefore;
		let after = $pos.nodeAfter;
		let index = $pos.index();
		if (!before || !after || !before.type.compatibleContent(after.type)) return false;
		if (!before.content.size && $pos.parent.canReplace(index - 1, index)) {
			if (dispatch) dispatch(state.tr.delete($pos.pos - before.nodeSize, $pos.pos).scrollIntoView());
			return true;
		}
		if (!$pos.parent.canReplace(index, index + 1) || !(after.isTextblock || canJoin(state.doc, $pos.pos))) return false;
		if (dispatch) dispatch(state.tr.join($pos.pos).scrollIntoView());
		return true;
	}
	function deleteBarrier(state, $cut, dispatch, dir) {
		let before = $cut.nodeBefore;
		let after = $cut.nodeAfter;
		let conn;
		let match;
		let isolated = before.type.spec.isolating || after.type.spec.isolating;
		if (!isolated && joinMaybeClear(state, $cut, dispatch)) return true;
		let canDelAfter = !isolated && $cut.parent.canReplace($cut.index(), $cut.index() + 1);
		if (canDelAfter && (conn = (match = before.contentMatchAt(before.childCount)).findWrapping(after.type)) && match.matchType(conn[0] || after.type).validEnd) {
			if (dispatch) {
				let end = $cut.pos + after.nodeSize;
				let wrap = Fragment$1.empty;
				for (let i = conn.length - 1; i >= 0; i--) wrap = Fragment$1.from(conn[i].create(null, wrap));
				wrap = Fragment$1.from(before.copy(wrap));
				let tr = state.tr.step(new ReplaceAroundStep($cut.pos - 1, end, $cut.pos, end, new Slice(wrap, 1, 0), conn.length, true));
				let $joinAt = tr.doc.resolve(end + 2 * conn.length);
				if ($joinAt.nodeAfter && $joinAt.nodeAfter.type == before.type && canJoin(tr.doc, $joinAt.pos)) tr.join($joinAt.pos);
				dispatch(tr.scrollIntoView());
			}
			return true;
		}
		let selAfter = after.type.spec.isolating || dir > 0 && isolated ? null : Selection.findFrom($cut, 1);
		let range = selAfter && selAfter.$from.blockRange(selAfter.$to);
		let target = range && liftTarget(range);
		if (target != null && target >= $cut.depth) {
			if (dispatch) dispatch(state.tr.lift(range, target).scrollIntoView());
			return true;
		}
		if (canDelAfter && textblockAt(after, "start", true) && textblockAt(before, "end")) {
			let at = before;
			let wrap = [];
			for (;;) {
				wrap.push(at);
				if (at.isTextblock) break;
				at = at.lastChild;
			}
			let afterText = after;
			let afterDepth = 1;
			for (; !afterText.isTextblock; afterText = afterText.firstChild) afterDepth++;
			if (at.canReplace(at.childCount, at.childCount, afterText.content)) {
				if (dispatch) {
					let end = Fragment$1.empty;
					for (let i = wrap.length - 1; i >= 0; i--) end = Fragment$1.from(wrap[i].copy(end));
					dispatch(state.tr.step(new ReplaceAroundStep($cut.pos - wrap.length, $cut.pos + after.nodeSize, $cut.pos + afterDepth, $cut.pos + after.nodeSize - afterDepth, new Slice(end, wrap.length, 0), 0, true)).scrollIntoView());
				}
				return true;
			}
		}
		return false;
	}
	function selectTextblockSide(side) {
		return function(state, dispatch) {
			let sel = state.selection;
			let $pos = side < 0 ? sel.$from : sel.$to;
			let depth = $pos.depth;
			while ($pos.node(depth).isInline) {
				if (!depth) return false;
				depth--;
			}
			if (!$pos.node(depth).isTextblock) return false;
			if (dispatch) dispatch(state.tr.setSelection(TextSelection.create(state.doc, side < 0 ? $pos.start(depth) : $pos.end(depth))));
			return true;
		};
	}
	/**
	Moves the cursor to the start of current text block.
	*/
	var selectTextblockStart$1 = selectTextblockSide(-1);
	/**
	Moves the cursor to the end of current text block.
	*/
	var selectTextblockEnd$1 = selectTextblockSide(1);
	/**
	Wrap the selection in a node of the given type with the given
	attributes.
	*/
	function wrapIn$1(nodeType, attrs = null) {
		return function(state, dispatch) {
			let { $from, $to } = state.selection;
			let range = $from.blockRange($to);
			let wrapping = range && findWrapping(range, nodeType, attrs);
			if (!wrapping) return false;
			if (dispatch) dispatch(state.tr.wrap(range, wrapping).scrollIntoView());
			return true;
		};
	}
	__name(wrapIn$1, "wrapIn");
	/**
	Returns a command that tries to set the selected textblocks to the
	given node type with the given attributes.
	*/
	function setBlockType(nodeType, attrs = null) {
		return function(state, dispatch) {
			let applicable = false;
			for (let i = 0; i < state.selection.ranges.length && !applicable; i++) {
				let { $from: { pos: from }, $to: { pos: to } } = state.selection.ranges[i];
				state.doc.nodesBetween(from, to, (node, pos) => {
					if (applicable) return false;
					if (!node.isTextblock || node.hasMarkup(nodeType, attrs)) return;
					if (node.type == nodeType) applicable = true;
					else {
						let $pos = state.doc.resolve(pos);
						let index = $pos.index();
						applicable = $pos.parent.canReplaceWith(index, index + 1, nodeType);
					}
				});
			}
			if (!applicable) return false;
			if (dispatch) {
				let tr = state.tr;
				for (let i = 0; i < state.selection.ranges.length; i++) {
					let { $from: { pos: from }, $to: { pos: to } } = state.selection.ranges[i];
					tr.setBlockType(from, to, nodeType, attrs);
				}
				dispatch(tr.scrollIntoView());
			}
			return true;
		};
	}
	/**
	Combine a number of command functions into a single function (which
	calls them one by one until one returns true).
	*/
	function chainCommands(...commands) {
		return function(state, dispatch, view) {
			for (let i = 0; i < commands.length; i++) if (commands[i](state, dispatch, view)) return true;
			return false;
		};
	}
	var backspace = chainCommands(deleteSelection$1, joinBackward$1, selectNodeBackward$1);
	var del = chainCommands(deleteSelection$1, joinForward$1, selectNodeForward$1);
	/**
	A basic keymap containing bindings not specific to any schema.
	Binds the following keys (when multiple commands are listed, they
	are chained with [`chainCommands`](https://prosemirror.net/docs/ref/#commands.chainCommands)):
	
	* **Enter** to `newlineInCode`, `createParagraphNear`, `liftEmptyBlock`, `splitBlock`
	* **Mod-Enter** to `exitCode`
	* **Backspace** and **Mod-Backspace** to `deleteSelection`, `joinBackward`, `selectNodeBackward`
	* **Delete** and **Mod-Delete** to `deleteSelection`, `joinForward`, `selectNodeForward`
	* **Mod-Delete** to `deleteSelection`, `joinForward`, `selectNodeForward`
	* **Mod-a** to `selectAll`
	*/
	var pcBaseKeymap = {
		"Enter": chainCommands(newlineInCode$1, createParagraphNear$1, liftEmptyBlock$1, splitBlock$1),
		"Mod-Enter": exitCode$1,
		"Backspace": backspace,
		"Mod-Backspace": backspace,
		"Shift-Backspace": backspace,
		"Delete": del,
		"Mod-Delete": del,
		"Mod-a": selectAll$1
	};
	/**
	A copy of `pcBaseKeymap` that also binds **Ctrl-h** like Backspace,
	**Ctrl-d** like Delete, **Alt-Backspace** like Ctrl-Backspace, and
	**Ctrl-Alt-Backspace**, **Alt-Delete**, and **Alt-d** like
	Ctrl-Delete.
	*/
	var macBaseKeymap = {
		"Ctrl-h": pcBaseKeymap["Backspace"],
		"Alt-Backspace": pcBaseKeymap["Mod-Backspace"],
		"Ctrl-d": pcBaseKeymap["Delete"],
		"Ctrl-Alt-Backspace": pcBaseKeymap["Mod-Delete"],
		"Alt-Delete": pcBaseKeymap["Mod-Delete"],
		"Alt-d": pcBaseKeymap["Mod-Delete"],
		"Ctrl-a": selectTextblockStart$1,
		"Ctrl-e": selectTextblockEnd$1
	};
	for (let key in pcBaseKeymap) macBaseKeymap[key] = pcBaseKeymap[key];
	/**
	Depending on the detected platform, this will hold
	[`pcBasekeymap`](https://prosemirror.net/docs/ref/#commands.pcBaseKeymap) or
	[`macBaseKeymap`](https://prosemirror.net/docs/ref/#commands.macBaseKeymap).
	*/
	var baseKeymap = (typeof navigator != "undefined" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : typeof os != "undefined" && os.platform ? os.platform() == "darwin" : false) ? macBaseKeymap : pcBaseKeymap;

//#endregion
//#region node_modules/prosemirror-schema-list/dist/index.js
/**
	Returns a command function that wraps the selection in a list with
	the given type an attributes. If `dispatch` is null, only return a
	value to indicate whether this is possible, but don't actually
	perform the change.
	*/
	function wrapInList$1(listType, attrs = null) {
		return function(state, dispatch) {
			let { $from, $to } = state.selection;
			let range = $from.blockRange($to);
			if (!range) return false;
			let tr = dispatch ? state.tr : null;
			if (!wrapRangeInList(tr, range, listType, attrs)) return false;
			if (dispatch) dispatch(tr.scrollIntoView());
			return true;
		};
	}
	__name(wrapInList$1, "wrapInList");
	/**
	Try to wrap the given node range in a list of the given type.
	Return `true` when this is possible, `false` otherwise. When `tr`
	is non-null, the wrapping is added to that transaction. When it is
	`null`, the function only queries whether the wrapping is
	possible.
	*/
	function wrapRangeInList(tr, range, listType, attrs = null) {
		let doJoin = false;
		let outerRange = range;
		let doc = range.$from.doc;
		if (range.depth >= 2 && range.$from.node(range.depth - 1).type.compatibleContent(listType) && range.startIndex == 0) {
			if (range.$from.index(range.depth - 1) == 0) return false;
			let $insert = doc.resolve(range.start - 2);
			outerRange = new NodeRange($insert, $insert, range.depth);
			if (range.endIndex < range.parent.childCount) range = new NodeRange(range.$from, doc.resolve(range.$to.end(range.depth)), range.depth);
			doJoin = true;
		}
		let wrap = findWrapping(outerRange, listType, attrs, range);
		if (!wrap) return false;
		if (tr) doWrapInList(tr, range, wrap, doJoin, listType);
		return true;
	}
	function doWrapInList(tr, range, wrappers, joinBefore, listType) {
		let content = Fragment$1.empty;
		for (let i = wrappers.length - 1; i >= 0; i--) content = Fragment$1.from(wrappers[i].type.create(wrappers[i].attrs, content));
		tr.step(new ReplaceAroundStep(range.start - (joinBefore ? 2 : 0), range.end, range.start, range.end, new Slice(content, 0, 0), wrappers.length, true));
		let found = 0;
		for (let i = 0; i < wrappers.length; i++) if (wrappers[i].type == listType) found = i + 1;
		let splitDepth = wrappers.length - found;
		let splitPos = range.start + wrappers.length - (joinBefore ? 2 : 0);
		let parent = range.parent;
		for (let i = range.startIndex, e = range.endIndex, first = true; i < e; i++, first = false) {
			if (!first && canSplit(tr.doc, splitPos, splitDepth)) {
				tr.split(splitPos, splitDepth);
				splitPos += 2 * splitDepth;
			}
			splitPos += parent.child(i).nodeSize;
		}
		return tr;
	}
	/**
	Create a command to lift the list item around the selection up into
	a wrapping list.
	*/
	function liftListItem$1(itemType) {
		return function(state, dispatch) {
			let { $from, $to } = state.selection;
			let range = $from.blockRange($to, (node) => node.childCount > 0 && node.firstChild.type == itemType);
			if (!range) return false;
			if (!dispatch) return true;
			if ($from.node(range.depth - 1).type == itemType) return liftToOuterList(state, dispatch, itemType, range);
			else return liftOutOfList(state, dispatch, range);
		};
	}
	__name(liftListItem$1, "liftListItem");
	function liftToOuterList(state, dispatch, itemType, range) {
		let tr = state.tr;
		let end = range.end;
		let endOfList = range.$to.end(range.depth);
		if (end < endOfList) {
			tr.step(new ReplaceAroundStep(end - 1, endOfList, end, endOfList, new Slice(Fragment$1.from(itemType.create(null, range.parent.copy())), 1, 0), 1, true));
			range = new NodeRange(tr.doc.resolve(range.$from.pos), tr.doc.resolve(endOfList), range.depth);
		}
		const target = liftTarget(range);
		if (target == null) return false;
		tr.lift(range, target);
		let $after = tr.doc.resolve(tr.mapping.map(end, -1) - 1);
		if (canJoin(tr.doc, $after.pos) && $after.nodeBefore.type == $after.nodeAfter.type) tr.join($after.pos);
		dispatch(tr.scrollIntoView());
		return true;
	}
	function liftOutOfList(state, dispatch, range) {
		let tr = state.tr;
		let list = range.parent;
		for (let pos = range.end, i = range.endIndex - 1, e = range.startIndex; i > e; i--) {
			pos -= list.child(i).nodeSize;
			tr.delete(pos - 1, pos + 1);
		}
		let $start = tr.doc.resolve(range.start);
		let item = $start.nodeAfter;
		if (tr.mapping.map(range.end) != range.start + $start.nodeAfter.nodeSize) return false;
		let atStart = range.startIndex == 0;
		let atEnd = range.endIndex == list.childCount;
		let parent = $start.node(-1);
		let indexBefore = $start.index(-1);
		if (!parent.canReplace(indexBefore + (atStart ? 0 : 1), indexBefore + 1, item.content.append(atEnd ? Fragment$1.empty : Fragment$1.from(list)))) return false;
		let start = $start.pos;
		let end = start + item.nodeSize;
		tr.step(new ReplaceAroundStep(start - (atStart ? 1 : 0), end + (atEnd ? 1 : 0), start + 1, end - 1, new Slice((atStart ? Fragment$1.empty : Fragment$1.from(list.copy(Fragment$1.empty))).append(atEnd ? Fragment$1.empty : Fragment$1.from(list.copy(Fragment$1.empty))), atStart ? 0 : 1, atEnd ? 0 : 1), atStart ? 0 : 1));
		dispatch(tr.scrollIntoView());
		return true;
	}
	/**
	Create a command to sink the list item around the selection down
	into an inner list.
	*/
	function sinkListItem$1(itemType) {
		return function(state, dispatch) {
			let { $from, $to } = state.selection;
			let range = $from.blockRange($to, (node) => node.childCount > 0 && node.firstChild.type == itemType);
			if (!range) return false;
			let startIndex = range.startIndex;
			if (startIndex == 0) return false;
			let parent = range.parent;
			let nodeBefore = parent.child(startIndex - 1);
			if (nodeBefore.type != itemType) return false;
			if (dispatch) {
				let nestedBefore = nodeBefore.lastChild && nodeBefore.lastChild.type == parent.type;
				let inner = Fragment$1.from(nestedBefore ? itemType.create() : null);
				let slice = new Slice(Fragment$1.from(itemType.create(null, Fragment$1.from(parent.type.create(null, inner)))), nestedBefore ? 3 : 1, 0);
				let before = range.start;
				let after = range.end;
				dispatch(state.tr.step(new ReplaceAroundStep(before - (nestedBefore ? 3 : 1), after, before, after, slice, 1, true)).scrollIntoView());
			}
			return true;
		};
	}
	__name(sinkListItem$1, "sinkListItem");

//#endregion
//#region node_modules/prosemirror-view/dist/index.js
	var domIndex = function(node) {
		for (var index = 0;; index++) {
			node = node.previousSibling;
			if (!node) return index;
		}
	};
	var parentNode = function(node) {
		let parent = node.assignedSlot || node.parentNode;
		return parent && parent.nodeType == 11 ? parent.host : parent;
	};
	var reusedRange = null;
	var textRange = function(node, from, to) {
		let range = reusedRange || (reusedRange = document.createRange());
		range.setEnd(node, to == null ? node.nodeValue.length : to);
		range.setStart(node, from || 0);
		return range;
	};
	var clearReusedRange = function() {
		reusedRange = null;
	};
	var isEquivalentPosition = function(node, off, targetNode, targetOff) {
		return targetNode && (scanFor(node, off, targetNode, targetOff, -1) || scanFor(node, off, targetNode, targetOff, 1));
	};
	var atomElements = /^(img|br|input|textarea|hr)$/i;
	function scanFor(node, off, targetNode, targetOff, dir) {
		var _a;
		for (;;) {
			if (node == targetNode && off == targetOff) return true;
			if (off == (dir < 0 ? 0 : nodeSize(node))) {
				let parent = node.parentNode;
				if (!parent || parent.nodeType != 1 || hasBlockDesc(node) || atomElements.test(node.nodeName) || node.contentEditable == "false") return false;
				off = domIndex(node) + (dir < 0 ? 0 : 1);
				node = parent;
			} else if (node.nodeType == 1) {
				let child = node.childNodes[off + (dir < 0 ? -1 : 0)];
				if (child.nodeType == 1 && child.contentEditable == "false") if ((_a = child.pmViewDesc) === null || _a === void 0 ? void 0 : _a.ignoreForSelection) off += dir;
				else return false;
				else {
					node = child;
					off = dir < 0 ? nodeSize(node) : 0;
				}
			} else return false;
		}
	}
	function nodeSize(node) {
		return node.nodeType == 3 ? node.nodeValue.length : node.childNodes.length;
	}
	function textNodeBefore$1(node, offset) {
		for (;;) {
			if (node.nodeType == 3 && offset) return node;
			if (node.nodeType == 1 && offset > 0) {
				if (node.contentEditable == "false") return null;
				node = node.childNodes[offset - 1];
				offset = nodeSize(node);
			} else if (node.parentNode && !hasBlockDesc(node)) {
				offset = domIndex(node);
				node = node.parentNode;
			} else return null;
		}
	}
	function textNodeAfter$1(node, offset) {
		for (;;) {
			if (node.nodeType == 3 && offset < node.nodeValue.length) return node;
			if (node.nodeType == 1 && offset < node.childNodes.length) {
				if (node.contentEditable == "false") return null;
				node = node.childNodes[offset];
				offset = 0;
			} else if (node.parentNode && !hasBlockDesc(node)) {
				offset = domIndex(node) + 1;
				node = node.parentNode;
			} else return null;
		}
	}
	function isOnEdge(node, offset, parent) {
		for (let atStart = offset == 0, atEnd = offset == nodeSize(node); atStart || atEnd;) {
			if (node == parent) return true;
			let index = domIndex(node);
			node = node.parentNode;
			if (!node) return false;
			atStart = atStart && index == 0;
			atEnd = atEnd && index == nodeSize(node);
		}
	}
	function hasBlockDesc(dom) {
		let desc;
		for (let cur = dom; cur; cur = cur.parentNode) if (desc = cur.pmViewDesc) break;
		return desc && desc.node && desc.node.isBlock && (desc.dom == dom || desc.contentDOM == dom);
	}
	var selectionCollapsed = function(domSel) {
		return domSel.focusNode && isEquivalentPosition(domSel.focusNode, domSel.focusOffset, domSel.anchorNode, domSel.anchorOffset);
	};
	function keyEvent(keyCode, key) {
		let event = document.createEvent("Event");
		event.initEvent("keydown", true, true);
		event.keyCode = keyCode;
		event.key = event.code = key;
		return event;
	}
	function deepActiveElement(doc) {
		let elt = doc.activeElement;
		while (elt && elt.shadowRoot) elt = elt.shadowRoot.activeElement;
		return elt;
	}
	function caretFromPoint(doc, x, y) {
		if (doc.caretPositionFromPoint) try {
			let pos = doc.caretPositionFromPoint(x, y);
			if (pos) return {
				node: pos.offsetNode,
				offset: Math.min(nodeSize(pos.offsetNode), pos.offset)
			};
		} catch (_) {}
		if (doc.caretRangeFromPoint) {
			let range = doc.caretRangeFromPoint(x, y);
			if (range) return {
				node: range.startContainer,
				offset: Math.min(nodeSize(range.startContainer), range.startOffset)
			};
		}
	}
	var nav = typeof navigator != "undefined" ? navigator : null;
	var doc = typeof document != "undefined" ? document : null;
	var agent = nav && nav.userAgent || "";
	var ie_edge = /Edge\/(\d+)/.exec(agent);
	var ie_upto10 = /MSIE \d/.exec(agent);
	var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(agent);
	var ie$1 = !!(ie_upto10 || ie_11up || ie_edge);
	var ie_version = ie_upto10 ? document.documentMode : ie_11up ? +ie_11up[1] : ie_edge ? +ie_edge[1] : 0;
	var gecko = !ie$1 && /gecko\/(\d+)/i.test(agent);
	gecko && +(/Firefox\/(\d+)/.exec(agent) || [0, 0])[1];
	var _chrome = !ie$1 && /Chrome\/(\d+)/.exec(agent);
	var chrome = !!_chrome;
	var chrome_version = _chrome ? +_chrome[1] : 0;
	var safari = !ie$1 && !!nav && /Apple Computer/.test(nav.vendor);
	var ios = safari && (/Mobile\/\w+/.test(agent) || !!nav && nav.maxTouchPoints > 2);
	var mac$2 = ios || (nav ? /Mac/.test(nav.platform) : false);
	var windows$1 = nav ? /Win/.test(nav.platform) : false;
	var android = /Android \d/.test(agent);
	var webkit = !!doc && "webkitFontSmoothing" in doc.documentElement.style;
	var webkit_version = webkit ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
	function windowRect(doc) {
		let vp = doc.defaultView && doc.defaultView.visualViewport;
		if (vp) return {
			left: 0,
			right: vp.width,
			top: 0,
			bottom: vp.height
		};
		return {
			left: 0,
			right: doc.documentElement.clientWidth,
			top: 0,
			bottom: doc.documentElement.clientHeight
		};
	}
	function getSide(value, side) {
		return typeof value == "number" ? value : value[side];
	}
	function clientRect(node) {
		let rect = node.getBoundingClientRect();
		let scaleX = rect.width / node.offsetWidth || 1;
		let scaleY = rect.height / node.offsetHeight || 1;
		return {
			left: rect.left,
			right: rect.left + node.clientWidth * scaleX,
			top: rect.top,
			bottom: rect.top + node.clientHeight * scaleY
		};
	}
	function scrollRectIntoView(view, rect, startDOM) {
		let scrollThreshold = view.someProp("scrollThreshold") || 0;
		let scrollMargin = view.someProp("scrollMargin") || 5;
		let doc = view.dom.ownerDocument;
		for (let parent = startDOM || view.dom;;) {
			if (!parent) break;
			if (parent.nodeType != 1) {
				parent = parentNode(parent);
				continue;
			}
			let elt = parent;
			let atTop = elt == doc.body;
			let bounding = atTop ? windowRect(doc) : clientRect(elt);
			let moveX = 0;
			let moveY = 0;
			if (rect.top < bounding.top + getSide(scrollThreshold, "top")) moveY = -(bounding.top - rect.top + getSide(scrollMargin, "top"));
			else if (rect.bottom > bounding.bottom - getSide(scrollThreshold, "bottom")) moveY = rect.bottom - rect.top > bounding.bottom - bounding.top ? rect.top + getSide(scrollMargin, "top") - bounding.top : rect.bottom - bounding.bottom + getSide(scrollMargin, "bottom");
			if (rect.left < bounding.left + getSide(scrollThreshold, "left")) moveX = -(bounding.left - rect.left + getSide(scrollMargin, "left"));
			else if (rect.right > bounding.right - getSide(scrollThreshold, "right")) moveX = rect.right - bounding.right + getSide(scrollMargin, "right");
			if (moveX || moveY) if (atTop) doc.defaultView.scrollBy(moveX, moveY);
			else {
				let startX = elt.scrollLeft;
				let startY = elt.scrollTop;
				if (moveY) elt.scrollTop += moveY;
				if (moveX) elt.scrollLeft += moveX;
				let dX = elt.scrollLeft - startX;
				let dY = elt.scrollTop - startY;
				rect = {
					left: rect.left - dX,
					top: rect.top - dY,
					right: rect.right - dX,
					bottom: rect.bottom - dY
				};
			}
			let pos = atTop ? "fixed" : getComputedStyle(parent).position;
			if (/^(fixed|sticky)$/.test(pos)) break;
			parent = pos == "absolute" ? parent.offsetParent : parentNode(parent);
		}
	}
	function storeScrollPos(view) {
		let rect = view.dom.getBoundingClientRect();
		let startY = Math.max(0, rect.top);
		let refDOM;
		let refTop;
		for (let x = (rect.left + rect.right) / 2, y = startY + 1; y < Math.min(innerHeight, rect.bottom); y += 5) {
			let dom = view.root.elementFromPoint(x, y);
			if (!dom || dom == view.dom || !view.dom.contains(dom)) continue;
			let localRect = dom.getBoundingClientRect();
			if (localRect.top >= startY - 20) {
				refDOM = dom;
				refTop = localRect.top;
				break;
			}
		}
		return {
			refDOM,
			refTop,
			stack: scrollStack(view.dom)
		};
	}
	function scrollStack(dom) {
		let stack = [];
		let doc = dom.ownerDocument;
		for (let cur = dom; cur; cur = parentNode(cur)) {
			stack.push({
				dom: cur,
				top: cur.scrollTop,
				left: cur.scrollLeft
			});
			if (dom == doc) break;
		}
		return stack;
	}
	function resetScrollPos({ refDOM, refTop, stack }) {
		let newRefTop = refDOM ? refDOM.getBoundingClientRect().top : 0;
		restoreScrollStack(stack, newRefTop == 0 ? 0 : newRefTop - refTop);
	}
	function restoreScrollStack(stack, dTop) {
		for (let i = 0; i < stack.length; i++) {
			let { dom, top, left } = stack[i];
			if (dom.scrollTop != top + dTop) dom.scrollTop = top + dTop;
			if (dom.scrollLeft != left) dom.scrollLeft = left;
		}
	}
	var preventScrollSupported = null;
	function focusPreventScroll(dom) {
		if (dom.setActive) return dom.setActive();
		if (preventScrollSupported) return dom.focus(preventScrollSupported);
		let stored = scrollStack(dom);
		dom.focus(preventScrollSupported == null ? { get preventScroll() {
			preventScrollSupported = { preventScroll: true };
			return true;
		} } : void 0);
		if (!preventScrollSupported) {
			preventScrollSupported = false;
			restoreScrollStack(stored, 0);
		}
	}
	function findOffsetInNode(node, coords) {
		let closest;
		let dxClosest = 2e8;
		let coordsClosest;
		let offset = 0;
		let rowBot = coords.top;
		let rowTop = coords.top;
		let firstBelow;
		let coordsBelow;
		for (let child = node.firstChild, childIndex = 0; child; child = child.nextSibling, childIndex++) {
			let rects;
			if (child.nodeType == 1) rects = child.getClientRects();
			else if (child.nodeType == 3) rects = textRange(child).getClientRects();
			else continue;
			for (let i = 0; i < rects.length; i++) {
				let rect = rects[i];
				if (rect.top <= rowBot && rect.bottom >= rowTop) {
					rowBot = Math.max(rect.bottom, rowBot);
					rowTop = Math.min(rect.top, rowTop);
					let dx = rect.left > coords.left ? rect.left - coords.left : rect.right < coords.left ? coords.left - rect.right : 0;
					if (dx < dxClosest) {
						closest = child;
						dxClosest = dx;
						coordsClosest = dx && closest.nodeType == 3 ? {
							left: rect.right < coords.left ? rect.right : rect.left,
							top: coords.top
						} : coords;
						if (child.nodeType == 1 && dx) offset = childIndex + (coords.left >= (rect.left + rect.right) / 2 ? 1 : 0);
						continue;
					}
				} else if (rect.top > coords.top && !firstBelow && rect.left <= coords.left && rect.right >= coords.left) {
					firstBelow = child;
					coordsBelow = {
						left: Math.max(rect.left, Math.min(rect.right, coords.left)),
						top: rect.top
					};
				}
				if (!closest && (coords.left >= rect.right && coords.top >= rect.top || coords.left >= rect.left && coords.top >= rect.bottom)) offset = childIndex + 1;
			}
		}
		if (!closest && firstBelow) {
			closest = firstBelow;
			coordsClosest = coordsBelow;
			dxClosest = 0;
		}
		if (closest && closest.nodeType == 3) return findOffsetInText(closest, coordsClosest);
		if (!closest || dxClosest && closest.nodeType == 1) return {
			node,
			offset
		};
		return findOffsetInNode(closest, coordsClosest);
	}
	function findOffsetInText(node, coords) {
		let len = node.nodeValue.length;
		let range = document.createRange();
		let result;
		for (let i = 0; i < len; i++) {
			range.setEnd(node, i + 1);
			range.setStart(node, i);
			let rect = singleRect(range, 1);
			if (rect.top == rect.bottom) continue;
			if (inRect(coords, rect)) {
				result = {
					node,
					offset: i + (coords.left >= (rect.left + rect.right) / 2 ? 1 : 0)
				};
				break;
			}
		}
		range.detach();
		return result || {
			node,
			offset: 0
		};
	}
	function inRect(coords, rect) {
		return coords.left >= rect.left - 1 && coords.left <= rect.right + 1 && coords.top >= rect.top - 1 && coords.top <= rect.bottom + 1;
	}
	function targetKludge(dom, coords) {
		let parent = dom.parentNode;
		if (parent && /^li$/i.test(parent.nodeName) && coords.left < dom.getBoundingClientRect().left) return parent;
		return dom;
	}
	function posFromElement(view, elt, coords) {
		let { node, offset } = findOffsetInNode(elt, coords), bias = -1;
		if (node.nodeType == 1 && !node.firstChild) {
			let rect = node.getBoundingClientRect();
			bias = rect.left != rect.right && coords.left > (rect.left + rect.right) / 2 ? 1 : -1;
		}
		return view.docView.posFromDOM(node, offset, bias);
	}
	function posFromCaret(view, node, offset, coords) {
		let outsideBlock = -1;
		for (let cur = node, sawBlock = false;;) {
			if (cur == view.dom) break;
			let desc = view.docView.nearestDesc(cur, true);
			let rect;
			if (!desc) return null;
			if (desc.dom.nodeType == 1 && (desc.node.isBlock && desc.parent || !desc.contentDOM) && ((rect = desc.dom.getBoundingClientRect()).width || rect.height)) {
				if (desc.node.isBlock && desc.parent && !/^T(R|BODY|HEAD|FOOT)$/.test(desc.dom.nodeName)) {
					if (!sawBlock && rect.left > coords.left || rect.top > coords.top) outsideBlock = desc.posBefore;
					else if (!sawBlock && rect.right < coords.left || rect.bottom < coords.top) outsideBlock = desc.posAfter;
					sawBlock = true;
				}
				if (!desc.contentDOM && outsideBlock < 0 && !desc.node.isText) return (desc.node.isBlock ? coords.top < (rect.top + rect.bottom) / 2 : coords.left < (rect.left + rect.right) / 2) ? desc.posBefore : desc.posAfter;
			}
			cur = desc.dom.parentNode;
		}
		return outsideBlock > -1 ? outsideBlock : view.docView.posFromDOM(node, offset, -1);
	}
	function elementFromPoint(element, coords, box) {
		let len = element.childNodes.length;
		if (len && box.top < box.bottom) for (let startI = Math.max(0, Math.min(len - 1, Math.floor(len * (coords.top - box.top) / (box.bottom - box.top)) - 2)), i = startI;;) {
			let child = element.childNodes[i];
			if (child.nodeType == 1) {
				let rects = child.getClientRects();
				for (let j = 0; j < rects.length; j++) {
					let rect = rects[j];
					if (inRect(coords, rect)) return elementFromPoint(child, coords, rect);
				}
			}
			if ((i = (i + 1) % len) == startI) break;
		}
		return element;
	}
	function posAtCoords(view, coords) {
		let doc = view.dom.ownerDocument;
		let node;
		let offset = 0;
		let caret = caretFromPoint(doc, coords.left, coords.top);
		if (caret) ({node, offset} = caret);
		let elt = (view.root.elementFromPoint ? view.root : doc).elementFromPoint(coords.left, coords.top);
		let pos;
		if (!elt || !view.dom.contains(elt.nodeType != 1 ? elt.parentNode : elt)) {
			let box = view.dom.getBoundingClientRect();
			if (!inRect(coords, box)) return null;
			elt = elementFromPoint(view.dom, coords, box);
			if (!elt) return null;
		}
		if (safari) {
			for (let p = elt; node && p; p = parentNode(p)) if (p.draggable) node = void 0;
		}
		elt = targetKludge(elt, coords);
		if (node) {
			if (gecko && node.nodeType == 1) {
				offset = Math.min(offset, node.childNodes.length);
				if (offset < node.childNodes.length) {
					let next = node.childNodes[offset];
					let box;
					if (next.nodeName == "IMG" && (box = next.getBoundingClientRect()).right <= coords.left && box.bottom > coords.top) offset++;
				}
			}
			let prev;
			if (webkit && offset && node.nodeType == 1 && (prev = node.childNodes[offset - 1]).nodeType == 1 && prev.contentEditable == "false" && prev.getBoundingClientRect().top >= coords.top) offset--;
			if (node == view.dom && offset == node.childNodes.length - 1 && node.lastChild.nodeType == 1 && coords.top > node.lastChild.getBoundingClientRect().bottom) pos = view.state.doc.content.size;
			else if (offset == 0 || node.nodeType != 1 || node.childNodes[offset - 1].nodeName != "BR") pos = posFromCaret(view, node, offset, coords);
		}
		if (pos == null) pos = posFromElement(view, elt, coords);
		let desc = view.docView.nearestDesc(elt, true);
		return {
			pos,
			inside: desc ? desc.posAtStart - desc.border : -1
		};
	}
	function nonZero(rect) {
		return rect.top < rect.bottom || rect.left < rect.right;
	}
	function singleRect(target, bias) {
		let rects = target.getClientRects();
		if (rects.length) {
			let first = rects[bias < 0 ? 0 : rects.length - 1];
			if (nonZero(first)) return first;
		}
		return Array.prototype.find.call(rects, nonZero) || target.getBoundingClientRect();
	}
	var BIDI = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
	function coordsAtPos(view, pos, side) {
		let { node, offset, atom } = view.docView.domFromPos(pos, side < 0 ? -1 : 1);
		let supportEmptyRange = webkit || gecko;
		if (node.nodeType == 3) if (supportEmptyRange && (BIDI.test(node.nodeValue) || (side < 0 ? !offset : offset == node.nodeValue.length))) {
			let rect = singleRect(textRange(node, offset, offset), side);
			if (gecko && offset && /\s/.test(node.nodeValue[offset - 1]) && offset < node.nodeValue.length) {
				let rectBefore = singleRect(textRange(node, offset - 1, offset - 1), -1);
				if (rectBefore.top == rect.top) {
					let rectAfter = singleRect(textRange(node, offset, offset + 1), -1);
					if (rectAfter.top != rect.top) return flattenV(rectAfter, rectAfter.left < rectBefore.left);
				}
			}
			return rect;
		} else {
			let from = offset;
			let to = offset;
			let takeSide = side < 0 ? 1 : -1;
			if (side < 0 && !offset) {
				to++;
				takeSide = -1;
			} else if (side >= 0 && offset == node.nodeValue.length) {
				from--;
				takeSide = 1;
			} else if (side < 0) from--;
			else to++;
			return flattenV(singleRect(textRange(node, from, to), takeSide), takeSide < 0);
		}
		if (!view.state.doc.resolve(pos - (atom || 0)).parent.inlineContent) {
			if (atom == null && offset && (side < 0 || offset == nodeSize(node))) {
				let before = node.childNodes[offset - 1];
				if (before.nodeType == 1) return flattenH(before.getBoundingClientRect(), false);
			}
			if (atom == null && offset < nodeSize(node)) {
				let after = node.childNodes[offset];
				if (after.nodeType == 1) return flattenH(after.getBoundingClientRect(), true);
			}
			return flattenH(node.getBoundingClientRect(), side >= 0);
		}
		if (atom == null && offset && (side < 0 || offset == nodeSize(node))) {
			let before = node.childNodes[offset - 1];
			let target = before.nodeType == 3 ? textRange(before, nodeSize(before) - (supportEmptyRange ? 0 : 1)) : before.nodeType == 1 && (before.nodeName != "BR" || !before.nextSibling) ? before : null;
			if (target) return flattenV(singleRect(target, 1), false);
		}
		if (atom == null && offset < nodeSize(node)) {
			let after = node.childNodes[offset];
			while (after.pmViewDesc && after.pmViewDesc.ignoreForCoords) after = after.nextSibling;
			let target = !after ? null : after.nodeType == 3 ? textRange(after, 0, supportEmptyRange ? 0 : 1) : after.nodeType == 1 ? after : null;
			if (target) return flattenV(singleRect(target, -1), true);
		}
		return flattenV(singleRect(node.nodeType == 3 ? textRange(node) : node, -side), side >= 0);
	}
	function flattenV(rect, left) {
		if (rect.width == 0) return rect;
		let x = left ? rect.left : rect.right;
		return {
			top: rect.top,
			bottom: rect.bottom,
			left: x,
			right: x
		};
	}
	function flattenH(rect, top) {
		if (rect.height == 0) return rect;
		let y = top ? rect.top : rect.bottom;
		return {
			top: y,
			bottom: y,
			left: rect.left,
			right: rect.right
		};
	}
	function withFlushedState(view, state, f) {
		let viewState = view.state;
		let active = view.root.activeElement;
		if (viewState != state) view.updateState(state);
		if (active != view.dom) view.focus();
		try {
			return f();
		} finally {
			if (viewState != state) view.updateState(viewState);
			if (active != view.dom && active) active.focus();
		}
	}
	function endOfTextblockVertical(view, state, dir) {
		let sel = state.selection;
		let $pos = dir == "up" ? sel.$from : sel.$to;
		return withFlushedState(view, state, () => {
			let { node: dom } = view.docView.domFromPos($pos.pos, dir == "up" ? -1 : 1);
			for (;;) {
				let nearest = view.docView.nearestDesc(dom, true);
				if (!nearest) break;
				if (nearest.node.isBlock) {
					dom = nearest.contentDOM || nearest.dom;
					break;
				}
				dom = nearest.dom.parentNode;
			}
			let coords = coordsAtPos(view, $pos.pos, 1);
			for (let child = dom.firstChild; child; child = child.nextSibling) {
				let boxes;
				if (child.nodeType == 1) boxes = child.getClientRects();
				else if (child.nodeType == 3) boxes = textRange(child, 0, child.nodeValue.length).getClientRects();
				else continue;
				for (let i = 0; i < boxes.length; i++) {
					let box = boxes[i];
					if (box.bottom > box.top + 1 && (dir == "up" ? coords.top - box.top > (box.bottom - coords.top) * 2 : box.bottom - coords.bottom > (coords.bottom - box.top) * 2)) return false;
				}
			}
			return true;
		});
	}
	var maybeRTL = /[\u0590-\u08ac]/;
	function endOfTextblockHorizontal(view, state, dir) {
		let { $head } = state.selection;
		if (!$head.parent.isTextblock) return false;
		let offset = $head.parentOffset;
		let atStart = !offset;
		let atEnd = offset == $head.parent.content.size;
		let sel = view.domSelection();
		if (!sel) return $head.pos == $head.start() || $head.pos == $head.end();
		if (!maybeRTL.test($head.parent.textContent) || !sel.modify) return dir == "left" || dir == "backward" ? atStart : atEnd;
		return withFlushedState(view, state, () => {
			let { focusNode: oldNode, focusOffset: oldOff, anchorNode, anchorOffset } = view.domSelectionRange();
			let oldBidiLevel = sel.caretBidiLevel;
			sel.modify("move", dir, "character");
			let parentDOM = $head.depth ? view.docView.domAfterPos($head.before()) : view.dom;
			let { focusNode: newNode, focusOffset: newOff } = view.domSelectionRange();
			let result = newNode && !parentDOM.contains(newNode.nodeType == 1 ? newNode : newNode.parentNode) || oldNode == newNode && oldOff == newOff;
			try {
				sel.collapse(anchorNode, anchorOffset);
				if (oldNode && (oldNode != anchorNode || oldOff != anchorOffset) && sel.extend) sel.extend(oldNode, oldOff);
			} catch (_) {}
			if (oldBidiLevel != null) sel.caretBidiLevel = oldBidiLevel;
			return result;
		});
	}
	var cachedState = null;
	var cachedDir = null;
	var cachedResult = false;
	function endOfTextblock(view, state, dir) {
		if (cachedState == state && cachedDir == dir) return cachedResult;
		cachedState = state;
		cachedDir = dir;
		return cachedResult = dir == "up" || dir == "down" ? endOfTextblockVertical(view, state, dir) : endOfTextblockHorizontal(view, state, dir);
	}
	var NOT_DIRTY = 0;
	var CHILD_DIRTY = 1;
	var CONTENT_DIRTY = 2;
	var NODE_DIRTY = 3;
	var ViewDesc = class {
		constructor(parent, children, dom, contentDOM) {
			this.parent = parent;
			this.children = children;
			this.dom = dom;
			this.contentDOM = contentDOM;
			this.dirty = NOT_DIRTY;
			dom.pmViewDesc = this;
		}
		matchesWidget(widget) {
			return false;
		}
		matchesMark(mark) {
			return false;
		}
		matchesNode(node, outerDeco, innerDeco) {
			return false;
		}
		matchesHack(nodeName) {
			return false;
		}
		parseRule() {
			return null;
		}
		stopEvent(event) {
			return false;
		}
		get size() {
			let size = 0;
			for (let i = 0; i < this.children.length; i++) size += this.children[i].size;
			return size;
		}
		get border() {
			return 0;
		}
		destroy() {
			this.parent = void 0;
			if (this.dom.pmViewDesc == this) this.dom.pmViewDesc = void 0;
			for (let i = 0; i < this.children.length; i++) this.children[i].destroy();
		}
		posBeforeChild(child) {
			for (let i = 0, pos = this.posAtStart;; i++) {
				let cur = this.children[i];
				if (cur == child) return pos;
				pos += cur.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(dom, offset, bias) {
			if (this.contentDOM && this.contentDOM.contains(dom.nodeType == 1 ? dom : dom.parentNode)) if (bias < 0) {
				let domBefore;
				let desc;
				if (dom == this.contentDOM) domBefore = dom.childNodes[offset - 1];
				else {
					while (dom.parentNode != this.contentDOM) dom = dom.parentNode;
					domBefore = dom.previousSibling;
				}
				while (domBefore && !((desc = domBefore.pmViewDesc) && desc.parent == this)) domBefore = domBefore.previousSibling;
				return domBefore ? this.posBeforeChild(desc) + desc.size : this.posAtStart;
			} else {
				let domAfter;
				let desc;
				if (dom == this.contentDOM) domAfter = dom.childNodes[offset];
				else {
					while (dom.parentNode != this.contentDOM) dom = dom.parentNode;
					domAfter = dom.nextSibling;
				}
				while (domAfter && !((desc = domAfter.pmViewDesc) && desc.parent == this)) domAfter = domAfter.nextSibling;
				return domAfter ? this.posBeforeChild(desc) : this.posAtEnd;
			}
			let atEnd;
			if (dom == this.dom && this.contentDOM) atEnd = offset > domIndex(this.contentDOM);
			else if (this.contentDOM && this.contentDOM != this.dom && this.dom.contains(this.contentDOM)) atEnd = dom.compareDocumentPosition(this.contentDOM) & 2;
			else if (this.dom.firstChild) {
				if (offset == 0) for (let search = dom;; search = search.parentNode) {
					if (search == this.dom) {
						atEnd = false;
						break;
					}
					if (search.previousSibling) break;
				}
				if (atEnd == null && offset == dom.childNodes.length) for (let search = dom;; search = search.parentNode) {
					if (search == this.dom) {
						atEnd = true;
						break;
					}
					if (search.nextSibling) break;
				}
			}
			return (atEnd == null ? bias > 0 : atEnd) ? this.posAtEnd : this.posAtStart;
		}
		nearestDesc(dom, onlyNodes = false) {
			for (let first = true, cur = dom; cur; cur = cur.parentNode) {
				let desc = this.getDesc(cur);
				let nodeDOM;
				if (desc && (!onlyNodes || desc.node)) if (first && (nodeDOM = desc.nodeDOM) && !(nodeDOM.nodeType == 1 ? nodeDOM.contains(dom.nodeType == 1 ? dom : dom.parentNode) : nodeDOM == dom)) first = false;
				else return desc;
			}
		}
		getDesc(dom) {
			let desc = dom.pmViewDesc;
			for (let cur = desc; cur; cur = cur.parent) if (cur == this) return desc;
		}
		posFromDOM(dom, offset, bias) {
			for (let scan = dom; scan; scan = scan.parentNode) {
				let desc = this.getDesc(scan);
				if (desc) return desc.localPosFromDOM(dom, offset, bias);
			}
			return -1;
		}
		descAt(pos) {
			for (let i = 0, offset = 0; i < this.children.length; i++) {
				let child = this.children[i];
				let end = offset + child.size;
				if (offset == pos && end != offset) {
					while (!child.border && child.children.length) for (let i = 0; i < child.children.length; i++) {
						let inner = child.children[i];
						if (inner.size) {
							child = inner;
							break;
						}
					}
					return child;
				}
				if (pos < end) return child.descAt(pos - offset - child.border);
				offset = end;
			}
		}
		domFromPos(pos, side) {
			if (!this.contentDOM) return {
				node: this.dom,
				offset: 0,
				atom: pos + 1
			};
			let i = 0;
			let offset = 0;
			for (let curPos = 0; i < this.children.length; i++) {
				let child = this.children[i];
				let end = curPos + child.size;
				if (end > pos || child instanceof TrailingHackViewDesc) {
					offset = pos - curPos;
					break;
				}
				curPos = end;
			}
			if (offset) return this.children[i].domFromPos(offset - this.children[i].border, side);
			for (let prev; i && !(prev = this.children[i - 1]).size && prev instanceof WidgetViewDesc && prev.side >= 0; i--);
			if (side <= 0) {
				let prev;
				let enter = true;
				for (;; i--, enter = false) {
					prev = i ? this.children[i - 1] : null;
					if (!prev || prev.dom.parentNode == this.contentDOM) break;
				}
				if (prev && side && enter && !prev.border && !prev.domAtom) return prev.domFromPos(prev.size, side);
				return {
					node: this.contentDOM,
					offset: prev ? domIndex(prev.dom) + 1 : 0
				};
			} else {
				let next;
				let enter = true;
				for (;; i++, enter = false) {
					next = i < this.children.length ? this.children[i] : null;
					if (!next || next.dom.parentNode == this.contentDOM) break;
				}
				if (next && enter && !next.border && !next.domAtom) return next.domFromPos(0, side);
				return {
					node: this.contentDOM,
					offset: next ? domIndex(next.dom) : this.contentDOM.childNodes.length
				};
			}
		}
		parseRange(from, to, base = 0) {
			if (this.children.length == 0) return {
				node: this.contentDOM,
				from,
				to,
				fromOffset: 0,
				toOffset: this.contentDOM.childNodes.length
			};
			let fromOffset = -1;
			let toOffset = -1;
			for (let offset = base, i = 0;; i++) {
				let child = this.children[i];
				let end = offset + child.size;
				if (fromOffset == -1 && from <= end) {
					let childBase = offset + child.border;
					if (from >= childBase && to <= end - child.border && child.node && child.contentDOM && this.contentDOM.contains(child.contentDOM)) return child.parseRange(from, to, childBase);
					from = offset;
					for (let j = i; j > 0; j--) {
						let prev = this.children[j - 1];
						if (prev.size && prev.dom.parentNode == this.contentDOM && !prev.emptyChildAt(1)) {
							fromOffset = domIndex(prev.dom) + 1;
							break;
						}
						from -= prev.size;
					}
					if (fromOffset == -1) fromOffset = 0;
				}
				if (fromOffset > -1 && (end > to || i == this.children.length - 1)) {
					to = end;
					for (let j = i + 1; j < this.children.length; j++) {
						let next = this.children[j];
						if (next.size && next.dom.parentNode == this.contentDOM && !next.emptyChildAt(-1)) {
							toOffset = domIndex(next.dom);
							break;
						}
						to += next.size;
					}
					if (toOffset == -1) toOffset = this.contentDOM.childNodes.length;
					break;
				}
				offset = end;
			}
			return {
				node: this.contentDOM,
				from,
				to,
				fromOffset,
				toOffset
			};
		}
		emptyChildAt(side) {
			if (this.border || !this.contentDOM || !this.children.length) return false;
			let child = this.children[side < 0 ? 0 : this.children.length - 1];
			return child.size == 0 || child.emptyChildAt(side);
		}
		domAfterPos(pos) {
			let { node, offset } = this.domFromPos(pos, 0);
			if (node.nodeType != 1 || offset == node.childNodes.length) throw new RangeError("No node after pos " + pos);
			return node.childNodes[offset];
		}
		setSelection(anchor, head, view, force = false) {
			let from = Math.min(anchor, head);
			let to = Math.max(anchor, head);
			for (let i = 0, offset = 0; i < this.children.length; i++) {
				let child = this.children[i];
				let end = offset + child.size;
				if (from > offset && to < end) return child.setSelection(anchor - offset - child.border, head - offset - child.border, view, force);
				offset = end;
			}
			let anchorDOM = this.domFromPos(anchor, anchor ? -1 : 1);
			let headDOM = head == anchor ? anchorDOM : this.domFromPos(head, head ? -1 : 1);
			let domSel = view.root.getSelection();
			let selRange = view.domSelectionRange();
			let brKludge = false;
			if ((gecko || safari) && anchor == head) {
				let { node, offset } = anchorDOM;
				if (node.nodeType == 3) {
					brKludge = !!(offset && node.nodeValue[offset - 1] == "\n");
					if (brKludge && offset == node.nodeValue.length) for (let scan = node, after; scan; scan = scan.parentNode) {
						if (after = scan.nextSibling) {
							if (after.nodeName == "BR") anchorDOM = headDOM = {
								node: after.parentNode,
								offset: domIndex(after) + 1
							};
							break;
						}
						let desc = scan.pmViewDesc;
						if (desc && desc.node && desc.node.isBlock) break;
					}
				} else {
					let prev = node.childNodes[offset - 1];
					brKludge = prev && (prev.nodeName == "BR" || prev.contentEditable == "false");
				}
			}
			if (gecko && selRange.focusNode && selRange.focusNode != headDOM.node && selRange.focusNode.nodeType == 1) {
				let after = selRange.focusNode.childNodes[selRange.focusOffset];
				if (after && after.contentEditable == "false") force = true;
			}
			if (!(force || brKludge && safari) && isEquivalentPosition(anchorDOM.node, anchorDOM.offset, selRange.anchorNode, selRange.anchorOffset) && isEquivalentPosition(headDOM.node, headDOM.offset, selRange.focusNode, selRange.focusOffset)) return;
			let domSelExtended = false;
			if ((domSel.extend || anchor == head) && !(brKludge && gecko)) {
				domSel.collapse(anchorDOM.node, anchorDOM.offset);
				try {
					if (anchor != head) domSel.extend(headDOM.node, headDOM.offset);
					domSelExtended = true;
				} catch (_) {}
			}
			if (!domSelExtended) {
				if (anchor > head) {
					let tmp = anchorDOM;
					anchorDOM = headDOM;
					headDOM = tmp;
				}
				let range = document.createRange();
				range.setEnd(headDOM.node, headDOM.offset);
				range.setStart(anchorDOM.node, anchorDOM.offset);
				domSel.removeAllRanges();
				domSel.addRange(range);
			}
		}
		ignoreMutation(mutation) {
			return !this.contentDOM && mutation.type != "selection";
		}
		get contentLost() {
			return this.contentDOM && this.contentDOM != this.dom && !this.dom.contains(this.contentDOM);
		}
		markDirty(from, to) {
			for (let offset = 0, i = 0; i < this.children.length; i++) {
				let child = this.children[i];
				let end = offset + child.size;
				if (offset == end ? from <= end && to >= offset : from < end && to > offset) {
					let startInside = offset + child.border;
					let endInside = end - child.border;
					if (from >= startInside && to <= endInside) {
						this.dirty = from == offset || to == end ? CONTENT_DIRTY : CHILD_DIRTY;
						if (from == startInside && to == endInside && (child.contentLost || child.dom.parentNode != this.contentDOM)) child.dirty = NODE_DIRTY;
						else child.markDirty(from - startInside, to - startInside);
						return;
					} else child.dirty = child.dom == child.contentDOM && child.dom.parentNode == this.contentDOM && !child.children.length ? CONTENT_DIRTY : NODE_DIRTY;
				}
				offset = end;
			}
			this.dirty = CONTENT_DIRTY;
		}
		markParentsDirty() {
			let level = 1;
			for (let node = this.parent; node; node = node.parent, level++) {
				let dirty = level == 1 ? CONTENT_DIRTY : CHILD_DIRTY;
				if (node.dirty < dirty) node.dirty = dirty;
			}
		}
		get domAtom() {
			return false;
		}
		get ignoreForCoords() {
			return false;
		}
		get ignoreForSelection() {
			return false;
		}
		isText(text) {
			return false;
		}
	};
	var WidgetViewDesc = class extends ViewDesc {
		constructor(parent, widget, view, pos) {
			let self;
			let dom = widget.type.toDOM;
			if (typeof dom == "function") dom = dom(view, () => {
				if (!self) return pos;
				if (self.parent) return self.parent.posBeforeChild(self);
			});
			if (!widget.type.spec.raw) {
				if (dom.nodeType != 1) {
					let wrap = document.createElement("span");
					wrap.appendChild(dom);
					dom = wrap;
				}
				dom.contentEditable = "false";
				dom.classList.add("ProseMirror-widget");
			}
			super(parent, [], dom, null);
			this.widget = widget;
			this.widget = widget;
			self = this;
		}
		matchesWidget(widget) {
			return this.dirty == NOT_DIRTY && widget.type.eq(this.widget.type);
		}
		parseRule() {
			return { ignore: true };
		}
		stopEvent(event) {
			let stop = this.widget.spec.stopEvent;
			return stop ? stop(event) : false;
		}
		ignoreMutation(mutation) {
			return mutation.type != "selection" || this.widget.spec.ignoreSelection;
		}
		destroy() {
			this.widget.type.destroy(this.dom);
			super.destroy();
		}
		get domAtom() {
			return true;
		}
		get ignoreForSelection() {
			return !!this.widget.type.spec.relaxedSide;
		}
		get side() {
			return this.widget.type.side;
		}
	};
	var CompositionViewDesc = class extends ViewDesc {
		constructor(parent, dom, textDOM, text) {
			super(parent, [], dom, null);
			this.textDOM = textDOM;
			this.text = text;
		}
		get size() {
			return this.text.length;
		}
		localPosFromDOM(dom, offset) {
			if (dom != this.textDOM) return this.posAtStart + (offset ? this.size : 0);
			return this.posAtStart + offset;
		}
		domFromPos(pos) {
			return {
				node: this.textDOM,
				offset: pos
			};
		}
		ignoreMutation(mut) {
			return mut.type === "characterData" && mut.target.nodeValue == mut.oldValue;
		}
	};
	var MarkViewDesc = class MarkViewDesc extends ViewDesc {
		constructor(parent, mark, dom, contentDOM, spec) {
			super(parent, [], dom, contentDOM);
			this.mark = mark;
			this.spec = spec;
		}
		static create(parent, mark, inline, view) {
			let custom = view.nodeViews[mark.type.name];
			let spec = custom && custom(mark, view, inline);
			if (!spec || !spec.dom) spec = DOMSerializer.renderSpec(document, mark.type.spec.toDOM(mark, inline), null, mark.attrs);
			return new MarkViewDesc(parent, mark, spec.dom, spec.contentDOM || spec.dom, spec);
		}
		parseRule() {
			if (this.dirty & NODE_DIRTY || this.mark.type.spec.reparseInView) return null;
			return {
				mark: this.mark.type.name,
				attrs: this.mark.attrs,
				contentElement: this.contentDOM
			};
		}
		matchesMark(mark) {
			return this.dirty != NODE_DIRTY && this.mark.eq(mark);
		}
		markDirty(from, to) {
			super.markDirty(from, to);
			if (this.dirty != NOT_DIRTY) {
				let parent = this.parent;
				while (!parent.node) parent = parent.parent;
				if (parent.dirty < this.dirty) parent.dirty = this.dirty;
				this.dirty = NOT_DIRTY;
			}
		}
		slice(from, to, view) {
			let copy = MarkViewDesc.create(this.parent, this.mark, true, view);
			let nodes = this.children;
			let size = this.size;
			if (to < size) nodes = replaceNodes(nodes, to, size, view);
			if (from > 0) nodes = replaceNodes(nodes, 0, from, view);
			for (let i = 0; i < nodes.length; i++) nodes[i].parent = copy;
			copy.children = nodes;
			return copy;
		}
		ignoreMutation(mutation) {
			return this.spec.ignoreMutation ? this.spec.ignoreMutation(mutation) : super.ignoreMutation(mutation);
		}
		destroy() {
			if (this.spec.destroy) this.spec.destroy();
			super.destroy();
		}
	};
	var NodeViewDesc = class NodeViewDesc extends ViewDesc {
		constructor(parent, node, outerDeco, innerDeco, dom, contentDOM, nodeDOM, view, pos) {
			super(parent, [], dom, contentDOM);
			this.node = node;
			this.outerDeco = outerDeco;
			this.innerDeco = innerDeco;
			this.nodeDOM = nodeDOM;
		}
		static create(parent, node, outerDeco, innerDeco, view, pos) {
			let custom = view.nodeViews[node.type.name];
			let descObj;
			let spec = custom && custom(node, view, () => {
				if (!descObj) return pos;
				if (descObj.parent) return descObj.parent.posBeforeChild(descObj);
			}, outerDeco, innerDeco);
			let dom = spec && spec.dom;
			let contentDOM = spec && spec.contentDOM;
			if (node.isText) {
				if (!dom) dom = document.createTextNode(node.text);
				else if (dom.nodeType != 3) throw new RangeError("Text must be rendered as a DOM text node");
			} else if (!dom) {
				let spec = DOMSerializer.renderSpec(document, node.type.spec.toDOM(node), null, node.attrs);
				({dom, contentDOM} = spec);
			}
			if (!contentDOM && !node.isText && dom.nodeName != "BR") {
				if (!dom.hasAttribute("contenteditable")) dom.contentEditable = "false";
				if (node.type.spec.draggable) dom.draggable = true;
			}
			let nodeDOM = dom;
			dom = applyOuterDeco(dom, outerDeco, node);
			if (spec) return descObj = new CustomNodeViewDesc(parent, node, outerDeco, innerDeco, dom, contentDOM || null, nodeDOM, spec, view, pos + 1);
			else if (node.isText) return new TextViewDesc(parent, node, outerDeco, innerDeco, dom, nodeDOM, view);
			else return new NodeViewDesc(parent, node, outerDeco, innerDeco, dom, contentDOM || null, nodeDOM, view, pos + 1);
		}
		parseRule() {
			if (this.node.type.spec.reparseInView) return null;
			let rule = {
				node: this.node.type.name,
				attrs: this.node.attrs
			};
			if (this.node.type.whitespace == "pre") rule.preserveWhitespace = "full";
			if (!this.contentDOM) rule.getContent = () => this.node.content;
			else if (!this.contentLost) rule.contentElement = this.contentDOM;
			else {
				for (let i = this.children.length - 1; i >= 0; i--) {
					let child = this.children[i];
					if (this.dom.contains(child.dom.parentNode)) {
						rule.contentElement = child.dom.parentNode;
						break;
					}
				}
				if (!rule.contentElement) rule.getContent = () => Fragment$1.empty;
			}
			return rule;
		}
		matchesNode(node, outerDeco, innerDeco) {
			return this.dirty == NOT_DIRTY && node.eq(this.node) && sameOuterDeco(outerDeco, this.outerDeco) && innerDeco.eq(this.innerDeco);
		}
		get size() {
			return this.node.nodeSize;
		}
		get border() {
			return this.node.isLeaf ? 0 : 1;
		}
		updateChildren(view, pos) {
			let inline = this.node.inlineContent;
			let off = pos;
			let composition = view.composing ? this.localCompositionInfo(view, pos) : null;
			let localComposition = composition && composition.pos > -1 ? composition : null;
			let compositionInChild = composition && composition.pos < 0;
			let updater = new ViewTreeUpdater(this, localComposition && localComposition.node, view);
			iterDeco(this.node, this.innerDeco, (widget, i, insideNode) => {
				if (widget.spec.marks) updater.syncToMarks(widget.spec.marks, inline, view, i);
				else if (widget.type.side >= 0 && !insideNode) updater.syncToMarks(i == this.node.childCount ? Mark$1.none : this.node.child(i).marks, inline, view, i);
				updater.placeWidget(widget, view, off);
			}, (child, outerDeco, innerDeco, i) => {
				updater.syncToMarks(child.marks, inline, view, i);
				let compIndex;
				if (updater.findNodeMatch(child, outerDeco, innerDeco, i));
				else if (compositionInChild && view.state.selection.from > off && view.state.selection.to < off + child.nodeSize && (compIndex = updater.findIndexWithChild(composition.node)) > -1 && updater.updateNodeAt(child, outerDeco, innerDeco, compIndex, view));
				else if (updater.updateNextNode(child, outerDeco, innerDeco, view, i, off));
				else updater.addNode(child, outerDeco, innerDeco, view, off);
				off += child.nodeSize;
			});
			updater.syncToMarks([], inline, view, 0);
			if (this.node.isTextblock) updater.addTextblockHacks();
			updater.destroyRest();
			if (updater.changed || this.dirty == CONTENT_DIRTY) {
				if (localComposition) this.protectLocalComposition(view, localComposition);
				renderDescs(this.contentDOM, this.children, view);
				if (ios) iosHacks(this.dom);
			}
		}
		localCompositionInfo(view, pos) {
			let { from, to } = view.state.selection;
			if (!(view.state.selection instanceof TextSelection) || from < pos || to > pos + this.node.content.size) return null;
			let textNode = view.input.compositionNode;
			if (!textNode || !this.dom.contains(textNode.parentNode)) return null;
			if (this.node.inlineContent) {
				let text = textNode.nodeValue;
				let textPos = findTextInFragment(this.node.content, text, from - pos, to - pos);
				return textPos < 0 ? null : {
					node: textNode,
					pos: textPos,
					text
				};
			} else return {
				node: textNode,
				pos: -1,
				text: ""
			};
		}
		protectLocalComposition(view, { node, pos, text }) {
			if (this.getDesc(node)) return;
			let topNode = node;
			for (;; topNode = topNode.parentNode) {
				if (topNode.parentNode == this.contentDOM) break;
				while (topNode.previousSibling) topNode.parentNode.removeChild(topNode.previousSibling);
				while (topNode.nextSibling) topNode.parentNode.removeChild(topNode.nextSibling);
				if (topNode.pmViewDesc) topNode.pmViewDesc = void 0;
			}
			let desc = new CompositionViewDesc(this, topNode, node, text);
			view.input.compositionNodes.push(desc);
			this.children = replaceNodes(this.children, pos, pos + text.length, view, desc);
		}
		update(node, outerDeco, innerDeco, view) {
			if (this.dirty == NODE_DIRTY || !node.sameMarkup(this.node)) return false;
			this.updateInner(node, outerDeco, innerDeco, view);
			return true;
		}
		updateInner(node, outerDeco, innerDeco, view) {
			this.updateOuterDeco(outerDeco);
			this.node = node;
			this.innerDeco = innerDeco;
			if (this.contentDOM) this.updateChildren(view, this.posAtStart);
			this.dirty = NOT_DIRTY;
		}
		updateOuterDeco(outerDeco) {
			if (sameOuterDeco(outerDeco, this.outerDeco)) return;
			let needsWrap = this.nodeDOM.nodeType != 1;
			let oldDOM = this.dom;
			this.dom = patchOuterDeco(this.dom, this.nodeDOM, computeOuterDeco(this.outerDeco, this.node, needsWrap), computeOuterDeco(outerDeco, this.node, needsWrap));
			if (this.dom != oldDOM) {
				oldDOM.pmViewDesc = void 0;
				this.dom.pmViewDesc = this;
			}
			this.outerDeco = outerDeco;
		}
		selectNode() {
			if (this.nodeDOM.nodeType == 1) {
				this.nodeDOM.classList.add("ProseMirror-selectednode");
				if (this.contentDOM || !this.node.type.spec.draggable) this.nodeDOM.draggable = true;
			}
		}
		deselectNode() {
			if (this.nodeDOM.nodeType == 1) {
				this.nodeDOM.classList.remove("ProseMirror-selectednode");
				if (this.contentDOM || !this.node.type.spec.draggable) this.nodeDOM.removeAttribute("draggable");
			}
		}
		get domAtom() {
			return this.node.isAtom;
		}
	};
	function docViewDesc(doc, outerDeco, innerDeco, dom, view) {
		applyOuterDeco(dom, outerDeco, doc);
		let docView = new NodeViewDesc(void 0, doc, outerDeco, innerDeco, dom, dom, dom, view, 0);
		if (docView.contentDOM) docView.updateChildren(view, 0);
		return docView;
	}
	var TextViewDesc = class TextViewDesc extends NodeViewDesc {
		constructor(parent, node, outerDeco, innerDeco, dom, nodeDOM, view) {
			super(parent, node, outerDeco, innerDeco, dom, null, nodeDOM, view, 0);
		}
		parseRule() {
			let skip = this.nodeDOM.parentNode;
			while (skip && skip != this.dom && !skip.pmIsDeco) skip = skip.parentNode;
			return { skip: skip || true };
		}
		update(node, outerDeco, innerDeco, view) {
			if (this.dirty == NODE_DIRTY || this.dirty != NOT_DIRTY && !this.inParent() || !node.sameMarkup(this.node)) return false;
			this.updateOuterDeco(outerDeco);
			if ((this.dirty != NOT_DIRTY || node.text != this.node.text) && node.text != this.nodeDOM.nodeValue) {
				this.nodeDOM.nodeValue = node.text;
				if (view.trackWrites == this.nodeDOM) view.trackWrites = null;
			}
			this.node = node;
			this.dirty = NOT_DIRTY;
			return true;
		}
		inParent() {
			let parentDOM = this.parent.contentDOM;
			for (let n = this.nodeDOM; n; n = n.parentNode) if (n == parentDOM) return true;
			return false;
		}
		domFromPos(pos) {
			return {
				node: this.nodeDOM,
				offset: pos
			};
		}
		localPosFromDOM(dom, offset, bias) {
			if (dom == this.nodeDOM) return this.posAtStart + Math.min(offset, this.node.text.length);
			return super.localPosFromDOM(dom, offset, bias);
		}
		ignoreMutation(mutation) {
			return mutation.type != "characterData" && mutation.type != "selection";
		}
		slice(from, to, view) {
			let node = this.node.cut(from, to);
			let dom = document.createTextNode(node.text);
			return new TextViewDesc(this.parent, node, this.outerDeco, this.innerDeco, dom, dom, view);
		}
		markDirty(from, to) {
			super.markDirty(from, to);
			if (this.dom != this.nodeDOM && (from == 0 || to == this.nodeDOM.nodeValue.length)) this.dirty = NODE_DIRTY;
		}
		get domAtom() {
			return false;
		}
		isText(text) {
			return this.node.text == text;
		}
	};
	var TrailingHackViewDesc = class extends ViewDesc {
		parseRule() {
			return { ignore: true };
		}
		matchesHack(nodeName) {
			return this.dirty == NOT_DIRTY && this.dom.nodeName == nodeName;
		}
		get domAtom() {
			return true;
		}
		get ignoreForCoords() {
			return this.dom.nodeName == "IMG";
		}
	};
	var CustomNodeViewDesc = class extends NodeViewDesc {
		constructor(parent, node, outerDeco, innerDeco, dom, contentDOM, nodeDOM, spec, view, pos) {
			super(parent, node, outerDeco, innerDeco, dom, contentDOM, nodeDOM, view, pos);
			this.spec = spec;
		}
		update(node, outerDeco, innerDeco, view) {
			if (this.dirty == NODE_DIRTY) return false;
			if (this.spec.update && (this.node.type == node.type || this.spec.multiType)) {
				let result = this.spec.update(node, outerDeco, innerDeco);
				if (result) this.updateInner(node, outerDeco, innerDeco, view);
				return result;
			} else if (!this.contentDOM && !node.isLeaf) return false;
			else return super.update(node, outerDeco, innerDeco, view);
		}
		selectNode() {
			this.spec.selectNode ? this.spec.selectNode() : super.selectNode();
		}
		deselectNode() {
			this.spec.deselectNode ? this.spec.deselectNode() : super.deselectNode();
		}
		setSelection(anchor, head, view, force) {
			this.spec.setSelection ? this.spec.setSelection(anchor, head, view.root) : super.setSelection(anchor, head, view, force);
		}
		destroy() {
			if (this.spec.destroy) this.spec.destroy();
			super.destroy();
		}
		stopEvent(event) {
			return this.spec.stopEvent ? this.spec.stopEvent(event) : false;
		}
		ignoreMutation(mutation) {
			return this.spec.ignoreMutation ? this.spec.ignoreMutation(mutation) : super.ignoreMutation(mutation);
		}
	};
	function renderDescs(parentDOM, descs, view) {
		let dom = parentDOM.firstChild;
		let written = false;
		for (let i = 0; i < descs.length; i++) {
			let desc = descs[i];
			let childDOM = desc.dom;
			if (childDOM.parentNode == parentDOM) {
				while (childDOM != dom) {
					dom = rm(dom);
					written = true;
				}
				dom = dom.nextSibling;
			} else {
				written = true;
				parentDOM.insertBefore(childDOM, dom);
			}
			if (desc instanceof MarkViewDesc) {
				let pos = dom ? dom.previousSibling : parentDOM.lastChild;
				renderDescs(desc.contentDOM, desc.children, view);
				dom = pos ? pos.nextSibling : parentDOM.firstChild;
			}
		}
		while (dom) {
			dom = rm(dom);
			written = true;
		}
		if (written && view.trackWrites == parentDOM) view.trackWrites = null;
	}
	var OuterDecoLevel = function(nodeName) {
		if (nodeName) this.nodeName = nodeName;
	};
	OuterDecoLevel.prototype = Object.create(null);
	var noDeco = [new OuterDecoLevel()];
	function computeOuterDeco(outerDeco, node, needsWrap) {
		if (outerDeco.length == 0) return noDeco;
		let top = needsWrap ? noDeco[0] : new OuterDecoLevel();
		let result = [top];
		for (let i = 0; i < outerDeco.length; i++) {
			let attrs = outerDeco[i].type.attrs;
			if (!attrs) continue;
			if (attrs.nodeName) result.push(top = new OuterDecoLevel(attrs.nodeName));
			for (let name in attrs) {
				let val = attrs[name];
				if (val == null) continue;
				if (needsWrap && result.length == 1) result.push(top = new OuterDecoLevel(node.isInline ? "span" : "div"));
				if (name == "class") top.class = (top.class ? top.class + " " : "") + val;
				else if (name == "style") top.style = (top.style ? top.style + ";" : "") + val;
				else if (name != "nodeName") top[name] = val;
			}
		}
		return result;
	}
	function patchOuterDeco(outerDOM, nodeDOM, prevComputed, curComputed) {
		if (prevComputed == noDeco && curComputed == noDeco) return nodeDOM;
		let curDOM = nodeDOM;
		for (let i = 0; i < curComputed.length; i++) {
			let deco = curComputed[i];
			let prev = prevComputed[i];
			if (i) {
				let parent;
				if (prev && prev.nodeName == deco.nodeName && curDOM != outerDOM && (parent = curDOM.parentNode) && parent.nodeName.toLowerCase() == deco.nodeName) curDOM = parent;
				else {
					parent = document.createElement(deco.nodeName);
					parent.pmIsDeco = true;
					parent.appendChild(curDOM);
					prev = noDeco[0];
					curDOM = parent;
				}
			}
			patchAttributes(curDOM, prev || noDeco[0], deco);
		}
		return curDOM;
	}
	function patchAttributes(dom, prev, cur) {
		for (let name in prev) if (name != "class" && name != "style" && name != "nodeName" && !(name in cur)) dom.removeAttribute(name);
		for (let name in cur) if (name != "class" && name != "style" && name != "nodeName" && cur[name] != prev[name]) dom.setAttribute(name, cur[name]);
		if (prev.class != cur.class) {
			let prevList = prev.class ? prev.class.split(" ").filter(Boolean) : [];
			let curList = cur.class ? cur.class.split(" ").filter(Boolean) : [];
			for (let i = 0; i < prevList.length; i++) if (curList.indexOf(prevList[i]) == -1) dom.classList.remove(prevList[i]);
			for (let i = 0; i < curList.length; i++) if (prevList.indexOf(curList[i]) == -1) dom.classList.add(curList[i]);
			if (dom.classList.length == 0) dom.removeAttribute("class");
		}
		if (prev.style != cur.style) {
			if (prev.style) {
				let prop = /\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;
				let m;
				while (m = prop.exec(prev.style)) dom.style.removeProperty(m[1]);
			}
			if (cur.style) dom.style.cssText += cur.style;
		}
	}
	function applyOuterDeco(dom, deco, node) {
		return patchOuterDeco(dom, dom, noDeco, computeOuterDeco(deco, node, dom.nodeType != 1));
	}
	function sameOuterDeco(a, b) {
		if (a.length != b.length) return false;
		for (let i = 0; i < a.length; i++) if (!a[i].type.eq(b[i].type)) return false;
		return true;
	}
	function rm(dom) {
		let next = dom.nextSibling;
		dom.parentNode.removeChild(dom);
		return next;
	}
	var ViewTreeUpdater = class {
		constructor(top, lock, view) {
			this.lock = lock;
			this.view = view;
			this.index = 0;
			this.stack = [];
			this.changed = false;
			this.top = top;
			this.preMatch = preMatch(top.node.content, top);
		}
		destroyBetween(start, end) {
			if (start == end) return;
			for (let i = start; i < end; i++) this.top.children[i].destroy();
			this.top.children.splice(start, end - start);
			this.changed = true;
		}
		destroyRest() {
			this.destroyBetween(this.index, this.top.children.length);
		}
		syncToMarks(marks, inline, view, parentIndex) {
			let keep = 0;
			let depth = this.stack.length >> 1;
			let maxKeep = Math.min(depth, marks.length);
			while (keep < maxKeep && (keep == depth - 1 ? this.top : this.stack[keep + 1 << 1]).matchesMark(marks[keep]) && marks[keep].type.spec.spanning !== false) keep++;
			while (keep < depth) {
				this.destroyRest();
				this.top.dirty = NOT_DIRTY;
				this.index = this.stack.pop();
				this.top = this.stack.pop();
				depth--;
			}
			while (depth < marks.length) {
				this.stack.push(this.top, this.index + 1);
				let found = -1;
				let scanTo = this.top.children.length;
				if (parentIndex < this.preMatch.index) scanTo = Math.min(this.index + 3, scanTo);
				for (let i = this.index; i < scanTo; i++) {
					let next = this.top.children[i];
					if (next.matchesMark(marks[depth]) && !this.isLocked(next.dom)) {
						found = i;
						break;
					}
				}
				if (found > -1) {
					if (found > this.index) {
						this.changed = true;
						this.destroyBetween(this.index, found);
					}
					this.top = this.top.children[this.index];
				} else {
					let markDesc = MarkViewDesc.create(this.top, marks[depth], inline, view);
					this.top.children.splice(this.index, 0, markDesc);
					this.top = markDesc;
					this.changed = true;
				}
				this.index = 0;
				depth++;
			}
		}
		findNodeMatch(node, outerDeco, innerDeco, index) {
			let found = -1;
			let targetDesc;
			if (index >= this.preMatch.index && (targetDesc = this.preMatch.matches[index - this.preMatch.index]).parent == this.top && targetDesc.matchesNode(node, outerDeco, innerDeco)) found = this.top.children.indexOf(targetDesc, this.index);
			else for (let i = this.index, e = Math.min(this.top.children.length, i + 5); i < e; i++) {
				let child = this.top.children[i];
				if (child.matchesNode(node, outerDeco, innerDeco) && !this.preMatch.matched.has(child)) {
					found = i;
					break;
				}
			}
			if (found < 0) return false;
			this.destroyBetween(this.index, found);
			this.index++;
			return true;
		}
		updateNodeAt(node, outerDeco, innerDeco, index, view) {
			let child = this.top.children[index];
			if (child.dirty == NODE_DIRTY && child.dom == child.contentDOM) child.dirty = CONTENT_DIRTY;
			if (!child.update(node, outerDeco, innerDeco, view)) return false;
			this.destroyBetween(this.index, index);
			this.index++;
			return true;
		}
		findIndexWithChild(domNode) {
			for (;;) {
				let parent = domNode.parentNode;
				if (!parent) return -1;
				if (parent == this.top.contentDOM) {
					let desc = domNode.pmViewDesc;
					if (desc) {
						for (let i = this.index; i < this.top.children.length; i++) if (this.top.children[i] == desc) return i;
					}
					return -1;
				}
				domNode = parent;
			}
		}
		updateNextNode(node, outerDeco, innerDeco, view, index, pos) {
			for (let i = this.index; i < this.top.children.length; i++) {
				let next = this.top.children[i];
				if (next instanceof NodeViewDesc) {
					let preMatch = this.preMatch.matched.get(next);
					if (preMatch != null && preMatch != index) return false;
					let nextDOM = next.dom;
					let updated;
					let locked = this.isLocked(nextDOM) && !(node.isText && next.node && next.node.isText && next.nodeDOM.nodeValue == node.text && next.dirty != NODE_DIRTY && sameOuterDeco(outerDeco, next.outerDeco));
					if (!locked && next.update(node, outerDeco, innerDeco, view)) {
						this.destroyBetween(this.index, i);
						if (next.dom != nextDOM) this.changed = true;
						this.index++;
						return true;
					} else if (!locked && (updated = this.recreateWrapper(next, node, outerDeco, innerDeco, view, pos))) {
						this.destroyBetween(this.index, i);
						this.top.children[this.index] = updated;
						if (updated.contentDOM) {
							updated.dirty = CONTENT_DIRTY;
							updated.updateChildren(view, pos + 1);
							updated.dirty = NOT_DIRTY;
						}
						this.changed = true;
						this.index++;
						return true;
					}
					break;
				}
			}
			return false;
		}
		recreateWrapper(next, node, outerDeco, innerDeco, view, pos) {
			if (next.dirty || node.isAtom || !next.children.length || !next.node.content.eq(node.content) || !sameOuterDeco(outerDeco, next.outerDeco) || !innerDeco.eq(next.innerDeco)) return null;
			let wrapper = NodeViewDesc.create(this.top, node, outerDeco, innerDeco, view, pos);
			if (wrapper.contentDOM) {
				wrapper.children = next.children;
				next.children = [];
				for (let ch of wrapper.children) ch.parent = wrapper;
			}
			next.destroy();
			return wrapper;
		}
		addNode(node, outerDeco, innerDeco, view, pos) {
			let desc = NodeViewDesc.create(this.top, node, outerDeco, innerDeco, view, pos);
			if (desc.contentDOM) desc.updateChildren(view, pos + 1);
			this.top.children.splice(this.index++, 0, desc);
			this.changed = true;
		}
		placeWidget(widget, view, pos) {
			let next = this.index < this.top.children.length ? this.top.children[this.index] : null;
			if (next && next.matchesWidget(widget) && (widget == next.widget || !next.widget.type.toDOM.parentNode)) this.index++;
			else {
				let desc = new WidgetViewDesc(this.top, widget, view, pos);
				this.top.children.splice(this.index++, 0, desc);
				this.changed = true;
			}
		}
		addTextblockHacks() {
			let lastChild = this.top.children[this.index - 1];
			let parent = this.top;
			while (lastChild instanceof MarkViewDesc) {
				parent = lastChild;
				lastChild = parent.children[parent.children.length - 1];
			}
			if (!lastChild || !(lastChild instanceof TextViewDesc) || /\n$/.test(lastChild.node.text) || this.view.requiresGeckoHackNode && /\s$/.test(lastChild.node.text)) {
				if ((safari || chrome) && lastChild && lastChild.dom.contentEditable == "false") this.addHackNode("IMG", parent);
				this.addHackNode("BR", this.top);
			}
		}
		addHackNode(nodeName, parent) {
			if (parent == this.top && this.index < parent.children.length && parent.children[this.index].matchesHack(nodeName)) this.index++;
			else {
				let dom = document.createElement(nodeName);
				if (nodeName == "IMG") {
					dom.className = "ProseMirror-separator";
					dom.alt = "";
				}
				if (nodeName == "BR") dom.className = "ProseMirror-trailingBreak";
				let hack = new TrailingHackViewDesc(this.top, [], dom, null);
				if (parent != this.top) parent.children.push(hack);
				else parent.children.splice(this.index++, 0, hack);
				this.changed = true;
			}
		}
		isLocked(node) {
			return this.lock && (node == this.lock || node.nodeType == 1 && node.contains(this.lock.parentNode));
		}
	};
	function preMatch(frag, parentDesc) {
		let curDesc = parentDesc;
		let descI = curDesc.children.length;
		let fI = frag.childCount;
		let matched = /* @__PURE__ */ new Map();
		let matches = [];
		outer: while (fI > 0) {
			let desc;
			for (;;) if (descI) {
				let next = curDesc.children[descI - 1];
				if (next instanceof MarkViewDesc) {
					curDesc = next;
					descI = next.children.length;
				} else {
					desc = next;
					descI--;
					break;
				}
			} else if (curDesc == parentDesc) break outer;
			else {
				descI = curDesc.parent.children.indexOf(curDesc);
				curDesc = curDesc.parent;
			}
			let node = desc.node;
			if (!node) continue;
			if (node != frag.child(fI - 1)) break;
			--fI;
			matched.set(desc, fI);
			matches.push(desc);
		}
		return {
			index: fI,
			matched,
			matches: matches.reverse()
		};
	}
	function compareSide(a, b) {
		return a.type.side - b.type.side;
	}
	function iterDeco(parent, deco, onWidget, onNode) {
		let locals = deco.locals(parent);
		let offset = 0;
		if (locals.length == 0) {
			for (let i = 0; i < parent.childCount; i++) {
				let child = parent.child(i);
				onNode(child, locals, deco.forChild(offset, child), i);
				offset += child.nodeSize;
			}
			return;
		}
		let decoIndex = 0;
		let active = [];
		let restNode = null;
		for (let parentIndex = 0;;) {
			let widget;
			let widgets;
			while (decoIndex < locals.length && locals[decoIndex].to == offset) {
				let next = locals[decoIndex++];
				if (next.widget) if (!widget) widget = next;
				else (widgets || (widgets = [widget])).push(next);
			}
			if (widget) if (widgets) {
				widgets.sort(compareSide);
				for (let i = 0; i < widgets.length; i++) onWidget(widgets[i], parentIndex, !!restNode);
			} else onWidget(widget, parentIndex, !!restNode);
			let child;
			let index;
			if (restNode) {
				index = -1;
				child = restNode;
				restNode = null;
			} else if (parentIndex < parent.childCount) {
				index = parentIndex;
				child = parent.child(parentIndex++);
			} else break;
			for (let i = 0; i < active.length; i++) if (active[i].to <= offset) active.splice(i--, 1);
			while (decoIndex < locals.length && locals[decoIndex].from <= offset && locals[decoIndex].to > offset) active.push(locals[decoIndex++]);
			let end = offset + child.nodeSize;
			if (child.isText) {
				let cutAt = end;
				if (decoIndex < locals.length && locals[decoIndex].from < cutAt) cutAt = locals[decoIndex].from;
				for (let i = 0; i < active.length; i++) if (active[i].to < cutAt) cutAt = active[i].to;
				if (cutAt < end) {
					restNode = child.cut(cutAt - offset);
					child = child.cut(0, cutAt - offset);
					end = cutAt;
					index = -1;
				}
			} else while (decoIndex < locals.length && locals[decoIndex].to < end) decoIndex++;
			let outerDeco = child.isInline && !child.isLeaf ? active.filter((d) => !d.inline) : active.slice();
			onNode(child, outerDeco, deco.forChild(offset, child), index);
			offset = end;
		}
	}
	function iosHacks(dom) {
		if (dom.nodeName == "UL" || dom.nodeName == "OL") {
			let oldCSS = dom.style.cssText;
			dom.style.cssText = oldCSS + "; list-style: square !important";
			window.getComputedStyle(dom).listStyle;
			dom.style.cssText = oldCSS;
		}
	}
	function findTextInFragment(frag, text, from, to) {
		for (let i = 0, pos = 0; i < frag.childCount && pos <= to;) {
			let child = frag.child(i++);
			let childStart = pos;
			pos += child.nodeSize;
			if (!child.isText) continue;
			let str = child.text;
			while (i < frag.childCount) {
				let next = frag.child(i++);
				pos += next.nodeSize;
				if (!next.isText) break;
				str += next.text;
			}
			if (pos >= from) {
				if (pos >= to && str.slice(to - text.length - childStart, to - childStart) == text) return to - text.length;
				let found = childStart < to ? str.lastIndexOf(text, to - childStart - 1) : -1;
				if (found >= 0 && found + text.length + childStart >= from) return childStart + found;
				if (from == to && str.length >= to + text.length - childStart && str.slice(to - childStart, to - childStart + text.length) == text) return to;
			}
		}
		return -1;
	}
	function replaceNodes(nodes, from, to, view, replacement) {
		let result = [];
		for (let i = 0, off = 0; i < nodes.length; i++) {
			let child = nodes[i];
			let start = off;
			let end = off += child.size;
			if (start >= to || end <= from) result.push(child);
			else {
				if (start < from) result.push(child.slice(0, from - start, view));
				if (replacement) {
					result.push(replacement);
					replacement = void 0;
				}
				if (end > to) result.push(child.slice(to - start, child.size, view));
			}
		}
		return result;
	}
	function selectionFromDOM(view, origin = null) {
		let domSel = view.domSelectionRange();
		let doc = view.state.doc;
		if (!domSel.focusNode) return null;
		let nearestDesc = view.docView.nearestDesc(domSel.focusNode);
		let inWidget = nearestDesc && nearestDesc.size == 0;
		let head = view.docView.posFromDOM(domSel.focusNode, domSel.focusOffset, 1);
		if (head < 0) return null;
		let $head = doc.resolve(head);
		let anchor;
		let selection;
		if (selectionCollapsed(domSel)) {
			anchor = head;
			while (nearestDesc && !nearestDesc.node) nearestDesc = nearestDesc.parent;
			let nearestDescNode = nearestDesc.node;
			if (nearestDesc && nearestDescNode.isAtom && NodeSelection.isSelectable(nearestDescNode) && nearestDesc.parent && !(nearestDescNode.isInline && isOnEdge(domSel.focusNode, domSel.focusOffset, nearestDesc.dom))) {
				let pos = nearestDesc.posBefore;
				selection = new NodeSelection(head == pos ? $head : doc.resolve(pos));
			}
		} else {
			if (domSel instanceof view.dom.ownerDocument.defaultView.Selection && domSel.rangeCount > 1) {
				let min = head;
				let max = head;
				for (let i = 0; i < domSel.rangeCount; i++) {
					let range = domSel.getRangeAt(i);
					min = Math.min(min, view.docView.posFromDOM(range.startContainer, range.startOffset, 1));
					max = Math.max(max, view.docView.posFromDOM(range.endContainer, range.endOffset, -1));
				}
				if (min < 0) return null;
				[anchor, head] = max == view.state.selection.anchor ? [max, min] : [min, max];
				$head = doc.resolve(head);
			} else anchor = view.docView.posFromDOM(domSel.anchorNode, domSel.anchorOffset, 1);
			if (anchor < 0) return null;
		}
		let $anchor = doc.resolve(anchor);
		if (!selection) {
			let bias = origin == "pointer" || view.state.selection.head < $head.pos && !inWidget ? 1 : -1;
			selection = selectionBetween(view, $anchor, $head, bias);
		}
		return selection;
	}
	function editorOwnsSelection(view) {
		return view.editable ? view.hasFocus() : hasSelection(view) && document.activeElement && document.activeElement.contains(view.dom);
	}
	function selectionToDOM(view, force = false) {
		let sel = view.state.selection;
		syncNodeSelection(view, sel);
		if (!editorOwnsSelection(view)) return;
		if (!force && view.input.mouseDown && view.input.mouseDown.allowDefault && chrome) {
			let domSel = view.domSelectionRange();
			let curSel = view.domObserver.currentSelection;
			if (domSel.anchorNode && curSel.anchorNode && isEquivalentPosition(domSel.anchorNode, domSel.anchorOffset, curSel.anchorNode, curSel.anchorOffset)) {
				view.input.mouseDown.delayedSelectionSync = true;
				view.domObserver.setCurSelection();
				return;
			}
		}
		view.domObserver.disconnectSelection();
		if (view.cursorWrapper) selectCursorWrapper(view);
		else {
			let { anchor, head } = sel, resetEditableFrom, resetEditableTo;
			if (brokenSelectBetweenUneditable && !(sel instanceof TextSelection)) {
				if (!sel.$from.parent.inlineContent) resetEditableFrom = temporarilyEditableNear(view, sel.from);
				if (!sel.empty && !sel.$from.parent.inlineContent) resetEditableTo = temporarilyEditableNear(view, sel.to);
			}
			view.docView.setSelection(anchor, head, view, force);
			if (brokenSelectBetweenUneditable) {
				if (resetEditableFrom) resetEditable(resetEditableFrom);
				if (resetEditableTo) resetEditable(resetEditableTo);
			}
			if (sel.visible) view.dom.classList.remove("ProseMirror-hideselection");
			else {
				view.dom.classList.add("ProseMirror-hideselection");
				if ("onselectionchange" in document) removeClassOnSelectionChange(view);
			}
		}
		view.domObserver.setCurSelection();
		view.domObserver.connectSelection();
	}
	var brokenSelectBetweenUneditable = safari || chrome && chrome_version < 63;
	function temporarilyEditableNear(view, pos) {
		let { node, offset } = view.docView.domFromPos(pos, 0);
		let after = offset < node.childNodes.length ? node.childNodes[offset] : null;
		let before = offset ? node.childNodes[offset - 1] : null;
		if (safari && after && after.contentEditable == "false") return setEditable(after);
		if ((!after || after.contentEditable == "false") && (!before || before.contentEditable == "false")) {
			if (after) return setEditable(after);
			else if (before) return setEditable(before);
		}
	}
	function setEditable(element) {
		element.contentEditable = "true";
		if (safari && element.draggable) {
			element.draggable = false;
			element.wasDraggable = true;
		}
		return element;
	}
	function resetEditable(element) {
		element.contentEditable = "false";
		if (element.wasDraggable) {
			element.draggable = true;
			element.wasDraggable = null;
		}
	}
	function removeClassOnSelectionChange(view) {
		let doc = view.dom.ownerDocument;
		doc.removeEventListener("selectionchange", view.input.hideSelectionGuard);
		let domSel = view.domSelectionRange();
		let node = domSel.anchorNode;
		let offset = domSel.anchorOffset;
		doc.addEventListener("selectionchange", view.input.hideSelectionGuard = () => {
			if (domSel.anchorNode != node || domSel.anchorOffset != offset) {
				doc.removeEventListener("selectionchange", view.input.hideSelectionGuard);
				setTimeout(() => {
					if (!editorOwnsSelection(view) || view.state.selection.visible) view.dom.classList.remove("ProseMirror-hideselection");
				}, 20);
			}
		});
	}
	function selectCursorWrapper(view) {
		let domSel = view.domSelection();
		if (!domSel) return;
		let node = view.cursorWrapper.dom;
		let img = node.nodeName == "IMG";
		if (img) domSel.collapse(node.parentNode, domIndex(node) + 1);
		else domSel.collapse(node, 0);
		if (!img && !view.state.selection.visible && ie$1 && ie_version <= 11) {
			node.disabled = true;
			node.disabled = false;
		}
	}
	function syncNodeSelection(view, sel) {
		if (sel instanceof NodeSelection) {
			let desc = view.docView.descAt(sel.from);
			if (desc != view.lastSelectedViewDesc) {
				clearNodeSelection(view);
				if (desc) desc.selectNode();
				view.lastSelectedViewDesc = desc;
			}
		} else clearNodeSelection(view);
	}
	function clearNodeSelection(view) {
		if (view.lastSelectedViewDesc) {
			if (view.lastSelectedViewDesc.parent) view.lastSelectedViewDesc.deselectNode();
			view.lastSelectedViewDesc = void 0;
		}
	}
	function selectionBetween(view, $anchor, $head, bias) {
		return view.someProp("createSelectionBetween", (f) => f(view, $anchor, $head)) || TextSelection.between($anchor, $head, bias);
	}
	function hasFocusAndSelection(view) {
		if (view.editable && !view.hasFocus()) return false;
		return hasSelection(view);
	}
	function hasSelection(view) {
		let sel = view.domSelectionRange();
		if (!sel.anchorNode) return false;
		try {
			return view.dom.contains(sel.anchorNode.nodeType == 3 ? sel.anchorNode.parentNode : sel.anchorNode) && (view.editable || view.dom.contains(sel.focusNode.nodeType == 3 ? sel.focusNode.parentNode : sel.focusNode));
		} catch (_) {
			return false;
		}
	}
	function anchorInRightPlace(view) {
		let anchorDOM = view.docView.domFromPos(view.state.selection.anchor, 0);
		let domSel = view.domSelectionRange();
		return isEquivalentPosition(anchorDOM.node, anchorDOM.offset, domSel.anchorNode, domSel.anchorOffset);
	}
	function moveSelectionBlock(state, dir) {
		let { $anchor, $head } = state.selection;
		let $side = dir > 0 ? $anchor.max($head) : $anchor.min($head);
		let $start = !$side.parent.inlineContent ? $side : $side.depth ? state.doc.resolve(dir > 0 ? $side.after() : $side.before()) : null;
		return $start && Selection.findFrom($start, dir);
	}
	function apply(view, sel) {
		view.dispatch(view.state.tr.setSelection(sel).scrollIntoView());
		return true;
	}
	function selectHorizontally(view, dir, mods) {
		let sel = view.state.selection;
		if (sel instanceof TextSelection) {
			if (mods.indexOf("s") > -1) {
				let { $head } = sel, node = $head.textOffset ? null : dir < 0 ? $head.nodeBefore : $head.nodeAfter;
				if (!node || node.isText || !node.isLeaf) return false;
				let $newHead = view.state.doc.resolve($head.pos + node.nodeSize * (dir < 0 ? -1 : 1));
				return apply(view, new TextSelection(sel.$anchor, $newHead));
			} else if (!sel.empty) return false;
			else if (view.endOfTextblock(dir > 0 ? "forward" : "backward")) {
				let next = moveSelectionBlock(view.state, dir);
				if (next && next instanceof NodeSelection) return apply(view, next);
				return false;
			} else if (!(mac$2 && mods.indexOf("m") > -1)) {
				let $head = sel.$head;
				let node = $head.textOffset ? null : dir < 0 ? $head.nodeBefore : $head.nodeAfter;
				let desc;
				if (!node || node.isText) return false;
				let nodePos = dir < 0 ? $head.pos - node.nodeSize : $head.pos;
				if (!(node.isAtom || (desc = view.docView.descAt(nodePos)) && !desc.contentDOM)) return false;
				if (NodeSelection.isSelectable(node)) return apply(view, new NodeSelection(dir < 0 ? view.state.doc.resolve($head.pos - node.nodeSize) : $head));
				else if (webkit) return apply(view, new TextSelection(view.state.doc.resolve(dir < 0 ? nodePos : nodePos + node.nodeSize)));
				else return false;
			}
		} else if (sel instanceof NodeSelection && sel.node.isInline) return apply(view, new TextSelection(dir > 0 ? sel.$to : sel.$from));
		else {
			let next = moveSelectionBlock(view.state, dir);
			if (next) return apply(view, next);
			return false;
		}
	}
	function nodeLen(node) {
		return node.nodeType == 3 ? node.nodeValue.length : node.childNodes.length;
	}
	function isIgnorable(dom, dir) {
		let desc = dom.pmViewDesc;
		return desc && desc.size == 0 && (dir < 0 || dom.nextSibling || dom.nodeName != "BR");
	}
	function skipIgnoredNodes(view, dir) {
		return dir < 0 ? skipIgnoredNodesBefore(view) : skipIgnoredNodesAfter(view);
	}
	function skipIgnoredNodesBefore(view) {
		let sel = view.domSelectionRange();
		let node = sel.focusNode;
		let offset = sel.focusOffset;
		if (!node) return;
		let moveNode;
		let moveOffset;
		let force = false;
		if (gecko && node.nodeType == 1 && offset < nodeLen(node) && isIgnorable(node.childNodes[offset], -1)) force = true;
		for (;;) if (offset > 0) if (node.nodeType != 1) break;
		else {
			let before = node.childNodes[offset - 1];
			if (isIgnorable(before, -1)) {
				moveNode = node;
				moveOffset = --offset;
			} else if (before.nodeType == 3) {
				node = before;
				offset = node.nodeValue.length;
			} else break;
		}
		else if (isBlockNode(node)) break;
		else {
			let prev = node.previousSibling;
			while (prev && isIgnorable(prev, -1)) {
				moveNode = node.parentNode;
				moveOffset = domIndex(prev);
				prev = prev.previousSibling;
			}
			if (!prev) {
				node = node.parentNode;
				if (node == view.dom) break;
				offset = 0;
			} else {
				node = prev;
				offset = nodeLen(node);
			}
		}
		if (force) setSelFocus(view, node, offset);
		else if (moveNode) setSelFocus(view, moveNode, moveOffset);
	}
	function skipIgnoredNodesAfter(view) {
		let sel = view.domSelectionRange();
		let node = sel.focusNode;
		let offset = sel.focusOffset;
		if (!node) return;
		let len = nodeLen(node);
		let moveNode;
		let moveOffset;
		for (;;) if (offset < len) {
			if (node.nodeType != 1) break;
			let after = node.childNodes[offset];
			if (isIgnorable(after, 1)) {
				moveNode = node;
				moveOffset = ++offset;
			} else break;
		} else if (isBlockNode(node)) break;
		else {
			let next = node.nextSibling;
			while (next && isIgnorable(next, 1)) {
				moveNode = next.parentNode;
				moveOffset = domIndex(next) + 1;
				next = next.nextSibling;
			}
			if (!next) {
				node = node.parentNode;
				if (node == view.dom) break;
				offset = len = 0;
			} else {
				node = next;
				offset = 0;
				len = nodeLen(node);
			}
		}
		if (moveNode) setSelFocus(view, moveNode, moveOffset);
	}
	function isBlockNode(dom) {
		let desc = dom.pmViewDesc;
		return desc && desc.node && desc.node.isBlock;
	}
	function textNodeAfter(node, offset) {
		while (node && offset == node.childNodes.length && !hasBlockDesc(node)) {
			offset = domIndex(node) + 1;
			node = node.parentNode;
		}
		while (node && offset < node.childNodes.length) {
			let next = node.childNodes[offset];
			if (next.nodeType == 3) return next;
			if (next.nodeType == 1 && next.contentEditable == "false") break;
			node = next;
			offset = 0;
		}
	}
	function textNodeBefore(node, offset) {
		while (node && !offset && !hasBlockDesc(node)) {
			offset = domIndex(node);
			node = node.parentNode;
		}
		while (node && offset) {
			let next = node.childNodes[offset - 1];
			if (next.nodeType == 3) return next;
			if (next.nodeType == 1 && next.contentEditable == "false") break;
			node = next;
			offset = node.childNodes.length;
		}
	}
	function setSelFocus(view, node, offset) {
		if (node.nodeType != 3) {
			let before;
			let after;
			if (after = textNodeAfter(node, offset)) {
				node = after;
				offset = 0;
			} else if (before = textNodeBefore(node, offset)) {
				node = before;
				offset = before.nodeValue.length;
			}
		}
		let sel = view.domSelection();
		if (!sel) return;
		if (selectionCollapsed(sel)) {
			let range = document.createRange();
			range.setEnd(node, offset);
			range.setStart(node, offset);
			sel.removeAllRanges();
			sel.addRange(range);
		} else if (sel.extend) sel.extend(node, offset);
		view.domObserver.setCurSelection();
		let { state } = view;
		setTimeout(() => {
			if (view.state == state) selectionToDOM(view);
		}, 50);
	}
	function findDirection(view, pos) {
		let $pos = view.state.doc.resolve(pos);
		if (!(chrome || windows$1) && $pos.parent.inlineContent) {
			let coords = view.coordsAtPos(pos);
			if (pos > $pos.start()) {
				let before = view.coordsAtPos(pos - 1);
				let mid = (before.top + before.bottom) / 2;
				if (mid > coords.top && mid < coords.bottom && Math.abs(before.left - coords.left) > 1) return before.left < coords.left ? "ltr" : "rtl";
			}
			if (pos < $pos.end()) {
				let after = view.coordsAtPos(pos + 1);
				let mid = (after.top + after.bottom) / 2;
				if (mid > coords.top && mid < coords.bottom && Math.abs(after.left - coords.left) > 1) return after.left > coords.left ? "ltr" : "rtl";
			}
		}
		return getComputedStyle(view.dom).direction == "rtl" ? "rtl" : "ltr";
	}
	function selectVertically(view, dir, mods) {
		let sel = view.state.selection;
		if (sel instanceof TextSelection && !sel.empty || mods.indexOf("s") > -1) return false;
		if (mac$2 && mods.indexOf("m") > -1) return false;
		let { $from, $to } = sel;
		if (!$from.parent.inlineContent || view.endOfTextblock(dir < 0 ? "up" : "down")) {
			let next = moveSelectionBlock(view.state, dir);
			if (next && next instanceof NodeSelection) return apply(view, next);
		}
		if (!$from.parent.inlineContent) {
			let side = dir < 0 ? $from : $to;
			let beyond = sel instanceof AllSelection ? Selection.near(side, dir) : Selection.findFrom(side, dir);
			return beyond ? apply(view, beyond) : false;
		}
		return false;
	}
	function stopNativeHorizontalDelete(view, dir) {
		if (!(view.state.selection instanceof TextSelection)) return true;
		let { $head, $anchor, empty } = view.state.selection;
		if (!$head.sameParent($anchor)) return true;
		if (!empty) return false;
		if (view.endOfTextblock(dir > 0 ? "forward" : "backward")) return true;
		let nextNode = !$head.textOffset && (dir < 0 ? $head.nodeBefore : $head.nodeAfter);
		if (nextNode && !nextNode.isText) {
			let tr = view.state.tr;
			if (dir < 0) tr.delete($head.pos - nextNode.nodeSize, $head.pos);
			else tr.delete($head.pos, $head.pos + nextNode.nodeSize);
			view.dispatch(tr);
			return true;
		}
		return false;
	}
	function switchEditable(view, node, state) {
		view.domObserver.stop();
		node.contentEditable = state;
		view.domObserver.start();
	}
	function safariDownArrowBug(view) {
		if (!safari || view.state.selection.$head.parentOffset > 0) return false;
		let { focusNode, focusOffset } = view.domSelectionRange();
		if (focusNode && focusNode.nodeType == 1 && focusOffset == 0 && focusNode.firstChild && focusNode.firstChild.contentEditable == "false") {
			let child = focusNode.firstChild;
			switchEditable(view, child, "true");
			setTimeout(() => switchEditable(view, child, "false"), 20);
		}
		return false;
	}
	function getMods(event) {
		let result = "";
		if (event.ctrlKey) result += "c";
		if (event.metaKey) result += "m";
		if (event.altKey) result += "a";
		if (event.shiftKey) result += "s";
		return result;
	}
	function captureKeyDown(view, event) {
		let code = event.keyCode;
		let mods = getMods(event);
		if (code == 8 || mac$2 && code == 72 && mods == "c") return stopNativeHorizontalDelete(view, -1) || skipIgnoredNodes(view, -1);
		else if (code == 46 && !event.shiftKey || mac$2 && code == 68 && mods == "c") return stopNativeHorizontalDelete(view, 1) || skipIgnoredNodes(view, 1);
		else if (code == 13 || code == 27) return true;
		else if (code == 37 || mac$2 && code == 66 && mods == "c") {
			let dir = code == 37 ? findDirection(view, view.state.selection.from) == "ltr" ? -1 : 1 : -1;
			return selectHorizontally(view, dir, mods) || skipIgnoredNodes(view, dir);
		} else if (code == 39 || mac$2 && code == 70 && mods == "c") {
			let dir = code == 39 ? findDirection(view, view.state.selection.from) == "ltr" ? 1 : -1 : 1;
			return selectHorizontally(view, dir, mods) || skipIgnoredNodes(view, dir);
		} else if (code == 38 || mac$2 && code == 80 && mods == "c") return selectVertically(view, -1, mods) || skipIgnoredNodes(view, -1);
		else if (code == 40 || mac$2 && code == 78 && mods == "c") return safariDownArrowBug(view) || selectVertically(view, 1, mods) || skipIgnoredNodes(view, 1);
		else if (mods == (mac$2 ? "m" : "c") && (code == 66 || code == 73 || code == 89 || code == 90)) return true;
		return false;
	}
	function serializeForClipboard(view, slice) {
		view.someProp("transformCopied", (f) => {
			slice = f(slice, view);
		});
		let context = [], { content, openStart, openEnd } = slice;
		while (openStart > 1 && openEnd > 1 && content.childCount == 1 && content.firstChild.childCount == 1) {
			openStart--;
			openEnd--;
			let node = content.firstChild;
			context.push(node.type.name, node.attrs != node.type.defaultAttrs ? node.attrs : null);
			content = node.content;
		}
		let serializer = view.someProp("clipboardSerializer") || DOMSerializer.fromSchema(view.state.schema);
		let doc = detachedDoc();
		let wrap = doc.createElement("div");
		wrap.appendChild(serializer.serializeFragment(content, { document: doc }));
		let firstChild = wrap.firstChild;
		let needsWrap;
		let wrappers = 0;
		while (firstChild && firstChild.nodeType == 1 && (needsWrap = wrapMap[firstChild.nodeName.toLowerCase()])) {
			for (let i = needsWrap.length - 1; i >= 0; i--) {
				let wrapper = doc.createElement(needsWrap[i]);
				while (wrap.firstChild) wrapper.appendChild(wrap.firstChild);
				wrap.appendChild(wrapper);
				wrappers++;
			}
			firstChild = wrap.firstChild;
		}
		if (firstChild && firstChild.nodeType == 1) firstChild.setAttribute("data-pm-slice", `${openStart} ${openEnd}${wrappers ? ` -${wrappers}` : ""} ${JSON.stringify(context)}`);
		return {
			dom: wrap,
			text: view.someProp("clipboardTextSerializer", (f) => f(slice, view)) || slice.content.textBetween(0, slice.content.size, "\n\n"),
			slice
		};
	}
	function parseFromClipboard(view, text, html, plainText, $context) {
		let inCode = $context.parent.type.spec.code;
		let dom;
		let slice;
		if (!html && !text) return null;
		let asText = !!text && (plainText || inCode || !html);
		if (asText) {
			view.someProp("transformPastedText", (f) => {
				text = f(text, inCode || plainText, view);
			});
			if (inCode) {
				slice = new Slice(Fragment$1.from(view.state.schema.text(text.replace(/\r\n?/g, "\n"))), 0, 0);
				view.someProp("transformPasted", (f) => {
					slice = f(slice, view, true);
				});
				return slice;
			}
			let parsed = view.someProp("clipboardTextParser", (f) => f(text, $context, plainText, view));
			if (parsed) slice = parsed;
			else {
				let marks = $context.marks();
				let { schema } = view.state, serializer = DOMSerializer.fromSchema(schema);
				dom = document.createElement("div");
				text.split(/(?:\r\n?|\n)+/).forEach((block) => {
					let p = dom.appendChild(document.createElement("p"));
					if (block) p.appendChild(serializer.serializeNode(schema.text(block, marks)));
				});
			}
		} else {
			view.someProp("transformPastedHTML", (f) => {
				html = f(html, view);
			});
			dom = readHTML(html);
			if (webkit) restoreReplacedSpaces(dom);
		}
		let contextNode = dom && dom.querySelector("[data-pm-slice]");
		let sliceData = contextNode && /^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(contextNode.getAttribute("data-pm-slice") || "");
		if (sliceData && sliceData[3]) for (let i = +sliceData[3]; i > 0; i--) {
			let child = dom.firstChild;
			while (child && child.nodeType != 1) child = child.nextSibling;
			if (!child) break;
			dom = child;
		}
		if (!slice) slice = (view.someProp("clipboardParser") || view.someProp("domParser") || DOMParser$1.fromSchema(view.state.schema)).parseSlice(dom, {
			preserveWhitespace: !!(asText || sliceData),
			context: $context,
			ruleFromNode(dom) {
				if (dom.nodeName == "BR" && !dom.nextSibling && dom.parentNode && !inlineParents.test(dom.parentNode.nodeName)) return { ignore: true };
				return null;
			}
		});
		if (sliceData) slice = addContext(closeSlice(slice, +sliceData[1], +sliceData[2]), sliceData[4]);
		else {
			slice = Slice.maxOpen(normalizeSiblings(slice.content, $context), true);
			if (slice.openStart || slice.openEnd) {
				let openStart = 0;
				let openEnd = 0;
				for (let node = slice.content.firstChild; openStart < slice.openStart && !node.type.spec.isolating; openStart++, node = node.firstChild);
				for (let node = slice.content.lastChild; openEnd < slice.openEnd && !node.type.spec.isolating; openEnd++, node = node.lastChild);
				slice = closeSlice(slice, openStart, openEnd);
			}
		}
		view.someProp("transformPasted", (f) => {
			slice = f(slice, view, asText);
		});
		return slice;
	}
	var inlineParents = /^(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 normalizeSiblings(fragment, $context) {
		if (fragment.childCount < 2) return fragment;
		for (let d = $context.depth; d >= 0; d--) {
			let match = $context.node(d).contentMatchAt($context.index(d));
			let lastWrap;
			let result = [];
			fragment.forEach((node) => {
				if (!result) return;
				let wrap = match.findWrapping(node.type);
				let inLast;
				if (!wrap) return result = null;
				if (inLast = result.length && lastWrap.length && addToSibling(wrap, lastWrap, node, result[result.length - 1], 0)) result[result.length - 1] = inLast;
				else {
					if (result.length) result[result.length - 1] = closeRight(result[result.length - 1], lastWrap.length);
					let wrapped = withWrappers(node, wrap);
					result.push(wrapped);
					match = match.matchType(wrapped.type);
					lastWrap = wrap;
				}
			});
			if (result) return Fragment$1.from(result);
		}
		return fragment;
	}
	function withWrappers(node, wrap, from = 0) {
		for (let i = wrap.length - 1; i >= from; i--) node = wrap[i].create(null, Fragment$1.from(node));
		return node;
	}
	function addToSibling(wrap, lastWrap, node, sibling, depth) {
		if (depth < wrap.length && depth < lastWrap.length && wrap[depth] == lastWrap[depth]) {
			let inner = addToSibling(wrap, lastWrap, node, sibling.lastChild, depth + 1);
			if (inner) return sibling.copy(sibling.content.replaceChild(sibling.childCount - 1, inner));
			if (sibling.contentMatchAt(sibling.childCount).matchType(depth == wrap.length - 1 ? node.type : wrap[depth + 1])) return sibling.copy(sibling.content.append(Fragment$1.from(withWrappers(node, wrap, depth + 1))));
		}
	}
	function closeRight(node, depth) {
		if (depth == 0) return node;
		let fragment = node.content.replaceChild(node.childCount - 1, closeRight(node.lastChild, depth - 1));
		let fill = node.contentMatchAt(node.childCount).fillBefore(Fragment$1.empty, true);
		return node.copy(fragment.append(fill));
	}
	function closeRange(fragment, side, from, to, depth, openEnd) {
		let node = side < 0 ? fragment.firstChild : fragment.lastChild;
		let inner = node.content;
		if (fragment.childCount > 1) openEnd = 0;
		if (depth < to - 1) inner = closeRange(inner, side, from, to, depth + 1, openEnd);
		if (depth >= from) inner = side < 0 ? node.contentMatchAt(0).fillBefore(inner, openEnd <= depth).append(inner) : inner.append(node.contentMatchAt(node.childCount).fillBefore(Fragment$1.empty, true));
		return fragment.replaceChild(side < 0 ? 0 : fragment.childCount - 1, node.copy(inner));
	}
	function closeSlice(slice, openStart, openEnd) {
		if (openStart < slice.openStart) slice = new Slice(closeRange(slice.content, -1, openStart, slice.openStart, 0, slice.openEnd), openStart, slice.openEnd);
		if (openEnd < slice.openEnd) slice = new Slice(closeRange(slice.content, 1, openEnd, slice.openEnd, 0, 0), slice.openStart, openEnd);
		return slice;
	}
	var wrapMap = {
		thead: ["table"],
		tbody: ["table"],
		tfoot: ["table"],
		caption: ["table"],
		colgroup: ["table"],
		col: ["table", "colgroup"],
		tr: ["table", "tbody"],
		td: [
			"table",
			"tbody",
			"tr"
		],
		th: [
			"table",
			"tbody",
			"tr"
		]
	};
	var _detachedDoc = null;
	function detachedDoc() {
		return _detachedDoc || (_detachedDoc = document.implementation.createHTMLDocument("title"));
	}
	var _policy = null;
	function maybeWrapTrusted(html) {
		let trustedTypes = window.trustedTypes;
		if (!trustedTypes) return html;
		if (!_policy) _policy = trustedTypes.defaultPolicy || trustedTypes.createPolicy("ProseMirrorClipboard", { createHTML: (s) => s });
		return _policy.createHTML(html);
	}
	function readHTML(html) {
		let metas = /^(\s*<meta [^>]*>)*/.exec(html);
		if (metas) html = html.slice(metas[0].length);
		let elt = detachedDoc().createElement("div");
		let firstTag = /<([a-z][^>\s]+)/i.exec(html);
		let wrap;
		if (wrap = firstTag && wrapMap[firstTag[1].toLowerCase()]) html = wrap.map((n) => "<" + n + ">").join("") + html + wrap.map((n) => "</" + n + ">").reverse().join("");
		elt.innerHTML = maybeWrapTrusted(html);
		if (wrap) for (let i = 0; i < wrap.length; i++) elt = elt.querySelector(wrap[i]) || elt;
		return elt;
	}
	function restoreReplacedSpaces(dom) {
		let nodes = dom.querySelectorAll(chrome ? "span:not([class]):not([style])" : "span.Apple-converted-space");
		for (let i = 0; i < nodes.length; i++) {
			let node = nodes[i];
			if (node.childNodes.length == 1 && node.textContent == "\xA0" && node.parentNode) node.parentNode.replaceChild(dom.ownerDocument.createTextNode(" "), node);
		}
	}
	function addContext(slice, context) {
		if (!slice.size) return slice;
		let schema = slice.content.firstChild.type.schema;
		let array;
		try {
			array = JSON.parse(context);
		} catch (e) {
			return slice;
		}
		let { content, openStart, openEnd } = slice;
		for (let i = array.length - 2; i >= 0; i -= 2) {
			let type = schema.nodes[array[i]];
			if (!type || type.hasRequiredAttrs()) break;
			content = Fragment$1.from(type.create(array[i + 1], content));
			openStart++;
			openEnd++;
		}
		return new Slice(content, openStart, openEnd);
	}
	var handlers = {};
	var editHandlers = {};
	var passiveHandlers = {
		touchstart: true,
		touchmove: true
	};
	var InputState = class {
		constructor() {
			this.shiftKey = false;
			this.mouseDown = null;
			this.lastKeyCode = null;
			this.lastKeyCodeTime = 0;
			this.lastClick = {
				time: 0,
				x: 0,
				y: 0,
				type: "",
				button: 0
			};
			this.lastSelectionOrigin = null;
			this.lastSelectionTime = 0;
			this.lastIOSEnter = 0;
			this.lastIOSEnterFallbackTimeout = -1;
			this.lastFocus = 0;
			this.lastTouch = 0;
			this.lastChromeDelete = 0;
			this.composing = false;
			this.compositionNode = null;
			this.composingTimeout = -1;
			this.compositionNodes = [];
			this.compositionEndedAt = -2e8;
			this.compositionID = 1;
			this.badSafariComposition = false;
			this.compositionPendingChanges = 0;
			this.domChangeCount = 0;
			this.eventHandlers = Object.create(null);
			this.hideSelectionGuard = null;
		}
	};
	function initInput(view) {
		for (let event in handlers) {
			let handler = handlers[event];
			view.dom.addEventListener(event, view.input.eventHandlers[event] = (event) => {
				if (eventBelongsToView(view, event) && !runCustomHandler(view, event) && (view.editable || !(event.type in editHandlers))) handler(view, event);
			}, passiveHandlers[event] ? { passive: true } : void 0);
		}
		if (safari) view.dom.addEventListener("input", () => null);
		ensureListeners(view);
	}
	function setSelectionOrigin(view, origin) {
		view.input.lastSelectionOrigin = origin;
		view.input.lastSelectionTime = Date.now();
	}
	function destroyInput(view) {
		view.domObserver.stop();
		for (let type in view.input.eventHandlers) view.dom.removeEventListener(type, view.input.eventHandlers[type]);
		clearTimeout(view.input.composingTimeout);
		clearTimeout(view.input.lastIOSEnterFallbackTimeout);
	}
	function ensureListeners(view) {
		view.someProp("handleDOMEvents", (currentHandlers) => {
			for (let type in currentHandlers) if (!view.input.eventHandlers[type]) view.dom.addEventListener(type, view.input.eventHandlers[type] = (event) => runCustomHandler(view, event));
		});
	}
	function runCustomHandler(view, event) {
		return view.someProp("handleDOMEvents", (handlers) => {
			let handler = handlers[event.type];
			return handler ? handler(view, event) || event.defaultPrevented : false;
		});
	}
	function eventBelongsToView(view, event) {
		if (!event.bubbles) return true;
		if (event.defaultPrevented) return false;
		for (let node = event.target; node != view.dom; node = node.parentNode) if (!node || node.nodeType == 11 || node.pmViewDesc && node.pmViewDesc.stopEvent(event)) return false;
		return true;
	}
	function dispatchEvent(view, event) {
		if (!runCustomHandler(view, event) && handlers[event.type] && (view.editable || !(event.type in editHandlers))) handlers[event.type](view, event);
	}
	editHandlers.keydown = (view, _event) => {
		let event = _event;
		view.input.shiftKey = event.keyCode == 16 || event.shiftKey;
		if (inOrNearComposition(view, event)) return;
		view.input.lastKeyCode = event.keyCode;
		view.input.lastKeyCodeTime = Date.now();
		if (android && chrome && event.keyCode == 13) return;
		if (event.keyCode != 229) view.domObserver.forceFlush();
		if (ios && event.keyCode == 13 && !event.ctrlKey && !event.altKey && !event.metaKey) {
			let now = Date.now();
			view.input.lastIOSEnter = now;
			view.input.lastIOSEnterFallbackTimeout = setTimeout(() => {
				if (view.input.lastIOSEnter == now) {
					view.someProp("handleKeyDown", (f) => f(view, keyEvent(13, "Enter")));
					view.input.lastIOSEnter = 0;
				}
			}, 200);
		} else if (view.someProp("handleKeyDown", (f) => f(view, event)) || captureKeyDown(view, event)) event.preventDefault();
		else setSelectionOrigin(view, "key");
	};
	editHandlers.keyup = (view, event) => {
		if (event.keyCode == 16) view.input.shiftKey = false;
	};
	editHandlers.keypress = (view, _event) => {
		let event = _event;
		if (inOrNearComposition(view, event) || !event.charCode || event.ctrlKey && !event.altKey || mac$2 && event.metaKey) return;
		if (view.someProp("handleKeyPress", (f) => f(view, event))) {
			event.preventDefault();
			return;
		}
		let sel = view.state.selection;
		if (!(sel instanceof TextSelection) || !sel.$from.sameParent(sel.$to)) {
			let text = String.fromCharCode(event.charCode);
			let deflt = () => view.state.tr.insertText(text).scrollIntoView();
			if (!/[\r\n]/.test(text) && !view.someProp("handleTextInput", (f) => f(view, sel.$from.pos, sel.$to.pos, text, deflt))) view.dispatch(deflt());
			event.preventDefault();
		}
	};
	function eventCoords(event) {
		return {
			left: event.clientX,
			top: event.clientY
		};
	}
	function isNear(event, click) {
		let dx = click.x - event.clientX;
		let dy = click.y - event.clientY;
		return dx * dx + dy * dy < 100;
	}
	function runHandlerOnContext(view, propName, pos, inside, event) {
		if (inside == -1) return false;
		let $pos = view.state.doc.resolve(inside);
		for (let i = $pos.depth + 1; i > 0; i--) if (view.someProp(propName, (f) => i > $pos.depth ? f(view, pos, $pos.nodeAfter, $pos.before(i), event, true) : f(view, pos, $pos.node(i), $pos.before(i), event, false))) return true;
		return false;
	}
	function updateSelection(view, selection, origin) {
		if (!view.focused) view.focus();
		if (view.state.selection.eq(selection)) return;
		let tr = view.state.tr.setSelection(selection);
		if (origin == "pointer") tr.setMeta("pointer", true);
		view.dispatch(tr);
	}
	function selectClickedLeaf(view, inside) {
		if (inside == -1) return false;
		let $pos = view.state.doc.resolve(inside);
		let node = $pos.nodeAfter;
		if (node && node.isAtom && NodeSelection.isSelectable(node)) {
			updateSelection(view, new NodeSelection($pos), "pointer");
			return true;
		}
		return false;
	}
	function selectClickedNode(view, inside) {
		if (inside == -1) return false;
		let sel = view.state.selection;
		let selectedNode;
		let selectAt;
		if (sel instanceof NodeSelection) selectedNode = sel.node;
		let $pos = view.state.doc.resolve(inside);
		for (let i = $pos.depth + 1; i > 0; i--) {
			let node = i > $pos.depth ? $pos.nodeAfter : $pos.node(i);
			if (NodeSelection.isSelectable(node)) {
				if (selectedNode && sel.$from.depth > 0 && i >= sel.$from.depth && $pos.before(sel.$from.depth + 1) == sel.$from.pos) selectAt = $pos.before(sel.$from.depth);
				else selectAt = $pos.before(i);
				break;
			}
		}
		if (selectAt != null) {
			updateSelection(view, NodeSelection.create(view.state.doc, selectAt), "pointer");
			return true;
		} else return false;
	}
	function handleSingleClick(view, pos, inside, event, selectNode) {
		return runHandlerOnContext(view, "handleClickOn", pos, inside, event) || view.someProp("handleClick", (f) => f(view, pos, event)) || (selectNode ? selectClickedNode(view, inside) : selectClickedLeaf(view, inside));
	}
	function handleDoubleClick(view, pos, inside, event) {
		return runHandlerOnContext(view, "handleDoubleClickOn", pos, inside, event) || view.someProp("handleDoubleClick", (f) => f(view, pos, event));
	}
	function handleTripleClick(view, pos, inside, event) {
		return runHandlerOnContext(view, "handleTripleClickOn", pos, inside, event) || view.someProp("handleTripleClick", (f) => f(view, pos, event)) || defaultTripleClick(view, inside, event);
	}
	function defaultTripleClick(view, inside, event) {
		if (event.button != 0) return false;
		let doc = view.state.doc;
		if (inside == -1) {
			if (doc.inlineContent) {
				updateSelection(view, TextSelection.create(doc, 0, doc.content.size), "pointer");
				return true;
			}
			return false;
		}
		let $pos = doc.resolve(inside);
		for (let i = $pos.depth + 1; i > 0; i--) {
			let node = i > $pos.depth ? $pos.nodeAfter : $pos.node(i);
			let nodePos = $pos.before(i);
			if (node.inlineContent) updateSelection(view, TextSelection.create(doc, nodePos + 1, nodePos + 1 + node.content.size), "pointer");
			else if (NodeSelection.isSelectable(node)) updateSelection(view, NodeSelection.create(doc, nodePos), "pointer");
			else continue;
			return true;
		}
	}
	function forceDOMFlush(view) {
		return endComposition(view);
	}
	var selectNodeModifier = mac$2 ? "metaKey" : "ctrlKey";
	handlers.mousedown = (view, _event) => {
		let event = _event;
		view.input.shiftKey = event.shiftKey;
		let flushed = forceDOMFlush(view);
		let now = Date.now();
		let type = "singleClick";
		if (now - view.input.lastClick.time < 500 && isNear(event, view.input.lastClick) && !event[selectNodeModifier] && view.input.lastClick.button == event.button) {
			if (view.input.lastClick.type == "singleClick") type = "doubleClick";
			else if (view.input.lastClick.type == "doubleClick") type = "tripleClick";
		}
		view.input.lastClick = {
			time: now,
			x: event.clientX,
			y: event.clientY,
			type,
			button: event.button
		};
		let pos = view.posAtCoords(eventCoords(event));
		if (!pos) return;
		if (type == "singleClick") {
			if (view.input.mouseDown) view.input.mouseDown.done();
			view.input.mouseDown = new MouseDown(view, pos, event, !!flushed);
		} else if ((type == "doubleClick" ? handleDoubleClick : handleTripleClick)(view, pos.pos, pos.inside, event)) event.preventDefault();
		else setSelectionOrigin(view, "pointer");
	};
	var MouseDown = class {
		constructor(view, pos, event, flushed) {
			this.view = view;
			this.pos = pos;
			this.event = event;
			this.flushed = flushed;
			this.delayedSelectionSync = false;
			this.mightDrag = null;
			this.startDoc = view.state.doc;
			this.selectNode = !!event[selectNodeModifier];
			this.allowDefault = event.shiftKey;
			let targetNode;
			let targetPos;
			if (pos.inside > -1) {
				targetNode = view.state.doc.nodeAt(pos.inside);
				targetPos = pos.inside;
			} else {
				let $pos = view.state.doc.resolve(pos.pos);
				targetNode = $pos.parent;
				targetPos = $pos.depth ? $pos.before() : 0;
			}
			const target = flushed ? null : event.target;
			const targetDesc = target ? view.docView.nearestDesc(target, true) : null;
			this.target = targetDesc && targetDesc.nodeDOM.nodeType == 1 ? targetDesc.nodeDOM : null;
			let { selection } = view.state;
			if (event.button == 0 && targetNode.type.spec.draggable && targetNode.type.spec.selectable !== false || selection instanceof NodeSelection && selection.from <= targetPos && selection.to > targetPos) this.mightDrag = {
				node: targetNode,
				pos: targetPos,
				addAttr: !!(this.target && !this.target.draggable),
				setUneditable: !!(this.target && gecko && !this.target.hasAttribute("contentEditable"))
			};
			if (this.target && this.mightDrag && (this.mightDrag.addAttr || this.mightDrag.setUneditable)) {
				this.view.domObserver.stop();
				if (this.mightDrag.addAttr) this.target.draggable = true;
				if (this.mightDrag.setUneditable) setTimeout(() => {
					if (this.view.input.mouseDown == this) this.target.setAttribute("contentEditable", "false");
				}, 20);
				this.view.domObserver.start();
			}
			view.root.addEventListener("mouseup", this.up = this.up.bind(this));
			view.root.addEventListener("mousemove", this.move = this.move.bind(this));
			setSelectionOrigin(view, "pointer");
		}
		done() {
			this.view.root.removeEventListener("mouseup", this.up);
			this.view.root.removeEventListener("mousemove", this.move);
			if (this.mightDrag && this.target) {
				this.view.domObserver.stop();
				if (this.mightDrag.addAttr) this.target.removeAttribute("draggable");
				if (this.mightDrag.setUneditable) this.target.removeAttribute("contentEditable");
				this.view.domObserver.start();
			}
			if (this.delayedSelectionSync) setTimeout(() => selectionToDOM(this.view));
			this.view.input.mouseDown = null;
		}
		up(event) {
			this.done();
			if (!this.view.dom.contains(event.target)) return;
			let pos = this.pos;
			if (this.view.state.doc != this.startDoc) pos = this.view.posAtCoords(eventCoords(event));
			this.updateAllowDefault(event);
			if (this.allowDefault || !pos) setSelectionOrigin(this.view, "pointer");
			else if (handleSingleClick(this.view, pos.pos, pos.inside, event, this.selectNode)) event.preventDefault();
			else if (event.button == 0 && (this.flushed || safari && this.mightDrag && !this.mightDrag.node.isAtom || chrome && !this.view.state.selection.visible && Math.min(Math.abs(pos.pos - this.view.state.selection.from), Math.abs(pos.pos - this.view.state.selection.to)) <= 2)) {
				updateSelection(this.view, Selection.near(this.view.state.doc.resolve(pos.pos)), "pointer");
				event.preventDefault();
			} else setSelectionOrigin(this.view, "pointer");
		}
		move(event) {
			this.updateAllowDefault(event);
			setSelectionOrigin(this.view, "pointer");
			if (event.buttons == 0) this.done();
		}
		updateAllowDefault(event) {
			if (!this.allowDefault && (Math.abs(this.event.x - event.clientX) > 4 || Math.abs(this.event.y - event.clientY) > 4)) this.allowDefault = true;
		}
	};
	handlers.touchstart = (view) => {
		view.input.lastTouch = Date.now();
		forceDOMFlush(view);
		setSelectionOrigin(view, "pointer");
	};
	handlers.touchmove = (view) => {
		view.input.lastTouch = Date.now();
		setSelectionOrigin(view, "pointer");
	};
	handlers.contextmenu = (view) => forceDOMFlush(view);
	function inOrNearComposition(view, event) {
		if (view.composing) return true;
		if (safari && Math.abs(event.timeStamp - view.input.compositionEndedAt) < 500) {
			view.input.compositionEndedAt = -2e8;
			return true;
		}
		return false;
	}
	var timeoutComposition = android ? 5e3 : -1;
	editHandlers.compositionstart = editHandlers.compositionupdate = (view) => {
		if (!view.composing) {
			view.domObserver.flush();
			let { state } = view, $pos = state.selection.$to;
			if (state.selection instanceof TextSelection && (state.storedMarks || !$pos.textOffset && $pos.parentOffset && $pos.nodeBefore.marks.some((m) => m.type.spec.inclusive === false) || chrome && windows$1 && selectionBeforeUneditable(view))) {
				view.markCursor = view.state.storedMarks || $pos.marks();
				endComposition(view, true);
				view.markCursor = null;
			} else {
				endComposition(view, !state.selection.empty);
				if (gecko && state.selection.empty && $pos.parentOffset && !$pos.textOffset && $pos.nodeBefore.marks.length) {
					let sel = view.domSelectionRange();
					for (let node = sel.focusNode, offset = sel.focusOffset; node && node.nodeType == 1 && offset != 0;) {
						let before = offset < 0 ? node.lastChild : node.childNodes[offset - 1];
						if (!before) break;
						if (before.nodeType == 3) {
							let sel = view.domSelection();
							if (sel) sel.collapse(before, before.nodeValue.length);
							break;
						} else {
							node = before;
							offset = -1;
						}
					}
				}
			}
			view.input.composing = true;
		}
		scheduleComposeEnd(view, timeoutComposition);
	};
	function selectionBeforeUneditable(view) {
		let { focusNode, focusOffset } = view.domSelectionRange();
		if (!focusNode || focusNode.nodeType != 1 || focusOffset >= focusNode.childNodes.length) return false;
		let next = focusNode.childNodes[focusOffset];
		return next.nodeType == 1 && next.contentEditable == "false";
	}
	editHandlers.compositionend = (view, event) => {
		if (view.composing) {
			view.input.composing = false;
			view.input.compositionEndedAt = event.timeStamp;
			view.input.compositionPendingChanges = view.domObserver.pendingRecords().length ? view.input.compositionID : 0;
			view.input.compositionNode = null;
			if (view.input.badSafariComposition) view.domObserver.forceFlush();
			else if (view.input.compositionPendingChanges) Promise.resolve().then(() => view.domObserver.flush());
			view.input.compositionID++;
			scheduleComposeEnd(view, 20);
		}
	};
	function scheduleComposeEnd(view, delay) {
		clearTimeout(view.input.composingTimeout);
		if (delay > -1) view.input.composingTimeout = setTimeout(() => endComposition(view), delay);
	}
	function clearComposition(view) {
		if (view.composing) {
			view.input.composing = false;
			view.input.compositionEndedAt = timestampFromCustomEvent();
		}
		while (view.input.compositionNodes.length > 0) view.input.compositionNodes.pop().markParentsDirty();
	}
	function findCompositionNode(view) {
		let sel = view.domSelectionRange();
		if (!sel.focusNode) return null;
		let textBefore = textNodeBefore$1(sel.focusNode, sel.focusOffset);
		let textAfter = textNodeAfter$1(sel.focusNode, sel.focusOffset);
		if (textBefore && textAfter && textBefore != textAfter) {
			let descAfter = textAfter.pmViewDesc;
			let lastChanged = view.domObserver.lastChangedTextNode;
			if (textBefore == lastChanged || textAfter == lastChanged) return lastChanged;
			if (!descAfter || !descAfter.isText(textAfter.nodeValue)) return textAfter;
			else if (view.input.compositionNode == textAfter) {
				let descBefore = textBefore.pmViewDesc;
				if (!(!descBefore || !descBefore.isText(textBefore.nodeValue))) return textAfter;
			}
		}
		return textBefore || textAfter;
	}
	function timestampFromCustomEvent() {
		let event = document.createEvent("Event");
		event.initEvent("event", true, true);
		return event.timeStamp;
	}
	/**
	@internal
	*/
	function endComposition(view, restarting = false) {
		if (android && view.domObserver.flushingSoon >= 0) return;
		view.domObserver.forceFlush();
		clearComposition(view);
		if (restarting || view.docView && view.docView.dirty) {
			let sel = selectionFromDOM(view);
			let cur = view.state.selection;
			if (sel && !sel.eq(cur)) view.dispatch(view.state.tr.setSelection(sel));
			else if ((view.markCursor || restarting) && !cur.$from.node(cur.$from.sharedDepth(cur.to)).inlineContent) view.dispatch(view.state.tr.deleteSelection());
			else view.updateState(view.state);
			return true;
		}
		return false;
	}
	function captureCopy(view, dom) {
		if (!view.dom.parentNode) return;
		let wrap = view.dom.parentNode.appendChild(document.createElement("div"));
		wrap.appendChild(dom);
		wrap.style.cssText = "position: fixed; left: -10000px; top: 10px";
		let sel = getSelection();
		let range = document.createRange();
		range.selectNodeContents(dom);
		view.dom.blur();
		sel.removeAllRanges();
		sel.addRange(range);
		setTimeout(() => {
			if (wrap.parentNode) wrap.parentNode.removeChild(wrap);
			view.focus();
		}, 50);
	}
	var brokenClipboardAPI = ie$1 && ie_version < 15 || ios && webkit_version < 604;
	handlers.copy = editHandlers.cut = (view, _event) => {
		let event = _event;
		let sel = view.state.selection;
		let cut = event.type == "cut";
		if (sel.empty) return;
		let data = brokenClipboardAPI ? null : event.clipboardData;
		let { dom, text } = serializeForClipboard(view, sel.content());
		if (data) {
			event.preventDefault();
			data.clearData();
			data.setData("text/html", dom.innerHTML);
			data.setData("text/plain", text);
		} else captureCopy(view, dom);
		if (cut) view.dispatch(view.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
	};
	function sliceSingleNode(slice) {
		return slice.openStart == 0 && slice.openEnd == 0 && slice.content.childCount == 1 ? slice.content.firstChild : null;
	}
	function capturePaste(view, event) {
		if (!view.dom.parentNode) return;
		let plainText = view.input.shiftKey || view.state.selection.$from.parent.type.spec.code;
		let target = view.dom.parentNode.appendChild(document.createElement(plainText ? "textarea" : "div"));
		if (!plainText) target.contentEditable = "true";
		target.style.cssText = "position: fixed; left: -10000px; top: 10px";
		target.focus();
		let plain = view.input.shiftKey && view.input.lastKeyCode != 45;
		setTimeout(() => {
			view.focus();
			if (target.parentNode) target.parentNode.removeChild(target);
			if (plainText) doPaste(view, target.value, null, plain, event);
			else doPaste(view, target.textContent, target.innerHTML, plain, event);
		}, 50);
	}
	function doPaste(view, text, html, preferPlain, event) {
		let slice = parseFromClipboard(view, text, html, preferPlain, view.state.selection.$from);
		if (view.someProp("handlePaste", (f) => f(view, event, slice || Slice.empty))) return true;
		if (!slice) return false;
		let singleNode = sliceSingleNode(slice);
		let tr = singleNode ? view.state.tr.replaceSelectionWith(singleNode, preferPlain) : view.state.tr.replaceSelection(slice);
		view.dispatch(tr.scrollIntoView().setMeta("paste", true).setMeta("uiEvent", "paste"));
		return true;
	}
	function getText$1(clipboardData) {
		let text = clipboardData.getData("text/plain") || clipboardData.getData("Text");
		if (text) return text;
		let uris = clipboardData.getData("text/uri-list");
		return uris ? uris.replace(/\r?\n/g, " ") : "";
	}
	__name(getText$1, "getText");
	editHandlers.paste = (view, _event) => {
		let event = _event;
		if (view.composing && !android) return;
		let data = brokenClipboardAPI ? null : event.clipboardData;
		let plain = view.input.shiftKey && view.input.lastKeyCode != 45;
		if (data && doPaste(view, getText$1(data), data.getData("text/html"), plain, event)) event.preventDefault();
		else capturePaste(view, event);
	};
	var Dragging = class {
		constructor(slice, move, node) {
			this.slice = slice;
			this.move = move;
			this.node = node;
		}
	};
	var dragCopyModifier = mac$2 ? "altKey" : "ctrlKey";
	function dragMoves(view, event) {
		let moves = view.someProp("dragCopies", (test) => !test(event));
		return moves != null ? moves : !event[dragCopyModifier];
	}
	handlers.dragstart = (view, _event) => {
		let event = _event;
		let mouseDown = view.input.mouseDown;
		if (mouseDown) mouseDown.done();
		if (!event.dataTransfer) return;
		let sel = view.state.selection;
		let pos = sel.empty ? null : view.posAtCoords(eventCoords(event));
		let node;
		if (pos && pos.pos >= sel.from && pos.pos <= (sel instanceof NodeSelection ? sel.to - 1 : sel.to));
		else if (mouseDown && mouseDown.mightDrag) node = NodeSelection.create(view.state.doc, mouseDown.mightDrag.pos);
		else if (event.target && event.target.nodeType == 1) {
			let desc = view.docView.nearestDesc(event.target, true);
			if (desc && desc.node.type.spec.draggable && desc != view.docView) node = NodeSelection.create(view.state.doc, desc.posBefore);
		}
		let { dom, text, slice } = serializeForClipboard(view, (node || view.state.selection).content());
		if (!event.dataTransfer.files.length || !chrome || chrome_version > 120) event.dataTransfer.clearData();
		event.dataTransfer.setData(brokenClipboardAPI ? "Text" : "text/html", dom.innerHTML);
		event.dataTransfer.effectAllowed = "copyMove";
		if (!brokenClipboardAPI) event.dataTransfer.setData("text/plain", text);
		view.dragging = new Dragging(slice, dragMoves(view, event), node);
	};
	handlers.dragend = (view) => {
		let dragging = view.dragging;
		window.setTimeout(() => {
			if (view.dragging == dragging) view.dragging = null;
		}, 50);
	};
	editHandlers.dragover = editHandlers.dragenter = (_, e) => e.preventDefault();
	editHandlers.drop = (view, event) => {
		try {
			handleDrop(view, event, view.dragging);
		} finally {
			view.dragging = null;
		}
	};
	function handleDrop(view, event, dragging) {
		if (!event.dataTransfer) return;
		let eventPos = view.posAtCoords(eventCoords(event));
		if (!eventPos) return;
		let $mouse = view.state.doc.resolve(eventPos.pos);
		let slice = dragging && dragging.slice;
		if (slice) view.someProp("transformPasted", (f) => {
			slice = f(slice, view, false);
		});
		else slice = parseFromClipboard(view, getText$1(event.dataTransfer), brokenClipboardAPI ? null : event.dataTransfer.getData("text/html"), false, $mouse);
		let move = !!(dragging && dragMoves(view, event));
		if (view.someProp("handleDrop", (f) => f(view, event, slice || Slice.empty, move))) {
			event.preventDefault();
			return;
		}
		if (!slice) return;
		event.preventDefault();
		let insertPos = slice ? dropPoint(view.state.doc, $mouse.pos, slice) : $mouse.pos;
		if (insertPos == null) insertPos = $mouse.pos;
		let tr = view.state.tr;
		if (move) {
			let { node } = dragging;
			if (node) node.replace(tr);
			else tr.deleteSelection();
		}
		let pos = tr.mapping.map(insertPos);
		let isNode = slice.openStart == 0 && slice.openEnd == 0 && slice.content.childCount == 1;
		let beforeInsert = tr.doc;
		if (isNode) tr.replaceRangeWith(pos, pos, slice.content.firstChild);
		else tr.replaceRange(pos, pos, slice);
		if (tr.doc.eq(beforeInsert)) return;
		let $pos = tr.doc.resolve(pos);
		if (isNode && NodeSelection.isSelectable(slice.content.firstChild) && $pos.nodeAfter && $pos.nodeAfter.sameMarkup(slice.content.firstChild)) tr.setSelection(new NodeSelection($pos));
		else {
			let end = tr.mapping.map(insertPos);
			tr.mapping.maps[tr.mapping.maps.length - 1].forEach((_from, _to, _newFrom, newTo) => end = newTo);
			tr.setSelection(selectionBetween(view, $pos, tr.doc.resolve(end)));
		}
		view.focus();
		view.dispatch(tr.setMeta("uiEvent", "drop"));
	}
	handlers.focus = (view) => {
		view.input.lastFocus = Date.now();
		if (!view.focused) {
			view.domObserver.stop();
			view.dom.classList.add("ProseMirror-focused");
			view.domObserver.start();
			view.focused = true;
			setTimeout(() => {
				if (view.docView && view.hasFocus() && !view.domObserver.currentSelection.eq(view.domSelectionRange())) selectionToDOM(view);
			}, 20);
		}
	};
	handlers.blur = (view, _event) => {
		let event = _event;
		if (view.focused) {
			view.domObserver.stop();
			view.dom.classList.remove("ProseMirror-focused");
			view.domObserver.start();
			if (event.relatedTarget && view.dom.contains(event.relatedTarget)) view.domObserver.currentSelection.clear();
			view.focused = false;
		}
	};
	handlers.beforeinput = (view, _event) => {
		if (chrome && android && _event.inputType == "deleteContentBackward") {
			view.domObserver.flushSoon();
			let { domChangeCount } = view.input;
			setTimeout(() => {
				if (view.input.domChangeCount != domChangeCount) return;
				view.dom.blur();
				view.focus();
				if (view.someProp("handleKeyDown", (f) => f(view, keyEvent(8, "Backspace")))) return;
				let { $cursor } = view.state.selection;
				if ($cursor && $cursor.pos > 0) view.dispatch(view.state.tr.delete($cursor.pos - 1, $cursor.pos).scrollIntoView());
			}, 50);
		}
	};
	for (let prop in editHandlers) handlers[prop] = editHandlers[prop];
	function compareObjs(a, b) {
		if (a == b) return true;
		for (let p in a) if (a[p] !== b[p]) return false;
		for (let p in b) if (!(p in a)) return false;
		return true;
	}
	var WidgetType = class WidgetType {
		constructor(toDOM, spec) {
			this.toDOM = toDOM;
			this.spec = spec || noSpec;
			this.side = this.spec.side || 0;
		}
		map(mapping, span, offset, oldOffset) {
			let { pos, deleted } = mapping.mapResult(span.from + oldOffset, this.side < 0 ? -1 : 1);
			return deleted ? null : new Decoration(pos - offset, pos - offset, this);
		}
		valid() {
			return true;
		}
		eq(other) {
			return this == other || other instanceof WidgetType && (this.spec.key && this.spec.key == other.spec.key || this.toDOM == other.toDOM && compareObjs(this.spec, other.spec));
		}
		destroy(node) {
			if (this.spec.destroy) this.spec.destroy(node);
		}
	};
	var InlineType = class InlineType {
		constructor(attrs, spec) {
			this.attrs = attrs;
			this.spec = spec || noSpec;
		}
		map(mapping, span, offset, oldOffset) {
			let from = mapping.map(span.from + oldOffset, this.spec.inclusiveStart ? -1 : 1) - offset;
			let to = mapping.map(span.to + oldOffset, this.spec.inclusiveEnd ? 1 : -1) - offset;
			return from >= to ? null : new Decoration(from, to, this);
		}
		valid(_, span) {
			return span.from < span.to;
		}
		eq(other) {
			return this == other || other instanceof InlineType && compareObjs(this.attrs, other.attrs) && compareObjs(this.spec, other.spec);
		}
		static is(span) {
			return span.type instanceof InlineType;
		}
		destroy() {}
	};
	var NodeType = class NodeType {
		constructor(attrs, spec) {
			this.attrs = attrs;
			this.spec = spec || noSpec;
		}
		map(mapping, span, offset, oldOffset) {
			let from = mapping.mapResult(span.from + oldOffset, 1);
			if (from.deleted) return null;
			let to = mapping.mapResult(span.to + oldOffset, -1);
			if (to.deleted || to.pos <= from.pos) return null;
			return new Decoration(from.pos - offset, to.pos - offset, this);
		}
		valid(node, span) {
			let { index, offset } = node.content.findIndex(span.from), child;
			return offset == span.from && !(child = node.child(index)).isText && offset + child.nodeSize == span.to;
		}
		eq(other) {
			return this == other || other instanceof NodeType && compareObjs(this.attrs, other.attrs) && compareObjs(this.spec, other.spec);
		}
		destroy() {}
	};
	/**
	Decoration objects can be provided to the view through the
	[`decorations` prop](https://prosemirror.net/docs/ref/#view.EditorProps.decorations). They come in
	several variants—see the static members of this class for details.
	*/
	var Decoration = class Decoration {
		/**
		@internal
		*/
		constructor(from, to, type) {
			this.from = from;
			this.to = to;
			this.type = type;
		}
		/**
		@internal
		*/
		copy(from, to) {
			return new Decoration(from, to, this.type);
		}
		/**
		@internal
		*/
		eq(other, offset = 0) {
			return this.type.eq(other.type) && this.from + offset == other.from && this.to + offset == other.to;
		}
		/**
		@internal
		*/
		map(mapping, offset, oldOffset) {
			return this.type.map(mapping, this, offset, oldOffset);
		}
		/**
		Creates a widget decoration, which is a DOM node that's shown in
		the document at the given position. It is recommended that you
		delay rendering the widget by passing a function that will be
		called when the widget is actually drawn in a view, but you can
		also directly pass a DOM node. `getPos` can be used to find the
		widget's current document position.
		*/
		static widget(pos, toDOM, spec) {
			return new Decoration(pos, pos, new WidgetType(toDOM, spec));
		}
		/**
		Creates an inline decoration, which adds the given attributes to
		each inline node between `from` and `to`.
		*/
		static inline(from, to, attrs, spec) {
			return new Decoration(from, to, new InlineType(attrs, spec));
		}
		/**
		Creates a node decoration. `from` and `to` should point precisely
		before and after a node in the document. That node, and only that
		node, will receive the given attributes.
		*/
		static node(from, to, attrs, spec) {
			return new Decoration(from, to, new NodeType(attrs, spec));
		}
		/**
		The spec provided when creating this decoration. Can be useful
		if you've stored extra information in that object.
		*/
		get spec() {
			return this.type.spec;
		}
		/**
		@internal
		*/
		get inline() {
			return this.type instanceof InlineType;
		}
		/**
		@internal
		*/
		get widget() {
			return this.type instanceof WidgetType;
		}
	};
	var none = [];
	var noSpec = {};
	/**
	A collection of [decorations](https://prosemirror.net/docs/ref/#view.Decoration), organized in such
	a way that the drawing algorithm can efficiently use and compare
	them. This is a persistent data structure—it is not modified,
	updates create a new value.
	*/
	var DecorationSet = class DecorationSet {
		/**
		@internal
		*/
		constructor(local, children) {
			this.local = local.length ? local : none;
			this.children = children.length ? children : none;
		}
		/**
		Create a set of decorations, using the structure of the given
		document. This will consume (modify) the `decorations` array, so
		you must make a copy if you want need to preserve that.
		*/
		static create(doc, decorations) {
			return decorations.length ? buildTree(decorations, doc, 0, noSpec) : empty;
		}
		/**
		Find all decorations in this set which touch the given range
		(including decorations that start or end directly at the
		boundaries) and match the given predicate on their spec. When
		`start` and `end` are omitted, all decorations in the set are
		considered. When `predicate` isn't given, all decorations are
		assumed to match.
		*/
		find(start, end, predicate) {
			let result = [];
			this.findInner(start == null ? 0 : start, end == null ? 1e9 : end, result, 0, predicate);
			return result;
		}
		findInner(start, end, result, offset, predicate) {
			for (let i = 0; i < this.local.length; i++) {
				let span = this.local[i];
				if (span.from <= end && span.to >= start && (!predicate || predicate(span.spec))) result.push(span.copy(span.from + offset, span.to + offset));
			}
			for (let i = 0; i < this.children.length; i += 3) if (this.children[i] < end && this.children[i + 1] > start) {
				let childOff = this.children[i] + 1;
				this.children[i + 2].findInner(start - childOff, end - childOff, result, offset + childOff, predicate);
			}
		}
		/**
		Map the set of decorations in response to a change in the
		document.
		*/
		map(mapping, doc, options) {
			if (this == empty || mapping.maps.length == 0) return this;
			return this.mapInner(mapping, doc, 0, 0, options || noSpec);
		}
		/**
		@internal
		*/
		mapInner(mapping, node, offset, oldOffset, options) {
			let newLocal;
			for (let i = 0; i < this.local.length; i++) {
				let mapped = this.local[i].map(mapping, offset, oldOffset);
				if (mapped && mapped.type.valid(node, mapped)) (newLocal || (newLocal = [])).push(mapped);
				else if (options.onRemove) options.onRemove(this.local[i].spec);
			}
			if (this.children.length) return mapChildren(this.children, newLocal || [], mapping, node, offset, oldOffset, options);
			else return newLocal ? new DecorationSet(newLocal.sort(byPos), none) : empty;
		}
		/**
		Add the given array of decorations to the ones in the set,
		producing a new set. Consumes the `decorations` array. Needs
		access to the current document to create the appropriate tree
		structure.
		*/
		add(doc, decorations) {
			if (!decorations.length) return this;
			if (this == empty) return DecorationSet.create(doc, decorations);
			return this.addInner(doc, decorations, 0);
		}
		addInner(doc, decorations, offset) {
			let children;
			let childIndex = 0;
			doc.forEach((childNode, childOffset) => {
				let baseOffset = childOffset + offset;
				let found;
				if (!(found = takeSpansForNode(decorations, childNode, baseOffset))) return;
				if (!children) children = this.children.slice();
				while (childIndex < children.length && children[childIndex] < childOffset) childIndex += 3;
				if (children[childIndex] == childOffset) children[childIndex + 2] = children[childIndex + 2].addInner(childNode, found, baseOffset + 1);
				else children.splice(childIndex, 0, childOffset, childOffset + childNode.nodeSize, buildTree(found, childNode, baseOffset + 1, noSpec));
				childIndex += 3;
			});
			let local = moveSpans(childIndex ? withoutNulls(decorations) : decorations, -offset);
			for (let i = 0; i < local.length; i++) if (!local[i].type.valid(doc, local[i])) local.splice(i--, 1);
			return new DecorationSet(local.length ? this.local.concat(local).sort(byPos) : this.local, children || this.children);
		}
		/**
		Create a new set that contains the decorations in this set, minus
		the ones in the given array.
		*/
		remove(decorations) {
			if (decorations.length == 0 || this == empty) return this;
			return this.removeInner(decorations, 0);
		}
		removeInner(decorations, offset) {
			let children = this.children;
			let local = this.local;
			for (let i = 0; i < children.length; i += 3) {
				let found;
				let from = children[i] + offset;
				let to = children[i + 1] + offset;
				for (let j = 0, span; j < decorations.length; j++) if (span = decorations[j]) {
					if (span.from > from && span.to < to) {
						decorations[j] = null;
						(found || (found = [])).push(span);
					}
				}
				if (!found) continue;
				if (children == this.children) children = this.children.slice();
				let removed = children[i + 2].removeInner(found, from + 1);
				if (removed != empty) children[i + 2] = removed;
				else {
					children.splice(i, 3);
					i -= 3;
				}
			}
			if (local.length) {
				for (let i = 0, span; i < decorations.length; i++) if (span = decorations[i]) {
					for (let j = 0; j < local.length; j++) if (local[j].eq(span, offset)) {
						if (local == this.local) local = this.local.slice();
						local.splice(j--, 1);
					}
				}
			}
			if (children == this.children && local == this.local) return this;
			return local.length || children.length ? new DecorationSet(local, children) : empty;
		}
		forChild(offset, node) {
			if (this == empty) return this;
			if (node.isLeaf) return DecorationSet.empty;
			let child;
			let local;
			for (let i = 0; i < this.children.length; i += 3) if (this.children[i] >= offset) {
				if (this.children[i] == offset) child = this.children[i + 2];
				break;
			}
			let start = offset + 1;
			let end = start + node.content.size;
			for (let i = 0; i < this.local.length; i++) {
				let dec = this.local[i];
				if (dec.from < end && dec.to > start && dec.type instanceof InlineType) {
					let from = Math.max(start, dec.from) - start;
					let to = Math.min(end, dec.to) - start;
					if (from < to) (local || (local = [])).push(dec.copy(from, to));
				}
			}
			if (local) {
				let localSet = new DecorationSet(local.sort(byPos), none);
				return child ? new DecorationGroup([localSet, child]) : localSet;
			}
			return child || empty;
		}
		/**
		@internal
		*/
		eq(other) {
			if (this == other) return true;
			if (!(other instanceof DecorationSet) || this.local.length != other.local.length || this.children.length != other.children.length) return false;
			for (let i = 0; i < this.local.length; i++) if (!this.local[i].eq(other.local[i])) return false;
			for (let i = 0; i < this.children.length; i += 3) if (this.children[i] != other.children[i] || this.children[i + 1] != other.children[i + 1] || !this.children[i + 2].eq(other.children[i + 2])) return false;
			return true;
		}
		/**
		@internal
		*/
		locals(node) {
			return removeOverlap(this.localsInner(node));
		}
		/**
		@internal
		*/
		localsInner(node) {
			if (this == empty) return none;
			if (node.inlineContent || !this.local.some(InlineType.is)) return this.local;
			let result = [];
			for (let i = 0; i < this.local.length; i++) if (!(this.local[i].type instanceof InlineType)) result.push(this.local[i]);
			return result;
		}
		forEachSet(f) {
			f(this);
		}
	};
	/**
	The empty set of decorations.
	*/
	DecorationSet.empty = new DecorationSet([], []);
	/**
	@internal
	*/
	DecorationSet.removeOverlap = removeOverlap;
	var empty = DecorationSet.empty;
	var DecorationGroup = class DecorationGroup {
		constructor(members) {
			this.members = members;
		}
		map(mapping, doc) {
			const mappedDecos = this.members.map((member) => member.map(mapping, doc, noSpec));
			return DecorationGroup.from(mappedDecos);
		}
		forChild(offset, child) {
			if (child.isLeaf) return DecorationSet.empty;
			let found = [];
			for (let i = 0; i < this.members.length; i++) {
				let result = this.members[i].forChild(offset, child);
				if (result == empty) continue;
				if (result instanceof DecorationGroup) found = found.concat(result.members);
				else found.push(result);
			}
			return DecorationGroup.from(found);
		}
		eq(other) {
			if (!(other instanceof DecorationGroup) || other.members.length != this.members.length) return false;
			for (let i = 0; i < this.members.length; i++) if (!this.members[i].eq(other.members[i])) return false;
			return true;
		}
		locals(node) {
			let result;
			let sorted = true;
			for (let i = 0; i < this.members.length; i++) {
				let locals = this.members[i].localsInner(node);
				if (!locals.length) continue;
				if (!result) result = locals;
				else {
					if (sorted) {
						result = result.slice();
						sorted = false;
					}
					for (let j = 0; j < locals.length; j++) result.push(locals[j]);
				}
			}
			return result ? removeOverlap(sorted ? result : result.sort(byPos)) : none;
		}
		static from(members) {
			switch (members.length) {
				case 0: return empty;
				case 1: return members[0];
				default: return new DecorationGroup(members.every((m) => m instanceof DecorationSet) ? members : members.reduce((r, m) => r.concat(m instanceof DecorationSet ? m : m.members), []));
			}
		}
		forEachSet(f) {
			for (let i = 0; i < this.members.length; i++) this.members[i].forEachSet(f);
		}
	};
	function mapChildren(oldChildren, newLocal, mapping, node, offset, oldOffset, options) {
		let children = oldChildren.slice();
		for (let i = 0, baseOffset = oldOffset; i < mapping.maps.length; i++) {
			let moved = 0;
			mapping.maps[i].forEach((oldStart, oldEnd, newStart, newEnd) => {
				let dSize = newEnd - newStart - (oldEnd - oldStart);
				for (let i = 0; i < children.length; i += 3) {
					let end = children[i + 1];
					if (end < 0 || oldStart > end + baseOffset - moved) continue;
					let start = children[i] + baseOffset - moved;
					if (oldEnd >= start) children[i + 1] = oldStart <= start ? -2 : -1;
					else if (oldStart >= baseOffset && dSize) {
						children[i] += dSize;
						children[i + 1] += dSize;
					}
				}
				moved += dSize;
			});
			baseOffset = mapping.maps[i].map(baseOffset, -1);
		}
		let mustRebuild = false;
		for (let i = 0; i < children.length; i += 3) if (children[i + 1] < 0) {
			if (children[i + 1] == -2) {
				mustRebuild = true;
				children[i + 1] = -1;
				continue;
			}
			let from = mapping.map(oldChildren[i] + oldOffset);
			let fromLocal = from - offset;
			if (fromLocal < 0 || fromLocal >= node.content.size) {
				mustRebuild = true;
				continue;
			}
			let toLocal = mapping.map(oldChildren[i + 1] + oldOffset, -1) - offset;
			let { index, offset: childOffset } = node.content.findIndex(fromLocal);
			let childNode = node.maybeChild(index);
			if (childNode && childOffset == fromLocal && childOffset + childNode.nodeSize == toLocal) {
				let mapped = children[i + 2].mapInner(mapping, childNode, from + 1, oldChildren[i] + oldOffset + 1, options);
				if (mapped != empty) {
					children[i] = fromLocal;
					children[i + 1] = toLocal;
					children[i + 2] = mapped;
				} else {
					children[i + 1] = -2;
					mustRebuild = true;
				}
			} else mustRebuild = true;
		}
		if (mustRebuild) {
			let built = buildTree(mapAndGatherRemainingDecorations(children, oldChildren, newLocal, mapping, offset, oldOffset, options), node, 0, options);
			newLocal = built.local;
			for (let i = 0; i < children.length; i += 3) if (children[i + 1] < 0) {
				children.splice(i, 3);
				i -= 3;
			}
			for (let i = 0, j = 0; i < built.children.length; i += 3) {
				let from = built.children[i];
				while (j < children.length && children[j] < from) j += 3;
				children.splice(j, 0, built.children[i], built.children[i + 1], built.children[i + 2]);
			}
		}
		return new DecorationSet(newLocal.sort(byPos), children);
	}
	function moveSpans(spans, offset) {
		if (!offset || !spans.length) return spans;
		let result = [];
		for (let i = 0; i < spans.length; i++) {
			let span = spans[i];
			result.push(new Decoration(span.from + offset, span.to + offset, span.type));
		}
		return result;
	}
	function mapAndGatherRemainingDecorations(children, oldChildren, decorations, mapping, offset, oldOffset, options) {
		function gather(set, oldOffset) {
			for (let i = 0; i < set.local.length; i++) {
				let mapped = set.local[i].map(mapping, offset, oldOffset);
				if (mapped) decorations.push(mapped);
				else if (options.onRemove) options.onRemove(set.local[i].spec);
			}
			for (let i = 0; i < set.children.length; i += 3) gather(set.children[i + 2], set.children[i] + oldOffset + 1);
		}
		for (let i = 0; i < children.length; i += 3) if (children[i + 1] == -1) gather(children[i + 2], oldChildren[i] + oldOffset + 1);
		return decorations;
	}
	function takeSpansForNode(spans, node, offset) {
		if (node.isLeaf) return null;
		let end = offset + node.nodeSize;
		let found = null;
		for (let i = 0, span; i < spans.length; i++) if ((span = spans[i]) && span.from > offset && span.to < end) {
			(found || (found = [])).push(span);
			spans[i] = null;
		}
		return found;
	}
	function withoutNulls(array) {
		let result = [];
		for (let i = 0; i < array.length; i++) if (array[i] != null) result.push(array[i]);
		return result;
	}
	function buildTree(spans, node, offset, options) {
		let children = [];
		let hasNulls = false;
		node.forEach((childNode, localStart) => {
			let found = takeSpansForNode(spans, childNode, localStart + offset);
			if (found) {
				hasNulls = true;
				let subtree = buildTree(found, childNode, offset + localStart + 1, options);
				if (subtree != empty) children.push(localStart, localStart + childNode.nodeSize, subtree);
			}
		});
		let locals = moveSpans(hasNulls ? withoutNulls(spans) : spans, -offset).sort(byPos);
		for (let i = 0; i < locals.length; i++) if (!locals[i].type.valid(node, locals[i])) {
			if (options.onRemove) options.onRemove(locals[i].spec);
			locals.splice(i--, 1);
		}
		return locals.length || children.length ? new DecorationSet(locals, children) : empty;
	}
	function byPos(a, b) {
		return a.from - b.from || a.to - b.to;
	}
	function removeOverlap(spans) {
		let working = spans;
		for (let i = 0; i < working.length - 1; i++) {
			let span = working[i];
			if (span.from != span.to) for (let j = i + 1; j < working.length; j++) {
				let next = working[j];
				if (next.from == span.from) {
					if (next.to != span.to) {
						if (working == spans) working = spans.slice();
						working[j] = next.copy(next.from, span.to);
						insertAhead(working, j + 1, next.copy(span.to, next.to));
					}
					continue;
				} else {
					if (next.from < span.to) {
						if (working == spans) working = spans.slice();
						working[i] = span.copy(span.from, next.from);
						insertAhead(working, j, span.copy(next.from, span.to));
					}
					break;
				}
			}
		}
		return working;
	}
	function insertAhead(array, i, deco) {
		while (i < array.length && byPos(deco, array[i]) > 0) i++;
		array.splice(i, 0, deco);
	}
	function viewDecorations(view) {
		let found = [];
		view.someProp("decorations", (f) => {
			let result = f(view.state);
			if (result && result != empty) found.push(result);
		});
		if (view.cursorWrapper) found.push(DecorationSet.create(view.state.doc, [view.cursorWrapper.deco]));
		return DecorationGroup.from(found);
	}
	var observeOptions = {
		childList: true,
		characterData: true,
		characterDataOldValue: true,
		attributes: true,
		attributeOldValue: true,
		subtree: true
	};
	var useCharData = ie$1 && ie_version <= 11;
	var SelectionState = class {
		constructor() {
			this.anchorNode = null;
			this.anchorOffset = 0;
			this.focusNode = null;
			this.focusOffset = 0;
		}
		set(sel) {
			this.anchorNode = sel.anchorNode;
			this.anchorOffset = sel.anchorOffset;
			this.focusNode = sel.focusNode;
			this.focusOffset = sel.focusOffset;
		}
		clear() {
			this.anchorNode = this.focusNode = null;
		}
		eq(sel) {
			return sel.anchorNode == this.anchorNode && sel.anchorOffset == this.anchorOffset && sel.focusNode == this.focusNode && sel.focusOffset == this.focusOffset;
		}
	};
	var DOMObserver = class {
		constructor(view, handleDOMChange) {
			this.view = view;
			this.handleDOMChange = handleDOMChange;
			this.queue = [];
			this.flushingSoon = -1;
			this.observer = null;
			this.currentSelection = new SelectionState();
			this.onCharData = null;
			this.suppressingSelectionUpdates = false;
			this.lastChangedTextNode = null;
			this.observer = window.MutationObserver && new window.MutationObserver((mutations) => {
				for (let i = 0; i < mutations.length; i++) this.queue.push(mutations[i]);
				if (ie$1 && ie_version <= 11 && mutations.some((m) => m.type == "childList" && m.removedNodes.length || m.type == "characterData" && m.oldValue.length > m.target.nodeValue.length)) this.flushSoon();
				else if (safari && view.composing && mutations.some((m) => m.type == "childList" && m.target.nodeName == "TR")) {
					view.input.badSafariComposition = true;
					this.flushSoon();
				} else this.flush();
			});
			if (useCharData) this.onCharData = (e) => {
				this.queue.push({
					target: e.target,
					type: "characterData",
					oldValue: e.prevValue
				});
				this.flushSoon();
			};
			this.onSelectionChange = this.onSelectionChange.bind(this);
		}
		flushSoon() {
			if (this.flushingSoon < 0) this.flushingSoon = window.setTimeout(() => {
				this.flushingSoon = -1;
				this.flush();
			}, 20);
		}
		forceFlush() {
			if (this.flushingSoon > -1) {
				window.clearTimeout(this.flushingSoon);
				this.flushingSoon = -1;
				this.flush();
			}
		}
		start() {
			if (this.observer) {
				this.observer.takeRecords();
				this.observer.observe(this.view.dom, observeOptions);
			}
			if (this.onCharData) this.view.dom.addEventListener("DOMCharacterDataModified", this.onCharData);
			this.connectSelection();
		}
		stop() {
			if (this.observer) {
				let take = this.observer.takeRecords();
				if (take.length) {
					for (let i = 0; i < take.length; i++) this.queue.push(take[i]);
					window.setTimeout(() => this.flush(), 20);
				}
				this.observer.disconnect();
			}
			if (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 = true;
			setTimeout(() => this.suppressingSelectionUpdates = false, 50);
		}
		onSelectionChange() {
			if (!hasFocusAndSelection(this.view)) return;
			if (this.suppressingSelectionUpdates) return selectionToDOM(this.view);
			if (ie$1 && ie_version <= 11 && !this.view.state.selection.empty) {
				let sel = this.view.domSelectionRange();
				if (sel.focusNode && isEquivalentPosition(sel.focusNode, sel.focusOffset, sel.anchorNode, sel.anchorOffset)) return this.flushSoon();
			}
			this.flush();
		}
		setCurSelection() {
			this.currentSelection.set(this.view.domSelectionRange());
		}
		ignoreSelectionChange(sel) {
			if (!sel.focusNode) return true;
			let ancestors = /* @__PURE__ */ new Set();
			let container;
			for (let scan = sel.focusNode; scan; scan = parentNode(scan)) ancestors.add(scan);
			for (let scan = sel.anchorNode; scan; scan = parentNode(scan)) if (ancestors.has(scan)) {
				container = scan;
				break;
			}
			let desc = container && this.view.docView.nearestDesc(container);
			if (desc && desc.ignoreMutation({
				type: "selection",
				target: container.nodeType == 3 ? container.parentNode : container
			})) {
				this.setCurSelection();
				return true;
			}
		}
		pendingRecords() {
			if (this.observer) for (let mut of this.observer.takeRecords()) this.queue.push(mut);
			return this.queue;
		}
		flush() {
			let { view } = this;
			if (!view.docView || this.flushingSoon > -1) return;
			let mutations = this.pendingRecords();
			if (mutations.length) this.queue = [];
			let sel = view.domSelectionRange();
			let newSel = !this.suppressingSelectionUpdates && !this.currentSelection.eq(sel) && hasFocusAndSelection(view) && !this.ignoreSelectionChange(sel);
			let from = -1;
			let to = -1;
			let typeOver = false;
			let added = [];
			if (view.editable) for (let i = 0; i < mutations.length; i++) {
				let result = this.registerMutation(mutations[i], added);
				if (result) {
					from = from < 0 ? result.from : Math.min(result.from, from);
					to = to < 0 ? result.to : Math.max(result.to, to);
					if (result.typeOver) typeOver = true;
				}
			}
			if (added.some((n) => n.nodeName == "BR") && (view.input.lastKeyCode == 8 || view.input.lastKeyCode == 46)) {
				for (let node of added) if (node.nodeName == "BR" && node.parentNode) {
					let after = node.nextSibling;
					if (after && after.nodeType == 1 && after.contentEditable == "false") node.parentNode.removeChild(node);
				}
			} else if (gecko && added.length) {
				let brs = added.filter((n) => n.nodeName == "BR");
				if (brs.length == 2) {
					let [a, b] = brs;
					if (a.parentNode && a.parentNode.parentNode == b.parentNode) b.remove();
					else a.remove();
				} else {
					let { focusNode } = this.currentSelection;
					for (let br of brs) {
						let parent = br.parentNode;
						if (parent && parent.nodeName == "LI" && (!focusNode || blockParent(view, focusNode) != parent)) br.remove();
					}
				}
			}
			let readSel = null;
			if (from < 0 && newSel && view.input.lastFocus > Date.now() - 200 && Math.max(view.input.lastTouch, view.input.lastClick.time) < Date.now() - 300 && selectionCollapsed(sel) && (readSel = selectionFromDOM(view)) && readSel.eq(Selection.near(view.state.doc.resolve(0), 1))) {
				view.input.lastFocus = 0;
				selectionToDOM(view);
				this.currentSelection.set(sel);
				view.scrollToSelection();
			} else if (from > -1 || newSel) {
				if (from > -1) {
					view.docView.markDirty(from, to);
					checkCSS(view);
				}
				if (view.input.badSafariComposition) {
					view.input.badSafariComposition = false;
					fixUpBadSafariComposition(view, added);
				}
				this.handleDOMChange(from, to, typeOver, added);
				if (view.docView && view.docView.dirty) view.updateState(view.state);
				else if (!this.currentSelection.eq(sel)) selectionToDOM(view);
				this.currentSelection.set(sel);
			}
		}
		registerMutation(mut, added) {
			if (added.indexOf(mut.target) > -1) return null;
			let desc = this.view.docView.nearestDesc(mut.target);
			if (mut.type == "attributes" && (desc == this.view.docView || mut.attributeName == "contenteditable" || mut.attributeName == "style" && !mut.oldValue && !mut.target.getAttribute("style"))) return null;
			if (!desc || desc.ignoreMutation(mut)) return null;
			if (mut.type == "childList") {
				for (let i = 0; i < mut.addedNodes.length; i++) {
					let node = mut.addedNodes[i];
					added.push(node);
					if (node.nodeType == 3) this.lastChangedTextNode = node;
				}
				if (desc.contentDOM && desc.contentDOM != desc.dom && !desc.contentDOM.contains(mut.target)) return {
					from: desc.posBefore,
					to: desc.posAfter
				};
				let prev = mut.previousSibling;
				let next = mut.nextSibling;
				if (ie$1 && ie_version <= 11 && mut.addedNodes.length) for (let i = 0; i < mut.addedNodes.length; i++) {
					let { previousSibling, nextSibling } = mut.addedNodes[i];
					if (!previousSibling || Array.prototype.indexOf.call(mut.addedNodes, previousSibling) < 0) prev = previousSibling;
					if (!nextSibling || Array.prototype.indexOf.call(mut.addedNodes, nextSibling) < 0) next = nextSibling;
				}
				let fromOffset = prev && prev.parentNode == mut.target ? domIndex(prev) + 1 : 0;
				let from = desc.localPosFromDOM(mut.target, fromOffset, -1);
				let toOffset = next && next.parentNode == mut.target ? domIndex(next) : mut.target.childNodes.length;
				return {
					from,
					to: desc.localPosFromDOM(mut.target, toOffset, 1)
				};
			} else if (mut.type == "attributes") return {
				from: desc.posAtStart - desc.border,
				to: desc.posAtEnd + desc.border
			};
			else {
				this.lastChangedTextNode = mut.target;
				return {
					from: desc.posAtStart,
					to: desc.posAtEnd,
					typeOver: mut.target.nodeValue == mut.oldValue
				};
			}
		}
	};
	var cssChecked = /* @__PURE__ */ new WeakMap();
	var cssCheckWarned = false;
	function checkCSS(view) {
		if (cssChecked.has(view)) return;
		cssChecked.set(view, null);
		if ([
			"normal",
			"nowrap",
			"pre-line"
		].indexOf(getComputedStyle(view.dom).whiteSpace) !== -1) {
			view.requiresGeckoHackNode = gecko;
			if (cssCheckWarned) return;
			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.");
			cssCheckWarned = true;
		}
	}
	function rangeToSelectionRange(view, range) {
		let anchorNode = range.startContainer;
		let anchorOffset = range.startOffset;
		let focusNode = range.endContainer;
		let focusOffset = range.endOffset;
		let currentAnchor = view.domAtPos(view.state.selection.anchor);
		if (isEquivalentPosition(currentAnchor.node, currentAnchor.offset, focusNode, focusOffset)) [anchorNode, anchorOffset, focusNode, focusOffset] = [
			focusNode,
			focusOffset,
			anchorNode,
			anchorOffset
		];
		return {
			anchorNode,
			anchorOffset,
			focusNode,
			focusOffset
		};
	}
	function safariShadowSelectionRange(view, selection) {
		if (selection.getComposedRanges) {
			let range = selection.getComposedRanges(view.root)[0];
			if (range) return rangeToSelectionRange(view, range);
		}
		let found;
		function read(event) {
			event.preventDefault();
			event.stopImmediatePropagation();
			found = event.getTargetRanges()[0];
		}
		view.dom.addEventListener("beforeinput", read, true);
		document.execCommand("indent");
		view.dom.removeEventListener("beforeinput", read, true);
		return found ? rangeToSelectionRange(view, found) : null;
	}
	function blockParent(view, node) {
		for (let p = node.parentNode; p && p != view.dom; p = p.parentNode) {
			let desc = view.docView.nearestDesc(p, true);
			if (desc && desc.node.isBlock) return p;
		}
		return null;
	}
	function fixUpBadSafariComposition(view, addedNodes) {
		var _a;
		let { focusNode, focusOffset } = view.domSelectionRange();
		for (let node of addedNodes) if (((_a = node.parentNode) === null || _a === void 0 ? void 0 : _a.nodeName) == "TR") {
			let nextCell = node.nextSibling;
			while (nextCell && nextCell.nodeName != "TD" && nextCell.nodeName != "TH") nextCell = nextCell.nextSibling;
			if (nextCell) {
				let parent = nextCell;
				for (;;) {
					let first = parent.firstChild;
					if (!first || first.nodeType != 1 || first.contentEditable == "false" || /^(BR|IMG)$/.test(first.nodeName)) break;
					parent = first;
				}
				parent.insertBefore(node, parent.firstChild);
				if (focusNode == node) view.domSelection().collapse(node, focusOffset);
			} else node.parentNode.removeChild(node);
		}
	}
	function parseBetween(view, from_, to_) {
		let { node: parent, fromOffset, toOffset, from, to } = view.docView.parseRange(from_, to_);
		let domSel = view.domSelectionRange();
		let find;
		let anchor = domSel.anchorNode;
		if (anchor && view.dom.contains(anchor.nodeType == 1 ? anchor : anchor.parentNode)) {
			find = [{
				node: anchor,
				offset: domSel.anchorOffset
			}];
			if (!selectionCollapsed(domSel)) find.push({
				node: domSel.focusNode,
				offset: domSel.focusOffset
			});
		}
		if (chrome && view.input.lastKeyCode === 8) for (let off = toOffset; off > fromOffset; off--) {
			let node = parent.childNodes[off - 1];
			let desc = node.pmViewDesc;
			if (node.nodeName == "BR" && !desc) {
				toOffset = off;
				break;
			}
			if (!desc || desc.size) break;
		}
		let startDoc = view.state.doc;
		let parser = view.someProp("domParser") || DOMParser$1.fromSchema(view.state.schema);
		let $from = startDoc.resolve(from);
		let sel = null;
		let doc = parser.parse(parent, {
			topNode: $from.parent,
			topMatch: $from.parent.contentMatchAt($from.index()),
			topOpen: true,
			from: fromOffset,
			to: toOffset,
			preserveWhitespace: $from.parent.type.whitespace == "pre" ? "full" : true,
			findPositions: find,
			ruleFromNode,
			context: $from
		});
		if (find && find[0].pos != null) {
			let anchor = find[0].pos;
			let head = find[1] && find[1].pos;
			if (head == null) head = anchor;
			sel = {
				anchor: anchor + from,
				head: head + from
			};
		}
		return {
			doc,
			sel,
			from,
			to
		};
	}
	function ruleFromNode(dom) {
		let desc = dom.pmViewDesc;
		if (desc) return desc.parseRule();
		else if (dom.nodeName == "BR" && dom.parentNode) {
			if (safari && /^(ul|ol)$/i.test(dom.parentNode.nodeName)) {
				let skip = document.createElement("div");
				skip.appendChild(document.createElement("li"));
				return { skip };
			} else if (dom.parentNode.lastChild == dom || safari && /^(tr|table)$/i.test(dom.parentNode.nodeName)) return { ignore: true };
		} else if (dom.nodeName == "IMG" && dom.getAttribute("mark-placeholder")) return { ignore: true };
		return null;
	}
	var isInline = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;
	function readDOMChange(view, from, to, typeOver, addedNodes) {
		let compositionID = view.input.compositionPendingChanges || (view.composing ? view.input.compositionID : 0);
		view.input.compositionPendingChanges = 0;
		if (from < 0) {
			let origin = view.input.lastSelectionTime > Date.now() - 50 ? view.input.lastSelectionOrigin : null;
			let newSel = selectionFromDOM(view, origin);
			if (newSel && !view.state.selection.eq(newSel)) {
				if (chrome && android && view.input.lastKeyCode === 13 && Date.now() - 100 < view.input.lastKeyCodeTime && view.someProp("handleKeyDown", (f) => f(view, keyEvent(13, "Enter")))) return;
				let tr = view.state.tr.setSelection(newSel);
				if (origin == "pointer") tr.setMeta("pointer", true);
				else if (origin == "key") tr.scrollIntoView();
				if (compositionID) tr.setMeta("composition", compositionID);
				view.dispatch(tr);
			}
			return;
		}
		let $before = view.state.doc.resolve(from);
		let shared = $before.sharedDepth(to);
		from = $before.before(shared + 1);
		to = view.state.doc.resolve(to).after(shared + 1);
		let sel = view.state.selection;
		let parse = parseBetween(view, from, to);
		let doc = view.state.doc;
		let compare = doc.slice(parse.from, parse.to);
		let preferredPos;
		let preferredSide;
		if (view.input.lastKeyCode === 8 && Date.now() - 100 < view.input.lastKeyCodeTime) {
			preferredPos = view.state.selection.to;
			preferredSide = "end";
		} else {
			preferredPos = view.state.selection.from;
			preferredSide = "start";
		}
		view.input.lastKeyCode = null;
		let change = findDiff(compare.content, parse.doc.content, parse.from, preferredPos, preferredSide);
		if (change) view.input.domChangeCount++;
		if ((ios && view.input.lastIOSEnter > Date.now() - 225 || android) && addedNodes.some((n) => n.nodeType == 1 && !isInline.test(n.nodeName)) && (!change || change.endA >= change.endB) && view.someProp("handleKeyDown", (f) => f(view, keyEvent(13, "Enter")))) {
			view.input.lastIOSEnter = 0;
			return;
		}
		if (!change) if (typeOver && sel instanceof TextSelection && !sel.empty && sel.$head.sameParent(sel.$anchor) && !view.composing && !(parse.sel && parse.sel.anchor != parse.sel.head)) change = {
			start: sel.from,
			endA: sel.to,
			endB: sel.to
		};
		else {
			if (parse.sel) {
				let sel = resolveSelection(view, view.state.doc, parse.sel);
				if (sel && !sel.eq(view.state.selection)) {
					let tr = view.state.tr.setSelection(sel);
					if (compositionID) tr.setMeta("composition", compositionID);
					view.dispatch(tr);
				}
			}
			return;
		}
		if (view.state.selection.from < view.state.selection.to && change.start == change.endB && view.state.selection instanceof TextSelection) {
			if (change.start > view.state.selection.from && change.start <= view.state.selection.from + 2 && view.state.selection.from >= parse.from) change.start = view.state.selection.from;
			else if (change.endA < view.state.selection.to && change.endA >= view.state.selection.to - 2 && view.state.selection.to <= parse.to) {
				change.endB += view.state.selection.to - change.endA;
				change.endA = view.state.selection.to;
			}
		}
		if (ie$1 && ie_version <= 11 && change.endB == change.start + 1 && change.endA == change.start && change.start > parse.from && parse.doc.textBetween(change.start - parse.from - 1, change.start - parse.from + 1) == " \xA0") {
			change.start--;
			change.endA--;
			change.endB--;
		}
		let $from = parse.doc.resolveNoCache(change.start - parse.from);
		let $to = parse.doc.resolveNoCache(change.endB - parse.from);
		let $fromA = doc.resolve(change.start);
		let inlineChange = $from.sameParent($to) && $from.parent.inlineContent && $fromA.end() >= change.endA;
		if ((ios && view.input.lastIOSEnter > Date.now() - 225 && (!inlineChange || addedNodes.some((n) => n.nodeName == "DIV" || n.nodeName == "P")) || !inlineChange && $from.pos < parse.doc.content.size && (!$from.sameParent($to) || !$from.parent.inlineContent) && $from.pos < $to.pos && !/\S/.test(parse.doc.textBetween($from.pos, $to.pos, "", ""))) && view.someProp("handleKeyDown", (f) => f(view, keyEvent(13, "Enter")))) {
			view.input.lastIOSEnter = 0;
			return;
		}
		if (view.state.selection.anchor > change.start && looksLikeBackspace(doc, change.start, change.endA, $from, $to) && view.someProp("handleKeyDown", (f) => f(view, keyEvent(8, "Backspace")))) {
			if (android && chrome) view.domObserver.suppressSelectionUpdates();
			return;
		}
		if (chrome && change.endB == change.start) view.input.lastChromeDelete = Date.now();
		if (android && !inlineChange && $from.start() != $to.start() && $to.parentOffset == 0 && $from.depth == $to.depth && parse.sel && parse.sel.anchor == parse.sel.head && parse.sel.head == change.endA) {
			change.endB -= 2;
			$to = parse.doc.resolveNoCache(change.endB - parse.from);
			setTimeout(() => {
				view.someProp("handleKeyDown", function(f) {
					return f(view, keyEvent(13, "Enter"));
				});
			}, 20);
		}
		let chFrom = change.start;
		let chTo = change.endA;
		let mkTr = (base) => {
			let tr = base || view.state.tr.replace(chFrom, chTo, parse.doc.slice(change.start - parse.from, change.endB - parse.from));
			if (parse.sel) {
				let sel = resolveSelection(view, tr.doc, parse.sel);
				if (sel && !(chrome && view.composing && sel.empty && (change.start != change.endB || view.input.lastChromeDelete < Date.now() - 100) && (sel.head == chFrom || sel.head == tr.mapping.map(chTo) - 1) || ie$1 && sel.empty && sel.head == chFrom)) tr.setSelection(sel);
			}
			if (compositionID) tr.setMeta("composition", compositionID);
			return tr.scrollIntoView();
		};
		let markChange;
		if (inlineChange) if ($from.pos == $to.pos) {
			if (ie$1 && ie_version <= 11 && $from.parentOffset == 0) {
				view.domObserver.suppressSelectionUpdates();
				setTimeout(() => selectionToDOM(view), 20);
			}
			let tr = mkTr(view.state.tr.delete(chFrom, chTo));
			let marks = doc.resolve(change.start).marksAcross(doc.resolve(change.endA));
			if (marks) tr.ensureMarks(marks);
			view.dispatch(tr);
		} else if (change.endA == change.endB && (markChange = isMarkChange($from.parent.content.cut($from.parentOffset, $to.parentOffset), $fromA.parent.content.cut($fromA.parentOffset, change.endA - $fromA.start())))) {
			let tr = mkTr(view.state.tr);
			if (markChange.type == "add") tr.addMark(chFrom, chTo, markChange.mark);
			else tr.removeMark(chFrom, chTo, markChange.mark);
			view.dispatch(tr);
		} else if ($from.parent.child($from.index()).isText && $from.index() == $to.index() - ($to.textOffset ? 0 : 1)) {
			let text = $from.parent.textBetween($from.parentOffset, $to.parentOffset);
			let deflt = () => mkTr(view.state.tr.insertText(text, chFrom, chTo));
			if (!view.someProp("handleTextInput", (f) => f(view, chFrom, chTo, text, deflt))) view.dispatch(deflt());
		} else view.dispatch(mkTr());
		else view.dispatch(mkTr());
	}
	function resolveSelection(view, doc, parsedSel) {
		if (Math.max(parsedSel.anchor, parsedSel.head) > doc.content.size) return null;
		return selectionBetween(view, doc.resolve(parsedSel.anchor), doc.resolve(parsedSel.head));
	}
	function isMarkChange(cur, prev) {
		let curMarks = cur.firstChild.marks;
		let prevMarks = prev.firstChild.marks;
		let added = curMarks;
		let removed = prevMarks;
		let type;
		let mark;
		let update;
		for (let i = 0; i < prevMarks.length; i++) added = prevMarks[i].removeFromSet(added);
		for (let i = 0; i < curMarks.length; i++) removed = curMarks[i].removeFromSet(removed);
		if (added.length == 1 && removed.length == 0) {
			mark = added[0];
			type = "add";
			update = (node) => node.mark(mark.addToSet(node.marks));
		} else if (added.length == 0 && removed.length == 1) {
			mark = removed[0];
			type = "remove";
			update = (node) => node.mark(mark.removeFromSet(node.marks));
		} else return null;
		let updated = [];
		for (let i = 0; i < prev.childCount; i++) updated.push(update(prev.child(i)));
		if (Fragment$1.from(updated).eq(cur)) return {
			mark,
			type
		};
	}
	function looksLikeBackspace(old, start, end, $newStart, $newEnd) {
		if (end - start <= $newEnd.pos - $newStart.pos || skipClosingAndOpening($newStart, true, false) < $newEnd.pos) return false;
		let $start = old.resolve(start);
		if (!$newStart.parent.isTextblock) {
			let after = $start.nodeAfter;
			return after != null && end == start + after.nodeSize;
		}
		if ($start.parentOffset < $start.parent.content.size || !$start.parent.isTextblock) return false;
		let $next = old.resolve(skipClosingAndOpening($start, true, true));
		if (!$next.parent.isTextblock || $next.pos > end || skipClosingAndOpening($next, true, false) < end) return false;
		return $newStart.parent.content.cut($newStart.parentOffset).eq($next.parent.content);
	}
	function skipClosingAndOpening($pos, fromEnd, mayOpen) {
		let depth = $pos.depth;
		let end = fromEnd ? $pos.end() : $pos.pos;
		while (depth > 0 && (fromEnd || $pos.indexAfter(depth) == $pos.node(depth).childCount)) {
			depth--;
			end++;
			fromEnd = false;
		}
		if (mayOpen) {
			let next = $pos.node(depth).maybeChild($pos.indexAfter(depth));
			while (next && !next.isLeaf) {
				next = next.firstChild;
				end++;
			}
		}
		return end;
	}
	function findDiff(a, b, pos, preferredPos, preferredSide) {
		let start = a.findDiffStart(b, pos);
		if (start == null) return null;
		let { a: endA, b: endB } = a.findDiffEnd(b, pos + a.size, pos + b.size);
		if (preferredSide == "end") {
			let adjust = Math.max(0, start - Math.min(endA, endB));
			preferredPos -= endA + adjust - start;
		}
		if (endA < start && a.size < b.size) {
			let move = preferredPos <= start && preferredPos >= endA ? start - preferredPos : 0;
			start -= move;
			if (start && start < b.size && isSurrogatePair(b.textBetween(start - 1, start + 1))) start += move ? 1 : -1;
			endB = start + (endB - endA);
			endA = start;
		} else if (endB < start) {
			let move = preferredPos <= start && preferredPos >= endB ? start - preferredPos : 0;
			start -= move;
			if (start && start < a.size && isSurrogatePair(a.textBetween(start - 1, start + 1))) start += move ? 1 : -1;
			endA = start + (endA - endB);
			endB = start;
		}
		return {
			start,
			endA,
			endB
		};
	}
	function isSurrogatePair(str) {
		if (str.length != 2) return false;
		let a = str.charCodeAt(0);
		let b = str.charCodeAt(1);
		return a >= 56320 && a <= 57343 && b >= 55296 && b <= 56319;
	}
	/**
	An editor view manages the DOM structure that represents an
	editable document. Its state and behavior are determined by its
	[props](https://prosemirror.net/docs/ref/#view.DirectEditorProps).
	*/
	var EditorView = class {
		/**
		Create a view. `place` may be a DOM node that the editor should
		be appended to, a function that will place it into the document,
		or an object whose `mount` property holds the node to use as the
		document container. If it is `null`, the editor will not be
		added to the document.
		*/
		constructor(place, props) {
			this._root = null;
			/**
			@internal
			*/
			this.focused = false;
			/**
			Kludge used to work around a Chrome bug @internal
			*/
			this.trackWrites = null;
			this.mounted = false;
			/**
			@internal
			*/
			this.markCursor = null;
			/**
			@internal
			*/
			this.cursorWrapper = null;
			/**
			@internal
			*/
			this.lastSelectedViewDesc = void 0;
			/**
			@internal
			*/
			this.input = new InputState();
			this.prevDirectPlugins = [];
			this.pluginViews = [];
			/**
			Holds `true` when a hack node is needed in Firefox to prevent the
			[space is eaten issue](https://github.com/ProseMirror/prosemirror/issues/651)
			@internal
			*/
			this.requiresGeckoHackNode = false;
			/**
			When editor content is being dragged, this object contains
			information about the dragged slice and whether it is being
			copied or moved. At any other time, it is null.
			*/
			this.dragging = null;
			this._props = props;
			this.state = props.state;
			this.directPlugins = props.plugins || [];
			this.directPlugins.forEach(checkStateComponent);
			this.dispatch = this.dispatch.bind(this);
			this.dom = place && place.mount || document.createElement("div");
			if (place) {
				if (place.appendChild) place.appendChild(this.dom);
				else if (typeof place == "function") place(this.dom);
				else if (place.mount) this.mounted = true;
			}
			this.editable = getEditable(this);
			updateCursorWrapper(this);
			this.nodeViews = buildNodeViews(this);
			this.docView = docViewDesc(this.state.doc, computeDocDeco(this), viewDecorations(this), this.dom, this);
			this.domObserver = new DOMObserver(this, (from, to, typeOver, added) => readDOMChange(this, from, to, typeOver, added));
			this.domObserver.start();
			initInput(this);
			this.updatePluginViews();
		}
		/**
		Holds `true` when a
		[composition](https://w3c.github.io/uievents/#events-compositionevents)
		is active.
		*/
		get composing() {
			return this.input.composing;
		}
		/**
		The view's current [props](https://prosemirror.net/docs/ref/#view.EditorProps).
		*/
		get props() {
			if (this._props.state != this.state) {
				let prev = this._props;
				this._props = {};
				for (let name in prev) this._props[name] = prev[name];
				this._props.state = this.state;
			}
			return this._props;
		}
		/**
		Update the view's props. Will immediately cause an update to
		the DOM.
		*/
		update(props) {
			if (props.handleDOMEvents != this._props.handleDOMEvents) ensureListeners(this);
			let prevProps = this._props;
			this._props = props;
			if (props.plugins) {
				props.plugins.forEach(checkStateComponent);
				this.directPlugins = props.plugins;
			}
			this.updateStateInner(props.state, prevProps);
		}
		/**
		Update the view by updating existing props object with the object
		given as argument. Equivalent to `view.update(Object.assign({},
		view.props, props))`.
		*/
		setProps(props) {
			let updated = {};
			for (let name in this._props) updated[name] = this._props[name];
			updated.state = this.state;
			for (let name in props) updated[name] = props[name];
			this.update(updated);
		}
		/**
		Update the editor's `state` prop, without touching any of the
		other props.
		*/
		updateState(state) {
			this.updateStateInner(state, this._props);
		}
		updateStateInner(state, prevProps) {
			var _a;
			let prev = this.state;
			let redraw = false;
			let updateSel = false;
			if (state.storedMarks && this.composing) {
				clearComposition(this);
				updateSel = true;
			}
			this.state = state;
			let pluginsChanged = prev.plugins != state.plugins || this._props.plugins != prevProps.plugins;
			if (pluginsChanged || this._props.plugins != prevProps.plugins || this._props.nodeViews != prevProps.nodeViews) {
				let nodeViews = buildNodeViews(this);
				if (changedNodeViews(nodeViews, this.nodeViews)) {
					this.nodeViews = nodeViews;
					redraw = true;
				}
			}
			if (pluginsChanged || prevProps.handleDOMEvents != this._props.handleDOMEvents) ensureListeners(this);
			this.editable = getEditable(this);
			updateCursorWrapper(this);
			let innerDeco = viewDecorations(this);
			let outerDeco = computeDocDeco(this);
			let scroll = prev.plugins != state.plugins && !prev.doc.eq(state.doc) ? "reset" : state.scrollToSelection > prev.scrollToSelection ? "to selection" : "preserve";
			let updateDoc = redraw || !this.docView.matchesNode(state.doc, outerDeco, innerDeco);
			if (updateDoc || !state.selection.eq(prev.selection)) updateSel = true;
			let oldScrollPos = scroll == "preserve" && updateSel && this.dom.style.overflowAnchor == null && storeScrollPos(this);
			if (updateSel) {
				this.domObserver.stop();
				let forceSelUpdate = updateDoc && (ie$1 || chrome) && !this.composing && !prev.selection.empty && !state.selection.empty && selectionContextChanged(prev.selection, state.selection);
				if (updateDoc) {
					let chromeKludge = chrome ? this.trackWrites = this.domSelectionRange().focusNode : null;
					if (this.composing) this.input.compositionNode = findCompositionNode(this);
					if (redraw || !this.docView.update(state.doc, outerDeco, innerDeco, this)) {
						this.docView.updateOuterDeco(outerDeco);
						this.docView.destroy();
						this.docView = docViewDesc(state.doc, outerDeco, innerDeco, this.dom, this);
					}
					if (chromeKludge && (!this.trackWrites || !this.dom.contains(this.trackWrites))) forceSelUpdate = true;
				}
				if (forceSelUpdate || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && anchorInRightPlace(this))) selectionToDOM(this, forceSelUpdate);
				else {
					syncNodeSelection(this, state.selection);
					this.domObserver.setCurSelection();
				}
				this.domObserver.start();
			}
			this.updatePluginViews(prev);
			if (((_a = this.dragging) === null || _a === void 0 ? void 0 : _a.node) && !prev.doc.eq(state.doc)) this.updateDraggedNode(this.dragging, prev);
			if (scroll == "reset") this.dom.scrollTop = 0;
			else if (scroll == "to selection") this.scrollToSelection();
			else if (oldScrollPos) resetScrollPos(oldScrollPos);
		}
		/**
		@internal
		*/
		scrollToSelection() {
			let startDOM = this.domSelectionRange().focusNode;
			if (!startDOM || !this.dom.contains(startDOM.nodeType == 1 ? startDOM : startDOM.parentNode));
			else if (this.someProp("handleScrollToSelection", (f) => f(this)));
			else if (this.state.selection instanceof NodeSelection) {
				let target = this.docView.domAfterPos(this.state.selection.from);
				if (target.nodeType == 1) scrollRectIntoView(this, target.getBoundingClientRect(), startDOM);
			} else scrollRectIntoView(this, this.coordsAtPos(this.state.selection.head, 1), startDOM);
		}
		destroyPluginViews() {
			let view;
			while (view = this.pluginViews.pop()) if (view.destroy) view.destroy();
		}
		updatePluginViews(prevState) {
			if (!prevState || prevState.plugins != this.state.plugins || this.directPlugins != this.prevDirectPlugins) {
				this.prevDirectPlugins = this.directPlugins;
				this.destroyPluginViews();
				for (let i = 0; i < this.directPlugins.length; i++) {
					let plugin = this.directPlugins[i];
					if (plugin.spec.view) this.pluginViews.push(plugin.spec.view(this));
				}
				for (let i = 0; i < this.state.plugins.length; i++) {
					let plugin = this.state.plugins[i];
					if (plugin.spec.view) this.pluginViews.push(plugin.spec.view(this));
				}
			} else for (let i = 0; i < this.pluginViews.length; i++) {
				let pluginView = this.pluginViews[i];
				if (pluginView.update) pluginView.update(this, prevState);
			}
		}
		updateDraggedNode(dragging, prev) {
			let sel = dragging.node;
			let found = -1;
			if (this.state.doc.nodeAt(sel.from) == sel.node) found = sel.from;
			else {
				let movedPos = sel.from + (this.state.doc.content.size - prev.doc.content.size);
				if ((movedPos > 0 && this.state.doc.nodeAt(movedPos)) == sel.node) found = movedPos;
			}
			this.dragging = new Dragging(dragging.slice, dragging.move, found < 0 ? void 0 : NodeSelection.create(this.state.doc, found));
		}
		someProp(propName, f) {
			let prop = this._props && this._props[propName];
			let value;
			if (prop != null && (value = f ? f(prop) : prop)) return value;
			for (let i = 0; i < this.directPlugins.length; i++) {
				let prop = this.directPlugins[i].props[propName];
				if (prop != null && (value = f ? f(prop) : prop)) return value;
			}
			let plugins = this.state.plugins;
			if (plugins) for (let i = 0; i < plugins.length; i++) {
				let prop = plugins[i].props[propName];
				if (prop != null && (value = f ? f(prop) : prop)) return value;
			}
		}
		/**
		Query whether the view has focus.
		*/
		hasFocus() {
			if (ie$1) {
				let node = this.root.activeElement;
				if (node == this.dom) return true;
				if (!node || !this.dom.contains(node)) return false;
				while (node && this.dom != node && this.dom.contains(node)) {
					if (node.contentEditable == "false") return false;
					node = node.parentElement;
				}
				return true;
			}
			return this.root.activeElement == this.dom;
		}
		/**
		Focus the editor.
		*/
		focus() {
			this.domObserver.stop();
			if (this.editable) focusPreventScroll(this.dom);
			selectionToDOM(this);
			this.domObserver.start();
		}
		/**
		Get the document root in which the editor exists. This will
		usually be the top-level `document`, but might be a [shadow
		DOM](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Shadow_DOM)
		root if the editor is inside one.
		*/
		get root() {
			let cached = this._root;
			if (cached == null) {
				for (let search = this.dom.parentNode; search; search = search.parentNode) if (search.nodeType == 9 || search.nodeType == 11 && search.host) {
					if (!search.getSelection) Object.getPrototypeOf(search).getSelection = () => search.ownerDocument.getSelection();
					return this._root = search;
				}
			}
			return cached || document;
		}
		/**
		When an existing editor view is moved to a new document or
		shadow tree, call this to make it recompute its root.
		*/
		updateRoot() {
			this._root = null;
		}
		/**
		Given a pair of viewport coordinates, return the document
		position that corresponds to them. May return null if the given
		coordinates aren't inside of the editor. When an object is
		returned, its `pos` property is the position nearest to the
		coordinates, and its `inside` property holds the position of the
		inner node that the position falls inside of, or -1 if it is at
		the top level, not in any node.
		*/
		posAtCoords(coords) {
			return posAtCoords(this, coords);
		}
		/**
		Returns the viewport rectangle at a given document position.
		`left` and `right` will be the same number, as this returns a
		flat cursor-ish rectangle. If the position is between two things
		that aren't directly adjacent, `side` determines which element
		is used. When < 0, the element before the position is used,
		otherwise the element after.
		*/
		coordsAtPos(pos, side = 1) {
			return coordsAtPos(this, pos, side);
		}
		/**
		Find the DOM position that corresponds to the given document
		position. When `side` is negative, find the position as close as
		possible to the content before the position. When positive,
		prefer positions close to the content after the position. When
		zero, prefer as shallow a position as possible.
		
		Note that you should **not** mutate the editor's internal DOM,
		only inspect it (and even that is usually not necessary).
		*/
		domAtPos(pos, side = 0) {
			return this.docView.domFromPos(pos, side);
		}
		/**
		Find the DOM node that represents the document node after the
		given position. May return `null` when the position doesn't point
		in front of a node or if the node is inside an opaque node view.
		
		This is intended to be able to call things like
		`getBoundingClientRect` on that DOM node. Do **not** mutate the
		editor DOM directly, or add styling this way, since that will be
		immediately overriden by the editor as it redraws the node.
		*/
		nodeDOM(pos) {
			let desc = this.docView.descAt(pos);
			return desc ? desc.nodeDOM : null;
		}
		/**
		Find the document position that corresponds to a given DOM
		position. (Whenever possible, it is preferable to inspect the
		document structure directly, rather than poking around in the
		DOM, but sometimes—for example when interpreting an event
		target—you don't have a choice.)
		
		The `bias` parameter can be used to influence which side of a DOM
		node to use when the position is inside a leaf node.
		*/
		posAtDOM(node, offset, bias = -1) {
			let pos = this.docView.posFromDOM(node, offset, bias);
			if (pos == null) throw new RangeError("DOM position not inside the editor");
			return pos;
		}
		/**
		Find out whether the selection is at the end of a textblock when
		moving in a given direction. When, for example, given `"left"`,
		it will return true if moving left from the current cursor
		position would leave that position's parent textblock. Will apply
		to the view's current state by default, but it is possible to
		pass a different state.
		*/
		endOfTextblock(dir, state) {
			return endOfTextblock(this, state || this.state, dir);
		}
		/**
		Run the editor's paste logic with the given HTML string. The
		`event`, if given, will be passed to the
		[`handlePaste`](https://prosemirror.net/docs/ref/#view.EditorProps.handlePaste) hook.
		*/
		pasteHTML(html, event) {
			return doPaste(this, "", html, false, event || new ClipboardEvent("paste"));
		}
		/**
		Run the editor's paste logic with the given plain-text input.
		*/
		pasteText(text, event) {
			return doPaste(this, text, null, true, event || new ClipboardEvent("paste"));
		}
		/**
		Serialize the given slice as it would be if it was copied from
		this editor. Returns a DOM element that contains a
		representation of the slice as its children, a textual
		representation, and the transformed slice (which can be
		different from the given input due to hooks like
		[`transformCopied`](https://prosemirror.net/docs/ref/#view.EditorProps.transformCopied)).
		*/
		serializeForClipboard(slice) {
			return serializeForClipboard(this, slice);
		}
		/**
		Removes the editor from the DOM and destroys all [node
		views](https://prosemirror.net/docs/ref/#view.NodeView).
		*/
		destroy() {
			if (!this.docView) return;
			destroyInput(this);
			this.destroyPluginViews();
			if (this.mounted) {
				this.docView.update(this.state.doc, [], viewDecorations(this), this);
				this.dom.textContent = "";
			} else if (this.dom.parentNode) this.dom.parentNode.removeChild(this.dom);
			this.docView.destroy();
			this.docView = null;
			clearReusedRange();
		}
		/**
		This is true when the view has been
		[destroyed](https://prosemirror.net/docs/ref/#view.EditorView.destroy) (and thus should not be
		used anymore).
		*/
		get isDestroyed() {
			return this.docView == null;
		}
		/**
		Used for testing.
		*/
		dispatchEvent(event) {
			return dispatchEvent(this, event);
		}
		/**
		@internal
		*/
		domSelectionRange() {
			let sel = this.domSelection();
			if (!sel) return {
				focusNode: null,
				focusOffset: 0,
				anchorNode: null,
				anchorOffset: 0
			};
			return safari && this.root.nodeType === 11 && deepActiveElement(this.dom.ownerDocument) == this.dom && safariShadowSelectionRange(this, sel) || sel;
		}
		/**
		@internal
		*/
		domSelection() {
			return this.root.getSelection();
		}
	};
	EditorView.prototype.dispatch = function(tr) {
		let dispatchTransaction = this._props.dispatchTransaction;
		if (dispatchTransaction) dispatchTransaction.call(this, tr);
		else this.updateState(this.state.apply(tr));
	};
	function computeDocDeco(view) {
		let attrs = Object.create(null);
		attrs.class = "ProseMirror";
		attrs.contenteditable = String(view.editable);
		view.someProp("attributes", (value) => {
			if (typeof value == "function") value = value(view.state);
			if (value) {
				for (let attr in value) if (attr == "class") attrs.class += " " + value[attr];
				else if (attr == "style") attrs.style = (attrs.style ? attrs.style + ";" : "") + value[attr];
				else if (!attrs[attr] && attr != "contenteditable" && attr != "nodeName") attrs[attr] = String(value[attr]);
			}
		});
		if (!attrs.translate) attrs.translate = "no";
		return [Decoration.node(0, view.state.doc.content.size, attrs)];
	}
	function updateCursorWrapper(view) {
		if (view.markCursor) {
			let dom = document.createElement("img");
			dom.className = "ProseMirror-separator";
			dom.setAttribute("mark-placeholder", "true");
			dom.setAttribute("alt", "");
			view.cursorWrapper = {
				dom,
				deco: Decoration.widget(view.state.selection.from, dom, {
					raw: true,
					marks: view.markCursor
				})
			};
		} else view.cursorWrapper = null;
	}
	function getEditable(view) {
		return !view.someProp("editable", (value) => value(view.state) === false);
	}
	function selectionContextChanged(sel1, sel2) {
		let depth = Math.min(sel1.$anchor.sharedDepth(sel1.head), sel2.$anchor.sharedDepth(sel2.head));
		return sel1.$anchor.start(depth) != sel2.$anchor.start(depth);
	}
	function buildNodeViews(view) {
		let result = Object.create(null);
		function add(obj) {
			for (let prop in obj) if (!Object.prototype.hasOwnProperty.call(result, prop)) result[prop] = obj[prop];
		}
		view.someProp("nodeViews", add);
		view.someProp("markViews", add);
		return result;
	}
	function changedNodeViews(a, b) {
		let nA = 0;
		let nB = 0;
		for (let prop in a) {
			if (a[prop] != b[prop]) return true;
			nA++;
		}
		for (let _ in b) nB++;
		return nA != nB;
	}
	function checkStateComponent(plugin) {
		if (plugin.spec.state || plugin.spec.filterTransaction || plugin.spec.appendTransaction) throw new RangeError("Plugins passed directly to the view must not have a state component");
	}

//#endregion
//#region node_modules/w3c-keyname/index.js
	var base = {
		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: "'"
	};
	var shift = {
		48: ")",
		49: "!",
		50: "@",
		51: "#",
		52: "$",
		53: "%",
		54: "^",
		55: "&",
		56: "*",
		57: "(",
		59: ":",
		61: "+",
		173: "_",
		186: ":",
		187: "+",
		188: "<",
		189: "_",
		190: ">",
		191: "?",
		192: "~",
		219: "{",
		220: "|",
		221: "}",
		222: "\""
	};
	var mac$1 = typeof navigator != "undefined" && /Mac/.test(navigator.platform);
	var ie = typeof navigator != "undefined" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
	for (var i = 0; i < 10; i++) base[48 + i] = base[96 + i] = String(i);
	for (var i = 1; i <= 24; i++) base[i + 111] = "F" + i;
	for (var i = 65; i <= 90; i++) {
		base[i] = String.fromCharCode(i + 32);
		shift[i] = String.fromCharCode(i);
	}
	for (var code in base) if (!shift.hasOwnProperty(code)) shift[code] = base[code];
	function keyName(event) {
		var name = !(mac$1 && event.metaKey && event.shiftKey && !event.ctrlKey && !event.altKey || ie && event.shiftKey && event.key && event.key.length == 1 || event.key == "Unidentified") && event.key || (event.shiftKey ? shift : base)[event.keyCode] || event.key || "Unidentified";
		if (name == "Esc") name = "Escape";
		if (name == "Del") name = "Delete";
		if (name == "Left") name = "ArrowLeft";
		if (name == "Up") name = "ArrowUp";
		if (name == "Right") name = "ArrowRight";
		if (name == "Down") name = "ArrowDown";
		return name;
	}

//#endregion
//#region node_modules/prosemirror-keymap/dist/index.js
	var mac = typeof navigator != "undefined" && /Mac|iP(hone|[oa]d)/.test(navigator.platform);
	var windows = typeof navigator != "undefined" && /Win/.test(navigator.platform);
	function normalizeKeyName$1(name) {
		let parts = name.split(/-(?!$)/);
		let result = parts[parts.length - 1];
		if (result == "Space") result = " ";
		let alt;
		let ctrl;
		let shift;
		let meta;
		for (let i = 0; i < parts.length - 1; i++) {
			let mod = parts[i];
			if (/^(cmd|meta|m)$/i.test(mod)) meta = true;
			else if (/^a(lt)?$/i.test(mod)) alt = true;
			else if (/^(c|ctrl|control)$/i.test(mod)) ctrl = true;
			else if (/^s(hift)?$/i.test(mod)) shift = true;
			else if (/^mod$/i.test(mod)) if (mac) meta = true;
			else ctrl = true;
			else throw new Error("Unrecognized modifier name: " + mod);
		}
		if (alt) result = "Alt-" + result;
		if (ctrl) result = "Ctrl-" + result;
		if (meta) result = "Meta-" + result;
		if (shift) result = "Shift-" + result;
		return result;
	}
	__name(normalizeKeyName$1, "normalizeKeyName");
	function normalize(map) {
		let copy = Object.create(null);
		for (let prop in map) copy[normalizeKeyName$1(prop)] = map[prop];
		return copy;
	}
	function modifiers(name, event, shift = true) {
		if (event.altKey) name = "Alt-" + name;
		if (event.ctrlKey) name = "Ctrl-" + name;
		if (event.metaKey) name = "Meta-" + name;
		if (shift && event.shiftKey) name = "Shift-" + name;
		return name;
	}
	/**
	Create a keymap plugin for the given set of bindings.
	
	Bindings should map key names to [command](https://prosemirror.net/docs/ref/#commands)-style
	functions, which will be called with `(EditorState, dispatch,
	EditorView)` arguments, and should return true when they've handled
	the key. Note that the view argument isn't part of the command
	protocol, but can be used as an escape hatch if a binding needs to
	directly interact with the UI.
	
	Key names may be strings like `"Shift-Ctrl-Enter"`—a key
	identifier prefixed with zero or more modifiers. Key identifiers
	are based on the strings that can appear in
	[`KeyEvent.key`](https:developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key).
	Use lowercase letters to refer to letter keys (or uppercase letters
	if you want shift to be held). You may use `"Space"` as an alias
	for the `" "` name.
	
	Modifiers can be given in any order. `Shift-` (or `s-`), `Alt-` (or
	`a-`), `Ctrl-` (or `c-` or `Control-`) and `Cmd-` (or `m-` or
	`Meta-`) are recognized. For characters that are created by holding
	shift, the `Shift-` prefix is implied, and should not be added
	explicitly.
	
	You can use `Mod-` as a shorthand for `Cmd-` on Mac and `Ctrl-` on
	other platforms.
	
	You can add multiple keymap plugins to an editor. The order in
	which they appear determines their precedence (the ones early in
	the array get to dispatch first).
	*/
	function keymap(bindings) {
		return new Plugin({ props: { handleKeyDown: keydownHandler(bindings) } });
	}
	/**
	Given a set of bindings (using the same format as
	[`keymap`](https://prosemirror.net/docs/ref/#keymap.keymap)), return a [keydown
	handler](https://prosemirror.net/docs/ref/#view.EditorProps.handleKeyDown) that handles them.
	*/
	function keydownHandler(bindings) {
		let map = normalize(bindings);
		return function(view, event) {
			let name = keyName(event);
			let baseName;
			let direct = map[modifiers(name, event)];
			if (direct && direct(view.state, view.dispatch, view)) return true;
			if (name.length == 1 && name != " ") {
				if (event.shiftKey) {
					let noShift = map[modifiers(name, event, false)];
					if (noShift && noShift(view.state, view.dispatch, view)) return true;
				}
				if ((event.altKey || event.metaKey || event.ctrlKey) && !(windows && event.ctrlKey && event.altKey) && (baseName = base[event.keyCode]) && baseName != name) {
					let fromCode = map[modifiers(baseName, event)];
					if (fromCode && fromCode(view.state, view.dispatch, view)) return true;
				}
			}
			return false;
		};
	}

//#endregion
//#region node_modules/@tiptap/core/dist/index.js
	var __defProp = Object.defineProperty;
	var __export = (target, all) => {
		for (var name in all) __defProp(target, name, {
			get: all[name],
			enumerable: true
		});
	};
	function createChainableState(config) {
		const { state, transaction } = config;
		let { selection } = transaction;
		let { doc } = transaction;
		let { storedMarks } = transaction;
		return {
			...state,
			apply: state.apply.bind(state),
			applyTransaction: state.applyTransaction.bind(state),
			plugins: state.plugins,
			schema: state.schema,
			reconfigure: state.reconfigure.bind(state),
			toJSON: state.toJSON.bind(state),
			get storedMarks() {
				return storedMarks;
			},
			get selection() {
				return selection;
			},
			get doc() {
				return doc;
			},
			get tr() {
				selection = transaction.selection;
				doc = transaction.doc;
				storedMarks = transaction.storedMarks;
				return transaction;
			}
		};
	}
	var CommandManager = class {
		constructor(props) {
			this.editor = props.editor;
			this.rawCommands = this.editor.extensionManager.commands;
			this.customState = props.state;
		}
		get hasCustomState() {
			return !!this.customState;
		}
		get state() {
			return this.customState || this.editor.state;
		}
		get commands() {
			const { rawCommands, editor, state } = this;
			const { view } = editor;
			const { tr } = state;
			const props = this.buildProps(tr);
			return Object.fromEntries(Object.entries(rawCommands).map(([name, command2]) => {
				const method = (...args) => {
					const callback = command2(...args)(props);
					if (!tr.getMeta("preventDispatch") && !this.hasCustomState) view.dispatch(tr);
					return callback;
				};
				return [name, method];
			}));
		}
		get chain() {
			return () => this.createChain();
		}
		get can() {
			return () => this.createCan();
		}
		createChain(startTr, shouldDispatch = true) {
			const { rawCommands, editor, state } = this;
			const { view } = editor;
			const callbacks = [];
			const hasStartTransaction = !!startTr;
			const tr = startTr || state.tr;
			const run3 = () => {
				if (!hasStartTransaction && shouldDispatch && !tr.getMeta("preventDispatch") && !this.hasCustomState) view.dispatch(tr);
				return callbacks.every((callback) => callback === true);
			};
			const chain = {
				...Object.fromEntries(Object.entries(rawCommands).map(([name, command2]) => {
					const chainedCommand = (...args) => {
						const props = this.buildProps(tr, shouldDispatch);
						const callback = command2(...args)(props);
						callbacks.push(callback);
						return chain;
					};
					return [name, chainedCommand];
				})),
				run: run3
			};
			return chain;
		}
		createCan(startTr) {
			const { rawCommands, state } = this;
			const dispatch = false;
			const tr = startTr || state.tr;
			const props = this.buildProps(tr, dispatch);
			return {
				...Object.fromEntries(Object.entries(rawCommands).map(([name, command2]) => {
					return [name, (...args) => command2(...args)({
						...props,
						dispatch: void 0
					})];
				})),
				chain: () => this.createChain(tr, dispatch)
			};
		}
		buildProps(tr, shouldDispatch = true) {
			const { rawCommands, editor, state } = this;
			const { view } = editor;
			const props = {
				tr,
				editor,
				view,
				state: createChainableState({
					state,
					transaction: tr
				}),
				dispatch: shouldDispatch ? () => void 0 : void 0,
				chain: () => this.createChain(tr, shouldDispatch),
				can: () => this.createCan(tr),
				get commands() {
					return Object.fromEntries(Object.entries(rawCommands).map(([name, command2]) => {
						return [name, (...args) => command2(...args)(props)];
					}));
				}
			};
			return props;
		}
	};
	var commands_exports = {};
	__export(commands_exports, {
		blur: () => blur,
		clearContent: () => clearContent,
		clearNodes: () => clearNodes,
		command: () => command,
		createParagraphNear: () => createParagraphNear,
		cut: () => cut,
		deleteCurrentNode: () => deleteCurrentNode,
		deleteNode: () => deleteNode,
		deleteRange: () => deleteRange,
		deleteSelection: () => deleteSelection,
		enter: () => enter,
		exitCode: () => exitCode,
		extendMarkRange: () => extendMarkRange,
		first: () => first,
		focus: () => focus,
		forEach: () => forEach,
		insertContent: () => insertContent,
		insertContentAt: () => insertContentAt,
		joinBackward: () => joinBackward,
		joinDown: () => joinDown,
		joinForward: () => joinForward,
		joinItemBackward: () => joinItemBackward,
		joinItemForward: () => joinItemForward,
		joinTextblockBackward: () => joinTextblockBackward,
		joinTextblockForward: () => joinTextblockForward,
		joinUp: () => joinUp,
		keyboardShortcut: () => keyboardShortcut,
		lift: () => lift,
		liftEmptyBlock: () => liftEmptyBlock,
		liftListItem: () => liftListItem,
		newlineInCode: () => newlineInCode,
		resetAttributes: () => resetAttributes,
		scrollIntoView: () => scrollIntoView,
		selectAll: () => selectAll,
		selectNodeBackward: () => selectNodeBackward,
		selectNodeForward: () => selectNodeForward,
		selectParentNode: () => selectParentNode,
		selectTextblockEnd: () => selectTextblockEnd,
		selectTextblockStart: () => selectTextblockStart,
		setContent: () => setContent,
		setMark: () => setMark,
		setMeta: () => setMeta,
		setNode: () => setNode,
		setNodeSelection: () => setNodeSelection,
		setTextDirection: () => setTextDirection,
		setTextSelection: () => setTextSelection,
		sinkListItem: () => sinkListItem,
		splitBlock: () => splitBlock,
		splitListItem: () => splitListItem,
		toggleList: () => toggleList,
		toggleMark: () => toggleMark,
		toggleNode: () => toggleNode,
		toggleWrap: () => toggleWrap,
		undoInputRule: () => undoInputRule,
		unsetAllMarks: () => unsetAllMarks,
		unsetMark: () => unsetMark,
		unsetTextDirection: () => unsetTextDirection,
		updateAttributes: () => updateAttributes,
		wrapIn: () => wrapIn,
		wrapInList: () => wrapInList
	});
	var blur = () => ({ editor, view }) => {
		requestAnimationFrame(() => {
			var _a;
			if (!editor.isDestroyed) {
				view.dom.blur();
				(_a = window == null ? void 0 : window.getSelection()) == null || _a.removeAllRanges();
			}
		});
		return true;
	};
	var clearContent = (emitUpdate = true) => ({ commands }) => {
		return commands.setContent("", { emitUpdate });
	};
	var clearNodes = () => ({ state, tr, dispatch }) => {
		const { selection } = tr;
		const { ranges } = selection;
		if (!dispatch) return true;
		ranges.forEach(({ $from, $to }) => {
			state.doc.nodesBetween($from.pos, $to.pos, (node, pos) => {
				if (node.type.isText) return;
				const { doc, mapping } = tr;
				const $mappedFrom = doc.resolve(mapping.map(pos));
				const $mappedTo = doc.resolve(mapping.map(pos + node.nodeSize));
				const nodeRange = $mappedFrom.blockRange($mappedTo);
				if (!nodeRange) return;
				const targetLiftDepth = liftTarget(nodeRange);
				if (node.type.isTextblock) {
					const { defaultType } = $mappedFrom.parent.contentMatchAt($mappedFrom.index());
					tr.setNodeMarkup(nodeRange.start, defaultType);
				}
				if (targetLiftDepth || targetLiftDepth === 0) tr.lift(nodeRange, targetLiftDepth);
			});
		});
		return true;
	};
	var command = (fn) => (props) => {
		return fn(props);
	};
	var createParagraphNear = () => ({ state, dispatch }) => {
		return createParagraphNear$1(state, dispatch);
	};
	var cut = (originRange, targetPos) => ({ editor, tr }) => {
		const { state } = editor;
		const contentSlice = state.doc.slice(originRange.from, originRange.to);
		tr.deleteRange(originRange.from, originRange.to);
		const newPos = tr.mapping.map(targetPos);
		tr.insert(newPos, contentSlice.content);
		tr.setSelection(new TextSelection(tr.doc.resolve(Math.max(newPos - 1, 0))));
		return true;
	};
	var deleteCurrentNode = () => ({ tr, dispatch }) => {
		const { selection } = tr;
		const currentNode = selection.$anchor.node();
		if (currentNode.content.size > 0) return false;
		const $pos = tr.selection.$anchor;
		for (let depth = $pos.depth; depth > 0; depth -= 1) if ($pos.node(depth).type === currentNode.type) {
			if (dispatch) {
				const from = $pos.before(depth);
				const to = $pos.after(depth);
				tr.delete(from, to).scrollIntoView();
			}
			return true;
		}
		return false;
	};
	function getNodeType(nameOrType, schema) {
		if (typeof nameOrType === "string") {
			if (!schema.nodes[nameOrType]) throw Error(`There is no node type named '${nameOrType}'. Maybe you forgot to add the extension?`);
			return schema.nodes[nameOrType];
		}
		return nameOrType;
	}
	var deleteNode = (typeOrName) => ({ tr, state, dispatch }) => {
		const type = getNodeType(typeOrName, state.schema);
		const $pos = tr.selection.$anchor;
		for (let depth = $pos.depth; depth > 0; depth -= 1) if ($pos.node(depth).type === type) {
			if (dispatch) {
				const from = $pos.before(depth);
				const to = $pos.after(depth);
				tr.delete(from, to).scrollIntoView();
			}
			return true;
		}
		return false;
	};
	var deleteRange = (range) => ({ tr, dispatch }) => {
		const { from, to } = range;
		if (dispatch) tr.delete(from, to);
		return true;
	};
	var deleteSelection = () => ({ state, dispatch }) => {
		return deleteSelection$1(state, dispatch);
	};
	var enter = () => ({ commands }) => {
		return commands.keyboardShortcut("Enter");
	};
	var exitCode = () => ({ state, dispatch }) => {
		return exitCode$1(state, dispatch);
	};
	function isRegExp(value) {
		return Object.prototype.toString.call(value) === "[object RegExp]";
	}
	function objectIncludes(object1, object2, options = { strict: true }) {
		const keys = Object.keys(object2);
		if (!keys.length) return true;
		return keys.every((key) => {
			if (options.strict) return object2[key] === object1[key];
			if (isRegExp(object2[key])) return object2[key].test(object1[key]);
			return object2[key] === object1[key];
		});
	}
	function findMarkInSet(marks, type, attributes = {}) {
		return marks.find((item) => {
			return item.type === type && objectIncludes(Object.fromEntries(Object.keys(attributes).map((k) => [k, item.attrs[k]])), attributes);
		});
	}
	function isMarkInSet(marks, type, attributes = {}) {
		return !!findMarkInSet(marks, type, attributes);
	}
	function getMarkRange($pos, type, attributes) {
		var _a;
		if (!$pos || !type) return;
		let start = $pos.parent.childAfter($pos.parentOffset);
		if (!start.node || !start.node.marks.some((mark2) => mark2.type === type)) start = $pos.parent.childBefore($pos.parentOffset);
		if (!start.node || !start.node.marks.some((mark2) => mark2.type === type)) return;
		attributes = attributes || ((_a = start.node.marks[0]) == null ? void 0 : _a.attrs);
		if (!findMarkInSet([...start.node.marks], type, attributes)) return;
		let startIndex = start.index;
		let startPos = $pos.start() + start.offset;
		let endIndex = startIndex + 1;
		let endPos = startPos + start.node.nodeSize;
		while (startIndex > 0 && isMarkInSet([...$pos.parent.child(startIndex - 1).marks], type, attributes)) {
			startIndex -= 1;
			startPos -= $pos.parent.child(startIndex).nodeSize;
		}
		while (endIndex < $pos.parent.childCount && isMarkInSet([...$pos.parent.child(endIndex).marks], type, attributes)) {
			endPos += $pos.parent.child(endIndex).nodeSize;
			endIndex += 1;
		}
		return {
			from: startPos,
			to: endPos
		};
	}
	function getMarkType(nameOrType, schema) {
		if (typeof nameOrType === "string") {
			if (!schema.marks[nameOrType]) throw Error(`There is no mark type named '${nameOrType}'. Maybe you forgot to add the extension?`);
			return schema.marks[nameOrType];
		}
		return nameOrType;
	}
	var extendMarkRange = (typeOrName, attributes = {}) => ({ tr, state, dispatch }) => {
		const type = getMarkType(typeOrName, state.schema);
		const { doc, selection } = tr;
		const { $from, from, to } = selection;
		if (dispatch) {
			const range = getMarkRange($from, type, attributes);
			if (range && range.from <= from && range.to >= to) {
				const newSelection = TextSelection.create(doc, range.from, range.to);
				tr.setSelection(newSelection);
			}
		}
		return true;
	};
	var first = (commands) => (props) => {
		const items = typeof commands === "function" ? commands(props) : commands;
		for (let i = 0; i < items.length; i += 1) if (items[i](props)) return true;
		return false;
	};
	function isTextSelection(value) {
		return value instanceof TextSelection;
	}
	function minMax(value = 0, min = 0, max = 0) {
		return Math.min(Math.max(value, min), max);
	}
	function resolveFocusPosition(doc, position = null) {
		if (!position) return null;
		const selectionAtStart = Selection.atStart(doc);
		const selectionAtEnd = Selection.atEnd(doc);
		if (position === "start" || position === true) return selectionAtStart;
		if (position === "end") return selectionAtEnd;
		const minPos = selectionAtStart.from;
		const maxPos = selectionAtEnd.to;
		if (position === "all") return TextSelection.create(doc, minMax(0, minPos, maxPos), minMax(doc.content.size, minPos, maxPos));
		return TextSelection.create(doc, minMax(position, minPos, maxPos), minMax(position, minPos, maxPos));
	}
	function isAndroid() {
		return navigator.platform === "Android" || /android/i.test(navigator.userAgent);
	}
	function isiOS() {
		return [
			"iPad Simulator",
			"iPhone Simulator",
			"iPod Simulator",
			"iPad",
			"iPhone",
			"iPod"
		].includes(navigator.platform) || navigator.userAgent.includes("Mac") && "ontouchend" in document;
	}
	function isSafari() {
		return typeof navigator !== "undefined" ? /^((?!chrome|android).)*safari/i.test(navigator.userAgent) : false;
	}
	var focus = (position = null, options = {}) => ({ editor, view, tr, dispatch }) => {
		options = {
			scrollIntoView: true,
			...options
		};
		const delayedFocus = () => {
			if (isiOS() || isAndroid()) view.dom.focus();
			if (isSafari() && !isiOS() && !isAndroid()) view.dom.focus({ preventScroll: true });
			requestAnimationFrame(() => {
				if (!editor.isDestroyed) {
					view.focus();
					if (options == null ? void 0 : options.scrollIntoView) editor.commands.scrollIntoView();
				}
			});
		};
		try {
			if (view.hasFocus() && position === null || position === false) return true;
		} catch {
			return false;
		}
		if (dispatch && position === null && !isTextSelection(editor.state.selection)) {
			delayedFocus();
			return true;
		}
		const selection = resolveFocusPosition(tr.doc, position) || editor.state.selection;
		const isSameSelection = editor.state.selection.eq(selection);
		if (dispatch) {
			if (!isSameSelection) tr.setSelection(selection);
			if (isSameSelection && tr.storedMarks) tr.setStoredMarks(tr.storedMarks);
			delayedFocus();
		}
		return true;
	};
	var forEach = (items, fn) => (props) => {
		return items.every((item, index) => fn(item, {
			...props,
			index
		}));
	};
	var insertContent = (value, options) => ({ tr, commands }) => {
		return commands.insertContentAt({
			from: tr.selection.from,
			to: tr.selection.to
		}, value, options);
	};
	var removeWhitespaces = (node) => {
		const children = node.childNodes;
		for (let i = children.length - 1; i >= 0; i -= 1) {
			const child = children[i];
			if (child.nodeType === 3 && child.nodeValue && /^(\n\s\s|\n)$/.test(child.nodeValue)) node.removeChild(child);
			else if (child.nodeType === 1) removeWhitespaces(child);
		}
		return node;
	};
	function elementFromString(value) {
		if (typeof window === "undefined") throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");
		const wrappedValue = `<body>${value}</body>`;
		const html = new window.DOMParser().parseFromString(wrappedValue, "text/html").body;
		return removeWhitespaces(html);
	}
	function createNodeFromContent(content, schema, options) {
		if (content instanceof Node || content instanceof Fragment$1) return content;
		options = {
			slice: true,
			parseOptions: {},
			...options
		};
		const isJSONContent = typeof content === "object" && content !== null;
		const isTextContent = typeof content === "string";
		if (isJSONContent) try {
			if (Array.isArray(content) && content.length > 0) return Fragment$1.fromArray(content.map((item) => schema.nodeFromJSON(item)));
			const node = schema.nodeFromJSON(content);
			if (options.errorOnInvalidContent) node.check();
			return node;
		} catch (error) {
			if (options.errorOnInvalidContent) throw new Error("[tiptap error]: Invalid JSON content", { cause: error });
			console.warn("[tiptap warn]: Invalid content.", "Passed value:", content, "Error:", error);
			return createNodeFromContent("", schema, options);
		}
		if (isTextContent) {
			if (options.errorOnInvalidContent) {
				let hasInvalidContent = false;
				let invalidContent = "";
				const contentCheckSchema = new Schema({
					topNode: schema.spec.topNode,
					marks: schema.spec.marks,
					nodes: schema.spec.nodes.append({ __tiptap__private__unknown__catch__all__node: {
						content: "inline*",
						group: "block",
						parseDOM: [{
							tag: "*",
							getAttrs: (e) => {
								hasInvalidContent = true;
								invalidContent = typeof e === "string" ? e : e.outerHTML;
								return null;
							}
						}]
					} })
				});
				if (options.slice) DOMParser$1.fromSchema(contentCheckSchema).parseSlice(elementFromString(content), options.parseOptions);
				else DOMParser$1.fromSchema(contentCheckSchema).parse(elementFromString(content), options.parseOptions);
				if (options.errorOnInvalidContent && hasInvalidContent) throw new Error("[tiptap error]: Invalid HTML content", { cause: /* @__PURE__ */ new Error(`Invalid element found: ${invalidContent}`) });
			}
			const parser = DOMParser$1.fromSchema(schema);
			if (options.slice) return parser.parseSlice(elementFromString(content), options.parseOptions).content;
			return parser.parse(elementFromString(content), options.parseOptions);
		}
		return createNodeFromContent("", schema, options);
	}
	function selectionToInsertionEnd(tr, startLen, bias) {
		const last = tr.steps.length - 1;
		if (last < startLen) return;
		const step = tr.steps[last];
		if (!(step instanceof ReplaceStep || step instanceof ReplaceAroundStep)) return;
		const map = tr.mapping.maps[last];
		let end = 0;
		map.forEach((_from, _to, _newFrom, newTo) => {
			if (end === 0) end = newTo;
		});
		tr.setSelection(Selection.near(tr.doc.resolve(end), bias));
	}
	var isFragment = (nodeOrFragment) => {
		return !("type" in nodeOrFragment);
	};
	var insertContentAt = (position, value, options) => ({ tr, dispatch, editor }) => {
		var _a;
		if (dispatch) {
			options = {
				parseOptions: editor.options.parseOptions,
				updateSelection: true,
				applyInputRules: false,
				applyPasteRules: false,
				...options
			};
			let content;
			const emitContentError = (error) => {
				editor.emit("contentError", {
					editor,
					error,
					disableCollaboration: () => {
						if ("collaboration" in editor.storage && typeof editor.storage.collaboration === "object" && editor.storage.collaboration) editor.storage.collaboration.isDisabled = true;
					}
				});
			};
			const parseOptions = {
				preserveWhitespace: "full",
				...options.parseOptions
			};
			if (!options.errorOnInvalidContent && !editor.options.enableContentCheck && editor.options.emitContentError) try {
				createNodeFromContent(value, editor.schema, {
					parseOptions,
					errorOnInvalidContent: true
				});
			} catch (e) {
				emitContentError(e);
			}
			try {
				content = createNodeFromContent(value, editor.schema, {
					parseOptions,
					errorOnInvalidContent: (_a = options.errorOnInvalidContent) != null ? _a : editor.options.enableContentCheck
				});
			} catch (e) {
				emitContentError(e);
				return false;
			}
			let { from, to } = typeof position === "number" ? {
				from: position,
				to: position
			} : {
				from: position.from,
				to: position.to
			};
			let isOnlyTextContent = true;
			let isOnlyBlockContent = true;
			(isFragment(content) ? content : [content]).forEach((node) => {
				node.check();
				isOnlyTextContent = isOnlyTextContent ? node.isText && node.marks.length === 0 : false;
				isOnlyBlockContent = isOnlyBlockContent ? node.isBlock : false;
			});
			if (from === to && isOnlyBlockContent) {
				const { parent } = tr.doc.resolve(from);
				if (parent.isTextblock && !parent.type.spec.code && !parent.childCount) {
					from -= 1;
					to += 1;
				}
			}
			let newContent;
			if (isOnlyTextContent) {
				if (Array.isArray(value)) newContent = value.map((v) => v.text || "").join("");
				else if (value instanceof Fragment$1) {
					let text = "";
					value.forEach((node) => {
						if (node.text) text += node.text;
					});
					newContent = text;
				} else if (typeof value === "object" && !!value && !!value.text) newContent = value.text;
				else newContent = value;
				tr.insertText(newContent, from, to);
			} else {
				newContent = content;
				const $from = tr.doc.resolve(from);
				const $fromNode = $from.node();
				const fromSelectionAtStart = $from.parentOffset === 0;
				const isTextSelection2 = $fromNode.isText || $fromNode.isTextblock;
				const hasContent = $fromNode.content.size > 0;
				if (fromSelectionAtStart && isTextSelection2 && hasContent) from = Math.max(0, from - 1);
				tr.replaceWith(from, to, newContent);
			}
			if (options.updateSelection) selectionToInsertionEnd(tr, tr.steps.length - 1, -1);
			if (options.applyInputRules) tr.setMeta("applyInputRules", {
				from,
				text: newContent
			});
			if (options.applyPasteRules) tr.setMeta("applyPasteRules", {
				from,
				text: newContent
			});
		}
		return true;
	};
	var joinUp = () => ({ state, dispatch }) => {
		return joinUp$1(state, dispatch);
	};
	var joinDown = () => ({ state, dispatch }) => {
		return joinDown$1(state, dispatch);
	};
	var joinBackward = () => ({ state, dispatch }) => {
		return joinBackward$1(state, dispatch);
	};
	var joinForward = () => ({ state, dispatch }) => {
		return joinForward$1(state, dispatch);
	};
	var joinItemBackward = () => ({ state, dispatch, tr }) => {
		try {
			const point = joinPoint(state.doc, state.selection.$from.pos, -1);
			if (point === null || point === void 0) return false;
			tr.join(point, 2);
			if (dispatch) dispatch(tr);
			return true;
		} catch {
			return false;
		}
	};
	var joinItemForward = () => ({ state, dispatch, tr }) => {
		try {
			const point = joinPoint(state.doc, state.selection.$from.pos, 1);
			if (point === null || point === void 0) return false;
			tr.join(point, 2);
			if (dispatch) dispatch(tr);
			return true;
		} catch {
			return false;
		}
	};
	var joinTextblockBackward = () => ({ state, dispatch }) => {
		return joinTextblockBackward$1(state, dispatch);
	};
	var joinTextblockForward = () => ({ state, dispatch }) => {
		return joinTextblockForward$1(state, dispatch);
	};
	function isMacOS() {
		return typeof navigator !== "undefined" ? /Mac/.test(navigator.platform) : false;
	}
	function normalizeKeyName(name) {
		const parts = name.split(/-(?!$)/);
		let result = parts[parts.length - 1];
		if (result === "Space") result = " ";
		let alt;
		let ctrl;
		let shift;
		let meta;
		for (let i = 0; i < parts.length - 1; i += 1) {
			const mod = parts[i];
			if (/^(cmd|meta|m)$/i.test(mod)) meta = true;
			else if (/^a(lt)?$/i.test(mod)) alt = true;
			else if (/^(c|ctrl|control)$/i.test(mod)) ctrl = true;
			else if (/^s(hift)?$/i.test(mod)) shift = true;
			else if (/^mod$/i.test(mod)) if (isiOS() || isMacOS()) meta = true;
			else ctrl = true;
			else throw new Error(`Unrecognized modifier name: ${mod}`);
		}
		if (alt) result = `Alt-${result}`;
		if (ctrl) result = `Ctrl-${result}`;
		if (meta) result = `Meta-${result}`;
		if (shift) result = `Shift-${result}`;
		return result;
	}
	var keyboardShortcut = (name) => ({ editor, view, tr, dispatch }) => {
		const keys = normalizeKeyName(name).split(/-(?!$)/);
		const key = keys.find((item) => ![
			"Alt",
			"Ctrl",
			"Meta",
			"Shift"
		].includes(item));
		const event = new KeyboardEvent("keydown", {
			key: key === "Space" ? " " : key,
			altKey: keys.includes("Alt"),
			ctrlKey: keys.includes("Ctrl"),
			metaKey: keys.includes("Meta"),
			shiftKey: keys.includes("Shift"),
			bubbles: true,
			cancelable: true
		});
		editor.captureTransaction(() => {
			view.someProp("handleKeyDown", (f) => f(view, event));
		})?.steps.forEach((step) => {
			const newStep = step.map(tr.mapping);
			if (newStep && dispatch) tr.maybeStep(newStep);
		});
		return true;
	};
	function isNodeActive(state, typeOrName, attributes = {}) {
		const { from, to, empty } = state.selection;
		const type = typeOrName ? getNodeType(typeOrName, state.schema) : null;
		const nodeRanges = [];
		state.doc.nodesBetween(from, to, (node, pos) => {
			if (node.isText) return;
			const relativeFrom = Math.max(from, pos);
			const relativeTo = Math.min(to, pos + node.nodeSize);
			nodeRanges.push({
				node,
				from: relativeFrom,
				to: relativeTo
			});
		});
		const selectionRange = to - from;
		const matchedNodeRanges = nodeRanges.filter((nodeRange) => {
			if (!type) return true;
			return type.name === nodeRange.node.type.name;
		}).filter((nodeRange) => objectIncludes(nodeRange.node.attrs, attributes, { strict: false }));
		if (empty) return !!matchedNodeRanges.length;
		return matchedNodeRanges.reduce((sum, nodeRange) => sum + nodeRange.to - nodeRange.from, 0) >= selectionRange;
	}
	var lift = (typeOrName, attributes = {}) => ({ state, dispatch }) => {
		if (!isNodeActive(state, getNodeType(typeOrName, state.schema), attributes)) return false;
		return lift$1(state, dispatch);
	};
	var liftEmptyBlock = () => ({ state, dispatch }) => {
		return liftEmptyBlock$1(state, dispatch);
	};
	var liftListItem = (typeOrName) => ({ state, dispatch }) => {
		return liftListItem$1(getNodeType(typeOrName, state.schema))(state, dispatch);
	};
	var newlineInCode = () => ({ state, dispatch }) => {
		return newlineInCode$1(state, dispatch);
	};
	function getSchemaTypeNameByName(name, schema) {
		if (schema.nodes[name]) return "node";
		if (schema.marks[name]) return "mark";
		return null;
	}
	function deleteProps(obj, propOrProps) {
		const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
		return Object.keys(obj).reduce((newObj, prop) => {
			if (!props.includes(prop)) newObj[prop] = obj[prop];
			return newObj;
		}, {});
	}
	var resetAttributes = (typeOrName, attributes) => ({ tr, state, dispatch }) => {
		let nodeType = null;
		let markType = null;
		const schemaType = getSchemaTypeNameByName(typeof typeOrName === "string" ? typeOrName : typeOrName.name, state.schema);
		if (!schemaType) return false;
		if (schemaType === "node") nodeType = getNodeType(typeOrName, state.schema);
		if (schemaType === "mark") markType = getMarkType(typeOrName, state.schema);
		let canReset = false;
		tr.selection.ranges.forEach((range) => {
			state.doc.nodesBetween(range.$from.pos, range.$to.pos, (node, pos) => {
				if (nodeType && nodeType === node.type) {
					canReset = true;
					if (dispatch) tr.setNodeMarkup(pos, void 0, deleteProps(node.attrs, attributes));
				}
				if (markType && node.marks.length) node.marks.forEach((mark) => {
					if (markType === mark.type) {
						canReset = true;
						if (dispatch) tr.addMark(pos, pos + node.nodeSize, markType.create(deleteProps(mark.attrs, attributes)));
					}
				});
			});
		});
		return canReset;
	};
	var scrollIntoView = () => ({ tr, dispatch }) => {
		if (dispatch) tr.scrollIntoView();
		return true;
	};
	var selectAll = () => ({ tr, dispatch }) => {
		if (dispatch) {
			const selection = new AllSelection(tr.doc);
			tr.setSelection(selection);
		}
		return true;
	};
	var selectNodeBackward = () => ({ state, dispatch }) => {
		return selectNodeBackward$1(state, dispatch);
	};
	var selectNodeForward = () => ({ state, dispatch }) => {
		return selectNodeForward$1(state, dispatch);
	};
	var selectParentNode = () => ({ state, dispatch }) => {
		return selectParentNode$1(state, dispatch);
	};
	var selectTextblockEnd = () => ({ state, dispatch }) => {
		return selectTextblockEnd$1(state, dispatch);
	};
	var selectTextblockStart = () => ({ state, dispatch }) => {
		return selectTextblockStart$1(state, dispatch);
	};
	function createDocument(content, schema, parseOptions = {}, options = {}) {
		return createNodeFromContent(content, schema, {
			slice: false,
			parseOptions,
			errorOnInvalidContent: options.errorOnInvalidContent
		});
	}
	var setContent = (content, { errorOnInvalidContent, emitUpdate = true, parseOptions = {} } = {}) => ({ editor, tr, dispatch, commands }) => {
		const { doc } = tr;
		if (parseOptions.preserveWhitespace !== "full") {
			const document2 = createDocument(content, editor.schema, parseOptions, { errorOnInvalidContent: errorOnInvalidContent != null ? errorOnInvalidContent : editor.options.enableContentCheck });
			if (dispatch) tr.replaceWith(0, doc.content.size, document2).setMeta("preventUpdate", !emitUpdate);
			return true;
		}
		if (dispatch) tr.setMeta("preventUpdate", !emitUpdate);
		return commands.insertContentAt({
			from: 0,
			to: doc.content.size
		}, content, {
			parseOptions,
			errorOnInvalidContent: errorOnInvalidContent != null ? errorOnInvalidContent : editor.options.enableContentCheck
		});
	};
	function getMarkAttributes(state, typeOrName) {
		const type = getMarkType(typeOrName, state.schema);
		const { from, to, empty } = state.selection;
		const marks = [];
		if (empty) {
			if (state.storedMarks) marks.push(...state.storedMarks);
			marks.push(...state.selection.$head.marks());
		} else state.doc.nodesBetween(from, to, (node) => {
			marks.push(...node.marks);
		});
		const mark = marks.find((markItem) => markItem.type.name === type.name);
		if (!mark) return {};
		return { ...mark.attrs };
	}
	function combineTransactionSteps(oldDoc, transactions) {
		const transform = new Transform(oldDoc);
		transactions.forEach((transaction) => {
			transaction.steps.forEach((step) => {
				transform.step(step);
			});
		});
		return transform;
	}
	function defaultBlockAt(match) {
		for (let i = 0; i < match.edgeCount; i += 1) {
			const { type } = match.edge(i);
			if (type.isTextblock && !type.hasRequiredAttrs()) return type;
		}
		return null;
	}
	function findChildrenInRange(node, range, predicate) {
		const nodesWithPos = [];
		node.nodesBetween(range.from, range.to, (child, pos) => {
			if (predicate(child)) nodesWithPos.push({
				node: child,
				pos
			});
		});
		return nodesWithPos;
	}
	function findParentNodeClosestToPos($pos, predicate) {
		for (let i = $pos.depth; i > 0; i -= 1) {
			const node = $pos.node(i);
			if (predicate(node)) return {
				pos: i > 0 ? $pos.before(i) : 0,
				start: $pos.start(i),
				depth: i,
				node
			};
		}
	}
	function findParentNode(predicate) {
		return (selection) => findParentNodeClosestToPos(selection.$from, predicate);
	}
	function getExtensionField(extension, field, context) {
		if (extension.config[field] === void 0 && extension.parent) return getExtensionField(extension.parent, field, context);
		if (typeof extension.config[field] === "function") return extension.config[field].bind({
			...context,
			parent: extension.parent ? getExtensionField(extension.parent, field, context) : null
		});
		return extension.config[field];
	}
	function flattenExtensions(extensions) {
		return extensions.map((extension) => {
			const addExtensions = getExtensionField(extension, "addExtensions", {
				name: extension.name,
				options: extension.options,
				storage: extension.storage
			});
			if (addExtensions) return [extension, ...flattenExtensions(addExtensions())];
			return extension;
		}).flat(10);
	}
	function getHTMLFromFragment(fragment, schema) {
		const documentFragment = DOMSerializer.fromSchema(schema).serializeFragment(fragment);
		const container = document.implementation.createHTMLDocument().createElement("div");
		container.appendChild(documentFragment);
		return container.innerHTML;
	}
	function isFunction(value) {
		return typeof value === "function";
	}
	function callOrReturn(value, context = void 0, ...props) {
		if (isFunction(value)) {
			if (context) return value.bind(context)(...props);
			return value(...props);
		}
		return value;
	}
	function isEmptyObject(value = {}) {
		return Object.keys(value).length === 0 && value.constructor === Object;
	}
	function splitExtensions(extensions) {
		return {
			baseExtensions: extensions.filter((extension) => extension.type === "extension"),
			nodeExtensions: extensions.filter((extension) => extension.type === "node"),
			markExtensions: extensions.filter((extension) => extension.type === "mark")
		};
	}
	function getAttributesFromExtensions(extensions) {
		const extensionAttributes = [];
		const { nodeExtensions, markExtensions } = splitExtensions(extensions);
		const nodeAndMarkExtensions = [...nodeExtensions, ...markExtensions];
		const defaultAttribute = {
			default: null,
			validate: void 0,
			rendered: true,
			renderHTML: null,
			parseHTML: null,
			keepOnSplit: true,
			isRequired: false
		};
		const nodeExtensionTypes = nodeExtensions.filter((ext) => ext.name !== "text").map((ext) => ext.name);
		const markExtensionTypes = markExtensions.map((ext) => ext.name);
		const allExtensionTypes = [...nodeExtensionTypes, ...markExtensionTypes];
		extensions.forEach((extension) => {
			const addGlobalAttributes = getExtensionField(extension, "addGlobalAttributes", {
				name: extension.name,
				options: extension.options,
				storage: extension.storage,
				extensions: nodeAndMarkExtensions
			});
			if (!addGlobalAttributes) return;
			addGlobalAttributes().forEach((globalAttribute) => {
				let resolvedTypes;
				if (Array.isArray(globalAttribute.types)) resolvedTypes = globalAttribute.types;
				else if (globalAttribute.types === "*") resolvedTypes = allExtensionTypes;
				else if (globalAttribute.types === "nodes") resolvedTypes = nodeExtensionTypes;
				else if (globalAttribute.types === "marks") resolvedTypes = markExtensionTypes;
				else resolvedTypes = [];
				resolvedTypes.forEach((type) => {
					Object.entries(globalAttribute.attributes).forEach(([name, attribute]) => {
						extensionAttributes.push({
							type,
							name,
							attribute: {
								...defaultAttribute,
								...attribute
							}
						});
					});
				});
			});
		});
		nodeAndMarkExtensions.forEach((extension) => {
			const addAttributes = getExtensionField(extension, "addAttributes", {
				name: extension.name,
				options: extension.options,
				storage: extension.storage
			});
			if (!addAttributes) return;
			const attributes = addAttributes();
			Object.entries(attributes).forEach(([name, attribute]) => {
				const mergedAttr = {
					...defaultAttribute,
					...attribute
				};
				if (typeof (mergedAttr == null ? void 0 : mergedAttr.default) === "function") mergedAttr.default = mergedAttr.default();
				if ((mergedAttr == null ? void 0 : mergedAttr.isRequired) && (mergedAttr == null ? void 0 : mergedAttr.default) === void 0) delete mergedAttr.default;
				extensionAttributes.push({
					type: extension.name,
					name,
					attribute: mergedAttr
				});
			});
		});
		return extensionAttributes;
	}
	function mergeAttributes(...objects) {
		return objects.filter((item) => !!item).reduce((items, item) => {
			const mergedAttributes = { ...items };
			Object.entries(item).forEach(([key, value]) => {
				if (!mergedAttributes[key]) {
					mergedAttributes[key] = value;
					return;
				}
				if (key === "class") {
					const valueClasses = value ? String(value).split(" ") : [];
					const existingClasses = mergedAttributes[key] ? mergedAttributes[key].split(" ") : [];
					const insertClasses = valueClasses.filter((valueClass) => !existingClasses.includes(valueClass));
					mergedAttributes[key] = [...existingClasses, ...insertClasses].join(" ");
				} else if (key === "style") {
					const newStyles = value ? value.split(";").map((style2) => style2.trim()).filter(Boolean) : [];
					const existingStyles = mergedAttributes[key] ? mergedAttributes[key].split(";").map((style2) => style2.trim()).filter(Boolean) : [];
					const styleMap = /* @__PURE__ */ new Map();
					existingStyles.forEach((style2) => {
						const [property, val] = style2.split(":").map((part) => part.trim());
						styleMap.set(property, val);
					});
					newStyles.forEach((style2) => {
						const [property, val] = style2.split(":").map((part) => part.trim());
						styleMap.set(property, val);
					});
					mergedAttributes[key] = Array.from(styleMap.entries()).map(([property, val]) => `${property}: ${val}`).join("; ");
				} else mergedAttributes[key] = value;
			});
			return mergedAttributes;
		}, {});
	}
	function getRenderedAttributes(nodeOrMark, extensionAttributes) {
		return extensionAttributes.filter((attribute) => attribute.type === nodeOrMark.type.name).filter((item) => item.attribute.rendered).map((item) => {
			if (!item.attribute.renderHTML) return { [item.name]: nodeOrMark.attrs[item.name] };
			return item.attribute.renderHTML(nodeOrMark.attrs) || {};
		}).reduce((attributes, attribute) => mergeAttributes(attributes, attribute), {});
	}
	function fromString(value) {
		if (typeof value !== "string") return value;
		if (value.match(/^[+-]?(?:\d*\.)?\d+$/)) return Number(value);
		if (value === "true") return true;
		if (value === "false") return false;
		return value;
	}
	function injectExtensionAttributesToParseRule(parseRule, extensionAttributes) {
		if ("style" in parseRule) return parseRule;
		return {
			...parseRule,
			getAttrs: (node) => {
				const oldAttributes = parseRule.getAttrs ? parseRule.getAttrs(node) : parseRule.attrs;
				if (oldAttributes === false) return false;
				const newAttributes = extensionAttributes.reduce((items, item) => {
					const value = item.attribute.parseHTML ? item.attribute.parseHTML(node) : fromString(node.getAttribute(item.name));
					if (value === null || value === void 0) return items;
					return {
						...items,
						[item.name]: value
					};
				}, {});
				return {
					...oldAttributes,
					...newAttributes
				};
			}
		};
	}
	function cleanUpSchemaItem(data) {
		return Object.fromEntries(Object.entries(data).filter(([key, value]) => {
			if (key === "attrs" && isEmptyObject(value)) return false;
			return value !== null && value !== void 0;
		}));
	}
	function buildAttributeSpec(extensionAttribute) {
		var _a;
		var _b;
		const spec = {};
		if (!((_a = extensionAttribute == null ? void 0 : extensionAttribute.attribute) == null ? void 0 : _a.isRequired) && "default" in ((extensionAttribute == null ? void 0 : extensionAttribute.attribute) || {})) spec.default = extensionAttribute.attribute.default;
		if (((_b = extensionAttribute == null ? void 0 : extensionAttribute.attribute) == null ? void 0 : _b.validate) !== void 0) spec.validate = extensionAttribute.attribute.validate;
		return [extensionAttribute.name, spec];
	}
	function getSchemaByResolvedExtensions(extensions, editor) {
		var _a;
		const allAttributes = getAttributesFromExtensions(extensions);
		const { nodeExtensions, markExtensions } = splitExtensions(extensions);
		return new Schema({
			topNode: (_a = nodeExtensions.find((extension) => getExtensionField(extension, "topNode"))) == null ? void 0 : _a.name,
			nodes: Object.fromEntries(nodeExtensions.map((extension) => {
				const extensionAttributes = allAttributes.filter((attribute) => attribute.type === extension.name);
				const context = {
					name: extension.name,
					options: extension.options,
					storage: extension.storage,
					editor
				};
				const schema = cleanUpSchemaItem({
					...extensions.reduce((fields, e) => {
						const extendNodeSchema = getExtensionField(e, "extendNodeSchema", context);
						return {
							...fields,
							...extendNodeSchema ? extendNodeSchema(extension) : {}
						};
					}, {}),
					content: callOrReturn(getExtensionField(extension, "content", context)),
					marks: callOrReturn(getExtensionField(extension, "marks", context)),
					group: callOrReturn(getExtensionField(extension, "group", context)),
					inline: callOrReturn(getExtensionField(extension, "inline", context)),
					atom: callOrReturn(getExtensionField(extension, "atom", context)),
					selectable: callOrReturn(getExtensionField(extension, "selectable", context)),
					draggable: callOrReturn(getExtensionField(extension, "draggable", context)),
					code: callOrReturn(getExtensionField(extension, "code", context)),
					whitespace: callOrReturn(getExtensionField(extension, "whitespace", context)),
					linebreakReplacement: callOrReturn(getExtensionField(extension, "linebreakReplacement", context)),
					defining: callOrReturn(getExtensionField(extension, "defining", context)),
					isolating: callOrReturn(getExtensionField(extension, "isolating", context)),
					attrs: Object.fromEntries(extensionAttributes.map(buildAttributeSpec))
				});
				const parseHTML = callOrReturn(getExtensionField(extension, "parseHTML", context));
				if (parseHTML) schema.parseDOM = parseHTML.map((parseRule) => injectExtensionAttributesToParseRule(parseRule, extensionAttributes));
				const renderHTML = getExtensionField(extension, "renderHTML", context);
				if (renderHTML) schema.toDOM = (node) => renderHTML({
					node,
					HTMLAttributes: getRenderedAttributes(node, extensionAttributes)
				});
				const renderText = getExtensionField(extension, "renderText", context);
				if (renderText) schema.toText = renderText;
				return [extension.name, schema];
			})),
			marks: Object.fromEntries(markExtensions.map((extension) => {
				const extensionAttributes = allAttributes.filter((attribute) => attribute.type === extension.name);
				const context = {
					name: extension.name,
					options: extension.options,
					storage: extension.storage,
					editor
				};
				const schema = cleanUpSchemaItem({
					...extensions.reduce((fields, e) => {
						const extendMarkSchema = getExtensionField(e, "extendMarkSchema", context);
						return {
							...fields,
							...extendMarkSchema ? extendMarkSchema(extension) : {}
						};
					}, {}),
					inclusive: callOrReturn(getExtensionField(extension, "inclusive", context)),
					excludes: callOrReturn(getExtensionField(extension, "excludes", context)),
					group: callOrReturn(getExtensionField(extension, "group", context)),
					spanning: callOrReturn(getExtensionField(extension, "spanning", context)),
					code: callOrReturn(getExtensionField(extension, "code", context)),
					attrs: Object.fromEntries(extensionAttributes.map(buildAttributeSpec))
				});
				const parseHTML = callOrReturn(getExtensionField(extension, "parseHTML", context));
				if (parseHTML) schema.parseDOM = parseHTML.map((parseRule) => injectExtensionAttributesToParseRule(parseRule, extensionAttributes));
				const renderHTML = getExtensionField(extension, "renderHTML", context);
				if (renderHTML) schema.toDOM = (mark) => renderHTML({
					mark,
					HTMLAttributes: getRenderedAttributes(mark, extensionAttributes)
				});
				return [extension.name, schema];
			}))
		});
	}
	function findDuplicates(items) {
		const filtered = items.filter((el, index) => items.indexOf(el) !== index);
		return Array.from(new Set(filtered));
	}
	function sortExtensions(extensions) {
		const defaultPriority = 100;
		return extensions.sort((a, b) => {
			const priorityA = getExtensionField(a, "priority") || defaultPriority;
			const priorityB = getExtensionField(b, "priority") || defaultPriority;
			if (priorityA > priorityB) return -1;
			if (priorityA < priorityB) return 1;
			return 0;
		});
	}
	function resolveExtensions(extensions) {
		const resolvedExtensions = sortExtensions(flattenExtensions(extensions));
		const duplicatedNames = findDuplicates(resolvedExtensions.map((extension) => extension.name));
		if (duplicatedNames.length) console.warn(`[tiptap warn]: Duplicate extension names found: [${duplicatedNames.map((item) => `'${item}'`).join(", ")}]. This can lead to issues.`);
		return resolvedExtensions;
	}
	function getTextBetween(startNode, range, options) {
		const { from, to } = range;
		const { blockSeparator = "\n\n", textSerializers = {} } = options || {};
		let text = "";
		startNode.nodesBetween(from, to, (node, pos, parent, index) => {
			var _a;
			if (node.isBlock && pos > from) text += blockSeparator;
			const textSerializer = textSerializers == null ? void 0 : textSerializers[node.type.name];
			if (textSerializer) {
				if (parent) text += textSerializer({
					node,
					pos,
					parent,
					index,
					range
				});
				return false;
			}
			if (node.isText) text += (_a = node == null ? void 0 : node.text) == null ? void 0 : _a.slice(Math.max(from, pos) - pos, to - pos);
		});
		return text;
	}
	function getText(node, options) {
		return getTextBetween(node, {
			from: 0,
			to: node.content.size
		}, options);
	}
	function getTextSerializersFromSchema(schema) {
		return Object.fromEntries(Object.entries(schema.nodes).filter(([, node]) => node.spec.toText).map(([name, node]) => [name, node.spec.toText]));
	}
	function getNodeAttributes(state, typeOrName) {
		const type = getNodeType(typeOrName, state.schema);
		const { from, to } = state.selection;
		const nodes = [];
		state.doc.nodesBetween(from, to, (node2) => {
			nodes.push(node2);
		});
		const node = nodes.reverse().find((nodeItem) => nodeItem.type.name === type.name);
		if (!node) return {};
		return { ...node.attrs };
	}
	function getAttributes(state, typeOrName) {
		const schemaType = getSchemaTypeNameByName(typeof typeOrName === "string" ? typeOrName : typeOrName.name, state.schema);
		if (schemaType === "node") return getNodeAttributes(state, typeOrName);
		if (schemaType === "mark") return getMarkAttributes(state, typeOrName);
		return {};
	}
	function removeDuplicates(array, by = JSON.stringify) {
		const seen = {};
		return array.filter((item) => {
			const key = by(item);
			return Object.prototype.hasOwnProperty.call(seen, key) ? false : seen[key] = true;
		});
	}
	function simplifyChangedRanges(changes) {
		const uniqueChanges = removeDuplicates(changes);
		return uniqueChanges.length === 1 ? uniqueChanges : uniqueChanges.filter((change, index) => {
			return !uniqueChanges.filter((_, i) => i !== index).some((otherChange) => {
				return change.oldRange.from >= otherChange.oldRange.from && change.oldRange.to <= otherChange.oldRange.to && change.newRange.from >= otherChange.newRange.from && change.newRange.to <= otherChange.newRange.to;
			});
		});
	}
	function getChangedRanges(transform) {
		const { mapping, steps } = transform;
		const changes = [];
		mapping.maps.forEach((stepMap, index) => {
			const ranges = [];
			if (!stepMap.ranges.length) {
				const { from, to } = steps[index];
				if (from === void 0 || to === void 0) return;
				ranges.push({
					from,
					to
				});
			} else stepMap.forEach((from, to) => {
				ranges.push({
					from,
					to
				});
			});
			ranges.forEach(({ from, to }) => {
				const newStart = mapping.slice(index).map(from, -1);
				const newEnd = mapping.slice(index).map(to);
				const oldStart = mapping.invert().map(newStart, -1);
				const oldEnd = mapping.invert().map(newEnd);
				changes.push({
					oldRange: {
						from: oldStart,
						to: oldEnd
					},
					newRange: {
						from: newStart,
						to: newEnd
					}
				});
			});
		});
		return simplifyChangedRanges(changes);
	}
	function getMarksBetween(from, to, doc) {
		const marks = [];
		if (from === to) doc.resolve(from).marks().forEach((mark) => {
			const range = getMarkRange(doc.resolve(from), mark.type);
			if (!range) return;
			marks.push({
				mark,
				...range
			});
		});
		else doc.nodesBetween(from, to, (node, pos) => {
			if (!node || (node == null ? void 0 : node.nodeSize) === void 0) return;
			marks.push(...node.marks.map((mark) => ({
				from: pos,
				to: pos + node.nodeSize,
				mark
			})));
		});
		return marks;
	}
	function getSchemaTypeByName(name, schema) {
		return schema.nodes[name] || schema.marks[name] || null;
	}
	function getSplittedAttributes(extensionAttributes, typeName, attributes) {
		return Object.fromEntries(Object.entries(attributes).filter(([name]) => {
			const extensionAttribute = extensionAttributes.find((item) => {
				return item.type === typeName && item.name === name;
			});
			if (!extensionAttribute) return false;
			return extensionAttribute.attribute.keepOnSplit;
		}));
	}
	var getTextContentFromNodes = ($from, maxMatch = 500) => {
		let textBefore = "";
		const sliceEndPos = $from.parentOffset;
		$from.parent.nodesBetween(Math.max(0, sliceEndPos - maxMatch), sliceEndPos, (node, pos, parent, index) => {
			var _a;
			var _b;
			const chunk = ((_b = (_a = node.type.spec).toText) == null ? void 0 : _b.call(_a, {
				node,
				pos,
				parent,
				index
			})) || node.textContent || "%leaf%";
			textBefore += node.isAtom && !node.isText ? chunk : chunk.slice(0, Math.max(0, sliceEndPos - pos));
		});
		return textBefore;
	};
	function isMarkActive(state, typeOrName, attributes = {}) {
		const { empty, ranges } = state.selection;
		const type = typeOrName ? getMarkType(typeOrName, state.schema) : null;
		if (empty) return !!(state.storedMarks || state.selection.$from.marks()).filter((mark) => {
			if (!type) return true;
			return type.name === mark.type.name;
		}).find((mark) => objectIncludes(mark.attrs, attributes, { strict: false }));
		let selectionRange = 0;
		const markRanges = [];
		ranges.forEach(({ $from, $to }) => {
			const from = $from.pos;
			const to = $to.pos;
			state.doc.nodesBetween(from, to, (node, pos) => {
				if (type && node.inlineContent && !node.type.allowsMarkType(type)) return false;
				if (!node.isText && !node.marks.length) return;
				const relativeFrom = Math.max(from, pos);
				const relativeTo = Math.min(to, pos + node.nodeSize);
				const range2 = relativeTo - relativeFrom;
				selectionRange += range2;
				markRanges.push(...node.marks.map((mark) => ({
					mark,
					from: relativeFrom,
					to: relativeTo
				})));
			});
		});
		if (selectionRange === 0) return false;
		const matchedRange = markRanges.filter((markRange) => {
			if (!type) return true;
			return type.name === markRange.mark.type.name;
		}).filter((markRange) => objectIncludes(markRange.mark.attrs, attributes, { strict: false })).reduce((sum, markRange) => sum + markRange.to - markRange.from, 0);
		const excludedRange = markRanges.filter((markRange) => {
			if (!type) return true;
			return markRange.mark.type !== type && markRange.mark.type.excludes(type);
		}).reduce((sum, markRange) => sum + markRange.to - markRange.from, 0);
		return (matchedRange > 0 ? matchedRange + excludedRange : matchedRange) >= selectionRange;
	}
	function isActive(state, name, attributes = {}) {
		if (!name) return isNodeActive(state, null, attributes) || isMarkActive(state, null, attributes);
		const schemaType = getSchemaTypeNameByName(name, state.schema);
		if (schemaType === "node") return isNodeActive(state, name, attributes);
		if (schemaType === "mark") return isMarkActive(state, name, attributes);
		return false;
	}
	function isExtensionRulesEnabled(extension, enabled) {
		if (Array.isArray(enabled)) return enabled.some((enabledExtension) => {
			return (typeof enabledExtension === "string" ? enabledExtension : enabledExtension.name) === extension.name;
		});
		return enabled;
	}
	function isList(name, extensions) {
		const { nodeExtensions } = splitExtensions(extensions);
		const extension = nodeExtensions.find((item) => item.name === name);
		if (!extension) return false;
		const group = callOrReturn(getExtensionField(extension, "group", {
			name: extension.name,
			options: extension.options,
			storage: extension.storage
		}));
		if (typeof group !== "string") return false;
		return group.split(" ").includes("list");
	}
	function isNodeEmpty(node, { checkChildren = true, ignoreWhitespace = false } = {}) {
		var _a;
		if (ignoreWhitespace) {
			if (node.type.name === "hardBreak") return true;
			if (node.isText) return /^\s*$/m.test((_a = node.text) != null ? _a : "");
		}
		if (node.isText) return !node.text;
		if (node.isAtom || node.isLeaf) return false;
		if (node.content.childCount === 0) return true;
		if (checkChildren) {
			let isContentEmpty = true;
			node.content.forEach((childNode) => {
				if (isContentEmpty === false) return;
				if (!isNodeEmpty(childNode, {
					ignoreWhitespace,
					checkChildren
				})) isContentEmpty = false;
			});
			return isContentEmpty;
		}
		return false;
	}
	var MappablePosition = class _MappablePosition {
		constructor(position) {
			this.position = position;
		}
		/**
		* Creates a MappablePosition from a JSON object.
		*/
		static fromJSON(json) {
			return new _MappablePosition(json.position);
		}
		/**
		* Converts the MappablePosition to a JSON object.
		*/
		toJSON() {
			return { position: this.position };
		}
	};
	function getUpdatedPosition(position, transaction) {
		const mapResult = transaction.mapping.mapResult(position.position);
		return {
			position: new MappablePosition(mapResult.pos),
			mapResult
		};
	}
	function createMappablePosition(position) {
		return new MappablePosition(position);
	}
	function canSetMark(state, tr, newMarkType) {
		var _a;
		const { selection } = tr;
		let cursor = null;
		if (isTextSelection(selection)) cursor = selection.$cursor;
		if (cursor) {
			const currentMarks = (_a = state.storedMarks) != null ? _a : cursor.marks();
			return cursor.parent.type.allowsMarkType(newMarkType) && (!!newMarkType.isInSet(currentMarks) || !currentMarks.some((mark) => mark.type.excludes(newMarkType)));
		}
		const { ranges } = selection;
		return ranges.some(({ $from, $to }) => {
			let someNodeSupportsMark = $from.depth === 0 ? state.doc.inlineContent && state.doc.type.allowsMarkType(newMarkType) : false;
			state.doc.nodesBetween($from.pos, $to.pos, (node, _pos, parent) => {
				if (someNodeSupportsMark) return false;
				if (node.isInline) {
					const parentAllowsMarkType = !parent || parent.type.allowsMarkType(newMarkType);
					const currentMarksAllowMarkType = !!newMarkType.isInSet(node.marks) || !node.marks.some((otherMark) => otherMark.type.excludes(newMarkType));
					someNodeSupportsMark = parentAllowsMarkType && currentMarksAllowMarkType;
				}
				return !someNodeSupportsMark;
			});
			return someNodeSupportsMark;
		});
	}
	var setMark = (typeOrName, attributes = {}) => ({ tr, state, dispatch }) => {
		const { selection } = tr;
		const { empty, ranges } = selection;
		const type = getMarkType(typeOrName, state.schema);
		if (dispatch) if (empty) {
			const oldAttributes = getMarkAttributes(state, type);
			tr.addStoredMark(type.create({
				...oldAttributes,
				...attributes
			}));
		} else ranges.forEach((range) => {
			const from = range.$from.pos;
			const to = range.$to.pos;
			state.doc.nodesBetween(from, to, (node, pos) => {
				const trimmedFrom = Math.max(pos, from);
				const trimmedTo = Math.min(pos + node.nodeSize, to);
				if (node.marks.find((mark) => mark.type === type)) node.marks.forEach((mark) => {
					if (type === mark.type) tr.addMark(trimmedFrom, trimmedTo, type.create({
						...mark.attrs,
						...attributes
					}));
				});
				else tr.addMark(trimmedFrom, trimmedTo, type.create(attributes));
			});
		});
		return canSetMark(state, tr, type);
	};
	var setMeta = (key, value) => ({ tr }) => {
		tr.setMeta(key, value);
		return true;
	};
	var setNode = (typeOrName, attributes = {}) => ({ state, dispatch, chain }) => {
		const type = getNodeType(typeOrName, state.schema);
		let attributesToCopy;
		if (state.selection.$anchor.sameParent(state.selection.$head)) attributesToCopy = state.selection.$anchor.parent.attrs;
		if (!type.isTextblock) {
			console.warn("[tiptap warn]: Currently \"setNode()\" only supports text block nodes.");
			return false;
		}
		return chain().command(({ commands }) => {
			if (setBlockType(type, {
				...attributesToCopy,
				...attributes
			})(state)) return true;
			return commands.clearNodes();
		}).command(({ state: updatedState }) => {
			return setBlockType(type, {
				...attributesToCopy,
				...attributes
			})(updatedState, dispatch);
		}).run();
	};
	var setNodeSelection = (position) => ({ tr, dispatch }) => {
		if (dispatch) {
			const { doc } = tr;
			const from = minMax(position, 0, doc.content.size);
			const selection = NodeSelection.create(doc, from);
			tr.setSelection(selection);
		}
		return true;
	};
	var setTextDirection = (direction, position) => ({ tr, state, dispatch }) => {
		const { selection } = state;
		let from;
		let to;
		if (typeof position === "number") {
			from = position;
			to = position;
		} else if (position && "from" in position && "to" in position) {
			from = position.from;
			to = position.to;
		} else {
			from = selection.from;
			to = selection.to;
		}
		if (dispatch) tr.doc.nodesBetween(from, to, (node, pos) => {
			if (node.isText) return;
			tr.setNodeMarkup(pos, void 0, {
				...node.attrs,
				dir: direction
			});
		});
		return true;
	};
	var setTextSelection = (position) => ({ tr, dispatch }) => {
		if (dispatch) {
			const { doc } = tr;
			const { from, to } = typeof position === "number" ? {
				from: position,
				to: position
			} : position;
			const minPos = TextSelection.atStart(doc).from;
			const maxPos = TextSelection.atEnd(doc).to;
			const resolvedFrom = minMax(from, minPos, maxPos);
			const resolvedEnd = minMax(to, minPos, maxPos);
			const selection = TextSelection.create(doc, resolvedFrom, resolvedEnd);
			tr.setSelection(selection);
		}
		return true;
	};
	var sinkListItem = (typeOrName) => ({ state, dispatch }) => {
		return sinkListItem$1(getNodeType(typeOrName, state.schema))(state, dispatch);
	};
	function ensureMarks(state, splittableMarks) {
		const marks = state.storedMarks || state.selection.$to.parentOffset && state.selection.$from.marks();
		if (marks) {
			const filteredMarks = marks.filter((mark) => splittableMarks == null ? void 0 : splittableMarks.includes(mark.type.name));
			state.tr.ensureMarks(filteredMarks);
		}
	}
	var splitBlock = ({ keepMarks = true } = {}) => ({ tr, state, dispatch, editor }) => {
		const { selection, doc } = tr;
		const { $from, $to } = selection;
		const extensionAttributes = editor.extensionManager.attributes;
		const newAttributes = getSplittedAttributes(extensionAttributes, $from.node().type.name, $from.node().attrs);
		if (selection instanceof NodeSelection && selection.node.isBlock) {
			if (!$from.parentOffset || !canSplit(doc, $from.pos)) return false;
			if (dispatch) {
				if (keepMarks) ensureMarks(state, editor.extensionManager.splittableMarks);
				tr.split($from.pos).scrollIntoView();
			}
			return true;
		}
		if (!$from.parent.isBlock) return false;
		const atEnd = $to.parentOffset === $to.parent.content.size;
		const deflt = $from.depth === 0 ? void 0 : defaultBlockAt($from.node(-1).contentMatchAt($from.indexAfter(-1)));
		let types = atEnd && deflt ? [{
			type: deflt,
			attrs: newAttributes
		}] : void 0;
		let can = canSplit(tr.doc, tr.mapping.map($from.pos), 1, types);
		if (!types && !can && canSplit(tr.doc, tr.mapping.map($from.pos), 1, deflt ? [{ type: deflt }] : void 0)) {
			can = true;
			types = deflt ? [{
				type: deflt,
				attrs: newAttributes
			}] : void 0;
		}
		if (dispatch) {
			if (can) {
				if (selection instanceof TextSelection) tr.deleteSelection();
				tr.split(tr.mapping.map($from.pos), 1, types);
				if (deflt && !atEnd && !$from.parentOffset && $from.parent.type !== deflt) {
					const first2 = tr.mapping.map($from.before());
					const $first = tr.doc.resolve(first2);
					if ($from.node(-1).canReplaceWith($first.index(), $first.index() + 1, deflt)) tr.setNodeMarkup(tr.mapping.map($from.before()), deflt);
				}
			}
			if (keepMarks) ensureMarks(state, editor.extensionManager.splittableMarks);
			tr.scrollIntoView();
		}
		return can;
	};
	var splitListItem = (typeOrName, overrideAttrs = {}) => ({ tr, state, dispatch, editor }) => {
		var _a;
		const type = getNodeType(typeOrName, state.schema);
		const { $from, $to } = state.selection;
		const node = state.selection.node;
		if (node && node.isBlock || $from.depth < 2 || !$from.sameParent($to)) return false;
		const grandParent = $from.node(-1);
		if (grandParent.type !== type) return false;
		const extensionAttributes = editor.extensionManager.attributes;
		if ($from.parent.content.size === 0 && $from.node(-1).childCount === $from.indexAfter(-1)) {
			if ($from.depth === 2 || $from.node(-3).type !== type || $from.index(-2) !== $from.node(-2).childCount - 1) return false;
			if (dispatch) {
				let wrap = Fragment$1.empty;
				const depthBefore = $from.index(-1) ? 1 : $from.index(-2) ? 2 : 3;
				for (let d = $from.depth - depthBefore; d >= $from.depth - 3; d -= 1) wrap = Fragment$1.from($from.node(d).copy(wrap));
				const depthAfter = $from.indexAfter(-1) < $from.node(-2).childCount ? 1 : $from.indexAfter(-2) < $from.node(-3).childCount ? 2 : 3;
				const newNextTypeAttributes2 = {
					...getSplittedAttributes(extensionAttributes, $from.node().type.name, $from.node().attrs),
					...overrideAttrs
				};
				const nextType2 = ((_a = type.contentMatch.defaultType) == null ? void 0 : _a.createAndFill(newNextTypeAttributes2)) || void 0;
				wrap = wrap.append(Fragment$1.from(type.createAndFill(null, nextType2) || void 0));
				const start = $from.before($from.depth - (depthBefore - 1));
				tr.replace(start, $from.after(-depthAfter), new Slice(wrap, 4 - depthBefore, 0));
				let sel = -1;
				tr.doc.nodesBetween(start, tr.doc.content.size, (n, pos) => {
					if (sel > -1) return false;
					if (n.isTextblock && n.content.size === 0) sel = pos + 1;
				});
				if (sel > -1) tr.setSelection(TextSelection.near(tr.doc.resolve(sel)));
				tr.scrollIntoView();
			}
			return true;
		}
		const nextType = $to.pos === $from.end() ? grandParent.contentMatchAt(0).defaultType : null;
		const newTypeAttributes = {
			...getSplittedAttributes(extensionAttributes, grandParent.type.name, grandParent.attrs),
			...overrideAttrs
		};
		const newNextTypeAttributes = {
			...getSplittedAttributes(extensionAttributes, $from.node().type.name, $from.node().attrs),
			...overrideAttrs
		};
		tr.delete($from.pos, $to.pos);
		const types = nextType ? [{
			type,
			attrs: newTypeAttributes
		}, {
			type: nextType,
			attrs: newNextTypeAttributes
		}] : [{
			type,
			attrs: newTypeAttributes
		}];
		if (!canSplit(tr.doc, $from.pos, 2)) return false;
		if (dispatch) {
			const { selection, storedMarks } = state;
			const { splittableMarks } = editor.extensionManager;
			const marks = storedMarks || selection.$to.parentOffset && selection.$from.marks();
			tr.split($from.pos, 2, types).scrollIntoView();
			if (!marks || !dispatch) return true;
			const filteredMarks = marks.filter((mark) => splittableMarks.includes(mark.type.name));
			tr.ensureMarks(filteredMarks);
		}
		return true;
	};
	var joinListBackwards = (tr, listType) => {
		const list = findParentNode((node) => node.type === listType)(tr.selection);
		if (!list) return true;
		const before = tr.doc.resolve(Math.max(0, list.pos - 1)).before(list.depth);
		if (before === void 0) return true;
		const nodeBefore = tr.doc.nodeAt(before);
		if (!(list.node.type === (nodeBefore == null ? void 0 : nodeBefore.type) && canJoin(tr.doc, list.pos))) return true;
		tr.join(list.pos);
		return true;
	};
	var joinListForwards = (tr, listType) => {
		const list = findParentNode((node) => node.type === listType)(tr.selection);
		if (!list) return true;
		const after = tr.doc.resolve(list.start).after(list.depth);
		if (after === void 0) return true;
		const nodeAfter = tr.doc.nodeAt(after);
		if (!(list.node.type === (nodeAfter == null ? void 0 : nodeAfter.type) && canJoin(tr.doc, after))) return true;
		tr.join(after);
		return true;
	};
	var toggleList = (listTypeOrName, itemTypeOrName, keepMarks, attributes = {}) => ({ editor, tr, state, dispatch, chain, commands, can }) => {
		const { extensions, splittableMarks } = editor.extensionManager;
		const listType = getNodeType(listTypeOrName, state.schema);
		const itemType = getNodeType(itemTypeOrName, state.schema);
		const { selection, storedMarks } = state;
		const { $from, $to } = selection;
		const range = $from.blockRange($to);
		const marks = storedMarks || selection.$to.parentOffset && selection.$from.marks();
		if (!range) return false;
		const parentList = findParentNode((node) => isList(node.type.name, extensions))(selection);
		if (range.depth >= 1 && parentList && range.depth - parentList.depth <= 1) {
			if (parentList.node.type === listType) return commands.liftListItem(itemType);
			if (isList(parentList.node.type.name, extensions) && listType.validContent(parentList.node.content) && dispatch) return chain().command(() => {
				tr.setNodeMarkup(parentList.pos, listType);
				return true;
			}).command(() => joinListBackwards(tr, listType)).command(() => joinListForwards(tr, listType)).run();
		}
		if (!keepMarks || !marks || !dispatch) return chain().command(() => {
			if (can().wrapInList(listType, attributes)) return true;
			return commands.clearNodes();
		}).wrapInList(listType, attributes).command(() => joinListBackwards(tr, listType)).command(() => joinListForwards(tr, listType)).run();
		return chain().command(() => {
			const canWrapInList = can().wrapInList(listType, attributes);
			const filteredMarks = marks.filter((mark) => splittableMarks.includes(mark.type.name));
			tr.ensureMarks(filteredMarks);
			if (canWrapInList) return true;
			return commands.clearNodes();
		}).wrapInList(listType, attributes).command(() => joinListBackwards(tr, listType)).command(() => joinListForwards(tr, listType)).run();
	};
	var toggleMark = (typeOrName, attributes = {}, options = {}) => ({ state, commands }) => {
		const { extendEmptyMarkRange = false } = options;
		const type = getMarkType(typeOrName, state.schema);
		if (isMarkActive(state, type, attributes)) return commands.unsetMark(type, { extendEmptyMarkRange });
		return commands.setMark(type, attributes);
	};
	var toggleNode = (typeOrName, toggleTypeOrName, attributes = {}) => ({ state, commands }) => {
		const type = getNodeType(typeOrName, state.schema);
		const toggleType = getNodeType(toggleTypeOrName, state.schema);
		const isActive2 = isNodeActive(state, type, attributes);
		let attributesToCopy;
		if (state.selection.$anchor.sameParent(state.selection.$head)) attributesToCopy = state.selection.$anchor.parent.attrs;
		if (isActive2) return commands.setNode(toggleType, attributesToCopy);
		return commands.setNode(type, {
			...attributesToCopy,
			...attributes
		});
	};
	var toggleWrap = (typeOrName, attributes = {}) => ({ state, commands }) => {
		const type = getNodeType(typeOrName, state.schema);
		if (isNodeActive(state, type, attributes)) return commands.lift(type);
		return commands.wrapIn(type, attributes);
	};
	var undoInputRule = () => ({ state, dispatch }) => {
		const plugins = state.plugins;
		for (let i = 0; i < plugins.length; i += 1) {
			const plugin = plugins[i];
			let undoable;
			if (plugin.spec.isInputRules && (undoable = plugin.getState(state))) {
				if (dispatch) {
					const tr = state.tr;
					const toUndo = undoable.transform;
					for (let j = toUndo.steps.length - 1; j >= 0; j -= 1) tr.step(toUndo.steps[j].invert(toUndo.docs[j]));
					if (undoable.text) {
						const marks = tr.doc.resolve(undoable.from).marks();
						tr.replaceWith(undoable.from, undoable.to, state.schema.text(undoable.text, marks));
					} else tr.delete(undoable.from, undoable.to);
				}
				return true;
			}
		}
		return false;
	};
	var unsetAllMarks = () => ({ tr, dispatch }) => {
		const { selection } = tr;
		const { empty, ranges } = selection;
		if (empty) return true;
		if (dispatch) ranges.forEach((range) => {
			tr.removeMark(range.$from.pos, range.$to.pos);
		});
		return true;
	};
	var unsetMark = (typeOrName, options = {}) => ({ tr, state, dispatch }) => {
		var _a;
		const { extendEmptyMarkRange = false } = options;
		const { selection } = tr;
		const type = getMarkType(typeOrName, state.schema);
		const { $from, empty, ranges } = selection;
		if (!dispatch) return true;
		if (empty && extendEmptyMarkRange) {
			let { from, to } = selection;
			const range = getMarkRange($from, type, (_a = $from.marks().find((mark) => mark.type === type)) == null ? void 0 : _a.attrs);
			if (range) {
				from = range.from;
				to = range.to;
			}
			tr.removeMark(from, to, type);
		} else ranges.forEach((range) => {
			tr.removeMark(range.$from.pos, range.$to.pos, type);
		});
		tr.removeStoredMark(type);
		return true;
	};
	var unsetTextDirection = (position) => ({ tr, state, dispatch }) => {
		const { selection } = state;
		let from;
		let to;
		if (typeof position === "number") {
			from = position;
			to = position;
		} else if (position && "from" in position && "to" in position) {
			from = position.from;
			to = position.to;
		} else {
			from = selection.from;
			to = selection.to;
		}
		if (dispatch) tr.doc.nodesBetween(from, to, (node, pos) => {
			if (node.isText) return;
			const newAttrs = { ...node.attrs };
			delete newAttrs.dir;
			tr.setNodeMarkup(pos, void 0, newAttrs);
		});
		return true;
	};
	var updateAttributes = (typeOrName, attributes = {}) => ({ tr, state, dispatch }) => {
		let nodeType = null;
		let markType = null;
		const schemaType = getSchemaTypeNameByName(typeof typeOrName === "string" ? typeOrName : typeOrName.name, state.schema);
		if (!schemaType) return false;
		if (schemaType === "node") nodeType = getNodeType(typeOrName, state.schema);
		if (schemaType === "mark") markType = getMarkType(typeOrName, state.schema);
		let canUpdate = false;
		tr.selection.ranges.forEach((range) => {
			const from = range.$from.pos;
			const to = range.$to.pos;
			let lastPos;
			let lastNode;
			let trimmedFrom;
			let trimmedTo;
			if (tr.selection.empty) state.doc.nodesBetween(from, to, (node, pos) => {
				if (nodeType && nodeType === node.type) {
					canUpdate = true;
					trimmedFrom = Math.max(pos, from);
					trimmedTo = Math.min(pos + node.nodeSize, to);
					lastPos = pos;
					lastNode = node;
				}
			});
			else state.doc.nodesBetween(from, to, (node, pos) => {
				if (pos < from && nodeType && nodeType === node.type) {
					canUpdate = true;
					trimmedFrom = Math.max(pos, from);
					trimmedTo = Math.min(pos + node.nodeSize, to);
					lastPos = pos;
					lastNode = node;
				}
				if (pos >= from && pos <= to) {
					if (nodeType && nodeType === node.type) {
						canUpdate = true;
						if (dispatch) tr.setNodeMarkup(pos, void 0, {
							...node.attrs,
							...attributes
						});
					}
					if (markType && node.marks.length) node.marks.forEach((mark) => {
						if (markType === mark.type) {
							canUpdate = true;
							if (dispatch) {
								const trimmedFrom2 = Math.max(pos, from);
								const trimmedTo2 = Math.min(pos + node.nodeSize, to);
								tr.addMark(trimmedFrom2, trimmedTo2, markType.create({
									...mark.attrs,
									...attributes
								}));
							}
						}
					});
				}
			});
			if (lastNode) {
				if (lastPos !== void 0 && dispatch) tr.setNodeMarkup(lastPos, void 0, {
					...lastNode.attrs,
					...attributes
				});
				if (markType && lastNode.marks.length) lastNode.marks.forEach((mark) => {
					if (markType === mark.type && dispatch) tr.addMark(trimmedFrom, trimmedTo, markType.create({
						...mark.attrs,
						...attributes
					}));
				});
			}
		});
		return canUpdate;
	};
	var wrapIn = (typeOrName, attributes = {}) => ({ state, dispatch }) => {
		return wrapIn$1(getNodeType(typeOrName, state.schema), attributes)(state, dispatch);
	};
	var wrapInList = (typeOrName, attributes = {}) => ({ state, dispatch }) => {
		return wrapInList$1(getNodeType(typeOrName, state.schema), attributes)(state, dispatch);
	};
	var EventEmitter = class {
		constructor() {
			this.callbacks = {};
		}
		on(event, fn) {
			if (!this.callbacks[event]) this.callbacks[event] = [];
			this.callbacks[event].push(fn);
			return this;
		}
		emit(event, ...args) {
			const callbacks = this.callbacks[event];
			if (callbacks) callbacks.forEach((callback) => callback.apply(this, args));
			return this;
		}
		off(event, fn) {
			const callbacks = this.callbacks[event];
			if (callbacks) if (fn) this.callbacks[event] = callbacks.filter((callback) => callback !== fn);
			else delete this.callbacks[event];
			return this;
		}
		once(event, fn) {
			const onceFn = (...args) => {
				this.off(event, onceFn);
				fn.apply(this, args);
			};
			return this.on(event, onceFn);
		}
		removeAllListeners() {
			this.callbacks = {};
		}
	};
	var InputRule = class {
		constructor(config) {
			var _a;
			this.find = config.find;
			this.handler = config.handler;
			this.undoable = (_a = config.undoable) != null ? _a : true;
		}
	};
	var inputRuleMatcherHandler = (text, find) => {
		if (isRegExp(find)) return find.exec(text);
		const inputRuleMatch = find(text);
		if (!inputRuleMatch) return null;
		const result = [inputRuleMatch.text];
		result.index = inputRuleMatch.index;
		result.input = text;
		result.data = inputRuleMatch.data;
		if (inputRuleMatch.replaceWith) {
			if (!inputRuleMatch.text.includes(inputRuleMatch.replaceWith)) console.warn("[tiptap warn]: \"inputRuleMatch.replaceWith\" must be part of \"inputRuleMatch.text\".");
			result.push(inputRuleMatch.replaceWith);
		}
		return result;
	};
	function run$2(config) {
		var _a;
		const { editor, from, to, text, rules, plugin } = config;
		const { view } = editor;
		if (view.composing) return false;
		const $from = view.state.doc.resolve(from);
		if ($from.parent.type.spec.code || !!((_a = $from.nodeBefore || $from.nodeAfter) == null ? void 0 : _a.marks.find((mark) => mark.type.spec.code))) return false;
		let matched = false;
		const textBefore = getTextContentFromNodes($from) + text;
		rules.forEach((rule) => {
			if (matched) return;
			const match = inputRuleMatcherHandler(textBefore, rule.find);
			if (!match) return;
			const tr = view.state.tr;
			const state = createChainableState({
				state: view.state,
				transaction: tr
			});
			const range = {
				from: from - (match[0].length - text.length),
				to
			};
			const { commands, chain, can } = new CommandManager({
				editor,
				state
			});
			if (rule.handler({
				state,
				range,
				match,
				commands,
				chain,
				can
			}) === null || !tr.steps.length) return;
			if (rule.undoable) tr.setMeta(plugin, {
				transform: tr,
				from,
				to,
				text
			});
			view.dispatch(tr);
			matched = true;
		});
		return matched;
	}
	__name(run$2, "run");
	function inputRulesPlugin(props) {
		const { editor, rules } = props;
		const plugin = new Plugin({
			state: {
				init() {
					return null;
				},
				apply(tr, prev, state) {
					const stored = tr.getMeta(plugin);
					if (stored) return stored;
					const simulatedInputMeta = tr.getMeta("applyInputRules");
					if (!!simulatedInputMeta) setTimeout(() => {
						let { text } = simulatedInputMeta;
						if (typeof text === "string") text = text;
						else text = getHTMLFromFragment(Fragment$1.from(text), state.schema);
						const { from } = simulatedInputMeta;
						const to = from + text.length;
						run$2({
							editor,
							from,
							to,
							text,
							rules,
							plugin
						});
					});
					return tr.selectionSet || tr.docChanged ? null : prev;
				}
			},
			props: {
				handleTextInput(view, from, to, text) {
					return run$2({
						editor,
						from,
						to,
						text,
						rules,
						plugin
					});
				},
				handleDOMEvents: { compositionend: (view) => {
					setTimeout(() => {
						const { $cursor } = view.state.selection;
						if ($cursor) run$2({
							editor,
							from: $cursor.pos,
							to: $cursor.pos,
							text: "",
							rules,
							plugin
						});
					});
					return false;
				} },
				handleKeyDown(view, event) {
					if (event.key !== "Enter") return false;
					const { $cursor } = view.state.selection;
					if ($cursor) return run$2({
						editor,
						from: $cursor.pos,
						to: $cursor.pos,
						text: "\n",
						rules,
						plugin
					});
					return false;
				}
			},
			isInputRules: true
		});
		return plugin;
	}
	function getType(value) {
		return Object.prototype.toString.call(value).slice(8, -1);
	}
	function isPlainObject(value) {
		if (getType(value) !== "Object") return false;
		return value.constructor === Object && Object.getPrototypeOf(value) === Object.prototype;
	}
	function mergeDeep(target, source) {
		const output = { ...target };
		if (isPlainObject(target) && isPlainObject(source)) Object.keys(source).forEach((key) => {
			if (isPlainObject(source[key]) && isPlainObject(target[key])) output[key] = mergeDeep(target[key], source[key]);
			else output[key] = source[key];
		});
		return output;
	}
	var Extendable = class {
		constructor(config = {}) {
			this.type = "extendable";
			this.parent = null;
			this.child = null;
			this.name = "";
			this.config = { name: this.name };
			this.config = {
				...this.config,
				...config
			};
			this.name = this.config.name;
		}
		get options() {
			return { ...callOrReturn(getExtensionField(this, "addOptions", { name: this.name })) || {} };
		}
		get storage() {
			return { ...callOrReturn(getExtensionField(this, "addStorage", {
				name: this.name,
				options: this.options
			})) || {} };
		}
		configure(options = {}) {
			const extension = this.extend({
				...this.config,
				addOptions: () => {
					return mergeDeep(this.options, options);
				}
			});
			extension.name = this.name;
			extension.parent = this.parent;
			return extension;
		}
		extend(extendedConfig = {}) {
			const extension = new this.constructor({
				...this.config,
				...extendedConfig
			});
			extension.parent = this;
			this.child = extension;
			extension.name = "name" in extendedConfig ? extendedConfig.name : extension.parent.name;
			return extension;
		}
	};
	var Mark = class _Mark extends Extendable {
		constructor() {
			super(...arguments);
			this.type = "mark";
		}
		/**
		* Create a new Mark instance
		* @param config - Mark configuration object or a function that returns a configuration object
		*/
		static create(config = {}) {
			const resolvedConfig = typeof config === "function" ? config() : config;
			return new _Mark(resolvedConfig);
		}
		static handleExit({ editor, mark }) {
			const { tr } = editor.state;
			const currentPos = editor.state.selection.$from;
			if (currentPos.pos === currentPos.end()) {
				const currentMarks = currentPos.marks();
				if (!!!currentMarks.find((m) => (m == null ? void 0 : m.type.name) === mark.name)) return false;
				const removeMark = currentMarks.find((m) => (m == null ? void 0 : m.type.name) === mark.name);
				if (removeMark) tr.removeStoredMark(removeMark);
				tr.insertText(" ", currentPos.pos);
				editor.view.dispatch(tr);
				return true;
			}
			return false;
		}
		configure(options) {
			return super.configure(options);
		}
		extend(extendedConfig) {
			const resolvedConfig = typeof extendedConfig === "function" ? extendedConfig() : extendedConfig;
			return super.extend(resolvedConfig);
		}
	};
	function isNumber(value) {
		return typeof value === "number";
	}
	var PasteRule = class {
		constructor(config) {
			this.find = config.find;
			this.handler = config.handler;
		}
	};
	var pasteRuleMatcherHandler = (text, find, event) => {
		if (isRegExp(find)) return [...text.matchAll(find)];
		const matches = find(text, event);
		if (!matches) return [];
		return matches.map((pasteRuleMatch) => {
			const result = [pasteRuleMatch.text];
			result.index = pasteRuleMatch.index;
			result.input = text;
			result.data = pasteRuleMatch.data;
			if (pasteRuleMatch.replaceWith) {
				if (!pasteRuleMatch.text.includes(pasteRuleMatch.replaceWith)) console.warn("[tiptap warn]: \"pasteRuleMatch.replaceWith\" must be part of \"pasteRuleMatch.text\".");
				result.push(pasteRuleMatch.replaceWith);
			}
			return result;
		});
	};
	function run2(config) {
		const { editor, state, from, to, rule, pasteEvent, dropEvent } = config;
		const { commands, chain, can } = new CommandManager({
			editor,
			state
		});
		const handlers = [];
		state.doc.nodesBetween(from, to, (node, pos) => {
			var _a;
			var _b;
			var _c;
			var _d;
			var _e;
			if (((_b = (_a = node.type) == null ? void 0 : _a.spec) == null ? void 0 : _b.code) || !(node.isText || node.isTextblock || node.isInline)) return;
			const contentSize = (_e = (_d = (_c = node.content) == null ? void 0 : _c.size) != null ? _d : node.nodeSize) != null ? _e : 0;
			const resolvedFrom = Math.max(from, pos);
			const resolvedTo = Math.min(to, pos + contentSize);
			if (resolvedFrom >= resolvedTo) return;
			pasteRuleMatcherHandler(node.isText ? node.text || "" : node.textBetween(resolvedFrom - pos, resolvedTo - pos, void 0, "￼"), rule.find, pasteEvent).forEach((match) => {
				if (match.index === void 0) return;
				const start = resolvedFrom + match.index + 1;
				const end = start + match[0].length;
				const range = {
					from: state.tr.mapping.map(start),
					to: state.tr.mapping.map(end)
				};
				const handler = rule.handler({
					state,
					range,
					match,
					commands,
					chain,
					can,
					pasteEvent,
					dropEvent
				});
				handlers.push(handler);
			});
		});
		return handlers.every((handler) => handler !== null);
	}
	var tiptapDragFromOtherEditor = null;
	var createClipboardPasteEvent = (text) => {
		var _a;
		const event = new ClipboardEvent("paste", { clipboardData: new DataTransfer() });
		(_a = event.clipboardData) == null || _a.setData("text/html", text);
		return event;
	};
	function pasteRulesPlugin(props) {
		const { editor, rules } = props;
		let dragSourceElement = null;
		let isPastedFromProseMirror = false;
		let isDroppedFromProseMirror = false;
		let pasteEvent = typeof ClipboardEvent !== "undefined" ? new ClipboardEvent("paste") : null;
		let dropEvent;
		try {
			dropEvent = typeof DragEvent !== "undefined" ? new DragEvent("drop") : null;
		} catch {
			dropEvent = null;
		}
		const processEvent = ({ state, from, to, rule, pasteEvt }) => {
			const tr = state.tr;
			const chainableState = createChainableState({
				state,
				transaction: tr
			});
			if (!run2({
				editor,
				state: chainableState,
				from: Math.max(from - 1, 0),
				to: to.b - 1,
				rule,
				pasteEvent: pasteEvt,
				dropEvent
			}) || !tr.steps.length) return;
			try {
				dropEvent = typeof DragEvent !== "undefined" ? new DragEvent("drop") : null;
			} catch {
				dropEvent = null;
			}
			pasteEvent = typeof ClipboardEvent !== "undefined" ? new ClipboardEvent("paste") : null;
			return tr;
		};
		return rules.map((rule) => {
			return new Plugin({
				view(view) {
					const handleDragstart = (event) => {
						var _a;
						dragSourceElement = ((_a = view.dom.parentElement) == null ? void 0 : _a.contains(event.target)) ? view.dom.parentElement : null;
						if (dragSourceElement) tiptapDragFromOtherEditor = editor;
					};
					const handleDragend = () => {
						if (tiptapDragFromOtherEditor) tiptapDragFromOtherEditor = null;
					};
					window.addEventListener("dragstart", handleDragstart);
					window.addEventListener("dragend", handleDragend);
					return { destroy() {
						window.removeEventListener("dragstart", handleDragstart);
						window.removeEventListener("dragend", handleDragend);
					} };
				},
				props: { handleDOMEvents: {
					drop: (view, event) => {
						isDroppedFromProseMirror = dragSourceElement === view.dom.parentElement;
						dropEvent = event;
						if (!isDroppedFromProseMirror) {
							const dragFromOtherEditor = tiptapDragFromOtherEditor;
							if (dragFromOtherEditor == null ? void 0 : dragFromOtherEditor.isEditable) setTimeout(() => {
								const selection = dragFromOtherEditor.state.selection;
								if (selection) dragFromOtherEditor.commands.deleteRange({
									from: selection.from,
									to: selection.to
								});
							}, 10);
						}
						return false;
					},
					paste: (_view, event) => {
						var _a;
						const html = (_a = event.clipboardData) == null ? void 0 : _a.getData("text/html");
						pasteEvent = event;
						isPastedFromProseMirror = !!(html == null ? void 0 : html.includes("data-pm-slice"));
						return false;
					}
				} },
				appendTransaction: (transactions, oldState, state) => {
					const transaction = transactions[0];
					const isPaste = transaction.getMeta("uiEvent") === "paste" && !isPastedFromProseMirror;
					const isDrop = transaction.getMeta("uiEvent") === "drop" && !isDroppedFromProseMirror;
					const simulatedPasteMeta = transaction.getMeta("applyPasteRules");
					const isSimulatedPaste = !!simulatedPasteMeta;
					if (!isPaste && !isDrop && !isSimulatedPaste) return;
					if (isSimulatedPaste) {
						let { text } = simulatedPasteMeta;
						if (typeof text === "string") text = text;
						else text = getHTMLFromFragment(Fragment$1.from(text), state.schema);
						const { from: from2 } = simulatedPasteMeta;
						const to2 = from2 + text.length;
						const pasteEvt = createClipboardPasteEvent(text);
						return processEvent({
							rule,
							state,
							from: from2,
							to: { b: to2 },
							pasteEvt
						});
					}
					const from = oldState.doc.content.findDiffStart(state.doc.content);
					const to = oldState.doc.content.findDiffEnd(state.doc.content);
					if (!isNumber(from) || !to || from === to.b) return;
					return processEvent({
						rule,
						state,
						from,
						to,
						pasteEvt: pasteEvent
					});
				}
			});
		});
	}
	var ExtensionManager = class {
		constructor(extensions, editor) {
			this.splittableMarks = [];
			this.editor = editor;
			this.baseExtensions = extensions;
			this.extensions = resolveExtensions(extensions);
			this.schema = getSchemaByResolvedExtensions(this.extensions, editor);
			this.setupExtensions();
		}
		/**
		* Get all commands from the extensions.
		* @returns An object with all commands where the key is the command name and the value is the command function
		*/
		get commands() {
			return this.extensions.reduce((commands, extension) => {
				const addCommands = getExtensionField(extension, "addCommands", {
					name: extension.name,
					options: extension.options,
					storage: this.editor.extensionStorage[extension.name],
					editor: this.editor,
					type: getSchemaTypeByName(extension.name, this.schema)
				});
				if (!addCommands) return commands;
				return {
					...commands,
					...addCommands()
				};
			}, {});
		}
		/**
		* Get all registered Prosemirror plugins from the extensions.
		* @returns An array of Prosemirror plugins
		*/
		get plugins() {
			const { editor } = this;
			return sortExtensions([...this.extensions].reverse()).flatMap((extension) => {
				const context = {
					name: extension.name,
					options: extension.options,
					storage: this.editor.extensionStorage[extension.name],
					editor,
					type: getSchemaTypeByName(extension.name, this.schema)
				};
				const plugins = [];
				const addKeyboardShortcuts = getExtensionField(extension, "addKeyboardShortcuts", context);
				let defaultBindings = {};
				if (extension.type === "mark" && getExtensionField(extension, "exitable", context)) defaultBindings.ArrowRight = () => Mark.handleExit({
					editor,
					mark: extension
				});
				if (addKeyboardShortcuts) {
					const bindings = Object.fromEntries(Object.entries(addKeyboardShortcuts()).map(([shortcut, method]) => {
						return [shortcut, () => method({ editor })];
					}));
					defaultBindings = {
						...defaultBindings,
						...bindings
					};
				}
				const keyMapPlugin = keymap(defaultBindings);
				plugins.push(keyMapPlugin);
				const addInputRules = getExtensionField(extension, "addInputRules", context);
				if (isExtensionRulesEnabled(extension, editor.options.enableInputRules) && addInputRules) {
					const rules = addInputRules();
					if (rules && rules.length) {
						const inputResult = inputRulesPlugin({
							editor,
							rules
						});
						const inputPlugins = Array.isArray(inputResult) ? inputResult : [inputResult];
						plugins.push(...inputPlugins);
					}
				}
				const addPasteRules = getExtensionField(extension, "addPasteRules", context);
				if (isExtensionRulesEnabled(extension, editor.options.enablePasteRules) && addPasteRules) {
					const rules = addPasteRules();
					if (rules && rules.length) {
						const pasteRules = pasteRulesPlugin({
							editor,
							rules
						});
						plugins.push(...pasteRules);
					}
				}
				const addProseMirrorPlugins = getExtensionField(extension, "addProseMirrorPlugins", context);
				if (addProseMirrorPlugins) {
					const proseMirrorPlugins = addProseMirrorPlugins();
					plugins.push(...proseMirrorPlugins);
				}
				return plugins;
			});
		}
		/**
		* Get all attributes from the extensions.
		* @returns An array of attributes
		*/
		get attributes() {
			return getAttributesFromExtensions(this.extensions);
		}
		/**
		* Get all node views from the extensions.
		* @returns An object with all node views where the key is the node name and the value is the node view function
		*/
		get nodeViews() {
			const { editor } = this;
			const { nodeExtensions } = splitExtensions(this.extensions);
			return Object.fromEntries(nodeExtensions.filter((extension) => !!getExtensionField(extension, "addNodeView")).map((extension) => {
				const extensionAttributes = this.attributes.filter((attribute) => attribute.type === extension.name);
				const addNodeView = getExtensionField(extension, "addNodeView", {
					name: extension.name,
					options: extension.options,
					storage: this.editor.extensionStorage[extension.name],
					editor,
					type: getNodeType(extension.name, this.schema)
				});
				if (!addNodeView) return [];
				const nodeViewResult = addNodeView();
				if (!nodeViewResult) return [];
				const nodeview = (node, view, getPos, decorations, innerDecorations) => {
					const HTMLAttributes = getRenderedAttributes(node, extensionAttributes);
					return nodeViewResult({
						node,
						view,
						getPos,
						decorations,
						innerDecorations,
						editor,
						extension,
						HTMLAttributes
					});
				};
				return [extension.name, nodeview];
			}));
		}
		/**
		* Get the composed dispatchTransaction function from all extensions.
		* @param baseDispatch The base dispatch function (e.g. from the editor or user props)
		* @returns A composed dispatch function
		*/
		dispatchTransaction(baseDispatch) {
			const { editor } = this;
			return sortExtensions([...this.extensions].reverse()).reduceRight((next, extension) => {
				const context = {
					name: extension.name,
					options: extension.options,
					storage: this.editor.extensionStorage[extension.name],
					editor,
					type: getSchemaTypeByName(extension.name, this.schema)
				};
				const dispatchTransaction = getExtensionField(extension, "dispatchTransaction", context);
				if (!dispatchTransaction) return next;
				return (transaction) => {
					dispatchTransaction.call(context, {
						transaction,
						next
					});
				};
			}, baseDispatch);
		}
		/**
		* Get the composed transformPastedHTML function from all extensions.
		* @param baseTransform The base transform function (e.g. from the editor props)
		* @returns A composed transform function that chains all extension transforms
		*/
		transformPastedHTML(baseTransform) {
			const { editor } = this;
			return sortExtensions([...this.extensions]).reduce((transform, extension) => {
				const context = {
					name: extension.name,
					options: extension.options,
					storage: this.editor.extensionStorage[extension.name],
					editor,
					type: getSchemaTypeByName(extension.name, this.schema)
				};
				const extensionTransform = getExtensionField(extension, "transformPastedHTML", context);
				if (!extensionTransform) return transform;
				return (html, view) => {
					const transformedHtml = transform(html, view);
					return extensionTransform.call(context, transformedHtml);
				};
			}, baseTransform || ((html) => html));
		}
		get markViews() {
			const { editor } = this;
			const { markExtensions } = splitExtensions(this.extensions);
			return Object.fromEntries(markExtensions.filter((extension) => !!getExtensionField(extension, "addMarkView")).map((extension) => {
				const extensionAttributes = this.attributes.filter((attribute) => attribute.type === extension.name);
				const addMarkView = getExtensionField(extension, "addMarkView", {
					name: extension.name,
					options: extension.options,
					storage: this.editor.extensionStorage[extension.name],
					editor,
					type: getMarkType(extension.name, this.schema)
				});
				if (!addMarkView) return [];
				const markView = (mark, view, inline) => {
					const HTMLAttributes = getRenderedAttributes(mark, extensionAttributes);
					return addMarkView()({
						mark,
						view,
						inline,
						editor,
						extension,
						HTMLAttributes,
						updateAttributes: (attrs) => {
							updateMarkViewAttributes(mark, editor, attrs);
						}
					});
				};
				return [extension.name, markView];
			}));
		}
		/**
		* Go through all extensions, create extension storages & setup marks
		* & bind editor event listener.
		*/
		setupExtensions() {
			const extensions = this.extensions;
			this.editor.extensionStorage = Object.fromEntries(extensions.map((extension) => [extension.name, extension.storage]));
			extensions.forEach((extension) => {
				var _a;
				const context = {
					name: extension.name,
					options: extension.options,
					storage: this.editor.extensionStorage[extension.name],
					editor: this.editor,
					type: getSchemaTypeByName(extension.name, this.schema)
				};
				if (extension.type === "mark") {
					if ((_a = callOrReturn(getExtensionField(extension, "keepOnSplit", context))) != null ? _a : true) this.splittableMarks.push(extension.name);
				}
				const onBeforeCreate = getExtensionField(extension, "onBeforeCreate", context);
				const onCreate = getExtensionField(extension, "onCreate", context);
				const onUpdate = getExtensionField(extension, "onUpdate", context);
				const onSelectionUpdate = getExtensionField(extension, "onSelectionUpdate", context);
				const onTransaction = getExtensionField(extension, "onTransaction", context);
				const onFocus = getExtensionField(extension, "onFocus", context);
				const onBlur = getExtensionField(extension, "onBlur", context);
				const onDestroy = getExtensionField(extension, "onDestroy", context);
				if (onBeforeCreate) this.editor.on("beforeCreate", onBeforeCreate);
				if (onCreate) this.editor.on("create", onCreate);
				if (onUpdate) this.editor.on("update", onUpdate);
				if (onSelectionUpdate) this.editor.on("selectionUpdate", onSelectionUpdate);
				if (onTransaction) this.editor.on("transaction", onTransaction);
				if (onFocus) this.editor.on("focus", onFocus);
				if (onBlur) this.editor.on("blur", onBlur);
				if (onDestroy) this.editor.on("destroy", onDestroy);
			});
		}
	};
	ExtensionManager.resolve = resolveExtensions;
	ExtensionManager.sort = sortExtensions;
	ExtensionManager.flatten = flattenExtensions;
	var extensions_exports = {};
	__export(extensions_exports, {
		ClipboardTextSerializer: () => ClipboardTextSerializer,
		Commands: () => Commands,
		Delete: () => Delete,
		Drop: () => Drop,
		Editable: () => Editable,
		FocusEvents: () => FocusEvents,
		Keymap: () => Keymap,
		Paste: () => Paste,
		Tabindex: () => Tabindex,
		TextDirection: () => TextDirection,
		focusEventsPluginKey: () => focusEventsPluginKey
	});
	var Extension = class _Extension extends Extendable {
		constructor() {
			super(...arguments);
			this.type = "extension";
		}
		/**
		* Create a new Extension instance
		* @param config - Extension configuration object or a function that returns a configuration object
		*/
		static create(config = {}) {
			const resolvedConfig = typeof config === "function" ? config() : config;
			return new _Extension(resolvedConfig);
		}
		configure(options) {
			return super.configure(options);
		}
		extend(extendedConfig) {
			const resolvedConfig = typeof extendedConfig === "function" ? extendedConfig() : extendedConfig;
			return super.extend(resolvedConfig);
		}
	};
	var ClipboardTextSerializer = Extension.create({
		name: "clipboardTextSerializer",
		addOptions() {
			return { blockSeparator: void 0 };
		},
		addProseMirrorPlugins() {
			return [new Plugin({
				key: new PluginKey("clipboardTextSerializer"),
				props: { clipboardTextSerializer: () => {
					const { editor } = this;
					const { state, schema } = editor;
					const { doc, selection } = state;
					const { ranges } = selection;
					const from = Math.min(...ranges.map((range2) => range2.$from.pos));
					const to = Math.max(...ranges.map((range2) => range2.$to.pos));
					const textSerializers = getTextSerializersFromSchema(schema);
					return getTextBetween(doc, {
						from,
						to
					}, {
						...this.options.blockSeparator !== void 0 ? { blockSeparator: this.options.blockSeparator } : {},
						textSerializers
					});
				} }
			})];
		}
	});
	var Commands = Extension.create({
		name: "commands",
		addCommands() {
			return { ...commands_exports };
		}
	});
	var Delete = Extension.create({
		name: "delete",
		onUpdate({ transaction, appendedTransactions }) {
			var _a;
			var _b;
			var _c;
			const callback = () => {
				var _a2;
				var _b2;
				var _c2;
				var _d;
				if ((_d = (_c2 = (_b2 = (_a2 = this.editor.options.coreExtensionOptions) == null ? void 0 : _a2.delete) == null ? void 0 : _b2.filterTransaction) == null ? void 0 : _c2.call(_b2, transaction)) != null ? _d : transaction.getMeta("y-sync$")) return;
				const nextTransaction = combineTransactionSteps(transaction.before, [transaction, ...appendedTransactions]);
				getChangedRanges(nextTransaction).forEach((change) => {
					if (nextTransaction.mapping.mapResult(change.oldRange.from).deletedAfter && nextTransaction.mapping.mapResult(change.oldRange.to).deletedBefore) nextTransaction.before.nodesBetween(change.oldRange.from, change.oldRange.to, (node, from) => {
						const to = from + node.nodeSize - 2;
						const isFullyWithinRange = change.oldRange.from <= from && to <= change.oldRange.to;
						this.editor.emit("delete", {
							type: "node",
							node,
							from,
							to,
							newFrom: nextTransaction.mapping.map(from),
							newTo: nextTransaction.mapping.map(to),
							deletedRange: change.oldRange,
							newRange: change.newRange,
							partial: !isFullyWithinRange,
							editor: this.editor,
							transaction,
							combinedTransform: nextTransaction
						});
					});
				});
				const mapping = nextTransaction.mapping;
				nextTransaction.steps.forEach((step, index) => {
					var _a3;
					var _b3;
					if (step instanceof RemoveMarkStep) {
						const newStart = mapping.slice(index).map(step.from, -1);
						const newEnd = mapping.slice(index).map(step.to);
						const oldStart = mapping.invert().map(newStart, -1);
						const oldEnd = mapping.invert().map(newEnd);
						const foundBeforeMark = (_a3 = nextTransaction.doc.nodeAt(newStart - 1)) == null ? void 0 : _a3.marks.some((mark) => mark.eq(step.mark));
						const foundAfterMark = (_b3 = nextTransaction.doc.nodeAt(newEnd)) == null ? void 0 : _b3.marks.some((mark) => mark.eq(step.mark));
						this.editor.emit("delete", {
							type: "mark",
							mark: step.mark,
							from: step.from,
							to: step.to,
							deletedRange: {
								from: oldStart,
								to: oldEnd
							},
							newRange: {
								from: newStart,
								to: newEnd
							},
							partial: Boolean(foundAfterMark || foundBeforeMark),
							editor: this.editor,
							transaction,
							combinedTransform: nextTransaction
						});
					}
				});
			};
			if ((_c = (_b = (_a = this.editor.options.coreExtensionOptions) == null ? void 0 : _a.delete) == null ? void 0 : _b.async) != null ? _c : true) setTimeout(callback, 0);
			else callback();
		}
	});
	var Drop = Extension.create({
		name: "drop",
		addProseMirrorPlugins() {
			return [new Plugin({
				key: new PluginKey("tiptapDrop"),
				props: { handleDrop: (_, e, slice, moved) => {
					this.editor.emit("drop", {
						editor: this.editor,
						event: e,
						slice,
						moved
					});
				} }
			})];
		}
	});
	var Editable = Extension.create({
		name: "editable",
		addProseMirrorPlugins() {
			return [new Plugin({
				key: new PluginKey("editable"),
				props: { editable: () => this.editor.options.editable }
			})];
		}
	});
	var focusEventsPluginKey = new PluginKey("focusEvents");
	var FocusEvents = Extension.create({
		name: "focusEvents",
		addProseMirrorPlugins() {
			const { editor } = this;
			return [new Plugin({
				key: focusEventsPluginKey,
				props: { handleDOMEvents: {
					focus: (view, event) => {
						editor.isFocused = true;
						const transaction = editor.state.tr.setMeta("focus", { event }).setMeta("addToHistory", false);
						view.dispatch(transaction);
						return false;
					},
					blur: (view, event) => {
						editor.isFocused = false;
						const transaction = editor.state.tr.setMeta("blur", { event }).setMeta("addToHistory", false);
						view.dispatch(transaction);
						return false;
					}
				} }
			})];
		}
	});
	var Keymap = Extension.create({
		name: "keymap",
		addKeyboardShortcuts() {
			const handleBackspace = () => this.editor.commands.first(({ commands }) => [
				() => commands.undoInputRule(),
				() => commands.command(({ tr }) => {
					const { selection, doc } = tr;
					const { empty, $anchor } = selection;
					const { pos, parent } = $anchor;
					const $parentPos = $anchor.parent.isTextblock && pos > 0 ? tr.doc.resolve(pos - 1) : $anchor;
					const parentIsIsolating = $parentPos.parent.type.spec.isolating;
					const parentPos = $anchor.pos - $anchor.parentOffset;
					const isAtStart = parentIsIsolating && $parentPos.parent.childCount === 1 ? parentPos === $anchor.pos : Selection.atStart(doc).from === pos;
					if (!empty || !parent.type.isTextblock || parent.textContent.length || !isAtStart || isAtStart && $anchor.parent.type.name === "paragraph") return false;
					return commands.clearNodes();
				}),
				() => commands.deleteSelection(),
				() => commands.joinBackward(),
				() => commands.selectNodeBackward()
			]);
			const handleDelete = () => this.editor.commands.first(({ commands }) => [
				() => commands.deleteSelection(),
				() => commands.deleteCurrentNode(),
				() => commands.joinForward(),
				() => commands.selectNodeForward()
			]);
			const handleEnter = () => this.editor.commands.first(({ commands }) => [
				() => commands.newlineInCode(),
				() => commands.createParagraphNear(),
				() => commands.liftEmptyBlock(),
				() => commands.splitBlock()
			]);
			const baseKeymap = {
				Enter: handleEnter,
				"Mod-Enter": () => this.editor.commands.exitCode(),
				Backspace: handleBackspace,
				"Mod-Backspace": handleBackspace,
				"Shift-Backspace": handleBackspace,
				Delete: handleDelete,
				"Mod-Delete": handleDelete,
				"Mod-a": () => this.editor.commands.selectAll()
			};
			const pcKeymap = { ...baseKeymap };
			const macKeymap = {
				...baseKeymap,
				"Ctrl-h": handleBackspace,
				"Alt-Backspace": handleBackspace,
				"Ctrl-d": handleDelete,
				"Ctrl-Alt-Backspace": handleDelete,
				"Alt-Delete": handleDelete,
				"Alt-d": handleDelete,
				"Ctrl-a": () => this.editor.commands.selectTextblockStart(),
				"Ctrl-e": () => this.editor.commands.selectTextblockEnd()
			};
			if (isiOS() || isMacOS()) return macKeymap;
			return pcKeymap;
		},
		addProseMirrorPlugins() {
			return [new Plugin({
				key: new PluginKey("clearDocument"),
				appendTransaction: (transactions, oldState, newState) => {
					if (transactions.some((tr2) => tr2.getMeta("composition"))) return;
					const docChanges = transactions.some((transaction) => transaction.docChanged) && !oldState.doc.eq(newState.doc);
					const ignoreTr = transactions.some((transaction) => transaction.getMeta("preventClearDocument"));
					if (!docChanges || ignoreTr) return;
					const { empty, from, to } = oldState.selection;
					const allFrom = Selection.atStart(oldState.doc).from;
					const allEnd = Selection.atEnd(oldState.doc).to;
					if (empty || !(from === allFrom && to === allEnd)) return;
					if (!isNodeEmpty(newState.doc)) return;
					const tr = newState.tr;
					const state = createChainableState({
						state: newState,
						transaction: tr
					});
					const { commands } = new CommandManager({
						editor: this.editor,
						state
					});
					commands.clearNodes();
					if (!tr.steps.length) return;
					return tr;
				}
			})];
		}
	});
	var Paste = Extension.create({
		name: "paste",
		addProseMirrorPlugins() {
			return [new Plugin({
				key: new PluginKey("tiptapPaste"),
				props: { handlePaste: (_view, e, slice) => {
					this.editor.emit("paste", {
						editor: this.editor,
						event: e,
						slice
					});
				} }
			})];
		}
	});
	var Tabindex = Extension.create({
		name: "tabindex",
		addProseMirrorPlugins() {
			return [new Plugin({
				key: new PluginKey("tabindex"),
				props: { attributes: () => this.editor.isEditable ? { tabindex: "0" } : {} }
			})];
		}
	});
	var TextDirection = Extension.create({
		name: "textDirection",
		addOptions() {
			return { direction: void 0 };
		},
		addGlobalAttributes() {
			if (!this.options.direction) return [];
			const { nodeExtensions } = splitExtensions(this.extensions);
			return [{
				types: nodeExtensions.filter((extension) => extension.name !== "text").map((extension) => extension.name),
				attributes: { dir: {
					default: this.options.direction,
					parseHTML: (element) => {
						const dir = element.getAttribute("dir");
						if (dir && (dir === "ltr" || dir === "rtl" || dir === "auto")) return dir;
						return this.options.direction;
					},
					renderHTML: (attributes) => {
						if (!attributes.dir) return {};
						return { dir: attributes.dir };
					}
				} }
			}];
		},
		addProseMirrorPlugins() {
			return [new Plugin({
				key: new PluginKey("textDirection"),
				props: { attributes: () => {
					const direction = this.options.direction;
					if (!direction) return {};
					return { dir: direction };
				} }
			})];
		}
	});
	var NodePos = class _NodePos {
		constructor(pos, editor, isBlock = false, node = null) {
			this.currentNode = null;
			this.actualDepth = null;
			this.isBlock = isBlock;
			this.resolvedPos = pos;
			this.editor = editor;
			this.currentNode = node;
		}
		get name() {
			return this.node.type.name;
		}
		get node() {
			return this.currentNode || this.resolvedPos.node();
		}
		get element() {
			return this.editor.view.domAtPos(this.pos).node;
		}
		get depth() {
			var _a;
			return (_a = this.actualDepth) != null ? _a : this.resolvedPos.depth;
		}
		get pos() {
			return this.resolvedPos.pos;
		}
		get content() {
			return this.node.content;
		}
		set content(content) {
			let from = this.from;
			let to = this.to;
			if (this.isBlock) {
				if (this.content.size === 0) {
					console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);
					return;
				}
				from = this.from + 1;
				to = this.to - 1;
			}
			this.editor.commands.insertContentAt({
				from,
				to
			}, content);
		}
		get attributes() {
			return this.node.attrs;
		}
		get textContent() {
			return this.node.textContent;
		}
		get size() {
			return this.node.nodeSize;
		}
		get from() {
			if (this.isBlock) return this.pos;
			return this.resolvedPos.start(this.resolvedPos.depth);
		}
		get range() {
			return {
				from: this.from,
				to: this.to
			};
		}
		get to() {
			if (this.isBlock) return this.pos + this.size;
			return this.resolvedPos.end(this.resolvedPos.depth) + (this.node.isText ? 0 : 1);
		}
		get parent() {
			if (this.depth === 0) return null;
			const parentPos = this.resolvedPos.start(this.resolvedPos.depth - 1);
			const $pos = this.resolvedPos.doc.resolve(parentPos);
			return new _NodePos($pos, this.editor);
		}
		get before() {
			let $pos = this.resolvedPos.doc.resolve(this.from - (this.isBlock ? 1 : 2));
			if ($pos.depth !== this.depth) $pos = this.resolvedPos.doc.resolve(this.from - 3);
			return new _NodePos($pos, this.editor);
		}
		get after() {
			let $pos = this.resolvedPos.doc.resolve(this.to + (this.isBlock ? 2 : 1));
			if ($pos.depth !== this.depth) $pos = this.resolvedPos.doc.resolve(this.to + 3);
			return new _NodePos($pos, this.editor);
		}
		get children() {
			const children = [];
			this.node.content.forEach((node, offset) => {
				const isBlock = node.isBlock && !node.isTextblock;
				const isNonTextAtom = node.isAtom && !node.isText;
				const isInline = node.isInline;
				const targetPos = this.pos + offset + (isNonTextAtom ? 0 : 1);
				if (targetPos < 0 || targetPos > this.resolvedPos.doc.nodeSize - 2) return;
				const $pos = this.resolvedPos.doc.resolve(targetPos);
				if (!isBlock && !isInline && $pos.depth <= this.depth) return;
				const childNodePos = new _NodePos($pos, this.editor, isBlock, isBlock || isInline ? node : null);
				if (isBlock) childNodePos.actualDepth = this.depth + 1;
				children.push(childNodePos);
			});
			return children;
		}
		get firstChild() {
			return this.children[0] || null;
		}
		get lastChild() {
			const children = this.children;
			return children[children.length - 1] || null;
		}
		closest(selector, attributes = {}) {
			let node = null;
			let currentNode = this.parent;
			while (currentNode && !node) {
				if (currentNode.node.type.name === selector) if (Object.keys(attributes).length > 0) {
					const nodeAttributes = currentNode.node.attrs;
					const attrKeys = Object.keys(attributes);
					for (let index = 0; index < attrKeys.length; index += 1) {
						const key = attrKeys[index];
						if (nodeAttributes[key] !== attributes[key]) break;
					}
				} else node = currentNode;
				currentNode = currentNode.parent;
			}
			return node;
		}
		querySelector(selector, attributes = {}) {
			return this.querySelectorAll(selector, attributes, true)[0] || null;
		}
		querySelectorAll(selector, attributes = {}, firstItemOnly = false) {
			let nodes = [];
			if (!this.children || this.children.length === 0) return nodes;
			const attrKeys = Object.keys(attributes);
			this.children.forEach((childPos) => {
				if (firstItemOnly && nodes.length > 0) return;
				if (childPos.node.type.name === selector) {
					if (attrKeys.every((key) => attributes[key] === childPos.node.attrs[key])) nodes.push(childPos);
				}
				if (firstItemOnly && nodes.length > 0) return;
				nodes = nodes.concat(childPos.querySelectorAll(selector, attributes, firstItemOnly));
			});
			return nodes;
		}
		setAttribute(attributes) {
			const { tr } = this.editor.state;
			tr.setNodeMarkup(this.from, void 0, {
				...this.node.attrs,
				...attributes
			});
			this.editor.view.dispatch(tr);
		}
	};
	var style = `.ProseMirror {
  position: relative;
}

.ProseMirror {
  word-wrap: break-word;
  white-space: pre-wrap;
  white-space: break-spaces;
  -webkit-font-variant-ligatures: none;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
}

.ProseMirror [contenteditable="false"] {
  white-space: normal;
}

.ProseMirror [contenteditable="false"] [contenteditable="true"] {
  white-space: pre-wrap;
}

.ProseMirror pre {
  white-space: pre-wrap;
}

img.ProseMirror-separator {
  display: inline !important;
  border: none !important;
  margin: 0 !important;
  width: 0 !important;
  height: 0 !important;
}

.ProseMirror-gapcursor {
  display: none;
  pointer-events: none;
  position: absolute;
  margin: 0;
}

.ProseMirror-gapcursor:after {
  content: "";
  display: block;
  position: absolute;
  top: -2px;
  width: 20px;
  border-top: 1px solid black;
  animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
}

@keyframes ProseMirror-cursor-blink {
  to {
    visibility: hidden;
  }
}

.ProseMirror-hideselection *::selection {
  background: transparent;
}

.ProseMirror-hideselection *::-moz-selection {
  background: transparent;
}

.ProseMirror-hideselection * {
  caret-color: transparent;
}

.ProseMirror-focused .ProseMirror-gapcursor {
  display: block;
}`;
	function createStyleTag(style2, nonce, suffix) {
		const tiptapStyleTag = document.querySelector(`style[data-tiptap-style${suffix ? `-${suffix}` : ""}]`);
		if (tiptapStyleTag !== null) return tiptapStyleTag;
		const styleNode = document.createElement("style");
		if (nonce) styleNode.setAttribute("nonce", nonce);
		styleNode.setAttribute(`data-tiptap-style${suffix ? `-${suffix}` : ""}`, "");
		styleNode.innerHTML = style2;
		document.getElementsByTagName("head")[0].appendChild(styleNode);
		return styleNode;
	}
	var Editor = class extends EventEmitter {
		constructor(options = {}) {
			super();
			this.css = null;
			this.className = "tiptap";
			this.editorView = null;
			this.isFocused = false;
			/**
			* The editor is considered initialized after the `create` event has been emitted.
			*/
			this.isInitialized = false;
			this.extensionStorage = {};
			/**
			* A unique ID for this editor instance.
			*/
			this.instanceId = Math.random().toString(36).slice(2, 9);
			this.options = {
				element: typeof document !== "undefined" ? document.createElement("div") : null,
				content: "",
				injectCSS: true,
				injectNonce: void 0,
				extensions: [],
				autofocus: false,
				editable: true,
				textDirection: void 0,
				editorProps: {},
				parseOptions: {},
				coreExtensionOptions: {},
				enableInputRules: true,
				enablePasteRules: true,
				enableCoreExtensions: true,
				enableContentCheck: false,
				emitContentError: false,
				onBeforeCreate: () => null,
				onCreate: () => null,
				onMount: () => null,
				onUnmount: () => null,
				onUpdate: () => null,
				onSelectionUpdate: () => null,
				onTransaction: () => null,
				onFocus: () => null,
				onBlur: () => null,
				onDestroy: () => null,
				onContentError: ({ error }) => {
					throw error;
				},
				onPaste: () => null,
				onDrop: () => null,
				onDelete: () => null,
				enableExtensionDispatchTransaction: true
			};
			this.isCapturingTransaction = false;
			this.capturedTransaction = null;
			/**
			* Returns a set of utilities for working with positions and ranges.
			*/
			this.utils = {
				getUpdatedPosition,
				createMappablePosition
			};
			this.setOptions(options);
			this.createExtensionManager();
			this.createCommandManager();
			this.createSchema();
			this.on("beforeCreate", this.options.onBeforeCreate);
			this.emit("beforeCreate", { editor: this });
			this.on("mount", this.options.onMount);
			this.on("unmount", this.options.onUnmount);
			this.on("contentError", this.options.onContentError);
			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);
			this.on("drop", ({ event, slice, moved }) => this.options.onDrop(event, slice, moved));
			this.on("paste", ({ event, slice }) => this.options.onPaste(event, slice));
			this.on("delete", this.options.onDelete);
			const initialDoc = this.createDoc();
			const selection = resolveFocusPosition(initialDoc, this.options.autofocus);
			this.editorState = EditorState.create({
				doc: initialDoc,
				schema: this.schema,
				selection: selection || void 0
			});
			if (this.options.element) this.mount(this.options.element);
		}
		/**
		* Attach the editor to the DOM, creating a new editor view.
		*/
		mount(el) {
			if (typeof document === "undefined") throw new Error(`[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.`);
			this.createView(el);
			this.emit("mount", { editor: this });
			if (this.css && !document.head.contains(this.css)) document.head.appendChild(this.css);
			window.setTimeout(() => {
				if (this.isDestroyed) return;
				if (this.options.autofocus !== false && this.options.autofocus !== null) this.commands.focus(this.options.autofocus);
				this.emit("create", { editor: this });
				this.isInitialized = true;
			}, 0);
		}
		/**
		* Remove the editor from the DOM, but still allow remounting at a different point in time
		*/
		unmount() {
			if (this.editorView) {
				const dom = this.editorView.dom;
				if (dom == null ? void 0 : dom.editor) delete dom.editor;
				this.editorView.destroy();
			}
			this.editorView = null;
			this.isInitialized = false;
			if (this.css && !document.querySelectorAll(`.${this.className}`).length) try {
				if (typeof this.css.remove === "function") this.css.remove();
				else if (this.css.parentNode) this.css.parentNode.removeChild(this.css);
			} catch (error) {
				console.warn("Failed to remove CSS element:", error);
			}
			this.css = null;
			this.emit("unmount", { editor: this });
		}
		/**
		* Returns the editor storage.
		*/
		get storage() {
			return this.extensionStorage;
		}
		/**
		* An object of all registered commands.
		*/
		get commands() {
			return this.commandManager.commands;
		}
		/**
		* Create a command chain to call multiple commands at once.
		*/
		chain() {
			return this.commandManager.chain();
		}
		/**
		* Check if a command or a command chain can be executed. Without executing it.
		*/
		can() {
			return this.commandManager.can();
		}
		/**
		* Inject CSS styles.
		*/
		injectCSS() {
			if (this.options.injectCSS && typeof document !== "undefined") this.css = createStyleTag(style, this.options.injectNonce);
		}
		/**
		* Update editor options.
		*
		* @param options A list of options
		*/
		setOptions(options = {}) {
			this.options = {
				...this.options,
				...options
			};
			if (!this.editorView || !this.state || this.isDestroyed) return;
			if (this.options.editorProps) this.view.setProps(this.options.editorProps);
			this.view.updateState(this.state);
		}
		/**
		* Update editable state of the editor.
		*/
		setEditable(editable, emitUpdate = true) {
			this.setOptions({ editable });
			if (emitUpdate) this.emit("update", {
				editor: this,
				transaction: this.state.tr,
				appendedTransactions: []
			});
		}
		/**
		* Returns whether the editor is editable.
		*/
		get isEditable() {
			return this.options.editable && this.view && this.view.editable;
		}
		/**
		* Returns the editor view.
		*/
		get view() {
			if (this.editorView) return this.editorView;
			return new Proxy({
				state: this.editorState,
				updateState: (state) => {
					this.editorState = state;
				},
				dispatch: (tr) => {
					this.dispatchTransaction(tr);
				},
				composing: false,
				dragging: null,
				editable: true,
				isDestroyed: false
			}, { get: (obj, key) => {
				if (this.editorView) return this.editorView[key];
				if (key === "state") return this.editorState;
				if (key in obj) return Reflect.get(obj, key);
				throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${key}']. The editor may not be mounted yet.`);
			} });
		}
		/**
		* Returns the editor state.
		*/
		get state() {
			if (this.editorView) this.editorState = this.view.state;
			return this.editorState;
		}
		/**
		* Register a ProseMirror plugin.
		*
		* @param plugin A ProseMirror plugin
		* @param handlePlugins Control how to merge the plugin into the existing plugins.
		* @returns The new editor state
		*/
		registerPlugin(plugin, handlePlugins) {
			const plugins = isFunction(handlePlugins) ? handlePlugins(plugin, [...this.state.plugins]) : [...this.state.plugins, plugin];
			const state = this.state.reconfigure({ plugins });
			this.view.updateState(state);
			return state;
		}
		/**
		* Unregister a ProseMirror plugin.
		*
		* @param nameOrPluginKeyToRemove The plugins name
		* @returns The new editor state or undefined if the editor is destroyed
		*/
		unregisterPlugin(nameOrPluginKeyToRemove) {
			if (this.isDestroyed) return;
			const prevPlugins = this.state.plugins;
			let plugins = prevPlugins;
			[].concat(nameOrPluginKeyToRemove).forEach((nameOrPluginKey) => {
				const name = typeof nameOrPluginKey === "string" ? `${nameOrPluginKey}$` : nameOrPluginKey.key;
				plugins = plugins.filter((plugin) => !plugin.key.startsWith(name));
			});
			if (prevPlugins.length === plugins.length) return;
			const state = this.state.reconfigure({ plugins });
			this.view.updateState(state);
			return state;
		}
		/**
		* Creates an extension manager.
		*/
		createExtensionManager() {
			var _a;
			var _b;
			const allExtensions = [...this.options.enableCoreExtensions ? [
				Editable,
				ClipboardTextSerializer.configure({ blockSeparator: (_b = (_a = this.options.coreExtensionOptions) == null ? void 0 : _a.clipboardTextSerializer) == null ? void 0 : _b.blockSeparator }),
				Commands,
				FocusEvents,
				Keymap,
				Tabindex,
				Drop,
				Paste,
				Delete,
				TextDirection.configure({ direction: this.options.textDirection })
			].filter((ext) => {
				if (typeof this.options.enableCoreExtensions === "object") return this.options.enableCoreExtensions[ext.name] !== false;
				return true;
			}) : [], ...this.options.extensions].filter((extension) => {
				return [
					"extension",
					"node",
					"mark"
				].includes(extension == null ? void 0 : extension.type);
			});
			this.extensionManager = new ExtensionManager(allExtensions, this);
		}
		/**
		* Creates an command manager.
		*/
		createCommandManager() {
			this.commandManager = new CommandManager({ editor: this });
		}
		/**
		* Creates a ProseMirror schema.
		*/
		createSchema() {
			this.schema = this.extensionManager.schema;
		}
		/**
		* Creates the initial document.
		*/
		createDoc() {
			let doc;
			try {
				doc = createDocument(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: this.options.enableContentCheck });
			} catch (e) {
				if (!(e instanceof Error) || !["[tiptap error]: Invalid JSON content", "[tiptap error]: Invalid HTML content"].includes(e.message)) throw e;
				this.emit("contentError", {
					editor: this,
					error: e,
					disableCollaboration: () => {
						if ("collaboration" in this.storage && typeof this.storage.collaboration === "object" && this.storage.collaboration) this.storage.collaboration.isDisabled = true;
						this.options.extensions = this.options.extensions.filter((extension) => extension.name !== "collaboration");
						this.createExtensionManager();
					}
				});
				doc = createDocument(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: false });
			}
			return doc;
		}
		/**
		* Creates a ProseMirror view.
		*/
		createView(element) {
			const { editorProps, enableExtensionDispatchTransaction } = this.options;
			const baseDispatch = editorProps.dispatchTransaction || this.dispatchTransaction.bind(this);
			const dispatch = enableExtensionDispatchTransaction ? this.extensionManager.dispatchTransaction(baseDispatch) : baseDispatch;
			const baseTransformPastedHTML = editorProps.transformPastedHTML;
			const transformPastedHTML = this.extensionManager.transformPastedHTML(baseTransformPastedHTML);
			this.editorView = new EditorView(element, {
				...editorProps,
				attributes: {
					role: "textbox",
					...editorProps == null ? void 0 : editorProps.attributes
				},
				dispatchTransaction: dispatch,
				transformPastedHTML,
				state: this.editorState,
				markViews: this.extensionManager.markViews,
				nodeViews: this.extensionManager.nodeViews
			});
			const newState = this.state.reconfigure({ plugins: this.extensionManager.plugins });
			this.view.updateState(newState);
			this.prependClass();
			this.injectCSS();
			const dom = this.view.dom;
			dom.editor = this;
		}
		/**
		* Creates all node and mark views.
		*/
		createNodeViews() {
			if (this.view.isDestroyed) return;
			this.view.setProps({
				markViews: this.extensionManager.markViews,
				nodeViews: this.extensionManager.nodeViews
			});
		}
		/**
		* Prepend class name to element.
		*/
		prependClass() {
			this.view.dom.className = `${this.className} ${this.view.dom.className}`;
		}
		captureTransaction(fn) {
			this.isCapturingTransaction = true;
			fn();
			this.isCapturingTransaction = false;
			const tr = this.capturedTransaction;
			this.capturedTransaction = null;
			return tr;
		}
		/**
		* The callback over which to send transactions (state updates) produced by the view.
		*
		* @param transaction An editor state transaction
		*/
		dispatchTransaction(transaction) {
			if (this.view.isDestroyed) return;
			if (this.isCapturingTransaction) {
				if (!this.capturedTransaction) {
					this.capturedTransaction = transaction;
					return;
				}
				transaction.steps.forEach((step) => {
					var _a;
					return (_a = this.capturedTransaction) == null ? void 0 : _a.step(step);
				});
				return;
			}
			const { state, transactions } = this.state.applyTransaction(transaction);
			const selectionHasChanged = !this.state.selection.eq(state.selection);
			const rootTrWasApplied = transactions.includes(transaction);
			const prevState = this.state;
			this.emit("beforeTransaction", {
				editor: this,
				transaction,
				nextState: state
			});
			if (!rootTrWasApplied) return;
			this.view.updateState(state);
			this.emit("transaction", {
				editor: this,
				transaction,
				appendedTransactions: transactions.slice(1)
			});
			if (selectionHasChanged) this.emit("selectionUpdate", {
				editor: this,
				transaction
			});
			const mostRecentFocusTr = transactions.findLast((tr) => tr.getMeta("focus") || tr.getMeta("blur"));
			const focus2 = mostRecentFocusTr == null ? void 0 : mostRecentFocusTr.getMeta("focus");
			const blur2 = mostRecentFocusTr == null ? void 0 : mostRecentFocusTr.getMeta("blur");
			if (focus2) this.emit("focus", {
				editor: this,
				event: focus2.event,
				transaction: mostRecentFocusTr
			});
			if (blur2) this.emit("blur", {
				editor: this,
				event: blur2.event,
				transaction: mostRecentFocusTr
			});
			if (transaction.getMeta("preventUpdate") || !transactions.some((tr) => tr.docChanged) || prevState.doc.eq(state.doc)) return;
			this.emit("update", {
				editor: this,
				transaction,
				appendedTransactions: transactions.slice(1)
			});
		}
		/**
		* Get attributes of the currently selected node or mark.
		*/
		getAttributes(nameOrType) {
			return getAttributes(this.state, nameOrType);
		}
		isActive(nameOrAttributes, attributesOrUndefined) {
			const name = typeof nameOrAttributes === "string" ? nameOrAttributes : null;
			const attributes = typeof nameOrAttributes === "string" ? attributesOrUndefined : nameOrAttributes;
			return isActive(this.state, name, attributes);
		}
		/**
		* Get the document as JSON.
		*/
		getJSON() {
			return this.state.doc.toJSON();
		}
		/**
		* Get the document as HTML.
		*/
		getHTML() {
			return getHTMLFromFragment(this.state.doc.content, this.schema);
		}
		/**
		* Get the document as text.
		*/
		getText(options) {
			const { blockSeparator = "\n\n", textSerializers = {} } = options || {};
			return getText(this.state.doc, {
				blockSeparator,
				textSerializers: {
					...getTextSerializersFromSchema(this.schema),
					...textSerializers
				}
			});
		}
		/**
		* Check if there is no content.
		*/
		get isEmpty() {
			return isNodeEmpty(this.state.doc);
		}
		/**
		* Destroy the editor.
		*/
		destroy() {
			this.emit("destroy");
			this.unmount();
			this.removeAllListeners();
		}
		/**
		* Check if the editor is already destroyed.
		*/
		get isDestroyed() {
			var _a;
			var _b;
			return (_b = (_a = this.editorView) == null ? void 0 : _a.isDestroyed) != null ? _b : true;
		}
		$node(selector, attributes) {
			var _a;
			return ((_a = this.$doc) == null ? void 0 : _a.querySelector(selector, attributes)) || null;
		}
		$nodes(selector, attributes) {
			var _a;
			return ((_a = this.$doc) == null ? void 0 : _a.querySelectorAll(selector, attributes)) || null;
		}
		$pos(pos) {
			return new NodePos(this.state.doc.resolve(pos), this);
		}
		get $doc() {
			return this.$pos(0);
		}
	};
	function markInputRule(config) {
		return new InputRule({
			find: config.find,
			handler: ({ state, range, match }) => {
				const attributes = callOrReturn(config.getAttributes, void 0, match);
				if (attributes === false || attributes === null) return null;
				const { tr } = state;
				const captureGroup = match[match.length - 1];
				const fullMatch = match[0];
				if (captureGroup) {
					const startSpaces = fullMatch.search(/\S/);
					const textStart = range.from + fullMatch.indexOf(captureGroup);
					const textEnd = textStart + captureGroup.length;
					if (getMarksBetween(range.from, range.to, state.doc).filter((item) => {
						return item.mark.type.excluded.find((type) => type === config.type && type !== item.mark.type);
					}).filter((item) => item.to > textStart).length) return null;
					if (textEnd < range.to) tr.delete(textEnd, range.to);
					if (textStart > range.from) tr.delete(range.from + startSpaces, textStart);
					const markEnd = range.from + startSpaces + captureGroup.length;
					tr.addMark(range.from + startSpaces, markEnd, config.type.create(attributes || {}));
					tr.removeStoredMark(config.type);
				}
			},
			undoable: config.undoable
		});
	}
	function textblockTypeInputRule(config) {
		return new InputRule({
			find: config.find,
			handler: ({ state, range, match }) => {
				const $start = state.doc.resolve(range.from);
				const attributes = callOrReturn(config.getAttributes, void 0, match) || {};
				if (!$start.node(-1).canReplaceWith($start.index(-1), $start.indexAfter(-1), config.type)) return null;
				state.tr.delete(range.from, range.to).setBlockType(range.from, range.from, config.type, attributes);
			},
			undoable: config.undoable
		});
	}
	var markdown_exports = {};
	__export(markdown_exports, {
		createAtomBlockMarkdownSpec: () => createAtomBlockMarkdownSpec,
		createBlockMarkdownSpec: () => createBlockMarkdownSpec,
		createInlineMarkdownSpec: () => createInlineMarkdownSpec,
		parseAttributes: () => parseAttributes,
		parseIndentedBlocks: () => parseIndentedBlocks,
		renderNestedMarkdownContent: () => renderNestedMarkdownContent,
		serializeAttributes: () => serializeAttributes
	});
	function parseAttributes(attrString) {
		if (!(attrString == null ? void 0 : attrString.trim())) return {};
		const attributes = {};
		const quotedStrings = [];
		const tempString = attrString.replace(/["']([^"']*)["']/g, (match) => {
			quotedStrings.push(match);
			return `__QUOTED_${quotedStrings.length - 1}__`;
		});
		const classMatches = tempString.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);
		if (classMatches) attributes.class = classMatches.map((match) => match.trim().slice(1)).join(" ");
		const idMatch = tempString.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);
		if (idMatch) attributes.id = idMatch[1];
		Array.from(tempString.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach(([, key, quotedRef]) => {
			var _a;
			const quotedIndex = parseInt(((_a = quotedRef.match(/__QUOTED_(\d+)__/)) == null ? void 0 : _a[1]) || "0", 10);
			const quotedValue = quotedStrings[quotedIndex];
			if (quotedValue) attributes[key] = quotedValue.slice(1, -1);
		});
		const cleanString = tempString.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g, "").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g, "").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g, "").trim();
		if (cleanString) cleanString.split(/\s+/).filter(Boolean).forEach((attr) => {
			if (attr.match(/^[a-zA-Z][\w-]*$/)) attributes[attr] = true;
		});
		return attributes;
	}
	function serializeAttributes(attributes) {
		if (!attributes || Object.keys(attributes).length === 0) return "";
		const parts = [];
		if (attributes.class) String(attributes.class).split(/\s+/).filter(Boolean).forEach((cls) => parts.push(`.${cls}`));
		if (attributes.id) parts.push(`#${attributes.id}`);
		Object.entries(attributes).forEach(([key, value]) => {
			if (key === "class" || key === "id") return;
			if (value === true) parts.push(key);
			else if (value !== false && value != null) parts.push(`${key}="${String(value)}"`);
		});
		return parts.join(" ");
	}
	function createAtomBlockMarkdownSpec(options) {
		const { nodeName, name: markdownName, parseAttributes: parseAttributes2 = parseAttributes, serializeAttributes: serializeAttributes2 = serializeAttributes, defaultAttributes = {}, requiredAttributes = [], allowedAttributes } = options;
		const blockName = markdownName || nodeName;
		const filterAttributes = (attrs) => {
			if (!allowedAttributes) return attrs;
			const filtered = {};
			allowedAttributes.forEach((key) => {
				if (key in attrs) filtered[key] = attrs[key];
			});
			return filtered;
		};
		return {
			parseMarkdown: (token, h2) => {
				const attrs = {
					...defaultAttributes,
					...token.attributes
				};
				return h2.createNode(nodeName, attrs, []);
			},
			markdownTokenizer: {
				name: nodeName,
				level: "block",
				start(src) {
					var _a;
					const regex = new RegExp(`^:::${blockName}(?:\\s|$)`, "m");
					const index = (_a = src.match(regex)) == null ? void 0 : _a.index;
					return index !== void 0 ? index : -1;
				},
				tokenize(src, _tokens, _lexer) {
					const regex = new RegExp(`^:::${blockName}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`);
					const match = src.match(regex);
					if (!match) return;
					const attrString = match[1] || "";
					const attributes = parseAttributes2(attrString);
					if (requiredAttributes.find((required) => !(required in attributes))) return;
					return {
						type: nodeName,
						raw: match[0],
						attributes
					};
				}
			},
			renderMarkdown: (node) => {
				const filteredAttrs = filterAttributes(node.attrs || {});
				const attrs = serializeAttributes2(filteredAttrs);
				const attrString = attrs ? ` {${attrs}}` : "";
				return `:::${blockName}${attrString} :::`;
			}
		};
	}
	function createBlockMarkdownSpec(options) {
		const { nodeName, name: markdownName, getContent, parseAttributes: parseAttributes2 = parseAttributes, serializeAttributes: serializeAttributes2 = serializeAttributes, defaultAttributes = {}, content = "block", allowedAttributes } = options;
		const blockName = markdownName || nodeName;
		const filterAttributes = (attrs) => {
			if (!allowedAttributes) return attrs;
			const filtered = {};
			allowedAttributes.forEach((key) => {
				if (key in attrs) filtered[key] = attrs[key];
			});
			return filtered;
		};
		return {
			parseMarkdown: (token, h2) => {
				let nodeContent;
				if (getContent) {
					const contentResult = getContent(token);
					nodeContent = typeof contentResult === "string" ? [{
						type: "text",
						text: contentResult
					}] : contentResult;
				} else if (content === "block") nodeContent = h2.parseChildren(token.tokens || []);
				else nodeContent = h2.parseInline(token.tokens || []);
				const attrs = {
					...defaultAttributes,
					...token.attributes
				};
				return h2.createNode(nodeName, attrs, nodeContent);
			},
			markdownTokenizer: {
				name: nodeName,
				level: "block",
				start(src) {
					var _a;
					const regex = new RegExp(`^:::${blockName}`, "m");
					const index = (_a = src.match(regex)) == null ? void 0 : _a.index;
					return index !== void 0 ? index : -1;
				},
				tokenize(src, _tokens, lexer) {
					var _a;
					const openingRegex = new RegExp(`^:::${blockName}(?:\\s+\\{([^}]*)\\})?\\s*\\n`);
					const openingMatch = src.match(openingRegex);
					if (!openingMatch) return;
					const [openingTag, attrString = ""] = openingMatch;
					const attributes = parseAttributes2(attrString);
					let level = 1;
					const position = openingTag.length;
					let matchedContent = "";
					const blockPattern = /^:::([\w-]*)(\s.*)?/gm;
					const remaining = src.slice(position);
					blockPattern.lastIndex = 0;
					for (;;) {
						const match = blockPattern.exec(remaining);
						if (match === null) break;
						const matchPos = match.index;
						const blockType = match[1];
						if ((_a = match[2]) == null ? void 0 : _a.endsWith(":::")) continue;
						if (blockType) level += 1;
						else {
							level -= 1;
							if (level === 0) {
								const rawContent = remaining.slice(0, matchPos);
								matchedContent = rawContent.trim();
								const fullMatch = src.slice(0, position + matchPos + match[0].length);
								let contentTokens = [];
								if (matchedContent) if (content === "block") {
									contentTokens = lexer.blockTokens(rawContent);
									contentTokens.forEach((token) => {
										if (token.text && (!token.tokens || token.tokens.length === 0)) token.tokens = lexer.inlineTokens(token.text);
									});
									while (contentTokens.length > 0) {
										const lastToken = contentTokens[contentTokens.length - 1];
										if (lastToken.type === "paragraph" && (!lastToken.text || lastToken.text.trim() === "")) contentTokens.pop();
										else break;
									}
								} else contentTokens = lexer.inlineTokens(matchedContent);
								return {
									type: nodeName,
									raw: fullMatch,
									attributes,
									content: matchedContent,
									tokens: contentTokens
								};
							}
						}
					}
				}
			},
			renderMarkdown: (node, h2) => {
				const filteredAttrs = filterAttributes(node.attrs || {});
				const attrs = serializeAttributes2(filteredAttrs);
				const attrString = attrs ? ` {${attrs}}` : "";
				const renderedContent = h2.renderChildren(node.content || [], "\n\n");
				return `:::${blockName}${attrString}

${renderedContent}

:::`;
			}
		};
	}
	function parseShortcodeAttributes(attrString) {
		if (!attrString.trim()) return {};
		const attributes = {};
		const regex = /(\w+)=(?:"([^"]*)"|'([^']*)')/g;
		let match = regex.exec(attrString);
		while (match !== null) {
			const [, key, doubleQuoted, singleQuoted] = match;
			attributes[key] = doubleQuoted || singleQuoted;
			match = regex.exec(attrString);
		}
		return attributes;
	}
	function serializeShortcodeAttributes(attrs) {
		return Object.entries(attrs).filter(([, value]) => value !== void 0 && value !== null).map(([key, value]) => `${key}="${value}"`).join(" ");
	}
	function createInlineMarkdownSpec(options) {
		const { nodeName, name: shortcodeName, getContent, parseAttributes: parseAttributes2 = parseShortcodeAttributes, serializeAttributes: serializeAttributes2 = serializeShortcodeAttributes, defaultAttributes = {}, selfClosing = false, allowedAttributes } = options;
		const shortcode = shortcodeName || nodeName;
		const filterAttributes = (attrs) => {
			if (!allowedAttributes) return attrs;
			const filtered = {};
			allowedAttributes.forEach((attr) => {
				const attrName = typeof attr === "string" ? attr : attr.name;
				const skipIfDefault = typeof attr === "string" ? void 0 : attr.skipIfDefault;
				if (attrName in attrs) {
					const value = attrs[attrName];
					if (skipIfDefault !== void 0 && value === skipIfDefault) return;
					filtered[attrName] = value;
				}
			});
			return filtered;
		};
		const escapedShortcode = shortcode.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
		return {
			parseMarkdown: (token, h2) => {
				const attrs = {
					...defaultAttributes,
					...token.attributes
				};
				if (selfClosing) return h2.createNode(nodeName, attrs);
				const content = getContent ? getContent(token) : token.content || "";
				if (content) return h2.createNode(nodeName, attrs, [h2.createTextNode(content)]);
				return h2.createNode(nodeName, attrs, []);
			},
			markdownTokenizer: {
				name: nodeName,
				level: "inline",
				start(src) {
					const startPattern = selfClosing ? new RegExp(`\\[${escapedShortcode}\\s*[^\\]]*\\]`) : new RegExp(`\\[${escapedShortcode}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${escapedShortcode}\\]`);
					const match = src.match(startPattern);
					const index = match == null ? void 0 : match.index;
					return index !== void 0 ? index : -1;
				},
				tokenize(src, _tokens, _lexer) {
					const tokenPattern = selfClosing ? new RegExp(`^\\[${escapedShortcode}\\s*([^\\]]*)\\]`) : new RegExp(`^\\[${escapedShortcode}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${escapedShortcode}\\]`);
					const match = src.match(tokenPattern);
					if (!match) return;
					let content = "";
					let attrString = "";
					if (selfClosing) {
						const [, attrs] = match;
						attrString = attrs;
					} else {
						const [, attrs, contentMatch] = match;
						attrString = attrs;
						content = contentMatch || "";
					}
					const attributes = parseAttributes2(attrString.trim());
					return {
						type: nodeName,
						raw: match[0],
						content: content.trim(),
						attributes
					};
				}
			},
			renderMarkdown: (node) => {
				let content = "";
				if (getContent) content = getContent(node);
				else if (node.content && node.content.length > 0) content = node.content.filter((child) => child.type === "text").map((child) => child.text).join("");
				const filteredAttrs = filterAttributes(node.attrs || {});
				const attrs = serializeAttributes2(filteredAttrs);
				const attrString = attrs ? ` ${attrs}` : "";
				if (selfClosing) return `[${shortcode}${attrString}]`;
				return `[${shortcode}${attrString}]${content}[/${shortcode}]`;
			}
		};
	}
	function parseIndentedBlocks(src, config, lexer) {
		var _a;
		var _b;
		var _c;
		var _d;
		const lines = src.split("\n");
		const items = [];
		let totalRaw = "";
		let i = 0;
		const baseIndentSize = config.baseIndentSize || 2;
		while (i < lines.length) {
			const currentLine = lines[i];
			const itemMatch = currentLine.match(config.itemPattern);
			if (!itemMatch) if (items.length > 0) break;
			else if (currentLine.trim() === "") {
				i += 1;
				totalRaw = `${totalRaw}${currentLine}
`;
				continue;
			} else return;
			const itemData = config.extractItemData(itemMatch);
			const { indentLevel, mainContent } = itemData;
			totalRaw = `${totalRaw}${currentLine}
`;
			const itemContent = [mainContent];
			i += 1;
			while (i < lines.length) {
				const nextLine = lines[i];
				if (nextLine.trim() === "") {
					const nextNonEmptyIndex = lines.slice(i + 1).findIndex((l) => l.trim() !== "");
					if (nextNonEmptyIndex === -1) break;
					if ((((_b = (_a = lines[i + 1 + nextNonEmptyIndex].match(/^(\s*)/)) == null ? void 0 : _a[1]) == null ? void 0 : _b.length) || 0) > indentLevel) {
						itemContent.push(nextLine);
						totalRaw = `${totalRaw}${nextLine}
`;
						i += 1;
						continue;
					} else break;
				}
				if ((((_d = (_c = nextLine.match(/^(\s*)/)) == null ? void 0 : _c[1]) == null ? void 0 : _d.length) || 0) > indentLevel) {
					itemContent.push(nextLine);
					totalRaw = `${totalRaw}${nextLine}
`;
					i += 1;
				} else break;
			}
			let nestedTokens;
			const nestedContent = itemContent.slice(1);
			if (nestedContent.length > 0) {
				const dedentedNested = nestedContent.map((nestedLine) => nestedLine.slice(indentLevel + baseIndentSize)).join("\n");
				if (dedentedNested.trim()) if (config.customNestedParser) nestedTokens = config.customNestedParser(dedentedNested);
				else nestedTokens = lexer.blockTokens(dedentedNested);
			}
			const token = config.createToken(itemData, nestedTokens);
			items.push(token);
		}
		if (items.length === 0) return;
		return {
			items,
			raw: totalRaw
		};
	}
	function renderNestedMarkdownContent(node, h2, prefixOrGenerator, ctx) {
		if (!node || !Array.isArray(node.content)) return "";
		const prefix = typeof prefixOrGenerator === "function" ? prefixOrGenerator(ctx) : prefixOrGenerator;
		const [content, ...children] = node.content;
		const output = [`${prefix}${h2.renderChildren([content])}`];
		if (children && children.length > 0) children.forEach((child) => {
			const childContent = h2.renderChildren([child]);
			if (childContent) {
				const indentedChild = childContent.split("\n").map((line) => line ? h2.indent(line) : "").join("\n");
				output.push(indentedChild);
			}
		});
		return output.join("\n");
	}
	function updateMarkViewAttributes(checkMark, editor, attrs = {}) {
		const { state } = editor;
		const { doc, tr } = state;
		const thisMark = checkMark;
		doc.descendants((node, pos) => {
			const from = tr.mapping.map(pos);
			const to = tr.mapping.map(pos) + node.nodeSize;
			let foundMark = null;
			node.marks.forEach((mark) => {
				if (mark !== thisMark) return false;
				foundMark = mark;
			});
			if (!foundMark) return;
			let needsUpdate = false;
			Object.keys(attrs).forEach((k) => {
				if (attrs[k] !== foundMark.attrs[k]) needsUpdate = true;
			});
			if (needsUpdate) {
				const updatedMark = checkMark.type.create({
					...checkMark.attrs,
					...attrs
				});
				tr.removeMark(from, to, checkMark.type);
				tr.addMark(from, to, updatedMark);
			}
		});
		if (tr.docChanged) editor.view.dispatch(tr);
	}
	var Node3 = class _Node extends Extendable {
		constructor() {
			super(...arguments);
			this.type = "node";
		}
		/**
		* Create a new Node instance
		* @param config - Node configuration object or a function that returns a configuration object
		*/
		static create(config = {}) {
			const resolvedConfig = typeof config === "function" ? config() : config;
			return new _Node(resolvedConfig);
		}
		configure(options) {
			return super.configure(options);
		}
		extend(extendedConfig) {
			const resolvedConfig = typeof extendedConfig === "function" ? extendedConfig() : extendedConfig;
			return super.extend(resolvedConfig);
		}
	};
	function markPasteRule(config) {
		return new PasteRule({
			find: config.find,
			handler: ({ state, range, match, pasteEvent }) => {
				const attributes = callOrReturn(config.getAttributes, void 0, match, pasteEvent);
				if (attributes === false || attributes === null) return null;
				const { tr } = state;
				const captureGroup = match[match.length - 1];
				const fullMatch = match[0];
				let markEnd = range.to;
				if (captureGroup) {
					const startSpaces = fullMatch.search(/\S/);
					const textStart = range.from + fullMatch.indexOf(captureGroup);
					const textEnd = textStart + captureGroup.length;
					if (getMarksBetween(range.from, range.to, state.doc).filter((item) => {
						return item.mark.type.excluded.find((type) => type === config.type && type !== item.mark.type);
					}).filter((item) => item.to > textStart).length) return null;
					if (textEnd < range.to) tr.delete(textEnd, range.to);
					if (textStart > range.from) tr.delete(range.from + startSpaces, textStart);
					markEnd = range.from + startSpaces + captureGroup.length;
					tr.addMark(range.from + startSpaces, markEnd, config.type.create(attributes || {}));
					tr.removeStoredMark(config.type);
				}
			}
		});
	}

//#endregion
//#region node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js
	var h = (tag, attributes) => {
		if (tag === "slot") return 0;
		if (tag instanceof Function) return tag(attributes);
		const { children, ...rest } = attributes != null ? attributes : {};
		if (tag === "svg") throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");
		return [
			tag,
			rest,
			children
		];
	};

//#endregion
//#region node_modules/@tiptap/extension-bold/dist/index.js
	var starInputRegex$1 = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/;
	var starPasteRegex$1 = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g;
	var underscoreInputRegex$1 = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/;
	var underscorePasteRegex$1 = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g;
	var Bold = Mark.create({
		name: "bold",
		addOptions() {
			return { HTMLAttributes: {} };
		},
		parseHTML() {
			return [
				{ tag: "strong" },
				{
					tag: "b",
					getAttrs: (node) => node.style.fontWeight !== "normal" && null
				},
				{
					style: "font-weight=400",
					clearMark: (mark) => mark.type.name === this.name
				},
				{
					style: "font-weight",
					getAttrs: (value) => /^(bold(er)?|[5-9]\d{2,})$/.test(value) && null
				}
			];
		},
		renderHTML({ HTMLAttributes }) {
			return /* @__PURE__ */ h("strong", {
				...mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),
				children: /* @__PURE__ */ h("slot", {})
			});
		},
		markdownTokenName: "strong",
		parseMarkdown: (token, helpers) => {
			return helpers.applyMark("bold", helpers.parseInline(token.tokens || []));
		},
		renderMarkdown: (node, h) => {
			return `**${h.renderChildren(node)}**`;
		},
		addCommands() {
			return {
				setBold: () => ({ commands }) => {
					return commands.setMark(this.name);
				},
				toggleBold: () => ({ commands }) => {
					return commands.toggleMark(this.name);
				},
				unsetBold: () => ({ commands }) => {
					return commands.unsetMark(this.name);
				}
			};
		},
		addKeyboardShortcuts() {
			return {
				"Mod-b": () => this.editor.commands.toggleBold(),
				"Mod-B": () => this.editor.commands.toggleBold()
			};
		},
		addInputRules() {
			return [markInputRule({
				find: starInputRegex$1,
				type: this.type
			}), markInputRule({
				find: underscoreInputRegex$1,
				type: this.type
			})];
		},
		addPasteRules() {
			return [markPasteRule({
				find: starPasteRegex$1,
				type: this.type
			}), markPasteRule({
				find: underscorePasteRegex$1,
				type: this.type
			})];
		}
	});
	var index_default$11 = Bold;

//#endregion
//#region node_modules/@tiptap/extension-document/dist/index.js
	var Document$1 = Node3.create({
		name: "doc",
		topNode: true,
		content: "block+",
		renderMarkdown: (node, h) => {
			if (!node.content) return "";
			return h.renderChildren(node.content, "\n\n");
		}
	});
	var index_default$10 = Document$1;

//#endregion
//#region node_modules/@tiptap/extension-hard-break/dist/index.js
	var HardBreak = Node3.create({
		name: "hardBreak",
		markdownTokenName: "br",
		addOptions() {
			return {
				keepMarks: true,
				HTMLAttributes: {}
			};
		},
		inline: true,
		group: "inline",
		selectable: false,
		linebreakReplacement: true,
		parseHTML() {
			return [{ tag: "br" }];
		},
		renderHTML({ HTMLAttributes }) {
			return ["br", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)];
		},
		renderText() {
			return "\n";
		},
		renderMarkdown: () => `  
`,
		parseMarkdown: () => {
			return { type: "hardBreak" };
		},
		addCommands() {
			return { setHardBreak: () => ({ commands, chain, state, editor }) => {
				return commands.first([() => commands.exitCode(), () => commands.command(() => {
					const { selection, storedMarks } = state;
					if (selection.$from.parent.type.spec.isolating) return false;
					const { keepMarks } = this.options;
					const { splittableMarks } = editor.extensionManager;
					const marks = storedMarks || selection.$to.parentOffset && selection.$from.marks();
					return chain().insertContent({ type: this.name }).command(({ tr, dispatch }) => {
						if (dispatch && marks && keepMarks) {
							const filteredMarks = marks.filter((mark) => splittableMarks.includes(mark.type.name));
							tr.ensureMarks(filteredMarks);
						}
						return true;
					}).run();
				})]);
			} };
		},
		addKeyboardShortcuts() {
			return {
				"Mod-Enter": () => this.editor.commands.setHardBreak(),
				"Shift-Enter": () => this.editor.commands.setHardBreak()
			};
		}
	});
	var index_default$9 = HardBreak;

//#endregion
//#region node_modules/@tiptap/extension-heading/dist/index.js
	var Heading = Node3.create({
		name: "heading",
		addOptions() {
			return {
				levels: [
					1,
					2,
					3,
					4,
					5,
					6
				],
				HTMLAttributes: {}
			};
		},
		content: "inline*",
		group: "block",
		defining: true,
		addAttributes() {
			return { level: {
				default: 1,
				rendered: false
			} };
		},
		parseHTML() {
			return this.options.levels.map((level) => ({
				tag: `h${level}`,
				attrs: { level }
			}));
		},
		renderHTML({ node, HTMLAttributes }) {
			return [
				`h${this.options.levels.includes(node.attrs.level) ? node.attrs.level : this.options.levels[0]}`,
				mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),
				0
			];
		},
		parseMarkdown: (token, helpers) => {
			return helpers.createNode("heading", { level: token.depth || 1 }, helpers.parseInline(token.tokens || []));
		},
		renderMarkdown: (node, h) => {
			var _a;
			const level = ((_a = node.attrs) == null ? void 0 : _a.level) ? parseInt(node.attrs.level, 10) : 1;
			const headingChars = "#".repeat(level);
			if (!node.content) return "";
			return `${headingChars} ${h.renderChildren(node.content)}`;
		},
		addCommands() {
			return {
				setHeading: (attributes) => ({ commands }) => {
					if (!this.options.levels.includes(attributes.level)) return false;
					return commands.setNode(this.name, attributes);
				},
				toggleHeading: (attributes) => ({ commands }) => {
					if (!this.options.levels.includes(attributes.level)) return false;
					return commands.toggleNode(this.name, "paragraph", attributes);
				}
			};
		},
		addKeyboardShortcuts() {
			return this.options.levels.reduce((items, level) => ({
				...items,
				[`Mod-Alt-${level}`]: () => this.editor.commands.toggleHeading({ level })
			}), {});
		},
		addInputRules() {
			return this.options.levels.map((level) => {
				return textblockTypeInputRule({
					find: new RegExp(`^(#{${Math.min(...this.options.levels)},${level}})\\s$`),
					type: this.type,
					getAttributes: { level }
				});
			});
		}
	});
	var index_default$8 = Heading;

//#endregion
//#region node_modules/@tiptap/extension-italic/dist/index.js
	var starInputRegex = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/;
	var starPasteRegex = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g;
	var underscoreInputRegex = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/;
	var underscorePasteRegex = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g;
	var Italic = Mark.create({
		name: "italic",
		addOptions() {
			return { HTMLAttributes: {} };
		},
		parseHTML() {
			return [
				{ tag: "em" },
				{
					tag: "i",
					getAttrs: (node) => node.style.fontStyle !== "normal" && null
				},
				{
					style: "font-style=normal",
					clearMark: (mark) => mark.type.name === this.name
				},
				{ style: "font-style=italic" }
			];
		},
		renderHTML({ HTMLAttributes }) {
			return [
				"em",
				mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),
				0
			];
		},
		addCommands() {
			return {
				setItalic: () => ({ commands }) => {
					return commands.setMark(this.name);
				},
				toggleItalic: () => ({ commands }) => {
					return commands.toggleMark(this.name);
				},
				unsetItalic: () => ({ commands }) => {
					return commands.unsetMark(this.name);
				}
			};
		},
		markdownTokenName: "em",
		parseMarkdown: (token, helpers) => {
			return helpers.applyMark("italic", helpers.parseInline(token.tokens || []));
		},
		renderMarkdown: (node, h) => {
			return `*${h.renderChildren(node)}*`;
		},
		addKeyboardShortcuts() {
			return {
				"Mod-i": () => this.editor.commands.toggleItalic(),
				"Mod-I": () => this.editor.commands.toggleItalic()
			};
		},
		addInputRules() {
			return [markInputRule({
				find: starInputRegex,
				type: this.type
			}), markInputRule({
				find: underscoreInputRegex,
				type: this.type
			})];
		},
		addPasteRules() {
			return [markPasteRule({
				find: starPasteRegex,
				type: this.type
			}), markPasteRule({
				find: underscorePasteRegex,
				type: this.type
			})];
		}
	});
	var index_default$7 = Italic;

//#endregion
//#region node_modules/linkifyjs/dist/linkify.mjs
	var encodedTlds = "aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2";
	var encodedUtlds = "ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2";
	/**
	* Finite State Machine generation utilities
	*/
	/**
	* @template T
	* @typedef {{ [group: string]: T[] }} Collections
	*/
	/**
	* @typedef {{ [group: string]: true }} Flags
	*/
	var numeric = "numeric";
	var ascii = "ascii";
	var alpha = "alpha";
	var asciinumeric = "asciinumeric";
	var alphanumeric = "alphanumeric";
	var domain = "domain";
	var emoji = "emoji";
	var scheme = "scheme";
	var slashscheme = "slashscheme";
	var whitespace = "whitespace";
	/**
	* @template T
	* @param {string} name
	* @param {Collections<T>} groups to register in
	* @returns {T[]} Current list of tokens in the given collection
	*/
	function registerGroup(name, groups) {
		if (!(name in groups)) groups[name] = [];
		return groups[name];
	}
	/**
	* @template T
	* @param {T} t token to add
	* @param {Collections<T>} groups
	* @param {Flags} flags
	*/
	function addToGroups(t, flags, groups) {
		if (flags[numeric]) {
			flags[asciinumeric] = true;
			flags[alphanumeric] = true;
		}
		if (flags[ascii]) {
			flags[asciinumeric] = true;
			flags[alpha] = true;
		}
		if (flags[asciinumeric]) flags[alphanumeric] = true;
		if (flags[alpha]) flags[alphanumeric] = true;
		if (flags[alphanumeric]) flags[domain] = true;
		if (flags[emoji]) flags[domain] = true;
		for (const k in flags) {
			const group = registerGroup(k, groups);
			if (group.indexOf(t) < 0) group.push(t);
		}
	}
	/**
	* @template T
	* @param {T} t token to check
	* @param {Collections<T>} groups
	* @returns {Flags} group flags that contain this token
	*/
	function flagsForToken(t, groups) {
		const result = {};
		for (const c in groups) if (groups[c].indexOf(t) >= 0) result[c] = true;
		return result;
	}
	/**
	* @template T
	* @typedef {null | T } Transition
	*/
	/**
	* Define a basic state machine state. j is the list of character transitions,
	* jr is the list of regex-match transitions, jd is the default state to
	* transition to t is the accepting token type, if any. If this is the terminal
	* state, then it does not emit a token.
	*
	* The template type T represents the type of the token this state accepts. This
	* should be a string (such as of the token exports in `text.js`) or a
	* MultiToken subclass (from `multi.js`)
	*
	* @template T
	* @param {T} [token] Token that this state emits
	*/
	function State(token = null) {
		/** @type {{ [input: string]: State<T> }} j */
		this.j = {};
		/** @type {[RegExp, State<T>][]} jr */
		this.jr = [];
		/** @type {?State<T>} jd */
		this.jd = null;
		/** @type {?T} t */
		this.t = token;
	}
	/**
	* Scanner token groups
	* @type Collections<string>
	*/
	State.groups = {};
	State.prototype = {
		accepts() {
			return !!this.t;
		},
		/**
		* Follow an existing transition from the given input to the next state.
		* Does not mutate.
		* @param {string} input character or token type to transition on
		* @returns {?State<T>} the next state, if any
		*/
		go(input) {
			const state = this;
			const nextState = state.j[input];
			if (nextState) return nextState;
			for (let i = 0; i < state.jr.length; i++) {
				const regex = state.jr[i][0];
				const nextState = state.jr[i][1];
				if (nextState && regex.test(input)) return nextState;
			}
			return state.jd;
		},
		/**
		* Whether the state has a transition for the given input. Set the second
		* argument to true to only look for an exact match (and not a default or
		* regular-expression-based transition)
		* @param {string} input
		* @param {boolean} exactOnly
		*/
		has(input, exactOnly = false) {
			return exactOnly ? input in this.j : !!this.go(input);
		},
		/**
		* Short for "transition all"; create a transition from the array of items
		* in the given list to the same final resulting state.
		* @param {string | string[]} inputs Group of inputs to transition on
		* @param {Transition<T> | State<T>} [next] Transition options
		* @param {Flags} [flags] Collections flags to add token to
		* @param {Collections<T>} [groups] Master list of token groups
		*/
		ta(inputs, next, flags, groups) {
			for (let i = 0; i < inputs.length; i++) this.tt(inputs[i], next, flags, groups);
		},
		/**
		* Short for "take regexp transition"; defines a transition for this state
		* when it encounters a token which matches the given regular expression
		* @param {RegExp} regexp Regular expression transition (populate first)
		* @param {T | State<T>} [next] Transition options
		* @param {Flags} [flags] Collections flags to add token to
		* @param {Collections<T>} [groups] Master list of token groups
		* @returns {State<T>} taken after the given input
		*/
		tr(regexp, next, flags, groups) {
			groups = groups || State.groups;
			let nextState;
			if (next && next.j) nextState = next;
			else {
				nextState = new State(next);
				if (flags && groups) addToGroups(next, flags, groups);
			}
			this.jr.push([regexp, nextState]);
			return nextState;
		},
		/**
		* Short for "take transitions", will take as many sequential transitions as
		* the length of the given input and returns the
		* resulting final state.
		* @param {string | string[]} input
		* @param {T | State<T>} [next] Transition options
		* @param {Flags} [flags] Collections flags to add token to
		* @param {Collections<T>} [groups] Master list of token groups
		* @returns {State<T>} taken after the given input
		*/
		ts(input, next, flags, groups) {
			let state = this;
			const len = input.length;
			if (!len) return state;
			for (let i = 0; i < len - 1; i++) state = state.tt(input[i]);
			return state.tt(input[len - 1], next, flags, groups);
		},
		/**
		* Short for "take transition", this is a method for building/working with
		* state machines.
		*
		* If a state already exists for the given input, returns it.
		*
		* If a token is specified, that state will emit that token when reached by
		* the linkify engine.
		*
		* If no state exists, it will be initialized with some default transitions
		* that resemble existing default transitions.
		*
		* If a state is given for the second argument, that state will be
		* transitioned to on the given input regardless of what that input
		* previously did.
		*
		* Specify a token group flags to define groups that this token belongs to.
		* The token will be added to corresponding entires in the given groups
		* object.
		*
		* @param {string} input character, token type to transition on
		* @param {T | State<T>} [next] Transition options
		* @param {Flags} [flags] Collections flags to add token to
		* @param {Collections<T>} [groups] Master list of groups
		* @returns {State<T>} taken after the given input
		*/
		tt(input, next, flags, groups) {
			groups = groups || State.groups;
			const state = this;
			if (next && next.j) {
				state.j[input] = next;
				return next;
			}
			const t = next;
			let nextState;
			let templateState = state.go(input);
			if (templateState) {
				nextState = new State();
				Object.assign(nextState.j, templateState.j);
				nextState.jr.push.apply(nextState.jr, templateState.jr);
				nextState.jd = templateState.jd;
				nextState.t = templateState.t;
			} else nextState = new State();
			if (t) {
				if (groups) {
					if (nextState.t && typeof nextState.t === "string") addToGroups(t, Object.assign(flagsForToken(nextState.t, groups), flags), groups);
					else if (flags) addToGroups(t, flags, groups);
				}
				nextState.t = t;
			}
			state.j[input] = nextState;
			return nextState;
		}
	};
	/**
	* @template T
	* @param {State<T>} state
	* @param {string | string[]} input
	* @param {Flags} [flags]
	* @param {Collections<T>} [groups]
	*/
	var ta = (state, input, next, flags, groups) => state.ta(input, next, flags, groups);
	/**
	* @template T
	* @param {State<T>} state
	* @param {RegExp} regexp
	* @param {T | State<T>} [next]
	* @param {Flags} [flags]
	* @param {Collections<T>} [groups]
	*/
	var tr = (state, regexp, next, flags, groups) => state.tr(regexp, next, flags, groups);
	/**
	* @template T
	* @param {State<T>} state
	* @param {string | string[]} input
	* @param {T | State<T>} [next]
	* @param {Flags} [flags]
	* @param {Collections<T>} [groups]
	*/
	var ts = (state, input, next, flags, groups) => state.ts(input, next, flags, groups);
	/**
	* @template T
	* @param {State<T>} state
	* @param {string} input
	* @param {T | State<T>} [next]
	* @param {Collections<T>} [groups]
	* @param {Flags} [flags]
	*/
	var tt = (state, input, next, flags, groups) => state.tt(input, next, flags, groups);
	/******************************************************************************
	Text Tokens
	Identifiers for token outputs from the regexp scanner
	******************************************************************************/
	var WORD = "WORD";
	var UWORD = "UWORD";
	var ASCIINUMERICAL = "ASCIINUMERICAL";
	var ALPHANUMERICAL = "ALPHANUMERICAL";
	var LOCALHOST = "LOCALHOST";
	var TLD = "TLD";
	var UTLD = "UTLD";
	var SCHEME = "SCHEME";
	var SLASH_SCHEME = "SLASH_SCHEME";
	var NUM = "NUM";
	var WS = "WS";
	var NL = "NL";
	var OPENBRACE = "OPENBRACE";
	var CLOSEBRACE = "CLOSEBRACE";
	var OPENBRACKET = "OPENBRACKET";
	var CLOSEBRACKET = "CLOSEBRACKET";
	var OPENPAREN = "OPENPAREN";
	var CLOSEPAREN = "CLOSEPAREN";
	var OPENANGLEBRACKET = "OPENANGLEBRACKET";
	var CLOSEANGLEBRACKET = "CLOSEANGLEBRACKET";
	var FULLWIDTHLEFTPAREN = "FULLWIDTHLEFTPAREN";
	var FULLWIDTHRIGHTPAREN = "FULLWIDTHRIGHTPAREN";
	var LEFTCORNERBRACKET = "LEFTCORNERBRACKET";
	var RIGHTCORNERBRACKET = "RIGHTCORNERBRACKET";
	var LEFTWHITECORNERBRACKET = "LEFTWHITECORNERBRACKET";
	var RIGHTWHITECORNERBRACKET = "RIGHTWHITECORNERBRACKET";
	var FULLWIDTHLESSTHAN = "FULLWIDTHLESSTHAN";
	var FULLWIDTHGREATERTHAN = "FULLWIDTHGREATERTHAN";
	var AMPERSAND = "AMPERSAND";
	var APOSTROPHE = "APOSTROPHE";
	var ASTERISK = "ASTERISK";
	var AT = "AT";
	var BACKSLASH = "BACKSLASH";
	var BACKTICK = "BACKTICK";
	var CARET = "CARET";
	var COLON = "COLON";
	var COMMA = "COMMA";
	var DOLLAR = "DOLLAR";
	var DOT = "DOT";
	var EQUALS = "EQUALS";
	var EXCLAMATION = "EXCLAMATION";
	var HYPHEN = "HYPHEN";
	var PERCENT = "PERCENT";
	var PIPE = "PIPE";
	var PLUS = "PLUS";
	var POUND = "POUND";
	var QUERY = "QUERY";
	var QUOTE = "QUOTE";
	var FULLWIDTHMIDDLEDOT = "FULLWIDTHMIDDLEDOT";
	var SEMI = "SEMI";
	var SLASH = "SLASH";
	var TILDE = "TILDE";
	var UNDERSCORE = "UNDERSCORE";
	var EMOJI$1 = "EMOJI";
	var SYM = "SYM";
	var tk = /*#__PURE__*/ Object.freeze({
		__proto__: null,
		ALPHANUMERICAL,
		AMPERSAND,
		APOSTROPHE,
		ASCIINUMERICAL,
		ASTERISK,
		AT,
		BACKSLASH,
		BACKTICK,
		CARET,
		CLOSEANGLEBRACKET,
		CLOSEBRACE,
		CLOSEBRACKET,
		CLOSEPAREN,
		COLON,
		COMMA,
		DOLLAR,
		DOT,
		EMOJI: EMOJI$1,
		EQUALS,
		EXCLAMATION,
		FULLWIDTHGREATERTHAN,
		FULLWIDTHLEFTPAREN,
		FULLWIDTHLESSTHAN,
		FULLWIDTHMIDDLEDOT,
		FULLWIDTHRIGHTPAREN,
		HYPHEN,
		LEFTCORNERBRACKET,
		LEFTWHITECORNERBRACKET,
		LOCALHOST,
		NL,
		NUM,
		OPENANGLEBRACKET,
		OPENBRACE,
		OPENBRACKET,
		OPENPAREN,
		PERCENT,
		PIPE,
		PLUS,
		POUND,
		QUERY,
		QUOTE,
		RIGHTCORNERBRACKET,
		RIGHTWHITECORNERBRACKET,
		SCHEME,
		SEMI,
		SLASH,
		SLASH_SCHEME,
		SYM,
		TILDE,
		TLD,
		UNDERSCORE,
		UTLD,
		UWORD,
		WORD,
		WS
	});
	var ASCII_LETTER = /[a-z]/;
	var LETTER = /\p{L}/u;
	var EMOJI = /\p{Emoji}/u;
	var DIGIT = /\d/;
	var SPACE = /\s/;
	/**
	The scanner provides an interface that takes a string of text as input, and
	outputs an array of tokens instances that can be used for easy URL parsing.
	*/
	var CR = "\r";
	var LF = "\n";
	var EMOJI_VARIATION = "️";
	var EMOJI_JOINER = "‍";
	var OBJECT_REPLACEMENT = "￼";
	var tlds = null;
	var utlds = null;
	/**
	* Scanner output token:
	* - `t` is the token name (e.g., 'NUM', 'EMOJI', 'TLD')
	* - `v` is the value of the token (e.g., '123', '❤️', 'com')
	* - `s` is the start index of the token in the original string
	* - `e` is the end index of the token in the original string
	* @typedef {{t: string, v: string, s: number, e: number}} Token
	*/
	/**
	* @template T
	* @typedef {{ [collection: string]: T[] }} Collections
	*/
	/**
	* Initialize the scanner character-based state machine for the given start
	* state
	* @param {[string, boolean][]} customSchemes List of custom schemes, where each
	* item is a length-2 tuple with the first element set to the string scheme, and
	* the second element set to `true` if the `://` after the scheme is optional
	*/
	function init$2(customSchemes = []) {
		/** @type Collections<string> */
		const groups = {};
		State.groups = groups;
		/** @type State<string> */
		const Start = new State();
		if (tlds == null) tlds = decodeTlds(encodedTlds);
		if (utlds == null) utlds = decodeTlds(encodedUtlds);
		tt(Start, "'", APOSTROPHE);
		tt(Start, "{", OPENBRACE);
		tt(Start, "}", CLOSEBRACE);
		tt(Start, "[", OPENBRACKET);
		tt(Start, "]", CLOSEBRACKET);
		tt(Start, "(", OPENPAREN);
		tt(Start, ")", CLOSEPAREN);
		tt(Start, "<", OPENANGLEBRACKET);
		tt(Start, ">", CLOSEANGLEBRACKET);
		tt(Start, "（", FULLWIDTHLEFTPAREN);
		tt(Start, "）", FULLWIDTHRIGHTPAREN);
		tt(Start, "「", LEFTCORNERBRACKET);
		tt(Start, "」", RIGHTCORNERBRACKET);
		tt(Start, "『", LEFTWHITECORNERBRACKET);
		tt(Start, "』", RIGHTWHITECORNERBRACKET);
		tt(Start, "＜", FULLWIDTHLESSTHAN);
		tt(Start, "＞", FULLWIDTHGREATERTHAN);
		tt(Start, "&", AMPERSAND);
		tt(Start, "*", ASTERISK);
		tt(Start, "@", AT);
		tt(Start, "`", BACKTICK);
		tt(Start, "^", CARET);
		tt(Start, ":", COLON);
		tt(Start, ",", COMMA);
		tt(Start, "$", DOLLAR);
		tt(Start, ".", DOT);
		tt(Start, "=", EQUALS);
		tt(Start, "!", EXCLAMATION);
		tt(Start, "-", HYPHEN);
		tt(Start, "%", PERCENT);
		tt(Start, "|", PIPE);
		tt(Start, "+", PLUS);
		tt(Start, "#", POUND);
		tt(Start, "?", QUERY);
		tt(Start, "\"", QUOTE);
		tt(Start, "/", SLASH);
		tt(Start, ";", SEMI);
		tt(Start, "~", TILDE);
		tt(Start, "_", UNDERSCORE);
		tt(Start, "\\", BACKSLASH);
		tt(Start, "・", FULLWIDTHMIDDLEDOT);
		const Num = tr(Start, DIGIT, NUM, { [numeric]: true });
		tr(Num, DIGIT, Num);
		const Asciinumeric = tr(Num, ASCII_LETTER, ASCIINUMERICAL, { [asciinumeric]: true });
		const Alphanumeric = tr(Num, LETTER, ALPHANUMERICAL, { [alphanumeric]: true });
		const Word = tr(Start, ASCII_LETTER, WORD, { [ascii]: true });
		tr(Word, DIGIT, Asciinumeric);
		tr(Word, ASCII_LETTER, Word);
		tr(Asciinumeric, DIGIT, Asciinumeric);
		tr(Asciinumeric, ASCII_LETTER, Asciinumeric);
		const UWord = tr(Start, LETTER, UWORD, { [alpha]: true });
		tr(UWord, ASCII_LETTER);
		tr(UWord, DIGIT, Alphanumeric);
		tr(UWord, LETTER, UWord);
		tr(Alphanumeric, DIGIT, Alphanumeric);
		tr(Alphanumeric, ASCII_LETTER);
		tr(Alphanumeric, LETTER, Alphanumeric);
		const Nl = tt(Start, LF, NL, { [whitespace]: true });
		const Cr = tt(Start, CR, WS, { [whitespace]: true });
		const Ws = tr(Start, SPACE, WS, { [whitespace]: true });
		tt(Start, OBJECT_REPLACEMENT, Ws);
		tt(Cr, LF, Nl);
		tt(Cr, OBJECT_REPLACEMENT, Ws);
		tr(Cr, SPACE, Ws);
		tt(Ws, CR);
		tt(Ws, LF);
		tr(Ws, SPACE, Ws);
		tt(Ws, OBJECT_REPLACEMENT, Ws);
		const Emoji = tr(Start, EMOJI, EMOJI$1, { [emoji]: true });
		tt(Emoji, "#");
		tr(Emoji, EMOJI, Emoji);
		tt(Emoji, EMOJI_VARIATION, Emoji);
		const EmojiJoiner = tt(Emoji, EMOJI_JOINER);
		tt(EmojiJoiner, "#");
		tr(EmojiJoiner, EMOJI, Emoji);
		const wordjr = [[ASCII_LETTER, Word], [DIGIT, Asciinumeric]];
		const uwordjr = [
			[ASCII_LETTER, null],
			[LETTER, UWord],
			[DIGIT, Alphanumeric]
		];
		for (let i = 0; i < tlds.length; i++) fastts(Start, tlds[i], TLD, WORD, wordjr);
		for (let i = 0; i < utlds.length; i++) fastts(Start, utlds[i], UTLD, UWORD, uwordjr);
		addToGroups(TLD, {
			tld: true,
			ascii: true
		}, groups);
		addToGroups(UTLD, {
			utld: true,
			alpha: true
		}, groups);
		fastts(Start, "file", SCHEME, WORD, wordjr);
		fastts(Start, "mailto", SCHEME, WORD, wordjr);
		fastts(Start, "http", SLASH_SCHEME, WORD, wordjr);
		fastts(Start, "https", SLASH_SCHEME, WORD, wordjr);
		fastts(Start, "ftp", SLASH_SCHEME, WORD, wordjr);
		fastts(Start, "ftps", SLASH_SCHEME, WORD, wordjr);
		addToGroups(SCHEME, {
			scheme: true,
			ascii: true
		}, groups);
		addToGroups(SLASH_SCHEME, {
			slashscheme: true,
			ascii: true
		}, groups);
		customSchemes = customSchemes.sort((a, b) => a[0] > b[0] ? 1 : -1);
		for (let i = 0; i < customSchemes.length; i++) {
			const sch = customSchemes[i][0];
			const flags = customSchemes[i][1] ? { [scheme]: true } : { [slashscheme]: true };
			if (sch.indexOf("-") >= 0) flags[domain] = true;
			else if (!ASCII_LETTER.test(sch)) flags[numeric] = true;
			else if (DIGIT.test(sch)) flags[asciinumeric] = true;
			else flags[ascii] = true;
			ts(Start, sch, sch, flags);
		}
		ts(Start, "localhost", LOCALHOST, { ascii: true });
		Start.jd = new State(SYM);
		return {
			start: Start,
			tokens: Object.assign({ groups }, tk)
		};
	}
	/**
	Given a string, returns an array of TOKEN instances representing the
	composition of that string.
	
	@method run
	@param {State<string>} start scanner starting state
	@param {string} str input string to scan
	@return {Token[]} list of tokens, each with a type and value
	*/
	function run$1(start, str) {
		const iterable = stringToArray(str.replace(/[A-Z]/g, (c) => c.toLowerCase()));
		const charCount = iterable.length;
		const tokens = [];
		let cursor = 0;
		let charCursor = 0;
		while (charCursor < charCount) {
			let state = start;
			let nextState = null;
			let tokenLength = 0;
			let latestAccepting = null;
			let sinceAccepts = -1;
			let charsSinceAccepts = -1;
			while (charCursor < charCount && (nextState = state.go(iterable[charCursor]))) {
				state = nextState;
				if (state.accepts()) {
					sinceAccepts = 0;
					charsSinceAccepts = 0;
					latestAccepting = state;
				} else if (sinceAccepts >= 0) {
					sinceAccepts += iterable[charCursor].length;
					charsSinceAccepts++;
				}
				tokenLength += iterable[charCursor].length;
				cursor += iterable[charCursor].length;
				charCursor++;
			}
			cursor -= sinceAccepts;
			charCursor -= charsSinceAccepts;
			tokenLength -= sinceAccepts;
			tokens.push({
				t: latestAccepting.t,
				v: str.slice(cursor - tokenLength, cursor),
				s: cursor - tokenLength,
				e: cursor
			});
		}
		return tokens;
	}
	/**
	* Convert a String to an Array of characters, taking into account that some
	* characters like emojis take up two string indexes.
	*
	* Adapted from core-js (MIT license)
	* https://github.com/zloirock/core-js/blob/2d69cf5f99ab3ea3463c395df81e5a15b68f49d9/packages/core-js/internals/string-multibyte.js
	*
	* @function stringToArray
	* @param {string} str
	* @returns {string[]}
	*/
	function stringToArray(str) {
		const result = [];
		const len = str.length;
		let index = 0;
		while (index < len) {
			let first = str.charCodeAt(index);
			let second;
			let char = first < 55296 || first > 56319 || index + 1 === len || (second = str.charCodeAt(index + 1)) < 56320 || second > 57343 ? str[index] : str.slice(index, index + 2);
			result.push(char);
			index += char.length;
		}
		return result;
	}
	/**
	* Fast version of ts function for when transition defaults are well known
	* @param {State<string>} state
	* @param {string} input
	* @param {string} t
	* @param {string} defaultt
	* @param {[RegExp, State<string>][]} jr
	* @returns {State<string>}
	*/
	function fastts(state, input, t, defaultt, jr) {
		let next;
		const len = input.length;
		for (let i = 0; i < len - 1; i++) {
			const char = input[i];
			if (state.j[char]) next = state.j[char];
			else {
				next = new State(defaultt);
				next.jr = jr.slice();
				state.j[char] = next;
			}
			state = next;
		}
		next = new State(t);
		next.jr = jr.slice();
		state.j[input[len - 1]] = next;
		return next;
	}
	/**
	* Converts a string of Top-Level Domain names encoded in update-tlds.js back
	* into a list of strings.
	* @param {str} encoded encoded TLDs string
	* @returns {str[]} original TLDs list
	*/
	function decodeTlds(encoded) {
		const words = [];
		const stack = [];
		let i = 0;
		let digits = "0123456789";
		while (i < encoded.length) {
			let popDigitCount = 0;
			while (digits.indexOf(encoded[i + popDigitCount]) >= 0) popDigitCount++;
			if (popDigitCount > 0) {
				words.push(stack.join(""));
				for (let popCount = parseInt(encoded.substring(i, i + popDigitCount), 10); popCount > 0; popCount--) stack.pop();
				i += popDigitCount;
			} else {
				stack.push(encoded[i]);
				i++;
			}
		}
		return words;
	}
	/**
	* An object where each key is a valid DOM Event Name such as `click` or `focus`
	* and each value is an event handler function.
	*
	* https://developer.mozilla.org/en-US/docs/Web/API/Element#events
	* @typedef {?{ [event: string]: Function }} EventListeners
	*/
	/**
	* All formatted properties required to render a link, including `tagName`,
	* `attributes`, `content` and `eventListeners`.
	* @typedef {{ tagName: any, attributes: {[attr: string]: any}, content: string,
	* eventListeners: EventListeners }} IntermediateRepresentation
	*/
	/**
	* Specify either an object described by the template type `O` or a function.
	*
	* The function takes a string value (usually the link's href attribute), the
	* link type (`'url'`, `'hashtag`', etc.) and an internal token representation
	* of the link. It should return an object of the template type `O`
	* @template O
	* @typedef {O | ((value: string, type: string, token: MultiToken) => O)} OptObj
	*/
	/**
	* Specify either a function described by template type `F` or an object.
	*
	* Each key in the object should be a link type (`'url'`, `'hashtag`', etc.). Each
	* value should be a function with template type `F` that is called when the
	* corresponding link type is encountered.
	* @template F
	* @typedef {F | { [type: string]: F}} OptFn
	*/
	/**
	* Specify either a value with template type `V`, a function that returns `V` or
	* an object where each value resolves to `V`.
	*
	* The function takes a string value (usually the link's href attribute), the
	* link type (`'url'`, `'hashtag`', etc.) and an internal token representation
	* of the link. It should return an object of the template type `V`
	*
	* For the object, each key should be a link type (`'url'`, `'hashtag`', etc.).
	* Each value should either have type `V` or a function that returns V. This
	* function similarly takes a string value and a token.
	*
	* Example valid types for `Opt<string>`:
	*
	* ```js
	* 'hello'
	* (value, type, token) => 'world'
	* { url: 'hello', email: (value, token) => 'world'}
	* ```
	* @template V
	* @typedef {V | ((value: string, type: string, token: MultiToken) => V) | { [type: string]: V | ((value: string, token: MultiToken) => V) }} Opt
	*/
	/**
	* See available options: https://linkify.js.org/docs/options.html
	* @typedef {{
	* 	defaultProtocol?: string,
	*  events?: OptObj<EventListeners>,
	* 	format?: Opt<string>,
	* 	formatHref?: Opt<string>,
	* 	nl2br?: boolean,
	* 	tagName?: Opt<any>,
	* 	target?: Opt<string>,
	* 	rel?: Opt<string>,
	* 	validate?: Opt<boolean>,
	* 	truncate?: Opt<number>,
	* 	className?: Opt<string>,
	* 	attributes?: OptObj<({ [attr: string]: any })>,
	*  ignoreTags?: string[],
	* 	render?: OptFn<((ir: IntermediateRepresentation) => any)>
	* }} Opts
	*/
	/**
	* @type Required<Opts>
	*/
	var defaults = {
		defaultProtocol: "http",
		events: null,
		format: noop,
		formatHref: noop,
		nl2br: false,
		tagName: "a",
		target: null,
		rel: null,
		validate: true,
		truncate: Infinity,
		className: null,
		attributes: null,
		ignoreTags: [],
		render: null
	};
	/**
	* Utility class for linkify interfaces to apply specified
	* {@link Opts formatting and rendering options}.
	*
	* @param {Opts | Options} [opts] Option value overrides.
	* @param {(ir: IntermediateRepresentation) => any} [defaultRender] (For
	*   internal use) default render function that determines how to generate an
	*   HTML element based on a link token's derived tagName, attributes and HTML.
	*   Similar to render option
	*/
	function Options(opts, defaultRender = null) {
		let o = Object.assign({}, defaults);
		if (opts) o = Object.assign(o, opts instanceof Options ? opts.o : opts);
		const ignoredTags = o.ignoreTags;
		const uppercaseIgnoredTags = [];
		for (let i = 0; i < ignoredTags.length; i++) uppercaseIgnoredTags.push(ignoredTags[i].toUpperCase());
		/** @protected */
		this.o = o;
		if (defaultRender) this.defaultRender = defaultRender;
		this.ignoreTags = uppercaseIgnoredTags;
	}
	Options.prototype = {
		o: defaults,
		/**
		* @type string[]
		*/
		ignoreTags: [],
		/**
		* @param {IntermediateRepresentation} ir
		* @returns {any}
		*/
		defaultRender(ir) {
			return ir;
		},
		/**
		* Returns true or false based on whether a token should be displayed as a
		* link based on the user options.
		* @param {MultiToken} token
		* @returns {boolean}
		*/
		check(token) {
			return this.get("validate", token.toString(), token);
		},
		/**
		* Resolve an option's value based on the value of the option and the given
		* params. If operator and token are specified and the target option is
		* callable, automatically calls the function with the given argument.
		* @template {keyof Opts} K
		* @param {K} key Name of option to use
		* @param {string} [operator] will be passed to the target option if it's a
		* function. If not specified, RAW function value gets returned
		* @param {MultiToken} [token] The token from linkify.tokenize
		* @returns {Opts[K] | any}
		*/
		get(key, operator, token) {
			const isCallable = operator != null;
			let option = this.o[key];
			if (!option) return option;
			if (typeof option === "object") {
				option = token.t in option ? option[token.t] : defaults[key];
				if (typeof option === "function" && isCallable) option = option(operator, token);
			} else if (typeof option === "function" && isCallable) option = option(operator, token.t, token);
			return option;
		},
		/**
		* @template {keyof Opts} L
		* @param {L} key Name of options object to use
		* @param {string} [operator]
		* @param {MultiToken} [token]
		* @returns {Opts[L] | any}
		*/
		getObj(key, operator, token) {
			let obj = this.o[key];
			if (typeof obj === "function" && operator != null) obj = obj(operator, token.t, token);
			return obj;
		},
		/**
		* Convert the given token to a rendered element that may be added to the
		* calling-interface's DOM
		* @param {MultiToken} token Token to render to an HTML element
		* @returns {any} Render result; e.g., HTML string, DOM element, React
		*   Component, etc.
		*/
		render(token) {
			const ir = token.render(this);
			return (this.get("render", null, token) || this.defaultRender)(ir, token.t, token);
		}
	};
	function noop(val) {
		return val;
	}
	/******************************************************************************
	Multi-Tokens
	Tokens composed of arrays of TextTokens
	******************************************************************************/
	/**
	* @param {string} value
	* @param {Token[]} tokens
	*/
	function MultiToken(value, tokens) {
		this.t = "token";
		this.v = value;
		this.tk = tokens;
	}
	/**
	* Abstract class used for manufacturing tokens of text tokens. That is rather
	* than the value for a token being a small string of text, it's value an array
	* of text tokens.
	*
	* Used for grouping together URLs, emails, hashtags, and other potential
	* creations.
	* @class MultiToken
	* @property {string} t
	* @property {string} v
	* @property {Token[]} tk
	* @abstract
	*/
	MultiToken.prototype = {
		isLink: false,
		/**
		* Return the string this token represents.
		* @return {string}
		*/
		toString() {
			return this.v;
		},
		/**
		* What should the value for this token be in the `href` HTML attribute?
		* Returns the `.toString` value by default.
		* @param {string} [scheme]
		* @return {string}
		*/
		toHref(scheme) {
			return this.toString();
		},
		/**
		* @param {Options} options Formatting options
		* @returns {string}
		*/
		toFormattedString(options) {
			const val = this.toString();
			const truncate = options.get("truncate", val, this);
			const formatted = options.get("format", val, this);
			return truncate && formatted.length > truncate ? formatted.substring(0, truncate) + "…" : formatted;
		},
		/**
		*
		* @param {Options} options
		* @returns {string}
		*/
		toFormattedHref(options) {
			return options.get("formatHref", this.toHref(options.get("defaultProtocol")), this);
		},
		/**
		* The start index of this token in the original input string
		* @returns {number}
		*/
		startIndex() {
			return this.tk[0].s;
		},
		/**
		* The end index of this token in the original input string (up to this
		* index but not including it)
		* @returns {number}
		*/
		endIndex() {
			return this.tk[this.tk.length - 1].e;
		},
		/**
		Returns an object  of relevant values for this token, which includes keys
		* type - Kind of token ('url', 'email', etc.)
		* value - Original text
		* href - The value that should be added to the anchor tag's href
		attribute
		@method toObject
		@param {string} [protocol] `'http'` by default
		*/
		toObject(protocol = defaults.defaultProtocol) {
			return {
				type: this.t,
				value: this.toString(),
				isLink: this.isLink,
				href: this.toHref(protocol),
				start: this.startIndex(),
				end: this.endIndex()
			};
		},
		/**
		*
		* @param {Options} options Formatting option
		*/
		toFormattedObject(options) {
			return {
				type: this.t,
				value: this.toFormattedString(options),
				isLink: this.isLink,
				href: this.toFormattedHref(options),
				start: this.startIndex(),
				end: this.endIndex()
			};
		},
		/**
		* Whether this token should be rendered as a link according to the given options
		* @param {Options} options
		* @returns {boolean}
		*/
		validate(options) {
			return options.get("validate", this.toString(), this);
		},
		/**
		* Return an object that represents how this link should be rendered.
		* @param {Options} options Formattinng options
		*/
		render(options) {
			const token = this;
			const href = this.toHref(options.get("defaultProtocol"));
			const formattedHref = options.get("formatHref", href, this);
			const tagName = options.get("tagName", href, token);
			const content = this.toFormattedString(options);
			const attributes = {};
			const className = options.get("className", href, token);
			const target = options.get("target", href, token);
			const rel = options.get("rel", href, token);
			const attrs = options.getObj("attributes", href, token);
			const eventListeners = options.getObj("events", href, token);
			attributes.href = formattedHref;
			if (className) attributes.class = className;
			if (target) attributes.target = target;
			if (rel) attributes.rel = rel;
			if (attrs) Object.assign(attributes, attrs);
			return {
				tagName,
				attributes,
				content,
				eventListeners
			};
		}
	};
	/**
	* Create a new token that can be emitted by the parser state machine
	* @param {string} type readable type of the token
	* @param {object} props properties to assign or override, including isLink = true or false
	* @returns {new (value: string, tokens: Token[]) => MultiToken} new token class
	*/
	function createTokenClass(type, props) {
		class Token extends MultiToken {
			constructor(value, tokens) {
				super(value, tokens);
				this.t = type;
			}
		}
		for (const p in props) Token.prototype[p] = props[p];
		Token.t = type;
		return Token;
	}
	/**
	Represents a list of tokens making up a valid email address
	*/
	var Email = createTokenClass("email", {
		isLink: true,
		toHref() {
			return "mailto:" + this.toString();
		}
	});
	/**
	Represents some plain text
	*/
	var Text$1 = createTokenClass("text");
	/**
	Multi-linebreak token - represents a line break
	@class Nl
	*/
	var Nl = createTokenClass("nl");
	/**
	Represents a list of text tokens making up a valid URL
	@class Url
	*/
	var Url = createTokenClass("url", {
		isLink: true,
		/**
		Lowercases relevant parts of the domain and adds the protocol if
		required. Note that this will not escape unsafe HTML characters in the
		URL.
		@param {string} [scheme] default scheme (e.g., 'https')
		@return {string} the full href
		*/
		toHref(scheme = defaults.defaultProtocol) {
			return this.hasProtocol() ? this.v : `${scheme}://${this.v}`;
		},
		/**
		* Check whether this URL token has a protocol
		* @return {boolean}
		*/
		hasProtocol() {
			const tokens = this.tk;
			return tokens.length >= 2 && tokens[0].t !== LOCALHOST && tokens[1].t === COLON;
		}
	});
	/**
	Not exactly parser, more like the second-stage scanner (although we can
	theoretically hotswap the code here with a real parser in the future... but
	for a little URL-finding utility abstract syntax trees may be a little
	overkill).
	
	URL format: http://en.wikipedia.org/wiki/URI_scheme
	Email format: http://en.wikipedia.org/wiki/EmailAddress (links to RFC in
	reference)
	
	@module linkify
	@submodule parser
	@main run
	*/
	var makeState = (arg) => new State(arg);
	/**
	* Generate the parser multi token-based state machine
	* @param {{ groups: Collections<string> }} tokens
	*/
	function init$1({ groups }) {
		const qsAccepting = groups.domain.concat([
			AMPERSAND,
			ASTERISK,
			AT,
			BACKSLASH,
			BACKTICK,
			CARET,
			DOLLAR,
			EQUALS,
			HYPHEN,
			NUM,
			PERCENT,
			PIPE,
			PLUS,
			POUND,
			SLASH,
			SYM,
			TILDE,
			UNDERSCORE
		]);
		const qsNonAccepting = [
			APOSTROPHE,
			COLON,
			COMMA,
			DOT,
			EXCLAMATION,
			PERCENT,
			QUERY,
			QUOTE,
			SEMI,
			OPENANGLEBRACKET,
			CLOSEANGLEBRACKET,
			OPENBRACE,
			CLOSEBRACE,
			CLOSEBRACKET,
			OPENBRACKET,
			OPENPAREN,
			CLOSEPAREN,
			FULLWIDTHLEFTPAREN,
			FULLWIDTHRIGHTPAREN,
			LEFTCORNERBRACKET,
			RIGHTCORNERBRACKET,
			LEFTWHITECORNERBRACKET,
			RIGHTWHITECORNERBRACKET,
			FULLWIDTHLESSTHAN,
			FULLWIDTHGREATERTHAN
		];
		const localpartAccepting = [
			AMPERSAND,
			APOSTROPHE,
			ASTERISK,
			BACKSLASH,
			BACKTICK,
			CARET,
			DOLLAR,
			EQUALS,
			HYPHEN,
			OPENBRACE,
			CLOSEBRACE,
			PERCENT,
			PIPE,
			PLUS,
			POUND,
			QUERY,
			SLASH,
			SYM,
			TILDE,
			UNDERSCORE
		];
		/**
		* @type State<Token>
		*/
		const Start = makeState();
		const Localpart = tt(Start, TILDE);
		ta(Localpart, localpartAccepting, Localpart);
		ta(Localpart, groups.domain, Localpart);
		const Domain = makeState();
		const Scheme = makeState();
		const SlashScheme = makeState();
		ta(Start, groups.domain, Domain);
		ta(Start, groups.scheme, Scheme);
		ta(Start, groups.slashscheme, SlashScheme);
		ta(Domain, localpartAccepting, Localpart);
		ta(Domain, groups.domain, Domain);
		const LocalpartAt = tt(Domain, AT);
		tt(Localpart, AT, LocalpartAt);
		tt(Scheme, AT, LocalpartAt);
		tt(SlashScheme, AT, LocalpartAt);
		const LocalpartDot = tt(Localpart, DOT);
		ta(LocalpartDot, localpartAccepting, Localpart);
		ta(LocalpartDot, groups.domain, Localpart);
		const EmailDomain = makeState();
		ta(LocalpartAt, groups.domain, EmailDomain);
		ta(EmailDomain, groups.domain, EmailDomain);
		const EmailDomainDot = tt(EmailDomain, DOT);
		ta(EmailDomainDot, groups.domain, EmailDomain);
		const Email$1 = makeState(Email);
		ta(EmailDomainDot, groups.tld, Email$1);
		ta(EmailDomainDot, groups.utld, Email$1);
		tt(LocalpartAt, LOCALHOST, Email$1);
		const EmailDomainHyphen = tt(EmailDomain, HYPHEN);
		tt(EmailDomainHyphen, HYPHEN, EmailDomainHyphen);
		ta(EmailDomainHyphen, groups.domain, EmailDomain);
		ta(Email$1, groups.domain, EmailDomain);
		tt(Email$1, DOT, EmailDomainDot);
		tt(Email$1, HYPHEN, EmailDomainHyphen);
		const EmailColon = tt(Email$1, COLON);
		ta(EmailColon, groups.numeric, Email);
		const DomainHyphen = tt(Domain, HYPHEN);
		const DomainDot = tt(Domain, DOT);
		tt(DomainHyphen, HYPHEN, DomainHyphen);
		ta(DomainHyphen, groups.domain, Domain);
		ta(DomainDot, localpartAccepting, Localpart);
		ta(DomainDot, groups.domain, Domain);
		const DomainDotTld = makeState(Url);
		ta(DomainDot, groups.tld, DomainDotTld);
		ta(DomainDot, groups.utld, DomainDotTld);
		ta(DomainDotTld, groups.domain, Domain);
		ta(DomainDotTld, localpartAccepting, Localpart);
		tt(DomainDotTld, DOT, DomainDot);
		tt(DomainDotTld, HYPHEN, DomainHyphen);
		tt(DomainDotTld, AT, LocalpartAt);
		const DomainDotTldColon = tt(DomainDotTld, COLON);
		const DomainDotTldColonPort = makeState(Url);
		ta(DomainDotTldColon, groups.numeric, DomainDotTldColonPort);
		const Url$1 = makeState(Url);
		const UrlNonaccept = makeState();
		ta(Url$1, qsAccepting, Url$1);
		ta(Url$1, qsNonAccepting, UrlNonaccept);
		ta(UrlNonaccept, qsAccepting, Url$1);
		ta(UrlNonaccept, qsNonAccepting, UrlNonaccept);
		tt(DomainDotTld, SLASH, Url$1);
		tt(DomainDotTldColonPort, SLASH, Url$1);
		const SchemeColon = tt(Scheme, COLON);
		const SlashSchemeColon = tt(SlashScheme, COLON);
		const SlashSchemeColonSlash = tt(SlashSchemeColon, SLASH);
		const UriPrefix = tt(SlashSchemeColonSlash, SLASH);
		ta(Scheme, groups.domain, Domain);
		tt(Scheme, DOT, DomainDot);
		tt(Scheme, HYPHEN, DomainHyphen);
		ta(SlashScheme, groups.domain, Domain);
		tt(SlashScheme, DOT, DomainDot);
		tt(SlashScheme, HYPHEN, DomainHyphen);
		ta(SchemeColon, groups.domain, Url$1);
		tt(SchemeColon, SLASH, Url$1);
		tt(SchemeColon, QUERY, Url$1);
		ta(UriPrefix, groups.domain, Url$1);
		ta(UriPrefix, qsAccepting, Url$1);
		tt(UriPrefix, SLASH, Url$1);
		const bracketPairs = [
			[OPENBRACE, CLOSEBRACE],
			[OPENBRACKET, CLOSEBRACKET],
			[OPENPAREN, CLOSEPAREN],
			[OPENANGLEBRACKET, CLOSEANGLEBRACKET],
			[FULLWIDTHLEFTPAREN, FULLWIDTHRIGHTPAREN],
			[LEFTCORNERBRACKET, RIGHTCORNERBRACKET],
			[LEFTWHITECORNERBRACKET, RIGHTWHITECORNERBRACKET],
			[FULLWIDTHLESSTHAN, FULLWIDTHGREATERTHAN]
		];
		for (let i = 0; i < bracketPairs.length; i++) {
			const [OPEN, CLOSE] = bracketPairs[i];
			const UrlOpen = tt(Url$1, OPEN);
			tt(UrlNonaccept, OPEN, UrlOpen);
			tt(UrlOpen, CLOSE, Url$1);
			const UrlOpenQ = makeState(Url);
			ta(UrlOpen, qsAccepting, UrlOpenQ);
			const UrlOpenSyms = makeState();
			ta(UrlOpen, qsNonAccepting);
			ta(UrlOpenQ, qsAccepting, UrlOpenQ);
			ta(UrlOpenQ, qsNonAccepting, UrlOpenSyms);
			ta(UrlOpenSyms, qsAccepting, UrlOpenQ);
			ta(UrlOpenSyms, qsNonAccepting, UrlOpenSyms);
			tt(UrlOpenQ, CLOSE, Url$1);
			tt(UrlOpenSyms, CLOSE, Url$1);
		}
		tt(Start, LOCALHOST, DomainDotTld);
		tt(Start, NL, Nl);
		return {
			start: Start,
			tokens: tk
		};
	}
	/**
	* Run the parser state machine on a list of scanned string-based tokens to
	* create a list of multi tokens, each of which represents a URL, email address,
	* plain text, etc.
	*
	* @param {State<MultiToken>} start parser start state
	* @param {string} input the original input used to generate the given tokens
	* @param {Token[]} tokens list of scanned tokens
	* @returns {MultiToken[]}
	*/
	function run(start, input, tokens) {
		let len = tokens.length;
		let cursor = 0;
		let multis = [];
		let textTokens = [];
		while (cursor < len) {
			let state = start;
			let secondState = null;
			let nextState = null;
			let multiLength = 0;
			let latestAccepting = null;
			let sinceAccepts = -1;
			while (cursor < len && !(secondState = state.go(tokens[cursor].t))) textTokens.push(tokens[cursor++]);
			while (cursor < len && (nextState = secondState || state.go(tokens[cursor].t))) {
				secondState = null;
				state = nextState;
				if (state.accepts()) {
					sinceAccepts = 0;
					latestAccepting = state;
				} else if (sinceAccepts >= 0) sinceAccepts++;
				cursor++;
				multiLength++;
			}
			if (sinceAccepts < 0) {
				cursor -= multiLength;
				if (cursor < len) {
					textTokens.push(tokens[cursor]);
					cursor++;
				}
			} else {
				if (textTokens.length > 0) {
					multis.push(initMultiToken(Text$1, input, textTokens));
					textTokens = [];
				}
				cursor -= sinceAccepts;
				multiLength -= sinceAccepts;
				const Multi = latestAccepting.t;
				const subtokens = tokens.slice(cursor - multiLength, cursor);
				multis.push(initMultiToken(Multi, input, subtokens));
			}
		}
		if (textTokens.length > 0) multis.push(initMultiToken(Text$1, input, textTokens));
		return multis;
	}
	/**
	* Utility function for instantiating a new multitoken with all the relevant
	* fields during parsing.
	* @param {new (value: string, tokens: Token[]) => MultiToken} Multi class to instantiate
	* @param {string} input original input string
	* @param {Token[]} tokens consecutive tokens scanned from input string
	* @returns {MultiToken}
	*/
	function initMultiToken(Multi, input, tokens) {
		const startIdx = tokens[0].s;
		const endIdx = tokens[tokens.length - 1].e;
		return new Multi(input.slice(startIdx, endIdx), tokens);
	}
	var warn = typeof console !== "undefined" && console && console.warn || (() => {});
	var warnAdvice = "until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.";
	var INIT = {
		scanner: null,
		parser: null,
		tokenQueue: [],
		pluginQueue: [],
		customSchemes: [],
		initialized: false
	};
	/**
	* @typedef {{
	* 	start: State<string>,
	* 	tokens: { groups: Collections<string> } & typeof tk
	* }} ScannerInit
	*/
	/**
	* @typedef {{
	* 	start: State<MultiToken>,
	* 	tokens: typeof multi
	* }} ParserInit
	*/
	/**
	* @typedef {(arg: { scanner: ScannerInit }) => void} TokenPlugin
	*/
	/**
	* @typedef {(arg: { scanner: ScannerInit, parser: ParserInit }) => void} Plugin
	*/
	/**
	* De-register all plugins and reset the internal state-machine. Used for
	* testing; not required in practice.
	* @private
	*/
	function reset() {
		State.groups = {};
		INIT.scanner = null;
		INIT.parser = null;
		INIT.tokenQueue = [];
		INIT.pluginQueue = [];
		INIT.customSchemes = [];
		INIT.initialized = false;
		return INIT;
	}
	/**
	* Detect URLs with the following additional protocol. Anything with format
	* "protocol://..." will be considered a link. If `optionalSlashSlash` is set to
	* `true`, anything with format "protocol:..." will be considered a link.
	* @param {string} scheme
	* @param {boolean} [optionalSlashSlash]
	*/
	function registerCustomProtocol(scheme, optionalSlashSlash = false) {
		if (INIT.initialized) warn(`linkifyjs: already initialized - will not register custom scheme "${scheme}" ${warnAdvice}`);
		if (!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(scheme)) throw new Error(`linkifyjs: incorrect scheme format.
1. Must only contain digits, lowercase ASCII letters or "-"
2. Cannot start or end with "-"
3. "-" cannot repeat`);
		INIT.customSchemes.push([scheme, optionalSlashSlash]);
	}
	/**
	* Initialize the linkify state machine. Called automatically the first time
	* linkify is called on a string, but may be called manually as well.
	*/
	function init() {
		INIT.scanner = init$2(INIT.customSchemes);
		for (let i = 0; i < INIT.tokenQueue.length; i++) INIT.tokenQueue[i][1]({ scanner: INIT.scanner });
		INIT.parser = init$1(INIT.scanner.tokens);
		for (let i = 0; i < INIT.pluginQueue.length; i++) INIT.pluginQueue[i][1]({
			scanner: INIT.scanner,
			parser: INIT.parser
		});
		INIT.initialized = true;
		return INIT;
	}
	/**
	* Parse a string into tokens that represent linkable and non-linkable sub-components
	* @param {string} str
	* @return {MultiToken[]} tokens
	*/
	function tokenize(str) {
		if (!INIT.initialized) init();
		return run(INIT.parser.start, str, run$1(INIT.scanner.start, str));
	}
	tokenize.scan = run$1;
	/**
	* Find a list of linkable items in the given string.
	* @param {string} str string to find links in
	* @param {string | Opts} [type] either formatting options or specific type of
	* links to find, e.g., 'url' or 'email'
	* @param {Opts} [opts] formatting options for final output. Cannot be specified
	* if opts already provided in `type` argument
	*/
	function find(str, type = null, opts = null) {
		if (type && typeof type === "object") {
			if (opts) throw Error(`linkifyjs: Invalid link type ${type}; must be a string`);
			opts = type;
			type = null;
		}
		const options = new Options(opts);
		const tokens = tokenize(str);
		const filtered = [];
		for (let i = 0; i < tokens.length; i++) {
			const token = tokens[i];
			if (token.isLink && (!type || token.t === type) && options.check(token)) filtered.push(token.toFormattedObject(options));
		}
		return filtered;
	}

//#endregion
//#region node_modules/@tiptap/extension-link/dist/index.js
	var UNICODE_WHITESPACE_PATTERN = "[\0- \xA0 ᠎ -\u2029 　]";
	var UNICODE_WHITESPACE_REGEX = new RegExp(UNICODE_WHITESPACE_PATTERN);
	var UNICODE_WHITESPACE_REGEX_END = new RegExp(`${UNICODE_WHITESPACE_PATTERN}$`);
	var UNICODE_WHITESPACE_REGEX_GLOBAL = new RegExp(UNICODE_WHITESPACE_PATTERN, "g");
	function isValidLinkStructure(tokens) {
		if (tokens.length === 1) return tokens[0].isLink;
		if (tokens.length === 3 && tokens[1].isLink) return ["()", "[]"].includes(tokens[0].value + tokens[2].value);
		return false;
	}
	function autolink(options) {
		return new Plugin({
			key: new PluginKey("autolink"),
			appendTransaction: (transactions, oldState, newState) => {
				const docChanges = transactions.some((transaction) => transaction.docChanged) && !oldState.doc.eq(newState.doc);
				const preventAutolink = transactions.some((transaction) => transaction.getMeta("preventAutolink"));
				if (!docChanges || preventAutolink) return;
				const { tr } = newState;
				getChangedRanges(combineTransactionSteps(oldState.doc, [...transactions])).forEach(({ newRange }) => {
					const nodesInChangedRanges = findChildrenInRange(newState.doc, newRange, (node) => node.isTextblock);
					let textBlock;
					let textBeforeWhitespace;
					if (nodesInChangedRanges.length > 1) {
						textBlock = nodesInChangedRanges[0];
						textBeforeWhitespace = newState.doc.textBetween(textBlock.pos, textBlock.pos + textBlock.node.nodeSize, void 0, " ");
					} else if (nodesInChangedRanges.length) {
						const endText = newState.doc.textBetween(newRange.from, newRange.to, " ", " ");
						if (!UNICODE_WHITESPACE_REGEX_END.test(endText)) return;
						textBlock = nodesInChangedRanges[0];
						textBeforeWhitespace = newState.doc.textBetween(textBlock.pos, newRange.to, void 0, " ");
					}
					if (textBlock && textBeforeWhitespace) {
						const wordsBeforeWhitespace = textBeforeWhitespace.split(UNICODE_WHITESPACE_REGEX).filter(Boolean);
						if (wordsBeforeWhitespace.length <= 0) return false;
						const lastWordBeforeSpace = wordsBeforeWhitespace[wordsBeforeWhitespace.length - 1];
						const lastWordAndBlockOffset = textBlock.pos + textBeforeWhitespace.lastIndexOf(lastWordBeforeSpace);
						if (!lastWordBeforeSpace) return false;
						const linksBeforeSpace = tokenize(lastWordBeforeSpace).map((t) => t.toObject(options.defaultProtocol));
						if (!isValidLinkStructure(linksBeforeSpace)) return false;
						linksBeforeSpace.filter((link) => link.isLink).map((link) => ({
							...link,
							from: lastWordAndBlockOffset + link.start + 1,
							to: lastWordAndBlockOffset + link.end + 1
						})).filter((link) => {
							if (!newState.schema.marks.code) return true;
							return !newState.doc.rangeHasMark(link.from, link.to, newState.schema.marks.code);
						}).filter((link) => options.validate(link.value)).filter((link) => options.shouldAutoLink(link.value)).forEach((link) => {
							if (getMarksBetween(link.from, link.to, newState.doc).some((item) => item.mark.type === options.type)) return;
							tr.addMark(link.from, link.to, options.type.create({ href: link.href }));
						});
					}
				});
				if (!tr.steps.length) return;
				return tr;
			}
		});
	}
	function clickHandler(options) {
		return new Plugin({
			key: new PluginKey("handleClickLink"),
			props: { handleClick: (view, pos, event) => {
				var _a;
				var _b;
				if (event.button !== 0) return false;
				if (!view.editable) return false;
				let link = null;
				if (event.target instanceof HTMLAnchorElement) link = event.target;
				else {
					const target = event.target;
					if (!target) return false;
					const root = options.editor.view.dom;
					link = target.closest("a");
					if (link && !root.contains(link)) link = null;
				}
				if (!link) return false;
				let handled = false;
				if (options.enableClickSelection) handled = options.editor.commands.extendMarkRange(options.type.name);
				if (options.openOnClick) {
					const attrs = getAttributes(view.state, options.type.name);
					const href = (_a = link.href) != null ? _a : attrs.href;
					const target = (_b = link.target) != null ? _b : attrs.target;
					if (href) {
						window.open(href, target);
						handled = true;
					}
				}
				return handled;
			} }
		});
	}
	function pasteHandler(options) {
		return new Plugin({
			key: new PluginKey("handlePasteLink"),
			props: { handlePaste: (view, _event, slice) => {
				const { shouldAutoLink } = options;
				const { state } = view;
				const { selection } = state;
				const { empty } = selection;
				if (empty) return false;
				let textContent = "";
				slice.content.forEach((node) => {
					textContent += node.textContent;
				});
				const link = find(textContent, { defaultProtocol: options.defaultProtocol }).find((item) => item.isLink && item.value === textContent);
				if (!textContent || !link || shouldAutoLink !== void 0 && !shouldAutoLink(link.value)) return false;
				return options.editor.commands.setMark(options.type, { href: link.href });
			} }
		});
	}
	function isAllowedUri(uri, protocols) {
		const allowedProtocols = [
			"http",
			"https",
			"ftp",
			"ftps",
			"mailto",
			"tel",
			"callto",
			"sms",
			"cid",
			"xmpp"
		];
		if (protocols) protocols.forEach((protocol) => {
			const nextProtocol = typeof protocol === "string" ? protocol : protocol.scheme;
			if (nextProtocol) allowedProtocols.push(nextProtocol);
		});
		return !uri || uri.replace(UNICODE_WHITESPACE_REGEX_GLOBAL, "").match(new RegExp(`^(?:(?:${allowedProtocols.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`, "i"));
	}
	var Link = Mark.create({
		name: "link",
		priority: 1e3,
		keepOnSplit: false,
		exitable: true,
		onCreate() {
			if (this.options.validate && !this.options.shouldAutoLink) {
				this.options.shouldAutoLink = this.options.validate;
				console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.");
			}
			this.options.protocols.forEach((protocol) => {
				if (typeof protocol === "string") {
					registerCustomProtocol(protocol);
					return;
				}
				registerCustomProtocol(protocol.scheme, protocol.optionalSlashes);
			});
		},
		onDestroy() {
			reset();
		},
		inclusive() {
			return this.options.autolink;
		},
		addOptions() {
			return {
				openOnClick: true,
				enableClickSelection: false,
				linkOnPaste: true,
				autolink: true,
				protocols: [],
				defaultProtocol: "http",
				HTMLAttributes: {
					target: "_blank",
					rel: "noopener noreferrer nofollow",
					class: null
				},
				isAllowedUri: (url, ctx) => !!isAllowedUri(url, ctx.protocols),
				validate: (url) => !!url,
				shouldAutoLink: (url) => {
					const hasProtocol = /^[a-z][a-z0-9+.-]*:\/\//i.test(url);
					const hasMaybeProtocol = /^[a-z][a-z0-9+.-]*:/i.test(url);
					if (hasProtocol || hasMaybeProtocol && !url.includes("@")) return true;
					const hostname = (url.includes("@") ? url.split("@").pop() : url).split(/[/?#:]/)[0];
					if (/^\d{1,3}(\.\d{1,3}){3}$/.test(hostname)) return false;
					if (!/\./.test(hostname)) return false;
					return true;
				}
			};
		},
		addAttributes() {
			return {
				href: {
					default: null,
					parseHTML(element) {
						return element.getAttribute("href");
					}
				},
				target: { default: this.options.HTMLAttributes.target },
				rel: { default: this.options.HTMLAttributes.rel },
				class: { default: this.options.HTMLAttributes.class },
				title: { default: null }
			};
		},
		parseHTML() {
			return [{
				tag: "a[href]",
				getAttrs: (dom) => {
					const href = dom.getAttribute("href");
					if (!href || !this.options.isAllowedUri(href, {
						defaultValidate: (url) => !!isAllowedUri(url, this.options.protocols),
						protocols: this.options.protocols,
						defaultProtocol: this.options.defaultProtocol
					})) return false;
					return null;
				}
			}];
		},
		renderHTML({ HTMLAttributes }) {
			if (!this.options.isAllowedUri(HTMLAttributes.href, {
				defaultValidate: (href) => !!isAllowedUri(href, this.options.protocols),
				protocols: this.options.protocols,
				defaultProtocol: this.options.defaultProtocol
			})) return [
				"a",
				mergeAttributes(this.options.HTMLAttributes, {
					...HTMLAttributes,
					href: ""
				}),
				0
			];
			return [
				"a",
				mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),
				0
			];
		},
		markdownTokenName: "link",
		parseMarkdown: (token, helpers) => {
			return helpers.applyMark("link", helpers.parseInline(token.tokens || []), {
				href: token.href,
				title: token.title || null
			});
		},
		renderMarkdown: (node, h) => {
			var _a;
			var _b;
			var _c;
			var _d;
			const href = (_b = (_a = node.attrs) == null ? void 0 : _a.href) != null ? _b : "";
			const title = (_d = (_c = node.attrs) == null ? void 0 : _c.title) != null ? _d : "";
			const text = h.renderChildren(node);
			return title ? `[${text}](${href} "${title}")` : `[${text}](${href})`;
		},
		addCommands() {
			return {
				setLink: (attributes) => ({ chain }) => {
					const { href } = attributes;
					if (!this.options.isAllowedUri(href, {
						defaultValidate: (url) => !!isAllowedUri(url, this.options.protocols),
						protocols: this.options.protocols,
						defaultProtocol: this.options.defaultProtocol
					})) return false;
					return chain().setMark(this.name, attributes).setMeta("preventAutolink", true).run();
				},
				toggleLink: (attributes) => ({ chain }) => {
					const { href } = attributes || {};
					if (href && !this.options.isAllowedUri(href, {
						defaultValidate: (url) => !!isAllowedUri(url, this.options.protocols),
						protocols: this.options.protocols,
						defaultProtocol: this.options.defaultProtocol
					})) return false;
					return chain().toggleMark(this.name, attributes, { extendEmptyMarkRange: true }).setMeta("preventAutolink", true).run();
				},
				unsetLink: () => ({ chain }) => {
					return chain().unsetMark(this.name, { extendEmptyMarkRange: true }).setMeta("preventAutolink", true).run();
				}
			};
		},
		addPasteRules() {
			return [markPasteRule({
				find: (text) => {
					const foundLinks = [];
					if (text) {
						const { protocols, defaultProtocol } = this.options;
						const links = find(text).filter((item) => item.isLink && this.options.isAllowedUri(item.value, {
							defaultValidate: (href) => !!isAllowedUri(href, protocols),
							protocols,
							defaultProtocol
						}));
						if (links.length) links.forEach((link) => {
							if (!this.options.shouldAutoLink(link.value)) return;
							foundLinks.push({
								text: link.value,
								data: { href: link.href },
								index: link.start
							});
						});
					}
					return foundLinks;
				},
				type: this.type,
				getAttributes: (match) => {
					var _a;
					return { href: (_a = match.data) == null ? void 0 : _a.href };
				}
			})];
		},
		addProseMirrorPlugins() {
			const plugins = [];
			const { protocols, defaultProtocol } = this.options;
			if (this.options.autolink) plugins.push(autolink({
				type: this.type,
				defaultProtocol: this.options.defaultProtocol,
				validate: (url) => this.options.isAllowedUri(url, {
					defaultValidate: (href) => !!isAllowedUri(href, protocols),
					protocols,
					defaultProtocol
				}),
				shouldAutoLink: this.options.shouldAutoLink
			}));
			plugins.push(clickHandler({
				type: this.type,
				editor: this.editor,
				openOnClick: this.options.openOnClick === "whenNotEditable" ? true : this.options.openOnClick,
				enableClickSelection: this.options.enableClickSelection
			}));
			if (this.options.linkOnPaste) plugins.push(pasteHandler({
				editor: this.editor,
				defaultProtocol: this.options.defaultProtocol,
				type: this.type,
				shouldAutoLink: this.options.shouldAutoLink
			}));
			return plugins;
		}
	});
	var index_default$6 = Link;

//#endregion
//#region node_modules/@tiptap/extension-paragraph/dist/index.js
	var EMPTY_PARAGRAPH_MARKDOWN = "&nbsp;";
	var NBSP_CHAR = "\xA0";
	var Paragraph = Node3.create({
		name: "paragraph",
		priority: 1e3,
		addOptions() {
			return { HTMLAttributes: {} };
		},
		group: "block",
		content: "inline*",
		parseHTML() {
			return [{ tag: "p" }];
		},
		renderHTML({ HTMLAttributes }) {
			return [
				"p",
				mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),
				0
			];
		},
		parseMarkdown: (token, helpers) => {
			const tokens = token.tokens || [];
			if (tokens.length === 1 && tokens[0].type === "image") return helpers.parseChildren([tokens[0]]);
			const content = helpers.parseInline(tokens);
			if (content.length === 1 && content[0].type === "text" && (content[0].text === EMPTY_PARAGRAPH_MARKDOWN || content[0].text === NBSP_CHAR)) return helpers.createNode("paragraph", void 0, []);
			return helpers.createNode("paragraph", void 0, content);
		},
		renderMarkdown: (node, h) => {
			if (!node) return "";
			const content = Array.isArray(node.content) ? node.content : [];
			if (content.length === 0) return EMPTY_PARAGRAPH_MARKDOWN;
			return h.renderChildren(content);
		},
		addCommands() {
			return { setParagraph: () => ({ commands }) => {
				return commands.setNode(this.name);
			} };
		},
		addKeyboardShortcuts() {
			return { "Mod-Alt-0": () => this.editor.commands.setParagraph() };
		}
	});
	var index_default$5 = Paragraph;

//#endregion
//#region node_modules/@tiptap/extension-strike/dist/index.js
	var inputRegex = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/;
	var pasteRegex = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g;
	var Strike = Mark.create({
		name: "strike",
		addOptions() {
			return { HTMLAttributes: {} };
		},
		parseHTML() {
			return [
				{ tag: "s" },
				{ tag: "del" },
				{ tag: "strike" },
				{
					style: "text-decoration",
					consuming: false,
					getAttrs: (style) => style.includes("line-through") ? {} : false
				}
			];
		},
		renderHTML({ HTMLAttributes }) {
			return [
				"s",
				mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),
				0
			];
		},
		markdownTokenName: "del",
		parseMarkdown: (token, helpers) => {
			return helpers.applyMark("strike", helpers.parseInline(token.tokens || []));
		},
		renderMarkdown: (node, h) => {
			return `~~${h.renderChildren(node)}~~`;
		},
		addCommands() {
			return {
				setStrike: () => ({ commands }) => {
					return commands.setMark(this.name);
				},
				toggleStrike: () => ({ commands }) => {
					return commands.toggleMark(this.name);
				},
				unsetStrike: () => ({ commands }) => {
					return commands.unsetMark(this.name);
				}
			};
		},
		addKeyboardShortcuts() {
			return { "Mod-Shift-s": () => this.editor.commands.toggleStrike() };
		},
		addInputRules() {
			return [markInputRule({
				find: inputRegex,
				type: this.type
			})];
		},
		addPasteRules() {
			return [markPasteRule({
				find: pasteRegex,
				type: this.type
			})];
		}
	});
	var index_default$4 = Strike;

//#endregion
//#region node_modules/@tiptap/extension-subscript/dist/index.js
	var Subscript = Mark.create({
		name: "subscript",
		addOptions() {
			return { HTMLAttributes: {} };
		},
		parseHTML() {
			return [{ tag: "sub" }, {
				style: "vertical-align",
				getAttrs(value) {
					if (value !== "sub") return false;
					return null;
				}
			}];
		},
		renderHTML({ HTMLAttributes }) {
			return [
				"sub",
				mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),
				0
			];
		},
		addCommands() {
			return {
				setSubscript: () => ({ commands }) => {
					return commands.setMark(this.name);
				},
				toggleSubscript: () => ({ commands }) => {
					return commands.toggleMark(this.name);
				},
				unsetSubscript: () => ({ commands }) => {
					return commands.unsetMark(this.name);
				}
			};
		},
		addKeyboardShortcuts() {
			return { "Mod-,": () => this.editor.commands.toggleSubscript() };
		}
	});
	var index_default$3 = Subscript;

//#endregion
//#region node_modules/@tiptap/extension-superscript/dist/index.js
	var Superscript = Mark.create({
		name: "superscript",
		addOptions() {
			return { HTMLAttributes: {} };
		},
		parseHTML() {
			return [{ tag: "sup" }, {
				style: "vertical-align",
				getAttrs(value) {
					if (value !== "super") return false;
					return null;
				}
			}];
		},
		renderHTML({ HTMLAttributes }) {
			return [
				"sup",
				mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),
				0
			];
		},
		addCommands() {
			return {
				setSuperscript: () => ({ commands }) => {
					return commands.setMark(this.name);
				},
				toggleSuperscript: () => ({ commands }) => {
					return commands.toggleMark(this.name);
				},
				unsetSuperscript: () => ({ commands }) => {
					return commands.unsetMark(this.name);
				}
			};
		},
		addKeyboardShortcuts() {
			return { "Mod-.": () => this.editor.commands.toggleSuperscript() };
		}
	});
	var index_default$2 = Superscript;

//#endregion
//#region node_modules/@tiptap/extension-text/dist/index.js
	var Text = Node3.create({
		name: "text",
		group: "inline",
		parseMarkdown: (token) => {
			return {
				type: "text",
				text: token.text || ""
			};
		},
		renderMarkdown: (node) => node.text || ""
	});
	var index_default$1 = Text;

//#endregion
//#region node_modules/@tiptap/extension-underline/dist/index.js
	var Underline = Mark.create({
		name: "underline",
		addOptions() {
			return { HTMLAttributes: {} };
		},
		parseHTML() {
			return [{ tag: "u" }, {
				style: "text-decoration",
				consuming: false,
				getAttrs: (style) => style.includes("underline") ? {} : false
			}];
		},
		renderHTML({ HTMLAttributes }) {
			return [
				"u",
				mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),
				0
			];
		},
		parseMarkdown(token, helpers) {
			return helpers.applyMark(this.name || "underline", helpers.parseInline(token.tokens || []));
		},
		renderMarkdown(node, helpers) {
			return `++${helpers.renderChildren(node)}++`;
		},
		markdownTokenizer: {
			name: "underline",
			level: "inline",
			start(src) {
				return src.indexOf("++");
			},
			tokenize(src, _tokens, lexer) {
				const match = /^(\+\+)([\s\S]+?)(\+\+)/.exec(src);
				if (!match) return;
				const innerContent = match[2].trim();
				return {
					type: "underline",
					raw: match[0],
					text: innerContent,
					tokens: lexer.inlineTokens(innerContent)
				};
			}
		},
		addCommands() {
			return {
				setUnderline: () => ({ commands }) => {
					return commands.setMark(this.name);
				},
				toggleUnderline: () => ({ commands }) => {
					return commands.toggleMark(this.name);
				},
				unsetUnderline: () => ({ commands }) => {
					return commands.unsetMark(this.name);
				}
			};
		},
		addKeyboardShortcuts() {
			return {
				"Mod-u": () => this.editor.commands.toggleUnderline(),
				"Mod-U": () => this.editor.commands.toggleUnderline()
			};
		}
	});
	var index_default = Underline;

//#endregion
//#region node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js
/**
	* @license React
	* use-sync-external-store-shim.development.js
	*
	* Copyright (c) Meta Platforms, Inc. and affiliates.
	*
	* This source code is licensed under the MIT license found in the
	* LICENSE file in the root directory of this source tree.
	*/
	var require_use_sync_external_store_shim_development = /* @__PURE__ */ __commonJSMin(((exports) => {
		(function() {
			function is(x, y) {
				return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
			}
			function useSyncExternalStore$2(subscribe, getSnapshot) {
				didWarnOld18Alpha || void 0 === React.startTransition || (didWarnOld18Alpha = !0, console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));
				var value = getSnapshot();
				if (!didWarnUncachedGetSnapshot) {
					var cachedValue = getSnapshot();
					objectIs(value, cachedValue) || (console.error("The result of getSnapshot should be cached to avoid an infinite loop"), didWarnUncachedGetSnapshot = !0);
				}
				cachedValue = useState({ inst: {
					value,
					getSnapshot
				} });
				var inst = cachedValue[0].inst;
				var forceUpdate = cachedValue[1];
				useLayoutEffect(function() {
					inst.value = value;
					inst.getSnapshot = getSnapshot;
					checkIfSnapshotChanged(inst) && forceUpdate({ inst });
				}, [
					subscribe,
					value,
					getSnapshot
				]);
				useEffect(function() {
					checkIfSnapshotChanged(inst) && forceUpdate({ inst });
					return subscribe(function() {
						checkIfSnapshotChanged(inst) && forceUpdate({ inst });
					});
				}, [subscribe]);
				useDebugValue(value);
				return value;
			}
			function checkIfSnapshotChanged(inst) {
				var latestGetSnapshot = inst.getSnapshot;
				inst = inst.value;
				try {
					var nextValue = latestGetSnapshot();
					return !objectIs(inst, nextValue);
				} catch (error) {
					return !0;
				}
			}
			function useSyncExternalStore$1(subscribe, getSnapshot) {
				return getSnapshot();
			}
			"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
			var React = (globalThis.React);
			var objectIs = "function" === typeof Object.is ? Object.is : is;
			var useState = React.useState;
			var useEffect = React.useEffect;
			var useLayoutEffect = React.useLayoutEffect;
			var useDebugValue = React.useDebugValue;
			var didWarnOld18Alpha = !1;
			var didWarnUncachedGetSnapshot = !1;
			var shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
			exports.useSyncExternalStore = void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;
			"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
		})();
	}));

//#endregion
//#region node_modules/use-sync-external-store/shim/index.js
	var require_shim = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		module.exports = require_use_sync_external_store_shim_development();
	}));

//#endregion
//#region node_modules/react/cjs/react-jsx-runtime.development.js
/**
	* @license React
	* react-jsx-runtime.development.js
	*
	* Copyright (c) Facebook, Inc. and its affiliates.
	*
	* This source code is licensed under the MIT license found in the
	* LICENSE file in the root directory of this source tree.
	*/
	var require_react_jsx_runtime_development = /* @__PURE__ */ __commonJSMin(((exports) => {
		(function() {
			"use strict";
			var React = (globalThis.React);
			var REACT_ELEMENT_TYPE = Symbol.for("react.element");
			var REACT_PORTAL_TYPE = Symbol.for("react.portal");
			var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
			var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
			var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
			var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
			var REACT_CONTEXT_TYPE = Symbol.for("react.context");
			var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
			var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
			var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
			var REACT_MEMO_TYPE = Symbol.for("react.memo");
			var REACT_LAZY_TYPE = Symbol.for("react.lazy");
			var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
			var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
			var FAUX_ITERATOR_SYMBOL = "@@iterator";
			function getIteratorFn(maybeIterable) {
				if (maybeIterable === null || typeof maybeIterable !== "object") return null;
				var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
				if (typeof maybeIterator === "function") return maybeIterator;
				return null;
			}
			var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
			function error(format) {
				for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) args[_key2 - 1] = arguments[_key2];
				printWarning("error", format, args);
			}
			function printWarning(level, format, args) {
				var stack = ReactSharedInternals.ReactDebugCurrentFrame.getStackAddendum();
				if (stack !== "") {
					format += "%s";
					args = args.concat([stack]);
				}
				var argsWithFormat = args.map(function(item) {
					return String(item);
				});
				argsWithFormat.unshift("Warning: " + format);
				Function.prototype.apply.call(console[level], console, argsWithFormat);
			}
			var enableScopeAPI = false;
			var enableCacheElement = false;
			var enableTransitionTracing = false;
			var enableLegacyHidden = false;
			var enableDebugTracing = false;
			var REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
			function isValidElementType(type) {
				if (typeof type === "string" || typeof type === "function") return true;
				if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) return true;
				if (typeof type === "object" && type !== null) {
					if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) return true;
				}
				return false;
			}
			function getWrappedName(outerType, innerType, wrapperName) {
				var displayName = outerType.displayName;
				if (displayName) return displayName;
				var functionName = innerType.displayName || innerType.name || "";
				return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
			}
			function getContextName(type) {
				return type.displayName || "Context";
			}
			function getComponentNameFromType(type) {
				if (type == null) return null;
				if (typeof type.tag === "number") error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");
				if (typeof type === "function") return type.displayName || type.name || null;
				if (typeof type === "string") return type;
				switch (type) {
					case REACT_FRAGMENT_TYPE: return "Fragment";
					case REACT_PORTAL_TYPE: return "Portal";
					case REACT_PROFILER_TYPE: return "Profiler";
					case REACT_STRICT_MODE_TYPE: return "StrictMode";
					case REACT_SUSPENSE_TYPE: return "Suspense";
					case REACT_SUSPENSE_LIST_TYPE: return "SuspenseList";
				}
				if (typeof type === "object") switch (type.$$typeof) {
					case REACT_CONTEXT_TYPE: return getContextName(type) + ".Consumer";
					case REACT_PROVIDER_TYPE: return getContextName(type._context) + ".Provider";
					case REACT_FORWARD_REF_TYPE: return getWrappedName(type, type.render, "ForwardRef");
					case REACT_MEMO_TYPE:
						var outerName = type.displayName || null;
						if (outerName !== null) return outerName;
						return getComponentNameFromType(type.type) || "Memo";
					case REACT_LAZY_TYPE:
						var lazyComponent = type;
						var payload = lazyComponent._payload;
						var init = lazyComponent._init;
						try {
							return getComponentNameFromType(init(payload));
						} catch (x) {
							return null;
						}
				}
				return null;
			}
			var assign = Object.assign;
			var disabledDepth = 0;
			var prevLog;
			var prevInfo;
			var prevWarn;
			var prevError;
			var prevGroup;
			var prevGroupCollapsed;
			var prevGroupEnd;
			function disabledLog() {}
			disabledLog.__reactDisabledLog = true;
			function disableLogs() {
				if (disabledDepth === 0) {
					prevLog = console.log;
					prevInfo = console.info;
					prevWarn = console.warn;
					prevError = console.error;
					prevGroup = console.group;
					prevGroupCollapsed = console.groupCollapsed;
					prevGroupEnd = console.groupEnd;
					var props = {
						configurable: true,
						enumerable: true,
						value: disabledLog,
						writable: true
					};
					Object.defineProperties(console, {
						info: props,
						log: props,
						warn: props,
						error: props,
						group: props,
						groupCollapsed: props,
						groupEnd: props
					});
				}
				disabledDepth++;
			}
			function reenableLogs() {
				disabledDepth--;
				if (disabledDepth === 0) {
					var props = {
						configurable: true,
						enumerable: true,
						writable: true
					};
					Object.defineProperties(console, {
						log: assign({}, props, { value: prevLog }),
						info: assign({}, props, { value: prevInfo }),
						warn: assign({}, props, { value: prevWarn }),
						error: assign({}, props, { value: prevError }),
						group: assign({}, props, { value: prevGroup }),
						groupCollapsed: assign({}, props, { value: prevGroupCollapsed }),
						groupEnd: assign({}, props, { value: prevGroupEnd })
					});
				}
				if (disabledDepth < 0) error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
			}
			var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
			var prefix;
			function describeBuiltInComponentFrame(name, source, ownerFn) {
				if (prefix === void 0) try {
					throw Error();
				} catch (x) {
					var match = x.stack.trim().match(/\n( *(at )?)/);
					prefix = match && match[1] || "";
				}
				return "\n" + prefix + name;
			}
			var reentry = false;
			var componentFrameCache = new (typeof WeakMap === "function" ? WeakMap : Map)();
			function describeNativeComponentFrame(fn, construct) {
				if (!fn || reentry) return "";
				var frame = componentFrameCache.get(fn);
				if (frame !== void 0) return frame;
				var control;
				reentry = true;
				var previousPrepareStackTrace = Error.prepareStackTrace;
				Error.prepareStackTrace = void 0;
				var previousDispatcher = ReactCurrentDispatcher.current;
				ReactCurrentDispatcher.current = null;
				disableLogs();
				try {
					if (construct) {
						var Fake = function() {
							throw Error();
						};
						Object.defineProperty(Fake.prototype, "props", { set: function() {
							throw Error();
						} });
						if (typeof Reflect === "object" && Reflect.construct) {
							try {
								Reflect.construct(Fake, []);
							} catch (x) {
								control = x;
							}
							Reflect.construct(fn, [], Fake);
						} else {
							try {
								Fake.call();
							} catch (x) {
								control = x;
							}
							fn.call(Fake.prototype);
						}
					} else {
						try {
							throw Error();
						} catch (x) {
							control = x;
						}
						fn();
					}
				} catch (sample) {
					if (sample && control && typeof sample.stack === "string") {
						var sampleLines = sample.stack.split("\n");
						var controlLines = control.stack.split("\n");
						var s = sampleLines.length - 1;
						var c = controlLines.length - 1;
						while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) c--;
						for (; s >= 1 && c >= 0; s--, c--) if (sampleLines[s] !== controlLines[c]) {
							if (s !== 1 || c !== 1) do {
								s--;
								c--;
								if (c < 0 || sampleLines[s] !== controlLines[c]) {
									var _frame = "\n" + sampleLines[s].replace(" at new ", " at ");
									if (fn.displayName && _frame.includes("<anonymous>")) _frame = _frame.replace("<anonymous>", fn.displayName);
									if (typeof fn === "function") componentFrameCache.set(fn, _frame);
									return _frame;
								}
							} while (s >= 1 && c >= 0);
							break;
						}
					}
				} finally {
					reentry = false;
					ReactCurrentDispatcher.current = previousDispatcher;
					reenableLogs();
					Error.prepareStackTrace = previousPrepareStackTrace;
				}
				var name = fn ? fn.displayName || fn.name : "";
				var syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
				if (typeof fn === "function") componentFrameCache.set(fn, syntheticFrame);
				return syntheticFrame;
			}
			function describeFunctionComponentFrame(fn, source, ownerFn) {
				return describeNativeComponentFrame(fn, false);
			}
			function shouldConstruct(Component) {
				var prototype = Component.prototype;
				return !!(prototype && prototype.isReactComponent);
			}
			function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
				if (type == null) return "";
				if (typeof type === "function") return describeNativeComponentFrame(type, shouldConstruct(type));
				if (typeof type === "string") return describeBuiltInComponentFrame(type);
				switch (type) {
					case REACT_SUSPENSE_TYPE: return describeBuiltInComponentFrame("Suspense");
					case REACT_SUSPENSE_LIST_TYPE: return describeBuiltInComponentFrame("SuspenseList");
				}
				if (typeof type === "object") switch (type.$$typeof) {
					case REACT_FORWARD_REF_TYPE: return describeFunctionComponentFrame(type.render);
					case REACT_MEMO_TYPE: return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
					case REACT_LAZY_TYPE:
						var lazyComponent = type;
						var payload = lazyComponent._payload;
						var init = lazyComponent._init;
						try {
							return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
						} catch (x) {}
				}
				return "";
			}
			var hasOwnProperty = Object.prototype.hasOwnProperty;
			var loggedTypeFailures = {};
			var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
			function setCurrentlyValidatingElement(element) {
				if (element) {
					var owner = element._owner;
					var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
					ReactDebugCurrentFrame.setExtraStackFrame(stack);
				} else ReactDebugCurrentFrame.setExtraStackFrame(null);
			}
			function checkPropTypes(typeSpecs, values, location, componentName, element) {
				var has = Function.call.bind(hasOwnProperty);
				for (var typeSpecName in typeSpecs) if (has(typeSpecs, typeSpecName)) {
					var error$1 = void 0;
					try {
						if (typeof typeSpecs[typeSpecName] !== "function") {
							var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
							err.name = "Invariant Violation";
							throw err;
						}
						error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
					} catch (ex) {
						error$1 = ex;
					}
					if (error$1 && !(error$1 instanceof Error)) {
						setCurrentlyValidatingElement(element);
						error("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1);
						setCurrentlyValidatingElement(null);
					}
					if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
						loggedTypeFailures[error$1.message] = true;
						setCurrentlyValidatingElement(element);
						error("Failed %s type: %s", location, error$1.message);
						setCurrentlyValidatingElement(null);
					}
				}
			}
			var isArrayImpl = Array.isArray;
			function isArray(a) {
				return isArrayImpl(a);
			}
			function typeName(value) {
				return typeof Symbol === "function" && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
			}
			function willCoercionThrow(value) {
				try {
					testStringCoercion(value);
					return false;
				} catch (e) {
					return true;
				}
			}
			function testStringCoercion(value) {
				return "" + value;
			}
			function checkKeyStringCoercion(value) {
				if (willCoercionThrow(value)) {
					error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value));
					return testStringCoercion(value);
				}
			}
			var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
			var RESERVED_PROPS = {
				key: true,
				ref: true,
				__self: true,
				__source: true
			};
			var specialPropKeyWarningShown;
			var specialPropRefWarningShown;
			var didWarnAboutStringRefs = {};
			function hasValidRef(config) {
				if (hasOwnProperty.call(config, "ref")) {
					var getter = Object.getOwnPropertyDescriptor(config, "ref").get;
					if (getter && getter.isReactWarning) return false;
				}
				return config.ref !== void 0;
			}
			function hasValidKey(config) {
				if (hasOwnProperty.call(config, "key")) {
					var getter = Object.getOwnPropertyDescriptor(config, "key").get;
					if (getter && getter.isReactWarning) return false;
				}
				return config.key !== void 0;
			}
			function warnIfStringRefCannotBeAutoConverted(config, self) {
				if (typeof config.ref === "string" && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
					var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
					if (!didWarnAboutStringRefs[componentName]) {
						error("Component \"%s\" contains the string ref \"%s\". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref", getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);
						didWarnAboutStringRefs[componentName] = true;
					}
				}
			}
			function defineKeyPropWarningGetter(props, displayName) {
				var warnAboutAccessingKey = function() {
					if (!specialPropKeyWarningShown) {
						specialPropKeyWarningShown = true;
						error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);
					}
				};
				warnAboutAccessingKey.isReactWarning = true;
				Object.defineProperty(props, "key", {
					get: warnAboutAccessingKey,
					configurable: true
				});
			}
			function defineRefPropWarningGetter(props, displayName) {
				var warnAboutAccessingRef = function() {
					if (!specialPropRefWarningShown) {
						specialPropRefWarningShown = true;
						error("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);
					}
				};
				warnAboutAccessingRef.isReactWarning = true;
				Object.defineProperty(props, "ref", {
					get: warnAboutAccessingRef,
					configurable: true
				});
			}
			/**
			* Factory method to create a new React element. This no longer adheres to
			* the class pattern, so do not use new to call it. Also, instanceof check
			* will not work. Instead test $$typeof field against Symbol.for('react.element') to check
			* if something is a React Element.
			*
			* @param {*} type
			* @param {*} props
			* @param {*} key
			* @param {string|object} ref
			* @param {*} owner
			* @param {*} self A *temporary* helper to detect places where `this` is
			* different from the `owner` when React.createElement is called, so that we
			* can warn. We want to get rid of owner and replace string `ref`s with arrow
			* functions, and as long as `this` and owner are the same, there will be no
			* change in behavior.
			* @param {*} source An annotation object (added by a transpiler or otherwise)
			* indicating filename, line number, and/or other information.
			* @internal
			*/
			var ReactElement = function(type, key, ref, self, source, owner, props) {
				var element = {
					$$typeof: REACT_ELEMENT_TYPE,
					type,
					key,
					ref,
					props,
					_owner: owner
				};
				element._store = {};
				Object.defineProperty(element._store, "validated", {
					configurable: false,
					enumerable: false,
					writable: true,
					value: false
				});
				Object.defineProperty(element, "_self", {
					configurable: false,
					enumerable: false,
					writable: false,
					value: self
				});
				Object.defineProperty(element, "_source", {
					configurable: false,
					enumerable: false,
					writable: false,
					value: source
				});
				if (Object.freeze) {
					Object.freeze(element.props);
					Object.freeze(element);
				}
				return element;
			};
			/**
			* https://github.com/reactjs/rfcs/pull/107
			* @param {*} type
			* @param {object} props
			* @param {string} key
			*/
			function jsxDEV(type, config, maybeKey, source, self) {
				var propName;
				var props = {};
				var key = null;
				var ref = null;
				if (maybeKey !== void 0) {
					checkKeyStringCoercion(maybeKey);
					key = "" + maybeKey;
				}
				if (hasValidKey(config)) {
					checkKeyStringCoercion(config.key);
					key = "" + config.key;
				}
				if (hasValidRef(config)) {
					ref = config.ref;
					warnIfStringRefCannotBeAutoConverted(config, self);
				}
				for (propName in config) if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) props[propName] = config[propName];
				if (type && type.defaultProps) {
					var defaultProps = type.defaultProps;
					for (propName in defaultProps) if (props[propName] === void 0) props[propName] = defaultProps[propName];
				}
				if (key || ref) {
					var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;
					if (key) defineKeyPropWarningGetter(props, displayName);
					if (ref) defineRefPropWarningGetter(props, displayName);
				}
				return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
			}
			var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
			var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
			function setCurrentlyValidatingElement$1(element) {
				if (element) {
					var owner = element._owner;
					var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
					ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
				} else ReactDebugCurrentFrame$1.setExtraStackFrame(null);
			}
			var propTypesMisspellWarningShown = false;
			/**
			* Verifies the object is a ReactElement.
			* See https://reactjs.org/docs/react-api.html#isvalidelement
			* @param {?object} object
			* @return {boolean} True if `object` is a ReactElement.
			* @final
			*/
			function isValidElement(object) {
				return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
			}
			function getDeclarationErrorAddendum() {
				if (ReactCurrentOwner$1.current) {
					var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
					if (name) return "\n\nCheck the render method of `" + name + "`.";
				}
				return "";
			}
			function getSourceInfoErrorAddendum(source) {
				if (source !== void 0) {
					var fileName = source.fileName.replace(/^.*[\\\/]/, "");
					var lineNumber = source.lineNumber;
					return "\n\nCheck your code at " + fileName + ":" + lineNumber + ".";
				}
				return "";
			}
			/**
			* Warn if there's no key explicitly set on dynamic arrays of children or
			* object keys are not valid. This allows us to keep track of children between
			* updates.
			*/
			var ownerHasKeyUseWarning = {};
			function getCurrentComponentErrorInfo(parentType) {
				var info = getDeclarationErrorAddendum();
				if (!info) {
					var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name;
					if (parentName) info = "\n\nCheck the top-level render call using <" + parentName + ">.";
				}
				return info;
			}
			/**
			* Warn if the element doesn't have an explicit key assigned to it.
			* This element is in an array. The array could grow and shrink or be
			* reordered. All children that haven't already been validated are required to
			* have a "key" property assigned to it. Error statuses are cached so a warning
			* will only be shown once.
			*
			* @internal
			* @param {ReactElement} element Element that requires a key.
			* @param {*} parentType element's parent's type.
			*/
			function validateExplicitKey(element, parentType) {
				if (!element._store || element._store.validated || element.key != null) return;
				element._store.validated = true;
				var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
				if (ownerHasKeyUseWarning[currentComponentErrorInfo]) return;
				ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
				var childOwner = "";
				if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
				setCurrentlyValidatingElement$1(element);
				error("Each child in a list should have a unique \"key\" prop.%s%s See https://reactjs.org/link/warning-keys for more information.", currentComponentErrorInfo, childOwner);
				setCurrentlyValidatingElement$1(null);
			}
			/**
			* Ensure that every element either is passed in a static location, in an
			* array with an explicit keys property defined, or in an object literal
			* with valid key property.
			*
			* @internal
			* @param {ReactNode} node Statically passed child of any type.
			* @param {*} parentType node's parent's type.
			*/
			function validateChildKeys(node, parentType) {
				if (typeof node !== "object") return;
				if (isArray(node)) for (var i = 0; i < node.length; i++) {
					var child = node[i];
					if (isValidElement(child)) validateExplicitKey(child, parentType);
				}
				else if (isValidElement(node)) {
					if (node._store) node._store.validated = true;
				} else if (node) {
					var iteratorFn = getIteratorFn(node);
					if (typeof iteratorFn === "function") {
						if (iteratorFn !== node.entries) {
							var iterator = iteratorFn.call(node);
							var step;
							while (!(step = iterator.next()).done) if (isValidElement(step.value)) validateExplicitKey(step.value, parentType);
						}
					}
				}
			}
			/**
			* Given an element, validate that its props follow the propTypes definition,
			* provided by the type.
			*
			* @param {ReactElement} element
			*/
			function validatePropTypes(element) {
				var type = element.type;
				if (type === null || type === void 0 || typeof type === "string") return;
				var propTypes;
				if (typeof type === "function") propTypes = type.propTypes;
				else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_MEMO_TYPE)) propTypes = type.propTypes;
				else return;
				if (propTypes) {
					var name = getComponentNameFromType(type);
					checkPropTypes(propTypes, element.props, "prop", name, element);
				} else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
					propTypesMisspellWarningShown = true;
					error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", getComponentNameFromType(type) || "Unknown");
				}
				if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
			}
			/**
			* Given a fragment, validate that it can only be provided with fragment props
			* @param {ReactElement} fragment
			*/
			function validateFragmentProps(fragment) {
				var keys = Object.keys(fragment.props);
				for (var i = 0; i < keys.length; i++) {
					var key = keys[i];
					if (key !== "children" && key !== "key") {
						setCurrentlyValidatingElement$1(fragment);
						error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key);
						setCurrentlyValidatingElement$1(null);
						break;
					}
				}
				if (fragment.ref !== null) {
					setCurrentlyValidatingElement$1(fragment);
					error("Invalid attribute `ref` supplied to `React.Fragment`.");
					setCurrentlyValidatingElement$1(null);
				}
			}
			var didWarnAboutKeySpread = {};
			function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
				var validType = isValidElementType(type);
				if (!validType) {
					var info = "";
					if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
					var sourceInfo = getSourceInfoErrorAddendum(source);
					if (sourceInfo) info += sourceInfo;
					else info += getDeclarationErrorAddendum();
					var typeString;
					if (type === null) typeString = "null";
					else if (isArray(type)) typeString = "array";
					else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {
						typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />";
						info = " Did you accidentally export a JSX literal instead of a component?";
					} else typeString = typeof type;
					error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info);
				}
				var element = jsxDEV(type, props, key, source, self);
				if (element == null) return element;
				if (validType) {
					var children = props.children;
					if (children !== void 0) if (isStaticChildren) if (isArray(children)) {
						for (var i = 0; i < children.length; i++) validateChildKeys(children[i], type);
						if (Object.freeze) Object.freeze(children);
					} else error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
					else validateChildKeys(children, type);
				}
				if (hasOwnProperty.call(props, "key")) {
					var componentName = getComponentNameFromType(type);
					var keys = Object.keys(props).filter(function(k) {
						return k !== "key";
					});
					var beforeExample = keys.length > 0 ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
					if (!didWarnAboutKeySpread[componentName + beforeExample]) {
						error("A props object containing a \"key\" prop is being spread into JSX:\n  let props = %s;\n  <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n  let props = %s;\n  <%s key={someKey} {...props} />", beforeExample, componentName, keys.length > 0 ? "{" + keys.join(": ..., ") + ": ...}" : "{}", componentName);
						didWarnAboutKeySpread[componentName + beforeExample] = true;
					}
				}
				if (type === REACT_FRAGMENT_TYPE) validateFragmentProps(element);
				else validatePropTypes(element);
				return element;
			}
			function jsxWithValidationStatic(type, props, key) {
				return jsxWithValidation(type, props, key, true);
			}
			function jsxWithValidationDynamic(type, props, key) {
				return jsxWithValidation(type, props, key, false);
			}
			var jsx = jsxWithValidationDynamic;
			var jsxs = jsxWithValidationStatic;
			exports.Fragment = REACT_FRAGMENT_TYPE;
			exports.jsx = jsx;
			exports.jsxs = jsxs;
		})();
	}));

//#endregion
//#region node_modules/react/jsx-runtime.js
	var require_jsx_runtime = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		module.exports = require_react_jsx_runtime_development();
	}));

//#endregion
//#region node_modules/fast-equals/dist/es/index.mjs
var import_shim = require_shim();
var import_jsx_runtime = require_jsx_runtime();
	var { getOwnPropertyNames, getOwnPropertySymbols } = Object;
	var { hasOwnProperty } = Object.prototype;
	/**
	* Combine two comparators into a single comparators.
	*/
	function combineComparators(comparatorA, comparatorB) {
		return function isEqual(a, b, state) {
			return comparatorA(a, b, state) && comparatorB(a, b, state);
		};
	}
	/**
	* Wrap the provided `areItemsEqual` method to manage the circular state, allowing
	* for circular references to be safely included in the comparison without creating
	* stack overflows.
	*/
	function createIsCircular(areItemsEqual) {
		return function isCircular(a, b, state) {
			if (!a || !b || typeof a !== "object" || typeof b !== "object") return areItemsEqual(a, b, state);
			const { cache } = state;
			const cachedA = cache.get(a);
			const cachedB = cache.get(b);
			if (cachedA && cachedB) return cachedA === b && cachedB === a;
			cache.set(a, b);
			cache.set(b, a);
			const result = areItemsEqual(a, b, state);
			cache.delete(a);
			cache.delete(b);
			return result;
		};
	}
	/**
	* Get the `@@toStringTag` of the value, if it exists.
	*/
	function getShortTag(value) {
		return value != null ? value[Symbol.toStringTag] : void 0;
	}
	/**
	* Get the properties to strictly examine, which include both own properties that are
	* not enumerable and symbol properties.
	*/
	function getStrictProperties(object) {
		return getOwnPropertyNames(object).concat(getOwnPropertySymbols(object));
	}
	/**
	* Whether the object contains the property passed as an own property.
	*/
	var hasOwn = Object.hasOwn || ((object, property) => hasOwnProperty.call(object, property));
	/**
	* Whether the values passed are strictly equal or both NaN.
	*/
	function sameValueZeroEqual(a, b) {
		return a === b || !a && !b && a !== a && b !== b;
	}
	var PREACT_VNODE = "__v";
	var PREACT_OWNER = "__o";
	var REACT_OWNER = "_owner";
	var { getOwnPropertyDescriptor, keys } = Object;
	/**
	* Whether the array buffers are equal in value.
	*/
	function areArrayBuffersEqual(a, b) {
		return a.byteLength === b.byteLength && areTypedArraysEqual(new Uint8Array(a), new Uint8Array(b));
	}
	/**
	* Whether the arrays are equal in value.
	*/
	function areArraysEqual(a, b, state) {
		let index = a.length;
		if (b.length !== index) return false;
		while (index-- > 0) if (!state.equals(a[index], b[index], index, index, a, b, state)) return false;
		return true;
	}
	/**
	* Whether the dataviews are equal in value.
	*/
	function areDataViewsEqual(a, b) {
		return a.byteLength === b.byteLength && areTypedArraysEqual(new Uint8Array(a.buffer, a.byteOffset, a.byteLength), new Uint8Array(b.buffer, b.byteOffset, b.byteLength));
	}
	/**
	* Whether the dates passed are equal in value.
	*/
	function areDatesEqual(a, b) {
		return sameValueZeroEqual(a.getTime(), b.getTime());
	}
	/**
	* Whether the errors passed are equal in value.
	*/
	function areErrorsEqual(a, b) {
		return a.name === b.name && a.message === b.message && a.cause === b.cause && a.stack === b.stack;
	}
	/**
	* Whether the functions passed are equal in value.
	*/
	function areFunctionsEqual(a, b) {
		return a === b;
	}
	/**
	* Whether the `Map`s are equal in value.
	*/
	function areMapsEqual(a, b, state) {
		const size = a.size;
		if (size !== b.size) return false;
		if (!size) return true;
		const matchedIndices = new Array(size);
		const aIterable = a.entries();
		let aResult;
		let bResult;
		let index = 0;
		while (aResult = aIterable.next()) {
			if (aResult.done) break;
			const bIterable = b.entries();
			let hasMatch = false;
			let matchIndex = 0;
			while (bResult = bIterable.next()) {
				if (bResult.done) break;
				if (matchedIndices[matchIndex]) {
					matchIndex++;
					continue;
				}
				const aEntry = aResult.value;
				const bEntry = bResult.value;
				if (state.equals(aEntry[0], bEntry[0], index, matchIndex, a, b, state) && state.equals(aEntry[1], bEntry[1], aEntry[0], bEntry[0], a, b, state)) {
					hasMatch = matchedIndices[matchIndex] = true;
					break;
				}
				matchIndex++;
			}
			if (!hasMatch) return false;
			index++;
		}
		return true;
	}
	/**
	* Whether the numbers are equal in value.
	*/
	var areNumbersEqual = sameValueZeroEqual;
	/**
	* Whether the objects are equal in value.
	*/
	function areObjectsEqual(a, b, state) {
		const properties = keys(a);
		let index = properties.length;
		if (keys(b).length !== index) return false;
		while (index-- > 0) if (!isPropertyEqual(a, b, state, properties[index])) return false;
		return true;
	}
	/**
	* Whether the objects are equal in value with strict property checking.
	*/
	function areObjectsEqualStrict(a, b, state) {
		const properties = getStrictProperties(a);
		let index = properties.length;
		if (getStrictProperties(b).length !== index) return false;
		let property;
		let descriptorA;
		let descriptorB;
		while (index-- > 0) {
			property = properties[index];
			if (!isPropertyEqual(a, b, state, property)) return false;
			descriptorA = getOwnPropertyDescriptor(a, property);
			descriptorB = getOwnPropertyDescriptor(b, property);
			if ((descriptorA || descriptorB) && (!descriptorA || !descriptorB || descriptorA.configurable !== descriptorB.configurable || descriptorA.enumerable !== descriptorB.enumerable || descriptorA.writable !== descriptorB.writable)) return false;
		}
		return true;
	}
	/**
	* Whether the primitive wrappers passed are equal in value.
	*/
	function arePrimitiveWrappersEqual(a, b) {
		return sameValueZeroEqual(a.valueOf(), b.valueOf());
	}
	/**
	* Whether the regexps passed are equal in value.
	*/
	function areRegExpsEqual(a, b) {
		return a.source === b.source && a.flags === b.flags;
	}
	/**
	* Whether the `Set`s are equal in value.
	*/
	function areSetsEqual(a, b, state) {
		const size = a.size;
		if (size !== b.size) return false;
		if (!size) return true;
		const matchedIndices = new Array(size);
		const aIterable = a.values();
		let aResult;
		let bResult;
		while (aResult = aIterable.next()) {
			if (aResult.done) break;
			const bIterable = b.values();
			let hasMatch = false;
			let matchIndex = 0;
			while (bResult = bIterable.next()) {
				if (bResult.done) break;
				if (!matchedIndices[matchIndex] && state.equals(aResult.value, bResult.value, aResult.value, bResult.value, a, b, state)) {
					hasMatch = matchedIndices[matchIndex] = true;
					break;
				}
				matchIndex++;
			}
			if (!hasMatch) return false;
		}
		return true;
	}
	/**
	* Whether the TypedArray instances are equal in value.
	*/
	function areTypedArraysEqual(a, b) {
		let index = a.byteLength;
		if (b.byteLength !== index || a.byteOffset !== b.byteOffset) return false;
		while (index-- > 0) if (a[index] !== b[index]) return false;
		return true;
	}
	/**
	* Whether the URL instances are equal in value.
	*/
	function areUrlsEqual(a, b) {
		return a.hostname === b.hostname && a.pathname === b.pathname && a.protocol === b.protocol && a.port === b.port && a.hash === b.hash && a.username === b.username && a.password === b.password;
	}
	function isPropertyEqual(a, b, state, property) {
		if ((property === REACT_OWNER || property === PREACT_OWNER || property === PREACT_VNODE) && (a.$$typeof || b.$$typeof)) return true;
		return hasOwn(b, property) && state.equals(a[property], b[property], property, property, a, b, state);
	}
	var ARRAY_BUFFER_TAG = "[object ArrayBuffer]";
	var ARGUMENTS_TAG = "[object Arguments]";
	var BOOLEAN_TAG = "[object Boolean]";
	var DATA_VIEW_TAG = "[object DataView]";
	var DATE_TAG = "[object Date]";
	var ERROR_TAG = "[object Error]";
	var MAP_TAG = "[object Map]";
	var NUMBER_TAG = "[object Number]";
	var OBJECT_TAG = "[object Object]";
	var REG_EXP_TAG = "[object RegExp]";
	var SET_TAG = "[object Set]";
	var STRING_TAG = "[object String]";
	var TYPED_ARRAY_TAGS = {
		"[object Int8Array]": true,
		"[object Uint8Array]": true,
		"[object Uint8ClampedArray]": true,
		"[object Int16Array]": true,
		"[object Uint16Array]": true,
		"[object Int32Array]": true,
		"[object Uint32Array]": true,
		"[object Float16Array]": true,
		"[object Float32Array]": true,
		"[object Float64Array]": true,
		"[object BigInt64Array]": true,
		"[object BigUint64Array]": true
	};
	var URL_TAG = "[object URL]";
	var toString = Object.prototype.toString;
	/**
	* Create a comparator method based on the type-specific equality comparators passed.
	*/
	function createEqualityComparator({ areArrayBuffersEqual, areArraysEqual, areDataViewsEqual, areDatesEqual, areErrorsEqual, areFunctionsEqual, areMapsEqual, areNumbersEqual, areObjectsEqual, arePrimitiveWrappersEqual, areRegExpsEqual, areSetsEqual, areTypedArraysEqual, areUrlsEqual, unknownTagComparators }) {
		/**
		* compare the value of the two objects and return true if they are equivalent in values
		*/
		return function comparator(a, b, state) {
			if (a === b) return true;
			if (a == null || b == null) return false;
			const type = typeof a;
			if (type !== typeof b) return false;
			if (type !== "object") {
				if (type === "number") return areNumbersEqual(a, b, state);
				if (type === "function") return areFunctionsEqual(a, b, state);
				return false;
			}
			const constructor = a.constructor;
			if (constructor !== b.constructor) return false;
			if (constructor === Object) return areObjectsEqual(a, b, state);
			if (Array.isArray(a)) return areArraysEqual(a, b, state);
			if (constructor === Date) return areDatesEqual(a, b, state);
			if (constructor === RegExp) return areRegExpsEqual(a, b, state);
			if (constructor === Map) return areMapsEqual(a, b, state);
			if (constructor === Set) return areSetsEqual(a, b, state);
			const tag = toString.call(a);
			if (tag === DATE_TAG) return areDatesEqual(a, b, state);
			if (tag === REG_EXP_TAG) return areRegExpsEqual(a, b, state);
			if (tag === MAP_TAG) return areMapsEqual(a, b, state);
			if (tag === SET_TAG) return areSetsEqual(a, b, state);
			if (tag === OBJECT_TAG) return typeof a.then !== "function" && typeof b.then !== "function" && areObjectsEqual(a, b, state);
			if (tag === URL_TAG) return areUrlsEqual(a, b, state);
			if (tag === ERROR_TAG) return areErrorsEqual(a, b, state);
			if (tag === ARGUMENTS_TAG) return areObjectsEqual(a, b, state);
			if (TYPED_ARRAY_TAGS[tag]) return areTypedArraysEqual(a, b, state);
			if (tag === ARRAY_BUFFER_TAG) return areArrayBuffersEqual(a, b, state);
			if (tag === DATA_VIEW_TAG) return areDataViewsEqual(a, b, state);
			if (tag === BOOLEAN_TAG || tag === NUMBER_TAG || tag === STRING_TAG) return arePrimitiveWrappersEqual(a, b, state);
			if (unknownTagComparators) {
				let unknownTagComparator = unknownTagComparators[tag];
				if (!unknownTagComparator) {
					const shortTag = getShortTag(a);
					if (shortTag) unknownTagComparator = unknownTagComparators[shortTag];
				}
				if (unknownTagComparator) return unknownTagComparator(a, b, state);
			}
			return false;
		};
	}
	/**
	* Create the configuration object used for building comparators.
	*/
	function createEqualityComparatorConfig({ circular, createCustomConfig, strict }) {
		let config = {
			areArrayBuffersEqual,
			areArraysEqual: strict ? areObjectsEqualStrict : areArraysEqual,
			areDataViewsEqual,
			areDatesEqual,
			areErrorsEqual,
			areFunctionsEqual,
			areMapsEqual: strict ? combineComparators(areMapsEqual, areObjectsEqualStrict) : areMapsEqual,
			areNumbersEqual,
			areObjectsEqual: strict ? areObjectsEqualStrict : areObjectsEqual,
			arePrimitiveWrappersEqual,
			areRegExpsEqual,
			areSetsEqual: strict ? combineComparators(areSetsEqual, areObjectsEqualStrict) : areSetsEqual,
			areTypedArraysEqual: strict ? combineComparators(areTypedArraysEqual, areObjectsEqualStrict) : areTypedArraysEqual,
			areUrlsEqual,
			unknownTagComparators: void 0
		};
		if (createCustomConfig) config = Object.assign({}, config, createCustomConfig(config));
		if (circular) {
			const areArraysEqual = createIsCircular(config.areArraysEqual);
			const areMapsEqual = createIsCircular(config.areMapsEqual);
			const areObjectsEqual = createIsCircular(config.areObjectsEqual);
			const areSetsEqual = createIsCircular(config.areSetsEqual);
			config = Object.assign({}, config, {
				areArraysEqual,
				areMapsEqual,
				areObjectsEqual,
				areSetsEqual
			});
		}
		return config;
	}
	/**
	* Default equality comparator pass-through, used as the standard `isEqual` creator for
	* use inside the built comparator.
	*/
	function createInternalEqualityComparator(compare) {
		return function(a, b, _indexOrKeyA, _indexOrKeyB, _parentA, _parentB, state) {
			return compare(a, b, state);
		};
	}
	/**
	* Create the `isEqual` function used by the consuming application.
	*/
	function createIsEqual({ circular, comparator, createState, equals, strict }) {
		if (createState) return function isEqual(a, b) {
			const { cache = circular ? /* @__PURE__ */ new WeakMap() : void 0, meta } = createState();
			return comparator(a, b, {
				cache,
				equals,
				meta,
				strict
			});
		};
		if (circular) return function isEqual(a, b) {
			return comparator(a, b, {
				cache: /* @__PURE__ */ new WeakMap(),
				equals,
				meta: void 0,
				strict
			});
		};
		const state = {
			cache: void 0,
			equals,
			meta: void 0,
			strict
		};
		return function isEqual(a, b) {
			return comparator(a, b, state);
		};
	}
	/**
	* Whether the items passed are deeply-equal in value.
	*/
	var deepEqual = createCustomEqual();
	/**
	* Whether the items passed are deeply-equal in value based on strict comparison.
	*/
	var strictDeepEqual = createCustomEqual({ strict: true });
	/**
	* Whether the items passed are deeply-equal in value, including circular references.
	*/
	var circularDeepEqual = createCustomEqual({ circular: true });
	/**
	* Whether the items passed are deeply-equal in value, including circular references,
	* based on strict comparison.
	*/
	var strictCircularDeepEqual = createCustomEqual({
		circular: true,
		strict: true
	});
	/**
	* Whether the items passed are shallowly-equal in value.
	*/
	var shallowEqual = createCustomEqual({ createInternalComparator: () => sameValueZeroEqual });
	/**
	* Whether the items passed are shallowly-equal in value based on strict comparison
	*/
	var strictShallowEqual = createCustomEqual({
		strict: true,
		createInternalComparator: () => sameValueZeroEqual
	});
	/**
	* Whether the items passed are shallowly-equal in value, including circular references.
	*/
	var circularShallowEqual = createCustomEqual({
		circular: true,
		createInternalComparator: () => sameValueZeroEqual
	});
	/**
	* Whether the items passed are shallowly-equal in value, including circular references,
	* based on strict comparison.
	*/
	var strictCircularShallowEqual = createCustomEqual({
		circular: true,
		createInternalComparator: () => sameValueZeroEqual,
		strict: true
	});
	/**
	* Create a custom equality comparison method.
	*
	* This can be done to create very targeted comparisons in extreme hot-path scenarios
	* where the standard methods are not performant enough, but can also be used to provide
	* support for legacy environments that do not support expected features like
	* `RegExp.prototype.flags` out of the box.
	*/
	function createCustomEqual(options = {}) {
		const { circular = false, createInternalComparator: createCustomInternalComparator, createState, strict = false } = options;
		const comparator = createEqualityComparator(createEqualityComparatorConfig(options));
		return createIsEqual({
			circular,
			comparator,
			createState,
			equals: createCustomInternalComparator ? createCustomInternalComparator(comparator) : createInternalEqualityComparator(comparator),
			strict
		});
	}

//#endregion
//#region node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js
/**
	* @license React
	* use-sync-external-store-shim/with-selector.development.js
	*
	* Copyright (c) Meta Platforms, Inc. and affiliates.
	*
	* This source code is licensed under the MIT license found in the
	* LICENSE file in the root directory of this source tree.
	*/
	var require_with_selector_development = /* @__PURE__ */ __commonJSMin(((exports) => {
		(function() {
			function is(x, y) {
				return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
			}
			"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
			var React = (globalThis.React);
			var shim = require_shim();
			var objectIs = "function" === typeof Object.is ? Object.is : is;
			var useSyncExternalStore = shim.useSyncExternalStore;
			var useRef = React.useRef;
			var useEffect = React.useEffect;
			var useMemo = React.useMemo;
			var useDebugValue = React.useDebugValue;
			exports.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
				var instRef = useRef(null);
				if (null === instRef.current) {
					var inst = {
						hasValue: !1,
						value: null
					};
					instRef.current = inst;
				} else inst = instRef.current;
				instRef = useMemo(function() {
					function memoizedSelector(nextSnapshot) {
						if (!hasMemo) {
							hasMemo = !0;
							memoizedSnapshot = nextSnapshot;
							nextSnapshot = selector(nextSnapshot);
							if (void 0 !== isEqual && inst.hasValue) {
								var currentSelection = inst.value;
								if (isEqual(currentSelection, nextSnapshot)) return memoizedSelection = currentSelection;
							}
							return memoizedSelection = nextSnapshot;
						}
						currentSelection = memoizedSelection;
						if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;
						var nextSelection = selector(nextSnapshot);
						if (void 0 !== isEqual && isEqual(currentSelection, nextSelection)) return memoizedSnapshot = nextSnapshot, currentSelection;
						memoizedSnapshot = nextSnapshot;
						return memoizedSelection = nextSelection;
					}
					var hasMemo = !1;
					var memoizedSnapshot;
					var memoizedSelection;
					var maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot;
					return [function() {
						return memoizedSelector(getSnapshot());
					}, null === maybeGetServerSnapshot ? void 0 : function() {
						return memoizedSelector(maybeGetServerSnapshot());
					}];
				}, [
					getSnapshot,
					getServerSnapshot,
					selector,
					isEqual
				]);
				var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);
				useEffect(function() {
					inst.hasValue = !0;
					inst.value = value;
				}, [value]);
				useDebugValue(value);
				return value;
			};
			"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
		})();
	}));

//#endregion
//#region node_modules/use-sync-external-store/shim/with-selector.js
	var require_with_selector = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		module.exports = require_with_selector_development();
	}));

//#endregion
//#region node_modules/@tiptap/react/dist/index.js
	var import_with_selector = require_with_selector();
	var mergeRefs = (...refs) => {
		return (node) => {
			refs.forEach((ref) => {
				if (typeof ref === "function") ref(node);
				else if (ref) ref.current = node;
			});
		};
	};
	var Portals = ({ contentComponent }) => {
		const renderers = (0, import_shim.useSyncExternalStore)(contentComponent.subscribe, contentComponent.getSnapshot, contentComponent.getServerSnapshot);
		return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: Object.values(renderers) });
	};
	function getInstance() {
		const subscribers = /* @__PURE__ */ new Set();
		let renderers = {};
		return {
			/**
			* Subscribe to the editor instance's changes.
			*/
			subscribe(callback) {
				subscribers.add(callback);
				return () => {
					subscribers.delete(callback);
				};
			},
			getSnapshot() {
				return renderers;
			},
			getServerSnapshot() {
				return renderers;
			},
			/**
			* Adds a new NodeView Renderer to the editor.
			*/
			setRenderer(id, renderer) {
				renderers = {
					...renderers,
					[id]: react_dom$1.default.createPortal(renderer.reactElement, renderer.element, id)
				};
				subscribers.forEach((subscriber) => subscriber());
			},
			/**
			* Removes a NodeView Renderer from the editor.
			*/
			removeRenderer(id) {
				const nextRenderers = { ...renderers };
				delete nextRenderers[id];
				renderers = nextRenderers;
				subscribers.forEach((subscriber) => subscriber());
			}
		};
	}
	var PureEditorContent = class extends react$1.default.Component {
		constructor(props) {
			var _a;
			super(props);
			this.editorContentRef = react$1.default.createRef();
			this.initialized = false;
			this.state = { hasContentComponentInitialized: Boolean((_a = props.editor) == null ? void 0 : _a.contentComponent) };
		}
		componentDidMount() {
			this.init();
		}
		componentDidUpdate() {
			this.init();
		}
		init() {
			var _a;
			const editor = this.props.editor;
			if (editor && !editor.isDestroyed && ((_a = editor.view.dom) == null ? void 0 : _a.parentNode)) {
				if (editor.contentComponent) return;
				const element = this.editorContentRef.current;
				element.append(...editor.view.dom.parentNode.childNodes);
				editor.setOptions({ element });
				editor.contentComponent = getInstance();
				if (!this.state.hasContentComponentInitialized) this.unsubscribeToContentComponent = editor.contentComponent.subscribe(() => {
					this.setState((prevState) => {
						if (!prevState.hasContentComponentInitialized) return { hasContentComponentInitialized: true };
						return prevState;
					});
					if (this.unsubscribeToContentComponent) this.unsubscribeToContentComponent();
				});
				editor.createNodeViews();
				this.initialized = true;
			}
		}
		componentWillUnmount() {
			var _a;
			const editor = this.props.editor;
			if (!editor) return;
			this.initialized = false;
			if (!editor.isDestroyed) editor.view.setProps({ nodeViews: {} });
			if (this.unsubscribeToContentComponent) this.unsubscribeToContentComponent();
			editor.contentComponent = null;
			try {
				if (!((_a = editor.view.dom) == null ? void 0 : _a.parentNode)) return;
				const newElement = document.createElement("div");
				newElement.append(...editor.view.dom.parentNode.childNodes);
				editor.setOptions({ element: newElement });
			} catch {}
		}
		render() {
			const { editor, innerRef, ...rest } = this.props;
			return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
				ref: mergeRefs(innerRef, this.editorContentRef),
				...rest
			}), (editor == null ? void 0 : editor.contentComponent) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Portals, { contentComponent: editor.contentComponent })] });
		}
	};
	var EditorContentWithKey = (0, react$1.forwardRef)((props, ref) => {
		const key = react$1.default.useMemo(() => {
			return Math.floor(Math.random() * 4294967295).toString();
		}, [props.editor]);
		return react$1.default.createElement(PureEditorContent, {
			key,
			innerRef: ref,
			...props
		});
	});
	var EditorContent = react$1.default.memo(EditorContentWithKey);
	var useIsomorphicLayoutEffect = typeof window !== "undefined" ? react$1.useLayoutEffect : react$1.useEffect;
	var EditorStateManager = class {
		constructor(initialEditor) {
			this.transactionNumber = 0;
			this.lastTransactionNumber = 0;
			this.subscribers = /* @__PURE__ */ new Set();
			this.editor = initialEditor;
			this.lastSnapshot = {
				editor: initialEditor,
				transactionNumber: 0
			};
			this.getSnapshot = this.getSnapshot.bind(this);
			this.getServerSnapshot = this.getServerSnapshot.bind(this);
			this.watch = this.watch.bind(this);
			this.subscribe = this.subscribe.bind(this);
		}
		/**
		* Get the current editor instance.
		*/
		getSnapshot() {
			if (this.transactionNumber === this.lastTransactionNumber) return this.lastSnapshot;
			this.lastTransactionNumber = this.transactionNumber;
			this.lastSnapshot = {
				editor: this.editor,
				transactionNumber: this.transactionNumber
			};
			return this.lastSnapshot;
		}
		/**
		* Always disable the editor on the server-side.
		*/
		getServerSnapshot() {
			return {
				editor: null,
				transactionNumber: 0
			};
		}
		/**
		* Subscribe to the editor instance's changes.
		*/
		subscribe(callback) {
			this.subscribers.add(callback);
			return () => {
				this.subscribers.delete(callback);
			};
		}
		/**
		* Watch the editor instance for changes.
		*/
		watch(nextEditor) {
			this.editor = nextEditor;
			if (this.editor) {
				const fn = () => {
					this.transactionNumber += 1;
					this.subscribers.forEach((callback) => callback());
				};
				const currentEditor = this.editor;
				currentEditor.on("transaction", fn);
				return () => {
					currentEditor.off("transaction", fn);
				};
			}
		}
	};
	function useEditorState(options) {
		var _a;
		const [editorStateManager] = (0, react$1.useState)(() => new EditorStateManager(options.editor));
		const selectedState = (0, import_with_selector.useSyncExternalStoreWithSelector)(editorStateManager.subscribe, editorStateManager.getSnapshot, editorStateManager.getServerSnapshot, options.selector, (_a = options.equalityFn) != null ? _a : deepEqual);
		useIsomorphicLayoutEffect(() => {
			return editorStateManager.watch(options.editor);
		}, [options.editor, editorStateManager]);
		(0, react$1.useDebugValue)(selectedState);
		return selectedState;
	}
	var isDev = true;
	var isSSR = typeof window === "undefined";
	var isNext = isSSR || Boolean(typeof window !== "undefined" && window.next);
	var EditorInstanceManager = class _EditorInstanceManager {
		constructor(options) {
			/**
			* The current editor instance.
			*/
			this.editor = null;
			/**
			* The subscriptions to notify when the editor instance
			* has been created or destroyed.
			*/
			this.subscriptions = /* @__PURE__ */ new Set();
			/**
			* Whether the editor has been mounted.
			*/
			this.isComponentMounted = false;
			/**
			* The most recent dependencies array.
			*/
			this.previousDeps = null;
			/**
			* The unique instance ID. This is used to identify the editor instance. And will be re-generated for each new instance.
			*/
			this.instanceId = "";
			this.options = options;
			this.subscriptions = /* @__PURE__ */ new Set();
			this.setEditor(this.getInitialEditor());
			this.scheduleDestroy();
			this.getEditor = this.getEditor.bind(this);
			this.getServerSnapshot = this.getServerSnapshot.bind(this);
			this.subscribe = this.subscribe.bind(this);
			this.refreshEditorInstance = this.refreshEditorInstance.bind(this);
			this.scheduleDestroy = this.scheduleDestroy.bind(this);
			this.onRender = this.onRender.bind(this);
			this.createEditor = this.createEditor.bind(this);
		}
		setEditor(editor) {
			this.editor = editor;
			this.instanceId = Math.random().toString(36).slice(2, 9);
			this.subscriptions.forEach((cb) => cb());
		}
		getInitialEditor() {
			if (this.options.current.immediatelyRender === void 0) {
				if (isSSR || isNext) {
					if (isDev) throw new Error("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches.");
					return null;
				}
				return this.createEditor();
			}
			if (this.options.current.immediatelyRender && isSSR && isDev) throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");
			if (this.options.current.immediatelyRender) return this.createEditor();
			return null;
		}
		/**
		* Create a new editor instance. And attach event listeners.
		*/
		createEditor() {
			return new Editor({
				...this.options.current,
				onBeforeCreate: (...args) => {
					var _a;
					var _b;
					return (_b = (_a = this.options.current).onBeforeCreate) == null ? void 0 : _b.call(_a, ...args);
				},
				onBlur: (...args) => {
					var _a;
					var _b;
					return (_b = (_a = this.options.current).onBlur) == null ? void 0 : _b.call(_a, ...args);
				},
				onCreate: (...args) => {
					var _a;
					var _b;
					return (_b = (_a = this.options.current).onCreate) == null ? void 0 : _b.call(_a, ...args);
				},
				onDestroy: (...args) => {
					var _a;
					var _b;
					return (_b = (_a = this.options.current).onDestroy) == null ? void 0 : _b.call(_a, ...args);
				},
				onFocus: (...args) => {
					var _a;
					var _b;
					return (_b = (_a = this.options.current).onFocus) == null ? void 0 : _b.call(_a, ...args);
				},
				onSelectionUpdate: (...args) => {
					var _a;
					var _b;
					return (_b = (_a = this.options.current).onSelectionUpdate) == null ? void 0 : _b.call(_a, ...args);
				},
				onTransaction: (...args) => {
					var _a;
					var _b;
					return (_b = (_a = this.options.current).onTransaction) == null ? void 0 : _b.call(_a, ...args);
				},
				onUpdate: (...args) => {
					var _a;
					var _b;
					return (_b = (_a = this.options.current).onUpdate) == null ? void 0 : _b.call(_a, ...args);
				},
				onContentError: (...args) => {
					var _a;
					var _b;
					return (_b = (_a = this.options.current).onContentError) == null ? void 0 : _b.call(_a, ...args);
				},
				onDrop: (...args) => {
					var _a;
					var _b;
					return (_b = (_a = this.options.current).onDrop) == null ? void 0 : _b.call(_a, ...args);
				},
				onPaste: (...args) => {
					var _a;
					var _b;
					return (_b = (_a = this.options.current).onPaste) == null ? void 0 : _b.call(_a, ...args);
				},
				onDelete: (...args) => {
					var _a;
					var _b;
					return (_b = (_a = this.options.current).onDelete) == null ? void 0 : _b.call(_a, ...args);
				}
			});
		}
		/**
		* Get the current editor instance.
		*/
		getEditor() {
			return this.editor;
		}
		/**
		* Always disable the editor on the server-side.
		*/
		getServerSnapshot() {
			return null;
		}
		/**
		* Subscribe to the editor instance's changes.
		*/
		subscribe(onStoreChange) {
			this.subscriptions.add(onStoreChange);
			return () => {
				this.subscriptions.delete(onStoreChange);
			};
		}
		static compareOptions(a, b) {
			return Object.keys(a).every((key) => {
				if ([
					"onCreate",
					"onBeforeCreate",
					"onDestroy",
					"onUpdate",
					"onTransaction",
					"onFocus",
					"onBlur",
					"onSelectionUpdate",
					"onContentError",
					"onDrop",
					"onPaste"
				].includes(key)) return true;
				if (key === "extensions" && a.extensions && b.extensions) {
					if (a.extensions.length !== b.extensions.length) return false;
					return a.extensions.every((extension, index) => {
						var _a;
						if (extension !== ((_a = b.extensions) == null ? void 0 : _a[index])) return false;
						return true;
					});
				}
				if (a[key] !== b[key]) return false;
				return true;
			});
		}
		/**
		* On each render, we will create, update, or destroy the editor instance.
		* @param deps The dependencies to watch for changes
		* @returns A cleanup function
		*/
		onRender(deps) {
			return () => {
				this.isComponentMounted = true;
				clearTimeout(this.scheduledDestructionTimeout);
				if (this.editor && !this.editor.isDestroyed && deps.length === 0) {
					if (!_EditorInstanceManager.compareOptions(this.options.current, this.editor.options)) this.editor.setOptions({
						...this.options.current,
						editable: this.editor.isEditable
					});
				} else this.refreshEditorInstance(deps);
				return () => {
					this.isComponentMounted = false;
					this.scheduleDestroy();
				};
			};
		}
		/**
		* Recreate the editor instance if the dependencies have changed.
		*/
		refreshEditorInstance(deps) {
			if (this.editor && !this.editor.isDestroyed) {
				if (this.previousDeps === null) {
					this.previousDeps = deps;
					return;
				}
				if (this.previousDeps.length === deps.length && this.previousDeps.every((dep, index) => dep === deps[index])) return;
			}
			if (this.editor && !this.editor.isDestroyed) this.editor.destroy();
			this.setEditor(this.createEditor());
			this.previousDeps = deps;
		}
		/**
		* Schedule the destruction of the editor instance.
		* This will only destroy the editor if it was not mounted on the next tick.
		* This is to avoid destroying the editor instance when it's actually still mounted.
		*/
		scheduleDestroy() {
			const currentInstanceId = this.instanceId;
			const currentEditor = this.editor;
			this.scheduledDestructionTimeout = setTimeout(() => {
				if (this.isComponentMounted && this.instanceId === currentInstanceId) {
					if (currentEditor) currentEditor.setOptions(this.options.current);
					return;
				}
				if (currentEditor && !currentEditor.isDestroyed) {
					currentEditor.destroy();
					if (this.instanceId === currentInstanceId) this.setEditor(null);
				}
			}, 1);
		}
	};
	function useEditor(options = {}, deps = []) {
		const mostRecentOptions = (0, react$1.useRef)(options);
		mostRecentOptions.current = options;
		const [instanceManager] = (0, react$1.useState)(() => new EditorInstanceManager(mostRecentOptions));
		const editor = (0, import_shim.useSyncExternalStore)(instanceManager.subscribe, instanceManager.getEditor, instanceManager.getServerSnapshot);
		(0, react$1.useDebugValue)(editor);
		(0, react$1.useEffect)(instanceManager.onRender(deps));
		useEditorState({
			editor,
			selector: ({ transactionNumber }) => {
				if (options.shouldRerenderOnTransaction === false || options.shouldRerenderOnTransaction === void 0) return null;
				if (options.immediatelyRender && transactionNumber === 0) return 0;
				return transactionNumber + 1;
			}
		});
		return editor;
	}
	var EditorContext = (0, react$1.createContext)({ editor: null });
	var EditorConsumer = EditorContext.Consumer;
	var ReactNodeViewContext = (0, react$1.createContext)({
		onDragStart: () => {},
		nodeViewContentChildren: void 0,
		nodeViewContentRef: () => {}
	});
	var useReactNodeView = () => (0, react$1.useContext)(ReactNodeViewContext);
	var NodeViewWrapper = react$1.default.forwardRef((props, ref) => {
		const { onDragStart } = useReactNodeView();
		return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(props.as || "div", {
			...props,
			ref,
			"data-node-view-wrapper": "",
			onDragStart,
			style: {
				whiteSpace: "normal",
				...props.style
			}
		});
	});
	var ReactMarkViewContext = react$1.default.createContext({ markViewContentRef: () => {} });
	var TiptapContext = (0, react$1.createContext)({ get editor() {
		throw new Error("useTiptap must be used within a <Tiptap> provider");
	} });
	TiptapContext.displayName = "TiptapContext";
	var useTiptap = () => (0, react$1.useContext)(TiptapContext);
	function TiptapWrapper({ editor, instance, children }) {
		const resolvedEditor = editor != null ? editor : instance;
		if (!resolvedEditor) throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");
		const tiptapContextValue = (0, react$1.useMemo)(() => ({ editor: resolvedEditor }), [resolvedEditor]);
		const legacyContextValue = (0, react$1.useMemo)(() => ({ editor: resolvedEditor }), [resolvedEditor]);
		return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EditorContext.Provider, {
			value: legacyContextValue,
			children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TiptapContext.Provider, {
				value: tiptapContextValue,
				children
			})
		});
	}
	TiptapWrapper.displayName = "Tiptap";
	function TiptapContent({ ...rest }) {
		const { editor } = useTiptap();
		return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EditorContent, {
			editor,
			...rest
		});
	}
	TiptapContent.displayName = "Tiptap.Content";
	var Tiptap = Object.assign(TiptapWrapper, { 
	/**
	* The Tiptap Content component that renders the EditorContent with the editor instance from the context.
	* @see TiptapContent
	*/
Content: TiptapContent });

//#endregion
//#region packages/packages/libs/editor-controls/src/utils/inline-editing.ts
	function isEmpty(value = "") {
		if (!value) return true;
		const pseudoElement = document.createElement("div");
		pseudoElement.innerHTML = value;
		return !pseudoElement.textContent?.length;
	}
	function htmlToPlainText(html) {
		if (!html) return "";
		const normalizedHtml = html.replace(/<br\s*\/?>/gi, "\n").replace(/<\/p>\s*<p[^>]*>/gi, "\n");
		return new DOMParser().parseFromString(normalizedHtml, "text/html").body.textContent ?? "";
	}
	function extractInlineHtmlContent(propValue) {
		if (_elementor_editor_props.escapedHtmlPropTypeUtil.isValid(propValue)) return _elementor_editor_props.escapedHtmlPropTypeUtil.extract(propValue) ?? "";
		const htmlV3 = _elementor_editor_props.htmlV3PropTypeUtil.extract(propValue);
		return _elementor_editor_props.stringPropTypeUtil.extract(htmlV3?.content ?? null) ?? "";
	}

//#endregion
//#region packages/packages/libs/editor-controls/src/components/inline-editor.tsx
	var ITALIC_KEYBOARD_SHORTCUT = "i";
	var BOLD_KEYBOARD_SHORTCUT = "b";
	var UNDERLINE_KEYBOARD_SHORTCUT = "u";
	var InlineEditor = react.forwardRef((props, ref) => {
		const { value, setValue, placeholder = null, editorProps = {}, elementClasses = "", autofocus = false, sx = {}, onBlur = void 0, expectedTag = null, onEditorCreate, onEditorDestroy, wrapperClassName, onSelectionEnd, mountElement = null } = props;
		const containerRef = (0, react.useRef)(null);
		const onBlurRef = (0, react.useRef)(onBlur);
		onBlurRef.current = onBlur;
		const documentContentSettings = !!expectedTag ? "block+" : "inline*";
		const onUpdate = ({ editor: updatedEditor }) => {
			const newValue = updatedEditor.getHTML();
			setValue(isEmpty(newValue) ? null : newValue);
		};
		const onKeyDown = (_, event) => {
			if (event.key === "Escape") onBlurRef.current?.();
			if (!event.metaKey && !event.ctrlKey || event.altKey) return;
			if ([
				ITALIC_KEYBOARD_SHORTCUT,
				BOLD_KEYBOARD_SHORTCUT,
				UNDERLINE_KEYBOARD_SHORTCUT
			].includes(event.key)) event.stopPropagation();
		};
		const editedElementAttributes = (HTMLAttributes) => ({
			...HTMLAttributes,
			class: elementClasses
		});
		const editor = useEditor({
			...mountElement ? { element: mountElement } : {},
			extensions: [
				index_default$10.extend({ content: documentContentSettings }),
				index_default$5.extend({ renderHTML({ HTMLAttributes }) {
					return [
						expectedTag ?? "p",
						editedElementAttributes(HTMLAttributes),
						0
					];
				} }),
				index_default$8.extend({ renderHTML({ node, HTMLAttributes }) {
					if (expectedTag) return [
						expectedTag,
						editedElementAttributes(HTMLAttributes),
						0
					];
					return [
						`h${this.options.levels.includes(node.attrs.level) ? node.attrs.level : this.options.levels[0]}`,
						editedElementAttributes(HTMLAttributes),
						0
					];
				} }).configure({ levels: [
					1,
					2,
					3,
					4,
					5,
					6
				] }),
				index_default$6.configure({ openOnClick: false }),
				index_default$1,
				index_default$11,
				index_default$7,
				index_default$4,
				index_default$2,
				index_default$3,
				index_default,
				index_default$9.extend({ addKeyboardShortcuts() {
					return { Enter: () => this.editor.commands.setHardBreak() };
				} })
			],
			content: value,
			onUpdate,
			autofocus,
			editorProps: {
				...editorProps,
				handleDOMEvents: { keydown: onKeyDown },
				attributes: {
					...editorProps.attributes ?? {},
					role: "textbox",
					...placeholder ? { "data-placeholder": htmlToPlainText(placeholder) } : {},
					...value === null || value === "" ? { class: "is-empty" } : {}
				}
			},
			onCreate: onEditorCreate ? ({ editor: mountedEditor }) => onEditorCreate(mountedEditor) : void 0,
			onDestroy: onEditorDestroy ? () => onEditorDestroy() : void 0,
			onBlur: mountElement ? void 0 : () => onBlurRef.current?.(),
			onSelectionUpdate: onSelectionEnd ? ({ editor: updatedEditor }) => onSelectionEnd(updatedEditor.view) : void 0
		});
		useOnUpdate(() => {
			if (!editor) return;
			if (editor.getHTML() !== value) editor.commands.setContent(value, { emitUpdate: false });
		}, [editor, value]);
		if (mountElement) return null;
		return /* @__PURE__ */ react.createElement(_elementor_ui.Box, {
			ref: containerRef,
			sx,
			className: wrapperClassName
		}, /* @__PURE__ */ react.createElement(EditorContent, {
			ref,
			editor
		}));
	});
	var useOnUpdate = (callback, dependencies) => {
		const hasMounted = (0, react.useRef)(false);
		(0, react.useEffect)(() => {
			if (hasMounted.current) callback();
			else hasMounted.current = true;
		}, dependencies);
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/components/url-popover.tsx
	var UrlPopover = ({ popupState, restoreValue, anchorRef, value, onChange, openInNewTab, onToggleNewTab }) => {
		const inputRef = (0, react.useRef)(null);
		(0, react.useEffect)(() => {
			if (popupState.isOpen) requestAnimationFrame(() => inputRef.current?.focus());
		}, [popupState.isOpen]);
		const handleClose = () => {
			restoreValue();
			popupState.close();
		};
		return /* @__PURE__ */ react.createElement(_elementor_ui.Popover, {
			slotProps: { paper: { sx: {
				borderRadius: "16px",
				width: anchorRef.current?.offsetWidth + "px",
				marginTop: -1
			} } },
			...(0, _elementor_ui.bindPopover)(popupState),
			anchorOrigin: {
				vertical: "top",
				horizontal: "left"
			},
			transformOrigin: {
				vertical: "top",
				horizontal: "left"
			},
			onClose: handleClose
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Stack, {
			direction: "row",
			alignItems: "center",
			gap: 1,
			sx: { p: 1.5 }
		}, /* @__PURE__ */ react.createElement(_elementor_ui.TextField, {
			value,
			onChange,
			size: "tiny",
			fullWidth: true,
			placeholder: (0, _wordpress_i18n.__)("Type a URL", "elementor"),
			inputProps: { ref: inputRef },
			color: "secondary",
			InputProps: { sx: { borderRadius: "8px" } },
			onKeyUp: (event) => event.key === "Enter" && handleClose()
		}), /* @__PURE__ */ react.createElement(_elementor_ui.Tooltip, { title: (0, _wordpress_i18n.__)("Open in a new tab", "elementor") }, /* @__PURE__ */ react.createElement(_elementor_ui.ToggleButton, {
			size: "tiny",
			value: "newTab",
			selected: openInNewTab,
			onClick: onToggleNewTab,
			"aria-label": (0, _wordpress_i18n.__)("Open in a new tab", "elementor"),
			sx: { borderRadius: "8px" }
		}, /* @__PURE__ */ react.createElement(_elementor_icons.ExternalLinkIcon, { fontSize: "tiny" })))));
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/components/inline-editor-toolbar.tsx
	var InlineEditorToolbar = ({ editor, elementId, sx = {}, inControlPanel = false }) => {
		const [urlValue, setUrlValue] = (0, react.useState)("");
		const [openInNewTab, setOpenInNewTab] = (0, react.useState)(false);
		const toolbarRef = (0, react.useRef)(null);
		const linkPopupState = (0, _elementor_ui.usePopupState)({ variant: "popover" });
		const isElementClickable = elementId ? checkIfElementIsClickable(elementId) : false;
		const editorState = useEditorState({
			editor,
			selector: (ctx) => possibleFormats.filter((format) => ctx.editor.isActive(format))
		});
		const formatButtonsList = (0, react.useMemo)(() => {
			const buttons = Object.values(formatButtons);
			if (isElementClickable) return buttons.filter((button) => button.action !== "link");
			return buttons;
		}, [isElementClickable]);
		const handleLinkClick = () => {
			const linkAttrs = editor.getAttributes("link");
			setUrlValue(linkAttrs.href || "");
			setOpenInNewTab(linkAttrs.target === "_blank");
			linkPopupState.open(toolbarRef.current);
		};
		const handleUrlChange = (event) => {
			setUrlValue(event.target.value);
		};
		const handleToggleNewTab = () => {
			setOpenInNewTab(!openInNewTab);
		};
		const handleUrlSubmit = () => {
			if (urlValue) editor.chain().focus().setLink({
				href: urlValue,
				target: openInNewTab ? "_blank" : "_self"
			}).run();
			else editor.chain().focus().unsetLink().run();
			if (elementId) window.dispatchEvent(new CustomEvent("elementor:inline-link-changed", { detail: { elementId } }));
			linkPopupState.close();
		};
		(0, react.useEffect)(() => {
			if (!inControlPanel) editor?.commands?.focus();
		}, [editor, inControlPanel]);
		return /* @__PURE__ */ react.createElement(_elementor_ui.Box, {
			ref: toolbarRef,
			sx: {
				display: "inline-flex",
				gap: .5,
				padding: .5,
				borderRadius: "8px",
				backgroundColor: "background.paper",
				boxShadow: "0 2px 8px rgba(0, 0, 0, 0.2)",
				alignItems: "center",
				visibility: linkPopupState.isOpen ? "hidden" : "visible",
				pointerEvents: linkPopupState.isOpen ? "none" : "all",
				...sx,
				...inControlPanel && {
					width: "100%",
					justifyContent: "center",
					flexDirection: "row",
					backgroundColor: "transparent",
					boxShadow: "none",
					borderWidth: "0",
					borderBottom: "1px solid",
					borderBottomColor: (theme) => theme.palette.text.secondary,
					borderRadius: "0",
					position: "absolute",
					top: "0",
					left: "0",
					"&, & .MuiIconButton-root, & .MuiToggleButton-root": { color: (theme) => theme.palette.text.primary }
				}
			}
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Tooltip, {
			title: clearButton.label,
			placement: "top",
			sx: { borderRadius: "8px" }
		}, /* @__PURE__ */ react.createElement(_elementor_ui.IconButton, {
			"aria-label": clearButton.label,
			onClick: () => clearButton.method(editor),
			size: "tiny"
		}, clearButton.icon)), /* @__PURE__ */ react.createElement(_elementor_ui.ToggleButtonGroup, {
			value: editorState,
			size: "tiny",
			sx: {
				display: "flex",
				gap: .5,
				border: "none",
				[`& .${_elementor_ui.toggleButtonGroupClasses.firstButton}, & .${_elementor_ui.toggleButtonGroupClasses.middleButton}, & .${_elementor_ui.toggleButtonGroupClasses.lastButton}`]: {
					borderRadius: "8px",
					border: "none",
					marginLeft: 0,
					"&.Mui-selected": { marginLeft: 0 },
					"& + &.Mui-selected": { marginLeft: 0 }
				},
				...inControlPanel && {
					justifyContent: "space-between",
					width: "100%",
					"& svg": {
						width: "0.7rem",
						height: "0.7rem"
					}
				}
			}
		}, formatButtonsList.map((button) => /* @__PURE__ */ react.createElement(_elementor_ui.Tooltip, {
			title: button.label,
			key: button.action,
			placement: "top"
		}, /* @__PURE__ */ react.createElement(_elementor_ui.ToggleButton, {
			value: button.action,
			"aria-label": button.label,
			size: "tiny",
			onClick: () => {
				if (button.action === "link") handleLinkClick();
				else button.method?.(editor);
				editor?.commands?.focus();
			}
		}, button.icon)))), /* @__PURE__ */ react.createElement(UrlPopover, {
			popupState: linkPopupState,
			anchorRef: toolbarRef,
			restoreValue: handleUrlSubmit,
			value: urlValue,
			onChange: handleUrlChange,
			openInNewTab,
			onToggleNewTab: handleToggleNewTab
		}));
	};
	var checkIfElementIsClickable = (elementId) => {
		const isButton = (0, _elementor_editor_elements.getContainer)(elementId)?.model.get("widgetType") === "e-button";
		const hasLink = !!(0, _elementor_editor_elements.getElementSetting)(elementId, "link")?.value?.destination;
		return isButton || hasLink;
	};
	var { clear: clearButton, ...formatButtons } = {
		clear: {
			label: (0, _wordpress_i18n.__)("Clear", "elementor"),
			icon: /* @__PURE__ */ react.createElement(_elementor_icons.MinusIcon, { fontSize: "tiny" }),
			action: "clear",
			method: (editor) => {
				editor.chain().focus().clearNodes().unsetAllMarks().run();
			}
		},
		bold: {
			label: (0, _wordpress_i18n.__)("Bold", "elementor"),
			icon: /* @__PURE__ */ react.createElement(_elementor_icons.BoldIcon, { fontSize: "tiny" }),
			action: "bold",
			method: (editor) => {
				editor.chain().focus().toggleBold().run();
			}
		},
		italic: {
			label: (0, _wordpress_i18n.__)("Italic", "elementor"),
			icon: /* @__PURE__ */ react.createElement(_elementor_icons.ItalicIcon, { fontSize: "tiny" }),
			action: "italic",
			method: (editor) => {
				editor.chain().focus().toggleItalic().run();
			}
		},
		underline: {
			label: (0, _wordpress_i18n.__)("Underline", "elementor"),
			icon: /* @__PURE__ */ react.createElement(_elementor_icons.UnderlineIcon, { fontSize: "tiny" }),
			action: "underline",
			method: (editor) => {
				editor.chain().focus().toggleUnderline().run();
			}
		},
		strike: {
			label: (0, _wordpress_i18n.__)("Strikethrough", "elementor"),
			icon: /* @__PURE__ */ react.createElement(_elementor_icons.StrikethroughIcon, { fontSize: "tiny" }),
			action: "strike",
			method: (editor) => {
				editor.chain().focus().toggleStrike().run();
			}
		},
		superscript: {
			label: (0, _wordpress_i18n.__)("Superscript", "elementor"),
			icon: /* @__PURE__ */ react.createElement(_elementor_icons.SuperscriptIcon, { fontSize: "tiny" }),
			action: "superscript",
			method: (editor) => {
				editor.chain().focus().toggleSuperscript().run();
			}
		},
		subscript: {
			label: (0, _wordpress_i18n.__)("Subscript", "elementor"),
			icon: /* @__PURE__ */ react.createElement(_elementor_icons.SubscriptIcon, { fontSize: "tiny" }),
			action: "subscript",
			method: (editor) => {
				editor.chain().focus().toggleSubscript().run();
			}
		},
		link: {
			label: (0, _wordpress_i18n.__)("Link", "elementor"),
			icon: /* @__PURE__ */ react.createElement(_elementor_icons.LinkIcon, { fontSize: "tiny" }),
			action: "link",
			method: null
		}
	};
	var possibleFormats = Object.keys(formatButtons);

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/inline-editing-control.tsx
	var InlineEditingControl = createControl(({ sx, attributes, props, context: { elementId } }) => {
		const { setValue, placeholder, value } = useBoundProp(_elementor_editor_props.escapedHtmlPropTypeUtil);
		const { value: rawValue } = usePropKeyContext();
		const content = value ?? extractInlineHtmlContent(rawValue);
		const [editor, setEditor] = (0, react.useState)(null);
		const handleChange = (0, react.useCallback)((newValue) => {
			setValue(newValue ?? "");
		}, [setValue]);
		return /* @__PURE__ */ react.createElement(ControlActions, null, /* @__PURE__ */ react.createElement(_elementor_ui.Box, { sx: { position: "relative" } }, editor && editor.isEditable && /* @__PURE__ */ react.createElement(InlineEditorToolbar, {
			editor,
			elementId,
			sx: (theme) => ({
				boxShadow: "none",
				border: "1px solid",
				borderColor: theme.palette.text.secondary,
				mb: .5
			}),
			inControlPanel: true
		}), /* @__PURE__ */ react.createElement(_elementor_ui.Box, {
			sx: (theme) => ({
				p: .8,
				border: "1px solid",
				borderColor: theme.palette.text.secondary,
				borderRadius: "8px",
				transition: "border-color .2s ease, box-shadow .2s ease",
				"&:hover": { borderColor: theme.palette.text.primary },
				"&:focus-within": {
					borderColor: theme.palette.text.primary,
					boxShadow: `0 0 0 1px ${theme.palette.text.primary}`
				},
				"& .ProseMirror:focus": { outline: "none" },
				"& .ProseMirror": {
					minHeight: "100px",
					fontSize: "12px",
					"& a": { color: "inherit" },
					"& .elementor-inline-editor-reset": {
						margin: 0,
						padding: 0
					},
					"&.is-empty::before": {
						content: "attr(data-placeholder)",
						color: "text.tertiary",
						pointerEvents: "none",
						position: "absolute",
						opacity: .6
					}
				},
				".strip-styles *": { all: "unset" },
				...sx
			}),
			...attributes,
			...props
		}, /* @__PURE__ */ react.createElement(InlineEditor, {
			value: content,
			setValue: handleChange,
			placeholder: placeholder ?? null,
			onEditorCreate: setEditor,
			onEditorDestroy: () => setEditor(null),
			sx: { paddingBlockStart: 5 }
		}))));
	});

//#endregion
//#region packages/packages/libs/editor-controls/src/hooks/use-form-field-suggestions.ts
	var FORM_FIELD_WIDGET_TYPES = [
		"e-form-input",
		"e-form-textarea",
		"e-form-checkbox",
		"e-form-radio-button",
		"e-form-select",
		"e-form-date-picker",
		"e-form-time-picker"
	];
	var FORM_ELEMENT_TYPE = "e-form";
	var CSS_ID_PROP_KEY = "_cssid";
	function isFormFieldWidgetType(widgetType) {
		return FORM_FIELD_WIDGET_TYPES.includes(widgetType);
	}
	function extractStringPropValue(value) {
		return _elementor_editor_props.stringPropTypeUtil.extract(value);
	}
	function getSettingWithDefault(child, widgetType, key) {
		const fromGet = child.settings.get(key);
		if (fromGet !== null && fromGet !== void 0) return fromGet;
		return ((0, _elementor_editor_elements.getWidgetsCache)()?.[widgetType]?.atomic_props_schema)?.[key]?.default ?? null;
	}
	function getFieldCssId(child, widgetType) {
		return extractStringPropValue(getSettingWithDefault(child, widgetType, CSS_ID_PROP_KEY));
	}
	function getFormContainer(elementId) {
		let container = (0, _elementor_editor_elements.getContainer)(elementId);
		while (container) {
			if (container.model.get("elType") === FORM_ELEMENT_TYPE) return container;
			container = container.parent ?? null;
		}
		return null;
	}
	function useFormFieldSuggestions(options) {
		return (0, _elementor_editor_v1_adapters.__privateUseListenTo)([
			(0, _elementor_editor_v1_adapters.v1ReadyEvent)(),
			(0, _elementor_editor_v1_adapters.commandEndEvent)("document/elements/create"),
			(0, _elementor_editor_v1_adapters.commandEndEvent)("document/elements/delete"),
			(0, _elementor_editor_v1_adapters.commandEndEvent)("document/elements/set-settings")
		], () => {
			const selectedElement = (0, _elementor_editor_elements.getSelectedElements)()[0];
			if (!selectedElement) return [];
			const formContainer = getFormContainer(selectedElement.id);
			if (!formContainer?.children) return [];
			const suggestions = [];
			const seenCssIds = /* @__PURE__ */ new Set();
			formContainer.children.forEachRecursive?.((child) => {
				const widgetType = child.model.get("widgetType");
				if (!widgetType || !isFormFieldWidgetType(widgetType)) return;
				if (options?.inputType) {
					if (extractStringPropValue(getSettingWithDefault(child, widgetType, "type")) !== options.inputType) return;
				}
				const cssId = getFieldCssId(child, widgetType);
				if (!cssId || seenCssIds.has(cssId)) return;
				seenCssIds.add(cssId);
				suggestions.push({
					label: cssId,
					value: cssId
				});
			});
			return suggestions;
		}, []);
	}

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/email-form-action-control/utils.ts
	var MIN_PRO_VERSION_FOR_MENTIONS = "4.1.0";
	var CHIP_TRIGGER_KEYS = /* @__PURE__ */ new Set([" ", ","]);
	function isValidEmail(email) {
		return _elementor_schema.z.string().email().safeParse(email).success;
	}
	var FORM_FIELD_SHORTCODE_PATTERN = /^\[[^[\]]+]$/;
	function isFormFieldShortcode(value) {
		return FORM_FIELD_SHORTCODE_PATTERN.test(value);
	}
	var shouldShowMentionsInfo = () => {
		if (!(0, _elementor_utils.hasProInstalled)()) return true;
		const proVersion = window.elementorPro?.config?.version;
		if (!proVersion) return false;
		return (0, _elementor_utils.isVersionGreaterOrEqual)(proVersion, MIN_PRO_VERSION_FOR_MENTIONS);
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/email-form-action-control/email-chips-field.tsx
	var isValidRecipient = (address) => isValidEmail(address) || isFormFieldShortcode(address);
	function resolveMention(raw, suggestions) {
		if (!raw.startsWith("@")) return raw;
		const match = suggestions.find((suggestion) => createMentionPattern(suggestion.value, "start").test(raw));
		return match ? `[${match.value}]` : raw;
	}
	var EmailChipsControl = createControl(({ placeholder, suggestions = [] }) => {
		const { value, setValue, disabled } = useBoundProp(_elementor_editor_props.stringArrayPropTypeUtil);
		const [inputValue, setInputValue] = (0, react.useState)("");
		const items = value || [];
		const selectedValues = items.map((item) => _elementor_editor_props.stringPropTypeUtil.extract(item)).filter((val) => val !== null);
		const suggestionOptions = (0, react.useMemo)(() => suggestions.map((suggestion) => `[${suggestion.value}]`), [suggestions]);
		const tryAddChip = (raw) => {
			const address = resolveMention(raw.trim(), suggestions);
			if (!address || selectedValues.includes(address) || !isValidRecipient(address)) return;
			setValue([...items, _elementor_editor_props.stringPropTypeUtil.create(address)]);
			setInputValue("");
		};
		const handleChange = (_, newValue) => {
			const updated = [];
			for (const entry of newValue) {
				const address = resolveMention(entry.trim(), suggestions);
				if (!address || !isValidRecipient(address)) continue;
				updated.push(_elementor_editor_props.stringPropTypeUtil.create(address));
			}
			setValue(updated);
			setInputValue("");
		};
		const handleBlur = (event) => {
			const target = event.target;
			tryAddChip(target.value);
			setInputValue("");
		};
		const handleKeyDown = (event) => {
			if (CHIP_TRIGGER_KEYS.has(event.key) && inputValue.trim()) {
				event.preventDefault();
				tryAddChip(inputValue);
			}
		};
		return /* @__PURE__ */ react.createElement(ControlActions, null, /* @__PURE__ */ react.createElement(_elementor_ui.Autocomplete, {
			fullWidth: true,
			multiple: true,
			freeSolo: true,
			size: "tiny",
			disabled,
			inputValue,
			onInputChange: (_, val, reason) => {
				if (reason !== "reset") setInputValue(val);
			},
			value: selectedValues,
			onChange: handleChange,
			options: suggestionOptions,
			filterOptions: (options, state) => {
				const query = state.inputValue.trim().replace(/^@/, "").toLowerCase();
				return query ? options.filter((option) => option.toLowerCase().includes(query)) : options;
			},
			filterSelectedOptions: true,
			onBlur: handleBlur,
			getOptionLabel: (option) => option,
			isOptionEqualToValue: (option, val) => option === val,
			renderInput: (params) => /* @__PURE__ */ react.createElement(_elementor_ui.TextField, {
				...params,
				placeholder,
				onKeyDown: handleKeyDown
			}),
			renderTags: (tagValues, getTagProps) => /* @__PURE__ */ react.createElement(ChipsList, {
				getLabel: (option) => option,
				getTagProps,
				values: tagValues
			})
		}));
	});
	var EmailChipsField = ({ fieldLabel, placeholder, suggestions }) => /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
		container: true,
		direction: "column",
		gap: .5
	}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, { item: true }, /* @__PURE__ */ react.createElement(ControlFormLabel, null, fieldLabel)), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, { item: true }, /* @__PURE__ */ react.createElement(EmailChipsControl, {
		placeholder,
		suggestions
	})));

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/email-form-action-control/email-field.tsx
	var EmailField = ({ bind, label, placeholder }) => /* @__PURE__ */ react.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
		container: true,
		direction: "column",
		gap: .5
	}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, { item: true }, /* @__PURE__ */ react.createElement(ControlFormLabel, null, label)), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, { item: true }, /* @__PURE__ */ react.createElement(TextControl, { placeholder }))));

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/email-form-action-control/fields.tsx
	var SendToField = ({ placeholder }) => {
		const suggestions = useFormFieldSuggestions({ inputType: "email" });
		return /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "to" }, /* @__PURE__ */ react.createElement(_elementor_ui.Stack, { gap: .5 }, /* @__PURE__ */ react.createElement(EmailChipsField, {
			fieldLabel: (0, _wordpress_i18n.__)("Send to", "elementor"),
			placeholder,
			suggestions
		}), shouldShowMentionsInfo() && /* @__PURE__ */ react.createElement(_elementor_editor_ui.InfoAlert, null, (0, _wordpress_i18n.__)("Type @ or an email field name to insert its submitted value.", "elementor"))));
	};
	var SubjectField = () => /* @__PURE__ */ react.createElement(EmailField, {
		bind: "subject",
		label: (0, _wordpress_i18n.__)("Email subject", "elementor"),
		placeholder: (0, _wordpress_i18n.__)("New form submission", "elementor")
	});
	var MessageField = () => {
		const suggestions = useFormFieldSuggestions();
		return /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "message" }, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			container: true,
			direction: "column",
			gap: .5
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, { item: true }, /* @__PURE__ */ react.createElement(ControlFormLabel, null, (0, _wordpress_i18n.__)("Message", "elementor"))), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, { item: true }, /* @__PURE__ */ react.createElement(MentionTextAreaControl, { suggestions })), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, { item: true }, /* @__PURE__ */ react.createElement(_elementor_editor_ui.InfoAlert, null, shouldShowMentionsInfo() ? (0, _wordpress_i18n.__)("[all-fields] shortcode sends all fields. Type @ to insert specific fields and customize your message.", "elementor") : (0, _wordpress_i18n.__)("[all-fields] shortcode sends all fields.", "elementor")))));
	};
	var FromEmailField = () => /* @__PURE__ */ react.createElement(EmailField, {
		bind: "from",
		label: (0, _wordpress_i18n.__)("From email", "elementor"),
		placeholder: (0, _wordpress_i18n.__)("What email should appear as the sender?", "elementor")
	});
	var FromNameField = () => /* @__PURE__ */ react.createElement(EmailField, {
		bind: "from-name",
		label: (0, _wordpress_i18n.__)("From name", "elementor"),
		placeholder: (0, _wordpress_i18n.__)("What name should appear as the sender?", "elementor")
	});
	var ReplyToField = () => {
		const emailSuggestions = useFormFieldSuggestions({ inputType: "email" });
		return /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "reply-to" }, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			container: true,
			direction: "column",
			gap: .5
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, { item: true }, /* @__PURE__ */ react.createElement(ControlFormLabel, null, (0, _wordpress_i18n.__)("Reply-to", "elementor"))), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, { item: true }, /* @__PURE__ */ react.createElement(MentionTextAreaControl, {
			suggestions: emailSuggestions,
			rows: 1,
			triggerPosition: "start",
			placeholder: (0, _wordpress_i18n.__)("You can type @ to insert an email field", "elementor")
		}))));
	};
	var CcField = () => {
		const suggestions = useFormFieldSuggestions({ inputType: "email" });
		return /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "cc" }, /* @__PURE__ */ react.createElement(EmailChipsField, {
			fieldLabel: (0, _wordpress_i18n.__)("Cc", "elementor"),
			suggestions
		}));
	};
	var BccField = () => {
		const suggestions = useFormFieldSuggestions({ inputType: "email" });
		return /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "bcc" }, /* @__PURE__ */ react.createElement(EmailChipsField, {
			fieldLabel: (0, _wordpress_i18n.__)("Bcc", "elementor"),
			suggestions
		}));
	};
	var MetaDataField = () => /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "meta-data" }, /* @__PURE__ */ react.createElement(_elementor_ui.Stack, { gap: .5 }, /* @__PURE__ */ react.createElement(ControlFormLabel, null, (0, _wordpress_i18n.__)("Metadata", "elementor")), /* @__PURE__ */ react.createElement(ChipsControl, { options: [
		{
			label: (0, _wordpress_i18n.__)("Date", "elementor"),
			value: "date"
		},
		{
			label: (0, _wordpress_i18n.__)("Time", "elementor"),
			value: "time"
		},
		{
			label: (0, _wordpress_i18n.__)("Page URL", "elementor"),
			value: "page-url"
		},
		{
			label: (0, _wordpress_i18n.__)("User agent", "elementor"),
			value: "user-agent"
		},
		{
			label: (0, _wordpress_i18n.__)("Credit", "elementor"),
			value: "credit"
		}
	] })));
	var SendAsField = () => /* @__PURE__ */ react.createElement(PropKeyProvider, { bind: "send-as" }, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
		container: true,
		direction: "column",
		gap: .5
	}, /* @__PURE__ */ react.createElement(_elementor_ui.Grid, { item: true }, /* @__PURE__ */ react.createElement(ControlFormLabel, null, (0, _wordpress_i18n.__)("Send as", "elementor"))), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, { item: true }, /* @__PURE__ */ react.createElement(SelectControl, { options: [{
		label: (0, _wordpress_i18n.__)("HTML", "elementor"),
		value: "html"
	}, {
		label: (0, _wordpress_i18n.__)("Plain Text", "elementor"),
		value: "plain"
	}] }))));

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/email-form-action-control/index.tsx
	var EmailFormActionControl = createControl(({ toPlaceholder, label }) => {
		const { value, setValue, ...propContext } = useBoundProp(_elementor_editor_props.emailsPropTypeUtil);
		return /* @__PURE__ */ react.createElement(PropProvider, {
			...propContext,
			value,
			setValue
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Stack, { gap: 2 }, /* @__PURE__ */ react.createElement(ControlLabel, null, label ? label + " " + (0, _wordpress_i18n.__)("settings", "elementor") : (0, _wordpress_i18n.__)("Email settings", "elementor")), /* @__PURE__ */ react.createElement(SendToField, { placeholder: toPlaceholder }), /* @__PURE__ */ react.createElement(SubjectField, null), /* @__PURE__ */ react.createElement(MessageField, null), /* @__PURE__ */ react.createElement(FromEmailField, null), /* @__PURE__ */ react.createElement(AdvancedSettings, null)));
	});
	var AdvancedSettings = () => /* @__PURE__ */ react.createElement(_elementor_editor_ui.CollapsibleContent, { defaultOpen: false }, /* @__PURE__ */ react.createElement(_elementor_ui.Box, { sx: { pt: 2 } }, /* @__PURE__ */ react.createElement(_elementor_ui.Stack, { gap: 2 }, /* @__PURE__ */ react.createElement(FromNameField, null), /* @__PURE__ */ react.createElement(ReplyToField, null), /* @__PURE__ */ react.createElement(CcField, null), /* @__PURE__ */ react.createElement(BccField, null), /* @__PURE__ */ react.createElement(_elementor_ui.Divider, null), /* @__PURE__ */ react.createElement(MetaDataField, null), /* @__PURE__ */ react.createElement(SendAsField, null))));

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/attachment-type-control.tsx
	var AttachmentTypeControl = createControl(({ label, options }) => {
		return /* @__PURE__ */ react.createElement(_elementor_ui.Grid, {
			container: true,
			direction: "column",
			gap: 1
		}, label && /* @__PURE__ */ react.createElement(_elementor_ui.Grid, { item: true }, /* @__PURE__ */ react.createElement(ControlFormLabel, null, label)), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, { item: true }, /* @__PURE__ */ react.createElement(SelectControl, { options })), /* @__PURE__ */ react.createElement(_elementor_ui.Grid, { item: true }, /* @__PURE__ */ react.createElement(_elementor_editor_ui.InfoAlert, null, (0, _wordpress_i18n.__)("Linked uploads are saved to the server. Direct attachments will not appear under Submissions.", "elementor"))));
	});

//#endregion
//#region packages/packages/libs/editor-controls/src/controls/grid-span-control.tsx
	var GridSpanControl = createControl(({ placeholder: propPlaceholder, error, inputValue, inputDisabled, helperText, sx, ariaLabel }) => {
		const { value, setValue, disabled, placeholder: boundPlaceholder } = useBoundProp(_elementor_editor_props.spanPropTypeUtil);
		const handleChange = (event) => {
			const next = event.target.value;
			setValue(next === "" ? null : next);
		};
		const placeholder = propPlaceholder ?? boundPlaceholder ?? `e.g: 'span 2' or '1 / 3'`;
		return /* @__PURE__ */ react.createElement(ControlActions, null, /* @__PURE__ */ react.createElement(_elementor_ui.TextField, {
			size: "tiny",
			fullWidth: true,
			disabled: inputDisabled ?? disabled,
			value: inputValue ?? value ?? "",
			onChange: handleChange,
			placeholder,
			error,
			helperText,
			sx,
			inputProps: { ...ariaLabel ? { "aria-label": ariaLabel } : {} }
		}));
	});

//#endregion
//#region packages/packages/libs/editor-controls/src/components/promotions/promotion-trigger.tsx
	function getV4Promotion(key) {
		return window.elementor?.config?.v4Promotions?.[key];
	}
	var PromotionTrigger = (0, react.forwardRef)(({ promotionKey, children, trackingData }, ref) => {
		const [isOpen, setIsOpen] = (0, react.useState)(false);
		const promotion = getV4Promotion(promotionKey);
		const toggle = (0, react.useCallback)(() => {
			setIsOpen((prev) => {
				if (!prev) trackViewPromotion(trackingData);
				return !prev;
			});
		}, [trackingData]);
		(0, react.useImperativeHandle)(ref, () => ({ toggle }), [toggle]);
		return /* @__PURE__ */ react.createElement(react.Fragment, null, promotion && /* @__PURE__ */ react.createElement(_elementor_editor_ui.PromotionInfotip, {
			title: promotion.title,
			content: promotion.content,
			assetUrl: promotion.image,
			ctaUrl: promotion.ctaUrl,
			open: isOpen,
			onClose: (e) => {
				e.stopPropagation();
				setIsOpen(false);
			},
			onCtaClick: () => trackUpgradePromotionClick(trackingData)
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Box, {
			onClick: (e) => {
				e.stopPropagation();
				toggle();
			},
			sx: {
				cursor: "pointer",
				display: "inline-flex"
			}
		}, children ?? /* @__PURE__ */ react.createElement(_elementor_editor_ui.PromotionChip, null))));
	});

//#endregion
//#region packages/packages/libs/editor-controls/src/components/promotions/display-conditions-control.tsx
	var ARIA_LABEL$1 = (0, _wordpress_i18n.__)("Display Conditions", "elementor");
	var TRACKING_DATA$1 = {
		target_name: "display_conditions",
		location_l2: "general"
	};
	var DisplayConditionsControl = createControl(() => {
		const triggerRef = (0, react.useRef)(null);
		return /* @__PURE__ */ react.createElement(_elementor_ui.Stack, {
			direction: "row",
			spacing: 2,
			sx: {
				justifyContent: "flex-end",
				alignItems: "center"
			}
		}, /* @__PURE__ */ react.createElement(PromotionTrigger, {
			ref: triggerRef,
			promotionKey: "displayConditions",
			trackingData: TRACKING_DATA$1
		}), /* @__PURE__ */ react.createElement(_elementor_ui.Tooltip, {
			title: ARIA_LABEL$1,
			placement: "top"
		}, /* @__PURE__ */ react.createElement(_elementor_ui.IconButton, {
			size: "tiny",
			"aria-label": ARIA_LABEL$1,
			"data-behavior": "display-conditions",
			onClick: () => triggerRef.current?.toggle(),
			sx: {
				border: "1px solid",
				borderColor: "divider",
				borderRadius: 1
			}
		}, /* @__PURE__ */ react.createElement(_elementor_icons.SitemapIcon, {
			fontSize: "tiny",
			color: "disabled"
		}))));
	});

//#endregion
//#region packages/packages/libs/editor-controls/src/components/promotions/attributes-control.tsx
	var ARIA_LABEL = (0, _wordpress_i18n.__)("Attributes", "elementor");
	var TRACKING_DATA = {
		target_name: "attributes",
		location_l2: "general"
	};
	var AttributesControl = createControl(() => {
		const triggerRef = (0, react.useRef)(null);
		return /* @__PURE__ */ react.createElement(_elementor_ui.Stack, {
			direction: "row",
			spacing: 2,
			sx: {
				justifyContent: "flex-end",
				alignItems: "center"
			}
		}, /* @__PURE__ */ react.createElement(PromotionTrigger, {
			ref: triggerRef,
			promotionKey: "attributes",
			trackingData: TRACKING_DATA
		}), /* @__PURE__ */ react.createElement(_elementor_ui.Tooltip, {
			title: ARIA_LABEL,
			placement: "top"
		}, /* @__PURE__ */ react.createElement(_elementor_icons.PlusIcon, {
			"aria-label": ARIA_LABEL,
			fontSize: "tiny",
			color: "disabled",
			onClick: () => triggerRef.current?.toggle(),
			sx: { cursor: "pointer" }
		})));
	});

//#endregion
//#region packages/packages/libs/editor-controls/src/components/icon-buttons/clear-icon-button.tsx
	var CustomIconButton = (0, _elementor_ui.styled)(_elementor_ui.IconButton)(({ theme }) => ({
		width: theme.spacing(2.5),
		height: theme.spacing(2.5)
	}));
	var ClearIconButton = ({ tooltipText, onClick, disabled, size = "tiny" }) => /* @__PURE__ */ react.createElement(_elementor_ui.Tooltip, {
		title: tooltipText,
		placement: "top",
		disableInteractive: true
	}, /* @__PURE__ */ react.createElement(CustomIconButton, {
		"aria-label": tooltipText,
		size,
		onClick,
		disabled
	}, /* @__PURE__ */ react.createElement(_elementor_icons.BrushBigIcon, { fontSize: size })));

//#endregion
//#region packages/packages/libs/editor-controls/src/components/repeater/repeater.tsx
	var SIZE = "tiny";
	var EMPTY_OPEN_ITEM = -1;
	var Repeater = ({ label, itemSettings, disabled = false, openOnAdd = false, values: items = [], setValues: setItems, showDuplicate = true, showToggle = true, showRemove = true, disableAddItemButton = false, addButtonInfotipContent, openItem: initialOpenItem = EMPTY_OPEN_ITEM, isSortable = true, adornment = ControlAdornments }) => {
		const [openItem, setOpenItem] = (0, react.useState)(initialOpenItem);
		const uniqueKeys = items.map((item, index) => isSortable && "getId" in itemSettings ? itemSettings.getId({
			item,
			index
		}) : String(index));
		const addRepeaterItem = () => {
			const newItem = structuredClone(itemSettings.initialValues);
			const newIndex = items.length;
			setItems([...items, newItem], {}, { action: {
				type: "add",
				payload: [{
					index: newIndex,
					item: newItem
				}]
			} });
			if (openOnAdd) setOpenItem(newIndex);
		};
		const duplicateRepeaterItem = (index) => {
			const newItem = structuredClone(items[index]);
			const atPosition = 1 + index;
			setItems([
				...items.slice(0, atPosition),
				newItem,
				...items.slice(atPosition)
			], {}, { action: {
				type: "duplicate",
				payload: [{
					index,
					item: newItem
				}]
			} });
		};
		const removeRepeaterItem = (index) => {
			const removedItem = items[index];
			setItems(items.filter((_, pos) => {
				return pos !== index;
			}), {}, { action: {
				type: "remove",
				payload: [{
					index,
					item: removedItem
				}]
			} });
		};
		const toggleDisableRepeaterItem = (index) => {
			setItems(items.map((value, pos) => {
				if (pos === index) {
					const { disabled: propDisabled, ...rest } = value;
					return {
						...rest,
						...propDisabled ? {} : { disabled: true }
					};
				}
				return value;
			}), {}, { action: { type: "toggle-disable" } });
		};
		const onChangeOrder = (reorderedKeys, meta) => {
			setItems(reorderedKeys.map((id) => {
				return items[uniqueKeys.indexOf(id)];
			}), {}, { action: {
				type: "reorder",
				payload: { ...meta }
			} });
		};
		const isButtonDisabled = disabled || disableAddItemButton;
		const shouldShowInfotip = isButtonDisabled && addButtonInfotipContent;
		const addButton = /* @__PURE__ */ react.createElement(_elementor_ui.IconButton, {
			size: SIZE,
			sx: { ml: "auto" },
			disabled: isButtonDisabled,
			onClick: addRepeaterItem,
			"aria-label": (0, _wordpress_i18n.__)("Add item", "elementor")
		}, /* @__PURE__ */ react.createElement(_elementor_icons.PlusIcon, { fontSize: SIZE }));
		return /* @__PURE__ */ react.createElement(SectionContent, { gap: 2 }, /* @__PURE__ */ react.createElement(RepeaterHeader, {
			label,
			adornment
		}, shouldShowInfotip ? /* @__PURE__ */ react.createElement(_elementor_ui.Infotip, {
			placement: "right",
			content: addButtonInfotipContent,
			color: "secondary",
			slotProps: { popper: { sx: { width: 300 } } }
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Box, { sx: { ...isButtonDisabled ? { cursor: "not-allowed" } : {} } }, addButton)) : addButton), 0 < uniqueKeys.length && /* @__PURE__ */ react.createElement(SortableProvider, {
			value: uniqueKeys,
			onChange: onChangeOrder
		}, uniqueKeys.map((key) => {
			const index = uniqueKeys.indexOf(key);
			const value = items[index];
			if (!value) return null;
			return /* @__PURE__ */ react.createElement(SortableItem, {
				id: key,
				key: `sortable-${key}`,
				disabled: !isSortable
			}, /* @__PURE__ */ react.createElement(RepeaterItem, {
				disabled,
				propDisabled: value?.disabled,
				label: /* @__PURE__ */ react.createElement(RepeaterItemLabelSlot, { value }, /* @__PURE__ */ react.createElement(itemSettings.Label, {
					value,
					index
				})),
				startIcon: /* @__PURE__ */ react.createElement(RepeaterItemIconSlot, { value }, /* @__PURE__ */ react.createElement(itemSettings.Icon, { value })),
				removeItem: () => removeRepeaterItem(index),
				duplicateItem: () => duplicateRepeaterItem(index),
				toggleDisableItem: () => toggleDisableRepeaterItem(index),
				openOnMount: openOnAdd && openItem === index,
				onOpen: () => setOpenItem(EMPTY_OPEN_ITEM),
				onPopoverOpen: itemSettings.onPopoverOpen,
				onPopoverClose: itemSettings.onPopoverClose,
				showDuplicate,
				showToggle,
				showRemove,
				actions: itemSettings.actions,
				value
			}, (props) => /* @__PURE__ */ react.createElement(itemSettings.Content, {
				...props,
				value,
				bind: String(index),
				index
			})));
		})));
	};
	var RepeaterItem = ({ label, propDisabled, startIcon, children, removeItem, duplicateItem, toggleDisableItem, openOnMount, onOpen, onPopoverOpen, onPopoverClose, showDuplicate, showToggle, showRemove, disabled, actions, value }) => {
		const { popoverState, popoverProps, ref, setRef } = usePopover(openOnMount, () => {
			onOpen();
			onPopoverOpen?.(value);
		}, onPopoverClose ? () => onPopoverClose(value) : void 0);
		const triggerProps = (0, _elementor_ui.bindTrigger)(popoverState);
		usePopoverDismiss({
			isOpen: popoverState.isOpen,
			onClose: popoverProps.onClose
		});
		const duplicateLabel = (0, _wordpress_i18n.__)("Duplicate", "elementor");
		const toggleLabel = propDisabled ? (0, _wordpress_i18n.__)("Show", "elementor") : (0, _wordpress_i18n.__)("Hide", "elementor");
		const removeLabel = (0, _wordpress_i18n.__)("Remove", "elementor");
		return /* @__PURE__ */ react.createElement(_elementor_ui.Box, { sx: { display: "contents" } }, /* @__PURE__ */ react.createElement(RepeaterTag, {
			disabled,
			label,
			ref: setRef,
			"aria-label": (0, _wordpress_i18n.__)("Open item", "elementor"),
			...triggerProps,
			onClick: (e) => {
				triggerProps.onClick(e);
				if (!popoverState.isOpen) onPopoverOpen?.(value);
			},
			startIcon,
			actions: /* @__PURE__ */ react.createElement(react.Fragment, null, showDuplicate && /* @__PURE__ */ react.createElement(_elementor_ui.Tooltip, {
				title: duplicateLabel,
				placement: "top"
			}, /* @__PURE__ */ react.createElement(_elementor_ui.IconButton, {
				size: SIZE,
				onClick: duplicateItem,
				"aria-label": duplicateLabel
			}, /* @__PURE__ */ react.createElement(_elementor_icons.CopyIcon, { fontSize: SIZE }))), showToggle && /* @__PURE__ */ react.createElement(_elementor_ui.Tooltip, {
				title: toggleLabel,
				placement: "top"
			}, /* @__PURE__ */ react.createElement(_elementor_ui.IconButton, {
				size: SIZE,
				onClick: toggleDisableItem,
				"aria-label": toggleLabel
			}, propDisabled ? /* @__PURE__ */ react.createElement(_elementor_icons.EyeOffIcon, { fontSize: SIZE }) : /* @__PURE__ */ react.createElement(_elementor_icons.EyeIcon, { fontSize: SIZE }))), actions?.(value), showRemove && /* @__PURE__ */ react.createElement(_elementor_ui.Tooltip, {
				title: removeLabel,
				placement: "top"
			}, /* @__PURE__ */ react.createElement(_elementor_ui.IconButton, {
				size: SIZE,
				onClick: removeItem,
				"aria-label": removeLabel
			}, /* @__PURE__ */ react.createElement(_elementor_icons.XIcon, { fontSize: SIZE }))))
		}), /* @__PURE__ */ react.createElement(RepeaterPopover, {
			width: ref?.getBoundingClientRect().width,
			...popoverProps,
			anchorEl: ref
		}, /* @__PURE__ */ react.createElement(_elementor_ui.Box, null, children({ anchorEl: ref }))));
	};
	var usePopover = (openOnMount, onOpen, onPopoverClose) => {
		const [ref, setRef] = (0, react.useState)(null);
		const popoverState = (0, _elementor_ui.usePopupState)({ variant: "popover" });
		const popoverProps = (0, _elementor_ui.bindPopover)(popoverState);
		(0, react.useEffect)(() => {
			if (openOnMount && ref) {
				popoverState.open(ref);
				onOpen?.();
			}
		}, [ref]);
		const onClose = () => {
			popoverProps.onClose?.();
			onPopoverClose?.();
		};
		return {
			popoverState,
			ref,
			setRef,
			popoverProps: {
				...popoverProps,
				onClose
			}
		};
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/hooks/use-size-value.ts
	var DEFAULT_UNIT = "px";
	var DEFAULT_SIZE = "";
	var useSizeValue = (externalValue, onChange, defaultUnit) => {
		const [sizeValue, setSizeValue] = useSyncExternalState({
			external: externalValue,
			setExternal: (newState) => {
				if (newState !== null) onChange(newState);
			},
			persistWhen: (newState) => differsFromExternal(newState, externalValue),
			fallback: () => ({
				size: DEFAULT_SIZE,
				unit: defaultUnit ?? DEFAULT_UNIT
			})
		});
		const setSize = (value) => {
			const newState = {
				...sizeValue,
				size: value.trim() === "" ? null : Number(value)
			};
			setSizeValue(newState);
		};
		const setUnit = (unit) => {
			const newState = {
				...sizeValue,
				unit
			};
			setSizeValue(newState);
		};
		return {
			size: sizeValue.size,
			unit: sizeValue.unit,
			setSize,
			setUnit
		};
	};
	var differsFromExternal = (newState, externalState) => {
		return newState?.size !== externalState?.size || newState?.unit !== externalState?.unit;
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/components/size/unit-select.tsx
	var menuItemContentStyles = {
		display: "flex",
		flexDirection: "column",
		justifyContent: "center"
	};
	var UnitSelect = ({ value, showPrimaryColor, onClick, options }) => {
		const popupState = (0, _elementor_ui.usePopupState)({
			variant: "popover",
			popupId: (0, react.useId)()
		});
		const handleMenuItemClick = (index) => {
			onClick(options[index]);
			popupState.close();
		};
		return /* @__PURE__ */ react.createElement(react.Fragment, null, /* @__PURE__ */ react.createElement(StyledButton, {
			isPrimaryColor: showPrimaryColor,
			size: "small",
			...(0, _elementor_ui.bindTrigger)(popupState)
		}, value), /* @__PURE__ */ react.createElement(_elementor_ui.Menu, {
			MenuListProps: { dense: true },
			...(0, _elementor_ui.bindMenu)(popupState)
		}, options.map((option, index) => /* @__PURE__ */ react.createElement(_elementor_editor_ui.MenuListItem, {
			key: option,
			onClick: () => handleMenuItemClick(index),
			primaryTypographyProps: {
				variant: "caption",
				sx: {
					...menuItemContentStyles,
					lineHeight: "1"
				}
			},
			menuItemTextProps: { sx: menuItemContentStyles }
		}, option.toUpperCase()))));
	};
	var StyledButton = (0, _elementor_ui.styled)(_elementor_ui.Button, { shouldForwardProp: (prop) => prop !== "isPrimaryColor" })(({ isPrimaryColor, theme }) => ({
		color: isPrimaryColor ? theme.palette.text.primary : theme.palette.text.tertiary,
		font: "inherit",
		minWidth: "initial",
		textTransform: "uppercase"
	}));

//#endregion
//#region packages/packages/libs/editor-controls/src/components/size/unstable-size-input.tsx
	var UnstableSizeInput = (0, react.forwardRef)(({ type, value, onChange, onKeyDown, onKeyUp, InputProps, onBlur, focused, disabled }, ref) => {
		return /* @__PURE__ */ react.createElement(NumberInput, {
			ref,
			size: "tiny",
			fullWidth: true,
			type,
			value,
			onKeyUp,
			focused,
			disabled,
			onKeyDown,
			onInput: onChange,
			onBlur,
			InputProps,
			sx: getCursorStyle(InputProps?.readOnly ?? false)
		});
	});
	var getCursorStyle = (readOnly) => ({ input: { cursor: readOnly ? "default !important" : void 0 } });

//#endregion
//#region packages/packages/libs/editor-controls/src/components/size/unstable-size-field.tsx
	var UnstableSizeField = ({ value, InputProps, onChange, onBlur, units, defaultUnit, startIcon }) => {
		const { size, unit, setSize, setUnit } = useSizeValue(value, onChange, defaultUnit);
		const shouldHighlightUnit = () => {
			return hasValue(size);
		};
		return /* @__PURE__ */ react.createElement(UnstableSizeInput, {
			type: "number",
			value: size ?? "",
			onBlur,
			onChange: (event) => setSize(event.target.value),
			InputProps: {
				...InputProps,
				startAdornment: startIcon && /* @__PURE__ */ react.createElement(_elementor_ui.InputAdornment, { position: "start" }, startIcon),
				endAdornment: /* @__PURE__ */ react.createElement(_elementor_ui.InputAdornment, { position: "end" }, /* @__PURE__ */ react.createElement(UnitSelect, {
					options: units,
					value: unit,
					onClick: setUnit,
					showPrimaryColor: shouldHighlightUnit()
				}))
			}
		});
	};
	var hasValue = (value) => {
		return value !== null && value !== "";
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/hooks/use-font-families.ts
	var getFontControlConfig = () => {
		const { controls } = (0, _elementor_editor_v1_adapters.getElementorConfig)();
		return controls?.font ?? {};
	};
	var useFontFamilies = () => {
		const { groups, options } = getFontControlConfig();
		return (0, react.useMemo)(() => {
			if (!groups || !options) return [];
			const groupKeys = Object.keys(groups);
			const groupIndexMap = new Map(groupKeys.map((key, index) => [key, index]));
			return Object.entries(options).reduce((acc, [font, category]) => {
				const groupIndex = groupIndexMap.get(category);
				if (groupIndex === void 0) return acc;
				if (!acc[groupIndex]) acc[groupIndex] = {
					label: groups[category],
					fonts: []
				};
				acc[groupIndex].fonts.push(font);
				return acc;
			}, []).filter(Boolean);
		}, [groups, options]);
	};

//#endregion
//#region packages/packages/libs/editor-controls/src/index.ts
	var src_exports = /* @__PURE__ */ __exportAll({
		AspectRatioControl: () => AspectRatioControl,
		AttachmentTypeControl: () => AttachmentTypeControl,
		AttributesControl: () => AttributesControl,
		BackgroundControl: () => BackgroundControl,
		BoxShadowRepeaterControl: () => BoxShadowRepeaterControl,
		ChipsControl: () => ChipsControl,
		ClearIconButton: () => ClearIconButton,
		ColorControl: () => ColorControl,
		ControlActions: () => ControlActions,
		ControlActionsProvider: () => ControlActionsProvider,
		ControlAdornments: () => ControlAdornments,
		ControlAdornmentsProvider: () => ControlAdornmentsProvider,
		ControlFormLabel: () => ControlFormLabel,
		ControlReplacementsProvider: () => ControlReplacementsProvider,
		ControlToggleButtonGroup: () => ControlToggleButtonGroup,
		DateRangeControl: () => DateRangeControl,
		DateTimeControl: () => DateTimeControl,
		DisplayConditionsControl: () => DisplayConditionsControl,
		EmailFormActionControl: () => EmailFormActionControl,
		EqualUnequalSizesControl: () => EqualUnequalSizesControl,
		FilterRepeaterControl: () => FilterRepeaterControl,
		FontFamilyControl: () => FontFamilyControl,
		GapControl: () => GapControl,
		GridSpanControl: () => GridSpanControl,
		HtmlTagControl: () => HtmlTagControl,
		ImageControl: () => ImageControl,
		InlineEditingControl: () => InlineEditingControl,
		InlineEditor: () => InlineEditor,
		InlineEditorToolbar: () => InlineEditorToolbar,
		ItemSelector: () => ItemSelector,
		KeyValueControl: () => KeyValueControl,
		LinkControl: () => LinkControl,
		LinkedDimensionsControl: () => LinkedDimensionsControl,
		MentionTextAreaControl: () => MentionTextAreaControl,
		NumberControl: () => NumberControl,
		NumberInput: () => NumberInput,
		PopoverContent: () => PopoverContent,
		PopoverGridContainer: () => PopoverGridContainer,
		PositionControl: () => PositionControl,
		PromotionTrigger: () => PromotionTrigger,
		PropKeyProvider: () => PropKeyProvider,
		PropProvider: () => PropProvider,
		QueryChipsControl: () => QueryChipsControl,
		QueryControl: () => QueryControl,
		QueryFilterRepeaterControl: () => QueryFilterRepeaterControl,
		RepeatableControl: () => RepeatableControl,
		Repeater: () => Repeater,
		SelectControl: () => SelectControl,
		SelectControlWrapper: () => SelectControlWrapper,
		SizeComponent: () => SizeComponent,
		SizeControl: () => SizeControl,
		StrokeControl: () => StrokeControl,
		StyledToggleButton: () => StyledToggleButton,
		StyledToggleButtonGroup: () => StyledToggleButtonGroup,
		SvgMediaControl: () => SvgMediaControl,
		SwitchControl: () => SwitchControl,
		TextAreaControl: () => TextAreaControl,
		TextControl: () => TextControl,
		TimeRangeControl: () => TimeRangeControl,
		TimeStringControl: () => TimeStringControl,
		ToggleButtonGroupUi: () => ToggleButtonGroupUi,
		ToggleControl: () => ToggleControl,
		TransformRepeaterControl: () => TransformRepeaterControl,
		TransformSettingsControl: () => TransformSettingsControl,
		TransitionRepeaterControl: () => TransitionRepeaterControl,
		UnstableSizeControl: () => UnstableSizeControl,
		UnstableSizeField: () => UnstableSizeField,
		UrlControl: () => UrlControl,
		VideoMediaControl: () => VideoMediaControl,
		createControl: () => createControl,
		createControlReplacementsRegistry: () => createControlReplacementsRegistry,
		enqueueFont: () => enqueueFont,
		getControlReplacements: () => getControlReplacements,
		injectIntoRepeaterItemActions: () => injectIntoRepeaterItemActions,
		injectIntoRepeaterItemIcon: () => injectIntoRepeaterItemIcon,
		injectIntoRepeaterItemLabel: () => injectIntoRepeaterItemLabel,
		isUnitExtendedOption: () => isUnitExtendedOption,
		registerControlReplacement: () => registerControlReplacement,
		trackUpgradePromotionClick: () => trackUpgradePromotionClick,
		trackViewPromotion: () => trackViewPromotion,
		transitionProperties: () => transitionProperties,
		transitionsItemsList: () => transitionsItemsList,
		useBoundProp: () => useBoundProp,
		useControlActions: () => useControlActions,
		useControlReplacement: () => useControlReplacement,
		useFontFamilies: () => useFontFamilies,
		useSyncExternalState: () => useSyncExternalState,
		useTypingBuffer: () => useTypingBuffer
	});

//#endregion
//#region \0elementor-package-library-entry
	(window.elementorV2 = window.elementorV2 || {}).editorControls = src_exports;

//#endregion
})(React, elementorV2.editorProps, elementorV2.ui, wp.i18n, elementorV2.utils, elementorV2.query, elementorV2.httpClient, elementorV2.icons, elementorV2.wpMedia, elementorV2.editorUi, ReactDOM, elementorV2.editorResponsive, elementorV2.locations, elementorV2.editorElements, elementorV2.editorV1Adapters, elementorV2.session, elementorV2.editorCurrentUser, elementorV2.env, elementorV2.events, elementorV2.schema);
window.elementorV2.editorControls?.init?.();
//# sourceMappingURL=editor-controls.js.map
````
