{"version":3,"file":"index-BQFEjTa1.js","sources":["../../../node_modules/.pnpm/@formkit+utils@1.6.7/node_modules/@formkit/utils/dist/index.mjs","../../../node_modules/.pnpm/@formkit+core@1.6.7/node_modules/@formkit/core/dist/index.mjs","../../../node_modules/.pnpm/@formkit+observer@1.6.7/node_modules/@formkit/observer/dist/index.mjs","../../../node_modules/.pnpm/@formkit+rules@1.6.7/node_modules/@formkit/rules/dist/index.mjs","../../../node_modules/.pnpm/@formkit+validation@1.6.7/node_modules/@formkit/validation/dist/index.mjs","../../../node_modules/.pnpm/@formkit+i18n@1.6.7/node_modules/@formkit/i18n/dist/index.mjs","../../../node_modules/.pnpm/@formkit+inputs@1.6.7/node_modules/@formkit/inputs/dist/index.mjs","../../../node_modules/.pnpm/@formkit+themes@1.6.7_tailwindcss@3.4.13/node_modules/@formkit/themes/dist/index.mjs","../../../node_modules/.pnpm/@formkit+dev@1.6.7/node_modules/@formkit/dev/dist/index.mjs","../../../node_modules/.pnpm/@formkit+vue@1.6.7_tailwindcss@3.4.13_vue@3.5.12_typescript@5.6.2_/node_modules/@formkit/vue/dist/index.mjs","../../../app/javascript/shared/helpers/emoji.js","../../../app/javascript/shared/components/EmojiOrIcon.vue","../../../app/javascript/dashboard/components/ui/WootButton.vue","../../../app/javascript/shared/constants/countries.js","../../../node_modules/.pnpm/timezone-phone-codes@0.0.2/node_modules/timezone-phone-codes/dist/timezone-phone-codes.es.js","../../../node_modules/.pnpm/countries-and-timezones@3.6.0/node_modules/countries-and-timezones/esm/index.js","../../../app/javascript/shared/components/PhoneInput/helper.js","../../../app/javascript/dashboard/components/widgets/Avatar.vue","../../../app/javascript/dashboard/components/widgets/Thumbnail.vue","../../../node_modules/.pnpm/date-fns@2.21.1/node_modules/date-fns/esm/addDays/index.js","../../../node_modules/.pnpm/date-fns@2.21.1/node_modules/date-fns/esm/compareAsc/index.js","../../../node_modules/.pnpm/date-fns@2.21.1/node_modules/date-fns/esm/isSameDay/index.js","../../../node_modules/.pnpm/date-fns@2.21.1/node_modules/date-fns/esm/differenceInCalendarMonths/index.js","../../../node_modules/.pnpm/date-fns@2.21.1/node_modules/date-fns/esm/differenceInMilliseconds/index.js","../../../node_modules/.pnpm/date-fns@2.21.1/node_modules/date-fns/esm/endOfDay/index.js","../../../node_modules/.pnpm/date-fns@2.21.1/node_modules/date-fns/esm/endOfMonth/index.js","../../../node_modules/.pnpm/date-fns@2.21.1/node_modules/date-fns/esm/isLastDayOfMonth/index.js","../../../node_modules/.pnpm/date-fns@2.21.1/node_modules/date-fns/esm/differenceInMonths/index.js","../../../node_modules/.pnpm/date-fns@2.21.1/node_modules/date-fns/esm/differenceInSeconds/index.js","../../../node_modules/.pnpm/date-fns@2.21.1/node_modules/date-fns/esm/_lib/assign/index.js","../../../node_modules/.pnpm/date-fns@2.21.1/node_modules/date-fns/esm/_lib/cloneObject/index.js","../../../node_modules/.pnpm/date-fns@2.21.1/node_modules/date-fns/esm/formatDistance/index.js","../../../node_modules/.pnpm/date-fns@2.21.1/node_modules/date-fns/esm/formatDistanceToNow/index.js","../../../node_modules/.pnpm/date-fns@2.21.1/node_modules/date-fns/esm/getHours/index.js","../../../node_modules/.pnpm/date-fns@2.21.1/node_modules/date-fns/esm/getMinutes/index.js","../../../node_modules/.pnpm/date-fns@2.21.1/node_modules/date-fns/esm/getTime/index.js","../../../node_modules/.pnpm/date-fns@2.21.1/node_modules/date-fns/esm/getUnixTime/index.js","../../../node_modules/.pnpm/date-fns@2.21.1/node_modules/date-fns/esm/subDays/index.js","../../../node_modules/.pnpm/date-fns@2.21.1/node_modules/date-fns/esm/_lib/setUTCDay/index.js","../../../node_modules/.pnpm/date-fns@2.21.1/node_modules/date-fns/esm/_lib/setUTCISODay/index.js","../../../node_modules/.pnpm/date-fns@2.21.1/node_modules/date-fns/esm/_lib/setUTCISOWeek/index.js","../../../node_modules/.pnpm/date-fns@2.21.1/node_modules/date-fns/esm/_lib/setUTCWeek/index.js","../../../node_modules/.pnpm/date-fns@2.21.1/node_modules/date-fns/esm/parse/_lib/parsers/index.js","../../../node_modules/.pnpm/date-fns@2.21.1/node_modules/date-fns/esm/parse/index.js","../../../node_modules/.pnpm/date-fns@2.21.1/node_modules/date-fns/esm/isSameYear/index.js","../../../node_modules/.pnpm/date-fns@2.21.1/node_modules/date-fns/esm/isToday/index.js","../../../node_modules/.pnpm/date-fns@2.21.1/node_modules/date-fns/esm/isYesterday/index.js","../../../app/javascript/dashboard/composables/store.js","../../../node_modules/.pnpm/@rails+actioncable@6.1.3/node_modules/@rails/actioncable/app/assets/javascripts/action_cable.js","../../../app/javascript/shared/helpers/BaseActionCableConnector.js","../../../node_modules/.pnpm/rope-sequence@1.3.2/node_modules/rope-sequence/dist/index.es.js","../../../node_modules/.pnpm/orderedmap@2.1.0/node_modules/orderedmap/dist/index.js","../../../node_modules/.pnpm/prosemirror-model@1.22.3/node_modules/prosemirror-model/dist/index.js","../../../node_modules/.pnpm/prosemirror-transform@1.10.0/node_modules/prosemirror-transform/dist/index.js","../../../node_modules/.pnpm/prosemirror-state@1.4.3/node_modules/prosemirror-state/dist/index.js","../../../node_modules/.pnpm/prosemirror-history@1.4.1/node_modules/prosemirror-history/dist/index.js","../../../node_modules/.pnpm/prosemirror-dropcursor@1.8.1/node_modules/prosemirror-dropcursor/dist/index.js","../../../node_modules/.pnpm/w3c-keyname@2.2.4/node_modules/w3c-keyname/index.es.js","../../../node_modules/.pnpm/prosemirror-keymap@1.2.2/node_modules/prosemirror-keymap/dist/index.js","../../../node_modules/.pnpm/prosemirror-view@1.34.1/node_modules/prosemirror-view/dist/index.js","../../../node_modules/.pnpm/prosemirror-gapcursor@1.3.2/node_modules/prosemirror-gapcursor/dist/index.js","../../../node_modules/.pnpm/crelt@1.0.5/node_modules/crelt/index.es.js","../../../node_modules/.pnpm/prosemirror-commands@1.6.0/node_modules/prosemirror-commands/dist/index.js","../../../node_modules/.pnpm/prosemirror-menu@1.2.4/node_modules/prosemirror-menu/dist/index.js","../../../node_modules/.pnpm/prosemirror-inputrules@1.4.0/node_modules/prosemirror-inputrules/dist/index.js","../../../node_modules/.pnpm/prosemirror-utils@1.2.2_prosemirror-model@1.22.3_prosemirror-state@1.4.3/node_modules/prosemirror-utils/dist/index.js","../../../node_modules/.pnpm/prosemirror-schema-list@1.4.1/node_modules/prosemirror-schema-list/dist/index.js","../../../node_modules/.pnpm/mdurl@2.0.0/node_modules/mdurl/lib/decode.mjs","../../../node_modules/.pnpm/mdurl@2.0.0/node_modules/mdurl/lib/encode.mjs","../../../node_modules/.pnpm/mdurl@2.0.0/node_modules/mdurl/lib/format.mjs","../../../node_modules/.pnpm/mdurl@2.0.0/node_modules/mdurl/lib/parse.mjs","../../../node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/properties/Any/regex.mjs","../../../node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/categories/Cc/regex.mjs","../../../node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/categories/Cf/regex.mjs","../../../node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/categories/P/regex.mjs","../../../node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/categories/S/regex.mjs","../../../node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/categories/Z/regex.mjs","../../../node_modules/.pnpm/entities@4.5.0/node_modules/entities/lib/esm/generated/decode-data-html.js","../../../node_modules/.pnpm/entities@4.5.0/node_modules/entities/lib/esm/generated/decode-data-xml.js","../../../node_modules/.pnpm/entities@4.5.0/node_modules/entities/lib/esm/decode_codepoint.js","../../../node_modules/.pnpm/entities@4.5.0/node_modules/entities/lib/esm/decode.js","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/common/utils.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/helpers/parse_link_label.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/helpers/parse_link_destination.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/helpers/parse_link_title.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/renderer.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/ruler.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/token.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_core/state_core.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_core/normalize.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_core/block.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_core/inline.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_core/linkify.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_core/replacements.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_core/smartquotes.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_core/text_join.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/parser_core.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_block/state_block.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_block/table.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_block/code.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_block/fence.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_block/blockquote.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_block/hr.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_block/list.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_block/reference.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/common/html_blocks.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/common/html_re.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_block/html_block.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_block/heading.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_block/lheading.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_block/paragraph.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/parser_block.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/state_inline.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/text.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/linkify.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/newline.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/escape.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/backticks.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/strikethrough.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/emphasis.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/link.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/image.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/autolink.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/html_inline.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/entity.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/balance_pairs.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/fragments_join.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/parser_inline.mjs","../../../node_modules/.pnpm/linkify-it@5.0.0/node_modules/linkify-it/lib/re.mjs","../../../node_modules/.pnpm/linkify-it@5.0.0/node_modules/linkify-it/index.mjs","../../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.es6.js","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/presets/default.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/presets/zero.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/presets/commonmark.mjs","../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/index.mjs","../../../node_modules/.pnpm/prosemirror-markdown@1.13.0/node_modules/prosemirror-markdown/dist/index.js","../../../node_modules/.pnpm/markdown-it-sup@2.0.0/node_modules/markdown-it-sup/index.mjs","../../../node_modules/.pnpm/@chatwoot+prosemirror-schema@1.1.1-next/node_modules/@chatwoot/prosemirror-schema/dist/index.es.js","../../../app/javascript/dashboard/helper/editorHelper.js","../../../app/javascript/shared/helpers/FileHelper.js","../../../app/javascript/shared/helpers/timeHelper.js","../../../app/javascript/shared/components/ResizableTextArea.vue","../../../app/javascript/widget/i18n/index.js","../../../app/javascript/dashboard/routes/dashboard/settings/inbox/helpers/businessHour.js","../../../app/javascript/shared/helpers/DateHelper.js","../../../node_modules/.pnpm/vue-upload-component@3.1.17/node_modules/vue-upload-component/dist/vue-upload-component.js","../../../node_modules/.pnpm/activestorage@5.2.8/node_modules/activestorage/app/assets/javascripts/activestorage.js","../../../app/javascript/shared/components/ArticleSkeletonLoader.vue","../../../app/javascript/shared/components/IframeLoader.vue","../../../app/javascript/shared/helpers/MessageTypeHelper.js","../../../app/javascript/shared/helpers/IntegrationHelper.js","../../../app/javascript/dashboard/assets/images/typing.gif","../../../node_modules/.pnpm/urlpattern-polyfill@10.0.0/node_modules/urlpattern-polyfill/dist/urlpattern.js","../../../node_modules/.pnpm/urlpattern-polyfill@10.0.0/node_modules/urlpattern-polyfill/index.js"],"sourcesContent":["// packages/utils/src/index.ts\nvar isBrowser = typeof window !== \"undefined\";\nvar explicitKeys = [\n \"__key\",\n \"__init\",\n \"__shim\",\n \"__original\",\n \"__index\",\n \"__prevKey\"\n];\nfunction token() {\n return Math.random().toString(36).substring(2, 15);\n}\nfunction setify(items) {\n return items instanceof Set ? items : new Set(items);\n}\nfunction dedupe(arr1, arr2) {\n const original = arr1 instanceof Set ? arr1 : new Set(arr1);\n if (arr2)\n arr2.forEach((item) => original.add(item));\n return [...original];\n}\nfunction has(obj, property) {\n return Object.prototype.hasOwnProperty.call(obj, property);\n}\nfunction eq(valA, valB, deep = true, explicit = [\"__key\"]) {\n if (valA === valB)\n return true;\n if (typeof valB === \"object\" && typeof valA === \"object\") {\n if (valA instanceof Map)\n return false;\n if (valA instanceof Set)\n return false;\n if (valA instanceof Date && valB instanceof Date)\n return valA.getTime() === valB.getTime();\n if (valA instanceof RegExp && valB instanceof RegExp)\n return eqRegExp(valA, valB);\n if (valA === null || valB === null)\n return false;\n if (Object.keys(valA).length !== Object.keys(valB).length)\n return false;\n for (const k of explicit) {\n if ((k in valA || k in valB) && valA[k] !== valB[k])\n return false;\n }\n for (const key in valA) {\n if (!(key in valB))\n return false;\n if (valA[key] !== valB[key] && !deep)\n return false;\n if (deep && !eq(valA[key], valB[key], deep, explicit))\n return false;\n }\n return true;\n }\n return false;\n}\nfunction eqRegExp(x, y) {\n return x.source === y.source && x.flags.split(\"\").sort().join(\"\") === y.flags.split(\"\").sort().join(\"\");\n}\nfunction empty(value) {\n const type = typeof value;\n if (type === \"number\")\n return false;\n if (value === void 0)\n return true;\n if (type === \"string\") {\n return value === \"\";\n }\n if (type === \"object\") {\n if (value === null)\n return true;\n for (const _i in value)\n return false;\n if (value instanceof RegExp)\n return false;\n if (value instanceof Date)\n return false;\n return true;\n }\n return false;\n}\nfunction escapeExp(string) {\n return string.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\nfunction regexForFormat(format) {\n const escaped = `^${escapeExp(format)}$`;\n const formats = {\n MM: \"(0[1-9]|1[012])\",\n M: \"([1-9]|1[012])\",\n DD: \"([012][0-9]|3[01])\",\n D: \"([012]?[0-9]|3[01])\",\n YYYY: \"\\\\d{4}\",\n YY: \"\\\\d{2}\"\n };\n const tokens = Object.keys(formats);\n return new RegExp(\n tokens.reduce((regex, format2) => {\n return regex.replace(format2, formats[format2]);\n }, escaped)\n );\n}\nfunction nodeType(type) {\n const t = type.toLowerCase();\n if (t === \"list\")\n return \"list\";\n if (t === \"group\")\n return \"group\";\n return \"input\";\n}\nfunction isRecord(o) {\n return Object.prototype.toString.call(o) === \"[object Object]\";\n}\nfunction isObject(o) {\n return isRecord(o) || Array.isArray(o);\n}\nfunction isPojo(o) {\n if (isRecord(o) === false)\n return false;\n if (o.__FKNode__ || o.__POJO__ === false)\n return false;\n const ctor = o.constructor;\n if (ctor === void 0)\n return true;\n const prot = ctor.prototype;\n if (isRecord(prot) === false)\n return false;\n if (prot.hasOwnProperty(\"isPrototypeOf\") === false) {\n return false;\n }\n return true;\n}\nvar extend = /* @__NO_SIDE_EFFECTS__ */ (original, additional, extendArrays = false, ignoreUndefined = false) => {\n if (additional === null)\n return null;\n const merged = {};\n if (typeof additional === \"string\")\n return additional;\n for (const key in original) {\n if (has(additional, key) && (additional[key] !== void 0 || !ignoreUndefined)) {\n if (extendArrays && Array.isArray(original[key]) && Array.isArray(additional[key])) {\n merged[key] = original[key].concat(additional[key]);\n continue;\n }\n if (additional[key] === void 0) {\n continue;\n }\n if (isPojo(original[key]) && isPojo(additional[key])) {\n merged[key] = /* @__PURE__ */ extend(\n original[key],\n additional[key],\n extendArrays,\n ignoreUndefined\n );\n } else {\n merged[key] = additional[key];\n }\n } else {\n merged[key] = original[key];\n }\n }\n for (const key in additional) {\n if (!has(merged, key) && additional[key] !== void 0) {\n merged[key] = additional[key];\n }\n }\n return merged;\n};\nfunction isQuotedString(str) {\n if (str[0] !== '\"' && str[0] !== \"'\")\n return false;\n if (str[0] !== str[str.length - 1])\n return false;\n const quoteType = str[0];\n for (let p = 1; p < str.length; p++) {\n if (str[p] === quoteType && (p === 1 || str[p - 1] !== \"\\\\\") && p !== str.length - 1) {\n return false;\n }\n }\n return true;\n}\nfunction rmEscapes(str) {\n if (!str.length)\n return \"\";\n let clean = \"\";\n let lastChar = \"\";\n for (let p = 0; p < str.length; p++) {\n const char = str.charAt(p);\n if (char !== \"\\\\\" || lastChar === \"\\\\\") {\n clean += char;\n }\n lastChar = char;\n }\n return clean;\n}\nfunction assignDeep(a, b) {\n for (const key in a) {\n if (has(b, key) && a[key] !== b[key] && !(isPojo(a[key]) && isPojo(b[key]))) {\n a[key] = b[key];\n } else if (isPojo(a[key]) && isPojo(b[key])) {\n assignDeep(a[key], b[key]);\n }\n }\n for (const key in b) {\n if (!has(a, key)) {\n a[key] = b[key];\n }\n }\n return a;\n}\nfunction nodeProps(...sets) {\n return sets.reduce((valid, props) => {\n const { value, name, modelValue, config, plugins, ...validProps } = props;\n return Object.assign(valid, validProps);\n }, {});\n}\nfunction parseArgs(str) {\n const args = [];\n let arg = \"\";\n let depth = 0;\n let quote = \"\";\n let lastChar = \"\";\n for (let p = 0; p < str.length; p++) {\n const char = str.charAt(p);\n if (char === quote && lastChar !== \"\\\\\") {\n quote = \"\";\n } else if ((char === \"'\" || char === '\"') && !quote && lastChar !== \"\\\\\") {\n quote = char;\n } else if (char === \"(\" && !quote) {\n depth++;\n } else if (char === \")\" && !quote) {\n depth--;\n }\n if (char === \",\" && !quote && depth === 0) {\n args.push(arg);\n arg = \"\";\n } else if (char !== \" \" || quote) {\n arg += char;\n }\n lastChar = char;\n }\n if (arg) {\n args.push(arg);\n }\n return args;\n}\nfunction except(obj, toRemove) {\n const clean = {};\n const exps = toRemove.filter((n) => n instanceof RegExp);\n const keysToRemove = new Set(toRemove);\n for (const key in obj) {\n if (!keysToRemove.has(key) && !exps.some((exp) => exp.test(key))) {\n clean[key] = obj[key];\n }\n }\n return clean;\n}\nfunction only(obj, include) {\n const clean = {};\n const exps = include.filter((n) => n instanceof RegExp);\n include.forEach((key) => {\n if (!(key instanceof RegExp)) {\n clean[key] = obj[key];\n }\n });\n Object.keys(obj).forEach((key) => {\n if (exps.some((exp) => exp.test(key))) {\n clean[key] = obj[key];\n }\n });\n return clean;\n}\nfunction camel(str) {\n return str.replace(\n /-([a-z0-9])/gi,\n (_s, g) => g.toUpperCase()\n );\n}\nfunction kebab(str) {\n return str.replace(\n /([a-z0-9])([A-Z])/g,\n (_s, trail, cap) => trail + \"-\" + cap.toLowerCase()\n ).replace(\" \", \"-\").toLowerCase();\n}\nfunction shallowClone(obj, explicit = explicitKeys) {\n if (obj !== null && typeof obj === \"object\") {\n let returnObject;\n if (Array.isArray(obj))\n returnObject = [...obj];\n else if (isPojo(obj))\n returnObject = { ...obj };\n if (returnObject) {\n applyExplicit(obj, returnObject, explicit);\n return returnObject;\n }\n }\n return obj;\n}\nfunction clone(obj, explicit = explicitKeys) {\n if (obj === null || obj instanceof RegExp || obj instanceof Date || obj instanceof Map || obj instanceof Set || typeof File === \"function\" && obj instanceof File)\n return obj;\n let returnObject;\n if (Array.isArray(obj)) {\n returnObject = obj.map((value) => {\n if (typeof value === \"object\")\n return clone(value, explicit);\n return value;\n });\n } else {\n returnObject = Object.keys(obj).reduce((newObj, key) => {\n newObj[key] = typeof obj[key] === \"object\" ? clone(obj[key], explicit) : obj[key];\n return newObj;\n }, {});\n }\n for (const key of explicit) {\n if (key in obj) {\n Object.defineProperty(returnObject, key, {\n enumerable: false,\n value: obj[key]\n });\n }\n }\n return returnObject;\n}\nfunction cloneAny(obj) {\n return typeof obj === \"object\" ? clone(obj) : obj;\n}\nfunction getAt(obj, addr) {\n if (!obj || typeof obj !== \"object\")\n return null;\n const segments = addr.split(\".\");\n let o = obj;\n for (const i in segments) {\n const segment = segments[i];\n if (has(o, segment)) {\n o = o[segment];\n }\n if (+i === segments.length - 1)\n return o;\n if (!o || typeof o !== \"object\")\n return null;\n }\n return null;\n}\nfunction undefine(value) {\n return value !== void 0 && value !== \"false\" && value !== false ? true : void 0;\n}\nfunction init(obj) {\n return !Object.isFrozen(obj) ? Object.defineProperty(obj, \"__init\", {\n enumerable: false,\n value: true\n }) : obj;\n}\nfunction slugify(str) {\n return str.normalize(\"NFD\").replace(/[\\u0300-\\u036f]/g, \"\").toLowerCase().replace(/[^a-z0-9]/g, \" \").trim().replace(/\\s+/g, \"-\");\n}\nfunction spread(obj, explicit = explicitKeys) {\n if (obj && typeof obj === \"object\") {\n if (obj instanceof RegExp)\n return obj;\n if (obj instanceof Date)\n return obj;\n let spread2;\n if (Array.isArray(obj)) {\n spread2 = [...obj];\n } else {\n spread2 = { ...obj };\n }\n return applyExplicit(\n obj,\n spread2,\n explicit\n );\n }\n return obj;\n}\nfunction applyExplicit(original, obj, explicit) {\n for (const key of explicit) {\n if (key in original) {\n Object.defineProperty(obj, key, {\n enumerable: false,\n value: original[key]\n });\n }\n }\n return obj;\n}\nfunction whenAvailable(childId, callback, root) {\n if (!isBrowser)\n return;\n if (!root)\n root = document;\n const el = root.getElementById(childId);\n if (el)\n return callback(el);\n const observer = new MutationObserver(() => {\n const el2 = root?.getElementById(childId);\n if (el2) {\n observer?.disconnect();\n callback(el2);\n }\n });\n observer.observe(root, { childList: true, subtree: true });\n}\nfunction oncePerTick(fn) {\n let called = false;\n return (...args) => {\n if (called)\n return;\n called = true;\n queueMicrotask(() => called = false);\n return fn(...args);\n };\n}\nfunction boolGetter(value) {\n if (value === \"false\" || value === false)\n return void 0;\n return true;\n}\n\nexport { assignDeep, boolGetter, camel, clone, cloneAny, dedupe, empty, eq, eqRegExp, escapeExp, except, extend, getAt, has, init, isObject, isPojo, isQuotedString, isRecord, kebab, nodeProps, nodeType, oncePerTick, only, parseArgs, regexForFormat, rmEscapes, setify, shallowClone, slugify, spread, token, undefine, whenAvailable };\n//# sourceMappingURL=out.js.map\n//# sourceMappingURL=index.mjs.map","import { token, cloneAny, empty, isObject, init, eq, clone, camel, extend as extend$1, undefine, has, kebab, dedupe, parseArgs, getAt, isQuotedString, rmEscapes, slugify, boolGetter, isRecord } from '@formkit/utils';\n\n// packages/core/src/dispatcher.ts\nfunction createDispatcher() {\n const middleware = [];\n let currentIndex = 0;\n const use2 = (dispatchable) => middleware.push(dispatchable);\n const dispatch = (payload) => {\n const current = middleware[currentIndex];\n if (typeof current === \"function\") {\n return current(payload, (explicitPayload) => {\n currentIndex++;\n return dispatch(explicitPayload);\n });\n }\n currentIndex = 0;\n return payload;\n };\n use2.dispatch = dispatch;\n use2.unshift = (dispatchable) => middleware.unshift(dispatchable);\n use2.remove = (dispatchable) => {\n const index = middleware.indexOf(dispatchable);\n if (index > -1)\n middleware.splice(index, 1);\n };\n return use2;\n}\nfunction createEmitter() {\n const listeners = /* @__PURE__ */ new Map();\n const receipts2 = /* @__PURE__ */ new Map();\n let buffer = void 0;\n const emitter = (node, event) => {\n if (buffer) {\n buffer.set(event.name, [node, event]);\n return;\n }\n if (listeners.has(event.name)) {\n listeners.get(event.name).forEach((wrapper) => {\n if (event.origin === node || wrapper.modifiers.includes(\"deep\")) {\n wrapper.listener(event);\n }\n });\n }\n if (event.bubble) {\n node.bubble(event);\n }\n };\n emitter.flush = () => {\n listeners.clear();\n receipts2.clear();\n buffer?.clear();\n };\n emitter.on = (eventName, listener, pos = \"push\") => {\n const [event, ...modifiers] = eventName.split(\".\");\n const receipt = listener.receipt || token();\n const wrapper = {\n modifiers,\n event,\n listener,\n receipt\n };\n listeners.has(event) ? listeners.get(event)[pos](wrapper) : listeners.set(event, [wrapper]);\n receipts2.has(receipt) ? receipts2.get(receipt)[pos](event) : receipts2.set(receipt, [event]);\n return receipt;\n };\n emitter.off = (receipt) => {\n if (receipts2.has(receipt)) {\n receipts2.get(receipt)?.forEach((event) => {\n const eventListeners = listeners.get(event);\n if (Array.isArray(eventListeners)) {\n listeners.set(\n event,\n eventListeners.filter((wrapper) => wrapper.receipt !== receipt)\n );\n }\n });\n receipts2.delete(receipt);\n }\n };\n emitter.pause = (node) => {\n if (!buffer)\n buffer = /* @__PURE__ */ new Map();\n if (node) {\n node.walk((child) => child._e.pause());\n }\n };\n emitter.play = (node) => {\n if (!buffer)\n return;\n const events = buffer;\n buffer = void 0;\n events.forEach(([node2, event]) => emitter(node2, event));\n if (node) {\n node.walk((child) => child._e.play());\n }\n };\n return emitter;\n}\nfunction emit(node, context, name, payload, bubble2 = true, meta) {\n context._e(node, {\n payload,\n name,\n bubble: bubble2,\n origin: node,\n meta\n });\n return node;\n}\nfunction bubble(node, _context, event) {\n if (isNode(node.parent)) {\n node.parent._e(node.parent, event);\n }\n return node;\n}\nfunction on(_node, context, name, listener, pos) {\n return context._e.on(name, listener, pos);\n}\nfunction off(node, context, receipt) {\n context._e.off(receipt);\n return node;\n}\n\n// packages/core/src/errors.ts\nvar errorHandler = createDispatcher();\nerrorHandler((error2, next) => {\n if (!error2.message)\n error2.message = String(`E${error2.code}`);\n return next(error2);\n});\nvar warningHandler = createDispatcher();\nwarningHandler((warning, next) => {\n if (!warning.message)\n warning.message = String(`W${warning.code}`);\n const result = next(warning);\n if (console && typeof console.warn === \"function\")\n console.warn(result.message);\n return result;\n});\nfunction warn(code, data = {}) {\n warningHandler.dispatch({ code, data });\n}\nfunction error(code, data = {}) {\n throw Error(errorHandler.dispatch({ code, data }).message);\n}\nfunction createMessage(conf, node) {\n const m = {\n blocking: false,\n key: token(),\n meta: {},\n type: \"state\",\n visible: true,\n ...conf\n };\n if (node && m.value && m.meta.localize !== false) {\n m.value = node.t(m);\n m.meta.locale = node.config.locale;\n }\n return m;\n}\nvar storeTraps = {\n apply: applyMessages,\n set: setMessage,\n remove: removeMessage,\n filter: filterMessages,\n reduce: reduceMessages,\n release: releaseBuffer,\n touch: touchMessages\n};\nfunction createStore(_buffer = false) {\n const messages = {};\n let node;\n let buffer = _buffer;\n let _b = [];\n const _m = /* @__PURE__ */ new Map();\n let _r = void 0;\n const store = new Proxy(messages, {\n get(...args) {\n const [_target, property] = args;\n if (property === \"buffer\")\n return buffer;\n if (property === \"_b\")\n return _b;\n if (property === \"_m\")\n return _m;\n if (property === \"_r\")\n return _r;\n if (has(storeTraps, property)) {\n return storeTraps[property].bind(\n null,\n messages,\n store,\n node\n );\n }\n return Reflect.get(...args);\n },\n set(_t, prop, value) {\n if (prop === \"_n\") {\n node = value;\n if (_r === \"__n\")\n releaseMissed(node, store);\n return true;\n } else if (prop === \"_b\") {\n _b = value;\n return true;\n } else if (prop === \"buffer\") {\n buffer = value;\n return true;\n } else if (prop === \"_r\") {\n _r = value;\n return true;\n }\n error(101, node);\n return false;\n }\n });\n return store;\n}\nfunction setMessage(messageStore, store, node, message) {\n if (store.buffer) {\n store._b.push([[message]]);\n return store;\n }\n if (messageStore[message.key] !== message) {\n if (typeof message.value === \"string\" && message.meta.localize !== false) {\n const previous = message.value;\n message.value = node.t(message);\n if (message.value !== previous) {\n message.meta.locale = node.props.locale;\n }\n }\n const e = `message-${has(messageStore, message.key) ? \"updated\" : \"added\"}`;\n messageStore[message.key] = Object.freeze(\n node.hook.message.dispatch(message)\n );\n node.emit(e, message);\n }\n return store;\n}\nfunction touchMessages(messageStore, store) {\n for (const key in messageStore) {\n const message = { ...messageStore[key] };\n store.set(message);\n }\n}\nfunction removeMessage(messageStore, store, node, key) {\n if (has(messageStore, key)) {\n const message = messageStore[key];\n delete messageStore[key];\n node.emit(\"message-removed\", message);\n }\n if (store.buffer === true) {\n store._b = store._b.filter((buffered) => {\n buffered[0] = buffered[0].filter((m) => m.key !== key);\n return buffered[1] || buffered[0].length;\n });\n }\n return store;\n}\nfunction filterMessages(messageStore, store, node, callback, type) {\n for (const key in messageStore) {\n const message = messageStore[key];\n if ((!type || message.type === type) && !callback(message)) {\n removeMessage(messageStore, store, node, key);\n }\n }\n}\nfunction reduceMessages(messageStore, _store, _node, reducer, accumulator) {\n for (const key in messageStore) {\n const message = messageStore[key];\n accumulator = reducer(accumulator, message);\n }\n return accumulator;\n}\nfunction applyMessages(_messageStore, store, node, messages, clear) {\n if (Array.isArray(messages)) {\n if (store.buffer) {\n store._b.push([messages, clear]);\n return;\n }\n const applied = new Set(\n messages.map((message) => {\n store.set(message);\n return message.key;\n })\n );\n if (typeof clear === \"string\") {\n store.filter(\n (message) => message.type !== clear || applied.has(message.key)\n );\n } else if (typeof clear === \"function\") {\n store.filter((message) => !clear(message) || applied.has(message.key));\n }\n } else {\n for (const address in messages) {\n const child = node.at(address);\n if (child) {\n child.store.apply(messages[address], clear);\n } else {\n missed(node, store, address, messages[address], clear);\n }\n }\n }\n}\nfunction createMessages(node, ...errors) {\n const sourceKey = `${node.name}-set`;\n const make = (error2) => /* @__PURE__ */ createMessage({\n key: slugify(error2),\n type: \"error\",\n value: error2,\n meta: { source: sourceKey, autoClear: true }\n });\n return errors.filter((m) => !!m).map((errorSet) => {\n if (typeof errorSet === \"string\")\n errorSet = [errorSet];\n if (Array.isArray(errorSet)) {\n return errorSet.map((error2) => make(error2));\n } else {\n const errors2 = {};\n for (const key in errorSet) {\n if (Array.isArray(errorSet[key])) {\n errors2[key] = errorSet[key].map(\n (error2) => make(error2)\n );\n } else {\n errors2[key] = [make(errorSet[key])];\n }\n }\n return errors2;\n }\n });\n}\nfunction missed(node, store, address, messages, clear) {\n const misses = store._m;\n if (!misses.has(address))\n misses.set(address, []);\n if (!store._r)\n store._r = releaseMissed(node, store);\n misses.get(address)?.push([messages, clear]);\n}\nfunction releaseMissed(node, store) {\n return node.on(\n \"child.deep\",\n ({ payload: child }) => {\n store._m.forEach((misses, address) => {\n if (node.at(address) === child) {\n misses.forEach(([messages, clear]) => {\n child.store.apply(messages, clear);\n });\n store._m.delete(address);\n }\n });\n if (store._m.size === 0 && store._r) {\n node.off(store._r);\n store._r = void 0;\n }\n }\n );\n}\nfunction releaseBuffer(_messageStore, store) {\n store.buffer = false;\n store._b.forEach(([messages, clear]) => store.apply(messages, clear));\n store._b = [];\n}\nfunction createLedger() {\n const ledger = {};\n let n;\n return {\n count: (...args) => createCounter(n, ledger, ...args),\n init(node) {\n n = node;\n node.on(\"message-added.deep\", add(ledger, 1));\n node.on(\"message-removed.deep\", add(ledger, -1));\n },\n merge: (child) => merge(n, ledger, child),\n settled(counterName) {\n return has(ledger, counterName) ? ledger[counterName].promise : Promise.resolve();\n },\n unmerge: (child) => merge(n, ledger, child, true),\n value(counterName) {\n return has(ledger, counterName) ? ledger[counterName].count : 0;\n }\n };\n}\nfunction createCounter(node, ledger, counterName, condition, increment = 0) {\n condition = parseCondition(condition || counterName);\n if (!has(ledger, counterName)) {\n const counter = {\n condition,\n count: 0,\n name: counterName,\n node,\n promise: Promise.resolve(),\n resolve: () => {\n }\n // eslint-disable-line @typescript-eslint/no-empty-function\n };\n ledger[counterName] = counter;\n increment = node.store.reduce(\n (sum, m) => sum + counter.condition(m) * 1,\n increment\n );\n node.each((child) => {\n child.ledger.count(counter.name, counter.condition);\n increment += child.ledger.value(counter.name);\n });\n }\n return count(ledger[counterName], increment).promise;\n}\nfunction parseCondition(condition) {\n if (typeof condition === \"function\") {\n return condition;\n }\n return (m) => m.type === condition;\n}\nfunction count(counter, increment) {\n const initial = counter.count;\n const post = counter.count + increment;\n counter.count = post;\n if (initial === 0 && post !== 0) {\n counter.node.emit(`unsettled:${counter.name}`, counter.count, false);\n counter.promise = new Promise((r) => counter.resolve = r);\n } else if (initial !== 0 && post === 0) {\n counter.node.emit(`settled:${counter.name}`, counter.count, false);\n counter.resolve();\n }\n counter.node.emit(`count:${counter.name}`, counter.count, false);\n return counter;\n}\nfunction add(ledger, delta) {\n return (e) => {\n for (const name in ledger) {\n const counter = ledger[name];\n if (counter.condition(e.payload)) {\n count(counter, delta);\n }\n }\n };\n}\nfunction merge(parent, ledger, child, remove = false) {\n const originalParent = parent;\n for (const key in ledger) {\n const condition = ledger[key].condition;\n if (!remove)\n child.ledger.count(key, condition);\n const increment = child.ledger.value(key) * (remove ? -1 : 1);\n if (!parent)\n continue;\n do {\n parent.ledger.count(key, condition, increment);\n parent = parent.parent;\n } while (parent);\n parent = originalParent;\n }\n}\n\n// packages/core/src/registry.ts\nvar registry = /* @__PURE__ */ new Map();\nvar reflected = /* @__PURE__ */ new Map();\nvar emit2 = createEmitter();\nvar receipts = [];\nfunction register(node) {\n if (node.props.id) {\n registry.set(node.props.id, node);\n reflected.set(node, node.props.id);\n emit2(node, {\n payload: node,\n name: node.props.id,\n bubble: false,\n origin: node\n });\n }\n}\nfunction deregister(node) {\n if (reflected.has(node)) {\n const id = reflected.get(node);\n reflected.delete(node);\n registry.delete(id);\n emit2(node, {\n payload: null,\n name: id,\n bubble: false,\n origin: node\n });\n }\n}\nfunction getNode(id) {\n return registry.get(id);\n}\nfunction resetRegistry() {\n registry.forEach((node) => {\n deregister(node);\n });\n receipts.forEach((receipt) => emit2.off(receipt));\n}\nfunction watchRegistry(id, callback) {\n const receipt = emit2.on(id, callback);\n receipts.push(receipt);\n return receipt;\n}\nfunction stopWatch(receipt) {\n emit2.off(receipt);\n}\n\n// packages/core/src/config.ts\nfunction configChange(node, prop, value) {\n let usingFallback = true;\n !(prop in node.config._t) ? node.emit(`config:${prop}`, value, false) : usingFallback = false;\n if (!(prop in node.props)) {\n node.emit(\"prop\", { prop, value });\n node.emit(`prop:${prop}`, value);\n }\n return usingFallback;\n}\nfunction createConfig(options = {}) {\n const nodes = /* @__PURE__ */ new Set();\n const target = {\n ...options,\n ...{\n _add: (node) => nodes.add(node),\n _rm: (node) => nodes.delete(node)\n }\n };\n const rootConfig = new Proxy(target, {\n set(t, prop, value, r) {\n if (typeof prop === \"string\") {\n nodes.forEach((node) => configChange(node, prop, value));\n }\n return Reflect.set(t, prop, value, r);\n }\n });\n return rootConfig;\n}\n\n// packages/core/src/submitForm.ts\nfunction submitForm(id, root) {\n const formElement = (root || document).getElementById(id);\n if (formElement instanceof HTMLFormElement) {\n const event = new Event(\"submit\", { cancelable: true, bubbles: true });\n formElement.dispatchEvent(event);\n return;\n }\n warn(151, id);\n}\nfunction clearState(node) {\n const clear = (n) => {\n for (const key in n.store) {\n const message = n.store[key];\n if (message.type === \"error\" || message.type === \"ui\" && key === \"incomplete\") {\n n.store.remove(key);\n } else if (message.type === \"state\") {\n n.store.set({ ...message, value: false });\n }\n }\n };\n clear(node);\n node.walk(clear);\n}\nfunction reset(id, resetTo) {\n const node = typeof id === \"string\" ? getNode(id) : id;\n if (node) {\n const initial = (n) => cloneAny(n.props.initial) || (n.type === \"group\" ? {} : n.type === \"list\" ? [] : void 0);\n node._e.pause(node);\n const resetValue2 = cloneAny(resetTo);\n if (resetTo && !empty(resetTo)) {\n node.props.initial = isObject(resetValue2) ? init(resetValue2) : resetValue2;\n node.props._init = node.props.initial;\n }\n node.input(initial(node), false);\n node.walk((child) => {\n if (child.type === \"list\" && child.sync)\n return;\n child.input(initial(child), false);\n });\n node.input(\n empty(resetValue2) && resetValue2 ? resetValue2 : initial(node),\n false\n );\n const isDeepReset = node.type !== \"input\" && resetTo && !empty(resetTo) && isObject(resetTo);\n if (isDeepReset) {\n node.walk((child) => {\n child.props.initial = isObject(child.value) ? init(child.value) : child.value;\n child.props._init = child.props.initial;\n });\n }\n node._e.play(node);\n clearState(node);\n node.emit(\"reset\", node);\n return node;\n }\n warn(152, id);\n return;\n}\n\n// packages/core/src/node.ts\nvar defaultConfig = {\n delimiter: \".\",\n delay: 0,\n locale: \"en\",\n rootClasses: (key) => ({ [`formkit-${kebab(key)}`]: true })\n};\nvar useIndex = Symbol(\"index\");\nvar valueRemoved = Symbol(\"removed\");\nvar valueMoved = Symbol(\"moved\");\nvar valueInserted = Symbol(\"inserted\");\nfunction isList(arg) {\n return arg.type === \"list\" && Array.isArray(arg._value);\n}\nfunction isNode(node) {\n return node && typeof node === \"object\" && node.__FKNode__ === true;\n}\nvar invalidSetter = (node, _context, property) => {\n error(102, [node, property]);\n};\nvar traps = {\n _c: trap(getContext, invalidSetter, false),\n add: trap(addChild),\n addProps: trap(addProps),\n address: trap(getAddress, invalidSetter, false),\n at: trap(getNode2),\n bubble: trap(bubble),\n clearErrors: trap(clearErrors),\n calm: trap(calm),\n config: trap(false),\n define: trap(define),\n disturb: trap(disturb),\n destroy: trap(destroy),\n extend: trap(extend),\n hydrate: trap(hydrate),\n index: trap(getIndex, setIndex, false),\n input: trap(input),\n each: trap(eachChild),\n emit: trap(emit),\n find: trap(find),\n on: trap(on),\n off: trap(off),\n parent: trap(false, setParent),\n plugins: trap(false),\n remove: trap(removeChild),\n root: trap(getRoot, invalidSetter, false),\n reset: trap(resetValue),\n resetConfig: trap(resetConfig),\n setErrors: trap(setErrors),\n submit: trap(submit),\n t: trap(text),\n use: trap(use),\n name: trap(getName, false, false),\n walk: trap(walkTree)\n};\nfunction createTraps() {\n return new Map(Object.entries(traps));\n}\nfunction trap(getter, setter, curryGetter = true) {\n return {\n get: getter ? (node, context) => curryGetter ? (...args) => getter(node, context, ...args) : getter(node, context) : false,\n set: setter !== void 0 ? setter : invalidSetter.bind(null)\n };\n}\nfunction createHooks() {\n const hooks = /* @__PURE__ */ new Map();\n return new Proxy(hooks, {\n get(_, property) {\n if (!hooks.has(property)) {\n hooks.set(property, createDispatcher());\n }\n return hooks.get(property);\n }\n });\n}\nvar nameCount = 0;\nvar idCount = 0;\nfunction resetCount() {\n nameCount = 0;\n idCount = 0;\n}\nfunction names(children) {\n return children.reduce(\n (named, child) => Object.assign(named, { [child.name]: child }),\n {}\n );\n}\nfunction createName(options) {\n if (options.parent?.type === \"list\")\n return useIndex;\n return options.name || `${options.props?.type || \"input\"}_${++nameCount}`;\n}\nfunction createValue(options) {\n if (options.type === \"group\") {\n return init(\n options.value && typeof options.value === \"object\" && !Array.isArray(options.value) ? options.value : {}\n );\n } else if (options.type === \"list\") {\n return init(Array.isArray(options.value) ? options.value : []);\n }\n return options.value;\n}\nfunction input(node, context, value, async = true) {\n context._value = validateInput(node, node.hook.input.dispatch(value));\n node.emit(\"input\", context._value);\n if (node.isCreated && node.type === \"input\" && eq(context._value, context.value) && !node.props.mergeStrategy) {\n node.emit(\"commitRaw\", context.value);\n return context.settled;\n }\n if (context.isSettled)\n node.disturb();\n if (async) {\n if (context._tmo)\n clearTimeout(context._tmo);\n context._tmo = setTimeout(\n commit,\n node.props.delay,\n node,\n context\n );\n } else {\n commit(node, context);\n }\n return context.settled;\n}\nfunction validateInput(node, value) {\n switch (node.type) {\n case \"input\":\n break;\n case \"group\":\n if (!value || typeof value !== \"object\")\n error(107, [node, value]);\n break;\n case \"list\":\n if (!Array.isArray(value))\n error(108, [node, value]);\n break;\n }\n return value;\n}\nfunction commit(node, context, calm2 = true, hydrate2 = true) {\n context._value = context.value = node.hook.commit.dispatch(context._value);\n if (node.type !== \"input\" && hydrate2)\n node.hydrate();\n node.emit(\"commitRaw\", context.value);\n node.emit(\"commit\", context.value);\n if (calm2)\n node.calm();\n}\nfunction partial(context, { name, value, from }) {\n if (Object.isFrozen(context._value))\n return;\n if (isList(context)) {\n const insert = value === valueRemoved ? [] : value === valueMoved && typeof from === \"number\" ? context._value.splice(from, 1) : [value];\n context._value.splice(\n name,\n value === valueMoved || from === valueInserted ? 0 : 1,\n ...insert\n );\n return;\n }\n if (value !== valueRemoved) {\n context._value[name] = value;\n } else {\n delete context._value[name];\n }\n}\nfunction hydrate(node, context) {\n const _value = context._value;\n if (node.type === \"list\" && node.sync)\n syncListNodes(node, context);\n context.children.forEach((child) => {\n if (typeof _value !== \"object\")\n return;\n if (child.name in _value) {\n const childValue = child.type !== \"input\" || _value[child.name] && typeof _value[child.name] === \"object\" ? init(_value[child.name]) : _value[child.name];\n if (!child.isSettled || (!isObject(childValue) || child.props.mergeStrategy) && eq(childValue, child._value))\n return;\n child.input(childValue, false);\n } else {\n if (node.type !== \"list\" || typeof child.name === \"number\") {\n partial(context, { name: child.name, value: child.value });\n }\n if (!_value.__init) {\n if (child.type === \"group\")\n child.input({}, false);\n else if (child.type === \"list\")\n child.input([], false);\n else\n child.input(void 0, false);\n }\n }\n });\n return node;\n}\nfunction syncListNodes(node, context) {\n const _value = node._value;\n if (!Array.isArray(_value))\n return;\n const newChildren = [];\n const unused = new Set(context.children);\n const placeholderValues = /* @__PURE__ */ new Map();\n _value.forEach((value, i) => {\n if (context.children[i] && context.children[i]._value === value) {\n newChildren.push(context.children[i]);\n unused.delete(context.children[i]);\n } else {\n newChildren.push(null);\n const indexes = placeholderValues.get(value) || [];\n indexes.push(i);\n placeholderValues.set(value, indexes);\n }\n });\n if (unused.size && placeholderValues.size) {\n unused.forEach((child) => {\n if (placeholderValues.has(child._value)) {\n const indexes = placeholderValues.get(child._value);\n const index = indexes.shift();\n newChildren[index] = child;\n unused.delete(child);\n if (!indexes.length)\n placeholderValues.delete(child._value);\n }\n });\n }\n const emptyIndexes = [];\n placeholderValues.forEach((indexes) => {\n emptyIndexes.push(...indexes);\n });\n while (unused.size && emptyIndexes.length) {\n const child = unused.values().next().value;\n const index = emptyIndexes.shift();\n if (index === void 0)\n break;\n newChildren[index] = child;\n unused.delete(child);\n }\n emptyIndexes.forEach((index, value) => {\n newChildren[index] = createPlaceholder({ value });\n });\n if (unused.size) {\n unused.forEach((child) => {\n if (!(\"__FKP\" in child)) {\n const parent = child._c.parent;\n if (!parent || isPlaceholder(parent))\n return;\n parent.ledger.unmerge(child);\n child._c.parent = null;\n child.destroy();\n }\n });\n }\n context.children = newChildren;\n}\nfunction disturb(node, context) {\n if (context._d <= 0) {\n context.isSettled = false;\n node.emit(\"settled\", false, false);\n context.settled = new Promise((resolve) => {\n context._resolve = resolve;\n });\n if (node.parent)\n node.parent?.disturb();\n }\n context._d++;\n return node;\n}\nfunction calm(node, context, value) {\n if (value !== void 0 && node.type !== \"input\") {\n partial(context, value);\n const shouldHydrate = !!(node.config.mergeStrategy && node.config.mergeStrategy[value.name]);\n return commit(node, context, true, shouldHydrate);\n }\n if (context._d > 0)\n context._d--;\n if (context._d === 0) {\n context.isSettled = true;\n node.emit(\"settled\", true, false);\n if (node.parent)\n node.parent?.calm({ name: node.name, value: context.value });\n if (context._resolve)\n context._resolve(context.value);\n }\n}\nfunction destroy(node, context) {\n node.emit(\"destroying\", node);\n node.store.filter(() => false);\n if (node.parent) {\n node.parent.remove(node);\n }\n deregister(node);\n node.emit(\"destroyed\", node);\n context._e.flush();\n context._value = context.value = void 0;\n for (const property in context.context) {\n delete context.context[property];\n }\n context.plugins.clear();\n context.context = null;\n}\nfunction define(node, context, definition) {\n context.type = definition.type;\n const clonedDef = clone(definition);\n node.props.__propDefs = mergeProps(\n node.props.__propDefs ?? [],\n clonedDef?.props || []\n );\n clonedDef.props = node.props.__propDefs;\n context.props.definition = clonedDef;\n context.value = context._value = createValue({\n type: node.type,\n value: context.value\n });\n if (definition.forceTypeProp) {\n if (node.props.type)\n node.props.originalType = node.props.type;\n context.props.type = definition.forceTypeProp;\n }\n if (definition.family) {\n context.props.family = definition.family;\n }\n if (definition.features) {\n definition.features.forEach((feature) => feature(node));\n }\n if (definition.props) {\n node.addProps(definition.props);\n }\n node.emit(\"defined\", definition);\n}\nfunction addProps(node, context, props) {\n const propNames = Array.isArray(props) ? props : Object.keys(props);\n const defaults = !Array.isArray(props) ? propNames.reduce((defaults2, name) => {\n if (\"default\" in props[name]) {\n defaults2[name] = props[name].default;\n }\n return defaults2;\n }, {}) : {};\n if (node.props.attrs) {\n const attrs = { ...node.props.attrs };\n node.props._emit = false;\n for (const attr in attrs) {\n const camelName = camel(attr);\n if (propNames.includes(camelName)) {\n node.props[camelName] = attrs[attr];\n delete attrs[attr];\n }\n }\n if (!Array.isArray(props)) {\n propNames.forEach((prop) => {\n if (\"default\" in props[prop] && node.props[prop] === void 0) {\n node.props[prop] = defaults[prop];\n }\n });\n }\n const initial = cloneAny(context._value);\n node.props.initial = node.type !== \"input\" ? init(initial) : initial;\n node.props._emit = true;\n node.props.attrs = attrs;\n }\n const mergedProps = mergeProps(node.props.__propDefs ?? [], props);\n if (node.props.definition) {\n node.props.definition.props = mergedProps;\n }\n node.props.__propDefs = mergedProps;\n node.emit(\"added-props\", props);\n return node;\n}\nfunction toPropsObj(props) {\n return !Array.isArray(props) ? props : props.reduce((props2, prop) => {\n props2[prop] = {};\n return props2;\n }, {});\n}\nfunction mergeProps(props, newProps) {\n if (Array.isArray(props) && Array.isArray(newProps))\n return props.concat(newProps);\n return extend$1(toPropsObj(props), toPropsObj(newProps));\n}\nfunction addChild(parent, parentContext, child, listIndex) {\n if (parent.type === \"input\")\n error(100, parent);\n if (child.parent && child.parent !== parent) {\n child.parent.remove(child);\n }\n if (!parentContext.children.includes(child)) {\n if (listIndex !== void 0 && parent.type === \"list\") {\n const existingNode = parentContext.children[listIndex];\n if (existingNode && \"__FKP\" in existingNode) {\n child._c.uid = existingNode.uid;\n parentContext.children.splice(listIndex, 1, child);\n } else {\n parentContext.children.splice(listIndex, 0, child);\n }\n if (Array.isArray(parent.value) && parent.value.length < parentContext.children.length) {\n parent.disturb().calm({\n name: listIndex,\n value: child.value,\n from: valueInserted\n });\n }\n } else {\n parentContext.children.push(child);\n }\n if (!child.isSettled)\n parent.disturb();\n }\n if (child.parent !== parent) {\n child.parent = parent;\n if (child.parent !== parent) {\n parent.remove(child);\n child.parent.add(child);\n return parent;\n }\n } else {\n child.use(parent.plugins);\n }\n commit(parent, parentContext, false);\n parent.ledger.merge(child);\n parent.emit(\"child\", child);\n return parent;\n}\nfunction setParent(child, context, _property, parent) {\n if (isNode(parent)) {\n if (child.parent && child.parent !== parent) {\n child.parent.remove(child);\n }\n context.parent = parent;\n child.resetConfig();\n !parent.children.includes(child) ? parent.add(child) : child.use(parent.plugins);\n return true;\n }\n if (parent === null) {\n context.parent = null;\n return true;\n }\n return false;\n}\nfunction removeChild(node, context, child) {\n const childIndex = context.children.indexOf(child);\n if (childIndex !== -1) {\n if (child.isSettled)\n node.disturb();\n context.children.splice(childIndex, 1);\n let preserve = undefine(child.props.preserve);\n let parent = child.parent;\n while (preserve === void 0 && parent) {\n preserve = undefine(parent.props.preserve);\n parent = parent.parent;\n }\n if (!preserve) {\n node.calm({\n name: node.type === \"list\" ? childIndex : child.name,\n value: valueRemoved\n });\n } else {\n node.calm();\n }\n child.parent = null;\n child.config._rmn = child;\n }\n node.ledger.unmerge(child);\n node.emit(\"childRemoved\", child);\n return node;\n}\nfunction eachChild(_node, context, callback) {\n context.children.forEach((child) => !(\"__FKP\" in child) && callback(child));\n}\nfunction walkTree(_node, context, callback, stopIfFalse = false, skipSubtreeOnFalse = false) {\n context.children.some((child) => {\n if (\"__FKP\" in child)\n return false;\n const val = callback(child);\n if (stopIfFalse && val === false)\n return true;\n if (skipSubtreeOnFalse && val === false)\n return false;\n return child.walk(callback, stopIfFalse, skipSubtreeOnFalse);\n });\n}\nfunction resetConfig(node, context) {\n const parent = node.parent || void 0;\n context.config = createConfig2(node.config._t, parent);\n node.walk((n) => n.resetConfig());\n}\nfunction use(node, context, plugin, run = true, library = true) {\n if (Array.isArray(plugin) || plugin instanceof Set) {\n plugin.forEach((p) => use(node, context, p));\n return node;\n }\n if (!context.plugins.has(plugin)) {\n if (library && typeof plugin.library === \"function\")\n plugin.library(node);\n if (run && plugin(node) !== false) {\n context.plugins.add(plugin);\n node.children.forEach((child) => child.use(plugin));\n }\n }\n return node;\n}\nfunction setIndex(node, _context, _property, setIndex2) {\n if (isNode(node.parent)) {\n const children = node.parent.children;\n const index = setIndex2 >= children.length ? children.length - 1 : setIndex2 < 0 ? 0 : setIndex2;\n const oldIndex = children.indexOf(node);\n if (oldIndex === -1)\n return false;\n children.splice(oldIndex, 1);\n children.splice(index, 0, node);\n node.parent.children = children;\n if (node.parent.type === \"list\")\n node.parent.disturb().calm({ name: index, value: valueMoved, from: oldIndex });\n return true;\n }\n return false;\n}\nfunction getIndex(node) {\n if (node.parent) {\n const index = [...node.parent.children].indexOf(node);\n return index === -1 ? node.parent.children.length : index;\n }\n return -1;\n}\nfunction getContext(_node, context) {\n return context;\n}\nfunction getName(node, context) {\n if (node.parent?.type === \"list\")\n return node.index;\n return context.name !== useIndex ? context.name : node.index;\n}\nfunction getAddress(node, context) {\n return context.parent ? context.parent.address.concat([node.name]) : [node.name];\n}\nfunction getNode2(node, _context, locator) {\n const address = typeof locator === \"string\" ? locator.split(node.config.delimiter) : locator;\n if (!address.length)\n return void 0;\n const first = address[0];\n let pointer = node.parent;\n if (!pointer) {\n if (String(address[0]) === String(node.name))\n address.shift();\n pointer = node;\n }\n if (first === \"$parent\")\n address.shift();\n while (pointer && address.length) {\n const name = address.shift();\n switch (name) {\n case \"$root\":\n pointer = node.root;\n break;\n case \"$parent\":\n pointer = pointer.parent;\n break;\n case \"$self\":\n pointer = node;\n break;\n default:\n pointer = pointer.children.find(\n (c) => !(\"__FKP\" in c) && String(c.name) === String(name)\n ) || select(pointer, name);\n }\n }\n return pointer || void 0;\n}\nfunction select(node, selector) {\n const matches = String(selector).match(/^(find)\\((.*)\\)$/);\n if (matches) {\n const [, action, argStr] = matches;\n const args = argStr.split(\",\").map((arg) => arg.trim());\n switch (action) {\n case \"find\":\n return node.find(args[0], args[1]);\n default:\n return void 0;\n }\n }\n return void 0;\n}\nfunction find(node, _context, searchTerm, searcher) {\n return bfs(node, searchTerm, searcher);\n}\nfunction bfs(tree, searchValue, searchGoal = \"name\") {\n const search = typeof searchGoal === \"string\" ? (n) => n[searchGoal] == searchValue : searchGoal;\n const stack = [tree];\n while (stack.length) {\n const node = stack.shift();\n if (\"__FKP\" in node)\n continue;\n if (search(node, searchValue))\n return node;\n stack.push(...node.children);\n }\n return void 0;\n}\nfunction getRoot(n) {\n let node = n;\n while (node.parent) {\n node = node.parent;\n }\n return node;\n}\nfunction createConfig2(target = {}, parent) {\n let node = void 0;\n return new Proxy(target, {\n get(...args) {\n const prop = args[1];\n if (prop === \"_t\")\n return target;\n const localValue = Reflect.get(...args);\n if (localValue !== void 0)\n return localValue;\n if (parent) {\n const parentVal = parent.config[prop];\n if (parentVal !== void 0)\n return parentVal;\n }\n if (target.rootConfig && typeof prop === \"string\") {\n const rootValue = target.rootConfig[prop];\n if (rootValue !== void 0)\n return rootValue;\n }\n if (prop === \"delay\" && node?.type === \"input\")\n return 20;\n return defaultConfig[prop];\n },\n set(...args) {\n const prop = args[1];\n const value = args[2];\n if (prop === \"_n\") {\n node = value;\n if (target.rootConfig)\n target.rootConfig._add(node);\n return true;\n }\n if (prop === \"_rmn\") {\n if (target.rootConfig)\n target.rootConfig._rm(node);\n node = void 0;\n return true;\n }\n if (!eq(target[prop], value, false)) {\n const didSet = Reflect.set(...args);\n if (node) {\n node.emit(`config:${prop}`, value, false);\n configChange(node, prop, value);\n node.walk((n) => configChange(n, prop, value), false, true);\n }\n return didSet;\n }\n return true;\n }\n });\n}\nfunction text(node, _context, key, type = \"ui\") {\n const fragment = typeof key === \"string\" ? { key, value: key, type } : key;\n const value = node.hook.text.dispatch(fragment);\n node.emit(\"text\", value, false);\n return value.value;\n}\nfunction submit(node) {\n const name = node.name;\n do {\n if (node.props.isForm === true)\n break;\n if (!node.parent)\n error(106, name);\n node = node.parent;\n } while (node);\n if (node.props.id) {\n submitForm(node.props.id, node.props.__root);\n }\n}\nfunction resetValue(node, _context, value) {\n return reset(node, value);\n}\nfunction setErrors(node, _context, localErrors, childErrors) {\n const sourceKey = `${node.name}-set`;\n const errors = node.hook.setErrors.dispatch({ localErrors, childErrors });\n createMessages(node, errors.localErrors, errors.childErrors).forEach(\n (errors2) => {\n node.store.apply(errors2, (message) => message.meta.source === sourceKey);\n }\n );\n return node;\n}\nfunction clearErrors(node, _context, clearChildErrors = true, sourceKey) {\n node.store.filter((m) => {\n return !(sourceKey === void 0 || m.meta.source === sourceKey);\n }, \"error\");\n if (clearChildErrors) {\n sourceKey = sourceKey || `${node.name}-set`;\n node.walk((child) => {\n child.store.filter((message) => {\n return !(message.type === \"error\" && message.meta && message.meta.source === sourceKey);\n });\n });\n }\n return node;\n}\nfunction createProps(initial) {\n const props = {\n initial: typeof initial === \"object\" ? cloneAny(initial) : initial\n };\n let node;\n let isEmitting = true;\n let propDefs = {};\n return new Proxy(props, {\n get(...args) {\n const [_t, prop] = args;\n let val;\n if (has(props, prop)) {\n val = Reflect.get(...args);\n if (propDefs[prop]?.boolean)\n val = boolGetter(val);\n } else if (node && typeof prop === \"string\" && node.config[prop] !== void 0) {\n val = node.config[prop];\n if (prop === \"mergeStrategy\" && node?.type === \"input\" && isRecord(val) && node.name in val) {\n val = val[node.name];\n }\n } else {\n val = propDefs[prop]?.default;\n }\n const getter = propDefs[prop]?.getter;\n if (propDefs[prop]?.boolean)\n val = !!val;\n return getter ? getter(val, node) : val;\n },\n set(target, property, originalValue, receiver) {\n if (property === \"_n\") {\n node = originalValue;\n return true;\n }\n if (property === \"_emit\") {\n isEmitting = originalValue;\n return true;\n }\n let { prop, value } = node.hook.prop.dispatch({\n prop: property,\n value: originalValue\n });\n const setter = propDefs[prop]?.setter;\n value = setter ? setter(value, node) : value;\n if (!eq(props[prop], value, false) || typeof value === \"object\") {\n const didSet = Reflect.set(target, prop, value, receiver);\n if (prop === \"__propDefs\")\n propDefs = toPropsObj(value);\n if (isEmitting) {\n node.emit(\"prop\", { prop, value });\n if (typeof prop === \"string\")\n node.emit(`prop:${prop}`, value);\n }\n return didSet;\n }\n return true;\n }\n });\n}\nfunction extend(node, context, property, trap2) {\n context.traps.set(property, trap2);\n return node;\n}\nfunction findDefinition(node, plugins) {\n if (node.props.definition)\n return node.define(node.props.definition);\n for (const plugin of plugins) {\n if (node.props.definition)\n return;\n if (typeof plugin.library === \"function\") {\n plugin.library(node);\n }\n }\n}\nfunction createContext(options) {\n const value = createValue(options);\n const config = createConfig2(options.config || {}, options.parent);\n return {\n _d: 0,\n _e: createEmitter(),\n uid: Symbol(),\n _resolve: false,\n _tmo: false,\n _value: value,\n children: dedupe(options.children || []),\n config,\n hook: createHooks(),\n isCreated: false,\n isSettled: true,\n ledger: createLedger(),\n name: createName(options),\n parent: options.parent || null,\n plugins: /* @__PURE__ */ new Set(),\n props: createProps(value),\n settled: Promise.resolve(value),\n store: createStore(true),\n sync: options.sync || false,\n traps: createTraps(),\n type: options.type || \"input\",\n value\n };\n}\nfunction nodeInit(node, options) {\n const hasInitialId = options.props?.id;\n if (!hasInitialId)\n delete options.props?.id;\n node.ledger.init(node.store._n = node.props._n = node.config._n = node);\n node.props._emit = false;\n Object.assign(\n node.props,\n hasInitialId ? {} : { id: `input_${idCount++}` },\n options.props ?? {}\n );\n node.props._emit = true;\n findDefinition(\n node,\n /* @__PURE__ */ new Set([\n ...options.plugins || [],\n ...node.parent ? node.parent.plugins : []\n ])\n );\n if (options.plugins) {\n for (const plugin of options.plugins) {\n use(node, node._c, plugin, true, false);\n }\n }\n node.each((child) => node.add(child));\n if (node.parent)\n node.parent.add(node, options.index);\n if (node.type === \"input\" && node.children.length)\n error(100, node);\n input(node, node._c, node._value, false);\n node.store.release();\n if (hasInitialId)\n register(node);\n node.emit(\"created\", node);\n node.isCreated = true;\n return node;\n}\nfunction createPlaceholder(options) {\n return {\n __FKP: true,\n uid: Symbol(),\n name: options?.name ?? `p_${nameCount++}`,\n value: options?.value ?? null,\n _value: options?.value ?? null,\n type: options?.type ?? \"input\",\n props: {},\n use: () => {\n },\n input(value) {\n this._value = value;\n this.value = value;\n return Promise.resolve();\n },\n isSettled: true\n };\n}\nfunction isPlaceholder(node) {\n return \"__FKP\" in node;\n}\nfunction createNode(options) {\n const ops = options || {};\n const context = createContext(ops);\n const node = new Proxy(context, {\n get(...args) {\n const [, property] = args;\n if (property === \"__FKNode__\")\n return true;\n const trap2 = context.traps.get(property);\n if (trap2 && trap2.get)\n return trap2.get(node, context);\n return Reflect.get(...args);\n },\n set(...args) {\n const [, property, value] = args;\n const trap2 = context.traps.get(property);\n if (trap2 && trap2.set)\n return trap2.set(node, context, property, value);\n return Reflect.set(...args);\n }\n });\n return nodeInit(node, ops);\n}\nfunction isDOM(node) {\n return typeof node !== \"string\" && has(node, \"$el\");\n}\nfunction isComponent(node) {\n return typeof node !== \"string\" && has(node, \"$cmp\");\n}\nfunction isConditional(node) {\n if (!node || typeof node === \"string\")\n return false;\n return has(node, \"if\") && has(node, \"then\");\n}\nfunction isSugar(node) {\n return typeof node !== \"string\" && \"$formkit\" in node;\n}\nfunction sugar(node) {\n if (typeof node === \"string\") {\n return {\n $el: \"text\",\n children: node\n };\n }\n if (isSugar(node)) {\n const {\n $formkit: type,\n for: iterator,\n if: condition,\n children,\n bind,\n ...props\n } = node;\n return Object.assign(\n {\n $cmp: \"FormKit\",\n props: { ...props, type }\n },\n condition ? { if: condition } : {},\n iterator ? { for: iterator } : {},\n children ? { children } : {},\n bind ? { bind } : {}\n );\n }\n return node;\n}\nfunction compile(expr) {\n let provideTokens;\n const requirements = /* @__PURE__ */ new Set();\n const x = function expand(operand, tokens) {\n return typeof operand === \"function\" ? operand(tokens) : operand;\n };\n const operatorRegistry = [\n {\n \"&&\": (l, r, t) => x(l, t) && x(r, t),\n \"||\": (l, r, t) => x(l, t) || x(r, t)\n },\n {\n \"===\": (l, r, t) => !!(x(l, t) === x(r, t)),\n \"!==\": (l, r, t) => !!(x(l, t) !== x(r, t)),\n \"==\": (l, r, t) => !!(x(l, t) == x(r, t)),\n \"!=\": (l, r, t) => !!(x(l, t) != x(r, t)),\n \">=\": (l, r, t) => !!(x(l, t) >= x(r, t)),\n \"<=\": (l, r, t) => !!(x(l, t) <= x(r, t)),\n \">\": (l, r, t) => !!(x(l, t) > x(r, t)),\n \"<\": (l, r, t) => !!(x(l, t) < x(r, t))\n },\n {\n \"+\": (l, r, t) => x(l, t) + x(r, t),\n \"-\": (l, r, t) => x(l, t) - x(r, t)\n },\n {\n \"*\": (l, r, t) => x(l, t) * x(r, t),\n \"/\": (l, r, t) => x(l, t) / x(r, t),\n \"%\": (l, r, t) => x(l, t) % x(r, t)\n }\n ];\n const operatorSymbols = operatorRegistry.reduce((s, g) => {\n return s.concat(Object.keys(g));\n }, []);\n const operatorChars = new Set(operatorSymbols.map((key) => key.charAt(0)));\n function getOp(symbols, char, p, expression) {\n const candidates = symbols.filter((s) => s.startsWith(char));\n if (!candidates.length)\n return false;\n return candidates.find((symbol) => {\n if (expression.length >= p + symbol.length) {\n const nextChars = expression.substring(p, p + symbol.length);\n if (nextChars === symbol)\n return symbol;\n }\n return false;\n });\n }\n function getStep(p, expression, direction = 1) {\n let next = direction ? expression.substring(p + 1).trim() : expression.substring(0, p).trim();\n if (!next.length)\n return -1;\n if (!direction) {\n const reversed = next.split(\"\").reverse();\n const start = reversed.findIndex((char2) => operatorChars.has(char2));\n next = reversed.slice(start).join(\"\");\n }\n const char = next[0];\n return operatorRegistry.findIndex((operators) => {\n const symbols = Object.keys(operators);\n return !!getOp(symbols, char, 0, next);\n });\n }\n function getTail(pos, expression) {\n let tail = \"\";\n const length = expression.length;\n let depth = 0;\n for (let p = pos; p < length; p++) {\n const char = expression.charAt(p);\n if (char === \"(\") {\n depth++;\n } else if (char === \")\") {\n depth--;\n } else if (depth === 0 && char === \" \") {\n continue;\n }\n if (depth === 0 && getOp(operatorSymbols, char, p, expression)) {\n return [tail, p - 1];\n } else {\n tail += char;\n }\n }\n return [tail, expression.length - 1];\n }\n function parseLogicals(expression, step = 0) {\n const operators = operatorRegistry[step];\n const length = expression.length;\n const symbols = Object.keys(operators);\n let depth = 0;\n let quote = false;\n let op = null;\n let operand = \"\";\n let left = null;\n let operation;\n let lastChar = \"\";\n let char = \"\";\n let parenthetical = \"\";\n let parenQuote = \"\";\n let startP = 0;\n const addTo = (depth2, char2) => {\n depth2 ? parenthetical += char2 : operand += char2;\n };\n for (let p = 0; p < length; p++) {\n lastChar = char;\n char = expression.charAt(p);\n if ((char === \"'\" || char === '\"') && lastChar !== \"\\\\\" && (depth === 0 && !quote || depth && !parenQuote)) {\n if (depth) {\n parenQuote = char;\n } else {\n quote = char;\n }\n addTo(depth, char);\n continue;\n } else if (quote && (char !== quote || lastChar === \"\\\\\") || parenQuote && (char !== parenQuote || lastChar === \"\\\\\")) {\n addTo(depth, char);\n continue;\n } else if (quote === char) {\n quote = false;\n addTo(depth, char);\n continue;\n } else if (parenQuote === char) {\n parenQuote = false;\n addTo(depth, char);\n continue;\n } else if (char === \" \") {\n continue;\n } else if (char === \"(\") {\n if (depth === 0) {\n startP = p;\n } else {\n parenthetical += char;\n }\n depth++;\n } else if (char === \")\") {\n depth--;\n if (depth === 0) {\n const fn = typeof operand === \"string\" && operand.startsWith(\"$\") ? operand : void 0;\n const hasTail = fn && expression.charAt(p + 1) === \".\";\n let tail = \"\";\n if (hasTail) {\n [tail, p] = getTail(p + 2, expression);\n }\n const lStep = op ? step : getStep(startP, expression, 0);\n const rStep = getStep(p, expression);\n if (lStep === -1 && rStep === -1) {\n operand = evaluate(parenthetical, -1, fn, tail);\n if (typeof operand === \"string\")\n operand = parenthetical;\n } else if (op && (lStep >= rStep || rStep === -1) && step === lStep) {\n left = op.bind(null, evaluate(parenthetical, -1, fn, tail));\n op = null;\n operand = \"\";\n } else if (rStep > lStep && step === rStep) {\n operand = evaluate(parenthetical, -1, fn, tail);\n } else {\n operand += `(${parenthetical})${hasTail ? `.${tail}` : \"\"}`;\n }\n parenthetical = \"\";\n } else {\n parenthetical += char;\n }\n } else if (depth === 0 && (operation = getOp(symbols, char, p, expression))) {\n if (p === 0) {\n error(103, [operation, expression]);\n }\n p += operation.length - 1;\n if (p === expression.length - 1) {\n error(104, [operation, expression]);\n }\n if (!op) {\n if (left) {\n op = operators[operation].bind(null, evaluate(left, step));\n left = null;\n } else {\n op = operators[operation].bind(null, evaluate(operand, step));\n operand = \"\";\n }\n } else if (operand) {\n left = op.bind(null, evaluate(operand, step));\n op = operators[operation].bind(null, left);\n operand = \"\";\n }\n continue;\n } else {\n addTo(depth, char);\n }\n }\n if (operand && op) {\n op = op.bind(null, evaluate(operand, step));\n }\n op = !op && left ? left : op;\n if (!op && operand) {\n op = (v, t) => {\n return typeof v === \"function\" ? v(t) : v;\n };\n op = op.bind(null, evaluate(operand, step));\n }\n if (!op && !operand) {\n error(105, expression);\n }\n return op;\n }\n function evaluate(operand, step, fnToken, tail) {\n if (fnToken) {\n const fn = evaluate(fnToken, operatorRegistry.length);\n let userFuncReturn;\n let tailCall = tail ? compile(`$${tail}`) : false;\n if (typeof fn === \"function\") {\n const args = parseArgs(String(operand)).map(\n (arg) => evaluate(arg, -1)\n );\n return (tokens) => {\n const userFunc = fn(tokens);\n if (typeof userFunc !== \"function\") {\n warn(150, fnToken);\n return userFunc;\n }\n userFuncReturn = userFunc(\n ...args.map(\n (arg) => typeof arg === \"function\" ? arg(tokens) : arg\n )\n );\n if (tailCall) {\n tailCall = tailCall.provide((subTokens) => {\n const rootTokens = provideTokens(subTokens);\n const t = subTokens.reduce(\n (tokenSet, token3) => {\n const isTail = token3 === tail || tail?.startsWith(`${token3}(`);\n if (isTail) {\n const value = getAt(userFuncReturn, token3);\n tokenSet[token3] = () => value;\n } else {\n tokenSet[token3] = rootTokens[token3];\n }\n return tokenSet;\n },\n {}\n );\n return t;\n });\n }\n return tailCall ? tailCall() : userFuncReturn;\n };\n }\n } else if (typeof operand === \"string\") {\n if (operand === \"true\")\n return true;\n if (operand === \"false\")\n return false;\n if (operand === \"undefined\")\n return void 0;\n if (isQuotedString(operand))\n return rmEscapes(operand.substring(1, operand.length - 1));\n if (!isNaN(+operand))\n return Number(operand);\n if (step < operatorRegistry.length - 1) {\n return parseLogicals(operand, step + 1);\n } else {\n if (operand.startsWith(\"$\")) {\n const cleaned = operand.substring(1);\n requirements.add(cleaned);\n return function getToken(tokens) {\n return cleaned in tokens ? tokens[cleaned]() : void 0;\n };\n }\n return operand;\n }\n }\n return operand;\n }\n const compiled = parseLogicals(\n expr.startsWith(\"$:\") ? expr.substring(2) : expr\n );\n const reqs = Array.from(requirements);\n function provide(callback) {\n provideTokens = callback;\n return Object.assign(\n // @ts-ignore - @rollup/plugin-typescript doesn't like this\n compiled.bind(null, callback(reqs)),\n { provide }\n );\n }\n return Object.assign(compiled, {\n provide\n });\n}\n\n// packages/core/src/classes.ts\nfunction createClasses(propertyKey, node, sectionClassList) {\n if (!sectionClassList)\n return {};\n if (typeof sectionClassList === \"string\") {\n const classKeys = sectionClassList.split(\" \");\n return classKeys.reduce(\n (obj, key) => Object.assign(obj, { [key]: true }),\n {}\n );\n } else if (typeof sectionClassList === \"function\") {\n return createClasses(\n propertyKey,\n node,\n sectionClassList(node, propertyKey)\n );\n }\n return sectionClassList;\n}\nfunction generateClassList(node, property, ...args) {\n const combinedClassList = args.reduce((finalClassList, currentClassList) => {\n if (!currentClassList)\n return handleNegativeClasses(finalClassList);\n const { $reset, ...classList } = currentClassList;\n if ($reset) {\n return handleNegativeClasses(classList);\n }\n return handleNegativeClasses(Object.assign(finalClassList, classList));\n }, {});\n return Object.keys(\n node.hook.classes.dispatch({ property, classes: combinedClassList }).classes\n ).filter((key) => combinedClassList[key]).join(\" \") || null;\n}\nfunction handleNegativeClasses(classList) {\n const removalToken = \"$remove:\";\n let hasNegativeClassValue = false;\n const applicableClasses = Object.keys(classList).filter((className) => {\n if (classList[className] && className.startsWith(removalToken)) {\n hasNegativeClassValue = true;\n }\n return classList[className];\n });\n if (applicableClasses.length > 1 && hasNegativeClassValue) {\n const negativeClasses = applicableClasses.filter((className) => className.startsWith(removalToken));\n negativeClasses.map((negativeClass) => {\n const targetClass = negativeClass.substring(removalToken.length);\n classList[targetClass] = false;\n classList[negativeClass] = false;\n });\n }\n return classList;\n}\n\n// packages/core/src/setErrors.ts\nfunction setErrors2(id, localErrors, childErrors) {\n const node = getNode(id);\n if (node) {\n node.setErrors(localErrors, childErrors);\n } else {\n warn(651, id);\n }\n}\nfunction clearErrors2(id, clearChildren = true) {\n const node = getNode(id);\n if (node) {\n node.clearErrors(clearChildren);\n } else {\n warn(652, id);\n }\n}\n\n// packages/core/src/index.ts\nvar FORMKIT_VERSION = \"1.6.7\";\n\nexport { FORMKIT_VERSION, bfs, clearErrors2 as clearErrors, compile, createClasses, createConfig, createMessage, createNode, createPlaceholder, createValue, deregister, error, errorHandler, generateClassList, getNode, isComponent, isConditional, isDOM, isList, isNode, isPlaceholder, isSugar, names, register, reset, resetCount, resetRegistry, setErrors2 as setErrors, stopWatch, submitForm, sugar, use, useIndex, valueInserted, valueMoved, valueRemoved, warn, warningHandler, watchRegistry };\n//# sourceMappingURL=out.js.map\n//# sourceMappingURL=index.mjs.map","import { has } from '@formkit/utils';\nimport { isNode } from '@formkit/core';\n\n// packages/observer/src/index.ts\nvar revokedObservers = /* @__PURE__ */ new WeakSet();\nfunction createObserver(node, dependencies) {\n const deps = dependencies || Object.assign(/* @__PURE__ */ new Map(), { active: false });\n const receipts = /* @__PURE__ */ new Map();\n const addDependency = function(event) {\n if (!deps.active)\n return;\n if (!deps.has(node))\n deps.set(node, /* @__PURE__ */ new Set());\n deps.get(node)?.add(event);\n };\n const observeProps = function(props) {\n return new Proxy(props, {\n get(...args) {\n typeof args[1] === \"string\" && addDependency(`prop:${args[1]}`);\n return Reflect.get(...args);\n }\n });\n };\n const observeLedger = function(ledger) {\n return new Proxy(ledger, {\n get(...args) {\n if (args[1] === \"value\") {\n return (key) => {\n addDependency(`count:${key}`);\n return ledger.value(key);\n };\n }\n return Reflect.get(...args);\n }\n });\n };\n const observe = function(value, property) {\n if (isNode(value)) {\n return createObserver(value, deps);\n }\n if (property === \"value\")\n addDependency(\"commit\");\n if (property === \"_value\")\n addDependency(\"input\");\n if (property === \"props\")\n return observeProps(value);\n if (property === \"ledger\")\n return observeLedger(value);\n if (property === \"children\") {\n addDependency(\"child\");\n addDependency(\"childRemoved\");\n }\n return value;\n };\n const {\n proxy: observed,\n revoke\n } = Proxy.revocable(node, {\n get(...args) {\n switch (args[1]) {\n case \"_node\":\n return node;\n case \"deps\":\n return deps;\n case \"watch\":\n return (block, after, pos) => watch(observed, block, after, pos);\n case \"observe\":\n return () => {\n const old = new Map(deps);\n deps.clear();\n deps.active = true;\n return old;\n };\n case \"stopObserve\":\n return () => {\n const newDeps = new Map(deps);\n deps.active = false;\n return newDeps;\n };\n case \"receipts\":\n return receipts;\n case \"kill\":\n return () => {\n removeListeners(receipts);\n revokedObservers.add(args[2]);\n revoke();\n return void 0;\n };\n }\n const value = Reflect.get(...args);\n if (typeof value === \"function\") {\n return (...subArgs) => {\n const subValue = value(...subArgs);\n return observe(subValue, args[1]);\n };\n }\n return observe(value, args[1]);\n }\n });\n return observed;\n}\nfunction applyListeners(node, [toAdd, toRemove], callback, pos) {\n toAdd.forEach((events, depNode) => {\n events.forEach((event) => {\n node.receipts.has(depNode) || node.receipts.set(depNode, {});\n const events2 = node.receipts.get(depNode) ?? {};\n events2[event] = events2[event] ?? [];\n events2[event].push(depNode.on(event, callback, pos));\n node.receipts.set(depNode, events2);\n });\n });\n toRemove.forEach((events, depNode) => {\n events.forEach((event) => {\n if (node.receipts.has(depNode)) {\n const nodeReceipts = node.receipts.get(depNode);\n if (nodeReceipts && has(nodeReceipts, event)) {\n nodeReceipts[event].map(depNode.off);\n delete nodeReceipts[event];\n node.receipts.set(depNode, nodeReceipts);\n }\n }\n });\n });\n}\nfunction removeListeners(receipts) {\n receipts.forEach((events, node) => {\n for (const event in events) {\n events[event].map(node.off);\n }\n });\n receipts.clear();\n}\nfunction watch(node, block, after, pos) {\n const doAfterObservation = (res2) => {\n const newDeps = node.stopObserve();\n applyListeners(\n node,\n diffDeps(oldDeps, newDeps),\n () => watch(node, block, after, pos),\n pos\n );\n if (after)\n after(res2);\n };\n const oldDeps = new Map(node.deps);\n node.observe();\n const res = block(node);\n if (res instanceof Promise)\n res.then((val) => doAfterObservation(val));\n else\n doAfterObservation(res);\n}\nfunction diffDeps(previous, current) {\n const toAdd = /* @__PURE__ */ new Map();\n const toRemove = /* @__PURE__ */ new Map();\n current.forEach((events, node) => {\n if (!previous.has(node)) {\n toAdd.set(node, events);\n } else {\n const eventsToAdd = /* @__PURE__ */ new Set();\n const previousEvents = previous.get(node);\n events.forEach(\n (event) => !previousEvents?.has(event) && eventsToAdd.add(event)\n );\n toAdd.set(node, eventsToAdd);\n }\n });\n previous.forEach((events, node) => {\n if (!current.has(node)) {\n toRemove.set(node, events);\n } else {\n const eventsToRemove = /* @__PURE__ */ new Set();\n const newEvents = current.get(node);\n events.forEach(\n (event) => !newEvents?.has(event) && eventsToRemove.add(event)\n );\n toRemove.set(node, eventsToRemove);\n }\n });\n return [toAdd, toRemove];\n}\nfunction isKilled(node) {\n return revokedObservers.has(node);\n}\n\nexport { applyListeners, createObserver, diffDeps, isKilled, removeListeners };\n//# sourceMappingURL=out.js.map\n//# sourceMappingURL=index.mjs.map","import { has, regexForFormat, eq, empty } from '@formkit/utils';\n\n// packages/rules/src/accepted.ts\nvar accepted = function accepted2({ value }) {\n return [\"yes\", \"on\", \"1\", 1, true, \"true\"].includes(value);\n};\naccepted.skipEmpty = false;\nvar accepted_default = accepted;\n\n// packages/rules/src/date_after.ts\nvar date_after = function({ value }, compare = false) {\n const timestamp = Date.parse(compare || /* @__PURE__ */ new Date());\n const fieldValue = Date.parse(String(value));\n return isNaN(fieldValue) ? false : fieldValue > timestamp;\n};\nvar date_after_default = date_after;\n\n// packages/rules/src/date_after_or_equal.ts\nvar date_after_or_equal = function({ value }, compare = false) {\n const timestamp = Date.parse(compare || /* @__PURE__ */ new Date());\n const fieldValue = Date.parse(String(value));\n return isNaN(fieldValue) ? false : fieldValue > timestamp || fieldValue === timestamp;\n};\nvar date_after_or_equal_default = date_after_or_equal;\n\n// packages/rules/src/date_after_node.ts\nvar date_after_node = function(node, address) {\n if (!address)\n return false;\n const fieldValue = Date.parse(String(node.value));\n const foreignValue = Date.parse(String(node.at(address)?.value));\n if (isNaN(foreignValue))\n return true;\n return isNaN(fieldValue) ? false : fieldValue > foreignValue;\n};\nvar date_after_node_default = date_after_node;\nvar alpha = function({ value }, set = \"default\") {\n const sets = {\n default: /^\\p{L}+$/u,\n latin: /^[a-z]+$/i\n };\n const selectedSet = has(sets, set) ? set : \"default\";\n return sets[selectedSet].test(String(value));\n};\nvar alpha_default = alpha;\nvar alpha_spaces = function({ value }, set = \"default\") {\n const sets = {\n default: /^[\\p{L} ]+$/u,\n latin: /^[a-z ]+$/i\n };\n const selectedSet = has(sets, set) ? set : \"default\";\n return sets[selectedSet].test(String(value));\n};\nvar alpha_spaces_default = alpha_spaces;\nvar alphanumeric = function({ value }, set = \"default\") {\n const sets = {\n default: /^[0-9\\p{L}]+$/u,\n latin: /^[0-9a-z]+$/i\n };\n const selectedSet = has(sets, set) ? set : \"default\";\n return sets[selectedSet].test(String(value));\n};\nvar alphanumeric_default = alphanumeric;\n\n// packages/rules/src/date_before.ts\nvar date_before = function({ value }, compare = false) {\n const timestamp = Date.parse(compare || /* @__PURE__ */ new Date());\n const fieldValue = Date.parse(String(value));\n return isNaN(fieldValue) ? false : fieldValue < timestamp;\n};\nvar date_before_default = date_before;\n\n// packages/rules/src/date_before_node.ts\nvar date_before_node = function(node, address) {\n if (!address)\n return false;\n const fieldValue = Date.parse(String(node.value));\n const foreignValue = Date.parse(String(node.at(address)?.value));\n if (isNaN(foreignValue))\n return true;\n return isNaN(fieldValue) ? false : fieldValue < foreignValue;\n};\nvar date_before_node_default = date_before_node;\n\n// packages/rules/src/date_before_or_equal.ts\nvar date_before_or_equal = function({ value }, compare = false) {\n const timestamp = Date.parse(compare || /* @__PURE__ */ new Date());\n const fieldValue = Date.parse(String(value));\n return isNaN(fieldValue) ? false : fieldValue < timestamp || fieldValue === timestamp;\n};\nvar date_before_or_equal_default = date_before_or_equal;\n\n// packages/rules/src/between.ts\nvar between = function between2({ value }, from, to) {\n if (!isNaN(value) && !isNaN(from) && !isNaN(to)) {\n const val = 1 * value;\n from = Number(from);\n to = Number(to);\n const [a, b] = from <= to ? [from, to] : [to, from];\n return val >= 1 * a && val <= 1 * b;\n }\n return false;\n};\nvar between_default = between;\n\n// packages/rules/src/confirm.ts\nvar hasConfirm = /(_confirm(?:ed)?)$/;\nvar confirm = function confirm2(node, address, comparison = \"loose\") {\n if (!address) {\n address = hasConfirm.test(node.name) ? node.name.replace(hasConfirm, \"\") : `${node.name}_confirm`;\n }\n const foreignValue = node.at(address)?.value;\n return comparison === \"strict\" ? node.value === foreignValue : node.value == foreignValue;\n};\nvar confirm_default = confirm;\nvar contains_alpha = function({ value }, set = \"default\") {\n const sets = {\n default: /\\p{L}/u,\n latin: /[a-z]/i\n };\n const selectedSet = has(sets, set) ? set : \"default\";\n return sets[selectedSet].test(String(value));\n};\nvar contains_alpha_default = contains_alpha;\nvar contains_alpha_spaces = function({ value }, set = \"default\") {\n const sets = {\n default: /[\\p{L} ]/u,\n latin: /[a-z ]/i\n };\n const selectedSet = has(sets, set) ? set : \"default\";\n return sets[selectedSet].test(String(value));\n};\nvar contains_alpha_spaces_default = contains_alpha_spaces;\nvar contains_alphanumeric = function({ value }, set = \"default\") {\n const sets = {\n default: /[0-9\\p{L}]/u,\n latin: /[0-9a-z]/i\n };\n const selectedSet = has(sets, set) ? set : \"default\";\n return sets[selectedSet].test(String(value));\n};\nvar contains_alphanumeric_default = contains_alphanumeric;\nvar contains_lowercase = function({ value }, set = \"default\") {\n const sets = {\n default: /\\p{Ll}/u,\n latin: /[a-z]/\n };\n const selectedSet = has(sets, set) ? set : \"default\";\n return sets[selectedSet].test(String(value));\n};\nvar contains_lowercase_default = contains_lowercase;\n\n// packages/rules/src/contains_numeric.ts\nvar contains_numeric = function number({ value }) {\n return /[0-9]/.test(String(value));\n};\nvar contains_numeric_default = contains_numeric;\n\n// packages/rules/src/contains_symbol.ts\nvar contains_symbol = function({ value }) {\n return /[!-/:-@[-`{-~]/.test(String(value));\n};\nvar contains_symbol_default = contains_symbol;\nvar contains_uppercase = function({ value }, set = \"default\") {\n const sets = {\n default: /\\p{Lu}/u,\n latin: /[A-Z]/\n };\n const selectedSet = has(sets, set) ? set : \"default\";\n return sets[selectedSet].test(String(value));\n};\nvar contains_uppercase_default = contains_uppercase;\n\n// packages/rules/src/date_between.ts\nvar date_between = function date_between2({ value }, dateA, dateB) {\n dateA = dateA instanceof Date ? dateA.getTime() : Date.parse(dateA);\n dateB = dateB instanceof Date ? dateB.getTime() : Date.parse(dateB);\n const compareTo = value instanceof Date ? value.getTime() : Date.parse(String(value));\n if (dateA && !dateB) {\n dateB = dateA;\n dateA = Date.now();\n } else if (!dateA || !compareTo) {\n return false;\n }\n return compareTo >= dateA && compareTo <= dateB;\n};\nvar date_between_default = date_between;\nvar date_format = function date({ value }, format) {\n if (format && typeof format === \"string\") {\n return regexForFormat(format).test(String(value));\n }\n return !isNaN(Date.parse(String(value)));\n};\nvar date_format_default = date_format;\n\n// packages/rules/src/email.ts\nvar email = function email2({ value }) {\n const isEmail = /^(([^<>()\\[\\]\\.,;:\\s@\\\"]+(\\.[^<>()\\[\\]\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@(([^<>()[\\]\\.,;:\\s@\\\"]+\\.)+[^<>()[\\]\\.,;:\\s@\\\"]{2,})$/i;\n return isEmail.test(String(value));\n};\nvar email_default = email;\n\n// packages/rules/src/ends_with.ts\nvar ends_with = function ends_with2({ value }, ...stack) {\n if (typeof value === \"string\" && stack.length) {\n return stack.some((item) => {\n return value.endsWith(item);\n });\n } else if (typeof value === \"string\" && stack.length === 0) {\n return true;\n }\n return false;\n};\nvar ends_with_default = ends_with;\nvar is = function is2({ value }, ...stack) {\n return stack.some((item) => {\n if (typeof item === \"object\") {\n return eq(item, value);\n }\n return item == value;\n });\n};\nvar is_default = is;\n\n// packages/rules/src/length.ts\nvar length = function length2({ value }, first = 0, second = Infinity) {\n first = parseInt(first);\n second = isNaN(parseInt(second)) ? Infinity : parseInt(second);\n const min3 = first <= second ? first : second;\n const max3 = second >= first ? second : first;\n if (typeof value === \"string\" || Array.isArray(value)) {\n return value.length >= min3 && value.length <= max3;\n } else if (value && typeof value === \"object\") {\n const length3 = Object.keys(value).length;\n return length3 >= min3 && length3 <= max3;\n }\n return false;\n};\nvar length_default = length;\nvar lowercase = function({ value }, set = \"default\") {\n const sets = {\n default: /^\\p{Ll}+$/u,\n allow_non_alpha: /^[0-9\\p{Ll}!-/:-@[-`{-~]+$/u,\n allow_numeric: /^[0-9\\p{Ll}]+$/u,\n allow_numeric_dashes: /^[0-9\\p{Ll}-]+$/u,\n latin: /^[a-z]+$/\n };\n const selectedSet = has(sets, set) ? set : \"default\";\n return sets[selectedSet].test(String(value));\n};\nvar lowercase_default = lowercase;\n\n// packages/rules/src/matches.ts\nvar matches = function matches2({ value }, ...stack) {\n return stack.some((pattern) => {\n if (typeof pattern === \"string\" && pattern.substr(0, 1) === \"/\" && pattern.substr(-1) === \"/\") {\n pattern = new RegExp(pattern.substr(1, pattern.length - 2));\n }\n if (pattern instanceof RegExp) {\n return pattern.test(String(value));\n }\n return pattern === value;\n });\n};\nvar matches_default = matches;\n\n// packages/rules/src/max.ts\nvar max = function max2({ value }, maximum = 10) {\n if (Array.isArray(value)) {\n return value.length <= maximum;\n }\n return Number(value) <= Number(maximum);\n};\nvar max_default = max;\n\n// packages/rules/src/min.ts\nvar min = function min2({ value }, minimum = 1) {\n if (Array.isArray(value)) {\n return value.length >= minimum;\n }\n return Number(value) >= Number(minimum);\n};\nvar min_default = min;\nvar not = function not2({ value }, ...stack) {\n return !stack.some((item) => {\n if (typeof item === \"object\") {\n return eq(item, value);\n }\n return item === value;\n });\n};\nvar not_default = not;\n\n// packages/rules/src/number.ts\nvar number2 = function number3({ value }) {\n return !isNaN(value);\n};\nvar number_default = number2;\nvar require_one = function(node, ...inputNames) {\n if (!empty(node.value))\n return true;\n const values = inputNames.map((name) => node.at(name)?.value);\n return values.some((value) => !empty(value));\n};\nrequire_one.skipEmpty = false;\nvar require_one_default = require_one;\nvar required = function required2({ value }, action = \"default\") {\n return action === \"trim\" && typeof value === \"string\" ? !empty(value.trim()) : !empty(value);\n};\nrequired.skipEmpty = false;\nvar required_default = required;\n\n// packages/rules/src/starts_with.ts\nvar starts_with = function starts_with2({ value }, ...stack) {\n if (typeof value === \"string\" && stack.length) {\n return stack.some((item) => {\n return value.startsWith(item);\n });\n } else if (typeof value === \"string\" && stack.length === 0) {\n return true;\n }\n return false;\n};\nvar starts_with_default = starts_with;\n\n// packages/rules/src/symbol.ts\nvar symbol = function({ value }) {\n return /^[!-/:-@[-`{-~]+$/.test(String(value));\n};\nvar symbol_default = symbol;\nvar uppercase = function({ value }, set = \"default\") {\n const sets = {\n default: /^\\p{Lu}+$/u,\n latin: /^[A-Z]+$/\n };\n const selectedSet = has(sets, set) ? set : \"default\";\n return sets[selectedSet].test(String(value));\n};\nvar uppercase_default = uppercase;\n\n// packages/rules/src/url.ts\nvar url = function url2({ value }, ...stack) {\n try {\n const protocols = stack.length ? stack : [\"http:\", \"https:\"];\n const url3 = new URL(String(value));\n return protocols.includes(url3.protocol);\n } catch {\n return false;\n }\n};\nvar url_default = url;\n\nexport { accepted_default as accepted, alpha_default as alpha, alpha_spaces_default as alpha_spaces, alphanumeric_default as alphanumeric, between_default as between, confirm_default as confirm, contains_alpha_default as contains_alpha, contains_alpha_spaces_default as contains_alpha_spaces, contains_alphanumeric_default as contains_alphanumeric, contains_lowercase_default as contains_lowercase, contains_numeric_default as contains_numeric, contains_symbol_default as contains_symbol, contains_uppercase_default as contains_uppercase, date_after_default as date_after, date_after_node_default as date_after_node, date_after_or_equal_default as date_after_or_equal, date_before_default as date_before, date_before_node_default as date_before_node, date_before_or_equal_default as date_before_or_equal, date_between_default as date_between, date_format_default as date_format, email_default as email, ends_with_default as ends_with, is_default as is, length_default as length, lowercase_default as lowercase, matches_default as matches, max_default as max, min_default as min, not_default as not, number_default as number, require_one_default as require_one, required_default as required, starts_with_default as starts_with, symbol_default as symbol, uppercase_default as uppercase, url_default as url };\n//# sourceMappingURL=out.js.map\n//# sourceMappingURL=index.mjs.map","import { createMessage } from '@formkit/core';\nimport { removeListeners, isKilled, createObserver, diffDeps, applyListeners } from '@formkit/observer';\nimport { cloneAny, token, eq, empty, has, clone } from '@formkit/utils';\n\n// packages/validation/src/validation.ts\nvar validatingMessage = /* @__PURE__ */ createMessage({\n type: \"state\",\n blocking: true,\n visible: false,\n value: true,\n key: \"validating\"\n});\nfunction createValidationPlugin(baseRules = {}) {\n return function validationPlugin(node) {\n let propRules = cloneAny(node.props.validationRules || {});\n let availableRules = { ...baseRules, ...propRules };\n const state = { input: token(), rerun: null, isPassing: true };\n let validation = cloneAny(node.props.validation);\n node.on(\"prop:validation\", ({ payload }) => reboot(payload, propRules));\n node.on(\n \"prop:validationRules\",\n ({ payload }) => reboot(validation, payload)\n );\n function reboot(newValidation, newRules) {\n if (eq(Object.keys(propRules || {}), Object.keys(newRules || {})) && eq(validation, newValidation))\n return;\n propRules = cloneAny(newRules);\n validation = cloneAny(newValidation);\n availableRules = { ...baseRules, ...propRules };\n node.props.parsedRules?.forEach((validation2) => {\n removeMessage(validation2);\n removeListeners(validation2.observer.receipts);\n validation2.observer.kill();\n });\n node.store.filter(() => false, \"validation\");\n node.props.parsedRules = parseRules(newValidation, availableRules, node);\n state.isPassing = true;\n validate(node, node.props.parsedRules, state);\n }\n node.props.parsedRules = parseRules(validation, availableRules, node);\n validate(node, node.props.parsedRules, state);\n };\n}\nfunction validate(node, validations, state) {\n if (isKilled(node))\n return;\n state.input = token();\n node.store.set(\n /* @__PURE__ */ createMessage({\n key: \"failing\",\n value: !state.isPassing,\n visible: false\n })\n );\n state.isPassing = true;\n node.store.filter((message) => !message.meta.removeImmediately, \"validation\");\n validations.forEach(\n (validation) => validation.debounce && clearTimeout(validation.timer)\n );\n if (validations.length) {\n node.store.set(validatingMessage);\n run(0, validations, state, false, () => {\n node.store.remove(validatingMessage.key);\n node.store.set(\n /* @__PURE__ */ createMessage({\n key: \"failing\",\n value: !state.isPassing,\n visible: false\n })\n );\n });\n }\n}\nfunction run(current, validations, state, removeImmediately, complete) {\n const validation = validations[current];\n if (!validation)\n return complete();\n const node = validation.observer;\n if (isKilled(node))\n return;\n const currentRun = state.input;\n validation.state = null;\n function next(async, result) {\n if (state.input !== currentRun)\n return;\n state.isPassing = state.isPassing && !!result;\n validation.queued = false;\n const newDeps = node.stopObserve();\n const diff = diffDeps(validation.deps, newDeps);\n applyListeners(\n node,\n diff,\n function revalidate() {\n try {\n node.store.set(validatingMessage);\n } catch (e) {\n }\n validation.queued = true;\n if (state.rerun)\n clearTimeout(state.rerun);\n state.rerun = setTimeout(\n validate,\n 0,\n node,\n validations,\n state\n );\n },\n \"unshift\"\n // We want these listeners to run before other events are emitted so the 'state.validating' will be reliable.\n );\n validation.deps = newDeps;\n validation.state = result;\n if (result === false) {\n createFailedMessage(validation, removeImmediately || async);\n } else {\n removeMessage(validation);\n }\n if (validations.length > current + 1) {\n const nextValidation = validations[current + 1];\n if ((result || nextValidation.force || !nextValidation.skipEmpty) && nextValidation.state === null) {\n nextValidation.queued = true;\n }\n run(current + 1, validations, state, removeImmediately || async, complete);\n } else {\n complete();\n }\n }\n if ((!empty(node.value) || !validation.skipEmpty) && (state.isPassing || validation.force)) {\n if (validation.queued) {\n runRule(validation, node, (result) => {\n result instanceof Promise ? result.then((r) => next(true, r)) : next(false, result);\n });\n } else {\n run(current + 1, validations, state, removeImmediately, complete);\n }\n } else if (empty(node.value) && validation.skipEmpty && state.isPassing) {\n node.observe();\n node.value;\n next(false, state.isPassing);\n } else {\n next(false, null);\n }\n}\nfunction runRule(validation, node, after) {\n if (validation.debounce) {\n validation.timer = setTimeout(() => {\n node.observe();\n after(validation.rule(node, ...validation.args));\n }, validation.debounce);\n } else {\n node.observe();\n after(validation.rule(node, ...validation.args));\n }\n}\nfunction removeMessage(validation) {\n const key = `rule_${validation.name}`;\n if (validation.messageObserver) {\n validation.messageObserver = validation.messageObserver.kill();\n }\n if (has(validation.observer.store, key)) {\n validation.observer.store.remove(key);\n }\n}\nfunction createFailedMessage(validation, removeImmediately) {\n const node = validation.observer;\n if (isKilled(node))\n return;\n if (!validation.messageObserver) {\n validation.messageObserver = createObserver(node._node);\n }\n validation.messageObserver.watch(\n (node2) => {\n const i18nArgs = createI18nArgs(\n node2,\n validation\n );\n return i18nArgs;\n },\n (i18nArgs) => {\n const customMessage = createCustomMessage(node, validation, i18nArgs);\n const message = /* @__PURE__ */ createMessage({\n blocking: validation.blocking,\n key: `rule_${validation.name}`,\n meta: {\n /**\n * Use this key instead of the message root key to produce i18n validation\n * messages.\n */\n messageKey: validation.name,\n /**\n * For messages that were created *by or after* a debounced or async\n * validation rule — we make note of it so we can immediately remove them\n * as soon as the next commit happens.\n */\n removeImmediately,\n /**\n * Determines if this message should be passed to localization.\n */\n localize: !customMessage,\n /**\n * The arguments that will be passed to the validation rules\n */\n i18nArgs\n },\n type: \"validation\",\n value: customMessage || \"This field is not valid.\"\n });\n node.store.set(message);\n }\n );\n}\nfunction createCustomMessage(node, validation, i18nArgs) {\n const customMessage = node.props.validationMessages && has(node.props.validationMessages, validation.name) ? node.props.validationMessages[validation.name] : void 0;\n if (typeof customMessage === \"function\") {\n return customMessage(...i18nArgs);\n }\n return customMessage;\n}\nfunction createI18nArgs(node, validation) {\n return [\n {\n node,\n name: createMessageName(node),\n args: validation.args\n }\n ];\n}\nfunction createMessageName(node) {\n if (typeof node.props.validationLabel === \"function\") {\n return node.props.validationLabel(node);\n }\n return node.props.validationLabel || node.props.label || node.props.name || String(node.name);\n}\nvar hintPattern = \"(?:[\\\\*+?()0-9]+)\";\nvar rulePattern = \"[a-zA-Z][a-zA-Z0-9_]+\";\nvar ruleExtractor = new RegExp(\n `^(${hintPattern}?${rulePattern})(?:\\\\:(.*)+)?$`,\n \"i\"\n);\nvar hintExtractor = new RegExp(`^(${hintPattern})(${rulePattern})$`, \"i\");\nvar debounceExtractor = /([\\*+?]+)?(\\(\\d+\\))([\\*+?]+)?/;\nvar hasDebounce = /\\(\\d+\\)/;\nvar defaultHints = {\n blocking: true,\n debounce: 0,\n force: false,\n skipEmpty: true,\n name: \"\"\n};\nfunction parseRules(validation, rules, node) {\n if (!validation)\n return [];\n const intents = typeof validation === \"string\" ? extractRules(validation) : clone(validation);\n return intents.reduce((validations, args) => {\n let rule = args.shift();\n const hints = {};\n if (typeof rule === \"string\") {\n const [ruleName, parsedHints] = parseHints(rule);\n if (has(rules, ruleName)) {\n rule = rules[ruleName];\n Object.assign(hints, parsedHints);\n }\n }\n if (typeof rule === \"function\") {\n validations.push({\n observer: createObserver(node),\n rule,\n args,\n timer: 0,\n state: null,\n queued: true,\n deps: /* @__PURE__ */ new Map(),\n ...defaultHints,\n ...fnHints(hints, rule)\n });\n }\n return validations;\n }, []);\n}\nfunction extractRules(validation) {\n return validation.split(\"|\").reduce((rules, rule) => {\n const parsedRule = parseRule(rule);\n if (parsedRule) {\n rules.push(parsedRule);\n }\n return rules;\n }, []);\n}\nfunction parseRule(rule) {\n const trimmed = rule.trim();\n if (trimmed) {\n const matches = trimmed.match(ruleExtractor);\n if (matches && typeof matches[1] === \"string\") {\n const ruleName = matches[1].trim();\n const args = matches[2] && typeof matches[2] === \"string\" ? matches[2].split(\",\").map((s) => s.trim()) : [];\n return [ruleName, ...args];\n }\n }\n return false;\n}\nfunction parseHints(ruleName) {\n const matches = ruleName.match(hintExtractor);\n if (!matches) {\n return [ruleName, { name: ruleName }];\n }\n const map = {\n \"*\": { force: true },\n \"+\": { skipEmpty: false },\n \"?\": { blocking: false }\n };\n const [, hints, rule] = matches;\n const hintGroups = hasDebounce.test(hints) ? hints.match(debounceExtractor) || [] : [, hints];\n return [\n rule,\n [hintGroups[1], hintGroups[2], hintGroups[3]].reduce(\n (hints2, group) => {\n if (!group)\n return hints2;\n if (hasDebounce.test(group)) {\n hints2.debounce = parseInt(group.substr(1, group.length - 1));\n } else {\n group.split(\"\").forEach(\n (hint) => has(map, hint) && Object.assign(hints2, map[hint])\n );\n }\n return hints2;\n },\n { name: rule }\n )\n ];\n}\nfunction fnHints(existingHints, rule) {\n if (!existingHints.name) {\n existingHints.name = rule.ruleName || rule.name;\n }\n return [\"skipEmpty\", \"force\", \"debounce\", \"blocking\"].reduce(\n (hints, hint) => {\n if (has(rule, hint) && !has(hints, hint)) {\n Object.assign(hints, {\n [hint]: rule[hint]\n });\n }\n return hints;\n },\n existingHints\n );\n}\nfunction getValidationMessages(node) {\n const messages = /* @__PURE__ */ new Map();\n const extract = (n) => {\n const nodeMessages = [];\n for (const key in n.store) {\n const message = n.store[key];\n if (message.type === \"validation\" && message.visible && typeof message.value === \"string\") {\n nodeMessages.push(message);\n }\n }\n if (nodeMessages.length) {\n messages.set(n, nodeMessages);\n }\n return n;\n };\n extract(node).walk(extract);\n return messages;\n}\n\nexport { createMessageName, createValidationPlugin, getValidationMessages };\n//# sourceMappingURL=out.js.map\n//# sourceMappingURL=index.mjs.map","import { createMessageName } from '@formkit/validation';\nimport { has } from '@formkit/utils';\n\n// packages/i18n/src/locales/ar.ts\n\n// packages/i18n/src/formatters.ts\nfunction sentence(str) {\n return str[0].toUpperCase() + str.substr(1);\n}\nfunction list(items, conjunction = \"or\") {\n return items.reduce((oxford, item, index) => {\n oxford += item;\n if (index <= items.length - 2 && items.length > 2) {\n oxford += \", \";\n }\n if (index === items.length - 2) {\n oxford += `${items.length === 2 ? \" \" : \"\"}${conjunction} `;\n }\n return oxford;\n }, \"\");\n}\nfunction date(date2) {\n const dateTime = typeof date2 === \"string\" ? new Date(Date.parse(date2)) : date2;\n if (!(dateTime instanceof Date)) {\n return \"(unknown)\";\n }\n return new Intl.DateTimeFormat(void 0, {\n dateStyle: \"medium\",\n timeZone: \"UTC\"\n }).format(dateTime);\n}\nfunction order(first, second) {\n return Number(first) >= Number(second) ? [second, first] : [first, second];\n}\n\n// packages/i18n/src/locales/ar.ts\nvar ui = {\n /**\n * Shown on buttons for adding new items.\n */\n add: \"إضافة\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"إزالة\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"إزالة الكل\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"عذرا، لم يتم تعبئة جميع الحقول بشكل صحيح.\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"إرسال\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"لا يوجد ملف مختار\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"تحرك لأعلى\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"انتقل لأسفل\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"يتم الآن التحميل...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"تحميل المزيد\",\n /**\n * Shown on buttons that navigate state forward\n */\n next: \"التالي\",\n /**\n * Shown on buttons that navigate state backward\n */\n prev: \"السابق\",\n /**\n * Shown when transferring items between lists.\n */\n addAllValues: \"أضف جميع القيم\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"إضافة قيم محددة\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"قم بإزالة جميع القيم\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"إزالة القيم المحددة\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"اختر التاريخ\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"تاريخ التغيير\",\n /**\n * Shown when there is something to close\n */\n close: \"أغلق\",\n /**\n * Shown when there is something to open.\n */\n open: \"افتح\"\n};\nvar validation = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `الرجاء قبول ${name}.`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `يجب أن يكون ${sentence(name)} بعد ${date(args[0])}.`;\n }\n return `يجب أن يكون ${sentence(name)} في المستقبل.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `يمكن أن يحتوي ${sentence(name)} على أحرف أبجدية فقط.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `يمكن أن يحتوي ${sentence(name)} على أحرف وأرقام فقط.`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `يمكن أن تحتوي ${sentence(name)} على أحرف ومسافات فقط.`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `يجب أن يحتوي ${sentence(name)} على أحرف أبجدية.`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `يجب أن يحتوي ${sentence(name)} على أحرف أو أرقام.`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `يجب أن يحتوي ${sentence(name)} على أحرف أو مسافات.`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `يجب أن يحتوي ${sentence(name)} على رمز.`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `يجب أن يحتوي ${sentence(name)} على أحرف كبيرة.`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `يجب أن يحتوي ${sentence(name)} على أحرف صغيرة.`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `يجب أن يحتوي ${sentence(name)} على أرقام.`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `يجب أن يكون ${sentence(name)} رمزًا.`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `يمكن أن يحتوي ${sentence(name)} على أحرف كبيرة فقط.`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `يمكن أن يحتوي ${sentence(name)} على أحرف صغيرة فقط.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `يجب أن يكون ${sentence(name)} قبل ${date(args[0])}.`;\n }\n return `يجب أن يكون ${sentence(name)} في الماضي.`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `تمت تهيئة هذا الحقل بشكل غير صحيح ولا يمكن إرساله.`;\n }\n const [a, b] = order(args[0], args[1]);\n return `يجب أن يكون ${sentence(name)} ما بين ${a} و ${b}.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} غير متطابق.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} ليس تاريخًا صالحًا ، يرجى استخدام التنسيق ${args[0]}`;\n }\n return \"تمت تهيئة هذا الحقل بشكل غير صحيح ولا يمكن إرساله\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `يجب أن يكون ${sentence(name)} بين ${date(args[0])} و ${date(args[1])}`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"الرجاء أدخال بريد إليكتروني صالح.\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `لا ينتهي ${sentence(name)} بـ ${list(args)}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)} ليست قيمة مسموح بها.`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `يجب أن يكون ${sentence(name)} حرفًا واحدًا على الأقل.`;\n }\n if (min == 0 && max) {\n return `يجب أن يكون ${sentence(name)} أقل من أو يساوي ${max} حرفًا.`;\n }\n if (min === max) {\n return `يجب أن يتكون ${sentence(name)} من الأحرف ${max}.`;\n }\n if (min && max === Infinity) {\n return `يجب أن يكون ${sentence(name)} أكبر من أو يساوي ${min} حرفًا.`;\n }\n return `يجب أن يكون ${sentence(name)} بين ${min} و ${max} حرفًا.`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)} ليست قيمة مسموح بها.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `لا يمكن أن يكون أكثر من ${args[0]} ${name}.`;\n }\n return `يجب أن يكون ${sentence(name)} أقل من أو يساوي ${args[0]}.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"لا يسمح بتنسيقات الملفات.\";\n }\n return `يجب أن يكون ${sentence(name)} من النوع: ${args[0]}`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `لا يمكن أن يكون أقل من ${args[0]} ${name}.`;\n }\n return `يجب أن يكون ${sentence(name)} على الأقل ${args[0]}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `“${value}” ليس ${name} مسموحًا به.`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)} يجب ان يكون رقماً`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\" أو \")} مطلوب.`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `${sentence(name)} مطلوب.`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `لا يبدأ ${sentence(name)} بـ ${list(args)}.`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `يرجى إدخال عنوان URL صالح.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"التاريخ المحدد غير صالح.\"\n};\nvar ar = { ui, validation };\nvar ui2 = {\n /**\n * Shown on a button for adding additional items.\n */\n add: \"əlavə edin\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"çıxarmaq\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"Hamısını silin\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"Üzr istəyirik, bütün sahələr düzgün doldurulmayıb.\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"Təqdim et\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"Heç bir fayl seçilməyib\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"yuxarı hərəkət\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"Aşağı hərəkət\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"Yükləmə...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"Daha çox yüklə\",\n /**\n * Shown on buttons that navigate state forward\n */\n next: \"Növbəti\",\n /**\n * Shown on buttons that navigate state backward\n */\n prev: \"Əvvəlki\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"Bütün dəyərləri əlavə edin\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"Seçilmiş dəyərləri əlavə edin\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"Bütün dəyərləri sil\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"Seçilmiş dəyərləri sil\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"Tarixi seçin\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"Tarixi dəyişdirin\",\n /**\n * Shown when there is something to close\n */\n close: \"Bağlayın\",\n /**\n * Shown when there is something to open.\n */\n open: \"Açıq\"\n};\nvar validation2 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `${name} qəbul edin.`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} ${date(args[0])} sonra olmalıdır.`;\n }\n return `${sentence(name)} gələcəkdə olmalıdır.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(name)} yalnız əlifba sırası simvollarından ibarət ola bilər.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)} yalnız hərf və rəqəmlərdən ibarət ola bilər.`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)} yalnız hərflərdən və boşluqlardan ibarət ola bilər.`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `${sentence(name)} əlifba sırası simvolları ehtiva etməlidir.`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `${sentence(name)} hərfləri və ya nömrələri ehtiva etməlidir.`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `${sentence(name)} hərfləri və ya boşluqları ehtiva etməlidir.`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `${sentence(name)} simvolu ehtiva etməlidir.`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `${sentence(name)} böyük olmalıdır.`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `${sentence(name)} kiçik olmalıdır.`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `${sentence(name)} nömrələri ehtiva etməlidir.`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `${sentence(name)} simvol olmalıdır.`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `${sentence(name)} yalnız böyük hərfləri ehtiva edə bilər.`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `${sentence(name)} yalnız kiçik hərfləri ehtiva edə bilər.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} ${date(args[0])} əvvəl olmalıdır.`;\n }\n return `${sentence(name)} keçmişdə olmalıdır.`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `Bu sahə səhv konfiqurasiya edilib və onu təqdim etmək mümkün deyil.`;\n }\n const [a, b] = order(args[0], args[1]);\n return `${sentence(name)} ${a} və ${b} arasında olmalıdır.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} uyğun gəlmir.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} etibarlı tarix deyil, ${args[0]} formatından istifadə edin`;\n }\n return \"Bu sahə səhv konfiqurasiya edilib və onu təqdim etmək mümkün deyil\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)} ${date(args[0])} və ${date(args[1])} arasında olmalıdır`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"Etibarlı e-poçt ünvanı daxil edin.\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)} ${list(args)} ilə bitmir.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)} icazə verilən dəyər deyil.`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)} ən azı bir simvol olmalıdır.`;\n }\n if (min == 0 && max) {\n return `${sentence(name)} ${max} simvoldan kiçik və ya ona bərabər olmalıdır.`;\n }\n if (min === max) {\n return `${sentence(name)} ${max} simvol uzunluğunda olmalıdır.`;\n }\n if (min && max === Infinity) {\n return `${sentence(name)} ${min} simvoldan böyük və ya ona bərabər olmalıdır.`;\n }\n return `${sentence(name)} ${min} və ${max} simvol arasında olmalıdır.`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)} icazə verilən dəyər deyil.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `${args[0]} ${name}-dən çox ola bilməz.`;\n }\n return `${sentence(name)} ${args[0]} dəyərindən kiçik və ya ona bərabər olmalıdır.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"Fayl formatlarına icazə verilmir.\";\n }\n return `${sentence(name)} aşağıdakı tipdə olmalıdır: ${args[0]}`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `${args[0]} ${name}-dən az ola bilməz.`;\n }\n return `${sentence(name)} ən azı ${args[0]} olmalıdır.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `“${value}” icazə verilən ${name} deyil.`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)} rəqəm olmalıdır.`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\" və ya \")} tələb olunur.`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `${sentence(name)} tələb olunur.`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)} ${list(args)} ilə başlamır.`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `Xahiş edirik, düzgün URL daxil edin.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"Seçilmiş tarix etibarsızdır.\"\n};\nvar az = { ui: ui2, validation: validation2 };\nvar ui3 = {\n /**\n * Shown on a button for adding additional items.\n */\n add: \"Добави\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"Премахни\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"Премахни всички\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"Извинете, не всички полета са попълнени правилно.\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"Изпрати\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"Няма избран файл\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"Преместване нагоре\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"Преместете се надолу\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"Зареждане...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"Заредете повече\",\n /**\n * Shown on buttons that navigate state forward\n */\n next: \"Следващ\",\n /**\n * Shown on buttons that navigate state backward\n */\n prev: \"Предишен\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"Добавете всички стойности\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"Добавяне на избрани стойности\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"Премахнете всички стойности\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"Премахване на избраните стойности\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"Избери дата\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"Промяна на датата\",\n /**\n * Shown when there is something to close\n */\n close: \"Затвори\",\n /**\n * Shown when there is something to open.\n */\n open: \"Отворете\"\n};\nvar validation3 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `Моля приемете ${name}.`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} трябва да е след ${date(args[0])}.`;\n }\n return `${sentence(name)} трябва да бъде в бъдещето.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(name)} може да съдържа само букви.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)} може да съдържа само букви и цифри.`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)} може да съдържа само букви и интервали.`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `${sentence(name)} трябва да съдържа азбучни знаци.`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `${sentence(name)} трябва да съдържа букви или цифри.`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `${sentence(name)} трябва да съдържа букви или интервали.`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `${sentence(name)} трябва да съдържа символ.`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `${sentence(name)} трябва да съдържа главни букви.`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `${sentence(name)} трябва да съдържа малки букви.`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `${sentence(name)} трябва да съдържа числа.`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `${sentence(name)} трябва да бъде символ.`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `${sentence(name)} може да съдържа само главни букви.`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `${sentence(name)} може да съдържа само малки букви.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} трябва да е преди ${date(args[0])}.`;\n }\n return `${sentence(name)} трябва да бъде в миналото.`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `Това поле е конфигурирано неправилно и не може да бъде изпратено`;\n }\n const [a, b] = order(args[0], args[1]);\n return `${sentence(name)} трябва да бъде между ${a} и ${b}.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} не съвпада.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} е невалидна дата. Моля, използвайте формата ${args[0]}`;\n }\n return \"Това поле е конфигурирано неправилно и не може да бъде изпратено\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)} трябва да бъде между ${date(args[0])} и ${date(\n args[1]\n )}.`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"Моля, въведете валиден имейл адрес.\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)} не завършва на ${list(args)}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)} е неразрешена стойност.`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)} трябва да има поне един символ.`;\n }\n if (min == 0 && max) {\n return `${sentence(name)} трябва да бъде по-малко или равно на ${max} символа.`;\n }\n if (min === max) {\n return `${sentence(name)} трябва да бъде ${max} символи дълго.`;\n }\n if (min && max === Infinity) {\n return `${sentence(name)} трябва да бъде по-голямо или равно на ${min} символа.`;\n }\n return `${sentence(name)} трябва да бъде между ${min} и ${max} символа.`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)} е неразрешена стойност.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Не може да има повече от ${args[0]} ${name}.`;\n }\n return `${sentence(name)} трябва да бъде по-малко или равно на ${args[0]}.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"Не са разрешени никакви файлови формати.\";\n }\n return `${sentence(name)} трябва да бъде от тип: ${args[0]}`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Не може да има по-малко от ${args[0]} ${name}.`;\n }\n return `${sentence(name)} трябва да бъде поне ${args[0]}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `“${value}” е неразрешен ${name}.`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)} трябва да бъде число.`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\" или \")} изисква се.`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `${sentence(name)} е задължително.`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)} не започва с ${list(args)}.`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `Моля, въведете валиден URL адрес.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"Избраната дата е невалидна.\"\n};\nvar bg = { ui: ui3, validation: validation3 };\nvar ui4 = {\n /**\n * Shown on a button for adding additional items.\n */\n add: \"Dodaj\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"Ukloni\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"Ukloni sve\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"Nažalost, nisu sva polja ispravno popunjena.\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"Pošalji\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"Nije odabran nijedan fajl\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"Pomjeri gore\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"Pomjeri dole\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"Učitavanje...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"Učitaj više\",\n /**\n * Show on buttons that navigate state forward\n */\n next: \"Sljedeći\",\n /**\n * Show on buttons that navigate state backward\n */\n prev: \"Prethodni\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"Dodajte sve vrijednosti\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"Dodajte odabrane vrijednosti\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"Uklonite sve vrijednosti\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"Uklonite odabrane vrijednosti\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"Odaberite datum\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"Promjenite datum\",\n /**\n * Shown when there is something to close\n */\n close: \"Zatvori\",\n /**\n * Shown when there is something to open.\n */\n open: \"Otvoreno\"\n};\nvar validation4 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `Molimo prihvatite ${name}.`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} mora biti poslije ${date(args[0])}.`;\n }\n return `${sentence(name)} mora biti u budućnosti.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(name)} može sadržavati samo abecedne karaktere.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)} može sadržavati samo slova i brojeve.`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)} može sadržavati samo slova i razmake.`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `${sentence(name)} mora sadržavati abecedne karaktere.`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `${sentence(name)} mora sadržavati slova ili brojeve.`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `${sentence(name)} mora sadržavati slova ili razmake.`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `${sentence(name)} mora sadržavati simbol.`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `${sentence(name)} mora sadržavati veliko slovo.`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `${sentence(name)} mora sadržavati malo slovo.`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `${sentence(name)} mora sadržavati brojeve.`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `${sentence(name)} mora biti simbol.`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `${sentence(name)} može sadržavati samo velika slova.`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `${sentence(name)} može sadržavati samo mala slova.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} mora biti prije ${date(args[0])}.`;\n }\n return `${sentence(name)} mora biti u prošlosti.`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `Ovo polje je pogrešno konfigurirano i ne može se poslati.`;\n }\n const [a, b] = order(args[0], args[1]);\n return `${sentence(name)} mora biti između ${a} i ${b}.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} ne podudara se.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} nije ispravan datum, molimo koristite format ${args[0]}`;\n }\n return \"Ovo polje je pogrešno konfigurirano i ne može se poslati\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)} mora biti između ${date(args[0])} i ${date(args[1])}`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"Molimo Vas da unesete validnu email adresu.\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)} ne završava sa ${list(args)}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)} nije dozvoljena vrijednost.`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)} mora biti najmanje jedan karakter.`;\n }\n if (min == 0 && max) {\n return `${sentence(name)} mora biti manje od ili jednako ${max} karaktera.`;\n }\n if (min === max) {\n return `${sentence(name)} treba imati ${max} karaktera.`;\n }\n if (min && max === Infinity) {\n return `${sentence(name)} mora biti veći od ili jednak ${min} karaktera.`;\n }\n return `${sentence(name)} mora biti između ${min} i ${max} karaktera.`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)} nije dozvoljena vrijednost.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Ne može imati više od ${args[0]} ${name}.`;\n }\n return `${sentence(name)} mora biti manji ili jednak ${args[0]}.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"Nisu dozvoljeni formati datoteka.\";\n }\n return `${sentence(name)} mora biti tipa: ${args[0]}`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Ne može imati manje od ${args[0]} ${name}.`;\n }\n return `Mora biti barem ${args[0]} ${name} .`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `“${value}” nije dozvoljeno ${name}.`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)} mora biti broj.`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\" ili \")} je obavezno.`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `${sentence(name)} je obavezno.`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)} ne počinje sa ${list(args)}.`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `Unesite važeći link.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"Odabrani datum je nevažeći.\"\n};\nvar bs = { ui: ui4, validation: validation4 };\nvar ui5 = {\n /**\n * Shown on a button for adding additional items.\n */\n add: \"Afegir\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"Eliminar\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"Eliminar tot\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"Disculpi, no tots els camps estan omplerts correctament.\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"Enviar\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"Cap fitxer triat\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"Moure amunt\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"Moure avall\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"Carregant...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"Carregar més\",\n /**\n * Shown on buttons that navigate state forward\n */\n next: \"Següent\",\n /**\n * Shown on buttons that navigate state backward\n */\n prev: \"Anterior\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"Afegir tots els valors\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"Afegeix els valors seleccionats\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"Eliminar tots els valors\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"Elimina els valors seleccionats\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"Trieu la data\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"Canviar data\",\n /**\n * Shown when there is something to close\n */\n close: \"Tancar\",\n /**\n * Shown when there is something to open.\n */\n open: \"Obert\"\n};\nvar validation5 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://docs.formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `Si us plau accepti ${name}.`;\n },\n /**\n * The date is not after\n * @see {@link https://docs.formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} ha de ser posterior a ${date(args[0])}.`;\n }\n return `${sentence(name)} ha de succeïr al futur.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://docs.formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(name)} només pot contenir caràcters alfabètics.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://docs.formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)} només pot contenir lletres i números.`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://docs.formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)} només pot contenir lletres i espais.`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `${sentence(name)} ha de contenir caràcters alfabètics.`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `${sentence(name)} ha de contenir lletres o números.`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `${sentence(name)} ha de contenir lletres o espais.`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `${sentence(name)} ha de contenir símbol.`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `${sentence(name)} ha de contenir majúscules.`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `${sentence(name)} ha de contenir minúscules.`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `${sentence(name)} ha de contenir números.`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `${sentence(name)} ha de ser un símbol.`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `${sentence(name)} només pot contenir lletres majúscules.`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `${sentence(name)} només pot contenir lletres minúscules.`;\n },\n /**\n * The date is not before\n * @see {@link https://docs.formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} ha de ser anterior a ${date(args[0])}.`;\n }\n return `${sentence(name)} ha d'estar al passat.`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://docs.formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `Aquest camp està configurat incorrectament i no pot ésser enviat.`;\n }\n const [a, b] = order(args[0], args[1]);\n return `${sentence(name)} ha d'estar entre ${a} i ${b}.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://docs.formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} no concorda.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://docs.formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} no és una data vàlida, si us plau empri el format ${args[0]}`;\n }\n return \"Aquest camp està configurat incorrectament i no pot ésser enviat\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://docs.formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)} ha d'estar entre ${date(args[0])} i ${date(args[1])}`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://docs.formkit.com/essentials/validation#email}\n */\n email: `Si us plau, entri una adreça d'e-mail vàlida.`,\n /**\n * Does not end with the specified value\n * @see {@link https://docs.formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)} no acaba amb ${list(args)}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://docs.formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)} no és un valor acceptat.`;\n },\n /**\n * Does not match specified length\n * @see {@link https://docs.formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)} ha de tenir com a mínim un caràcter.`;\n }\n if (min == 0 && max) {\n return `${sentence(name)} ha de ser inferior o igual a ${max} caràcters.`;\n }\n if (min === max) {\n return `${sentence(name)} ha de tenir una longitud de ${max} caràcters.`;\n }\n if (min && max === Infinity) {\n return `${sentence(name)} ha de ser major que o igual a ${min} caràcters.`;\n }\n return `${sentence(name)} ha d'estar entre ${min} i ${max} caràcters.`;\n },\n /**\n * Value is not a match\n * @see {@link https://docs.formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)} no és un valor permès.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://docs.formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `No pot tenir més de ${args[0]} ${name}.`;\n }\n return `${sentence(name)} ha de ser menys que o igual a ${args[0]}.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://docs.formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"No hi ha cap format de fitxer acceptat.\";\n }\n return `${sentence(name)} ha de ser del tipus: ${args[0]}`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://docs.formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `No pot tenir menys de ${args[0]} ${name}.`;\n }\n return `${sentence(name)} ha de ser com a mínim ${args[0]}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://docs.formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `“${value}” no s'accepta com a ${name}.`;\n },\n /**\n * Is not a number\n * @see {@link https://docs.formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)} ha de ser un número.`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\" o \")} es requereix.`;\n },\n /**\n * Required field.\n * @see {@link https://docs.formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `${sentence(name)} és obligatori.`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://docs.formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)} no comença amb ${list(args)}.`;\n },\n /**\n * Is not a url\n * @see {@link https://docs.formkit.com/essentials/validation#url}\n */\n url() {\n return `Si us plau inclogui una url vàlida.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"La data seleccionada no és vàlida.\"\n};\nvar ca = { ui: ui5, validation: validation5 };\nvar ui6 = {\n /**\n * Shown on buttons for adding new items.\n */\n add: \"Přidat\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"Odebrat\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"Odebrat vše\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"Pardon, ale ne všechna pole jsou vyplněna správně.\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"Odeslat\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"Žádný soubor nebyl vybrán\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"Pohyb nahoru\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"Posunout dolů\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"Načítání...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"Načíst více\",\n /**\n * Shown on buttons that navigate state forward\n */\n next: \"Další\",\n /**\n * Shown on buttons that navigate state backward\n */\n prev: \"Předchozí\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"Přidat všechny hodnoty\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"Přidání vybraných hodnot\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"Odstraňte všechny hodnoty\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"Odstranění vybraných hodnot\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"Zvolte datum\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"Změnit datum\",\n /**\n * Shown when there is something to close\n */\n close: \"Zavřít\",\n /**\n * Shown when there is something to open.\n */\n open: \"Otevřeno\"\n};\nvar validation6 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `Prosím, zaškrtněte ${name}.`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} musí být po ${date(args[0])}.`;\n }\n return `${sentence(name)} musí být v budoucnosti.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(name)} může obsahovat pouze písmena.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)} může obsahovat pouze písmena a čísla.`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `${sentence(name)} musí obsahovat abecední znaky.`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `${sentence(name)} musí obsahovat písmena nebo číslice.`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `${sentence(name)} musí obsahovat písmena nebo mezery.`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `${sentence(name)} musí obsahovat symbol.`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `${sentence(name)} musí obsahovat velká písmena.`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `${sentence(name)} musí obsahovat malá písmena.`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `${sentence(name)} musí obsahovat čísla.`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `${sentence(name)} musí být symbol.`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `${sentence(name)} může obsahovat pouze velká písmena.`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `${sentence(name)} může obsahovat pouze malá písmena.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} musí být před ${date(args[0])}.`;\n }\n return `${sentence(name)} musí být v minulosti.`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `Toto pole bylo špatně nakonfigurováno a nemůže být odesláno.`;\n }\n const [a, b] = order(args[0], args[1]);\n return `${sentence(name)} musí být mezi ${a} a ${b}.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} nejsou shodná.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} není platné datum, prosím, použijte formát ${args[0]}`;\n }\n return \"Toto pole bylo špatně nakonfigurováno a nemůže být odesláno.\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)} musí být mezi ${date(args[0])} a ${date(args[1])}`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"Prosím, zadejte platnou e-mailovou adresu.\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)} nekončí na ${list(args)}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)} není povolená hodnota.`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)} musí mít nejméně jeden znak.`;\n }\n if (min == 0 && max) {\n return `${sentence(name)} může mít maximálně ${max} znaků.`;\n }\n if (min === max) {\n return `${sentence(name)} by mělo být ${max} znaků dlouhé.`;\n }\n if (min && max === Infinity) {\n return `${sentence(name)} musí obsahovat minimálně ${min} znaků.`;\n }\n return `${sentence(name)} musí být dlouhé ${min} až ${max} znaků.`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)} není povolená hodnota.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Nelze použít více než ${args[0]} ${name}.`;\n }\n return `${sentence(name)} musí mít menší nebo rovno než ${args[0]}.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"Nejsou nakonfigurovány povolené typy souborů.\";\n }\n return `${sentence(name)} musí být typu: ${args[0]}`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Nelze mít méně než ${args[0]} ${name}.`;\n }\n return `${sentence(name)} musí být minimálně ${args[0]}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `“${value}” není dovolená hodnota pro ${name}.`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)} musí být číslo.`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\" nebo \")} je vyžadován.`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `${sentence(name)} je povinné.`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)} nezačíná na ${list(args)}.`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `Zadejte prosím platnou adresu URL.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"Vybrané datum je neplatné.\"\n};\nvar cs = { ui: ui6, validation: validation6 };\nvar ui7 = {\n /**\n * Shown on buttons for adding new items.\n */\n add: \"Tilføj\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"Fjern\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"Fjern alle\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"Alle felter er ikke korrekt udfyldt.\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"Send\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"Ingen filer valgt\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"Flyt op\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"Flyt ned\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"Indlæser...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"Indlæs mere\",\n /**\n * Shown on buttons that navigate state forward\n */\n next: \"Næste\",\n /**\n * Shown on buttons that navigate state backward\n */\n prev: \"Forrige\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"Tilføj alle værdier\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"Tilføj valgte værdier\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"Fjern alle værdier\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"Fjern valgte værdier\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"Vælg dato\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"Skift dato\",\n /**\n * Shown when there is something to close\n */\n close: \"Luk\",\n /**\n * Shown when there is something to open.\n */\n open: \"Åbn\"\n};\nvar validation7 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `Accepter venligst ${name}.`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} skal være senere end ${date(args[0])}.`;\n }\n return `${sentence(name)} skal være i fremtiden.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(name)} kan kun indeholde bogstaver.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)} kan kun indeholde bogstaver og tal.`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)} kan kun indeholde bogstaver og mellemrum.`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `${sentence(name)} skal indeholde alfabetiske tegn.`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `${sentence(name)} skal indeholde bogstaver eller tal.`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `${sentence(name)} skal indeholde bogstaver eller mellemrum.`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `${sentence(name)} skal indeholde symbol.`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `${sentence(name)} skal indeholde store bogstaver.`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `${sentence(name)} skal indeholde små bogstaver.`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `${sentence(name)} skal indeholde tal.`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `${sentence(name)} skal være et symbol.`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `${sentence(name)} kan kun indeholde store bogstaver.`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `${sentence(name)} kan kun indeholde små bogstaver.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} skal være før ${date(args[0])}.`;\n }\n return `${sentence(name)} skal være før i dag.`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `Dette felt er ikke konfigureret korrekt og kan derfor ikke blive sendt.`;\n }\n const [a, b] = order(args[0], args[1]);\n return `${sentence(name)} skal være mellem ${a} og ${b}.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} matcher ikke.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} er ikke gyldig, brug venligst formatet ${args[0]}`;\n }\n return \"Dette felt er ikke konfigureret korrekt og kan derfor ikke blive sendt.\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)} skal være mellem ${date(args[0])} og ${date(args[1])}`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"Indtast venligst en gyldig email-adresse.\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)} slutter ikke med ${list(args)}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)} er ikke en gyldig værdi.`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)} skal være på mindst ét tegn.`;\n }\n if (min == 0 && max) {\n return `${sentence(name)} skal være på højst ${max} tegn.`;\n }\n if (min === max) {\n return `${sentence(name)} skal være ${max} tegn lange.`;\n }\n if (min && max === Infinity) {\n return `${sentence(name)} skal være på mindst ${min} tegn.`;\n }\n return `${sentence(name)} skal være på mindst ${min} og højst ${max} tegn.`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)} er ikke en gyldig værdi.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Kan ikke have flere end ${args[0]} ${name}.`;\n }\n return `${sentence(name)} skal være mindre eller lig med ${args[0]}.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"Ingen filformater tilladt.\";\n }\n return `${sentence(name)} skal være af filtypen: ${args[0]}`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Kan ikke have mindre end ${args[0]} ${name}.`;\n }\n return `${sentence(name)} skal være mindst ${args[0]}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `“${value}” er ikke en tilladt ${name}.`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)} skal være et tal.`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\" eller \")} er påkrævet.`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `${sentence(name)} er påkrævet.`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)} starter ikke med ${list(args)}.`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `Indtast en gyldig URL.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"Den valgte dato er ugyldig.\"\n};\nvar da = { ui: ui7, validation: validation7 };\nvar ui8 = {\n /**\n * Shown on buttons for adding new items.\n */\n add: \"Hinzufügen\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"Entfernen\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"Alles entfernen\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"Entschuldigung, nicht alle Felder wurden korrekt ausgefüllt.\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"Senden\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"Keine Datei ausgewählt\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"Gehe nach oben\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"Gehen Sie nach unten\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"Wird geladen...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"Mehr laden\",\n /**\n * Shown on buttons that navigate state forward\n */\n next: \"Weiter\",\n /**\n * Shown on buttons that navigate state backward\n */\n prev: \"Zurück\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"Alle Werte hinzufügen\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"Ausgewählte Werte hinzufügen\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"Alle Werte entfernen\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"Ausgewählte Werte entfernen\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"Datum wählen\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"Datum ändern\",\n /**\n * Shown when there is something to close\n */\n close: \"Schliessen\",\n /**\n * Shown when there is something to open.\n */\n open: \"Offen\"\n};\nvar validation8 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `Bitte ${name} akzeptieren.`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} muss nach dem ${date(args[0])} liegen.`;\n }\n return `${sentence(name)} muss in der Zukunft liegen.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(name)} darf nur Buchstaben enthalten.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)} darf nur Buchstaben und Zahlen enthalten.`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)} dürfen nur Buchstaben und Leerzeichen enthalten.`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `${sentence(name)} muss alphabetische Zeichen enthalten.`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `${sentence(name)} muss Buchstaben oder Zahlen enthalten.`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `${sentence(name)} muss Buchstaben oder Leerzeichen enthalten.`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `${sentence(name)} muss ein Symbol enthalten.`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `${sentence(name)} muss Großbuchstaben enthalten.`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `${sentence(name)} muss Kleinbuchstaben enthalten.`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `${sentence(name)} muss Zahlen enthalten.`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `${sentence(name)} muss ein Symbol sein.`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `${sentence(name)} kann nur Großbuchstaben enthalten.`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `${sentence(name)} kann nur Kleinbuchstaben enthalten.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} muss vor dem ${date(args[0])} liegen.`;\n }\n return `${sentence(name)} muss in der Vergangenheit liegen.`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `Dieses Feld wurde falsch konfiguriert und kann nicht übermittelt werden.`;\n }\n return `${sentence(name)} muss zwischen ${args[0]} und ${args[1]} sein.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} stimmt nicht überein.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} ist kein gültiges Datum im Format ${args[0]}.`;\n }\n return \"Dieses Feld wurde falsch konfiguriert und kann nicht übermittelt werden.\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)} muss zwischen ${date(args[0])} und ${date(\n args[1]\n )} liegen.`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"E-Mail Adresse ist ungültig.\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)} endet nicht mit ${list(args)}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)} enthält einen ungültigen Wert.`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = first <= second ? first : second;\n const max = second >= first ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)} muss mindestens ein Zeichen enthalten.`;\n }\n if (min == 0 && max) {\n return `${sentence(name)} darf maximal ${max} Zeichen enthalten.`;\n }\n if (min === max) {\n return `${sentence(name)} sollte ${max} Zeichen lang sein.`;\n }\n if (min && max === Infinity) {\n return `${sentence(name)} muss mindestens ${min} Zeichen enthalten.`;\n }\n return `${sentence(name)} muss zwischen ${min} und ${max} Zeichen enthalten.`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)} enthält einen ungültigen Wert.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Darf maximal ${args[0]} ${name} haben.`;\n }\n return `${sentence(name)} darf maximal ${args[0]} sein.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"Keine Dateiformate konfiguriert.\";\n }\n return `${sentence(name)} muss vom Typ ${args[0]} sein.`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Mindestens ${args[0]} ${name} erforderlich.`;\n }\n return `${sentence(name)} muss mindestens ${args[0]} sein.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `“${value}” ist kein gültiger Wert für ${name}.`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)} muss eine Zahl sein.`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\" oder \")} ist erforderlich.`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `${sentence(name)} ist erforderlich.`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)} beginnt nicht mit ${list(args)}.`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `Bitte geben Sie eine gültige URL ein.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"Das gewählte Datum ist ungültig.\"\n};\nvar de = { ui: ui8, validation: validation8 };\nvar ui9 = {\n /**\n * Shown on a button for adding additional items.\n */\n add: \"Προσθήκη\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"Αφαίρεση\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"Αφαίρεση όλων\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"Λυπούμαστε, υπάρχουν πεδία που δεν έχουν συμπληρωθεί σωστά.\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"Υποβολή\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"Κανένα αρχείο δεν έχει επιλεγεί\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"Προς τα επάνω\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"Προς τα κάτω\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"Φορτώνει...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"Φόρτωση περισσότερων\",\n /**\n * Shown on buttons that navigate state forward\n */\n next: \"Επόμενη\",\n /**\n * Shown on buttons that navigate state backward\n */\n prev: \"Προηγούμενο\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"Προσθήκη όλων των τιμών\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"Προσθήκη επιλεγμένων τιμών\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"Κατάργηση όλων των τιμών\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"Αφαίρεση επιλεγμένων τιμών\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"Επιλέξτε ημερομηνία\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"Αλλαγή ημερομηνίας\",\n /**\n * Shown when there is something to close\n */\n close: \"Κλείσιμο\",\n /**\n * Shown when there is something to open.\n */\n open: \"Ανοιχτό\"\n};\nvar validation9 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `Παρακαλώ αποδεχτείτε το ${name}.`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} πρέπει να είναι μετά της ${date(args[0])}.`;\n }\n return `${sentence(name)} πρέπει να είναι στο μέλλον.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(name)} μπορεί να περιέχει μόνο αλφαβητικούς χαρακτήρες.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)} μπορεί να περιέχει μόνο γράμματα και αριθμούς.`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)} μπορεί να περιέχει μόνο γράμματα και κενά.`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `Το ${sentence(name)} πρέπει να περιέχει αλφαβητικούς χαρακτήρες.`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `Το ${sentence(name)} πρέπει να περιέχει γράμματα ή αριθμούς.`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `${sentence(name)} πρέπει να περιέχει γράμματα ή κενά.`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `Το ${sentence(name)} πρέπει να περιέχει το σύμβολο.`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `Το ${sentence(name)} πρέπει να περιέχει κεφαλαία γράμματα.`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `Το ${sentence(name)} πρέπει να περιέχει πεζά γράμματα.`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `Το ${sentence(name)} πρέπει να περιέχει αριθμούς.`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `Το ${sentence(name)} πρέπει να είναι ένα σύμβολο.`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `Το ${sentence(name)} μπορεί να περιέχει μόνο κεφαλαία γράμματα.`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `Το ${sentence(name)} μπορεί να περιέχει μόνο πεζά γράμματα.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} πρέπει να είναι πριν της ${date(args[0])}.`;\n }\n return `${sentence(name)} πρέπει να είναι στο παρελθόν.`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `Αυτό το πεδίο έχει ρυθμιστεί λανθασμένα και δεν μπορεί να υποβληθεί.`;\n }\n const [a, b] = order(args[0], args[1]);\n return `${sentence(name)} πρέπει να είναι μεταξύ ${a} και ${b}.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} δεν ταιριάζει.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(\n name\n )} δεν είναι έγυρη ημερομηνία, παρακαλώ ακολουθήστε την διαμόρφωση ${args[0]}`;\n }\n return \"Αυτό το πεδίο έχει ρυθμιστεί λανθασμένα και δεν μπορεί να υποβληθεί\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)} πρέπει να είναι μεταξύ ${date(args[0])} και ${date(\n args[1]\n )}`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"Παρακαλώ πληκτρολογήστε μια έγκυρη email διεύθυνση. \",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)} δεν καταλήγει με ${list(args)}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)} δεν είναι μια επιτρεπτή τιμή.`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)} πρέπει να είναι τουλάχιστον ενός χαρακτήρα.`;\n }\n if (min == 0 && max) {\n return `${sentence(name)} πρέπει να είναι λιγότεροι ή ίσοι με ${max} χαρακτήρες.`;\n }\n if (min === max) {\n return `Το ${sentence(name)} θα πρέπει να έχει μήκος ${max} χαρακτήρες.`;\n }\n if (min && max === Infinity) {\n return `${sentence(\n name\n )} πρέπει να είναι περισσότεροι ή ίσοι με ${min} χαρακτήρες.`;\n }\n return `${sentence(name)} πρέπει να είναι μεταξύ ${min} και ${max} χαρακτήρες.`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)} δεν είναι μια επιτρεπτή τιμή.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Δεν μπορεί να έχει παραπάνω από ${args[0]} ${name}.`;\n }\n return `${sentence(name)} πρέπει αν είναι λιγότερο ή ίσο με το ${args[0]}.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"Δεν επιτρέπονται αρχεία.\";\n }\n return `${sentence(name)} πρέπει να είναι τύπου: ${args[0]}`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Δεν μπορεί να είναι λιγότερο από ${args[0]} ${name}.`;\n }\n return `${sentence(name)} πρέπει να είναι τουλάχιστον ${args[0]}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `“${value}” δεν είναι μια επιτρεπτή ${name}.`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)} πρέπει να είναι αριθμός.`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\" ή \")} απαιτείται.`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `${sentence(name)} είναι υποχρεωτικό.`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)} δεν αρχίζει με ${list(args)}.`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `Παρακαλώ εισάγετε ένα έγκυρο URL.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"Η επιλεγμένη ημερομηνία δεν είναι έγκυρη.\"\n};\nvar el = { ui: ui9, validation: validation9 };\nvar ui10 = {\n /**\n * Shown on a button for adding additional items.\n */\n add: \"Add\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"Remove\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"Remove all\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"Sorry, not all fields are filled out correctly.\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"Submit\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"No file chosen\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"Move up\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"Move down\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"Loading...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"Load more\",\n /**\n * Show on buttons that navigate state forward\n */\n next: \"Next\",\n /**\n * Show on buttons that navigate state backward\n */\n prev: \"Previous\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"Add all values\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"Add selected values\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"Remove all values\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"Remove selected values\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"Choose date\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"Change date\",\n /**\n * Shown above error summaries when someone attempts to submit a form with\n * errors and the developer has implemented ``.\n */\n summaryHeader: \"There were errors in your form.\",\n /*\n * Shown when there is something to close\n */\n close: \"Close\",\n /**\n * Shown when there is something to open.\n */\n open: \"Open\"\n};\nvar validation10 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `Please accept the ${name}.`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} must be after ${date(args[0])}.`;\n }\n return `${sentence(name)} must be in the future.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(name)} can only contain alphabetical characters.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)} can only contain letters and numbers.`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)} can only contain letters and spaces.`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `${sentence(name)} must contain alphabetical characters.`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `${sentence(name)} must contain letters or numbers.`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `${sentence(name)} must contain letters or spaces.`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `${sentence(name)} must contain a symbol.`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `${sentence(name)} must contain an uppercase letter.`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `${sentence(name)} must contain a lowercase letter.`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `${sentence(name)} must contain numbers.`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `${sentence(name)} must be a symbol.`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `${sentence(name)} can only contain uppercase letters.`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name, args }) {\n let postfix = \"\";\n if (Array.isArray(args) && args.length) {\n if (args[0] === \"allow_non_alpha\")\n postfix = \", numbers and symbols\";\n if (args[0] === \"allow_numeric\")\n postfix = \" and numbers\";\n if (args[0] === \"allow_numeric_dashes\")\n postfix = \", numbers and dashes\";\n }\n return `${sentence(name)} can only contain lowercase letters${postfix}.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} must be before ${date(args[0])}.`;\n }\n return `${sentence(name)} must be in the past.`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `This field was configured incorrectly and can’t be submitted.`;\n }\n const [a, b] = order(args[0], args[1]);\n return `${sentence(name)} must be between ${a} and ${b}.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} does not match.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} is not a valid date, please use the format ${args[0]}`;\n }\n return \"This field was configured incorrectly and can’t be submitted\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)} must be between ${date(args[0])} and ${date(args[1])}`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"Please enter a valid email address.\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)} doesn’t end with ${list(args)}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)} is not an allowed value.`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)} must be at least one character.`;\n }\n if (min == 0 && max) {\n return `${sentence(name)} must be less than or equal to ${max} characters.`;\n }\n if (min === max) {\n return `${sentence(name)} should be ${max} characters long.`;\n }\n if (min && max === Infinity) {\n return `${sentence(name)} must be greater than or equal to ${min} characters.`;\n }\n return `${sentence(name)} must be between ${min} and ${max} characters.`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)} is not an allowed value.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Cannot have more than ${args[0]} ${name}.`;\n }\n return `${sentence(name)} must be no more than ${args[0]}.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"No file formats allowed.\";\n }\n return `${sentence(name)} must be of the type: ${args[0]}`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Cannot have fewer than ${args[0]} ${name}.`;\n }\n return `${sentence(name)} must be at least ${args[0]}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `“${value}” is not an allowed ${name}.`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)} must be a number.`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\" or \")} is required.`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `${sentence(name)} is required.`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)} doesn’t start with ${list(args)}.`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `Please enter a valid URL.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"The selected date is invalid.\"\n};\nvar en = { ui: ui10, validation: validation10 };\nvar ui11 = {\n /**\n * Shown on buttons for adding new items.\n */\n add: \"Añadir\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"Quitar\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"Quitar todos\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"Discúlpe, los campos no fueron completados correctamente.\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"Enviar\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"Archivo no seleccionado\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"Moverse hacia arriba\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"Moverse hacia abajo\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"Cargando...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"Cargar más\",\n /**\n * Shown on buttons that navigate state forward\n */\n next: \"Próximo\",\n /**\n * Shown on buttons that navigate state backward\n */\n prev: \"Anterior\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"Añadir todos los valores\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"Añadir valores seleccionados\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"Eliminar todos los valores\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"Eliminar los valores seleccionados\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"Elige fecha\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"Cambiar fecha\",\n /**\n * Shown when there is something to close\n */\n close: \"Cerrar\",\n /**\n * Shown when there is something to open.\n */\n open: \"Abrir\"\n};\nvar validation11 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `Acepte el ${name} por favor.`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} debe ser posterior a ${date(args[0])}.`;\n }\n return `${sentence(name)} debe ser una fecha futura.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(name)} debe contener solo caractéres alfabéticos.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)} debe ser alfanumérico.`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)} espacios alfa solo pueden contener letras y espacios.`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `${sentence(name)} debe contener caracteres alfabéticos.`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `${sentence(name)} debe contener letras o números.`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `${sentence(name)} debe contener letras o espacios.`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `${sentence(name)} debe contener un símbolo.`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `${sentence(name)} debe estar en mayúsculas.`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `${sentence(name)} debe contener minúsculas.`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `${sentence(name)} debe contener números.`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `${sentence(name)} debe ser un símbolo.`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `${sentence(name)} solo puede contener letras mayúsculas.`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `${sentence(name)} solo puede contener letras minúsculas.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} debe ser anterior a ${date(args[0])}.`;\n }\n return `${sentence(name)} debe ser una fecha pasada.`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `El campo no fue completado correctamente y no puede ser enviado.`;\n }\n const [a, b] = order(args[0], args[1]);\n return `${sentence(name)} debe estar entre ${a} y ${b}.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} no coincide.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} no es una fecha válida, por favor utilice el formato ${args[0]}`;\n }\n return \"El campo no fue completado correctamente y no puede ser enviado.\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)} debe estar entre ${date(args[0])} y ${date(args[1])}`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"Ingrese una dirección de correo electrónico válida por favor.\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)} no termina con ${list(args)}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)} no es un valor permitido.`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)} debe tener al menos una letra.`;\n }\n if (min == 0 && max) {\n return `${sentence(name)} debe tener como máximo ${max} caractéres.`;\n }\n if (min === max) {\n return `${sentence(name)} debe tener ${max} caracteres.`;\n }\n if (min && max === Infinity) {\n return `${sentence(name)} debe tener como mínimo ${min} caractéres.`;\n }\n return `${sentence(name)} debe tener entre ${min} y ${max} caractéres.`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)} no es un valor permitido.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `No puede tener más de ${args[0]} ${name}.`;\n }\n return `${sentence(name)} debe ser menor o igual a ${args[0]}.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"No existen formatos de archivos permitidos.\";\n }\n return `${sentence(name)} debe ser del tipo: ${args[0]}`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `No puede tener menos de ${args[0]} ${name}.`;\n }\n return `${sentence(name)} debe ser de al menos ${args[0]}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `“${value}” no es un valor permitido de ${name}.`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)} debe ser un número.`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\" o \")} se requiere estar.`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `${sentence(name)} es requerido.`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)} debe comenzar con ${list(args)}.`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `Introduce una URL válida.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"La fecha seleccionada no es válida.\"\n};\nvar es = { ui: ui11, validation: validation11 };\nvar ui12 = {\n /**\n * Shown on buttons for adding new items.\n */\n add: \"افزودن\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"حذف\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"همه را حذف کنید\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"همه فیلدها به‌درستی پر نشده‌اند\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"ثبت\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"هیچ فایلی انتخاب نشده است\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"حرکت به بالا\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"حرکت به پایین\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"در حال بارگذاری...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"بارگذاری بیشتر\",\n /**\n * Shown on buttons that navigate state forward\n */\n next: \"بعدی\",\n /**\n * Shown on buttons that navigate state backward\n */\n prev: \"قبلی\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"تمام مقادیر را اضافه کنید\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"مقادیر انتخاب شده را اضافه کنید\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"تمام مقادیر را حذف کنید\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"حذف مقادیر انتخاب شده\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"تاریخ را انتخاب کنید\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"تغییر تاریخ\",\n /**\n * Shown when there is something to close\n */\n close: \"بستن\",\n /**\n * Shown when there is something to open.\n */\n open: \"باز کردن\"\n};\nvar validation12 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `لطفاً ${name} را بپذیرید.`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} باید بعد از تاریخ ${date(args[0])} باشد.`;\n }\n return `${sentence(name)} باید مربوط به آینده باشد.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(name)} فقط میتواند شامل حروف الفبا باشد.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)} فقط میتواند شامل حروف و اعداد باشد.`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)} فقط می تواند شامل حروف و فاصله باشد.`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `${sentence(name)} باید حاوی حروف الفبا باشد.`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `${sentence(name)} باید حاوی حروف یا اعداد باشد.`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `${sentence(name)} باید حاوی حروف یا فاصله باشد.`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `${sentence(name)} باید حاوی نماد باشد.`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `${sentence(name)} باید دارای حروف بزرگ باشد.`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `${sentence(name)} باید حاوی حروف کوچک باشد.`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `${sentence(name)} باید حاوی اعداد باشد.`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `${sentence(name)} باید یک نماد باشد.`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `${sentence(name)} تنها می‌تواند شامل حروف بزرگ باشد.`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `${sentence(name)} تنها می‌تواند شامل حروف کوچک باشد.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} باید قبل از تاریخ ${date(args[0])} باشد.`;\n }\n return `${sentence(name)} باید مربوط به گذشته باشد.`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `این فیلد به اشتباه پیکربندی شده است و قابل ارسال نیست`;\n }\n return `${sentence(name)} باید بین ${args[0]} و ${args[1]} باشد.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} مطابقت ندارد.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} تاریخ معتبری نیست، لطفاً از قالب ${args[0]} استفاده کنید\n`;\n }\n return \"این فیلد به اشتباه پیکربندی شده است و قابل ارسال نیست\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)} باید بین ${date(args[0])} و ${date(args[1])} باشد.`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"لطفا آدرس ایمیل معتبر وارد کنید.\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)} باید به ${list(args)} ختم شود.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)} مجاز نیست.`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = first <= second ? first : second;\n const max = second >= first ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)} باید حداقل یک کاراکتر باشد.`;\n }\n if (min == 0 && max) {\n return `${sentence(name)} باید کمتر یا برابر با ${max} کاراکتر باشد.`;\n }\n if (min === max) {\n return `${sentence(name)} باید ${max} کاراکتر طولانی باشد.`;\n }\n if (min && max === Infinity) {\n return `${sentence(name)} باید بزرگتر یا برابر با ${min} کاراکتر باشد.`;\n }\n return `${sentence(name)} باید بین ${min} و ${max} کاراکتر باشد.`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)} مجاز نیست.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `${name} نمی تواند بیش از ${args[0]} باشد.`;\n }\n return `${sentence(name)} باید کمتر یا برابر با ${args[0]} باشد.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"فرمت فایل مجاز نیست.\";\n }\n return `${sentence(name)} باید از این نوع باشد: ${args[0]}`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `${name} نمی تواند کمتر از ${args[0]} باشد.\n`;\n }\n return `${sentence(name)} باید حداقل ${args[0]} باشد.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `\"${value}\" یک ${name} مجاز نیست.`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)} باید عدد باشد.`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\" یا \")} مورد نیاز است.`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `پر کردن ${sentence(name)} اجباری است.`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)} باید با ${list(args)} شروع شود.`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `لطفا یک URL معتبر وارد کنید.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"تاریخ انتخاب شده نامعتبر است\"\n};\nvar fa = { ui: ui12, validation: validation12 };\nvar ui13 = {\n /**\n * Shown on buttons for adding new items.\n */\n add: \"Lisää\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"Poista\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"Poista kaikki\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"Kaikkia kenttiä ei ole täytetty oikein.\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"Tallenna\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"Ei valittuja tiedostoja\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"Siirrä ylös\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"Siirrä alas\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"Ladataan...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"Lataa lisää\",\n /**\n * Shown on buttons that navigate state forward\n */\n next: \"Seuraava\",\n /**\n * Shown on buttons that navigate state backward\n */\n prev: \"Edellinen\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"Lisää kaikki arvot\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"Lisää valitut arvot\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"Poista kaikki arvot\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"Poista valitut arvot\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"Valitse päivämäärä\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"Vaihda päivämäärä\",\n /**\n * Shown when there is something to close\n */\n close: \"Sulje\",\n /**\n * Shown when there is something to open.\n */\n open: \"Avoinna\"\n};\nvar validation13 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `Ole hyvä ja hyväksy ${name}`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} tulee olla ${date(args[0])} jälkeen.`;\n }\n return `${sentence(name)} on oltava tulevaisuudessa.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(name)} saa sisältää vain kirjaimia.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)} saa sisältää vain kirjaimia ja numeroita.`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)} voivat sisältää vain kirjaimia ja välilyöntejä.`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `${sentence(name)} on sisällettävä aakkoselliset merkit.`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `${sentence(name)} täytyy sisältää kirjaimia tai numeroita.`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `${sentence(name)} täytyy sisältää kirjaimia tai välilyöntejä.`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `${sentence(name)} täytyy sisältää symboli.`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `${sentence(name)} täytyy sisältää isoja kirjaimia.`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `${sentence(name)} täytyy sisältää pieniä kirjaimia.`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `${sentence(name)} täytyy sisältää numeroita.`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `${sentence(name)} on oltava symboli.`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `${sentence(name)} voi sisältää vain isoja kirjaimia.`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `${sentence(name)} voi sisältää vain pieniä kirjaimia.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} tulee olla ennen: ${date(args[0])}.`;\n }\n return `${sentence(name)} on oltava menneisyydessä.`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `Tämä kenttä on täytetty virheellisesti joten sitä ei voitu lähettää.`;\n }\n const [a, b] = order(args[0], args[1]);\n return `${sentence(name)} on oltava välillä ${a} - ${b} `;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} ei täsmää.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(\n name\n )} ei ole validi päivämäärä, ole hyvä ja syötä muodossa: ${args[0]}`;\n }\n return \"Tämä kenttä on täytetty virheellisesti joten sitä ei voitu lähettää.\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)} on oltava välillä ${date(args[0])} - ${date(args[1])}`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"Syötä validi sähköpostiosoite.\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)} tulee päättyä ${list(args)}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)} ei ole sallittu vaihtoehto.`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)} on oltava vähintään yksi merkki.`;\n }\n if (min == 0 && max) {\n return `${sentence(name)} on oltava ${max} tai alle merkkiä.`;\n }\n if (min === max) {\n return `${sentence(name)} pitäisi olla ${max} merkkiä pitkä.`;\n }\n if (min && max === Infinity) {\n return `${sentence(name)} on oltava vähintään ${min} merkkiä.`;\n }\n return `${sentence(name)} on oltava vähintään ${min}, enintään ${max} merkkiä.`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)} ei ole sallittu arvo.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Valitse enintään ${args[0]} ${name} vaihtoehtoa.`;\n }\n return `${sentence(name)} on oltava ${args[0]} tai alle.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"Tiedostoja ei sallita.\";\n }\n return `${sentence(name)} tulee olla ${args[0]}-tiedostotyyppiä.`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Valitse vähintään ${args[0]} ${name} vaihtoehtoa.`;\n }\n return `${sentence(name)} tulee olla ${args[0]} tai suurempi.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `“${value}” ei ole sallittu ${name}.`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `Kentän ${sentence(name)} tulee olla numero.`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\" tai \")} vaaditaan.`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `${sentence(name)} vaaditaan.`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)} on alettava ${list(args)}.`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `Anna kelvollinen URL-osoite.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"Valittu päivämäärä on virheellinen.\"\n};\nvar fi = { ui: ui13, validation: validation13 };\nvar ui14 = {\n /**\n * Shown on buttons for adding new items.\n */\n add: \"Ajouter\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"Supprimer\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"Enlever tout\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"Désolé, tous les champs ne sont pas remplis correctement.\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"Valider\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"Aucun fichier choisi\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"Déplacez-vous\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"Déplacez-vous\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"Chargement...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"Chargez plus\",\n /**\n * Shown on buttons that navigate state forward\n */\n next: \"Suivant\",\n /**\n * Shown on buttons that navigate state backward\n */\n prev: \"Précédent\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"Ajouter toutes les valeurs\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"Ajouter les valeurs sélectionnées\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"Supprimer toutes les valeurs\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"Supprimer les valeurs sélectionnées\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"Choisissez la date\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"Modifier la date\",\n /**\n * Shown when there is something to close\n */\n close: \"Fermer\",\n /**\n * Shown when there is something to open.\n */\n open: \"Ouvrir\"\n};\nvar validation14 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `Veuillez accepter le ${name}.`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} doit être postérieure au ${date(args[0])}.`;\n }\n return `${sentence(name)} doit être dans le futur.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(name)} ne peut contenir que des caractères alphabétiques.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)} ne peut contenir que des lettres et des chiffres.`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)} ne peuvent contenir que des lettres et des espaces.`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `${sentence(name)} doit contenir des caractères alphabétiques.`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `${sentence(name)} doit contenir au moins un lettre ou nombre.`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `${sentence(name)} doit contenir des lettres ou des espaces.`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `${sentence(name)} doit contenir un symbole.`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `${sentence(name)} doit contenir au moins une majuscule.`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `${sentence(name)} doit contenir au moins une minuscule.`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `${sentence(name)} doit contenir des chiffres.`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `${sentence(name)} doit être un symbole.`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `${sentence(name)} ne peuvent contenir que des majuscules.`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `${sentence(name)} ne peut contenir que des lettres minuscules.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} doit être antérieure au ${date(args[0])}.`;\n }\n return `${sentence(name)} doit être dans le passé.`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `Ce champ a été configuré de manière incorrecte et ne peut pas être soumis.`;\n }\n const [a, b] = order(args[0], args[1]);\n return `${sentence(name)} doit être comprise entre ${a} et ${b}.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} ne correspond pas.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(\n name\n )} n'est pas une date valide, veuillez utiliser le format ${args[0]}`;\n }\n return \"Ce champ a été configuré de manière incorrecte et ne peut pas être soumis.\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)} doit être comprise entre ${date(args[0])} et ${date(\n args[1]\n )}`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"Veuillez saisir une adresse email valide.\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)} ne se termine pas par ${list(args)}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)} n'est pas une valeur autorisée.`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)} doit comporter au moins un caractère.`;\n }\n if (min == 0 && max) {\n return `${sentence(name)} doit être inférieur ou égal à ${max} caractères.`;\n }\n if (min === max) {\n return `${sentence(name)} doit contenir ${max} caractères.`;\n }\n if (min && max === Infinity) {\n return `${sentence(name)} doit être supérieur ou égal à ${min} caractères.`;\n }\n return `${sentence(name)} doit être comprise entre ${min} et ${max} caractères.`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)} n'est pas une valeur autorisée.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Ne peut pas avoir plus de ${args[0]} ${name}.`;\n }\n return `${sentence(name)} doit être inférieur ou égal à ${args[0]}.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"Aucun format de fichier n’est autorisé\";\n }\n return `${sentence(name)} doit être du type: ${args[0]}`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Ne peut pas avoir moins de ${args[0]} ${name}.`;\n }\n return `${sentence(name)} doit être au moins de ${args[0]}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `“${value}” n'est pas un ${name} autorisé.`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)} doit être un nombre.`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\" ou \")} est requis.`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `${sentence(name)} est requis.`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)} ne commence pas par ${list(args)}.`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `Entrez une URL valide.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: `La date sélectionnée n'est pas valide.`\n};\nvar fr = { ui: ui14, validation: validation14 };\nvar ui15 = {\n /**\n * Shown on a button for adding additional items.\n */\n add: \"Foeg ta\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"Ferwider\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"Ferwider alles\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"Sorry, net alle fjilden binne korrekt ynfolle.\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"Ferstjoere\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"Gjin bestân keazen\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"Gean omheech\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"Nei ûnderen\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"Lade…\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"Mear lade\",\n /**\n * Show on buttons that navigate state forward\n */\n next: \"Folgende\",\n /**\n * Show on buttons that navigate state backward\n */\n prev: \"Foarige\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"Foegje alle wearden ta\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"Foegje selektearre wearden ta\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"Fuortsmite alle wearden\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"Fuortsmite selektearre wearden\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"Kies datum\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"Feroarje datum\"\n};\nvar validation15 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `Akseptearje de ${name}.`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} moat nei ${date(args[0])} wêze.`;\n }\n return `${sentence(name)} moat yn de takomst lizze.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(name)} mei allinne alfabetyske tekens befetsje.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)} mei allinne letters en sifers befetsje.`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)} mei allinne letters en spaasjes befetsje.`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `${sentence(name)} must contain alphabetical characters.`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `${sentence(name)} must contain letters and numbers.`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `${sentence(name)} must contain letters and spaces.`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `${sentence(name)} must contain symbol.`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `${sentence(name)} must contain uppercase.`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `${sentence(name)} must contain lowercase.`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `${sentence(name)} must contain number.`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `${sentence(name)} can only contain symbol.`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `${sentence(name)} can only contain uppercase.`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `${sentence(name)} can only contain lowercase.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} moat foar ${date(args[0])} falle.`;\n }\n return `${sentence(name)} moat yn it ferline wêze.`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `Dit fjild is ferkeard konfigurearre en kin net ferstjoerd wurde.`;\n }\n const [a, b] = order(args[0], args[1]);\n return `${sentence(name)} moat tusken ${a} en ${b} lizze.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} komt net oerien.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} is gjin jildige datum, brûk de notaasje ${args[0]}`;\n }\n return \"Dit fjild is ferkeard konfigurearre en kin net ferstjoerd wurde\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)} moat tusken ${date(args[0])} en ${date(args[1])} lizze`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"Folje in jildich e-mailadres yn.\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)} einiget net mei ${list(args)}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)} is gjin tastiene wearde.`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)} moat minimaal ien teken wêze.`;\n }\n if (min == 0 && max) {\n return `${sentence(name)} moat lytser wêze as of gelyk wêze oan ${max} tekens.`;\n }\n if (min === max) {\n return `${sentence(name)} moat ${max} tekens lang wêze.`;\n }\n if (min && max === Infinity) {\n return `${sentence(name)} moat grutter wêze as of gelyk wêze oan ${min} tekens.`;\n }\n return `${sentence(name)} moat tusken de ${min} en ${max} tekens befetsje.`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)} is gjin tastiene wearde.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Mei net mear as ${args[0]} ${name} hawwe.`;\n }\n return `${sentence(name)} moat lytser wêze as of gelyk wêze oan ${args[0]}.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"Gjin bestânsnotaasjes tastien.\";\n }\n return `${sentence(name)} moat fan it type: ${args[0]} wêze`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Mei net minder as ${args[0]} ${name} hawwe.`;\n }\n return `${sentence(name)} moat minimaal ${args[0]} wêze.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `\"${value}\" is gjin tastiene ${name}.`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)} moat in getal wêze.`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\" of \")} is ferplichte.`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `${sentence(name)} is ferplicht.`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)} begjint net mei ${list(args)}.`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `Doch der in jildige url by.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"De selektearre datum is ûnjildich.\"\n};\nvar fy = { ui: ui15, validation: validation15 };\nvar ui16 = {\n /**\n * Shown on a button for adding additional items.\n */\n add: \"הוסף\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"מחק\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"מחק הכל\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"שים לב, לא כל השדות מלאים כראוי.\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"שלח\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"לא נבחר קובץ..\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"הזז למעלה\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"הזז למטה\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"טוען...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"טען יותר\",\n /**\n * Shown on buttons that navigate state forward\n */\n next: \"הבא\",\n /**\n * Shown on buttons that navigate state backward\n */\n prev: \"הקודם\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"הוסף את כל הערכים\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"הוספת ערכים נבחרים\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"הסר את כל הערכים\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"הסר ערכים נבחרים\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"בחר תאריך\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"שינוי תאריך\",\n /**\n * Shown when there is something to close\n */\n close: \"סגור\",\n /**\n * Shown when there is something to open.\n */\n open: \"פתוח\"\n};\nvar validation16 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `אנא אשר את ${name}.`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} חייב להיות אחרי ${date(args[0])}.`;\n }\n return `${sentence(name)} חייב להיות בעתיד.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(name)} חייב להכיל אותיות אלפבת.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)} יכול להכיל רק מספרים ואותיות.`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)} יכול להכיל רק אותיות ורווחים.`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `${sentence(name)} חייב להכיל תווים אלפביתיים.`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `${sentence(name)} חייב להכיל אותיות או מספרים.`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `${sentence(name)} חייב להכיל אותיות או רווחים.`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `${sentence(name)} חייב להכיל סמל.`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `${sentence(name)} חייב להכיל אותיות רישיות.`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `${sentence(name)} חייב להכיל אותיות קטנות.`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `${sentence(name)} חייב להכיל מספרים.`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `${sentence(name)} חייב להיות סמל.`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `${sentence(name)} יכול להכיל אותיות רישיות בלבד.`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `${sentence(name)} יכול להכיל רק אותיות קטנות.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} חייב להיות לפני ${date(args[0])}.`;\n }\n return `${sentence(name)} חייב להיות בעבר`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `שדה זה לא הוגדר כראוי ולא יכול להישלח.`;\n }\n const [a, b] = order(args[0], args[1]);\n return `${sentence(name)} חייב להיות בין ${a} ו- ${b}.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} לא מתאים.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} הוא לא תאריך תקין, אנא השתמש בפורמט ${args[0]}`;\n }\n return \"שדה זה לא הוגדר כראוי ולא יכול להישלח.\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)} חייב להיות בין ${date(args[0])} ו- ${date(args[1])}`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"אנא הקלד אימייל תקין.\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)} לא מסתיים ב- ${list(args)}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)} הוא לא ערך מורשה.`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)} חייב להיות לפחות תו אחד.`;\n }\n if (min == 0 && max) {\n return `${sentence(name)} חייב להיות פחות או שווה ל- ${max} תווים.`;\n }\n if (min === max) {\n return `${sentence(name)} צריך להיות ${max} תווים ארוכים.`;\n }\n if (min && max === Infinity) {\n return `${sentence(name)} חייב להיות גדול או שווה ל- ${min} תווים.`;\n }\n return `${sentence(name)} חייב להיות בין ${min} ו- ${max} תווים.`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)} הוא לא ערך תקין.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `${name} לא יכול להיות עם יותר מ- ${args[0]}.`;\n }\n return `${sentence(name)} חייב להיות פחות או שווה ל- ${args[0]}.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"פורמט הקובץ לא מורשה.\";\n }\n return `${sentence(name)} חייב להיות מסוג: ${args[0]}`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `${name} לא יכול להיות עם פחות מ- ${args[0]}.`;\n }\n return `${sentence(name)} חייב להיות לפחות ${args[0]}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `“${value}” לא מתאים ל- ${name}.`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)} חייב להיות מספר.`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\" או \")} נדרש.`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `${sentence(name)} הינו חובה.`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)} לא מתחיל ב- ${list(args)}.`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `הזן כתובת URL חוקית.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"התאריך שנבחר אינו חוקי.\"\n};\nvar he = { ui: ui16, validation: validation16 };\nvar ui17 = {\n /**\n * Shown on buttons for adding new items.\n */\n add: \"Dodaj\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"Ukloni\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"Pojedina polja nisu ispravno ispunjena.\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"Predaj\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"Pomaknite se gore\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"Pomakni se dolje\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"Učitavanje...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"Učitaj više\",\n /**\n * Shown on buttons that navigate state forward\n */\n next: \"Sljedeći\",\n /**\n * Shown on buttons that navigate state backward\n */\n prev: \"prijašnji\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"Dodajte sve vrijednosti\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"Dodavanje odabranih vrijednosti\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"Ukloni sve vrijednosti\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"Ukloni odabrane vrijednosti\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"Odaberite datum\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"Promijeni datum\",\n /**\n * Shown when there is something to close\n */\n close: \"Zatvoriti\",\n /**\n * Shown when there is something to open.\n */\n open: \"Otvori\"\n};\nvar validation17 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `Potrebno je potvrditi ${name}.`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} mora biti u periodu poslije ${date(args[0])}.`;\n }\n return `${sentence(name)} mora biti u budućnosti.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(name)} mora sadržavati samo slova.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)} mora sadržavati slova i brojeve.`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)} mogu sadržavati samo slova i razmake..`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `${sentence(name)} mora sadržavati abecedne znakove.`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `${sentence(name)} mora sadržavati slova ili brojeve.`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `${sentence(name)} mora sadržavati slova ili razmake.`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `${sentence(name)} mora sadržavati simbol.`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `${sentence(name)} mora sadržavati velika slova.`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `${sentence(name)} mora sadržavati mala slova.`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `${sentence(name)} mora sadržavati brojeve.`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `${sentence(name)} mora biti simbol.`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `${sentence(name)} može sadržavati samo velika slova.`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `${sentence(name)} može sadržavati samo mala slova.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} mora biti prije ${date(args[0])}.`;\n }\n return `${sentence(name)} mora biti u prošlosti.`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `Format sadržaja nije ispravan i ne može biti predan.`;\n }\n return `${sentence(name)} mora biti između ${args[0]} i ${args[1]}.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} ne odgovara zadanoj vrijednosti.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(\n name\n )} nije ispravan format datuma. Molimo koristite sljedeći format: ${args[0]}`;\n }\n return \"Ovo polje nije ispravno postavljeno i ne može biti predano.\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)} mora biti vrijednost između ${date(args[0])} i ${date(\n args[1]\n )}`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"Molimo upišite ispravnu email adresu.\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)} ne završava s ${list(args)}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)} nije dopuštena vrijednost.`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = first <= second ? first : second;\n const max = second >= first ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)} mora sadržavati barem jedan znak.`;\n }\n if (min == 0 && max) {\n return `${sentence(name)} mora imati ${max} ili manje znakova.`;\n }\n if (min === max) {\n return `${sentence(name)} trebao bi biti dugačak ${max} znakova.`;\n }\n if (min && max === Infinity) {\n return `${sentence(name)} mora imati barem ${min} znakova.`;\n }\n return `Broj znakova za polje ${sentence(name)} mora biti između ${min} i ${max}.`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)} nije dozvoljena vrijednost.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Ne smije imati više od ${args[0]} ${name} polja.`;\n }\n return `${sentence(name)} mora imati vrijednost manju ili jednaku ${args[0]}.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"Format datoteke nije dozvoljen.\";\n }\n return `Format datoteke na polju ${sentence(name)} mora odgovarati: ${args[0]}`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Broj upisanih vrijednosti na polju ${name} mora biti barem ${args[0]}.`;\n }\n return `${sentence(name)} mora biti barem ${args[0]}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `“${value}” nije dozvoljena vrijednost na polju ${name}.`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)} mora biti broj.`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\" ili \")} je potreban.`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `${sentence(name)} je obavezno.`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)} ne počinje s ${list(args)}.`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `Unesite valjanu URL adresu.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"Odabrani datum je nevažeći.\"\n};\nvar hr = { ui: ui17, validation: validation17 };\nvar ui18 = {\n /**\n * Shown on a button for adding additional items.\n */\n add: \"Hozzáadás\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"Eltávolítás\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"Összes eltávolítása\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"Sajnáljuk, nem minden mező lett helyesen kitöltve.\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"Beküldés\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"Nincs fájl kiválasztva\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"Mozgás felfelé\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"Mozgás lefelé\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"Betöltés...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"Töltsön be többet\",\n /**\n * Shown on buttons that navigate state forward\n */\n next: \"Következő\",\n /**\n * Shown on buttons that navigate state backward\n */\n prev: \"Előző\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"Adja hozzá az összes értéket\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"Kiválasztott értékek hozzáadása\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"Távolítsa el az összes értéket\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"A kiválasztott értékek eltávolítása\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"Válassza ki a dátumot\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"Dátum módosítása\",\n /**\n * Shown when there is something to close\n */\n close: \"Bezárás\",\n /**\n * Shown when there is something to open.\n */\n open: \"Nyitott\"\n};\nvar validation18 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `Fogadja el a ${name} mezőt.`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} mezőnek ${date(args[0])} után kell lennie.`;\n }\n return `${sentence(name)} mezőnek a jövőben kell lennie.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(name)} csak alfanumerikus karaktereket tartalmazhat.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)} csak betűket és számokat tartalmazhat.`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)} csak betűket és szóközöket tartalmazhat.`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `A ${sentence(name)} betűrendes karaktereket kell tartalmaznia.`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `A ${sentence(name)} betűket vagy számokat kell tartalmaznia.`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `A ${sentence(name)} betűket vagy szóközöket kell tartalmaznia.`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `A ${sentence(name)} szimbólumot kell tartalmaznia.`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `A ${sentence(name)} nagybetűt kell tartalmaznia.`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `A ${sentence(name)} kisbetűt kell tartalmaznia.`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `A ${sentence(name)} számot kell tartalmaznia.`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `A ${sentence(name)} szimbólumnak kell lennie.`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `A ${sentence(name)} csak nagybetűket tartalmazhat.`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `A ${sentence(name)} csak kisbetűket tartalmazhat.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} mezőnek ${date(args[0])} előtt kell lennie.`;\n }\n return `${sentence(name)} mezőnek a múltban kell lennie.`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `Ez a mező hibásan lett konfigurálva, így nem lehet beküldeni.`;\n }\n const [a, b] = order(args[0], args[1]);\n return `A ${sentence(name)} mezőnek ${a} és ${b} között kell lennie.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} nem egyezik.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} nem érvényes dátum, ${args[0]} formátumot használj`;\n }\n return \"Ez a mező hibásan lett konfigurálva, így nem lehet beküldeni.\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)} mezőnek ${date(args[0])} és ${args[1]} között kell lennie`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"Kérjük, érvényes email címet adjon meg.\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)} mező nem a kijelölt (${list(args)}) módon ér véget.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)} nem engedélyezett érték.`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)} mezőnek legalább egy karakteresnek kell lennie.`;\n }\n if (min == 0 && max) {\n return `${sentence(name)} mezőnek maximum ${max} karakteresnek kell lennie.`;\n }\n if (min === max) {\n return `${sentence(name)} ${max} karakter hosszúnak kell lennie.`;\n }\n if (min && max === Infinity) {\n return `${sentence(name)} mezőnek minimum ${min} karakteresnek kell lennie.`;\n }\n return `${sentence(name)} mezőnek ${min} és ${max} karakter között kell lennie.`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)} nem engedélyezett érték.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Nem lehet több mint ${args[0]} ${name}.`;\n }\n return `${sentence(name)} nem lehet nagyobb, mint ${args[0]}.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"Nincsenek támogatott fájlformátumok.\";\n }\n return `${sentence(name)}-nak/nek a következőnek kell lennie: ${args[0]}`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Nem lehet kevesebb, mint ${args[0]} ${name}.`;\n }\n return `${sentence(name)}-nak/nek minimum ${args[0]}-nak/nek kell lennie.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `\"${value}\" nem engedélyezett ${name}.`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)} mezőnek számnak kell lennie.`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\" vagy \")} szükséges.`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `${sentence(name)} mező kötelező.`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)} nem a következővel kezdődik: ${list(args)}.`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `Kérjük, adjon meg egy érvényes URL-t.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"A kiválasztott dátum érvénytelen.\"\n};\nvar hu = { ui: ui18, validation: validation18 };\nvar ui19 = {\n /**\n * Shown on buttons for adding new items.\n */\n add: \"Tambah\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"Hapus\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"Hapus semua\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"Maaf, tidak semua bidang formulir terisi dengan benar\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"Kirim\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"Tidak ada file yang dipilih\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"Pindah ke atas\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"Pindah ke bawah\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"Memuat...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"Muat lebih\",\n /**\n * Shown on buttons that navigate state forward\n */\n next: \"Berikutnya\",\n /**\n * Shown on buttons that navigate state backward\n */\n prev: \"Sebelumnya\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"Tambahkan semua nilai\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"Tambahkan nilai yang dipilih\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"Hapus semua nilai\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"Hapus nilai yang dipilih\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"Pilih tanggal\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"Ubah tanggal\",\n /**\n * Shown when there is something to close\n */\n close: \"Tutup\",\n /**\n * Shown when there is something to open.\n */\n open: \"Buka\"\n};\nvar validation19 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `Tolong terima kolom ${name}.`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} nilainya harus lebih dari waktu ${date(args[0])}.`;\n }\n return `${sentence(name)} harus berisi waktu di masa depan.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(name)} hanya bisa diisi huruf alfabet.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)} hanya bisa diisi huruf dan angka.`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)} hanya boleh berisi huruf dan spasi..`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `${sentence(name)} harus berisi karakter abjad.`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `${sentence(name)} harus mengandung huruf atau angka.`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `${sentence(name)} harus berisi huruf atau spasi.`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `${sentence(name)} harus berisi simbol.`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `${sentence(name)} harus berisi huruf besar.`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `${sentence(name)} harus berisi huruf kecil.`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `${sentence(name)} harus berisi angka.`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `${sentence(name)} harus berupa simbol.`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `${sentence(name)} hanya dapat berisi huruf besar.`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `${sentence(name)} hanya dapat berisi huruf kecil.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} nilainya harus kurang dari waktu ${date(args[0])}.`;\n }\n return `${sentence(name)} harus berisi waktu yang sudah lampau.`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `Kolom ini tidak diisi dengan benar sehingga tidak bisa dikirim`;\n }\n const [a, b] = order(args[0], args[1]);\n return `${sentence(name)} harus bernilai diantara ${a} dan ${b}.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} nilainya tidak cocok.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} waktu tidak cocok, mohon gunakan format waktu ${args[0]}`;\n }\n return \"Kolom ini tidak diisi dengan benar sehingga tidak bisa dikirim\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)} harus diantara waktu ${date(args[0])} dan waktu ${date(\n args[1]\n )}`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"Tolong tulis alamat email yang benar.\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)} nilainya tidak berakhiran dengan ${list(args)}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)} adalah nilai yang tidak diizinkan.`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)} nilainya setidaknya berisi satu karakter.`;\n }\n if (min == 0 && max) {\n return `${sentence(\n name\n )} jumlah karakternya harus kurang dari atau sama dengan ${max} karakter.`;\n }\n if (min === max) {\n return `${sentence(name)} harus ${max} karakter panjang.`;\n }\n if (min && max === Infinity) {\n return `${sentence(\n name\n )} jumlah karakternya harus lebih dari atau sama dengan ${min} karakter.`;\n }\n return `${sentence(\n name\n )} jumlah karakternya hanya bisa antara ${min} dan ${max} karakter.`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)} nilainya tidak diizinkan.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Tidak bisa memiliki lebih dari ${args[0]} ${name}.`;\n }\n return `${sentence(name)} harus lebih kecil atau sama dengan ${args[0]}.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"Format file tidak diizinkan\";\n }\n return `${sentence(name)} hanya bisa bertipe: ${args[0]}`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Tidak boleh kurang dari ${args[0]} ${name}.`;\n }\n return `${sentence(name)} setidaknya harus berisi ${args[0]}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `“${value}” adalah nilai yang tidak diperbolehkan untuk ${name}.`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)} harus berupa angka.`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\" atau \")} diperlukan`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `${sentence(name)} harus diisi.`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)} tidak dimulai dengan ${list(args)}.`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `Harap masukkan URL yang valid.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"Tanggal yang dipilih tidak valid.\"\n};\nvar id = { ui: ui19, validation: validation19 };\nvar ui20 = {\n /**\n * Shown on a button for adding additional items.\n */\n add: \"Bæta við\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"Fjarlægja\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"Fjarlægja allt\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"Því miður, það er ekki búið að fylla rétt inn í alla reiti.\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"Senda\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"Engin skrá valin\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"Færa upp\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"Færa niður\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"Hleðsla...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"Sækja meira\",\n /**\n * Show on buttons that navigate state forward\n */\n next: \"Áfram\",\n /**\n * Show on buttons that navigate state backward\n */\n prev: \"Til baka\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"Bæta við öllum gildum\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"Bæta við völdum gildum\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"Fjarlægja öll gildi\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"Fjarlægja valin gildi\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"Velja dagsetningu\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"Breyta dagsetningu\",\n /**\n * Shown when there is something to close\n */\n close: \"Loka\",\n /**\n * Shown when there is something to open.\n */\n open: \"Opið\"\n};\nvar validation20 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `Vinsamlegast samþykktu ${name}`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} þarf að vera eftir ${date(args[0])}.`;\n }\n return `${sentence(name)} þarf að vera í framtíðinni.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(name)} má einungis innihalda bókstafi.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)} má einungis innihalda bókstafi og tölur.`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)} má einungis innihalda bókstafi og bil.`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `${sentence(name)} verður að innihalda bókstafi.`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `${sentence(name)} verður að innihalda bókstafi eða tölur.`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `${sentence(name)} verður að innihalda bókstafi eða bil.`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `${sentence(name)} verður að innihalda tákn.`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `${sentence(name)} verður að innihalda hástaf.`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `${sentence(name)} verður að innihalda lágstaf.`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `${sentence(name)} verður að innihalda tölur.`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `${sentence(name)} verður að vera tákn.`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `${sentence(name)} má einungis innihalda hástafi.`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `${sentence(name)} má einungis innihalda lágstafi.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} þarf að vera á undan ${date(args[0])}.`;\n }\n return `${sentence(name)} þarf að vera liðin.`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `Þessi reitur var ekki rétt stilltur.`;\n }\n const [a, b] = order(args[0], args[1]);\n return `${sentence(name)} þarf að vera á milli ${a} og ${b}.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} passar ekki.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(\n name\n )} er ekki gild dagsetning, vinsamlegast hafið dagsetninguna í formi ${args[0]}`;\n }\n return \"Þessi reitur var ekki rétt stilltur\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)} þarf að vera á milli ${date(args[0])} og ${date(\n args[1]\n )}`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"Vinsamlegast sláðu inn gilt netfang.\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)} endar ekki á ${list(args)}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)} er ekki leyfilegt gildi.`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)} þarf að vera að minnsta kosti einn stafur.`;\n }\n if (min == 0 && max) {\n return `${sentence(name)} þarf að vera færri en eða nákvæmlega ${max} stafir.`;\n }\n if (min === max) {\n return `${sentence(name)} þarf að vera ${max} stafir að lengd.`;\n }\n if (min && max === Infinity) {\n return `${sentence(name)} þarf að vera fleiri en eða nákvæmlega ${min} stafir.`;\n }\n return `${sentence(name)} þarf að vera á milli ${min} og ${max} stafir.`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)} er ekki leyfilegt gildi.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Ekki hægt að hafa fleiri en ${args[0]} ${name}.`;\n }\n return `${sentence(name)} þarf að vera minna en eða nákvæmlega ${args[0]}.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"Ekki leyfileg tegund skráar.\";\n }\n return `${sentence(name)} þarf að vera af tegundinni: ${args[0]}`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Ekki hægt að hafa færri en ${args[0]} ${name}.`;\n }\n return `Þarf að vera að minnsta kosti ${args[0]} ${name}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `“${value}” er ekki leyfilegt fyrir ${name}.`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)} þarf að vera tala.`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\" or \")} is required.`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `${sentence(name)} er skilyrt.`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)} byrjar ekki á ${list(args)}.`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `Vinsamlegast sláðu inn gilda slóð.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"Valin dagsetning er ógild\"\n};\nvar is = { ui: ui20, validation: validation20 };\nvar ui21 = {\n /**\n * Shown on buttons for adding new items.\n */\n add: \"Inserisci\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"Rimuovi\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"Rimuovi tutti\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"Ci dispiace, non tutti i campi sono compilati correttamente.\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"Invia\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"Nessun file selezionato\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"Sposta in alto\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"Sposta giù\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"Caricamento...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"Carica altro\",\n /**\n * Shown on buttons that navigate state forward\n */\n next: \"Prossimo\",\n /**\n * Shown on buttons that navigate state backward\n */\n prev: \"Precedente\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"Aggiungi tutti i valori\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"Aggiungi valori selezionati\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"Rimuovi tutti i valori\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"Rimuovi i valori selezionati\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"Scegli la data\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"Cambia data\",\n /**\n * Shown when there is something to close\n */\n close: \"Chiudi\",\n /**\n * Shown when there is something to open.\n */\n open: \"Aperta\"\n};\nvar validation21 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `Si prega di accettare ${name}.`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `la data ${sentence(name)} deve essere successiva ${date(args[0])}.`;\n }\n return `la data ${sentence(name)} deve essere nel futuro.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(name)} può contenere solo caratteri alfanumerici.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)} può contenere solo lettere e numeri.`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)} può contenere solo lettere e spazi.`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `${sentence(name)} deve contenere caratteri alfabetici.`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `${sentence(name)} deve contenere lettere o numeri.`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `${sentence(name)} deve contenere lettere o spazi.`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `${sentence(name)} deve contenere un simbolo.`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `${sentence(name)} must contain uppercase.`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `${sentence(name)} deve contenere lettere minuscole.`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `${sentence(name)} deve contenere numeri.`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `${sentence(name)} deve essere un simbolo.`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `${sentence(name)} può contenere solo lettere maiuscole.`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `${sentence(name)} può contenere solo lettere minuscole.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `la data ${sentence(name)} deve essere antecedente ${date(args[0])}.`;\n }\n return `${sentence(name)} deve essere nel passato.`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `Questo campo è stato configurato male e non può essere inviato.`;\n }\n const [a, b] = order(args[0], args[1]);\n return `${sentence(name)} deve essere tra ${a} e ${b}.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} non corrisponde.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} non è una data valida, per favore usa il formato ${args[0]}`;\n }\n return \"Questo campo è stato configurato in modo errato e non può essere inviato.\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)} deve essere tra ${date(args[0])} e ${date(args[1])}`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"Per favore inserire un indirizzo email valido.\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)} non termina con ${list(args)}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)} non è un valore consentito.`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)} deve contenere almeno un carattere.`;\n }\n if (min == 0 && max) {\n return `${sentence(name)} deve essere minore o uguale a ${max} caratteri.`;\n }\n if (min === max) {\n return `${sentence(name)} deve contenere ${max} caratteri.`;\n }\n if (min && max === Infinity) {\n return `${sentence(name)} deve essere maggiore o uguale a ${min} caratteri.`;\n }\n return `${sentence(name)} deve essere tra ${min} e ${max} caratteri.`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)} non è un valore consentito.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Non può avere più di ${args[0]} ${name}.`;\n }\n return `${sentence(name)} deve essere minore o uguale a ${args[0]}.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"Formato file non consentito.\";\n }\n return `${sentence(name)} deve essere di tipo: ${args[0]}`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Non può avere meno di ${args[0]} ${name}.`;\n }\n return `${sentence(name)} deve essere almeno ${args[0]}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `\"${value}\" non è un ${name} consentito.`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)} deve essere un numero.`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\" o \")} è richiesto.`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `${sentence(name)} è richiesto.`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)} non inizia con ${list(args)}.`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `Inserisci un URL valido.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"La data selezionata non è valida.\"\n};\nvar it = { ui: ui21, validation: validation21 };\nvar ui22 = {\n /**\n * Shown on buttons for adding new items.\n */\n add: \"追加\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"削除\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"全て削除\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"項目が正しく入力されていません。\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"送信\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"ファイルが選択されていません\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"上に移動\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"下へ移動\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"読み込み中...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"さらに読み込む\",\n /**\n * Shown on buttons that navigate state forward\n */\n next: \"[次へ]\",\n /**\n * Shown on buttons that navigate state backward\n */\n prev: \"前へ\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"すべての値を追加\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"選択した値を追加\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"すべての値を削除\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"選択した値を削除\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"日付を選択\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"日付を変更\",\n /**\n * Shown when there is something to close\n */\n close: \"閉じる\",\n /**\n * Shown when there is something to open.\n */\n open: \"[開く]\"\n};\nvar validation22 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `${name}の同意が必要です。`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)}は${date(args[0])}より後の日付である必要があります。`;\n }\n return `${sentence(name)}は将来の日付でなければなりません。`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(name)}には英字のみを含めることができます。`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)}には、文字と数字のみを含めることができます。`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)}には、文字とスペースのみを含めることができます。`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `${sentence(name)} にはアルファベット文字が含まれている必要があります。`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `${sentence(name)} には文字または数字を含める必要があります。`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `${sentence(name)} には文字またはスペースを含める必要があります。`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `${sentence(name)} には記号が含まれている必要があります。`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `${sentence(name)} には大文字を含める必要があります。`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `${sentence(name)} には小文字を含める必要があります。`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `${sentence(name)} には数字が含まれている必要があります。`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `${sentence(name)} はシンボルでなければなりません。`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `${sentence(name)} には大文字しか使用できません`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `${sentence(name)} には小文字しか使用できません。`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)}は${date(args[0])}より前の日付である必要があります。`;\n }\n return `${sentence(name)}は過去の日付である必要があります。`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `このフィールドは正しく構成されていないため、送信できません。`;\n }\n const [a, b] = order(args[0], args[1]);\n return `${sentence(name)}は${a}と${b}の間にある必要があります。`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)}が一致しません。`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)}は有効な日付ではありません。${args[0]}の形式を使用してください。`;\n }\n return \"このフィールドは正しく構成されておらず、送信できません。\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)}は${date(args[0])}と${date(\n args[1]\n )}の間にある必要があります。`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"有効なメールアドレスを入力してください。\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)}は${list(args)}で終わっていません。`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)}は許可された値ではありません。`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)}は少なくとも1文字である必要があります。`;\n }\n if (min == 0 && max) {\n return `${sentence(name)}は${max}文字以下である必要があります。`;\n }\n if (min === max) {\n return `${sentence(name)} の長さは ${max} 文字でなければなりません。`;\n }\n if (min && max === Infinity) {\n return `${sentence(name)}は${min}文字以上である必要があります。`;\n }\n return `${sentence(name)}は${min}から${max}文字の間でなければなりません。`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)}は許可された値ではありません。`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `${name}は${args[0]}を超えることはできません。`;\n }\n return `${sentence(name)}は${args[0]}以下である必要があります。`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"ファイル形式は許可されていません。\";\n }\n return `${sentence(name)}は${args[0]}である必要があります。`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `${name}は${args[0]}未満にすることはできません。`;\n }\n return `${sentence(name)}は少なくとも${args[0]}である必要があります。`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `“${value}”は許可された${name}ではありません。`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)}は数値でなければなりません。`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\"または\")}${labels}が必要です。`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `${sentence(name)}は必須です。`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)}は${list(args)}で始まっていません。`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `有効な URL を入力してください。`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"選択した日付は無効です。\"\n};\nvar ja = { ui: ui22, validation: validation22 };\nvar ui23 = {\n /**\n * Shown on a button for adding additional items.\n */\n add: \"қосу\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"Жою\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"Барлығын жою\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"Кешіріңіз, барлық өрістер дұрыс толтырылмаған.\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"Жіберу\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"Ешбір файл таңдалмады\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"Жоғары жылжу\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"Төмен жылжытыңыз\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"Жүктеу...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"Көбірек жүктеңіз\",\n /**\n * Shown on buttons that navigate state forward\n */\n next: \"Келесі\",\n /**\n * Shown on buttons that navigate state backward\n */\n prev: \"Алдыңғы\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"Барлық мәндерді қосыңыз\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"Таңдалған мәндерді қосыңыз\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"Барлық мәндерді алып тастаңыз\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"Таңдалған мәндерді алып тастаңыз\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"Күнді таңдаңыз\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"Өзгерту күні\",\n /**\n * Shown when there is something to close\n */\n close: \"Жабу\",\n /**\n * Shown when there is something to open.\n */\n open: \"Ашық\"\n};\nvar validation23 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `қабылдаңыз ${name}.`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} кейін болуы керек ${date(args[0])}.`;\n }\n return `${sentence(name)} болашақта болуы керек.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(name)} тек алфавиттік таңбаларды қамтуы мүмкін.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)} тек әріптер мен сандардан тұруы мүмкін.`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)} тек әріптер мен бос орындар болуы мүмкін.`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `${sentence(name)} алфавиттік таңбалардан тұруы керек.`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `${sentence(name)} құрамында әріптер немесе сандар болуы керек.`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `${sentence(name)} құрамында әріптер немесе бос орындар болуы керек.`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `${sentence(name)} символы болуы керек.`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `${sentence(name)} құрамында бас әріптер болуы керек.`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `${sentence(name)} кіші әріп болуы керек.`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `${sentence(name)} сандардан тұруы керек.`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `${sentence(name)} символы болуы керек.`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `${sentence(name)} тек бас әріптерден тұруы мүмкін.`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `${sentence(name)} құрамында тек кіші әріптер болуы мүмкін.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} бұрын болуы керек ${date(args[0])}.`;\n }\n return `${sentence(name)} өткенде болуы керек.`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `Бұл өріс қате конфигурацияланған және оны жіберу мүмкін емес.`;\n }\n const [a, b] = order(args[0], args[1]);\n return `${sentence(name)} арасында болуы керек ${a} және ${b}.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} сәйкес келмейді.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} жарамды күн емес, пішімді пайдаланыңыз ${args[0]}`;\n }\n return \"Бұл өріс қате конфигурацияланған және оны жіберу мүмкін емес\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)} арасында болуы керек ${date(args[0])} және ${date(\n args[1]\n )}`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"Өтінеміз қолданыстағы электронды пошта адресін енгізіңіз.\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)} -мен бітпейді ${list(args)}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)} рұқсат етілген мән емес.`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)} кем дегенде бір таңба болуы керек.`;\n }\n if (min == 0 && max) {\n return `${sentence(name)} кем немесе тең болуы керек ${max} кейіпкерлер.`;\n }\n if (min === max) {\n return `${sentence(name)} ${max} таңбалары болуы керек.`;\n }\n if (min && max === Infinity) {\n return `${sentence(name)} артық немесе тең болуы керек ${min} кейіпкерлер.`;\n }\n return `${sentence(name)} арасында болуы керек ${min} және ${max} кейіпкерлер.`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)} рұқсат етілген мән емес.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `артық болуы мүмкін емес ${args[0]} ${name}.`;\n }\n return `${sentence(name)} кем немесе тең болуы керек ${args[0]}.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"Файл пішімдері рұқсат етілмейді.\";\n }\n return `${sentence(name)} типте болуы керек: ${args[0]}`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `кем болуы мүмкін емес ${args[0]} ${name}.`;\n }\n return `${sentence(name)} кем дегенде болуы керек ${args[0]}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `“${value}” рұқсат етілмейді ${name}.`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)} сан болуы керек.`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\" не \")} қажет.`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `${sentence(name)} талап етіледі.`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)} -ден басталмайды ${list(args)}.`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `Жарамды URL мекенжайын енгізіңіз.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"Таңдалған күн жарамсыз.\"\n};\nvar kk = { ui: ui23, validation: validation23 };\nvar ui24 = {\n /**\n * Shown on buttons for adding new items.\n */\n add: \"추가\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"제거\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"모두 제거\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"모든 값을 채워주세요\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"제출하기\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"선택된 파일이 없습니다\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"위로 이동\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"아래로 이동\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"로드 중...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"더 불러오기\",\n /**\n * Shown on buttons that navigate state forward\n */\n next: \"다음\",\n /**\n * Shown on buttons that navigate state backward\n */\n prev: \"이전\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"모든 값 추가\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"선택한 값 추가\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"모든 값 제거\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"선택한 값 제거\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"날짜 선택\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"날짜 변경\",\n /**\n * Shown when there is something to close\n */\n close: \"닫기\",\n /**\n * Shown when there is something to open.\n */\n open: \"열기\"\n};\nvar validation24 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `${name} 올바른 값을 선택 해주세요`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} ${date(args[0])} 이후여야 합니다`;\n }\n return `${sentence(name)} 미래의 날짜여야합니다`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(name)} 알파벳 문자만 포함할 수 있습니다`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)} 문자와 숫자만 포함될 수 있습니다`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)} 문자와 공백만 포함할 수 있습니다.`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `${sentence(name)} 에는 알파벳 문자가 포함되어야 합니다.`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `${sentence(name)} 에는 문자나 숫자가 포함되어야 합니다.`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `${sentence(name)} 에는 문자나 공백이 포함되어야 합니다.`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `${sentence(name)} 에는 기호를 포함해야 합니다.`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `${sentence(name)} 는 대문자를 포함해야 합니다.`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `${sentence(name)} 는 소문자를 포함해야 합니다.`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `${sentence(name)} 에는 숫자가 포함되어야 합니다.`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `${sentence(name)} 는 기호여야 합니다.`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `${sentence(name)} 는 대문자만 포함할 수 있습니다.`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `${sentence(name)} 는 소문자만 포함할 수 있습니다.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} ${date(args[0])} 이전여야 합니다`;\n }\n return `${sentence(name)} 과거의 날짜여야합니다`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `잘못된 구성으로 제출할 수 없습니다`;\n }\n const [a, b] = order(args[0], args[1]);\n return `${sentence(name)} ${a}와 ${b} 사이여야 합니다`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} 일치하지 않습니다`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} 유효한 날짜가 아닙니다. ${args[0]}과 같은 형식을 사용해주세요`;\n }\n return \"잘못된 구성으로 제출할 수 없습니다\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)} ${date(args[0])}에서 ${date(args[1])} 사이여야 합니다`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"올바른 이메일 주소를 입력해주세요\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)} ${list(args)}로 끝나지 않습니다`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)} 허용되는 값이 아닙니다`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)} 하나 이상의 문자여야 합니다`;\n }\n if (min == 0 && max) {\n return `${sentence(name)} ${max}자 이하여야 합니다`;\n }\n if (min === max) {\n return `${sentence(name)} 는 ${max} 자 길이여야 합니다.`;\n }\n if (min && max === Infinity) {\n return `${sentence(name)} ${min} 문자보다 크거나 같아야 합니다`;\n }\n return `${sentence(name)} ${min}에서 ${max}자 사이여야 합니다`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)} 허용되는 값이 아닙니다`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `${args[0]} ${name} 초과할 수 없습니다`;\n }\n return `${sentence(name)} ${args[0]}보다 작거나 같아야 합니다`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"파일 형식이 허용되지 않습니다\";\n }\n return `${sentence(name)} ${args[0]} 유형이어야 합니다`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `${args[0]} ${name}보다 작을 수 없습니다`;\n }\n return `${sentence(name)} ${args[0]} 이상이어야 합니다`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `${value}\" 허용되지 않는 ${name}입니다`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)} 숫자여야 합니다`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\" 또는 \")}가 필요합니다.`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `${sentence(name)} 필수 값입니다`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)} ${list(args)}로 시작하지 않습니다`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `유효한 URL을 입력하십시오.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"선택한 날짜가 잘못되었습니다.\"\n};\nvar ko = { ui: ui24, validation: validation24 };\nfunction getByQuantity(quantity, vienetas, vienetai, vienetu) {\n const lastTwoDigits = quantity.toString().slice(-2);\n const parsedQuantity = parseInt(lastTwoDigits);\n if (parsedQuantity > 10 && parsedQuantity < 20 || parsedQuantity % 10 === 0) {\n return vienetu;\n }\n if (parsedQuantity === 1 || parsedQuantity % 10 === 1) {\n return vienetas;\n }\n return vienetai;\n}\nvar ui25 = {\n /**\n * Shown on a button for adding additional items.\n */\n add: \"Pridėti\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"Pašalinti\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"Pašalinti visus\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"Atsiprašome, ne visi laukai užpildyti teisingai.\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"Pateikti\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"Nepasirinktas joks failas\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"Aukštyn\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"Žemyn\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"Kraunama...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"Daugiau\",\n /**\n * Show on buttons that navigate state forward\n */\n next: \"Kitas\",\n /**\n * Show on buttons that navigate state backward\n */\n prev: \"Ankstesnis\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"Pridėti visas reikšmes\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"Pridėti pasirinktas reikšmes\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"Pašalinti visas reikšmes\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"Pašalinti pasirinktas reikšmes\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"Pasirinkti datą\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"Pakeisti datą\",\n /**\n * Shown when there is something to close\n */\n close: \"Uždaryti\",\n /**\n * Shown when there is something to open.\n */\n open: \"Atidaryti\"\n};\nvar validation25 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `Prašome priimti ${name}.`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} turi būti po ${date(args[0])}.`;\n }\n return `${sentence(name)} turi būti ateityje.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(name)} gali būti tik abėcėlės simboliai.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)} gali būti tik raidės ir skaičiai.`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)} gali būti tik raidės ir tarpai.`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `${sentence(name)} turi būti abėcėlės simbolių.`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `${sentence(name)} turi būti raidžių arba skaičių.`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `${sentence(name)} turi būti raidžių arba tarpų.`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `${sentence(name)} turi būti simbolių.`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `${sentence(name)} turi būti didžioji raidė.`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `${sentence(name)} turi būti mažoji raidė.`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `${sentence(name)} turi būti skaičių.`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `${sentence(name)} turi būti simbolis.`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `${sentence(name)} turi būti tik didžiosios raidės.`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `${sentence(name)} turi būti tik mažosios raidės.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} turi būti prieš ${date(args[0])}.`;\n }\n return `${sentence(name)} turi būti praeityje.`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `Šis laukas buvo sukonfigūruotas neteisingai ir jo negalima pateikti.`;\n }\n const [a, b] = order(args[0], args[1]);\n return `${sentence(name)} turi būti tarp ${a} ir ${b}.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} nesutampa.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} nėra tinkama data, naudokite formatą ${args[0]}`;\n }\n return \"Šis laukas buvo sukonfigūruotas neteisingai ir jo negalima pateikti\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)} turi būti tarp ${date(args[0])} ir ${date(args[1])}`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"Įveskite teisingą el. pašto adresą.\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)} nesibaigia su ${list(args)}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)} nėra leistina reikšmė.`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)} turi būti bent vienas simbolis.`;\n }\n if (min == 0 && max) {\n return `${sentence(name)} turi būti mažiau arba lygiai ${max} ${getByQuantity(\n max,\n \"simbolis\",\n \"simboliai\",\n \"simbolių\"\n )}.`;\n }\n if (min === max) {\n return `${sentence(name)} turi būti iš ${max} ${getByQuantity(\n max,\n \"simbolio\",\n \"simbolių\",\n \"simbolių\"\n )}.`;\n }\n if (min && max === Infinity) {\n return `${sentence(name)} turi būti daugiau arba lygiai ${min} ${getByQuantity(\n min,\n \"simbolis\",\n \"simboliai\",\n \"simbolių\"\n )}.`;\n }\n return `${sentence(name)} turi būti tarp ${min} ir ${max} simbolių.`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)} nėra leistina reikšmė.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Negali turėti daugiau nei ${args[0]} ${name}.`;\n }\n return `${sentence(name)} turi būti mažiau arba lygiai ${args[0]}.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"Neleidžiami jokie failų formatai.\";\n }\n return `${sentence(name)} turi būti tokio tipo: ${args[0]}`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Negali turėti mažiau nei ${args[0]} ${name}.`;\n }\n return `Turi būti bent ${args[0]} ${name} .`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `“${value}” nėra leidžiamas ${name}.`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)} turi būti skaičius.`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\" arba \")} yra privaloma.`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `${sentence(name)} yra privaloma.`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)} neprasideda su ${list(args)}.`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `Įveskite teisingą URL.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"Pasirinkta data yra netinkama.\"\n};\nvar lt = { ui: ui25, validation: validation25 };\n\n// packages/i18n/src/locales/lv.ts\nvar ui26 = {\n /**\n * Shown on a button for adding additional items.\n */\n add: \"Pievienot\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"Noņemt\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"Noņemt visus\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"Piedodiet, visi lauki nav aizpildīti.\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"Iesniegt\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"Nav izvēlēts fails\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"Uz augšu\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"Uz leju\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"Ielādējas...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"Ielādēt vēl\",\n /**\n * Show on buttons that navigate state forward\n */\n next: \"Tālāk\",\n /**\n * Show on buttons that navigate state backward\n */\n prev: \"Atpakaļ\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"Pievienot visas vērtības\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"Pievienojiet izvēlēto vērtību\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"Noņemt visas vērtības\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"Noņemt izvēlētās vērtības\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"Izvēlieties datumu\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"Mainīt datumu\",\n /**\n * Shown when there is something to close\n */\n close: \"Aizvērt\",\n /**\n * Shown when there is something to open.\n */\n open: \"Atvērt\"\n};\nvar validation26 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `Lūdzu apstipriniet ${name}`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${name} jābūt pēc ${date(args[0])}.`;\n }\n return `${name} jābūt pēc šodienas datuma.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${name} var saturēt tikai alfabētiskās rakstzīmes.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${name} var saturēt tikai burtus un ciparus.`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${name} var saturēt tikai burtus un atstarpes.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${name} jābūt pirms ${date(args[0])}.`;\n }\n return `${name} jābūt pirms šodienas datuma.`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `Šis lauks tika aizpildīts nepareizi un nevar tikt iesniegts.`;\n }\n const [a, b] = order(args[0], args[1]);\n return `${name} jābūt starp ${a} un ${b}.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${name} nesakrīt.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${name} nav pareizs datums, lūdzu lietojiet formātu ${args[0]}`;\n }\n return \"Šis lauks tika aizpildīts nepareizi un nevar tikt iesniegts.\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${name} jābūt starp ${date(args[0])} un ${date(args[1])}`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"Lūdzu ierakstiet pareizu e-pasta adresi.\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${name} nebeidzas ar ${list(args)}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${name} nav atļauta vērtība.`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `${name} jābūt vismaz vienam simbolam.`;\n }\n if (min == 0 && max) {\n return `${name} jābūt mazāk par vai ${max} simboliem.`;\n }\n if (min === max) {\n return `${name} jābūt ${max} simbolu garumā.`;\n }\n if (min && max === Infinity) {\n return `${name} jābūt vismaz ${min} simboliem.`;\n }\n return `${name} jābūt starp ${min} un ${max} simboliem.`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${name} nav atļauta vērtība.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Nevar būt vairāk par ${args[0]} ${name}.`;\n }\n return `${name} nevar būt mazāk par ${args[0]} vai ${args[0]}.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"Atļauti nenoteikti faila formāti.\";\n }\n return `${sentence(name)} faila formāti var būt šādi: ${args[0]}`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Nevar būt mazāk par ${args[0]} ${name}.`;\n }\n return `Jābūt vismaz ${args[0]} ${name}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `“${value}” nav atļauta vērtība iekš ${name}.`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${name} jābūt ciparam.`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `${name} ir obligāti jāaizpilda`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${name} nesākas ar ${list(args)}.`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `Lūdzu pievienojiet pareizu URL.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"Izvēlētais datums ir nepareizs.\"\n};\nvar lv = { ui: ui26, validation: validation26 };\n\n// packages/i18n/src/locales/mn.ts\nvar ui27 = {\n /**\n * Shown on a button for adding additional items.\n */\n add: \"Нэмэх\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"Хасах\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"Бүгдийг хасах\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"Уучлраарай, зарим нүдэн дахь өгөгдөл дутуу байна.\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"Илгээх\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"Файл сонгоогүй байна\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"Дээшээ\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"Доошоо\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"Ачааллаж байна...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"Нэмж ачааллах\",\n /**\n * Show on buttons that navigate state forward\n */\n next: \"Дараагийн\",\n /**\n * Show on buttons that navigate state backward\n */\n prev: \"Өмнөх\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"Бүх утгуудыг нэмэх\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"Сонгогдсон утгуудыг нэмэх\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"Бүх утгуудыг устгах\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"Сонгогдсон утгуудыг хасах\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"Огноо сонгох\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"Огноо өөрчлөх\",\n /**\n * Shown when there is something to close\n */\n close: \"Хаах\",\n /**\n * Shown when there is something to open.\n */\n open: \"Нээлттэй\"\n};\nvar validation27 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `${name} утгыг зөвшөөрнө үү.`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} нь ${date(args[0])}-ны дараа орох ёстой.`;\n }\n return `${sentence(name)} утга ирээдүйг заах ёстой.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(name)} зөвхөн үсэг агуулах ёстой.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)} зөвхөн үсэг болон тоог агуулах ёстой.`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)} зөвхөн үсэг болон зай агуулах ёстой.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} нь ${date(args[0])}-ны өмнө байх ёстой.`;\n }\n return `${sentence(name)} өнгөрсөн огноо байх ёстой.`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `Энэ нүдэн дэхь өгөгдөл буруу учраас илгээх боломжгүй.`;\n }\n const [a, b] = order(args[0], args[1]);\n return `${sentence(name)} нь заавал ${a}, ${b} хоёрын дунд байх ёстой.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} таарахгүй байна.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} нь хүчинтэй огноо биш тул ${args[0]} гэсэн огноог ашиглаарай.`;\n }\n return \"Энэхүү нүд буруу тул цааш илгээх боломжгүй.\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)} нь заавал ${date(args[0])}, ${date(\n args[1]\n )} хоёр огноон дунд байх ёстой.`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"Та хүчинтэй имейл хаягаа оруулна уу.\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)} нь ${list(args)} гэсэн утгаар төгсөөгүй байна.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)} нь зөвшөөрөгдөх утга биш.`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)} дээр хаяж нэг үсэг байх ёстой`;\n }\n if (min == 0 && max) {\n return `${sentence(name)}-н урт нь ${max}-ээс ихгүй байх ёстой.`;\n }\n if (min === max) {\n return `${sentence(name)} нь ${max} урт байвал зүгээр.`;\n }\n if (min && max === Infinity) {\n return `${sentence(name)}-н урт нь ${min}-ээс их буюу тэнцүү байж болно.`;\n }\n return `${sentence(name)}-н урт нь ${min}, ${max} хоёрын дунд байх ёстой.`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)} нь зөвшөөрөгдөх утга биш.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `${name} нь ${args[0]}-аас их байж болохгүй.`;\n }\n return `${sentence(name)} нь ${args[0]}-тай тэнцүү эсвэл бага байх ёстой.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"Файлын формат буруу.\";\n }\n return `${sentence(name)} төрөл нь ${args[0]} байх ёстой.`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `${name} нь ${args[0]}-аас их байж болохгүй.`;\n }\n return `${name} нь дор хаяж ${args[0]}-тай тэнцүү байх ёстой.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `“${value}” бол зөвшөөрөгдөх ${name} гэсэн утга биш.`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)} зөвхөн тоо байх ёстой.`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `${sentence(name)} байх ёстой.`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)} нь ${list(args)}-ээр эхлээгүй байна.`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `Хүчннтай URL оруулна уу.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"Сонгосон огноо буруу байна.\"\n};\nvar mn = { ui: ui27, validation: validation27 };\nvar ui28 = {\n /**\n * Shown on a button for adding additional items.\n */\n add: \"Legg til\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"Fjern\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"Fjern alle\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"Beklager, noen felter er ikke fylt ut korrekt.\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"Send inn\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"Ingen fil valgt\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"Flytt opp\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"Flytt ned\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"Laster...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"Last mer\",\n /**\n * Show on buttons that navigate state forward\n */\n next: \"Neste\",\n /**\n * Show on buttons that navigate state backward\n */\n prev: \"Forrige\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"Legg til alle verdier\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"Legg til valgte verdier\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"Fjern alle verdier\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"Fjern valgte verdier\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"Velg dato\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"Endre dato\"\n};\nvar validation28 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `Vennligst aksepter ${name}.`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} må være senere enn ${date(args[0])}.`;\n }\n return `${sentence(name)} må være i fremtiden.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(name)} kan bare inneholde alfabetiske tegn.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)} kan bare inneholde bokstaver og tall.`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)} kan bare inneholde bokstaver og mellomrom.`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `${sentence(name)} must contain alphabetical characters.`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `${sentence(name)} must contain letters and numbers.`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `${sentence(name)} must contain letters and spaces.`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `${sentence(name)} must contain symbol.`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `${sentence(name)} must contain uppercase.`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `${sentence(name)} must contain lowercase.`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `${sentence(name)} must contain number.`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `${sentence(name)} can only contain symbol.`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `${sentence(name)} can only contain uppercase.`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `${sentence(name)} can only contain lowercase.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} må være tidligere enn ${date(args[0])}.`;\n }\n return `${sentence(name)} må være i fortiden.`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `Dette feltet er feilkonfigurert og kan ikke innsendes.`;\n }\n const [a, b] = order(args[0], args[1]);\n return `${sentence(name)} må være mellom ${a} og ${b}.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} stemmer ikke overens.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} er ikke en gyldig dato, vennligst bruk formatet ${args[0]}`;\n }\n return \"Dette feltet er feilkonfigurert og kan ikke innsendes.\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)} må være mellom ${date(args[0])} og ${date(args[1])}`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"Vennligst oppgi en gyldig epostadresse.\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)} slutter ikke med ${list(args)}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)} er ikke en tillatt verdi.`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)} må ha minst ett tegn.`;\n }\n if (min == 0 && max) {\n return `${sentence(name)} må ha mindre enn eller nøyaktig ${max} tegn.`;\n }\n if (min === max) {\n return `${sentence(name)} skal være ${max} tegn langt.`;\n }\n if (min && max === Infinity) {\n return `${sentence(name)} må ha mer enn eller nøyaktig ${min} tegn.`;\n }\n return `${sentence(name)} må ha mellom ${min} og ${max} tegn.`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)} er ikke en tillatt verdi.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Kan ikke ha mer enn ${args[0]} ${name}.`;\n }\n return `${sentence(name)} må være mindre enn eller nøyaktig ${args[0]}.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"Ingen tillatte filformater.\";\n }\n return `${sentence(name)} må være av typen: ${args[0]}`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Kan ikke ha mindre enn ${args[0]} ${name}.`;\n }\n return `${sentence(name)} må være minst ${args[0]}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `“${value}” er ikke en tillatt ${name}.`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)} må være et tall.`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\" eller \")} er nødvendig.`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `${sentence(name)} er påkrevd.`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)} starter ikke med ${list(args)}.`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `Vennligst inkluder en gyldig url.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"Den valgte datoen er ugyldig.\"\n};\nvar nb = { ui: ui28, validation: validation28 };\nvar ui29 = {\n /**\n * Shown on buttons for adding new items.\n */\n add: \"Toevoegen\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"Verwijderen\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"Alles verwijderen\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"Sorry, niet alle velden zijn correct ingevuld.\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"Versturen\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"Geen bestand gekozen\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"Naar boven gaan\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"Naar beneden verplaatsen\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"Aan het laden...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"Meer laden\",\n /**\n * Shown on buttons that navigate state forward\n */\n next: \"Vervolgens\",\n /**\n * Shown on buttons that navigate state backward\n */\n prev: \"Voorgaand\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"Alle waarden toevoegen\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"Geselecteerde waarden toevoegen\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"Alle waarden verwijderen\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"Geselecteerde waarden verwijderen\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"Kies een datum\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"Datum wijzigen\",\n /**\n * Shown when there is something to close\n */\n close: \"Sluiten\",\n /**\n * Shown when there is something to open.\n */\n open: \"Open\"\n};\nvar validation29 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `Accepteer de ${name}.`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} moet na ${date(args[0])} zijn.`;\n }\n return `${sentence(name)} moet in de toekomst liggen.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(name)} mag alleen alfabetische tekens bevatten.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)} mag alleen letters en cijfers bevatten.`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)} mag alleen letters en spaties bevatten.`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `${sentence(name)} moet alfabetische tekens bevatten.`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `${sentence(name)} moet letters of cijfers bevatten.`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `${sentence(name)} moet letters of spaties bevatten.`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `${sentence(name)} moet een symbool bevatten.`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `${sentence(name)} moet hoofdletters bevatten.`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `${sentence(name)} moet kleine letters bevatten.`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `${sentence(name)} moet cijfers bevatten.`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `${sentence(name)} moet een symbool zijn.`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `${sentence(name)} mag alleen hoofdletters bevatten.`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `${sentence(name)} mag alleen kleine letters bevatten.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} moet vóór ${date(args[0])} vallen.`;\n }\n return `${sentence(name)} moet in het verleden liggen.`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `Dit veld is onjuist geconfigureerd en kan niet worden verzonden.`;\n }\n const [a, b] = order(args[0], args[1]);\n return `${sentence(name)} moet tussen ${a} en ${b} liggen.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} komt niet overeen.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} is geen geldige datum, gebruik de notatie ${args[0]}`;\n }\n return \"Dit veld is onjuist geconfigureerd en kan niet worden verzonden\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)} moet tussen ${date(args[0])} en ${date(args[1])} liggen`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"Vul een geldig e-mailadres in.\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)} eindigt niet met ${list(args)}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)} is geen toegestane waarde.`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)} moet minimaal één teken zijn.`;\n }\n if (min == 0 && max) {\n return `${sentence(name)} mag maximaal ${max} tekens lang zijn.`;\n }\n if (min === max) {\n return `${sentence(name)} moet ${max} tekens lang zijn.`;\n }\n if (min && max === Infinity) {\n return `${sentence(name)} moet minimaal ${min} tekens lang zijn.`;\n }\n return `${sentence(name)} moet tussen de ${min} en ${max} tekens zijn.`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)} is geen toegestane waarde.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Mag niet meer dan ${args[0]} ${name} hebben.`;\n }\n return `${sentence(name)} moet kleiner zijn dan of gelijk zijn aan ${args[0]}.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"Geen bestandsformaten toegestaan.\";\n }\n return `${sentence(name)} moet van het type: ${args[0]} zijn`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Mag niet minder dan ${args[0]} ${name} hebben.`;\n }\n return `${sentence(name)} moet minimaal ${args[0]} zijn.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `\"${value}\" is geen toegestane ${name}.`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)} moet een getal zijn.`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\" of \")} is vereist.`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `${sentence(name)} is verplicht.`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)} begint niet met ${list(args)}.`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `Voer een geldige URL in.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"De geselecteerde datum is ongeldig.\"\n};\nvar nl = { ui: ui29, validation: validation29 };\nvar ui30 = {\n /**\n * Shown on buttons for adding new items.\n */\n add: \"Dodaj\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"Usuń\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"Usuń wszystko\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"Nie wszystkie pola zostały wypełnione poprawnie.\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"Wyślij\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"Nie wybrano pliku\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"Przesuń w górę\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"Przesuń w dół\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"Ładowanie...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"Załaduj więcej\",\n /**\n * Shown on buttons that navigate state forward\n */\n next: \"Kolejny\",\n /**\n * Shown on buttons that navigate state backward\n */\n prev: \"Poprzednia\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"Dodaj wszystkie wartości\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"Dodaj wybrane wartości\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"Usuń wszystkie wartości\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"Usuń wybrane wartości\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"Wybierz datę\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"Zmień datę\",\n /**\n * Shown when there is something to close\n */\n close: \"Zamknij\",\n /**\n * Shown when there is something to open.\n */\n open: \"Otwórz\"\n};\nvar validation30 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `Proszę zaakceptować ${name}.`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} musi być po ${date(args[0])}.`;\n }\n return `${sentence(name)} musi być w przyszłości.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `Pole ${sentence(name)} może zawierać tylko znaki alfabetyczne.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `Pole ${sentence(name)} może zawierać tylko znaki alfanumeryczne.`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `Pole ${sentence(name)} mogą zawierać tylko litery i spacje.`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `${sentence(name)} musi zawierać znaki alfabetyczne.`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `${sentence(name)} musi zawierać litery lub cyfry.`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `${sentence(name)} musi zawierać litery lub spacje.`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `${sentence(name)} musi zawierać symbol.`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `${sentence(name)} musi zawierać wielkie litery.`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `${sentence(name)} musi zawierać małe litery.`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `${sentence(name)} musi zawierać liczby.`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `${sentence(name)} musi być symbolem.`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `${sentence(name)} może zawierać tylko wielkie litery.`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `${sentence(name)} może zawierać tylko małe litery.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} musi być przed ${date(args[0])}.`;\n }\n return `${sentence(name)} musi być w przeszłości.`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `Pole zostało wypełnione niepoprawnie i nie może zostać wysłane.`;\n }\n const [a, b] = order(args[0], args[1]);\n return `Wartość pola ${sentence(name)} musi być pomiędzy ${a} i ${b}.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} nie pokrywa się.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `Wartość pola ${sentence(\n name\n )} nie jest poprawną datą, proszę użyć formatu ${args[0]}`;\n }\n return \"To pole zostało wypełnione niepoprawnie i nie może zostać wysłane\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `Data w polu ${sentence(name)} musi być pomiędzy ${date(args[0])} i ${date(\n args[1]\n )}`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"Proszę wpisać poprawny adres email.\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `Pole ${sentence(name)} nie kończy się na ${list(args)}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `Pole ${sentence(name)} nie jest dozwoloną wartością.`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `Pole ${sentence(name)} musi posiadać minimum jeden znak.`;\n }\n if (min == 0 && max) {\n return `Pole ${sentence(name)} musi zawierać ${max} lub mniej znaków.`;\n }\n if (min && max === Infinity) {\n return `Pole ${sentence(name)} musi zawierać ${min} lub więcej znaków.`;\n }\n if (min === max) {\n return `Pole ${sentence(name)} musi mieć ${min} znaków.`;\n }\n return `Pole ${sentence(name)} musi mieć ${min}-${max} znaków.`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `Pole ${sentence(name)} zawiera niedozwolone znaki.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Nie można mieć więcej niż ${args[0]} ${name}.`;\n }\n return `Wartość pola ${sentence(name)} musi być mniejsza lub równa ${args[0]}.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"Nie podano dozwolonych typów plików.\";\n }\n return `${sentence(name)} musi być typem: ${args[0]}`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Musisz podać więcej niż ${args[0]} ${name}.`;\n }\n return ` Musisz podać conajmniej ${args[0]} ${sentence(name)}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name }) {\n return `Wartość pola ${name} jest niedozwolona.`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)} musi być numerem.`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\" lub \")} wymagany jest.`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `Pole ${sentence(name)} jest wymagane.`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `Wartośc pola ${sentence(name)} nie zaczyna się od ${list(args)}.`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `Wprowadź prawidłowy adres URL.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"Wybrana data jest nieprawidłowa.\"\n};\nvar pl = { ui: ui30, validation: validation30 };\nvar ui31 = {\n /**\n * Shown on buttons for adding new items.\n */\n add: \"Incluir\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"Remover\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"Remover todos\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"Desculpe, alguns campos não foram preenchidos corretamente.\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"Enviar\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"Nenhum arquivo selecionado.\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"Mover para cima\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"Mover para baixo\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"Carregando...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"Carregar mais\",\n /**\n * Shown on buttons that navigate state forward\n */\n next: \"Próximo\",\n /**\n * Shown on buttons that navigate state backward\n */\n prev: \"Anterior\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"Adicione todos os valores\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"Adicionar valores selecionados\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"Remover todos os valores\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"Remover valores selecionados\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"Escolha a data\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"Data da alteração\",\n /**\n * Shown when there is something to close\n */\n close: \"Fechar\",\n /**\n * Shown when there is something to open.\n */\n open: \"Aberto\"\n};\nvar validation31 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `Por favor aceite o ${name}.`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} precisa ser depois de ${date(args[0])}.`;\n }\n return `${sentence(name)} precisa ser no futuro.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(name)} precisa conter apenas letras.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)} pode conter apenas letras e números.`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)} pode conter apenas números e espaços.`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `${sentence(name)} deve conter caracteres alfabéticos.`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `${sentence(name)} deve conter letras ou números.`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `${sentence(name)} deve conter letras ou espaços.`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `${sentence(name)} deve conter um símbolo.`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `${sentence(name)} deve conter letras maiúsculas.`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `${sentence(name)} deve conter letras minúsculas.`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `${sentence(name)} deve conter números.`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `${sentence(name)} deve ser um símbolo.`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `${sentence(name)} só pode conter letras maiúsculas.`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `${sentence(name)} só pode conter letras minúsculas.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} precisa ser antes de ${date(args[0])}.`;\n }\n return `${sentence(name)} precisa ser no passado.`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `Este campo não foi configurado corretamente e não pode ser submetido.`;\n }\n const [a, b] = order(args[0], args[1]);\n return `${sentence(name)} precisa ser entre ${a} e ${b}.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} não é igual.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} não é uma data válida, por favor use este formato ${args[0]}`;\n }\n return \"Este campo não foi configurado corretamente e não pode ser submetido.\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)} precisa ser entre ${date(args[0])} e ${date(args[1])}`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"Por favor, insira um endereço de email válido.\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)} não termina com ${list(args)}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)} não é um valor permitido.`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = first <= second ? first : second;\n const max = second >= first ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)} precisa conter ao menos um caractere.`;\n }\n if (min == 0 && max) {\n return `${sentence(name)} precisa ser menor ou igual a ${max} caracteres.`;\n }\n if (min === max) {\n return `${sentence(name)} precisa conter ${max} caracteres.`;\n }\n if (min && max === Infinity) {\n return `${sentence(name)} precisa ser maior ou igual a ${min} caracteres.`;\n }\n return `${sentence(name)} precisa ter entre ${min} e ${max} caracteres.`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)} não é um valor permitido.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Não pode ter mais de ${args[0]} ${name}.`;\n }\n return `${sentence(name)} precisa ser menor ou igual a ${args[0]}.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"Não há formatos de arquivos permitidos.\";\n }\n return `${sentence(name)} precisa ser do tipo: ${args[0]}`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Não pode ter menos de ${args[0]} ${name}.`;\n }\n return `${sentence(name)} precisa ser pelo menos ${args[0]}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `“${value}” não é um(a) ${name} permitido(a).`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)} precisa ser um número.`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\" ou \")} é necessário.`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `${sentence(name)} é obrigatório.`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)} não começa com ${list(args)}.`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `Por favor, insira uma url válida.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"A data selecionada é inválida.\"\n};\nvar pt = { ui: ui31, validation: validation31 };\nvar ui32 = {\n /**\n * Shown on buttons for adding new items.\n */\n add: \"Adăugare\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"Elimină\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"Elimină tot\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"Pare rău, unele câmpuri nu sunt corect completate.\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"Trimite\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"Nu este selectat nici un fișier\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"Mutare în sus\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"Mutare în jos\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"Se încarcă...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"Încărcați mai mult\",\n /**\n * Shown on buttons that navigate state forward\n */\n next: \"Urmatorul\",\n /**\n * Shown on buttons that navigate state backward\n */\n prev: \"Precedent\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"Adăugați toate valorile\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"Adăugarea valorilor selectate\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"Eliminați toate valorile\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"Eliminați valorile selectate\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"Alege data\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"Modificați data\",\n /**\n * Shown when there is something to close\n */\n close: \"Închide\",\n /**\n * Shown when there is something to open.\n */\n open: \"Deschis\"\n};\nvar validation32 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `Te rog acceptă ${name}.`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} trebuie să fie după ${date(args[0])}.`;\n }\n return `${sentence(name)} trebuie sa fie în viitor.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(name)} poate conține doar caractere alafetice.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)} poate conține doar litere și numere.`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)} poate conține doar litere și spații.`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `${sentence(name)} trebuie să conțină caractere alfabetice.`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `${sentence(name)} trebuie să conțină litere sau numere.`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `${sentence(name)} trebuie să conțină litere sau spații.`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `${sentence(name)} trebuie să conțină simbol.`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `${sentence(name)} trebuie să conțină majuscule.`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `${sentence(name)} trebuie să conțină litere mici.`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `${sentence(name)} trebuie să conțină numere.`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `${sentence(name)} trebuie să fie un simbol.`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `${sentence(name)} poate conține doar litere mari.`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `${sentence(name)} poate conține doar litere mici.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} trebuie să preceadă ${date(args[0])}.`;\n }\n return `${sentence(name)} trebuie să fie în trecut.`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `Câmpul a fost configurat incorect și nu poate fi trimis.`;\n }\n const [a, b] = order(args[0], args[1]);\n return `${sentence(name)} trebuie să fie între ${a} și ${b}.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} nu se potrivește.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} nu este validă, te rog foloște formatul ${args[0]}`;\n }\n return \"Câmpul a fost incorect configurat și nu poate fi trimis.\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)} trebuie să fie între ${date(args[0])} și ${date(\n args[1]\n )}`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"Te rog folosește o adresă de email validă.\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)} nu se termină cu ${list(args)}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)} nu este o valoare acceptată.`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)} trebuie sa conțină cel puțin un caracter.`;\n }\n if (min == 0 && max) {\n return `${sentence(name)} trebuie sa aibă cel mult ${max} caractere.`;\n }\n if (min === max) {\n return `${sentence(name)} ar trebui să aibă ${max} caractere lungi.`;\n }\n if (min && max === Infinity) {\n return `${sentence(name)} trebuie să aibă cel puțin ${min} caractere.`;\n }\n return `${sentence(name)} trebuie să aibă între ${min} și ${max} caractere.`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)} nu este o valoare acceptată.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Nu poate avea mai mult decat ${args[0]} ${name}.`;\n }\n return `${sentence(name)} trebuie să fie cel mult egal cu ${args[0]}.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"Tipul de fișier neacceptat.\";\n }\n return `${sentence(name)} trebuie să fie de tipul: ${args[0]}`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Nu poate avea mai puțin decât ${args[0]} ${name}.`;\n }\n return `${sentence(name)} trebuie să fie cel puțin ${args[0]}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `“${value}” nu este o valoare acceptă pentru ${name}.`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)} trebuie să fie un număr.`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\" sau \")} este necesar.`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `${sentence(name)} este necesar.`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)} nu începe cu ${list(args)}.`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `Introduceți o adresă URL validă.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"Data selectată este nevalidă.\"\n};\nvar ro = { ui: ui32, validation: validation32 };\nvar ui33 = {\n /**\n * Shown on buttons for adding new items.\n */\n add: \"Добавить\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"Удалить\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"Убрать все\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"Извините, не все поля заполнены верно.\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"Отправить\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"Файл не выбран\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"Переместить вверх\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"Переместить вниз\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"Загрузка...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"Загрузить больше\",\n /**\n * Shown on buttons that navigate state forward\n */\n next: \"Следующий\",\n /**\n * Shown on buttons that navigate state backward\n */\n prev: \"Предыдущий\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"Добавить все значения\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"Добавить выбранные значения\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"Удалить все значения\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"Удалить выбранные значения\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"Выберите дату\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"Изменить дату\",\n /**\n * Shown when there is something to close\n */\n close: \"Закрыть\",\n /**\n * Shown when there is something to open.\n */\n open: \"Открыть\"\n};\nvar validation33 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `Пожалуйста, примите ${name}.`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `Дата ${sentence(name)} должна быть позже ${date(args[0])}.`;\n }\n return `Дата ${sentence(name)} должна быть в будущем.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `Поле ${sentence(name)} может содержать только буквы.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `Поле ${sentence(name)} может содержать только буквы и цифры.`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)} могут содержать только буквы и пробелы.`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `${sentence(name)} должен содержать алфавитные символы.`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `${sentence(name)} должен содержать буквы или цифры.`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `${sentence(name)} должно содержать буквы или пробелы.`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `${sentence(name)} должен содержать символ.`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `${sentence(name)} должно содержать прописные буквы.`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `${sentence(name)} должно содержать строчные буквы.`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `${sentence(name)} должен содержать числа.`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `${sentence(name)} должен быть символом.`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `${sentence(name)} может содержать только прописные буквы.`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `${sentence(name)} может содержать только буквы нижнего регистра.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `Дата ${sentence(name)} должна быть раньше ${date(args[0])}.`;\n }\n return `Дата ${sentence(name)} должна быть в прошлом.`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `Это поле заполнено неверно и не может быть отправлено.`;\n }\n const [a, b] = order(args[0], args[1]);\n return `Поле ${sentence(name)} должно быть между ${a} и ${b}.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `Поле ${sentence(name)} не совпадает.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `Поле ${sentence(\n name\n )} имеет неверную дату. Пожалуйста, используйте формат ${args[0]}`;\n }\n return \"Это поле заполнено неверно и не может быть отправлено.\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `Дата ${sentence(name)} должна быть между ${date(args[0])} и ${date(\n args[1]\n )}`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"Пожалуйста, введите действительный электронный адрес.\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `Поле ${sentence(name)} не должно заканчиваться на ${list(args)}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `Поле ${sentence(name)} имеет неподустимое значение.`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `Поле ${sentence(name)} должно содержать минимум один символ.`;\n }\n if (min == 0 && max) {\n return `Длина поля ${sentence(\n name\n )} должна быть меньше или равна ${max} символам.`;\n }\n if (min === max) {\n return `Длина ${sentence(name)} должна составлять ${max} символов.`;\n }\n if (min && max === Infinity) {\n return `Длина поля ${sentence(\n name\n )} должна быть больше или равна ${min} символам.`;\n }\n return `Длина поля ${sentence(name)} должна быть между ${min} и ${max} символами.`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `Поле ${sentence(name)} имеет недопустимое значение.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Не может быть выбрано больше, чем ${args[0]} ${name}.`;\n }\n return `Поле ${sentence(name)} должно быть меньше или равно ${args[0]}.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"Не указаны поддержиавемые форматы файла.\";\n }\n return `Формат файла в поле ${sentence(name)} должен быть: ${args[0]}.`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Не может быть выбрано меньше, чем ${args[0]} ${name}.`;\n }\n return `Поле ${sentence(name)} должно быть не менее, чем ${args[0]}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `“${value}” не поддерживается в поле ${name}.`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `Поле ${sentence(name)} должно быть числом.`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\" или \")} требуется.`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `Поле ${sentence(name)} обязательно для заполнения.`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `Поле ${sentence(name)} должно начинаться с ${list(args)}.`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `Пожалуйста, введите действительный URL-адрес.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"Выбранная дата недействительна.\"\n};\nvar ru = { ui: ui33, validation: validation33 };\nvar ui34 = {\n /**\n * Shown on a button for adding additional items.\n */\n add: \"Pridať\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"Odstrániť\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"Odstrániť všetko\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"Prepáčte, ale nie všetky polia sú vyplnené správne.\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"Odoslať\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"Nebol vybraný žiadny súbor\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"Posunúť hore\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"Posunúť dole\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"Načítavanie...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"Načítať viac\",\n /**\n * Shown on buttons that navigate state forward\n */\n next: \"Ďalšie\",\n /**\n * Shown on buttons that navigate state backward\n */\n prev: \"Predošlý\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"Pridajte všetky hodnoty\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"Pridajte vybrané hodnoty\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"Odstrániť všetky hodnoty\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"Odstrániť vybrané hodnoty\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"Vyberte dátum\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"Zmena dátumu\",\n /**\n * Shown when there is something to close\n */\n close: \"Zavrieť\",\n /**\n * Shown when there is something to open.\n */\n open: \"Otvorené\"\n};\nvar validation34 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `Prosím zaškrtnite ${name}.`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} musí byť za ${date(args[0])}.`;\n }\n return `${sentence(name)} musí byť v budúcnosti.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(name)} môže obsahovať iba písmená.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)} môže obsahovať iba písmená a čísla.`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)} môže obsahovať iba písmená a medzery.`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `${sentence(name)} musí obsahovať abecedné znaky.`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `${sentence(name)} musí obsahovať písmená alebo číslice.`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `${sentence(name)} musí obsahovať písmená alebo medzery.`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `${sentence(name)} musí obsahovať symbol.`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `${sentence(name)} musí obsahovať veľké písmená.`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `${sentence(name)} musí obsahovať malé písmená.`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `${sentence(name)} musí obsahovať čísla.`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `${sentence(name)} musí byť symbol.`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `${sentence(name)} môže obsahovať iba veľké písmená.`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `${sentence(name)} môže obsahovať len malé písmená.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} musí byť pred ${date(args[0])}.`;\n }\n return `${sentence(name)} musí byť v minulosti.`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `Toto pole bolo nesprávne nakonfigurované a nemôže byť odoslané.`;\n }\n const [a, b] = order(args[0], args[1]);\n return `${sentence(name)} musí byť medzi ${a} and ${b}.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} does not match.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} nie je platným dátumom, prosím, použite formát ${args[0]}`;\n }\n return \"Toto pole bolo nesprávne nakonfigurované a nemôže byť odoslané.\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)} musí byť medzi ${date(args[0])} a ${date(args[1])}`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"Prosím, zadajte platnú emailovú adresu.\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)} nekončí na ${list(args)}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)} nie je povolená hodnota.`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)} musí mať najmenej jeden znak.`;\n }\n if (min == 0 && max) {\n return `${sentence(name)} musí byť menšie alebo rovné ako ${max} znakov.`;\n }\n if (min === max) {\n return `${sentence(name)} by mala mať dĺžku ${max} znakov.`;\n }\n if (min && max === Infinity) {\n return `${sentence(name)} musí byť väčšie alebo rovné ako ${min} znakov.`;\n }\n return `${sentence(name)} musí byť medzi ${min} až ${max} znakov.`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)} nie je povolená hodnota.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Nie je možné použiť viac než ${args[0]} ${name}.`;\n }\n return `${sentence(name)} musí byť menšie alebo rovné ako ${args[0]}.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"Nie sú povolené formáty súborov.\";\n }\n return `${sentence(name)} musí byť typu: ${args[0]}`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Nemôže byť menej než ${args[0]} ${name}.`;\n }\n return `${sentence(name)} musí byť minimálne ${args[0]}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `“${value}” nie je povolené hodnota pre ${name}.`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)} musí byť číslo.`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\" alebo \")} je potrebný.`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `${sentence(name)} je povinné.`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)} nezačíná s ${list(args)}.`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `Zadajte platnú adresu URL.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"Vybraný dátum je neplatný.\"\n};\nvar sk = { ui: ui34, validation: validation34 };\nvar ui35 = {\n /**\n * Shown on buttons for adding new items.\n */\n add: \"Dodaj\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"Odstrani\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"Odstrani vse\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"Nekatera polja niso pravilno izpolnjena.\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"Pošlji\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"Nobena datoteka ni izbrana\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"Premakni se navzgor\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"Premakni se navzdol\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"Nalaganje...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"Naloži več\",\n /**\n * Shown on buttons that navigate state forward\n */\n next: \"Naslednji\",\n /**\n * Shown on buttons that navigate state backward\n */\n prev: \"Prejšnji\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"Dodajte vse vrednosti\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"Dodajanje izbranih vrednosti\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"Odstranite vse vrednosti\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"Odstrani izbrane vrednosti\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"Izberite datum\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"Spremeni datum\",\n /**\n * Shown when there is something to close\n */\n close: \"Zapri\",\n /**\n * Shown when there is something to open.\n */\n open: \"Odpri\"\n};\nvar validation35 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `Prosimo popravite ${name}.`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} mora biti po ${date(args[0])}.`;\n }\n return `${sentence(name)} mora biti v prihodnosti.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(name)} lahko vsebuje samo znake abecede.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)} lahko vsebuje samo črke in številke.`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)} lahko vsebuje samo črke in presledke.`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `${sentence(name)} mora vsebovati abecedne znake.`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `${sentence(name)} mora vsebovati črke ali številke.`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `${sentence(name)} mora vsebovati črke ali presledke.`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `${sentence(name)} mora vsebovati simbol.`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `${sentence(name)} mora vsebovati velike črke.`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `${sentence(name)} mora vsebovati male črke.`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `${sentence(name)} mora vsebovati številke.`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `${sentence(name)} mora biti simbol.`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `${sentence(name)} lahko vsebuje le velike črke.`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `${sentence(name)} lahko vsebuje le male črke.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} mora biti pred ${date(args[0])}.`;\n }\n return `${sentence(name)} mora biti v preteklosti.`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `To polje je narobe nastavljeno in ne mora biti izpolnjeno.`;\n }\n const [a, b] = order(args[0], args[1]);\n return `${sentence(name)} mora biti med ${a} in ${b}.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} se ne ujema.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} ni pravilen datum, prosimo uporabite format ${args[0]}`;\n }\n return \"To polje je narobe nastavljeno in ne mora biti izpolnjeno.\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)} mora biti med ${date(args[0])} in ${date(args[1])}`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"Vnesite veljaven e-poštni naslov.\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)} se mora kočati z ${list(args)}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)} ni dovoljena vrednost.`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)} mora vsebovati vsaj en znak.`;\n }\n if (min == 0 && max) {\n return `${sentence(name)} mora vsebovati največ ${max} znakov.`;\n }\n if (min === max) {\n return `${sentence(name)} mora biti dolg ${max} znakov.`;\n }\n if (min && max === Infinity) {\n return `${sentence(name)} mora vsebovati vsaj ${min} znakov.`;\n }\n return `${sentence(name)} mora vsebovati med ${min} in ${max} znakov.`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)} ni dovoljena vrednost.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Največ je ${args[0]} ${name}.`;\n }\n return `${sentence(name)} je lahko največ ${args[0]}.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"Nobena vrsta datoteke ni dovoljena.\";\n }\n return `${sentence(name)} mora biti tipa: ${args[0]}`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Najmanj ${args[0]} ${name} je dovoljenih.`;\n }\n return `${sentence(name)} mora biti vsaj ${args[0]}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `“${value}” ni dovoljen(a/o) ${name}.`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)} mora biti številka.`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\" ali \")} zahtevan je.`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `${sentence(name)} je zahtevan(o/a).`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)} se mora začeti z ${list(args)}.`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `Vnesite veljaven URL.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"Izbrani datum je neveljaven.\"\n};\nvar sl = { ui: ui35, validation: validation35 };\nvar ui36 = {\n /**\n * Shown on a button for adding additional items.\n */\n add: \"Dodaj\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"Ukloni\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"Ukloni sve\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"Pojedina polja nisu ispravno ispunjena.\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"Pošalji\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"Fajl nije odabran\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"Pomerite se gore\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"Pomeri se dole\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"Učitavanje...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"Učitaj više\",\n /**\n * Shown on buttons that navigate state forward\n */\n next: \"Sledeća\",\n /**\n * Shown on buttons that navigate state backward\n */\n prev: \"Prethodna\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"Dodajte sve vrednosti\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"Dodajte izabrane vrednosti\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"Uklonite sve vrednosti\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"Uklonite izabrane vrednosti\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"Izaberite datum\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"Promenite datum\",\n /**\n * Shown when there is something to close\n */\n close: \"Zatvori\",\n /**\n * Shown when there is something to open.\n */\n open: \"Otvori\"\n};\nvar validation36 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `Molimo prihvatite ${name}`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} mora biti posle ${date(args[0])}.`;\n }\n return `${sentence(name)} mora biti u budućnosti.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(name)} može da sadrži samo abecedne znakove.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)} može da sadrži samo slova i brojeve.`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)} može da sadrži samo slova i razmake.`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `${sentence(name)} mora da sadrži abecedne znakove.`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `${sentence(name)} mora da sadrži slova ili brojeve.`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `${sentence(name)} mora da sadrži slova ili razmake.`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `${sentence(name)} mora da sadrži simbol.`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `${sentence(name)} mora da sadrži velika slova.`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `${sentence(name)} mora da sadrži mala slova.`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `${sentence(name)} mora da sadrži brojeve.`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `${sentence(name)} mora biti simbol.`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `${sentence(name)} može da sadrži samo velika slova.`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `${sentence(name)} može da sadrži samo mala slova.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} mora biti pre ${date(args[0])}.`;\n }\n return `${sentence(name)} mora biti u prošlosti.`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `Ovo polje je pogrešno konfigurisano i ne može se poslati.`;\n }\n const [a, b] = order(args[0], args[1]);\n return `${sentence(name)} mora biti između ${a} i ${b}.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} se ne podudara.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} nije važeći datum, molimo Vas koristite format ${args[0]}`;\n }\n return \"Ovo polje je pogrešno konfigurisano i ne može se poslati\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)} mora biti između ${date(args[0])} i ${date(args[1])}`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"Unesite ispravnu e-mail adresu.\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)} se ne završava sa ${list(args)}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)} nije dozvoljena vrednost`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)} mora biti najmanje jedan karakter.`;\n }\n if (min == 0 && max) {\n return `${sentence(name)} mora biti manji ili jednaki od ${max} karaktera.`;\n }\n if (min === max) {\n return `${sentence(name)} treba da bude ${max} znakova dugačak.`;\n }\n if (min && max === Infinity) {\n return `${sentence(name)} mora biti veći ili jednaki od ${min} karaktera.`;\n }\n return `${sentence(name)} mora biti između ${min} i ${max} karaktera.`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)} nije dozvoljena vrednost.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Ne može imati više od ${args[0]} ${name}.`;\n }\n return `${sentence(name)} mora biti manji ili jednaki od ${args[0]}.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"Nisu dozvoljeni formati datoteka.\";\n }\n return `${sentence(name)} mora biti tipa: ${args[0]}`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Ne može imati manje od ${args[0]} ${name}.`;\n }\n return `${sentence(name)} mora da ima najmanje ${args[0]}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `“${value}” nije dozvoljeno ${name}.`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)} mora biti broj.`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\" или \")} потребан је.`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `${sentence(name)} je obavezno polje.`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)} ne počinje sa ${list(args)}.`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `Unesite važeću URL adresu.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"Izabrani datum je nevažeći.\"\n};\nvar sr = { ui: ui36, validation: validation36 };\nvar ui37 = {\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"Ta bort\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"Ta bort alla\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"Tyvärr är inte alla fält korrekt ifyllda\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"Skicka\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"Ingen fil vald\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"Flytta upp\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"Flytta ner\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"Laddar...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"Ladda mer\",\n /**\n * Shown on buttons that navigate state forward\n */\n next: \"Nästa\",\n /**\n * Shown on buttons that navigate state backward\n */\n prev: \"Föregående\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"Lägg till alla värden\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"Lägg till valda värden\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"Ta bort alla värden\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"Ta bort valda värden\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"Välj datum\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"Ändra datum\",\n /**\n * Shown when there is something to close\n */\n close: \"Stäng\",\n /**\n * Shown when there is something to open.\n */\n open: \"Öppna\"\n};\nvar validation37 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `Var god acceptera ${name}.`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} måste vara efter ${date(args[0])}.`;\n }\n return `${sentence(name)} måste vara framåt i tiden.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(name)} kan enbart innehålla bokstäver i alfabetet.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)} kan bara innehålla bokstäver och siffror.`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)} kan bara innehålla bokstäver och blanksteg.`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `${sentence(name)} måste innehålla alfabetiska tecken.`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `${sentence(name)} måste innehålla bokstäver eller siffror.`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `${sentence(name)} måste innehålla bokstäver eller mellanslag.`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `${sentence(name)} måste innehålla symbol.`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `${sentence(name)} måste innehålla versaler.`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `${sentence(name)} måste innehålla gemener.`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `${sentence(name)} måste innehålla siffror.`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `${sentence(name)} måste vara en symbol.`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `${sentence(name)} kan bara innehålla versaler.`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `${sentence(name)} kan bara innehålla små bokstäver.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} måste vara före ${date(args[0])}.`;\n }\n return `${sentence(name)} måste vara bakåt i tiden.`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `Det här fältet ställdes inte in korrekt och kan inte användas.`;\n }\n const [a, b] = order(args[0], args[1]);\n return `${sentence(name)} måste vara mellan ${a} och ${b}.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} matchar inte.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} är inte ett giltigt datum, var god använd formatet ${args[0]}`;\n }\n return \"Det här fältet ställdes inte in korrekt och kan inte användas\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)} måste vara mellan ${date(args[0])} och ${date(args[1])}`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"Var god fyll i en giltig e-postadress.\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)} slutar inte med ${list(args)}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)} är inte ett godkänt värde.`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)} måste ha minst ett tecken.`;\n }\n if (min == 0 && max) {\n return `${sentence(name)} måste vara ${max} tecken eller färre.`;\n }\n if (min === max) {\n return `${sentence(name)} bör vara ${max} tecken långa.`;\n }\n if (min && max === Infinity) {\n return `${sentence(name)} måste vara ${min} tecken eller fler.`;\n }\n return `${sentence(name)} måste vara mellan ${min} och ${max} tecken.`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)} är inte ett godkänt värde.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Kan inte ha mer än ${args[0]} ${name}.`;\n }\n return `${sentence(name)} måste vara ${args[0]} eller mindre.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"Inga filtyper tillåtna.\";\n }\n return `${sentence(name)} måste vara av filtypen: ${args[0]}`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Kan inte ha mindre än ${args[0]} ${name}.`;\n }\n return `${sentence(name)} måste vara minst ${args[0]}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `“${value}” är inte ett godkänt ${name}.`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)} måste vara en siffra.`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\" eller \")} krävs.`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `${sentence(name)} är obligatoriskt.`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)} börjar inte med ${list(args)}.`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `Ange en giltig URL.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"Det valda datumet är ogiltigt.\"\n};\nvar sv = { ui: ui37, validation: validation37 };\n\n// packages/i18n/src/locales/tet.ts\nvar ui38 = {\n /**\n * Shown on a button for adding additional items.\n */\n add: \"Aumenta\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"Hasai\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"Hasai Hotu\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"Deskulpa, iha informasaun neebe sala iha formuláriu\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"Submete\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"Seidauk hili file\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"Muda ba leten\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"Muda ba kotuk\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"Hein lai...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"Foti tan\",\n /**\n * Show on buttons that navigate state forward\n */\n next: \"Ba oin\",\n /**\n * Show on buttons that navigate state backward\n */\n prev: \"Ba kotuk\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"Aumenta hotu\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"Aumenta buat neebe hili ona\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"Hasai hotu\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"Hasai buat neebe hili ona\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"Hili data\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"Troka data\"\n};\nvar validation38 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `Favor ida simu ${name}.`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} tenki depoid ${date(args[0])}.`;\n }\n return `${sentence(name)} tenki iha futuru.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(name)} bele uza letra deit.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)} bele uza letra ka numeru deit.`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)} bele uza letra ka numeru deit.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} tenki antes ${date(args[0])}.`;\n }\n return `${sentence(name)} tenki antes ohin loron.`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `Informasaun nee la loos no la bele submete.`;\n }\n const [a, b] = order(args[0], args[1]);\n return `${sentence(name)} tenki iha klaran entre ${a} no ${b}.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} la hanesan.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} la loos, favor ida hakerek tuir ${args[0]}`;\n }\n return \"Informasaun nee la loos no la bele submete.\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)} tenki iha ${date(args[0])} no ${date(\n args[1]\n )} nia klaran`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"Favor hakerek endresu email neebe loos.\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)} la remata ho ${list(args)}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `la bele uza ${sentence(name)}.`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)} tenki iha letra ida ka liu.`;\n }\n if (min == 0 && max) {\n return `${sentence(name)} tenki badak liu ${max} letra.`;\n }\n if (min === max) {\n return `${sentence(name)} tenki iha letra ${max}.`;\n }\n if (min && max === Infinity) {\n return `${sentence(name)} tenki iha letra ${min} ka liu.`;\n }\n return `${sentence(name)} tenki iha letra ${min} too ${max}.`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `la bele uza ${sentence(name)}.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `La bele iha ${args[0]} ka liu ${name}.`;\n }\n return `${sentence(name)} tenki kiik liu ka hanesan ${args[0]}.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return `La bele simu 'format' ida.`;\n }\n return `${sentence(name)} tenki iha tipo: ${args[0]}`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Presiza ${args[0]} ${name} ka liu.`;\n }\n return `${name} tenki ${args[0]} ka liu.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `La bele uza “${value}” ba ${name}.`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)} tenki numeru.`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `Presiza ${sentence(name)}.`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)} la komesa ho ${list(args)}.`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `Favor hakerek URL neebe loos.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"Data la loos.\"\n};\nvar tet = { ui: ui38, validation: validation38 };\nvar ui39 = {\n /**\n * Shown on a button for adding additional items.\n */\n add: \"Илова кардан\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"Хориҷ кардан\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"Ҳамаро хориҷ кунед\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"Бубахшед, на ҳама майдонҳо дуруст пур карда шудаанд.\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"Пешниҳод кунед\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"Ягон файл интихоб нашудааст\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"Ба боло ҳаракат кунед\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"Ба поён ҳаракат кунед\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"Дар ҳоли боргузорӣ\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"Бештар бор кунед\",\n /**\n * Show on buttons that navigate state forward\n */\n next: \"Баъдӣ\",\n /**\n * Show on buttons that navigate state backward\n */\n prev: \"Гузашта\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"Ҳама арзишҳоро илова кунед\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"Илова кардани арзишҳои интихобшуда\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"Ҳама арзишҳоро хориҷ кунед\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"Арзишҳои интихобшударо хориҷ кунед\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"Сана интихоб кунед\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"Тағйир додани сана\"\n};\nvar validation39 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `Лутфан ${name}-ро қабул кунед`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} бояд пас аз ${date(args[0])} бошад.`;\n }\n return `${sentence(name)} бояд дар оянда бошад.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(name)} метавонад танҳо аломатҳои алифборо дар бар гирад.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)} метавонад танҳо ҳарфҳо ва рақамҳоро дар бар гирад.`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)} метавонад танҳо ҳарфҳо ва фосилаҳоро дар бар гирад.`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `${sentence(name)} must contain alphabetical characters.`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `${sentence(name)} must contain letters and numbers.`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `${sentence(name)} must contain letters and spaces.`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `${sentence(name)} must contain symbol.`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `${sentence(name)} must contain uppercase.`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `${sentence(name)} must contain lowercase.`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `${sentence(name)} must contain number.`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `${sentence(name)} can only contain symbol.`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `${sentence(name)} can only contain uppercase.`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `${sentence(name)} can only contain lowercase.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} бояд пеш аз ${date(args[0])} бошад.`;\n }\n return `${sentence(name)} бояд дар гузашта бошад.`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `Ин майдон нодуруст танзим шудааст ва онро пешниҳод кардан ғайриимкон аст.`;\n }\n const [a, b] = order(args[0], args[1]);\n return `${sentence(name)} бояд дар байни ${a} ва ${b} бошад.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} мувофиқат намекунад.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} санаи дуруст нест, лутфан формати ${args[0]}-ро истифода баред`;\n }\n return \"Ин майдон нодуруст танзим шудааст ва онро пешниҳод кардан ғайриимкон аст\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)} бояд дар байни ${date(args[0])} ва ${date(\n args[1]\n )} бошад`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"Лутфан нишонаи имейли амалкунандаро ворид намоед.\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)} бо ${list(args)} ба охир намерасад.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)} арзиши иҷозатдодашуда нест.`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)} бояд ҳадди аққал як аломат бошад.`;\n }\n if (min == 0 && max) {\n return `${sentence(name)} бояд аз ${max} аломат камтар ё баробар бошад.`;\n }\n if (min === max) {\n return `${sentence(name)} бояд ${max} аломат бошад.`;\n }\n if (min && max === Infinity) {\n return `${sentence(name)} бояд аз ${min} аломат зиёд ё баробар бошад.`;\n }\n return `${sentence(name)} бояд дар байни ${min} ва ${max} аломат бошад.`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)} арзиши иҷозатдодашуда нест.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Зиёда аз ${args[0]} ${name} дошта наметавонад.`;\n }\n return `${sentence(name)} бояд аз ${args[0]} камтар ё баробар бошад.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"Ягон формати файл иҷозат дода намешавад.\";\n }\n return `${sentence(name)} бояд чунин намуд бошад: ${args[0]}`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Камтар аз ${args[0]} ${name} дошта наметавонад.`;\n }\n return `${sentence(name)} бояд ҳадди аққал ${args[0]} бошад.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `\"${value}\" ${name} иҷозат дода намешавад.`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)} бояд рақам бошад.`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\" ё \")} зарур а`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `${sentence(name)} лозим аст.`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)} бо ${list(args)} оғоз намешавад.`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `Лутфан URL-и дурустро дохил кунед.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"Санаи интихобшуда нодуруст аст.\"\n};\nvar tg = { ui: ui39, validation: validation39 };\nvar ui40 = {\n /**\n * Shown on buttons for adding new items.\n */\n add: \"เพิ่ม\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"เอาออก\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"เอาออกทั้งหมด\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"ขออภัย ข้อมูลบางช่องที่กรอกไม่ถูกต้อง\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"ส่ง\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"ยังไม่ได้เลือกไฟล์\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"เลื่อนขึ้น\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"เลื่อนลง\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"กำลังโหลด...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"โหลดเพิ่มเติม\",\n /**\n * Shown on buttons that navigate state forward\n */\n next: \"ถัดไป\",\n /**\n * Shown on buttons that navigate state backward\n */\n prev: \"ก่อนหน้า\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"เพิ่มค่าทั้งหมด\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"เพิ่มค่าที่เลือก\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"ลบค่าทั้งหมด\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"ลบค่าที่เลือก\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"เลือกวันที่\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"เปลี่ยนวันที่\",\n /**\n * Shown when there is something to close\n */\n close: \"ปิด\",\n /**\n * Shown when there is something to open.\n */\n open: \"เปิด\"\n};\nvar validation40 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `กรุณายอมรับ ${name}`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} จะต้องเป็นวันที่หลังจาก ${date(args[0])}`;\n }\n return `${sentence(name)} จะต้องเป็นวันที่ที่ยังไม่มาถึง`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(name)} สามารถเป็นได้แค่ตัวอักษรเท่านั้น`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)} สามารถเป็นได้แค่ตัวอักษรและตัวเลขเท่านั้น`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)} สามารถเป็นได้แค่ตัวอักษรและเว้นวรรคเท่านั้น`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `${sentence(name)} ต้องมีตัวอักษรตัวอักษร`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `${sentence(name)} ต้องมีตัวอักษรหรือตัวเลข`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `${sentence(name)} ต้องมีตัวอักษรหรือช่องว่าง`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `${sentence(name)} ต้องมีสัญลักษณ์`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `${sentence(name)} ต้องมีตัวพิมพ์ใหญ่`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `${sentence(name)} ต้องมีตัวพิมพ์เล็ก`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `${sentence(name)} ต้องมีตัวเลข`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `${sentence(name)} จะต้องเป็นสัญลักษณ์`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `${sentence(name)} เท่านั้นที่สามารถมีตัวอักษรตัวพิมพ์ใหญ่`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `${sentence(name)} เท่านั้นที่สามารถมีตัวอักษรตัวพิมพ์เล็ก`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} จะต้องเป็นวันที่ที่มาก่อน ${date(args[0])}`;\n }\n return `${sentence(name)} จะต้องเป็นวันที่ที่ผ่านมาแล้ว`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `ช่องนี้ถูกตั้งค่าอย่างไม่ถูกต้อง และจะไม่สามารถส่งข้อมูลได้`;\n }\n const [a, b] = order(args[0], args[1]);\n return `${sentence(name)} จะต้องเป็นค่าระหว่าง ${a} และ ${b}`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} ไม่ตรงกัน`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} ไม่อยู่ในรูปแบบวันที่ที่ถูกต้อง กรุณากรอกตามรูปแบบ ${args[0]}`;\n }\n return \"ช่องนี้ถูกตั้งค่าอย่างไม่ถูกต้อง และจะไม่สามารถส่งข้อมูลได้\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)} จะต้องเป็นวันที่ระหว่าง ${date(args[0])} และ ${date(\n args[1]\n )}`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"กรุณากรอกที่อยู่อีเมลทีถูกต้อง\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)} จะต้องลงท้ายด้วย ${list(args)}`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)} ไม่ใช่ค่าที่อนุญาตให้กรอก`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)} จะต้องมีความยาวอย่างน้อยหนึ่งตัวอักษร`;\n }\n if (min == 0 && max) {\n return `${sentence(name)} จะต้องมีความยาวไม่เกิน ${max} ตัวอักษร`;\n }\n if (min === max) {\n return `${sentence(name)} ควรจะเป็น ${max} ตัวอักษรยาว`;\n }\n if (min && max === Infinity) {\n return `${sentence(name)} จะต้องมีความยาว ${min} ตัวอักษรขึ้นไป`;\n }\n return `${sentence(name)} จะต้องมีความยาวระหว่าง ${min} และ ${max} ตัวอักษร`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)} ไม่ใช่ค่าที่อนุญาตให้กรอก`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `ไม่สามารถเลือกมากกว่า ${args[0]} ${name} ได้`;\n }\n return `${sentence(name)} จะต้องมีค่าไม่เกิน ${args[0]}`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"ไม่มีประเภทของไฟล์ที่อนุญาต\";\n }\n return `${sentence(name)} จะต้องเป็นไฟล์ประเภท ${args[0]} เท่านั้น`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `ไม่สามารถเลือกน้อยกว่า ${args[0]} ${name} ได้`;\n }\n return `${sentence(name)} จะต้องมีค่าอย่างน้อย ${args[0]}`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `“${value}” ไม่ใช่ค่า ${name} ที่อนุญาตให้กรอก`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)} จะต้องเป็นตัวเลขเท่านั้น`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\" หรือ \")} ต้องการ.`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `กรุณากรอก ${sentence(name)}`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)} จะต้องเริ่มต้นด้วย ${list(args)}`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `กรุณาระบุที่อยู่ลิงก์ให้ถูกต้อง`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"วันที่ที่เลือกไม่ถูกต้อง\"\n};\nvar th = { ui: ui40, validation: validation40 };\nvar ui41 = {\n /**\n * Shown on buttons for adding new items.\n */\n add: \"Ekle\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"Kaldır\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"Hepsini kaldır\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"Maalesef, tüm alanlar doğru doldurulmadı.\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"Gönder\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"Dosya yok\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"Yukarı Taşı\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"Aşağı taşı\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"Yükleniyor...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"Daha fazla yükle\",\n /**\n * Shown on buttons that navigate state forward\n */\n next: \"Sonraki\",\n /**\n * Shown on buttons that navigate state backward\n */\n prev: \"Önceki\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"Tüm değerleri ekle\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"Seçili değerleri ekle\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"Tüm değerleri kaldır\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"Seçili değerleri kaldır\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"Tarih seçin\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"Tarihi değiştir\",\n /**\n * Shown when there is something to close\n */\n close: \"Kapat\",\n /**\n * Shown when there is something to open.\n */\n open: \"Açık\"\n};\nvar validation41 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `Lütfen ${name}'yi kabul edin.`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} ${date(args[0])}'den sonra olmalıdır.`;\n }\n return `${sentence(name)} gelecekte bir zaman olmalıdır.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(name)} sadece alfabetik karakterler içerebilir.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)} sadece alfabetik karakterler ve sayı içerebilir.`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)} yalnızca harf ve boşluk içerebilir.`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `${sentence(name)} alfabetik karakterler içermelidir.`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `${sentence(name)} harf veya rakamı içermelidir.`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `${sentence(name)} harf veya boşluk içermelidir.`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `${sentence(name)} sembol içermelidir.`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `${sentence(name)} büyük harf içermelidir.`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `${sentence(name)} küçük harf içermelidir.`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `${sentence(name)} sayı içermelidir.`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `${sentence(name)} bir sembol olmalıdır.`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `${sentence(name)} yalnızca büyük harfler içerebilir.`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `${sentence(name)} yalnızca küçük harfler içerebilir.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} ${date(args[0])} tarihinden önce olmalı.`;\n }\n return `${sentence(name)} geçmişte olmalı.`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `Alan yanlış yapılandırılmış ve gönderilemez.`;\n }\n const [a, b] = order(args[0], args[1]);\n return `${sentence(name)} ${a} ve ${b} aralığında olmalı.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} eşleşmiyor.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} geçerli bir tarih değil, lütfen ${args[0]} biçimini kullanın.`;\n }\n return \"Alan yanlış yapılandırılmış ve gönderilemez.\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)}, ${date(args[0])} ve ${date(args[1])} aralığında olmalı.`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"Lütfen geçerli bir e-mail adresi girin.\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)} ${list(args)} ile bitmiyor.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)} izin verilen bir değer değil.`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)} en azından bir karakter uzunluğunda olmalı.`;\n }\n if (min == 0 && max) {\n return `${sentence(name)} ${max}'e eşit veya daha küçük olmalı.`;\n }\n if (min === max) {\n return `${sentence(name)} ${max} karakter uzunluğunda olmalıdır.`;\n }\n if (min && max === Infinity) {\n return `${sentence(name)} ${min}'e eşit veya daha büyük olmalı.`;\n }\n return `${sentence(name)}, ${min} ve ${max} karakter uzunluğu aralığında olmalı.`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)} izin verilen bir değer değil.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `${name}'in uzunluğu ${args[0]}'dan daha uzun olamaz.`;\n }\n return `${sentence(name)} en azından ${args[0]} uzunluğunda veya ona eşit olmalı.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"Hiçbir dosya türüne izin verilmez.\";\n }\n return `${sentence(name)} şu tiplerden biri olmalı: ${args[0]}`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `${name}'in uzunluğu ${args[0]}'dan daha kısa olamaz.`;\n }\n return `${sentence(name)} en azından ${args[0]} uzunluğunda olmalı.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `“${value}” ${name} olamaz.`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)} sayı olmalı.`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\" veya \")} gereklidir.`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `${sentence(name)} gerekli.`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)} ${list(args)} ile başlamıyor.`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `Lütfen geçerli bir URL girin.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"Seçilen tarih geçersiz.\"\n};\nvar tr = { ui: ui41, validation: validation41 };\nvar ui42 = {\n /**\n * Shown on a button for adding additional items.\n */\n add: \"Додати\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"Видалити\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"Видалити все\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"Вибачте, не всі поля заповнені правильно.\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"Відправити\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"Файл не вибрано\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"Рухатися вгору\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"Пересунути вниз\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"Завантаження...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"Завантажте більше\",\n /**\n * Shown on buttons that navigate state forward\n */\n next: \"Наступний\",\n /**\n * Shown on buttons that navigate state backward\n */\n prev: \"Попередній\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"Додати всі значення\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"Додати вибрані значення\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"Вилучити всі значення\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"Вилучити вибрані значення\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"Виберіть дату\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"Змінити дату\",\n /**\n * Shown when there is something to close\n */\n close: \"Закрити\",\n /**\n * Shown when there is something to open.\n */\n open: \"Відкрити\"\n};\nvar validation42 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `Будь ласка, прийміть ${name}.`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `Дата ${sentence(name)} повинна бути пізніше за ${date(args[0])}.`;\n }\n return `Дата ${sentence(name)} має бути в майбутньому.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `Поле ${sentence(name)} може містити лише літери.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `Поле ${sentence(name)} може містити лише літери та цифри.`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `Поле ${sentence(name)} може містити лише літери та пробіли.`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `${sentence(name)} повинен містити алфавітні символи.`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `${sentence(name)} повинен містити букви або цифри.`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `${sentence(name)} повинен містити літери або пробіли.`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `${sentence(name)} повинен містити символ.`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `${sentence(name)} повинен містити великі регістри.`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `${sentence(name)} повинен містити малі регістри.`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `${sentence(name)} повинен містити цифри.`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `${sentence(name)} має бути символом.`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `${sentence(name)} може містити лише великі літери.`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `${sentence(name)} може містити лише малі літери.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `Дата ${sentence(name)} повинна бути раніше за ${date(args[0])}.`;\n }\n return `Дата ${sentence(name)} повинна бути в минулому.`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `Це поле заповнено неправильно і не може бути надіслано.`;\n }\n const [a, b] = order(args[0], args[1]);\n return `Поле ${sentence(name)} повинно бути між ${a} та ${b}.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `Поле ${sentence(name)} не збігається.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `Поле ${sentence(\n name\n )} має неправильну дату. Будь ласка, використовуйте формат ${args[0]}.`;\n }\n return \"Це поле заповнено неправильно і не може бути надіслано.\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `Дата ${sentence(name)} повинна бути між ${date(args[0])} та ${date(\n args[1]\n )}.`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"Будь ласка, введіть дійсну електронну адресу.\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `Поле ${sentence(name)} не повинно закінчуватися на ${list(args)}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `Поле ${sentence(name)} має неприпустиме значення.`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `Поле ${sentence(name)} має містити щонайменше один символ.`;\n }\n if (min == 0 && max) {\n return `Довжина поля ${sentence(\n name\n )} повинна бути меншою або дорівнювати ${max} символам.`;\n }\n if (min === max) {\n return `${sentence(name)} має бути довжиною ${max} символів.`;\n }\n if (min && max === Infinity) {\n return `Довжина поля ${sentence(\n name\n )} повинна бути більшою або дорівнювати ${min} символам.`;\n }\n return `Довжина поля ${sentence(\n name\n )} повинна бути між ${min} та ${max} символами.`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `Поле ${sentence(name)} має неприпустиме значення.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Не може бути вибрано більше ніж ${args[0]} ${name}.`;\n }\n return `Поле ${sentence(name)} має бути менше або дорівнювати ${args[0]}.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"Не вказано дозволені типи файлів.\";\n }\n return `Тип файлу в полі ${sentence(name)} має бути: ${args[0]}.`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `Не може бути вибрано менше ніж ${args[0]} ${name}.`;\n }\n return `Поле ${sentence(name)} має бути не менше ніж ${args[0]}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `“${value}” не дозволено в полі ${name}.`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `Поле ${sentence(name)} має бути числом.`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\" або \")} потрібно.`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `Поле ${sentence(name)} є обов'язковим.`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `Поле ${sentence(name)} має починатися з ${list(args)}.`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `Будь ласка, введіть коректну URL-адресу.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"Вибрана дата недійсна.\"\n};\nvar uk = { ui: ui42, validation: validation42 };\nvar ui43 = {\n /**\n * Shown on a button for adding additional items.\n */\n add: \"Qo'shish\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"O'chirish\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"Hammasini o'chirish\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"Kechirasiz, barcha maydonlar to'g'ri to'ldirilmagan.\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"Yuborish\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"Hech qanday fayl tanlanmagan\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"Yuqoriga ko’taring\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"Pastga siljish\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"Yuklanmoqda...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"Ko’proq yuklang\",\n /**\n * Shown on buttons that navigate state forward\n */\n next: \"Keyingi\",\n /**\n * Shown on buttons that navigate state backward\n */\n prev: \"Oldingi\",\n /**\n * Shown when adding all values.\n */\n addAllValues: `Barcha qiymatlarni qo'shish`,\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: `Tanlangan qiymatlarni qoʻshish`,\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"Barcha qiymatlarni olib tashlang\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"Tanlangan qiymatlarni olib tashlash\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"Sanani tanlang\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: `O'zgartirish sanasi`,\n /**\n * Shown when there is something to close\n */\n close: \"Yopish\",\n /**\n * Shown when there is something to open.\n */\n open: \"Ochiq\"\n};\nvar validation43 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `${name} ni qabul qiling.`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} ${date(args[0])} dan keyin bo'lishi kerak.`;\n }\n return `${sentence(name)} kelajakda bo'lishi kerak.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(\n name\n )} faqat alifbo tartibidagi belgilardan iborat bo'lishi mumkin.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)} faqat harflar va raqamlardan iborat bo'lishi mumkin.`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)} faqat harf va bo'shliqlardan iborat bo'lishi mumkin.`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `${sentence(name)} alfavit belgilarini o'z ichiga olishi kerak.`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `${sentence(name)} harflar yoki raqamlarni o'z ichiga olishi kerak.`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `${sentence(name)} harflar yoki bo'shliqlar bo'lishi kerak.`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `${sentence(name)} belgisi bo'lishi kerak.`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `${sentence(name)} katta harfni o'z ichiga olishi kerak.`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `${sentence(name)} kichik harflarni o'z ichiga olishi kerak.`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `${sentence(name)} raqamlarini o'z ichiga olishi kerak.`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `${sentence(name)} belgisi bo'lishi kerak.`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `${sentence(name)} faqat katta harflarni o'z ichiga olishi mumkin.`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `${sentence(name)} faqat kichik harflarni o'z ichiga olishi mumkin.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} ${date(args[0])} dan oldin bo'lishi kerak`;\n }\n return `${sentence(name)} o'tmishda bo'lishi kerak.`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `Bu maydon noto'g'ri sozlangan va uni yuborib bo'lmaydi.`;\n }\n const [a, b] = order(args[0], args[1]);\n return `${sentence(name)} ${a} va ${b} orasida bo'lishi kerak.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} mos emas.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} haqiqiy sana emas, iltimos ${args[0]} formatidan foydalaning`;\n }\n return \"Bu maydon noto'g'ri sozlangan va uni yuborib bo'lmaydi\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)} ${date(args[0])} va ${date(\n args[1]\n )} oralig'ida bo'lishi kerak`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"Iltimos amaldagi e-mail manzilingizni kiriting.\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)} ${list(args)} bilan tugamaydi.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)} ruxsat etilgan qiymat emas.`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)} kamida bitta belgidan iborat bo'lishi kerak.`;\n }\n if (min == 0 && max) {\n return `${sentence(name)} ${max} ta belgidan kam yoki teng bo'lishi kerak.`;\n }\n if (min === max) {\n return `${sentence(name)} bo'lishi kerak ${max} belgilar uzun.`;\n }\n if (min && max === Infinity) {\n return `${sentence(name)} ${min} ta belgidan ko'p yoki teng bo'lishi kerak.`;\n }\n return `${sentence(\n name\n )} ${min} va ${max} gacha belgilardan iborat bo'lishi kerak.`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)} ruxsat etilgan qiymat emas.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `${args[0]} ${name} dan ortiq bo'lishi mumkin emas.`;\n }\n return `${sentence(name)} ${args[0]} dan kichik yoki teng bo'lishi kerak.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"Fayl formatlariga ruxsat berilmagan.\";\n }\n return `${sentence(name)} quyidagi turdagi bo'lishi kerak: ${args[0]}`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `${args[0]} ${name} dan kam bo'lmasligi kerak.`;\n }\n return `${sentence(name)} kamida ${args[0]} bo'lishi kerak.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `\"${value}\" ruxsat berilmagan ${name}.`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)} raqam bo'lishi kerak.`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\" yoki \")} kerak.`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `${sentence(name)} talab qilinadi.`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)} ${list(args)} bilan boshlanmaydi.`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `Iltimos, tegishli URL manzilini kiriting.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"Tanlangan sana yaroqsiz.\"\n};\nvar uz = { ui: ui43, validation: validation43 };\nvar ui44 = {\n /**\n * Shown on buttons for adding new items.\n */\n add: \"Thêm\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"Xoá\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"Xoá tất cả\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"Xin lỗi, không phải tất cả các trường đều được nhập đúng.\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"Gửi\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"Chưa chọn file\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"Di chuyển lên\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"Di chuyển xuống\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"Đang tải...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"Tải thêm\",\n /**\n * Shown on buttons that navigate state forward\n */\n next: \"Tiếp\",\n /**\n * Shown on buttons that navigate state backward\n */\n prev: \"Trước\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"Thêm tất cả các giá trị\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"Thêm các giá trị đã chọn\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"Loại bỏ tất cả các giá trị\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"Loại bỏ các giá trị đã chọn\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"Chọn ngày\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"Thay đổi ngày\",\n /**\n * Shown when there is something to close\n */\n close: \"Đóng\",\n /**\n * Shown when there is something to open.\n */\n open: \"Mở\"\n};\nvar validation44 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `Hãy đồng ý với ${name}.`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} phải sau ${date(args[0])}.`;\n }\n return `${sentence(name)} phải trong tương lai.`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(name)} có thể chỉ bao gồm các chữ cái alphabet.`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)} có thể chỉ bao gồm các chữ cái và chữ số.`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)} chỉ có thể chứa các chữ cái và khoảng trắng.`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `${sentence(name)} phải chứa các ký tự chữ cái.`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `${sentence(name)} phải chứa chữ cái hoặc số.`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `${sentence(name)} phải chứa chữ cái hoặc dấu cách.`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `${sentence(name)} phải chứa ký hiệu.`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `${sentence(name)} phải chứa chữ hoa.`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `${sentence(name)} phải chứa chữ thường.`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `${sentence(name)} phải chứa số.`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `${sentence(name)} phải là một ký hiệu.`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `${sentence(name)} chỉ có thể chứa chữ hoa.`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `${sentence(name)} chỉ có thể chứa chữ thường.`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} phải trước ${date(args[0])}.`;\n }\n return `${sentence(name)} phải trong quá khứ.`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `Trường này đã được thiết lập sai và không thể gửi.`;\n }\n const [a, b] = order(args[0], args[1]);\n return `${sentence(name)} phải ở giữa ${a} và ${b}.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} không khớp.`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} không phải ngày hợp lệ, hãy sử dụng định dạng ${args[0]}`;\n }\n return \"Trường này đã được thiết lập sai và không thể gửi.\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)} phải ở giữa khoảng từ ${date(args[0])} đến ${date(\n args[1]\n )}.`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"Hãy nhập một địa chỉ email hợp lệ.\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)} không kết thúc với ${list(args)}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)} không phải một giá trị được cho phép.`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)} phải có độ dài tối thiểu một ký tự.`;\n }\n if (min == 0 && max) {\n return `${sentence(name)} phải có độ dài tối đa ${max} ký tự.`;\n }\n if (min === max) {\n return `${sentence(name)} nên dài ${max} ký tự.`;\n }\n if (min && max === Infinity) {\n return `${sentence(name)} phải có độ dài tối thiểu ${min} ký tự.`;\n }\n return `${sentence(\n name\n )} phải có độ dài tối đa trong khoảng từ ${min} đến ${max} ký tự.`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)} không phải một giá trị được cho phép.`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `${name} không thể lớn hơn ${args[0]}.`;\n }\n return `${sentence(name)} phải tối đa bằng ${args[0]}.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"Định dạng tệp tin này không được phép.\";\n }\n return `${sentence(name)} phải là một trong các dạng: ${args[0]}`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `${name} không thể nhỏ hơn ${args[0]}.`;\n }\n return `${sentence(name)} phải tối thiểu bằng ${args[0]}.`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `\"${value}\" không phải giá trị ${name} được phép.`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)} phải là một số.`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\" hoặc \")} cần có.`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `${sentence(name)} là bắt buộc.`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)} không bắt đầu với ${list(args)}.`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `Vui lòng nhập một URL hợp lệ.`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"Ngày đã chọn không hợp lệ.\"\n};\nvar vi = { ui: ui44, validation: validation44 };\nvar ui45 = {\n /**\n * Shown on a button for adding additional items.\n */\n add: \"添加\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"移除\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"移除全部\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"抱歉,部分字段未被正确填写。\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"提交\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"未选择文件\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"上移\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"下移\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"加载中...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"加载更多\",\n /**\n * Shown on buttons that navigate state forward\n */\n next: \"下一步\",\n /**\n * Shown on buttons that navigate state backward\n */\n prev: \"上一步\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"添加所有值\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"添加所选值\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"移除所有值\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"移除所选值\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"选择日期\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"更改日期\",\n /**\n * Shown when there is something to close\n */\n close: \"关闭\",\n /**\n * Shown when there is something to open.\n */\n open: \"打开\"\n};\nvar validation45 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `请接受${name}。`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)}必须晚于${date(args[0])}。`;\n }\n return `${sentence(name)}必须是未来的日期。`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(name)}只能包含英文字母。`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)}只能包含字母和数字。`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)}只能包含字母和空格。`;\n },\n /**\n * The value have no letter.\n * @see {@link https://formkit.com/essentials/validation#contains_alpha}\n */\n contains_alpha({ name }) {\n return `${sentence(name)} 必须包含字母字符`;\n },\n /**\n * The value have no alphanumeric\n * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}\n */\n contains_alphanumeric({ name }) {\n return `${sentence(name)} 必须包含字母或数字。`;\n },\n /**\n * The value have no letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}\n */\n contains_alpha_spaces({ name }) {\n return `${sentence(name)} 必须包含字母或空格。`;\n },\n /**\n * The value have no symbol\n * @see {@link https://formkit.com/essentials/validation#contains_symbol}\n */\n contains_symbol({ name }) {\n return `${sentence(name)} 必须包含符号。`;\n },\n /**\n * The value have no uppercase\n * @see {@link https://formkit.com/essentials/validation#contains_uppercase}\n */\n contains_uppercase({ name }) {\n return `${sentence(name)} 必须包含大写字母。`;\n },\n /**\n * The value have no lowercase\n * @see {@link https://formkit.com/essentials/validation#contains_lowercase}\n */\n contains_lowercase({ name }) {\n return `${sentence(name)} 必须包含小写字母。`;\n },\n /**\n * The value have no numeric\n * @see {@link https://formkit.com/essentials/validation#contains_numeric}\n */\n contains_numeric({ name }) {\n return `${sentence(name)} 必须包含数字。`;\n },\n /**\n * The value is not symbol\n * @see {@link https://formkit.com/essentials/validation#symbol}\n */\n symbol({ name }) {\n return `${sentence(name)} 必须是符号。`;\n },\n /**\n * The value is not uppercase\n * @see {@link https://formkit.com/essentials/validation#uppercase}\n */\n uppercase({ name }) {\n return `${sentence(name)} 只能包含大写字母。`;\n },\n /**\n * The value is not lowercase\n * @see {@link https://formkit.com/essentials/validation#lowercase}\n */\n lowercase({ name }) {\n return `${sentence(name)} 只能包含小写字母。`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)}必须早于${date(args[0])}。`;\n }\n return `${sentence(name)}必须是过去的日期。`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `该字段未被正确设置而无法提交。`;\n }\n const [a, b] = order(args[0], args[1]);\n return `${sentence(name)}必须在${a}和${b}之间。`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)}不匹配。`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)}不是合法日期,请使用 ${args[0]} 格式`;\n }\n return \"该字段未被正确设置而无法提交\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)}必须在${date(args[0])}和${date(args[1])}之间`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"请输入合法的电子邮件地址。\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)}必须以${list(args)}结尾。`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)}是不允许的。`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)}至少要有一个字符。`;\n }\n if (min == 0 && max) {\n return `${sentence(name)}必须少于或等于${max}个字符。`;\n }\n if (min === max) {\n return `${sentence(name)}必须包含${max}个字符。`;\n }\n if (min && max === Infinity) {\n return `${sentence(name)}必须多于或等于${min}个字符。`;\n }\n return `${sentence(name)}必须介于${min}和${max}个字符之间。`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)}是不允许的。`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `${name}不得多于${args[0]}个值。`;\n }\n return `${name}不得大于${args[0]}。`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"没有允许的文件格式。\";\n }\n return `${sentence(name)}的类型必须为:${args[0]}`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `${name}不得少于${args[0]}个值。`;\n }\n return `${sentence(name)}不得小于${args[0]}。`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `\"${value}\"不是一个合法的${name}。`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)}必须为数字。`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\"或\")}${labels}需要。`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `${sentence(name)}不得留空。`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)}必须以${list(args)}开头。`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `请输入有效的 URL。`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"所选日期无效。\"\n};\nvar zh = { ui: ui45, validation: validation45 };\nvar ui46 = {\n /**\n * Shown on a button for adding additional items.\n */\n add: \"新增\",\n /**\n * Shown when a button to remove items is visible.\n */\n remove: \"移除\",\n /**\n * Shown when there are multiple items to remove at the same time.\n */\n removeAll: \"移除全部\",\n /**\n * Shown when all fields are not filled out correctly.\n */\n incomplete: \"很抱歉,部分欄位填寫錯誤\",\n /**\n * Shown in a button inside a form to submit the form.\n */\n submit: \"提交\",\n /**\n * Shown when no files are selected.\n */\n noFiles: \"尚未選取檔案\",\n /**\n * Shown on buttons that move fields up in a list.\n */\n moveUp: \"上移\",\n /**\n * Shown on buttons that move fields down in a list.\n */\n moveDown: \"下移\",\n /**\n * Shown when something is actively loading.\n */\n isLoading: \"載入中...\",\n /**\n * Shown when there is more to load.\n */\n loadMore: \"載入更多\",\n /**\n * Show on buttons that navigate state forward\n */\n next: \"下一個\",\n /**\n * Show on buttons that navigate state backward\n */\n prev: \"上一個\",\n /**\n * Shown when adding all values.\n */\n addAllValues: \"加入全部的值\",\n /**\n * Shown when adding selected values.\n */\n addSelectedValues: \"加入選取的值\",\n /**\n * Shown when removing all values.\n */\n removeAllValues: \"移除全部的值\",\n /**\n * Shown when removing selected values.\n */\n removeSelectedValues: \"移除選取的值\",\n /**\n * Shown when there is a date to choose.\n */\n chooseDate: \"選擇日期\",\n /**\n * Shown when there is a date to change.\n */\n changeDate: \"變更日期\",\n /**\n * Shown when there is something to close\n */\n close: \"關閉\",\n /**\n * Shown when there is something to open.\n */\n open: \"開放\"\n};\nvar validation46 = {\n /**\n * The value is not an accepted value.\n * @see {@link https://formkit.com/essentials/validation#accepted}\n */\n accepted({ name }) {\n return `請接受 ${name}`;\n },\n /**\n * The date is not after\n * @see {@link https://formkit.com/essentials/validation#date-after}\n */\n date_after({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} 必須晚於 ${date(args[0])}`;\n }\n return `${sentence(name)} 必須晚於今日`;\n },\n /**\n * The value is not a letter.\n * @see {@link https://formkit.com/essentials/validation#alpha}\n */\n alpha({ name }) {\n return `${sentence(name)} 欄位儘能填寫英文字母`;\n },\n /**\n * The value is not alphanumeric\n * @see {@link https://formkit.com/essentials/validation#alphanumeric}\n */\n alphanumeric({ name }) {\n return `${sentence(name)} 欄位僅能填寫英文字母與數字`;\n },\n /**\n * The value is not letter and/or spaces\n * @see {@link https://formkit.com/essentials/validation#alpha-spaces}\n */\n alpha_spaces({ name }) {\n return `${sentence(name)} 欄位儘能填寫英文字母與空白`;\n },\n /**\n * The date is not before\n * @see {@link https://formkit.com/essentials/validation#date-before}\n */\n date_before({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} 必須早於 ${date(args[0])}.`;\n }\n return `${sentence(name)} 必須早於今日`;\n },\n /**\n * The value is not between two numbers\n * @see {@link https://formkit.com/essentials/validation#between}\n */\n between({ name, args }) {\n if (isNaN(args[0]) || isNaN(args[1])) {\n return `欄位值錯誤,無法提交`;\n }\n const [a, b] = order(args[0], args[1]);\n return `${sentence(name)} 必須介於 ${a} 和 ${b}.`;\n },\n /**\n * The confirmation field does not match\n * @see {@link https://formkit.com/essentials/validation#confirm}\n */\n confirm({ name }) {\n return `${sentence(name)} 與目標不一致`;\n },\n /**\n * The value is not a valid date\n * @see {@link https://formkit.com/essentials/validation#date-format}\n */\n date_format({ name, args }) {\n if (Array.isArray(args) && args.length) {\n return `${sentence(name)} 不是有效的日期,請使用 ${args[0]} 格式`;\n }\n return \"欄位值錯誤,無法提交\";\n },\n /**\n * Is not within expected date range\n * @see {@link https://formkit.com/essentials/validation#date-between}\n */\n date_between({ name, args }) {\n return `${sentence(name)} 必須介於 ${date(args[0])} 和 ${date(args[1])}`;\n },\n /**\n * Shown when the user-provided value is not a valid email address.\n * @see {@link https://formkit.com/essentials/validation#email}\n */\n email: \"請輸入有效的 email\",\n /**\n * Does not end with the specified value\n * @see {@link https://formkit.com/essentials/validation#ends-with}\n */\n ends_with({ name, args }) {\n return `${sentence(name)} 的結尾必須是 ${list(args)}`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#is}\n */\n is({ name }) {\n return `${sentence(name)} 欄位的值不合規則`;\n },\n /**\n * Does not match specified length\n * @see {@link https://formkit.com/essentials/validation#length}\n */\n length({ name, args: [first = 0, second = Infinity] }) {\n const min = Number(first) <= Number(second) ? first : second;\n const max = Number(second) >= Number(first) ? second : first;\n if (min == 1 && max === Infinity) {\n return `${sentence(name)} 欄位必須至少包含一個字`;\n }\n if (min == 0 && max) {\n return `${sentence(name)} 的字數必須小於等於 ${max}`;\n }\n if (min === max) {\n return `${sentence(name)} 的字數必須為 ${max}`;\n }\n if (min && max === Infinity) {\n return `${sentence(name)} 的字數必須大於等於 ${min}`;\n }\n return `${sentence(name)} 的字數必須介於 ${min} 和 ${max}`;\n },\n /**\n * Value is not a match\n * @see {@link https://formkit.com/essentials/validation#matches}\n */\n matches({ name }) {\n return `${sentence(name)} 欄位的值無效`;\n },\n /**\n * Exceeds maximum allowed value\n * @see {@link https://formkit.com/essentials/validation#max}\n */\n max({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `不能超過 ${args[0]} 個 ${name}.`;\n }\n return `${sentence(name)} 必須小於等於 ${args[0]}.`;\n },\n /**\n * The (field-level) value does not match specified mime type\n * @see {@link https://formkit.com/essentials/validation#mime}\n */\n mime({ name, args }) {\n if (!args[0]) {\n return \"非有效的檔案格式\";\n }\n return `${sentence(name)} 可接受的檔案格式為: ${args[0]}`;\n },\n /**\n * Does not fulfill minimum allowed value\n * @see {@link https://formkit.com/essentials/validation#min}\n */\n min({ name, node: { value }, args }) {\n if (Array.isArray(value)) {\n return `不可少於 ${args[0]} 個 ${name}`;\n }\n return `${name} 必須大於等於 ${args[0]}`;\n },\n /**\n * Is not an allowed value\n * @see {@link https://formkit.com/essentials/validation#not}\n */\n not({ name, node: { value } }) {\n return `“${value}” 不是 ${name} 欄位可接受的值`;\n },\n /**\n * Is not a number\n * @see {@link https://formkit.com/essentials/validation#number}\n */\n number({ name }) {\n return `${sentence(name)} 欄位必須是數字`;\n },\n /**\n * Require one field.\n * @see {@link https://formkit.com/essentials/validation#require-one}\n */\n require_one: ({ name, node, args: inputNames }) => {\n const labels = inputNames.map((name2) => {\n const dependentNode = node.at(name2);\n if (dependentNode) {\n return createMessageName(dependentNode);\n }\n return false;\n }).filter((name2) => !!name2);\n labels.unshift(name);\n return `${labels.join(\"或\")}${labels}需要。`;\n },\n /**\n * Required field.\n * @see {@link https://formkit.com/essentials/validation#required}\n */\n required({ name }) {\n return `${sentence(name)} 是必要欄位`;\n },\n /**\n * Does not start with specified value\n * @see {@link https://formkit.com/essentials/validation#starts-with}\n */\n starts_with({ name, args }) {\n return `${sentence(name)} 的開頭必須是 ${list(args)}`;\n },\n /**\n * Is not a url\n * @see {@link https://formkit.com/essentials/validation#url}\n */\n url() {\n return `請輸入有效的 url`;\n },\n /**\n * Shown when the date is invalid.\n */\n invalidDate: \"選取的日期無效\"\n};\nvar zhTW = { ui: ui46, validation: validation46 };\nvar i18nNodes = /* @__PURE__ */ new Set();\nvar activeLocale = null;\nfunction createI18nPlugin(registry) {\n return function i18nPlugin(node) {\n i18nNodes.add(node);\n if (activeLocale)\n node.config.locale = activeLocale;\n node.on(\"destroying\", () => i18nNodes.delete(node));\n let localeKey = parseLocale(node.config.locale, registry);\n let locale = localeKey ? registry[localeKey] : {};\n node.on(\"prop:locale\", ({ payload: lang }) => {\n localeKey = parseLocale(lang, registry);\n locale = localeKey ? registry[localeKey] : {};\n node.store.touch();\n });\n node.on(\"prop:label\", () => node.store.touch());\n node.on(\"prop:validationLabel\", () => node.store.touch());\n node.hook.text((fragment, next) => {\n const key = fragment.meta?.messageKey || fragment.key;\n if (has(locale, fragment.type) && has(locale[fragment.type], key)) {\n const t = locale[fragment.type][key];\n if (typeof t === \"function\") {\n fragment.value = Array.isArray(fragment.meta?.i18nArgs) ? t(...fragment.meta.i18nArgs) : t(fragment);\n } else {\n fragment.value = t;\n }\n }\n return next(fragment);\n });\n };\n}\nfunction parseLocale(locale, availableLocales) {\n if (has(availableLocales, locale)) {\n return locale;\n }\n const [lang] = locale.split(\"-\");\n if (has(availableLocales, lang)) {\n return lang;\n }\n for (const locale2 in availableLocales) {\n return locale2;\n }\n return false;\n}\nfunction changeLocale(locale) {\n activeLocale = locale;\n for (const node of i18nNodes) {\n node.config.locale = locale;\n }\n}\n\n// packages/i18n/src/index.ts\nvar locales = {\n ar,\n az,\n bg,\n bs,\n ca,\n cs,\n da,\n de,\n el,\n en,\n es,\n fa,\n fi,\n fr,\n fy,\n he,\n hr,\n hu,\n id,\n it,\n ja,\n kk,\n ko,\n lt,\n lv,\n nb,\n nl,\n pl,\n pt,\n ro,\n ru,\n sk,\n sl,\n sr,\n sv,\n tet,\n tg,\n th,\n tr,\n uk,\n uz,\n vi,\n zh,\n \"zh-TW\": zhTW,\n is,\n mn\n};\n\nexport { ar, az, bg, bs, ca, changeLocale, createI18nPlugin, cs, da, date, de, el, en, es, fa, fi, fr, fy, he, hr, hu, id, is, it, ja, kk, ko, list, locales, lt, lv, mn, nb, nl, order, pl, pt, ro, ru, sentence, sk, sl, sr, sv, tet, tg, th, tr, uk, uz, vi, zh, zhTW };\n//# sourceMappingURL=out.js.map\n//# sourceMappingURL=index.mjs.map","import { extend, camel, has, slugify, undefine, eq, token, clone, isObject, isPojo } from '@formkit/utils';\nimport { createMessage, warn, isConditional, isComponent, isDOM } from '@formkit/core';\n\n// packages/inputs/src/plugin.ts\nfunction createLibraryPlugin(...libraries) {\n const library = libraries.reduce(\n (merged, lib) => extend(merged, lib),\n {}\n );\n const plugin = () => {\n };\n plugin.library = function(node) {\n const type = camel(node.props.type);\n if (has(library, type)) {\n node.define(library[type]);\n }\n };\n return plugin;\n}\n\n// packages/inputs/src/props.ts\nvar runtimeProps = [\n \"classes\",\n \"config\",\n \"delay\",\n \"errors\",\n \"id\",\n \"index\",\n \"inputErrors\",\n \"library\",\n \"modelValue\",\n \"onUpdate:modelValue\",\n \"name\",\n \"number\",\n \"parent\",\n \"plugins\",\n \"sectionsSchema\",\n \"type\",\n \"validation\",\n \"validationLabel\",\n \"validationMessages\",\n \"validationRules\",\n // Runtime event props:\n \"onInput\",\n \"onInputRaw\",\n \"onUpdate:modelValue\",\n \"onNode\",\n \"onSubmit\",\n \"onSubmitInvalid\",\n \"onSubmitRaw\"\n];\nfunction isGroupOption(option2) {\n return option2 && typeof option2 === \"object\" && \"group\" in option2 && Array.isArray(option2.options);\n}\nfunction normalizeOptions(options2, i = { count: 1 }) {\n if (Array.isArray(options2)) {\n return options2.map(\n (option2) => {\n if (typeof option2 === \"string\" || typeof option2 === \"number\") {\n return {\n label: String(option2),\n value: String(option2)\n };\n }\n if (typeof option2 == \"object\") {\n if (\"group\" in option2) {\n option2.options = normalizeOptions(option2.options || [], i);\n return option2;\n } else if (\"value\" in option2 && typeof option2.value !== \"string\") {\n Object.assign(option2, {\n value: `__mask_${i.count++}`,\n __original: option2.value\n });\n }\n }\n return option2;\n }\n );\n }\n return Object.keys(options2).map((value) => {\n return {\n label: options2[value],\n value\n };\n });\n}\nfunction optionValue(options2, value, undefinedIfNotFound = false) {\n if (Array.isArray(options2)) {\n for (const option2 of options2) {\n if (typeof option2 !== \"object\" && option2)\n continue;\n if (isGroupOption(option2)) {\n const found = optionValue(option2.options, value, true);\n if (found !== void 0) {\n return found;\n }\n } else if (value == option2.value) {\n return \"__original\" in option2 ? option2.__original : option2.value;\n }\n }\n }\n return undefinedIfNotFound ? void 0 : value;\n}\nfunction shouldSelect(valueA, valueB) {\n if (valueA === null && valueB === void 0 || valueA === void 0 && valueB === null)\n return false;\n if (valueA == valueB)\n return true;\n if (isPojo(valueA) && isPojo(valueB))\n return eq(valueA, valueB);\n return false;\n}\nfunction options(node) {\n node.hook.prop((prop, next) => {\n var _a;\n if (prop.prop === \"options\") {\n if (typeof prop.value === \"function\") {\n node.props.optionsLoader = prop.value;\n prop.value = [];\n } else {\n (_a = node.props)._normalizeCounter ?? (_a._normalizeCounter = { count: 1 });\n prop.value = normalizeOptions(prop.value, node.props._normalizeCounter);\n }\n }\n return next(prop);\n });\n}\n// @__NO_SIDE_EFFECTS__\nfunction createSection(section, el, fragment2 = false) {\n return (...children) => {\n const extendable = (extensions) => {\n const node = !el || typeof el === \"string\" ? { $el: el } : el();\n if (isDOM(node) || isComponent(node)) {\n if (!node.meta) {\n node.meta = { section };\n } else {\n node.meta.section = section;\n }\n if (children.length && !node.children) {\n node.children = [\n ...children.map(\n (child) => typeof child === \"function\" ? child(extensions) : child\n )\n ];\n }\n if (isDOM(node)) {\n node.attrs = {\n class: `$classes.${section}`,\n ...node.attrs || {}\n };\n }\n }\n return {\n if: `$slots.${section}`,\n then: `$slots.${section}`,\n else: section in extensions ? /* @__PURE__ */ extendSchema(node, extensions[section]) : node\n };\n };\n extendable._s = section;\n return fragment2 ? /* @__PURE__ */ createRoot(extendable) : extendable;\n };\n}\n// @__NO_SIDE_EFFECTS__\nfunction createRoot(rootSection) {\n return (extensions) => {\n return [rootSection(extensions)];\n };\n}\nfunction isSchemaObject(schema) {\n return !!(schema && typeof schema === \"object\" && (\"$el\" in schema || \"$cmp\" in schema || \"$formkit\" in schema));\n}\n// @__NO_SIDE_EFFECTS__\nfunction extendSchema(schema, extension = {}) {\n if (typeof schema === \"string\") {\n return isSchemaObject(extension) || typeof extension === \"string\" ? extension : schema;\n } else if (Array.isArray(schema)) {\n return isSchemaObject(extension) ? extension : schema;\n }\n return extend(schema, extension);\n}\n\n// packages/inputs/src/sections/actions.ts\nvar actions = createSection(\"actions\", () => ({\n $el: \"div\",\n if: \"$actions\"\n}));\n\n// packages/inputs/src/sections/box.ts\nvar box = createSection(\"input\", () => ({\n $el: \"input\",\n bind: \"$attrs\",\n attrs: {\n type: \"$type\",\n name: \"$node.props.altName || $node.name\",\n disabled: \"$option.attrs.disabled || $disabled\",\n onInput: \"$handlers.toggleChecked\",\n checked: \"$fns.eq($_value, $onValue)\",\n onBlur: \"$handlers.blur\",\n value: \"$: true\",\n id: \"$id\",\n \"aria-describedby\": {\n if: \"$options.length\",\n then: {\n if: \"$option.help\",\n then: '$: \"help-\" + $option.attrs.id',\n else: void 0\n },\n else: {\n if: \"$help\",\n then: '$: \"help-\" + $id',\n else: void 0\n }\n }\n }\n}));\n\n// packages/inputs/src/sections/boxHelp.ts\nvar boxHelp = createSection(\"optionHelp\", () => ({\n $el: \"div\",\n if: \"$option.help\",\n attrs: {\n id: '$: \"help-\" + $option.attrs.id'\n }\n}));\n\n// packages/inputs/src/sections/boxInner.ts\nvar boxInner = createSection(\"inner\", \"span\");\n\n// packages/inputs/src/sections/boxLabel.ts\nvar boxLabel = createSection(\"label\", \"span\");\n\n// packages/inputs/src/sections/boxOption.ts\nvar boxOption = createSection(\"option\", () => ({\n $el: \"li\",\n for: [\"option\", \"$options\"],\n attrs: {\n \"data-disabled\": \"$option.attrs.disabled || $disabled || undefined\"\n }\n}));\n\n// packages/inputs/src/sections/boxOptions.ts\nvar boxOptions = createSection(\"options\", \"ul\");\n\n// packages/inputs/src/sections/boxWrapper.ts\nvar boxWrapper = createSection(\"wrapper\", () => ({\n $el: \"label\",\n attrs: {\n \"data-disabled\": {\n if: \"$options.length\",\n then: void 0,\n else: \"$disabled || undefined\"\n },\n \"data-checked\": {\n if: \"$options == undefined\",\n then: \"$fns.eq($_value, $onValue) || undefined\",\n else: \"$fns.isChecked($option.value) || undefined\"\n }\n }\n}));\n\n// packages/inputs/src/sections/buttonInput.ts\nvar buttonInput = createSection(\"input\", () => ({\n $el: \"button\",\n bind: \"$attrs\",\n attrs: {\n type: \"$type\",\n disabled: \"$disabled\",\n name: \"$node.name\",\n id: \"$id\"\n }\n}));\n\n// packages/inputs/src/sections/buttonLabel.ts\nvar buttonLabel = createSection(\"default\", null);\n\n// packages/inputs/src/sections/decorator.ts\nvar decorator = createSection(\"decorator\", () => ({\n $el: \"span\",\n attrs: {\n \"aria-hidden\": \"true\"\n }\n}));\n\n// packages/inputs/src/sections/fieldset.ts\nvar fieldset = createSection(\"fieldset\", () => ({\n $el: \"fieldset\",\n attrs: {\n id: \"$id\",\n \"aria-describedby\": {\n if: \"$help\",\n then: '$: \"help-\" + $id',\n else: void 0\n }\n }\n}));\n\n// packages/inputs/src/sections/fileInput.ts\nvar fileInput = createSection(\"input\", () => ({\n $el: \"input\",\n bind: \"$attrs\",\n attrs: {\n type: \"file\",\n disabled: \"$disabled\",\n name: \"$node.name\",\n onChange: \"$handlers.files\",\n onBlur: \"$handlers.blur\",\n id: \"$id\",\n \"aria-describedby\": \"$describedBy\",\n \"aria-required\": \"$state.required || undefined\"\n }\n}));\n\n// packages/inputs/src/sections/fileItem.ts\nvar fileItem = createSection(\"fileItem\", () => ({\n $el: \"li\",\n for: [\"file\", \"$value\"]\n}));\n\n// packages/inputs/src/sections/fileList.ts\nvar fileList = createSection(\"fileList\", () => ({\n $el: \"ul\",\n if: \"$value.length\",\n attrs: {\n \"data-has-multiple\": \"$_hasMultipleFiles\"\n }\n}));\n\n// packages/inputs/src/sections/fileName.ts\nvar fileName = createSection(\"fileName\", () => ({\n $el: \"span\",\n attrs: {\n class: \"$classes.fileName\"\n }\n}));\n\n// packages/inputs/src/sections/fileRemove.ts\nvar fileRemove = createSection(\"fileRemove\", () => ({\n $el: \"button\",\n attrs: {\n type: \"button\",\n onClick: \"$handlers.resetFiles\"\n }\n}));\n\n// packages/inputs/src/sections/formInput.ts\nvar formInput = createSection(\"form\", () => ({\n $el: \"form\",\n bind: \"$attrs\",\n meta: {\n autoAnimate: true\n },\n attrs: {\n id: \"$id\",\n name: \"$node.name\",\n onSubmit: \"$handlers.submit\",\n \"data-loading\": \"$state.loading || undefined\"\n }\n}));\n\n// packages/inputs/src/sections/fragment.ts\nvar fragment = createSection(\"wrapper\", null, true);\n\n// packages/inputs/src/sections/help.ts\nvar help = createSection(\"help\", () => ({\n $el: \"div\",\n if: \"$help\",\n attrs: {\n id: '$: \"help-\" + $id'\n }\n}));\n\n// packages/inputs/src/sections/icon.ts\nvar icon = (sectionKey, el) => {\n return createSection(`${sectionKey}Icon`, () => {\n const rawIconProp = `_raw${sectionKey.charAt(0).toUpperCase()}${sectionKey.slice(1)}Icon`;\n return {\n if: `$${sectionKey}Icon && $${rawIconProp}`,\n $el: `${el ? el : \"span\"}`,\n attrs: {\n class: `$classes.${sectionKey}Icon + \" \" + $classes.icon`,\n innerHTML: `$${rawIconProp}`,\n onClick: `$handlers.iconClick(${sectionKey})`,\n role: `$fns.iconRole(${sectionKey})`,\n tabindex: `$fns.iconRole(${sectionKey}) === \"button\" && \"0\" || undefined`,\n for: {\n if: `${el === \"label\"}`,\n then: \"$id\"\n }\n }\n };\n })();\n};\n\n// packages/inputs/src/sections/inner.ts\nvar inner = createSection(\"inner\", \"div\");\n\n// packages/inputs/src/sections/label.ts\nvar label = createSection(\"label\", () => ({\n $el: \"label\",\n if: \"$label\",\n attrs: {\n for: \"$id\"\n }\n}));\n\n// packages/inputs/src/sections/legend.ts\nvar legend = createSection(\"legend\", () => ({\n $el: \"legend\",\n if: \"$label\"\n}));\n\n// packages/inputs/src/sections/message.ts\nvar message = createSection(\"message\", () => ({\n $el: \"li\",\n for: [\"message\", \"$messages\"],\n attrs: {\n key: \"$message.key\",\n id: `$id + '-' + $message.key`,\n \"data-message-type\": \"$message.type\"\n }\n}));\n\n// packages/inputs/src/sections/messages.ts\nvar messages = createSection(\"messages\", () => ({\n $el: \"ul\",\n if: \"$defaultMessagePlacement && $fns.length($messages)\"\n}));\n\n// packages/inputs/src/sections/noFiles.ts\nvar noFiles = createSection(\"noFiles\", () => ({\n $el: \"span\",\n if: \"$value == null || $value.length == 0\"\n}));\n\n// packages/inputs/src/sections/optGroup.ts\nvar optGroup = createSection(\"optGroup\", () => ({\n $el: \"optgroup\",\n bind: \"$option.attrs\",\n attrs: {\n label: \"$option.group\"\n }\n}));\n\n// packages/inputs/src/sections/option.ts\nvar option = createSection(\"option\", () => ({\n $el: \"option\",\n bind: \"$option.attrs\",\n attrs: {\n class: \"$classes.option\",\n value: \"$option.value\",\n selected: \"$fns.isSelected($option)\"\n }\n}));\n\n// packages/inputs/src/sections/optionSlot.ts\nvar optionSlot = createSection(\"options\", () => ({\n $el: null,\n if: \"$options.length\",\n for: [\"option\", \"$option.options || $options\"]\n}));\n\n// packages/inputs/src/sections/outer.ts\nvar outer = createSection(\"outer\", () => ({\n $el: \"div\",\n meta: {\n autoAnimate: true\n },\n attrs: {\n key: \"$id\",\n \"data-family\": \"$family || undefined\",\n \"data-type\": \"$type\",\n \"data-multiple\": '$attrs.multiple || ($type != \"select\" && $options != undefined) || undefined',\n \"data-has-multiple\": \"$_hasMultipleFiles\",\n \"data-disabled\": '$: ($disabled !== \"false\" && $disabled) || undefined',\n \"data-empty\": \"$state.empty || undefined\",\n \"data-complete\": \"$state.complete || undefined\",\n \"data-invalid\": \"$state.invalid || undefined\",\n \"data-errors\": \"$state.errors || undefined\",\n \"data-submitted\": \"$state.submitted || undefined\",\n \"data-prefix-icon\": \"$_rawPrefixIcon !== undefined || undefined\",\n \"data-suffix-icon\": \"$_rawSuffixIcon !== undefined || undefined\",\n \"data-prefix-icon-click\": \"$onPrefixIconClick !== undefined || undefined\",\n \"data-suffix-icon-click\": \"$onSuffixIconClick !== undefined || undefined\"\n }\n}));\n\n// packages/inputs/src/sections/prefix.ts\nvar prefix = createSection(\"prefix\", null);\n\n// packages/inputs/src/sections/selectInput.ts\nvar selectInput = createSection(\"input\", () => ({\n $el: \"select\",\n bind: \"$attrs\",\n attrs: {\n id: \"$id\",\n \"data-placeholder\": \"$fns.showPlaceholder($_value, $placeholder)\",\n disabled: \"$disabled\",\n class: \"$classes.input\",\n name: \"$node.name\",\n onChange: \"$handlers.onChange\",\n onInput: \"$handlers.selectInput\",\n onBlur: \"$handlers.blur\",\n \"aria-describedby\": \"$describedBy\",\n \"aria-required\": \"$state.required || undefined\"\n }\n}));\n\n// packages/inputs/src/sections/submitInput.ts\nvar submitInput = createSection(\"submit\", () => ({\n $cmp: \"FormKit\",\n bind: \"$submitAttrs\",\n props: {\n type: \"submit\",\n label: \"$submitLabel\"\n }\n}));\n\n// packages/inputs/src/sections/suffix.ts\nvar suffix = createSection(\"suffix\", null);\n\n// packages/inputs/src/sections/textInput.ts\nvar textInput = createSection(\"input\", () => ({\n $el: \"input\",\n bind: \"$attrs\",\n attrs: {\n type: \"$type\",\n disabled: \"$disabled\",\n name: \"$node.name\",\n onInput: \"$handlers.DOMInput\",\n onBlur: \"$handlers.blur\",\n value: \"$_value\",\n id: \"$id\",\n \"aria-describedby\": \"$describedBy\",\n \"aria-required\": \"$state.required || undefined\"\n }\n}));\n\n// packages/inputs/src/sections/textareaInput.ts\nvar textareaInput = createSection(\"input\", () => ({\n $el: \"textarea\",\n bind: \"$attrs\",\n attrs: {\n disabled: \"$disabled\",\n name: \"$node.name\",\n onInput: \"$handlers.DOMInput\",\n onBlur: \"$handlers.blur\",\n value: \"$_value\",\n id: \"$id\",\n \"aria-describedby\": \"$describedBy\",\n \"aria-required\": \"$state.required || undefined\"\n },\n children: \"$initialValue\"\n}));\n\n// packages/inputs/src/sections/wrapper.ts\nvar wrapper = createSection(\"wrapper\", \"div\");\n\n// packages/inputs/src/features/renamesRadios.ts\nvar radioInstance = 0;\nfunction resetRadio() {\n radioInstance = 0;\n}\nfunction renamesRadios(node) {\n if (node.type === \"group\" || node.type === \"list\") {\n node.plugins.add(renamesRadiosPlugin);\n }\n}\nfunction renamesRadiosPlugin(node) {\n if (node.props.type === \"radio\") {\n node.addProps([\"altName\"]);\n node.props.altName = `${node.name}_${radioInstance++}`;\n }\n}\nfunction normalizeBoxes(node) {\n return function(prop, next) {\n if (prop.prop === \"options\" && Array.isArray(prop.value)) {\n prop.value = prop.value.map((option2) => {\n if (!option2.attrs?.id) {\n return extend(option2, {\n attrs: {\n id: `${node.props.id}-option-${slugify(String(option2.value))}`\n }\n });\n }\n return option2;\n });\n if (node.props.type === \"checkbox\" && !Array.isArray(node.value)) {\n if (node.isCreated) {\n node.input([], false);\n } else {\n node.on(\"created\", () => {\n if (!Array.isArray(node.value)) {\n node.input([], false);\n }\n });\n }\n }\n }\n return next(prop);\n };\n}\n\n// packages/inputs/src/features/checkboxes.ts\nfunction toggleChecked(node, e) {\n const el = e.target;\n if (el instanceof HTMLInputElement) {\n const value = Array.isArray(node.props.options) ? optionValue(node.props.options, el.value) : el.value;\n if (Array.isArray(node.props.options) && node.props.options.length) {\n if (!Array.isArray(node._value)) {\n node.input([value]);\n } else if (!node._value.some((existingValue) => shouldSelect(value, existingValue))) {\n node.input([...node._value, value]);\n } else {\n node.input(\n node._value.filter(\n (existingValue) => !shouldSelect(value, existingValue)\n )\n );\n }\n } else {\n if (el.checked) {\n node.input(node.props.onValue);\n } else {\n node.input(node.props.offValue);\n }\n }\n }\n}\nfunction isChecked(node, value) {\n node.context?.value;\n node.context?._value;\n if (Array.isArray(node._value)) {\n return node._value.some(\n (existingValue) => shouldSelect(optionValue(node.props.options, value), existingValue)\n );\n }\n return false;\n}\nfunction checkboxes(node) {\n node.on(\"created\", () => {\n if (node.context?.handlers) {\n node.context.handlers.toggleChecked = toggleChecked.bind(null, node);\n }\n if (node.context?.fns) {\n node.context.fns.isChecked = isChecked.bind(null, node);\n }\n if (!has(node.props, \"onValue\"))\n node.props.onValue = true;\n if (!has(node.props, \"offValue\"))\n node.props.offValue = false;\n });\n node.hook.prop(normalizeBoxes(node));\n}\n\n// packages/inputs/src/features/icon.ts\nfunction defaultIcon(sectionKey, defaultIcon2) {\n return (node) => {\n if (node.props[`${sectionKey}Icon`] === void 0) {\n node.props[`${sectionKey}Icon`] = defaultIcon2.startsWith(\" {\n if (\"disabled\" in node.props) {\n node.props.disabled = undefine(node.props.disabled);\n node.config.disabled = undefine(node.props.disabled);\n }\n });\n node.hook.prop(({ prop, value }, next) => {\n value = prop === \"disabled\" ? undefine(value) : value;\n return next({ prop, value });\n });\n node.on(\"prop:disabled\", ({ payload: value }) => {\n node.config.disabled = undefine(value);\n });\n}\nfunction localize(key, value) {\n return (node) => {\n node.store.set(\n /* @__PURE__ */ createMessage({\n key,\n type: \"ui\",\n value: value || key,\n meta: {\n localize: true,\n i18nArgs: [node]\n }\n })\n );\n };\n}\n\n// packages/inputs/src/features/files.ts\nvar isBrowser = typeof window !== \"undefined\";\nfunction removeHover(e) {\n if (e.target instanceof HTMLElement && e.target.hasAttribute(\"data-file-hover\")) {\n e.target.removeAttribute(\"data-file-hover\");\n }\n}\nfunction preventStrayDrop(type, e) {\n if (!(e.target instanceof HTMLInputElement)) {\n e.preventDefault();\n } else if (type === \"dragover\") {\n e.target.setAttribute(\"data-file-hover\", \"true\");\n }\n if (type === \"drop\") {\n removeHover(e);\n }\n}\nfunction files(node) {\n localize(\"noFiles\", \"Select file\")(node);\n localize(\"removeAll\", \"Remove all\")(node);\n localize(\"remove\")(node);\n node.addProps([\"_hasMultipleFiles\"]);\n if (isBrowser) {\n if (!window._FormKit_File_Drop) {\n window.addEventListener(\n \"dragover\",\n preventStrayDrop.bind(null, \"dragover\")\n );\n window.addEventListener(\"drop\", preventStrayDrop.bind(null, \"drop\"));\n window.addEventListener(\"dragleave\", removeHover);\n window._FormKit_File_Drop = true;\n }\n }\n node.hook.input((value, next) => next(Array.isArray(value) ? value : []));\n node.on(\"input\", ({ payload: value }) => {\n node.props._hasMultipleFiles = Array.isArray(value) && value.length > 1 ? true : void 0;\n });\n node.on(\"reset\", () => {\n if (node.props.id && isBrowser) {\n const el = document.getElementById(node.props.id);\n if (el)\n el.value = \"\";\n }\n });\n node.on(\"created\", () => {\n if (!Array.isArray(node.value))\n node.input([], false);\n if (!node.context)\n return;\n node.context.handlers.resetFiles = (e) => {\n e.preventDefault();\n node.input([]);\n if (node.props.id && isBrowser) {\n const el = document.getElementById(node.props.id);\n if (el)\n el.value = \"\";\n el?.focus();\n }\n };\n node.context.handlers.files = (e) => {\n const files2 = [];\n if (e.target instanceof HTMLInputElement && e.target.files) {\n for (let i = 0; i < e.target.files.length; i++) {\n let file2;\n if (file2 = e.target.files.item(i)) {\n files2.push({ name: file2.name, file: file2 });\n }\n }\n node.input(files2);\n }\n if (node.context)\n node.context.files = files2;\n if (typeof node.props.attrs?.onChange === \"function\") {\n node.props.attrs?.onChange(e);\n }\n };\n });\n}\nvar loading = /* @__PURE__ */ createMessage({\n key: \"loading\",\n value: true,\n visible: false\n});\nasync function handleSubmit(node, submitEvent) {\n const submitNonce = Math.random();\n node.props._submitNonce = submitNonce;\n submitEvent.preventDefault();\n await node.settled;\n if (node.ledger.value(\"validating\")) {\n node.store.set(loading);\n await node.ledger.settled(\"validating\");\n node.store.remove(\"loading\");\n if (node.props._submitNonce !== submitNonce)\n return;\n }\n const setSubmitted = (n) => n.store.set(\n /* @__PURE__ */ createMessage({\n key: \"submitted\",\n value: true,\n visible: false\n })\n );\n node.walk(setSubmitted);\n setSubmitted(node);\n node.emit(\"submit-raw\");\n if (typeof node.props.onSubmitRaw === \"function\") {\n node.props.onSubmitRaw(submitEvent, node);\n }\n if (node.ledger.value(\"blocking\")) {\n if (typeof node.props.onSubmitInvalid === \"function\") {\n node.props.onSubmitInvalid(node);\n }\n if (node.props.incompleteMessage !== false) {\n setIncompleteMessage(node);\n }\n } else {\n if (typeof node.props.onSubmit === \"function\") {\n const retVal = node.props.onSubmit(\n node.hook.submit.dispatch(clone(node.value)),\n node\n );\n if (retVal instanceof Promise) {\n const autoDisable = node.props.disabled === void 0 && node.props.submitBehavior !== \"live\";\n if (autoDisable)\n node.props.disabled = true;\n node.store.set(loading);\n await retVal;\n if (autoDisable)\n node.props.disabled = false;\n node.store.remove(\"loading\");\n }\n } else {\n if (submitEvent.target instanceof HTMLFormElement) {\n submitEvent.target.submit();\n }\n }\n }\n}\nfunction setIncompleteMessage(node) {\n node.store.set(\n /* @__PURE__ */ createMessage({\n blocking: false,\n key: `incomplete`,\n meta: {\n localize: node.props.incompleteMessage === void 0,\n i18nArgs: [{ node }],\n showAsMessage: true\n },\n type: \"ui\",\n value: node.props.incompleteMessage || \"Form incomplete.\"\n })\n );\n}\nfunction form(node) {\n var _a;\n node.props.isForm = true;\n node.ledger.count(\"validating\", (m) => m.key === \"validating\");\n (_a = node.props).submitAttrs ?? (_a.submitAttrs = {\n disabled: node.props.disabled\n });\n node.on(\"prop:disabled\", ({ payload: disabled }) => {\n node.props.submitAttrs = { ...node.props.submitAttrs, disabled };\n });\n node.on(\"created\", () => {\n if (node.context?.handlers) {\n node.context.handlers.submit = handleSubmit.bind(null, node);\n }\n if (!has(node.props, \"actions\")) {\n node.props.actions = true;\n }\n });\n node.on(\"prop:incompleteMessage\", () => {\n if (node.store.incomplete)\n setIncompleteMessage(node);\n });\n node.on(\"settled:blocking\", () => node.store.remove(\"incomplete\"));\n}\n\n// packages/inputs/src/features/ignores.ts\nfunction ignore(node) {\n if (node.props.ignore === void 0) {\n node.props.ignore = true;\n node.parent = null;\n }\n}\n\n// packages/inputs/src/features/initialValue.ts\nfunction initialValue(node) {\n node.on(\"created\", () => {\n if (node.context) {\n node.context.initialValue = node.value || \"\";\n }\n });\n}\n\n// packages/inputs/src/features/casts.ts\nfunction casts(node) {\n if (typeof node.props.number === \"undefined\")\n return;\n const strict = [\"number\", \"range\", \"hidden\"].includes(node.props.type);\n node.hook.input((value, next) => {\n if (value === \"\")\n return next(void 0);\n const numericValue = node.props.number === \"integer\" ? parseInt(value) : parseFloat(value);\n if (!Number.isFinite(numericValue))\n return strict ? next(void 0) : next(value);\n return next(numericValue);\n });\n}\nfunction toggleChecked2(node, event) {\n if (event.target instanceof HTMLInputElement) {\n node.input(optionValue(node.props.options, event.target.value));\n }\n}\nfunction isChecked2(node, value) {\n node.context?.value;\n node.context?._value;\n return shouldSelect(optionValue(node.props.options, value), node._value);\n}\nfunction radios(node) {\n node.on(\"created\", () => {\n if (!Array.isArray(node.props.options)) {\n warn(350, {\n node,\n inputType: \"radio\"\n });\n }\n if (node.context?.handlers) {\n node.context.handlers.toggleChecked = toggleChecked2.bind(null, node);\n }\n if (node.context?.fns) {\n node.context.fns.isChecked = isChecked2.bind(null, node);\n }\n });\n node.hook.prop(normalizeBoxes(node));\n}\nfunction isSelected(node, option2) {\n if (isGroupOption(option2))\n return false;\n node.context && node.context.value;\n const optionValue2 = \"__original\" in option2 ? option2.__original : option2.value;\n return Array.isArray(node._value) ? node._value.some((optionA) => shouldSelect(optionA, optionValue2)) : (node._value === void 0 || node._value === null && !containsValue(node.props.options, null)) && option2.attrs && option2.attrs[\"data-is-placeholder\"] ? true : shouldSelect(optionValue2, node._value);\n}\nfunction containsValue(options2, value) {\n return options2.some((option2) => {\n if (isGroupOption(option2)) {\n return containsValue(option2.options, value);\n } else {\n return (\"__original\" in option2 ? option2.__original : option2.value) === value;\n }\n });\n}\nasync function deferChange(node, e) {\n if (typeof node.props.attrs?.onChange === \"function\") {\n await new Promise((r) => setTimeout(r, 0));\n await node.settled;\n node.props.attrs.onChange(e);\n }\n}\nfunction selectInput2(node, e) {\n const target = e.target;\n const value = target.hasAttribute(\"multiple\") ? Array.from(target.selectedOptions).map(\n (o) => optionValue(node.props.options, o.value)\n ) : optionValue(node.props.options, target.value);\n node.input(value);\n}\nfunction applyPlaceholder(options2, placeholder) {\n if (!options2.some(\n (option2) => option2.attrs && option2.attrs[\"data-is-placeholder\"]\n )) {\n return [\n {\n label: placeholder,\n value: \"\",\n attrs: {\n hidden: true,\n disabled: true,\n \"data-is-placeholder\": \"true\"\n }\n },\n ...options2\n ];\n }\n return options2;\n}\nfunction firstValue(options2) {\n const option2 = options2.length > 0 ? options2[0] : void 0;\n if (!option2)\n return void 0;\n if (isGroupOption(option2))\n return firstValue(option2.options);\n return \"__original\" in option2 ? option2.__original : option2.value;\n}\nfunction select(node) {\n node.on(\"created\", () => {\n const isMultiple = undefine(node.props.attrs?.multiple);\n if (!isMultiple && node.props.placeholder && Array.isArray(node.props.options)) {\n node.hook.prop(({ prop, value }, next) => {\n if (prop === \"options\") {\n value = applyPlaceholder(value, node.props.placeholder);\n }\n return next({ prop, value });\n });\n node.props.options = applyPlaceholder(\n node.props.options,\n node.props.placeholder\n );\n }\n if (isMultiple) {\n if (node.value === void 0) {\n node.input([], false);\n }\n } else if (node.context && !node.context.options) {\n node.props.attrs = Object.assign({}, node.props.attrs, {\n value: node._value\n });\n node.on(\"input\", ({ payload }) => {\n node.props.attrs = Object.assign({}, node.props.attrs, {\n value: payload\n });\n });\n }\n if (node.context?.handlers) {\n node.context.handlers.selectInput = selectInput2.bind(null, node);\n node.context.handlers.onChange = deferChange.bind(null, node);\n }\n if (node.context?.fns) {\n node.context.fns.isSelected = isSelected.bind(null, node);\n node.context.fns.showPlaceholder = (value, placeholder) => {\n if (!Array.isArray(node.props.options))\n return false;\n const hasMatchingValue = node.props.options.some(\n (option2) => {\n if (option2.attrs && \"data-is-placeholder\" in option2.attrs)\n return false;\n const optionValue2 = \"__original\" in option2 ? option2.__original : option2.value;\n return eq(value, optionValue2);\n }\n );\n return placeholder && !hasMatchingValue ? true : void 0;\n };\n }\n });\n node.hook.input((value, next) => {\n if (!node.props.placeholder && value === void 0 && Array.isArray(node.props?.options) && node.props.options.length && !undefine(node.props?.attrs?.multiple)) {\n value = firstValue(node.props.options);\n }\n return next(value);\n });\n}\n\n// packages/inputs/src/compose.ts\n// @__NO_SIDE_EFFECTS__\nfunction isSlotCondition(node) {\n if (isConditional(node) && node.if && node.if.startsWith(\"$slots.\") && typeof node.then === \"string\" && node.then.startsWith(\"$slots.\") && \"else\" in node) {\n return true;\n }\n return false;\n}\n// @__NO_SIDE_EFFECTS__\nfunction findSection(schema, target) {\n return eachSection(\n schema,\n (section, sectionCondition, parent) => {\n if (section.meta?.section === target) {\n return [parent, sectionCondition];\n }\n return;\n },\n true\n ) ?? [false, false];\n}\nfunction eachSection(schema, callback, stopOnCallbackReturn = false, schemaParent) {\n if (Array.isArray(schema)) {\n for (const node of schema) {\n const callbackReturn = eachSection(\n node,\n callback,\n stopOnCallbackReturn,\n schema\n );\n if (callbackReturn && stopOnCallbackReturn) {\n return callbackReturn;\n }\n }\n return;\n }\n if (isSection(schema)) {\n const callbackReturn = callback(schema.else, schema, schemaParent);\n if (callbackReturn && stopOnCallbackReturn) {\n return callbackReturn;\n }\n return eachSection(schema.else, callback, stopOnCallbackReturn, schema);\n } else if ((isComponent(schema) || isDOM(schema)) && schema.children) {\n return eachSection(\n schema.children,\n callback,\n stopOnCallbackReturn\n );\n } else if (isConditional(schema)) {\n let callbackReturn = void 0;\n if (schema.then && typeof schema.then !== \"string\") {\n callbackReturn = eachSection(\n schema.then,\n callback,\n stopOnCallbackReturn,\n schema\n );\n }\n if (!callbackReturn && schema.else && typeof schema.else !== \"string\") {\n callbackReturn = eachSection(\n schema.else,\n callback,\n stopOnCallbackReturn,\n schema\n );\n }\n if (callbackReturn && stopOnCallbackReturn) {\n return callbackReturn;\n }\n }\n}\nfunction isSection(section) {\n if (isConditional(section) && typeof section.then === \"string\" && section.else && typeof section.else !== \"string\" && !Array.isArray(section.else) && !isConditional(section.else) && section.else.meta?.section) {\n return true;\n }\n return false;\n}\n// @__NO_SIDE_EFFECTS__\nfunction useSchema(inputSection, sectionsSchema = {}) {\n const schema = /* @__PURE__ */ outer(\n /* @__PURE__ */ wrapper(\n /* @__PURE__ */ label(\"$label\"),\n /* @__PURE__ */ inner(/* @__PURE__ */ icon(\"prefix\"), /* @__PURE__ */ prefix(), inputSection(), /* @__PURE__ */ suffix(), /* @__PURE__ */ icon(\"suffix\"))\n ),\n /* @__PURE__ */ help(\"$help\"),\n /* @__PURE__ */ messages(/* @__PURE__ */ message(\"$message.value\"))\n );\n return (propSectionsSchema = {}) => schema(extend(sectionsSchema, propSectionsSchema));\n}\n// @__NO_SIDE_EFFECTS__\nfunction $attrs(attrs, section) {\n const extendable = (extensions) => {\n const node = section(extensions);\n const attributes = typeof attrs === \"function\" ? attrs() : attrs;\n if (!isObject(attributes))\n return node;\n if (/* @__PURE__ */ isSlotCondition(node) && isDOM(node.else)) {\n node.else.attrs = { ...node.else.attrs, ...attributes };\n } else if (isDOM(node)) {\n node.attrs = { ...node.attrs, ...attributes };\n }\n return node;\n };\n extendable._s = section._s;\n return extendable;\n}\n// @__NO_SIDE_EFFECTS__\nfunction $if(condition, then, otherwise) {\n const extendable = (extensions) => {\n const node = then(extensions);\n if (otherwise || isSchemaObject(node) && \"if\" in node || /* @__PURE__ */ isSlotCondition(node)) {\n const conditionalNode = {\n if: condition,\n then: node\n };\n if (otherwise) {\n conditionalNode.else = otherwise(extensions);\n }\n return conditionalNode;\n } else if (/* @__PURE__ */ isSlotCondition(node)) {\n Object.assign(node.else, { if: condition });\n } else if (isSchemaObject(node)) {\n Object.assign(node, { if: condition });\n }\n return node;\n };\n extendable._s = token();\n return extendable;\n}\n// @__NO_SIDE_EFFECTS__\nfunction $for(varName, inName, section) {\n return (extensions) => {\n const node = section(extensions);\n if (/* @__PURE__ */ isSlotCondition(node)) {\n Object.assign(node.else, { for: [varName, inName] });\n } else if (isSchemaObject(node)) {\n Object.assign(node, { for: [varName, inName] });\n }\n return node;\n };\n}\n// @__NO_SIDE_EFFECTS__\nfunction $extend(section, extendWith) {\n const extendable = (extensions) => {\n const node = section({});\n if (/* @__PURE__ */ isSlotCondition(node)) {\n if (Array.isArray(node.else))\n return node;\n node.else = extendSchema(\n extendSchema(node.else, extendWith),\n section._s ? extensions[section._s] : {}\n );\n return node;\n }\n return extendSchema(\n extendSchema(node, extendWith),\n section._s ? extensions[section._s] : {}\n );\n };\n extendable._s = section._s;\n return extendable;\n}\n// @__NO_SIDE_EFFECTS__\nfunction $root(section) {\n warn(800, \"$root\");\n return createRoot(section);\n}\nfunction resetCounts() {\n resetRadio();\n}\n\n// packages/inputs/src/inputs/button.ts\nvar button = {\n /**\n * The actual schema of the input, or a function that returns the schema.\n */\n schema: /* @__PURE__ */ outer(\n /* @__PURE__ */ messages(/* @__PURE__ */ message(\"$message.value\")),\n /* @__PURE__ */ wrapper(\n /* @__PURE__ */ buttonInput(\n /* @__PURE__ */ icon(\"prefix\"),\n /* @__PURE__ */ prefix(),\n /* @__PURE__ */ buttonLabel(\"$label || $ui.submit.value\"),\n /* @__PURE__ */ suffix(),\n /* @__PURE__ */ icon(\"suffix\")\n )\n ),\n /* @__PURE__ */ help(\"$help\")\n ),\n /**\n * The type of node, can be a list, group, or input.\n */\n type: \"input\",\n /**\n * The family of inputs this one belongs too. For example \"text\" and \"email\"\n * are both part of the \"text\" family. This is primary used for styling.\n */\n family: \"button\",\n /**\n * An array of extra props to accept for this input.\n */\n props: [],\n /**\n * Additional features that should be added to your input\n */\n features: [localize(\"submit\"), ignore],\n /**\n * A key to use for memoizing the schema. This is used to prevent the schema\n * from needing to be stringified when performing a memo lookup.\n */\n schemaMemoKey: \"h6st4epl3j8\"\n};\n\n// packages/inputs/src/inputs/checkbox.ts\nvar checkbox = {\n /**\n * The actual schema of the input, or a function that returns the schema.\n */\n schema: /* @__PURE__ */ outer(\n $if(\n \"$options == undefined\",\n /**\n * Single checkbox structure.\n */\n /* @__PURE__ */ boxWrapper(\n /* @__PURE__ */ boxInner(/* @__PURE__ */ prefix(), /* @__PURE__ */ box(), /* @__PURE__ */ decorator(/* @__PURE__ */ icon(\"decorator\")), /* @__PURE__ */ suffix()),\n $extend(/* @__PURE__ */ boxLabel(\"$label\"), {\n if: \"$label\"\n })\n ),\n /**\n * Multi checkbox structure.\n */\n /* @__PURE__ */ fieldset(\n /* @__PURE__ */ legend(\"$label\"),\n /* @__PURE__ */ help(\"$help\"),\n /* @__PURE__ */ boxOptions(\n /* @__PURE__ */ boxOption(\n /* @__PURE__ */ boxWrapper(\n /* @__PURE__ */ boxInner(\n /* @__PURE__ */ prefix(),\n $extend(/* @__PURE__ */ box(), {\n bind: \"$option.attrs\",\n attrs: {\n id: \"$option.attrs.id\",\n value: \"$option.value\",\n checked: \"$fns.isChecked($option.value)\"\n }\n }),\n /* @__PURE__ */ decorator(/* @__PURE__ */ icon(\"decorator\")),\n /* @__PURE__ */ suffix()\n ),\n $extend(/* @__PURE__ */ boxLabel(\"$option.label\"), {\n if: \"$option.label\"\n })\n ),\n /* @__PURE__ */ boxHelp(\"$option.help\")\n )\n )\n )\n ),\n // Help text only goes under the input when it is a single.\n $if(\"$options == undefined && $help\", /* @__PURE__ */ help(\"$help\")),\n /* @__PURE__ */ messages(/* @__PURE__ */ message(\"$message.value\"))\n ),\n /**\n * The type of node, can be a list, group, or input.\n */\n type: \"input\",\n /**\n * The family of inputs this one belongs too. For example \"text\" and \"email\"\n * are both part of the \"text\" family. This is primary used for styling.\n */\n family: \"box\",\n /**\n * An array of extra props to accept for this input.\n */\n props: [\"options\", \"onValue\", \"offValue\", \"optionsLoader\"],\n /**\n * Additional features that should be added to your input\n */\n features: [\n options,\n checkboxes,\n defaultIcon(\"decorator\", \"checkboxDecorator\")\n ],\n /**\n * The key used to memoize the schema.\n */\n schemaMemoKey: \"qje02tb3gu8\"\n};\n\n// packages/inputs/src/inputs/file.ts\nvar file = {\n /**\n * The actual schema of the input, or a function that returns the schema.\n */\n schema: /* @__PURE__ */ outer(\n /* @__PURE__ */ wrapper(\n /* @__PURE__ */ label(\"$label\"),\n /* @__PURE__ */ inner(\n /* @__PURE__ */ icon(\"prefix\", \"label\"),\n /* @__PURE__ */ prefix(),\n /* @__PURE__ */ fileInput(),\n /* @__PURE__ */ fileList(\n /* @__PURE__ */ fileItem(\n /* @__PURE__ */ icon(\"fileItem\"),\n /* @__PURE__ */ fileName(\"$file.name\"),\n $if(\n \"$value.length === 1\",\n /* @__PURE__ */ fileRemove(\n /* @__PURE__ */ icon(\"fileRemove\"),\n '$ui.remove.value + \" \" + $file.name'\n )\n )\n )\n ),\n $if(\"$value.length > 1\", /* @__PURE__ */ fileRemove(\"$ui.removeAll.value\")),\n /* @__PURE__ */ noFiles(/* @__PURE__ */ icon(\"noFiles\"), \"$ui.noFiles.value\"),\n /* @__PURE__ */ suffix(),\n /* @__PURE__ */ icon(\"suffix\")\n )\n ),\n /* @__PURE__ */ help(\"$help\"),\n /* @__PURE__ */ messages(/* @__PURE__ */ message(\"$message.value\"))\n ),\n /**\n * The type of node, can be a list, group, or input.\n */\n type: \"input\",\n /**\n * The family of inputs this one belongs too. For example \"text\" and \"email\"\n * are both part of the \"text\" family. This is primary used for styling.\n */\n family: \"text\",\n /**\n * An array of extra props to accept for this input.\n */\n props: [],\n /**\n * Additional features that should be added to your input\n */\n features: [\n files,\n defaultIcon(\"fileItem\", \"fileItem\"),\n defaultIcon(\"fileRemove\", \"fileRemove\"),\n defaultIcon(\"noFiles\", \"noFiles\")\n ],\n /**\n * The key used to memoize the schema.\n */\n schemaMemoKey: \"9kqc4852fv8\"\n};\n\n// packages/inputs/src/inputs/form.ts\nvar form2 = {\n /**\n * The actual schema of the input, or a function that returns the schema.\n */\n schema: /* @__PURE__ */ formInput(\n \"$slots.default\",\n /* @__PURE__ */ messages(/* @__PURE__ */ message(\"$message.value\")),\n /* @__PURE__ */ actions(/* @__PURE__ */ submitInput())\n ),\n /**\n * The type of node, can be a list, group, or input.\n */\n type: \"group\",\n /**\n * An array of extra props to accept for this input.\n */\n props: [\n \"actions\",\n \"submit\",\n \"submitLabel\",\n \"submitAttrs\",\n \"submitBehavior\",\n \"incompleteMessage\"\n ],\n /**\n * Additional features that should be added to your input\n */\n features: [form, disables],\n /**\n * The key used to memoize the schema.\n */\n schemaMemoKey: \"5bg016redjo\"\n};\n\n// packages/inputs/src/inputs/group.ts\nvar group = {\n /**\n * The actual schema of the input, or a function that returns the schema.\n */\n schema: /* @__PURE__ */ fragment(\"$slots.default\"),\n /**\n * The type of node, can be a list, group, or input.\n */\n type: \"group\",\n /**\n * An array of extra props to accept for this input.\n */\n props: [],\n /**\n * Additional features that should be added to your input\n */\n features: [disables, renamesRadios]\n};\n\n// packages/inputs/src/inputs/hidden.ts\nvar hidden = {\n /**\n * The actual schema of the input, or a function that returns the schema.\n */\n schema: /* @__PURE__ */ textInput(),\n /**\n * The type of node, can be a list, group, or input.\n */\n type: \"input\",\n /**\n * An array of extra props to accept for this input.\n */\n props: [],\n /**\n * Additional features that should be added to your input\n */\n features: [casts]\n};\n\n// packages/inputs/src/inputs/list.ts\nvar list = {\n /**\n * The actual schema of the input, or a function that returns the schema.\n */\n schema: /* @__PURE__ */ fragment(\"$slots.default\"),\n /**\n * The type of node, can be a list, group, or input.\n */\n type: \"list\",\n /**\n * An array of extra props to accept for this input.\n */\n props: [\"sync\", \"dynamic\"],\n /**\n * Additional features that should be added to your input\n */\n features: [disables, renamesRadios]\n};\n\n// packages/inputs/src/inputs/meta.ts\nvar meta = {\n /**\n * The actual schema of the input, or a function that returns the schema.\n */\n schema: /* @__PURE__ */ fragment(),\n /**\n * The type of node, can be a list, group, or input.\n */\n type: \"input\",\n /**\n * An array of extra props to accept for this input.\n */\n props: [],\n /**\n * Additional features that should be added to your input\n */\n features: []\n};\n\n// packages/inputs/src/inputs/radio.ts\nvar radio = {\n /**\n * The actual schema of the input, or a function that returns the schema.\n */\n schema: /* @__PURE__ */ outer(\n $if(\n \"$options == undefined\",\n /**\n * Single radio structure.\n */\n /* @__PURE__ */ boxWrapper(\n /* @__PURE__ */ boxInner(/* @__PURE__ */ prefix(), /* @__PURE__ */ box(), /* @__PURE__ */ decorator(/* @__PURE__ */ icon(\"decorator\")), /* @__PURE__ */ suffix()),\n $extend(/* @__PURE__ */ boxLabel(\"$label\"), {\n if: \"$label\"\n })\n ),\n /**\n * Multi radio structure.\n */\n /* @__PURE__ */ fieldset(\n /* @__PURE__ */ legend(\"$label\"),\n /* @__PURE__ */ help(\"$help\"),\n /* @__PURE__ */ boxOptions(\n /* @__PURE__ */ boxOption(\n /* @__PURE__ */ boxWrapper(\n /* @__PURE__ */ boxInner(\n /* @__PURE__ */ prefix(),\n $extend(/* @__PURE__ */ box(), {\n bind: \"$option.attrs\",\n attrs: {\n id: \"$option.attrs.id\",\n value: \"$option.value\",\n checked: \"$fns.isChecked($option.value)\"\n }\n }),\n /* @__PURE__ */ decorator(/* @__PURE__ */ icon(\"decorator\")),\n /* @__PURE__ */ suffix()\n ),\n $extend(/* @__PURE__ */ boxLabel(\"$option.label\"), {\n if: \"$option.label\"\n })\n ),\n /* @__PURE__ */ boxHelp(\"$option.help\")\n )\n )\n )\n ),\n // Help text only goes under the input when it is a single.\n $if(\"$options == undefined && $help\", /* @__PURE__ */ help(\"$help\")),\n /* @__PURE__ */ messages(/* @__PURE__ */ message(\"$message.value\"))\n ),\n /**\n * The type of node, can be a list, group, or input.\n */\n type: \"input\",\n /**\n * The family of inputs this one belongs too. For example \"text\" and \"email\"\n * are both part of the \"text\" family. This is primary used for styling.\n */\n family: \"box\",\n /**\n * An array of extra props to accept for this input.\n */\n props: [\"options\", \"onValue\", \"offValue\", \"optionsLoader\"],\n /**\n * Additional features that should be added to your input\n */\n features: [options, radios, defaultIcon(\"decorator\", \"radioDecorator\")],\n /**\n * The key used to memoize the schema.\n */\n schemaMemoKey: \"qje02tb3gu8\"\n};\n\n// packages/inputs/src/inputs/select.ts\nvar select2 = {\n /**\n * The actual schema of the input, or a function that returns the schema.\n */\n schema: /* @__PURE__ */ outer(\n /* @__PURE__ */ wrapper(\n /* @__PURE__ */ label(\"$label\"),\n /* @__PURE__ */ inner(\n /* @__PURE__ */ icon(\"prefix\"),\n /* @__PURE__ */ prefix(),\n /* @__PURE__ */ selectInput(\n $if(\n \"$slots.default\",\n () => \"$slots.default\",\n /* @__PURE__ */ optionSlot(\n $if(\n \"$option.group\",\n /* @__PURE__ */ optGroup(/* @__PURE__ */ optionSlot(/* @__PURE__ */ option(\"$option.label\"))),\n /* @__PURE__ */ option(\"$option.label\")\n )\n )\n )\n ),\n $if(\"$attrs.multiple !== undefined\", () => \"\", /* @__PURE__ */ icon(\"select\")),\n /* @__PURE__ */ suffix(),\n /* @__PURE__ */ icon(\"suffix\")\n )\n ),\n /* @__PURE__ */ help(\"$help\"),\n /* @__PURE__ */ messages(/* @__PURE__ */ message(\"$message.value\"))\n ),\n /**\n * The type of node, can be a list, group, or input.\n */\n type: \"input\",\n /**\n * An array of extra props to accept for this input.\n */\n props: [\"options\", \"placeholder\", \"optionsLoader\"],\n /**\n * Additional features that should be added to your input\n */\n features: [options, select, defaultIcon(\"select\", \"select\")],\n /**\n * The key used to memoize the schema.\n */\n schemaMemoKey: \"cb119h43krg\"\n};\n\n// packages/inputs/src/inputs/textarea.ts\nvar textarea = {\n /**\n * The actual schema of the input, or a function that returns the schema.\n */\n schema: /* @__PURE__ */ outer(\n /* @__PURE__ */ wrapper(\n /* @__PURE__ */ label(\"$label\"),\n /* @__PURE__ */ inner(\n /* @__PURE__ */ icon(\"prefix\", \"label\"),\n /* @__PURE__ */ prefix(),\n /* @__PURE__ */ textareaInput(),\n /* @__PURE__ */ suffix(),\n /* @__PURE__ */ icon(\"suffix\")\n )\n ),\n /* @__PURE__ */ help(\"$help\"),\n /* @__PURE__ */ messages(/* @__PURE__ */ message(\"$message.value\"))\n ),\n /**\n * The type of node, can be a list, group, or input.\n */\n type: \"input\",\n /**\n * An array of extra props to accept for this input.\n */\n props: [],\n /**\n * Additional features that should be added to your input\n */\n features: [initialValue],\n /**\n * The key used to memoize the schema.\n */\n schemaMemoKey: \"b1n0td79m9g\"\n};\n\n// packages/inputs/src/inputs/text.ts\nvar text = {\n /**\n * The actual schema of the input, or a function that returns the schema.\n */\n schema: /* @__PURE__ */ outer(\n /* @__PURE__ */ wrapper(\n /* @__PURE__ */ label(\"$label\"),\n /* @__PURE__ */ inner(\n /* @__PURE__ */ icon(\"prefix\", \"label\"),\n /* @__PURE__ */ prefix(),\n /* @__PURE__ */ textInput(),\n /* @__PURE__ */ suffix(),\n /* @__PURE__ */ icon(\"suffix\")\n )\n ),\n /* @__PURE__ */ help(\"$help\"),\n /* @__PURE__ */ messages(/* @__PURE__ */ message(\"$message.value\"))\n ),\n /**\n * The type of node, can be a list, group, or input.\n */\n type: \"input\",\n /**\n * The family of inputs this one belongs too. For example \"text\" and \"email\"\n * are both part of the \"text\" family. This is primary used for styling.\n */\n family: \"text\",\n /**\n * An array of extra props to accept for this input.\n */\n props: [],\n /**\n * Additional features that should be added to your input\n */\n features: [casts],\n /**\n * The key used to memoize the schema.\n */\n schemaMemoKey: \"c3cc4kflsg\"\n};\n\n// packages/inputs/src/index.ts\nvar inputs = {\n button,\n submit: button,\n checkbox,\n file,\n form: form2,\n group,\n hidden,\n list,\n meta,\n radio,\n select: select2,\n textarea,\n text,\n color: text,\n date: text,\n datetimeLocal: text,\n email: text,\n month: text,\n number: text,\n password: text,\n search: text,\n tel: text,\n time: text,\n url: text,\n week: text,\n range: text\n};\n\nexport { $attrs, $extend, $for, $if, $root, actions, box, boxHelp, boxInner, boxLabel, boxOption, boxOptions, boxWrapper, button, buttonInput, buttonLabel, casts, checkbox, checkboxes, text as color, createLibraryPlugin, createSection, text as date, text as datetimeLocal, decorator, defaultIcon, disables as disablesChildren, eachSection, text as email, extendSchema, fieldset, file, fileInput, fileItem, fileList, fileName, fileRemove, files, findSection, form2 as form, formInput, form as forms, fragment, group, help, hidden, icon, ignore as ignores, initialValue, inner, inputs, isGroupOption, isSchemaObject, isSlotCondition, label, legend, list, localize, message, messages, meta, text as month, noFiles, normalizeBoxes, normalizeOptions, text as number, optGroup, option, optionSlot, options, outer, text as password, prefix, radio, radios, text as range, renamesRadios, resetCounts, resetRadio, runtimeProps, text as search, select2 as select, selectInput, select as selects, button as submit, submitInput, suffix, text as tel, text, textInput, textarea, textareaInput, text as time, text as url, useSchema, text as week, wrapper };\n//# sourceMappingURL=out.js.map\n//# sourceMappingURL=index.mjs.map","import { FORMKIT_VERSION } from '@formkit/core';\n\n// packages/themes/src/index.ts\nfunction generateClasses(classes) {\n const classesBySectionKey = {};\n Object.keys(classes).forEach((type) => {\n Object.keys(classes[type]).forEach((sectionKey) => {\n if (!classesBySectionKey[sectionKey]) {\n classesBySectionKey[sectionKey] = {\n [type]: classes[type][sectionKey]\n };\n } else {\n classesBySectionKey[sectionKey][type] = classes[type][sectionKey];\n }\n });\n });\n Object.keys(classesBySectionKey).forEach((sectionKey) => {\n const classesObject = classesBySectionKey[sectionKey];\n classesBySectionKey[sectionKey] = function(node, sectionKey2) {\n return addClassesBySection(node, sectionKey2, classesObject);\n };\n });\n return classesBySectionKey;\n}\nfunction addClassesBySection(node, _sectionKey, classesByType) {\n const type = node.props.type;\n const family = node.props.family;\n let classList = \"\";\n if (classesByType.global) {\n classList += classesByType.global + \" \";\n }\n if (classesByType[`family:${family}`]) {\n classList += classesByType[`family:${family}`] + \" \";\n }\n if (classesByType[type]) {\n classList += classesByType[type];\n }\n const listParts = classList.split(\"$reset\");\n if (listParts.length > 1) {\n return `$reset ${listParts[listParts.length - 1].trim()}`;\n }\n return listParts[0].trim();\n}\nvar documentStyles = void 0;\nvar documentThemeLinkTag = null;\nvar themeDidLoad;\nvar themeHasLoaded = false;\nvar themeWasRequested = false;\nvar themeLoaded = /* @__PURE__ */ new Promise((res) => {\n themeDidLoad = () => {\n themeHasLoaded = true;\n res();\n };\n});\nvar isClient = typeof window !== \"undefined\" && typeof fetch !== \"undefined\";\ndocumentStyles = isClient ? /* @__PURE__ */ getComputedStyle(document.documentElement) : void 0;\nvar iconRegistry = {};\nvar iconRequests = {};\nfunction createThemePlugin(theme, icons, iconLoaderUrl, iconLoader) {\n if (icons) {\n Object.assign(iconRegistry, icons);\n }\n if (isClient && !themeWasRequested && documentStyles?.getPropertyValue(\"--formkit-theme\")) {\n themeDidLoad();\n themeWasRequested = true;\n } else if (theme && !themeWasRequested && isClient) {\n loadTheme(theme);\n } else if (!themeWasRequested && isClient) {\n themeDidLoad();\n }\n const themePlugin = function themePlugin2(node) {\n node.addProps([\"iconLoader\", \"iconLoaderUrl\"]);\n node.props.iconHandler = createIconHandler(\n node.props?.iconLoader ? node.props.iconLoader : iconLoader,\n node.props?.iconLoaderUrl ? node.props.iconLoaderUrl : iconLoaderUrl\n );\n loadIconPropIcons(node, node.props.iconHandler);\n node.on(\"created\", () => {\n if (node?.context?.handlers) {\n node.context.handlers.iconClick = (sectionKey) => {\n const clickHandlerProp = `on${sectionKey.charAt(0).toUpperCase()}${sectionKey.slice(1)}IconClick`;\n const handlerFunction = node.props[clickHandlerProp];\n if (handlerFunction && typeof handlerFunction === \"function\") {\n return (e) => {\n return handlerFunction(node, e);\n };\n }\n return void 0;\n };\n }\n if (node?.context?.fns) {\n node.context.fns.iconRole = (sectionKey) => {\n const clickHandlerProp = `on${sectionKey.charAt(0).toUpperCase()}${sectionKey.slice(1)}IconClick`;\n return typeof node.props[clickHandlerProp] === \"function\" ? \"button\" : null;\n };\n }\n });\n };\n themePlugin.iconHandler = createIconHandler(iconLoader, iconLoaderUrl);\n return themePlugin;\n}\nfunction loadTheme(theme) {\n if (!theme || !isClient || typeof getComputedStyle !== \"function\") {\n return;\n }\n themeWasRequested = true;\n documentThemeLinkTag = document.getElementById(\"formkit-theme\");\n if (theme && // if we have a window object\n isClient && // we don't have an existing theme OR the theme being set up is different\n (!documentStyles?.getPropertyValue(\"--formkit-theme\") && !documentThemeLinkTag || documentThemeLinkTag?.getAttribute(\"data-theme\") && documentThemeLinkTag?.getAttribute(\"data-theme\") !== theme)) {\n const formkitVersion = FORMKIT_VERSION.startsWith(\"__\") ? \"latest\" : FORMKIT_VERSION;\n const themeUrl = `https://cdn.jsdelivr.net/npm/@formkit/themes@${formkitVersion}/dist/${theme}/theme.css`;\n const link = document.createElement(\"link\");\n link.type = \"text/css\";\n link.rel = \"stylesheet\";\n link.id = \"formkit-theme\";\n link.setAttribute(\"data-theme\", theme);\n link.onload = () => {\n documentStyles = getComputedStyle(document.documentElement);\n themeDidLoad();\n };\n document.head.appendChild(link);\n link.href = themeUrl;\n if (documentThemeLinkTag) {\n documentThemeLinkTag.remove();\n }\n }\n}\nfunction createIconHandler(iconLoader, iconLoaderUrl) {\n return (iconName) => {\n if (typeof iconName !== \"string\")\n return;\n if (iconName.startsWith(\" {\n if (!iconValue && typeof iconName === \"string\" && !isDefault) {\n return loadedIcon = typeof iconLoader === \"function\" ? iconLoader(iconName) : getRemoteIcon(iconName, iconLoaderUrl);\n }\n return iconValue;\n }).then((finalIcon) => {\n if (typeof iconName === \"string\") {\n iconRegistry[isDefault ? `default:${iconName}` : iconName] = finalIcon;\n }\n return finalIcon;\n });\n } else if (typeof loadedIcon === \"string\") {\n iconRegistry[isDefault ? `default:${iconName}` : iconName] = loadedIcon;\n return loadedIcon;\n }\n }\n return iconRequests[iconName];\n };\n}\nfunction getIconFromStylesheet(iconName) {\n if (!isClient)\n return;\n if (themeHasLoaded) {\n return loadStylesheetIcon(iconName);\n } else {\n return themeLoaded.then(() => {\n return loadStylesheetIcon(iconName);\n });\n }\n}\nfunction loadStylesheetIcon(iconName) {\n const cssVarIcon = documentStyles?.getPropertyValue(`--fk-icon-${iconName}`);\n if (cssVarIcon) {\n const icon = atob(cssVarIcon);\n if (icon.startsWith(\" {\n const icon = await r.text();\n if (icon.startsWith(\" {\n console.error(e);\n return void 0;\n });\n}\nfunction loadIconPropIcons(node, iconHandler) {\n const iconRegex = /^[a-zA-Z-]+(?:-icon|Icon)$/;\n const iconProps = Object.keys(node.props).filter((prop) => {\n return iconRegex.test(prop);\n });\n iconProps.forEach((sectionKey) => {\n return loadPropIcon(node, iconHandler, sectionKey);\n });\n}\nfunction loadPropIcon(node, iconHandler, sectionKey) {\n const iconName = node.props[sectionKey];\n const loadedIcon = iconHandler(iconName);\n const rawIconProp = `_raw${sectionKey.charAt(0).toUpperCase()}${sectionKey.slice(1)}`;\n const clickHandlerProp = `on${sectionKey.charAt(0).toUpperCase()}${sectionKey.slice(1)}Click`;\n node.addProps([rawIconProp, clickHandlerProp]);\n node.on(`prop:${sectionKey}`, reloadIcon);\n if (loadedIcon instanceof Promise) {\n return loadedIcon.then((svg) => {\n node.props[rawIconProp] = svg;\n });\n } else {\n node.props[rawIconProp] = loadedIcon;\n }\n return;\n}\nfunction reloadIcon(event) {\n const node = event.origin;\n const iconName = event.payload;\n const iconHandler = node?.props?.iconHandler;\n const sectionKey = event.name.split(\":\")[1];\n const rawIconProp = `_raw${sectionKey.charAt(0).toUpperCase()}${sectionKey.slice(1)}`;\n if (iconHandler && typeof iconHandler === \"function\") {\n const loadedIcon = iconHandler(iconName);\n if (loadedIcon instanceof Promise) {\n return loadedIcon.then((svg) => {\n node.props[rawIconProp] = svg;\n });\n } else {\n node.props[rawIconProp] = loadedIcon;\n }\n }\n}\n\nexport { createIconHandler, createThemePlugin, generateClasses, iconRegistry };\n//# sourceMappingURL=out.js.map\n//# sourceMappingURL=index.mjs.map","import { errorHandler, warningHandler } from '@formkit/core';\n\n// packages/dev/src/index.ts\nvar errors = {\n /**\n * FormKit errors:\n */\n 100: ({ data: node }) => `Only groups, lists, and forms can have children (${node.name}).`,\n 101: ({ data: node }) => `You cannot directly modify the store (${node.name}). See: https://formkit.com/advanced/core#message-store`,\n 102: ({\n data: [node, property]\n }) => `You cannot directly assign node.${property} (${node.name})`,\n 103: ({ data: [operator] }) => `Schema expressions cannot start with an operator (${operator})`,\n 104: ({ data: [operator, expression] }) => `Schema expressions cannot end with an operator (${operator} in \"${expression}\")`,\n 105: ({ data: expression }) => `Invalid schema expression: ${expression}`,\n 106: ({ data: name }) => `Cannot submit because (${name}) is not in a form.`,\n 107: ({ data: [node, value] }) => `Cannot set ${node.name} to non object value: ${value}`,\n 108: ({ data: [node, value] }) => `Cannot set ${node.name} to non array value: ${value}`,\n /**\n * Input specific errors:\n */\n 300: ({ data: [node] }) => `Cannot set behavior prop to overscroll (on ${node.name} input) when options prop is a function.`,\n /**\n * FormKit vue errors:\n */\n 600: ({ data: node }) => `Unknown input type${typeof node.props.type === \"string\" ? ' \"' + node.props.type + '\"' : \"\"} (\"${node.name}\")`,\n 601: ({ data: node }) => `Input definition${typeof node.props.type === \"string\" ? ' \"' + node.props.type + '\"' : \"\"} is missing a schema or component property (${node.name}).`\n};\nvar warnings = {\n /**\n * Core warnings:\n */\n 150: ({ data: fn }) => `Schema function \"${fn}()\" is not a valid function.`,\n 151: ({ data: id }) => `No form element with id: ${id}`,\n 152: ({ data: id }) => `No input element with id: ${id}`,\n /**\n * Input specific warnings:\n */\n 350: ({\n data: { node, inputType }\n }) => `Invalid options prop for ${node.name} input (${inputType}). See https://formkit.com/inputs/${inputType}`,\n /**\n * Vue warnings:\n */\n 650: 'Schema \"$get()\" must use the id of an input to access.',\n 651: ({ data: id }) => `Cannot setErrors() on \"${id}\" because no such id exists.`,\n 652: ({ data: id }) => `Cannot clearErrors() on \"${id}\" because no such id exists.`,\n /**\n * Deprecation warnings:\n */\n 800: ({ data: name }) => `${name} is deprecated.`\n};\nvar decodeErrors = (error, next) => {\n if (error.code in errors) {\n const err = errors[error.code];\n error.message = typeof err === \"function\" ? err(error) : err;\n }\n return next(error);\n};\nvar registered = false;\nfunction register() {\n if (!registered) {\n errorHandler(decodeErrors);\n warningHandler(decodeWarnings);\n registered = true;\n }\n}\nvar decodeWarnings = (warning, next) => {\n if (warning.code in warnings) {\n const warn = warnings[warning.code];\n warning.message = typeof warn === \"function\" ? warn(warning) : warn;\n }\n return next(warning);\n};\n\nexport { errors, register, warnings };\n//# sourceMappingURL=out.js.map\n//# sourceMappingURL=index.mjs.map","import { defineComponent, getCurrentInstance, markRaw, watch, watchEffect, reactive, onMounted, onUnmounted, ref, provide, h, inject, computed, toRef, onBeforeUnmount, KeepAlive, Suspense, nextTick, triggerRef, isRef, isReactive, createTextVNode, resolveComponent } from 'vue';\nimport { createConfig, createNode, error, createMessage, getNode, watchRegistry, stopWatch, resetCount as resetCount$1, clearErrors, setErrors, submitForm, reset, createClasses, generateClassList, warn, isNode, sugar, isDOM, isComponent, isConditional, compile } from '@formkit/core';\nexport { clearErrors, errorHandler, reset, setErrors, submitForm } from '@formkit/core';\nimport { cloneAny, extend, undefine, camel, kebab, nodeProps, only, except, oncePerTick, slugify, shallowClone, eq, token, isObject, empty, has, isPojo } from '@formkit/utils';\nimport { createObserver } from '@formkit/observer';\nimport * as defaultRules from '@formkit/rules';\nimport { createValidationPlugin } from '@formkit/validation';\nimport { createI18nPlugin, en } from '@formkit/i18n';\nexport { changeLocale } from '@formkit/i18n';\nimport { createSection, useSchema, localize, resetCounts, createLibraryPlugin, inputs, runtimeProps } from '@formkit/inputs';\nimport { createIconHandler, createThemePlugin } from '@formkit/themes';\nimport { register } from '@formkit/dev';\n\nvar __defProp = Object.defineProperty;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __esm = (fn, res) => function __init() {\n return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;\n};\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar vueBindings, bindings_default;\nvar init_bindings = __esm({\n \"packages/vue/src/bindings.ts\"() {\n vueBindings = function vueBindings2(node) {\n node.ledger.count(\"blocking\", (m) => m.blocking);\n const isValid = ref(!node.ledger.value(\"blocking\"));\n node.ledger.count(\"errors\", (m) => m.type === \"error\");\n const hasErrors = ref(!!node.ledger.value(\"errors\"));\n let hasTicked = false;\n nextTick(() => {\n hasTicked = true;\n });\n const availableMessages = reactive(\n node.store.reduce((store, message3) => {\n if (message3.visible) {\n store[message3.key] = message3;\n }\n return store;\n }, {})\n );\n const validationVisibility = ref(\n node.props.validationVisibility || (node.props.type === \"checkbox\" ? \"dirty\" : \"blur\")\n );\n node.on(\"prop:validationVisibility\", ({ payload }) => {\n validationVisibility.value = payload;\n });\n const hasShownErrors = ref(validationVisibility.value === \"live\");\n const isRequired = ref(false);\n const checkForRequired = (parsedRules) => {\n isRequired.value = (parsedRules ?? []).some(\n (rule) => rule.name === \"required\"\n );\n };\n checkForRequired(node.props.parsedRules);\n node.on(\"prop:parsedRules\", ({ payload }) => checkForRequired(payload));\n const items = ref(node.children.map((child) => child.uid));\n const validationVisible = computed(() => {\n if (!context.state)\n return false;\n if (context.state.submitted)\n return true;\n if (!hasShownErrors.value && !context.state.settled) {\n return false;\n }\n switch (validationVisibility.value) {\n case \"live\":\n return true;\n case \"blur\":\n return context.state.blurred;\n case \"dirty\":\n return context.state.dirty;\n default:\n return false;\n }\n });\n const isInvalid = computed(() => {\n return context.state.failing && validationVisible.value;\n });\n const isComplete = computed(() => {\n return context && hasValidation.value ? isValid.value && !hasErrors.value : context.state.dirty && !empty(context.value);\n });\n const hasValidation = ref(\n Array.isArray(node.props.parsedRules) && node.props.parsedRules.length > 0\n );\n node.on(\"prop:parsedRules\", ({ payload: rules }) => {\n hasValidation.value = Array.isArray(rules) && rules.length > 0;\n });\n const messages3 = computed(() => {\n const visibleMessages = {};\n for (const key in availableMessages) {\n const message3 = availableMessages[key];\n if (message3.type !== \"validation\" || validationVisible.value) {\n visibleMessages[key] = message3;\n }\n }\n return visibleMessages;\n });\n const ui = reactive(\n node.store.reduce((messages4, message3) => {\n if (message3.type === \"ui\" && message3.visible)\n messages4[message3.key] = message3;\n return messages4;\n }, {})\n );\n const passing = computed(() => !context.state.failing);\n const cachedClasses = reactive({});\n const classes2 = new Proxy(cachedClasses, {\n get(...args) {\n if (!node)\n return \"\";\n const [target, property] = args;\n let className = Reflect.get(...args);\n if (!className && typeof property === \"string\") {\n if (!has(target, property) && !property.startsWith(\"__v\")) {\n const observedNode = createObserver(node);\n observedNode.watch((node2) => {\n const rootClasses = typeof node2.config.rootClasses === \"function\" ? node2.config.rootClasses(property, node2) : {};\n const globalConfigClasses = node2.config.classes ? createClasses(property, node2, node2.config.classes[property]) : {};\n const classesPropClasses = createClasses(\n property,\n node2,\n node2.props[`_${property}Class`]\n );\n const sectionPropClasses = createClasses(\n property,\n node2,\n node2.props[`${property}Class`]\n );\n className = generateClassList(\n node2,\n property,\n rootClasses,\n globalConfigClasses,\n classesPropClasses,\n sectionPropClasses\n );\n target[property] = className ?? \"\";\n });\n }\n }\n return className;\n }\n });\n node.on(\"prop:rootClasses\", () => {\n const keys = Object.keys(cachedClasses);\n for (const key of keys) {\n delete cachedClasses[key];\n }\n });\n const describedBy = computed(() => {\n if (!node)\n return void 0;\n const describers = [];\n if (context.help) {\n describers.push(`help-${node.props.id}`);\n }\n for (const key in messages3.value) {\n describers.push(`${node.props.id}-${key}`);\n }\n return describers.length ? describers.join(\" \") : void 0;\n });\n const value = ref(node.value);\n const _value = ref(node.value);\n const context = reactive({\n _value,\n attrs: node.props.attrs,\n disabled: node.props.disabled,\n describedBy,\n fns: {\n length: (obj) => Object.keys(obj).length,\n number: (value2) => Number(value2),\n string: (value2) => String(value2),\n json: (value2) => JSON.stringify(value2),\n eq: eq\n },\n handlers: {\n blur: (e) => {\n if (!node)\n return;\n node.store.set(\n /* @__PURE__ */ createMessage({ key: \"blurred\", visible: false, value: true })\n );\n if (typeof node.props.attrs.onBlur === \"function\") {\n node.props.attrs.onBlur(e);\n }\n },\n touch: () => {\n const doCompare = context.dirtyBehavior === \"compare\";\n if (node.store.dirty?.value && !doCompare)\n return;\n const isDirty = !eq(node.props._init, node._value);\n if (!isDirty && !doCompare)\n return;\n node.store.set(\n /* @__PURE__ */ createMessage({ key: \"dirty\", visible: false, value: isDirty })\n );\n },\n DOMInput: (e) => {\n node.input(e.target.value);\n node.emit(\"dom-input-event\", e);\n }\n },\n help: node.props.help,\n id: node.props.id,\n items,\n label: node.props.label,\n messages: messages3,\n didMount: false,\n node: markRaw(node),\n options: node.props.options,\n defaultMessagePlacement: true,\n slots: node.props.__slots,\n state: {\n blurred: false,\n complete: isComplete,\n dirty: false,\n empty: empty(value),\n submitted: false,\n settled: node.isSettled,\n valid: isValid,\n invalid: isInvalid,\n errors: hasErrors,\n rules: hasValidation,\n validationVisible,\n required: isRequired,\n failing: false,\n passing\n },\n type: node.props.type,\n family: node.props.family,\n ui,\n value,\n classes: classes2\n });\n node.on(\"created\", () => {\n if (!eq(context.value, node.value)) {\n _value.value = node.value;\n value.value = node.value;\n triggerRef(value);\n triggerRef(_value);\n }\n (async () => {\n await node.settled;\n if (node)\n node.props._init = cloneAny(node.value);\n })();\n });\n node.on(\"mounted\", () => {\n context.didMount = true;\n });\n node.on(\"settled\", ({ payload: isSettled }) => {\n context.state.settled = isSettled;\n });\n function observeProps(observe) {\n const propNames = Array.isArray(observe) ? observe : Object.keys(observe);\n propNames.forEach((prop) => {\n prop = camel(prop);\n if (!has(context, prop)) {\n context[prop] = node.props[prop];\n }\n node.on(`prop:${prop}`, ({ payload }) => {\n context[prop] = payload;\n });\n });\n }\n const rootProps = () => {\n const props = [\n \"__root\",\n \"help\",\n \"label\",\n \"disabled\",\n \"options\",\n \"type\",\n \"attrs\",\n \"preserve\",\n \"preserveErrors\",\n \"id\",\n \"dirtyBehavior\"\n ];\n const iconPattern = /^[a-zA-Z-]+(?:-icon|Icon)$/;\n const matchingProps = Object.keys(node.props).filter((prop) => {\n return iconPattern.test(prop);\n });\n return props.concat(matchingProps);\n };\n observeProps(rootProps());\n function definedAs(definition3) {\n if (definition3.props)\n observeProps(definition3.props);\n }\n node.props.definition && definedAs(node.props.definition);\n node.on(\"added-props\", ({ payload }) => observeProps(payload));\n node.on(\"input\", ({ payload }) => {\n if (node.type !== \"input\" && !isRef(payload) && !isReactive(payload)) {\n _value.value = shallowClone(payload);\n } else {\n _value.value = payload;\n triggerRef(_value);\n }\n });\n node.on(\"commitRaw\", ({ payload }) => {\n if (node.type !== \"input\" && !isRef(payload) && !isReactive(payload)) {\n value.value = _value.value = shallowClone(payload);\n } else {\n value.value = _value.value = payload;\n triggerRef(value);\n }\n node.emit(\"modelUpdated\");\n });\n node.on(\"commit\", ({ payload }) => {\n if ((!context.state.dirty || context.dirtyBehavior === \"compare\") && node.isCreated && hasTicked) {\n if (!node.store.validating?.value) {\n context.handlers.touch();\n } else {\n const receipt = node.on(\"message-removed\", ({ payload: message3 }) => {\n if (message3.key === \"validating\") {\n context.handlers.touch();\n node.off(receipt);\n }\n });\n }\n }\n if (isComplete && node.type === \"input\" && hasErrors.value && !undefine(node.props.preserveErrors)) {\n node.store.filter(\n (message3) => !(message3.type === \"error\" && message3.meta?.autoClear === true)\n );\n }\n if (node.type === \"list\" && node.sync) {\n items.value = node.children.map((child) => child.uid);\n }\n context.state.empty = empty(payload);\n });\n const updateState = async (message3) => {\n if (message3.type === \"ui\" && message3.visible && !message3.meta.showAsMessage) {\n ui[message3.key] = message3;\n } else if (message3.visible) {\n availableMessages[message3.key] = message3;\n } else if (message3.type === \"state\") {\n context.state[message3.key] = !!message3.value;\n }\n };\n node.on(\"message-added\", (e) => updateState(e.payload));\n node.on(\"message-updated\", (e) => updateState(e.payload));\n node.on(\"message-removed\", ({ payload: message3 }) => {\n delete ui[message3.key];\n delete availableMessages[message3.key];\n delete context.state[message3.key];\n });\n node.on(\"settled:blocking\", () => {\n isValid.value = true;\n });\n node.on(\"unsettled:blocking\", () => {\n isValid.value = false;\n });\n node.on(\"settled:errors\", () => {\n hasErrors.value = false;\n });\n node.on(\"unsettled:errors\", () => {\n hasErrors.value = true;\n });\n watch(validationVisible, (value2) => {\n if (value2) {\n hasShownErrors.value = true;\n }\n });\n node.context = context;\n node.emit(\"context\", node, false);\n node.on(\"destroyed\", () => {\n node.context = void 0;\n node = null;\n });\n };\n bindings_default = vueBindings;\n }\n});\n\n// packages/vue/src/defaultConfig.ts\nvar defaultConfig_exports = {};\n__export(defaultConfig_exports, {\n defaultConfig: () => defaultConfig\n});\nvar defaultConfig;\nvar init_defaultConfig = __esm({\n \"packages/vue/src/defaultConfig.ts\"() {\n init_bindings();\n defaultConfig = (options = {}) => {\n register();\n const {\n rules = {},\n locales = {},\n inputs: inputs$1 = {},\n messages: messages3 = {},\n locale = void 0,\n theme = void 0,\n iconLoaderUrl = void 0,\n iconLoader = void 0,\n icons = {},\n ...nodeOptions\n } = options;\n const validation = createValidationPlugin({\n ...defaultRules,\n ...rules || {}\n });\n const i18n = createI18nPlugin(\n extend({ en, ...locales || {} }, messages3)\n );\n const library = createLibraryPlugin(inputs, inputs$1);\n const themePlugin = createThemePlugin(theme, icons, iconLoaderUrl, iconLoader);\n return extend(\n {\n plugins: [library, themePlugin, bindings_default, i18n, validation],\n ...!locale ? {} : { config: { locale } }\n },\n nodeOptions || {},\n true\n );\n };\n }\n});\n\n// packages/vue/src/composables/onSSRComplete.ts\nvar isServer = typeof window === \"undefined\";\nvar ssrCompleteRegistry = /* @__PURE__ */ new Map();\nfunction ssrComplete(app) {\n if (!isServer)\n return;\n const callbacks = ssrCompleteRegistry.get(app);\n if (!callbacks)\n return;\n for (const callback of callbacks) {\n callback();\n }\n callbacks.clear();\n ssrCompleteRegistry.delete(app);\n}\nfunction onSSRComplete(app, callback) {\n if (!isServer || !app)\n return;\n if (!ssrCompleteRegistry.has(app))\n ssrCompleteRegistry.set(app, /* @__PURE__ */ new Set());\n ssrCompleteRegistry.get(app)?.add(callback);\n}\n\n// packages/vue/src/FormKitSchema.ts\nvar isServer2 = typeof window === \"undefined\";\nvar memo = {};\nvar memoKeys = {};\nvar instanceKey;\nvar instanceScopes = /* @__PURE__ */ new WeakMap();\nvar raw = \"__raw__\";\nvar isClassProp = /[a-zA-Z0-9\\-][cC]lass$/;\nfunction getRef(token3, data) {\n const value = ref(null);\n if (token3 === \"get\") {\n const nodeRefs = {};\n value.value = get.bind(null, nodeRefs);\n return value;\n }\n const path = token3.split(\".\");\n watchEffect(() => {\n value.value = getValue(\n isRef(data) ? data.value : data,\n path\n );\n });\n return value;\n}\nfunction getValue(set, path) {\n if (Array.isArray(set)) {\n for (const subset of set) {\n const value = subset !== false && getValue(subset, path);\n if (value !== void 0)\n return value;\n }\n return void 0;\n }\n let foundValue = void 0;\n let obj = set;\n for (const i in path) {\n const key = path[i];\n if (typeof obj !== \"object\" || obj === null) {\n foundValue = void 0;\n break;\n }\n const currentValue = obj[key];\n if (Number(i) === path.length - 1 && currentValue !== void 0) {\n foundValue = typeof currentValue === \"function\" ? currentValue.bind(obj) : currentValue;\n break;\n }\n obj = currentValue;\n }\n return foundValue;\n}\nfunction get(nodeRefs, id) {\n if (typeof id !== \"string\")\n return warn(650);\n if (!(id in nodeRefs))\n nodeRefs[id] = ref(void 0);\n if (nodeRefs[id].value === void 0) {\n nodeRefs[id].value = null;\n const root = getNode(id);\n if (root)\n nodeRefs[id].value = root.context;\n watchRegistry(id, ({ payload: node }) => {\n nodeRefs[id].value = isNode(node) ? node.context : node;\n });\n }\n return nodeRefs[id].value;\n}\nfunction parseSchema(library, schema, memoKey) {\n function parseCondition(library2, node) {\n const condition = provider(compile(node.if), { if: true });\n const children = createElements(library2, node.then);\n const alternate = node.else ? createElements(library2, node.else) : null;\n return [condition, children, alternate];\n }\n function parseConditionAttr(attr, _default) {\n const condition = provider(compile(attr.if));\n let b = () => _default;\n let a = () => _default;\n if (typeof attr.then === \"object\") {\n a = parseAttrs(attr.then, void 0);\n } else if (typeof attr.then === \"string\" && attr.then?.startsWith(\"$\")) {\n a = provider(compile(attr.then));\n } else {\n a = () => attr.then;\n }\n if (has(attr, \"else\")) {\n if (typeof attr.else === \"object\") {\n b = parseAttrs(attr.else);\n } else if (typeof attr.else === \"string\" && attr.else?.startsWith(\"$\")) {\n b = provider(compile(attr.else));\n } else {\n b = () => attr.else;\n }\n }\n return () => condition() ? a() : b();\n }\n function parseAttrs(unparsedAttrs, bindExp, _default = {}) {\n const explicitAttrs = new Set(Object.keys(unparsedAttrs || {}));\n const boundAttrs = bindExp ? provider(compile(bindExp)) : () => ({});\n const setters = [\n (attrs) => {\n const bound = boundAttrs();\n for (const attr in bound) {\n if (!explicitAttrs.has(attr)) {\n attrs[attr] = bound[attr];\n }\n }\n }\n ];\n if (unparsedAttrs) {\n if (isConditional(unparsedAttrs)) {\n const condition = parseConditionAttr(\n unparsedAttrs,\n _default\n );\n return condition;\n }\n for (let attr in unparsedAttrs) {\n const value = unparsedAttrs[attr];\n let getValue2;\n const isStr = typeof value === \"string\";\n if (attr.startsWith(raw)) {\n attr = attr.substring(7);\n getValue2 = () => value;\n } else if (isStr && value.startsWith(\"$\") && value.length > 1 && !(value.startsWith(\"$reset\") && isClassProp.test(attr))) {\n getValue2 = provider(compile(value));\n } else if (typeof value === \"object\" && isConditional(value)) {\n getValue2 = parseConditionAttr(value, void 0);\n } else if (typeof value === \"object\" && isPojo(value)) {\n getValue2 = parseAttrs(value);\n } else {\n getValue2 = () => value;\n }\n setters.push((attrs) => {\n attrs[attr] = getValue2();\n });\n }\n }\n return () => {\n const attrs = Array.isArray(unparsedAttrs) ? [] : {};\n setters.forEach((setter) => setter(attrs));\n return attrs;\n };\n }\n function parseNode(library2, _node) {\n let element = null;\n let attrs = () => null;\n let condition = false;\n let children = null;\n let alternate = null;\n let iterator = null;\n let resolve = false;\n const node = sugar(_node);\n if (isDOM(node)) {\n element = node.$el;\n attrs = node.$el !== \"text\" ? parseAttrs(node.attrs, node.bind) : () => null;\n } else if (isComponent(node)) {\n if (typeof node.$cmp === \"string\") {\n if (has(library2, node.$cmp)) {\n element = library2[node.$cmp];\n } else {\n element = node.$cmp;\n resolve = true;\n }\n } else {\n element = node.$cmp;\n }\n attrs = parseAttrs(node.props, node.bind);\n } else if (isConditional(node)) {\n [condition, children, alternate] = parseCondition(library2, node);\n }\n if (!isConditional(node) && \"if\" in node) {\n condition = provider(compile(node.if));\n } else if (!isConditional(node) && element === null) {\n condition = () => true;\n }\n if (\"children\" in node && node.children) {\n if (typeof node.children === \"string\") {\n if (node.children.startsWith(\"$slots.\")) {\n element = element === \"text\" ? \"slot\" : element;\n children = provider(compile(node.children));\n } else if (node.children.startsWith(\"$\") && node.children.length > 1) {\n const value = provider(compile(node.children));\n children = () => String(value());\n } else {\n children = () => String(node.children);\n }\n } else if (Array.isArray(node.children)) {\n children = createElements(library2, node.children);\n } else {\n const [childCondition, c, a] = parseCondition(library2, node.children);\n children = (iterationData) => childCondition && childCondition() ? c && c(iterationData) : a && a(iterationData);\n }\n }\n if (isComponent(node)) {\n if (children) {\n const produceChildren = children;\n children = (iterationData) => {\n return {\n default(slotData2, key) {\n const currentKey = instanceKey;\n if (key)\n instanceKey = key;\n if (slotData2)\n instanceScopes.get(instanceKey)?.unshift(slotData2);\n if (iterationData)\n instanceScopes.get(instanceKey)?.unshift(iterationData);\n const c = produceChildren(iterationData);\n if (slotData2)\n instanceScopes.get(instanceKey)?.shift();\n if (iterationData)\n instanceScopes.get(instanceKey)?.shift();\n instanceKey = currentKey;\n return c;\n }\n };\n };\n children.slot = true;\n } else {\n children = () => ({});\n }\n }\n if (\"for\" in node && node.for) {\n const values = node.for.length === 3 ? node.for[2] : node.for[1];\n const getValues = typeof values === \"string\" && values.startsWith(\"$\") ? provider(compile(values)) : () => values;\n iterator = [\n getValues,\n node.for[0],\n node.for.length === 3 ? String(node.for[1]) : null\n ];\n }\n return [condition, element, attrs, children, alternate, iterator, resolve];\n }\n function createSlots(children, iterationData) {\n const slots = children(iterationData);\n const currentKey = instanceKey;\n return Object.keys(slots).reduce((allSlots, slotName) => {\n const slotFn = slots && slots[slotName];\n allSlots[slotName] = (data) => {\n return slotFn && slotFn(data, currentKey) || null;\n };\n return allSlots;\n }, {});\n }\n function createElement(library2, node) {\n const [condition, element, attrs, children, alternate, iterator, resolve] = parseNode(library2, node);\n let createNodes = (iterationData) => {\n if (condition && element === null && children) {\n return condition() ? children(iterationData) : alternate && alternate(iterationData);\n }\n if (element && (!condition || condition())) {\n if (element === \"text\" && children) {\n return createTextVNode(String(children()));\n }\n if (element === \"slot\" && children)\n return children(iterationData);\n const el = resolve ? resolveComponent(element) : element;\n const slots = children?.slot ? createSlots(children, iterationData) : null;\n return h(\n el,\n attrs(),\n slots || (children ? children(iterationData) : [])\n );\n }\n return typeof alternate === \"function\" ? alternate(iterationData) : alternate;\n };\n if (iterator) {\n const repeatedNode = createNodes;\n const [getValues, valueName, keyName] = iterator;\n createNodes = () => {\n const _v = getValues();\n const values = Number.isFinite(_v) ? Array(Number(_v)).fill(0).map((_, i) => i) : _v;\n const fragment = [];\n if (typeof values !== \"object\")\n return null;\n const instanceScope = instanceScopes.get(instanceKey) || [];\n const isArray = Array.isArray(values);\n for (const key in values) {\n if (isArray && key in Array.prototype)\n continue;\n const iterationData = Object.defineProperty(\n {\n ...instanceScope.reduce(\n (previousIterationData, scopedData) => {\n if (previousIterationData.__idata) {\n return { ...previousIterationData, ...scopedData };\n }\n return scopedData;\n },\n {}\n ),\n [valueName]: values[key],\n ...keyName !== null ? { [keyName]: isArray ? Number(key) : key } : {}\n },\n \"__idata\",\n { enumerable: false, value: true }\n );\n instanceScope.unshift(iterationData);\n fragment.push(repeatedNode.bind(null, iterationData)());\n instanceScope.shift();\n }\n return fragment;\n };\n }\n return createNodes;\n }\n function createElements(library2, schema2) {\n if (Array.isArray(schema2)) {\n const els = schema2.map(createElement.bind(null, library2));\n return (iterationData) => els.map((element2) => element2(iterationData));\n }\n const element = createElement(library2, schema2);\n return (iterationData) => element(iterationData);\n }\n const providers = [];\n function provider(compiled, hints = {}) {\n const compiledFns = /* @__PURE__ */ new WeakMap();\n providers.push((callback, key) => {\n compiledFns.set(\n key,\n compiled.provide((tokens) => callback(tokens, hints))\n );\n });\n return () => compiledFns.get(instanceKey)();\n }\n function createInstance(providerCallback, key) {\n memoKey ?? (memoKey = toMemoKey(schema));\n const [render, compiledProviders] = has(memo, memoKey) ? memo[memoKey] : [createElements(library, schema), providers];\n if (!isServer2) {\n memoKeys[memoKey] ?? (memoKeys[memoKey] = 0);\n memoKeys[memoKey]++;\n memo[memoKey] = [render, compiledProviders];\n }\n compiledProviders.forEach((compiledProvider) => {\n compiledProvider(providerCallback, key);\n });\n return () => {\n instanceKey = key;\n return render();\n };\n }\n return createInstance;\n}\nfunction useScope(token3, defaultValue) {\n const scopedData = instanceScopes.get(instanceKey) || [];\n let scopedValue = void 0;\n if (scopedData.length) {\n scopedValue = getValue(scopedData, token3.split(\".\"));\n }\n return scopedValue === void 0 ? defaultValue : scopedValue;\n}\nfunction slotData(data, key) {\n return new Proxy(data, {\n get(...args) {\n let data2 = void 0;\n const property = args[1];\n if (typeof property === \"string\") {\n const prevKey = instanceKey;\n instanceKey = key;\n data2 = useScope(property, void 0);\n instanceKey = prevKey;\n }\n return data2 !== void 0 ? data2 : Reflect.get(...args);\n }\n });\n}\nfunction createRenderFn(instanceCreator, data, instanceKey2) {\n return instanceCreator(\n (requirements, hints = {}) => {\n return requirements.reduce((tokens, token3) => {\n if (token3.startsWith(\"slots.\")) {\n const slot = token3.substring(6);\n const hasSlot = () => data.slots && has(data.slots, slot) && typeof data.slots[slot] === \"function\";\n if (hints.if) {\n tokens[token3] = hasSlot;\n } else if (data.slots) {\n const scopedData = slotData(data, instanceKey2);\n tokens[token3] = () => hasSlot() ? data.slots[slot](scopedData) : null;\n }\n } else {\n const value = getRef(token3, data);\n tokens[token3] = () => useScope(token3, value.value);\n }\n return tokens;\n }, {});\n },\n instanceKey2\n );\n}\nfunction clean(schema, memoKey, instanceKey2) {\n memoKey ?? (memoKey = toMemoKey(schema));\n memoKeys[memoKey]--;\n if (memoKeys[memoKey] === 0) {\n delete memoKeys[memoKey];\n const [, providers] = memo[memoKey];\n delete memo[memoKey];\n providers.length = 0;\n }\n instanceScopes.delete(instanceKey2);\n}\nfunction toMemoKey(schema) {\n return JSON.stringify(schema, (_, value) => {\n if (typeof value === \"function\") {\n return value.toString();\n }\n return value;\n });\n}\nvar FormKitSchema = /* @__PURE__ */ defineComponent({\n name: \"FormKitSchema\",\n props: {\n schema: {\n type: [Array, Object],\n required: true\n },\n data: {\n type: Object,\n default: () => ({})\n },\n library: {\n type: Object,\n default: () => ({})\n },\n memoKey: {\n type: String,\n required: false\n }\n },\n emits: [\"mounted\"],\n setup(props, context) {\n const instance = getCurrentInstance();\n let instanceKey2 = {};\n instanceScopes.set(instanceKey2, []);\n const library = { FormKit: markRaw(FormKit_default), ...props.library };\n let provider = parseSchema(library, props.schema, props.memoKey);\n let render;\n let data;\n if (!isServer2) {\n watch(\n () => props.schema,\n (newSchema, oldSchema) => {\n const oldKey = instanceKey2;\n instanceKey2 = {};\n instanceScopes.set(instanceKey2, []);\n provider = parseSchema(library, props.schema, props.memoKey);\n render = createRenderFn(provider, data, instanceKey2);\n if (newSchema === oldSchema) {\n (instance?.proxy?.$forceUpdate)();\n }\n clean(props.schema, props.memoKey, oldKey);\n },\n { deep: true }\n );\n }\n watchEffect(() => {\n data = Object.assign(reactive(props.data ?? {}), {\n slots: context.slots\n });\n context.slots;\n render = createRenderFn(provider, data, instanceKey2);\n });\n function cleanUp() {\n clean(props.schema, props.memoKey, instanceKey2);\n if (data) {\n if (data.node)\n data.node.destroy();\n data.slots = null;\n data = null;\n }\n render = null;\n }\n onMounted(() => context.emit(\"mounted\"));\n onUnmounted(cleanUp);\n onSSRComplete(getCurrentInstance()?.appContext.app, cleanUp);\n return () => render ? render() : null;\n }\n});\nvar FormKitSchema_default = FormKitSchema;\nvar isServer3 = typeof window === \"undefined\";\nvar parentSymbol = Symbol(\"FormKitParent\");\nvar componentSymbol = Symbol(\"FormKitComponentCallback\");\nvar currentSchemaNode = null;\nvar getCurrentSchemaNode = () => currentSchemaNode;\nfunction FormKit(props, context) {\n const node = useInput(props, context);\n if (!node.props.definition)\n error(600, node);\n if (node.props.definition.component) {\n return () => h(\n node.props.definition?.component,\n {\n context: node.context\n },\n { ...context.slots }\n );\n }\n const schema = ref([]);\n let memoKey = node.props.definition.schemaMemoKey;\n const generateSchema = () => {\n const schemaDefinition = node.props?.definition?.schema;\n if (!schemaDefinition)\n error(601, node);\n if (typeof schemaDefinition === \"function\") {\n currentSchemaNode = node;\n schema.value = schemaDefinition({ ...props.sectionsSchema || {} });\n currentSchemaNode = null;\n if (memoKey && props.sectionsSchema || \"memoKey\" in schemaDefinition && typeof schemaDefinition.memoKey === \"string\") {\n memoKey = (memoKey ?? schemaDefinition?.memoKey) + JSON.stringify(props.sectionsSchema);\n }\n } else {\n schema.value = schemaDefinition;\n }\n };\n generateSchema();\n if (!isServer3) {\n node.on(\"schema\", () => {\n memoKey += \"♻️\";\n generateSchema();\n });\n }\n context.emit(\"node\", node);\n const definitionLibrary = node.props.definition.library;\n const library = {\n FormKit: markRaw(formkitComponent),\n ...definitionLibrary,\n ...props.library ?? {}\n };\n function didMount() {\n node.emit(\"mounted\");\n }\n context.expose({ node });\n return () => h(\n FormKitSchema,\n {\n schema: schema.value,\n data: node.context,\n onMounted: didMount,\n library,\n memoKey\n },\n { ...context.slots }\n );\n}\nvar formkitComponent = /* @__PURE__ */ defineComponent(\n FormKit,\n {\n props: runtimeProps,\n inheritAttrs: false\n }\n);\nvar FormKit_default = formkitComponent;\nvar rootSymbol = Symbol();\nvar FormKitRoot = /* @__PURE__ */ defineComponent((_p, context) => {\n const boundary = ref(null);\n const showBody = ref(false);\n const shadowRoot = ref(void 0);\n const stopWatch2 = watch(boundary, (el) => {\n let parent = el;\n let root = null;\n while (parent = parent?.parentNode) {\n root = parent;\n if (root instanceof ShadowRoot || root instanceof Document) {\n foundRoot(root);\n break;\n }\n }\n stopWatch2();\n showBody.value = true;\n });\n provide(rootSymbol, shadowRoot);\n function foundRoot(root) {\n shadowRoot.value = root;\n }\n return () => showBody.value && context.slots.default ? context.slots.default() : h(\"template\", { ref: boundary });\n});\nfunction createPlugin(app, options) {\n app.component(options.alias || \"FormKit\", FormKit_default).component(options.schemaAlias || \"FormKitSchema\", FormKitSchema_default);\n return {\n get: getNode,\n setLocale: (locale) => {\n if (options.config?.rootConfig) {\n options.config.rootConfig.locale = locale;\n }\n },\n clearErrors,\n setErrors,\n submit: submitForm,\n reset\n };\n}\nvar optionsSymbol = Symbol.for(\"FormKitOptions\");\nvar configSymbol = Symbol.for(\"FormKitConfig\");\nvar plugin = {\n install(app, _options) {\n const options = Object.assign(\n {\n alias: \"FormKit\",\n schemaAlias: \"FormKitSchema\"\n },\n typeof _options === \"function\" ? _options() : _options\n );\n const rootConfig = createConfig(options.config || {});\n options.config = { rootConfig };\n app.config.globalProperties.$formkit = createPlugin(app, options);\n app.provide(optionsSymbol, options);\n app.provide(configSymbol, rootConfig);\n if (typeof window !== \"undefined\") {\n globalThis.__FORMKIT_CONFIGS__ = (globalThis.__FORMKIT_CONFIGS__ || []).concat([rootConfig]);\n }\n }\n};\n\n// packages/vue/src/composables/useInput.ts\nvar isBrowser = typeof window !== \"undefined\";\nvar pseudoProps = [\n // Boolean props\n \"ignore\",\n \"disabled\",\n \"preserve\",\n // String props\n \"help\",\n \"label\",\n /^preserve(-e|E)rrors/,\n /^[a-z]+(?:-visibility|Visibility|-behavior|Behavior)$/,\n /^[a-zA-Z-]+(?:-class|Class)$/,\n \"prefixIcon\",\n \"suffixIcon\",\n /^[a-zA-Z-]+(?:-icon|Icon)$/\n];\nvar boolProps = [\"disabled\", \"ignore\", \"preserve\"];\nfunction classesToNodeProps(node, props) {\n if (props.classes) {\n Object.keys(props.classes).forEach(\n (key) => {\n if (typeof key === \"string\") {\n node.props[`_${key}Class`] = props.classes[key];\n if (isObject(props.classes[key]) && key === \"inner\")\n Object.values(props.classes[key]);\n }\n }\n );\n }\n}\nfunction onlyListeners(props) {\n if (!props)\n return {};\n const knownListeners = [\"Submit\", \"SubmitRaw\", \"SubmitInvalid\"].reduce(\n (listeners, listener) => {\n const name = `on${listener}`;\n if (name in props) {\n if (typeof props[name] === \"function\") {\n listeners[name] = props[name];\n }\n }\n return listeners;\n },\n {}\n );\n return knownListeners;\n}\nfunction useInput(props, context, options = {}) {\n const config = Object.assign({}, inject(optionsSymbol) || {}, options);\n const __root = inject(rootSymbol, ref(isBrowser ? document : void 0));\n const __cmpCallback = inject(componentSymbol, () => {\n });\n const instance = getCurrentInstance();\n const listeners = onlyListeners(instance?.vnode.props);\n const isVModeled = [\"modelValue\", \"model-value\"].some(\n (prop) => prop in (instance?.vnode.props ?? {})\n );\n let isMounted = false;\n onMounted(() => {\n isMounted = true;\n });\n const value = props.modelValue !== void 0 ? props.modelValue : cloneAny(context.attrs.value);\n function createInitialProps() {\n const initialProps2 = {\n ...nodeProps(props),\n ...listeners,\n type: props.type ?? \"text\",\n __root: __root.value,\n __slots: context.slots\n };\n const attrs = except(nodeProps(context.attrs), pseudoProps);\n if (!attrs.key)\n attrs.key = token();\n initialProps2.attrs = attrs;\n const propValues = only(nodeProps(context.attrs), pseudoProps);\n for (const propName in propValues) {\n if (boolProps.includes(propName) && propValues[propName] === \"\") {\n propValues[propName] = true;\n }\n initialProps2[camel(propName)] = propValues[propName];\n }\n const classesProps = { props: {} };\n classesToNodeProps(classesProps, props);\n Object.assign(initialProps2, classesProps.props);\n if (typeof initialProps2.type !== \"string\") {\n initialProps2.definition = initialProps2.type;\n delete initialProps2.type;\n }\n return initialProps2;\n }\n const initialProps = createInitialProps();\n const parent = initialProps.ignore ? null : props.parent || inject(parentSymbol, null);\n const node = createNode(\n extend(\n config || {},\n {\n name: props.name || void 0,\n value,\n parent,\n plugins: (config.plugins || []).concat(props.plugins ?? []),\n config: props.config || {},\n props: initialProps,\n index: props.index,\n sync: !!undefine(context.attrs.sync || context.attrs.dynamic)\n },\n false,\n true\n )\n );\n __cmpCallback(node);\n if (!node.props.definition)\n error(600, node);\n const lateBoundProps = ref(\n new Set(\n Array.isArray(node.props.__propDefs) ? node.props.__propDefs : Object.keys(node.props.__propDefs ?? {})\n )\n );\n node.on(\n \"added-props\",\n ({ payload: lateProps }) => {\n const propNames = Array.isArray(lateProps) ? lateProps : Object.keys(lateProps ?? {});\n propNames.forEach((newProp) => lateBoundProps.value.add(newProp));\n }\n );\n const pseudoPropNames = computed(\n () => pseudoProps.concat([...lateBoundProps.value]).reduce((names, prop) => {\n if (typeof prop === \"string\") {\n names.push(camel(prop));\n names.push(kebab(prop));\n } else {\n names.push(prop);\n }\n return names;\n }, [])\n );\n watchEffect(() => classesToNodeProps(node, props));\n const passThrough = nodeProps(props);\n for (const prop in passThrough) {\n watch(\n () => props[prop],\n () => {\n if (props[prop] !== void 0) {\n node.props[prop] = props[prop];\n }\n }\n );\n }\n watchEffect(() => {\n node.props.__root = __root.value;\n });\n const attributeWatchers = /* @__PURE__ */ new Set();\n const possibleProps = nodeProps(context.attrs);\n watchEffect(() => {\n watchAttributes(only(possibleProps, pseudoPropNames.value));\n });\n function watchAttributes(attrProps) {\n attributeWatchers.forEach((stop) => {\n stop();\n attributeWatchers.delete(stop);\n });\n for (const prop in attrProps) {\n const camelName = camel(prop);\n attributeWatchers.add(\n watch(\n () => context.attrs[prop],\n () => {\n node.props[camelName] = context.attrs[prop];\n }\n )\n );\n }\n }\n watchEffect(() => {\n const attrs = except(nodeProps(context.attrs), pseudoPropNames.value);\n if (\"multiple\" in attrs)\n attrs.multiple = undefine(attrs.multiple);\n if (typeof attrs.onBlur === \"function\") {\n attrs.onBlur = oncePerTick(attrs.onBlur);\n }\n node.props.attrs = Object.assign({}, node.props.attrs || {}, attrs);\n });\n watchEffect(() => {\n const messages3 = (props.errors ?? []).map(\n (error3) => /* @__PURE__ */ createMessage({\n key: slugify(error3),\n type: \"error\",\n value: error3,\n meta: { source: \"prop\" }\n })\n );\n node.store.apply(\n messages3,\n (message3) => message3.type === \"error\" && message3.meta.source === \"prop\"\n );\n });\n if (node.type !== \"input\") {\n const sourceKey = `${node.name}-prop`;\n watchEffect(() => {\n const inputErrors = props.inputErrors ?? {};\n const keys = Object.keys(inputErrors);\n if (!keys.length)\n node.clearErrors(true, sourceKey);\n const messages3 = keys.reduce((messages4, key) => {\n let value2 = inputErrors[key];\n if (typeof value2 === \"string\")\n value2 = [value2];\n if (Array.isArray(value2)) {\n messages4[key] = value2.map(\n (error3) => /* @__PURE__ */ createMessage({\n key: error3,\n type: \"error\",\n value: error3,\n meta: { source: sourceKey }\n })\n );\n }\n return messages4;\n }, {});\n node.store.apply(\n messages3,\n (message3) => message3.type === \"error\" && message3.meta.source === sourceKey\n );\n });\n }\n watchEffect(() => Object.assign(node.config, props.config));\n if (node.type !== \"input\") {\n provide(parentSymbol, node);\n }\n let clonedValueBeforeVmodel = void 0;\n node.on(\"modelUpdated\", () => {\n context.emit(\"inputRaw\", node.context?.value, node);\n if (isMounted) {\n context.emit(\"input\", node.context?.value, node);\n }\n if (isVModeled && node.context) {\n clonedValueBeforeVmodel = cloneAny(node.value);\n context.emit(\"update:modelValue\", shallowClone(node.value));\n }\n });\n if (isVModeled) {\n watch(\n toRef(props, \"modelValue\"),\n (value2) => {\n if (!eq(clonedValueBeforeVmodel, value2)) {\n node.input(value2, false);\n }\n },\n { deep: true }\n );\n if (node.value !== value) {\n node.emit(\"modelUpdated\");\n }\n }\n onBeforeUnmount(() => node.destroy());\n return node;\n}\nvar totalCreated = 1;\nfunction isComponent2(obj) {\n return typeof obj === \"function\" && obj.length === 2 || typeof obj === \"object\" && !Array.isArray(obj) && !(\"$el\" in obj) && !(\"$cmp\" in obj) && !(\"if\" in obj);\n}\nfunction createInput(schemaOrComponent, definitionOptions = {}, sectionsSchema = {}) {\n const definition3 = {\n type: \"input\",\n ...definitionOptions\n };\n let schema;\n if (isComponent2(schemaOrComponent)) {\n const cmpName = `SchemaComponent${totalCreated++}`;\n schema = createSection(\"input\", () => ({\n $cmp: cmpName,\n props: {\n context: \"$node.context\"\n }\n }));\n definition3.library = { [cmpName]: markRaw(schemaOrComponent) };\n } else if (typeof schemaOrComponent === \"function\") {\n schema = schemaOrComponent;\n } else {\n schema = createSection(\"input\", () => cloneAny(schemaOrComponent));\n }\n definition3.schema = useSchema(schema || \"Schema undefined\", sectionsSchema);\n if (!definition3.schemaMemoKey) {\n definition3.schemaMemoKey = `${Math.random()}`;\n }\n return definition3;\n}\n\n// packages/vue/src/composables/defineFormKitConfig.ts\nfunction defineFormKitConfig(config) {\n return () => typeof config === \"function\" ? config() : config;\n}\nvar inputList = {};\nvar schemas = {};\nvar classes = {\n container: `\n formkit-kitchen-sink \n p-8\n `,\n tabs: `\n formkit-tabs \n mt-4 \n mr-[min(350px,25vw)]\n `,\n tab: `\n formkit-kitchen-sink-tab\n inline-block\n mb-4\n -mr-px\n cursor-pointer\n px-4\n py-2\n border\n border-neutral-200\n text-neutral-800\n data-[active]:bg-neutral-800\n data-[active]:border-neutral-800\n data-[active]:text-neutral-50\n hover:bg-neutral-100\n hover:text-neutral-900\n dark:border-neutral-700\n dark:text-neutral-50\n dark:data-[active]:bg-neutral-100\n dark:data-[active]:border-neutral-100\n dark:data-[active]:text-neutral-800\n dark:hover:bg-neutral-800\n dark:hover:text-neutral-50\n `,\n filterContainer: `\n formkit-filter-container\n grid\n grid-cols-[repeat(auto-fit,300px)]\n mr-[min(350px,25vw)]\n -mt-4\n mb-8\n px-4\n pt-8\n pb-4\n border\n relative\n -translate-y-px\n max-w-[1000px]\n border-neutral-200\n dark:border-neutral-700\n `,\n filterGroup: `\n formkit-filter-group\n mr-8\n mb-8\n [&_legend]:text-lg\n [&_ul]:columns-2\n [&_ul>li:first-child]:[column-span:all]\n [&_ul>li:first-child]:mt-2\n [&_ul>li:first-child]:mb-2\n [&_ul>li:first-child]:pb-2\n [&_ul>li:first-child]:border-b\n [&_ul>li:first-child]:border-neutral-200\n dark:[&_ul>li:first-child]:border-neutral-700\n `,\n formContainer: `\n formkit-form-container\n w-full\n bg-white\n rounded\n border\n border-neutral-100\n shadow-lg\n max-w-[800px]\n p-[min(5vw,5rem)]\n dark:bg-neutral-900\n dark:border-neutral-800\n dark:shadow-3xl\n [&_form>h1]:text-2xl\n [&_form>h1]:mb-4\n [&_form>h1]:font-bold\n [&_form>h1+p]:text-base\n [&_form>h1+p]:mb-4\n [&_form>h1+p]:-mt-2\n [&_form_.double]:flex\n [&_form_.double>*]:w-1/2\n [&_form_.double>*:first-child]:mr-2\n [&_form_.triple]:flex\n [&_form_.triple>*]:w-1/3\n [&_form_.triple>*:first-child]:mr-2\n [&_form_.triple>*:last-child]:ml-2\n `,\n inputs: `formkit-inputs`,\n specimen: `\n formkit-specimen \n flex \n flex-col \n p-2 \n max-w-[75vw]\n `,\n inputSection: `\n group/section\n formkit-input-section \n mr-[min(325px,25vw)]\n `,\n specimenGroup: `\n formkit-specimen-group\n grid\n mb-16\n grid-cols-[repeat(auto-fit,400px)]\n group-data-[type=\"transferlist\"]/section:grid-cols-[repeat(auto-fit,650px)]\n group-data-[type=\"multi-step\"]/section:grid-cols-[repeat(auto-fit,550px)]\n `,\n inputType: `\n formkit-input-type\n block\n font-bold\n text-neutral-900\n border-b\n border-neutral-100\n text-3xl\n mb-8\n pb-2\n capitalize\n dark:border-neutral-800 \n dark:text-neutral-50\n `\n};\nasync function fetchInputList() {\n const response = await fetch(\n \"https://raw.githubusercontent.com/formkit/input-schemas/master/index.json\"\n );\n const json = await response.json();\n return json;\n}\nasync function fetchInputSchema(input) {\n try {\n const response = await fetch(\n `https://raw.githubusercontent.com/formkit/input-schemas/master/schemas/${input}.json`\n );\n const json = await response.json();\n return json;\n } catch (error3) {\n console.error(error3);\n }\n}\nvar FormKitKitchenSink = /* @__PURE__ */ defineComponent({\n name: \"FormKitKitchenSink\",\n props: {\n schemas: {\n type: Array,\n required: false\n },\n pro: {\n type: Boolean,\n default: true\n },\n addons: {\n type: Boolean,\n default: true\n },\n forms: {\n type: Boolean,\n default: true\n },\n navigation: {\n type: Boolean,\n default: true\n }\n },\n async setup(props) {\n onMounted(() => {\n const filterNode = getNode(\"filter-checkboxes\");\n data.filters = computed(() => {\n if (!filterNode?.context)\n return [];\n const filters = filterNode.context.value;\n const filterValues = [];\n Object.keys(filters).forEach((key) => {\n filterValues.push(...filters[key]);\n });\n return filterValues;\n });\n });\n inputList = Object.keys(inputList).length ? inputList : await fetchInputList();\n const promises = [];\n const activeTab = ref(\"\");\n const inputCheckboxes = computed(() => {\n const inputGroups = {\n core: { label: \"Inputs\", name: \"core\", inputs: inputList.core }\n };\n if (props.pro) {\n inputGroups.pro = {\n label: \"Pro Inputs\",\n name: \"pro\",\n inputs: inputList.pro\n };\n }\n if (props.addons) {\n inputGroups.addons = {\n label: \"Add-ons\",\n name: \"addons\",\n inputs: inputList.addons\n };\n }\n return inputGroups;\n });\n if (!props.schemas) {\n const coreInputPromises = inputList.core.map(async (schema) => {\n const response = await fetchInputSchema(schema);\n schemas[schema] = response;\n });\n promises.push(...coreInputPromises);\n if (props.forms) {\n const formsPromises = inputList.forms.map(async (schema) => {\n const schemaName = `form/${schema}`;\n const response = await fetchInputSchema(schemaName);\n schemas[schemaName] = response;\n });\n promises.push(...formsPromises);\n }\n if (props.pro) {\n const proInputPromises = inputList.pro.map(async (schema) => {\n const response = await fetchInputSchema(schema);\n schemas[schema] = response;\n });\n promises.push(...proInputPromises);\n }\n if (props.addons) {\n const addonPromises = inputList.addons.map(async (schema) => {\n const response = await fetchInputSchema(schema);\n schemas[schema] = response;\n });\n promises.push(...addonPromises);\n }\n } else {\n const schemaPromises = props.schemas.map(async (schema) => {\n const response = await fetchInputSchema(`${schema}`);\n schemas[`${schema}`] = response;\n });\n promises.push(...schemaPromises);\n }\n const selectAll = (node) => {\n let previousValue = [];\n let skip = false;\n if (node.props.type !== \"checkbox\")\n return;\n node.on(\"created\", () => {\n const currentValue = node.value;\n if (Array.isArray(currentValue) && currentValue.length === 1 && currentValue[0] === \"all\") {\n node.input(\n node.props.options.map((option) => {\n if (typeof option !== \"string\")\n return option.value;\n return option;\n })\n );\n }\n previousValue = Array.isArray(node.value) ? node.value : [];\n });\n node.on(\"commit\", ({ payload }) => {\n if (skip) {\n skip = false;\n return;\n }\n if (!Array.isArray(payload))\n return;\n const previousValueHadAll = previousValue.includes(\"all\");\n const currentValueHasAll = payload.includes(\"all\");\n if (!previousValueHadAll && currentValueHasAll) {\n const computedOptions = node.props.options.map(\n (option) => {\n if (typeof option !== \"string\")\n return option.value;\n return option;\n }\n );\n node.input(computedOptions);\n previousValue = computedOptions;\n return;\n }\n if (previousValueHadAll && !currentValueHasAll) {\n node.input([]);\n previousValue = [];\n return;\n }\n const valueMinusAll = payload.filter((value) => value !== \"all\");\n if (valueMinusAll.length < node.props.options.length - 1 && currentValueHasAll) {\n node.input(valueMinusAll);\n previousValue = valueMinusAll;\n skip = true;\n return;\n }\n if (valueMinusAll.length === node.props.options.length - 1 && !currentValueHasAll) {\n const computedOptions = node.props.options.map(\n (option) => {\n if (typeof option !== \"string\")\n return option.value;\n return option;\n }\n );\n node.input(computedOptions);\n previousValue = Array.isArray(node.value) ? node.value : [];\n return;\n }\n });\n };\n const data = reactive({\n twClasses: classes,\n basicOptions: Array.from({ length: 15 }, (_, i) => `Option ${i + 1}`),\n asyncLoader: async () => {\n return await new Promise(() => {\n });\n },\n paginatedLoader: async ({\n page,\n hasNextPage\n }) => {\n const base = (page - 1) * 10;\n hasNextPage();\n return Array.from({ length: 10 }, (_, i) => `Option ${base + i + 1}`);\n },\n formSubmitHandler: async (data2) => {\n await new Promise((resolve) => setTimeout(resolve, 1e3));\n alert(\"Form submitted (fake) — check console for data object\");\n console.log(\"Form data:\", data2);\n },\n includes: (array, value) => {\n if (!Array.isArray(array))\n return false;\n return array.includes(value);\n },\n checkboxPlugins: [selectAll],\n filters: []\n });\n await Promise.all(promises);\n const inputKeys = Object.keys(schemas);\n const formNames = inputKeys.map((key) => {\n if (key.startsWith(\"form/\")) {\n switch (key) {\n case \"form/tshirt\":\n return {\n id: key,\n name: \"Order Form\"\n };\n default:\n const name = key.replace(\"form/\", \"\");\n return {\n id: key,\n name: name.charAt(0).toUpperCase() + name.slice(1) + \" Form\"\n };\n }\n }\n return {\n id: key,\n name: \"\"\n };\n });\n const filteredFormNames = formNames.filter((form) => form.name !== \"\");\n const forms = inputKeys.filter((schema) => {\n return schema.startsWith(\"form/\");\n });\n const inputs = inputKeys.filter(\n (schema) => !schema.startsWith(\"form/\")\n );\n const tabs = [];\n if (inputs.length) {\n tabs.push({\n id: \"kitchen-sink\",\n name: \"Kitchen Sink\"\n });\n }\n if (forms.length) {\n tabs.push(...filteredFormNames.sort((a, b) => a.name > b.name ? 1 : -1));\n }\n if (tabs.length) {\n activeTab.value = tabs[0].id;\n }\n const kitchenSinkRenders = computed(() => {\n inputs.sort();\n const schemaDefinitions = inputs.reduce(\n (schemaDefinitions2, inputName) => {\n const schemaDefinition = schemas[inputName];\n schemaDefinitions2.push({\n $el: \"div\",\n if: '$includes($filters, \"' + inputName + '\")',\n attrs: {\n key: inputName,\n class: \"$twClasses.inputSection\",\n \"data-type\": inputName\n },\n children: [\n {\n $el: \"h2\",\n attrs: {\n class: \"$twClasses.inputType\"\n },\n children: inputName\n },\n {\n $el: \"div\",\n attrs: {\n class: \"$twClasses.specimenGroup\"\n },\n children: [\n ...(Array.isArray(schemaDefinition) ? schemaDefinition : [schemaDefinition]).map((specimen) => {\n return {\n $el: \"div\",\n attrs: {\n class: \"$twClasses.specimen\"\n },\n children: [specimen]\n };\n })\n ]\n }\n ]\n });\n return schemaDefinitions2;\n },\n []\n );\n return h(\n KeepAlive,\n {},\n {\n default: () => {\n return activeTab.value === \"kitchen-sink\" ? h(FormKitSchema, { schema: schemaDefinitions, data }) : null;\n }\n }\n );\n });\n const formRenders = computed(() => {\n return filteredFormNames.map((form) => {\n const schemaDefinition = schemas[form.id];\n return h(\n \"div\",\n {\n key: form.id\n },\n activeTab.value === form.id ? [\n h(\n \"div\",\n {\n class: classes.formContainer\n },\n [\n h(FormKitSchema, {\n schema: schemaDefinition[0],\n data\n })\n ]\n )\n ] : \"\"\n );\n }).filter((form) => form.children);\n });\n const tabBar = computed(() => {\n return h(\n \"div\",\n {\n key: \"tab-bar\",\n class: classes.tabs\n },\n tabs.map((tab) => {\n return h(\n \"span\",\n {\n class: classes.tab,\n key: tab.id,\n \"data-tab\": tab.id,\n \"data-active\": activeTab.value === tab.id || void 0,\n onClick: () => {\n activeTab.value = tab.id;\n }\n },\n tab.name\n );\n })\n );\n });\n const filterCheckboxes = computed(() => {\n const createCheckboxSchema = (inputGroup) => {\n return {\n $el: \"div\",\n attrs: {\n class: \"$twClasses.filterGroup\"\n },\n children: [\n {\n $formkit: \"checkbox\",\n name: inputGroup.name,\n label: inputGroup.label,\n plugins: \"$checkboxPlugins\",\n value: [\"all\"],\n options: [\n {\n label: \"All\",\n value: \"all\"\n },\n ...Array.isArray(inputGroup.inputs) ? inputGroup.inputs : []\n ]\n }\n ]\n };\n };\n const filterSchema = h(FormKitSchema, {\n key: \"filter-checkboxes\",\n data,\n schema: {\n $formkit: \"group\",\n id: \"filter-checkboxes\",\n children: [\n {\n $el: \"div\",\n attrs: {\n class: \"$twClasses.filterContainer\"\n },\n children: Object.keys(inputCheckboxes.value).map((key) => {\n const inputGroup = inputCheckboxes.value[key];\n return createCheckboxSchema(inputGroup);\n })\n }\n ]\n }\n });\n return h(\n KeepAlive,\n {},\n {\n default: () => {\n if (!(tabs.find((tab) => tab.id === \"kitchen-sink\") && activeTab.value === \"kitchen-sink\")) {\n return null;\n }\n return filterSchema;\n }\n }\n );\n });\n return () => {\n return h(\n \"div\",\n {\n class: classes.container\n },\n [\n tabs.length > 1 ? tabBar.value : void 0,\n filterCheckboxes.value,\n ...formRenders.value,\n kitchenSinkRenders.value\n ]\n );\n };\n }\n});\nvar messages = createSection(\"messages\", () => ({\n $el: \"ul\",\n if: \"$fns.length($messages)\"\n}));\nvar message = createSection(\"message\", () => ({\n $el: \"li\",\n for: [\"message\", \"$messages\"],\n attrs: {\n key: \"$message.key\",\n id: `$id + '-' + $message.key`,\n \"data-message-type\": \"$message.type\"\n }\n}));\nvar definition = messages(message(\"$message.value\"));\nvar FormKitMessages = /* @__PURE__ */ defineComponent({\n props: {\n node: {\n type: Object,\n required: false\n },\n sectionsSchema: {\n type: Object,\n default: {}\n },\n defaultPosition: {\n type: [String, Boolean],\n default: false\n },\n library: {\n type: Object,\n default: () => ({})\n }\n },\n setup(props, context) {\n const node = computed(() => {\n return props.node || inject(parentSymbol, void 0);\n });\n watch(\n node,\n () => {\n if (node.value?.context && !undefine(props.defaultPosition)) {\n node.value.context.defaultMessagePlacement = false;\n }\n },\n { immediate: true }\n );\n const schema = definition(props.sectionsSchema || {});\n const data = computed(() => {\n return {\n messages: node.value?.context?.messages || {},\n fns: node.value?.context?.fns || {},\n classes: node.value?.context?.classes || {}\n };\n });\n return () => node.value?.context ? h(\n FormKitSchema_default,\n { schema, data: data.value, library: props.library },\n { ...context.slots }\n ) : null;\n }\n});\nfunction useConfig(config) {\n const options = Object.assign(\n {\n alias: \"FormKit\",\n schemaAlias: \"FormKitSchema\"\n },\n typeof config === \"function\" ? config() : config\n );\n const rootConfig = createConfig(options.config || {});\n options.config = { rootConfig };\n provide(optionsSymbol, options);\n provide(configSymbol, rootConfig);\n if (typeof window !== \"undefined\") {\n globalThis.__FORMKIT_CONFIGS__ = (globalThis.__FORMKIT_CONFIGS__ || []).concat([rootConfig]);\n }\n}\nvar FormKitProvider = /* @__PURE__ */ defineComponent(\n function FormKitProvider2(props, { slots, attrs }) {\n const options = {};\n if (props.config) {\n useConfig(props.config);\n }\n return () => slots.default ? slots.default(options).map((vnode) => {\n return h(vnode, {\n ...attrs,\n ...vnode.props\n });\n }) : null;\n },\n { props: [\"config\"], name: \"FormKitProvider\", inheritAttrs: false }\n);\nvar FormKitConfigLoader = /* @__PURE__ */ defineComponent(\n async function FormKitConfigLoader2(props, context) {\n let config = {};\n if (props.configFile) {\n const configFile = await import(\n /*@__formkit.config.ts__*/\n /* @vite-ignore */\n /* webpackIgnore: true */\n props.configFile\n );\n config = \"default\" in configFile ? configFile.default : configFile;\n }\n if (typeof config === \"function\") {\n config = config();\n }\n const useDefaultConfig = props.defaultConfig ?? true;\n if (useDefaultConfig) {\n const { defaultConfig: defaultConfig2 } = await Promise.resolve().then(() => (init_defaultConfig(), defaultConfig_exports));\n config = /* @__PURE__ */ defaultConfig2(config);\n }\n return () => h(FormKitProvider, { ...context.attrs, config }, context.slots);\n },\n {\n props: [\"defaultConfig\", \"configFile\"],\n inheritAttrs: false\n }\n);\nvar FormKitLazyProvider = /* @__PURE__ */ defineComponent(\n function FormKitLazyProvider2(props, context) {\n const config = inject(optionsSymbol, null);\n const passthru = (vnode) => {\n return h(vnode, {\n ...context.attrs,\n ...vnode.props\n });\n };\n if (config) {\n return () => context.slots?.default ? context.slots.default().map(passthru) : null;\n }\n const instance = getCurrentInstance();\n if (instance.suspense) {\n return () => h(FormKitConfigLoader, props, {\n default: () => context.slots?.default ? context.slots.default().map(passthru) : null\n });\n }\n return () => h(Suspense, null, {\n ...context.slots,\n default: () => h(FormKitConfigLoader, { ...context.attrs, ...props }, context.slots)\n });\n },\n {\n props: [\"defaultConfig\", \"configFile\"],\n inheritAttrs: false\n }\n);\nfunction useFormKitContext(addressOrEffect, optionalEffect) {\n const address = typeof addressOrEffect === \"string\" ? addressOrEffect : void 0;\n const effect = typeof addressOrEffect === \"function\" ? addressOrEffect : optionalEffect;\n const context = ref();\n const parentNode = inject(parentSymbol, null);\n if (parentNode) {\n if (address) {\n context.value = parentNode.at(address)?.context;\n const root = parentNode.at(\"$root\");\n if (root) {\n const receipt = root.on(\"child.deep\", () => {\n const targetNode = parentNode.at(address);\n if (targetNode && targetNode.context !== context.value) {\n context.value = targetNode.context;\n if (effect)\n effect(context.value);\n }\n });\n onUnmounted(() => {\n root.off(receipt);\n });\n }\n } else {\n context.value = parentNode?.context;\n }\n }\n if (context.value && effect)\n effect(context.value);\n return context;\n}\nfunction useFormKitContextById(id, effect) {\n const context = ref();\n const targetNode = getNode(id);\n if (targetNode)\n context.value = targetNode.context;\n if (!targetNode) {\n const receipt = watchRegistry(id, ({ payload: node }) => {\n if (node) {\n context.value = node.context;\n stopWatch(receipt);\n if (effect)\n effect(context.value);\n }\n });\n }\n if (context.value && effect)\n effect(context.value);\n return context;\n}\nfunction useFormKitNodeById(id, effect) {\n const nodeRef = ref();\n const targetNode = getNode(id);\n if (targetNode)\n nodeRef.value = targetNode;\n if (!targetNode) {\n const receipt = watchRegistry(id, ({ payload: node }) => {\n if (node) {\n nodeRef.value = node;\n stopWatch(receipt);\n if (effect)\n effect(node);\n }\n });\n }\n if (nodeRef.value && effect)\n effect(nodeRef.value);\n return nodeRef;\n}\nvar summary = createSection(\"summary\", () => ({\n $el: \"div\",\n attrs: {\n \"aria-live\": \"polite\"\n }\n}));\nvar summaryInner = createSection(\"summaryInner\", () => ({\n $el: \"div\",\n if: \"$summaries.length && $showSummaries\"\n}));\nvar messages2 = createSection(\"messages\", () => ({\n $el: \"ul\",\n if: \"$summaries.length && $showSummaries\"\n}));\nvar message2 = createSection(\"message\", () => ({\n $el: \"li\",\n for: [\"summary\", \"$summaries\"],\n attrs: {\n key: \"$summary.key\",\n \"data-message-type\": \"$summary.type\"\n }\n}));\nvar summaryHeader = createSection(\"summaryHeader\", () => ({\n $el: \"h2\",\n attrs: {\n id: \"$id\"\n }\n}));\nvar messageLink = createSection(\"messageLink\", () => ({\n $el: \"a\",\n attrs: {\n id: \"$summary.key\",\n href: '$: \"#\" + $summary.id',\n onClick: \"$jumpLink\"\n }\n}));\nvar definition2 = summary(\n summaryInner(\n summaryHeader(\"$summaryHeader\"),\n messages2(message2(messageLink(\"$summary.message\")))\n )\n);\nvar FormKitSummary = /* @__PURE__ */ defineComponent({\n props: {\n node: {\n type: Object,\n required: false\n },\n forceShow: {\n type: Boolean,\n default: false\n },\n sectionsSchema: {\n type: Object,\n default: {}\n }\n },\n emits: {\n /* eslint-disable-next-line @typescript-eslint/no-unused-vars */\n show: (_summaries) => true\n },\n setup(props, context) {\n const id = `summary-${token()}`;\n const node = computed(() => {\n return props.node || inject(parentSymbol, void 0);\n });\n if (!node)\n throw new Error(\n \"FormKitSummary must have a FormKit parent or use the node prop.\"\n );\n const summaryContexts = ref([]);\n const showSummaries = ref(false);\n const summaries = computed(() => {\n const summarizedMessages = [];\n summaryContexts.value.forEach((context2) => {\n for (const idx in context2.messages) {\n const message3 = context2.messages[idx];\n if (typeof message3.value !== \"string\")\n continue;\n summarizedMessages.push({\n message: message3.value,\n id: context2.id,\n key: `${context2.id}-${message3.key}`,\n type: message3.type\n });\n }\n });\n return summarizedMessages;\n });\n const addContexts = () => {\n summaryContexts.value = [];\n node.value?.walk(\n (child) => child.context && summaryContexts.value.push(child.context)\n );\n };\n node.value?.on(\"submit-raw\", async () => {\n addContexts();\n if (summaries.value.length === 0)\n return;\n context.emit(\"show\", summaries.value);\n showSummaries.value = true;\n await nextTick();\n if (typeof window !== \"undefined\") {\n document.getElementById(id)?.scrollIntoView({ behavior: \"smooth\" });\n if (summaries.value[0]) {\n document.getElementById(summaries.value[0].key)?.focus();\n }\n }\n });\n node.value?.on(\"child\", addContexts);\n function jumpLink(e) {\n if (e.target instanceof HTMLAnchorElement) {\n e.preventDefault();\n const id2 = e.target.getAttribute(\"href\")?.substring(1);\n if (id2) {\n document.getElementById(id2)?.scrollIntoView({ behavior: \"smooth\" });\n document.getElementById(id2)?.focus();\n }\n }\n }\n localize(\"summaryHeader\", \"There were errors in your form.\")(node.value);\n const schema = definition2(props.sectionsSchema || {});\n const data = computed(() => {\n return {\n id,\n fns: node.value?.context?.fns || {},\n classes: node.value?.context?.classes || {},\n summaries: summaries.value,\n showSummaries: props.forceShow || showSummaries.value,\n summaryHeader: node.value?.context?.ui?.summaryHeader?.value || \"\",\n jumpLink\n };\n });\n return () => node.value?.context ? h(FormKitSchema_default, { schema, data: data.value }, { ...context.slots }) : null;\n }\n});\n\n// packages/vue/src/index.ts\ninit_defaultConfig();\ninit_bindings();\nvar FormKitIcon = /* @__PURE__ */ defineComponent({\n name: \"FormKitIcon\",\n props: {\n icon: {\n type: String,\n default: \"\"\n },\n iconLoader: {\n type: Function,\n default: null\n },\n iconLoaderUrl: {\n type: Function,\n default: null\n }\n },\n setup(props) {\n const icon = ref(void 0);\n const config = inject(optionsSymbol, {});\n const parent = inject(parentSymbol, null);\n let iconHandler = void 0;\n function loadIcon() {\n if (!iconHandler || typeof iconHandler !== \"function\")\n return;\n const iconOrPromise = iconHandler(props.icon);\n if (iconOrPromise instanceof Promise) {\n iconOrPromise.then((iconValue) => {\n icon.value = iconValue;\n });\n } else {\n icon.value = iconOrPromise;\n }\n }\n if (props.iconLoader && typeof props.iconLoader === \"function\") {\n iconHandler = createIconHandler(props.iconLoader);\n } else if (parent && parent.props?.iconLoader) {\n iconHandler = createIconHandler(parent.props.iconLoader);\n } else if (props.iconLoaderUrl && typeof props.iconLoaderUrl === \"function\") {\n iconHandler = createIconHandler(iconHandler, props.iconLoaderUrl);\n } else {\n const iconPlugin = config?.plugins?.find((plugin2) => {\n return typeof plugin2.iconHandler === \"function\";\n });\n if (iconPlugin) {\n iconHandler = iconPlugin.iconHandler;\n }\n }\n watch(\n () => props.icon,\n () => {\n loadIcon();\n },\n { immediate: true }\n );\n return () => {\n if (props.icon && icon.value) {\n return h(\"span\", {\n class: \"formkit-icon\",\n innerHTML: icon.value\n });\n }\n return null;\n };\n }\n});\nfunction resetCount() {\n resetCounts();\n resetCount$1();\n}\n\nexport { FormKit_default as FormKit, FormKitIcon, FormKitKitchenSink, FormKitLazyProvider, FormKitMessages, FormKitProvider, FormKitRoot, FormKitSchema, FormKitSummary, bindings_default as bindings, componentSymbol, configSymbol, createInput, defaultConfig, defineFormKitConfig, getCurrentSchemaNode, onSSRComplete, optionsSymbol, parentSymbol, plugin, resetCount, rootSymbol, ssrComplete, useConfig, useFormKitContext, useFormKitContextById, useFormKitNodeById, useInput };\n//# sourceMappingURL=out.js.map\n//# sourceMappingURL=index.mjs.map","/**\n * Detects support for emoji character sets.\n *\n * Based on the Modernizr emoji detection.\n * https://github.com/Modernizr/Modernizr/blob/347ddb078116cee91b25b6e897e211b023f9dcb4/feature-detects/emoji.js\n *\n * @return {Boolean} true or false\n * @example\n *\n * hasEmojiSupport()\n * // => true|false\n */\nexport const hasEmojiSupport = () => {\n const pixelRatio = window.devicePixelRatio || 1;\n const offset = 12 * pixelRatio;\n const node = document.createElement('canvas');\n\n // canvastext support\n if (\n !node.getContext ||\n !node.getContext('2d') ||\n typeof node.getContext('2d').fillText !== 'function'\n ) {\n return false;\n }\n\n const ctx = node.getContext('2d');\n\n ctx.fillStyle = '#f00';\n ctx.textBaseline = 'top';\n ctx.font = '32px Arial';\n ctx.fillText('\\ud83d\\udc28', 0, 0); // U+1F428 KOALA\n return ctx.getImageData(offset, offset, 1, 1).data[0] !== 0;\n};\n\nexport const removeEmoji = text => {\n if (text) {\n return text\n .replace(\n /([\\u2700-\\u27BF]|[\\uE000-\\uF8FF]|\\uD83C[\\uDC00-\\uDFFF]|\\uD83D[\\uDC00-\\uDFFF]|[\\u2011-\\u26FF]|\\uD83E[\\uDD10-\\uDDFF])/g,\n ''\n )\n .replace(/\\s+/g, ' ')\n .trim();\n }\n return '';\n};\n","\n\n\n\n\n","\n\n\n","const countries = [\n {\n name: 'Afghanistan',\n dial_code: '+93',\n emoji: '🇦🇫',\n id: 'AF',\n },\n {\n name: 'Aland Islands',\n dial_code: '+358',\n emoji: '🇦🇽',\n id: 'AX',\n },\n {\n name: 'Albania',\n dial_code: '+355',\n emoji: '🇦🇱',\n id: 'AL',\n },\n {\n name: 'Algeria',\n dial_code: '+213',\n emoji: '🇩🇿',\n id: 'DZ',\n },\n {\n name: 'AmericanSamoa',\n dial_code: '+1684',\n emoji: '🇦🇸',\n id: 'AS',\n },\n {\n name: 'Andorra',\n dial_code: '+376',\n emoji: '🇦🇩',\n id: 'AD',\n },\n {\n name: 'Angola',\n dial_code: '+244',\n emoji: '🇦🇴',\n id: 'AO',\n },\n {\n name: 'Anguilla',\n dial_code: '+1264',\n emoji: '🇦🇮',\n id: 'AI',\n },\n {\n name: 'Antarctica',\n dial_code: '+672',\n emoji: '🇦🇶',\n id: 'AQ',\n },\n {\n name: 'Antigua and Barbuda',\n dial_code: '+1268',\n emoji: '🇦🇬',\n id: 'AG',\n },\n {\n name: 'Argentina',\n dial_code: '+54',\n emoji: '🇦🇷',\n id: 'AR',\n },\n {\n name: 'Armenia',\n dial_code: '+374',\n emoji: '🇦🇲',\n id: 'AM',\n },\n {\n name: 'Aruba',\n dial_code: '+297',\n emoji: '🇦🇼',\n id: 'AW',\n },\n {\n name: 'Australia',\n dial_code: '+61',\n emoji: '🇦🇺',\n id: 'AU',\n },\n {\n name: 'Austria',\n dial_code: '+43',\n emoji: '🇦🇹',\n id: 'AT',\n },\n {\n name: 'Azerbaijan',\n dial_code: '+994',\n emoji: '🇦🇿',\n id: 'AZ',\n },\n {\n name: 'Bahamas',\n dial_code: '+1242',\n emoji: '🇧🇸',\n id: 'BS',\n },\n {\n name: 'Bahrain',\n dial_code: '+973',\n emoji: '🇧🇭',\n id: 'BH',\n },\n {\n name: 'Bangladesh',\n dial_code: '+880',\n emoji: '🇧🇩',\n id: 'BD',\n },\n {\n name: 'Barbados',\n dial_code: '+1246',\n emoji: '🇧🇧',\n id: 'BB',\n },\n {\n name: 'Belarus',\n dial_code: '+375',\n emoji: '🇧🇾',\n id: 'BY',\n },\n {\n name: 'Belgium',\n dial_code: '+32',\n emoji: '🇧🇪',\n id: 'BE',\n },\n {\n name: 'Belize',\n dial_code: '+501',\n emoji: '🇧🇿',\n id: 'BZ',\n },\n {\n name: 'Benin',\n dial_code: '+229',\n emoji: '🇧🇯',\n id: 'BJ',\n },\n {\n name: 'Bermuda',\n dial_code: '+1441',\n emoji: '🇧🇲',\n id: 'BM',\n },\n {\n name: 'Bhutan',\n dial_code: '+975',\n emoji: '🇧🇹',\n id: 'BT',\n },\n {\n name: 'Bolivia, Plurinational State of',\n dial_code: '+591',\n emoji: '🇧🇴',\n id: 'BO',\n },\n {\n name: 'Bosnia and Herzegovina',\n dial_code: '+387',\n emoji: '🇧🇦',\n id: 'BA',\n },\n {\n name: 'Botswana',\n dial_code: '+267',\n emoji: '🇧🇼',\n id: 'BW',\n },\n {\n name: 'Brazil',\n dial_code: '+55',\n emoji: '🇧🇷',\n id: 'BR',\n },\n {\n name: 'British Indian Ocean Territory',\n dial_code: '+246',\n emoji: '🇮🇴',\n id: 'IO',\n },\n {\n name: 'Brunei Darussalam',\n dial_code: '+673',\n emoji: '🇧🇳',\n id: 'BN',\n },\n {\n name: 'Bulgaria',\n dial_code: '+359',\n emoji: '🇧🇬',\n id: 'BG',\n },\n {\n name: 'Burkina Faso',\n dial_code: '+226',\n emoji: '🇧🇫',\n id: 'BF',\n },\n {\n name: 'Burundi',\n dial_code: '+257',\n emoji: '🇧🇮',\n id: 'BI',\n },\n {\n name: 'Cambodia',\n dial_code: '+855',\n emoji: '🇰🇭',\n id: 'KH',\n },\n {\n name: 'Cameroon',\n dial_code: '+237',\n emoji: '🇨🇲',\n id: 'CM',\n },\n {\n name: 'Canada',\n dial_code: '+1',\n emoji: '🇨🇦',\n id: 'CA',\n },\n {\n name: 'Cape Verde',\n dial_code: '+238',\n emoji: '🇨🇻',\n id: 'CV',\n },\n {\n name: 'Cayman Islands',\n dial_code: '+345',\n emoji: '🇰🇾',\n id: 'KY',\n },\n {\n name: 'Central African Republic',\n dial_code: '+236',\n emoji: '🇨🇫',\n id: 'CF',\n },\n {\n name: 'Chad',\n dial_code: '+235',\n emoji: '🇹🇩',\n id: 'TD',\n },\n {\n name: 'Chile',\n dial_code: '+56',\n emoji: '🇨🇱',\n id: 'CL',\n },\n {\n name: 'China',\n dial_code: '+86',\n emoji: '🇨🇳',\n id: 'CN',\n },\n {\n name: 'Christmas Island',\n dial_code: '+61',\n emoji: '🇨🇽',\n id: 'CX',\n },\n {\n name: 'Cocos (Keeling) Islands',\n dial_code: '+61',\n emoji: '🇨🇨',\n id: 'CC',\n },\n {\n name: 'Colombia',\n dial_code: '+57',\n emoji: '🇨🇴',\n id: 'CO',\n },\n {\n name: 'Comoros',\n dial_code: '+269',\n emoji: '🇰🇲',\n id: 'KM',\n },\n {\n name: 'Congo',\n dial_code: '+242',\n emoji: '🇨🇬',\n id: 'CG',\n },\n {\n name: 'Congo, The Democratic Republic of the Congo',\n dial_code: '+243',\n emoji: '🇨🇩',\n id: 'CD',\n },\n {\n name: 'Cook Islands',\n dial_code: '+682',\n emoji: '🇨🇰',\n id: 'CK',\n },\n {\n name: 'Costa Rica',\n dial_code: '+506',\n emoji: '🇨🇷',\n id: 'CR',\n },\n {\n name: \"Cote d'Ivoire\",\n dial_code: '+225',\n emoji: '🇨🇮',\n id: 'CI',\n },\n {\n name: 'Croatia',\n dial_code: '+385',\n emoji: '🇭🇷',\n id: 'HR',\n },\n {\n name: 'Cuba',\n dial_code: '+53',\n emoji: '🇨🇺',\n id: 'CU',\n },\n {\n name: 'Cyprus',\n dial_code: '+357',\n emoji: '🇨🇾',\n id: 'CY',\n },\n {\n name: 'Czech Republic',\n dial_code: '+420',\n emoji: '🇨🇿',\n id: 'CZ',\n },\n {\n name: 'Denmark',\n dial_code: '+45',\n emoji: '🇩🇰',\n id: 'DK',\n },\n {\n name: 'Djibouti',\n dial_code: '+253',\n emoji: '🇩🇯',\n id: 'DJ',\n },\n {\n name: 'Dominica',\n dial_code: '+1767',\n emoji: '🇩🇲',\n id: 'DM',\n },\n {\n name: 'Dominican Republic',\n dial_code: '+1849',\n emoji: '🇩🇴',\n id: 'DO',\n },\n {\n name: 'Ecuador',\n dial_code: '+593',\n emoji: '🇪🇨',\n id: 'EC',\n },\n {\n name: 'Egypt',\n dial_code: '+20',\n emoji: '🇪🇬',\n id: 'EG',\n },\n {\n name: 'El Salvador',\n dial_code: '+503',\n emoji: '🇸🇻',\n id: 'SV',\n },\n {\n name: 'Equatorial Guinea',\n dial_code: '+240',\n emoji: '🇬🇶',\n id: 'GQ',\n },\n {\n name: 'Eritrea',\n dial_code: '+291',\n emoji: '🇪🇷',\n id: 'ER',\n },\n {\n name: 'Estonia',\n dial_code: '+372',\n emoji: '🇪🇪',\n id: 'EE',\n },\n {\n name: 'Ethiopia',\n dial_code: '+251',\n emoji: '🇪🇹',\n id: 'ET',\n },\n {\n name: 'Falkland Islands (Malvinas)',\n dial_code: '+500',\n emoji: '🇫🇰',\n id: 'FK',\n },\n {\n name: 'Faroe Islands',\n dial_code: '+298',\n emoji: '🇫🇴',\n id: 'FO',\n },\n {\n name: 'Fiji',\n dial_code: '+679',\n emoji: '🇫🇯',\n id: 'FJ',\n },\n {\n name: 'Finland',\n dial_code: '+358',\n emoji: '🇫🇮',\n id: 'FI',\n },\n {\n name: 'France',\n dial_code: '+33',\n emoji: '🇫🇷',\n id: 'FR',\n },\n {\n name: 'French Guiana',\n dial_code: '+594',\n emoji: '🇬🇫',\n id: 'GF',\n },\n {\n name: 'French Polynesia',\n dial_code: '+689',\n emoji: '🇵🇫',\n id: 'PF',\n },\n {\n name: 'Gabon',\n dial_code: '+241',\n emoji: '🇬🇦',\n id: 'GA',\n },\n {\n name: 'Gambia',\n dial_code: '+220',\n emoji: '🇬🇲',\n id: 'GM',\n },\n {\n name: 'Georgia',\n dial_code: '+995',\n emoji: '🇬🇪',\n id: 'GE',\n },\n {\n name: 'Germany',\n dial_code: '+49',\n emoji: '🇩🇪',\n id: 'DE',\n },\n {\n name: 'Ghana',\n dial_code: '+233',\n emoji: '🇬🇭',\n id: 'GH',\n },\n {\n name: 'Gibraltar',\n dial_code: '+350',\n emoji: '🇬🇮',\n id: 'GI',\n },\n {\n name: 'Greece',\n dial_code: '+30',\n emoji: '🇬🇷',\n id: 'GR',\n },\n {\n name: 'Greenland',\n dial_code: '+299',\n emoji: '🇬🇱',\n id: 'GL',\n },\n {\n name: 'Grenada',\n dial_code: '+1473',\n emoji: '🇬🇩',\n id: 'GD',\n },\n {\n name: 'Guadeloupe',\n dial_code: '+590',\n emoji: '🇬🇵',\n id: 'GP',\n },\n {\n name: 'Guam',\n dial_code: '+1671',\n emoji: '🇬🇺',\n id: 'GU',\n },\n {\n name: 'Guatemala',\n dial_code: '+502',\n emoji: '🇬🇹',\n id: 'GT',\n },\n {\n name: 'Guernsey',\n dial_code: '+44',\n emoji: '🇬🇬',\n id: 'GG',\n },\n {\n name: 'Guinea',\n dial_code: '+224',\n emoji: '🇬🇳',\n id: 'GN',\n },\n {\n name: 'Guinea-Bissau',\n dial_code: '+245',\n emoji: '🇬🇼',\n id: 'GW',\n },\n {\n name: 'Guyana',\n dial_code: '+595',\n emoji: '🇬🇾',\n id: 'GY',\n },\n {\n name: 'Haiti',\n dial_code: '+509',\n emoji: '🇭🇹',\n id: 'HT',\n },\n {\n name: 'Holy See (Vatican City State)',\n dial_code: '+379',\n emoji: '🇻🇦',\n id: 'VA',\n },\n {\n name: 'Honduras',\n dial_code: '+504',\n emoji: '🇭🇳',\n id: 'HN',\n },\n {\n name: 'Hong Kong',\n dial_code: '+852',\n emoji: '🇭🇰',\n id: 'HK',\n },\n {\n name: 'Hungary',\n dial_code: '+36',\n emoji: '🇭🇺',\n id: 'HU',\n },\n {\n name: 'Iceland',\n dial_code: '+354',\n emoji: '🇮🇸',\n id: 'IS',\n },\n {\n name: 'India',\n dial_code: '+91',\n emoji: '🇮🇳',\n id: 'IN',\n },\n {\n name: 'Indonesia',\n dial_code: '+62',\n emoji: '🇮🇩',\n id: 'ID',\n },\n {\n name: 'Iran, Islamic Republic of Persian Gulf',\n dial_code: '+98',\n emoji: '🇮🇷',\n id: 'IR',\n },\n {\n name: 'Iraq',\n dial_code: '+964',\n emoji: '🇮🇷',\n id: 'IQ',\n },\n {\n name: 'Ireland',\n dial_code: '+353',\n emoji: '🇮🇪',\n id: 'IE',\n },\n {\n name: 'Isle of Man',\n dial_code: '+44',\n emoji: '🇮🇲',\n id: 'IM',\n },\n {\n name: 'Israel',\n dial_code: '+972',\n emoji: '🇮🇱',\n id: 'IL',\n },\n {\n name: 'Italy',\n dial_code: '+39',\n emoji: '🇮🇹',\n id: 'IT',\n },\n {\n name: 'Jamaica',\n dial_code: '+1876',\n emoji: '🇯🇲',\n id: 'JM',\n },\n {\n name: 'Japan',\n dial_code: '+81',\n emoji: '🇯🇵',\n id: 'JP',\n },\n {\n name: 'Jersey',\n dial_code: '+44',\n emoji: '🇯🇪',\n id: 'JE',\n },\n {\n name: 'Jordan',\n dial_code: '+962',\n emoji: '🇯🇴',\n id: 'JO',\n },\n {\n name: 'Kazakhstan',\n dial_code: '+77',\n emoji: '🇰🇿',\n id: 'KZ',\n },\n {\n name: 'Kenya',\n dial_code: '+254',\n emoji: '🇰🇪',\n id: 'KE',\n },\n {\n name: 'Kiribati',\n dial_code: '+686',\n emoji: '🇰🇮',\n id: 'KI',\n },\n {\n name: \"Korea, Democratic People's Republic of Korea\",\n dial_code: '+850',\n emoji: '🇰🇵',\n id: 'KP',\n },\n {\n name: 'Korea, Republic of South Korea',\n dial_code: '+82',\n emoji: '🇰🇷',\n id: 'KR',\n },\n {\n name: 'Kuwait',\n dial_code: '+965',\n emoji: '🇰🇼',\n id: 'KW',\n },\n {\n name: 'Kyrgyzstan',\n dial_code: '+996',\n emoji: '🇰🇬',\n id: 'KG',\n },\n {\n name: 'Laos',\n dial_code: '+856',\n emoji: '🇱🇦',\n id: 'LA',\n },\n {\n name: 'Latvia',\n dial_code: '+371',\n emoji: '🇱🇻',\n id: 'LV',\n },\n {\n name: 'Lebanon',\n dial_code: '+961',\n emoji: '🇱🇧',\n id: 'LB',\n },\n {\n name: 'Lesotho',\n dial_code: '+266',\n emoji: '🇱🇸',\n id: 'LS',\n },\n {\n name: 'Liberia',\n dial_code: '+231',\n emoji: '🇱🇷',\n id: 'LR',\n },\n {\n name: 'Libyan Arab Jamahiriya',\n dial_code: '+218',\n emoji: '🇱🇾',\n id: 'LY',\n },\n {\n name: 'Liechtenstein',\n dial_code: '+423',\n emoji: '🇱🇮',\n id: 'LI',\n },\n {\n name: 'Lithuania',\n dial_code: '+370',\n emoji: '🇱🇹',\n id: 'LT',\n },\n {\n name: 'Luxembourg',\n dial_code: '+352',\n emoji: '🇱🇺',\n id: 'LU',\n },\n {\n name: 'Macao',\n dial_code: '+853',\n emoji: '🇲🇴',\n id: 'MO',\n },\n {\n name: 'Macedonia',\n dial_code: '+389',\n emoji: '🇲🇰',\n id: 'MK',\n },\n {\n name: 'Madagascar',\n dial_code: '+261',\n emoji: '🇲🇬',\n id: 'MG',\n },\n {\n name: 'Malawi',\n dial_code: '+265',\n emoji: '🇲🇼',\n id: 'MW',\n },\n {\n name: 'Malaysia',\n dial_code: '+60',\n emoji: '🇲🇾',\n id: 'MY',\n },\n {\n name: 'Maldives',\n dial_code: '+960',\n emoji: '🇲🇻',\n id: 'MV',\n },\n {\n name: 'Mali',\n dial_code: '+223',\n emoji: '🇲🇱',\n id: 'ML',\n },\n {\n name: 'Malta',\n dial_code: '+356',\n emoji: '🇲🇹',\n id: 'MT',\n },\n {\n name: 'Marshall Islands',\n dial_code: '+692',\n emoji: '🇲🇭',\n id: 'MH',\n },\n {\n name: 'Martinique',\n dial_code: '+596',\n emoji: '🇲🇶',\n id: 'MQ',\n },\n {\n name: 'Mauritania',\n dial_code: '+222',\n emoji: '🇲🇷',\n id: 'MR',\n },\n {\n name: 'Mauritius',\n dial_code: '+230',\n emoji: '🇲🇺',\n id: 'MU',\n },\n {\n name: 'Mayotte',\n dial_code: '+262',\n emoji: '🇾🇹',\n id: 'YT',\n },\n {\n name: 'Mexico',\n dial_code: '+52',\n emoji: '🇲🇽',\n id: 'MX',\n },\n {\n name: 'Micronesia, Federated States of Micronesia',\n dial_code: '+691',\n emoji: '🇫🇲',\n id: 'FM',\n },\n {\n name: 'Moldova',\n dial_code: '+373',\n emoji: '🇲🇩',\n id: 'MD',\n },\n {\n name: 'Monaco',\n dial_code: '+377',\n emoji: '🇲🇨',\n id: 'MC',\n },\n {\n name: 'Mongolia',\n dial_code: '+976',\n emoji: '🇲🇳',\n id: 'MN',\n },\n {\n name: 'Montenegro',\n dial_code: '+382',\n emoji: '🇲🇪',\n id: 'ME',\n },\n {\n name: 'Montserrat',\n dial_code: '+1664',\n emoji: '🇲🇸',\n id: 'MS',\n },\n {\n name: 'Morocco',\n dial_code: '+212',\n emoji: '🇲🇦',\n id: 'MA',\n },\n {\n name: 'Mozambique',\n dial_code: '+258',\n emoji: '🇲🇿',\n id: 'MZ',\n },\n {\n name: 'Myanmar',\n dial_code: '+95',\n emoji: '🇲🇲',\n id: 'MM',\n },\n {\n name: 'Namibia',\n emoji: '🇳🇦',\n dial_code: '+264',\n id: 'NA',\n },\n {\n name: 'Nauru',\n dial_code: '+674',\n emoji: '🇳🇷',\n id: 'NR',\n },\n {\n name: 'Nepal',\n dial_code: '+977',\n emoji: '🇳🇵',\n id: 'NP',\n },\n {\n name: 'Netherlands',\n dial_code: '+31',\n emoji: '🇳🇱',\n id: 'NL',\n },\n {\n name: 'Netherlands Antilles',\n dial_code: '+599',\n emoji: '🇧🇶',\n id: 'AN',\n },\n {\n name: 'New Caledonia',\n dial_code: '+687',\n emoji: '🇳🇨',\n id: 'NC',\n },\n {\n name: 'New Zealand',\n dial_code: '+64',\n emoji: '🇳🇿',\n id: 'NZ',\n },\n {\n name: 'Nicaragua',\n dial_code: '+505',\n emoji: '🇳🇮',\n id: 'NI',\n },\n {\n name: 'Niger',\n dial_code: '+227',\n emoji: '🇳🇪',\n id: 'NE',\n },\n {\n name: 'Nigeria',\n dial_code: '+234',\n emoji: '🇳🇬',\n id: 'NG',\n },\n {\n name: 'Niue',\n dial_code: '+683',\n emoji: '🇳🇺',\n id: 'NU',\n },\n {\n name: 'Norfolk Island',\n dial_code: '+672',\n emoji: '🇳🇫',\n id: 'NF',\n },\n {\n name: 'Northern Mariana Islands',\n dial_code: '+1670',\n emoji: '🇲🇵',\n id: 'MP',\n },\n {\n name: 'Norway',\n dial_code: '+47',\n emoji: '🇳🇴',\n id: 'NO',\n },\n {\n name: 'Oman',\n dial_code: '+968',\n emoji: '🇴🇲',\n id: 'OM',\n },\n {\n name: 'Pakistan',\n dial_code: '+92',\n emoji: '🇵🇰',\n id: 'PK',\n },\n {\n name: 'Palau',\n dial_code: '+680',\n emoji: '🇵🇼',\n id: 'PW',\n },\n {\n name: 'Palestinian Territory, Occupied',\n dial_code: '+970',\n emoji: '🇵🇸',\n id: 'PS',\n },\n {\n name: 'Panama',\n dial_code: '+507',\n emoji: '🇵🇦',\n id: 'PA',\n },\n {\n name: 'Papua New Guinea',\n dial_code: '+675',\n emoji: '🇵🇬',\n id: 'PG',\n },\n {\n name: 'Paraguay',\n dial_code: '+595',\n emoji: '🇵🇾',\n id: 'PY',\n },\n {\n name: 'Peru',\n dial_code: '+51',\n emoji: '🇵🇪',\n id: 'PE',\n },\n {\n name: 'Philippines',\n dial_code: '+63',\n emoji: '🇵🇭',\n id: 'PH',\n },\n {\n name: 'Pitcairn',\n dial_code: '+872',\n emoji: '🇵🇳',\n id: 'PN',\n },\n {\n name: 'Poland',\n dial_code: '+48',\n emoji: '🇵🇱',\n id: 'PL',\n },\n {\n name: 'Portugal',\n dial_code: '+351',\n emoji: '🇵🇹',\n id: 'PT',\n },\n {\n name: 'Puerto Rico',\n dial_code: '+1939',\n emoji: '🇵🇷',\n id: 'PR',\n },\n {\n name: 'Qatar',\n dial_code: '+974',\n emoji: '🇶🇦',\n id: 'QA',\n },\n {\n name: 'Romania',\n dial_code: '+40',\n emoji: '🇷🇴',\n id: 'RO',\n },\n {\n name: 'Russia',\n dial_code: '+7',\n emoji: '🇷🇺',\n id: 'RU',\n },\n {\n name: 'Rwanda',\n dial_code: '+250',\n emoji: '🇷🇼',\n id: 'RW',\n },\n {\n name: 'Reunion',\n dial_code: '+262',\n emoji: '🇷🇪',\n id: 'RE',\n },\n {\n name: 'Saint Barthelemy',\n dial_code: '+590',\n emoji: '🇧🇱',\n id: 'BL',\n },\n {\n name: 'Saint Helena, Ascension and Tristan Da Cunha',\n dial_code: '+290',\n emoji: '🇸🇭',\n id: 'SH',\n },\n {\n name: 'Saint Kitts and Nevis',\n dial_code: '+1869',\n emoji: '🇰🇳',\n id: 'KN',\n },\n {\n name: 'Saint Lucia',\n dial_code: '+1758',\n emoji: '🇱🇨',\n id: 'LC',\n },\n {\n name: 'Saint Martin',\n dial_code: '+590',\n emoji: '🇲🇫',\n id: 'MF',\n },\n {\n name: 'Saint Pierre and Miquelon',\n dial_code: '+508',\n emoji: '🇵🇲',\n id: 'PM',\n },\n {\n name: 'Saint Vincent and the Grenadines',\n dial_code: '+1784',\n emoji: '🇻🇨',\n id: 'VC',\n },\n {\n name: 'Samoa',\n dial_code: '+685',\n emoji: '🇼🇸',\n id: 'WS',\n },\n {\n name: 'San Marino',\n dial_code: '+378',\n emoji: '🇸🇲',\n id: 'SM',\n },\n {\n name: 'Sao Tome and Principe',\n dial_code: '+239',\n emoji: '🇸🇹',\n id: 'ST',\n },\n {\n name: 'Saudi Arabia',\n dial_code: '+966',\n emoji: '🇸🇦',\n id: 'SA',\n },\n {\n name: 'Senegal',\n dial_code: '+221',\n emoji: '🇸🇳',\n id: 'SN',\n },\n {\n name: 'Serbia',\n dial_code: '+381',\n emoji: '🇷🇸',\n id: 'RS',\n },\n {\n name: 'Seychelles',\n dial_code: '+248',\n emoji: '🇸🇨',\n id: 'SC',\n },\n {\n name: 'Sierra Leone',\n dial_code: '+232',\n emoji: '🇸🇱',\n id: 'SL',\n },\n {\n name: 'Singapore',\n dial_code: '+65',\n emoji: '🇸🇬',\n id: 'SG',\n },\n {\n name: 'Slovakia',\n dial_code: '+421',\n emoji: '🇸🇰',\n id: 'SK',\n },\n {\n name: 'Slovenia',\n dial_code: '+386',\n emoji: '🇸🇮',\n id: 'SI',\n },\n {\n name: 'Solomon Islands',\n dial_code: '+677',\n emoji: '🇸🇧',\n id: 'SB',\n },\n {\n name: 'Somalia',\n dial_code: '+252',\n emoji: '🇸🇴',\n id: 'SO',\n },\n {\n name: 'South Africa',\n dial_code: '+27',\n emoji: '🇿🇦',\n id: 'ZA',\n },\n {\n name: 'South Sudan',\n dial_code: '+211',\n emoji: '🇸🇸',\n id: 'SS',\n },\n {\n name: 'South Georgia and the South Sandwich Islands',\n dial_code: '+500',\n emoji: '🇬🇸',\n id: 'GS',\n },\n {\n name: 'Spain',\n dial_code: '+34',\n emoji: '🇪🇸',\n id: 'ES',\n },\n {\n name: 'Sri Lanka',\n dial_code: '+94',\n emoji: '🇱🇰',\n id: 'LK',\n },\n {\n name: 'Sudan',\n dial_code: '+249',\n emoji: '🇸🇩',\n id: 'SD',\n },\n {\n name: 'Suriname',\n dial_code: '+597',\n emoji: '🇸🇷',\n id: 'SR',\n },\n {\n name: 'Svalbard and Jan Mayen',\n dial_code: '+47',\n emoji: '🇸🇯',\n id: 'SJ',\n },\n {\n name: 'Swaziland',\n dial_code: '+268',\n emoji: '🇸🇿',\n id: 'SZ',\n },\n {\n name: 'Sweden',\n dial_code: '+46',\n emoji: '🇸🇪',\n id: 'SE',\n },\n {\n name: 'Switzerland',\n dial_code: '+41',\n emoji: '🇨🇭',\n id: 'CH',\n },\n {\n name: 'Syrian Arab Republic',\n dial_code: '+963',\n emoji: '🇸🇾',\n id: 'SY',\n },\n {\n name: 'Taiwan',\n dial_code: '+886',\n emoji: '🇹🇼',\n id: 'TW',\n },\n {\n name: 'Tajikistan',\n dial_code: '+992',\n emoji: '🇹🇯',\n id: 'TJ',\n },\n {\n name: 'Tanzania, United Republic of Tanzania',\n dial_code: '+255',\n emoji: '🇹🇿',\n id: 'TZ',\n },\n {\n name: 'Thailand',\n dial_code: '+66',\n emoji: '🇹🇭',\n id: 'TH',\n },\n {\n name: 'Timor-Leste',\n dial_code: '+670',\n emoji: '🇹🇱',\n id: 'TL',\n },\n {\n name: 'Togo',\n dial_code: '+228',\n emoji: '🇹🇬',\n id: 'TG',\n },\n {\n name: 'Tokelau',\n dial_code: '+690',\n emoji: '🇹🇰',\n id: 'TK',\n },\n {\n name: 'Tonga',\n dial_code: '+676',\n emoji: '🇹🇴',\n id: 'TO',\n },\n {\n name: 'Trinidad and Tobago',\n dial_code: '+1868',\n emoji: '🇹🇹',\n id: 'TT',\n },\n {\n name: 'Tunisia',\n dial_code: '+216',\n emoji: '🇹🇳',\n id: 'TN',\n },\n {\n name: 'Turkey',\n dial_code: '+90',\n emoji: '🇹🇷',\n id: 'TR',\n },\n {\n name: 'Turkmenistan',\n dial_code: '+993',\n emoji: '🇹🇲',\n id: 'TM',\n },\n {\n name: 'Turks and Caicos Islands',\n dial_code: '+1649',\n emoji: '🇹🇨',\n id: 'TC',\n },\n {\n name: 'Tuvalu',\n dial_code: '+688',\n emoji: '🇹🇻',\n id: 'TV',\n },\n {\n name: 'Uganda',\n dial_code: '+256',\n emoji: '🇺🇬',\n id: 'UG',\n },\n {\n name: 'Ukraine',\n dial_code: '+380',\n emoji: '🇺🇦',\n id: 'UA',\n },\n {\n name: 'United Arab Emirates',\n dial_code: '+971',\n emoji: '🇦🇪',\n id: 'AE',\n },\n {\n name: 'United Kingdom',\n dial_code: '+44',\n emoji: '🇬🇧',\n id: 'GB',\n },\n {\n name: 'United States',\n dial_code: '+1',\n emoji: '🇺🇸',\n id: 'US',\n },\n {\n name: 'Uruguay',\n dial_code: '+598',\n emoji: '🇺🇾',\n id: 'UY',\n },\n {\n name: 'Uzbekistan',\n dial_code: '+998',\n emoji: '🇺🇿',\n id: 'UZ',\n },\n {\n name: 'Vanuatu',\n dial_code: '+678',\n emoji: '🇻🇺',\n id: 'VU',\n },\n {\n name: 'Venezuela, Bolivarian Republic of Venezuela',\n dial_code: '+58',\n emoji: '🇻🇪',\n id: 'VE',\n },\n {\n name: 'Vietnam',\n dial_code: '+84',\n emoji: '🇻🇳',\n id: 'VN',\n },\n {\n name: 'Virgin Islands, British',\n dial_code: '+1284',\n emoji: '🇻🇬',\n id: 'VG',\n },\n {\n name: 'Virgin Islands, U.S.',\n dial_code: '+1340',\n emoji: '🇻🇮',\n id: 'VI',\n },\n {\n name: 'Wallis and Futuna',\n dial_code: '+681',\n emoji: '🇼🇫',\n id: 'WF',\n },\n {\n name: 'Yemen',\n dial_code: '+967',\n emoji: '🇾🇪',\n id: 'YE',\n },\n {\n name: 'Zambia',\n dial_code: '+260',\n emoji: '🇿🇲',\n id: 'ZM',\n },\n {\n name: 'Zimbabwe',\n dial_code: '+263',\n emoji: '🇿🇼',\n id: 'ZW',\n },\n];\n\nexport default countries;\n","const i = {\n \"Africa/Abidjan\": \"+225\",\n \"Africa/Accra\": \"+233\",\n \"Africa/Addis_Ababa\": \"+251\",\n \"Africa/Algiers\": \"+213\",\n \"Africa/Asmara\": \"+291\",\n \"Africa/Bamako\": \"+223\",\n \"Africa/Bangui\": \"+236\",\n \"Africa/Banjul\": \"+220\",\n \"Africa/Bissau\": \"+245\",\n \"Africa/Blantyre\": \"+265\",\n \"Africa/Brazzaville\": \"+242\",\n \"Africa/Bujumbura\": \"+257\",\n \"Africa/Cairo\": \"+20\",\n \"Africa/Casablanca\": \"+212\",\n \"Africa/Ceuta\": \"+34\",\n \"Africa/Conakry\": \"+224\",\n \"Africa/Dakar\": \"+221\",\n \"Africa/Dar_es_Salaam\": \"+255\",\n \"Africa/Djibouti\": \"+253\",\n \"Africa/Douala\": \"+237\",\n \"Africa/El_Aaiun\": \"+212\",\n \"Africa/Freetown\": \"+232\",\n \"Africa/Gaborone\": \"+267\",\n \"Africa/Harare\": \"+263\",\n \"Africa/Johannesburg\": \"+27\",\n \"Africa/Juba\": \"+211\",\n \"Africa/Kampala\": \"+256\",\n \"Africa/Khartoum\": \"+249\",\n \"Africa/Kigali\": \"+250\",\n \"Africa/Kinshasa\": \"+243\",\n \"Africa/Lagos\": \"+234\",\n \"Africa/Libreville\": \"+241\",\n \"Africa/Lome\": \"+228\",\n \"Africa/Luanda\": \"+244\",\n \"Africa/Lubumbashi\": \"+243\",\n \"Africa/Lusaka\": \"+260\",\n \"Africa/Malabo\": \"+240\",\n \"Africa/Maputo\": \"+258\",\n \"Africa/Maseru\": \"+266\",\n \"Africa/Mbabane\": \"+268\",\n \"Africa/Mogadishu\": \"+252\",\n \"Africa/Monrovia\": \"+231\",\n \"Africa/Nairobi\": \"+254\",\n \"Africa/Ndjamena\": \"+235\",\n \"Africa/Niamey\": \"+227\",\n \"Africa/Nouakchott\": \"+222\",\n \"Africa/Ouagadougou\": \"+226\",\n \"Africa/Porto-Novo\": \"+229\",\n \"Africa/Sao_Tome\": \"+239\",\n \"Africa/Tripoli\": \"+218\",\n \"Africa/Tunis\": \"+216\",\n \"Africa/Windhoek\": \"+264\",\n \"America/Adak\": \"+1\",\n \"America/Anchorage\": \"+1\",\n \"America/Anguilla\": \"+1\",\n \"America/Antigua\": \"+1\",\n \"America/Araguaina\": \"+55\",\n \"America/Argentina/Buenos_Aires\": \"+54\",\n \"America/Buenos_Aires\": \"+54\",\n \"America/Argentina/Catamarca\": \"+54\",\n \"America/Argentina/Cordoba\": \"+54\",\n \"America/Argentina/Jujuy\": \"+54\",\n \"America/Argentina/La_Rioja\": \"+54\",\n \"America/Argentina/Mendoza\": \"+54\",\n \"America/Argentina/Rio_Gallegos\": \"+54\",\n \"America/Argentina/Salta\": \"+54\",\n \"America/Argentina/San_Juan\": \"+54\",\n \"America/Argentina/San_Luis\": \"+54\",\n \"America/Argentina/Tucuman\": \"+54\",\n \"America/Argentina/Ushuaia\": \"+54\",\n \"America/Aruba\": \"+297\",\n \"America/Asuncion\": \"+595\",\n \"America/Atikokan\": \"+1\",\n \"America/Bahia\": \"+55\",\n \"America/Bahia_Banderas\": \"+52\",\n \"America/Barbados\": \"+1\",\n \"America/Belem\": \"+55\",\n \"America/Belize\": \"+501\",\n \"America/Blanc-Sablon\": \"+1\",\n \"America/Boa_Vista\": \"+55\",\n \"America/Bogota\": \"+57\",\n \"America/Boise\": \"+1\",\n \"America/Cambridge_Bay\": \"+1\",\n \"America/Campo_Grande\": \"+55\",\n \"America/Cancun\": \"+52\",\n \"America/Caracas\": \"+58\",\n \"America/Cayenne\": \"+594\",\n \"America/Cayman\": \"+1\",\n \"America/Chicago\": \"+1\",\n \"America/Chihuahua\": \"+52\",\n \"America/Costa_Rica\": \"+506\",\n \"America/Creston\": \"+1\",\n \"America/Cuiaba\": \"+55\",\n \"America/Curacao\": \"+599\",\n \"America/Danmarkshavn\": \"+299\",\n \"America/Dawson\": \"+1\",\n \"America/Dawson_Creek\": \"+1\",\n \"America/Denver\": \"+1\",\n \"America/Detroit\": \"+1\",\n \"America/Dominica\": \"+1\",\n \"America/Edmonton\": \"+1\",\n \"America/Eirunepe\": \"+55\",\n \"America/El_Salvador\": \"+503\",\n \"America/Fort_Nelson\": \"+1\",\n \"America/Fortaleza\": \"+55\",\n \"America/Glace_Bay\": \"+1\",\n \"America/Goose_Bay\": \"+1\",\n \"America/Grand_Turk\": \"+1\",\n \"America/Grenada\": \"+1\",\n \"America/Guadeloupe\": \"+590\",\n \"America/Guatemala\": \"+502\",\n \"America/Guayaquil\": \"+593\",\n \"America/Guyana\": \"+592\",\n \"America/Halifax\": \"+1\",\n \"America/Havana\": \"+53\",\n \"America/Hermosillo\": \"+52\",\n \"America/Indiana/Indianapolis\": \"+1\",\n \"America/Indiana/Knox\": \"+1\",\n \"America/Indiana/Marengo\": \"+1\",\n \"America/Indiana/Petersburg\": \"+1\",\n \"America/Indiana/Tell_City\": \"+1\",\n \"America/Indiana/Vevay\": \"+1\",\n \"America/Indiana/Vincennes\": \"+1\",\n \"America/Indiana/Winamac\": \"+1\",\n \"America/Inuvik\": \"+1\",\n \"America/Iqaluit\": \"+1\",\n \"America/Jamaica\": \"+1\",\n \"America/Juneau\": \"+1\",\n \"America/Kentucky/Louisville\": \"+1\",\n \"America/Kentucky/Monticello\": \"+1\",\n \"America/Kralendijk\": \"+599\",\n \"America/La_Paz\": \"+591\",\n \"America/Lima\": \"+51\",\n \"America/Los_Angeles\": \"+1\",\n \"America/Louisville\": \"+1\",\n \"America/Lower_Princes\": \"+1\",\n \"America/Maceio\": \"+55\",\n \"America/Managua\": \"+505\",\n \"America/Manaus\": \"+55\",\n \"America/Marigot\": \"+590\",\n \"America/Martinique\": \"+596\",\n \"America/Matamoros\": \"+52\",\n \"America/Mazatlan\": \"+52\",\n \"America/Mendoza\": \"+1\",\n \"America/Menominee\": \"+1\",\n \"America/Merida\": \"+52\",\n \"America/Metlakatla\": \"+1\",\n \"America/Mexico_City\": \"+52\",\n \"America/Miquelon\": \"+508\",\n \"America/Moncton\": \"+1\",\n \"America/Monterrey\": \"+52\",\n \"America/Montevideo\": \"+598\",\n \"America/Montserrat\": \"+1\",\n \"America/Nassau\": \"+1\",\n \"America/New_York\": \"+1\",\n \"America/Nipigon\": \"+1\",\n \"America/Nome\": \"+1\",\n \"America/Noronha\": \"+55\",\n \"America/North_Dakota/Beulah\": \"+1\",\n \"America/North_Dakota/Center\": \"+1\",\n \"America/North_Dakota/New_Salem\": \"+1\",\n \"America/Nuuk\": \"+299\",\n \"America/Ojinaga\": \"+52\",\n \"America/Panama\": \"+507\",\n \"America/Pangnirtung\": \"+1\",\n \"America/Paramaribo\": \"+597\",\n \"America/Phoenix\": \"+1\",\n \"America/Port-au-Prince\": \"+509\",\n \"America/Port_of_Spain\": \"+1\",\n \"America/Porto_Velho\": \"+55\",\n \"America/Puerto_Rico\": \"+1\",\n \"America/Punta_Arenas\": \"+56\",\n \"America/Rainy_River\": \"+1\",\n \"America/Rankin_Inlet\": \"+1\",\n \"America/Recife\": \"+55\",\n \"America/Regina\": \"+1\",\n \"America/Resolute\": \"+1\",\n \"America/Rio_Branco\": \"+55\",\n \"America/Santarem\": \"+55\",\n \"America/Santiago\": \"+56\",\n \"America/Santo_Domingo\": \"+1\",\n \"America/Sao_Paulo\": \"+55\",\n \"America/Scoresbysund\": \"+299\",\n \"America/Sitka\": \"+1\",\n \"America/St_Barthelemy\": \"+590\",\n \"America/St_Johns\": \"+1\",\n \"America/St_Kitts\": \"+1\",\n \"America/St_Lucia\": \"+1\",\n \"America/St_Thomas\": \"+1\",\n \"America/St_Vincent\": \"+1\",\n \"America/Swift_Current\": \"+1\",\n \"America/Tegucigalpa\": \"+504\",\n \"America/Thule\": \"+299\",\n \"America/Thunder_Bay\": \"+1\",\n \"America/Tijuana\": \"+52\",\n \"America/Toronto\": \"+1\",\n \"America/Tortola\": \"+1\",\n \"America/Vancouver\": \"+1\",\n \"America/Whitehorse\": \"+1\",\n \"America/Winnipeg\": \"+1\",\n \"America/Yakutat\": \"+1\",\n \"America/Yellowknife\": \"+1\",\n \"Antarctica/Casey\": \"+672\",\n \"Antarctica/Davis\": \"+672\",\n \"Antarctica/DumontDUrville\": \"+672\",\n \"Antarctica/Macquarie\": \"+61\",\n \"Antarctica/Mawson\": \"+672\",\n \"Antarctica/McMurdo\": \"+64\",\n \"Antarctica/Palmer\": \"+56\",\n \"Antarctica/Rothera\": \"+672\",\n \"Antarctica/Syowa\": \"+672\",\n \"Antarctica/Troll\": \"+47\",\n \"Antarctica/Vostok\": \"+672\",\n \"Arctic/Longyearbyen\": \"+47\",\n \"Asia/Aden\": \"+967\",\n \"Asia/Almaty\": \"+7\",\n \"Asia/Amman\": \"+962\",\n \"Asia/Anadyr\": \"+7\",\n \"Asia/Aqtau\": \"+7\",\n \"Asia/Aqtobe\": \"+7\",\n \"Asia/Ashgabat\": \"+993\",\n \"Asia/Atyrau\": \"+7\",\n \"Asia/Baghdad\": \"+964\",\n \"Asia/Bahrain\": \"+973\",\n \"Asia/Baku\": \"+994\",\n \"Asia/Bangkok\": \"+66\",\n \"Asia/Barnaul\": \"+7\",\n \"Asia/Beirut\": \"+961\",\n \"Asia/Bishkek\": \"+996\",\n \"Asia/Brunei\": \"+673\",\n \"Asia/Calcutta\": \"+91\",\n \"Asia/Chita\": \"+7\",\n \"Asia/Choibalsan\": \"+976\",\n \"Asia/Colombo\": \"+94\",\n \"Asia/Damascus\": \"+963\",\n \"Asia/Dhaka\": \"+880\",\n \"Asia/Dili\": \"+670\",\n \"Asia/Dubai\": \"+971\",\n \"Asia/Dushanbe\": \"+992\",\n \"Asia/Famagusta\": \"+357\",\n \"Asia/Gaza\": \"+970\",\n \"Asia/Hebron\": \"+970\",\n \"Asia/Ho_Chi_Minh\": \"+84\",\n \"Asia/Hong_Kong\": \"+852\",\n \"Asia/Hovd\": \"+976\",\n \"Asia/Irkutsk\": \"+7\",\n \"Asia/Jakarta\": \"+62\",\n \"Asia/Jayapura\": \"+62\",\n \"Asia/Jerusalem\": \"+972\",\n \"Asia/Kabul\": \"+93\",\n \"Asia/Kamchatka\": \"+7\",\n \"Asia/Karachi\": \"+92\",\n \"Asia/Kathmandu\": \"+977\",\n \"Asia/Khandyga\": \"+7\",\n \"Asia/Kolkata\": \"+91\",\n \"Asia/Krasnoyarsk\": \"+7\",\n \"Asia/Kuala_Lumpur\": \"+60\",\n \"Asia/Kuching\": \"+60\",\n \"Asia/Kuwait\": \"+965\",\n \"Asia/Macau\": \"+853\",\n \"Asia/Magadan\": \"+7\",\n \"Asia/Makassar\": \"+62\",\n \"Asia/Manila\": \"+63\",\n \"Asia/Muscat\": \"+968\",\n \"Asia/Nicosia\": \"+357\",\n \"Asia/Novokuznetsk\": \"+7\",\n \"Asia/Novosibirsk\": \"+7\",\n \"Asia/Omsk\": \"+7\",\n \"Asia/Oral\": \"+7\",\n \"Asia/Phnom_Penh\": \"+855\",\n \"Asia/Pontianak\": \"+62\",\n \"Asia/Pyongyang\": \"+850\",\n \"Asia/Qatar\": \"+974\",\n \"Asia/Qostanay\": \"+7\",\n \"Asia/Qyzylorda\": \"+7\",\n \"Asia/Rangoon\": \"+95\",\n \"Asia/Riyadh\": \"+966\",\n \"Asia/Saigon\": \"+84\",\n \"Asia/Sakhalin\": \"+7\",\n \"Asia/Samarkand\": \"+998\",\n \"Asia/Seoul\": \"+82\",\n \"Asia/Shanghai\": \"+86\",\n \"Asia/Singapore\": \"+65\",\n \"Asia/Srednekolymsk\": \"+7\",\n \"Asia/Taipei\": \"+886\",\n \"Asia/Tashkent\": \"+998\",\n \"Asia/Tbilisi\": \"+995\",\n \"Asia/Tehran\": \"+98\",\n \"Asia/Thimphu\": \"+975\",\n \"Asia/Tokyo\": \"+81\",\n \"Asia/Tomsk\": \"+7\",\n \"Asia/Ulaanbaatar\": \"+976\",\n \"Asia/Urumqi\": \"+86\",\n \"Asia/Ust-Nera\": \"+7\",\n \"Asia/Vientiane\": \"+856\",\n \"Asia/Vladivostok\": \"+7\",\n \"Asia/Yakutsk\": \"+7\",\n \"Asia/Yekaterinburg\": \"+7\",\n \"Asia/Yerevan\": \"+374\",\n \"Atlantic/Azores\": \"+351\",\n \"Atlantic/Bermuda\": \"+1\",\n \"Atlantic/Canary\": \"+34\",\n \"Atlantic/Cape_Verde\": \"+238\",\n \"Atlantic/Faroe\": \"+298\",\n \"Atlantic/Madeira\": \"+351\",\n \"Atlantic/Reykjavik\": \"+354\",\n \"Atlantic/South_Georgia\": \"+500\",\n \"Atlantic/St_Helena\": \"+290\",\n \"Atlantic/Stanley\": \"+500\",\n \"Australia/Adelaide\": \"+61\",\n \"Australia/Brisbane\": \"+61\",\n \"Australia/Broken_Hill\": \"+61\",\n \"Australia/Darwin\": \"+61\",\n \"Australia/Eucla\": \"+61\",\n \"Australia/Hobart\": \"+61\",\n \"Australia/Lindeman\": \"+61\",\n \"Australia/Lord_Howe\": \"+61\",\n \"Australia/Melbourne\": \"+61\",\n \"Australia/Perth\": \"+61\",\n \"Australia/Sydney\": \"+61\",\n \"Europe/Amsterdam\": \"+31\",\n \"Europe/Andorra\": \"+376\",\n \"Europe/Astrakhan\": \"+7\",\n \"Europe/Athens\": \"+30\",\n \"Europe/Belgrade\": \"+381\",\n \"Europe/Berlin\": \"+49\",\n \"Europe/Bratislava\": \"+421\",\n \"Europe/Brussels\": \"+32\",\n \"Europe/Bucharest\": \"+40\",\n \"Europe/Budapest\": \"+36\",\n \"Europe/Busingen\": \"+41\",\n \"Europe/Chisinau\": \"+373\",\n \"Europe/Copenhagen\": \"+45\",\n \"Europe/Dublin\": \"+353\",\n \"Europe/Gibraltar\": \"+350\",\n \"Europe/Guernsey\": \"+44\",\n \"Europe/Helsinki\": \"+358\",\n \"Europe/Isle_of_Man\": \"+44\",\n \"Europe/Istanbul\": \"+90\",\n \"Europe/Jersey\": \"+44\",\n \"Europe/Kaliningrad\": \"+7\",\n \"Europe/Kyiv\": \"+380\",\n \"Europe/Kiev\": \"+380\",\n \"Europe/Kirov\": \"+7\",\n \"Europe/Lisbon\": \"+351\",\n \"Europe/Ljubljana\": \"+386\",\n \"Europe/London\": \"+44\",\n \"Europe/Luxembourg\": \"+352\",\n \"Europe/Madrid\": \"+34\",\n \"Europe/Malta\": \"+356\",\n \"Europe/Mariehamn\": \"+358\",\n \"Europe/Minsk\": \"+375\",\n \"Europe/Monaco\": \"+377\",\n \"Europe/Moscow\": \"+7\",\n \"Europe/Oslo\": \"+47\",\n \"Europe/Paris\": \"+33\",\n \"Europe/Podgorica\": \"+382\",\n \"Europe/Prague\": \"+420\",\n \"Europe/Riga\": \"+371\",\n \"Europe/Rome\": \"+39\",\n \"Europe/Samara\": \"+7\",\n \"Europe/San_Marino\": \"+378\",\n \"Europe/Sarajevo\": \"+387\",\n \"Europe/Saratov\": \"+7\",\n \"Europe/Simferopol\": \"+7\",\n \"Europe/Skopje\": \"+389\",\n \"Europe/Sofia\": \"+359\",\n \"Europe/Stockholm\": \"+46\",\n \"Europe/Tallinn\": \"+372\",\n \"Europe/Tirane\": \"+355\",\n \"Europe/Ulyanovsk\": \"+7\",\n \"Europe/Vaduz\": \"+423\",\n \"Europe/Vatican\": \"+39\",\n \"Europe/Vienna\": \"+43\",\n \"Europe/Vilnius\": \"+370\",\n \"Europe/Volgograd\": \"+7\",\n \"Europe/Warsaw\": \"+48\",\n \"Europe/Zagreb\": \"+385\",\n \"Europe/Zurich\": \"+41\",\n \"Indian/Antananarivo\": \"+261\",\n \"Indian/Chagos\": \"+246\",\n \"Indian/Christmas\": \"+61\",\n \"Indian/Cocos\": \"+61\",\n \"Indian/Comoro\": \"+269\",\n \"Indian/Kerguelen\": \"+262\",\n \"Indian/Mahe\": \"+248\",\n \"Indian/Maldives\": \"+960\",\n \"Indian/Mauritius\": \"+230\",\n \"Indian/Mayotte\": \"+262\",\n \"Indian/Reunion\": \"+262\",\n \"Pacific/Apia\": \"+685\",\n \"Pacific/Auckland\": \"+64\",\n \"Pacific/Bougainville\": \"+675\",\n \"Pacific/Chatham\": \"+64\",\n \"Pacific/Chuuk\": \"+691\",\n \"Pacific/Easter\": \"+56\",\n \"Pacific/Efate\": \"+678\",\n \"Pacific/Enderbury\": \"+686\",\n \"Pacific/Fakaofo\": \"+690\",\n \"Pacific/Fiji\": \"+679\",\n \"Pacific/Funafuti\": \"+688\",\n \"Pacific/Galapagos\": \"+593\",\n \"Pacific/Gambier\": \"+689\",\n \"Pacific/Guadalcanal\": \"+677\",\n \"Pacific/Guam\": \"+1\",\n \"Pacific/Honolulu\": \"+1\",\n \"Pacific/Kiritimati\": \"+686\",\n \"Pacific/Kosrae\": \"+691\",\n \"Pacific/Kwajalein\": \"+692\",\n \"Pacific/Majuro\": \"+692\",\n \"Pacific/Marquesas\": \"+689\",\n \"Pacific/Midway\": \"+1\",\n \"Pacific/Nauru\": \"+674\",\n \"Pacific/Niue\": \"+683\",\n \"Pacific/Norfolk\": \"+672\",\n \"Pacific/Noumea\": \"+687\",\n \"Pacific/Pago_Pago\": \"+1\",\n \"Pacific/Palau\": \"+680\",\n \"Pacific/Pitcairn\": \"+64\",\n \"Pacific/Pohnpei\": \"+691\",\n \"Pacific/Port_Moresby\": \"+675\",\n \"Pacific/Rarotonga\": \"+682\",\n \"Pacific/Saipan\": \"+1\",\n \"Pacific/Tahiti\": \"+689\",\n \"Pacific/Tarawa\": \"+686\",\n \"Pacific/Tongatapu\": \"+676\",\n \"Pacific/Wake\": \"+1\",\n \"Pacific/Wallis\": \"+681\"\n}, r = (a) => i[a] || null;\nexport {\n r as getPhoneCodeByTimezone\n};\n","function _iterableToArrayLimit(r, l) {\n var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n if (null != t) {\n var e,\n n,\n i,\n u,\n a = [],\n f = !0,\n o = !1;\n try {\n if (i = (t = t.call(r)).next, 0 === l) {\n if (Object(t) !== t) return;\n f = !1;\n } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n } catch (r) {\n o = !0, n = r;\n } finally {\n try {\n if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;\n } finally {\n if (o) throw n;\n }\n }\n return a;\n }\n}\nfunction ownKeys(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function (r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nfunction _objectSpread2(e) {\n for (var r = 1; r < arguments.length; r++) {\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {\n _defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\n}\nfunction _defineProperty(obj, key, value) {\n key = _toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = _objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n return target;\n}\nfunction _slicedToArray(arr, i) {\n return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();\n}\nfunction _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}\nfunction _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nfunction _toPrimitive(input, hint) {\n if (typeof input !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (typeof res !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}\nfunction _toPropertyKey(arg) {\n var key = _toPrimitive(arg, \"string\");\n return typeof key === \"symbol\" ? key : String(key);\n}\n\nvar countries$1 = {\n\tAD: \"Andorra\",\n\tAE: \"United Arab Emirates\",\n\tAF: \"Afghanistan\",\n\tAG: \"Antigua and Barbuda\",\n\tAI: \"Anguilla\",\n\tAL: \"Albania\",\n\tAM: \"Armenia\",\n\tAO: \"Angola\",\n\tAQ: \"Antarctica\",\n\tAR: \"Argentina\",\n\tAS: \"American Samoa\",\n\tAT: \"Austria\",\n\tAU: \"Australia\",\n\tAW: \"Aruba\",\n\tAX: \"Åland Islands\",\n\tAZ: \"Azerbaijan\",\n\tBA: \"Bosnia and Herzegovina\",\n\tBB: \"Barbados\",\n\tBD: \"Bangladesh\",\n\tBE: \"Belgium\",\n\tBF: \"Burkina Faso\",\n\tBG: \"Bulgaria\",\n\tBH: \"Bahrain\",\n\tBI: \"Burundi\",\n\tBJ: \"Benin\",\n\tBL: \"Saint Barthélemy\",\n\tBM: \"Bermuda\",\n\tBN: \"Brunei\",\n\tBO: \"Bolivia\",\n\tBQ: \"Caribbean Netherlands\",\n\tBR: \"Brazil\",\n\tBS: \"Bahamas\",\n\tBT: \"Bhutan\",\n\tBW: \"Botswana\",\n\tBY: \"Belarus\",\n\tBZ: \"Belize\",\n\tCA: \"Canada\",\n\tCC: \"Cocos Islands\",\n\tCD: \"Democratic Republic of the Congo\",\n\tCF: \"Central African Republic\",\n\tCG: \"Republic of the Congo\",\n\tCH: \"Switzerland\",\n\tCI: \"Ivory Coast\",\n\tCK: \"Cook Islands\",\n\tCL: \"Chile\",\n\tCM: \"Cameroon\",\n\tCN: \"China\",\n\tCO: \"Colombia\",\n\tCR: \"Costa Rica\",\n\tCU: \"Cuba\",\n\tCV: \"Cabo Verde\",\n\tCW: \"Curaçao\",\n\tCX: \"Christmas Island\",\n\tCY: \"Cyprus\",\n\tCZ: \"Czechia\",\n\tDE: \"Germany\",\n\tDJ: \"Djibouti\",\n\tDK: \"Denmark\",\n\tDM: \"Dominica\",\n\tDO: \"Dominican Republic\",\n\tDZ: \"Algeria\",\n\tEC: \"Ecuador\",\n\tEE: \"Estonia\",\n\tEG: \"Egypt\",\n\tEH: \"Western Sahara\",\n\tER: \"Eritrea\",\n\tES: \"Spain\",\n\tET: \"Ethiopia\",\n\tFI: \"Finland\",\n\tFJ: \"Fiji\",\n\tFK: \"Falkland Islands\",\n\tFM: \"Micronesia\",\n\tFO: \"Faroe Islands\",\n\tFR: \"France\",\n\tGA: \"Gabon\",\n\tGB: \"United Kingdom\",\n\tGD: \"Grenada\",\n\tGE: \"Georgia\",\n\tGF: \"French Guiana\",\n\tGG: \"Guernsey\",\n\tGH: \"Ghana\",\n\tGI: \"Gibraltar\",\n\tGL: \"Greenland\",\n\tGM: \"Gambia\",\n\tGN: \"Guinea\",\n\tGP: \"Guadeloupe\",\n\tGQ: \"Equatorial Guinea\",\n\tGR: \"Greece\",\n\tGS: \"South Georgia and the South Sandwich Islands\",\n\tGT: \"Guatemala\",\n\tGU: \"Guam\",\n\tGW: \"Guinea-Bissau\",\n\tGY: \"Guyana\",\n\tHK: \"Hong Kong\",\n\tHN: \"Honduras\",\n\tHR: \"Croatia\",\n\tHT: \"Haiti\",\n\tHU: \"Hungary\",\n\tID: \"Indonesia\",\n\tIE: \"Ireland\",\n\tIL: \"Israel\",\n\tIM: \"Isle of Man\",\n\tIN: \"India\",\n\tIO: \"British Indian Ocean Territory\",\n\tIQ: \"Iraq\",\n\tIR: \"Iran\",\n\tIS: \"Iceland\",\n\tIT: \"Italy\",\n\tJE: \"Jersey\",\n\tJM: \"Jamaica\",\n\tJO: \"Jordan\",\n\tJP: \"Japan\",\n\tKE: \"Kenya\",\n\tKG: \"Kyrgyzstan\",\n\tKH: \"Cambodia\",\n\tKI: \"Kiribati\",\n\tKM: \"Comoros\",\n\tKN: \"Saint Kitts and Nevis\",\n\tKP: \"North Korea\",\n\tKR: \"South Korea\",\n\tKW: \"Kuwait\",\n\tKY: \"Cayman Islands\",\n\tKZ: \"Kazakhstan\",\n\tLA: \"Laos\",\n\tLB: \"Lebanon\",\n\tLC: \"Saint Lucia\",\n\tLI: \"Liechtenstein\",\n\tLK: \"Sri Lanka\",\n\tLR: \"Liberia\",\n\tLS: \"Lesotho\",\n\tLT: \"Lithuania\",\n\tLU: \"Luxembourg\",\n\tLV: \"Latvia\",\n\tLY: \"Libya\",\n\tMA: \"Morocco\",\n\tMC: \"Monaco\",\n\tMD: \"Moldova\",\n\tME: \"Montenegro\",\n\tMF: \"Saint Martin\",\n\tMG: \"Madagascar\",\n\tMH: \"Marshall Islands\",\n\tMK: \"North Macedonia\",\n\tML: \"Mali\",\n\tMM: \"Myanmar\",\n\tMN: \"Mongolia\",\n\tMO: \"Macao\",\n\tMP: \"Northern Mariana Islands\",\n\tMQ: \"Martinique\",\n\tMR: \"Mauritania\",\n\tMS: \"Montserrat\",\n\tMT: \"Malta\",\n\tMU: \"Mauritius\",\n\tMV: \"Maldives\",\n\tMW: \"Malawi\",\n\tMX: \"Mexico\",\n\tMY: \"Malaysia\",\n\tMZ: \"Mozambique\",\n\tNA: \"Namibia\",\n\tNC: \"New Caledonia\",\n\tNE: \"Niger\",\n\tNF: \"Norfolk Island\",\n\tNG: \"Nigeria\",\n\tNI: \"Nicaragua\",\n\tNL: \"Netherlands\",\n\tNO: \"Norway\",\n\tNP: \"Nepal\",\n\tNR: \"Nauru\",\n\tNU: \"Niue\",\n\tNZ: \"New Zealand\",\n\tOM: \"Oman\",\n\tPA: \"Panama\",\n\tPE: \"Peru\",\n\tPF: \"French Polynesia\",\n\tPG: \"Papua New Guinea\",\n\tPH: \"Philippines\",\n\tPK: \"Pakistan\",\n\tPL: \"Poland\",\n\tPM: \"Saint Pierre and Miquelon\",\n\tPN: \"Pitcairn\",\n\tPR: \"Puerto Rico\",\n\tPS: \"Palestine\",\n\tPT: \"Portugal\",\n\tPW: \"Palau\",\n\tPY: \"Paraguay\",\n\tQA: \"Qatar\",\n\tRE: \"Réunion\",\n\tRO: \"Romania\",\n\tRS: \"Serbia\",\n\tRU: \"Russia\",\n\tRW: \"Rwanda\",\n\tSA: \"Saudi Arabia\",\n\tSB: \"Solomon Islands\",\n\tSC: \"Seychelles\",\n\tSD: \"Sudan\",\n\tSE: \"Sweden\",\n\tSG: \"Singapore\",\n\tSH: \"Saint Helena, Ascension and Tristan da Cunha\",\n\tSI: \"Slovenia\",\n\tSJ: \"Svalbard and Jan Mayen\",\n\tSK: \"Slovakia\",\n\tSL: \"Sierra Leone\",\n\tSM: \"San Marino\",\n\tSN: \"Senegal\",\n\tSO: \"Somalia\",\n\tSR: \"Suriname\",\n\tSS: \"South Sudan\",\n\tST: \"Sao Tome and Principe\",\n\tSV: \"El Salvador\",\n\tSX: \"Sint Maarten\",\n\tSY: \"Syria\",\n\tSZ: \"Eswatini\",\n\tTC: \"Turks and Caicos Islands\",\n\tTD: \"Chad\",\n\tTF: \"French Southern Territories\",\n\tTG: \"Togo\",\n\tTH: \"Thailand\",\n\tTJ: \"Tajikistan\",\n\tTK: \"Tokelau\",\n\tTL: \"Timor-Leste\",\n\tTM: \"Turkmenistan\",\n\tTN: \"Tunisia\",\n\tTO: \"Tonga\",\n\tTR: \"Türkiye\",\n\tTT: \"Trinidad and Tobago\",\n\tTV: \"Tuvalu\",\n\tTW: \"Taiwan\",\n\tTZ: \"Tanzania\",\n\tUA: \"Ukraine\",\n\tUG: \"Uganda\",\n\tUM: \"United States Minor Outlying Islands\",\n\tUS: \"United States of America\",\n\tUY: \"Uruguay\",\n\tUZ: \"Uzbekistan\",\n\tVA: \"Holy See\",\n\tVC: \"Saint Vincent and the Grenadines\",\n\tVE: \"Venezuela\",\n\tVG: \"Virgin Islands (UK)\",\n\tVI: \"Virgin Islands (US)\",\n\tVN: \"Vietnam\",\n\tVU: \"Vanuatu\",\n\tWF: \"Wallis and Futuna\",\n\tWS: \"Samoa\",\n\tYE: \"Yemen\",\n\tYT: \"Mayotte\",\n\tZA: \"South Africa\",\n\tZM: \"Zambia\",\n\tZW: \"Zimbabwe\"\n};\nvar timezones$1 = {\n\t\"Africa/Abidjan\": {\n\t\tu: 0,\n\t\tc: [\n\t\t\t\"CI\",\n\t\t\t\"BF\",\n\t\t\t\"GH\",\n\t\t\t\"GM\",\n\t\t\t\"GN\",\n\t\t\t\"IS\",\n\t\t\t\"ML\",\n\t\t\t\"MR\",\n\t\t\t\"SH\",\n\t\t\t\"SL\",\n\t\t\t\"SN\",\n\t\t\t\"TG\"\n\t\t]\n\t},\n\t\"Africa/Accra\": {\n\t\ta: \"Africa/Abidjan\",\n\t\tc: [\n\t\t\t\"GH\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Africa/Addis_Ababa\": {\n\t\ta: \"Africa/Nairobi\",\n\t\tc: [\n\t\t\t\"ET\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Africa/Algiers\": {\n\t\tu: 60,\n\t\tc: [\n\t\t\t\"DZ\"\n\t\t]\n\t},\n\t\"Africa/Asmara\": {\n\t\ta: \"Africa/Nairobi\",\n\t\tc: [\n\t\t\t\"ER\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Africa/Asmera\": {\n\t\ta: \"Africa/Nairobi\",\n\t\tc: [\n\t\t\t\"ER\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Africa/Bamako\": {\n\t\ta: \"Africa/Abidjan\",\n\t\tc: [\n\t\t\t\"ML\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Africa/Bangui\": {\n\t\ta: \"Africa/Lagos\",\n\t\tc: [\n\t\t\t\"CF\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Africa/Banjul\": {\n\t\ta: \"Africa/Abidjan\",\n\t\tc: [\n\t\t\t\"GM\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Africa/Bissau\": {\n\t\tu: 0,\n\t\tc: [\n\t\t\t\"GW\"\n\t\t]\n\t},\n\t\"Africa/Blantyre\": {\n\t\ta: \"Africa/Maputo\",\n\t\tc: [\n\t\t\t\"MW\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Africa/Brazzaville\": {\n\t\ta: \"Africa/Lagos\",\n\t\tc: [\n\t\t\t\"CG\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Africa/Bujumbura\": {\n\t\ta: \"Africa/Maputo\",\n\t\tc: [\n\t\t\t\"BI\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Africa/Cairo\": {\n\t\tu: 120,\n\t\td: 180,\n\t\tc: [\n\t\t\t\"EG\"\n\t\t]\n\t},\n\t\"Africa/Casablanca\": {\n\t\tu: 60,\n\t\td: 0,\n\t\tc: [\n\t\t\t\"MA\"\n\t\t]\n\t},\n\t\"Africa/Ceuta\": {\n\t\tu: 60,\n\t\td: 120,\n\t\tc: [\n\t\t\t\"ES\"\n\t\t]\n\t},\n\t\"Africa/Conakry\": {\n\t\ta: \"Africa/Abidjan\",\n\t\tc: [\n\t\t\t\"GN\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Africa/Dakar\": {\n\t\ta: \"Africa/Abidjan\",\n\t\tc: [\n\t\t\t\"SN\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Africa/Dar_es_Salaam\": {\n\t\ta: \"Africa/Nairobi\",\n\t\tc: [\n\t\t\t\"TZ\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Africa/Djibouti\": {\n\t\ta: \"Africa/Nairobi\",\n\t\tc: [\n\t\t\t\"DJ\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Africa/Douala\": {\n\t\ta: \"Africa/Lagos\",\n\t\tc: [\n\t\t\t\"CM\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Africa/El_Aaiun\": {\n\t\tu: 60,\n\t\td: 0,\n\t\tc: [\n\t\t\t\"EH\"\n\t\t]\n\t},\n\t\"Africa/Freetown\": {\n\t\ta: \"Africa/Abidjan\",\n\t\tc: [\n\t\t\t\"SL\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Africa/Gaborone\": {\n\t\ta: \"Africa/Maputo\",\n\t\tc: [\n\t\t\t\"BW\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Africa/Harare\": {\n\t\ta: \"Africa/Maputo\",\n\t\tc: [\n\t\t\t\"ZW\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Africa/Johannesburg\": {\n\t\tu: 120,\n\t\tc: [\n\t\t\t\"ZA\",\n\t\t\t\"LS\",\n\t\t\t\"SZ\"\n\t\t]\n\t},\n\t\"Africa/Juba\": {\n\t\tu: 120,\n\t\tc: [\n\t\t\t\"SS\"\n\t\t]\n\t},\n\t\"Africa/Kampala\": {\n\t\ta: \"Africa/Nairobi\",\n\t\tc: [\n\t\t\t\"UG\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Africa/Khartoum\": {\n\t\tu: 120,\n\t\tc: [\n\t\t\t\"SD\"\n\t\t]\n\t},\n\t\"Africa/Kigali\": {\n\t\ta: \"Africa/Maputo\",\n\t\tc: [\n\t\t\t\"RW\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Africa/Kinshasa\": {\n\t\ta: \"Africa/Lagos\",\n\t\tc: [\n\t\t\t\"CD\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Africa/Lagos\": {\n\t\tu: 60,\n\t\tc: [\n\t\t\t\"NG\",\n\t\t\t\"AO\",\n\t\t\t\"BJ\",\n\t\t\t\"CD\",\n\t\t\t\"CF\",\n\t\t\t\"CG\",\n\t\t\t\"CM\",\n\t\t\t\"GA\",\n\t\t\t\"GQ\",\n\t\t\t\"NE\"\n\t\t]\n\t},\n\t\"Africa/Libreville\": {\n\t\ta: \"Africa/Lagos\",\n\t\tc: [\n\t\t\t\"GA\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Africa/Lome\": {\n\t\ta: \"Africa/Abidjan\",\n\t\tc: [\n\t\t\t\"TG\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Africa/Luanda\": {\n\t\ta: \"Africa/Lagos\",\n\t\tc: [\n\t\t\t\"AO\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Africa/Lubumbashi\": {\n\t\ta: \"Africa/Maputo\",\n\t\tc: [\n\t\t\t\"CD\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Africa/Lusaka\": {\n\t\ta: \"Africa/Maputo\",\n\t\tc: [\n\t\t\t\"ZM\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Africa/Malabo\": {\n\t\ta: \"Africa/Lagos\",\n\t\tc: [\n\t\t\t\"GQ\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Africa/Maputo\": {\n\t\tu: 120,\n\t\tc: [\n\t\t\t\"MZ\",\n\t\t\t\"BI\",\n\t\t\t\"BW\",\n\t\t\t\"CD\",\n\t\t\t\"MW\",\n\t\t\t\"RW\",\n\t\t\t\"ZM\",\n\t\t\t\"ZW\"\n\t\t]\n\t},\n\t\"Africa/Maseru\": {\n\t\ta: \"Africa/Johannesburg\",\n\t\tc: [\n\t\t\t\"LS\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Africa/Mbabane\": {\n\t\ta: \"Africa/Johannesburg\",\n\t\tc: [\n\t\t\t\"SZ\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Africa/Mogadishu\": {\n\t\ta: \"Africa/Nairobi\",\n\t\tc: [\n\t\t\t\"SO\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Africa/Monrovia\": {\n\t\tu: 0,\n\t\tc: [\n\t\t\t\"LR\"\n\t\t]\n\t},\n\t\"Africa/Nairobi\": {\n\t\tu: 180,\n\t\tc: [\n\t\t\t\"KE\",\n\t\t\t\"DJ\",\n\t\t\t\"ER\",\n\t\t\t\"ET\",\n\t\t\t\"KM\",\n\t\t\t\"MG\",\n\t\t\t\"SO\",\n\t\t\t\"TZ\",\n\t\t\t\"UG\",\n\t\t\t\"YT\"\n\t\t]\n\t},\n\t\"Africa/Ndjamena\": {\n\t\tu: 60,\n\t\tc: [\n\t\t\t\"TD\"\n\t\t]\n\t},\n\t\"Africa/Niamey\": {\n\t\ta: \"Africa/Lagos\",\n\t\tc: [\n\t\t\t\"NE\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Africa/Nouakchott\": {\n\t\ta: \"Africa/Abidjan\",\n\t\tc: [\n\t\t\t\"MR\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Africa/Ouagadougou\": {\n\t\ta: \"Africa/Abidjan\",\n\t\tc: [\n\t\t\t\"BF\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Africa/Porto-Novo\": {\n\t\ta: \"Africa/Lagos\",\n\t\tc: [\n\t\t\t\"BJ\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Africa/Sao_Tome\": {\n\t\tu: 0,\n\t\tc: [\n\t\t\t\"ST\"\n\t\t]\n\t},\n\t\"Africa/Timbuktu\": {\n\t\ta: \"Africa/Abidjan\",\n\t\tc: [\n\t\t\t\"ML\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Africa/Tripoli\": {\n\t\tu: 120,\n\t\tc: [\n\t\t\t\"LY\"\n\t\t]\n\t},\n\t\"Africa/Tunis\": {\n\t\tu: 60,\n\t\tc: [\n\t\t\t\"TN\"\n\t\t]\n\t},\n\t\"Africa/Windhoek\": {\n\t\tu: 120,\n\t\tc: [\n\t\t\t\"NA\"\n\t\t]\n\t},\n\t\"America/Adak\": {\n\t\tu: -600,\n\t\td: -540,\n\t\tc: [\n\t\t\t\"US\"\n\t\t]\n\t},\n\t\"America/Anchorage\": {\n\t\tu: -540,\n\t\td: -480,\n\t\tc: [\n\t\t\t\"US\"\n\t\t]\n\t},\n\t\"America/Anguilla\": {\n\t\ta: \"America/Puerto_Rico\",\n\t\tc: [\n\t\t\t\"AI\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"America/Antigua\": {\n\t\ta: \"America/Puerto_Rico\",\n\t\tc: [\n\t\t\t\"AG\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"America/Araguaina\": {\n\t\tu: -180,\n\t\tc: [\n\t\t\t\"BR\"\n\t\t]\n\t},\n\t\"America/Argentina/Buenos_Aires\": {\n\t\tu: -180,\n\t\tc: [\n\t\t\t\"AR\"\n\t\t]\n\t},\n\t\"America/Argentina/Catamarca\": {\n\t\tu: -180,\n\t\tc: [\n\t\t\t\"AR\"\n\t\t]\n\t},\n\t\"America/Argentina/ComodRivadavia\": {\n\t\ta: \"America/Argentina/Catamarca\",\n\t\tr: 1\n\t},\n\t\"America/Argentina/Cordoba\": {\n\t\tu: -180,\n\t\tc: [\n\t\t\t\"AR\"\n\t\t]\n\t},\n\t\"America/Argentina/Jujuy\": {\n\t\tu: -180,\n\t\tc: [\n\t\t\t\"AR\"\n\t\t]\n\t},\n\t\"America/Argentina/La_Rioja\": {\n\t\tu: -180,\n\t\tc: [\n\t\t\t\"AR\"\n\t\t]\n\t},\n\t\"America/Argentina/Mendoza\": {\n\t\tu: -180,\n\t\tc: [\n\t\t\t\"AR\"\n\t\t]\n\t},\n\t\"America/Argentina/Rio_Gallegos\": {\n\t\tu: -180,\n\t\tc: [\n\t\t\t\"AR\"\n\t\t]\n\t},\n\t\"America/Argentina/Salta\": {\n\t\tu: -180,\n\t\tc: [\n\t\t\t\"AR\"\n\t\t]\n\t},\n\t\"America/Argentina/San_Juan\": {\n\t\tu: -180,\n\t\tc: [\n\t\t\t\"AR\"\n\t\t]\n\t},\n\t\"America/Argentina/San_Luis\": {\n\t\tu: -180,\n\t\tc: [\n\t\t\t\"AR\"\n\t\t]\n\t},\n\t\"America/Argentina/Tucuman\": {\n\t\tu: -180,\n\t\tc: [\n\t\t\t\"AR\"\n\t\t]\n\t},\n\t\"America/Argentina/Ushuaia\": {\n\t\tu: -180,\n\t\tc: [\n\t\t\t\"AR\"\n\t\t]\n\t},\n\t\"America/Aruba\": {\n\t\ta: \"America/Puerto_Rico\",\n\t\tc: [\n\t\t\t\"AW\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"America/Asuncion\": {\n\t\tu: -240,\n\t\td: -180,\n\t\tc: [\n\t\t\t\"PY\"\n\t\t]\n\t},\n\t\"America/Atikokan\": {\n\t\ta: \"America/Panama\",\n\t\tc: [\n\t\t\t\"CA\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"America/Atka\": {\n\t\ta: \"America/Adak\",\n\t\tr: 1\n\t},\n\t\"America/Bahia\": {\n\t\tu: -180,\n\t\tc: [\n\t\t\t\"BR\"\n\t\t]\n\t},\n\t\"America/Bahia_Banderas\": {\n\t\tu: -360,\n\t\tc: [\n\t\t\t\"MX\"\n\t\t]\n\t},\n\t\"America/Barbados\": {\n\t\tu: -240,\n\t\tc: [\n\t\t\t\"BB\"\n\t\t]\n\t},\n\t\"America/Belem\": {\n\t\tu: -180,\n\t\tc: [\n\t\t\t\"BR\"\n\t\t]\n\t},\n\t\"America/Belize\": {\n\t\tu: -360,\n\t\tc: [\n\t\t\t\"BZ\"\n\t\t]\n\t},\n\t\"America/Blanc-Sablon\": {\n\t\ta: \"America/Puerto_Rico\",\n\t\tc: [\n\t\t\t\"CA\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"America/Boa_Vista\": {\n\t\tu: -240,\n\t\tc: [\n\t\t\t\"BR\"\n\t\t]\n\t},\n\t\"America/Bogota\": {\n\t\tu: -300,\n\t\tc: [\n\t\t\t\"CO\"\n\t\t]\n\t},\n\t\"America/Boise\": {\n\t\tu: -420,\n\t\td: -360,\n\t\tc: [\n\t\t\t\"US\"\n\t\t]\n\t},\n\t\"America/Buenos_Aires\": {\n\t\ta: \"America/Argentina/Buenos_Aires\",\n\t\tr: 1\n\t},\n\t\"America/Cambridge_Bay\": {\n\t\tu: -420,\n\t\td: -360,\n\t\tc: [\n\t\t\t\"CA\"\n\t\t]\n\t},\n\t\"America/Campo_Grande\": {\n\t\tu: -240,\n\t\tc: [\n\t\t\t\"BR\"\n\t\t]\n\t},\n\t\"America/Cancun\": {\n\t\tu: -300,\n\t\tc: [\n\t\t\t\"MX\"\n\t\t]\n\t},\n\t\"America/Caracas\": {\n\t\tu: -240,\n\t\tc: [\n\t\t\t\"VE\"\n\t\t]\n\t},\n\t\"America/Catamarca\": {\n\t\ta: \"America/Argentina/Catamarca\",\n\t\tr: 1\n\t},\n\t\"America/Cayenne\": {\n\t\tu: -180,\n\t\tc: [\n\t\t\t\"GF\"\n\t\t]\n\t},\n\t\"America/Cayman\": {\n\t\ta: \"America/Panama\",\n\t\tc: [\n\t\t\t\"KY\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"America/Chicago\": {\n\t\tu: -360,\n\t\td: -300,\n\t\tc: [\n\t\t\t\"US\"\n\t\t]\n\t},\n\t\"America/Chihuahua\": {\n\t\tu: -360,\n\t\tc: [\n\t\t\t\"MX\"\n\t\t]\n\t},\n\t\"America/Ciudad_Juarez\": {\n\t\tu: -420,\n\t\td: -360,\n\t\tc: [\n\t\t\t\"MX\"\n\t\t]\n\t},\n\t\"America/Coral_Harbour\": {\n\t\ta: \"America/Panama\",\n\t\tc: [\n\t\t\t\"CA\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"America/Cordoba\": {\n\t\ta: \"America/Argentina/Cordoba\",\n\t\tr: 1\n\t},\n\t\"America/Costa_Rica\": {\n\t\tu: -360,\n\t\tc: [\n\t\t\t\"CR\"\n\t\t]\n\t},\n\t\"America/Creston\": {\n\t\ta: \"America/Phoenix\",\n\t\tc: [\n\t\t\t\"CA\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"America/Cuiaba\": {\n\t\tu: -240,\n\t\tc: [\n\t\t\t\"BR\"\n\t\t]\n\t},\n\t\"America/Curacao\": {\n\t\ta: \"America/Puerto_Rico\",\n\t\tc: [\n\t\t\t\"CW\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"America/Danmarkshavn\": {\n\t\tu: 0,\n\t\tc: [\n\t\t\t\"GL\"\n\t\t]\n\t},\n\t\"America/Dawson\": {\n\t\tu: -420,\n\t\tc: [\n\t\t\t\"CA\"\n\t\t]\n\t},\n\t\"America/Dawson_Creek\": {\n\t\tu: -420,\n\t\tc: [\n\t\t\t\"CA\"\n\t\t]\n\t},\n\t\"America/Denver\": {\n\t\tu: -420,\n\t\td: -360,\n\t\tc: [\n\t\t\t\"US\"\n\t\t]\n\t},\n\t\"America/Detroit\": {\n\t\tu: -300,\n\t\td: -240,\n\t\tc: [\n\t\t\t\"US\"\n\t\t]\n\t},\n\t\"America/Dominica\": {\n\t\ta: \"America/Puerto_Rico\",\n\t\tc: [\n\t\t\t\"DM\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"America/Edmonton\": {\n\t\tu: -420,\n\t\td: -360,\n\t\tc: [\n\t\t\t\"CA\"\n\t\t]\n\t},\n\t\"America/Eirunepe\": {\n\t\tu: -300,\n\t\tc: [\n\t\t\t\"BR\"\n\t\t]\n\t},\n\t\"America/El_Salvador\": {\n\t\tu: -360,\n\t\tc: [\n\t\t\t\"SV\"\n\t\t]\n\t},\n\t\"America/Ensenada\": {\n\t\ta: \"America/Tijuana\",\n\t\tr: 1\n\t},\n\t\"America/Fort_Nelson\": {\n\t\tu: -420,\n\t\tc: [\n\t\t\t\"CA\"\n\t\t]\n\t},\n\t\"America/Fort_Wayne\": {\n\t\ta: \"America/Indiana/Indianapolis\",\n\t\tr: 1\n\t},\n\t\"America/Fortaleza\": {\n\t\tu: -180,\n\t\tc: [\n\t\t\t\"BR\"\n\t\t]\n\t},\n\t\"America/Glace_Bay\": {\n\t\tu: -240,\n\t\td: -180,\n\t\tc: [\n\t\t\t\"CA\"\n\t\t]\n\t},\n\t\"America/Godthab\": {\n\t\ta: \"America/Nuuk\",\n\t\tr: 1\n\t},\n\t\"America/Goose_Bay\": {\n\t\tu: -240,\n\t\td: -180,\n\t\tc: [\n\t\t\t\"CA\"\n\t\t]\n\t},\n\t\"America/Grand_Turk\": {\n\t\tu: -300,\n\t\td: -240,\n\t\tc: [\n\t\t\t\"TC\"\n\t\t]\n\t},\n\t\"America/Grenada\": {\n\t\ta: \"America/Puerto_Rico\",\n\t\tc: [\n\t\t\t\"GD\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"America/Guadeloupe\": {\n\t\ta: \"America/Puerto_Rico\",\n\t\tc: [\n\t\t\t\"GP\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"America/Guatemala\": {\n\t\tu: -360,\n\t\tc: [\n\t\t\t\"GT\"\n\t\t]\n\t},\n\t\"America/Guayaquil\": {\n\t\tu: -300,\n\t\tc: [\n\t\t\t\"EC\"\n\t\t]\n\t},\n\t\"America/Guyana\": {\n\t\tu: -240,\n\t\tc: [\n\t\t\t\"GY\"\n\t\t]\n\t},\n\t\"America/Halifax\": {\n\t\tu: -240,\n\t\td: -180,\n\t\tc: [\n\t\t\t\"CA\"\n\t\t]\n\t},\n\t\"America/Havana\": {\n\t\tu: -300,\n\t\td: -240,\n\t\tc: [\n\t\t\t\"CU\"\n\t\t]\n\t},\n\t\"America/Hermosillo\": {\n\t\tu: -420,\n\t\tc: [\n\t\t\t\"MX\"\n\t\t]\n\t},\n\t\"America/Indiana/Indianapolis\": {\n\t\tu: -300,\n\t\td: -240,\n\t\tc: [\n\t\t\t\"US\"\n\t\t]\n\t},\n\t\"America/Indiana/Knox\": {\n\t\tu: -360,\n\t\td: -300,\n\t\tc: [\n\t\t\t\"US\"\n\t\t]\n\t},\n\t\"America/Indiana/Marengo\": {\n\t\tu: -300,\n\t\td: -240,\n\t\tc: [\n\t\t\t\"US\"\n\t\t]\n\t},\n\t\"America/Indiana/Petersburg\": {\n\t\tu: -300,\n\t\td: -240,\n\t\tc: [\n\t\t\t\"US\"\n\t\t]\n\t},\n\t\"America/Indiana/Tell_City\": {\n\t\tu: -360,\n\t\td: -300,\n\t\tc: [\n\t\t\t\"US\"\n\t\t]\n\t},\n\t\"America/Indiana/Vevay\": {\n\t\tu: -300,\n\t\td: -240,\n\t\tc: [\n\t\t\t\"US\"\n\t\t]\n\t},\n\t\"America/Indiana/Vincennes\": {\n\t\tu: -300,\n\t\td: -240,\n\t\tc: [\n\t\t\t\"US\"\n\t\t]\n\t},\n\t\"America/Indiana/Winamac\": {\n\t\tu: -300,\n\t\td: -240,\n\t\tc: [\n\t\t\t\"US\"\n\t\t]\n\t},\n\t\"America/Indianapolis\": {\n\t\ta: \"America/Indiana/Indianapolis\",\n\t\tr: 1\n\t},\n\t\"America/Inuvik\": {\n\t\tu: -420,\n\t\td: -360,\n\t\tc: [\n\t\t\t\"CA\"\n\t\t]\n\t},\n\t\"America/Iqaluit\": {\n\t\tu: -300,\n\t\td: -240,\n\t\tc: [\n\t\t\t\"CA\"\n\t\t]\n\t},\n\t\"America/Jamaica\": {\n\t\tu: -300,\n\t\tc: [\n\t\t\t\"JM\"\n\t\t]\n\t},\n\t\"America/Jujuy\": {\n\t\ta: \"America/Argentina/Jujuy\",\n\t\tr: 1\n\t},\n\t\"America/Juneau\": {\n\t\tu: -540,\n\t\td: -480,\n\t\tc: [\n\t\t\t\"US\"\n\t\t]\n\t},\n\t\"America/Kentucky/Louisville\": {\n\t\tu: -300,\n\t\td: -240,\n\t\tc: [\n\t\t\t\"US\"\n\t\t]\n\t},\n\t\"America/Kentucky/Monticello\": {\n\t\tu: -300,\n\t\td: -240,\n\t\tc: [\n\t\t\t\"US\"\n\t\t]\n\t},\n\t\"America/Knox_IN\": {\n\t\ta: \"America/Indiana/Knox\",\n\t\tr: 1\n\t},\n\t\"America/Kralendijk\": {\n\t\ta: \"America/Puerto_Rico\",\n\t\tc: [\n\t\t\t\"BQ\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"America/La_Paz\": {\n\t\tu: -240,\n\t\tc: [\n\t\t\t\"BO\"\n\t\t]\n\t},\n\t\"America/Lima\": {\n\t\tu: -300,\n\t\tc: [\n\t\t\t\"PE\"\n\t\t]\n\t},\n\t\"America/Los_Angeles\": {\n\t\tu: -480,\n\t\td: -420,\n\t\tc: [\n\t\t\t\"US\"\n\t\t]\n\t},\n\t\"America/Louisville\": {\n\t\ta: \"America/Kentucky/Louisville\",\n\t\tr: 1\n\t},\n\t\"America/Lower_Princes\": {\n\t\ta: \"America/Puerto_Rico\",\n\t\tc: [\n\t\t\t\"SX\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"America/Maceio\": {\n\t\tu: -180,\n\t\tc: [\n\t\t\t\"BR\"\n\t\t]\n\t},\n\t\"America/Managua\": {\n\t\tu: -360,\n\t\tc: [\n\t\t\t\"NI\"\n\t\t]\n\t},\n\t\"America/Manaus\": {\n\t\tu: -240,\n\t\tc: [\n\t\t\t\"BR\"\n\t\t]\n\t},\n\t\"America/Marigot\": {\n\t\ta: \"America/Puerto_Rico\",\n\t\tc: [\n\t\t\t\"MF\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"America/Martinique\": {\n\t\tu: -240,\n\t\tc: [\n\t\t\t\"MQ\"\n\t\t]\n\t},\n\t\"America/Matamoros\": {\n\t\tu: -360,\n\t\td: -300,\n\t\tc: [\n\t\t\t\"MX\"\n\t\t]\n\t},\n\t\"America/Mazatlan\": {\n\t\tu: -420,\n\t\tc: [\n\t\t\t\"MX\"\n\t\t]\n\t},\n\t\"America/Mendoza\": {\n\t\ta: \"America/Argentina/Mendoza\",\n\t\tr: 1\n\t},\n\t\"America/Menominee\": {\n\t\tu: -360,\n\t\td: -300,\n\t\tc: [\n\t\t\t\"US\"\n\t\t]\n\t},\n\t\"America/Merida\": {\n\t\tu: -360,\n\t\tc: [\n\t\t\t\"MX\"\n\t\t]\n\t},\n\t\"America/Metlakatla\": {\n\t\tu: -540,\n\t\td: -480,\n\t\tc: [\n\t\t\t\"US\"\n\t\t]\n\t},\n\t\"America/Mexico_City\": {\n\t\tu: -360,\n\t\tc: [\n\t\t\t\"MX\"\n\t\t]\n\t},\n\t\"America/Miquelon\": {\n\t\tu: -180,\n\t\td: -120,\n\t\tc: [\n\t\t\t\"PM\"\n\t\t]\n\t},\n\t\"America/Moncton\": {\n\t\tu: -240,\n\t\td: -180,\n\t\tc: [\n\t\t\t\"CA\"\n\t\t]\n\t},\n\t\"America/Monterrey\": {\n\t\tu: -360,\n\t\tc: [\n\t\t\t\"MX\"\n\t\t]\n\t},\n\t\"America/Montevideo\": {\n\t\tu: -180,\n\t\tc: [\n\t\t\t\"UY\"\n\t\t]\n\t},\n\t\"America/Montreal\": {\n\t\ta: \"America/Toronto\",\n\t\tc: [\n\t\t\t\"CA\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"America/Montserrat\": {\n\t\ta: \"America/Puerto_Rico\",\n\t\tc: [\n\t\t\t\"MS\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"America/Nassau\": {\n\t\ta: \"America/Toronto\",\n\t\tc: [\n\t\t\t\"BS\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"America/New_York\": {\n\t\tu: -300,\n\t\td: -240,\n\t\tc: [\n\t\t\t\"US\"\n\t\t]\n\t},\n\t\"America/Nipigon\": {\n\t\ta: \"America/Toronto\",\n\t\tc: [\n\t\t\t\"CA\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"America/Nome\": {\n\t\tu: -540,\n\t\td: -480,\n\t\tc: [\n\t\t\t\"US\"\n\t\t]\n\t},\n\t\"America/Noronha\": {\n\t\tu: -120,\n\t\tc: [\n\t\t\t\"BR\"\n\t\t]\n\t},\n\t\"America/North_Dakota/Beulah\": {\n\t\tu: -360,\n\t\td: -300,\n\t\tc: [\n\t\t\t\"US\"\n\t\t]\n\t},\n\t\"America/North_Dakota/Center\": {\n\t\tu: -360,\n\t\td: -300,\n\t\tc: [\n\t\t\t\"US\"\n\t\t]\n\t},\n\t\"America/North_Dakota/New_Salem\": {\n\t\tu: -360,\n\t\td: -300,\n\t\tc: [\n\t\t\t\"US\"\n\t\t]\n\t},\n\t\"America/Nuuk\": {\n\t\tu: -120,\n\t\td: -60,\n\t\tc: [\n\t\t\t\"GL\"\n\t\t]\n\t},\n\t\"America/Ojinaga\": {\n\t\tu: -360,\n\t\td: -300,\n\t\tc: [\n\t\t\t\"MX\"\n\t\t]\n\t},\n\t\"America/Panama\": {\n\t\tu: -300,\n\t\tc: [\n\t\t\t\"PA\",\n\t\t\t\"CA\",\n\t\t\t\"KY\"\n\t\t]\n\t},\n\t\"America/Pangnirtung\": {\n\t\ta: \"America/Iqaluit\",\n\t\tr: 1\n\t},\n\t\"America/Paramaribo\": {\n\t\tu: -180,\n\t\tc: [\n\t\t\t\"SR\"\n\t\t]\n\t},\n\t\"America/Phoenix\": {\n\t\tu: -420,\n\t\tc: [\n\t\t\t\"US\",\n\t\t\t\"CA\"\n\t\t]\n\t},\n\t\"America/Port-au-Prince\": {\n\t\tu: -300,\n\t\td: -240,\n\t\tc: [\n\t\t\t\"HT\"\n\t\t]\n\t},\n\t\"America/Port_of_Spain\": {\n\t\ta: \"America/Puerto_Rico\",\n\t\tc: [\n\t\t\t\"TT\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"America/Porto_Acre\": {\n\t\ta: \"America/Rio_Branco\",\n\t\tr: 1\n\t},\n\t\"America/Porto_Velho\": {\n\t\tu: -240,\n\t\tc: [\n\t\t\t\"BR\"\n\t\t]\n\t},\n\t\"America/Puerto_Rico\": {\n\t\tu: -240,\n\t\tc: [\n\t\t\t\"PR\",\n\t\t\t\"AG\",\n\t\t\t\"CA\",\n\t\t\t\"AI\",\n\t\t\t\"AW\",\n\t\t\t\"BL\",\n\t\t\t\"BQ\",\n\t\t\t\"CW\",\n\t\t\t\"DM\",\n\t\t\t\"GD\",\n\t\t\t\"GP\",\n\t\t\t\"KN\",\n\t\t\t\"LC\",\n\t\t\t\"MF\",\n\t\t\t\"MS\",\n\t\t\t\"SX\",\n\t\t\t\"TT\",\n\t\t\t\"VC\",\n\t\t\t\"VG\",\n\t\t\t\"VI\"\n\t\t]\n\t},\n\t\"America/Punta_Arenas\": {\n\t\tu: -180,\n\t\tc: [\n\t\t\t\"CL\"\n\t\t]\n\t},\n\t\"America/Rainy_River\": {\n\t\ta: \"America/Winnipeg\",\n\t\tr: 1\n\t},\n\t\"America/Rankin_Inlet\": {\n\t\tu: -360,\n\t\td: -300,\n\t\tc: [\n\t\t\t\"CA\"\n\t\t]\n\t},\n\t\"America/Recife\": {\n\t\tu: -180,\n\t\tc: [\n\t\t\t\"BR\"\n\t\t]\n\t},\n\t\"America/Regina\": {\n\t\tu: -360,\n\t\tc: [\n\t\t\t\"CA\"\n\t\t]\n\t},\n\t\"America/Resolute\": {\n\t\tu: -360,\n\t\td: -300,\n\t\tc: [\n\t\t\t\"CA\"\n\t\t]\n\t},\n\t\"America/Rio_Branco\": {\n\t\tu: -300,\n\t\tc: [\n\t\t\t\"BR\"\n\t\t]\n\t},\n\t\"America/Rosario\": {\n\t\ta: \"America/Argentina/Cordoba\",\n\t\tr: 1\n\t},\n\t\"America/Santa_Isabel\": {\n\t\ta: \"America/Tijuana\",\n\t\tr: 1\n\t},\n\t\"America/Santarem\": {\n\t\tu: -180,\n\t\tc: [\n\t\t\t\"BR\"\n\t\t]\n\t},\n\t\"America/Santiago\": {\n\t\tu: -240,\n\t\td: -180,\n\t\tc: [\n\t\t\t\"CL\"\n\t\t]\n\t},\n\t\"America/Santo_Domingo\": {\n\t\tu: -240,\n\t\tc: [\n\t\t\t\"DO\"\n\t\t]\n\t},\n\t\"America/Sao_Paulo\": {\n\t\tu: -180,\n\t\tc: [\n\t\t\t\"BR\"\n\t\t]\n\t},\n\t\"America/Scoresbysund\": {\n\t\tu: -60,\n\t\td: 0,\n\t\tc: [\n\t\t\t\"GL\"\n\t\t]\n\t},\n\t\"America/Shiprock\": {\n\t\ta: \"America/Denver\",\n\t\tr: 1\n\t},\n\t\"America/Sitka\": {\n\t\tu: -540,\n\t\td: -480,\n\t\tc: [\n\t\t\t\"US\"\n\t\t]\n\t},\n\t\"America/St_Barthelemy\": {\n\t\ta: \"America/Puerto_Rico\",\n\t\tc: [\n\t\t\t\"BL\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"America/St_Johns\": {\n\t\tu: -210,\n\t\td: -150,\n\t\tc: [\n\t\t\t\"CA\"\n\t\t]\n\t},\n\t\"America/St_Kitts\": {\n\t\ta: \"America/Puerto_Rico\",\n\t\tc: [\n\t\t\t\"KN\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"America/St_Lucia\": {\n\t\ta: \"America/Puerto_Rico\",\n\t\tc: [\n\t\t\t\"LC\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"America/St_Thomas\": {\n\t\ta: \"America/Puerto_Rico\",\n\t\tc: [\n\t\t\t\"VI\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"America/St_Vincent\": {\n\t\ta: \"America/Puerto_Rico\",\n\t\tc: [\n\t\t\t\"VC\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"America/Swift_Current\": {\n\t\tu: -360,\n\t\tc: [\n\t\t\t\"CA\"\n\t\t]\n\t},\n\t\"America/Tegucigalpa\": {\n\t\tu: -360,\n\t\tc: [\n\t\t\t\"HN\"\n\t\t]\n\t},\n\t\"America/Thule\": {\n\t\tu: -240,\n\t\td: -180,\n\t\tc: [\n\t\t\t\"GL\"\n\t\t]\n\t},\n\t\"America/Thunder_Bay\": {\n\t\ta: \"America/Toronto\",\n\t\tc: [\n\t\t\t\"CA\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"America/Tijuana\": {\n\t\tu: -480,\n\t\td: -420,\n\t\tc: [\n\t\t\t\"MX\"\n\t\t]\n\t},\n\t\"America/Toronto\": {\n\t\tu: -300,\n\t\td: -240,\n\t\tc: [\n\t\t\t\"CA\",\n\t\t\t\"BS\"\n\t\t]\n\t},\n\t\"America/Tortola\": {\n\t\ta: \"America/Puerto_Rico\",\n\t\tc: [\n\t\t\t\"VG\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"America/Vancouver\": {\n\t\tu: -480,\n\t\td: -420,\n\t\tc: [\n\t\t\t\"CA\"\n\t\t]\n\t},\n\t\"America/Virgin\": {\n\t\ta: \"America/Puerto_Rico\",\n\t\tc: [\n\t\t\t\"VI\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"America/Whitehorse\": {\n\t\tu: -420,\n\t\tc: [\n\t\t\t\"CA\"\n\t\t]\n\t},\n\t\"America/Winnipeg\": {\n\t\tu: -360,\n\t\td: -300,\n\t\tc: [\n\t\t\t\"CA\"\n\t\t]\n\t},\n\t\"America/Yakutat\": {\n\t\tu: -540,\n\t\td: -480,\n\t\tc: [\n\t\t\t\"US\"\n\t\t]\n\t},\n\t\"America/Yellowknife\": {\n\t\ta: \"America/Edmonton\",\n\t\tr: 1\n\t},\n\t\"Antarctica/Casey\": {\n\t\tu: 660,\n\t\tc: [\n\t\t\t\"AQ\"\n\t\t]\n\t},\n\t\"Antarctica/Davis\": {\n\t\tu: 420,\n\t\tc: [\n\t\t\t\"AQ\"\n\t\t]\n\t},\n\t\"Antarctica/DumontDUrville\": {\n\t\ta: \"Pacific/Port_Moresby\",\n\t\tc: [\n\t\t\t\"AQ\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Antarctica/Macquarie\": {\n\t\tu: 600,\n\t\td: 660,\n\t\tc: [\n\t\t\t\"AU\"\n\t\t]\n\t},\n\t\"Antarctica/Mawson\": {\n\t\tu: 300,\n\t\tc: [\n\t\t\t\"AQ\"\n\t\t]\n\t},\n\t\"Antarctica/McMurdo\": {\n\t\ta: \"Pacific/Auckland\",\n\t\tc: [\n\t\t\t\"AQ\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Antarctica/Palmer\": {\n\t\tu: -180,\n\t\tc: [\n\t\t\t\"AQ\"\n\t\t]\n\t},\n\t\"Antarctica/Rothera\": {\n\t\tu: -180,\n\t\tc: [\n\t\t\t\"AQ\"\n\t\t]\n\t},\n\t\"Antarctica/South_Pole\": {\n\t\ta: \"Pacific/Auckland\",\n\t\tc: [\n\t\t\t\"AQ\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Antarctica/Syowa\": {\n\t\ta: \"Asia/Riyadh\",\n\t\tc: [\n\t\t\t\"AQ\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Antarctica/Troll\": {\n\t\tu: 0,\n\t\td: 120,\n\t\tc: [\n\t\t\t\"AQ\"\n\t\t]\n\t},\n\t\"Antarctica/Vostok\": {\n\t\ta: \"Asia/Urumqi\",\n\t\tc: [\n\t\t\t\"AQ\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Arctic/Longyearbyen\": {\n\t\ta: \"Europe/Berlin\",\n\t\tc: [\n\t\t\t\"SJ\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Asia/Aden\": {\n\t\ta: \"Asia/Riyadh\",\n\t\tc: [\n\t\t\t\"YE\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Asia/Almaty\": {\n\t\tu: 360,\n\t\tc: [\n\t\t\t\"KZ\"\n\t\t]\n\t},\n\t\"Asia/Amman\": {\n\t\tu: 180,\n\t\tc: [\n\t\t\t\"JO\"\n\t\t]\n\t},\n\t\"Asia/Anadyr\": {\n\t\tu: 720,\n\t\tc: [\n\t\t\t\"RU\"\n\t\t]\n\t},\n\t\"Asia/Aqtau\": {\n\t\tu: 300,\n\t\tc: [\n\t\t\t\"KZ\"\n\t\t]\n\t},\n\t\"Asia/Aqtobe\": {\n\t\tu: 300,\n\t\tc: [\n\t\t\t\"KZ\"\n\t\t]\n\t},\n\t\"Asia/Ashgabat\": {\n\t\tu: 300,\n\t\tc: [\n\t\t\t\"TM\"\n\t\t]\n\t},\n\t\"Asia/Ashkhabad\": {\n\t\ta: \"Asia/Ashgabat\",\n\t\tr: 1\n\t},\n\t\"Asia/Atyrau\": {\n\t\tu: 300,\n\t\tc: [\n\t\t\t\"KZ\"\n\t\t]\n\t},\n\t\"Asia/Baghdad\": {\n\t\tu: 180,\n\t\tc: [\n\t\t\t\"IQ\"\n\t\t]\n\t},\n\t\"Asia/Bahrain\": {\n\t\ta: \"Asia/Qatar\",\n\t\tc: [\n\t\t\t\"BH\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Asia/Baku\": {\n\t\tu: 240,\n\t\tc: [\n\t\t\t\"AZ\"\n\t\t]\n\t},\n\t\"Asia/Bangkok\": {\n\t\tu: 420,\n\t\tc: [\n\t\t\t\"TH\",\n\t\t\t\"CX\",\n\t\t\t\"KH\",\n\t\t\t\"LA\",\n\t\t\t\"VN\"\n\t\t]\n\t},\n\t\"Asia/Barnaul\": {\n\t\tu: 420,\n\t\tc: [\n\t\t\t\"RU\"\n\t\t]\n\t},\n\t\"Asia/Beirut\": {\n\t\tu: 120,\n\t\td: 180,\n\t\tc: [\n\t\t\t\"LB\"\n\t\t]\n\t},\n\t\"Asia/Bishkek\": {\n\t\tu: 360,\n\t\tc: [\n\t\t\t\"KG\"\n\t\t]\n\t},\n\t\"Asia/Brunei\": {\n\t\ta: \"Asia/Kuching\",\n\t\tc: [\n\t\t\t\"BN\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Asia/Calcutta\": {\n\t\ta: \"Asia/Kolkata\",\n\t\tr: 1\n\t},\n\t\"Asia/Chita\": {\n\t\tu: 540,\n\t\tc: [\n\t\t\t\"RU\"\n\t\t]\n\t},\n\t\"Asia/Choibalsan\": {\n\t\tu: 480,\n\t\tc: [\n\t\t\t\"MN\"\n\t\t]\n\t},\n\t\"Asia/Chongqing\": {\n\t\ta: \"Asia/Shanghai\",\n\t\tr: 1\n\t},\n\t\"Asia/Chungking\": {\n\t\ta: \"Asia/Shanghai\",\n\t\tr: 1\n\t},\n\t\"Asia/Colombo\": {\n\t\tu: 330,\n\t\tc: [\n\t\t\t\"LK\"\n\t\t]\n\t},\n\t\"Asia/Dacca\": {\n\t\ta: \"Asia/Dhaka\",\n\t\tr: 1\n\t},\n\t\"Asia/Damascus\": {\n\t\tu: 180,\n\t\tc: [\n\t\t\t\"SY\"\n\t\t]\n\t},\n\t\"Asia/Dhaka\": {\n\t\tu: 360,\n\t\tc: [\n\t\t\t\"BD\"\n\t\t]\n\t},\n\t\"Asia/Dili\": {\n\t\tu: 540,\n\t\tc: [\n\t\t\t\"TL\"\n\t\t]\n\t},\n\t\"Asia/Dubai\": {\n\t\tu: 240,\n\t\tc: [\n\t\t\t\"AE\",\n\t\t\t\"OM\",\n\t\t\t\"RE\",\n\t\t\t\"SC\",\n\t\t\t\"TF\"\n\t\t]\n\t},\n\t\"Asia/Dushanbe\": {\n\t\tu: 300,\n\t\tc: [\n\t\t\t\"TJ\"\n\t\t]\n\t},\n\t\"Asia/Famagusta\": {\n\t\tu: 120,\n\t\td: 180,\n\t\tc: [\n\t\t\t\"CY\"\n\t\t]\n\t},\n\t\"Asia/Gaza\": {\n\t\tu: 120,\n\t\td: 180,\n\t\tc: [\n\t\t\t\"PS\"\n\t\t]\n\t},\n\t\"Asia/Harbin\": {\n\t\ta: \"Asia/Shanghai\",\n\t\tr: 1\n\t},\n\t\"Asia/Hebron\": {\n\t\tu: 120,\n\t\td: 180,\n\t\tc: [\n\t\t\t\"PS\"\n\t\t]\n\t},\n\t\"Asia/Ho_Chi_Minh\": {\n\t\tu: 420,\n\t\tc: [\n\t\t\t\"VN\"\n\t\t]\n\t},\n\t\"Asia/Hong_Kong\": {\n\t\tu: 480,\n\t\tc: [\n\t\t\t\"HK\"\n\t\t]\n\t},\n\t\"Asia/Hovd\": {\n\t\tu: 420,\n\t\tc: [\n\t\t\t\"MN\"\n\t\t]\n\t},\n\t\"Asia/Irkutsk\": {\n\t\tu: 480,\n\t\tc: [\n\t\t\t\"RU\"\n\t\t]\n\t},\n\t\"Asia/Istanbul\": {\n\t\ta: \"Europe/Istanbul\",\n\t\tr: 1\n\t},\n\t\"Asia/Jakarta\": {\n\t\tu: 420,\n\t\tc: [\n\t\t\t\"ID\"\n\t\t]\n\t},\n\t\"Asia/Jayapura\": {\n\t\tu: 540,\n\t\tc: [\n\t\t\t\"ID\"\n\t\t]\n\t},\n\t\"Asia/Jerusalem\": {\n\t\tu: 120,\n\t\td: 180,\n\t\tc: [\n\t\t\t\"IL\"\n\t\t]\n\t},\n\t\"Asia/Kabul\": {\n\t\tu: 270,\n\t\tc: [\n\t\t\t\"AF\"\n\t\t]\n\t},\n\t\"Asia/Kamchatka\": {\n\t\tu: 720,\n\t\tc: [\n\t\t\t\"RU\"\n\t\t]\n\t},\n\t\"Asia/Karachi\": {\n\t\tu: 300,\n\t\tc: [\n\t\t\t\"PK\"\n\t\t]\n\t},\n\t\"Asia/Kashgar\": {\n\t\ta: \"Asia/Urumqi\",\n\t\tc: [\n\t\t\t\"CN\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Asia/Kathmandu\": {\n\t\tu: 345,\n\t\tc: [\n\t\t\t\"NP\"\n\t\t]\n\t},\n\t\"Asia/Katmandu\": {\n\t\ta: \"Asia/Kathmandu\",\n\t\tr: 1\n\t},\n\t\"Asia/Khandyga\": {\n\t\tu: 540,\n\t\tc: [\n\t\t\t\"RU\"\n\t\t]\n\t},\n\t\"Asia/Kolkata\": {\n\t\tu: 330,\n\t\tc: [\n\t\t\t\"IN\"\n\t\t]\n\t},\n\t\"Asia/Krasnoyarsk\": {\n\t\tu: 420,\n\t\tc: [\n\t\t\t\"RU\"\n\t\t]\n\t},\n\t\"Asia/Kuala_Lumpur\": {\n\t\ta: \"Asia/Singapore\",\n\t\tc: [\n\t\t\t\"MY\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Asia/Kuching\": {\n\t\tu: 480,\n\t\tc: [\n\t\t\t\"MY\",\n\t\t\t\"BN\"\n\t\t]\n\t},\n\t\"Asia/Kuwait\": {\n\t\ta: \"Asia/Riyadh\",\n\t\tc: [\n\t\t\t\"KW\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Asia/Macao\": {\n\t\ta: \"Asia/Macau\",\n\t\tr: 1\n\t},\n\t\"Asia/Macau\": {\n\t\tu: 480,\n\t\tc: [\n\t\t\t\"MO\"\n\t\t]\n\t},\n\t\"Asia/Magadan\": {\n\t\tu: 660,\n\t\tc: [\n\t\t\t\"RU\"\n\t\t]\n\t},\n\t\"Asia/Makassar\": {\n\t\tu: 480,\n\t\tc: [\n\t\t\t\"ID\"\n\t\t]\n\t},\n\t\"Asia/Manila\": {\n\t\tu: 480,\n\t\tc: [\n\t\t\t\"PH\"\n\t\t]\n\t},\n\t\"Asia/Muscat\": {\n\t\ta: \"Asia/Dubai\",\n\t\tc: [\n\t\t\t\"OM\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Asia/Nicosia\": {\n\t\tu: 120,\n\t\td: 180,\n\t\tc: [\n\t\t\t\"CY\"\n\t\t]\n\t},\n\t\"Asia/Novokuznetsk\": {\n\t\tu: 420,\n\t\tc: [\n\t\t\t\"RU\"\n\t\t]\n\t},\n\t\"Asia/Novosibirsk\": {\n\t\tu: 420,\n\t\tc: [\n\t\t\t\"RU\"\n\t\t]\n\t},\n\t\"Asia/Omsk\": {\n\t\tu: 360,\n\t\tc: [\n\t\t\t\"RU\"\n\t\t]\n\t},\n\t\"Asia/Oral\": {\n\t\tu: 300,\n\t\tc: [\n\t\t\t\"KZ\"\n\t\t]\n\t},\n\t\"Asia/Phnom_Penh\": {\n\t\ta: \"Asia/Bangkok\",\n\t\tc: [\n\t\t\t\"KH\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Asia/Pontianak\": {\n\t\tu: 420,\n\t\tc: [\n\t\t\t\"ID\"\n\t\t]\n\t},\n\t\"Asia/Pyongyang\": {\n\t\tu: 540,\n\t\tc: [\n\t\t\t\"KP\"\n\t\t]\n\t},\n\t\"Asia/Qatar\": {\n\t\tu: 180,\n\t\tc: [\n\t\t\t\"QA\",\n\t\t\t\"BH\"\n\t\t]\n\t},\n\t\"Asia/Qostanay\": {\n\t\tu: 360,\n\t\tc: [\n\t\t\t\"KZ\"\n\t\t]\n\t},\n\t\"Asia/Qyzylorda\": {\n\t\tu: 300,\n\t\tc: [\n\t\t\t\"KZ\"\n\t\t]\n\t},\n\t\"Asia/Rangoon\": {\n\t\ta: \"Asia/Yangon\",\n\t\tc: [\n\t\t\t\"MM\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Asia/Riyadh\": {\n\t\tu: 180,\n\t\tc: [\n\t\t\t\"SA\",\n\t\t\t\"AQ\",\n\t\t\t\"KW\",\n\t\t\t\"YE\"\n\t\t]\n\t},\n\t\"Asia/Saigon\": {\n\t\ta: \"Asia/Ho_Chi_Minh\",\n\t\tr: 1\n\t},\n\t\"Asia/Sakhalin\": {\n\t\tu: 660,\n\t\tc: [\n\t\t\t\"RU\"\n\t\t]\n\t},\n\t\"Asia/Samarkand\": {\n\t\tu: 300,\n\t\tc: [\n\t\t\t\"UZ\"\n\t\t]\n\t},\n\t\"Asia/Seoul\": {\n\t\tu: 540,\n\t\tc: [\n\t\t\t\"KR\"\n\t\t]\n\t},\n\t\"Asia/Shanghai\": {\n\t\tu: 480,\n\t\tc: [\n\t\t\t\"CN\"\n\t\t]\n\t},\n\t\"Asia/Singapore\": {\n\t\tu: 480,\n\t\tc: [\n\t\t\t\"SG\",\n\t\t\t\"MY\"\n\t\t]\n\t},\n\t\"Asia/Srednekolymsk\": {\n\t\tu: 660,\n\t\tc: [\n\t\t\t\"RU\"\n\t\t]\n\t},\n\t\"Asia/Taipei\": {\n\t\tu: 480,\n\t\tc: [\n\t\t\t\"TW\"\n\t\t]\n\t},\n\t\"Asia/Tashkent\": {\n\t\tu: 300,\n\t\tc: [\n\t\t\t\"UZ\"\n\t\t]\n\t},\n\t\"Asia/Tbilisi\": {\n\t\tu: 240,\n\t\tc: [\n\t\t\t\"GE\"\n\t\t]\n\t},\n\t\"Asia/Tehran\": {\n\t\tu: 210,\n\t\tc: [\n\t\t\t\"IR\"\n\t\t]\n\t},\n\t\"Asia/Tel_Aviv\": {\n\t\ta: \"Asia/Jerusalem\",\n\t\tr: 1\n\t},\n\t\"Asia/Thimbu\": {\n\t\ta: \"Asia/Thimphu\",\n\t\tr: 1\n\t},\n\t\"Asia/Thimphu\": {\n\t\tu: 360,\n\t\tc: [\n\t\t\t\"BT\"\n\t\t]\n\t},\n\t\"Asia/Tokyo\": {\n\t\tu: 540,\n\t\tc: [\n\t\t\t\"JP\"\n\t\t]\n\t},\n\t\"Asia/Tomsk\": {\n\t\tu: 420,\n\t\tc: [\n\t\t\t\"RU\"\n\t\t]\n\t},\n\t\"Asia/Ujung_Pandang\": {\n\t\ta: \"Asia/Makassar\",\n\t\tr: 1\n\t},\n\t\"Asia/Ulaanbaatar\": {\n\t\tu: 480,\n\t\tc: [\n\t\t\t\"MN\"\n\t\t]\n\t},\n\t\"Asia/Ulan_Bator\": {\n\t\ta: \"Asia/Ulaanbaatar\",\n\t\tr: 1\n\t},\n\t\"Asia/Urumqi\": {\n\t\tu: 360,\n\t\tc: [\n\t\t\t\"CN\",\n\t\t\t\"AQ\"\n\t\t]\n\t},\n\t\"Asia/Ust-Nera\": {\n\t\tu: 600,\n\t\tc: [\n\t\t\t\"RU\"\n\t\t]\n\t},\n\t\"Asia/Vientiane\": {\n\t\ta: \"Asia/Bangkok\",\n\t\tc: [\n\t\t\t\"LA\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Asia/Vladivostok\": {\n\t\tu: 600,\n\t\tc: [\n\t\t\t\"RU\"\n\t\t]\n\t},\n\t\"Asia/Yakutsk\": {\n\t\tu: 540,\n\t\tc: [\n\t\t\t\"RU\"\n\t\t]\n\t},\n\t\"Asia/Yangon\": {\n\t\tu: 390,\n\t\tc: [\n\t\t\t\"MM\",\n\t\t\t\"CC\"\n\t\t]\n\t},\n\t\"Asia/Yekaterinburg\": {\n\t\tu: 300,\n\t\tc: [\n\t\t\t\"RU\"\n\t\t]\n\t},\n\t\"Asia/Yerevan\": {\n\t\tu: 240,\n\t\tc: [\n\t\t\t\"AM\"\n\t\t]\n\t},\n\t\"Atlantic/Azores\": {\n\t\tu: -60,\n\t\td: 0,\n\t\tc: [\n\t\t\t\"PT\"\n\t\t]\n\t},\n\t\"Atlantic/Bermuda\": {\n\t\tu: -240,\n\t\td: -180,\n\t\tc: [\n\t\t\t\"BM\"\n\t\t]\n\t},\n\t\"Atlantic/Canary\": {\n\t\tu: 0,\n\t\td: 60,\n\t\tc: [\n\t\t\t\"ES\"\n\t\t]\n\t},\n\t\"Atlantic/Cape_Verde\": {\n\t\tu: -60,\n\t\tc: [\n\t\t\t\"CV\"\n\t\t]\n\t},\n\t\"Atlantic/Faeroe\": {\n\t\ta: \"Atlantic/Faroe\",\n\t\tr: 1\n\t},\n\t\"Atlantic/Faroe\": {\n\t\tu: 0,\n\t\td: 60,\n\t\tc: [\n\t\t\t\"FO\"\n\t\t]\n\t},\n\t\"Atlantic/Jan_Mayen\": {\n\t\ta: \"Europe/Berlin\",\n\t\tc: [\n\t\t\t\"SJ\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Atlantic/Madeira\": {\n\t\tu: 0,\n\t\td: 60,\n\t\tc: [\n\t\t\t\"PT\"\n\t\t]\n\t},\n\t\"Atlantic/Reykjavik\": {\n\t\ta: \"Africa/Abidjan\",\n\t\tc: [\n\t\t\t\"IS\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Atlantic/South_Georgia\": {\n\t\tu: -120,\n\t\tc: [\n\t\t\t\"GS\"\n\t\t]\n\t},\n\t\"Atlantic/St_Helena\": {\n\t\ta: \"Africa/Abidjan\",\n\t\tc: [\n\t\t\t\"SH\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Atlantic/Stanley\": {\n\t\tu: -180,\n\t\tc: [\n\t\t\t\"FK\"\n\t\t]\n\t},\n\t\"Australia/ACT\": {\n\t\ta: \"Australia/Sydney\",\n\t\tr: 1\n\t},\n\t\"Australia/Adelaide\": {\n\t\tu: 570,\n\t\td: 630,\n\t\tc: [\n\t\t\t\"AU\"\n\t\t]\n\t},\n\t\"Australia/Brisbane\": {\n\t\tu: 600,\n\t\tc: [\n\t\t\t\"AU\"\n\t\t]\n\t},\n\t\"Australia/Broken_Hill\": {\n\t\tu: 570,\n\t\td: 630,\n\t\tc: [\n\t\t\t\"AU\"\n\t\t]\n\t},\n\t\"Australia/Canberra\": {\n\t\ta: \"Australia/Sydney\",\n\t\tr: 1\n\t},\n\t\"Australia/Currie\": {\n\t\ta: \"Australia/Hobart\",\n\t\tr: 1\n\t},\n\t\"Australia/Darwin\": {\n\t\tu: 570,\n\t\tc: [\n\t\t\t\"AU\"\n\t\t]\n\t},\n\t\"Australia/Eucla\": {\n\t\tu: 525,\n\t\tc: [\n\t\t\t\"AU\"\n\t\t]\n\t},\n\t\"Australia/Hobart\": {\n\t\tu: 600,\n\t\td: 660,\n\t\tc: [\n\t\t\t\"AU\"\n\t\t]\n\t},\n\t\"Australia/LHI\": {\n\t\ta: \"Australia/Lord_Howe\",\n\t\tr: 1\n\t},\n\t\"Australia/Lindeman\": {\n\t\tu: 600,\n\t\tc: [\n\t\t\t\"AU\"\n\t\t]\n\t},\n\t\"Australia/Lord_Howe\": {\n\t\tu: 630,\n\t\td: 660,\n\t\tc: [\n\t\t\t\"AU\"\n\t\t]\n\t},\n\t\"Australia/Melbourne\": {\n\t\tu: 600,\n\t\td: 660,\n\t\tc: [\n\t\t\t\"AU\"\n\t\t]\n\t},\n\t\"Australia/NSW\": {\n\t\ta: \"Australia/Sydney\",\n\t\tr: 1\n\t},\n\t\"Australia/North\": {\n\t\ta: \"Australia/Darwin\",\n\t\tr: 1\n\t},\n\t\"Australia/Perth\": {\n\t\tu: 480,\n\t\tc: [\n\t\t\t\"AU\"\n\t\t]\n\t},\n\t\"Australia/Queensland\": {\n\t\ta: \"Australia/Brisbane\",\n\t\tr: 1\n\t},\n\t\"Australia/South\": {\n\t\ta: \"Australia/Adelaide\",\n\t\tr: 1\n\t},\n\t\"Australia/Sydney\": {\n\t\tu: 600,\n\t\td: 660,\n\t\tc: [\n\t\t\t\"AU\"\n\t\t]\n\t},\n\t\"Australia/Tasmania\": {\n\t\ta: \"Australia/Hobart\",\n\t\tr: 1\n\t},\n\t\"Australia/Victoria\": {\n\t\ta: \"Australia/Melbourne\",\n\t\tr: 1\n\t},\n\t\"Australia/West\": {\n\t\ta: \"Australia/Perth\",\n\t\tr: 1\n\t},\n\t\"Australia/Yancowinna\": {\n\t\ta: \"Australia/Broken_Hill\",\n\t\tr: 1\n\t},\n\t\"Brazil/Acre\": {\n\t\ta: \"America/Rio_Branco\",\n\t\tr: 1\n\t},\n\t\"Brazil/DeNoronha\": {\n\t\ta: \"America/Noronha\",\n\t\tr: 1\n\t},\n\t\"Brazil/East\": {\n\t\ta: \"America/Sao_Paulo\",\n\t\tr: 1\n\t},\n\t\"Brazil/West\": {\n\t\ta: \"America/Manaus\",\n\t\tr: 1\n\t},\n\tCET: {\n\t\tu: 60,\n\t\td: 120\n\t},\n\tCST6CDT: {\n\t\tu: -360,\n\t\td: -300\n\t},\n\t\"Canada/Atlantic\": {\n\t\ta: \"America/Halifax\",\n\t\tr: 1\n\t},\n\t\"Canada/Central\": {\n\t\ta: \"America/Winnipeg\",\n\t\tr: 1\n\t},\n\t\"Canada/Eastern\": {\n\t\ta: \"America/Toronto\",\n\t\tc: [\n\t\t\t\"CA\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Canada/Mountain\": {\n\t\ta: \"America/Edmonton\",\n\t\tr: 1\n\t},\n\t\"Canada/Newfoundland\": {\n\t\ta: \"America/St_Johns\",\n\t\tr: 1\n\t},\n\t\"Canada/Pacific\": {\n\t\ta: \"America/Vancouver\",\n\t\tr: 1\n\t},\n\t\"Canada/Saskatchewan\": {\n\t\ta: \"America/Regina\",\n\t\tr: 1\n\t},\n\t\"Canada/Yukon\": {\n\t\ta: \"America/Whitehorse\",\n\t\tr: 1\n\t},\n\t\"Chile/Continental\": {\n\t\ta: \"America/Santiago\",\n\t\tr: 1\n\t},\n\t\"Chile/EasterIsland\": {\n\t\ta: \"Pacific/Easter\",\n\t\tr: 1\n\t},\n\tCuba: {\n\t\ta: \"America/Havana\",\n\t\tr: 1\n\t},\n\tEET: {\n\t\tu: 120,\n\t\td: 180\n\t},\n\tEST: {\n\t\tu: -300\n\t},\n\tEST5EDT: {\n\t\tu: -300,\n\t\td: -240\n\t},\n\tEgypt: {\n\t\ta: \"Africa/Cairo\",\n\t\tr: 1\n\t},\n\tEire: {\n\t\ta: \"Europe/Dublin\",\n\t\tr: 1\n\t},\n\t\"Etc/GMT\": {\n\t\tu: 0\n\t},\n\t\"Etc/GMT+0\": {\n\t\ta: \"Etc/GMT\",\n\t\tr: 1\n\t},\n\t\"Etc/GMT+1\": {\n\t\tu: -60\n\t},\n\t\"Etc/GMT+10\": {\n\t\tu: -600\n\t},\n\t\"Etc/GMT+11\": {\n\t\tu: -660\n\t},\n\t\"Etc/GMT+12\": {\n\t\tu: -720\n\t},\n\t\"Etc/GMT+2\": {\n\t\tu: -120\n\t},\n\t\"Etc/GMT+3\": {\n\t\tu: -180\n\t},\n\t\"Etc/GMT+4\": {\n\t\tu: -240\n\t},\n\t\"Etc/GMT+5\": {\n\t\tu: -300\n\t},\n\t\"Etc/GMT+6\": {\n\t\tu: -360\n\t},\n\t\"Etc/GMT+7\": {\n\t\tu: -420\n\t},\n\t\"Etc/GMT+8\": {\n\t\tu: -480\n\t},\n\t\"Etc/GMT+9\": {\n\t\tu: -540\n\t},\n\t\"Etc/GMT-0\": {\n\t\ta: \"Etc/GMT\",\n\t\tr: 1\n\t},\n\t\"Etc/GMT-1\": {\n\t\tu: 60\n\t},\n\t\"Etc/GMT-10\": {\n\t\tu: 600\n\t},\n\t\"Etc/GMT-11\": {\n\t\tu: 660\n\t},\n\t\"Etc/GMT-12\": {\n\t\tu: 720\n\t},\n\t\"Etc/GMT-13\": {\n\t\tu: 780\n\t},\n\t\"Etc/GMT-14\": {\n\t\tu: 840\n\t},\n\t\"Etc/GMT-2\": {\n\t\tu: 120\n\t},\n\t\"Etc/GMT-3\": {\n\t\tu: 180\n\t},\n\t\"Etc/GMT-4\": {\n\t\tu: 240\n\t},\n\t\"Etc/GMT-5\": {\n\t\tu: 300\n\t},\n\t\"Etc/GMT-6\": {\n\t\tu: 360\n\t},\n\t\"Etc/GMT-7\": {\n\t\tu: 420\n\t},\n\t\"Etc/GMT-8\": {\n\t\tu: 480\n\t},\n\t\"Etc/GMT-9\": {\n\t\tu: 540\n\t},\n\t\"Etc/GMT0\": {\n\t\ta: \"Etc/GMT\",\n\t\tr: 1\n\t},\n\t\"Etc/Greenwich\": {\n\t\ta: \"Etc/GMT\",\n\t\tr: 1\n\t},\n\t\"Etc/UCT\": {\n\t\ta: \"Etc/UTC\",\n\t\tr: 1\n\t},\n\t\"Etc/UTC\": {\n\t\tu: 0\n\t},\n\t\"Etc/Universal\": {\n\t\ta: \"Etc/UTC\",\n\t\tr: 1\n\t},\n\t\"Etc/Zulu\": {\n\t\ta: \"Etc/UTC\",\n\t\tr: 1\n\t},\n\t\"Europe/Amsterdam\": {\n\t\ta: \"Europe/Brussels\",\n\t\tc: [\n\t\t\t\"NL\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Europe/Andorra\": {\n\t\tu: 60,\n\t\td: 120,\n\t\tc: [\n\t\t\t\"AD\"\n\t\t]\n\t},\n\t\"Europe/Astrakhan\": {\n\t\tu: 240,\n\t\tc: [\n\t\t\t\"RU\"\n\t\t]\n\t},\n\t\"Europe/Athens\": {\n\t\tu: 120,\n\t\td: 180,\n\t\tc: [\n\t\t\t\"GR\"\n\t\t]\n\t},\n\t\"Europe/Belfast\": {\n\t\ta: \"Europe/London\",\n\t\tc: [\n\t\t\t\"GB\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Europe/Belgrade\": {\n\t\tu: 60,\n\t\td: 120,\n\t\tc: [\n\t\t\t\"RS\",\n\t\t\t\"BA\",\n\t\t\t\"HR\",\n\t\t\t\"ME\",\n\t\t\t\"MK\",\n\t\t\t\"SI\"\n\t\t]\n\t},\n\t\"Europe/Berlin\": {\n\t\tu: 60,\n\t\td: 120,\n\t\tc: [\n\t\t\t\"DE\",\n\t\t\t\"DK\",\n\t\t\t\"NO\",\n\t\t\t\"SE\",\n\t\t\t\"SJ\"\n\t\t]\n\t},\n\t\"Europe/Bratislava\": {\n\t\ta: \"Europe/Prague\",\n\t\tc: [\n\t\t\t\"SK\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Europe/Brussels\": {\n\t\tu: 60,\n\t\td: 120,\n\t\tc: [\n\t\t\t\"BE\",\n\t\t\t\"LU\",\n\t\t\t\"NL\"\n\t\t]\n\t},\n\t\"Europe/Bucharest\": {\n\t\tu: 120,\n\t\td: 180,\n\t\tc: [\n\t\t\t\"RO\"\n\t\t]\n\t},\n\t\"Europe/Budapest\": {\n\t\tu: 60,\n\t\td: 120,\n\t\tc: [\n\t\t\t\"HU\"\n\t\t]\n\t},\n\t\"Europe/Busingen\": {\n\t\ta: \"Europe/Zurich\",\n\t\tc: [\n\t\t\t\"DE\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Europe/Chisinau\": {\n\t\tu: 120,\n\t\td: 180,\n\t\tc: [\n\t\t\t\"MD\"\n\t\t]\n\t},\n\t\"Europe/Copenhagen\": {\n\t\ta: \"Europe/Berlin\",\n\t\tc: [\n\t\t\t\"DK\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Europe/Dublin\": {\n\t\tu: 60,\n\t\td: 0,\n\t\tc: [\n\t\t\t\"IE\"\n\t\t]\n\t},\n\t\"Europe/Gibraltar\": {\n\t\tu: 60,\n\t\td: 120,\n\t\tc: [\n\t\t\t\"GI\"\n\t\t]\n\t},\n\t\"Europe/Guernsey\": {\n\t\ta: \"Europe/London\",\n\t\tc: [\n\t\t\t\"GG\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Europe/Helsinki\": {\n\t\tu: 120,\n\t\td: 180,\n\t\tc: [\n\t\t\t\"FI\",\n\t\t\t\"AX\"\n\t\t]\n\t},\n\t\"Europe/Isle_of_Man\": {\n\t\ta: \"Europe/London\",\n\t\tc: [\n\t\t\t\"IM\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Europe/Istanbul\": {\n\t\tu: 180,\n\t\tc: [\n\t\t\t\"TR\"\n\t\t]\n\t},\n\t\"Europe/Jersey\": {\n\t\ta: \"Europe/London\",\n\t\tc: [\n\t\t\t\"JE\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Europe/Kaliningrad\": {\n\t\tu: 120,\n\t\tc: [\n\t\t\t\"RU\"\n\t\t]\n\t},\n\t\"Europe/Kiev\": {\n\t\ta: \"Europe/Kyiv\",\n\t\tr: 1\n\t},\n\t\"Europe/Kirov\": {\n\t\tu: 180,\n\t\tc: [\n\t\t\t\"RU\"\n\t\t]\n\t},\n\t\"Europe/Kyiv\": {\n\t\tu: 120,\n\t\td: 180,\n\t\tc: [\n\t\t\t\"UA\"\n\t\t]\n\t},\n\t\"Europe/Lisbon\": {\n\t\tu: 0,\n\t\td: 60,\n\t\tc: [\n\t\t\t\"PT\"\n\t\t]\n\t},\n\t\"Europe/Ljubljana\": {\n\t\ta: \"Europe/Belgrade\",\n\t\tc: [\n\t\t\t\"SI\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Europe/London\": {\n\t\tu: 0,\n\t\td: 60,\n\t\tc: [\n\t\t\t\"GB\",\n\t\t\t\"GG\",\n\t\t\t\"IM\",\n\t\t\t\"JE\"\n\t\t]\n\t},\n\t\"Europe/Luxembourg\": {\n\t\ta: \"Europe/Brussels\",\n\t\tc: [\n\t\t\t\"LU\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Europe/Madrid\": {\n\t\tu: 60,\n\t\td: 120,\n\t\tc: [\n\t\t\t\"ES\"\n\t\t]\n\t},\n\t\"Europe/Malta\": {\n\t\tu: 60,\n\t\td: 120,\n\t\tc: [\n\t\t\t\"MT\"\n\t\t]\n\t},\n\t\"Europe/Mariehamn\": {\n\t\ta: \"Europe/Helsinki\",\n\t\tc: [\n\t\t\t\"AX\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Europe/Minsk\": {\n\t\tu: 180,\n\t\tc: [\n\t\t\t\"BY\"\n\t\t]\n\t},\n\t\"Europe/Monaco\": {\n\t\ta: \"Europe/Paris\",\n\t\tc: [\n\t\t\t\"MC\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Europe/Moscow\": {\n\t\tu: 180,\n\t\tc: [\n\t\t\t\"RU\"\n\t\t]\n\t},\n\t\"Europe/Nicosia\": {\n\t\ta: \"Asia/Nicosia\",\n\t\tr: 1\n\t},\n\t\"Europe/Oslo\": {\n\t\ta: \"Europe/Berlin\",\n\t\tc: [\n\t\t\t\"NO\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Europe/Paris\": {\n\t\tu: 60,\n\t\td: 120,\n\t\tc: [\n\t\t\t\"FR\",\n\t\t\t\"MC\"\n\t\t]\n\t},\n\t\"Europe/Podgorica\": {\n\t\ta: \"Europe/Belgrade\",\n\t\tc: [\n\t\t\t\"ME\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Europe/Prague\": {\n\t\tu: 60,\n\t\td: 120,\n\t\tc: [\n\t\t\t\"CZ\",\n\t\t\t\"SK\"\n\t\t]\n\t},\n\t\"Europe/Riga\": {\n\t\tu: 120,\n\t\td: 180,\n\t\tc: [\n\t\t\t\"LV\"\n\t\t]\n\t},\n\t\"Europe/Rome\": {\n\t\tu: 60,\n\t\td: 120,\n\t\tc: [\n\t\t\t\"IT\",\n\t\t\t\"SM\",\n\t\t\t\"VA\"\n\t\t]\n\t},\n\t\"Europe/Samara\": {\n\t\tu: 240,\n\t\tc: [\n\t\t\t\"RU\"\n\t\t]\n\t},\n\t\"Europe/San_Marino\": {\n\t\ta: \"Europe/Rome\",\n\t\tc: [\n\t\t\t\"SM\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Europe/Sarajevo\": {\n\t\ta: \"Europe/Belgrade\",\n\t\tc: [\n\t\t\t\"BA\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Europe/Saratov\": {\n\t\tu: 240,\n\t\tc: [\n\t\t\t\"RU\"\n\t\t]\n\t},\n\t\"Europe/Simferopol\": {\n\t\tu: 180,\n\t\tc: [\n\t\t\t\"RU\",\n\t\t\t\"UA\"\n\t\t]\n\t},\n\t\"Europe/Skopje\": {\n\t\ta: \"Europe/Belgrade\",\n\t\tc: [\n\t\t\t\"MK\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Europe/Sofia\": {\n\t\tu: 120,\n\t\td: 180,\n\t\tc: [\n\t\t\t\"BG\"\n\t\t]\n\t},\n\t\"Europe/Stockholm\": {\n\t\ta: \"Europe/Berlin\",\n\t\tc: [\n\t\t\t\"SE\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Europe/Tallinn\": {\n\t\tu: 120,\n\t\td: 180,\n\t\tc: [\n\t\t\t\"EE\"\n\t\t]\n\t},\n\t\"Europe/Tirane\": {\n\t\tu: 60,\n\t\td: 120,\n\t\tc: [\n\t\t\t\"AL\"\n\t\t]\n\t},\n\t\"Europe/Tiraspol\": {\n\t\ta: \"Europe/Chisinau\",\n\t\tr: 1\n\t},\n\t\"Europe/Ulyanovsk\": {\n\t\tu: 240,\n\t\tc: [\n\t\t\t\"RU\"\n\t\t]\n\t},\n\t\"Europe/Uzhgorod\": {\n\t\ta: \"Europe/Kyiv\",\n\t\tr: 1\n\t},\n\t\"Europe/Vaduz\": {\n\t\ta: \"Europe/Zurich\",\n\t\tc: [\n\t\t\t\"LI\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Europe/Vatican\": {\n\t\ta: \"Europe/Rome\",\n\t\tc: [\n\t\t\t\"VA\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Europe/Vienna\": {\n\t\tu: 60,\n\t\td: 120,\n\t\tc: [\n\t\t\t\"AT\"\n\t\t]\n\t},\n\t\"Europe/Vilnius\": {\n\t\tu: 120,\n\t\td: 180,\n\t\tc: [\n\t\t\t\"LT\"\n\t\t]\n\t},\n\t\"Europe/Volgograd\": {\n\t\tu: 180,\n\t\tc: [\n\t\t\t\"RU\"\n\t\t]\n\t},\n\t\"Europe/Warsaw\": {\n\t\tu: 60,\n\t\td: 120,\n\t\tc: [\n\t\t\t\"PL\"\n\t\t]\n\t},\n\t\"Europe/Zagreb\": {\n\t\ta: \"Europe/Belgrade\",\n\t\tc: [\n\t\t\t\"HR\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Europe/Zaporozhye\": {\n\t\ta: \"Europe/Kyiv\",\n\t\tr: 1\n\t},\n\t\"Europe/Zurich\": {\n\t\tu: 60,\n\t\td: 120,\n\t\tc: [\n\t\t\t\"CH\",\n\t\t\t\"DE\",\n\t\t\t\"LI\"\n\t\t]\n\t},\n\tFactory: {\n\t\tu: 0\n\t},\n\tGB: {\n\t\ta: \"Europe/London\",\n\t\tc: [\n\t\t\t\"GB\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"GB-Eire\": {\n\t\ta: \"Europe/London\",\n\t\tc: [\n\t\t\t\"GB\"\n\t\t],\n\t\tr: 1\n\t},\n\tGMT: {\n\t\ta: \"Etc/GMT\",\n\t\tr: 1\n\t},\n\t\"GMT+0\": {\n\t\ta: \"Etc/GMT\",\n\t\tr: 1\n\t},\n\t\"GMT-0\": {\n\t\ta: \"Etc/GMT\",\n\t\tr: 1\n\t},\n\tGMT0: {\n\t\ta: \"Etc/GMT\",\n\t\tr: 1\n\t},\n\tGreenwich: {\n\t\ta: \"Etc/GMT\",\n\t\tr: 1\n\t},\n\tHST: {\n\t\tu: -600\n\t},\n\tHongkong: {\n\t\ta: \"Asia/Hong_Kong\",\n\t\tr: 1\n\t},\n\tIceland: {\n\t\ta: \"Africa/Abidjan\",\n\t\tc: [\n\t\t\t\"IS\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Indian/Antananarivo\": {\n\t\ta: \"Africa/Nairobi\",\n\t\tc: [\n\t\t\t\"MG\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Indian/Chagos\": {\n\t\tu: 360,\n\t\tc: [\n\t\t\t\"IO\"\n\t\t]\n\t},\n\t\"Indian/Christmas\": {\n\t\ta: \"Asia/Bangkok\",\n\t\tc: [\n\t\t\t\"CX\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Indian/Cocos\": {\n\t\ta: \"Asia/Yangon\",\n\t\tc: [\n\t\t\t\"CC\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Indian/Comoro\": {\n\t\ta: \"Africa/Nairobi\",\n\t\tc: [\n\t\t\t\"KM\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Indian/Kerguelen\": {\n\t\ta: \"Indian/Maldives\",\n\t\tc: [\n\t\t\t\"TF\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Indian/Mahe\": {\n\t\ta: \"Asia/Dubai\",\n\t\tc: [\n\t\t\t\"SC\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Indian/Maldives\": {\n\t\tu: 300,\n\t\tc: [\n\t\t\t\"MV\",\n\t\t\t\"TF\"\n\t\t]\n\t},\n\t\"Indian/Mauritius\": {\n\t\tu: 240,\n\t\tc: [\n\t\t\t\"MU\"\n\t\t]\n\t},\n\t\"Indian/Mayotte\": {\n\t\ta: \"Africa/Nairobi\",\n\t\tc: [\n\t\t\t\"YT\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Indian/Reunion\": {\n\t\ta: \"Asia/Dubai\",\n\t\tc: [\n\t\t\t\"RE\"\n\t\t],\n\t\tr: 1\n\t},\n\tIran: {\n\t\ta: \"Asia/Tehran\",\n\t\tr: 1\n\t},\n\tIsrael: {\n\t\ta: \"Asia/Jerusalem\",\n\t\tr: 1\n\t},\n\tJamaica: {\n\t\ta: \"America/Jamaica\",\n\t\tr: 1\n\t},\n\tJapan: {\n\t\ta: \"Asia/Tokyo\",\n\t\tr: 1\n\t},\n\tKwajalein: {\n\t\ta: \"Pacific/Kwajalein\",\n\t\tr: 1\n\t},\n\tLibya: {\n\t\ta: \"Africa/Tripoli\",\n\t\tr: 1\n\t},\n\tMET: {\n\t\tu: 60,\n\t\td: 120\n\t},\n\tMST: {\n\t\tu: -420\n\t},\n\tMST7MDT: {\n\t\tu: -420,\n\t\td: -360\n\t},\n\t\"Mexico/BajaNorte\": {\n\t\ta: \"America/Tijuana\",\n\t\tr: 1\n\t},\n\t\"Mexico/BajaSur\": {\n\t\ta: \"America/Mazatlan\",\n\t\tr: 1\n\t},\n\t\"Mexico/General\": {\n\t\ta: \"America/Mexico_City\",\n\t\tr: 1\n\t},\n\tNZ: {\n\t\ta: \"Pacific/Auckland\",\n\t\tc: [\n\t\t\t\"NZ\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"NZ-CHAT\": {\n\t\ta: \"Pacific/Chatham\",\n\t\tr: 1\n\t},\n\tNavajo: {\n\t\ta: \"America/Denver\",\n\t\tr: 1\n\t},\n\tPRC: {\n\t\ta: \"Asia/Shanghai\",\n\t\tr: 1\n\t},\n\tPST8PDT: {\n\t\tu: -480,\n\t\td: -420\n\t},\n\t\"Pacific/Apia\": {\n\t\tu: 780,\n\t\tc: [\n\t\t\t\"WS\"\n\t\t]\n\t},\n\t\"Pacific/Auckland\": {\n\t\tu: 720,\n\t\td: 780,\n\t\tc: [\n\t\t\t\"NZ\",\n\t\t\t\"AQ\"\n\t\t]\n\t},\n\t\"Pacific/Bougainville\": {\n\t\tu: 660,\n\t\tc: [\n\t\t\t\"PG\"\n\t\t]\n\t},\n\t\"Pacific/Chatham\": {\n\t\tu: 765,\n\t\td: 825,\n\t\tc: [\n\t\t\t\"NZ\"\n\t\t]\n\t},\n\t\"Pacific/Chuuk\": {\n\t\ta: \"Pacific/Port_Moresby\",\n\t\tc: [\n\t\t\t\"FM\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Pacific/Easter\": {\n\t\tu: -360,\n\t\td: -300,\n\t\tc: [\n\t\t\t\"CL\"\n\t\t]\n\t},\n\t\"Pacific/Efate\": {\n\t\tu: 660,\n\t\tc: [\n\t\t\t\"VU\"\n\t\t]\n\t},\n\t\"Pacific/Enderbury\": {\n\t\ta: \"Pacific/Kanton\",\n\t\tr: 1\n\t},\n\t\"Pacific/Fakaofo\": {\n\t\tu: 780,\n\t\tc: [\n\t\t\t\"TK\"\n\t\t]\n\t},\n\t\"Pacific/Fiji\": {\n\t\tu: 720,\n\t\tc: [\n\t\t\t\"FJ\"\n\t\t]\n\t},\n\t\"Pacific/Funafuti\": {\n\t\ta: \"Pacific/Tarawa\",\n\t\tc: [\n\t\t\t\"TV\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Pacific/Galapagos\": {\n\t\tu: -360,\n\t\tc: [\n\t\t\t\"EC\"\n\t\t]\n\t},\n\t\"Pacific/Gambier\": {\n\t\tu: -540,\n\t\tc: [\n\t\t\t\"PF\"\n\t\t]\n\t},\n\t\"Pacific/Guadalcanal\": {\n\t\tu: 660,\n\t\tc: [\n\t\t\t\"SB\",\n\t\t\t\"FM\"\n\t\t]\n\t},\n\t\"Pacific/Guam\": {\n\t\tu: 600,\n\t\tc: [\n\t\t\t\"GU\",\n\t\t\t\"MP\"\n\t\t]\n\t},\n\t\"Pacific/Honolulu\": {\n\t\tu: -600,\n\t\tc: [\n\t\t\t\"US\"\n\t\t]\n\t},\n\t\"Pacific/Johnston\": {\n\t\ta: \"Pacific/Honolulu\",\n\t\tr: 1\n\t},\n\t\"Pacific/Kanton\": {\n\t\tu: 780,\n\t\tc: [\n\t\t\t\"KI\"\n\t\t]\n\t},\n\t\"Pacific/Kiritimati\": {\n\t\tu: 840,\n\t\tc: [\n\t\t\t\"KI\"\n\t\t]\n\t},\n\t\"Pacific/Kosrae\": {\n\t\tu: 660,\n\t\tc: [\n\t\t\t\"FM\"\n\t\t]\n\t},\n\t\"Pacific/Kwajalein\": {\n\t\tu: 720,\n\t\tc: [\n\t\t\t\"MH\"\n\t\t]\n\t},\n\t\"Pacific/Majuro\": {\n\t\ta: \"Pacific/Tarawa\",\n\t\tc: [\n\t\t\t\"MH\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Pacific/Marquesas\": {\n\t\tu: -570,\n\t\tc: [\n\t\t\t\"PF\"\n\t\t]\n\t},\n\t\"Pacific/Midway\": {\n\t\ta: \"Pacific/Pago_Pago\",\n\t\tc: [\n\t\t\t\"UM\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Pacific/Nauru\": {\n\t\tu: 720,\n\t\tc: [\n\t\t\t\"NR\"\n\t\t]\n\t},\n\t\"Pacific/Niue\": {\n\t\tu: -660,\n\t\tc: [\n\t\t\t\"NU\"\n\t\t]\n\t},\n\t\"Pacific/Norfolk\": {\n\t\tu: 660,\n\t\td: 720,\n\t\tc: [\n\t\t\t\"NF\"\n\t\t]\n\t},\n\t\"Pacific/Noumea\": {\n\t\tu: 660,\n\t\tc: [\n\t\t\t\"NC\"\n\t\t]\n\t},\n\t\"Pacific/Pago_Pago\": {\n\t\tu: -660,\n\t\tc: [\n\t\t\t\"AS\",\n\t\t\t\"UM\"\n\t\t]\n\t},\n\t\"Pacific/Palau\": {\n\t\tu: 540,\n\t\tc: [\n\t\t\t\"PW\"\n\t\t]\n\t},\n\t\"Pacific/Pitcairn\": {\n\t\tu: -480,\n\t\tc: [\n\t\t\t\"PN\"\n\t\t]\n\t},\n\t\"Pacific/Pohnpei\": {\n\t\ta: \"Pacific/Guadalcanal\",\n\t\tc: [\n\t\t\t\"FM\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Pacific/Ponape\": {\n\t\ta: \"Pacific/Guadalcanal\",\n\t\tc: [\n\t\t\t\"FM\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Pacific/Port_Moresby\": {\n\t\tu: 600,\n\t\tc: [\n\t\t\t\"PG\",\n\t\t\t\"AQ\",\n\t\t\t\"FM\"\n\t\t]\n\t},\n\t\"Pacific/Rarotonga\": {\n\t\tu: -600,\n\t\tc: [\n\t\t\t\"CK\"\n\t\t]\n\t},\n\t\"Pacific/Saipan\": {\n\t\ta: \"Pacific/Guam\",\n\t\tc: [\n\t\t\t\"MP\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Pacific/Samoa\": {\n\t\ta: \"Pacific/Pago_Pago\",\n\t\tc: [\n\t\t\t\"AS\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Pacific/Tahiti\": {\n\t\tu: -600,\n\t\tc: [\n\t\t\t\"PF\"\n\t\t]\n\t},\n\t\"Pacific/Tarawa\": {\n\t\tu: 720,\n\t\tc: [\n\t\t\t\"KI\",\n\t\t\t\"MH\",\n\t\t\t\"TV\",\n\t\t\t\"UM\",\n\t\t\t\"WF\"\n\t\t]\n\t},\n\t\"Pacific/Tongatapu\": {\n\t\tu: 780,\n\t\tc: [\n\t\t\t\"TO\"\n\t\t]\n\t},\n\t\"Pacific/Truk\": {\n\t\ta: \"Pacific/Port_Moresby\",\n\t\tc: [\n\t\t\t\"FM\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Pacific/Wake\": {\n\t\ta: \"Pacific/Tarawa\",\n\t\tc: [\n\t\t\t\"UM\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Pacific/Wallis\": {\n\t\ta: \"Pacific/Tarawa\",\n\t\tc: [\n\t\t\t\"WF\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"Pacific/Yap\": {\n\t\ta: \"Pacific/Port_Moresby\",\n\t\tc: [\n\t\t\t\"FM\"\n\t\t],\n\t\tr: 1\n\t},\n\tPoland: {\n\t\ta: \"Europe/Warsaw\",\n\t\tr: 1\n\t},\n\tPortugal: {\n\t\ta: \"Europe/Lisbon\",\n\t\tr: 1\n\t},\n\tROC: {\n\t\ta: \"Asia/Taipei\",\n\t\tr: 1\n\t},\n\tROK: {\n\t\ta: \"Asia/Seoul\",\n\t\tr: 1\n\t},\n\tSingapore: {\n\t\ta: \"Asia/Singapore\",\n\t\tc: [\n\t\t\t\"SG\"\n\t\t],\n\t\tr: 1\n\t},\n\tTurkey: {\n\t\ta: \"Europe/Istanbul\",\n\t\tr: 1\n\t},\n\tUCT: {\n\t\ta: \"Etc/UTC\",\n\t\tr: 1\n\t},\n\t\"US/Alaska\": {\n\t\ta: \"America/Anchorage\",\n\t\tr: 1\n\t},\n\t\"US/Aleutian\": {\n\t\ta: \"America/Adak\",\n\t\tr: 1\n\t},\n\t\"US/Arizona\": {\n\t\ta: \"America/Phoenix\",\n\t\tc: [\n\t\t\t\"US\"\n\t\t],\n\t\tr: 1\n\t},\n\t\"US/Central\": {\n\t\ta: \"America/Chicago\",\n\t\tr: 1\n\t},\n\t\"US/East-Indiana\": {\n\t\ta: \"America/Indiana/Indianapolis\",\n\t\tr: 1\n\t},\n\t\"US/Eastern\": {\n\t\ta: \"America/New_York\",\n\t\tr: 1\n\t},\n\t\"US/Hawaii\": {\n\t\ta: \"Pacific/Honolulu\",\n\t\tr: 1\n\t},\n\t\"US/Indiana-Starke\": {\n\t\ta: \"America/Indiana/Knox\",\n\t\tr: 1\n\t},\n\t\"US/Michigan\": {\n\t\ta: \"America/Detroit\",\n\t\tr: 1\n\t},\n\t\"US/Mountain\": {\n\t\ta: \"America/Denver\",\n\t\tr: 1\n\t},\n\t\"US/Pacific\": {\n\t\ta: \"America/Los_Angeles\",\n\t\tr: 1\n\t},\n\t\"US/Samoa\": {\n\t\ta: \"Pacific/Pago_Pago\",\n\t\tc: [\n\t\t\t\"AS\"\n\t\t],\n\t\tr: 1\n\t},\n\tUTC: {\n\t\ta: \"Etc/UTC\",\n\t\tr: 1\n\t},\n\tUniversal: {\n\t\ta: \"Etc/UTC\",\n\t\tr: 1\n\t},\n\t\"W-SU\": {\n\t\ta: \"Europe/Moscow\",\n\t\tr: 1\n\t},\n\tWET: {\n\t\tu: 0,\n\t\td: 60\n\t},\n\tZulu: {\n\t\ta: \"Etc/UTC\",\n\t\tr: 1\n\t}\n};\nvar data = {\n\tcountries: countries$1,\n\ttimezones: timezones$1\n};\n\nvar timezonesMap;\nfunction buildCountry(data, id) {\n var name = data.countries[id];\n if (!name) return null;\n var tzMap = getTimezonesMap(data)[id] || {};\n return {\n id: id,\n name: name,\n timezones: tzMap.current || [],\n allTimezones: tzMap.all || []\n };\n}\nfunction getTimezonesMap(data) {\n if (!timezonesMap) timezonesMap = buildTimezonesMap(data);\n return timezonesMap;\n}\nfunction buildTimezonesMap(data) {\n return Object.keys(data.timezones).reduce(function (result, id) {\n var tz = data.timezones[id];\n var c = tz.c,\n a = tz.a;\n var aliasTz = data.timezones[a] || {};\n var countries = c || aliasTz.c;\n if (!countries) return result;\n countries.forEach(function (country) {\n if (!result[country]) Object.assign(result, _defineProperty({}, country, {\n current: [],\n all: []\n }));\n if (tz.r === undefined) result[country].current.push(id);\n result[country].all.push(id);\n });\n return result;\n }, {});\n}\n\nfunction buildTimezone(data, name) {\n var timezone = data.timezones[name];\n if (!timezone) return null;\n var _timezone$a = timezone.a,\n aliasOf = _timezone$a === void 0 ? null : _timezone$a;\n var aliasTz = aliasOf ? data.timezones[aliasOf] : {};\n var tz = _objectSpread2(_objectSpread2({}, aliasTz), data.timezones[name]);\n var countries = tz.c || [];\n var utcOffset = tz.u;\n var dstOffset = Number.isInteger(tz.d) ? tz.d : utcOffset;\n var result = {\n name: name,\n countries: countries,\n utcOffset: utcOffset,\n utcOffsetStr: getOffsetStr(utcOffset),\n dstOffset: dstOffset,\n dstOffsetStr: getOffsetStr(dstOffset),\n aliasOf: aliasOf\n };\n if (timezone.r) result.deprecated = true;\n return result;\n}\nfunction getOffsetStr(offset) {\n var hours = Math.floor(Math.abs(offset) / 60);\n var min = offset % 60;\n var sign = offset < 0 ? '-' : '+';\n return \"\".concat(sign).concat(getNumStr(hours), \":\").concat(getNumStr(min));\n}\nfunction getNumStr(input) {\n var num = Math.abs(input);\n var prefix = num < 10 ? '0' : '';\n return \"\".concat(prefix).concat(num);\n}\n\nvar _excluded = [\"allTimezones\"];\nvar totalTimezones = Object.keys(data.timezones).length;\nvar countries = {};\nvar timezones = {};\nvar memoizedTimezones = 0;\nfunction getAllCountries() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return Object.keys(data.countries).reduce(function (prev, id) {\n return Object.assign(prev, _defineProperty({}, id, getCountry(id, options)));\n }, {});\n}\nfunction getAllTimezones() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n if (totalTimezones !== memoizedTimezones) Object.keys(data.timezones).forEach(getTimezone);\n return deliverTimezones(timezones, options);\n}\nfunction getCountry(id) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (!countries[id]) memoizeCountry(buildCountry(data, id));\n return deliverCountry(countries[id], options);\n}\nfunction memoizeCountry(country) {\n if (!country) return;\n countries[country.id] = country;\n}\nfunction getTimezone(name) {\n if (!timezones[name]) memoizeTimezone(buildTimezone(data, name));\n return timezones[name] ? _objectSpread2({}, timezones[name]) : null;\n}\nfunction memoizeTimezone(timezone) {\n if (!timezone) return;\n timezones[timezone.name] = timezone;\n memoizedTimezones = Object.keys(timezone).length;\n}\nfunction getCountriesForTimezone(tzName) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var timezone = getTimezone(tzName) || {};\n var values = timezone.countries || [];\n return values.map(function (c) {\n return getCountry(c, options);\n });\n}\nfunction getCountryForTimezone(tzName) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var _getCountriesForTimez = getCountriesForTimezone(tzName, options),\n _getCountriesForTimez2 = _slicedToArray(_getCountriesForTimez, 1),\n main = _getCountriesForTimez2[0];\n return main || null;\n}\nfunction getTimezonesForCountry(countryId) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var country = getCountry(countryId, options);\n if (!country) return null;\n var values = country.timezones || [];\n return values.map(getTimezone);\n}\nfunction deliverTimezones(tzs, options) {\n var _ref = options || {},\n deprecated = _ref.deprecated;\n if (deprecated === true) return tzs;\n return Object.keys(tzs).reduce(function (prev, key) {\n if (!tzs[key].deprecated) Object.assign(prev, _defineProperty({}, key, tzs[key]));\n return prev;\n }, {});\n}\nfunction deliverCountry(country, options) {\n if (!country) return null;\n var _ref2 = options || {},\n deprecated = _ref2.deprecated;\n country.allTimezones;\n var other = _objectWithoutProperties(country, _excluded);\n var tz = deprecated ? country.allTimezones : country.timezones;\n return _objectSpread2(_objectSpread2({}, other), {}, {\n timezones: tz\n });\n}\nvar index = {\n getCountry: getCountry,\n getTimezone: getTimezone,\n getAllCountries: getAllCountries,\n getAllTimezones: getAllTimezones,\n getTimezonesForCountry: getTimezonesForCountry,\n getCountriesForTimezone: getCountriesForTimezone,\n getCountryForTimezone: getCountryForTimezone\n};\n\nexport { index as default, getAllCountries, getAllTimezones, getCountriesForTimezone, getCountry, getCountryForTimezone, getTimezone, getTimezonesForCountry };\n//# sourceMappingURL=index.js.map\n","import { getPhoneCodeByTimezone } from 'timezone-phone-codes';\nimport ct from 'countries-and-timezones';\n\nconst getTimezone = () => Intl.DateTimeFormat().resolvedOptions().timeZone;\n\nexport const getActiveDialCode = () => {\n return getPhoneCodeByTimezone(getTimezone()) || '';\n};\n\nexport const getActiveCountryCode = () => {\n const country = ct.getCountryForTimezone(getTimezone()) || {};\n return country.id || '';\n};\n","\n\n\n\n\n","\n\n\n\n\n","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name addDays\n * @category Day Helpers\n * @summary Add the specified number of days to the given date.\n *\n * @description\n * Add the specified number of days to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of days to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} - the new date with the days added\n * @throws {TypeError} - 2 arguments required\n *\n * @example\n * // Add 10 days to 1 September 2014:\n * const result = addDays(new Date(2014, 8, 1), 10)\n * //=> Thu Sep 11 2014 00:00:00\n */\n\nexport default function addDays(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var amount = toInteger(dirtyAmount);\n\n if (isNaN(amount)) {\n return new Date(NaN);\n }\n\n if (!amount) {\n // If 0 days, no-op to avoid changing times in the hour before end of DST\n return date;\n }\n\n date.setDate(date.getDate() + amount);\n return date;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name compareAsc\n * @category Common Helpers\n * @summary Compare the two dates and return -1, 0 or 1.\n *\n * @description\n * Compare the two dates and return 1 if the first date is after the second,\n * -1 if the first date is before the second or 0 if dates are equal.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the first date to compare\n * @param {Date|Number} dateRight - the second date to compare\n * @returns {Number} the result of the comparison\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Compare 11 February 1987 and 10 July 1989:\n * const result = compareAsc(new Date(1987, 1, 11), new Date(1989, 6, 10))\n * //=> -1\n *\n * @example\n * // Sort the array of dates:\n * const result = [\n * new Date(1995, 6, 2),\n * new Date(1987, 1, 11),\n * new Date(1989, 6, 10)\n * ].sort(compareAsc)\n * //=> [\n * // Wed Feb 11 1987 00:00:00,\n * // Mon Jul 10 1989 00:00:00,\n * // Sun Jul 02 1995 00:00:00\n * // ]\n */\n\nexport default function compareAsc(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n var diff = dateLeft.getTime() - dateRight.getTime();\n\n if (diff < 0) {\n return -1;\n } else if (diff > 0) {\n return 1; // Return 0 if diff is 0; return NaN if diff is NaN\n } else {\n return diff;\n }\n}","import startOfDay from \"../startOfDay/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isSameDay\n * @category Day Helpers\n * @summary Are the given dates in the same day?\n *\n * @description\n * Are the given dates in the same day?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the first date to check\n * @param {Date|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same day\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Are 4 September 06:00:00 and 4 September 18:00:00 in the same day?\n * var result = isSameDay(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 18, 0))\n * //=> true\n */\n\nexport default function isSameDay(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeftStartOfDay = startOfDay(dirtyDateLeft);\n var dateRightStartOfDay = startOfDay(dirtyDateRight);\n return dateLeftStartOfDay.getTime() === dateRightStartOfDay.getTime();\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name differenceInCalendarMonths\n * @category Month Helpers\n * @summary Get the number of calendar months between the given dates.\n *\n * @description\n * Get the number of calendar months between the given dates.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of calendar months\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many calendar months are between 31 January 2014 and 1 September 2014?\n * var result = differenceInCalendarMonths(\n * new Date(2014, 8, 1),\n * new Date(2014, 0, 31)\n * )\n * //=> 8\n */\n\nexport default function differenceInCalendarMonths(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n var yearDiff = dateLeft.getFullYear() - dateRight.getFullYear();\n var monthDiff = dateLeft.getMonth() - dateRight.getMonth();\n return yearDiff * 12 + monthDiff;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name differenceInMilliseconds\n * @category Millisecond Helpers\n * @summary Get the number of milliseconds between the given dates.\n *\n * @description\n * Get the number of milliseconds between the given dates.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of milliseconds\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many milliseconds are between\n * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?\n * var result = differenceInMilliseconds(\n * new Date(2014, 6, 2, 12, 30, 21, 700),\n * new Date(2014, 6, 2, 12, 30, 20, 600)\n * )\n * //=> 1100\n */\n\nexport default function differenceInMilliseconds(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n return dateLeft.getTime() - dateRight.getTime();\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name endOfDay\n * @category Day Helpers\n * @summary Return the end of a day for the given date.\n *\n * @description\n * Return the end of a day for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of a day\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The end of a day for 2 September 2014 11:55:00:\n * const result = endOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 23:59:59.999\n */\n\nexport default function endOfDay(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n date.setHours(23, 59, 59, 999);\n return date;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name endOfMonth\n * @category Month Helpers\n * @summary Return the end of a month for the given date.\n *\n * @description\n * Return the end of a month for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of a month\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The end of a month for 2 September 2014 11:55:00:\n * const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 30 2014 23:59:59.999\n */\n\nexport default function endOfMonth(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var month = date.getMonth();\n date.setFullYear(date.getFullYear(), month + 1, 0);\n date.setHours(23, 59, 59, 999);\n return date;\n}","import toDate from \"../toDate/index.js\";\nimport endOfDay from \"../endOfDay/index.js\";\nimport endOfMonth from \"../endOfMonth/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isLastDayOfMonth\n * @category Month Helpers\n * @summary Is the given date the last day of a month?\n *\n * @description\n * Is the given date the last day of a month?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is the last day of a month\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Is 28 February 2014 the last day of a month?\n * var result = isLastDayOfMonth(new Date(2014, 1, 28))\n * //=> true\n */\n\nexport default function isLastDayOfMonth(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n return endOfDay(date).getTime() === endOfMonth(date).getTime();\n}","import toDate from \"../toDate/index.js\";\nimport differenceInCalendarMonths from \"../differenceInCalendarMonths/index.js\";\nimport compareAsc from \"../compareAsc/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport isLastDayOfMonth from \"../isLastDayOfMonth/index.js\";\n/**\n * @name differenceInMonths\n * @category Month Helpers\n * @summary Get the number of full months between the given dates.\n *\n * @description\n * Get the number of full months between the given dates.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of full months\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many full months are between 31 January 2014 and 1 September 2014?\n * var result = differenceInMonths(new Date(2014, 8, 1), new Date(2014, 0, 31))\n * //=> 7\n */\n\nexport default function differenceInMonths(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n var sign = compareAsc(dateLeft, dateRight);\n var difference = Math.abs(differenceInCalendarMonths(dateLeft, dateRight));\n var result; // Check for the difference of less than month\n\n if (difference < 1) {\n result = 0;\n } else {\n if (dateLeft.getMonth() === 1 && dateLeft.getDate() > 27) {\n // This will check if the date is end of Feb and assign a higher end of month date\n // to compare it with Jan\n dateLeft.setDate(30);\n }\n\n dateLeft.setMonth(dateLeft.getMonth() - sign * difference); // Math.abs(diff in full months - diff in calendar months) === 1 if last calendar month is not full\n // If so, result must be decreased by 1 in absolute value\n\n var isLastMonthNotFull = compareAsc(dateLeft, dateRight) === -sign; // Check for cases of one full calendar month\n\n if (isLastDayOfMonth(toDate(dirtyDateLeft)) && difference === 1 && compareAsc(dirtyDateLeft, dateRight) === 1) {\n isLastMonthNotFull = false;\n }\n\n result = sign * (difference - isLastMonthNotFull);\n } // Prevent negative zero\n\n\n return result === 0 ? 0 : result;\n}","import differenceInMilliseconds from \"../differenceInMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name differenceInSeconds\n * @category Second Helpers\n * @summary Get the number of seconds between the given dates.\n *\n * @description\n * Get the number of seconds between the given dates.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of seconds\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many seconds are between\n * // 2 July 2014 12:30:07.999 and 2 July 2014 12:30:20.000?\n * var result = differenceInSeconds(\n * new Date(2014, 6, 2, 12, 30, 20, 0),\n * new Date(2014, 6, 2, 12, 30, 7, 999)\n * )\n * //=> 12\n */\n\nexport default function differenceInSeconds(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var diff = differenceInMilliseconds(dirtyDateLeft, dirtyDateRight) / 1000;\n return diff > 0 ? Math.floor(diff) : Math.ceil(diff);\n}","export default function assign(target, dirtyObject) {\n if (target == null) {\n throw new TypeError('assign requires that input parameter not be null or undefined');\n }\n\n dirtyObject = dirtyObject || {};\n\n for (var property in dirtyObject) {\n if (dirtyObject.hasOwnProperty(property)) {\n target[property] = dirtyObject[property];\n }\n }\n\n return target;\n}","import assign from \"../assign/index.js\";\nexport default function cloneObject(dirtyObject) {\n return assign({}, dirtyObject);\n}","import compareAsc from \"../compareAsc/index.js\";\nimport differenceInMonths from \"../differenceInMonths/index.js\";\nimport differenceInSeconds from \"../differenceInSeconds/index.js\";\nimport defaultLocale from \"../locale/en-US/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport cloneObject from \"../_lib/cloneObject/index.js\";\nimport getTimezoneOffsetInMilliseconds from \"../_lib/getTimezoneOffsetInMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nvar MINUTES_IN_DAY = 1440;\nvar MINUTES_IN_ALMOST_TWO_DAYS = 2520;\nvar MINUTES_IN_MONTH = 43200;\nvar MINUTES_IN_TWO_MONTHS = 86400;\n/**\n * @name formatDistance\n * @category Common Helpers\n * @summary Return the distance between the given dates in words.\n *\n * @description\n * Return the distance between the given dates in words.\n *\n * | Distance between dates | Result |\n * |-------------------------------------------------------------------|---------------------|\n * | 0 ... 30 secs | less than a minute |\n * | 30 secs ... 1 min 30 secs | 1 minute |\n * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes |\n * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour |\n * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours |\n * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day |\n * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days |\n * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month |\n * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months |\n * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months |\n * | 1 yr ... 1 yr 3 months | about 1 year |\n * | 1 yr 3 months ... 1 yr 9 month s | over 1 year |\n * | 1 yr 9 months ... 2 yrs | almost 2 years |\n * | N yrs ... N yrs 3 months | about N years |\n * | N yrs 3 months ... N yrs 9 months | over N years |\n * | N yrs 9 months ... N+1 yrs | almost N+1 years |\n *\n * With `options.includeSeconds == true`:\n * | Distance between dates | Result |\n * |------------------------|----------------------|\n * | 0 secs ... 5 secs | less than 5 seconds |\n * | 5 secs ... 10 secs | less than 10 seconds |\n * | 10 secs ... 20 secs | less than 20 seconds |\n * | 20 secs ... 40 secs | half a minute |\n * | 40 secs ... 60 secs | less than a minute |\n * | 60 secs ... 90 secs | 1 minute |\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The function was renamed from `distanceInWords ` to `formatDistance`\n * to make its name consistent with `format` and `formatRelative`.\n *\n * - The order of arguments is swapped to make the function\n * consistent with `differenceIn...` functions.\n *\n * ```javascript\n * // Before v2.0.0\n *\n * distanceInWords(\n * new Date(1986, 3, 4, 10, 32, 0),\n * new Date(1986, 3, 4, 11, 32, 0),\n * { addSuffix: true }\n * ) //=> 'in about 1 hour'\n *\n * // v2.0.0 onward\n *\n * formatDistance(\n * new Date(1986, 3, 4, 11, 32, 0),\n * new Date(1986, 3, 4, 10, 32, 0),\n * { addSuffix: true }\n * ) //=> 'in about 1 hour'\n * ```\n *\n * @param {Date|Number} date - the date\n * @param {Date|Number} baseDate - the date to compare with\n * @param {Object} [options] - an object with options.\n * @param {Boolean} [options.includeSeconds=false] - distances less than a minute are more detailed\n * @param {Boolean} [options.addSuffix=false] - result indicates if the second date is earlier or later than the first\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @returns {String} the distance in words\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `date` must not be Invalid Date\n * @throws {RangeError} `baseDate` must not be Invalid Date\n * @throws {RangeError} `options.locale` must contain `formatDistance` property\n *\n * @example\n * // What is the distance between 2 July 2014 and 1 January 2015?\n * var result = formatDistance(new Date(2014, 6, 2), new Date(2015, 0, 1))\n * //=> '6 months'\n *\n * @example\n * // What is the distance between 1 January 2015 00:00:15\n * // and 1 January 2015 00:00:00, including seconds?\n * var result = formatDistance(\n * new Date(2015, 0, 1, 0, 0, 15),\n * new Date(2015, 0, 1, 0, 0, 0),\n * { includeSeconds: true }\n * )\n * //=> 'less than 20 seconds'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 1 January 2015, with a suffix?\n * var result = formatDistance(new Date(2015, 0, 1), new Date(2016, 0, 1), {\n * addSuffix: true\n * })\n * //=> 'about 1 year ago'\n *\n * @example\n * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto?\n * import { eoLocale } from 'date-fns/locale/eo'\n * var result = formatDistance(new Date(2016, 7, 1), new Date(2015, 0, 1), {\n * locale: eoLocale\n * })\n * //=> 'pli ol 1 jaro'\n */\n\nexport default function formatDistance(dirtyDate, dirtyBaseDate, dirtyOptions) {\n requiredArgs(2, arguments);\n var options = dirtyOptions || {};\n var locale = options.locale || defaultLocale;\n\n if (!locale.formatDistance) {\n throw new RangeError('locale must contain formatDistance property');\n }\n\n var comparison = compareAsc(dirtyDate, dirtyBaseDate);\n\n if (isNaN(comparison)) {\n throw new RangeError('Invalid time value');\n }\n\n var localizeOptions = cloneObject(options);\n localizeOptions.addSuffix = Boolean(options.addSuffix);\n localizeOptions.comparison = comparison;\n var dateLeft;\n var dateRight;\n\n if (comparison > 0) {\n dateLeft = toDate(dirtyBaseDate);\n dateRight = toDate(dirtyDate);\n } else {\n dateLeft = toDate(dirtyDate);\n dateRight = toDate(dirtyBaseDate);\n }\n\n var seconds = differenceInSeconds(dateRight, dateLeft);\n var offsetInSeconds = (getTimezoneOffsetInMilliseconds(dateRight) - getTimezoneOffsetInMilliseconds(dateLeft)) / 1000;\n var minutes = Math.round((seconds - offsetInSeconds) / 60);\n var months; // 0 up to 2 mins\n\n if (minutes < 2) {\n if (options.includeSeconds) {\n if (seconds < 5) {\n return locale.formatDistance('lessThanXSeconds', 5, localizeOptions);\n } else if (seconds < 10) {\n return locale.formatDistance('lessThanXSeconds', 10, localizeOptions);\n } else if (seconds < 20) {\n return locale.formatDistance('lessThanXSeconds', 20, localizeOptions);\n } else if (seconds < 40) {\n return locale.formatDistance('halfAMinute', null, localizeOptions);\n } else if (seconds < 60) {\n return locale.formatDistance('lessThanXMinutes', 1, localizeOptions);\n } else {\n return locale.formatDistance('xMinutes', 1, localizeOptions);\n }\n } else {\n if (minutes === 0) {\n return locale.formatDistance('lessThanXMinutes', 1, localizeOptions);\n } else {\n return locale.formatDistance('xMinutes', minutes, localizeOptions);\n }\n } // 2 mins up to 0.75 hrs\n\n } else if (minutes < 45) {\n return locale.formatDistance('xMinutes', minutes, localizeOptions); // 0.75 hrs up to 1.5 hrs\n } else if (minutes < 90) {\n return locale.formatDistance('aboutXHours', 1, localizeOptions); // 1.5 hrs up to 24 hrs\n } else if (minutes < MINUTES_IN_DAY) {\n var hours = Math.round(minutes / 60);\n return locale.formatDistance('aboutXHours', hours, localizeOptions); // 1 day up to 1.75 days\n } else if (minutes < MINUTES_IN_ALMOST_TWO_DAYS) {\n return locale.formatDistance('xDays', 1, localizeOptions); // 1.75 days up to 30 days\n } else if (minutes < MINUTES_IN_MONTH) {\n var days = Math.round(minutes / MINUTES_IN_DAY);\n return locale.formatDistance('xDays', days, localizeOptions); // 1 month up to 2 months\n } else if (minutes < MINUTES_IN_TWO_MONTHS) {\n months = Math.round(minutes / MINUTES_IN_MONTH);\n return locale.formatDistance('aboutXMonths', months, localizeOptions);\n }\n\n months = differenceInMonths(dateRight, dateLeft); // 2 months up to 12 months\n\n if (months < 12) {\n var nearestMonth = Math.round(minutes / MINUTES_IN_MONTH);\n return locale.formatDistance('xMonths', nearestMonth, localizeOptions); // 1 year up to max Date\n } else {\n var monthsSinceStartOfYear = months % 12;\n var years = Math.floor(months / 12); // N years up to 1 years 3 months\n\n if (monthsSinceStartOfYear < 3) {\n return locale.formatDistance('aboutXYears', years, localizeOptions); // N years 3 months up to N years 9 months\n } else if (monthsSinceStartOfYear < 9) {\n return locale.formatDistance('overXYears', years, localizeOptions); // N years 9 months up to N year 12 months\n } else {\n return locale.formatDistance('almostXYears', years + 1, localizeOptions);\n }\n }\n}","import distanceInWords from \"../formatDistance/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name formatDistanceToNow\n * @category Common Helpers\n * @summary Return the distance between the given date and now in words.\n * @pure false\n *\n * @description\n * Return the distance between the given date and now in words.\n *\n * | Distance to now | Result |\n * |-------------------------------------------------------------------|---------------------|\n * | 0 ... 30 secs | less than a minute |\n * | 30 secs ... 1 min 30 secs | 1 minute |\n * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes |\n * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour |\n * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours |\n * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day |\n * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days |\n * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month |\n * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months |\n * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months |\n * | 1 yr ... 1 yr 3 months | about 1 year |\n * | 1 yr 3 months ... 1 yr 9 month s | over 1 year |\n * | 1 yr 9 months ... 2 yrs | almost 2 years |\n * | N yrs ... N yrs 3 months | about N years |\n * | N yrs 3 months ... N yrs 9 months | over N years |\n * | N yrs 9 months ... N+1 yrs | almost N+1 years |\n *\n * With `options.includeSeconds == true`:\n * | Distance to now | Result |\n * |---------------------|----------------------|\n * | 0 secs ... 5 secs | less than 5 seconds |\n * | 5 secs ... 10 secs | less than 10 seconds |\n * | 10 secs ... 20 secs | less than 20 seconds |\n * | 20 secs ... 40 secs | half a minute |\n * | 40 secs ... 60 secs | less than a minute |\n * | 60 secs ... 90 secs | 1 minute |\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The function was renamed from `distanceInWordsToNow ` to `formatDistanceToNow`\n * to make its name consistent with `format` and `formatRelative`.\n *\n * ```javascript\n * // Before v2.0.0\n *\n * distanceInWordsToNow(new Date(2014, 6, 2), { addSuffix: true })\n * //=> 'in 6 months'\n *\n * // v2.0.0 onward\n *\n * formatDistanceToNow(new Date(2014, 6, 2), { addSuffix: true })\n * //=> 'in 6 months'\n * ```\n *\n * @param {Date|Number} date - the given date\n * @param {Object} [options] - the object with options\n * @param {Boolean} [options.includeSeconds=false] - distances less than a minute are more detailed\n * @param {Boolean} [options.addSuffix=false] - result specifies if now is earlier or later than the passed date\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @returns {String} the distance in words\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `date` must not be Invalid Date\n * @throws {RangeError} `options.locale` must contain `formatDistance` property\n *\n * @example\n * // If today is 1 January 2015, what is the distance to 2 July 2014?\n * var result = formatDistanceToNow(\n * new Date(2014, 6, 2)\n * )\n * //=> '6 months'\n *\n * @example\n * // If now is 1 January 2015 00:00:00,\n * // what is the distance to 1 January 2015 00:00:15, including seconds?\n * var result = formatDistanceToNow(\n * new Date(2015, 0, 1, 0, 0, 15),\n * {includeSeconds: true}\n * )\n * //=> 'less than 20 seconds'\n *\n * @example\n * // If today is 1 January 2015,\n * // what is the distance to 1 January 2016, with a suffix?\n * var result = formatDistanceToNow(\n * new Date(2016, 0, 1),\n * {addSuffix: true}\n * )\n * //=> 'in about 1 year'\n *\n * @example\n * // If today is 1 January 2015,\n * // what is the distance to 1 August 2016 in Esperanto?\n * var eoLocale = require('date-fns/locale/eo')\n * var result = formatDistanceToNow(\n * new Date(2016, 7, 1),\n * {locale: eoLocale}\n * )\n * //=> 'pli ol 1 jaro'\n */\n\nexport default function formatDistanceToNow(dirtyDate, dirtyOptions) {\n requiredArgs(1, arguments);\n return distanceInWords(dirtyDate, Date.now(), dirtyOptions);\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name getHours\n * @category Hour Helpers\n * @summary Get the hours of the given date.\n *\n * @description\n * Get the hours of the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the hours\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Get the hours of 29 February 2012 11:45:00:\n * const result = getHours(new Date(2012, 1, 29, 11, 45))\n * //=> 11\n */\n\nexport default function getHours(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var hours = date.getHours();\n return hours;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name getMinutes\n * @category Minute Helpers\n * @summary Get the minutes of the given date.\n *\n * @description\n * Get the minutes of the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the minutes\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Get the minutes of 29 February 2012 11:45:05:\n * const result = getMinutes(new Date(2012, 1, 29, 11, 45, 5))\n * //=> 45\n */\n\nexport default function getMinutes(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var minutes = date.getMinutes();\n return minutes;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name getTime\n * @category Timestamp Helpers\n * @summary Get the milliseconds timestamp of the given date.\n *\n * @description\n * Get the milliseconds timestamp of the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the timestamp\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Get the timestamp of 29 February 2012 11:45:05.123:\n * const result = getTime(new Date(2012, 1, 29, 11, 45, 5, 123))\n * //=> 1330515905123\n */\n\nexport default function getTime(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var timestamp = date.getTime();\n return timestamp;\n}","import getTime from \"../getTime/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name getUnixTime\n * @category Timestamp Helpers\n * @summary Get the seconds timestamp of the given date.\n *\n * @description\n * Get the seconds timestamp of the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the timestamp\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Get the timestamp of 29 February 2012 11:45:05 CET:\n * const result = getUnixTime(new Date(2012, 1, 29, 11, 45, 5))\n * //=> 1330512305\n */\n\nexport default function getUnixTime(dirtyDate) {\n requiredArgs(1, arguments);\n return Math.floor(getTime(dirtyDate) / 1000);\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport addDays from \"../addDays/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name subDays\n * @category Day Helpers\n * @summary Subtract the specified number of days from the given date.\n *\n * @description\n * Subtract the specified number of days from the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of days to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the days subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 10 days from 1 September 2014:\n * const result = subDays(new Date(2014, 8, 1), 10)\n * //=> Fri Aug 22 2014 00:00:00\n */\n\nexport default function subDays(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addDays(dirtyDate, -amount);\n}","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function setUTCDay(dirtyDate, dirtyDay, dirtyOptions) {\n requiredArgs(2, arguments);\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n var date = toDate(dirtyDate);\n var day = toInteger(dirtyDay);\n var currentDay = date.getUTCDay();\n var remainder = day % 7;\n var dayIndex = (remainder + 7) % 7;\n var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;\n date.setUTCDate(date.getUTCDate() + diff);\n return date;\n}","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function setUTCISODay(dirtyDate, dirtyDay) {\n requiredArgs(2, arguments);\n var day = toInteger(dirtyDay);\n\n if (day % 7 === 0) {\n day = day - 7;\n }\n\n var weekStartsOn = 1;\n var date = toDate(dirtyDate);\n var currentDay = date.getUTCDay();\n var remainder = day % 7;\n var dayIndex = (remainder + 7) % 7;\n var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;\n date.setUTCDate(date.getUTCDate() + diff);\n return date;\n}","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport getUTCISOWeek from \"../getUTCISOWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function setUTCISOWeek(dirtyDate, dirtyISOWeek) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var isoWeek = toInteger(dirtyISOWeek);\n var diff = getUTCISOWeek(date) - isoWeek;\n date.setUTCDate(date.getUTCDate() - diff * 7);\n return date;\n}","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport getUTCWeek from \"../getUTCWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function setUTCWeek(dirtyDate, dirtyWeek, options) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var week = toInteger(dirtyWeek);\n var diff = getUTCWeek(date, options) - week;\n date.setUTCDate(date.getUTCDate() - diff * 7);\n return date;\n}","import getUTCWeekYear from \"../../../_lib/getUTCWeekYear/index.js\";\nimport setUTCDay from \"../../../_lib/setUTCDay/index.js\";\nimport setUTCISODay from \"../../../_lib/setUTCISODay/index.js\";\nimport setUTCISOWeek from \"../../../_lib/setUTCISOWeek/index.js\";\nimport setUTCWeek from \"../../../_lib/setUTCWeek/index.js\";\nimport startOfUTCISOWeek from \"../../../_lib/startOfUTCISOWeek/index.js\";\nimport startOfUTCWeek from \"../../../_lib/startOfUTCWeek/index.js\";\nvar MILLISECONDS_IN_HOUR = 3600000;\nvar MILLISECONDS_IN_MINUTE = 60000;\nvar MILLISECONDS_IN_SECOND = 1000;\nvar numericPatterns = {\n month: /^(1[0-2]|0?\\d)/,\n // 0 to 12\n date: /^(3[0-1]|[0-2]?\\d)/,\n // 0 to 31\n dayOfYear: /^(36[0-6]|3[0-5]\\d|[0-2]?\\d?\\d)/,\n // 0 to 366\n week: /^(5[0-3]|[0-4]?\\d)/,\n // 0 to 53\n hour23h: /^(2[0-3]|[0-1]?\\d)/,\n // 0 to 23\n hour24h: /^(2[0-4]|[0-1]?\\d)/,\n // 0 to 24\n hour11h: /^(1[0-1]|0?\\d)/,\n // 0 to 11\n hour12h: /^(1[0-2]|0?\\d)/,\n // 0 to 12\n minute: /^[0-5]?\\d/,\n // 0 to 59\n second: /^[0-5]?\\d/,\n // 0 to 59\n singleDigit: /^\\d/,\n // 0 to 9\n twoDigits: /^\\d{1,2}/,\n // 0 to 99\n threeDigits: /^\\d{1,3}/,\n // 0 to 999\n fourDigits: /^\\d{1,4}/,\n // 0 to 9999\n anyDigitsSigned: /^-?\\d+/,\n singleDigitSigned: /^-?\\d/,\n // 0 to 9, -0 to -9\n twoDigitsSigned: /^-?\\d{1,2}/,\n // 0 to 99, -0 to -99\n threeDigitsSigned: /^-?\\d{1,3}/,\n // 0 to 999, -0 to -999\n fourDigitsSigned: /^-?\\d{1,4}/ // 0 to 9999, -0 to -9999\n\n};\nvar timezonePatterns = {\n basicOptionalMinutes: /^([+-])(\\d{2})(\\d{2})?|Z/,\n basic: /^([+-])(\\d{2})(\\d{2})|Z/,\n basicOptionalSeconds: /^([+-])(\\d{2})(\\d{2})((\\d{2}))?|Z/,\n extended: /^([+-])(\\d{2}):(\\d{2})|Z/,\n extendedOptionalSeconds: /^([+-])(\\d{2}):(\\d{2})(:(\\d{2}))?|Z/\n};\n\nfunction parseNumericPattern(pattern, string, valueCallback) {\n var matchResult = string.match(pattern);\n\n if (!matchResult) {\n return null;\n }\n\n var value = parseInt(matchResult[0], 10);\n return {\n value: valueCallback ? valueCallback(value) : value,\n rest: string.slice(matchResult[0].length)\n };\n}\n\nfunction parseTimezonePattern(pattern, string) {\n var matchResult = string.match(pattern);\n\n if (!matchResult) {\n return null;\n } // Input is 'Z'\n\n\n if (matchResult[0] === 'Z') {\n return {\n value: 0,\n rest: string.slice(1)\n };\n }\n\n var sign = matchResult[1] === '+' ? 1 : -1;\n var hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;\n var minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;\n var seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;\n return {\n value: sign * (hours * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE + seconds * MILLISECONDS_IN_SECOND),\n rest: string.slice(matchResult[0].length)\n };\n}\n\nfunction parseAnyDigitsSigned(string, valueCallback) {\n return parseNumericPattern(numericPatterns.anyDigitsSigned, string, valueCallback);\n}\n\nfunction parseNDigits(n, string, valueCallback) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigit, string, valueCallback);\n\n case 2:\n return parseNumericPattern(numericPatterns.twoDigits, string, valueCallback);\n\n case 3:\n return parseNumericPattern(numericPatterns.threeDigits, string, valueCallback);\n\n case 4:\n return parseNumericPattern(numericPatterns.fourDigits, string, valueCallback);\n\n default:\n return parseNumericPattern(new RegExp('^\\\\d{1,' + n + '}'), string, valueCallback);\n }\n}\n\nfunction parseNDigitsSigned(n, string, valueCallback) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigitSigned, string, valueCallback);\n\n case 2:\n return parseNumericPattern(numericPatterns.twoDigitsSigned, string, valueCallback);\n\n case 3:\n return parseNumericPattern(numericPatterns.threeDigitsSigned, string, valueCallback);\n\n case 4:\n return parseNumericPattern(numericPatterns.fourDigitsSigned, string, valueCallback);\n\n default:\n return parseNumericPattern(new RegExp('^-?\\\\d{1,' + n + '}'), string, valueCallback);\n }\n}\n\nfunction dayPeriodEnumToHours(enumValue) {\n switch (enumValue) {\n case 'morning':\n return 4;\n\n case 'evening':\n return 17;\n\n case 'pm':\n case 'noon':\n case 'afternoon':\n return 12;\n\n case 'am':\n case 'midnight':\n case 'night':\n default:\n return 0;\n }\n}\n\nfunction normalizeTwoDigitYear(twoDigitYear, currentYear) {\n var isCommonEra = currentYear > 0; // Absolute number of the current year:\n // 1 -> 1 AC\n // 0 -> 1 BC\n // -1 -> 2 BC\n\n var absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;\n var result;\n\n if (absCurrentYear <= 50) {\n result = twoDigitYear || 100;\n } else {\n var rangeEnd = absCurrentYear + 50;\n var rangeEndCentury = Math.floor(rangeEnd / 100) * 100;\n var isPreviousCentury = twoDigitYear >= rangeEnd % 100;\n result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);\n }\n\n return isCommonEra ? result : 1 - result;\n}\n\nvar DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nvar DAYS_IN_MONTH_LEAP_YEAR = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; // User for validation\n\nfunction isLeapYearIndex(year) {\n return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;\n}\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O* | Timezone (GMT) |\n * | p | | P | |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z* | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `parse` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n */\n\n\nvar parsers = {\n // Era\n G: {\n priority: 140,\n parse: function (string, token, match, _options) {\n switch (token) {\n // AD, BC\n case 'G':\n case 'GG':\n case 'GGG':\n return match.era(string, {\n width: 'abbreviated'\n }) || match.era(string, {\n width: 'narrow'\n });\n // A, B\n\n case 'GGGGG':\n return match.era(string, {\n width: 'narrow'\n });\n // Anno Domini, Before Christ\n\n case 'GGGG':\n default:\n return match.era(string, {\n width: 'wide'\n }) || match.era(string, {\n width: 'abbreviated'\n }) || match.era(string, {\n width: 'narrow'\n });\n }\n },\n set: function (date, flags, value, _options) {\n flags.era = value;\n date.setUTCFullYear(value, 0, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['R', 'u', 't', 'T']\n },\n // Year\n y: {\n // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns\n // | Year | y | yy | yyy | yyyy | yyyyy |\n // |----------|-------|----|-------|-------|-------|\n // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\n priority: 130,\n parse: function (string, token, match, _options) {\n var valueCallback = function (year) {\n return {\n year: year,\n isTwoDigitYear: token === 'yy'\n };\n };\n\n switch (token) {\n case 'y':\n return parseNDigits(4, string, valueCallback);\n\n case 'yo':\n return match.ordinalNumber(string, {\n unit: 'year',\n valueCallback: valueCallback\n });\n\n default:\n return parseNDigits(token.length, string, valueCallback);\n }\n },\n validate: function (_date, value, _options) {\n return value.isTwoDigitYear || value.year > 0;\n },\n set: function (date, flags, value, _options) {\n var currentYear = date.getUTCFullYear();\n\n if (value.isTwoDigitYear) {\n var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);\n date.setUTCFullYear(normalizedTwoDigitYear, 0, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n }\n\n var year = !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setUTCFullYear(year, 0, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'u', 'w', 'I', 'i', 'e', 'c', 't', 'T']\n },\n // Local week-numbering year\n Y: {\n priority: 130,\n parse: function (string, token, match, _options) {\n var valueCallback = function (year) {\n return {\n year: year,\n isTwoDigitYear: token === 'YY'\n };\n };\n\n switch (token) {\n case 'Y':\n return parseNDigits(4, string, valueCallback);\n\n case 'Yo':\n return match.ordinalNumber(string, {\n unit: 'year',\n valueCallback: valueCallback\n });\n\n default:\n return parseNDigits(token.length, string, valueCallback);\n }\n },\n validate: function (_date, value, _options) {\n return value.isTwoDigitYear || value.year > 0;\n },\n set: function (date, flags, value, options) {\n var currentYear = getUTCWeekYear(date, options);\n\n if (value.isTwoDigitYear) {\n var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);\n date.setUTCFullYear(normalizedTwoDigitYear, 0, options.firstWeekContainsDate);\n date.setUTCHours(0, 0, 0, 0);\n return startOfUTCWeek(date, options);\n }\n\n var year = !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setUTCFullYear(year, 0, options.firstWeekContainsDate);\n date.setUTCHours(0, 0, 0, 0);\n return startOfUTCWeek(date, options);\n },\n incompatibleTokens: ['y', 'R', 'u', 'Q', 'q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']\n },\n // ISO week-numbering year\n R: {\n priority: 130,\n parse: function (string, token, _match, _options) {\n if (token === 'R') {\n return parseNDigitsSigned(4, string);\n }\n\n return parseNDigitsSigned(token.length, string);\n },\n set: function (_date, _flags, value, _options) {\n var firstWeekOfYear = new Date(0);\n firstWeekOfYear.setUTCFullYear(value, 0, 4);\n firstWeekOfYear.setUTCHours(0, 0, 0, 0);\n return startOfUTCISOWeek(firstWeekOfYear);\n },\n incompatibleTokens: ['G', 'y', 'Y', 'u', 'Q', 'q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']\n },\n // Extended year\n u: {\n priority: 130,\n parse: function (string, token, _match, _options) {\n if (token === 'u') {\n return parseNDigitsSigned(4, string);\n }\n\n return parseNDigitsSigned(token.length, string);\n },\n set: function (date, _flags, value, _options) {\n date.setUTCFullYear(value, 0, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['G', 'y', 'Y', 'R', 'w', 'I', 'i', 'e', 'c', 't', 'T']\n },\n // Quarter\n Q: {\n priority: 120,\n parse: function (string, token, match, _options) {\n switch (token) {\n // 1, 2, 3, 4\n case 'Q':\n case 'QQ':\n // 01, 02, 03, 04\n return parseNDigits(token.length, string);\n // 1st, 2nd, 3rd, 4th\n\n case 'Qo':\n return match.ordinalNumber(string, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\n case 'QQQ':\n return match.quarter(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.quarter(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n\n case 'QQQQQ':\n return match.quarter(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'QQQQ':\n default:\n return match.quarter(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.quarter(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.quarter(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 4;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth((value - 1) * 3, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Stand-alone quarter\n q: {\n priority: 120,\n parse: function (string, token, match, _options) {\n switch (token) {\n // 1, 2, 3, 4\n case 'q':\n case 'qq':\n // 01, 02, 03, 04\n return parseNDigits(token.length, string);\n // 1st, 2nd, 3rd, 4th\n\n case 'qo':\n return match.ordinalNumber(string, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\n case 'qqq':\n return match.quarter(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.quarter(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n\n case 'qqqqq':\n return match.quarter(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'qqqq':\n default:\n return match.quarter(string, {\n width: 'wide',\n context: 'standalone'\n }) || match.quarter(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.quarter(string, {\n width: 'narrow',\n context: 'standalone'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 4;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth((value - 1) * 3, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'Q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Month\n M: {\n priority: 110,\n parse: function (string, token, match, _options) {\n var valueCallback = function (value) {\n return value - 1;\n };\n\n switch (token) {\n // 1, 2, ..., 12\n case 'M':\n return parseNumericPattern(numericPatterns.month, string, valueCallback);\n // 01, 02, ..., 12\n\n case 'MM':\n return parseNDigits(2, string, valueCallback);\n // 1st, 2nd, ..., 12th\n\n case 'Mo':\n return match.ordinalNumber(string, {\n unit: 'month',\n valueCallback: valueCallback\n });\n // Jan, Feb, ..., Dec\n\n case 'MMM':\n return match.month(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.month(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // J, F, ..., D\n\n case 'MMMMM':\n return match.month(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // January, February, ..., December\n\n case 'MMMM':\n default:\n return match.month(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.month(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.month(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 11;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth(value, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'L', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Stand-alone month\n L: {\n priority: 110,\n parse: function (string, token, match, _options) {\n var valueCallback = function (value) {\n return value - 1;\n };\n\n switch (token) {\n // 1, 2, ..., 12\n case 'L':\n return parseNumericPattern(numericPatterns.month, string, valueCallback);\n // 01, 02, ..., 12\n\n case 'LL':\n return parseNDigits(2, string, valueCallback);\n // 1st, 2nd, ..., 12th\n\n case 'Lo':\n return match.ordinalNumber(string, {\n unit: 'month',\n valueCallback: valueCallback\n });\n // Jan, Feb, ..., Dec\n\n case 'LLL':\n return match.month(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.month(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // J, F, ..., D\n\n case 'LLLLL':\n return match.month(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // January, February, ..., December\n\n case 'LLLL':\n default:\n return match.month(string, {\n width: 'wide',\n context: 'standalone'\n }) || match.month(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.month(string, {\n width: 'narrow',\n context: 'standalone'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 11;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth(value, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'M', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Local week of year\n w: {\n priority: 100,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'w':\n return parseNumericPattern(numericPatterns.week, string);\n\n case 'wo':\n return match.ordinalNumber(string, {\n unit: 'week'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 53;\n },\n set: function (date, _flags, value, options) {\n return startOfUTCWeek(setUTCWeek(date, value, options), options);\n },\n incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']\n },\n // ISO week of year\n I: {\n priority: 100,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'I':\n return parseNumericPattern(numericPatterns.week, string);\n\n case 'Io':\n return match.ordinalNumber(string, {\n unit: 'week'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 53;\n },\n set: function (date, _flags, value, options) {\n return startOfUTCISOWeek(setUTCISOWeek(date, value, options), options);\n },\n incompatibleTokens: ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']\n },\n // Day of the month\n d: {\n priority: 90,\n subPriority: 1,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'd':\n return parseNumericPattern(numericPatterns.date, string);\n\n case 'do':\n return match.ordinalNumber(string, {\n unit: 'date'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (date, value, _options) {\n var year = date.getUTCFullYear();\n var isLeapYear = isLeapYearIndex(year);\n var month = date.getUTCMonth();\n\n if (isLeapYear) {\n return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];\n } else {\n return value >= 1 && value <= DAYS_IN_MONTH[month];\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCDate(value);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Day of year\n D: {\n priority: 90,\n subPriority: 1,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'D':\n case 'DD':\n return parseNumericPattern(numericPatterns.dayOfYear, string);\n\n case 'Do':\n return match.ordinalNumber(string, {\n unit: 'date'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (date, value, _options) {\n var year = date.getUTCFullYear();\n var isLeapYear = isLeapYearIndex(year);\n\n if (isLeapYear) {\n return value >= 1 && value <= 366;\n } else {\n return value >= 1 && value <= 365;\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth(0, value);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'M', 'L', 'w', 'I', 'd', 'E', 'i', 'e', 'c', 't', 'T']\n },\n // Day of week\n E: {\n priority: 90,\n parse: function (string, token, match, _options) {\n switch (token) {\n // Tue\n case 'E':\n case 'EE':\n case 'EEE':\n return match.day(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // T\n\n case 'EEEEE':\n return match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'EEEEEE':\n return match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tuesday\n\n case 'EEEE':\n default:\n return match.day(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.day(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 6;\n },\n set: function (date, _flags, value, options) {\n date = setUTCDay(date, value, options);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['D', 'i', 'e', 'c', 't', 'T']\n },\n // Local day of week\n e: {\n priority: 90,\n parse: function (string, token, match, options) {\n var valueCallback = function (value) {\n var wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case 'e':\n case 'ee':\n // 03\n return parseNDigits(token.length, string, valueCallback);\n // 3rd\n\n case 'eo':\n return match.ordinalNumber(string, {\n unit: 'day',\n valueCallback: valueCallback\n });\n // Tue\n\n case 'eee':\n return match.day(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // T\n\n case 'eeeee':\n return match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'eeeeee':\n return match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tuesday\n\n case 'eeee':\n default:\n return match.day(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.day(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 6;\n },\n set: function (date, _flags, value, options) {\n date = setUTCDay(date, value, options);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'c', 't', 'T']\n },\n // Stand-alone local day of week\n c: {\n priority: 90,\n parse: function (string, token, match, options) {\n var valueCallback = function (value) {\n var wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case 'c':\n case 'cc':\n // 03\n return parseNDigits(token.length, string, valueCallback);\n // 3rd\n\n case 'co':\n return match.ordinalNumber(string, {\n unit: 'day',\n valueCallback: valueCallback\n });\n // Tue\n\n case 'ccc':\n return match.day(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.day(string, {\n width: 'short',\n context: 'standalone'\n }) || match.day(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // T\n\n case 'ccccc':\n return match.day(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // Tu\n\n case 'cccccc':\n return match.day(string, {\n width: 'short',\n context: 'standalone'\n }) || match.day(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // Tuesday\n\n case 'cccc':\n default:\n return match.day(string, {\n width: 'wide',\n context: 'standalone'\n }) || match.day(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.day(string, {\n width: 'short',\n context: 'standalone'\n }) || match.day(string, {\n width: 'narrow',\n context: 'standalone'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 6;\n },\n set: function (date, _flags, value, options) {\n date = setUTCDay(date, value, options);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'e', 't', 'T']\n },\n // ISO day of week\n i: {\n priority: 90,\n parse: function (string, token, match, _options) {\n var valueCallback = function (value) {\n if (value === 0) {\n return 7;\n }\n\n return value;\n };\n\n switch (token) {\n // 2\n case 'i':\n case 'ii':\n // 02\n return parseNDigits(token.length, string);\n // 2nd\n\n case 'io':\n return match.ordinalNumber(string, {\n unit: 'day'\n });\n // Tue\n\n case 'iii':\n return match.day(string, {\n width: 'abbreviated',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'short',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting',\n valueCallback: valueCallback\n });\n // T\n\n case 'iiiii':\n return match.day(string, {\n width: 'narrow',\n context: 'formatting',\n valueCallback: valueCallback\n });\n // Tu\n\n case 'iiiiii':\n return match.day(string, {\n width: 'short',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting',\n valueCallback: valueCallback\n });\n // Tuesday\n\n case 'iiii':\n default:\n return match.day(string, {\n width: 'wide',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'abbreviated',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'short',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting',\n valueCallback: valueCallback\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 7;\n },\n set: function (date, _flags, value, options) {\n date = setUTCISODay(date, value, options);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'E', 'e', 'c', 't', 'T']\n },\n // AM or PM\n a: {\n priority: 80,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'a':\n case 'aa':\n case 'aaa':\n return match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'aaaaa':\n return match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'aaaa':\n default:\n return match.dayPeriod(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['b', 'B', 'H', 'K', 'k', 't', 'T']\n },\n // AM, PM, midnight\n b: {\n priority: 80,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'b':\n case 'bb':\n case 'bbb':\n return match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'bbbbb':\n return match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'bbbb':\n default:\n return match.dayPeriod(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['a', 'B', 'H', 'K', 'k', 't', 'T']\n },\n // in the morning, in the afternoon, in the evening, at night\n B: {\n priority: 80,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'B':\n case 'BB':\n case 'BBB':\n return match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'BBBBB':\n return match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'BBBB':\n default:\n return match.dayPeriod(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['a', 'b', 't', 'T']\n },\n // Hour [1-12]\n h: {\n priority: 70,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'h':\n return parseNumericPattern(numericPatterns.hour12h, string);\n\n case 'ho':\n return match.ordinalNumber(string, {\n unit: 'hour'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 12;\n },\n set: function (date, _flags, value, _options) {\n var isPM = date.getUTCHours() >= 12;\n\n if (isPM && value < 12) {\n date.setUTCHours(value + 12, 0, 0, 0);\n } else if (!isPM && value === 12) {\n date.setUTCHours(0, 0, 0, 0);\n } else {\n date.setUTCHours(value, 0, 0, 0);\n }\n\n return date;\n },\n incompatibleTokens: ['H', 'K', 'k', 't', 'T']\n },\n // Hour [0-23]\n H: {\n priority: 70,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'H':\n return parseNumericPattern(numericPatterns.hour23h, string);\n\n case 'Ho':\n return match.ordinalNumber(string, {\n unit: 'hour'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 23;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCHours(value, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['a', 'b', 'h', 'K', 'k', 't', 'T']\n },\n // Hour [0-11]\n K: {\n priority: 70,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'K':\n return parseNumericPattern(numericPatterns.hour11h, string);\n\n case 'Ko':\n return match.ordinalNumber(string, {\n unit: 'hour'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 11;\n },\n set: function (date, _flags, value, _options) {\n var isPM = date.getUTCHours() >= 12;\n\n if (isPM && value < 12) {\n date.setUTCHours(value + 12, 0, 0, 0);\n } else {\n date.setUTCHours(value, 0, 0, 0);\n }\n\n return date;\n },\n incompatibleTokens: ['a', 'b', 'h', 'H', 'k', 't', 'T']\n },\n // Hour [1-24]\n k: {\n priority: 70,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'k':\n return parseNumericPattern(numericPatterns.hour24h, string);\n\n case 'ko':\n return match.ordinalNumber(string, {\n unit: 'hour'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 24;\n },\n set: function (date, _flags, value, _options) {\n var hours = value <= 24 ? value % 24 : value;\n date.setUTCHours(hours, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['a', 'b', 'h', 'H', 'K', 't', 'T']\n },\n // Minute\n m: {\n priority: 60,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'm':\n return parseNumericPattern(numericPatterns.minute, string);\n\n case 'mo':\n return match.ordinalNumber(string, {\n unit: 'minute'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 59;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMinutes(value, 0, 0);\n return date;\n },\n incompatibleTokens: ['t', 'T']\n },\n // Second\n s: {\n priority: 50,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 's':\n return parseNumericPattern(numericPatterns.second, string);\n\n case 'so':\n return match.ordinalNumber(string, {\n unit: 'second'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 59;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCSeconds(value, 0);\n return date;\n },\n incompatibleTokens: ['t', 'T']\n },\n // Fraction of second\n S: {\n priority: 30,\n parse: function (string, token, _match, _options) {\n var valueCallback = function (value) {\n return Math.floor(value * Math.pow(10, -token.length + 3));\n };\n\n return parseNDigits(token.length, string, valueCallback);\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMilliseconds(value);\n return date;\n },\n incompatibleTokens: ['t', 'T']\n },\n // Timezone (ISO-8601. +00:00 is `'Z'`)\n X: {\n priority: 10,\n parse: function (string, token, _match, _options) {\n switch (token) {\n case 'X':\n return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, string);\n\n case 'XX':\n return parseTimezonePattern(timezonePatterns.basic, string);\n\n case 'XXXX':\n return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, string);\n\n case 'XXXXX':\n return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, string);\n\n case 'XXX':\n default:\n return parseTimezonePattern(timezonePatterns.extended, string);\n }\n },\n set: function (date, flags, value, _options) {\n if (flags.timestampIsSet) {\n return date;\n }\n\n return new Date(date.getTime() - value);\n },\n incompatibleTokens: ['t', 'T', 'x']\n },\n // Timezone (ISO-8601)\n x: {\n priority: 10,\n parse: function (string, token, _match, _options) {\n switch (token) {\n case 'x':\n return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, string);\n\n case 'xx':\n return parseTimezonePattern(timezonePatterns.basic, string);\n\n case 'xxxx':\n return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, string);\n\n case 'xxxxx':\n return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, string);\n\n case 'xxx':\n default:\n return parseTimezonePattern(timezonePatterns.extended, string);\n }\n },\n set: function (date, flags, value, _options) {\n if (flags.timestampIsSet) {\n return date;\n }\n\n return new Date(date.getTime() - value);\n },\n incompatibleTokens: ['t', 'T', 'X']\n },\n // Seconds timestamp\n t: {\n priority: 40,\n parse: function (string, _token, _match, _options) {\n return parseAnyDigitsSigned(string);\n },\n set: function (_date, _flags, value, _options) {\n return [new Date(value * 1000), {\n timestampIsSet: true\n }];\n },\n incompatibleTokens: '*'\n },\n // Milliseconds timestamp\n T: {\n priority: 20,\n parse: function (string, _token, _match, _options) {\n return parseAnyDigitsSigned(string);\n },\n set: function (_date, _flags, value, _options) {\n return [new Date(value), {\n timestampIsSet: true\n }];\n },\n incompatibleTokens: '*'\n }\n};\nexport default parsers;","import defaultLocale from \"../locale/en-US/index.js\";\nimport subMilliseconds from \"../subMilliseconds/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport assign from \"../_lib/assign/index.js\";\nimport longFormatters from \"../_lib/format/longFormatters/index.js\";\nimport getTimezoneOffsetInMilliseconds from \"../_lib/getTimezoneOffsetInMilliseconds/index.js\";\nimport { isProtectedDayOfYearToken, isProtectedWeekYearToken, throwProtectedError } from \"../_lib/protectedTokens/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\nimport parsers from \"./_lib/parsers/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nvar TIMEZONE_UNIT_PRIORITY = 10; // This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\n\nvar formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\n\nvar longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\nvar escapedStringRegExp = /^'([^]*?)'?$/;\nvar doubleQuoteRegExp = /''/g;\nvar notWhitespaceRegExp = /\\S/;\nvar unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n/**\n * @name parse\n * @category Common Helpers\n * @summary Parse the date.\n *\n * @description\n * Return the date parsed from string using the given format string.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://git.io/fxCyr\n *\n * The characters in the format string wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n *\n * Format of the format string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 5 below the table).\n *\n * Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited\n * and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception:\n *\n * ```javascript\n * parse('23 AM', 'HH a', new Date())\n * //=> RangeError: The format string mustn't contain `HH` and `a` at the same time\n * ```\n *\n * See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true\n *\n * Accepted format string patterns:\n * | Unit |Prior| Pattern | Result examples | Notes |\n * |---------------------------------|-----|---------|-----------------------------------|-------|\n * | Era | 140 | G..GGG | AD, BC | |\n * | | | GGGG | Anno Domini, Before Christ | 2 |\n * | | | GGGGG | A, B | |\n * | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 |\n * | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | yy | 44, 01, 00, 17 | 4 |\n * | | | yyy | 044, 001, 123, 999 | 4 |\n * | | | yyyy | 0044, 0001, 1900, 2017 | 4 |\n * | | | yyyyy | ... | 2,4 |\n * | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 |\n * | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | YY | 44, 01, 00, 17 | 4,6 |\n * | | | YYY | 044, 001, 123, 999 | 4 |\n * | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 |\n * | | | YYYYY | ... | 2,4 |\n * | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 |\n * | | | RR | -43, 01, 00, 17 | 4,5 |\n * | | | RRR | -043, 001, 123, 999, -999 | 4,5 |\n * | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 |\n * | | | RRRRR | ... | 2,4,5 |\n * | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 |\n * | | | uu | -43, 01, 99, -99 | 4 |\n * | | | uuu | -043, 001, 123, 999, -999 | 4 |\n * | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 |\n * | | | uuuuu | ... | 2,4 |\n * | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | |\n * | | | Qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | QQ | 01, 02, 03, 04 | |\n * | | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | |\n * | | | qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | qq | 01, 02, 03, 04 | |\n * | | | qqq | Q1, Q2, Q3, Q4 | |\n * | | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | | qqqqq | 1, 2, 3, 4 | 3 |\n * | Month (formatting) | 110 | M | 1, 2, ..., 12 | |\n * | | | Mo | 1st, 2nd, ..., 12th | 5 |\n * | | | MM | 01, 02, ..., 12 | |\n * | | | MMM | Jan, Feb, ..., Dec | |\n * | | | MMMM | January, February, ..., December | 2 |\n * | | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | |\n * | | | Lo | 1st, 2nd, ..., 12th | 5 |\n * | | | LL | 01, 02, ..., 12 | |\n * | | | LLL | Jan, Feb, ..., Dec | |\n * | | | LLLL | January, February, ..., December | 2 |\n * | | | LLLLL | J, F, ..., D | |\n * | Local week of year | 100 | w | 1, 2, ..., 53 | |\n * | | | wo | 1st, 2nd, ..., 53th | 5 |\n * | | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 |\n * | | | Io | 1st, 2nd, ..., 53th | 5 |\n * | | | II | 01, 02, ..., 53 | 5 |\n * | Day of month | 90 | d | 1, 2, ..., 31 | |\n * | | | do | 1st, 2nd, ..., 31st | 5 |\n * | | | dd | 01, 02, ..., 31 | |\n * | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 |\n * | | | Do | 1st, 2nd, ..., 365th, 366th | 5 |\n * | | | DD | 01, 02, ..., 365, 366 | 7 |\n * | | | DDD | 001, 002, ..., 365, 366 | |\n * | | | DDDD | ... | 2 |\n * | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | | EEEEE | M, T, W, T, F, S, S | |\n * | | | EEEEEE | Mo, Tu, We, Th, Fr, Su, Sa | |\n * | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 |\n * | | | io | 1st, 2nd, ..., 7th | 5 |\n * | | | ii | 01, 02, ..., 07 | 5 |\n * | | | iii | Mon, Tue, Wed, ..., Sun | 5 |\n * | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 |\n * | | | iiiii | M, T, W, T, F, S, S | 5 |\n * | | | iiiiii | Mo, Tu, We, Th, Fr, Su, Sa | 5 |\n * | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | |\n * | | | eo | 2nd, 3rd, ..., 1st | 5 |\n * | | | ee | 02, 03, ..., 01 | |\n * | | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | | eeeee | M, T, W, T, F, S, S | |\n * | | | eeeeee | Mo, Tu, We, Th, Fr, Su, Sa | |\n * | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | |\n * | | | co | 2nd, 3rd, ..., 1st | 5 |\n * | | | cc | 02, 03, ..., 01 | |\n * | | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | | ccccc | M, T, W, T, F, S, S | |\n * | | | cccccc | Mo, Tu, We, Th, Fr, Su, Sa | |\n * | AM, PM | 80 | a..aaa | AM, PM | |\n * | | | aaaa | a.m., p.m. | 2 |\n * | | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | |\n * | | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | | bbbbb | a, p, n, mi | |\n * | Flexible day period | 80 | B..BBB | at night, in the morning, ... | |\n * | | | BBBB | at night, in the morning, ... | 2 |\n * | | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | |\n * | | | ho | 1st, 2nd, ..., 11th, 12th | 5 |\n * | | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | |\n * | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 |\n * | | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | |\n * | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 |\n * | | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | |\n * | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 |\n * | | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | 60 | m | 0, 1, ..., 59 | |\n * | | | mo | 0th, 1st, ..., 59th | 5 |\n * | | | mm | 00, 01, ..., 59 | |\n * | Second | 50 | s | 0, 1, ..., 59 | |\n * | | | so | 0th, 1st, ..., 59th | 5 |\n * | | | ss | 00, 01, ..., 59 | |\n * | Seconds timestamp | 40 | t | 512969520 | |\n * | | | tt | ... | 2 |\n * | Fraction of second | 30 | S | 0, 1, ..., 9 | |\n * | | | SS | 00, 01, ..., 99 | |\n * | | | SSS | 000, 0001, ..., 999 | |\n * | | | SSSS | ... | 2 |\n * | Milliseconds timestamp | 20 | T | 512969520900 | |\n * | | | TT | ... | 2 |\n * | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | |\n * | | | XX | -0800, +0530, Z | |\n * | | | XXX | -08:00, +05:30, Z | |\n * | | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | |\n * | | | xx | -0800, +0530, +0000 | |\n * | | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Long localized date | NA | P | 05/29/1453 | 5,8 |\n * | | | PP | May 29, 1453 | |\n * | | | PPP | May 29th, 1453 | |\n * | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 |\n * | Long localized time | NA | p | 12:00 AM | 5,8 |\n * | | | pp | 12:00:00 AM | |\n * | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | |\n * | | | PPpp | May 29, 1453, 12:00:00 AM | |\n * | | | PPPpp | May 29th, 1453 at ... | |\n * | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular.\n * In `format` function, they will produce different result:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * `parse` will try to match both formatting and stand-alone units interchangably.\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table:\n * - for numerical units (`yyyyyyyy`) `parse` will try to match a number\n * as wide as the sequence\n * - for text units (`MMMMMMMM`) `parse` will try to match the widest variation of the unit.\n * These variations are marked with \"2\" in the last column of the table.\n *\n * 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 4. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`:\n *\n * `parse('50', 'yy', new Date(2018, 0, 1)) //=> Sat Jan 01 2050 00:00:00`\n *\n * `parse('75', 'yy', new Date(2018, 0, 1)) //=> Wed Jan 01 1975 00:00:00`\n *\n * while `uu` will just assign the year as is:\n *\n * `parse('50', 'uu', new Date(2018, 0, 1)) //=> Sat Jan 01 0050 00:00:00`\n *\n * `parse('75', 'uu', new Date(2018, 0, 1)) //=> Tue Jan 01 0075 00:00:00`\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [setISOWeekYear]{@link https://date-fns.org/docs/setISOWeekYear}\n * and [setWeekYear]{@link https://date-fns.org/docs/setWeekYear}).\n *\n * 5. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://git.io/fxCyr\n *\n * 7. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://git.io/fxCyr\n *\n * 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based\n * on the given locale.\n *\n * using `en-US` locale: `P` => `MM/dd/yyyy`\n * using `en-US` locale: `p` => `hh:mm a`\n * using `pt-BR` locale: `P` => `dd/MM/yyyy`\n * using `pt-BR` locale: `p` => `HH:mm`\n *\n * Values will be assigned to the date in the descending order of its unit's priority.\n * Units of an equal priority overwrite each other in the order of appearance.\n *\n * If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year),\n * the values will be taken from 3rd argument `referenceDate` which works as a context of parsing.\n *\n * `referenceDate` must be passed for correct work of the function.\n * If you're not sure which `referenceDate` to supply, create a new instance of Date:\n * `parse('02/11/2014', 'MM/dd/yyyy', new Date())`\n * In this case parsing will be done in the context of the current date.\n * If `referenceDate` is `Invalid Date` or a value not convertible to valid `Date`,\n * then `Invalid Date` will be returned.\n *\n * The result may vary by locale.\n *\n * If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned.\n *\n * If parsing failed, `Invalid Date` will be returned.\n * Invalid Date is a Date, whose time value is NaN.\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - Old `parse` was renamed to `toDate`.\n * Now `parse` is a new function which parses a string using a provided format.\n *\n * ```javascript\n * // Before v2.0.0\n * parse('2016-01-01')\n *\n * // v2.0.0 onward (toDate no longer accepts a string)\n * toDate(1392098430000) // Unix to timestamp\n * toDate(new Date(2014, 1, 11, 11, 30, 30)) // Cloning the date\n * parse('2016-01-01', 'yyyy-MM-dd', new Date())\n * ```\n *\n * @param {String} dateString - the string to parse\n * @param {String} formatString - the string of tokens\n * @param {Date|Number} referenceDate - defines values missing from the parsed dateString\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year\n * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;\n * see: https://git.io/fxCyr\n * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;\n * see: https://git.io/fxCyr\n * @returns {Date} the parsed date\n * @throws {TypeError} 3 arguments required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\n * @throws {RangeError} `options.locale` must contain `match` property\n * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} format string contains an unescaped latin alphabet character\n *\n * @example\n * // Parse 11 February 2014 from middle-endian format:\n * var result = parse('02/11/2014', 'MM/dd/yyyy', new Date())\n * //=> Tue Feb 11 2014 00:00:00\n *\n * @example\n * // Parse 28th of February in Esperanto locale in the context of 2010 year:\n * import eo from 'date-fns/locale/eo'\n * var result = parse('28-a de februaro', \"do 'de' MMMM\", new Date(2010, 0, 1), {\n * locale: eo\n * })\n * //=> Sun Feb 28 2010 00:00:00\n */\n\nexport default function parse(dirtyDateString, dirtyFormatString, dirtyReferenceDate, dirtyOptions) {\n requiredArgs(3, arguments);\n var dateString = String(dirtyDateString);\n var formatString = String(dirtyFormatString);\n var options = dirtyOptions || {};\n var locale = options.locale || defaultLocale;\n\n if (!locale.match) {\n throw new RangeError('locale must contain match property');\n }\n\n var localeFirstWeekContainsDate = locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN\n\n if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {\n throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');\n }\n\n var localeWeekStartsOn = locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n if (formatString === '') {\n if (dateString === '') {\n return toDate(dirtyReferenceDate);\n } else {\n return new Date(NaN);\n }\n }\n\n var subFnOptions = {\n firstWeekContainsDate: firstWeekContainsDate,\n weekStartsOn: weekStartsOn,\n locale: locale // If timezone isn't specified, it will be set to the system timezone\n\n };\n var setters = [{\n priority: TIMEZONE_UNIT_PRIORITY,\n subPriority: -1,\n set: dateToSystemTimezone,\n index: 0\n }];\n var i;\n var tokens = formatString.match(longFormattingTokensRegExp).map(function (substring) {\n var firstCharacter = substring[0];\n\n if (firstCharacter === 'p' || firstCharacter === 'P') {\n var longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong, subFnOptions);\n }\n\n return substring;\n }).join('').match(formattingTokensRegExp);\n var usedTokens = [];\n\n for (i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n\n if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(token)) {\n throwProtectedError(token, formatString, dirtyDateString);\n }\n\n if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(token)) {\n throwProtectedError(token, formatString, dirtyDateString);\n }\n\n var firstCharacter = token[0];\n var parser = parsers[firstCharacter];\n\n if (parser) {\n var incompatibleTokens = parser.incompatibleTokens;\n\n if (Array.isArray(incompatibleTokens)) {\n var incompatibleToken = void 0;\n\n for (var _i = 0; _i < usedTokens.length; _i++) {\n var usedToken = usedTokens[_i].token;\n\n if (incompatibleTokens.indexOf(usedToken) !== -1 || usedToken === firstCharacter) {\n incompatibleToken = usedTokens[_i];\n break;\n }\n }\n\n if (incompatibleToken) {\n throw new RangeError(\"The format string mustn't contain `\".concat(incompatibleToken.fullToken, \"` and `\").concat(token, \"` at the same time\"));\n }\n } else if (parser.incompatibleTokens === '*' && usedTokens.length) {\n throw new RangeError(\"The format string mustn't contain `\".concat(token, \"` and any other token at the same time\"));\n }\n\n usedTokens.push({\n token: firstCharacter,\n fullToken: token\n });\n var parseResult = parser.parse(dateString, token, locale.match, subFnOptions);\n\n if (!parseResult) {\n return new Date(NaN);\n }\n\n setters.push({\n priority: parser.priority,\n subPriority: parser.subPriority || 0,\n set: parser.set,\n validate: parser.validate,\n value: parseResult.value,\n index: setters.length\n });\n dateString = parseResult.rest;\n } else {\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');\n } // Replace two single quote characters with one single quote character\n\n\n if (token === \"''\") {\n token = \"'\";\n } else if (firstCharacter === \"'\") {\n token = cleanEscapedString(token);\n } // Cut token from string, or, if string doesn't match the token, return Invalid Date\n\n\n if (dateString.indexOf(token) === 0) {\n dateString = dateString.slice(token.length);\n } else {\n return new Date(NaN);\n }\n }\n } // Check if the remaining input contains something other than whitespace\n\n\n if (dateString.length > 0 && notWhitespaceRegExp.test(dateString)) {\n return new Date(NaN);\n }\n\n var uniquePrioritySetters = setters.map(function (setter) {\n return setter.priority;\n }).sort(function (a, b) {\n return b - a;\n }).filter(function (priority, index, array) {\n return array.indexOf(priority) === index;\n }).map(function (priority) {\n return setters.filter(function (setter) {\n return setter.priority === priority;\n }).sort(function (a, b) {\n return b.subPriority - a.subPriority;\n });\n }).map(function (setterArray) {\n return setterArray[0];\n });\n var date = toDate(dirtyReferenceDate);\n\n if (isNaN(date)) {\n return new Date(NaN);\n } // Convert the date in system timezone to the same date in UTC+00:00 timezone.\n // This ensures that when UTC functions will be implemented, locales will be compatible with them.\n // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/37\n\n\n var utcDate = subMilliseconds(date, getTimezoneOffsetInMilliseconds(date));\n var flags = {};\n\n for (i = 0; i < uniquePrioritySetters.length; i++) {\n var setter = uniquePrioritySetters[i];\n\n if (setter.validate && !setter.validate(utcDate, setter.value, subFnOptions)) {\n return new Date(NaN);\n }\n\n var result = setter.set(utcDate, flags, setter.value, subFnOptions); // Result is tuple (date, flags)\n\n if (result[0]) {\n utcDate = result[0];\n assign(flags, result[1]); // Result is date\n } else {\n utcDate = result;\n }\n }\n\n return utcDate;\n}\n\nfunction dateToSystemTimezone(date, flags) {\n if (flags.timestampIsSet) {\n return date;\n }\n\n var convertedDate = new Date(0);\n convertedDate.setFullYear(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());\n convertedDate.setHours(date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds());\n return convertedDate;\n}\n\nfunction cleanEscapedString(input) {\n return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, \"'\");\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isSameYear\n * @category Year Helpers\n * @summary Are the given dates in the same year?\n *\n * @description\n * Are the given dates in the same year?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the first date to check\n * @param {Date|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same year\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Are 2 September 2014 and 25 September 2014 in the same year?\n * var result = isSameYear(new Date(2014, 8, 2), new Date(2014, 8, 25))\n * //=> true\n */\n\nexport default function isSameYear(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n return dateLeft.getFullYear() === dateRight.getFullYear();\n}","import isSameDay from \"../isSameDay/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isToday\n * @category Day Helpers\n * @summary Is the given date today?\n * @pure false\n *\n * @description\n * Is the given date today?\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is today\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // If today is 6 October 2014, is 6 October 14:00:00 today?\n * var result = isToday(new Date(2014, 9, 6, 14, 0))\n * //=> true\n */\n\nexport default function isToday(dirtyDate) {\n requiredArgs(1, arguments);\n return isSameDay(dirtyDate, Date.now());\n}","import isSameDay from \"../isSameDay/index.js\";\nimport subDays from \"../subDays/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isYesterday\n * @category Day Helpers\n * @summary Is the given date yesterday?\n * @pure false\n *\n * @description\n * Is the given date yesterday?\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is yesterday\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // If today is 6 October 2014, is 5 October 14:00:00 yesterday?\n * var result = isYesterday(new Date(2014, 9, 5, 14, 0))\n * //=> true\n */\n\nexport default function isYesterday(dirtyDate) {\n requiredArgs(1, arguments);\n return isSameDay(dirtyDate, subDays(Date.now(), 1));\n}","import { computed, unref } from 'vue';\nimport { getCurrentInstance } from 'vue';\n\nexport const useStore = () => {\n const vm = getCurrentInstance();\n if (!vm) throw new Error('must be called in setup');\n return vm.proxy.$store;\n};\n\nexport const useStoreGetters = () => {\n const store = useStore();\n return Object.fromEntries(\n Object.keys(store.getters).map(getter => [\n getter,\n computed(() => store.getters[getter]),\n ])\n );\n};\n\nexport const useMapGetter = key => {\n const store = useStore();\n return computed(() => store.getters[key]);\n};\n\nexport const useFunctionGetter = (key, ...args) => {\n const store = useStore();\n return computed(() => {\n const unrefedArgs = args.map(arg => unref(arg));\n return store.getters[key](...unrefedArgs);\n });\n};\n","(function(global, factory) {\n typeof exports === \"object\" && typeof module !== \"undefined\" ? factory(exports) : typeof define === \"function\" && define.amd ? define([ \"exports\" ], factory) : factory(global.ActionCable = {});\n})(this, function(exports) {\n \"use strict\";\n var adapters = {\n logger: self.console,\n WebSocket: self.WebSocket\n };\n var logger = {\n log: function log() {\n if (this.enabled) {\n var _adapters$logger;\n for (var _len = arguments.length, messages = Array(_len), _key = 0; _key < _len; _key++) {\n messages[_key] = arguments[_key];\n }\n messages.push(Date.now());\n (_adapters$logger = adapters.logger).log.apply(_adapters$logger, [ \"[ActionCable]\" ].concat(messages));\n }\n }\n };\n var _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function(obj) {\n return typeof obj;\n } : function(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n var classCallCheck = function(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n };\n var createClass = function() {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n return function(Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n }();\n var now = function now() {\n return new Date().getTime();\n };\n var secondsSince = function secondsSince(time) {\n return (now() - time) / 1e3;\n };\n var clamp = function clamp(number, min, max) {\n return Math.max(min, Math.min(max, number));\n };\n var ConnectionMonitor = function() {\n function ConnectionMonitor(connection) {\n classCallCheck(this, ConnectionMonitor);\n this.visibilityDidChange = this.visibilityDidChange.bind(this);\n this.connection = connection;\n this.reconnectAttempts = 0;\n }\n ConnectionMonitor.prototype.start = function start() {\n if (!this.isRunning()) {\n this.startedAt = now();\n delete this.stoppedAt;\n this.startPolling();\n addEventListener(\"visibilitychange\", this.visibilityDidChange);\n logger.log(\"ConnectionMonitor started. pollInterval = \" + this.getPollInterval() + \" ms\");\n }\n };\n ConnectionMonitor.prototype.stop = function stop() {\n if (this.isRunning()) {\n this.stoppedAt = now();\n this.stopPolling();\n removeEventListener(\"visibilitychange\", this.visibilityDidChange);\n logger.log(\"ConnectionMonitor stopped\");\n }\n };\n ConnectionMonitor.prototype.isRunning = function isRunning() {\n return this.startedAt && !this.stoppedAt;\n };\n ConnectionMonitor.prototype.recordPing = function recordPing() {\n this.pingedAt = now();\n };\n ConnectionMonitor.prototype.recordConnect = function recordConnect() {\n this.reconnectAttempts = 0;\n this.recordPing();\n delete this.disconnectedAt;\n logger.log(\"ConnectionMonitor recorded connect\");\n };\n ConnectionMonitor.prototype.recordDisconnect = function recordDisconnect() {\n this.disconnectedAt = now();\n logger.log(\"ConnectionMonitor recorded disconnect\");\n };\n ConnectionMonitor.prototype.startPolling = function startPolling() {\n this.stopPolling();\n this.poll();\n };\n ConnectionMonitor.prototype.stopPolling = function stopPolling() {\n clearTimeout(this.pollTimeout);\n };\n ConnectionMonitor.prototype.poll = function poll() {\n var _this = this;\n this.pollTimeout = setTimeout(function() {\n _this.reconnectIfStale();\n _this.poll();\n }, this.getPollInterval());\n };\n ConnectionMonitor.prototype.getPollInterval = function getPollInterval() {\n var _constructor$pollInte = this.constructor.pollInterval, min = _constructor$pollInte.min, max = _constructor$pollInte.max, multiplier = _constructor$pollInte.multiplier;\n var interval = multiplier * Math.log(this.reconnectAttempts + 1);\n return Math.round(clamp(interval, min, max) * 1e3);\n };\n ConnectionMonitor.prototype.reconnectIfStale = function reconnectIfStale() {\n if (this.connectionIsStale()) {\n logger.log(\"ConnectionMonitor detected stale connection. reconnectAttempts = \" + this.reconnectAttempts + \", pollInterval = \" + this.getPollInterval() + \" ms, time disconnected = \" + secondsSince(this.disconnectedAt) + \" s, stale threshold = \" + this.constructor.staleThreshold + \" s\");\n this.reconnectAttempts++;\n if (this.disconnectedRecently()) {\n logger.log(\"ConnectionMonitor skipping reopening recent disconnect\");\n } else {\n logger.log(\"ConnectionMonitor reopening\");\n this.connection.reopen();\n }\n }\n };\n ConnectionMonitor.prototype.connectionIsStale = function connectionIsStale() {\n return secondsSince(this.pingedAt ? this.pingedAt : this.startedAt) > this.constructor.staleThreshold;\n };\n ConnectionMonitor.prototype.disconnectedRecently = function disconnectedRecently() {\n return this.disconnectedAt && secondsSince(this.disconnectedAt) < this.constructor.staleThreshold;\n };\n ConnectionMonitor.prototype.visibilityDidChange = function visibilityDidChange() {\n var _this2 = this;\n if (document.visibilityState === \"visible\") {\n setTimeout(function() {\n if (_this2.connectionIsStale() || !_this2.connection.isOpen()) {\n logger.log(\"ConnectionMonitor reopening stale connection on visibilitychange. visibilityState = \" + document.visibilityState);\n _this2.connection.reopen();\n }\n }, 200);\n }\n };\n return ConnectionMonitor;\n }();\n ConnectionMonitor.pollInterval = {\n min: 3,\n max: 30,\n multiplier: 5\n };\n ConnectionMonitor.staleThreshold = 6;\n var INTERNAL = {\n message_types: {\n welcome: \"welcome\",\n disconnect: \"disconnect\",\n ping: \"ping\",\n confirmation: \"confirm_subscription\",\n rejection: \"reject_subscription\"\n },\n disconnect_reasons: {\n unauthorized: \"unauthorized\",\n invalid_request: \"invalid_request\",\n server_restart: \"server_restart\"\n },\n default_mount_path: \"/cable\",\n protocols: [ \"actioncable-v1-json\", \"actioncable-unsupported\" ]\n };\n var message_types = INTERNAL.message_types, protocols = INTERNAL.protocols;\n var supportedProtocols = protocols.slice(0, protocols.length - 1);\n var indexOf = [].indexOf;\n var Connection = function() {\n function Connection(consumer) {\n classCallCheck(this, Connection);\n this.open = this.open.bind(this);\n this.consumer = consumer;\n this.subscriptions = this.consumer.subscriptions;\n this.monitor = new ConnectionMonitor(this);\n this.disconnected = true;\n }\n Connection.prototype.send = function send(data) {\n if (this.isOpen()) {\n this.webSocket.send(JSON.stringify(data));\n return true;\n } else {\n return false;\n }\n };\n Connection.prototype.open = function open() {\n if (this.isActive()) {\n logger.log(\"Attempted to open WebSocket, but existing socket is \" + this.getState());\n return false;\n } else {\n logger.log(\"Opening WebSocket, current state is \" + this.getState() + \", subprotocols: \" + protocols);\n if (this.webSocket) {\n this.uninstallEventHandlers();\n }\n this.webSocket = new adapters.WebSocket(this.consumer.url, protocols);\n this.installEventHandlers();\n this.monitor.start();\n return true;\n }\n };\n Connection.prototype.close = function close() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {\n allowReconnect: true\n }, allowReconnect = _ref.allowReconnect;\n if (!allowReconnect) {\n this.monitor.stop();\n }\n if (this.isActive()) {\n return this.webSocket.close();\n }\n };\n Connection.prototype.reopen = function reopen() {\n logger.log(\"Reopening WebSocket, current state is \" + this.getState());\n if (this.isActive()) {\n try {\n return this.close();\n } catch (error) {\n logger.log(\"Failed to reopen WebSocket\", error);\n } finally {\n logger.log(\"Reopening WebSocket in \" + this.constructor.reopenDelay + \"ms\");\n setTimeout(this.open, this.constructor.reopenDelay);\n }\n } else {\n return this.open();\n }\n };\n Connection.prototype.getProtocol = function getProtocol() {\n if (this.webSocket) {\n return this.webSocket.protocol;\n }\n };\n Connection.prototype.isOpen = function isOpen() {\n return this.isState(\"open\");\n };\n Connection.prototype.isActive = function isActive() {\n return this.isState(\"open\", \"connecting\");\n };\n Connection.prototype.isProtocolSupported = function isProtocolSupported() {\n return indexOf.call(supportedProtocols, this.getProtocol()) >= 0;\n };\n Connection.prototype.isState = function isState() {\n for (var _len = arguments.length, states = Array(_len), _key = 0; _key < _len; _key++) {\n states[_key] = arguments[_key];\n }\n return indexOf.call(states, this.getState()) >= 0;\n };\n Connection.prototype.getState = function getState() {\n if (this.webSocket) {\n for (var state in adapters.WebSocket) {\n if (adapters.WebSocket[state] === this.webSocket.readyState) {\n return state.toLowerCase();\n }\n }\n }\n return null;\n };\n Connection.prototype.installEventHandlers = function installEventHandlers() {\n for (var eventName in this.events) {\n var handler = this.events[eventName].bind(this);\n this.webSocket[\"on\" + eventName] = handler;\n }\n };\n Connection.prototype.uninstallEventHandlers = function uninstallEventHandlers() {\n for (var eventName in this.events) {\n this.webSocket[\"on\" + eventName] = function() {};\n }\n };\n return Connection;\n }();\n Connection.reopenDelay = 500;\n Connection.prototype.events = {\n message: function message(event) {\n if (!this.isProtocolSupported()) {\n return;\n }\n var _JSON$parse = JSON.parse(event.data), identifier = _JSON$parse.identifier, message = _JSON$parse.message, reason = _JSON$parse.reason, reconnect = _JSON$parse.reconnect, type = _JSON$parse.type;\n switch (type) {\n case message_types.welcome:\n this.monitor.recordConnect();\n return this.subscriptions.reload();\n\n case message_types.disconnect:\n logger.log(\"Disconnecting. Reason: \" + reason);\n return this.close({\n allowReconnect: reconnect\n });\n\n case message_types.ping:\n return this.monitor.recordPing();\n\n case message_types.confirmation:\n return this.subscriptions.notify(identifier, \"connected\");\n\n case message_types.rejection:\n return this.subscriptions.reject(identifier);\n\n default:\n return this.subscriptions.notify(identifier, \"received\", message);\n }\n },\n open: function open() {\n logger.log(\"WebSocket onopen event, using '\" + this.getProtocol() + \"' subprotocol\");\n this.disconnected = false;\n if (!this.isProtocolSupported()) {\n logger.log(\"Protocol is unsupported. Stopping monitor and disconnecting.\");\n return this.close({\n allowReconnect: false\n });\n }\n },\n close: function close(event) {\n logger.log(\"WebSocket onclose event\");\n if (this.disconnected) {\n return;\n }\n this.disconnected = true;\n this.monitor.recordDisconnect();\n return this.subscriptions.notifyAll(\"disconnected\", {\n willAttemptReconnect: this.monitor.isRunning()\n });\n },\n error: function error() {\n logger.log(\"WebSocket onerror event\");\n }\n };\n var extend = function extend(object, properties) {\n if (properties != null) {\n for (var key in properties) {\n var value = properties[key];\n object[key] = value;\n }\n }\n return object;\n };\n var Subscription = function() {\n function Subscription(consumer) {\n var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var mixin = arguments[2];\n classCallCheck(this, Subscription);\n this.consumer = consumer;\n this.identifier = JSON.stringify(params);\n extend(this, mixin);\n }\n Subscription.prototype.perform = function perform(action) {\n var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n data.action = action;\n return this.send(data);\n };\n Subscription.prototype.send = function send(data) {\n return this.consumer.send({\n command: \"message\",\n identifier: this.identifier,\n data: JSON.stringify(data)\n });\n };\n Subscription.prototype.unsubscribe = function unsubscribe() {\n return this.consumer.subscriptions.remove(this);\n };\n return Subscription;\n }();\n var Subscriptions = function() {\n function Subscriptions(consumer) {\n classCallCheck(this, Subscriptions);\n this.consumer = consumer;\n this.subscriptions = [];\n }\n Subscriptions.prototype.create = function create(channelName, mixin) {\n var channel = channelName;\n var params = (typeof channel === \"undefined\" ? \"undefined\" : _typeof(channel)) === \"object\" ? channel : {\n channel: channel\n };\n var subscription = new Subscription(this.consumer, params, mixin);\n return this.add(subscription);\n };\n Subscriptions.prototype.add = function add(subscription) {\n this.subscriptions.push(subscription);\n this.consumer.ensureActiveConnection();\n this.notify(subscription, \"initialized\");\n this.sendCommand(subscription, \"subscribe\");\n return subscription;\n };\n Subscriptions.prototype.remove = function remove(subscription) {\n this.forget(subscription);\n if (!this.findAll(subscription.identifier).length) {\n this.sendCommand(subscription, \"unsubscribe\");\n }\n return subscription;\n };\n Subscriptions.prototype.reject = function reject(identifier) {\n var _this = this;\n return this.findAll(identifier).map(function(subscription) {\n _this.forget(subscription);\n _this.notify(subscription, \"rejected\");\n return subscription;\n });\n };\n Subscriptions.prototype.forget = function forget(subscription) {\n this.subscriptions = this.subscriptions.filter(function(s) {\n return s !== subscription;\n });\n return subscription;\n };\n Subscriptions.prototype.findAll = function findAll(identifier) {\n return this.subscriptions.filter(function(s) {\n return s.identifier === identifier;\n });\n };\n Subscriptions.prototype.reload = function reload() {\n var _this2 = this;\n return this.subscriptions.map(function(subscription) {\n return _this2.sendCommand(subscription, \"subscribe\");\n });\n };\n Subscriptions.prototype.notifyAll = function notifyAll(callbackName) {\n var _this3 = this;\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n return this.subscriptions.map(function(subscription) {\n return _this3.notify.apply(_this3, [ subscription, callbackName ].concat(args));\n });\n };\n Subscriptions.prototype.notify = function notify(subscription, callbackName) {\n for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n args[_key2 - 2] = arguments[_key2];\n }\n var subscriptions = void 0;\n if (typeof subscription === \"string\") {\n subscriptions = this.findAll(subscription);\n } else {\n subscriptions = [ subscription ];\n }\n return subscriptions.map(function(subscription) {\n return typeof subscription[callbackName] === \"function\" ? subscription[callbackName].apply(subscription, args) : undefined;\n });\n };\n Subscriptions.prototype.sendCommand = function sendCommand(subscription, command) {\n var identifier = subscription.identifier;\n return this.consumer.send({\n command: command,\n identifier: identifier\n });\n };\n return Subscriptions;\n }();\n var Consumer = function() {\n function Consumer(url) {\n classCallCheck(this, Consumer);\n this._url = url;\n this.subscriptions = new Subscriptions(this);\n this.connection = new Connection(this);\n }\n Consumer.prototype.send = function send(data) {\n return this.connection.send(data);\n };\n Consumer.prototype.connect = function connect() {\n return this.connection.open();\n };\n Consumer.prototype.disconnect = function disconnect() {\n return this.connection.close({\n allowReconnect: false\n });\n };\n Consumer.prototype.ensureActiveConnection = function ensureActiveConnection() {\n if (!this.connection.isActive()) {\n return this.connection.open();\n }\n };\n createClass(Consumer, [ {\n key: \"url\",\n get: function get$$1() {\n return createWebSocketURL(this._url);\n }\n } ]);\n return Consumer;\n }();\n function createWebSocketURL(url) {\n if (typeof url === \"function\") {\n url = url();\n }\n if (url && !/^wss?:/i.test(url)) {\n var a = document.createElement(\"a\");\n a.href = url;\n a.href = a.href;\n a.protocol = a.protocol.replace(\"http\", \"ws\");\n return a.href;\n } else {\n return url;\n }\n }\n function createConsumer() {\n var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getConfig(\"url\") || INTERNAL.default_mount_path;\n return new Consumer(url);\n }\n function getConfig(name) {\n var element = document.head.querySelector(\"meta[name='action-cable-\" + name + \"']\");\n if (element) {\n return element.getAttribute(\"content\");\n }\n }\n exports.Connection = Connection;\n exports.ConnectionMonitor = ConnectionMonitor;\n exports.Consumer = Consumer;\n exports.INTERNAL = INTERNAL;\n exports.Subscription = Subscription;\n exports.Subscriptions = Subscriptions;\n exports.adapters = adapters;\n exports.createWebSocketURL = createWebSocketURL;\n exports.logger = logger;\n exports.createConsumer = createConsumer;\n exports.getConfig = getConfig;\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n});\n","import { createConsumer } from '@rails/actioncable';\n\nconst PRESENCE_INTERVAL = 20000;\nconst RECONNECT_INTERVAL = 1000;\n\nclass BaseActionCableConnector {\n static isDisconnected = false;\n\n constructor(app, pubsubToken, websocketHost = '') {\n const websocketURL = websocketHost ? `${websocketHost}/cable` : undefined;\n\n this.consumer = createConsumer(websocketURL);\n this.subscription = this.consumer.subscriptions.create(\n {\n channel: 'RoomChannel',\n pubsub_token: pubsubToken,\n account_id: app.$store.getters.getCurrentAccountId,\n user_id: app.$store.getters.getCurrentUserID,\n },\n {\n updatePresence() {\n this.perform('update_presence');\n },\n received: this.onReceived,\n disconnected: () => {\n BaseActionCableConnector.isDisconnected = true;\n this.onDisconnected();\n this.initReconnectTimer();\n },\n }\n );\n this.app = app;\n this.events = {};\n this.reconnectTimer = null;\n this.isAValidEvent = () => true;\n this.triggerPresenceInterval = () => {\n setTimeout(() => {\n this.subscription.updatePresence();\n this.triggerPresenceInterval();\n }, PRESENCE_INTERVAL);\n };\n this.triggerPresenceInterval();\n }\n\n checkConnection() {\n const isConnectionActive = this.consumer.connection.isOpen();\n const isReconnected =\n BaseActionCableConnector.isDisconnected && isConnectionActive;\n if (isReconnected) {\n this.clearReconnectTimer();\n this.onReconnect();\n BaseActionCableConnector.isDisconnected = false;\n } else {\n this.initReconnectTimer();\n }\n }\n\n clearReconnectTimer = () => {\n if (this.reconnectTimer) {\n clearTimeout(this.reconnectTimer);\n this.reconnectTimer = null;\n }\n };\n\n initReconnectTimer = () => {\n this.clearReconnectTimer();\n this.reconnectTimer = setTimeout(() => {\n this.checkConnection();\n }, RECONNECT_INTERVAL);\n };\n\n // eslint-disable-next-line class-methods-use-this\n onReconnect = () => {};\n\n // eslint-disable-next-line class-methods-use-this\n onDisconnected = () => {};\n\n disconnect() {\n this.consumer.disconnect();\n }\n\n onReceived = ({ event, data } = {}) => {\n if (this.isAValidEvent(data)) {\n if (this.events[event] && typeof this.events[event] === 'function') {\n this.events[event](data);\n }\n }\n };\n}\n\nexport default BaseActionCableConnector;\n","var GOOD_LEAF_SIZE = 200;\n\n// :: class A rope sequence is a persistent sequence data structure\n// that supports appending, prepending, and slicing without doing a\n// full copy. It is represented as a mostly-balanced tree.\nvar RopeSequence = function RopeSequence () {};\n\nRopeSequence.prototype.append = function append (other) {\n if (!other.length) { return this }\n other = RopeSequence.from(other);\n\n return (!this.length && other) ||\n (other.length < GOOD_LEAF_SIZE && this.leafAppend(other)) ||\n (this.length < GOOD_LEAF_SIZE && other.leafPrepend(this)) ||\n this.appendInner(other)\n};\n\n// :: (union<[T], RopeSequence>) → RopeSequence\n// Prepend an array or other rope to this one, returning a new rope.\nRopeSequence.prototype.prepend = function prepend (other) {\n if (!other.length) { return this }\n return RopeSequence.from(other).append(this)\n};\n\nRopeSequence.prototype.appendInner = function appendInner (other) {\n return new Append(this, other)\n};\n\n// :: (?number, ?number) → RopeSequence\n// Create a rope repesenting a sub-sequence of this rope.\nRopeSequence.prototype.slice = function slice (from, to) {\n if ( from === void 0 ) from = 0;\n if ( to === void 0 ) to = this.length;\n\n if (from >= to) { return RopeSequence.empty }\n return this.sliceInner(Math.max(0, from), Math.min(this.length, to))\n};\n\n// :: (number) → T\n// Retrieve the element at the given position from this rope.\nRopeSequence.prototype.get = function get (i) {\n if (i < 0 || i >= this.length) { return undefined }\n return this.getInner(i)\n};\n\n// :: ((element: T, index: number) → ?bool, ?number, ?number)\n// Call the given function for each element between the given\n// indices. This tends to be more efficient than looping over the\n// indices and calling `get`, because it doesn't have to descend the\n// tree for every element.\nRopeSequence.prototype.forEach = function forEach (f, from, to) {\n if ( from === void 0 ) from = 0;\n if ( to === void 0 ) to = this.length;\n\n if (from <= to)\n { this.forEachInner(f, from, to, 0); }\n else\n { this.forEachInvertedInner(f, from, to, 0); }\n};\n\n// :: ((element: T, index: number) → U, ?number, ?number) → [U]\n// Map the given functions over the elements of the rope, producing\n// a flat array.\nRopeSequence.prototype.map = function map (f, from, to) {\n if ( from === void 0 ) from = 0;\n if ( to === void 0 ) to = this.length;\n\n var result = [];\n this.forEach(function (elt, i) { return result.push(f(elt, i)); }, from, to);\n return result\n};\n\n// :: (?union<[T], RopeSequence>) → RopeSequence\n// Create a rope representing the given array, or return the rope\n// itself if a rope was given.\nRopeSequence.from = function from (values) {\n if (values instanceof RopeSequence) { return values }\n return values && values.length ? new Leaf(values) : RopeSequence.empty\n};\n\nvar Leaf = /*@__PURE__*/(function (RopeSequence) {\n function Leaf(values) {\n RopeSequence.call(this);\n this.values = values;\n }\n\n if ( RopeSequence ) Leaf.__proto__ = RopeSequence;\n Leaf.prototype = Object.create( RopeSequence && RopeSequence.prototype );\n Leaf.prototype.constructor = Leaf;\n\n var prototypeAccessors = { length: { configurable: true },depth: { configurable: true } };\n\n Leaf.prototype.flatten = function flatten () {\n return this.values\n };\n\n Leaf.prototype.sliceInner = function sliceInner (from, to) {\n if (from == 0 && to == this.length) { return this }\n return new Leaf(this.values.slice(from, to))\n };\n\n Leaf.prototype.getInner = function getInner (i) {\n return this.values[i]\n };\n\n Leaf.prototype.forEachInner = function forEachInner (f, from, to, start) {\n for (var i = from; i < to; i++)\n { if (f(this.values[i], start + i) === false) { return false } }\n };\n\n Leaf.prototype.forEachInvertedInner = function forEachInvertedInner (f, from, to, start) {\n for (var i = from - 1; i >= to; i--)\n { if (f(this.values[i], start + i) === false) { return false } }\n };\n\n Leaf.prototype.leafAppend = function leafAppend (other) {\n if (this.length + other.length <= GOOD_LEAF_SIZE)\n { return new Leaf(this.values.concat(other.flatten())) }\n };\n\n Leaf.prototype.leafPrepend = function leafPrepend (other) {\n if (this.length + other.length <= GOOD_LEAF_SIZE)\n { return new Leaf(other.flatten().concat(this.values)) }\n };\n\n prototypeAccessors.length.get = function () { return this.values.length };\n\n prototypeAccessors.depth.get = function () { return 0 };\n\n Object.defineProperties( Leaf.prototype, prototypeAccessors );\n\n return Leaf;\n}(RopeSequence));\n\n// :: RopeSequence\n// The empty rope sequence.\nRopeSequence.empty = new Leaf([]);\n\nvar Append = /*@__PURE__*/(function (RopeSequence) {\n function Append(left, right) {\n RopeSequence.call(this);\n this.left = left;\n this.right = right;\n this.length = left.length + right.length;\n this.depth = Math.max(left.depth, right.depth) + 1;\n }\n\n if ( RopeSequence ) Append.__proto__ = RopeSequence;\n Append.prototype = Object.create( RopeSequence && RopeSequence.prototype );\n Append.prototype.constructor = Append;\n\n Append.prototype.flatten = function flatten () {\n return this.left.flatten().concat(this.right.flatten())\n };\n\n Append.prototype.getInner = function getInner (i) {\n return i < this.left.length ? this.left.get(i) : this.right.get(i - this.left.length)\n };\n\n Append.prototype.forEachInner = function forEachInner (f, from, to, start) {\n var leftLen = this.left.length;\n if (from < leftLen &&\n this.left.forEachInner(f, from, Math.min(to, leftLen), start) === false)\n { return false }\n if (to > leftLen &&\n this.right.forEachInner(f, Math.max(from - leftLen, 0), Math.min(this.length, to) - leftLen, start + leftLen) === false)\n { return false }\n };\n\n Append.prototype.forEachInvertedInner = function forEachInvertedInner (f, from, to, start) {\n var leftLen = this.left.length;\n if (from > leftLen &&\n this.right.forEachInvertedInner(f, from - leftLen, Math.max(to, leftLen) - leftLen, start + leftLen) === false)\n { return false }\n if (to < leftLen &&\n this.left.forEachInvertedInner(f, Math.min(from, leftLen), to, start) === false)\n { return false }\n };\n\n Append.prototype.sliceInner = function sliceInner (from, to) {\n if (from == 0 && to == this.length) { return this }\n var leftLen = this.left.length;\n if (to <= leftLen) { return this.left.slice(from, to) }\n if (from >= leftLen) { return this.right.slice(from - leftLen, to - leftLen) }\n return this.left.slice(from, leftLen).append(this.right.slice(0, to - leftLen))\n };\n\n Append.prototype.leafAppend = function leafAppend (other) {\n var inner = this.right.leafAppend(other);\n if (inner) { return new Append(this.left, inner) }\n };\n\n Append.prototype.leafPrepend = function leafPrepend (other) {\n var inner = this.left.leafPrepend(other);\n if (inner) { return new Append(inner, this.right) }\n };\n\n Append.prototype.appendInner = function appendInner (other) {\n if (this.left.depth >= Math.max(this.right.depth, other.depth) + 1)\n { return new Append(this.left, new Append(this.right, other)) }\n return new Append(this, other)\n };\n\n return Append;\n}(RopeSequence));\n\nvar ropeSequence = RopeSequence;\n\nexport default ropeSequence;\n","// ::- Persistent data structure representing an ordered mapping from\n// strings to values, with some convenient update methods.\nfunction OrderedMap(content) {\n this.content = content;\n}\n\nOrderedMap.prototype = {\n constructor: OrderedMap,\n\n find: function(key) {\n for (var i = 0; i < this.content.length; i += 2)\n if (this.content[i] === key) return i\n return -1\n },\n\n // :: (string) → ?any\n // Retrieve the value stored under `key`, or return undefined when\n // no such key exists.\n get: function(key) {\n var found = this.find(key);\n return found == -1 ? undefined : this.content[found + 1]\n },\n\n // :: (string, any, ?string) → OrderedMap\n // Create a new map by replacing the value of `key` with a new\n // value, or adding a binding to the end of the map. If `newKey` is\n // given, the key of the binding will be replaced with that key.\n update: function(key, value, newKey) {\n var self = newKey && newKey != key ? this.remove(newKey) : this;\n var found = self.find(key), content = self.content.slice();\n if (found == -1) {\n content.push(newKey || key, value);\n } else {\n content[found + 1] = value;\n if (newKey) content[found] = newKey;\n }\n return new OrderedMap(content)\n },\n\n // :: (string) → OrderedMap\n // Return a map with the given key removed, if it existed.\n remove: function(key) {\n var found = this.find(key);\n if (found == -1) return this\n var content = this.content.slice();\n content.splice(found, 2);\n return new OrderedMap(content)\n },\n\n // :: (string, any) → OrderedMap\n // Add a new key to the start of the map.\n addToStart: function(key, value) {\n return new OrderedMap([key, value].concat(this.remove(key).content))\n },\n\n // :: (string, any) → OrderedMap\n // Add a new key to the end of the map.\n addToEnd: function(key, value) {\n var content = this.remove(key).content.slice();\n content.push(key, value);\n return new OrderedMap(content)\n },\n\n // :: (string, string, any) → OrderedMap\n // Add a key after the given key. If `place` is not found, the new\n // key is added to the end.\n addBefore: function(place, key, value) {\n var without = this.remove(key), content = without.content.slice();\n var found = without.find(place);\n content.splice(found == -1 ? content.length : found, 0, key, value);\n return new OrderedMap(content)\n },\n\n // :: ((key: string, value: any))\n // Call the given function for each key/value pair in the map, in\n // order.\n forEach: function(f) {\n for (var i = 0; i < this.content.length; i += 2)\n f(this.content[i], this.content[i + 1]);\n },\n\n // :: (union) → OrderedMap\n // Create a new map by prepending the keys in this map that don't\n // appear in `map` before the keys in `map`.\n prepend: function(map) {\n map = OrderedMap.from(map);\n if (!map.size) return this\n return new OrderedMap(map.content.concat(this.subtract(map).content))\n },\n\n // :: (union) → OrderedMap\n // Create a new map by appending the keys in this map that don't\n // appear in `map` after the keys in `map`.\n append: function(map) {\n map = OrderedMap.from(map);\n if (!map.size) return this\n return new OrderedMap(this.subtract(map).content.concat(map.content))\n },\n\n // :: (union) → OrderedMap\n // Create a map containing all the keys in this map that don't\n // appear in `map`.\n subtract: function(map) {\n var result = this;\n map = OrderedMap.from(map);\n for (var i = 0; i < map.content.length; i += 2)\n result = result.remove(map.content[i]);\n return result\n },\n\n // :: () → Object\n // Turn ordered map into a plain object.\n toObject: function() {\n var result = {};\n this.forEach(function(key, value) { result[key] = value; });\n return result\n },\n\n // :: number\n // The amount of keys in this map.\n get size() {\n return this.content.length >> 1\n }\n};\n\n// :: (?union) → OrderedMap\n// Return a map with the given content. If null, create an empty\n// map. If given an ordered map, return that map itself. If given an\n// object, create a map from the object's properties.\nOrderedMap.from = function(value) {\n if (value instanceof OrderedMap) return value\n var content = [];\n if (value) for (var prop in value) content.push(prop, value[prop]);\n return new OrderedMap(content)\n};\n\nexport default OrderedMap;\n","import OrderedMap from 'orderedmap';\n\nfunction findDiffStart(a, b, pos) {\n for (let i = 0;; i++) {\n if (i == a.childCount || i == b.childCount)\n return a.childCount == b.childCount ? null : pos;\n let childA = a.child(i), childB = b.child(i);\n if (childA == childB) {\n pos += childA.nodeSize;\n continue;\n }\n if (!childA.sameMarkup(childB))\n return pos;\n if (childA.isText && childA.text != childB.text) {\n for (let j = 0; childA.text[j] == childB.text[j]; j++)\n pos++;\n return pos;\n }\n if (childA.content.size || childB.content.size) {\n let inner = findDiffStart(childA.content, childB.content, pos + 1);\n if (inner != null)\n return inner;\n }\n pos += childA.nodeSize;\n }\n}\nfunction findDiffEnd(a, b, posA, posB) {\n for (let iA = a.childCount, iB = b.childCount;;) {\n if (iA == 0 || iB == 0)\n return iA == iB ? null : { a: posA, b: posB };\n let childA = a.child(--iA), childB = b.child(--iB), size = childA.nodeSize;\n if (childA == childB) {\n posA -= size;\n posB -= size;\n continue;\n }\n if (!childA.sameMarkup(childB))\n return { a: posA, b: posB };\n if (childA.isText && childA.text != childB.text) {\n let same = 0, minSize = Math.min(childA.text.length, childB.text.length);\n while (same < minSize && childA.text[childA.text.length - same - 1] == childB.text[childB.text.length - same - 1]) {\n same++;\n posA--;\n posB--;\n }\n return { a: posA, b: posB };\n }\n if (childA.content.size || childB.content.size) {\n let inner = findDiffEnd(childA.content, childB.content, posA - 1, posB - 1);\n if (inner)\n return inner;\n }\n posA -= size;\n posB -= size;\n }\n}\n\n/**\nA fragment represents a node's collection of child nodes.\n\nLike nodes, fragments are persistent data structures, and you\nshould not mutate them or their content. Rather, you create new\ninstances whenever needed. The API tries to make this easy.\n*/\nclass Fragment {\n /**\n @internal\n */\n constructor(\n /**\n @internal\n */\n content, size) {\n this.content = content;\n this.size = size || 0;\n if (size == null)\n for (let i = 0; i < content.length; i++)\n this.size += content[i].nodeSize;\n }\n /**\n Invoke a callback for all descendant nodes between the given two\n positions (relative to start of this fragment). Doesn't descend\n into a node when the callback returns `false`.\n */\n nodesBetween(from, to, f, nodeStart = 0, parent) {\n for (let i = 0, pos = 0; pos < to; i++) {\n let child = this.content[i], end = pos + child.nodeSize;\n if (end > from && f(child, nodeStart + pos, parent || null, i) !== false && child.content.size) {\n let start = pos + 1;\n child.nodesBetween(Math.max(0, from - start), Math.min(child.content.size, to - start), f, nodeStart + start);\n }\n pos = end;\n }\n }\n /**\n Call the given callback for every descendant node. `pos` will be\n relative to the start of the fragment. The callback may return\n `false` to prevent traversal of a given node's children.\n */\n descendants(f) {\n this.nodesBetween(0, this.size, f);\n }\n /**\n Extract the text between `from` and `to`. See the same method on\n [`Node`](https://prosemirror.net/docs/ref/#model.Node.textBetween).\n */\n textBetween(from, to, blockSeparator, leafText) {\n let text = \"\", first = true;\n this.nodesBetween(from, to, (node, pos) => {\n let nodeText = node.isText ? node.text.slice(Math.max(from, pos) - pos, to - pos)\n : !node.isLeaf ? \"\"\n : leafText ? (typeof leafText === \"function\" ? leafText(node) : leafText)\n : node.type.spec.leafText ? node.type.spec.leafText(node)\n : \"\";\n if (node.isBlock && (node.isLeaf && nodeText || node.isTextblock) && blockSeparator) {\n if (first)\n first = false;\n else\n text += blockSeparator;\n }\n text += nodeText;\n }, 0);\n return text;\n }\n /**\n Create a new fragment containing the combined content of this\n fragment and the other.\n */\n append(other) {\n if (!other.size)\n return this;\n if (!this.size)\n return other;\n let last = this.lastChild, first = other.firstChild, content = this.content.slice(), i = 0;\n if (last.isText && last.sameMarkup(first)) {\n content[content.length - 1] = last.withText(last.text + first.text);\n i = 1;\n }\n for (; i < other.content.length; i++)\n content.push(other.content[i]);\n return new Fragment(content, this.size + other.size);\n }\n /**\n Cut out the sub-fragment between the two given positions.\n */\n cut(from, to = this.size) {\n if (from == 0 && to == this.size)\n return this;\n let result = [], size = 0;\n if (to > from)\n for (let i = 0, pos = 0; pos < to; i++) {\n let child = this.content[i], end = pos + child.nodeSize;\n if (end > from) {\n if (pos < from || end > to) {\n if (child.isText)\n child = child.cut(Math.max(0, from - pos), Math.min(child.text.length, to - pos));\n else\n child = child.cut(Math.max(0, from - pos - 1), Math.min(child.content.size, to - pos - 1));\n }\n result.push(child);\n size += child.nodeSize;\n }\n pos = end;\n }\n return new Fragment(result, size);\n }\n /**\n @internal\n */\n cutByIndex(from, to) {\n if (from == to)\n return Fragment.empty;\n if (from == 0 && to == this.content.length)\n return this;\n return new Fragment(this.content.slice(from, to));\n }\n /**\n Create a new fragment in which the node at the given index is\n replaced by the given node.\n */\n replaceChild(index, node) {\n let current = this.content[index];\n if (current == node)\n return this;\n let copy = this.content.slice();\n let size = this.size + node.nodeSize - current.nodeSize;\n copy[index] = node;\n return new Fragment(copy, size);\n }\n /**\n Create a new fragment by prepending the given node to this\n fragment.\n */\n addToStart(node) {\n return new Fragment([node].concat(this.content), this.size + node.nodeSize);\n }\n /**\n Create a new fragment by appending the given node to this\n fragment.\n */\n addToEnd(node) {\n return new Fragment(this.content.concat(node), this.size + node.nodeSize);\n }\n /**\n Compare this fragment to another one.\n */\n eq(other) {\n if (this.content.length != other.content.length)\n return false;\n for (let i = 0; i < this.content.length; i++)\n if (!this.content[i].eq(other.content[i]))\n return false;\n return true;\n }\n /**\n The first child of the fragment, or `null` if it is empty.\n */\n get firstChild() { return this.content.length ? this.content[0] : null; }\n /**\n The last child of the fragment, or `null` if it is empty.\n */\n get lastChild() { return this.content.length ? this.content[this.content.length - 1] : null; }\n /**\n The number of child nodes in this fragment.\n */\n get childCount() { return this.content.length; }\n /**\n Get the child node at the given index. Raise an error when the\n index is out of range.\n */\n child(index) {\n let found = this.content[index];\n if (!found)\n throw new RangeError(\"Index \" + index + \" out of range for \" + this);\n return found;\n }\n /**\n Get the child node at the given index, if it exists.\n */\n maybeChild(index) {\n return this.content[index] || null;\n }\n /**\n Call `f` for every child node, passing the node, its offset\n into this parent node, and its index.\n */\n forEach(f) {\n for (let i = 0, p = 0; i < this.content.length; i++) {\n let child = this.content[i];\n f(child, p, i);\n p += child.nodeSize;\n }\n }\n /**\n Find the first position at which this fragment and another\n fragment differ, or `null` if they are the same.\n */\n findDiffStart(other, pos = 0) {\n return findDiffStart(this, other, pos);\n }\n /**\n Find the first position, searching from the end, at which this\n fragment and the given fragment differ, or `null` if they are\n the same. Since this position will not be the same in both\n nodes, an object with two separate positions is returned.\n */\n findDiffEnd(other, pos = this.size, otherPos = other.size) {\n return findDiffEnd(this, other, pos, otherPos);\n }\n /**\n Find the index and inner offset corresponding to a given relative\n position in this fragment. The result object will be reused\n (overwritten) the next time the function is called. @internal\n */\n findIndex(pos, round = -1) {\n if (pos == 0)\n return retIndex(0, pos);\n if (pos == this.size)\n return retIndex(this.content.length, pos);\n if (pos > this.size || pos < 0)\n throw new RangeError(`Position ${pos} outside of fragment (${this})`);\n for (let i = 0, curPos = 0;; i++) {\n let cur = this.child(i), end = curPos + cur.nodeSize;\n if (end >= pos) {\n if (end == pos || round > 0)\n return retIndex(i + 1, end);\n return retIndex(i, curPos);\n }\n curPos = end;\n }\n }\n /**\n Return a debugging string that describes this fragment.\n */\n toString() { return \"<\" + this.toStringInner() + \">\"; }\n /**\n @internal\n */\n toStringInner() { return this.content.join(\", \"); }\n /**\n Create a JSON-serializeable representation of this fragment.\n */\n toJSON() {\n return this.content.length ? this.content.map(n => n.toJSON()) : null;\n }\n /**\n Deserialize a fragment from its JSON representation.\n */\n static fromJSON(schema, value) {\n if (!value)\n return Fragment.empty;\n if (!Array.isArray(value))\n throw new RangeError(\"Invalid input for Fragment.fromJSON\");\n return new Fragment(value.map(schema.nodeFromJSON));\n }\n /**\n Build a fragment from an array of nodes. Ensures that adjacent\n text nodes with the same marks are joined together.\n */\n static fromArray(array) {\n if (!array.length)\n return Fragment.empty;\n let joined, size = 0;\n for (let i = 0; i < array.length; i++) {\n let node = array[i];\n size += node.nodeSize;\n if (i && node.isText && array[i - 1].sameMarkup(node)) {\n if (!joined)\n joined = array.slice(0, i);\n joined[joined.length - 1] = node\n .withText(joined[joined.length - 1].text + node.text);\n }\n else if (joined) {\n joined.push(node);\n }\n }\n return new Fragment(joined || array, size);\n }\n /**\n Create a fragment from something that can be interpreted as a\n set of nodes. For `null`, it returns the empty fragment. For a\n fragment, the fragment itself. For a node or array of nodes, a\n fragment containing those nodes.\n */\n static from(nodes) {\n if (!nodes)\n return Fragment.empty;\n if (nodes instanceof Fragment)\n return nodes;\n if (Array.isArray(nodes))\n return this.fromArray(nodes);\n if (nodes.attrs)\n return new Fragment([nodes], nodes.nodeSize);\n throw new RangeError(\"Can not convert \" + nodes + \" to a Fragment\" +\n (nodes.nodesBetween ? \" (looks like multiple versions of prosemirror-model were loaded)\" : \"\"));\n }\n}\n/**\nAn empty fragment. Intended to be reused whenever a node doesn't\ncontain anything (rather than allocating a new empty fragment for\neach leaf node).\n*/\nFragment.empty = new Fragment([], 0);\nconst found = { index: 0, offset: 0 };\nfunction retIndex(index, offset) {\n found.index = index;\n found.offset = offset;\n return found;\n}\n\nfunction compareDeep(a, b) {\n if (a === b)\n return true;\n if (!(a && typeof a == \"object\") ||\n !(b && typeof b == \"object\"))\n return false;\n let array = Array.isArray(a);\n if (Array.isArray(b) != array)\n return false;\n if (array) {\n if (a.length != b.length)\n return false;\n for (let i = 0; i < a.length; i++)\n if (!compareDeep(a[i], b[i]))\n return false;\n }\n else {\n for (let p in a)\n if (!(p in b) || !compareDeep(a[p], b[p]))\n return false;\n for (let p in b)\n if (!(p in a))\n return false;\n }\n return true;\n}\n\n/**\nA mark is a piece of information that can be attached to a node,\nsuch as it being emphasized, in code font, or a link. It has a\ntype and optionally a set of attributes that provide further\ninformation (such as the target of the link). Marks are created\nthrough a `Schema`, which controls which types exist and which\nattributes they have.\n*/\nclass Mark {\n /**\n @internal\n */\n constructor(\n /**\n The type of this mark.\n */\n type, \n /**\n The attributes associated with this mark.\n */\n attrs) {\n this.type = type;\n this.attrs = attrs;\n }\n /**\n Given a set of marks, create a new set which contains this one as\n well, in the right position. If this mark is already in the set,\n the set itself is returned. If any marks that are set to be\n [exclusive](https://prosemirror.net/docs/ref/#model.MarkSpec.excludes) with this mark are present,\n those are replaced by this one.\n */\n addToSet(set) {\n let copy, placed = false;\n for (let i = 0; i < set.length; i++) {\n let other = set[i];\n if (this.eq(other))\n return set;\n if (this.type.excludes(other.type)) {\n if (!copy)\n copy = set.slice(0, i);\n }\n else if (other.type.excludes(this.type)) {\n return set;\n }\n else {\n if (!placed && other.type.rank > this.type.rank) {\n if (!copy)\n copy = set.slice(0, i);\n copy.push(this);\n placed = true;\n }\n if (copy)\n copy.push(other);\n }\n }\n if (!copy)\n copy = set.slice();\n if (!placed)\n copy.push(this);\n return copy;\n }\n /**\n Remove this mark from the given set, returning a new set. If this\n mark is not in the set, the set itself is returned.\n */\n removeFromSet(set) {\n for (let i = 0; i < set.length; i++)\n if (this.eq(set[i]))\n return set.slice(0, i).concat(set.slice(i + 1));\n return set;\n }\n /**\n Test whether this mark is in the given set of marks.\n */\n isInSet(set) {\n for (let i = 0; i < set.length; i++)\n if (this.eq(set[i]))\n return true;\n return false;\n }\n /**\n Test whether this mark has the same type and attributes as\n another mark.\n */\n eq(other) {\n return this == other ||\n (this.type == other.type && compareDeep(this.attrs, other.attrs));\n }\n /**\n Convert this mark to a JSON-serializeable representation.\n */\n toJSON() {\n let obj = { type: this.type.name };\n for (let _ in this.attrs) {\n obj.attrs = this.attrs;\n break;\n }\n return obj;\n }\n /**\n Deserialize a mark from JSON.\n */\n static fromJSON(schema, json) {\n if (!json)\n throw new RangeError(\"Invalid input for Mark.fromJSON\");\n let type = schema.marks[json.type];\n if (!type)\n throw new RangeError(`There is no mark type ${json.type} in this schema`);\n let mark = type.create(json.attrs);\n type.checkAttrs(mark.attrs);\n return mark;\n }\n /**\n Test whether two sets of marks are identical.\n */\n static sameSet(a, b) {\n if (a == b)\n return true;\n if (a.length != b.length)\n return false;\n for (let i = 0; i < a.length; i++)\n if (!a[i].eq(b[i]))\n return false;\n return true;\n }\n /**\n Create a properly sorted mark set from null, a single mark, or an\n unsorted array of marks.\n */\n static setFrom(marks) {\n if (!marks || Array.isArray(marks) && marks.length == 0)\n return Mark.none;\n if (marks instanceof Mark)\n return [marks];\n let copy = marks.slice();\n copy.sort((a, b) => a.type.rank - b.type.rank);\n return copy;\n }\n}\n/**\nThe empty set of marks.\n*/\nMark.none = [];\n\n/**\nError type raised by [`Node.replace`](https://prosemirror.net/docs/ref/#model.Node.replace) when\ngiven an invalid replacement.\n*/\nclass ReplaceError extends Error {\n}\n/*\nReplaceError = function(this: any, message: string) {\n let err = Error.call(this, message)\n ;(err as any).__proto__ = ReplaceError.prototype\n return err\n} as any\n\nReplaceError.prototype = Object.create(Error.prototype)\nReplaceError.prototype.constructor = ReplaceError\nReplaceError.prototype.name = \"ReplaceError\"\n*/\n/**\nA slice represents a piece cut out of a larger document. It\nstores not only a fragment, but also the depth up to which nodes on\nboth side are ‘open’ (cut through).\n*/\nclass Slice {\n /**\n Create a slice. When specifying a non-zero open depth, you must\n make sure that there are nodes of at least that depth at the\n appropriate side of the fragment—i.e. if the fragment is an\n empty paragraph node, `openStart` and `openEnd` can't be greater\n than 1.\n \n It is not necessary for the content of open nodes to conform to\n the schema's content constraints, though it should be a valid\n start/end/middle for such a node, depending on which sides are\n open.\n */\n constructor(\n /**\n The slice's content.\n */\n content, \n /**\n The open depth at the start of the fragment.\n */\n openStart, \n /**\n The open depth at the end.\n */\n openEnd) {\n this.content = content;\n this.openStart = openStart;\n this.openEnd = openEnd;\n }\n /**\n The size this slice would add when inserted into a document.\n */\n get size() {\n return this.content.size - this.openStart - this.openEnd;\n }\n /**\n @internal\n */\n insertAt(pos, fragment) {\n let content = insertInto(this.content, pos + this.openStart, fragment);\n return content && new Slice(content, this.openStart, this.openEnd);\n }\n /**\n @internal\n */\n removeBetween(from, to) {\n return new Slice(removeRange(this.content, from + this.openStart, to + this.openStart), this.openStart, this.openEnd);\n }\n /**\n Tests whether this slice is equal to another slice.\n */\n eq(other) {\n return this.content.eq(other.content) && this.openStart == other.openStart && this.openEnd == other.openEnd;\n }\n /**\n @internal\n */\n toString() {\n return this.content + \"(\" + this.openStart + \",\" + this.openEnd + \")\";\n }\n /**\n Convert a slice to a JSON-serializable representation.\n */\n toJSON() {\n if (!this.content.size)\n return null;\n let json = { content: this.content.toJSON() };\n if (this.openStart > 0)\n json.openStart = this.openStart;\n if (this.openEnd > 0)\n json.openEnd = this.openEnd;\n return json;\n }\n /**\n Deserialize a slice from its JSON representation.\n */\n static fromJSON(schema, json) {\n if (!json)\n return Slice.empty;\n let openStart = json.openStart || 0, openEnd = json.openEnd || 0;\n if (typeof openStart != \"number\" || typeof openEnd != \"number\")\n throw new RangeError(\"Invalid input for Slice.fromJSON\");\n return new Slice(Fragment.fromJSON(schema, json.content), openStart, openEnd);\n }\n /**\n Create a slice from a fragment by taking the maximum possible\n open value on both side of the fragment.\n */\n static maxOpen(fragment, openIsolating = true) {\n let openStart = 0, openEnd = 0;\n for (let n = fragment.firstChild; n && !n.isLeaf && (openIsolating || !n.type.spec.isolating); n = n.firstChild)\n openStart++;\n for (let n = fragment.lastChild; n && !n.isLeaf && (openIsolating || !n.type.spec.isolating); n = n.lastChild)\n openEnd++;\n return new Slice(fragment, openStart, openEnd);\n }\n}\n/**\nThe empty slice.\n*/\nSlice.empty = new Slice(Fragment.empty, 0, 0);\nfunction removeRange(content, from, to) {\n let { index, offset } = content.findIndex(from), child = content.maybeChild(index);\n let { index: indexTo, offset: offsetTo } = content.findIndex(to);\n if (offset == from || child.isText) {\n if (offsetTo != to && !content.child(indexTo).isText)\n throw new RangeError(\"Removing non-flat range\");\n return content.cut(0, from).append(content.cut(to));\n }\n if (index != indexTo)\n throw new RangeError(\"Removing non-flat range\");\n return content.replaceChild(index, child.copy(removeRange(child.content, from - offset - 1, to - offset - 1)));\n}\nfunction insertInto(content, dist, insert, parent) {\n let { index, offset } = content.findIndex(dist), child = content.maybeChild(index);\n if (offset == dist || child.isText) {\n if (parent && !parent.canReplace(index, index, insert))\n return null;\n return content.cut(0, dist).append(insert).append(content.cut(dist));\n }\n let inner = insertInto(child.content, dist - offset - 1, insert);\n return inner && content.replaceChild(index, child.copy(inner));\n}\nfunction replace($from, $to, slice) {\n if (slice.openStart > $from.depth)\n throw new ReplaceError(\"Inserted content deeper than insertion position\");\n if ($from.depth - slice.openStart != $to.depth - slice.openEnd)\n throw new ReplaceError(\"Inconsistent open depths\");\n return replaceOuter($from, $to, slice, 0);\n}\nfunction replaceOuter($from, $to, slice, depth) {\n let index = $from.index(depth), node = $from.node(depth);\n if (index == $to.index(depth) && depth < $from.depth - slice.openStart) {\n let inner = replaceOuter($from, $to, slice, depth + 1);\n return node.copy(node.content.replaceChild(index, inner));\n }\n else if (!slice.content.size) {\n return close(node, replaceTwoWay($from, $to, depth));\n }\n else if (!slice.openStart && !slice.openEnd && $from.depth == depth && $to.depth == depth) { // Simple, flat case\n let parent = $from.parent, content = parent.content;\n return close(parent, content.cut(0, $from.parentOffset).append(slice.content).append(content.cut($to.parentOffset)));\n }\n else {\n let { start, end } = prepareSliceForReplace(slice, $from);\n return close(node, replaceThreeWay($from, start, end, $to, depth));\n }\n}\nfunction checkJoin(main, sub) {\n if (!sub.type.compatibleContent(main.type))\n throw new ReplaceError(\"Cannot join \" + sub.type.name + \" onto \" + main.type.name);\n}\nfunction joinable($before, $after, depth) {\n let node = $before.node(depth);\n checkJoin(node, $after.node(depth));\n return node;\n}\nfunction addNode(child, target) {\n let last = target.length - 1;\n if (last >= 0 && child.isText && child.sameMarkup(target[last]))\n target[last] = child.withText(target[last].text + child.text);\n else\n target.push(child);\n}\nfunction addRange($start, $end, depth, target) {\n let node = ($end || $start).node(depth);\n let startIndex = 0, endIndex = $end ? $end.index(depth) : node.childCount;\n if ($start) {\n startIndex = $start.index(depth);\n if ($start.depth > depth) {\n startIndex++;\n }\n else if ($start.textOffset) {\n addNode($start.nodeAfter, target);\n startIndex++;\n }\n }\n for (let i = startIndex; i < endIndex; i++)\n addNode(node.child(i), target);\n if ($end && $end.depth == depth && $end.textOffset)\n addNode($end.nodeBefore, target);\n}\nfunction close(node, content) {\n node.type.checkContent(content);\n return node.copy(content);\n}\nfunction replaceThreeWay($from, $start, $end, $to, depth) {\n let openStart = $from.depth > depth && joinable($from, $start, depth + 1);\n let openEnd = $to.depth > depth && joinable($end, $to, depth + 1);\n let content = [];\n addRange(null, $from, depth, content);\n if (openStart && openEnd && $start.index(depth) == $end.index(depth)) {\n checkJoin(openStart, openEnd);\n addNode(close(openStart, replaceThreeWay($from, $start, $end, $to, depth + 1)), content);\n }\n else {\n if (openStart)\n addNode(close(openStart, replaceTwoWay($from, $start, depth + 1)), content);\n addRange($start, $end, depth, content);\n if (openEnd)\n addNode(close(openEnd, replaceTwoWay($end, $to, depth + 1)), content);\n }\n addRange($to, null, depth, content);\n return new Fragment(content);\n}\nfunction replaceTwoWay($from, $to, depth) {\n let content = [];\n addRange(null, $from, depth, content);\n if ($from.depth > depth) {\n let type = joinable($from, $to, depth + 1);\n addNode(close(type, replaceTwoWay($from, $to, depth + 1)), content);\n }\n addRange($to, null, depth, content);\n return new Fragment(content);\n}\nfunction prepareSliceForReplace(slice, $along) {\n let extra = $along.depth - slice.openStart, parent = $along.node(extra);\n let node = parent.copy(slice.content);\n for (let i = extra - 1; i >= 0; i--)\n node = $along.node(i).copy(Fragment.from(node));\n return { start: node.resolveNoCache(slice.openStart + extra),\n end: node.resolveNoCache(node.content.size - slice.openEnd - extra) };\n}\n\n/**\nYou can [_resolve_](https://prosemirror.net/docs/ref/#model.Node.resolve) a position to get more\ninformation about it. Objects of this class represent such a\nresolved position, providing various pieces of context\ninformation, and some helper methods.\n\nThroughout this interface, methods that take an optional `depth`\nparameter will interpret undefined as `this.depth` and negative\nnumbers as `this.depth + value`.\n*/\nclass ResolvedPos {\n /**\n @internal\n */\n constructor(\n /**\n The position that was resolved.\n */\n pos, \n /**\n @internal\n */\n path, \n /**\n The offset this position has into its parent node.\n */\n parentOffset) {\n this.pos = pos;\n this.path = path;\n this.parentOffset = parentOffset;\n this.depth = path.length / 3 - 1;\n }\n /**\n @internal\n */\n resolveDepth(val) {\n if (val == null)\n return this.depth;\n if (val < 0)\n return this.depth + val;\n return val;\n }\n /**\n The parent node that the position points into. Note that even if\n a position points into a text node, that node is not considered\n the parent—text nodes are ‘flat’ in this model, and have no content.\n */\n get parent() { return this.node(this.depth); }\n /**\n The root node in which the position was resolved.\n */\n get doc() { return this.node(0); }\n /**\n The ancestor node at the given level. `p.node(p.depth)` is the\n same as `p.parent`.\n */\n node(depth) { return this.path[this.resolveDepth(depth) * 3]; }\n /**\n The index into the ancestor at the given level. If this points\n at the 3rd node in the 2nd paragraph on the top level, for\n example, `p.index(0)` is 1 and `p.index(1)` is 2.\n */\n index(depth) { return this.path[this.resolveDepth(depth) * 3 + 1]; }\n /**\n The index pointing after this position into the ancestor at the\n given level.\n */\n indexAfter(depth) {\n depth = this.resolveDepth(depth);\n return this.index(depth) + (depth == this.depth && !this.textOffset ? 0 : 1);\n }\n /**\n The (absolute) position at the start of the node at the given\n level.\n */\n start(depth) {\n depth = this.resolveDepth(depth);\n return depth == 0 ? 0 : this.path[depth * 3 - 1] + 1;\n }\n /**\n The (absolute) position at the end of the node at the given\n level.\n */\n end(depth) {\n depth = this.resolveDepth(depth);\n return this.start(depth) + this.node(depth).content.size;\n }\n /**\n The (absolute) position directly before the wrapping node at the\n given level, or, when `depth` is `this.depth + 1`, the original\n position.\n */\n before(depth) {\n depth = this.resolveDepth(depth);\n if (!depth)\n throw new RangeError(\"There is no position before the top-level node\");\n return depth == this.depth + 1 ? this.pos : this.path[depth * 3 - 1];\n }\n /**\n The (absolute) position directly after the wrapping node at the\n given level, or the original position when `depth` is `this.depth + 1`.\n */\n after(depth) {\n depth = this.resolveDepth(depth);\n if (!depth)\n throw new RangeError(\"There is no position after the top-level node\");\n return depth == this.depth + 1 ? this.pos : this.path[depth * 3 - 1] + this.path[depth * 3].nodeSize;\n }\n /**\n When this position points into a text node, this returns the\n distance between the position and the start of the text node.\n Will be zero for positions that point between nodes.\n */\n get textOffset() { return this.pos - this.path[this.path.length - 1]; }\n /**\n Get the node directly after the position, if any. If the position\n points into a text node, only the part of that node after the\n position is returned.\n */\n get nodeAfter() {\n let parent = this.parent, index = this.index(this.depth);\n if (index == parent.childCount)\n return null;\n let dOff = this.pos - this.path[this.path.length - 1], child = parent.child(index);\n return dOff ? parent.child(index).cut(dOff) : child;\n }\n /**\n Get the node directly before the position, if any. If the\n position points into a text node, only the part of that node\n before the position is returned.\n */\n get nodeBefore() {\n let index = this.index(this.depth);\n let dOff = this.pos - this.path[this.path.length - 1];\n if (dOff)\n return this.parent.child(index).cut(0, dOff);\n return index == 0 ? null : this.parent.child(index - 1);\n }\n /**\n Get the position at the given index in the parent node at the\n given depth (which defaults to `this.depth`).\n */\n posAtIndex(index, depth) {\n depth = this.resolveDepth(depth);\n let node = this.path[depth * 3], pos = depth == 0 ? 0 : this.path[depth * 3 - 1] + 1;\n for (let i = 0; i < index; i++)\n pos += node.child(i).nodeSize;\n return pos;\n }\n /**\n Get the marks at this position, factoring in the surrounding\n marks' [`inclusive`](https://prosemirror.net/docs/ref/#model.MarkSpec.inclusive) property. If the\n position is at the start of a non-empty node, the marks of the\n node after it (if any) are returned.\n */\n marks() {\n let parent = this.parent, index = this.index();\n // In an empty parent, return the empty array\n if (parent.content.size == 0)\n return Mark.none;\n // When inside a text node, just return the text node's marks\n if (this.textOffset)\n return parent.child(index).marks;\n let main = parent.maybeChild(index - 1), other = parent.maybeChild(index);\n // If the `after` flag is true of there is no node before, make\n // the node after this position the main reference.\n if (!main) {\n let tmp = main;\n main = other;\n other = tmp;\n }\n // Use all marks in the main node, except those that have\n // `inclusive` set to false and are not present in the other node.\n let marks = main.marks;\n for (var i = 0; i < marks.length; i++)\n if (marks[i].type.spec.inclusive === false && (!other || !marks[i].isInSet(other.marks)))\n marks = marks[i--].removeFromSet(marks);\n return marks;\n }\n /**\n Get the marks after the current position, if any, except those\n that are non-inclusive and not present at position `$end`. This\n is mostly useful for getting the set of marks to preserve after a\n deletion. Will return `null` if this position is at the end of\n its parent node or its parent node isn't a textblock (in which\n case no marks should be preserved).\n */\n marksAcross($end) {\n let after = this.parent.maybeChild(this.index());\n if (!after || !after.isInline)\n return null;\n let marks = after.marks, next = $end.parent.maybeChild($end.index());\n for (var i = 0; i < marks.length; i++)\n if (marks[i].type.spec.inclusive === false && (!next || !marks[i].isInSet(next.marks)))\n marks = marks[i--].removeFromSet(marks);\n return marks;\n }\n /**\n The depth up to which this position and the given (non-resolved)\n position share the same parent nodes.\n */\n sharedDepth(pos) {\n for (let depth = this.depth; depth > 0; depth--)\n if (this.start(depth) <= pos && this.end(depth) >= pos)\n return depth;\n return 0;\n }\n /**\n Returns a range based on the place where this position and the\n given position diverge around block content. If both point into\n the same textblock, for example, a range around that textblock\n will be returned. If they point into different blocks, the range\n around those blocks in their shared ancestor is returned. You can\n pass in an optional predicate that will be called with a parent\n node to see if a range into that parent is acceptable.\n */\n blockRange(other = this, pred) {\n if (other.pos < this.pos)\n return other.blockRange(this);\n for (let d = this.depth - (this.parent.inlineContent || this.pos == other.pos ? 1 : 0); d >= 0; d--)\n if (other.pos <= this.end(d) && (!pred || pred(this.node(d))))\n return new NodeRange(this, other, d);\n return null;\n }\n /**\n Query whether the given position shares the same parent node.\n */\n sameParent(other) {\n return this.pos - this.parentOffset == other.pos - other.parentOffset;\n }\n /**\n Return the greater of this and the given position.\n */\n max(other) {\n return other.pos > this.pos ? other : this;\n }\n /**\n Return the smaller of this and the given position.\n */\n min(other) {\n return other.pos < this.pos ? other : this;\n }\n /**\n @internal\n */\n toString() {\n let str = \"\";\n for (let i = 1; i <= this.depth; i++)\n str += (str ? \"/\" : \"\") + this.node(i).type.name + \"_\" + this.index(i - 1);\n return str + \":\" + this.parentOffset;\n }\n /**\n @internal\n */\n static resolve(doc, pos) {\n if (!(pos >= 0 && pos <= doc.content.size))\n throw new RangeError(\"Position \" + pos + \" out of range\");\n let path = [];\n let start = 0, parentOffset = pos;\n for (let node = doc;;) {\n let { index, offset } = node.content.findIndex(parentOffset);\n let rem = parentOffset - offset;\n path.push(node, index, start + offset);\n if (!rem)\n break;\n node = node.child(index);\n if (node.isText)\n break;\n parentOffset = rem - 1;\n start += offset + 1;\n }\n return new ResolvedPos(pos, path, parentOffset);\n }\n /**\n @internal\n */\n static resolveCached(doc, pos) {\n let cache = resolveCache.get(doc);\n if (cache) {\n for (let i = 0; i < cache.elts.length; i++) {\n let elt = cache.elts[i];\n if (elt.pos == pos)\n return elt;\n }\n }\n else {\n resolveCache.set(doc, cache = new ResolveCache);\n }\n let result = cache.elts[cache.i] = ResolvedPos.resolve(doc, pos);\n cache.i = (cache.i + 1) % resolveCacheSize;\n return result;\n }\n}\nclass ResolveCache {\n constructor() {\n this.elts = [];\n this.i = 0;\n }\n}\nconst resolveCacheSize = 12, resolveCache = new WeakMap();\n/**\nRepresents a flat range of content, i.e. one that starts and\nends in the same node.\n*/\nclass NodeRange {\n /**\n Construct a node range. `$from` and `$to` should point into the\n same node until at least the given `depth`, since a node range\n denotes an adjacent set of nodes in a single parent node.\n */\n constructor(\n /**\n A resolved position along the start of the content. May have a\n `depth` greater than this object's `depth` property, since\n these are the positions that were used to compute the range,\n not re-resolved positions directly at its boundaries.\n */\n $from, \n /**\n A position along the end of the content. See\n caveat for [`$from`](https://prosemirror.net/docs/ref/#model.NodeRange.$from).\n */\n $to, \n /**\n The depth of the node that this range points into.\n */\n depth) {\n this.$from = $from;\n this.$to = $to;\n this.depth = depth;\n }\n /**\n The position at the start of the range.\n */\n get start() { return this.$from.before(this.depth + 1); }\n /**\n The position at the end of the range.\n */\n get end() { return this.$to.after(this.depth + 1); }\n /**\n The parent node that the range points into.\n */\n get parent() { return this.$from.node(this.depth); }\n /**\n The start index of the range in the parent node.\n */\n get startIndex() { return this.$from.index(this.depth); }\n /**\n The end index of the range in the parent node.\n */\n get endIndex() { return this.$to.indexAfter(this.depth); }\n}\n\nconst emptyAttrs = Object.create(null);\n/**\nThis class represents a node in the tree that makes up a\nProseMirror document. So a document is an instance of `Node`, with\nchildren that are also instances of `Node`.\n\nNodes are persistent data structures. Instead of changing them, you\ncreate new ones with the content you want. Old ones keep pointing\nat the old document shape. This is made cheaper by sharing\nstructure between the old and new data as much as possible, which a\ntree shape like this (without back pointers) makes easy.\n\n**Do not** directly mutate the properties of a `Node` object. See\n[the guide](/docs/guide/#doc) for more information.\n*/\nclass Node {\n /**\n @internal\n */\n constructor(\n /**\n The type of node that this is.\n */\n type, \n /**\n An object mapping attribute names to values. The kind of\n attributes allowed and required are\n [determined](https://prosemirror.net/docs/ref/#model.NodeSpec.attrs) by the node type.\n */\n attrs, \n // A fragment holding the node's children.\n content, \n /**\n The marks (things like whether it is emphasized or part of a\n link) applied to this node.\n */\n marks = Mark.none) {\n this.type = type;\n this.attrs = attrs;\n this.marks = marks;\n this.content = content || Fragment.empty;\n }\n /**\n The size of this node, as defined by the integer-based [indexing\n scheme](/docs/guide/#doc.indexing). For text nodes, this is the\n amount of characters. For other leaf nodes, it is one. For\n non-leaf nodes, it is the size of the content plus two (the\n start and end token).\n */\n get nodeSize() { return this.isLeaf ? 1 : 2 + this.content.size; }\n /**\n The number of children that the node has.\n */\n get childCount() { return this.content.childCount; }\n /**\n Get the child node at the given index. Raises an error when the\n index is out of range.\n */\n child(index) { return this.content.child(index); }\n /**\n Get the child node at the given index, if it exists.\n */\n maybeChild(index) { return this.content.maybeChild(index); }\n /**\n Call `f` for every child node, passing the node, its offset\n into this parent node, and its index.\n */\n forEach(f) { this.content.forEach(f); }\n /**\n Invoke a callback for all descendant nodes recursively between\n the given two positions that are relative to start of this\n node's content. The callback is invoked with the node, its\n position relative to the original node (method receiver),\n its parent node, and its child index. When the callback returns\n false for a given node, that node's children will not be\n recursed over. The last parameter can be used to specify a\n starting position to count from.\n */\n nodesBetween(from, to, f, startPos = 0) {\n this.content.nodesBetween(from, to, f, startPos, this);\n }\n /**\n Call the given callback for every descendant node. Doesn't\n descend into a node when the callback returns `false`.\n */\n descendants(f) {\n this.nodesBetween(0, this.content.size, f);\n }\n /**\n Concatenates all the text nodes found in this fragment and its\n children.\n */\n get textContent() {\n return (this.isLeaf && this.type.spec.leafText)\n ? this.type.spec.leafText(this)\n : this.textBetween(0, this.content.size, \"\");\n }\n /**\n Get all text between positions `from` and `to`. When\n `blockSeparator` is given, it will be inserted to separate text\n from different block nodes. If `leafText` is given, it'll be\n inserted for every non-text leaf node encountered, otherwise\n [`leafText`](https://prosemirror.net/docs/ref/#model.NodeSpec^leafText) will be used.\n */\n textBetween(from, to, blockSeparator, leafText) {\n return this.content.textBetween(from, to, blockSeparator, leafText);\n }\n /**\n Returns this node's first child, or `null` if there are no\n children.\n */\n get firstChild() { return this.content.firstChild; }\n /**\n Returns this node's last child, or `null` if there are no\n children.\n */\n get lastChild() { return this.content.lastChild; }\n /**\n Test whether two nodes represent the same piece of document.\n */\n eq(other) {\n return this == other || (this.sameMarkup(other) && this.content.eq(other.content));\n }\n /**\n Compare the markup (type, attributes, and marks) of this node to\n those of another. Returns `true` if both have the same markup.\n */\n sameMarkup(other) {\n return this.hasMarkup(other.type, other.attrs, other.marks);\n }\n /**\n Check whether this node's markup correspond to the given type,\n attributes, and marks.\n */\n hasMarkup(type, attrs, marks) {\n return this.type == type &&\n compareDeep(this.attrs, attrs || type.defaultAttrs || emptyAttrs) &&\n Mark.sameSet(this.marks, marks || Mark.none);\n }\n /**\n Create a new node with the same markup as this node, containing\n the given content (or empty, if no content is given).\n */\n copy(content = null) {\n if (content == this.content)\n return this;\n return new Node(this.type, this.attrs, content, this.marks);\n }\n /**\n Create a copy of this node, with the given set of marks instead\n of the node's own marks.\n */\n mark(marks) {\n return marks == this.marks ? this : new Node(this.type, this.attrs, this.content, marks);\n }\n /**\n Create a copy of this node with only the content between the\n given positions. If `to` is not given, it defaults to the end of\n the node.\n */\n cut(from, to = this.content.size) {\n if (from == 0 && to == this.content.size)\n return this;\n return this.copy(this.content.cut(from, to));\n }\n /**\n Cut out the part of the document between the given positions, and\n return it as a `Slice` object.\n */\n slice(from, to = this.content.size, includeParents = false) {\n if (from == to)\n return Slice.empty;\n let $from = this.resolve(from), $to = this.resolve(to);\n let depth = includeParents ? 0 : $from.sharedDepth(to);\n let start = $from.start(depth), node = $from.node(depth);\n let content = node.content.cut($from.pos - start, $to.pos - start);\n return new Slice(content, $from.depth - depth, $to.depth - depth);\n }\n /**\n Replace the part of the document between the given positions with\n the given slice. The slice must 'fit', meaning its open sides\n must be able to connect to the surrounding content, and its\n content nodes must be valid children for the node they are placed\n into. If any of this is violated, an error of type\n [`ReplaceError`](https://prosemirror.net/docs/ref/#model.ReplaceError) is thrown.\n */\n replace(from, to, slice) {\n return replace(this.resolve(from), this.resolve(to), slice);\n }\n /**\n Find the node directly after the given position.\n */\n nodeAt(pos) {\n for (let node = this;;) {\n let { index, offset } = node.content.findIndex(pos);\n node = node.maybeChild(index);\n if (!node)\n return null;\n if (offset == pos || node.isText)\n return node;\n pos -= offset + 1;\n }\n }\n /**\n Find the (direct) child node after the given offset, if any,\n and return it along with its index and offset relative to this\n node.\n */\n childAfter(pos) {\n let { index, offset } = this.content.findIndex(pos);\n return { node: this.content.maybeChild(index), index, offset };\n }\n /**\n Find the (direct) child node before the given offset, if any,\n and return it along with its index and offset relative to this\n node.\n */\n childBefore(pos) {\n if (pos == 0)\n return { node: null, index: 0, offset: 0 };\n let { index, offset } = this.content.findIndex(pos);\n if (offset < pos)\n return { node: this.content.child(index), index, offset };\n let node = this.content.child(index - 1);\n return { node, index: index - 1, offset: offset - node.nodeSize };\n }\n /**\n Resolve the given position in the document, returning an\n [object](https://prosemirror.net/docs/ref/#model.ResolvedPos) with information about its context.\n */\n resolve(pos) { return ResolvedPos.resolveCached(this, pos); }\n /**\n @internal\n */\n resolveNoCache(pos) { return ResolvedPos.resolve(this, pos); }\n /**\n Test whether a given mark or mark type occurs in this document\n between the two given positions.\n */\n rangeHasMark(from, to, type) {\n let found = false;\n if (to > from)\n this.nodesBetween(from, to, node => {\n if (type.isInSet(node.marks))\n found = true;\n return !found;\n });\n return found;\n }\n /**\n True when this is a block (non-inline node)\n */\n get isBlock() { return this.type.isBlock; }\n /**\n True when this is a textblock node, a block node with inline\n content.\n */\n get isTextblock() { return this.type.isTextblock; }\n /**\n True when this node allows inline content.\n */\n get inlineContent() { return this.type.inlineContent; }\n /**\n True when this is an inline node (a text node or a node that can\n appear among text).\n */\n get isInline() { return this.type.isInline; }\n /**\n True when this is a text node.\n */\n get isText() { return this.type.isText; }\n /**\n True when this is a leaf node.\n */\n get isLeaf() { return this.type.isLeaf; }\n /**\n True when this is an atom, i.e. when it does not have directly\n editable content. This is usually the same as `isLeaf`, but can\n be configured with the [`atom` property](https://prosemirror.net/docs/ref/#model.NodeSpec.atom)\n on a node's spec (typically used when the node is displayed as\n an uneditable [node view](https://prosemirror.net/docs/ref/#view.NodeView)).\n */\n get isAtom() { return this.type.isAtom; }\n /**\n Return a string representation of this node for debugging\n purposes.\n */\n toString() {\n if (this.type.spec.toDebugString)\n return this.type.spec.toDebugString(this);\n let name = this.type.name;\n if (this.content.size)\n name += \"(\" + this.content.toStringInner() + \")\";\n return wrapMarks(this.marks, name);\n }\n /**\n Get the content match in this node at the given index.\n */\n contentMatchAt(index) {\n let match = this.type.contentMatch.matchFragment(this.content, 0, index);\n if (!match)\n throw new Error(\"Called contentMatchAt on a node with invalid content\");\n return match;\n }\n /**\n Test whether replacing the range between `from` and `to` (by\n child index) with the given replacement fragment (which defaults\n to the empty fragment) would leave the node's content valid. You\n can optionally pass `start` and `end` indices into the\n replacement fragment.\n */\n canReplace(from, to, replacement = Fragment.empty, start = 0, end = replacement.childCount) {\n let one = this.contentMatchAt(from).matchFragment(replacement, start, end);\n let two = one && one.matchFragment(this.content, to);\n if (!two || !two.validEnd)\n return false;\n for (let i = start; i < end; i++)\n if (!this.type.allowsMarks(replacement.child(i).marks))\n return false;\n return true;\n }\n /**\n Test whether replacing the range `from` to `to` (by index) with\n a node of the given type would leave the node's content valid.\n */\n canReplaceWith(from, to, type, marks) {\n if (marks && !this.type.allowsMarks(marks))\n return false;\n let start = this.contentMatchAt(from).matchType(type);\n let end = start && start.matchFragment(this.content, to);\n return end ? end.validEnd : false;\n }\n /**\n Test whether the given node's content could be appended to this\n node. If that node is empty, this will only return true if there\n is at least one node type that can appear in both nodes (to avoid\n merging completely incompatible nodes).\n */\n canAppend(other) {\n if (other.content.size)\n return this.canReplace(this.childCount, this.childCount, other.content);\n else\n return this.type.compatibleContent(other.type);\n }\n /**\n Check whether this node and its descendants conform to the\n schema, and raise an exception when they do not.\n */\n check() {\n this.type.checkContent(this.content);\n this.type.checkAttrs(this.attrs);\n let copy = Mark.none;\n for (let i = 0; i < this.marks.length; i++) {\n let mark = this.marks[i];\n mark.type.checkAttrs(mark.attrs);\n copy = mark.addToSet(copy);\n }\n if (!Mark.sameSet(copy, this.marks))\n throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(m => m.type.name)}`);\n this.content.forEach(node => node.check());\n }\n /**\n Return a JSON-serializeable representation of this node.\n */\n toJSON() {\n let obj = { type: this.type.name };\n for (let _ in this.attrs) {\n obj.attrs = this.attrs;\n break;\n }\n if (this.content.size)\n obj.content = this.content.toJSON();\n if (this.marks.length)\n obj.marks = this.marks.map(n => n.toJSON());\n return obj;\n }\n /**\n Deserialize a node from its JSON representation.\n */\n static fromJSON(schema, json) {\n if (!json)\n throw new RangeError(\"Invalid input for Node.fromJSON\");\n let marks = undefined;\n if (json.marks) {\n if (!Array.isArray(json.marks))\n throw new RangeError(\"Invalid mark data for Node.fromJSON\");\n marks = json.marks.map(schema.markFromJSON);\n }\n if (json.type == \"text\") {\n if (typeof json.text != \"string\")\n throw new RangeError(\"Invalid text node in JSON\");\n return schema.text(json.text, marks);\n }\n let content = Fragment.fromJSON(schema, json.content);\n let node = schema.nodeType(json.type).create(json.attrs, content, marks);\n node.type.checkAttrs(node.attrs);\n return node;\n }\n}\nNode.prototype.text = undefined;\nclass TextNode extends Node {\n /**\n @internal\n */\n constructor(type, attrs, content, marks) {\n super(type, attrs, null, marks);\n if (!content)\n throw new RangeError(\"Empty text nodes are not allowed\");\n this.text = content;\n }\n toString() {\n if (this.type.spec.toDebugString)\n return this.type.spec.toDebugString(this);\n return wrapMarks(this.marks, JSON.stringify(this.text));\n }\n get textContent() { return this.text; }\n textBetween(from, to) { return this.text.slice(from, to); }\n get nodeSize() { return this.text.length; }\n mark(marks) {\n return marks == this.marks ? this : new TextNode(this.type, this.attrs, this.text, marks);\n }\n withText(text) {\n if (text == this.text)\n return this;\n return new TextNode(this.type, this.attrs, text, this.marks);\n }\n cut(from = 0, to = this.text.length) {\n if (from == 0 && to == this.text.length)\n return this;\n return this.withText(this.text.slice(from, to));\n }\n eq(other) {\n return this.sameMarkup(other) && this.text == other.text;\n }\n toJSON() {\n let base = super.toJSON();\n base.text = this.text;\n return base;\n }\n}\nfunction wrapMarks(marks, str) {\n for (let i = marks.length - 1; i >= 0; i--)\n str = marks[i].type.name + \"(\" + str + \")\";\n return str;\n}\n\n/**\nInstances of this class represent a match state of a node type's\n[content expression](https://prosemirror.net/docs/ref/#model.NodeSpec.content), and can be used to\nfind out whether further content matches here, and whether a given\nposition is a valid end of the node.\n*/\nclass ContentMatch {\n /**\n @internal\n */\n constructor(\n /**\n True when this match state represents a valid end of the node.\n */\n validEnd) {\n this.validEnd = validEnd;\n /**\n @internal\n */\n this.next = [];\n /**\n @internal\n */\n this.wrapCache = [];\n }\n /**\n @internal\n */\n static parse(string, nodeTypes) {\n let stream = new TokenStream(string, nodeTypes);\n if (stream.next == null)\n return ContentMatch.empty;\n let expr = parseExpr(stream);\n if (stream.next)\n stream.err(\"Unexpected trailing text\");\n let match = dfa(nfa(expr));\n checkForDeadEnds(match, stream);\n return match;\n }\n /**\n Match a node type, returning a match after that node if\n successful.\n */\n matchType(type) {\n for (let i = 0; i < this.next.length; i++)\n if (this.next[i].type == type)\n return this.next[i].next;\n return null;\n }\n /**\n Try to match a fragment. Returns the resulting match when\n successful.\n */\n matchFragment(frag, start = 0, end = frag.childCount) {\n let cur = this;\n for (let i = start; cur && i < end; i++)\n cur = cur.matchType(frag.child(i).type);\n return cur;\n }\n /**\n @internal\n */\n get inlineContent() {\n return this.next.length != 0 && this.next[0].type.isInline;\n }\n /**\n Get the first matching node type at this match position that can\n be generated.\n */\n get defaultType() {\n for (let i = 0; i < this.next.length; i++) {\n let { type } = this.next[i];\n if (!(type.isText || type.hasRequiredAttrs()))\n return type;\n }\n return null;\n }\n /**\n @internal\n */\n compatible(other) {\n for (let i = 0; i < this.next.length; i++)\n for (let j = 0; j < other.next.length; j++)\n if (this.next[i].type == other.next[j].type)\n return true;\n return false;\n }\n /**\n Try to match the given fragment, and if that fails, see if it can\n be made to match by inserting nodes in front of it. When\n successful, return a fragment of inserted nodes (which may be\n empty if nothing had to be inserted). When `toEnd` is true, only\n return a fragment if the resulting match goes to the end of the\n content expression.\n */\n fillBefore(after, toEnd = false, startIndex = 0) {\n let seen = [this];\n function search(match, types) {\n let finished = match.matchFragment(after, startIndex);\n if (finished && (!toEnd || finished.validEnd))\n return Fragment.from(types.map(tp => tp.createAndFill()));\n for (let i = 0; i < match.next.length; i++) {\n let { type, next } = match.next[i];\n if (!(type.isText || type.hasRequiredAttrs()) && seen.indexOf(next) == -1) {\n seen.push(next);\n let found = search(next, types.concat(type));\n if (found)\n return found;\n }\n }\n return null;\n }\n return search(this, []);\n }\n /**\n Find a set of wrapping node types that would allow a node of the\n given type to appear at this position. The result may be empty\n (when it fits directly) and will be null when no such wrapping\n exists.\n */\n findWrapping(target) {\n for (let i = 0; i < this.wrapCache.length; i += 2)\n if (this.wrapCache[i] == target)\n return this.wrapCache[i + 1];\n let computed = this.computeWrapping(target);\n this.wrapCache.push(target, computed);\n return computed;\n }\n /**\n @internal\n */\n computeWrapping(target) {\n let seen = Object.create(null), active = [{ match: this, type: null, via: null }];\n while (active.length) {\n let current = active.shift(), match = current.match;\n if (match.matchType(target)) {\n let result = [];\n for (let obj = current; obj.type; obj = obj.via)\n result.push(obj.type);\n return result.reverse();\n }\n for (let i = 0; i < match.next.length; i++) {\n let { type, next } = match.next[i];\n if (!type.isLeaf && !type.hasRequiredAttrs() && !(type.name in seen) && (!current.type || next.validEnd)) {\n active.push({ match: type.contentMatch, type, via: current });\n seen[type.name] = true;\n }\n }\n }\n return null;\n }\n /**\n The number of outgoing edges this node has in the finite\n automaton that describes the content expression.\n */\n get edgeCount() {\n return this.next.length;\n }\n /**\n Get the _n_​th outgoing edge from this node in the finite\n automaton that describes the content expression.\n */\n edge(n) {\n if (n >= this.next.length)\n throw new RangeError(`There's no ${n}th edge in this content match`);\n return this.next[n];\n }\n /**\n @internal\n */\n toString() {\n let seen = [];\n function scan(m) {\n seen.push(m);\n for (let i = 0; i < m.next.length; i++)\n if (seen.indexOf(m.next[i].next) == -1)\n scan(m.next[i].next);\n }\n scan(this);\n return seen.map((m, i) => {\n let out = i + (m.validEnd ? \"*\" : \" \") + \" \";\n for (let i = 0; i < m.next.length; i++)\n out += (i ? \", \" : \"\") + m.next[i].type.name + \"->\" + seen.indexOf(m.next[i].next);\n return out;\n }).join(\"\\n\");\n }\n}\n/**\n@internal\n*/\nContentMatch.empty = new ContentMatch(true);\nclass TokenStream {\n constructor(string, nodeTypes) {\n this.string = string;\n this.nodeTypes = nodeTypes;\n this.inline = null;\n this.pos = 0;\n this.tokens = string.split(/\\s*(?=\\b|\\W|$)/);\n if (this.tokens[this.tokens.length - 1] == \"\")\n this.tokens.pop();\n if (this.tokens[0] == \"\")\n this.tokens.shift();\n }\n get next() { return this.tokens[this.pos]; }\n eat(tok) { return this.next == tok && (this.pos++ || true); }\n err(str) { throw new SyntaxError(str + \" (in content expression '\" + this.string + \"')\"); }\n}\nfunction parseExpr(stream) {\n let exprs = [];\n do {\n exprs.push(parseExprSeq(stream));\n } while (stream.eat(\"|\"));\n return exprs.length == 1 ? exprs[0] : { type: \"choice\", exprs };\n}\nfunction parseExprSeq(stream) {\n let exprs = [];\n do {\n exprs.push(parseExprSubscript(stream));\n } while (stream.next && stream.next != \")\" && stream.next != \"|\");\n return exprs.length == 1 ? exprs[0] : { type: \"seq\", exprs };\n}\nfunction parseExprSubscript(stream) {\n let expr = parseExprAtom(stream);\n for (;;) {\n if (stream.eat(\"+\"))\n expr = { type: \"plus\", expr };\n else if (stream.eat(\"*\"))\n expr = { type: \"star\", expr };\n else if (stream.eat(\"?\"))\n expr = { type: \"opt\", expr };\n else if (stream.eat(\"{\"))\n expr = parseExprRange(stream, expr);\n else\n break;\n }\n return expr;\n}\nfunction parseNum(stream) {\n if (/\\D/.test(stream.next))\n stream.err(\"Expected number, got '\" + stream.next + \"'\");\n let result = Number(stream.next);\n stream.pos++;\n return result;\n}\nfunction parseExprRange(stream, expr) {\n let min = parseNum(stream), max = min;\n if (stream.eat(\",\")) {\n if (stream.next != \"}\")\n max = parseNum(stream);\n else\n max = -1;\n }\n if (!stream.eat(\"}\"))\n stream.err(\"Unclosed braced range\");\n return { type: \"range\", min, max, expr };\n}\nfunction resolveName(stream, name) {\n let types = stream.nodeTypes, type = types[name];\n if (type)\n return [type];\n let result = [];\n for (let typeName in types) {\n let type = types[typeName];\n if (type.groups.indexOf(name) > -1)\n result.push(type);\n }\n if (result.length == 0)\n stream.err(\"No node type or group '\" + name + \"' found\");\n return result;\n}\nfunction parseExprAtom(stream) {\n if (stream.eat(\"(\")) {\n let expr = parseExpr(stream);\n if (!stream.eat(\")\"))\n stream.err(\"Missing closing paren\");\n return expr;\n }\n else if (!/\\W/.test(stream.next)) {\n let exprs = resolveName(stream, stream.next).map(type => {\n if (stream.inline == null)\n stream.inline = type.isInline;\n else if (stream.inline != type.isInline)\n stream.err(\"Mixing inline and block content\");\n return { type: \"name\", value: type };\n });\n stream.pos++;\n return exprs.length == 1 ? exprs[0] : { type: \"choice\", exprs };\n }\n else {\n stream.err(\"Unexpected token '\" + stream.next + \"'\");\n }\n}\n/**\nConstruct an NFA from an expression as returned by the parser. The\nNFA is represented as an array of states, which are themselves\narrays of edges, which are `{term, to}` objects. The first state is\nthe entry state and the last node is the success state.\n\nNote that unlike typical NFAs, the edge ordering in this one is\nsignificant, in that it is used to contruct filler content when\nnecessary.\n*/\nfunction nfa(expr) {\n let nfa = [[]];\n connect(compile(expr, 0), node());\n return nfa;\n function node() { return nfa.push([]) - 1; }\n function edge(from, to, term) {\n let edge = { term, to };\n nfa[from].push(edge);\n return edge;\n }\n function connect(edges, to) {\n edges.forEach(edge => edge.to = to);\n }\n function compile(expr, from) {\n if (expr.type == \"choice\") {\n return expr.exprs.reduce((out, expr) => out.concat(compile(expr, from)), []);\n }\n else if (expr.type == \"seq\") {\n for (let i = 0;; i++) {\n let next = compile(expr.exprs[i], from);\n if (i == expr.exprs.length - 1)\n return next;\n connect(next, from = node());\n }\n }\n else if (expr.type == \"star\") {\n let loop = node();\n edge(from, loop);\n connect(compile(expr.expr, loop), loop);\n return [edge(loop)];\n }\n else if (expr.type == \"plus\") {\n let loop = node();\n connect(compile(expr.expr, from), loop);\n connect(compile(expr.expr, loop), loop);\n return [edge(loop)];\n }\n else if (expr.type == \"opt\") {\n return [edge(from)].concat(compile(expr.expr, from));\n }\n else if (expr.type == \"range\") {\n let cur = from;\n for (let i = 0; i < expr.min; i++) {\n let next = node();\n connect(compile(expr.expr, cur), next);\n cur = next;\n }\n if (expr.max == -1) {\n connect(compile(expr.expr, cur), cur);\n }\n else {\n for (let i = expr.min; i < expr.max; i++) {\n let next = node();\n edge(cur, next);\n connect(compile(expr.expr, cur), next);\n cur = next;\n }\n }\n return [edge(cur)];\n }\n else if (expr.type == \"name\") {\n return [edge(from, undefined, expr.value)];\n }\n else {\n throw new Error(\"Unknown expr type\");\n }\n }\n}\nfunction cmp(a, b) { return b - a; }\n// Get the set of nodes reachable by null edges from `node`. Omit\n// nodes with only a single null-out-edge, since they may lead to\n// needless duplicated nodes.\nfunction nullFrom(nfa, node) {\n let result = [];\n scan(node);\n return result.sort(cmp);\n function scan(node) {\n let edges = nfa[node];\n if (edges.length == 1 && !edges[0].term)\n return scan(edges[0].to);\n result.push(node);\n for (let i = 0; i < edges.length; i++) {\n let { term, to } = edges[i];\n if (!term && result.indexOf(to) == -1)\n scan(to);\n }\n }\n}\n// Compiles an NFA as produced by `nfa` into a DFA, modeled as a set\n// of state objects (`ContentMatch` instances) with transitions\n// between them.\nfunction dfa(nfa) {\n let labeled = Object.create(null);\n return explore(nullFrom(nfa, 0));\n function explore(states) {\n let out = [];\n states.forEach(node => {\n nfa[node].forEach(({ term, to }) => {\n if (!term)\n return;\n let set;\n for (let i = 0; i < out.length; i++)\n if (out[i][0] == term)\n set = out[i][1];\n nullFrom(nfa, to).forEach(node => {\n if (!set)\n out.push([term, set = []]);\n if (set.indexOf(node) == -1)\n set.push(node);\n });\n });\n });\n let state = labeled[states.join(\",\")] = new ContentMatch(states.indexOf(nfa.length - 1) > -1);\n for (let i = 0; i < out.length; i++) {\n let states = out[i][1].sort(cmp);\n state.next.push({ type: out[i][0], next: labeled[states.join(\",\")] || explore(states) });\n }\n return state;\n }\n}\nfunction checkForDeadEnds(match, stream) {\n for (let i = 0, work = [match]; i < work.length; i++) {\n let state = work[i], dead = !state.validEnd, nodes = [];\n for (let j = 0; j < state.next.length; j++) {\n let { type, next } = state.next[j];\n nodes.push(type.name);\n if (dead && !(type.isText || type.hasRequiredAttrs()))\n dead = false;\n if (work.indexOf(next) == -1)\n work.push(next);\n }\n if (dead)\n stream.err(\"Only non-generatable nodes (\" + nodes.join(\", \") + \") in a required position (see https://prosemirror.net/docs/guide/#generatable)\");\n }\n}\n\n// For node types where all attrs have a default value (or which don't\n// have any attributes), build up a single reusable default attribute\n// object, and use it for all nodes that don't specify specific\n// attributes.\nfunction defaultAttrs(attrs) {\n let defaults = Object.create(null);\n for (let attrName in attrs) {\n let attr = attrs[attrName];\n if (!attr.hasDefault)\n return null;\n defaults[attrName] = attr.default;\n }\n return defaults;\n}\nfunction computeAttrs(attrs, value) {\n let built = Object.create(null);\n for (let name in attrs) {\n let given = value && value[name];\n if (given === undefined) {\n let attr = attrs[name];\n if (attr.hasDefault)\n given = attr.default;\n else\n throw new RangeError(\"No value supplied for attribute \" + name);\n }\n built[name] = given;\n }\n return built;\n}\nfunction checkAttrs(attrs, values, type, name) {\n for (let name in values)\n if (!(name in attrs))\n throw new RangeError(`Unsupported attribute ${name} for ${type} of type ${name}`);\n for (let name in attrs) {\n let attr = attrs[name];\n if (attr.validate)\n attr.validate(values[name]);\n }\n}\nfunction initAttrs(typeName, attrs) {\n let result = Object.create(null);\n if (attrs)\n for (let name in attrs)\n result[name] = new Attribute(typeName, name, attrs[name]);\n return result;\n}\n/**\nNode types are objects allocated once per `Schema` and used to\n[tag](https://prosemirror.net/docs/ref/#model.Node.type) `Node` instances. They contain information\nabout the node type, such as its name and what kind of node it\nrepresents.\n*/\nclass NodeType {\n /**\n @internal\n */\n constructor(\n /**\n The name the node type has in this schema.\n */\n name, \n /**\n A link back to the `Schema` the node type belongs to.\n */\n schema, \n /**\n The spec that this type is based on\n */\n spec) {\n this.name = name;\n this.schema = schema;\n this.spec = spec;\n /**\n The set of marks allowed in this node. `null` means all marks\n are allowed.\n */\n this.markSet = null;\n this.groups = spec.group ? spec.group.split(\" \") : [];\n this.attrs = initAttrs(name, spec.attrs);\n this.defaultAttrs = defaultAttrs(this.attrs);\n this.contentMatch = null;\n this.inlineContent = null;\n this.isBlock = !(spec.inline || name == \"text\");\n this.isText = name == \"text\";\n }\n /**\n True if this is an inline type.\n */\n get isInline() { return !this.isBlock; }\n /**\n True if this is a textblock type, a block that contains inline\n content.\n */\n get isTextblock() { return this.isBlock && this.inlineContent; }\n /**\n True for node types that allow no content.\n */\n get isLeaf() { return this.contentMatch == ContentMatch.empty; }\n /**\n True when this node is an atom, i.e. when it does not have\n directly editable content.\n */\n get isAtom() { return this.isLeaf || !!this.spec.atom; }\n /**\n The node type's [whitespace](https://prosemirror.net/docs/ref/#model.NodeSpec.whitespace) option.\n */\n get whitespace() {\n return this.spec.whitespace || (this.spec.code ? \"pre\" : \"normal\");\n }\n /**\n Tells you whether this node type has any required attributes.\n */\n hasRequiredAttrs() {\n for (let n in this.attrs)\n if (this.attrs[n].isRequired)\n return true;\n return false;\n }\n /**\n Indicates whether this node allows some of the same content as\n the given node type.\n */\n compatibleContent(other) {\n return this == other || this.contentMatch.compatible(other.contentMatch);\n }\n /**\n @internal\n */\n computeAttrs(attrs) {\n if (!attrs && this.defaultAttrs)\n return this.defaultAttrs;\n else\n return computeAttrs(this.attrs, attrs);\n }\n /**\n Create a `Node` of this type. The given attributes are\n checked and defaulted (you can pass `null` to use the type's\n defaults entirely, if no required attributes exist). `content`\n may be a `Fragment`, a node, an array of nodes, or\n `null`. Similarly `marks` may be `null` to default to the empty\n set of marks.\n */\n create(attrs = null, content, marks) {\n if (this.isText)\n throw new Error(\"NodeType.create can't construct text nodes\");\n return new Node(this, this.computeAttrs(attrs), Fragment.from(content), Mark.setFrom(marks));\n }\n /**\n Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but check the given content\n against the node type's content restrictions, and throw an error\n if it doesn't match.\n */\n createChecked(attrs = null, content, marks) {\n content = Fragment.from(content);\n this.checkContent(content);\n return new Node(this, this.computeAttrs(attrs), content, Mark.setFrom(marks));\n }\n /**\n Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but see if it is\n necessary to add nodes to the start or end of the given fragment\n to make it fit the node. If no fitting wrapping can be found,\n return null. Note that, due to the fact that required nodes can\n always be created, this will always succeed if you pass null or\n `Fragment.empty` as content.\n */\n createAndFill(attrs = null, content, marks) {\n attrs = this.computeAttrs(attrs);\n content = Fragment.from(content);\n if (content.size) {\n let before = this.contentMatch.fillBefore(content);\n if (!before)\n return null;\n content = before.append(content);\n }\n let matched = this.contentMatch.matchFragment(content);\n let after = matched && matched.fillBefore(Fragment.empty, true);\n if (!after)\n return null;\n return new Node(this, attrs, content.append(after), Mark.setFrom(marks));\n }\n /**\n Returns true if the given fragment is valid content for this node\n type.\n */\n validContent(content) {\n let result = this.contentMatch.matchFragment(content);\n if (!result || !result.validEnd)\n return false;\n for (let i = 0; i < content.childCount; i++)\n if (!this.allowsMarks(content.child(i).marks))\n return false;\n return true;\n }\n /**\n Throws a RangeError if the given fragment is not valid content for this\n node type.\n @internal\n */\n checkContent(content) {\n if (!this.validContent(content))\n throw new RangeError(`Invalid content for node ${this.name}: ${content.toString().slice(0, 50)}`);\n }\n /**\n @internal\n */\n checkAttrs(attrs) {\n checkAttrs(this.attrs, attrs, \"node\", this.name);\n }\n /**\n Check whether the given mark type is allowed in this node.\n */\n allowsMarkType(markType) {\n return this.markSet == null || this.markSet.indexOf(markType) > -1;\n }\n /**\n Test whether the given set of marks are allowed in this node.\n */\n allowsMarks(marks) {\n if (this.markSet == null)\n return true;\n for (let i = 0; i < marks.length; i++)\n if (!this.allowsMarkType(marks[i].type))\n return false;\n return true;\n }\n /**\n Removes the marks that are not allowed in this node from the given set.\n */\n allowedMarks(marks) {\n if (this.markSet == null)\n return marks;\n let copy;\n for (let i = 0; i < marks.length; i++) {\n if (!this.allowsMarkType(marks[i].type)) {\n if (!copy)\n copy = marks.slice(0, i);\n }\n else if (copy) {\n copy.push(marks[i]);\n }\n }\n return !copy ? marks : copy.length ? copy : Mark.none;\n }\n /**\n @internal\n */\n static compile(nodes, schema) {\n let result = Object.create(null);\n nodes.forEach((name, spec) => result[name] = new NodeType(name, schema, spec));\n let topType = schema.spec.topNode || \"doc\";\n if (!result[topType])\n throw new RangeError(\"Schema is missing its top node type ('\" + topType + \"')\");\n if (!result.text)\n throw new RangeError(\"Every schema needs a 'text' type\");\n for (let _ in result.text.attrs)\n throw new RangeError(\"The text node type should not have attributes\");\n return result;\n }\n}\nfunction validateType(typeName, attrName, type) {\n let types = type.split(\"|\");\n return (value) => {\n let name = value === null ? \"null\" : typeof value;\n if (types.indexOf(name) < 0)\n throw new RangeError(`Expected value of type ${types} for attribute ${attrName} on type ${typeName}, got ${name}`);\n };\n}\n// Attribute descriptors\nclass Attribute {\n constructor(typeName, attrName, options) {\n this.hasDefault = Object.prototype.hasOwnProperty.call(options, \"default\");\n this.default = options.default;\n this.validate = typeof options.validate == \"string\" ? validateType(typeName, attrName, options.validate) : options.validate;\n }\n get isRequired() {\n return !this.hasDefault;\n }\n}\n// Marks\n/**\nLike nodes, marks (which are associated with nodes to signify\nthings like emphasis or being part of a link) are\n[tagged](https://prosemirror.net/docs/ref/#model.Mark.type) with type objects, which are\ninstantiated once per `Schema`.\n*/\nclass MarkType {\n /**\n @internal\n */\n constructor(\n /**\n The name of the mark type.\n */\n name, \n /**\n @internal\n */\n rank, \n /**\n The schema that this mark type instance is part of.\n */\n schema, \n /**\n The spec on which the type is based.\n */\n spec) {\n this.name = name;\n this.rank = rank;\n this.schema = schema;\n this.spec = spec;\n this.attrs = initAttrs(name, spec.attrs);\n this.excluded = null;\n let defaults = defaultAttrs(this.attrs);\n this.instance = defaults ? new Mark(this, defaults) : null;\n }\n /**\n Create a mark of this type. `attrs` may be `null` or an object\n containing only some of the mark's attributes. The others, if\n they have defaults, will be added.\n */\n create(attrs = null) {\n if (!attrs && this.instance)\n return this.instance;\n return new Mark(this, computeAttrs(this.attrs, attrs));\n }\n /**\n @internal\n */\n static compile(marks, schema) {\n let result = Object.create(null), rank = 0;\n marks.forEach((name, spec) => result[name] = new MarkType(name, rank++, schema, spec));\n return result;\n }\n /**\n When there is a mark of this type in the given set, a new set\n without it is returned. Otherwise, the input set is returned.\n */\n removeFromSet(set) {\n for (var i = 0; i < set.length; i++)\n if (set[i].type == this) {\n set = set.slice(0, i).concat(set.slice(i + 1));\n i--;\n }\n return set;\n }\n /**\n Tests whether there is a mark of this type in the given set.\n */\n isInSet(set) {\n for (let i = 0; i < set.length; i++)\n if (set[i].type == this)\n return set[i];\n }\n /**\n @internal\n */\n checkAttrs(attrs) {\n checkAttrs(this.attrs, attrs, \"mark\", this.name);\n }\n /**\n Queries whether a given mark type is\n [excluded](https://prosemirror.net/docs/ref/#model.MarkSpec.excludes) by this one.\n */\n excludes(other) {\n return this.excluded.indexOf(other) > -1;\n }\n}\n/**\nA document schema. Holds [node](https://prosemirror.net/docs/ref/#model.NodeType) and [mark\ntype](https://prosemirror.net/docs/ref/#model.MarkType) objects for the nodes and marks that may\noccur in conforming documents, and provides functionality for\ncreating and deserializing such documents.\n\nWhen given, the type parameters provide the names of the nodes and\nmarks in this schema.\n*/\nclass Schema {\n /**\n Construct a schema from a schema [specification](https://prosemirror.net/docs/ref/#model.SchemaSpec).\n */\n constructor(spec) {\n /**\n The [linebreak\n replacement](https://prosemirror.net/docs/ref/#model.NodeSpec.linebreakReplacement) node defined\n in this schema, if any.\n */\n this.linebreakReplacement = null;\n /**\n An object for storing whatever values modules may want to\n compute and cache per schema. (If you want to store something\n in it, try to use property names unlikely to clash.)\n */\n this.cached = Object.create(null);\n let instanceSpec = this.spec = {};\n for (let prop in spec)\n instanceSpec[prop] = spec[prop];\n instanceSpec.nodes = OrderedMap.from(spec.nodes),\n instanceSpec.marks = OrderedMap.from(spec.marks || {}),\n this.nodes = NodeType.compile(this.spec.nodes, this);\n this.marks = MarkType.compile(this.spec.marks, this);\n let contentExprCache = Object.create(null);\n for (let prop in this.nodes) {\n if (prop in this.marks)\n throw new RangeError(prop + \" can not be both a node and a mark\");\n let type = this.nodes[prop], contentExpr = type.spec.content || \"\", markExpr = type.spec.marks;\n type.contentMatch = contentExprCache[contentExpr] ||\n (contentExprCache[contentExpr] = ContentMatch.parse(contentExpr, this.nodes));\n type.inlineContent = type.contentMatch.inlineContent;\n if (type.spec.linebreakReplacement) {\n if (this.linebreakReplacement)\n throw new RangeError(\"Multiple linebreak nodes defined\");\n if (!type.isInline || !type.isLeaf)\n throw new RangeError(\"Linebreak replacement nodes must be inline leaf nodes\");\n this.linebreakReplacement = type;\n }\n type.markSet = markExpr == \"_\" ? null :\n markExpr ? gatherMarks(this, markExpr.split(\" \")) :\n markExpr == \"\" || !type.inlineContent ? [] : null;\n }\n for (let prop in this.marks) {\n let type = this.marks[prop], excl = type.spec.excludes;\n type.excluded = excl == null ? [type] : excl == \"\" ? [] : gatherMarks(this, excl.split(\" \"));\n }\n this.nodeFromJSON = this.nodeFromJSON.bind(this);\n this.markFromJSON = this.markFromJSON.bind(this);\n this.topNodeType = this.nodes[this.spec.topNode || \"doc\"];\n this.cached.wrappings = Object.create(null);\n }\n /**\n Create a node in this schema. The `type` may be a string or a\n `NodeType` instance. Attributes will be extended with defaults,\n `content` may be a `Fragment`, `null`, a `Node`, or an array of\n nodes.\n */\n node(type, attrs = null, content, marks) {\n if (typeof type == \"string\")\n type = this.nodeType(type);\n else if (!(type instanceof NodeType))\n throw new RangeError(\"Invalid node type: \" + type);\n else if (type.schema != this)\n throw new RangeError(\"Node type from different schema used (\" + type.name + \")\");\n return type.createChecked(attrs, content, marks);\n }\n /**\n Create a text node in the schema. Empty text nodes are not\n allowed.\n */\n text(text, marks) {\n let type = this.nodes.text;\n return new TextNode(type, type.defaultAttrs, text, Mark.setFrom(marks));\n }\n /**\n Create a mark with the given type and attributes.\n */\n mark(type, attrs) {\n if (typeof type == \"string\")\n type = this.marks[type];\n return type.create(attrs);\n }\n /**\n Deserialize a node from its JSON representation. This method is\n bound.\n */\n nodeFromJSON(json) {\n return Node.fromJSON(this, json);\n }\n /**\n Deserialize a mark from its JSON representation. This method is\n bound.\n */\n markFromJSON(json) {\n return Mark.fromJSON(this, json);\n }\n /**\n @internal\n */\n nodeType(name) {\n let found = this.nodes[name];\n if (!found)\n throw new RangeError(\"Unknown node type: \" + name);\n return found;\n }\n}\nfunction gatherMarks(schema, marks) {\n let found = [];\n for (let i = 0; i < marks.length; i++) {\n let name = marks[i], mark = schema.marks[name], ok = mark;\n if (mark) {\n found.push(mark);\n }\n else {\n for (let prop in schema.marks) {\n let mark = schema.marks[prop];\n if (name == \"_\" || (mark.spec.group && mark.spec.group.split(\" \").indexOf(name) > -1))\n found.push(ok = mark);\n }\n }\n if (!ok)\n throw new SyntaxError(\"Unknown mark type: '\" + marks[i] + \"'\");\n }\n return found;\n}\n\nfunction isTagRule(rule) { return rule.tag != null; }\nfunction isStyleRule(rule) { return rule.style != null; }\n/**\nA DOM parser represents a strategy for parsing DOM content into a\nProseMirror document conforming to a given schema. Its behavior is\ndefined by an array of [rules](https://prosemirror.net/docs/ref/#model.ParseRule).\n*/\nclass DOMParser {\n /**\n Create a parser that targets the given schema, using the given\n parsing rules.\n */\n constructor(\n /**\n The schema into which the parser parses.\n */\n schema, \n /**\n The set of [parse rules](https://prosemirror.net/docs/ref/#model.ParseRule) that the parser\n uses, in order of precedence.\n */\n rules) {\n this.schema = schema;\n this.rules = rules;\n /**\n @internal\n */\n this.tags = [];\n /**\n @internal\n */\n this.styles = [];\n let matchedStyles = this.matchedStyles = [];\n rules.forEach(rule => {\n if (isTagRule(rule)) {\n this.tags.push(rule);\n }\n else if (isStyleRule(rule)) {\n let prop = /[^=]*/.exec(rule.style)[0];\n if (matchedStyles.indexOf(prop) < 0)\n matchedStyles.push(prop);\n this.styles.push(rule);\n }\n });\n // Only normalize list elements when lists in the schema can't directly contain themselves\n this.normalizeLists = !this.tags.some(r => {\n if (!/^(ul|ol)\\b/.test(r.tag) || !r.node)\n return false;\n let node = schema.nodes[r.node];\n return node.contentMatch.matchType(node);\n });\n }\n /**\n Parse a document from the content of a DOM node.\n */\n parse(dom, options = {}) {\n let context = new ParseContext(this, options, false);\n context.addAll(dom, Mark.none, options.from, options.to);\n return context.finish();\n }\n /**\n Parses the content of the given DOM node, like\n [`parse`](https://prosemirror.net/docs/ref/#model.DOMParser.parse), and takes the same set of\n options. But unlike that method, which produces a whole node,\n this one returns a slice that is open at the sides, meaning that\n the schema constraints aren't applied to the start of nodes to\n the left of the input and the end of nodes at the end.\n */\n parseSlice(dom, options = {}) {\n let context = new ParseContext(this, options, true);\n context.addAll(dom, Mark.none, options.from, options.to);\n return Slice.maxOpen(context.finish());\n }\n /**\n @internal\n */\n matchTag(dom, context, after) {\n for (let i = after ? this.tags.indexOf(after) + 1 : 0; i < this.tags.length; i++) {\n let rule = this.tags[i];\n if (matches(dom, rule.tag) &&\n (rule.namespace === undefined || dom.namespaceURI == rule.namespace) &&\n (!rule.context || context.matchesContext(rule.context))) {\n if (rule.getAttrs) {\n let result = rule.getAttrs(dom);\n if (result === false)\n continue;\n rule.attrs = result || undefined;\n }\n return rule;\n }\n }\n }\n /**\n @internal\n */\n matchStyle(prop, value, context, after) {\n for (let i = after ? this.styles.indexOf(after) + 1 : 0; i < this.styles.length; i++) {\n let rule = this.styles[i], style = rule.style;\n if (style.indexOf(prop) != 0 ||\n rule.context && !context.matchesContext(rule.context) ||\n // Test that the style string either precisely matches the prop,\n // or has an '=' sign after the prop, followed by the given\n // value.\n style.length > prop.length &&\n (style.charCodeAt(prop.length) != 61 || style.slice(prop.length + 1) != value))\n continue;\n if (rule.getAttrs) {\n let result = rule.getAttrs(value);\n if (result === false)\n continue;\n rule.attrs = result || undefined;\n }\n return rule;\n }\n }\n /**\n @internal\n */\n static schemaRules(schema) {\n let result = [];\n function insert(rule) {\n let priority = rule.priority == null ? 50 : rule.priority, i = 0;\n for (; i < result.length; i++) {\n let next = result[i], nextPriority = next.priority == null ? 50 : next.priority;\n if (nextPriority < priority)\n break;\n }\n result.splice(i, 0, rule);\n }\n for (let name in schema.marks) {\n let rules = schema.marks[name].spec.parseDOM;\n if (rules)\n rules.forEach(rule => {\n insert(rule = copy(rule));\n if (!(rule.mark || rule.ignore || rule.clearMark))\n rule.mark = name;\n });\n }\n for (let name in schema.nodes) {\n let rules = schema.nodes[name].spec.parseDOM;\n if (rules)\n rules.forEach(rule => {\n insert(rule = copy(rule));\n if (!(rule.node || rule.ignore || rule.mark))\n rule.node = name;\n });\n }\n return result;\n }\n /**\n Construct a DOM parser using the parsing rules listed in a\n schema's [node specs](https://prosemirror.net/docs/ref/#model.NodeSpec.parseDOM), reordered by\n [priority](https://prosemirror.net/docs/ref/#model.ParseRule.priority).\n */\n static fromSchema(schema) {\n return schema.cached.domParser ||\n (schema.cached.domParser = new DOMParser(schema, DOMParser.schemaRules(schema)));\n }\n}\nconst blockTags = {\n address: true, article: true, aside: true, blockquote: true, canvas: true,\n dd: true, div: true, dl: true, fieldset: true, figcaption: true, figure: true,\n footer: true, form: true, h1: true, h2: true, h3: true, h4: true, h5: true,\n h6: true, header: true, hgroup: true, hr: true, li: true, noscript: true, ol: true,\n output: true, p: true, pre: true, section: true, table: true, tfoot: true, ul: true\n};\nconst ignoreTags = {\n head: true, noscript: true, object: true, script: true, style: true, title: true\n};\nconst listTags = { ol: true, ul: true };\n// Using a bitfield for node context options\nconst OPT_PRESERVE_WS = 1, OPT_PRESERVE_WS_FULL = 2, OPT_OPEN_LEFT = 4;\nfunction wsOptionsFor(type, preserveWhitespace, base) {\n if (preserveWhitespace != null)\n return (preserveWhitespace ? OPT_PRESERVE_WS : 0) |\n (preserveWhitespace === \"full\" ? OPT_PRESERVE_WS_FULL : 0);\n return type && type.whitespace == \"pre\" ? OPT_PRESERVE_WS | OPT_PRESERVE_WS_FULL : base & ~OPT_OPEN_LEFT;\n}\nclass NodeContext {\n constructor(type, attrs, marks, solid, match, options) {\n this.type = type;\n this.attrs = attrs;\n this.marks = marks;\n this.solid = solid;\n this.options = options;\n this.content = [];\n // Marks applied to the node's children\n this.activeMarks = Mark.none;\n this.match = match || (options & OPT_OPEN_LEFT ? null : type.contentMatch);\n }\n findWrapping(node) {\n if (!this.match) {\n if (!this.type)\n return [];\n let fill = this.type.contentMatch.fillBefore(Fragment.from(node));\n if (fill) {\n this.match = this.type.contentMatch.matchFragment(fill);\n }\n else {\n let start = this.type.contentMatch, wrap;\n if (wrap = start.findWrapping(node.type)) {\n this.match = start;\n return wrap;\n }\n else {\n return null;\n }\n }\n }\n return this.match.findWrapping(node.type);\n }\n finish(openEnd) {\n if (!(this.options & OPT_PRESERVE_WS)) { // Strip trailing whitespace\n let last = this.content[this.content.length - 1], m;\n if (last && last.isText && (m = /[ \\t\\r\\n\\u000c]+$/.exec(last.text))) {\n let text = last;\n if (last.text.length == m[0].length)\n this.content.pop();\n else\n this.content[this.content.length - 1] = text.withText(text.text.slice(0, text.text.length - m[0].length));\n }\n }\n let content = Fragment.from(this.content);\n if (!openEnd && this.match)\n content = content.append(this.match.fillBefore(Fragment.empty, true));\n return this.type ? this.type.create(this.attrs, content, this.marks) : content;\n }\n inlineContext(node) {\n if (this.type)\n return this.type.inlineContent;\n if (this.content.length)\n return this.content[0].isInline;\n return node.parentNode && !blockTags.hasOwnProperty(node.parentNode.nodeName.toLowerCase());\n }\n}\nclass ParseContext {\n constructor(\n // The parser we are using.\n parser, \n // The options passed to this parse.\n options, isOpen) {\n this.parser = parser;\n this.options = options;\n this.isOpen = isOpen;\n this.open = 0;\n let topNode = options.topNode, topContext;\n let topOptions = wsOptionsFor(null, options.preserveWhitespace, 0) | (isOpen ? OPT_OPEN_LEFT : 0);\n if (topNode)\n topContext = new NodeContext(topNode.type, topNode.attrs, Mark.none, true, options.topMatch || topNode.type.contentMatch, topOptions);\n else if (isOpen)\n topContext = new NodeContext(null, null, Mark.none, true, null, topOptions);\n else\n topContext = new NodeContext(parser.schema.topNodeType, null, Mark.none, true, null, topOptions);\n this.nodes = [topContext];\n this.find = options.findPositions;\n this.needsBlock = false;\n }\n get top() {\n return this.nodes[this.open];\n }\n // Add a DOM node to the content. Text is inserted as text node,\n // otherwise, the node is passed to `addElement` or, if it has a\n // `style` attribute, `addElementWithStyles`.\n addDOM(dom, marks) {\n if (dom.nodeType == 3)\n this.addTextNode(dom, marks);\n else if (dom.nodeType == 1)\n this.addElement(dom, marks);\n }\n addTextNode(dom, marks) {\n let value = dom.nodeValue;\n let top = this.top;\n if (top.options & OPT_PRESERVE_WS_FULL ||\n top.inlineContext(dom) ||\n /[^ \\t\\r\\n\\u000c]/.test(value)) {\n if (!(top.options & OPT_PRESERVE_WS)) {\n value = value.replace(/[ \\t\\r\\n\\u000c]+/g, \" \");\n // If this starts with whitespace, and there is no node before it, or\n // a hard break, or a text node that ends with whitespace, strip the\n // leading space.\n if (/^[ \\t\\r\\n\\u000c]/.test(value) && this.open == this.nodes.length - 1) {\n let nodeBefore = top.content[top.content.length - 1];\n let domNodeBefore = dom.previousSibling;\n if (!nodeBefore ||\n (domNodeBefore && domNodeBefore.nodeName == 'BR') ||\n (nodeBefore.isText && /[ \\t\\r\\n\\u000c]$/.test(nodeBefore.text)))\n value = value.slice(1);\n }\n }\n else if (!(top.options & OPT_PRESERVE_WS_FULL)) {\n value = value.replace(/\\r?\\n|\\r/g, \" \");\n }\n else {\n value = value.replace(/\\r\\n?/g, \"\\n\");\n }\n if (value)\n this.insertNode(this.parser.schema.text(value), marks);\n this.findInText(dom);\n }\n else {\n this.findInside(dom);\n }\n }\n // Try to find a handler for the given tag and use that to parse. If\n // none is found, the element's content nodes are added directly.\n addElement(dom, marks, matchAfter) {\n let name = dom.nodeName.toLowerCase(), ruleID;\n if (listTags.hasOwnProperty(name) && this.parser.normalizeLists)\n normalizeList(dom);\n let rule = (this.options.ruleFromNode && this.options.ruleFromNode(dom)) ||\n (ruleID = this.parser.matchTag(dom, this, matchAfter));\n if (rule ? rule.ignore : ignoreTags.hasOwnProperty(name)) {\n this.findInside(dom);\n this.ignoreFallback(dom, marks);\n }\n else if (!rule || rule.skip || rule.closeParent) {\n if (rule && rule.closeParent)\n this.open = Math.max(0, this.open - 1);\n else if (rule && rule.skip.nodeType)\n dom = rule.skip;\n let sync, top = this.top, oldNeedsBlock = this.needsBlock;\n if (blockTags.hasOwnProperty(name)) {\n if (top.content.length && top.content[0].isInline && this.open) {\n this.open--;\n top = this.top;\n }\n sync = true;\n if (!top.type)\n this.needsBlock = true;\n }\n else if (!dom.firstChild) {\n this.leafFallback(dom, marks);\n return;\n }\n let innerMarks = rule && rule.skip ? marks : this.readStyles(dom, marks);\n if (innerMarks)\n this.addAll(dom, innerMarks);\n if (sync)\n this.sync(top);\n this.needsBlock = oldNeedsBlock;\n }\n else {\n let innerMarks = this.readStyles(dom, marks);\n if (innerMarks)\n this.addElementByRule(dom, rule, innerMarks, rule.consuming === false ? ruleID : undefined);\n }\n }\n // Called for leaf DOM nodes that would otherwise be ignored\n leafFallback(dom, marks) {\n if (dom.nodeName == \"BR\" && this.top.type && this.top.type.inlineContent)\n this.addTextNode(dom.ownerDocument.createTextNode(\"\\n\"), marks);\n }\n // Called for ignored nodes\n ignoreFallback(dom, marks) {\n // Ignored BR nodes should at least create an inline context\n if (dom.nodeName == \"BR\" && (!this.top.type || !this.top.type.inlineContent))\n this.findPlace(this.parser.schema.text(\"-\"), marks);\n }\n // Run any style parser associated with the node's styles. Either\n // return an updated array of marks, or null to indicate some of the\n // styles had a rule with `ignore` set.\n readStyles(dom, marks) {\n let styles = dom.style;\n // Because many properties will only show up in 'normalized' form\n // in `style.item` (i.e. text-decoration becomes\n // text-decoration-line, text-decoration-color, etc), we directly\n // query the styles mentioned in our rules instead of iterating\n // over the items.\n if (styles && styles.length)\n for (let i = 0; i < this.parser.matchedStyles.length; i++) {\n let name = this.parser.matchedStyles[i], value = styles.getPropertyValue(name);\n if (value)\n for (let after = undefined;;) {\n let rule = this.parser.matchStyle(name, value, this, after);\n if (!rule)\n break;\n if (rule.ignore)\n return null;\n if (rule.clearMark)\n marks = marks.filter(m => !rule.clearMark(m));\n else\n marks = marks.concat(this.parser.schema.marks[rule.mark].create(rule.attrs));\n if (rule.consuming === false)\n after = rule;\n else\n break;\n }\n }\n return marks;\n }\n // Look up a handler for the given node. If none are found, return\n // false. Otherwise, apply it, use its return value to drive the way\n // the node's content is wrapped, and return true.\n addElementByRule(dom, rule, marks, continueAfter) {\n let sync, nodeType;\n if (rule.node) {\n nodeType = this.parser.schema.nodes[rule.node];\n if (!nodeType.isLeaf) {\n let inner = this.enter(nodeType, rule.attrs || null, marks, rule.preserveWhitespace);\n if (inner) {\n sync = true;\n marks = inner;\n }\n }\n else if (!this.insertNode(nodeType.create(rule.attrs), marks)) {\n this.leafFallback(dom, marks);\n }\n }\n else {\n let markType = this.parser.schema.marks[rule.mark];\n marks = marks.concat(markType.create(rule.attrs));\n }\n let startIn = this.top;\n if (nodeType && nodeType.isLeaf) {\n this.findInside(dom);\n }\n else if (continueAfter) {\n this.addElement(dom, marks, continueAfter);\n }\n else if (rule.getContent) {\n this.findInside(dom);\n rule.getContent(dom, this.parser.schema).forEach(node => this.insertNode(node, marks));\n }\n else {\n let contentDOM = dom;\n if (typeof rule.contentElement == \"string\")\n contentDOM = dom.querySelector(rule.contentElement);\n else if (typeof rule.contentElement == \"function\")\n contentDOM = rule.contentElement(dom);\n else if (rule.contentElement)\n contentDOM = rule.contentElement;\n this.findAround(dom, contentDOM, true);\n this.addAll(contentDOM, marks);\n }\n if (sync && this.sync(startIn))\n this.open--;\n }\n // Add all child nodes between `startIndex` and `endIndex` (or the\n // whole node, if not given). If `sync` is passed, use it to\n // synchronize after every block element.\n addAll(parent, marks, startIndex, endIndex) {\n let index = startIndex || 0;\n for (let dom = startIndex ? parent.childNodes[startIndex] : parent.firstChild, end = endIndex == null ? null : parent.childNodes[endIndex]; dom != end; dom = dom.nextSibling, ++index) {\n this.findAtPoint(parent, index);\n this.addDOM(dom, marks);\n }\n this.findAtPoint(parent, index);\n }\n // Try to find a way to fit the given node type into the current\n // context. May add intermediate wrappers and/or leave non-solid\n // nodes that we're in.\n findPlace(node, marks) {\n let route, sync;\n for (let depth = this.open; depth >= 0; depth--) {\n let cx = this.nodes[depth];\n let found = cx.findWrapping(node);\n if (found && (!route || route.length > found.length)) {\n route = found;\n sync = cx;\n if (!found.length)\n break;\n }\n if (cx.solid)\n break;\n }\n if (!route)\n return null;\n this.sync(sync);\n for (let i = 0; i < route.length; i++)\n marks = this.enterInner(route[i], null, marks, false);\n return marks;\n }\n // Try to insert the given node, adjusting the context when needed.\n insertNode(node, marks) {\n if (node.isInline && this.needsBlock && !this.top.type) {\n let block = this.textblockFromContext();\n if (block)\n marks = this.enterInner(block, null, marks);\n }\n let innerMarks = this.findPlace(node, marks);\n if (innerMarks) {\n this.closeExtra();\n let top = this.top;\n if (top.match)\n top.match = top.match.matchType(node.type);\n let nodeMarks = Mark.none;\n for (let m of innerMarks.concat(node.marks))\n if (top.type ? top.type.allowsMarkType(m.type) : markMayApply(m.type, node.type))\n nodeMarks = m.addToSet(nodeMarks);\n top.content.push(node.mark(nodeMarks));\n return true;\n }\n return false;\n }\n // Try to start a node of the given type, adjusting the context when\n // necessary.\n enter(type, attrs, marks, preserveWS) {\n let innerMarks = this.findPlace(type.create(attrs), marks);\n if (innerMarks)\n innerMarks = this.enterInner(type, attrs, marks, true, preserveWS);\n return innerMarks;\n }\n // Open a node of the given type\n enterInner(type, attrs, marks, solid = false, preserveWS) {\n this.closeExtra();\n let top = this.top;\n top.match = top.match && top.match.matchType(type);\n let options = wsOptionsFor(type, preserveWS, top.options);\n if ((top.options & OPT_OPEN_LEFT) && top.content.length == 0)\n options |= OPT_OPEN_LEFT;\n let applyMarks = Mark.none;\n marks = marks.filter(m => {\n if (top.type ? top.type.allowsMarkType(m.type) : markMayApply(m.type, type)) {\n applyMarks = m.addToSet(applyMarks);\n return false;\n }\n return true;\n });\n this.nodes.push(new NodeContext(type, attrs, applyMarks, solid, null, options));\n this.open++;\n return marks;\n }\n // Make sure all nodes above this.open are finished and added to\n // their parents\n closeExtra(openEnd = false) {\n let i = this.nodes.length - 1;\n if (i > this.open) {\n for (; i > this.open; i--)\n this.nodes[i - 1].content.push(this.nodes[i].finish(openEnd));\n this.nodes.length = this.open + 1;\n }\n }\n finish() {\n this.open = 0;\n this.closeExtra(this.isOpen);\n return this.nodes[0].finish(this.isOpen || this.options.topOpen);\n }\n sync(to) {\n for (let i = this.open; i >= 0; i--)\n if (this.nodes[i] == to) {\n this.open = i;\n return true;\n }\n return false;\n }\n get currentPos() {\n this.closeExtra();\n let pos = 0;\n for (let i = this.open; i >= 0; i--) {\n let content = this.nodes[i].content;\n for (let j = content.length - 1; j >= 0; j--)\n pos += content[j].nodeSize;\n if (i)\n pos++;\n }\n return pos;\n }\n findAtPoint(parent, offset) {\n if (this.find)\n for (let i = 0; i < this.find.length; i++) {\n if (this.find[i].node == parent && this.find[i].offset == offset)\n this.find[i].pos = this.currentPos;\n }\n }\n findInside(parent) {\n if (this.find)\n for (let i = 0; i < this.find.length; i++) {\n if (this.find[i].pos == null && parent.nodeType == 1 && parent.contains(this.find[i].node))\n this.find[i].pos = this.currentPos;\n }\n }\n findAround(parent, content, before) {\n if (parent != content && this.find)\n for (let i = 0; i < this.find.length; i++) {\n if (this.find[i].pos == null && parent.nodeType == 1 && parent.contains(this.find[i].node)) {\n let pos = content.compareDocumentPosition(this.find[i].node);\n if (pos & (before ? 2 : 4))\n this.find[i].pos = this.currentPos;\n }\n }\n }\n findInText(textNode) {\n if (this.find)\n for (let i = 0; i < this.find.length; i++) {\n if (this.find[i].node == textNode)\n this.find[i].pos = this.currentPos - (textNode.nodeValue.length - this.find[i].offset);\n }\n }\n // Determines whether the given context string matches this context.\n matchesContext(context) {\n if (context.indexOf(\"|\") > -1)\n return context.split(/\\s*\\|\\s*/).some(this.matchesContext, this);\n let parts = context.split(\"/\");\n let option = this.options.context;\n let useRoot = !this.isOpen && (!option || option.parent.type == this.nodes[0].type);\n let minDepth = -(option ? option.depth + 1 : 0) + (useRoot ? 0 : 1);\n let match = (i, depth) => {\n for (; i >= 0; i--) {\n let part = parts[i];\n if (part == \"\") {\n if (i == parts.length - 1 || i == 0)\n continue;\n for (; depth >= minDepth; depth--)\n if (match(i - 1, depth))\n return true;\n return false;\n }\n else {\n let next = depth > 0 || (depth == 0 && useRoot) ? this.nodes[depth].type\n : option && depth >= minDepth ? option.node(depth - minDepth).type\n : null;\n if (!next || (next.name != part && next.groups.indexOf(part) == -1))\n return false;\n depth--;\n }\n }\n return true;\n };\n return match(parts.length - 1, this.open);\n }\n textblockFromContext() {\n let $context = this.options.context;\n if ($context)\n for (let d = $context.depth; d >= 0; d--) {\n let deflt = $context.node(d).contentMatchAt($context.indexAfter(d)).defaultType;\n if (deflt && deflt.isTextblock && deflt.defaultAttrs)\n return deflt;\n }\n for (let name in this.parser.schema.nodes) {\n let type = this.parser.schema.nodes[name];\n if (type.isTextblock && type.defaultAttrs)\n return type;\n }\n }\n}\n// Kludge to work around directly nested list nodes produced by some\n// tools and allowed by browsers to mean that the nested list is\n// actually part of the list item above it.\nfunction normalizeList(dom) {\n for (let child = dom.firstChild, prevItem = null; child; child = child.nextSibling) {\n let name = child.nodeType == 1 ? child.nodeName.toLowerCase() : null;\n if (name && listTags.hasOwnProperty(name) && prevItem) {\n prevItem.appendChild(child);\n child = prevItem;\n }\n else if (name == \"li\") {\n prevItem = child;\n }\n else if (name) {\n prevItem = null;\n }\n }\n}\n// Apply a CSS selector.\nfunction matches(dom, selector) {\n return (dom.matches || dom.msMatchesSelector || dom.webkitMatchesSelector || dom.mozMatchesSelector).call(dom, selector);\n}\nfunction copy(obj) {\n let copy = {};\n for (let prop in obj)\n copy[prop] = obj[prop];\n return copy;\n}\n// Used when finding a mark at the top level of a fragment parse.\n// Checks whether it would be reasonable to apply a given mark type to\n// a given node, by looking at the way the mark occurs in the schema.\nfunction markMayApply(markType, nodeType) {\n let nodes = nodeType.schema.nodes;\n for (let name in nodes) {\n let parent = nodes[name];\n if (!parent.allowsMarkType(markType))\n continue;\n let seen = [], scan = (match) => {\n seen.push(match);\n for (let i = 0; i < match.edgeCount; i++) {\n let { type, next } = match.edge(i);\n if (type == nodeType)\n return true;\n if (seen.indexOf(next) < 0 && scan(next))\n return true;\n }\n };\n if (scan(parent.contentMatch))\n return true;\n }\n}\n\n/**\nA DOM serializer knows how to convert ProseMirror nodes and\nmarks of various types to DOM nodes.\n*/\nclass DOMSerializer {\n /**\n Create a serializer. `nodes` should map node names to functions\n that take a node and return a description of the corresponding\n DOM. `marks` does the same for mark names, but also gets an\n argument that tells it whether the mark's content is block or\n inline content (for typical use, it'll always be inline). A mark\n serializer may be `null` to indicate that marks of that type\n should not be serialized.\n */\n constructor(\n /**\n The node serialization functions.\n */\n nodes, \n /**\n The mark serialization functions.\n */\n marks) {\n this.nodes = nodes;\n this.marks = marks;\n }\n /**\n Serialize the content of this fragment to a DOM fragment. When\n not in the browser, the `document` option, containing a DOM\n document, should be passed so that the serializer can create\n nodes.\n */\n serializeFragment(fragment, options = {}, target) {\n if (!target)\n target = doc(options).createDocumentFragment();\n let top = target, active = [];\n fragment.forEach(node => {\n if (active.length || node.marks.length) {\n let keep = 0, rendered = 0;\n while (keep < active.length && rendered < node.marks.length) {\n let next = node.marks[rendered];\n if (!this.marks[next.type.name]) {\n rendered++;\n continue;\n }\n if (!next.eq(active[keep][0]) || next.type.spec.spanning === false)\n break;\n keep++;\n rendered++;\n }\n while (keep < active.length)\n top = active.pop()[1];\n while (rendered < node.marks.length) {\n let add = node.marks[rendered++];\n let markDOM = this.serializeMark(add, node.isInline, options);\n if (markDOM) {\n active.push([add, top]);\n top.appendChild(markDOM.dom);\n top = markDOM.contentDOM || markDOM.dom;\n }\n }\n }\n top.appendChild(this.serializeNodeInner(node, options));\n });\n return target;\n }\n /**\n @internal\n */\n serializeNodeInner(node, options) {\n let { dom, contentDOM } = renderSpec(doc(options), this.nodes[node.type.name](node), null, node.attrs);\n if (contentDOM) {\n if (node.isLeaf)\n throw new RangeError(\"Content hole not allowed in a leaf node spec\");\n this.serializeFragment(node.content, options, contentDOM);\n }\n return dom;\n }\n /**\n Serialize this node to a DOM node. This can be useful when you\n need to serialize a part of a document, as opposed to the whole\n document. To serialize a whole document, use\n [`serializeFragment`](https://prosemirror.net/docs/ref/#model.DOMSerializer.serializeFragment) on\n its [content](https://prosemirror.net/docs/ref/#model.Node.content).\n */\n serializeNode(node, options = {}) {\n let dom = this.serializeNodeInner(node, options);\n for (let i = node.marks.length - 1; i >= 0; i--) {\n let wrap = this.serializeMark(node.marks[i], node.isInline, options);\n if (wrap) {\n (wrap.contentDOM || wrap.dom).appendChild(dom);\n dom = wrap.dom;\n }\n }\n return dom;\n }\n /**\n @internal\n */\n serializeMark(mark, inline, options = {}) {\n let toDOM = this.marks[mark.type.name];\n return toDOM && renderSpec(doc(options), toDOM(mark, inline), null, mark.attrs);\n }\n static renderSpec(doc, structure, xmlNS = null, blockArraysIn) {\n return renderSpec(doc, structure, xmlNS, blockArraysIn);\n }\n /**\n Build a serializer using the [`toDOM`](https://prosemirror.net/docs/ref/#model.NodeSpec.toDOM)\n properties in a schema's node and mark specs.\n */\n static fromSchema(schema) {\n return schema.cached.domSerializer ||\n (schema.cached.domSerializer = new DOMSerializer(this.nodesFromSchema(schema), this.marksFromSchema(schema)));\n }\n /**\n Gather the serializers in a schema's node specs into an object.\n This can be useful as a base to build a custom serializer from.\n */\n static nodesFromSchema(schema) {\n let result = gatherToDOM(schema.nodes);\n if (!result.text)\n result.text = node => node.text;\n return result;\n }\n /**\n Gather the serializers in a schema's mark specs into an object.\n */\n static marksFromSchema(schema) {\n return gatherToDOM(schema.marks);\n }\n}\nfunction gatherToDOM(obj) {\n let result = {};\n for (let name in obj) {\n let toDOM = obj[name].spec.toDOM;\n if (toDOM)\n result[name] = toDOM;\n }\n return result;\n}\nfunction doc(options) {\n return options.document || window.document;\n}\nconst suspiciousAttributeCache = new WeakMap();\nfunction suspiciousAttributes(attrs) {\n let value = suspiciousAttributeCache.get(attrs);\n if (value === undefined)\n suspiciousAttributeCache.set(attrs, value = suspiciousAttributesInner(attrs));\n return value;\n}\nfunction suspiciousAttributesInner(attrs) {\n let result = null;\n function scan(value) {\n if (value && typeof value == \"object\") {\n if (Array.isArray(value)) {\n if (typeof value[0] == \"string\") {\n if (!result)\n result = [];\n result.push(value);\n }\n else {\n for (let i = 0; i < value.length; i++)\n scan(value[i]);\n }\n }\n else {\n for (let prop in value)\n scan(value[prop]);\n }\n }\n }\n scan(attrs);\n return result;\n}\nfunction renderSpec(doc, structure, xmlNS, blockArraysIn) {\n if (typeof structure == \"string\")\n return { dom: doc.createTextNode(structure) };\n if (structure.nodeType != null)\n return { dom: structure };\n if (structure.dom && structure.dom.nodeType != null)\n return structure;\n let tagName = structure[0], suspicious;\n if (typeof tagName != \"string\")\n throw new RangeError(\"Invalid array passed to renderSpec\");\n if (blockArraysIn && (suspicious = suspiciousAttributes(blockArraysIn)) &&\n suspicious.indexOf(structure) > -1)\n throw new RangeError(\"Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.\");\n let space = tagName.indexOf(\" \");\n if (space > 0) {\n xmlNS = tagName.slice(0, space);\n tagName = tagName.slice(space + 1);\n }\n let contentDOM;\n let dom = (xmlNS ? doc.createElementNS(xmlNS, tagName) : doc.createElement(tagName));\n let attrs = structure[1], start = 1;\n if (attrs && typeof attrs == \"object\" && attrs.nodeType == null && !Array.isArray(attrs)) {\n start = 2;\n for (let name in attrs)\n if (attrs[name] != null) {\n let space = name.indexOf(\" \");\n if (space > 0)\n dom.setAttributeNS(name.slice(0, space), name.slice(space + 1), attrs[name]);\n else\n dom.setAttribute(name, attrs[name]);\n }\n }\n for (let i = start; i < structure.length; i++) {\n let child = structure[i];\n if (child === 0) {\n if (i < structure.length - 1 || i > start)\n throw new RangeError(\"Content hole must be the only child of its parent node\");\n return { dom, contentDOM: dom };\n }\n else {\n let { dom: inner, contentDOM: innerContent } = renderSpec(doc, child, xmlNS, blockArraysIn);\n dom.appendChild(inner);\n if (innerContent) {\n if (contentDOM)\n throw new RangeError(\"Multiple content holes\");\n contentDOM = innerContent;\n }\n }\n }\n return { dom, contentDOM };\n}\n\nexport { ContentMatch, DOMParser, DOMSerializer, Fragment, Mark, MarkType, Node, NodeRange, NodeType, ReplaceError, ResolvedPos, Schema, Slice };\n","import { ReplaceError, Slice, Fragment, MarkType, Mark } from 'prosemirror-model';\n\n// Recovery values encode a range index and an offset. They are\n// represented as numbers, because tons of them will be created when\n// mapping, for example, a large number of decorations. The number's\n// lower 16 bits provide the index, the remaining bits the offset.\n//\n// Note: We intentionally don't use bit shift operators to en- and\n// decode these, since those clip to 32 bits, which we might in rare\n// cases want to overflow. A 64-bit float can represent 48-bit\n// integers precisely.\nconst lower16 = 0xffff;\nconst factor16 = Math.pow(2, 16);\nfunction makeRecover(index, offset) { return index + offset * factor16; }\nfunction recoverIndex(value) { return value & lower16; }\nfunction recoverOffset(value) { return (value - (value & lower16)) / factor16; }\nconst DEL_BEFORE = 1, DEL_AFTER = 2, DEL_ACROSS = 4, DEL_SIDE = 8;\n/**\nAn object representing a mapped position with extra\ninformation.\n*/\nclass MapResult {\n /**\n @internal\n */\n constructor(\n /**\n The mapped version of the position.\n */\n pos, \n /**\n @internal\n */\n delInfo, \n /**\n @internal\n */\n recover) {\n this.pos = pos;\n this.delInfo = delInfo;\n this.recover = recover;\n }\n /**\n Tells you whether the position was deleted, that is, whether the\n step removed the token on the side queried (via the `assoc`)\n argument from the document.\n */\n get deleted() { return (this.delInfo & DEL_SIDE) > 0; }\n /**\n Tells you whether the token before the mapped position was deleted.\n */\n get deletedBefore() { return (this.delInfo & (DEL_BEFORE | DEL_ACROSS)) > 0; }\n /**\n True when the token after the mapped position was deleted.\n */\n get deletedAfter() { return (this.delInfo & (DEL_AFTER | DEL_ACROSS)) > 0; }\n /**\n Tells whether any of the steps mapped through deletes across the\n position (including both the token before and after the\n position).\n */\n get deletedAcross() { return (this.delInfo & DEL_ACROSS) > 0; }\n}\n/**\nA map describing the deletions and insertions made by a step, which\ncan be used to find the correspondence between positions in the\npre-step version of a document and the same position in the\npost-step version.\n*/\nclass StepMap {\n /**\n Create a position map. The modifications to the document are\n represented as an array of numbers, in which each group of three\n represents a modified chunk as `[start, oldSize, newSize]`.\n */\n constructor(\n /**\n @internal\n */\n ranges, \n /**\n @internal\n */\n inverted = false) {\n this.ranges = ranges;\n this.inverted = inverted;\n if (!ranges.length && StepMap.empty)\n return StepMap.empty;\n }\n /**\n @internal\n */\n recover(value) {\n let diff = 0, index = recoverIndex(value);\n if (!this.inverted)\n for (let i = 0; i < index; i++)\n diff += this.ranges[i * 3 + 2] - this.ranges[i * 3 + 1];\n return this.ranges[index * 3] + diff + recoverOffset(value);\n }\n mapResult(pos, assoc = 1) { return this._map(pos, assoc, false); }\n map(pos, assoc = 1) { return this._map(pos, assoc, true); }\n /**\n @internal\n */\n _map(pos, assoc, simple) {\n let diff = 0, oldIndex = this.inverted ? 2 : 1, newIndex = this.inverted ? 1 : 2;\n for (let i = 0; i < this.ranges.length; i += 3) {\n let start = this.ranges[i] - (this.inverted ? diff : 0);\n if (start > pos)\n break;\n let oldSize = this.ranges[i + oldIndex], newSize = this.ranges[i + newIndex], end = start + oldSize;\n if (pos <= end) {\n let side = !oldSize ? assoc : pos == start ? -1 : pos == end ? 1 : assoc;\n let result = start + diff + (side < 0 ? 0 : newSize);\n if (simple)\n return result;\n let recover = pos == (assoc < 0 ? start : end) ? null : makeRecover(i / 3, pos - start);\n let del = pos == start ? DEL_AFTER : pos == end ? DEL_BEFORE : DEL_ACROSS;\n if (assoc < 0 ? pos != start : pos != end)\n del |= DEL_SIDE;\n return new MapResult(result, del, recover);\n }\n diff += newSize - oldSize;\n }\n return simple ? pos + diff : new MapResult(pos + diff, 0, null);\n }\n /**\n @internal\n */\n touches(pos, recover) {\n let diff = 0, index = recoverIndex(recover);\n let oldIndex = this.inverted ? 2 : 1, newIndex = this.inverted ? 1 : 2;\n for (let i = 0; i < this.ranges.length; i += 3) {\n let start = this.ranges[i] - (this.inverted ? diff : 0);\n if (start > pos)\n break;\n let oldSize = this.ranges[i + oldIndex], end = start + oldSize;\n if (pos <= end && i == index * 3)\n return true;\n diff += this.ranges[i + newIndex] - oldSize;\n }\n return false;\n }\n /**\n Calls the given function on each of the changed ranges included in\n this map.\n */\n forEach(f) {\n let oldIndex = this.inverted ? 2 : 1, newIndex = this.inverted ? 1 : 2;\n for (let i = 0, diff = 0; i < this.ranges.length; i += 3) {\n let start = this.ranges[i], oldStart = start - (this.inverted ? diff : 0), newStart = start + (this.inverted ? 0 : diff);\n let oldSize = this.ranges[i + oldIndex], newSize = this.ranges[i + newIndex];\n f(oldStart, oldStart + oldSize, newStart, newStart + newSize);\n diff += newSize - oldSize;\n }\n }\n /**\n Create an inverted version of this map. The result can be used to\n map positions in the post-step document to the pre-step document.\n */\n invert() {\n return new StepMap(this.ranges, !this.inverted);\n }\n /**\n @internal\n */\n toString() {\n return (this.inverted ? \"-\" : \"\") + JSON.stringify(this.ranges);\n }\n /**\n Create a map that moves all positions by offset `n` (which may be\n negative). This can be useful when applying steps meant for a\n sub-document to a larger document, or vice-versa.\n */\n static offset(n) {\n return n == 0 ? StepMap.empty : new StepMap(n < 0 ? [0, -n, 0] : [0, 0, n]);\n }\n}\n/**\nA StepMap that contains no changed ranges.\n*/\nStepMap.empty = new StepMap([]);\n/**\nA mapping represents a pipeline of zero or more [step\nmaps](https://prosemirror.net/docs/ref/#transform.StepMap). It has special provisions for losslessly\nhandling mapping positions through a series of steps in which some\nsteps are inverted versions of earlier steps. (This comes up when\n‘[rebasing](/docs/guide/#transform.rebasing)’ steps for\ncollaboration or history management.)\n*/\nclass Mapping {\n /**\n Create a new mapping with the given position maps.\n */\n constructor(\n /**\n The step maps in this mapping.\n */\n maps = [], \n /**\n @internal\n */\n mirror, \n /**\n The starting position in the `maps` array, used when `map` or\n `mapResult` is called.\n */\n from = 0, \n /**\n The end position in the `maps` array.\n */\n to = maps.length) {\n this.maps = maps;\n this.mirror = mirror;\n this.from = from;\n this.to = to;\n }\n /**\n Create a mapping that maps only through a part of this one.\n */\n slice(from = 0, to = this.maps.length) {\n return new Mapping(this.maps, this.mirror, from, to);\n }\n /**\n @internal\n */\n copy() {\n return new Mapping(this.maps.slice(), this.mirror && this.mirror.slice(), this.from, this.to);\n }\n /**\n Add a step map to the end of this mapping. If `mirrors` is\n given, it should be the index of the step map that is the mirror\n image of this one.\n */\n appendMap(map, mirrors) {\n this.to = this.maps.push(map);\n if (mirrors != null)\n this.setMirror(this.maps.length - 1, mirrors);\n }\n /**\n Add all the step maps in a given mapping to this one (preserving\n mirroring information).\n */\n appendMapping(mapping) {\n for (let i = 0, startSize = this.maps.length; i < mapping.maps.length; i++) {\n let mirr = mapping.getMirror(i);\n this.appendMap(mapping.maps[i], mirr != null && mirr < i ? startSize + mirr : undefined);\n }\n }\n /**\n Finds the offset of the step map that mirrors the map at the\n given offset, in this mapping (as per the second argument to\n `appendMap`).\n */\n getMirror(n) {\n if (this.mirror)\n for (let i = 0; i < this.mirror.length; i++)\n if (this.mirror[i] == n)\n return this.mirror[i + (i % 2 ? -1 : 1)];\n }\n /**\n @internal\n */\n setMirror(n, m) {\n if (!this.mirror)\n this.mirror = [];\n this.mirror.push(n, m);\n }\n /**\n Append the inverse of the given mapping to this one.\n */\n appendMappingInverted(mapping) {\n for (let i = mapping.maps.length - 1, totalSize = this.maps.length + mapping.maps.length; i >= 0; i--) {\n let mirr = mapping.getMirror(i);\n this.appendMap(mapping.maps[i].invert(), mirr != null && mirr > i ? totalSize - mirr - 1 : undefined);\n }\n }\n /**\n Create an inverted version of this mapping.\n */\n invert() {\n let inverse = new Mapping;\n inverse.appendMappingInverted(this);\n return inverse;\n }\n /**\n Map a position through this mapping.\n */\n map(pos, assoc = 1) {\n if (this.mirror)\n return this._map(pos, assoc, true);\n for (let i = this.from; i < this.to; i++)\n pos = this.maps[i].map(pos, assoc);\n return pos;\n }\n /**\n Map a position through this mapping, returning a mapping\n result.\n */\n mapResult(pos, assoc = 1) { return this._map(pos, assoc, false); }\n /**\n @internal\n */\n _map(pos, assoc, simple) {\n let delInfo = 0;\n for (let i = this.from; i < this.to; i++) {\n let map = this.maps[i], result = map.mapResult(pos, assoc);\n if (result.recover != null) {\n let corr = this.getMirror(i);\n if (corr != null && corr > i && corr < this.to) {\n i = corr;\n pos = this.maps[corr].recover(result.recover);\n continue;\n }\n }\n delInfo |= result.delInfo;\n pos = result.pos;\n }\n return simple ? pos : new MapResult(pos, delInfo, null);\n }\n}\n\nconst stepsByID = Object.create(null);\n/**\nA step object represents an atomic change. It generally applies\nonly to the document it was created for, since the positions\nstored in it will only make sense for that document.\n\nNew steps are defined by creating classes that extend `Step`,\noverriding the `apply`, `invert`, `map`, `getMap` and `fromJSON`\nmethods, and registering your class with a unique\nJSON-serialization identifier using\n[`Step.jsonID`](https://prosemirror.net/docs/ref/#transform.Step^jsonID).\n*/\nclass Step {\n /**\n Get the step map that represents the changes made by this step,\n and which can be used to transform between positions in the old\n and the new document.\n */\n getMap() { return StepMap.empty; }\n /**\n Try to merge this step with another one, to be applied directly\n after it. Returns the merged step when possible, null if the\n steps can't be merged.\n */\n merge(other) { return null; }\n /**\n Deserialize a step from its JSON representation. Will call\n through to the step class' own implementation of this method.\n */\n static fromJSON(schema, json) {\n if (!json || !json.stepType)\n throw new RangeError(\"Invalid input for Step.fromJSON\");\n let type = stepsByID[json.stepType];\n if (!type)\n throw new RangeError(`No step type ${json.stepType} defined`);\n return type.fromJSON(schema, json);\n }\n /**\n To be able to serialize steps to JSON, each step needs a string\n ID to attach to its JSON representation. Use this method to\n register an ID for your step classes. Try to pick something\n that's unlikely to clash with steps from other modules.\n */\n static jsonID(id, stepClass) {\n if (id in stepsByID)\n throw new RangeError(\"Duplicate use of step JSON ID \" + id);\n stepsByID[id] = stepClass;\n stepClass.prototype.jsonID = id;\n return stepClass;\n }\n}\n/**\nThe result of [applying](https://prosemirror.net/docs/ref/#transform.Step.apply) a step. Contains either a\nnew document or a failure value.\n*/\nclass StepResult {\n /**\n @internal\n */\n constructor(\n /**\n The transformed document, if successful.\n */\n doc, \n /**\n The failure message, if unsuccessful.\n */\n failed) {\n this.doc = doc;\n this.failed = failed;\n }\n /**\n Create a successful step result.\n */\n static ok(doc) { return new StepResult(doc, null); }\n /**\n Create a failed step result.\n */\n static fail(message) { return new StepResult(null, message); }\n /**\n Call [`Node.replace`](https://prosemirror.net/docs/ref/#model.Node.replace) with the given\n arguments. Create a successful result if it succeeds, and a\n failed one if it throws a `ReplaceError`.\n */\n static fromReplace(doc, from, to, slice) {\n try {\n return StepResult.ok(doc.replace(from, to, slice));\n }\n catch (e) {\n if (e instanceof ReplaceError)\n return StepResult.fail(e.message);\n throw e;\n }\n }\n}\n\nfunction mapFragment(fragment, f, parent) {\n let mapped = [];\n for (let i = 0; i < fragment.childCount; i++) {\n let child = fragment.child(i);\n if (child.content.size)\n child = child.copy(mapFragment(child.content, f, child));\n if (child.isInline)\n child = f(child, parent, i);\n mapped.push(child);\n }\n return Fragment.fromArray(mapped);\n}\n/**\nAdd a mark to all inline content between two positions.\n*/\nclass AddMarkStep extends Step {\n /**\n Create a mark step.\n */\n constructor(\n /**\n The start of the marked range.\n */\n from, \n /**\n The end of the marked range.\n */\n to, \n /**\n The mark to add.\n */\n mark) {\n super();\n this.from = from;\n this.to = to;\n this.mark = mark;\n }\n apply(doc) {\n let oldSlice = doc.slice(this.from, this.to), $from = doc.resolve(this.from);\n let parent = $from.node($from.sharedDepth(this.to));\n let slice = new Slice(mapFragment(oldSlice.content, (node, parent) => {\n if (!node.isAtom || !parent.type.allowsMarkType(this.mark.type))\n return node;\n return node.mark(this.mark.addToSet(node.marks));\n }, parent), oldSlice.openStart, oldSlice.openEnd);\n return StepResult.fromReplace(doc, this.from, this.to, slice);\n }\n invert() {\n return new RemoveMarkStep(this.from, this.to, this.mark);\n }\n map(mapping) {\n let from = mapping.mapResult(this.from, 1), to = mapping.mapResult(this.to, -1);\n if (from.deleted && to.deleted || from.pos >= to.pos)\n return null;\n return new AddMarkStep(from.pos, to.pos, this.mark);\n }\n merge(other) {\n if (other instanceof AddMarkStep &&\n other.mark.eq(this.mark) &&\n this.from <= other.to && this.to >= other.from)\n return new AddMarkStep(Math.min(this.from, other.from), Math.max(this.to, other.to), this.mark);\n return null;\n }\n toJSON() {\n return { stepType: \"addMark\", mark: this.mark.toJSON(),\n from: this.from, to: this.to };\n }\n /**\n @internal\n */\n static fromJSON(schema, json) {\n if (typeof json.from != \"number\" || typeof json.to != \"number\")\n throw new RangeError(\"Invalid input for AddMarkStep.fromJSON\");\n return new AddMarkStep(json.from, json.to, schema.markFromJSON(json.mark));\n }\n}\nStep.jsonID(\"addMark\", AddMarkStep);\n/**\nRemove a mark from all inline content between two positions.\n*/\nclass RemoveMarkStep extends Step {\n /**\n Create a mark-removing step.\n */\n constructor(\n /**\n The start of the unmarked range.\n */\n from, \n /**\n The end of the unmarked range.\n */\n to, \n /**\n The mark to remove.\n */\n mark) {\n super();\n this.from = from;\n this.to = to;\n this.mark = mark;\n }\n apply(doc) {\n let oldSlice = doc.slice(this.from, this.to);\n let slice = new Slice(mapFragment(oldSlice.content, node => {\n return node.mark(this.mark.removeFromSet(node.marks));\n }, doc), oldSlice.openStart, oldSlice.openEnd);\n return StepResult.fromReplace(doc, this.from, this.to, slice);\n }\n invert() {\n return new AddMarkStep(this.from, this.to, this.mark);\n }\n map(mapping) {\n let from = mapping.mapResult(this.from, 1), to = mapping.mapResult(this.to, -1);\n if (from.deleted && to.deleted || from.pos >= to.pos)\n return null;\n return new RemoveMarkStep(from.pos, to.pos, this.mark);\n }\n merge(other) {\n if (other instanceof RemoveMarkStep &&\n other.mark.eq(this.mark) &&\n this.from <= other.to && this.to >= other.from)\n return new RemoveMarkStep(Math.min(this.from, other.from), Math.max(this.to, other.to), this.mark);\n return null;\n }\n toJSON() {\n return { stepType: \"removeMark\", mark: this.mark.toJSON(),\n from: this.from, to: this.to };\n }\n /**\n @internal\n */\n static fromJSON(schema, json) {\n if (typeof json.from != \"number\" || typeof json.to != \"number\")\n throw new RangeError(\"Invalid input for RemoveMarkStep.fromJSON\");\n return new RemoveMarkStep(json.from, json.to, schema.markFromJSON(json.mark));\n }\n}\nStep.jsonID(\"removeMark\", RemoveMarkStep);\n/**\nAdd a mark to a specific node.\n*/\nclass AddNodeMarkStep extends Step {\n /**\n Create a node mark step.\n */\n constructor(\n /**\n The position of the target node.\n */\n pos, \n /**\n The mark to add.\n */\n mark) {\n super();\n this.pos = pos;\n this.mark = mark;\n }\n apply(doc) {\n let node = doc.nodeAt(this.pos);\n if (!node)\n return StepResult.fail(\"No node at mark step's position\");\n let updated = node.type.create(node.attrs, null, this.mark.addToSet(node.marks));\n return StepResult.fromReplace(doc, this.pos, this.pos + 1, new Slice(Fragment.from(updated), 0, node.isLeaf ? 0 : 1));\n }\n invert(doc) {\n let node = doc.nodeAt(this.pos);\n if (node) {\n let newSet = this.mark.addToSet(node.marks);\n if (newSet.length == node.marks.length) {\n for (let i = 0; i < node.marks.length; i++)\n if (!node.marks[i].isInSet(newSet))\n return new AddNodeMarkStep(this.pos, node.marks[i]);\n return new AddNodeMarkStep(this.pos, this.mark);\n }\n }\n return new RemoveNodeMarkStep(this.pos, this.mark);\n }\n map(mapping) {\n let pos = mapping.mapResult(this.pos, 1);\n return pos.deletedAfter ? null : new AddNodeMarkStep(pos.pos, this.mark);\n }\n toJSON() {\n return { stepType: \"addNodeMark\", pos: this.pos, mark: this.mark.toJSON() };\n }\n /**\n @internal\n */\n static fromJSON(schema, json) {\n if (typeof json.pos != \"number\")\n throw new RangeError(\"Invalid input for AddNodeMarkStep.fromJSON\");\n return new AddNodeMarkStep(json.pos, schema.markFromJSON(json.mark));\n }\n}\nStep.jsonID(\"addNodeMark\", AddNodeMarkStep);\n/**\nRemove a mark from a specific node.\n*/\nclass RemoveNodeMarkStep extends Step {\n /**\n Create a mark-removing step.\n */\n constructor(\n /**\n The position of the target node.\n */\n pos, \n /**\n The mark to remove.\n */\n mark) {\n super();\n this.pos = pos;\n this.mark = mark;\n }\n apply(doc) {\n let node = doc.nodeAt(this.pos);\n if (!node)\n return StepResult.fail(\"No node at mark step's position\");\n let updated = node.type.create(node.attrs, null, this.mark.removeFromSet(node.marks));\n return StepResult.fromReplace(doc, this.pos, this.pos + 1, new Slice(Fragment.from(updated), 0, node.isLeaf ? 0 : 1));\n }\n invert(doc) {\n let node = doc.nodeAt(this.pos);\n if (!node || !this.mark.isInSet(node.marks))\n return this;\n return new AddNodeMarkStep(this.pos, this.mark);\n }\n map(mapping) {\n let pos = mapping.mapResult(this.pos, 1);\n return pos.deletedAfter ? null : new RemoveNodeMarkStep(pos.pos, this.mark);\n }\n toJSON() {\n return { stepType: \"removeNodeMark\", pos: this.pos, mark: this.mark.toJSON() };\n }\n /**\n @internal\n */\n static fromJSON(schema, json) {\n if (typeof json.pos != \"number\")\n throw new RangeError(\"Invalid input for RemoveNodeMarkStep.fromJSON\");\n return new RemoveNodeMarkStep(json.pos, schema.markFromJSON(json.mark));\n }\n}\nStep.jsonID(\"removeNodeMark\", RemoveNodeMarkStep);\n\n/**\nReplace a part of the document with a slice of new content.\n*/\nclass ReplaceStep extends Step {\n /**\n The given `slice` should fit the 'gap' between `from` and\n `to`—the depths must line up, and the surrounding nodes must be\n able to be joined with the open sides of the slice. When\n `structure` is true, the step will fail if the content between\n from and to is not just a sequence of closing and then opening\n tokens (this is to guard against rebased replace steps\n overwriting something they weren't supposed to).\n */\n constructor(\n /**\n The start position of the replaced range.\n */\n from, \n /**\n The end position of the replaced range.\n */\n to, \n /**\n The slice to insert.\n */\n slice, \n /**\n @internal\n */\n structure = false) {\n super();\n this.from = from;\n this.to = to;\n this.slice = slice;\n this.structure = structure;\n }\n apply(doc) {\n if (this.structure && contentBetween(doc, this.from, this.to))\n return StepResult.fail(\"Structure replace would overwrite content\");\n return StepResult.fromReplace(doc, this.from, this.to, this.slice);\n }\n getMap() {\n return new StepMap([this.from, this.to - this.from, this.slice.size]);\n }\n invert(doc) {\n return new ReplaceStep(this.from, this.from + this.slice.size, doc.slice(this.from, this.to));\n }\n map(mapping) {\n let from = mapping.mapResult(this.from, 1), to = mapping.mapResult(this.to, -1);\n if (from.deletedAcross && to.deletedAcross)\n return null;\n return new ReplaceStep(from.pos, Math.max(from.pos, to.pos), this.slice);\n }\n merge(other) {\n if (!(other instanceof ReplaceStep) || other.structure || this.structure)\n return null;\n if (this.from + this.slice.size == other.from && !this.slice.openEnd && !other.slice.openStart) {\n let slice = this.slice.size + other.slice.size == 0 ? Slice.empty\n : new Slice(this.slice.content.append(other.slice.content), this.slice.openStart, other.slice.openEnd);\n return new ReplaceStep(this.from, this.to + (other.to - other.from), slice, this.structure);\n }\n else if (other.to == this.from && !this.slice.openStart && !other.slice.openEnd) {\n let slice = this.slice.size + other.slice.size == 0 ? Slice.empty\n : new Slice(other.slice.content.append(this.slice.content), other.slice.openStart, this.slice.openEnd);\n return new ReplaceStep(other.from, this.to, slice, this.structure);\n }\n else {\n return null;\n }\n }\n toJSON() {\n let json = { stepType: \"replace\", from: this.from, to: this.to };\n if (this.slice.size)\n json.slice = this.slice.toJSON();\n if (this.structure)\n json.structure = true;\n return json;\n }\n /**\n @internal\n */\n static fromJSON(schema, json) {\n if (typeof json.from != \"number\" || typeof json.to != \"number\")\n throw new RangeError(\"Invalid input for ReplaceStep.fromJSON\");\n return new ReplaceStep(json.from, json.to, Slice.fromJSON(schema, json.slice), !!json.structure);\n }\n}\nStep.jsonID(\"replace\", ReplaceStep);\n/**\nReplace a part of the document with a slice of content, but\npreserve a range of the replaced content by moving it into the\nslice.\n*/\nclass ReplaceAroundStep extends Step {\n /**\n Create a replace-around step with the given range and gap.\n `insert` should be the point in the slice into which the content\n of the gap should be moved. `structure` has the same meaning as\n it has in the [`ReplaceStep`](https://prosemirror.net/docs/ref/#transform.ReplaceStep) class.\n */\n constructor(\n /**\n The start position of the replaced range.\n */\n from, \n /**\n The end position of the replaced range.\n */\n to, \n /**\n The start of preserved range.\n */\n gapFrom, \n /**\n The end of preserved range.\n */\n gapTo, \n /**\n The slice to insert.\n */\n slice, \n /**\n The position in the slice where the preserved range should be\n inserted.\n */\n insert, \n /**\n @internal\n */\n structure = false) {\n super();\n this.from = from;\n this.to = to;\n this.gapFrom = gapFrom;\n this.gapTo = gapTo;\n this.slice = slice;\n this.insert = insert;\n this.structure = structure;\n }\n apply(doc) {\n if (this.structure && (contentBetween(doc, this.from, this.gapFrom) ||\n contentBetween(doc, this.gapTo, this.to)))\n return StepResult.fail(\"Structure gap-replace would overwrite content\");\n let gap = doc.slice(this.gapFrom, this.gapTo);\n if (gap.openStart || gap.openEnd)\n return StepResult.fail(\"Gap is not a flat range\");\n let inserted = this.slice.insertAt(this.insert, gap.content);\n if (!inserted)\n return StepResult.fail(\"Content does not fit in gap\");\n return StepResult.fromReplace(doc, this.from, this.to, inserted);\n }\n getMap() {\n return new StepMap([this.from, this.gapFrom - this.from, this.insert,\n this.gapTo, this.to - this.gapTo, this.slice.size - this.insert]);\n }\n invert(doc) {\n let gap = this.gapTo - this.gapFrom;\n 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);\n }\n map(mapping) {\n let from = mapping.mapResult(this.from, 1), to = mapping.mapResult(this.to, -1);\n let gapFrom = this.from == this.gapFrom ? from.pos : mapping.map(this.gapFrom, -1);\n let gapTo = this.to == this.gapTo ? to.pos : mapping.map(this.gapTo, 1);\n if ((from.deletedAcross && to.deletedAcross) || gapFrom < from.pos || gapTo > to.pos)\n return null;\n return new ReplaceAroundStep(from.pos, to.pos, gapFrom, gapTo, this.slice, this.insert, this.structure);\n }\n toJSON() {\n let json = { stepType: \"replaceAround\", from: this.from, to: this.to,\n gapFrom: this.gapFrom, gapTo: this.gapTo, insert: this.insert };\n if (this.slice.size)\n json.slice = this.slice.toJSON();\n if (this.structure)\n json.structure = true;\n return json;\n }\n /**\n @internal\n */\n static fromJSON(schema, json) {\n if (typeof json.from != \"number\" || typeof json.to != \"number\" ||\n typeof json.gapFrom != \"number\" || typeof json.gapTo != \"number\" || typeof json.insert != \"number\")\n throw new RangeError(\"Invalid input for ReplaceAroundStep.fromJSON\");\n return new ReplaceAroundStep(json.from, json.to, json.gapFrom, json.gapTo, Slice.fromJSON(schema, json.slice), json.insert, !!json.structure);\n }\n}\nStep.jsonID(\"replaceAround\", ReplaceAroundStep);\nfunction contentBetween(doc, from, to) {\n let $from = doc.resolve(from), dist = to - from, depth = $from.depth;\n while (dist > 0 && depth > 0 && $from.indexAfter(depth) == $from.node(depth).childCount) {\n depth--;\n dist--;\n }\n if (dist > 0) {\n let next = $from.node(depth).maybeChild($from.indexAfter(depth));\n while (dist > 0) {\n if (!next || next.isLeaf)\n return true;\n next = next.firstChild;\n dist--;\n }\n }\n return false;\n}\n\nfunction addMark(tr, from, to, mark) {\n let removed = [], added = [];\n let removing, adding;\n tr.doc.nodesBetween(from, to, (node, pos, parent) => {\n if (!node.isInline)\n return;\n let marks = node.marks;\n if (!mark.isInSet(marks) && parent.type.allowsMarkType(mark.type)) {\n let start = Math.max(pos, from), end = Math.min(pos + node.nodeSize, to);\n let newSet = mark.addToSet(marks);\n for (let i = 0; i < marks.length; i++) {\n if (!marks[i].isInSet(newSet)) {\n if (removing && removing.to == start && removing.mark.eq(marks[i]))\n removing.to = end;\n else\n removed.push(removing = new RemoveMarkStep(start, end, marks[i]));\n }\n }\n if (adding && adding.to == start)\n adding.to = end;\n else\n added.push(adding = new AddMarkStep(start, end, mark));\n }\n });\n removed.forEach(s => tr.step(s));\n added.forEach(s => tr.step(s));\n}\nfunction removeMark(tr, from, to, mark) {\n let matched = [], step = 0;\n tr.doc.nodesBetween(from, to, (node, pos) => {\n if (!node.isInline)\n return;\n step++;\n let toRemove = null;\n if (mark instanceof MarkType) {\n let set = node.marks, found;\n while (found = mark.isInSet(set)) {\n (toRemove || (toRemove = [])).push(found);\n set = found.removeFromSet(set);\n }\n }\n else if (mark) {\n if (mark.isInSet(node.marks))\n toRemove = [mark];\n }\n else {\n toRemove = node.marks;\n }\n if (toRemove && toRemove.length) {\n let end = Math.min(pos + node.nodeSize, to);\n for (let i = 0; i < toRemove.length; i++) {\n let style = toRemove[i], found;\n for (let j = 0; j < matched.length; j++) {\n let m = matched[j];\n if (m.step == step - 1 && style.eq(matched[j].style))\n found = m;\n }\n if (found) {\n found.to = end;\n found.step = step;\n }\n else {\n matched.push({ style, from: Math.max(pos, from), to: end, step });\n }\n }\n }\n });\n matched.forEach(m => tr.step(new RemoveMarkStep(m.from, m.to, m.style)));\n}\nfunction clearIncompatible(tr, pos, parentType, match = parentType.contentMatch, clearNewlines = true) {\n let node = tr.doc.nodeAt(pos);\n let replSteps = [], cur = pos + 1;\n for (let i = 0; i < node.childCount; i++) {\n let child = node.child(i), end = cur + child.nodeSize;\n let allowed = match.matchType(child.type);\n if (!allowed) {\n replSteps.push(new ReplaceStep(cur, end, Slice.empty));\n }\n else {\n match = allowed;\n for (let j = 0; j < child.marks.length; j++)\n if (!parentType.allowsMarkType(child.marks[j].type))\n tr.step(new RemoveMarkStep(cur, end, child.marks[j]));\n if (clearNewlines && child.isText && parentType.whitespace != \"pre\") {\n let m, newline = /\\r?\\n|\\r/g, slice;\n while (m = newline.exec(child.text)) {\n if (!slice)\n slice = new Slice(Fragment.from(parentType.schema.text(\" \", parentType.allowedMarks(child.marks))), 0, 0);\n replSteps.push(new ReplaceStep(cur + m.index, cur + m.index + m[0].length, slice));\n }\n }\n }\n cur = end;\n }\n if (!match.validEnd) {\n let fill = match.fillBefore(Fragment.empty, true);\n tr.replace(cur, cur, new Slice(fill, 0, 0));\n }\n for (let i = replSteps.length - 1; i >= 0; i--)\n tr.step(replSteps[i]);\n}\n\nfunction canCut(node, start, end) {\n return (start == 0 || node.canReplace(start, node.childCount)) &&\n (end == node.childCount || node.canReplace(0, end));\n}\n/**\nTry to find a target depth to which the content in the given range\ncan be lifted. Will not go across\n[isolating](https://prosemirror.net/docs/ref/#model.NodeSpec.isolating) parent nodes.\n*/\nfunction liftTarget(range) {\n let parent = range.parent;\n let content = parent.content.cutByIndex(range.startIndex, range.endIndex);\n for (let depth = range.depth;; --depth) {\n let node = range.$from.node(depth);\n let index = range.$from.index(depth), endIndex = range.$to.indexAfter(depth);\n if (depth < range.depth && node.canReplace(index, endIndex, content))\n return depth;\n if (depth == 0 || node.type.spec.isolating || !canCut(node, index, endIndex))\n break;\n }\n return null;\n}\nfunction lift(tr, range, target) {\n let { $from, $to, depth } = range;\n let gapStart = $from.before(depth + 1), gapEnd = $to.after(depth + 1);\n let start = gapStart, end = gapEnd;\n let before = Fragment.empty, openStart = 0;\n for (let d = depth, splitting = false; d > target; d--)\n if (splitting || $from.index(d) > 0) {\n splitting = true;\n before = Fragment.from($from.node(d).copy(before));\n openStart++;\n }\n else {\n start--;\n }\n let after = Fragment.empty, openEnd = 0;\n for (let d = depth, splitting = false; d > target; d--)\n if (splitting || $to.after(d + 1) < $to.end(d)) {\n splitting = true;\n after = Fragment.from($to.node(d).copy(after));\n openEnd++;\n }\n else {\n end++;\n }\n tr.step(new ReplaceAroundStep(start, end, gapStart, gapEnd, new Slice(before.append(after), openStart, openEnd), before.size - openStart, true));\n}\n/**\nTry to find a valid way to wrap the content in the given range in a\nnode of the given type. May introduce extra nodes around and inside\nthe wrapper node, if necessary. Returns null if no valid wrapping\ncould be found. When `innerRange` is given, that range's content is\nused as the content to fit into the wrapping, instead of the\ncontent of `range`.\n*/\nfunction findWrapping(range, nodeType, attrs = null, innerRange = range) {\n let around = findWrappingOutside(range, nodeType);\n let inner = around && findWrappingInside(innerRange, nodeType);\n if (!inner)\n return null;\n return around.map(withAttrs)\n .concat({ type: nodeType, attrs }).concat(inner.map(withAttrs));\n}\nfunction withAttrs(type) { return { type, attrs: null }; }\nfunction findWrappingOutside(range, type) {\n let { parent, startIndex, endIndex } = range;\n let around = parent.contentMatchAt(startIndex).findWrapping(type);\n if (!around)\n return null;\n let outer = around.length ? around[0] : type;\n return parent.canReplaceWith(startIndex, endIndex, outer) ? around : null;\n}\nfunction findWrappingInside(range, type) {\n let { parent, startIndex, endIndex } = range;\n let inner = parent.child(startIndex);\n let inside = type.contentMatch.findWrapping(inner.type);\n if (!inside)\n return null;\n let lastType = inside.length ? inside[inside.length - 1] : type;\n let innerMatch = lastType.contentMatch;\n for (let i = startIndex; innerMatch && i < endIndex; i++)\n innerMatch = innerMatch.matchType(parent.child(i).type);\n if (!innerMatch || !innerMatch.validEnd)\n return null;\n return inside;\n}\nfunction wrap(tr, range, wrappers) {\n let content = Fragment.empty;\n for (let i = wrappers.length - 1; i >= 0; i--) {\n if (content.size) {\n let match = wrappers[i].type.contentMatch.matchFragment(content);\n if (!match || !match.validEnd)\n throw new RangeError(\"Wrapper type given to Transform.wrap does not form valid content of its parent wrapper\");\n }\n content = Fragment.from(wrappers[i].type.create(wrappers[i].attrs, content));\n }\n let start = range.start, end = range.end;\n tr.step(new ReplaceAroundStep(start, end, start, end, new Slice(content, 0, 0), wrappers.length, true));\n}\nfunction setBlockType(tr, from, to, type, attrs) {\n if (!type.isTextblock)\n throw new RangeError(\"Type given to setBlockType should be a textblock\");\n let mapFrom = tr.steps.length;\n tr.doc.nodesBetween(from, to, (node, pos) => {\n let attrsHere = typeof attrs == \"function\" ? attrs(node) : attrs;\n if (node.isTextblock && !node.hasMarkup(type, attrsHere) &&\n canChangeType(tr.doc, tr.mapping.slice(mapFrom).map(pos), type)) {\n let convertNewlines = null;\n if (type.schema.linebreakReplacement) {\n let pre = type.whitespace == \"pre\", supportLinebreak = !!type.contentMatch.matchType(type.schema.linebreakReplacement);\n if (pre && !supportLinebreak)\n convertNewlines = false;\n else if (!pre && supportLinebreak)\n convertNewlines = true;\n }\n // Ensure all markup that isn't allowed in the new node type is cleared\n if (convertNewlines === false)\n replaceLinebreaks(tr, node, pos, mapFrom);\n clearIncompatible(tr, tr.mapping.slice(mapFrom).map(pos, 1), type, undefined, convertNewlines === null);\n let mapping = tr.mapping.slice(mapFrom);\n let startM = mapping.map(pos, 1), endM = mapping.map(pos + node.nodeSize, 1);\n tr.step(new ReplaceAroundStep(startM, endM, startM + 1, endM - 1, new Slice(Fragment.from(type.create(attrsHere, null, node.marks)), 0, 0), 1, true));\n if (convertNewlines === true)\n replaceNewlines(tr, node, pos, mapFrom);\n return false;\n }\n });\n}\nfunction replaceNewlines(tr, node, pos, mapFrom) {\n node.forEach((child, offset) => {\n if (child.isText) {\n let m, newline = /\\r?\\n|\\r/g;\n while (m = newline.exec(child.text)) {\n let start = tr.mapping.slice(mapFrom).map(pos + 1 + offset + m.index);\n tr.replaceWith(start, start + 1, node.type.schema.linebreakReplacement.create());\n }\n }\n });\n}\nfunction replaceLinebreaks(tr, node, pos, mapFrom) {\n node.forEach((child, offset) => {\n if (child.type == child.type.schema.linebreakReplacement) {\n let start = tr.mapping.slice(mapFrom).map(pos + 1 + offset);\n tr.replaceWith(start, start + 1, node.type.schema.text(\"\\n\"));\n }\n });\n}\nfunction canChangeType(doc, pos, type) {\n let $pos = doc.resolve(pos), index = $pos.index();\n return $pos.parent.canReplaceWith(index, index + 1, type);\n}\n/**\nChange the type, attributes, and/or marks of the node at `pos`.\nWhen `type` isn't given, the existing node type is preserved,\n*/\nfunction setNodeMarkup(tr, pos, type, attrs, marks) {\n let node = tr.doc.nodeAt(pos);\n if (!node)\n throw new RangeError(\"No node at given position\");\n if (!type)\n type = node.type;\n let newNode = type.create(attrs, null, marks || node.marks);\n if (node.isLeaf)\n return tr.replaceWith(pos, pos + node.nodeSize, newNode);\n if (!type.validContent(node.content))\n throw new RangeError(\"Invalid content for node type \" + type.name);\n tr.step(new ReplaceAroundStep(pos, pos + node.nodeSize, pos + 1, pos + node.nodeSize - 1, new Slice(Fragment.from(newNode), 0, 0), 1, true));\n}\n/**\nCheck whether splitting at the given position is allowed.\n*/\nfunction canSplit(doc, pos, depth = 1, typesAfter) {\n let $pos = doc.resolve(pos), base = $pos.depth - depth;\n let innerType = (typesAfter && typesAfter[typesAfter.length - 1]) || $pos.parent;\n if (base < 0 || $pos.parent.type.spec.isolating ||\n !$pos.parent.canReplace($pos.index(), $pos.parent.childCount) ||\n !innerType.type.validContent($pos.parent.content.cutByIndex($pos.index(), $pos.parent.childCount)))\n return false;\n for (let d = $pos.depth - 1, i = depth - 2; d > base; d--, i--) {\n let node = $pos.node(d), index = $pos.index(d);\n if (node.type.spec.isolating)\n return false;\n let rest = node.content.cutByIndex(index, node.childCount);\n let overrideChild = typesAfter && typesAfter[i + 1];\n if (overrideChild)\n rest = rest.replaceChild(0, overrideChild.type.create(overrideChild.attrs));\n let after = (typesAfter && typesAfter[i]) || node;\n if (!node.canReplace(index + 1, node.childCount) || !after.type.validContent(rest))\n return false;\n }\n let index = $pos.indexAfter(base);\n let baseType = typesAfter && typesAfter[0];\n return $pos.node(base).canReplaceWith(index, index, baseType ? baseType.type : $pos.node(base + 1).type);\n}\nfunction split(tr, pos, depth = 1, typesAfter) {\n let $pos = tr.doc.resolve(pos), before = Fragment.empty, after = Fragment.empty;\n for (let d = $pos.depth, e = $pos.depth - depth, i = depth - 1; d > e; d--, i--) {\n before = Fragment.from($pos.node(d).copy(before));\n let typeAfter = typesAfter && typesAfter[i];\n after = Fragment.from(typeAfter ? typeAfter.type.create(typeAfter.attrs, after) : $pos.node(d).copy(after));\n }\n tr.step(new ReplaceStep(pos, pos, new Slice(before.append(after), depth, depth), true));\n}\n/**\nTest whether the blocks before and after a given position can be\njoined.\n*/\nfunction canJoin(doc, pos) {\n let $pos = doc.resolve(pos), index = $pos.index();\n return joinable($pos.nodeBefore, $pos.nodeAfter) &&\n $pos.parent.canReplace(index, index + 1);\n}\nfunction joinable(a, b) {\n return !!(a && b && !a.isLeaf && a.canAppend(b));\n}\n/**\nFind an ancestor of the given position that can be joined to the\nblock before (or after if `dir` is positive). Returns the joinable\npoint, if any.\n*/\nfunction joinPoint(doc, pos, dir = -1) {\n let $pos = doc.resolve(pos);\n for (let d = $pos.depth;; d--) {\n let before, after, index = $pos.index(d);\n if (d == $pos.depth) {\n before = $pos.nodeBefore;\n after = $pos.nodeAfter;\n }\n else if (dir > 0) {\n before = $pos.node(d + 1);\n index++;\n after = $pos.node(d).maybeChild(index);\n }\n else {\n before = $pos.node(d).maybeChild(index - 1);\n after = $pos.node(d + 1);\n }\n if (before && !before.isTextblock && joinable(before, after) &&\n $pos.node(d).canReplace(index, index + 1))\n return pos;\n if (d == 0)\n break;\n pos = dir < 0 ? $pos.before(d) : $pos.after(d);\n }\n}\nfunction join(tr, pos, depth) {\n let step = new ReplaceStep(pos - depth, pos + depth, Slice.empty, true);\n tr.step(step);\n}\n/**\nTry to find a point where a node of the given type can be inserted\nnear `pos`, by searching up the node hierarchy when `pos` itself\nisn't a valid place but is at the start or end of a node. Return\nnull if no position was found.\n*/\nfunction insertPoint(doc, pos, nodeType) {\n let $pos = doc.resolve(pos);\n if ($pos.parent.canReplaceWith($pos.index(), $pos.index(), nodeType))\n return pos;\n if ($pos.parentOffset == 0)\n for (let d = $pos.depth - 1; d >= 0; d--) {\n let index = $pos.index(d);\n if ($pos.node(d).canReplaceWith(index, index, nodeType))\n return $pos.before(d + 1);\n if (index > 0)\n return null;\n }\n if ($pos.parentOffset == $pos.parent.content.size)\n for (let d = $pos.depth - 1; d >= 0; d--) {\n let index = $pos.indexAfter(d);\n if ($pos.node(d).canReplaceWith(index, index, nodeType))\n return $pos.after(d + 1);\n if (index < $pos.node(d).childCount)\n return null;\n }\n return null;\n}\n/**\nFinds a position at or around the given position where the given\nslice can be inserted. Will look at parent nodes' nearest boundary\nand try there, even if the original position wasn't directly at the\nstart or end of that node. Returns null when no position was found.\n*/\nfunction dropPoint(doc, pos, slice) {\n let $pos = doc.resolve(pos);\n if (!slice.content.size)\n return pos;\n let content = slice.content;\n for (let i = 0; i < slice.openStart; i++)\n content = content.firstChild.content;\n for (let pass = 1; pass <= (slice.openStart == 0 && slice.size ? 2 : 1); pass++) {\n for (let d = $pos.depth; d >= 0; d--) {\n let bias = d == $pos.depth ? 0 : $pos.pos <= ($pos.start(d + 1) + $pos.end(d + 1)) / 2 ? -1 : 1;\n let insertPos = $pos.index(d) + (bias > 0 ? 1 : 0);\n let parent = $pos.node(d), fits = false;\n if (pass == 1) {\n fits = parent.canReplace(insertPos, insertPos, content);\n }\n else {\n let wrapping = parent.contentMatchAt(insertPos).findWrapping(content.firstChild.type);\n fits = wrapping && parent.canReplaceWith(insertPos, insertPos, wrapping[0]);\n }\n if (fits)\n return bias == 0 ? $pos.pos : bias < 0 ? $pos.before(d + 1) : $pos.after(d + 1);\n }\n }\n return null;\n}\n\n/**\n‘Fit’ a slice into a given position in the document, producing a\n[step](https://prosemirror.net/docs/ref/#transform.Step) that inserts it. Will return null if\nthere's no meaningful way to insert the slice here, or inserting it\nwould be a no-op (an empty slice over an empty range).\n*/\nfunction replaceStep(doc, from, to = from, slice = Slice.empty) {\n if (from == to && !slice.size)\n return null;\n let $from = doc.resolve(from), $to = doc.resolve(to);\n // Optimization -- avoid work if it's obvious that it's not needed.\n if (fitsTrivially($from, $to, slice))\n return new ReplaceStep(from, to, slice);\n return new Fitter($from, $to, slice).fit();\n}\nfunction fitsTrivially($from, $to, slice) {\n return !slice.openStart && !slice.openEnd && $from.start() == $to.start() &&\n $from.parent.canReplace($from.index(), $to.index(), slice.content);\n}\n// Algorithm for 'placing' the elements of a slice into a gap:\n//\n// We consider the content of each node that is open to the left to be\n// independently placeable. I.e. in , when the\n// paragraph on the left is open, \"foo\" can be placed (somewhere on\n// the left side of the replacement gap) independently from p(\"bar\").\n//\n// This class tracks the state of the placement progress in the\n// following properties:\n//\n// - `frontier` holds a stack of `{type, match}` objects that\n// represent the open side of the replacement. It starts at\n// `$from`, then moves forward as content is placed, and is finally\n// reconciled with `$to`.\n//\n// - `unplaced` is a slice that represents the content that hasn't\n// been placed yet.\n//\n// - `placed` is a fragment of placed content. Its open-start value\n// is implicit in `$from`, and its open-end value in `frontier`.\nclass Fitter {\n constructor($from, $to, unplaced) {\n this.$from = $from;\n this.$to = $to;\n this.unplaced = unplaced;\n this.frontier = [];\n this.placed = Fragment.empty;\n for (let i = 0; i <= $from.depth; i++) {\n let node = $from.node(i);\n this.frontier.push({\n type: node.type,\n match: node.contentMatchAt($from.indexAfter(i))\n });\n }\n for (let i = $from.depth; i > 0; i--)\n this.placed = Fragment.from($from.node(i).copy(this.placed));\n }\n get depth() { return this.frontier.length - 1; }\n fit() {\n // As long as there's unplaced content, try to place some of it.\n // If that fails, either increase the open score of the unplaced\n // slice, or drop nodes from it, and then try again.\n while (this.unplaced.size) {\n let fit = this.findFittable();\n if (fit)\n this.placeNodes(fit);\n else\n this.openMore() || this.dropNode();\n }\n // When there's inline content directly after the frontier _and_\n // directly after `this.$to`, we must generate a `ReplaceAround`\n // step that pulls that content into the node after the frontier.\n // That means the fitting must be done to the end of the textblock\n // node after `this.$to`, not `this.$to` itself.\n let moveInline = this.mustMoveInline(), placedSize = this.placed.size - this.depth - this.$from.depth;\n let $from = this.$from, $to = this.close(moveInline < 0 ? this.$to : $from.doc.resolve(moveInline));\n if (!$to)\n return null;\n // If closing to `$to` succeeded, create a step\n let content = this.placed, openStart = $from.depth, openEnd = $to.depth;\n while (openStart && openEnd && content.childCount == 1) { // Normalize by dropping open parent nodes\n content = content.firstChild.content;\n openStart--;\n openEnd--;\n }\n let slice = new Slice(content, openStart, openEnd);\n if (moveInline > -1)\n return new ReplaceAroundStep($from.pos, moveInline, this.$to.pos, this.$to.end(), slice, placedSize);\n if (slice.size || $from.pos != this.$to.pos) // Don't generate no-op steps\n return new ReplaceStep($from.pos, $to.pos, slice);\n return null;\n }\n // Find a position on the start spine of `this.unplaced` that has\n // content that can be moved somewhere on the frontier. Returns two\n // depths, one for the slice and one for the frontier.\n findFittable() {\n let startDepth = this.unplaced.openStart;\n for (let cur = this.unplaced.content, d = 0, openEnd = this.unplaced.openEnd; d < startDepth; d++) {\n let node = cur.firstChild;\n if (cur.childCount > 1)\n openEnd = 0;\n if (node.type.spec.isolating && openEnd <= d) {\n startDepth = d;\n break;\n }\n cur = node.content;\n }\n // Only try wrapping nodes (pass 2) after finding a place without\n // wrapping failed.\n for (let pass = 1; pass <= 2; pass++) {\n for (let sliceDepth = pass == 1 ? startDepth : this.unplaced.openStart; sliceDepth >= 0; sliceDepth--) {\n let fragment, parent = null;\n if (sliceDepth) {\n parent = contentAt(this.unplaced.content, sliceDepth - 1).firstChild;\n fragment = parent.content;\n }\n else {\n fragment = this.unplaced.content;\n }\n let first = fragment.firstChild;\n for (let frontierDepth = this.depth; frontierDepth >= 0; frontierDepth--) {\n let { type, match } = this.frontier[frontierDepth], wrap, inject = null;\n // In pass 1, if the next node matches, or there is no next\n // node but the parents look compatible, we've found a\n // place.\n if (pass == 1 && (first ? match.matchType(first.type) || (inject = match.fillBefore(Fragment.from(first), false))\n : parent && type.compatibleContent(parent.type)))\n return { sliceDepth, frontierDepth, parent, inject };\n // In pass 2, look for a set of wrapping nodes that make\n // `first` fit here.\n else if (pass == 2 && first && (wrap = match.findWrapping(first.type)))\n return { sliceDepth, frontierDepth, parent, wrap };\n // Don't continue looking further up if the parent node\n // would fit here.\n if (parent && match.matchType(parent.type))\n break;\n }\n }\n }\n }\n openMore() {\n let { content, openStart, openEnd } = this.unplaced;\n let inner = contentAt(content, openStart);\n if (!inner.childCount || inner.firstChild.isLeaf)\n return false;\n this.unplaced = new Slice(content, openStart + 1, Math.max(openEnd, inner.size + openStart >= content.size - openEnd ? openStart + 1 : 0));\n return true;\n }\n dropNode() {\n let { content, openStart, openEnd } = this.unplaced;\n let inner = contentAt(content, openStart);\n if (inner.childCount <= 1 && openStart > 0) {\n let openAtEnd = content.size - openStart <= openStart + inner.size;\n this.unplaced = new Slice(dropFromFragment(content, openStart - 1, 1), openStart - 1, openAtEnd ? openStart - 1 : openEnd);\n }\n else {\n this.unplaced = new Slice(dropFromFragment(content, openStart, 1), openStart, openEnd);\n }\n }\n // Move content from the unplaced slice at `sliceDepth` to the\n // frontier node at `frontierDepth`. Close that frontier node when\n // applicable.\n placeNodes({ sliceDepth, frontierDepth, parent, inject, wrap }) {\n while (this.depth > frontierDepth)\n this.closeFrontierNode();\n if (wrap)\n for (let i = 0; i < wrap.length; i++)\n this.openFrontierNode(wrap[i]);\n let slice = this.unplaced, fragment = parent ? parent.content : slice.content;\n let openStart = slice.openStart - sliceDepth;\n let taken = 0, add = [];\n let { match, type } = this.frontier[frontierDepth];\n if (inject) {\n for (let i = 0; i < inject.childCount; i++)\n add.push(inject.child(i));\n match = match.matchFragment(inject);\n }\n // Computes the amount of (end) open nodes at the end of the\n // fragment. When 0, the parent is open, but no more. When\n // negative, nothing is open.\n let openEndCount = (fragment.size + sliceDepth) - (slice.content.size - slice.openEnd);\n // Scan over the fragment, fitting as many child nodes as\n // possible.\n while (taken < fragment.childCount) {\n let next = fragment.child(taken), matches = match.matchType(next.type);\n if (!matches)\n break;\n taken++;\n if (taken > 1 || openStart == 0 || next.content.size) { // Drop empty open nodes\n match = matches;\n add.push(closeNodeStart(next.mark(type.allowedMarks(next.marks)), taken == 1 ? openStart : 0, taken == fragment.childCount ? openEndCount : -1));\n }\n }\n let toEnd = taken == fragment.childCount;\n if (!toEnd)\n openEndCount = -1;\n this.placed = addToFragment(this.placed, frontierDepth, Fragment.from(add));\n this.frontier[frontierDepth].match = match;\n // If the parent types match, and the entire node was moved, and\n // it's not open, close this frontier node right away.\n if (toEnd && openEndCount < 0 && parent && parent.type == this.frontier[this.depth].type && this.frontier.length > 1)\n this.closeFrontierNode();\n // Add new frontier nodes for any open nodes at the end.\n for (let i = 0, cur = fragment; i < openEndCount; i++) {\n let node = cur.lastChild;\n this.frontier.push({ type: node.type, match: node.contentMatchAt(node.childCount) });\n cur = node.content;\n }\n // Update `this.unplaced`. Drop the entire node from which we\n // placed it we got to its end, otherwise just drop the placed\n // nodes.\n this.unplaced = !toEnd ? new Slice(dropFromFragment(slice.content, sliceDepth, taken), slice.openStart, slice.openEnd)\n : sliceDepth == 0 ? Slice.empty\n : new Slice(dropFromFragment(slice.content, sliceDepth - 1, 1), sliceDepth - 1, openEndCount < 0 ? slice.openEnd : sliceDepth - 1);\n }\n mustMoveInline() {\n if (!this.$to.parent.isTextblock)\n return -1;\n let top = this.frontier[this.depth], level;\n if (!top.type.isTextblock || !contentAfterFits(this.$to, this.$to.depth, top.type, top.match, false) ||\n (this.$to.depth == this.depth && (level = this.findCloseLevel(this.$to)) && level.depth == this.depth))\n return -1;\n let { depth } = this.$to, after = this.$to.after(depth);\n while (depth > 1 && after == this.$to.end(--depth))\n ++after;\n return after;\n }\n findCloseLevel($to) {\n scan: for (let i = Math.min(this.depth, $to.depth); i >= 0; i--) {\n let { match, type } = this.frontier[i];\n let dropInner = i < $to.depth && $to.end(i + 1) == $to.pos + ($to.depth - (i + 1));\n let fit = contentAfterFits($to, i, type, match, dropInner);\n if (!fit)\n continue;\n for (let d = i - 1; d >= 0; d--) {\n let { match, type } = this.frontier[d];\n let matches = contentAfterFits($to, d, type, match, true);\n if (!matches || matches.childCount)\n continue scan;\n }\n return { depth: i, fit, move: dropInner ? $to.doc.resolve($to.after(i + 1)) : $to };\n }\n }\n close($to) {\n let close = this.findCloseLevel($to);\n if (!close)\n return null;\n while (this.depth > close.depth)\n this.closeFrontierNode();\n if (close.fit.childCount)\n this.placed = addToFragment(this.placed, close.depth, close.fit);\n $to = close.move;\n for (let d = close.depth + 1; d <= $to.depth; d++) {\n let node = $to.node(d), add = node.type.contentMatch.fillBefore(node.content, true, $to.index(d));\n this.openFrontierNode(node.type, node.attrs, add);\n }\n return $to;\n }\n openFrontierNode(type, attrs = null, content) {\n let top = this.frontier[this.depth];\n top.match = top.match.matchType(type);\n this.placed = addToFragment(this.placed, this.depth, Fragment.from(type.create(attrs, content)));\n this.frontier.push({ type, match: type.contentMatch });\n }\n closeFrontierNode() {\n let open = this.frontier.pop();\n let add = open.match.fillBefore(Fragment.empty, true);\n if (add.childCount)\n this.placed = addToFragment(this.placed, this.frontier.length, add);\n }\n}\nfunction dropFromFragment(fragment, depth, count) {\n if (depth == 0)\n return fragment.cutByIndex(count, fragment.childCount);\n return fragment.replaceChild(0, fragment.firstChild.copy(dropFromFragment(fragment.firstChild.content, depth - 1, count)));\n}\nfunction addToFragment(fragment, depth, content) {\n if (depth == 0)\n return fragment.append(content);\n return fragment.replaceChild(fragment.childCount - 1, fragment.lastChild.copy(addToFragment(fragment.lastChild.content, depth - 1, content)));\n}\nfunction contentAt(fragment, depth) {\n for (let i = 0; i < depth; i++)\n fragment = fragment.firstChild.content;\n return fragment;\n}\nfunction closeNodeStart(node, openStart, openEnd) {\n if (openStart <= 0)\n return node;\n let frag = node.content;\n if (openStart > 1)\n frag = frag.replaceChild(0, closeNodeStart(frag.firstChild, openStart - 1, frag.childCount == 1 ? openEnd - 1 : 0));\n if (openStart > 0) {\n frag = node.type.contentMatch.fillBefore(frag).append(frag);\n if (openEnd <= 0)\n frag = frag.append(node.type.contentMatch.matchFragment(frag).fillBefore(Fragment.empty, true));\n }\n return node.copy(frag);\n}\nfunction contentAfterFits($to, depth, type, match, open) {\n let node = $to.node(depth), index = open ? $to.indexAfter(depth) : $to.index(depth);\n if (index == node.childCount && !type.compatibleContent(node.type))\n return null;\n let fit = match.fillBefore(node.content, true, index);\n return fit && !invalidMarks(type, node.content, index) ? fit : null;\n}\nfunction invalidMarks(type, fragment, start) {\n for (let i = start; i < fragment.childCount; i++)\n if (!type.allowsMarks(fragment.child(i).marks))\n return true;\n return false;\n}\nfunction definesContent(type) {\n return type.spec.defining || type.spec.definingForContent;\n}\nfunction replaceRange(tr, from, to, slice) {\n if (!slice.size)\n return tr.deleteRange(from, to);\n let $from = tr.doc.resolve(from), $to = tr.doc.resolve(to);\n if (fitsTrivially($from, $to, slice))\n return tr.step(new ReplaceStep(from, to, slice));\n let targetDepths = coveredDepths($from, tr.doc.resolve(to));\n // Can't replace the whole document, so remove 0 if it's present\n if (targetDepths[targetDepths.length - 1] == 0)\n targetDepths.pop();\n // Negative numbers represent not expansion over the whole node at\n // that depth, but replacing from $from.before(-D) to $to.pos.\n let preferredTarget = -($from.depth + 1);\n targetDepths.unshift(preferredTarget);\n // This loop picks a preferred target depth, if one of the covering\n // depths is not outside of a defining node, and adds negative\n // depths for any depth that has $from at its start and does not\n // cross a defining node.\n for (let d = $from.depth, pos = $from.pos - 1; d > 0; d--, pos--) {\n let spec = $from.node(d).type.spec;\n if (spec.defining || spec.definingAsContext || spec.isolating)\n break;\n if (targetDepths.indexOf(d) > -1)\n preferredTarget = d;\n else if ($from.before(d) == pos)\n targetDepths.splice(1, 0, -d);\n }\n // Try to fit each possible depth of the slice into each possible\n // target depth, starting with the preferred depths.\n let preferredTargetIndex = targetDepths.indexOf(preferredTarget);\n let leftNodes = [], preferredDepth = slice.openStart;\n for (let content = slice.content, i = 0;; i++) {\n let node = content.firstChild;\n leftNodes.push(node);\n if (i == slice.openStart)\n break;\n content = node.content;\n }\n // Back up preferredDepth to cover defining textblocks directly\n // above it, possibly skipping a non-defining textblock.\n for (let d = preferredDepth - 1; d >= 0; d--) {\n let leftNode = leftNodes[d], def = definesContent(leftNode.type);\n if (def && !leftNode.sameMarkup($from.node(Math.abs(preferredTarget) - 1)))\n preferredDepth = d;\n else if (def || !leftNode.type.isTextblock)\n break;\n }\n for (let j = slice.openStart; j >= 0; j--) {\n let openDepth = (j + preferredDepth + 1) % (slice.openStart + 1);\n let insert = leftNodes[openDepth];\n if (!insert)\n continue;\n for (let i = 0; i < targetDepths.length; i++) {\n // Loop over possible expansion levels, starting with the\n // preferred one\n let targetDepth = targetDepths[(i + preferredTargetIndex) % targetDepths.length], expand = true;\n if (targetDepth < 0) {\n expand = false;\n targetDepth = -targetDepth;\n }\n let parent = $from.node(targetDepth - 1), index = $from.index(targetDepth - 1);\n if (parent.canReplaceWith(index, index, insert.type, insert.marks))\n return tr.replace($from.before(targetDepth), expand ? $to.after(targetDepth) : to, new Slice(closeFragment(slice.content, 0, slice.openStart, openDepth), openDepth, slice.openEnd));\n }\n }\n let startSteps = tr.steps.length;\n for (let i = targetDepths.length - 1; i >= 0; i--) {\n tr.replace(from, to, slice);\n if (tr.steps.length > startSteps)\n break;\n let depth = targetDepths[i];\n if (depth < 0)\n continue;\n from = $from.before(depth);\n to = $to.after(depth);\n }\n}\nfunction closeFragment(fragment, depth, oldOpen, newOpen, parent) {\n if (depth < oldOpen) {\n let first = fragment.firstChild;\n fragment = fragment.replaceChild(0, first.copy(closeFragment(first.content, depth + 1, oldOpen, newOpen, first)));\n }\n if (depth > newOpen) {\n let match = parent.contentMatchAt(0);\n let start = match.fillBefore(fragment).append(fragment);\n fragment = start.append(match.matchFragment(start).fillBefore(Fragment.empty, true));\n }\n return fragment;\n}\nfunction replaceRangeWith(tr, from, to, node) {\n if (!node.isInline && from == to && tr.doc.resolve(from).parent.content.size) {\n let point = insertPoint(tr.doc, from, node.type);\n if (point != null)\n from = to = point;\n }\n tr.replaceRange(from, to, new Slice(Fragment.from(node), 0, 0));\n}\nfunction deleteRange(tr, from, to) {\n let $from = tr.doc.resolve(from), $to = tr.doc.resolve(to);\n let covered = coveredDepths($from, $to);\n for (let i = 0; i < covered.length; i++) {\n let depth = covered[i], last = i == covered.length - 1;\n if ((last && depth == 0) || $from.node(depth).type.contentMatch.validEnd)\n return tr.delete($from.start(depth), $to.end(depth));\n if (depth > 0 && (last || $from.node(depth - 1).canReplace($from.index(depth - 1), $to.indexAfter(depth - 1))))\n return tr.delete($from.before(depth), $to.after(depth));\n }\n for (let d = 1; d <= $from.depth && d <= $to.depth; d++) {\n if (from - $from.start(d) == $from.depth - d && to > $from.end(d) && $to.end(d) - to != $to.depth - d)\n return tr.delete($from.before(d), to);\n }\n tr.delete(from, to);\n}\n// Returns an array of all depths for which $from - $to spans the\n// whole content of the nodes at that depth.\nfunction coveredDepths($from, $to) {\n let result = [], minDepth = Math.min($from.depth, $to.depth);\n for (let d = minDepth; d >= 0; d--) {\n let start = $from.start(d);\n if (start < $from.pos - ($from.depth - d) ||\n $to.end(d) > $to.pos + ($to.depth - d) ||\n $from.node(d).type.spec.isolating ||\n $to.node(d).type.spec.isolating)\n break;\n if (start == $to.start(d) ||\n (d == $from.depth && d == $to.depth && $from.parent.inlineContent && $to.parent.inlineContent &&\n d && $to.start(d - 1) == start - 1))\n result.push(d);\n }\n return result;\n}\n\n/**\nUpdate an attribute in a specific node.\n*/\nclass AttrStep extends Step {\n /**\n Construct an attribute step.\n */\n constructor(\n /**\n The position of the target node.\n */\n pos, \n /**\n The attribute to set.\n */\n attr, \n // The attribute's new value.\n value) {\n super();\n this.pos = pos;\n this.attr = attr;\n this.value = value;\n }\n apply(doc) {\n let node = doc.nodeAt(this.pos);\n if (!node)\n return StepResult.fail(\"No node at attribute step's position\");\n let attrs = Object.create(null);\n for (let name in node.attrs)\n attrs[name] = node.attrs[name];\n attrs[this.attr] = this.value;\n let updated = node.type.create(attrs, null, node.marks);\n return StepResult.fromReplace(doc, this.pos, this.pos + 1, new Slice(Fragment.from(updated), 0, node.isLeaf ? 0 : 1));\n }\n getMap() {\n return StepMap.empty;\n }\n invert(doc) {\n return new AttrStep(this.pos, this.attr, doc.nodeAt(this.pos).attrs[this.attr]);\n }\n map(mapping) {\n let pos = mapping.mapResult(this.pos, 1);\n return pos.deletedAfter ? null : new AttrStep(pos.pos, this.attr, this.value);\n }\n toJSON() {\n return { stepType: \"attr\", pos: this.pos, attr: this.attr, value: this.value };\n }\n static fromJSON(schema, json) {\n if (typeof json.pos != \"number\" || typeof json.attr != \"string\")\n throw new RangeError(\"Invalid input for AttrStep.fromJSON\");\n return new AttrStep(json.pos, json.attr, json.value);\n }\n}\nStep.jsonID(\"attr\", AttrStep);\n/**\nUpdate an attribute in the doc node.\n*/\nclass DocAttrStep extends Step {\n /**\n Construct an attribute step.\n */\n constructor(\n /**\n The attribute to set.\n */\n attr, \n // The attribute's new value.\n value) {\n super();\n this.attr = attr;\n this.value = value;\n }\n apply(doc) {\n let attrs = Object.create(null);\n for (let name in doc.attrs)\n attrs[name] = doc.attrs[name];\n attrs[this.attr] = this.value;\n let updated = doc.type.create(attrs, doc.content, doc.marks);\n return StepResult.ok(updated);\n }\n getMap() {\n return StepMap.empty;\n }\n invert(doc) {\n return new DocAttrStep(this.attr, doc.attrs[this.attr]);\n }\n map(mapping) {\n return this;\n }\n toJSON() {\n return { stepType: \"docAttr\", attr: this.attr, value: this.value };\n }\n static fromJSON(schema, json) {\n if (typeof json.attr != \"string\")\n throw new RangeError(\"Invalid input for DocAttrStep.fromJSON\");\n return new DocAttrStep(json.attr, json.value);\n }\n}\nStep.jsonID(\"docAttr\", DocAttrStep);\n\n/**\n@internal\n*/\nlet TransformError = class extends Error {\n};\nTransformError = function TransformError(message) {\n let err = Error.call(this, message);\n err.__proto__ = TransformError.prototype;\n return err;\n};\nTransformError.prototype = Object.create(Error.prototype);\nTransformError.prototype.constructor = TransformError;\nTransformError.prototype.name = \"TransformError\";\n/**\nAbstraction to build up and track an array of\n[steps](https://prosemirror.net/docs/ref/#transform.Step) representing a document transformation.\n\nMost transforming methods return the `Transform` object itself, so\nthat they can be chained.\n*/\nclass Transform {\n /**\n Create a transform that starts with the given document.\n */\n constructor(\n /**\n The current document (the result of applying the steps in the\n transform).\n */\n doc) {\n this.doc = doc;\n /**\n The steps in this transform.\n */\n this.steps = [];\n /**\n The documents before each of the steps.\n */\n this.docs = [];\n /**\n A mapping with the maps for each of the steps in this transform.\n */\n this.mapping = new Mapping;\n }\n /**\n The starting document.\n */\n get before() { return this.docs.length ? this.docs[0] : this.doc; }\n /**\n Apply a new step in this transform, saving the result. Throws an\n error when the step fails.\n */\n step(step) {\n let result = this.maybeStep(step);\n if (result.failed)\n throw new TransformError(result.failed);\n return this;\n }\n /**\n Try to apply a step in this transformation, ignoring it if it\n fails. Returns the step result.\n */\n maybeStep(step) {\n let result = step.apply(this.doc);\n if (!result.failed)\n this.addStep(step, result.doc);\n return result;\n }\n /**\n True when the document has been changed (when there are any\n steps).\n */\n get docChanged() {\n return this.steps.length > 0;\n }\n /**\n @internal\n */\n addStep(step, doc) {\n this.docs.push(this.doc);\n this.steps.push(step);\n this.mapping.appendMap(step.getMap());\n this.doc = doc;\n }\n /**\n Replace the part of the document between `from` and `to` with the\n given `slice`.\n */\n replace(from, to = from, slice = Slice.empty) {\n let step = replaceStep(this.doc, from, to, slice);\n if (step)\n this.step(step);\n return this;\n }\n /**\n Replace the given range with the given content, which may be a\n fragment, node, or array of nodes.\n */\n replaceWith(from, to, content) {\n return this.replace(from, to, new Slice(Fragment.from(content), 0, 0));\n }\n /**\n Delete the content between the given positions.\n */\n delete(from, to) {\n return this.replace(from, to, Slice.empty);\n }\n /**\n Insert the given content at the given position.\n */\n insert(pos, content) {\n return this.replaceWith(pos, pos, content);\n }\n /**\n Replace a range of the document with a given slice, using\n `from`, `to`, and the slice's\n [`openStart`](https://prosemirror.net/docs/ref/#model.Slice.openStart) property as hints, rather\n than fixed start and end points. This method may grow the\n replaced area or close open nodes in the slice in order to get a\n fit that is more in line with WYSIWYG expectations, by dropping\n fully covered parent nodes of the replaced region when they are\n marked [non-defining as\n context](https://prosemirror.net/docs/ref/#model.NodeSpec.definingAsContext), or including an\n open parent node from the slice that _is_ marked as [defining\n its content](https://prosemirror.net/docs/ref/#model.NodeSpec.definingForContent).\n \n This is the method, for example, to handle paste. The similar\n [`replace`](https://prosemirror.net/docs/ref/#transform.Transform.replace) method is a more\n primitive tool which will _not_ move the start and end of its given\n range, and is useful in situations where you need more precise\n control over what happens.\n */\n replaceRange(from, to, slice) {\n replaceRange(this, from, to, slice);\n return this;\n }\n /**\n Replace the given range with a node, but use `from` and `to` as\n hints, rather than precise positions. When from and to are the same\n and are at the start or end of a parent node in which the given\n node doesn't fit, this method may _move_ them out towards a parent\n that does allow the given node to be placed. When the given range\n completely covers a parent node, this method may completely replace\n that parent node.\n */\n replaceRangeWith(from, to, node) {\n replaceRangeWith(this, from, to, node);\n return this;\n }\n /**\n Delete the given range, expanding it to cover fully covered\n parent nodes until a valid replace is found.\n */\n deleteRange(from, to) {\n deleteRange(this, from, to);\n return this;\n }\n /**\n Split the content in the given range off from its parent, if there\n is sibling content before or after it, and move it up the tree to\n the depth specified by `target`. You'll probably want to use\n [`liftTarget`](https://prosemirror.net/docs/ref/#transform.liftTarget) to compute `target`, to make\n sure the lift is valid.\n */\n lift(range, target) {\n lift(this, range, target);\n return this;\n }\n /**\n Join the blocks around the given position. If depth is 2, their\n last and first siblings are also joined, and so on.\n */\n join(pos, depth = 1) {\n join(this, pos, depth);\n return this;\n }\n /**\n Wrap the given [range](https://prosemirror.net/docs/ref/#model.NodeRange) in the given set of wrappers.\n The wrappers are assumed to be valid in this position, and should\n probably be computed with [`findWrapping`](https://prosemirror.net/docs/ref/#transform.findWrapping).\n */\n wrap(range, wrappers) {\n wrap(this, range, wrappers);\n return this;\n }\n /**\n Set the type of all textblocks (partly) between `from` and `to` to\n the given node type with the given attributes.\n */\n setBlockType(from, to = from, type, attrs = null) {\n setBlockType(this, from, to, type, attrs);\n return this;\n }\n /**\n Change the type, attributes, and/or marks of the node at `pos`.\n When `type` isn't given, the existing node type is preserved,\n */\n setNodeMarkup(pos, type, attrs = null, marks) {\n setNodeMarkup(this, pos, type, attrs, marks);\n return this;\n }\n /**\n Set a single attribute on a given node to a new value.\n The `pos` addresses the document content. Use `setDocAttribute`\n to set attributes on the document itself.\n */\n setNodeAttribute(pos, attr, value) {\n this.step(new AttrStep(pos, attr, value));\n return this;\n }\n /**\n Set a single attribute on the document to a new value.\n */\n setDocAttribute(attr, value) {\n this.step(new DocAttrStep(attr, value));\n return this;\n }\n /**\n Add a mark to the node at position `pos`.\n */\n addNodeMark(pos, mark) {\n this.step(new AddNodeMarkStep(pos, mark));\n return this;\n }\n /**\n Remove a mark (or a mark of the given type) from the node at\n position `pos`.\n */\n removeNodeMark(pos, mark) {\n if (!(mark instanceof Mark)) {\n let node = this.doc.nodeAt(pos);\n if (!node)\n throw new RangeError(\"No node at position \" + pos);\n mark = mark.isInSet(node.marks);\n if (!mark)\n return this;\n }\n this.step(new RemoveNodeMarkStep(pos, mark));\n return this;\n }\n /**\n Split the node at the given position, and optionally, if `depth` is\n greater than one, any number of nodes above that. By default, the\n parts split off will inherit the node type of the original node.\n This can be changed by passing an array of types and attributes to\n use after the split.\n */\n split(pos, depth = 1, typesAfter) {\n split(this, pos, depth, typesAfter);\n return this;\n }\n /**\n Add the given mark to the inline content between `from` and `to`.\n */\n addMark(from, to, mark) {\n addMark(this, from, to, mark);\n return this;\n }\n /**\n Remove marks from inline nodes between `from` and `to`. When\n `mark` is a single mark, remove precisely that mark. When it is\n a mark type, remove all marks of that type. When it is null,\n remove all marks of any type.\n */\n removeMark(from, to, mark) {\n removeMark(this, from, to, mark);\n return this;\n }\n /**\n Removes all marks and nodes from the content of the node at\n `pos` that don't match the given new parent node type. Accepts\n an optional starting [content match](https://prosemirror.net/docs/ref/#model.ContentMatch) as\n third argument.\n */\n clearIncompatible(pos, parentType, match) {\n clearIncompatible(this, pos, parentType, match);\n return this;\n }\n}\n\nexport { AddMarkStep, AddNodeMarkStep, AttrStep, DocAttrStep, MapResult, Mapping, RemoveMarkStep, RemoveNodeMarkStep, ReplaceAroundStep, ReplaceStep, Step, StepMap, StepResult, Transform, TransformError, canJoin, canSplit, dropPoint, findWrapping, insertPoint, joinPoint, liftTarget, replaceStep };\n","import { Slice, Fragment, Mark, Node } from 'prosemirror-model';\nimport { ReplaceStep, ReplaceAroundStep, Transform } from 'prosemirror-transform';\n\nconst classesById = Object.create(null);\n/**\nSuperclass for editor selections. Every selection type should\nextend this. Should not be instantiated directly.\n*/\nclass Selection {\n /**\n Initialize a selection with the head and anchor and ranges. If no\n ranges are given, constructs a single range across `$anchor` and\n `$head`.\n */\n constructor(\n /**\n The resolved anchor of the selection (the side that stays in\n place when the selection is modified).\n */\n $anchor, \n /**\n The resolved head of the selection (the side that moves when\n the selection is modified).\n */\n $head, ranges) {\n this.$anchor = $anchor;\n this.$head = $head;\n this.ranges = ranges || [new SelectionRange($anchor.min($head), $anchor.max($head))];\n }\n /**\n The selection's anchor, as an unresolved position.\n */\n get anchor() { return this.$anchor.pos; }\n /**\n The selection's head.\n */\n get head() { return this.$head.pos; }\n /**\n The lower bound of the selection's main range.\n */\n get from() { return this.$from.pos; }\n /**\n The upper bound of the selection's main range.\n */\n get to() { return this.$to.pos; }\n /**\n The resolved lower bound of the selection's main range.\n */\n get $from() {\n return this.ranges[0].$from;\n }\n /**\n The resolved upper bound of the selection's main range.\n */\n get $to() {\n return this.ranges[0].$to;\n }\n /**\n Indicates whether the selection contains any content.\n */\n get empty() {\n let ranges = this.ranges;\n for (let i = 0; i < ranges.length; i++)\n if (ranges[i].$from.pos != ranges[i].$to.pos)\n return false;\n return true;\n }\n /**\n Get the content of this selection as a slice.\n */\n content() {\n return this.$from.doc.slice(this.from, this.to, true);\n }\n /**\n Replace the selection with a slice or, if no slice is given,\n delete the selection. Will append to the given transaction.\n */\n replace(tr, content = Slice.empty) {\n // Put the new selection at the position after the inserted\n // content. When that ended in an inline node, search backwards,\n // to get the position after that node. If not, search forward.\n let lastNode = content.content.lastChild, lastParent = null;\n for (let i = 0; i < content.openEnd; i++) {\n lastParent = lastNode;\n lastNode = lastNode.lastChild;\n }\n let mapFrom = tr.steps.length, ranges = this.ranges;\n for (let i = 0; i < ranges.length; i++) {\n let { $from, $to } = ranges[i], mapping = tr.mapping.slice(mapFrom);\n tr.replaceRange(mapping.map($from.pos), mapping.map($to.pos), i ? Slice.empty : content);\n if (i == 0)\n selectionToInsertionEnd(tr, mapFrom, (lastNode ? lastNode.isInline : lastParent && lastParent.isTextblock) ? -1 : 1);\n }\n }\n /**\n Replace the selection with the given node, appending the changes\n to the given transaction.\n */\n replaceWith(tr, node) {\n let mapFrom = tr.steps.length, ranges = this.ranges;\n for (let i = 0; i < ranges.length; i++) {\n let { $from, $to } = ranges[i], mapping = tr.mapping.slice(mapFrom);\n let from = mapping.map($from.pos), to = mapping.map($to.pos);\n if (i) {\n tr.deleteRange(from, to);\n }\n else {\n tr.replaceRangeWith(from, to, node);\n selectionToInsertionEnd(tr, mapFrom, node.isInline ? -1 : 1);\n }\n }\n }\n /**\n Find a valid cursor or leaf node selection starting at the given\n position and searching back if `dir` is negative, and forward if\n positive. When `textOnly` is true, only consider cursor\n selections. Will return null when no valid selection position is\n found.\n */\n static findFrom($pos, dir, textOnly = false) {\n let inner = $pos.parent.inlineContent ? new TextSelection($pos)\n : findSelectionIn($pos.node(0), $pos.parent, $pos.pos, $pos.index(), dir, textOnly);\n if (inner)\n return inner;\n for (let depth = $pos.depth - 1; depth >= 0; depth--) {\n let found = dir < 0\n ? findSelectionIn($pos.node(0), $pos.node(depth), $pos.before(depth + 1), $pos.index(depth), dir, textOnly)\n : findSelectionIn($pos.node(0), $pos.node(depth), $pos.after(depth + 1), $pos.index(depth) + 1, dir, textOnly);\n if (found)\n return found;\n }\n return null;\n }\n /**\n Find a valid cursor or leaf node selection near the given\n position. Searches forward first by default, but if `bias` is\n negative, it will search backwards first.\n */\n static near($pos, bias = 1) {\n return this.findFrom($pos, bias) || this.findFrom($pos, -bias) || new AllSelection($pos.node(0));\n }\n /**\n Find the cursor or leaf node selection closest to the start of\n the given document. Will return an\n [`AllSelection`](https://prosemirror.net/docs/ref/#state.AllSelection) if no valid position\n exists.\n */\n static atStart(doc) {\n return findSelectionIn(doc, doc, 0, 0, 1) || new AllSelection(doc);\n }\n /**\n Find the cursor or leaf node selection closest to the end of the\n given document.\n */\n static atEnd(doc) {\n return findSelectionIn(doc, doc, doc.content.size, doc.childCount, -1) || new AllSelection(doc);\n }\n /**\n Deserialize the JSON representation of a selection. Must be\n implemented for custom classes (as a static class method).\n */\n static fromJSON(doc, json) {\n if (!json || !json.type)\n throw new RangeError(\"Invalid input for Selection.fromJSON\");\n let cls = classesById[json.type];\n if (!cls)\n throw new RangeError(`No selection type ${json.type} defined`);\n return cls.fromJSON(doc, json);\n }\n /**\n To be able to deserialize selections from JSON, custom selection\n classes must register themselves with an ID string, so that they\n can be disambiguated. Try to pick something that's unlikely to\n clash with classes from other modules.\n */\n static jsonID(id, selectionClass) {\n if (id in classesById)\n throw new RangeError(\"Duplicate use of selection JSON ID \" + id);\n classesById[id] = selectionClass;\n selectionClass.prototype.jsonID = id;\n return selectionClass;\n }\n /**\n Get a [bookmark](https://prosemirror.net/docs/ref/#state.SelectionBookmark) for this selection,\n which is a value that can be mapped without having access to a\n current document, and later resolved to a real selection for a\n given document again. (This is used mostly by the history to\n track and restore old selections.) The default implementation of\n this method just converts the selection to a text selection and\n returns the bookmark for that.\n */\n getBookmark() {\n return TextSelection.between(this.$anchor, this.$head).getBookmark();\n }\n}\nSelection.prototype.visible = true;\n/**\nRepresents a selected range in a document.\n*/\nclass SelectionRange {\n /**\n Create a range.\n */\n constructor(\n /**\n The lower bound of the range.\n */\n $from, \n /**\n The upper bound of the range.\n */\n $to) {\n this.$from = $from;\n this.$to = $to;\n }\n}\nlet warnedAboutTextSelection = false;\nfunction checkTextSelection($pos) {\n if (!warnedAboutTextSelection && !$pos.parent.inlineContent) {\n warnedAboutTextSelection = true;\n console[\"warn\"](\"TextSelection endpoint not pointing into a node with inline content (\" + $pos.parent.type.name + \")\");\n }\n}\n/**\nA text selection represents a classical editor selection, with a\nhead (the moving side) and anchor (immobile side), both of which\npoint into textblock nodes. It can be empty (a regular cursor\nposition).\n*/\nclass TextSelection extends Selection {\n /**\n Construct a text selection between the given points.\n */\n constructor($anchor, $head = $anchor) {\n checkTextSelection($anchor);\n checkTextSelection($head);\n super($anchor, $head);\n }\n /**\n Returns a resolved position if this is a cursor selection (an\n empty text selection), and null otherwise.\n */\n get $cursor() { return this.$anchor.pos == this.$head.pos ? this.$head : null; }\n map(doc, mapping) {\n let $head = doc.resolve(mapping.map(this.head));\n if (!$head.parent.inlineContent)\n return Selection.near($head);\n let $anchor = doc.resolve(mapping.map(this.anchor));\n return new TextSelection($anchor.parent.inlineContent ? $anchor : $head, $head);\n }\n replace(tr, content = Slice.empty) {\n super.replace(tr, content);\n if (content == Slice.empty) {\n let marks = this.$from.marksAcross(this.$to);\n if (marks)\n tr.ensureMarks(marks);\n }\n }\n eq(other) {\n return other instanceof TextSelection && other.anchor == this.anchor && other.head == this.head;\n }\n getBookmark() {\n return new TextBookmark(this.anchor, this.head);\n }\n toJSON() {\n return { type: \"text\", anchor: this.anchor, head: this.head };\n }\n /**\n @internal\n */\n static fromJSON(doc, json) {\n if (typeof json.anchor != \"number\" || typeof json.head != \"number\")\n throw new RangeError(\"Invalid input for TextSelection.fromJSON\");\n return new TextSelection(doc.resolve(json.anchor), doc.resolve(json.head));\n }\n /**\n Create a text selection from non-resolved positions.\n */\n static create(doc, anchor, head = anchor) {\n let $anchor = doc.resolve(anchor);\n return new this($anchor, head == anchor ? $anchor : doc.resolve(head));\n }\n /**\n Return a text selection that spans the given positions or, if\n they aren't text positions, find a text selection near them.\n `bias` determines whether the method searches forward (default)\n or backwards (negative number) first. Will fall back to calling\n [`Selection.near`](https://prosemirror.net/docs/ref/#state.Selection^near) when the document\n doesn't contain a valid text position.\n */\n static between($anchor, $head, bias) {\n let dPos = $anchor.pos - $head.pos;\n if (!bias || dPos)\n bias = dPos >= 0 ? 1 : -1;\n if (!$head.parent.inlineContent) {\n let found = Selection.findFrom($head, bias, true) || Selection.findFrom($head, -bias, true);\n if (found)\n $head = found.$head;\n else\n return Selection.near($head, bias);\n }\n if (!$anchor.parent.inlineContent) {\n if (dPos == 0) {\n $anchor = $head;\n }\n else {\n $anchor = (Selection.findFrom($anchor, -bias, true) || Selection.findFrom($anchor, bias, true)).$anchor;\n if (($anchor.pos < $head.pos) != (dPos < 0))\n $anchor = $head;\n }\n }\n return new TextSelection($anchor, $head);\n }\n}\nSelection.jsonID(\"text\", TextSelection);\nclass TextBookmark {\n constructor(anchor, head) {\n this.anchor = anchor;\n this.head = head;\n }\n map(mapping) {\n return new TextBookmark(mapping.map(this.anchor), mapping.map(this.head));\n }\n resolve(doc) {\n return TextSelection.between(doc.resolve(this.anchor), doc.resolve(this.head));\n }\n}\n/**\nA node selection is a selection that points at a single node. All\nnodes marked [selectable](https://prosemirror.net/docs/ref/#model.NodeSpec.selectable) can be the\ntarget of a node selection. In such a selection, `from` and `to`\npoint directly before and after the selected node, `anchor` equals\n`from`, and `head` equals `to`..\n*/\nclass NodeSelection extends Selection {\n /**\n Create a node selection. Does not verify the validity of its\n argument.\n */\n constructor($pos) {\n let node = $pos.nodeAfter;\n let $end = $pos.node(0).resolve($pos.pos + node.nodeSize);\n super($pos, $end);\n this.node = node;\n }\n map(doc, mapping) {\n let { deleted, pos } = mapping.mapResult(this.anchor);\n let $pos = doc.resolve(pos);\n if (deleted)\n return Selection.near($pos);\n return new NodeSelection($pos);\n }\n content() {\n return new Slice(Fragment.from(this.node), 0, 0);\n }\n eq(other) {\n return other instanceof NodeSelection && other.anchor == this.anchor;\n }\n toJSON() {\n return { type: \"node\", anchor: this.anchor };\n }\n getBookmark() { return new NodeBookmark(this.anchor); }\n /**\n @internal\n */\n static fromJSON(doc, json) {\n if (typeof json.anchor != \"number\")\n throw new RangeError(\"Invalid input for NodeSelection.fromJSON\");\n return new NodeSelection(doc.resolve(json.anchor));\n }\n /**\n Create a node selection from non-resolved positions.\n */\n static create(doc, from) {\n return new NodeSelection(doc.resolve(from));\n }\n /**\n Determines whether the given node may be selected as a node\n selection.\n */\n static isSelectable(node) {\n return !node.isText && node.type.spec.selectable !== false;\n }\n}\nNodeSelection.prototype.visible = false;\nSelection.jsonID(\"node\", NodeSelection);\nclass NodeBookmark {\n constructor(anchor) {\n this.anchor = anchor;\n }\n map(mapping) {\n let { deleted, pos } = mapping.mapResult(this.anchor);\n return deleted ? new TextBookmark(pos, pos) : new NodeBookmark(pos);\n }\n resolve(doc) {\n let $pos = doc.resolve(this.anchor), node = $pos.nodeAfter;\n if (node && NodeSelection.isSelectable(node))\n return new NodeSelection($pos);\n return Selection.near($pos);\n }\n}\n/**\nA selection type that represents selecting the whole document\n(which can not necessarily be expressed with a text selection, when\nthere are for example leaf block nodes at the start or end of the\ndocument).\n*/\nclass AllSelection extends Selection {\n /**\n Create an all-selection over the given document.\n */\n constructor(doc) {\n super(doc.resolve(0), doc.resolve(doc.content.size));\n }\n replace(tr, content = Slice.empty) {\n if (content == Slice.empty) {\n tr.delete(0, tr.doc.content.size);\n let sel = Selection.atStart(tr.doc);\n if (!sel.eq(tr.selection))\n tr.setSelection(sel);\n }\n else {\n super.replace(tr, content);\n }\n }\n toJSON() { return { type: \"all\" }; }\n /**\n @internal\n */\n static fromJSON(doc) { return new AllSelection(doc); }\n map(doc) { return new AllSelection(doc); }\n eq(other) { return other instanceof AllSelection; }\n getBookmark() { return AllBookmark; }\n}\nSelection.jsonID(\"all\", AllSelection);\nconst AllBookmark = {\n map() { return this; },\n resolve(doc) { return new AllSelection(doc); }\n};\n// FIXME we'll need some awareness of text direction when scanning for selections\n// Try to find a selection inside the given node. `pos` points at the\n// position where the search starts. When `text` is true, only return\n// text selections.\nfunction findSelectionIn(doc, node, pos, index, dir, text = false) {\n if (node.inlineContent)\n return TextSelection.create(doc, pos);\n for (let i = index - (dir > 0 ? 0 : 1); dir > 0 ? i < node.childCount : i >= 0; i += dir) {\n let child = node.child(i);\n if (!child.isAtom) {\n let inner = findSelectionIn(doc, child, pos + dir, dir < 0 ? child.childCount : 0, dir, text);\n if (inner)\n return inner;\n }\n else if (!text && NodeSelection.isSelectable(child)) {\n return NodeSelection.create(doc, pos - (dir < 0 ? child.nodeSize : 0));\n }\n pos += child.nodeSize * dir;\n }\n return null;\n}\nfunction selectionToInsertionEnd(tr, startLen, bias) {\n let last = tr.steps.length - 1;\n if (last < startLen)\n return;\n let step = tr.steps[last];\n if (!(step instanceof ReplaceStep || step instanceof ReplaceAroundStep))\n return;\n let map = tr.mapping.maps[last], end;\n map.forEach((_from, _to, _newFrom, newTo) => { if (end == null)\n end = newTo; });\n tr.setSelection(Selection.near(tr.doc.resolve(end), bias));\n}\n\nconst UPDATED_SEL = 1, UPDATED_MARKS = 2, UPDATED_SCROLL = 4;\n/**\nAn editor state transaction, which can be applied to a state to\ncreate an updated state. Use\n[`EditorState.tr`](https://prosemirror.net/docs/ref/#state.EditorState.tr) to create an instance.\n\nTransactions track changes to the document (they are a subclass of\n[`Transform`](https://prosemirror.net/docs/ref/#transform.Transform)), but also other state changes,\nlike selection updates and adjustments of the set of [stored\nmarks](https://prosemirror.net/docs/ref/#state.EditorState.storedMarks). In addition, you can store\nmetadata properties in a transaction, which are extra pieces of\ninformation that client code or plugins can use to describe what a\ntransaction represents, so that they can update their [own\nstate](https://prosemirror.net/docs/ref/#state.StateField) accordingly.\n\nThe [editor view](https://prosemirror.net/docs/ref/#view.EditorView) uses a few metadata\nproperties: it will attach a property `\"pointer\"` with the value\n`true` to selection transactions directly caused by mouse or touch\ninput, a `\"composition\"` property holding an ID identifying the\ncomposition that caused it to transactions caused by composed DOM\ninput, and a `\"uiEvent\"` property of that may be `\"paste\"`,\n`\"cut\"`, or `\"drop\"`.\n*/\nclass Transaction extends Transform {\n /**\n @internal\n */\n constructor(state) {\n super(state.doc);\n // The step count for which the current selection is valid.\n this.curSelectionFor = 0;\n // Bitfield to track which aspects of the state were updated by\n // this transaction.\n this.updated = 0;\n // Object used to store metadata properties for the transaction.\n this.meta = Object.create(null);\n this.time = Date.now();\n this.curSelection = state.selection;\n this.storedMarks = state.storedMarks;\n }\n /**\n The transaction's current selection. This defaults to the editor\n selection [mapped](https://prosemirror.net/docs/ref/#state.Selection.map) through the steps in the\n transaction, but can be overwritten with\n [`setSelection`](https://prosemirror.net/docs/ref/#state.Transaction.setSelection).\n */\n get selection() {\n if (this.curSelectionFor < this.steps.length) {\n this.curSelection = this.curSelection.map(this.doc, this.mapping.slice(this.curSelectionFor));\n this.curSelectionFor = this.steps.length;\n }\n return this.curSelection;\n }\n /**\n Update the transaction's current selection. Will determine the\n selection that the editor gets when the transaction is applied.\n */\n setSelection(selection) {\n if (selection.$from.doc != this.doc)\n throw new RangeError(\"Selection passed to setSelection must point at the current document\");\n this.curSelection = selection;\n this.curSelectionFor = this.steps.length;\n this.updated = (this.updated | UPDATED_SEL) & ~UPDATED_MARKS;\n this.storedMarks = null;\n return this;\n }\n /**\n Whether the selection was explicitly updated by this transaction.\n */\n get selectionSet() {\n return (this.updated & UPDATED_SEL) > 0;\n }\n /**\n Set the current stored marks.\n */\n setStoredMarks(marks) {\n this.storedMarks = marks;\n this.updated |= UPDATED_MARKS;\n return this;\n }\n /**\n Make sure the current stored marks or, if that is null, the marks\n at the selection, match the given set of marks. Does nothing if\n this is already the case.\n */\n ensureMarks(marks) {\n if (!Mark.sameSet(this.storedMarks || this.selection.$from.marks(), marks))\n this.setStoredMarks(marks);\n return this;\n }\n /**\n Add a mark to the set of stored marks.\n */\n addStoredMark(mark) {\n return this.ensureMarks(mark.addToSet(this.storedMarks || this.selection.$head.marks()));\n }\n /**\n Remove a mark or mark type from the set of stored marks.\n */\n removeStoredMark(mark) {\n return this.ensureMarks(mark.removeFromSet(this.storedMarks || this.selection.$head.marks()));\n }\n /**\n Whether the stored marks were explicitly set for this transaction.\n */\n get storedMarksSet() {\n return (this.updated & UPDATED_MARKS) > 0;\n }\n /**\n @internal\n */\n addStep(step, doc) {\n super.addStep(step, doc);\n this.updated = this.updated & ~UPDATED_MARKS;\n this.storedMarks = null;\n }\n /**\n Update the timestamp for the transaction.\n */\n setTime(time) {\n this.time = time;\n return this;\n }\n /**\n Replace the current selection with the given slice.\n */\n replaceSelection(slice) {\n this.selection.replace(this, slice);\n return this;\n }\n /**\n Replace the selection with the given node. When `inheritMarks` is\n true and the content is inline, it inherits the marks from the\n place where it is inserted.\n */\n replaceSelectionWith(node, inheritMarks = true) {\n let selection = this.selection;\n if (inheritMarks)\n node = node.mark(this.storedMarks || (selection.empty ? selection.$from.marks() : (selection.$from.marksAcross(selection.$to) || Mark.none)));\n selection.replaceWith(this, node);\n return this;\n }\n /**\n Delete the selection.\n */\n deleteSelection() {\n this.selection.replace(this);\n return this;\n }\n /**\n Replace the given range, or the selection if no range is given,\n with a text node containing the given string.\n */\n insertText(text, from, to) {\n let schema = this.doc.type.schema;\n if (from == null) {\n if (!text)\n return this.deleteSelection();\n return this.replaceSelectionWith(schema.text(text), true);\n }\n else {\n if (to == null)\n to = from;\n to = to == null ? from : to;\n if (!text)\n return this.deleteRange(from, to);\n let marks = this.storedMarks;\n if (!marks) {\n let $from = this.doc.resolve(from);\n marks = to == from ? $from.marks() : $from.marksAcross(this.doc.resolve(to));\n }\n this.replaceRangeWith(from, to, schema.text(text, marks));\n if (!this.selection.empty)\n this.setSelection(Selection.near(this.selection.$to));\n return this;\n }\n }\n /**\n Store a metadata property in this transaction, keyed either by\n name or by plugin.\n */\n setMeta(key, value) {\n this.meta[typeof key == \"string\" ? key : key.key] = value;\n return this;\n }\n /**\n Retrieve a metadata property for a given name or plugin.\n */\n getMeta(key) {\n return this.meta[typeof key == \"string\" ? key : key.key];\n }\n /**\n Returns true if this transaction doesn't contain any metadata,\n and can thus safely be extended.\n */\n get isGeneric() {\n for (let _ in this.meta)\n return false;\n return true;\n }\n /**\n Indicate that the editor should scroll the selection into view\n when updated to the state produced by this transaction.\n */\n scrollIntoView() {\n this.updated |= UPDATED_SCROLL;\n return this;\n }\n /**\n True when this transaction has had `scrollIntoView` called on it.\n */\n get scrolledIntoView() {\n return (this.updated & UPDATED_SCROLL) > 0;\n }\n}\n\nfunction bind(f, self) {\n return !self || !f ? f : f.bind(self);\n}\nclass FieldDesc {\n constructor(name, desc, self) {\n this.name = name;\n this.init = bind(desc.init, self);\n this.apply = bind(desc.apply, self);\n }\n}\nconst baseFields = [\n new FieldDesc(\"doc\", {\n init(config) { return config.doc || config.schema.topNodeType.createAndFill(); },\n apply(tr) { return tr.doc; }\n }),\n new FieldDesc(\"selection\", {\n init(config, instance) { return config.selection || Selection.atStart(instance.doc); },\n apply(tr) { return tr.selection; }\n }),\n new FieldDesc(\"storedMarks\", {\n init(config) { return config.storedMarks || null; },\n apply(tr, _marks, _old, state) { return state.selection.$cursor ? tr.storedMarks : null; }\n }),\n new FieldDesc(\"scrollToSelection\", {\n init() { return 0; },\n apply(tr, prev) { return tr.scrolledIntoView ? prev + 1 : prev; }\n })\n];\n// Object wrapping the part of a state object that stays the same\n// across transactions. Stored in the state's `config` property.\nclass Configuration {\n constructor(schema, plugins) {\n this.schema = schema;\n this.plugins = [];\n this.pluginsByKey = Object.create(null);\n this.fields = baseFields.slice();\n if (plugins)\n plugins.forEach(plugin => {\n if (this.pluginsByKey[plugin.key])\n throw new RangeError(\"Adding different instances of a keyed plugin (\" + plugin.key + \")\");\n this.plugins.push(plugin);\n this.pluginsByKey[plugin.key] = plugin;\n if (plugin.spec.state)\n this.fields.push(new FieldDesc(plugin.key, plugin.spec.state, plugin));\n });\n }\n}\n/**\nThe state of a ProseMirror editor is represented by an object of\nthis type. A state is a persistent data structure—it isn't\nupdated, but rather a new state value is computed from an old one\nusing the [`apply`](https://prosemirror.net/docs/ref/#state.EditorState.apply) method.\n\nA state holds a number of built-in fields, and plugins can\n[define](https://prosemirror.net/docs/ref/#state.PluginSpec.state) additional fields.\n*/\nclass EditorState {\n /**\n @internal\n */\n constructor(\n /**\n @internal\n */\n config) {\n this.config = config;\n }\n /**\n The schema of the state's document.\n */\n get schema() {\n return this.config.schema;\n }\n /**\n The plugins that are active in this state.\n */\n get plugins() {\n return this.config.plugins;\n }\n /**\n Apply the given transaction to produce a new state.\n */\n apply(tr) {\n return this.applyTransaction(tr).state;\n }\n /**\n @internal\n */\n filterTransaction(tr, ignore = -1) {\n for (let i = 0; i < this.config.plugins.length; i++)\n if (i != ignore) {\n let plugin = this.config.plugins[i];\n if (plugin.spec.filterTransaction && !plugin.spec.filterTransaction.call(plugin, tr, this))\n return false;\n }\n return true;\n }\n /**\n Verbose variant of [`apply`](https://prosemirror.net/docs/ref/#state.EditorState.apply) that\n returns the precise transactions that were applied (which might\n be influenced by the [transaction\n hooks](https://prosemirror.net/docs/ref/#state.PluginSpec.filterTransaction) of\n plugins) along with the new state.\n */\n applyTransaction(rootTr) {\n if (!this.filterTransaction(rootTr))\n return { state: this, transactions: [] };\n let trs = [rootTr], newState = this.applyInner(rootTr), seen = null;\n // This loop repeatedly gives plugins a chance to respond to\n // transactions as new transactions are added, making sure to only\n // pass the transactions the plugin did not see before.\n for (;;) {\n let haveNew = false;\n for (let i = 0; i < this.config.plugins.length; i++) {\n let plugin = this.config.plugins[i];\n if (plugin.spec.appendTransaction) {\n let n = seen ? seen[i].n : 0, oldState = seen ? seen[i].state : this;\n let tr = n < trs.length &&\n plugin.spec.appendTransaction.call(plugin, n ? trs.slice(n) : trs, oldState, newState);\n if (tr && newState.filterTransaction(tr, i)) {\n tr.setMeta(\"appendedTransaction\", rootTr);\n if (!seen) {\n seen = [];\n for (let j = 0; j < this.config.plugins.length; j++)\n seen.push(j < i ? { state: newState, n: trs.length } : { state: this, n: 0 });\n }\n trs.push(tr);\n newState = newState.applyInner(tr);\n haveNew = true;\n }\n if (seen)\n seen[i] = { state: newState, n: trs.length };\n }\n }\n if (!haveNew)\n return { state: newState, transactions: trs };\n }\n }\n /**\n @internal\n */\n applyInner(tr) {\n if (!tr.before.eq(this.doc))\n throw new RangeError(\"Applying a mismatched transaction\");\n let newInstance = new EditorState(this.config), fields = this.config.fields;\n for (let i = 0; i < fields.length; i++) {\n let field = fields[i];\n newInstance[field.name] = field.apply(tr, this[field.name], this, newInstance);\n }\n return newInstance;\n }\n /**\n Start a [transaction](https://prosemirror.net/docs/ref/#state.Transaction) from this state.\n */\n get tr() { return new Transaction(this); }\n /**\n Create a new state.\n */\n static create(config) {\n let $config = new Configuration(config.doc ? config.doc.type.schema : config.schema, config.plugins);\n let instance = new EditorState($config);\n for (let i = 0; i < $config.fields.length; i++)\n instance[$config.fields[i].name] = $config.fields[i].init(config, instance);\n return instance;\n }\n /**\n Create a new state based on this one, but with an adjusted set\n of active plugins. State fields that exist in both sets of\n plugins are kept unchanged. Those that no longer exist are\n dropped, and those that are new are initialized using their\n [`init`](https://prosemirror.net/docs/ref/#state.StateField.init) method, passing in the new\n configuration object..\n */\n reconfigure(config) {\n let $config = new Configuration(this.schema, config.plugins);\n let fields = $config.fields, instance = new EditorState($config);\n for (let i = 0; i < fields.length; i++) {\n let name = fields[i].name;\n instance[name] = this.hasOwnProperty(name) ? this[name] : fields[i].init(config, instance);\n }\n return instance;\n }\n /**\n Serialize this state to JSON. If you want to serialize the state\n of plugins, pass an object mapping property names to use in the\n resulting JSON object to plugin objects. The argument may also be\n a string or number, in which case it is ignored, to support the\n way `JSON.stringify` calls `toString` methods.\n */\n toJSON(pluginFields) {\n let result = { doc: this.doc.toJSON(), selection: this.selection.toJSON() };\n if (this.storedMarks)\n result.storedMarks = this.storedMarks.map(m => m.toJSON());\n if (pluginFields && typeof pluginFields == 'object')\n for (let prop in pluginFields) {\n if (prop == \"doc\" || prop == \"selection\")\n throw new RangeError(\"The JSON fields `doc` and `selection` are reserved\");\n let plugin = pluginFields[prop], state = plugin.spec.state;\n if (state && state.toJSON)\n result[prop] = state.toJSON.call(plugin, this[plugin.key]);\n }\n return result;\n }\n /**\n Deserialize a JSON representation of a state. `config` should\n have at least a `schema` field, and should contain array of\n plugins to initialize the state with. `pluginFields` can be used\n to deserialize the state of plugins, by associating plugin\n instances with the property names they use in the JSON object.\n */\n static fromJSON(config, json, pluginFields) {\n if (!json)\n throw new RangeError(\"Invalid input for EditorState.fromJSON\");\n if (!config.schema)\n throw new RangeError(\"Required config field 'schema' missing\");\n let $config = new Configuration(config.schema, config.plugins);\n let instance = new EditorState($config);\n $config.fields.forEach(field => {\n if (field.name == \"doc\") {\n instance.doc = Node.fromJSON(config.schema, json.doc);\n }\n else if (field.name == \"selection\") {\n instance.selection = Selection.fromJSON(instance.doc, json.selection);\n }\n else if (field.name == \"storedMarks\") {\n if (json.storedMarks)\n instance.storedMarks = json.storedMarks.map(config.schema.markFromJSON);\n }\n else {\n if (pluginFields)\n for (let prop in pluginFields) {\n let plugin = pluginFields[prop], state = plugin.spec.state;\n if (plugin.key == field.name && state && state.fromJSON &&\n Object.prototype.hasOwnProperty.call(json, prop)) {\n instance[field.name] = state.fromJSON.call(plugin, config, json[prop], instance);\n return;\n }\n }\n instance[field.name] = field.init(config, instance);\n }\n });\n return instance;\n }\n}\n\nfunction bindProps(obj, self, target) {\n for (let prop in obj) {\n let val = obj[prop];\n if (val instanceof Function)\n val = val.bind(self);\n else if (prop == \"handleDOMEvents\")\n val = bindProps(val, self, {});\n target[prop] = val;\n }\n return target;\n}\n/**\nPlugins bundle functionality that can be added to an editor.\nThey are part of the [editor state](https://prosemirror.net/docs/ref/#state.EditorState) and\nmay influence that state and the view that contains it.\n*/\nclass Plugin {\n /**\n Create a plugin.\n */\n constructor(\n /**\n The plugin's [spec object](https://prosemirror.net/docs/ref/#state.PluginSpec).\n */\n spec) {\n this.spec = spec;\n /**\n The [props](https://prosemirror.net/docs/ref/#view.EditorProps) exported by this plugin.\n */\n this.props = {};\n if (spec.props)\n bindProps(spec.props, this, this.props);\n this.key = spec.key ? spec.key.key : createKey(\"plugin\");\n }\n /**\n Extract the plugin's state field from an editor state.\n */\n getState(state) { return state[this.key]; }\n}\nconst keys = Object.create(null);\nfunction createKey(name) {\n if (name in keys)\n return name + \"$\" + ++keys[name];\n keys[name] = 0;\n return name + \"$\";\n}\n/**\nA key is used to [tag](https://prosemirror.net/docs/ref/#state.PluginSpec.key) plugins in a way\nthat makes it possible to find them, given an editor state.\nAssigning a key does mean only one plugin of that type can be\nactive in a state.\n*/\nclass PluginKey {\n /**\n Create a plugin key.\n */\n constructor(name = \"key\") { this.key = createKey(name); }\n /**\n Get the active plugin with this key, if any, from an editor\n state.\n */\n get(state) { return state.config.pluginsByKey[this.key]; }\n /**\n Get the plugin's state from an editor state.\n */\n getState(state) { return state[this.key]; }\n}\n\nexport { AllSelection, EditorState, NodeSelection, Plugin, PluginKey, Selection, SelectionRange, TextSelection, Transaction };\n","import RopeSequence from 'rope-sequence';\nimport { Mapping } from 'prosemirror-transform';\nimport { PluginKey, Plugin } from 'prosemirror-state';\n\n// ProseMirror's history isn't simply a way to roll back to a previous\n// state, because ProseMirror supports applying changes without adding\n// them to the history (for example during collaboration).\n//\n// To this end, each 'Branch' (one for the undo history and one for\n// the redo history) keeps an array of 'Items', which can optionally\n// hold a step (an actual undoable change), and always hold a position\n// map (which is needed to move changes below them to apply to the\n// current document).\n//\n// An item that has both a step and a selection bookmark is the start\n// of an 'event' — a group of changes that will be undone or redone at\n// once. (It stores only the bookmark, since that way we don't have to\n// provide a document until the selection is actually applied, which\n// is useful when compressing.)\n// Used to schedule history compression\nconst max_empty_items = 500;\nclass Branch {\n constructor(items, eventCount) {\n this.items = items;\n this.eventCount = eventCount;\n }\n // Pop the latest event off the branch's history and apply it\n // to a document transform.\n popEvent(state, preserveItems) {\n if (this.eventCount == 0)\n return null;\n let end = this.items.length;\n for (;; end--) {\n let next = this.items.get(end - 1);\n if (next.selection) {\n --end;\n break;\n }\n }\n let remap, mapFrom;\n if (preserveItems) {\n remap = this.remapping(end, this.items.length);\n mapFrom = remap.maps.length;\n }\n let transform = state.tr;\n let selection, remaining;\n let addAfter = [], addBefore = [];\n this.items.forEach((item, i) => {\n if (!item.step) {\n if (!remap) {\n remap = this.remapping(end, i + 1);\n mapFrom = remap.maps.length;\n }\n mapFrom--;\n addBefore.push(item);\n return;\n }\n if (remap) {\n addBefore.push(new Item(item.map));\n let step = item.step.map(remap.slice(mapFrom)), map;\n if (step && transform.maybeStep(step).doc) {\n map = transform.mapping.maps[transform.mapping.maps.length - 1];\n addAfter.push(new Item(map, undefined, undefined, addAfter.length + addBefore.length));\n }\n mapFrom--;\n if (map)\n remap.appendMap(map, mapFrom);\n }\n else {\n transform.maybeStep(item.step);\n }\n if (item.selection) {\n selection = remap ? item.selection.map(remap.slice(mapFrom)) : item.selection;\n remaining = new Branch(this.items.slice(0, end).append(addBefore.reverse().concat(addAfter)), this.eventCount - 1);\n return false;\n }\n }, this.items.length, 0);\n return { remaining: remaining, transform, selection: selection };\n }\n // Create a new branch with the given transform added.\n addTransform(transform, selection, histOptions, preserveItems) {\n let newItems = [], eventCount = this.eventCount;\n let oldItems = this.items, lastItem = !preserveItems && oldItems.length ? oldItems.get(oldItems.length - 1) : null;\n for (let i = 0; i < transform.steps.length; i++) {\n let step = transform.steps[i].invert(transform.docs[i]);\n let item = new Item(transform.mapping.maps[i], step, selection), merged;\n if (merged = lastItem && lastItem.merge(item)) {\n item = merged;\n if (i)\n newItems.pop();\n else\n oldItems = oldItems.slice(0, oldItems.length - 1);\n }\n newItems.push(item);\n if (selection) {\n eventCount++;\n selection = undefined;\n }\n if (!preserveItems)\n lastItem = item;\n }\n let overflow = eventCount - histOptions.depth;\n if (overflow > DEPTH_OVERFLOW) {\n oldItems = cutOffEvents(oldItems, overflow);\n eventCount -= overflow;\n }\n return new Branch(oldItems.append(newItems), eventCount);\n }\n remapping(from, to) {\n let maps = new Mapping;\n this.items.forEach((item, i) => {\n let mirrorPos = item.mirrorOffset != null && i - item.mirrorOffset >= from\n ? maps.maps.length - item.mirrorOffset : undefined;\n maps.appendMap(item.map, mirrorPos);\n }, from, to);\n return maps;\n }\n addMaps(array) {\n if (this.eventCount == 0)\n return this;\n return new Branch(this.items.append(array.map(map => new Item(map))), this.eventCount);\n }\n // When the collab module receives remote changes, the history has\n // to know about those, so that it can adjust the steps that were\n // rebased on top of the remote changes, and include the position\n // maps for the remote changes in its array of items.\n rebased(rebasedTransform, rebasedCount) {\n if (!this.eventCount)\n return this;\n let rebasedItems = [], start = Math.max(0, this.items.length - rebasedCount);\n let mapping = rebasedTransform.mapping;\n let newUntil = rebasedTransform.steps.length;\n let eventCount = this.eventCount;\n this.items.forEach(item => { if (item.selection)\n eventCount--; }, start);\n let iRebased = rebasedCount;\n this.items.forEach(item => {\n let pos = mapping.getMirror(--iRebased);\n if (pos == null)\n return;\n newUntil = Math.min(newUntil, pos);\n let map = mapping.maps[pos];\n if (item.step) {\n let step = rebasedTransform.steps[pos].invert(rebasedTransform.docs[pos]);\n let selection = item.selection && item.selection.map(mapping.slice(iRebased + 1, pos));\n if (selection)\n eventCount++;\n rebasedItems.push(new Item(map, step, selection));\n }\n else {\n rebasedItems.push(new Item(map));\n }\n }, start);\n let newMaps = [];\n for (let i = rebasedCount; i < newUntil; i++)\n newMaps.push(new Item(mapping.maps[i]));\n let items = this.items.slice(0, start).append(newMaps).append(rebasedItems);\n let branch = new Branch(items, eventCount);\n if (branch.emptyItemCount() > max_empty_items)\n branch = branch.compress(this.items.length - rebasedItems.length);\n return branch;\n }\n emptyItemCount() {\n let count = 0;\n this.items.forEach(item => { if (!item.step)\n count++; });\n return count;\n }\n // Compressing a branch means rewriting it to push the air (map-only\n // items) out. During collaboration, these naturally accumulate\n // because each remote change adds one. The `upto` argument is used\n // to ensure that only the items below a given level are compressed,\n // because `rebased` relies on a clean, untouched set of items in\n // order to associate old items with rebased steps.\n compress(upto = this.items.length) {\n let remap = this.remapping(0, upto), mapFrom = remap.maps.length;\n let items = [], events = 0;\n this.items.forEach((item, i) => {\n if (i >= upto) {\n items.push(item);\n if (item.selection)\n events++;\n }\n else if (item.step) {\n let step = item.step.map(remap.slice(mapFrom)), map = step && step.getMap();\n mapFrom--;\n if (map)\n remap.appendMap(map, mapFrom);\n if (step) {\n let selection = item.selection && item.selection.map(remap.slice(mapFrom));\n if (selection)\n events++;\n let newItem = new Item(map.invert(), step, selection), merged, last = items.length - 1;\n if (merged = items.length && items[last].merge(newItem))\n items[last] = merged;\n else\n items.push(newItem);\n }\n }\n else if (item.map) {\n mapFrom--;\n }\n }, this.items.length, 0);\n return new Branch(RopeSequence.from(items.reverse()), events);\n }\n}\nBranch.empty = new Branch(RopeSequence.empty, 0);\nfunction cutOffEvents(items, n) {\n let cutPoint;\n items.forEach((item, i) => {\n if (item.selection && (n-- == 0)) {\n cutPoint = i;\n return false;\n }\n });\n return items.slice(cutPoint);\n}\nclass Item {\n constructor(\n // The (forward) step map for this item.\n map, \n // The inverted step\n step, \n // If this is non-null, this item is the start of a group, and\n // this selection is the starting selection for the group (the one\n // that was active before the first step was applied)\n selection, \n // If this item is the inverse of a previous mapping on the stack,\n // this points at the inverse's offset\n mirrorOffset) {\n this.map = map;\n this.step = step;\n this.selection = selection;\n this.mirrorOffset = mirrorOffset;\n }\n merge(other) {\n if (this.step && other.step && !other.selection) {\n let step = other.step.merge(this.step);\n if (step)\n return new Item(step.getMap().invert(), step, this.selection);\n }\n }\n}\n// The value of the state field that tracks undo/redo history for that\n// state. Will be stored in the plugin state when the history plugin\n// is active.\nclass HistoryState {\n constructor(done, undone, prevRanges, prevTime, prevComposition) {\n this.done = done;\n this.undone = undone;\n this.prevRanges = prevRanges;\n this.prevTime = prevTime;\n this.prevComposition = prevComposition;\n }\n}\nconst DEPTH_OVERFLOW = 20;\n// Record a transformation in undo history.\nfunction applyTransaction(history, state, tr, options) {\n let historyTr = tr.getMeta(historyKey), rebased;\n if (historyTr)\n return historyTr.historyState;\n if (tr.getMeta(closeHistoryKey))\n history = new HistoryState(history.done, history.undone, null, 0, -1);\n let appended = tr.getMeta(\"appendedTransaction\");\n if (tr.steps.length == 0) {\n return history;\n }\n else if (appended && appended.getMeta(historyKey)) {\n if (appended.getMeta(historyKey).redo)\n return new HistoryState(history.done.addTransform(tr, undefined, options, mustPreserveItems(state)), history.undone, rangesFor(tr.mapping.maps), history.prevTime, history.prevComposition);\n else\n return new HistoryState(history.done, history.undone.addTransform(tr, undefined, options, mustPreserveItems(state)), null, history.prevTime, history.prevComposition);\n }\n else if (tr.getMeta(\"addToHistory\") !== false && !(appended && appended.getMeta(\"addToHistory\") === false)) {\n // Group transforms that occur in quick succession into one event.\n let composition = tr.getMeta(\"composition\");\n let newGroup = history.prevTime == 0 ||\n (!appended && history.prevComposition != composition &&\n (history.prevTime < (tr.time || 0) - options.newGroupDelay || !isAdjacentTo(tr, history.prevRanges)));\n let prevRanges = appended ? mapRanges(history.prevRanges, tr.mapping) : rangesFor(tr.mapping.maps);\n return new HistoryState(history.done.addTransform(tr, newGroup ? state.selection.getBookmark() : undefined, options, mustPreserveItems(state)), Branch.empty, prevRanges, tr.time, composition == null ? history.prevComposition : composition);\n }\n else if (rebased = tr.getMeta(\"rebased\")) {\n // Used by the collab module to tell the history that some of its\n // content has been rebased.\n return new HistoryState(history.done.rebased(tr, rebased), history.undone.rebased(tr, rebased), mapRanges(history.prevRanges, tr.mapping), history.prevTime, history.prevComposition);\n }\n else {\n return new HistoryState(history.done.addMaps(tr.mapping.maps), history.undone.addMaps(tr.mapping.maps), mapRanges(history.prevRanges, tr.mapping), history.prevTime, history.prevComposition);\n }\n}\nfunction isAdjacentTo(transform, prevRanges) {\n if (!prevRanges)\n return false;\n if (!transform.docChanged)\n return true;\n let adjacent = false;\n transform.mapping.maps[0].forEach((start, end) => {\n for (let i = 0; i < prevRanges.length; i += 2)\n if (start <= prevRanges[i + 1] && end >= prevRanges[i])\n adjacent = true;\n });\n return adjacent;\n}\nfunction rangesFor(maps) {\n let result = [];\n for (let i = maps.length - 1; i >= 0 && result.length == 0; i--)\n maps[i].forEach((_from, _to, from, to) => result.push(from, to));\n return result;\n}\nfunction mapRanges(ranges, mapping) {\n if (!ranges)\n return null;\n let result = [];\n for (let i = 0; i < ranges.length; i += 2) {\n let from = mapping.map(ranges[i], 1), to = mapping.map(ranges[i + 1], -1);\n if (from <= to)\n result.push(from, to);\n }\n return result;\n}\n// Apply the latest event from one branch to the document and shift the event\n// onto the other branch.\nfunction histTransaction(history, state, redo) {\n let preserveItems = mustPreserveItems(state);\n let histOptions = historyKey.get(state).spec.config;\n let pop = (redo ? history.undone : history.done).popEvent(state, preserveItems);\n if (!pop)\n return null;\n let selection = pop.selection.resolve(pop.transform.doc);\n let added = (redo ? history.done : history.undone).addTransform(pop.transform, state.selection.getBookmark(), histOptions, preserveItems);\n let newHist = new HistoryState(redo ? added : pop.remaining, redo ? pop.remaining : added, null, 0, -1);\n return pop.transform.setSelection(selection).setMeta(historyKey, { redo, historyState: newHist });\n}\nlet cachedPreserveItems = false, cachedPreserveItemsPlugins = null;\n// Check whether any plugin in the given state has a\n// `historyPreserveItems` property in its spec, in which case we must\n// preserve steps exactly as they came in, so that they can be\n// rebased.\nfunction mustPreserveItems(state) {\n let plugins = state.plugins;\n if (cachedPreserveItemsPlugins != plugins) {\n cachedPreserveItems = false;\n cachedPreserveItemsPlugins = plugins;\n for (let i = 0; i < plugins.length; i++)\n if (plugins[i].spec.historyPreserveItems) {\n cachedPreserveItems = true;\n break;\n }\n }\n return cachedPreserveItems;\n}\n/**\nSet a flag on the given transaction that will prevent further steps\nfrom being appended to an existing history event (so that they\nrequire a separate undo command to undo).\n*/\nfunction closeHistory(tr) {\n return tr.setMeta(closeHistoryKey, true);\n}\nconst historyKey = new PluginKey(\"history\");\nconst closeHistoryKey = new PluginKey(\"closeHistory\");\n/**\nReturns a plugin that enables the undo history for an editor. The\nplugin will track undo and redo stacks, which can be used with the\n[`undo`](https://prosemirror.net/docs/ref/#history.undo) and [`redo`](https://prosemirror.net/docs/ref/#history.redo) commands.\n\nYou can set an `\"addToHistory\"` [metadata\nproperty](https://prosemirror.net/docs/ref/#state.Transaction.setMeta) of `false` on a transaction\nto prevent it from being rolled back by undo.\n*/\nfunction history(config = {}) {\n config = { depth: config.depth || 100,\n newGroupDelay: config.newGroupDelay || 500 };\n return new Plugin({\n key: historyKey,\n state: {\n init() {\n return new HistoryState(Branch.empty, Branch.empty, null, 0, -1);\n },\n apply(tr, hist, state) {\n return applyTransaction(hist, state, tr, config);\n }\n },\n config,\n props: {\n handleDOMEvents: {\n beforeinput(view, e) {\n let inputType = e.inputType;\n let command = inputType == \"historyUndo\" ? undo : inputType == \"historyRedo\" ? redo : null;\n if (!command)\n return false;\n e.preventDefault();\n return command(view.state, view.dispatch);\n }\n }\n }\n });\n}\nfunction buildCommand(redo, scroll) {\n return (state, dispatch) => {\n let hist = historyKey.getState(state);\n if (!hist || (redo ? hist.undone : hist.done).eventCount == 0)\n return false;\n if (dispatch) {\n let tr = histTransaction(hist, state, redo);\n if (tr)\n dispatch(scroll ? tr.scrollIntoView() : tr);\n }\n return true;\n };\n}\n/**\nA command function that undoes the last change, if any.\n*/\nconst undo = buildCommand(false, true);\n/**\nA command function that redoes the last undone change, if any.\n*/\nconst redo = buildCommand(true, true);\n/**\nA command function that undoes the last change. Don't scroll the\nselection into view.\n*/\nconst undoNoScroll = buildCommand(false, false);\n/**\nA command function that redoes the last undone change. Don't\nscroll the selection into view.\n*/\nconst redoNoScroll = buildCommand(true, false);\n/**\nThe amount of undoable events available in a given state.\n*/\nfunction undoDepth(state) {\n let hist = historyKey.getState(state);\n return hist ? hist.done.eventCount : 0;\n}\n/**\nThe amount of redoable events available in a given editor state.\n*/\nfunction redoDepth(state) {\n let hist = historyKey.getState(state);\n return hist ? hist.undone.eventCount : 0;\n}\n\nexport { closeHistory, history, redo, redoDepth, redoNoScroll, undo, undoDepth, undoNoScroll };\n","import { Plugin } from 'prosemirror-state';\nimport { dropPoint } from 'prosemirror-transform';\n\n/**\nCreate a plugin that, when added to a ProseMirror instance,\ncauses a decoration to show up at the drop position when something\nis dragged over the editor.\n\nNodes may add a `disableDropCursor` property to their spec to\ncontrol the showing of a drop cursor inside them. This may be a\nboolean or a function, which will be called with a view and a\nposition, and should return a boolean.\n*/\nfunction dropCursor(options = {}) {\n return new Plugin({\n view(editorView) { return new DropCursorView(editorView, options); }\n });\n}\nclass DropCursorView {\n constructor(editorView, options) {\n var _a;\n this.editorView = editorView;\n this.cursorPos = null;\n this.element = null;\n this.timeout = -1;\n this.width = (_a = options.width) !== null && _a !== void 0 ? _a : 1;\n this.color = options.color === false ? undefined : (options.color || \"black\");\n this.class = options.class;\n this.handlers = [\"dragover\", \"dragend\", \"drop\", \"dragleave\"].map(name => {\n let handler = (e) => { this[name](e); };\n editorView.dom.addEventListener(name, handler);\n return { name, handler };\n });\n }\n destroy() {\n this.handlers.forEach(({ name, handler }) => this.editorView.dom.removeEventListener(name, handler));\n }\n update(editorView, prevState) {\n if (this.cursorPos != null && prevState.doc != editorView.state.doc) {\n if (this.cursorPos > editorView.state.doc.content.size)\n this.setCursor(null);\n else\n this.updateOverlay();\n }\n }\n setCursor(pos) {\n if (pos == this.cursorPos)\n return;\n this.cursorPos = pos;\n if (pos == null) {\n this.element.parentNode.removeChild(this.element);\n this.element = null;\n }\n else {\n this.updateOverlay();\n }\n }\n updateOverlay() {\n let $pos = this.editorView.state.doc.resolve(this.cursorPos);\n let isBlock = !$pos.parent.inlineContent, rect;\n if (isBlock) {\n let before = $pos.nodeBefore, after = $pos.nodeAfter;\n if (before || after) {\n let node = this.editorView.nodeDOM(this.cursorPos - (before ? before.nodeSize : 0));\n if (node) {\n let nodeRect = node.getBoundingClientRect();\n let top = before ? nodeRect.bottom : nodeRect.top;\n if (before && after)\n top = (top + this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top) / 2;\n rect = { left: nodeRect.left, right: nodeRect.right, top: top - this.width / 2, bottom: top + this.width / 2 };\n }\n }\n }\n if (!rect) {\n let coords = this.editorView.coordsAtPos(this.cursorPos);\n rect = { left: coords.left - this.width / 2, right: coords.left + this.width / 2, top: coords.top, bottom: coords.bottom };\n }\n let parent = this.editorView.dom.offsetParent;\n if (!this.element) {\n this.element = parent.appendChild(document.createElement(\"div\"));\n if (this.class)\n this.element.className = this.class;\n this.element.style.cssText = \"position: absolute; z-index: 50; pointer-events: none;\";\n if (this.color) {\n this.element.style.backgroundColor = this.color;\n }\n }\n this.element.classList.toggle(\"prosemirror-dropcursor-block\", isBlock);\n this.element.classList.toggle(\"prosemirror-dropcursor-inline\", !isBlock);\n let parentLeft, parentTop;\n if (!parent || parent == document.body && getComputedStyle(parent).position == \"static\") {\n parentLeft = -pageXOffset;\n parentTop = -pageYOffset;\n }\n else {\n let rect = parent.getBoundingClientRect();\n parentLeft = rect.left - parent.scrollLeft;\n parentTop = rect.top - parent.scrollTop;\n }\n this.element.style.left = (rect.left - parentLeft) + \"px\";\n this.element.style.top = (rect.top - parentTop) + \"px\";\n this.element.style.width = (rect.right - rect.left) + \"px\";\n this.element.style.height = (rect.bottom - rect.top) + \"px\";\n }\n scheduleRemoval(timeout) {\n clearTimeout(this.timeout);\n this.timeout = setTimeout(() => this.setCursor(null), timeout);\n }\n dragover(event) {\n if (!this.editorView.editable)\n return;\n let pos = this.editorView.posAtCoords({ left: event.clientX, top: event.clientY });\n let node = pos && pos.inside >= 0 && this.editorView.state.doc.nodeAt(pos.inside);\n let disableDropCursor = node && node.type.spec.disableDropCursor;\n let disabled = typeof disableDropCursor == \"function\" ? disableDropCursor(this.editorView, pos, event) : disableDropCursor;\n if (pos && !disabled) {\n let target = pos.pos;\n if (this.editorView.dragging && this.editorView.dragging.slice) {\n let point = dropPoint(this.editorView.state.doc, target, this.editorView.dragging.slice);\n if (point != null)\n target = point;\n }\n this.setCursor(target);\n this.scheduleRemoval(5000);\n }\n }\n dragend() {\n this.scheduleRemoval(20);\n }\n drop() {\n this.scheduleRemoval(20);\n }\n dragleave(event) {\n if (event.target == this.editorView.dom || !this.editorView.dom.contains(event.relatedTarget))\n this.setCursor(null);\n }\n}\n\nexport { dropCursor };\n","export var base = {\n 8: \"Backspace\",\n 9: \"Tab\",\n 10: \"Enter\",\n 12: \"NumLock\",\n 13: \"Enter\",\n 16: \"Shift\",\n 17: \"Control\",\n 18: \"Alt\",\n 20: \"CapsLock\",\n 27: \"Escape\",\n 32: \" \",\n 33: \"PageUp\",\n 34: \"PageDown\",\n 35: \"End\",\n 36: \"Home\",\n 37: \"ArrowLeft\",\n 38: \"ArrowUp\",\n 39: \"ArrowRight\",\n 40: \"ArrowDown\",\n 44: \"PrintScreen\",\n 45: \"Insert\",\n 46: \"Delete\",\n 59: \";\",\n 61: \"=\",\n 91: \"Meta\",\n 92: \"Meta\",\n 106: \"*\",\n 107: \"+\",\n 108: \",\",\n 109: \"-\",\n 110: \".\",\n 111: \"/\",\n 144: \"NumLock\",\n 145: \"ScrollLock\",\n 160: \"Shift\",\n 161: \"Shift\",\n 162: \"Control\",\n 163: \"Control\",\n 164: \"Alt\",\n 165: \"Alt\",\n 173: \"-\",\n 186: \";\",\n 187: \"=\",\n 188: \",\",\n 189: \"-\",\n 190: \".\",\n 191: \"/\",\n 192: \"`\",\n 219: \"[\",\n 220: \"\\\\\",\n 221: \"]\",\n 222: \"'\",\n 229: \"q\"\n}\n\nexport var shift = {\n 48: \")\",\n 49: \"!\",\n 50: \"@\",\n 51: \"#\",\n 52: \"$\",\n 53: \"%\",\n 54: \"^\",\n 55: \"&\",\n 56: \"*\",\n 57: \"(\",\n 59: \":\",\n 61: \"+\",\n 173: \"_\",\n 186: \":\",\n 187: \"+\",\n 188: \"<\",\n 189: \"_\",\n 190: \">\",\n 191: \"?\",\n 192: \"~\",\n 219: \"{\",\n 220: \"|\",\n 221: \"}\",\n 222: \"\\\"\",\n 229: \"Q\"\n}\n\nvar chrome = typeof navigator != \"undefined\" && /Chrome\\/(\\d+)/.exec(navigator.userAgent)\nvar safari = typeof navigator != \"undefined\" && /Apple Computer/.test(navigator.vendor)\nvar gecko = typeof navigator != \"undefined\" && /Gecko\\/\\d+/.test(navigator.userAgent)\nvar mac = typeof navigator != \"undefined\" && /Mac/.test(navigator.platform)\nvar ie = typeof navigator != \"undefined\" && /MSIE \\d|Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(navigator.userAgent)\nvar brokenModifierNames = chrome && (mac || +chrome[1] < 57) || gecko && mac\n\n// Fill in the digit keys\nfor (var i = 0; i < 10; i++) base[48 + i] = base[96 + i] = String(i)\n\n// The function keys\nfor (var i = 1; i <= 24; i++) base[i + 111] = \"F\" + i\n\n// And the alphabetic keys\nfor (var i = 65; i <= 90; i++) {\n base[i] = String.fromCharCode(i + 32)\n shift[i] = String.fromCharCode(i)\n}\n\n// For each code that doesn't have a shift-equivalent, copy the base name\nfor (var code in base) if (!shift.hasOwnProperty(code)) shift[code] = base[code]\n\nexport function keyName(event) {\n // Don't trust event.key in Chrome when there are modifiers until\n // they fix https://bugs.chromium.org/p/chromium/issues/detail?id=633838\n var ignoreKey = brokenModifierNames && (event.ctrlKey || event.altKey || event.metaKey) ||\n (safari || ie) && event.shiftKey && event.key && event.key.length == 1\n var name = (!ignoreKey && event.key) ||\n (event.shiftKey ? shift : base)[event.keyCode] ||\n event.key || \"Unidentified\"\n // Edge sometimes produces wrong names (Issue #3)\n if (name == \"Esc\") name = \"Escape\"\n if (name == \"Del\") name = \"Delete\"\n // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8860571/\n if (name == \"Left\") name = \"ArrowLeft\"\n if (name == \"Up\") name = \"ArrowUp\"\n if (name == \"Right\") name = \"ArrowRight\"\n if (name == \"Down\") name = \"ArrowDown\"\n return name\n}\n","import { keyName, base } from 'w3c-keyname';\nimport { Plugin } from 'prosemirror-state';\n\nconst mac = typeof navigator != \"undefined\" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : false;\nfunction normalizeKeyName(name) {\n let parts = name.split(/-(?!$)/), result = parts[parts.length - 1];\n if (result == \"Space\")\n result = \" \";\n let alt, ctrl, shift, meta;\n for (let i = 0; i < parts.length - 1; i++) {\n let mod = parts[i];\n if (/^(cmd|meta|m)$/i.test(mod))\n meta = true;\n else if (/^a(lt)?$/i.test(mod))\n alt = true;\n else if (/^(c|ctrl|control)$/i.test(mod))\n ctrl = true;\n else if (/^s(hift)?$/i.test(mod))\n shift = true;\n else if (/^mod$/i.test(mod)) {\n if (mac)\n meta = true;\n else\n ctrl = true;\n }\n else\n throw new Error(\"Unrecognized modifier name: \" + mod);\n }\n if (alt)\n result = \"Alt-\" + result;\n if (ctrl)\n result = \"Ctrl-\" + result;\n if (meta)\n result = \"Meta-\" + result;\n if (shift)\n result = \"Shift-\" + result;\n return result;\n}\nfunction normalize(map) {\n let copy = Object.create(null);\n for (let prop in map)\n copy[normalizeKeyName(prop)] = map[prop];\n return copy;\n}\nfunction modifiers(name, event, shift = true) {\n if (event.altKey)\n name = \"Alt-\" + name;\n if (event.ctrlKey)\n name = \"Ctrl-\" + name;\n if (event.metaKey)\n name = \"Meta-\" + name;\n if (shift && event.shiftKey)\n name = \"Shift-\" + name;\n return name;\n}\n/**\nCreate a keymap plugin for the given set of bindings.\n\nBindings should map key names to [command](https://prosemirror.net/docs/ref/#commands)-style\nfunctions, which will be called with `(EditorState, dispatch,\nEditorView)` arguments, and should return true when they've handled\nthe key. Note that the view argument isn't part of the command\nprotocol, but can be used as an escape hatch if a binding needs to\ndirectly interact with the UI.\n\nKey names may be strings like `\"Shift-Ctrl-Enter\"`—a key\nidentifier prefixed with zero or more modifiers. Key identifiers\nare based on the strings that can appear in\n[`KeyEvent.key`](https:developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key).\nUse lowercase letters to refer to letter keys (or uppercase letters\nif you want shift to be held). You may use `\"Space\"` as an alias\nfor the `\" \"` name.\n\nModifiers can be given in any order. `Shift-` (or `s-`), `Alt-` (or\n`a-`), `Ctrl-` (or `c-` or `Control-`) and `Cmd-` (or `m-` or\n`Meta-`) are recognized. For characters that are created by holding\nshift, the `Shift-` prefix is implied, and should not be added\nexplicitly.\n\nYou can use `Mod-` as a shorthand for `Cmd-` on Mac and `Ctrl-` on\nother platforms.\n\nYou can add multiple keymap plugins to an editor. The order in\nwhich they appear determines their precedence (the ones early in\nthe array get to dispatch first).\n*/\nfunction keymap(bindings) {\n return new Plugin({ props: { handleKeyDown: keydownHandler(bindings) } });\n}\n/**\nGiven a set of bindings (using the same format as\n[`keymap`](https://prosemirror.net/docs/ref/#keymap.keymap)), return a [keydown\nhandler](https://prosemirror.net/docs/ref/#view.EditorProps.handleKeyDown) that handles them.\n*/\nfunction keydownHandler(bindings) {\n let map = normalize(bindings);\n return function (view, event) {\n let name = keyName(event), baseName, direct = map[modifiers(name, event)];\n if (direct && direct(view.state, view.dispatch, view))\n return true;\n // A character key\n if (name.length == 1 && name != \" \") {\n if (event.shiftKey) {\n // In case the name was already modified by shift, try looking\n // it up without its shift modifier\n let noShift = map[modifiers(name, event, false)];\n if (noShift && noShift(view.state, view.dispatch, view))\n return true;\n }\n if ((event.shiftKey || event.altKey || event.metaKey || name.charCodeAt(0) > 127) &&\n (baseName = base[event.keyCode]) && baseName != name) {\n // Try falling back to the keyCode when there's a modifier\n // active or the character produced isn't ASCII, and our table\n // produces a different name from the the keyCode. See #668,\n // #1060\n let fromCode = map[modifiers(baseName, event)];\n if (fromCode && fromCode(view.state, view.dispatch, view))\n return true;\n }\n }\n return false;\n };\n}\n\nexport { keydownHandler, keymap };\n","import { TextSelection, NodeSelection, AllSelection, Selection } from 'prosemirror-state';\nimport { DOMSerializer, Fragment, Mark, Slice, DOMParser } from 'prosemirror-model';\nimport { dropPoint } from 'prosemirror-transform';\n\nconst domIndex = function (node) {\n for (var index = 0;; index++) {\n node = node.previousSibling;\n if (!node)\n return index;\n }\n};\nconst parentNode = function (node) {\n let parent = node.assignedSlot || node.parentNode;\n return parent && parent.nodeType == 11 ? parent.host : parent;\n};\nlet reusedRange = null;\n// Note that this will always return the same range, because DOM range\n// objects are every expensive, and keep slowing down subsequent DOM\n// updates, for some reason.\nconst textRange = function (node, from, to) {\n let range = reusedRange || (reusedRange = document.createRange());\n range.setEnd(node, to == null ? node.nodeValue.length : to);\n range.setStart(node, from || 0);\n return range;\n};\nconst clearReusedRange = function () {\n reusedRange = null;\n};\n// Scans forward and backward through DOM positions equivalent to the\n// given one to see if the two are in the same place (i.e. after a\n// text node vs at the end of that text node)\nconst isEquivalentPosition = function (node, off, targetNode, targetOff) {\n return targetNode && (scanFor(node, off, targetNode, targetOff, -1) ||\n scanFor(node, off, targetNode, targetOff, 1));\n};\nconst atomElements = /^(img|br|input|textarea|hr)$/i;\nfunction scanFor(node, off, targetNode, targetOff, dir) {\n for (;;) {\n if (node == targetNode && off == targetOff)\n return true;\n if (off == (dir < 0 ? 0 : nodeSize(node))) {\n let parent = node.parentNode;\n if (!parent || parent.nodeType != 1 || hasBlockDesc(node) || atomElements.test(node.nodeName) ||\n node.contentEditable == \"false\")\n return false;\n off = domIndex(node) + (dir < 0 ? 0 : 1);\n node = parent;\n }\n else if (node.nodeType == 1) {\n node = node.childNodes[off + (dir < 0 ? -1 : 0)];\n if (node.contentEditable == \"false\")\n return false;\n off = dir < 0 ? nodeSize(node) : 0;\n }\n else {\n return false;\n }\n }\n}\nfunction nodeSize(node) {\n return node.nodeType == 3 ? node.nodeValue.length : node.childNodes.length;\n}\nfunction textNodeBefore$1(node, offset) {\n for (;;) {\n if (node.nodeType == 3 && offset)\n return node;\n if (node.nodeType == 1 && offset > 0) {\n if (node.contentEditable == \"false\")\n return null;\n node = node.childNodes[offset - 1];\n offset = nodeSize(node);\n }\n else if (node.parentNode && !hasBlockDesc(node)) {\n offset = domIndex(node);\n node = node.parentNode;\n }\n else {\n return null;\n }\n }\n}\nfunction textNodeAfter$1(node, offset) {\n for (;;) {\n if (node.nodeType == 3 && offset < node.nodeValue.length)\n return node;\n if (node.nodeType == 1 && offset < node.childNodes.length) {\n if (node.contentEditable == \"false\")\n return null;\n node = node.childNodes[offset];\n offset = 0;\n }\n else if (node.parentNode && !hasBlockDesc(node)) {\n offset = domIndex(node) + 1;\n node = node.parentNode;\n }\n else {\n return null;\n }\n }\n}\nfunction isOnEdge(node, offset, parent) {\n for (let atStart = offset == 0, atEnd = offset == nodeSize(node); atStart || atEnd;) {\n if (node == parent)\n return true;\n let index = domIndex(node);\n node = node.parentNode;\n if (!node)\n return false;\n atStart = atStart && index == 0;\n atEnd = atEnd && index == nodeSize(node);\n }\n}\nfunction hasBlockDesc(dom) {\n let desc;\n for (let cur = dom; cur; cur = cur.parentNode)\n if (desc = cur.pmViewDesc)\n break;\n return desc && desc.node && desc.node.isBlock && (desc.dom == dom || desc.contentDOM == dom);\n}\n// Work around Chrome issue https://bugs.chromium.org/p/chromium/issues/detail?id=447523\n// (isCollapsed inappropriately returns true in shadow dom)\nconst selectionCollapsed = function (domSel) {\n return domSel.focusNode && isEquivalentPosition(domSel.focusNode, domSel.focusOffset, domSel.anchorNode, domSel.anchorOffset);\n};\nfunction keyEvent(keyCode, key) {\n let event = document.createEvent(\"Event\");\n event.initEvent(\"keydown\", true, true);\n event.keyCode = keyCode;\n event.key = event.code = key;\n return event;\n}\nfunction deepActiveElement(doc) {\n let elt = doc.activeElement;\n while (elt && elt.shadowRoot)\n elt = elt.shadowRoot.activeElement;\n return elt;\n}\nfunction caretFromPoint(doc, x, y) {\n if (doc.caretPositionFromPoint) {\n try { // Firefox throws for this call in hard-to-predict circumstances (#994)\n let pos = doc.caretPositionFromPoint(x, y);\n // Clip the offset, because Chrome will return a text offset\n // into nodes, which can't be treated as a regular DOM\n // offset\n if (pos)\n return { node: pos.offsetNode, offset: Math.min(nodeSize(pos.offsetNode), pos.offset) };\n }\n catch (_) { }\n }\n if (doc.caretRangeFromPoint) {\n let range = doc.caretRangeFromPoint(x, y);\n if (range)\n return { node: range.startContainer, offset: Math.min(nodeSize(range.startContainer), range.startOffset) };\n }\n}\n\nconst nav = typeof navigator != \"undefined\" ? navigator : null;\nconst doc = typeof document != \"undefined\" ? document : null;\nconst agent = (nav && nav.userAgent) || \"\";\nconst ie_edge = /Edge\\/(\\d+)/.exec(agent);\nconst ie_upto10 = /MSIE \\d/.exec(agent);\nconst ie_11up = /Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(agent);\nconst ie = !!(ie_upto10 || ie_11up || ie_edge);\nconst ie_version = ie_upto10 ? document.documentMode : ie_11up ? +ie_11up[1] : ie_edge ? +ie_edge[1] : 0;\nconst gecko = !ie && /gecko\\/(\\d+)/i.test(agent);\ngecko && +(/Firefox\\/(\\d+)/.exec(agent) || [0, 0])[1];\nconst _chrome = !ie && /Chrome\\/(\\d+)/.exec(agent);\nconst chrome = !!_chrome;\nconst chrome_version = _chrome ? +_chrome[1] : 0;\nconst safari = !ie && !!nav && /Apple Computer/.test(nav.vendor);\n// Is true for both iOS and iPadOS for convenience\nconst ios = safari && (/Mobile\\/\\w+/.test(agent) || !!nav && nav.maxTouchPoints > 2);\nconst mac = ios || (nav ? /Mac/.test(nav.platform) : false);\nconst windows = nav ? /Win/.test(nav.platform) : false;\nconst android = /Android \\d/.test(agent);\nconst webkit = !!doc && \"webkitFontSmoothing\" in doc.documentElement.style;\nconst webkit_version = webkit ? +(/\\bAppleWebKit\\/(\\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;\n\nfunction windowRect(doc) {\n let vp = doc.defaultView && doc.defaultView.visualViewport;\n if (vp)\n return {\n left: 0, right: vp.width,\n top: 0, bottom: vp.height\n };\n return { left: 0, right: doc.documentElement.clientWidth,\n top: 0, bottom: doc.documentElement.clientHeight };\n}\nfunction getSide(value, side) {\n return typeof value == \"number\" ? value : value[side];\n}\nfunction clientRect(node) {\n let rect = node.getBoundingClientRect();\n // Adjust for elements with style \"transform: scale()\"\n let scaleX = (rect.width / node.offsetWidth) || 1;\n let scaleY = (rect.height / node.offsetHeight) || 1;\n // Make sure scrollbar width isn't included in the rectangle\n return { left: rect.left, right: rect.left + node.clientWidth * scaleX,\n top: rect.top, bottom: rect.top + node.clientHeight * scaleY };\n}\nfunction scrollRectIntoView(view, rect, startDOM) {\n let scrollThreshold = view.someProp(\"scrollThreshold\") || 0, scrollMargin = view.someProp(\"scrollMargin\") || 5;\n let doc = view.dom.ownerDocument;\n for (let parent = startDOM || view.dom;; parent = parentNode(parent)) {\n if (!parent)\n break;\n if (parent.nodeType != 1)\n continue;\n let elt = parent;\n let atTop = elt == doc.body;\n let bounding = atTop ? windowRect(doc) : clientRect(elt);\n let moveX = 0, moveY = 0;\n if (rect.top < bounding.top + getSide(scrollThreshold, \"top\"))\n moveY = -(bounding.top - rect.top + getSide(scrollMargin, \"top\"));\n else if (rect.bottom > bounding.bottom - getSide(scrollThreshold, \"bottom\"))\n moveY = rect.bottom - rect.top > bounding.bottom - bounding.top\n ? rect.top + getSide(scrollMargin, \"top\") - bounding.top\n : rect.bottom - bounding.bottom + getSide(scrollMargin, \"bottom\");\n if (rect.left < bounding.left + getSide(scrollThreshold, \"left\"))\n moveX = -(bounding.left - rect.left + getSide(scrollMargin, \"left\"));\n else if (rect.right > bounding.right - getSide(scrollThreshold, \"right\"))\n moveX = rect.right - bounding.right + getSide(scrollMargin, \"right\");\n if (moveX || moveY) {\n if (atTop) {\n doc.defaultView.scrollBy(moveX, moveY);\n }\n else {\n let startX = elt.scrollLeft, startY = elt.scrollTop;\n if (moveY)\n elt.scrollTop += moveY;\n if (moveX)\n elt.scrollLeft += moveX;\n let dX = elt.scrollLeft - startX, dY = elt.scrollTop - startY;\n rect = { left: rect.left - dX, top: rect.top - dY, right: rect.right - dX, bottom: rect.bottom - dY };\n }\n }\n if (atTop || /^(fixed|sticky)$/.test(getComputedStyle(parent).position))\n break;\n }\n}\n// Store the scroll position of the editor's parent nodes, along with\n// the top position of an element near the top of the editor, which\n// will be used to make sure the visible viewport remains stable even\n// when the size of the content above changes.\nfunction storeScrollPos(view) {\n let rect = view.dom.getBoundingClientRect(), startY = Math.max(0, rect.top);\n let refDOM, refTop;\n for (let x = (rect.left + rect.right) / 2, y = startY + 1; y < Math.min(innerHeight, rect.bottom); y += 5) {\n let dom = view.root.elementFromPoint(x, y);\n if (!dom || dom == view.dom || !view.dom.contains(dom))\n continue;\n let localRect = dom.getBoundingClientRect();\n if (localRect.top >= startY - 20) {\n refDOM = dom;\n refTop = localRect.top;\n break;\n }\n }\n return { refDOM: refDOM, refTop: refTop, stack: scrollStack(view.dom) };\n}\nfunction scrollStack(dom) {\n let stack = [], doc = dom.ownerDocument;\n for (let cur = dom; cur; cur = parentNode(cur)) {\n stack.push({ dom: cur, top: cur.scrollTop, left: cur.scrollLeft });\n if (dom == doc)\n break;\n }\n return stack;\n}\n// Reset the scroll position of the editor's parent nodes to that what\n// it was before, when storeScrollPos was called.\nfunction resetScrollPos({ refDOM, refTop, stack }) {\n let newRefTop = refDOM ? refDOM.getBoundingClientRect().top : 0;\n restoreScrollStack(stack, newRefTop == 0 ? 0 : newRefTop - refTop);\n}\nfunction restoreScrollStack(stack, dTop) {\n for (let i = 0; i < stack.length; i++) {\n let { dom, top, left } = stack[i];\n if (dom.scrollTop != top + dTop)\n dom.scrollTop = top + dTop;\n if (dom.scrollLeft != left)\n dom.scrollLeft = left;\n }\n}\nlet preventScrollSupported = null;\n// Feature-detects support for .focus({preventScroll: true}), and uses\n// a fallback kludge when not supported.\nfunction focusPreventScroll(dom) {\n if (dom.setActive)\n return dom.setActive(); // in IE\n if (preventScrollSupported)\n return dom.focus(preventScrollSupported);\n let stored = scrollStack(dom);\n dom.focus(preventScrollSupported == null ? {\n get preventScroll() {\n preventScrollSupported = { preventScroll: true };\n return true;\n }\n } : undefined);\n if (!preventScrollSupported) {\n preventScrollSupported = false;\n restoreScrollStack(stored, 0);\n }\n}\nfunction findOffsetInNode(node, coords) {\n let closest, dxClosest = 2e8, coordsClosest, offset = 0;\n let rowBot = coords.top, rowTop = coords.top;\n let firstBelow, coordsBelow;\n for (let child = node.firstChild, childIndex = 0; child; child = child.nextSibling, childIndex++) {\n let rects;\n if (child.nodeType == 1)\n rects = child.getClientRects();\n else if (child.nodeType == 3)\n rects = textRange(child).getClientRects();\n else\n continue;\n for (let i = 0; i < rects.length; i++) {\n let rect = rects[i];\n if (rect.top <= rowBot && rect.bottom >= rowTop) {\n rowBot = Math.max(rect.bottom, rowBot);\n rowTop = Math.min(rect.top, rowTop);\n let dx = rect.left > coords.left ? rect.left - coords.left\n : rect.right < coords.left ? coords.left - rect.right : 0;\n if (dx < dxClosest) {\n closest = child;\n dxClosest = dx;\n coordsClosest = dx && closest.nodeType == 3 ? {\n left: rect.right < coords.left ? rect.right : rect.left,\n top: coords.top\n } : coords;\n if (child.nodeType == 1 && dx)\n offset = childIndex + (coords.left >= (rect.left + rect.right) / 2 ? 1 : 0);\n continue;\n }\n }\n else if (rect.top > coords.top && !firstBelow && rect.left <= coords.left && rect.right >= coords.left) {\n firstBelow = child;\n coordsBelow = { left: Math.max(rect.left, Math.min(rect.right, coords.left)), top: rect.top };\n }\n if (!closest && (coords.left >= rect.right && coords.top >= rect.top ||\n coords.left >= rect.left && coords.top >= rect.bottom))\n offset = childIndex + 1;\n }\n }\n if (!closest && firstBelow) {\n closest = firstBelow;\n coordsClosest = coordsBelow;\n dxClosest = 0;\n }\n if (closest && closest.nodeType == 3)\n return findOffsetInText(closest, coordsClosest);\n if (!closest || (dxClosest && closest.nodeType == 1))\n return { node, offset };\n return findOffsetInNode(closest, coordsClosest);\n}\nfunction findOffsetInText(node, coords) {\n let len = node.nodeValue.length;\n let range = document.createRange();\n for (let i = 0; i < len; i++) {\n range.setEnd(node, i + 1);\n range.setStart(node, i);\n let rect = singleRect(range, 1);\n if (rect.top == rect.bottom)\n continue;\n if (inRect(coords, rect))\n return { node, offset: i + (coords.left >= (rect.left + rect.right) / 2 ? 1 : 0) };\n }\n return { node, offset: 0 };\n}\nfunction inRect(coords, rect) {\n return coords.left >= rect.left - 1 && coords.left <= rect.right + 1 &&\n coords.top >= rect.top - 1 && coords.top <= rect.bottom + 1;\n}\nfunction targetKludge(dom, coords) {\n let parent = dom.parentNode;\n if (parent && /^li$/i.test(parent.nodeName) && coords.left < dom.getBoundingClientRect().left)\n return parent;\n return dom;\n}\nfunction posFromElement(view, elt, coords) {\n let { node, offset } = findOffsetInNode(elt, coords), bias = -1;\n if (node.nodeType == 1 && !node.firstChild) {\n let rect = node.getBoundingClientRect();\n bias = rect.left != rect.right && coords.left > (rect.left + rect.right) / 2 ? 1 : -1;\n }\n return view.docView.posFromDOM(node, offset, bias);\n}\nfunction posFromCaret(view, node, offset, coords) {\n // Browser (in caretPosition/RangeFromPoint) will agressively\n // normalize towards nearby inline nodes. Since we are interested in\n // positions between block nodes too, we first walk up the hierarchy\n // of nodes to see if there are block nodes that the coordinates\n // fall outside of. If so, we take the position before/after that\n // block. If not, we call `posFromDOM` on the raw node/offset.\n let outsideBlock = -1;\n for (let cur = node, sawBlock = false;;) {\n if (cur == view.dom)\n break;\n let desc = view.docView.nearestDesc(cur, true);\n if (!desc)\n return null;\n if (desc.dom.nodeType == 1 && (desc.node.isBlock && desc.parent || !desc.contentDOM)) {\n let rect = desc.dom.getBoundingClientRect();\n if (desc.node.isBlock && desc.parent) {\n // Only apply the horizontal test to the innermost block. Vertical for any parent.\n if (!sawBlock && rect.left > coords.left || rect.top > coords.top)\n outsideBlock = desc.posBefore;\n else if (!sawBlock && rect.right < coords.left || rect.bottom < coords.top)\n outsideBlock = desc.posAfter;\n sawBlock = true;\n }\n if (!desc.contentDOM && outsideBlock < 0 && !desc.node.isText) {\n // If we are inside a leaf, return the side of the leaf closer to the coords\n let before = desc.node.isBlock ? coords.top < (rect.top + rect.bottom) / 2\n : coords.left < (rect.left + rect.right) / 2;\n return before ? desc.posBefore : desc.posAfter;\n }\n }\n cur = desc.dom.parentNode;\n }\n return outsideBlock > -1 ? outsideBlock : view.docView.posFromDOM(node, offset, -1);\n}\nfunction elementFromPoint(element, coords, box) {\n let len = element.childNodes.length;\n if (len && box.top < box.bottom) {\n for (let startI = Math.max(0, Math.min(len - 1, Math.floor(len * (coords.top - box.top) / (box.bottom - box.top)) - 2)), i = startI;;) {\n let child = element.childNodes[i];\n if (child.nodeType == 1) {\n let rects = child.getClientRects();\n for (let j = 0; j < rects.length; j++) {\n let rect = rects[j];\n if (inRect(coords, rect))\n return elementFromPoint(child, coords, rect);\n }\n }\n if ((i = (i + 1) % len) == startI)\n break;\n }\n }\n return element;\n}\n// Given an x,y position on the editor, get the position in the document.\nfunction posAtCoords(view, coords) {\n let doc = view.dom.ownerDocument, node, offset = 0;\n let caret = caretFromPoint(doc, coords.left, coords.top);\n if (caret)\n ({ node, offset } = caret);\n let elt = (view.root.elementFromPoint ? view.root : doc)\n .elementFromPoint(coords.left, coords.top);\n let pos;\n if (!elt || !view.dom.contains(elt.nodeType != 1 ? elt.parentNode : elt)) {\n let box = view.dom.getBoundingClientRect();\n if (!inRect(coords, box))\n return null;\n elt = elementFromPoint(view.dom, coords, box);\n if (!elt)\n return null;\n }\n // Safari's caretRangeFromPoint returns nonsense when on a draggable element\n if (safari) {\n for (let p = elt; node && p; p = parentNode(p))\n if (p.draggable)\n node = undefined;\n }\n elt = targetKludge(elt, coords);\n if (node) {\n if (gecko && node.nodeType == 1) {\n // Firefox will sometimes return offsets into nodes, which\n // have no actual children, from caretPositionFromPoint (#953)\n offset = Math.min(offset, node.childNodes.length);\n // It'll also move the returned position before image nodes,\n // even if those are behind it.\n if (offset < node.childNodes.length) {\n let next = node.childNodes[offset], box;\n if (next.nodeName == \"IMG\" && (box = next.getBoundingClientRect()).right <= coords.left &&\n box.bottom > coords.top)\n offset++;\n }\n }\n let prev;\n // When clicking above the right side of an uneditable node, Chrome will report a cursor position after that node.\n if (webkit && offset && node.nodeType == 1 && (prev = node.childNodes[offset - 1]).nodeType == 1 &&\n prev.contentEditable == \"false\" && prev.getBoundingClientRect().top >= coords.top)\n offset--;\n // Suspiciously specific kludge to work around caret*FromPoint\n // never returning a position at the end of the document\n if (node == view.dom && offset == node.childNodes.length - 1 && node.lastChild.nodeType == 1 &&\n coords.top > node.lastChild.getBoundingClientRect().bottom)\n pos = view.state.doc.content.size;\n // Ignore positions directly after a BR, since caret*FromPoint\n // 'round up' positions that would be more accurately placed\n // before the BR node.\n else if (offset == 0 || node.nodeType != 1 || node.childNodes[offset - 1].nodeName != \"BR\")\n pos = posFromCaret(view, node, offset, coords);\n }\n if (pos == null)\n pos = posFromElement(view, elt, coords);\n let desc = view.docView.nearestDesc(elt, true);\n return { pos, inside: desc ? desc.posAtStart - desc.border : -1 };\n}\nfunction nonZero(rect) {\n return rect.top < rect.bottom || rect.left < rect.right;\n}\nfunction singleRect(target, bias) {\n let rects = target.getClientRects();\n if (rects.length) {\n let first = rects[bias < 0 ? 0 : rects.length - 1];\n if (nonZero(first))\n return first;\n }\n return Array.prototype.find.call(rects, nonZero) || target.getBoundingClientRect();\n}\nconst BIDI = /[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac]/;\n// Given a position in the document model, get a bounding box of the\n// character at that position, relative to the window.\nfunction coordsAtPos(view, pos, side) {\n let { node, offset, atom } = view.docView.domFromPos(pos, side < 0 ? -1 : 1);\n let supportEmptyRange = webkit || gecko;\n if (node.nodeType == 3) {\n // These browsers support querying empty text ranges. Prefer that in\n // bidi context or when at the end of a node.\n if (supportEmptyRange && (BIDI.test(node.nodeValue) || (side < 0 ? !offset : offset == node.nodeValue.length))) {\n let rect = singleRect(textRange(node, offset, offset), side);\n // Firefox returns bad results (the position before the space)\n // when querying a position directly after line-broken\n // whitespace. Detect this situation and and kludge around it\n if (gecko && offset && /\\s/.test(node.nodeValue[offset - 1]) && offset < node.nodeValue.length) {\n let rectBefore = singleRect(textRange(node, offset - 1, offset - 1), -1);\n if (rectBefore.top == rect.top) {\n let rectAfter = singleRect(textRange(node, offset, offset + 1), -1);\n if (rectAfter.top != rect.top)\n return flattenV(rectAfter, rectAfter.left < rectBefore.left);\n }\n }\n return rect;\n }\n else {\n let from = offset, to = offset, takeSide = side < 0 ? 1 : -1;\n if (side < 0 && !offset) {\n to++;\n takeSide = -1;\n }\n else if (side >= 0 && offset == node.nodeValue.length) {\n from--;\n takeSide = 1;\n }\n else if (side < 0) {\n from--;\n }\n else {\n to++;\n }\n return flattenV(singleRect(textRange(node, from, to), takeSide), takeSide < 0);\n }\n }\n let $dom = view.state.doc.resolve(pos - (atom || 0));\n // Return a horizontal line in block context\n if (!$dom.parent.inlineContent) {\n if (atom == null && offset && (side < 0 || offset == nodeSize(node))) {\n let before = node.childNodes[offset - 1];\n if (before.nodeType == 1)\n return flattenH(before.getBoundingClientRect(), false);\n }\n if (atom == null && offset < nodeSize(node)) {\n let after = node.childNodes[offset];\n if (after.nodeType == 1)\n return flattenH(after.getBoundingClientRect(), true);\n }\n return flattenH(node.getBoundingClientRect(), side >= 0);\n }\n // Inline, not in text node (this is not Bidi-safe)\n if (atom == null && offset && (side < 0 || offset == nodeSize(node))) {\n let before = node.childNodes[offset - 1];\n let target = before.nodeType == 3 ? textRange(before, nodeSize(before) - (supportEmptyRange ? 0 : 1))\n // BR nodes tend to only return the rectangle before them.\n // Only use them if they are the last element in their parent\n : before.nodeType == 1 && (before.nodeName != \"BR\" || !before.nextSibling) ? before : null;\n if (target)\n return flattenV(singleRect(target, 1), false);\n }\n if (atom == null && offset < nodeSize(node)) {\n let after = node.childNodes[offset];\n while (after.pmViewDesc && after.pmViewDesc.ignoreForCoords)\n after = after.nextSibling;\n let target = !after ? null : after.nodeType == 3 ? textRange(after, 0, (supportEmptyRange ? 0 : 1))\n : after.nodeType == 1 ? after : null;\n if (target)\n return flattenV(singleRect(target, -1), true);\n }\n // All else failed, just try to get a rectangle for the target node\n return flattenV(singleRect(node.nodeType == 3 ? textRange(node) : node, -side), side >= 0);\n}\nfunction flattenV(rect, left) {\n if (rect.width == 0)\n return rect;\n let x = left ? rect.left : rect.right;\n return { top: rect.top, bottom: rect.bottom, left: x, right: x };\n}\nfunction flattenH(rect, top) {\n if (rect.height == 0)\n return rect;\n let y = top ? rect.top : rect.bottom;\n return { top: y, bottom: y, left: rect.left, right: rect.right };\n}\nfunction withFlushedState(view, state, f) {\n let viewState = view.state, active = view.root.activeElement;\n if (viewState != state)\n view.updateState(state);\n if (active != view.dom)\n view.focus();\n try {\n return f();\n }\n finally {\n if (viewState != state)\n view.updateState(viewState);\n if (active != view.dom && active)\n active.focus();\n }\n}\n// Whether vertical position motion in a given direction\n// from a position would leave a text block.\nfunction endOfTextblockVertical(view, state, dir) {\n let sel = state.selection;\n let $pos = dir == \"up\" ? sel.$from : sel.$to;\n return withFlushedState(view, state, () => {\n let { node: dom } = view.docView.domFromPos($pos.pos, dir == \"up\" ? -1 : 1);\n for (;;) {\n let nearest = view.docView.nearestDesc(dom, true);\n if (!nearest)\n break;\n if (nearest.node.isBlock) {\n dom = nearest.contentDOM || nearest.dom;\n break;\n }\n dom = nearest.dom.parentNode;\n }\n let coords = coordsAtPos(view, $pos.pos, 1);\n for (let child = dom.firstChild; child; child = child.nextSibling) {\n let boxes;\n if (child.nodeType == 1)\n boxes = child.getClientRects();\n else if (child.nodeType == 3)\n boxes = textRange(child, 0, child.nodeValue.length).getClientRects();\n else\n continue;\n for (let i = 0; i < boxes.length; i++) {\n let box = boxes[i];\n if (box.bottom > box.top + 1 &&\n (dir == \"up\" ? coords.top - box.top > (box.bottom - coords.top) * 2\n : box.bottom - coords.bottom > (coords.bottom - box.top) * 2))\n return false;\n }\n }\n return true;\n });\n}\nconst maybeRTL = /[\\u0590-\\u08ac]/;\nfunction endOfTextblockHorizontal(view, state, dir) {\n let { $head } = state.selection;\n if (!$head.parent.isTextblock)\n return false;\n let offset = $head.parentOffset, atStart = !offset, atEnd = offset == $head.parent.content.size;\n let sel = view.domSelection();\n if (!sel)\n return $head.pos == $head.start() || $head.pos == $head.end();\n // If the textblock is all LTR, or the browser doesn't support\n // Selection.modify (Edge), fall back to a primitive approach\n if (!maybeRTL.test($head.parent.textContent) || !sel.modify)\n return dir == \"left\" || dir == \"backward\" ? atStart : atEnd;\n return withFlushedState(view, state, () => {\n // This is a huge hack, but appears to be the best we can\n // currently do: use `Selection.modify` to move the selection by\n // one character, and see if that moves the cursor out of the\n // textblock (or doesn't move it at all, when at the start/end of\n // the document).\n let { focusNode: oldNode, focusOffset: oldOff, anchorNode, anchorOffset } = view.domSelectionRange();\n let oldBidiLevel = sel.caretBidiLevel // Only for Firefox\n ;\n sel.modify(\"move\", dir, \"character\");\n let parentDOM = $head.depth ? view.docView.domAfterPos($head.before()) : view.dom;\n let { focusNode: newNode, focusOffset: newOff } = view.domSelectionRange();\n let result = newNode && !parentDOM.contains(newNode.nodeType == 1 ? newNode : newNode.parentNode) ||\n (oldNode == newNode && oldOff == newOff);\n // Restore the previous selection\n try {\n sel.collapse(anchorNode, anchorOffset);\n if (oldNode && (oldNode != anchorNode || oldOff != anchorOffset) && sel.extend)\n sel.extend(oldNode, oldOff);\n }\n catch (_) { }\n if (oldBidiLevel != null)\n sel.caretBidiLevel = oldBidiLevel;\n return result;\n });\n}\nlet cachedState = null;\nlet cachedDir = null;\nlet cachedResult = false;\nfunction endOfTextblock(view, state, dir) {\n if (cachedState == state && cachedDir == dir)\n return cachedResult;\n cachedState = state;\n cachedDir = dir;\n return cachedResult = dir == \"up\" || dir == \"down\"\n ? endOfTextblockVertical(view, state, dir)\n : endOfTextblockHorizontal(view, state, dir);\n}\n\n// View descriptions are data structures that describe the DOM that is\n// used to represent the editor's content. They are used for:\n//\n// - Incremental redrawing when the document changes\n//\n// - Figuring out what part of the document a given DOM position\n// corresponds to\n//\n// - Wiring in custom implementations of the editing interface for a\n// given node\n//\n// They form a doubly-linked mutable tree, starting at `view.docView`.\nconst NOT_DIRTY = 0, CHILD_DIRTY = 1, CONTENT_DIRTY = 2, NODE_DIRTY = 3;\n// Superclass for the various kinds of descriptions. Defines their\n// basic structure and shared methods.\nclass ViewDesc {\n constructor(parent, children, dom, \n // This is the node that holds the child views. It may be null for\n // descs that don't have children.\n contentDOM) {\n this.parent = parent;\n this.children = children;\n this.dom = dom;\n this.contentDOM = contentDOM;\n this.dirty = NOT_DIRTY;\n // An expando property on the DOM node provides a link back to its\n // description.\n dom.pmViewDesc = this;\n }\n // Used to check whether a given description corresponds to a\n // widget/mark/node.\n matchesWidget(widget) { return false; }\n matchesMark(mark) { return false; }\n matchesNode(node, outerDeco, innerDeco) { return false; }\n matchesHack(nodeName) { return false; }\n // When parsing in-editor content (in domchange.js), we allow\n // descriptions to determine the parse rules that should be used to\n // parse them.\n parseRule() { return null; }\n // Used by the editor's event handler to ignore events that come\n // from certain descs.\n stopEvent(event) { return false; }\n // The size of the content represented by this desc.\n get size() {\n let size = 0;\n for (let i = 0; i < this.children.length; i++)\n size += this.children[i].size;\n return size;\n }\n // For block nodes, this represents the space taken up by their\n // start/end tokens.\n get border() { return 0; }\n destroy() {\n this.parent = undefined;\n if (this.dom.pmViewDesc == this)\n this.dom.pmViewDesc = undefined;\n for (let i = 0; i < this.children.length; i++)\n this.children[i].destroy();\n }\n posBeforeChild(child) {\n for (let i = 0, pos = this.posAtStart;; i++) {\n let cur = this.children[i];\n if (cur == child)\n return pos;\n pos += cur.size;\n }\n }\n get posBefore() {\n return this.parent.posBeforeChild(this);\n }\n get posAtStart() {\n return this.parent ? this.parent.posBeforeChild(this) + this.border : 0;\n }\n get posAfter() {\n return this.posBefore + this.size;\n }\n get posAtEnd() {\n return this.posAtStart + this.size - 2 * this.border;\n }\n localPosFromDOM(dom, offset, bias) {\n // If the DOM position is in the content, use the child desc after\n // it to figure out a position.\n if (this.contentDOM && this.contentDOM.contains(dom.nodeType == 1 ? dom : dom.parentNode)) {\n if (bias < 0) {\n let domBefore, desc;\n if (dom == this.contentDOM) {\n domBefore = dom.childNodes[offset - 1];\n }\n else {\n while (dom.parentNode != this.contentDOM)\n dom = dom.parentNode;\n domBefore = dom.previousSibling;\n }\n while (domBefore && !((desc = domBefore.pmViewDesc) && desc.parent == this))\n domBefore = domBefore.previousSibling;\n return domBefore ? this.posBeforeChild(desc) + desc.size : this.posAtStart;\n }\n else {\n let domAfter, desc;\n if (dom == this.contentDOM) {\n domAfter = dom.childNodes[offset];\n }\n else {\n while (dom.parentNode != this.contentDOM)\n dom = dom.parentNode;\n domAfter = dom.nextSibling;\n }\n while (domAfter && !((desc = domAfter.pmViewDesc) && desc.parent == this))\n domAfter = domAfter.nextSibling;\n return domAfter ? this.posBeforeChild(desc) : this.posAtEnd;\n }\n }\n // Otherwise, use various heuristics, falling back on the bias\n // parameter, to determine whether to return the position at the\n // start or at the end of this view desc.\n let atEnd;\n if (dom == this.dom && this.contentDOM) {\n atEnd = offset > domIndex(this.contentDOM);\n }\n else if (this.contentDOM && this.contentDOM != this.dom && this.dom.contains(this.contentDOM)) {\n atEnd = dom.compareDocumentPosition(this.contentDOM) & 2;\n }\n else if (this.dom.firstChild) {\n if (offset == 0)\n for (let search = dom;; search = search.parentNode) {\n if (search == this.dom) {\n atEnd = false;\n break;\n }\n if (search.previousSibling)\n break;\n }\n if (atEnd == null && offset == dom.childNodes.length)\n for (let search = dom;; search = search.parentNode) {\n if (search == this.dom) {\n atEnd = true;\n break;\n }\n if (search.nextSibling)\n break;\n }\n }\n return (atEnd == null ? bias > 0 : atEnd) ? this.posAtEnd : this.posAtStart;\n }\n nearestDesc(dom, onlyNodes = false) {\n for (let first = true, cur = dom; cur; cur = cur.parentNode) {\n let desc = this.getDesc(cur), nodeDOM;\n if (desc && (!onlyNodes || desc.node)) {\n // If dom is outside of this desc's nodeDOM, don't count it.\n if (first && (nodeDOM = desc.nodeDOM) &&\n !(nodeDOM.nodeType == 1 ? nodeDOM.contains(dom.nodeType == 1 ? dom : dom.parentNode) : nodeDOM == dom))\n first = false;\n else\n return desc;\n }\n }\n }\n getDesc(dom) {\n let desc = dom.pmViewDesc;\n for (let cur = desc; cur; cur = cur.parent)\n if (cur == this)\n return desc;\n }\n posFromDOM(dom, offset, bias) {\n for (let scan = dom; scan; scan = scan.parentNode) {\n let desc = this.getDesc(scan);\n if (desc)\n return desc.localPosFromDOM(dom, offset, bias);\n }\n return -1;\n }\n // Find the desc for the node after the given pos, if any. (When a\n // parent node overrode rendering, there might not be one.)\n descAt(pos) {\n for (let i = 0, offset = 0; i < this.children.length; i++) {\n let child = this.children[i], end = offset + child.size;\n if (offset == pos && end != offset) {\n while (!child.border && child.children.length)\n child = child.children[0];\n return child;\n }\n if (pos < end)\n return child.descAt(pos - offset - child.border);\n offset = end;\n }\n }\n domFromPos(pos, side) {\n if (!this.contentDOM)\n return { node: this.dom, offset: 0, atom: pos + 1 };\n // First find the position in the child array\n let i = 0, offset = 0;\n for (let curPos = 0; i < this.children.length; i++) {\n let child = this.children[i], end = curPos + child.size;\n if (end > pos || child instanceof TrailingHackViewDesc) {\n offset = pos - curPos;\n break;\n }\n curPos = end;\n }\n // If this points into the middle of a child, call through\n if (offset)\n return this.children[i].domFromPos(offset - this.children[i].border, side);\n // Go back if there were any zero-length widgets with side >= 0 before this point\n for (let prev; i && !(prev = this.children[i - 1]).size && prev instanceof WidgetViewDesc && prev.side >= 0; i--) { }\n // Scan towards the first useable node\n if (side <= 0) {\n let prev, enter = true;\n for (;; i--, enter = false) {\n prev = i ? this.children[i - 1] : null;\n if (!prev || prev.dom.parentNode == this.contentDOM)\n break;\n }\n if (prev && side && enter && !prev.border && !prev.domAtom)\n return prev.domFromPos(prev.size, side);\n return { node: this.contentDOM, offset: prev ? domIndex(prev.dom) + 1 : 0 };\n }\n else {\n let next, enter = true;\n for (;; i++, enter = false) {\n next = i < this.children.length ? this.children[i] : null;\n if (!next || next.dom.parentNode == this.contentDOM)\n break;\n }\n if (next && enter && !next.border && !next.domAtom)\n return next.domFromPos(0, side);\n return { node: this.contentDOM, offset: next ? domIndex(next.dom) : this.contentDOM.childNodes.length };\n }\n }\n // Used to find a DOM range in a single parent for a given changed\n // range.\n parseRange(from, to, base = 0) {\n if (this.children.length == 0)\n return { node: this.contentDOM, from, to, fromOffset: 0, toOffset: this.contentDOM.childNodes.length };\n let fromOffset = -1, toOffset = -1;\n for (let offset = base, i = 0;; i++) {\n let child = this.children[i], end = offset + child.size;\n if (fromOffset == -1 && from <= end) {\n let childBase = offset + child.border;\n // FIXME maybe descend mark views to parse a narrower range?\n if (from >= childBase && to <= end - child.border && child.node &&\n child.contentDOM && this.contentDOM.contains(child.contentDOM))\n return child.parseRange(from, to, childBase);\n from = offset;\n for (let j = i; j > 0; j--) {\n let prev = this.children[j - 1];\n if (prev.size && prev.dom.parentNode == this.contentDOM && !prev.emptyChildAt(1)) {\n fromOffset = domIndex(prev.dom) + 1;\n break;\n }\n from -= prev.size;\n }\n if (fromOffset == -1)\n fromOffset = 0;\n }\n if (fromOffset > -1 && (end > to || i == this.children.length - 1)) {\n to = end;\n for (let j = i + 1; j < this.children.length; j++) {\n let next = this.children[j];\n if (next.size && next.dom.parentNode == this.contentDOM && !next.emptyChildAt(-1)) {\n toOffset = domIndex(next.dom);\n break;\n }\n to += next.size;\n }\n if (toOffset == -1)\n toOffset = this.contentDOM.childNodes.length;\n break;\n }\n offset = end;\n }\n return { node: this.contentDOM, from, to, fromOffset, toOffset };\n }\n emptyChildAt(side) {\n if (this.border || !this.contentDOM || !this.children.length)\n return false;\n let child = this.children[side < 0 ? 0 : this.children.length - 1];\n return child.size == 0 || child.emptyChildAt(side);\n }\n domAfterPos(pos) {\n let { node, offset } = this.domFromPos(pos, 0);\n if (node.nodeType != 1 || offset == node.childNodes.length)\n throw new RangeError(\"No node after pos \" + pos);\n return node.childNodes[offset];\n }\n // View descs are responsible for setting any selection that falls\n // entirely inside of them, so that custom implementations can do\n // custom things with the selection. Note that this falls apart when\n // a selection starts in such a node and ends in another, in which\n // case we just use whatever domFromPos produces as a best effort.\n setSelection(anchor, head, root, force = false) {\n // If the selection falls entirely in a child, give it to that child\n let from = Math.min(anchor, head), to = Math.max(anchor, head);\n for (let i = 0, offset = 0; i < this.children.length; i++) {\n let child = this.children[i], end = offset + child.size;\n if (from > offset && to < end)\n return child.setSelection(anchor - offset - child.border, head - offset - child.border, root, force);\n offset = end;\n }\n let anchorDOM = this.domFromPos(anchor, anchor ? -1 : 1);\n let headDOM = head == anchor ? anchorDOM : this.domFromPos(head, head ? -1 : 1);\n let domSel = root.getSelection();\n let brKludge = false;\n // On Firefox, using Selection.collapse to put the cursor after a\n // BR node for some reason doesn't always work (#1073). On Safari,\n // the cursor sometimes inexplicable visually lags behind its\n // reported position in such situations (#1092).\n if ((gecko || safari) && anchor == head) {\n let { node, offset } = anchorDOM;\n if (node.nodeType == 3) {\n brKludge = !!(offset && node.nodeValue[offset - 1] == \"\\n\");\n // Issue #1128\n if (brKludge && offset == node.nodeValue.length) {\n for (let scan = node, after; scan; scan = scan.parentNode) {\n if (after = scan.nextSibling) {\n if (after.nodeName == \"BR\")\n anchorDOM = headDOM = { node: after.parentNode, offset: domIndex(after) + 1 };\n break;\n }\n let desc = scan.pmViewDesc;\n if (desc && desc.node && desc.node.isBlock)\n break;\n }\n }\n }\n else {\n let prev = node.childNodes[offset - 1];\n brKludge = prev && (prev.nodeName == \"BR\" || prev.contentEditable == \"false\");\n }\n }\n // Firefox can act strangely when the selection is in front of an\n // uneditable node. See #1163 and https://bugzilla.mozilla.org/show_bug.cgi?id=1709536\n if (gecko && domSel.focusNode && domSel.focusNode != headDOM.node && domSel.focusNode.nodeType == 1) {\n let after = domSel.focusNode.childNodes[domSel.focusOffset];\n if (after && after.contentEditable == \"false\")\n force = true;\n }\n if (!(force || brKludge && safari) &&\n isEquivalentPosition(anchorDOM.node, anchorDOM.offset, domSel.anchorNode, domSel.anchorOffset) &&\n isEquivalentPosition(headDOM.node, headDOM.offset, domSel.focusNode, domSel.focusOffset))\n return;\n // Selection.extend can be used to create an 'inverted' selection\n // (one where the focus is before the anchor), but not all\n // browsers support it yet.\n let domSelExtended = false;\n if ((domSel.extend || anchor == head) && !brKludge) {\n domSel.collapse(anchorDOM.node, anchorDOM.offset);\n try {\n if (anchor != head)\n domSel.extend(headDOM.node, headDOM.offset);\n domSelExtended = true;\n }\n catch (_) {\n // In some cases with Chrome the selection is empty after calling\n // collapse, even when it should be valid. This appears to be a bug, but\n // it is difficult to isolate. If this happens fallback to the old path\n // without using extend.\n // Similarly, this could crash on Safari if the editor is hidden, and\n // there was no selection.\n }\n }\n if (!domSelExtended) {\n if (anchor > head) {\n let tmp = anchorDOM;\n anchorDOM = headDOM;\n headDOM = tmp;\n }\n let range = document.createRange();\n range.setEnd(headDOM.node, headDOM.offset);\n range.setStart(anchorDOM.node, anchorDOM.offset);\n domSel.removeAllRanges();\n domSel.addRange(range);\n }\n }\n ignoreMutation(mutation) {\n return !this.contentDOM && mutation.type != \"selection\";\n }\n get contentLost() {\n return this.contentDOM && this.contentDOM != this.dom && !this.dom.contains(this.contentDOM);\n }\n // Remove a subtree of the element tree that has been touched\n // by a DOM change, so that the next update will redraw it.\n markDirty(from, to) {\n for (let offset = 0, i = 0; i < this.children.length; i++) {\n let child = this.children[i], end = offset + child.size;\n if (offset == end ? from <= end && to >= offset : from < end && to > offset) {\n let startInside = offset + child.border, endInside = end - child.border;\n if (from >= startInside && to <= endInside) {\n this.dirty = from == offset || to == end ? CONTENT_DIRTY : CHILD_DIRTY;\n if (from == startInside && to == endInside &&\n (child.contentLost || child.dom.parentNode != this.contentDOM))\n child.dirty = NODE_DIRTY;\n else\n child.markDirty(from - startInside, to - startInside);\n return;\n }\n else {\n child.dirty = child.dom == child.contentDOM && child.dom.parentNode == this.contentDOM && !child.children.length\n ? CONTENT_DIRTY : NODE_DIRTY;\n }\n }\n offset = end;\n }\n this.dirty = CONTENT_DIRTY;\n }\n markParentsDirty() {\n let level = 1;\n for (let node = this.parent; node; node = node.parent, level++) {\n let dirty = level == 1 ? CONTENT_DIRTY : CHILD_DIRTY;\n if (node.dirty < dirty)\n node.dirty = dirty;\n }\n }\n get domAtom() { return false; }\n get ignoreForCoords() { return false; }\n isText(text) { return false; }\n}\n// A widget desc represents a widget decoration, which is a DOM node\n// drawn between the document nodes.\nclass WidgetViewDesc extends ViewDesc {\n constructor(parent, widget, view, pos) {\n let self, dom = widget.type.toDOM;\n if (typeof dom == \"function\")\n dom = dom(view, () => {\n if (!self)\n return pos;\n if (self.parent)\n return self.parent.posBeforeChild(self);\n });\n if (!widget.type.spec.raw) {\n if (dom.nodeType != 1) {\n let wrap = document.createElement(\"span\");\n wrap.appendChild(dom);\n dom = wrap;\n }\n dom.contentEditable = \"false\";\n dom.classList.add(\"ProseMirror-widget\");\n }\n super(parent, [], dom, null);\n this.widget = widget;\n this.widget = widget;\n self = this;\n }\n matchesWidget(widget) {\n return this.dirty == NOT_DIRTY && widget.type.eq(this.widget.type);\n }\n parseRule() { return { ignore: true }; }\n stopEvent(event) {\n let stop = this.widget.spec.stopEvent;\n return stop ? stop(event) : false;\n }\n ignoreMutation(mutation) {\n return mutation.type != \"selection\" || this.widget.spec.ignoreSelection;\n }\n destroy() {\n this.widget.type.destroy(this.dom);\n super.destroy();\n }\n get domAtom() { return true; }\n get side() { return this.widget.type.side; }\n}\nclass CompositionViewDesc extends ViewDesc {\n constructor(parent, dom, textDOM, text) {\n super(parent, [], dom, null);\n this.textDOM = textDOM;\n this.text = text;\n }\n get size() { return this.text.length; }\n localPosFromDOM(dom, offset) {\n if (dom != this.textDOM)\n return this.posAtStart + (offset ? this.size : 0);\n return this.posAtStart + offset;\n }\n domFromPos(pos) {\n return { node: this.textDOM, offset: pos };\n }\n ignoreMutation(mut) {\n return mut.type === 'characterData' && mut.target.nodeValue == mut.oldValue;\n }\n}\n// A mark desc represents a mark. May have multiple children,\n// depending on how the mark is split. Note that marks are drawn using\n// a fixed nesting order, for simplicity and predictability, so in\n// some cases they will be split more often than would appear\n// necessary.\nclass MarkViewDesc extends ViewDesc {\n constructor(parent, mark, dom, contentDOM) {\n super(parent, [], dom, contentDOM);\n this.mark = mark;\n }\n static create(parent, mark, inline, view) {\n let custom = view.nodeViews[mark.type.name];\n let spec = custom && custom(mark, view, inline);\n if (!spec || !spec.dom)\n spec = DOMSerializer.renderSpec(document, mark.type.spec.toDOM(mark, inline), null, mark.attrs);\n return new MarkViewDesc(parent, mark, spec.dom, spec.contentDOM || spec.dom);\n }\n parseRule() {\n if ((this.dirty & NODE_DIRTY) || this.mark.type.spec.reparseInView)\n return null;\n return { mark: this.mark.type.name, attrs: this.mark.attrs, contentElement: this.contentDOM };\n }\n matchesMark(mark) { return this.dirty != NODE_DIRTY && this.mark.eq(mark); }\n markDirty(from, to) {\n super.markDirty(from, to);\n // Move dirty info to nearest node view\n if (this.dirty != NOT_DIRTY) {\n let parent = this.parent;\n while (!parent.node)\n parent = parent.parent;\n if (parent.dirty < this.dirty)\n parent.dirty = this.dirty;\n this.dirty = NOT_DIRTY;\n }\n }\n slice(from, to, view) {\n let copy = MarkViewDesc.create(this.parent, this.mark, true, view);\n let nodes = this.children, size = this.size;\n if (to < size)\n nodes = replaceNodes(nodes, to, size, view);\n if (from > 0)\n nodes = replaceNodes(nodes, 0, from, view);\n for (let i = 0; i < nodes.length; i++)\n nodes[i].parent = copy;\n copy.children = nodes;\n return copy;\n }\n}\n// Node view descs are the main, most common type of view desc, and\n// correspond to an actual node in the document. Unlike mark descs,\n// they populate their child array themselves.\nclass NodeViewDesc extends ViewDesc {\n constructor(parent, node, outerDeco, innerDeco, dom, contentDOM, nodeDOM, view, pos) {\n super(parent, [], dom, contentDOM);\n this.node = node;\n this.outerDeco = outerDeco;\n this.innerDeco = innerDeco;\n this.nodeDOM = nodeDOM;\n }\n // By default, a node is rendered using the `toDOM` method from the\n // node type spec. But client code can use the `nodeViews` spec to\n // supply a custom node view, which can influence various aspects of\n // the way the node works.\n //\n // (Using subclassing for this was intentionally decided against,\n // since it'd require exposing a whole slew of finicky\n // implementation details to the user code that they probably will\n // never need.)\n static create(parent, node, outerDeco, innerDeco, view, pos) {\n let custom = view.nodeViews[node.type.name], descObj;\n let spec = custom && custom(node, view, () => {\n // (This is a function that allows the custom view to find its\n // own position)\n if (!descObj)\n return pos;\n if (descObj.parent)\n return descObj.parent.posBeforeChild(descObj);\n }, outerDeco, innerDeco);\n let dom = spec && spec.dom, contentDOM = spec && spec.contentDOM;\n if (node.isText) {\n if (!dom)\n dom = document.createTextNode(node.text);\n else if (dom.nodeType != 3)\n throw new RangeError(\"Text must be rendered as a DOM text node\");\n }\n else if (!dom) {\n let spec = DOMSerializer.renderSpec(document, node.type.spec.toDOM(node), null, node.attrs);\n ({ dom, contentDOM } = spec);\n }\n if (!contentDOM && !node.isText && dom.nodeName != \"BR\") { // Chrome gets confused by
\n if (!dom.hasAttribute(\"contenteditable\"))\n dom.contentEditable = \"false\";\n if (node.type.spec.draggable)\n dom.draggable = true;\n }\n let nodeDOM = dom;\n dom = applyOuterDeco(dom, outerDeco, node);\n if (spec)\n return descObj = new CustomNodeViewDesc(parent, node, outerDeco, innerDeco, dom, contentDOM || null, nodeDOM, spec, view, pos + 1);\n else if (node.isText)\n return new TextViewDesc(parent, node, outerDeco, innerDeco, dom, nodeDOM, view);\n else\n return new NodeViewDesc(parent, node, outerDeco, innerDeco, dom, contentDOM || null, nodeDOM, view, pos + 1);\n }\n parseRule() {\n // Experimental kludge to allow opt-in re-parsing of nodes\n if (this.node.type.spec.reparseInView)\n return null;\n // FIXME the assumption that this can always return the current\n // attrs means that if the user somehow manages to change the\n // attrs in the dom, that won't be picked up. Not entirely sure\n // whether this is a problem\n let rule = { node: this.node.type.name, attrs: this.node.attrs };\n if (this.node.type.whitespace == \"pre\")\n rule.preserveWhitespace = \"full\";\n if (!this.contentDOM) {\n rule.getContent = () => this.node.content;\n }\n else if (!this.contentLost) {\n rule.contentElement = this.contentDOM;\n }\n else {\n // Chrome likes to randomly recreate parent nodes when\n // backspacing things. When that happens, this tries to find the\n // new parent.\n for (let i = this.children.length - 1; i >= 0; i--) {\n let child = this.children[i];\n if (this.dom.contains(child.dom.parentNode)) {\n rule.contentElement = child.dom.parentNode;\n break;\n }\n }\n if (!rule.contentElement)\n rule.getContent = () => Fragment.empty;\n }\n return rule;\n }\n matchesNode(node, outerDeco, innerDeco) {\n return this.dirty == NOT_DIRTY && node.eq(this.node) &&\n sameOuterDeco(outerDeco, this.outerDeco) && innerDeco.eq(this.innerDeco);\n }\n get size() { return this.node.nodeSize; }\n get border() { return this.node.isLeaf ? 0 : 1; }\n // Syncs `this.children` to match `this.node.content` and the local\n // decorations, possibly introducing nesting for marks. Then, in a\n // separate step, syncs the DOM inside `this.contentDOM` to\n // `this.children`.\n updateChildren(view, pos) {\n let inline = this.node.inlineContent, off = pos;\n let composition = view.composing ? this.localCompositionInfo(view, pos) : null;\n let localComposition = composition && composition.pos > -1 ? composition : null;\n let compositionInChild = composition && composition.pos < 0;\n let updater = new ViewTreeUpdater(this, localComposition && localComposition.node, view);\n iterDeco(this.node, this.innerDeco, (widget, i, insideNode) => {\n if (widget.spec.marks)\n updater.syncToMarks(widget.spec.marks, inline, view);\n else if (widget.type.side >= 0 && !insideNode)\n updater.syncToMarks(i == this.node.childCount ? Mark.none : this.node.child(i).marks, inline, view);\n // If the next node is a desc matching this widget, reuse it,\n // otherwise insert the widget as a new view desc.\n updater.placeWidget(widget, view, off);\n }, (child, outerDeco, innerDeco, i) => {\n // Make sure the wrapping mark descs match the node's marks.\n updater.syncToMarks(child.marks, inline, view);\n // Try several strategies for drawing this node\n let compIndex;\n if (updater.findNodeMatch(child, outerDeco, innerDeco, i)) ;\n else if (compositionInChild && view.state.selection.from > off &&\n view.state.selection.to < off + child.nodeSize &&\n (compIndex = updater.findIndexWithChild(composition.node)) > -1 &&\n updater.updateNodeAt(child, outerDeco, innerDeco, compIndex, view)) ;\n else if (updater.updateNextNode(child, outerDeco, innerDeco, view, i, off)) ;\n else {\n // Add it as a new view\n updater.addNode(child, outerDeco, innerDeco, view, off);\n }\n off += child.nodeSize;\n });\n // Drop all remaining descs after the current position.\n updater.syncToMarks([], inline, view);\n if (this.node.isTextblock)\n updater.addTextblockHacks();\n updater.destroyRest();\n // Sync the DOM if anything changed\n if (updater.changed || this.dirty == CONTENT_DIRTY) {\n // May have to protect focused DOM from being changed if a composition is active\n if (localComposition)\n this.protectLocalComposition(view, localComposition);\n renderDescs(this.contentDOM, this.children, view);\n if (ios)\n iosHacks(this.dom);\n }\n }\n localCompositionInfo(view, pos) {\n // Only do something if both the selection and a focused text node\n // are inside of this node\n let { from, to } = view.state.selection;\n if (!(view.state.selection instanceof TextSelection) || from < pos || to > pos + this.node.content.size)\n return null;\n let textNode = view.input.compositionNode;\n if (!textNode || !this.dom.contains(textNode.parentNode))\n return null;\n if (this.node.inlineContent) {\n // Find the text in the focused node in the node, stop if it's not\n // there (may have been modified through other means, in which\n // case it should overwritten)\n let text = textNode.nodeValue;\n let textPos = findTextInFragment(this.node.content, text, from - pos, to - pos);\n return textPos < 0 ? null : { node: textNode, pos: textPos, text };\n }\n else {\n return { node: textNode, pos: -1, text: \"\" };\n }\n }\n protectLocalComposition(view, { node, pos, text }) {\n // The node is already part of a local view desc, leave it there\n if (this.getDesc(node))\n return;\n // Create a composition view for the orphaned nodes\n let topNode = node;\n for (;; topNode = topNode.parentNode) {\n if (topNode.parentNode == this.contentDOM)\n break;\n while (topNode.previousSibling)\n topNode.parentNode.removeChild(topNode.previousSibling);\n while (topNode.nextSibling)\n topNode.parentNode.removeChild(topNode.nextSibling);\n if (topNode.pmViewDesc)\n topNode.pmViewDesc = undefined;\n }\n let desc = new CompositionViewDesc(this, topNode, node, text);\n view.input.compositionNodes.push(desc);\n // Patch up this.children to contain the composition view\n this.children = replaceNodes(this.children, pos, pos + text.length, view, desc);\n }\n // If this desc must be updated to match the given node decoration,\n // do so and return true.\n update(node, outerDeco, innerDeco, view) {\n if (this.dirty == NODE_DIRTY ||\n !node.sameMarkup(this.node))\n return false;\n this.updateInner(node, outerDeco, innerDeco, view);\n return true;\n }\n updateInner(node, outerDeco, innerDeco, view) {\n this.updateOuterDeco(outerDeco);\n this.node = node;\n this.innerDeco = innerDeco;\n if (this.contentDOM)\n this.updateChildren(view, this.posAtStart);\n this.dirty = NOT_DIRTY;\n }\n updateOuterDeco(outerDeco) {\n if (sameOuterDeco(outerDeco, this.outerDeco))\n return;\n let needsWrap = this.nodeDOM.nodeType != 1;\n let oldDOM = this.dom;\n this.dom = patchOuterDeco(this.dom, this.nodeDOM, computeOuterDeco(this.outerDeco, this.node, needsWrap), computeOuterDeco(outerDeco, this.node, needsWrap));\n if (this.dom != oldDOM) {\n oldDOM.pmViewDesc = undefined;\n this.dom.pmViewDesc = this;\n }\n this.outerDeco = outerDeco;\n }\n // Mark this node as being the selected node.\n selectNode() {\n if (this.nodeDOM.nodeType == 1)\n this.nodeDOM.classList.add(\"ProseMirror-selectednode\");\n if (this.contentDOM || !this.node.type.spec.draggable)\n this.dom.draggable = true;\n }\n // Remove selected node marking from this node.\n deselectNode() {\n if (this.nodeDOM.nodeType == 1) {\n this.nodeDOM.classList.remove(\"ProseMirror-selectednode\");\n if (this.contentDOM || !this.node.type.spec.draggable)\n this.dom.removeAttribute(\"draggable\");\n }\n }\n get domAtom() { return this.node.isAtom; }\n}\n// Create a view desc for the top-level document node, to be exported\n// and used by the view class.\nfunction docViewDesc(doc, outerDeco, innerDeco, dom, view) {\n applyOuterDeco(dom, outerDeco, doc);\n let docView = new NodeViewDesc(undefined, doc, outerDeco, innerDeco, dom, dom, dom, view, 0);\n if (docView.contentDOM)\n docView.updateChildren(view, 0);\n return docView;\n}\nclass TextViewDesc extends NodeViewDesc {\n constructor(parent, node, outerDeco, innerDeco, dom, nodeDOM, view) {\n super(parent, node, outerDeco, innerDeco, dom, null, nodeDOM, view, 0);\n }\n parseRule() {\n let skip = this.nodeDOM.parentNode;\n while (skip && skip != this.dom && !skip.pmIsDeco)\n skip = skip.parentNode;\n return { skip: (skip || true) };\n }\n update(node, outerDeco, innerDeco, view) {\n if (this.dirty == NODE_DIRTY || (this.dirty != NOT_DIRTY && !this.inParent()) ||\n !node.sameMarkup(this.node))\n return false;\n this.updateOuterDeco(outerDeco);\n if ((this.dirty != NOT_DIRTY || node.text != this.node.text) && node.text != this.nodeDOM.nodeValue) {\n this.nodeDOM.nodeValue = node.text;\n if (view.trackWrites == this.nodeDOM)\n view.trackWrites = null;\n }\n this.node = node;\n this.dirty = NOT_DIRTY;\n return true;\n }\n inParent() {\n let parentDOM = this.parent.contentDOM;\n for (let n = this.nodeDOM; n; n = n.parentNode)\n if (n == parentDOM)\n return true;\n return false;\n }\n domFromPos(pos) {\n return { node: this.nodeDOM, offset: pos };\n }\n localPosFromDOM(dom, offset, bias) {\n if (dom == this.nodeDOM)\n return this.posAtStart + Math.min(offset, this.node.text.length);\n return super.localPosFromDOM(dom, offset, bias);\n }\n ignoreMutation(mutation) {\n return mutation.type != \"characterData\" && mutation.type != \"selection\";\n }\n slice(from, to, view) {\n let node = this.node.cut(from, to), dom = document.createTextNode(node.text);\n return new TextViewDesc(this.parent, node, this.outerDeco, this.innerDeco, dom, dom, view);\n }\n markDirty(from, to) {\n super.markDirty(from, to);\n if (this.dom != this.nodeDOM && (from == 0 || to == this.nodeDOM.nodeValue.length))\n this.dirty = NODE_DIRTY;\n }\n get domAtom() { return false; }\n isText(text) { return this.node.text == text; }\n}\n// A dummy desc used to tag trailing BR or IMG nodes created to work\n// around contentEditable terribleness.\nclass TrailingHackViewDesc extends ViewDesc {\n parseRule() { return { ignore: true }; }\n matchesHack(nodeName) { return this.dirty == NOT_DIRTY && this.dom.nodeName == nodeName; }\n get domAtom() { return true; }\n get ignoreForCoords() { return this.dom.nodeName == \"IMG\"; }\n}\n// A separate subclass is used for customized node views, so that the\n// extra checks only have to be made for nodes that are actually\n// customized.\nclass CustomNodeViewDesc extends NodeViewDesc {\n constructor(parent, node, outerDeco, innerDeco, dom, contentDOM, nodeDOM, spec, view, pos) {\n super(parent, node, outerDeco, innerDeco, dom, contentDOM, nodeDOM, view, pos);\n this.spec = spec;\n }\n // A custom `update` method gets to decide whether the update goes\n // through. If it does, and there's a `contentDOM` node, our logic\n // updates the children.\n update(node, outerDeco, innerDeco, view) {\n if (this.dirty == NODE_DIRTY)\n return false;\n if (this.spec.update) {\n let result = this.spec.update(node, outerDeco, innerDeco);\n if (result)\n this.updateInner(node, outerDeco, innerDeco, view);\n return result;\n }\n else if (!this.contentDOM && !node.isLeaf) {\n return false;\n }\n else {\n return super.update(node, outerDeco, innerDeco, view);\n }\n }\n selectNode() {\n this.spec.selectNode ? this.spec.selectNode() : super.selectNode();\n }\n deselectNode() {\n this.spec.deselectNode ? this.spec.deselectNode() : super.deselectNode();\n }\n setSelection(anchor, head, root, force) {\n this.spec.setSelection ? this.spec.setSelection(anchor, head, root)\n : super.setSelection(anchor, head, root, force);\n }\n destroy() {\n if (this.spec.destroy)\n this.spec.destroy();\n super.destroy();\n }\n stopEvent(event) {\n return this.spec.stopEvent ? this.spec.stopEvent(event) : false;\n }\n ignoreMutation(mutation) {\n return this.spec.ignoreMutation ? this.spec.ignoreMutation(mutation) : super.ignoreMutation(mutation);\n }\n}\n// Sync the content of the given DOM node with the nodes associated\n// with the given array of view descs, recursing into mark descs\n// because this should sync the subtree for a whole node at a time.\nfunction renderDescs(parentDOM, descs, view) {\n let dom = parentDOM.firstChild, written = false;\n for (let i = 0; i < descs.length; i++) {\n let desc = descs[i], childDOM = desc.dom;\n if (childDOM.parentNode == parentDOM) {\n while (childDOM != dom) {\n dom = rm(dom);\n written = true;\n }\n dom = dom.nextSibling;\n }\n else {\n written = true;\n parentDOM.insertBefore(childDOM, dom);\n }\n if (desc instanceof MarkViewDesc) {\n let pos = dom ? dom.previousSibling : parentDOM.lastChild;\n renderDescs(desc.contentDOM, desc.children, view);\n dom = pos ? pos.nextSibling : parentDOM.firstChild;\n }\n }\n while (dom) {\n dom = rm(dom);\n written = true;\n }\n if (written && view.trackWrites == parentDOM)\n view.trackWrites = null;\n}\nconst OuterDecoLevel = function (nodeName) {\n if (nodeName)\n this.nodeName = nodeName;\n};\nOuterDecoLevel.prototype = Object.create(null);\nconst noDeco = [new OuterDecoLevel];\nfunction computeOuterDeco(outerDeco, node, needsWrap) {\n if (outerDeco.length == 0)\n return noDeco;\n let top = needsWrap ? noDeco[0] : new OuterDecoLevel, result = [top];\n for (let i = 0; i < outerDeco.length; i++) {\n let attrs = outerDeco[i].type.attrs;\n if (!attrs)\n continue;\n if (attrs.nodeName)\n result.push(top = new OuterDecoLevel(attrs.nodeName));\n for (let name in attrs) {\n let val = attrs[name];\n if (val == null)\n continue;\n if (needsWrap && result.length == 1)\n result.push(top = new OuterDecoLevel(node.isInline ? \"span\" : \"div\"));\n if (name == \"class\")\n top.class = (top.class ? top.class + \" \" : \"\") + val;\n else if (name == \"style\")\n top.style = (top.style ? top.style + \";\" : \"\") + val;\n else if (name != \"nodeName\")\n top[name] = val;\n }\n }\n return result;\n}\nfunction patchOuterDeco(outerDOM, nodeDOM, prevComputed, curComputed) {\n // Shortcut for trivial case\n if (prevComputed == noDeco && curComputed == noDeco)\n return nodeDOM;\n let curDOM = nodeDOM;\n for (let i = 0; i < curComputed.length; i++) {\n let deco = curComputed[i], prev = prevComputed[i];\n if (i) {\n let parent;\n if (prev && prev.nodeName == deco.nodeName && curDOM != outerDOM &&\n (parent = curDOM.parentNode) && parent.nodeName.toLowerCase() == deco.nodeName) {\n curDOM = parent;\n }\n else {\n parent = document.createElement(deco.nodeName);\n parent.pmIsDeco = true;\n parent.appendChild(curDOM);\n prev = noDeco[0];\n curDOM = parent;\n }\n }\n patchAttributes(curDOM, prev || noDeco[0], deco);\n }\n return curDOM;\n}\nfunction patchAttributes(dom, prev, cur) {\n for (let name in prev)\n if (name != \"class\" && name != \"style\" && name != \"nodeName\" && !(name in cur))\n dom.removeAttribute(name);\n for (let name in cur)\n if (name != \"class\" && name != \"style\" && name != \"nodeName\" && cur[name] != prev[name])\n dom.setAttribute(name, cur[name]);\n if (prev.class != cur.class) {\n let prevList = prev.class ? prev.class.split(\" \").filter(Boolean) : [];\n let curList = cur.class ? cur.class.split(\" \").filter(Boolean) : [];\n for (let i = 0; i < prevList.length; i++)\n if (curList.indexOf(prevList[i]) == -1)\n dom.classList.remove(prevList[i]);\n for (let i = 0; i < curList.length; i++)\n if (prevList.indexOf(curList[i]) == -1)\n dom.classList.add(curList[i]);\n if (dom.classList.length == 0)\n dom.removeAttribute(\"class\");\n }\n if (prev.style != cur.style) {\n if (prev.style) {\n let prop = /\\s*([\\w\\-\\xa1-\\uffff]+)\\s*:(?:\"(?:\\\\.|[^\"])*\"|'(?:\\\\.|[^'])*'|\\(.*?\\)|[^;])*/g, m;\n while (m = prop.exec(prev.style))\n dom.style.removeProperty(m[1]);\n }\n if (cur.style)\n dom.style.cssText += cur.style;\n }\n}\nfunction applyOuterDeco(dom, deco, node) {\n return patchOuterDeco(dom, dom, noDeco, computeOuterDeco(deco, node, dom.nodeType != 1));\n}\nfunction sameOuterDeco(a, b) {\n if (a.length != b.length)\n return false;\n for (let i = 0; i < a.length; i++)\n if (!a[i].type.eq(b[i].type))\n return false;\n return true;\n}\n// Remove a DOM node and return its next sibling.\nfunction rm(dom) {\n let next = dom.nextSibling;\n dom.parentNode.removeChild(dom);\n return next;\n}\n// Helper class for incrementally updating a tree of mark descs and\n// the widget and node descs inside of them.\nclass ViewTreeUpdater {\n constructor(top, lock, view) {\n this.lock = lock;\n this.view = view;\n // Index into `this.top`'s child array, represents the current\n // update position.\n this.index = 0;\n // When entering a mark, the current top and index are pushed\n // onto this.\n this.stack = [];\n // Tracks whether anything was changed\n this.changed = false;\n this.top = top;\n this.preMatch = preMatch(top.node.content, top);\n }\n // Destroy and remove the children between the given indices in\n // `this.top`.\n destroyBetween(start, end) {\n if (start == end)\n return;\n for (let i = start; i < end; i++)\n this.top.children[i].destroy();\n this.top.children.splice(start, end - start);\n this.changed = true;\n }\n // Destroy all remaining children in `this.top`.\n destroyRest() {\n this.destroyBetween(this.index, this.top.children.length);\n }\n // Sync the current stack of mark descs with the given array of\n // marks, reusing existing mark descs when possible.\n syncToMarks(marks, inline, view) {\n let keep = 0, depth = this.stack.length >> 1;\n let maxKeep = Math.min(depth, marks.length);\n while (keep < maxKeep &&\n (keep == depth - 1 ? this.top : this.stack[(keep + 1) << 1])\n .matchesMark(marks[keep]) && marks[keep].type.spec.spanning !== false)\n keep++;\n while (keep < depth) {\n this.destroyRest();\n this.top.dirty = NOT_DIRTY;\n this.index = this.stack.pop();\n this.top = this.stack.pop();\n depth--;\n }\n while (depth < marks.length) {\n this.stack.push(this.top, this.index + 1);\n let found = -1;\n for (let i = this.index; i < Math.min(this.index + 3, this.top.children.length); i++) {\n let next = this.top.children[i];\n if (next.matchesMark(marks[depth]) && !this.isLocked(next.dom)) {\n found = i;\n break;\n }\n }\n if (found > -1) {\n if (found > this.index) {\n this.changed = true;\n this.destroyBetween(this.index, found);\n }\n this.top = this.top.children[this.index];\n }\n else {\n let markDesc = MarkViewDesc.create(this.top, marks[depth], inline, view);\n this.top.children.splice(this.index, 0, markDesc);\n this.top = markDesc;\n this.changed = true;\n }\n this.index = 0;\n depth++;\n }\n }\n // Try to find a node desc matching the given data. Skip over it and\n // return true when successful.\n findNodeMatch(node, outerDeco, innerDeco, index) {\n let found = -1, targetDesc;\n if (index >= this.preMatch.index &&\n (targetDesc = this.preMatch.matches[index - this.preMatch.index]).parent == this.top &&\n targetDesc.matchesNode(node, outerDeco, innerDeco)) {\n found = this.top.children.indexOf(targetDesc, this.index);\n }\n else {\n for (let i = this.index, e = Math.min(this.top.children.length, i + 5); i < e; i++) {\n let child = this.top.children[i];\n if (child.matchesNode(node, outerDeco, innerDeco) && !this.preMatch.matched.has(child)) {\n found = i;\n break;\n }\n }\n }\n if (found < 0)\n return false;\n this.destroyBetween(this.index, found);\n this.index++;\n return true;\n }\n updateNodeAt(node, outerDeco, innerDeco, index, view) {\n let child = this.top.children[index];\n if (child.dirty == NODE_DIRTY && child.dom == child.contentDOM)\n child.dirty = CONTENT_DIRTY;\n if (!child.update(node, outerDeco, innerDeco, view))\n return false;\n this.destroyBetween(this.index, index);\n this.index++;\n return true;\n }\n findIndexWithChild(domNode) {\n for (;;) {\n let parent = domNode.parentNode;\n if (!parent)\n return -1;\n if (parent == this.top.contentDOM) {\n let desc = domNode.pmViewDesc;\n if (desc)\n for (let i = this.index; i < this.top.children.length; i++) {\n if (this.top.children[i] == desc)\n return i;\n }\n return -1;\n }\n domNode = parent;\n }\n }\n // Try to update the next node, if any, to the given data. Checks\n // pre-matches to avoid overwriting nodes that could still be used.\n updateNextNode(node, outerDeco, innerDeco, view, index, pos) {\n for (let i = this.index; i < this.top.children.length; i++) {\n let next = this.top.children[i];\n if (next instanceof NodeViewDesc) {\n let preMatch = this.preMatch.matched.get(next);\n if (preMatch != null && preMatch != index)\n return false;\n let nextDOM = next.dom, updated;\n // Can't update if nextDOM is or contains this.lock, except if\n // it's a text node whose content already matches the new text\n // and whose decorations match the new ones.\n let locked = this.isLocked(nextDOM) &&\n !(node.isText && next.node && next.node.isText && next.nodeDOM.nodeValue == node.text &&\n next.dirty != NODE_DIRTY && sameOuterDeco(outerDeco, next.outerDeco));\n if (!locked && next.update(node, outerDeco, innerDeco, view)) {\n this.destroyBetween(this.index, i);\n if (next.dom != nextDOM)\n this.changed = true;\n this.index++;\n return true;\n }\n else if (!locked && (updated = this.recreateWrapper(next, node, outerDeco, innerDeco, view, pos))) {\n this.top.children[this.index] = updated;\n if (updated.contentDOM) {\n updated.dirty = CONTENT_DIRTY;\n updated.updateChildren(view, pos + 1);\n updated.dirty = NOT_DIRTY;\n }\n this.changed = true;\n this.index++;\n return true;\n }\n break;\n }\n }\n return false;\n }\n // When a node with content is replaced by a different node with\n // identical content, move over its children.\n recreateWrapper(next, node, outerDeco, innerDeco, view, pos) {\n if (next.dirty || node.isAtom || !next.children.length ||\n !next.node.content.eq(node.content))\n return null;\n let wrapper = NodeViewDesc.create(this.top, node, outerDeco, innerDeco, view, pos);\n if (wrapper.contentDOM) {\n wrapper.children = next.children;\n next.children = [];\n for (let ch of wrapper.children)\n ch.parent = wrapper;\n }\n next.destroy();\n return wrapper;\n }\n // Insert the node as a newly created node desc.\n addNode(node, outerDeco, innerDeco, view, pos) {\n let desc = NodeViewDesc.create(this.top, node, outerDeco, innerDeco, view, pos);\n if (desc.contentDOM)\n desc.updateChildren(view, pos + 1);\n this.top.children.splice(this.index++, 0, desc);\n this.changed = true;\n }\n placeWidget(widget, view, pos) {\n let next = this.index < this.top.children.length ? this.top.children[this.index] : null;\n if (next && next.matchesWidget(widget) &&\n (widget == next.widget || !next.widget.type.toDOM.parentNode)) {\n this.index++;\n }\n else {\n let desc = new WidgetViewDesc(this.top, widget, view, pos);\n this.top.children.splice(this.index++, 0, desc);\n this.changed = true;\n }\n }\n // Make sure a textblock looks and behaves correctly in\n // contentEditable.\n addTextblockHacks() {\n let lastChild = this.top.children[this.index - 1], parent = this.top;\n while (lastChild instanceof MarkViewDesc) {\n parent = lastChild;\n lastChild = parent.children[parent.children.length - 1];\n }\n if (!lastChild || // Empty textblock\n !(lastChild instanceof TextViewDesc) ||\n /\\n$/.test(lastChild.node.text) ||\n (this.view.requiresGeckoHackNode && /\\s$/.test(lastChild.node.text))) {\n // Avoid bugs in Safari's cursor drawing (#1165) and Chrome's mouse selection (#1152)\n if ((safari || chrome) && lastChild && lastChild.dom.contentEditable == \"false\")\n this.addHackNode(\"IMG\", parent);\n this.addHackNode(\"BR\", this.top);\n }\n }\n addHackNode(nodeName, parent) {\n if (parent == this.top && this.index < parent.children.length && parent.children[this.index].matchesHack(nodeName)) {\n this.index++;\n }\n else {\n let dom = document.createElement(nodeName);\n if (nodeName == \"IMG\") {\n dom.className = \"ProseMirror-separator\";\n dom.alt = \"\";\n }\n if (nodeName == \"BR\")\n dom.className = \"ProseMirror-trailingBreak\";\n let hack = new TrailingHackViewDesc(this.top, [], dom, null);\n if (parent != this.top)\n parent.children.push(hack);\n else\n parent.children.splice(this.index++, 0, hack);\n this.changed = true;\n }\n }\n isLocked(node) {\n return this.lock && (node == this.lock || node.nodeType == 1 && node.contains(this.lock.parentNode));\n }\n}\n// Iterate from the end of the fragment and array of descs to find\n// directly matching ones, in order to avoid overeagerly reusing those\n// for other nodes. Returns the fragment index of the first node that\n// is part of the sequence of matched nodes at the end of the\n// fragment.\nfunction preMatch(frag, parentDesc) {\n let curDesc = parentDesc, descI = curDesc.children.length;\n let fI = frag.childCount, matched = new Map, matches = [];\n outer: while (fI > 0) {\n let desc;\n for (;;) {\n if (descI) {\n let next = curDesc.children[descI - 1];\n if (next instanceof MarkViewDesc) {\n curDesc = next;\n descI = next.children.length;\n }\n else {\n desc = next;\n descI--;\n break;\n }\n }\n else if (curDesc == parentDesc) {\n break outer;\n }\n else {\n // FIXME\n descI = curDesc.parent.children.indexOf(curDesc);\n curDesc = curDesc.parent;\n }\n }\n let node = desc.node;\n if (!node)\n continue;\n if (node != frag.child(fI - 1))\n break;\n --fI;\n matched.set(desc, fI);\n matches.push(desc);\n }\n return { index: fI, matched, matches: matches.reverse() };\n}\nfunction compareSide(a, b) {\n return a.type.side - b.type.side;\n}\n// This function abstracts iterating over the nodes and decorations in\n// a fragment. Calls `onNode` for each node, with its local and child\n// decorations. Splits text nodes when there is a decoration starting\n// or ending inside of them. Calls `onWidget` for each widget.\nfunction iterDeco(parent, deco, onWidget, onNode) {\n let locals = deco.locals(parent), offset = 0;\n // Simple, cheap variant for when there are no local decorations\n if (locals.length == 0) {\n for (let i = 0; i < parent.childCount; i++) {\n let child = parent.child(i);\n onNode(child, locals, deco.forChild(offset, child), i);\n offset += child.nodeSize;\n }\n return;\n }\n let decoIndex = 0, active = [], restNode = null;\n for (let parentIndex = 0;;) {\n let widget, widgets;\n while (decoIndex < locals.length && locals[decoIndex].to == offset) {\n let next = locals[decoIndex++];\n if (next.widget) {\n if (!widget)\n widget = next;\n else\n (widgets || (widgets = [widget])).push(next);\n }\n }\n if (widget) {\n if (widgets) {\n widgets.sort(compareSide);\n for (let i = 0; i < widgets.length; i++)\n onWidget(widgets[i], parentIndex, !!restNode);\n }\n else {\n onWidget(widget, parentIndex, !!restNode);\n }\n }\n let child, index;\n if (restNode) {\n index = -1;\n child = restNode;\n restNode = null;\n }\n else if (parentIndex < parent.childCount) {\n index = parentIndex;\n child = parent.child(parentIndex++);\n }\n else {\n break;\n }\n for (let i = 0; i < active.length; i++)\n if (active[i].to <= offset)\n active.splice(i--, 1);\n while (decoIndex < locals.length && locals[decoIndex].from <= offset && locals[decoIndex].to > offset)\n active.push(locals[decoIndex++]);\n let end = offset + child.nodeSize;\n if (child.isText) {\n let cutAt = end;\n if (decoIndex < locals.length && locals[decoIndex].from < cutAt)\n cutAt = locals[decoIndex].from;\n for (let i = 0; i < active.length; i++)\n if (active[i].to < cutAt)\n cutAt = active[i].to;\n if (cutAt < end) {\n restNode = child.cut(cutAt - offset);\n child = child.cut(0, cutAt - offset);\n end = cutAt;\n index = -1;\n }\n }\n else {\n while (decoIndex < locals.length && locals[decoIndex].to < end)\n decoIndex++;\n }\n let outerDeco = child.isInline && !child.isLeaf ? active.filter(d => !d.inline) : active.slice();\n onNode(child, outerDeco, deco.forChild(offset, child), index);\n offset = end;\n }\n}\n// List markers in Mobile Safari will mysteriously disappear\n// sometimes. This works around that.\nfunction iosHacks(dom) {\n if (dom.nodeName == \"UL\" || dom.nodeName == \"OL\") {\n let oldCSS = dom.style.cssText;\n dom.style.cssText = oldCSS + \"; list-style: square !important\";\n window.getComputedStyle(dom).listStyle;\n dom.style.cssText = oldCSS;\n }\n}\n// Find a piece of text in an inline fragment, overlapping from-to\nfunction findTextInFragment(frag, text, from, to) {\n for (let i = 0, pos = 0; i < frag.childCount && pos <= to;) {\n let child = frag.child(i++), childStart = pos;\n pos += child.nodeSize;\n if (!child.isText)\n continue;\n let str = child.text;\n while (i < frag.childCount) {\n let next = frag.child(i++);\n pos += next.nodeSize;\n if (!next.isText)\n break;\n str += next.text;\n }\n if (pos >= from) {\n if (pos >= to && str.slice(to - text.length - childStart, to - childStart) == text)\n return to - text.length;\n let found = childStart < to ? str.lastIndexOf(text, to - childStart - 1) : -1;\n if (found >= 0 && found + text.length + childStart >= from)\n return childStart + found;\n if (from == to && str.length >= (to + text.length) - childStart &&\n str.slice(to - childStart, to - childStart + text.length) == text)\n return to;\n }\n }\n return -1;\n}\n// Replace range from-to in an array of view descs with replacement\n// (may be null to just delete). This goes very much against the grain\n// of the rest of this code, which tends to create nodes with the\n// right shape in one go, rather than messing with them after\n// creation, but is necessary in the composition hack.\nfunction replaceNodes(nodes, from, to, view, replacement) {\n let result = [];\n for (let i = 0, off = 0; i < nodes.length; i++) {\n let child = nodes[i], start = off, end = off += child.size;\n if (start >= to || end <= from) {\n result.push(child);\n }\n else {\n if (start < from)\n result.push(child.slice(0, from - start, view));\n if (replacement) {\n result.push(replacement);\n replacement = undefined;\n }\n if (end > to)\n result.push(child.slice(to - start, child.size, view));\n }\n }\n return result;\n}\n\nfunction selectionFromDOM(view, origin = null) {\n let domSel = view.domSelectionRange(), doc = view.state.doc;\n if (!domSel.focusNode)\n return null;\n let nearestDesc = view.docView.nearestDesc(domSel.focusNode), inWidget = nearestDesc && nearestDesc.size == 0;\n let head = view.docView.posFromDOM(domSel.focusNode, domSel.focusOffset, 1);\n if (head < 0)\n return null;\n let $head = doc.resolve(head), $anchor, selection;\n if (selectionCollapsed(domSel)) {\n $anchor = $head;\n while (nearestDesc && !nearestDesc.node)\n nearestDesc = nearestDesc.parent;\n let nearestDescNode = nearestDesc.node;\n if (nearestDesc && nearestDescNode.isAtom && NodeSelection.isSelectable(nearestDescNode) && nearestDesc.parent\n && !(nearestDescNode.isInline && isOnEdge(domSel.focusNode, domSel.focusOffset, nearestDesc.dom))) {\n let pos = nearestDesc.posBefore;\n selection = new NodeSelection(head == pos ? $head : doc.resolve(pos));\n }\n }\n else {\n let anchor = view.docView.posFromDOM(domSel.anchorNode, domSel.anchorOffset, 1);\n if (anchor < 0)\n return null;\n $anchor = doc.resolve(anchor);\n }\n if (!selection) {\n let bias = origin == \"pointer\" || (view.state.selection.head < $head.pos && !inWidget) ? 1 : -1;\n selection = selectionBetween(view, $anchor, $head, bias);\n }\n return selection;\n}\nfunction editorOwnsSelection(view) {\n return view.editable ? view.hasFocus() :\n hasSelection(view) && document.activeElement && document.activeElement.contains(view.dom);\n}\nfunction selectionToDOM(view, force = false) {\n let sel = view.state.selection;\n syncNodeSelection(view, sel);\n if (!editorOwnsSelection(view))\n return;\n // The delayed drag selection causes issues with Cell Selections\n // in Safari. And the drag selection delay is to workarond issues\n // which only present in Chrome.\n if (!force && view.input.mouseDown && view.input.mouseDown.allowDefault && chrome) {\n let domSel = view.domSelectionRange(), curSel = view.domObserver.currentSelection;\n if (domSel.anchorNode && curSel.anchorNode &&\n isEquivalentPosition(domSel.anchorNode, domSel.anchorOffset, curSel.anchorNode, curSel.anchorOffset)) {\n view.input.mouseDown.delayedSelectionSync = true;\n view.domObserver.setCurSelection();\n return;\n }\n }\n view.domObserver.disconnectSelection();\n if (view.cursorWrapper) {\n selectCursorWrapper(view);\n }\n else {\n let { anchor, head } = sel, resetEditableFrom, resetEditableTo;\n if (brokenSelectBetweenUneditable && !(sel instanceof TextSelection)) {\n if (!sel.$from.parent.inlineContent)\n resetEditableFrom = temporarilyEditableNear(view, sel.from);\n if (!sel.empty && !sel.$from.parent.inlineContent)\n resetEditableTo = temporarilyEditableNear(view, sel.to);\n }\n view.docView.setSelection(anchor, head, view.root, force);\n if (brokenSelectBetweenUneditable) {\n if (resetEditableFrom)\n resetEditable(resetEditableFrom);\n if (resetEditableTo)\n resetEditable(resetEditableTo);\n }\n if (sel.visible) {\n view.dom.classList.remove(\"ProseMirror-hideselection\");\n }\n else {\n view.dom.classList.add(\"ProseMirror-hideselection\");\n if (\"onselectionchange\" in document)\n removeClassOnSelectionChange(view);\n }\n }\n view.domObserver.setCurSelection();\n view.domObserver.connectSelection();\n}\n// Kludge to work around Webkit not allowing a selection to start/end\n// between non-editable block nodes. We briefly make something\n// editable, set the selection, then set it uneditable again.\nconst brokenSelectBetweenUneditable = safari || chrome && chrome_version < 63;\nfunction temporarilyEditableNear(view, pos) {\n let { node, offset } = view.docView.domFromPos(pos, 0);\n let after = offset < node.childNodes.length ? node.childNodes[offset] : null;\n let before = offset ? node.childNodes[offset - 1] : null;\n if (safari && after && after.contentEditable == \"false\")\n return setEditable(after);\n if ((!after || after.contentEditable == \"false\") &&\n (!before || before.contentEditable == \"false\")) {\n if (after)\n return setEditable(after);\n else if (before)\n return setEditable(before);\n }\n}\nfunction setEditable(element) {\n element.contentEditable = \"true\";\n if (safari && element.draggable) {\n element.draggable = false;\n element.wasDraggable = true;\n }\n return element;\n}\nfunction resetEditable(element) {\n element.contentEditable = \"false\";\n if (element.wasDraggable) {\n element.draggable = true;\n element.wasDraggable = null;\n }\n}\nfunction removeClassOnSelectionChange(view) {\n let doc = view.dom.ownerDocument;\n doc.removeEventListener(\"selectionchange\", view.input.hideSelectionGuard);\n let domSel = view.domSelectionRange();\n let node = domSel.anchorNode, offset = domSel.anchorOffset;\n doc.addEventListener(\"selectionchange\", view.input.hideSelectionGuard = () => {\n if (domSel.anchorNode != node || domSel.anchorOffset != offset) {\n doc.removeEventListener(\"selectionchange\", view.input.hideSelectionGuard);\n setTimeout(() => {\n if (!editorOwnsSelection(view) || view.state.selection.visible)\n view.dom.classList.remove(\"ProseMirror-hideselection\");\n }, 20);\n }\n });\n}\nfunction selectCursorWrapper(view) {\n let domSel = view.domSelection(), range = document.createRange();\n if (!domSel)\n return;\n let node = view.cursorWrapper.dom, img = node.nodeName == \"IMG\";\n if (img)\n range.setStart(node.parentNode, domIndex(node) + 1);\n else\n range.setStart(node, 0);\n range.collapse(true);\n domSel.removeAllRanges();\n domSel.addRange(range);\n // Kludge to kill 'control selection' in IE11 when selecting an\n // invisible cursor wrapper, since that would result in those weird\n // resize handles and a selection that considers the absolutely\n // positioned wrapper, rather than the root editable node, the\n // focused element.\n if (!img && !view.state.selection.visible && ie && ie_version <= 11) {\n node.disabled = true;\n node.disabled = false;\n }\n}\nfunction syncNodeSelection(view, sel) {\n if (sel instanceof NodeSelection) {\n let desc = view.docView.descAt(sel.from);\n if (desc != view.lastSelectedViewDesc) {\n clearNodeSelection(view);\n if (desc)\n desc.selectNode();\n view.lastSelectedViewDesc = desc;\n }\n }\n else {\n clearNodeSelection(view);\n }\n}\n// Clear all DOM statefulness of the last node selection.\nfunction clearNodeSelection(view) {\n if (view.lastSelectedViewDesc) {\n if (view.lastSelectedViewDesc.parent)\n view.lastSelectedViewDesc.deselectNode();\n view.lastSelectedViewDesc = undefined;\n }\n}\nfunction selectionBetween(view, $anchor, $head, bias) {\n return view.someProp(\"createSelectionBetween\", f => f(view, $anchor, $head))\n || TextSelection.between($anchor, $head, bias);\n}\nfunction hasFocusAndSelection(view) {\n if (view.editable && !view.hasFocus())\n return false;\n return hasSelection(view);\n}\nfunction hasSelection(view) {\n let sel = view.domSelectionRange();\n if (!sel.anchorNode)\n return false;\n try {\n // Firefox will raise 'permission denied' errors when accessing\n // properties of `sel.anchorNode` when it's in a generated CSS\n // element.\n return view.dom.contains(sel.anchorNode.nodeType == 3 ? sel.anchorNode.parentNode : sel.anchorNode) &&\n (view.editable || view.dom.contains(sel.focusNode.nodeType == 3 ? sel.focusNode.parentNode : sel.focusNode));\n }\n catch (_) {\n return false;\n }\n}\nfunction anchorInRightPlace(view) {\n let anchorDOM = view.docView.domFromPos(view.state.selection.anchor, 0);\n let domSel = view.domSelectionRange();\n return isEquivalentPosition(anchorDOM.node, anchorDOM.offset, domSel.anchorNode, domSel.anchorOffset);\n}\n\nfunction moveSelectionBlock(state, dir) {\n let { $anchor, $head } = state.selection;\n let $side = dir > 0 ? $anchor.max($head) : $anchor.min($head);\n let $start = !$side.parent.inlineContent ? $side : $side.depth ? state.doc.resolve(dir > 0 ? $side.after() : $side.before()) : null;\n return $start && Selection.findFrom($start, dir);\n}\nfunction apply(view, sel) {\n view.dispatch(view.state.tr.setSelection(sel).scrollIntoView());\n return true;\n}\nfunction selectHorizontally(view, dir, mods) {\n let sel = view.state.selection;\n if (sel instanceof TextSelection) {\n if (mods.indexOf(\"s\") > -1) {\n let { $head } = sel, node = $head.textOffset ? null : dir < 0 ? $head.nodeBefore : $head.nodeAfter;\n if (!node || node.isText || !node.isLeaf)\n return false;\n let $newHead = view.state.doc.resolve($head.pos + node.nodeSize * (dir < 0 ? -1 : 1));\n return apply(view, new TextSelection(sel.$anchor, $newHead));\n }\n else if (!sel.empty) {\n return false;\n }\n else if (view.endOfTextblock(dir > 0 ? \"forward\" : \"backward\")) {\n let next = moveSelectionBlock(view.state, dir);\n if (next && (next instanceof NodeSelection))\n return apply(view, next);\n return false;\n }\n else if (!(mac && mods.indexOf(\"m\") > -1)) {\n let $head = sel.$head, node = $head.textOffset ? null : dir < 0 ? $head.nodeBefore : $head.nodeAfter, desc;\n if (!node || node.isText)\n return false;\n let nodePos = dir < 0 ? $head.pos - node.nodeSize : $head.pos;\n if (!(node.isAtom || (desc = view.docView.descAt(nodePos)) && !desc.contentDOM))\n return false;\n if (NodeSelection.isSelectable(node)) {\n return apply(view, new NodeSelection(dir < 0 ? view.state.doc.resolve($head.pos - node.nodeSize) : $head));\n }\n else if (webkit) {\n // Chrome and Safari will introduce extra pointless cursor\n // positions around inline uneditable nodes, so we have to\n // take over and move the cursor past them (#937)\n return apply(view, new TextSelection(view.state.doc.resolve(dir < 0 ? nodePos : nodePos + node.nodeSize)));\n }\n else {\n return false;\n }\n }\n }\n else if (sel instanceof NodeSelection && sel.node.isInline) {\n return apply(view, new TextSelection(dir > 0 ? sel.$to : sel.$from));\n }\n else {\n let next = moveSelectionBlock(view.state, dir);\n if (next)\n return apply(view, next);\n return false;\n }\n}\nfunction nodeLen(node) {\n return node.nodeType == 3 ? node.nodeValue.length : node.childNodes.length;\n}\nfunction isIgnorable(dom, dir) {\n let desc = dom.pmViewDesc;\n return desc && desc.size == 0 && (dir < 0 || dom.nextSibling || dom.nodeName != \"BR\");\n}\nfunction skipIgnoredNodes(view, dir) {\n return dir < 0 ? skipIgnoredNodesBefore(view) : skipIgnoredNodesAfter(view);\n}\n// Make sure the cursor isn't directly after one or more ignored\n// nodes, which will confuse the browser's cursor motion logic.\nfunction skipIgnoredNodesBefore(view) {\n let sel = view.domSelectionRange();\n let node = sel.focusNode, offset = sel.focusOffset;\n if (!node)\n return;\n let moveNode, moveOffset, force = false;\n // Gecko will do odd things when the selection is directly in front\n // of a non-editable node, so in that case, move it into the next\n // node if possible. Issue prosemirror/prosemirror#832.\n if (gecko && node.nodeType == 1 && offset < nodeLen(node) && isIgnorable(node.childNodes[offset], -1))\n force = true;\n for (;;) {\n if (offset > 0) {\n if (node.nodeType != 1) {\n break;\n }\n else {\n let before = node.childNodes[offset - 1];\n if (isIgnorable(before, -1)) {\n moveNode = node;\n moveOffset = --offset;\n }\n else if (before.nodeType == 3) {\n node = before;\n offset = node.nodeValue.length;\n }\n else\n break;\n }\n }\n else if (isBlockNode(node)) {\n break;\n }\n else {\n let prev = node.previousSibling;\n while (prev && isIgnorable(prev, -1)) {\n moveNode = node.parentNode;\n moveOffset = domIndex(prev);\n prev = prev.previousSibling;\n }\n if (!prev) {\n node = node.parentNode;\n if (node == view.dom)\n break;\n offset = 0;\n }\n else {\n node = prev;\n offset = nodeLen(node);\n }\n }\n }\n if (force)\n setSelFocus(view, node, offset);\n else if (moveNode)\n setSelFocus(view, moveNode, moveOffset);\n}\n// Make sure the cursor isn't directly before one or more ignored\n// nodes.\nfunction skipIgnoredNodesAfter(view) {\n let sel = view.domSelectionRange();\n let node = sel.focusNode, offset = sel.focusOffset;\n if (!node)\n return;\n let len = nodeLen(node);\n let moveNode, moveOffset;\n for (;;) {\n if (offset < len) {\n if (node.nodeType != 1)\n break;\n let after = node.childNodes[offset];\n if (isIgnorable(after, 1)) {\n moveNode = node;\n moveOffset = ++offset;\n }\n else\n break;\n }\n else if (isBlockNode(node)) {\n break;\n }\n else {\n let next = node.nextSibling;\n while (next && isIgnorable(next, 1)) {\n moveNode = next.parentNode;\n moveOffset = domIndex(next) + 1;\n next = next.nextSibling;\n }\n if (!next) {\n node = node.parentNode;\n if (node == view.dom)\n break;\n offset = len = 0;\n }\n else {\n node = next;\n offset = 0;\n len = nodeLen(node);\n }\n }\n }\n if (moveNode)\n setSelFocus(view, moveNode, moveOffset);\n}\nfunction isBlockNode(dom) {\n let desc = dom.pmViewDesc;\n return desc && desc.node && desc.node.isBlock;\n}\nfunction textNodeAfter(node, offset) {\n while (node && offset == node.childNodes.length && !hasBlockDesc(node)) {\n offset = domIndex(node) + 1;\n node = node.parentNode;\n }\n while (node && offset < node.childNodes.length) {\n let next = node.childNodes[offset];\n if (next.nodeType == 3)\n return next;\n if (next.nodeType == 1 && next.contentEditable == \"false\")\n break;\n node = next;\n offset = 0;\n }\n}\nfunction textNodeBefore(node, offset) {\n while (node && !offset && !hasBlockDesc(node)) {\n offset = domIndex(node);\n node = node.parentNode;\n }\n while (node && offset) {\n let next = node.childNodes[offset - 1];\n if (next.nodeType == 3)\n return next;\n if (next.nodeType == 1 && next.contentEditable == \"false\")\n break;\n node = next;\n offset = node.childNodes.length;\n }\n}\nfunction setSelFocus(view, node, offset) {\n if (node.nodeType != 3) {\n let before, after;\n if (after = textNodeAfter(node, offset)) {\n node = after;\n offset = 0;\n }\n else if (before = textNodeBefore(node, offset)) {\n node = before;\n offset = before.nodeValue.length;\n }\n }\n let sel = view.domSelection();\n if (!sel)\n return;\n if (selectionCollapsed(sel)) {\n let range = document.createRange();\n range.setEnd(node, offset);\n range.setStart(node, offset);\n sel.removeAllRanges();\n sel.addRange(range);\n }\n else if (sel.extend) {\n sel.extend(node, offset);\n }\n view.domObserver.setCurSelection();\n let { state } = view;\n // If no state update ends up happening, reset the selection.\n setTimeout(() => {\n if (view.state == state)\n selectionToDOM(view);\n }, 50);\n}\nfunction findDirection(view, pos) {\n let $pos = view.state.doc.resolve(pos);\n if (!(chrome || windows) && $pos.parent.inlineContent) {\n let coords = view.coordsAtPos(pos);\n if (pos > $pos.start()) {\n let before = view.coordsAtPos(pos - 1);\n let mid = (before.top + before.bottom) / 2;\n if (mid > coords.top && mid < coords.bottom && Math.abs(before.left - coords.left) > 1)\n return before.left < coords.left ? \"ltr\" : \"rtl\";\n }\n if (pos < $pos.end()) {\n let after = view.coordsAtPos(pos + 1);\n let mid = (after.top + after.bottom) / 2;\n if (mid > coords.top && mid < coords.bottom && Math.abs(after.left - coords.left) > 1)\n return after.left > coords.left ? \"ltr\" : \"rtl\";\n }\n }\n let computed = getComputedStyle(view.dom).direction;\n return computed == \"rtl\" ? \"rtl\" : \"ltr\";\n}\n// Check whether vertical selection motion would involve node\n// selections. If so, apply it (if not, the result is left to the\n// browser)\nfunction selectVertically(view, dir, mods) {\n let sel = view.state.selection;\n if (sel instanceof TextSelection && !sel.empty || mods.indexOf(\"s\") > -1)\n return false;\n if (mac && mods.indexOf(\"m\") > -1)\n return false;\n let { $from, $to } = sel;\n if (!$from.parent.inlineContent || view.endOfTextblock(dir < 0 ? \"up\" : \"down\")) {\n let next = moveSelectionBlock(view.state, dir);\n if (next && (next instanceof NodeSelection))\n return apply(view, next);\n }\n if (!$from.parent.inlineContent) {\n let side = dir < 0 ? $from : $to;\n let beyond = sel instanceof AllSelection ? Selection.near(side, dir) : Selection.findFrom(side, dir);\n return beyond ? apply(view, beyond) : false;\n }\n return false;\n}\nfunction stopNativeHorizontalDelete(view, dir) {\n if (!(view.state.selection instanceof TextSelection))\n return true;\n let { $head, $anchor, empty } = view.state.selection;\n if (!$head.sameParent($anchor))\n return true;\n if (!empty)\n return false;\n if (view.endOfTextblock(dir > 0 ? \"forward\" : \"backward\"))\n return true;\n let nextNode = !$head.textOffset && (dir < 0 ? $head.nodeBefore : $head.nodeAfter);\n if (nextNode && !nextNode.isText) {\n let tr = view.state.tr;\n if (dir < 0)\n tr.delete($head.pos - nextNode.nodeSize, $head.pos);\n else\n tr.delete($head.pos, $head.pos + nextNode.nodeSize);\n view.dispatch(tr);\n return true;\n }\n return false;\n}\nfunction switchEditable(view, node, state) {\n view.domObserver.stop();\n node.contentEditable = state;\n view.domObserver.start();\n}\n// Issue #867 / #1090 / https://bugs.chromium.org/p/chromium/issues/detail?id=903821\n// In which Safari (and at some point in the past, Chrome) does really\n// wrong things when the down arrow is pressed when the cursor is\n// directly at the start of a textblock and has an uneditable node\n// after it\nfunction safariDownArrowBug(view) {\n if (!safari || view.state.selection.$head.parentOffset > 0)\n return false;\n let { focusNode, focusOffset } = view.domSelectionRange();\n if (focusNode && focusNode.nodeType == 1 && focusOffset == 0 &&\n focusNode.firstChild && focusNode.firstChild.contentEditable == \"false\") {\n let child = focusNode.firstChild;\n switchEditable(view, child, \"true\");\n setTimeout(() => switchEditable(view, child, \"false\"), 20);\n }\n return false;\n}\n// A backdrop key mapping used to make sure we always suppress keys\n// that have a dangerous default effect, even if the commands they are\n// bound to return false, and to make sure that cursor-motion keys\n// find a cursor (as opposed to a node selection) when pressed. For\n// cursor-motion keys, the code in the handlers also takes care of\n// block selections.\nfunction getMods(event) {\n let result = \"\";\n if (event.ctrlKey)\n result += \"c\";\n if (event.metaKey)\n result += \"m\";\n if (event.altKey)\n result += \"a\";\n if (event.shiftKey)\n result += \"s\";\n return result;\n}\nfunction captureKeyDown(view, event) {\n let code = event.keyCode, mods = getMods(event);\n if (code == 8 || (mac && code == 72 && mods == \"c\")) { // Backspace, Ctrl-h on Mac\n return stopNativeHorizontalDelete(view, -1) || skipIgnoredNodes(view, -1);\n }\n else if ((code == 46 && !event.shiftKey) || (mac && code == 68 && mods == \"c\")) { // Delete, Ctrl-d on Mac\n return stopNativeHorizontalDelete(view, 1) || skipIgnoredNodes(view, 1);\n }\n else if (code == 13 || code == 27) { // Enter, Esc\n return true;\n }\n else if (code == 37 || (mac && code == 66 && mods == \"c\")) { // Left arrow, Ctrl-b on Mac\n let dir = code == 37 ? (findDirection(view, view.state.selection.from) == \"ltr\" ? -1 : 1) : -1;\n return selectHorizontally(view, dir, mods) || skipIgnoredNodes(view, dir);\n }\n else if (code == 39 || (mac && code == 70 && mods == \"c\")) { // Right arrow, Ctrl-f on Mac\n let dir = code == 39 ? (findDirection(view, view.state.selection.from) == \"ltr\" ? 1 : -1) : 1;\n return selectHorizontally(view, dir, mods) || skipIgnoredNodes(view, dir);\n }\n else if (code == 38 || (mac && code == 80 && mods == \"c\")) { // Up arrow, Ctrl-p on Mac\n return selectVertically(view, -1, mods) || skipIgnoredNodes(view, -1);\n }\n else if (code == 40 || (mac && code == 78 && mods == \"c\")) { // Down arrow, Ctrl-n on Mac\n return safariDownArrowBug(view) || selectVertically(view, 1, mods) || skipIgnoredNodes(view, 1);\n }\n else if (mods == (mac ? \"m\" : \"c\") &&\n (code == 66 || code == 73 || code == 89 || code == 90)) { // Mod-[biyz]\n return true;\n }\n return false;\n}\n\nfunction serializeForClipboard(view, slice) {\n view.someProp(\"transformCopied\", f => { slice = f(slice, view); });\n let context = [], { content, openStart, openEnd } = slice;\n while (openStart > 1 && openEnd > 1 && content.childCount == 1 && content.firstChild.childCount == 1) {\n openStart--;\n openEnd--;\n let node = content.firstChild;\n context.push(node.type.name, node.attrs != node.type.defaultAttrs ? node.attrs : null);\n content = node.content;\n }\n let serializer = view.someProp(\"clipboardSerializer\") || DOMSerializer.fromSchema(view.state.schema);\n let doc = detachedDoc(), wrap = doc.createElement(\"div\");\n wrap.appendChild(serializer.serializeFragment(content, { document: doc }));\n let firstChild = wrap.firstChild, needsWrap, wrappers = 0;\n while (firstChild && firstChild.nodeType == 1 && (needsWrap = wrapMap[firstChild.nodeName.toLowerCase()])) {\n for (let i = needsWrap.length - 1; i >= 0; i--) {\n let wrapper = doc.createElement(needsWrap[i]);\n while (wrap.firstChild)\n wrapper.appendChild(wrap.firstChild);\n wrap.appendChild(wrapper);\n wrappers++;\n }\n firstChild = wrap.firstChild;\n }\n if (firstChild && firstChild.nodeType == 1)\n firstChild.setAttribute(\"data-pm-slice\", `${openStart} ${openEnd}${wrappers ? ` -${wrappers}` : \"\"} ${JSON.stringify(context)}`);\n let text = view.someProp(\"clipboardTextSerializer\", f => f(slice, view)) ||\n slice.content.textBetween(0, slice.content.size, \"\\n\\n\");\n return { dom: wrap, text, slice };\n}\n// Read a slice of content from the clipboard (or drop data).\nfunction parseFromClipboard(view, text, html, plainText, $context) {\n let inCode = $context.parent.type.spec.code;\n let dom, slice;\n if (!html && !text)\n return null;\n let asText = text && (plainText || inCode || !html);\n if (asText) {\n view.someProp(\"transformPastedText\", f => { text = f(text, inCode || plainText, view); });\n if (inCode)\n return text ? new Slice(Fragment.from(view.state.schema.text(text.replace(/\\r\\n?/g, \"\\n\"))), 0, 0) : Slice.empty;\n let parsed = view.someProp(\"clipboardTextParser\", f => f(text, $context, plainText, view));\n if (parsed) {\n slice = parsed;\n }\n else {\n let marks = $context.marks();\n let { schema } = view.state, serializer = DOMSerializer.fromSchema(schema);\n dom = document.createElement(\"div\");\n text.split(/(?:\\r\\n?|\\n)+/).forEach(block => {\n let p = dom.appendChild(document.createElement(\"p\"));\n if (block)\n p.appendChild(serializer.serializeNode(schema.text(block, marks)));\n });\n }\n }\n else {\n view.someProp(\"transformPastedHTML\", f => { html = f(html, view); });\n dom = readHTML(html);\n if (webkit)\n restoreReplacedSpaces(dom);\n }\n let contextNode = dom && dom.querySelector(\"[data-pm-slice]\");\n let sliceData = contextNode && /^(\\d+) (\\d+)(?: -(\\d+))? (.*)/.exec(contextNode.getAttribute(\"data-pm-slice\") || \"\");\n if (sliceData && sliceData[3])\n for (let i = +sliceData[3]; i > 0; i--) {\n let child = dom.firstChild;\n while (child && child.nodeType != 1)\n child = child.nextSibling;\n if (!child)\n break;\n dom = child;\n }\n if (!slice) {\n let parser = view.someProp(\"clipboardParser\") || view.someProp(\"domParser\") || DOMParser.fromSchema(view.state.schema);\n slice = parser.parseSlice(dom, {\n preserveWhitespace: !!(asText || sliceData),\n context: $context,\n ruleFromNode(dom) {\n if (dom.nodeName == \"BR\" && !dom.nextSibling &&\n dom.parentNode && !inlineParents.test(dom.parentNode.nodeName))\n return { ignore: true };\n return null;\n }\n });\n }\n if (sliceData) {\n slice = addContext(closeSlice(slice, +sliceData[1], +sliceData[2]), sliceData[4]);\n }\n else { // HTML wasn't created by ProseMirror. Make sure top-level siblings are coherent\n slice = Slice.maxOpen(normalizeSiblings(slice.content, $context), true);\n if (slice.openStart || slice.openEnd) {\n let openStart = 0, openEnd = 0;\n for (let node = slice.content.firstChild; openStart < slice.openStart && !node.type.spec.isolating; openStart++, node = node.firstChild) { }\n for (let node = slice.content.lastChild; openEnd < slice.openEnd && !node.type.spec.isolating; openEnd++, node = node.lastChild) { }\n slice = closeSlice(slice, openStart, openEnd);\n }\n }\n view.someProp(\"transformPasted\", f => { slice = f(slice, view); });\n return slice;\n}\nconst 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;\n// Takes a slice parsed with parseSlice, which means there hasn't been\n// any content-expression checking done on the top nodes, tries to\n// find a parent node in the current context that might fit the nodes,\n// and if successful, rebuilds the slice so that it fits into that parent.\n//\n// This addresses the problem that Transform.replace expects a\n// coherent slice, and will fail to place a set of siblings that don't\n// fit anywhere in the schema.\nfunction normalizeSiblings(fragment, $context) {\n if (fragment.childCount < 2)\n return fragment;\n for (let d = $context.depth; d >= 0; d--) {\n let parent = $context.node(d);\n let match = parent.contentMatchAt($context.index(d));\n let lastWrap, result = [];\n fragment.forEach(node => {\n if (!result)\n return;\n let wrap = match.findWrapping(node.type), inLast;\n if (!wrap)\n return result = null;\n if (inLast = result.length && lastWrap.length && addToSibling(wrap, lastWrap, node, result[result.length - 1], 0)) {\n result[result.length - 1] = inLast;\n }\n else {\n if (result.length)\n result[result.length - 1] = closeRight(result[result.length - 1], lastWrap.length);\n let wrapped = withWrappers(node, wrap);\n result.push(wrapped);\n match = match.matchType(wrapped.type);\n lastWrap = wrap;\n }\n });\n if (result)\n return Fragment.from(result);\n }\n return fragment;\n}\nfunction withWrappers(node, wrap, from = 0) {\n for (let i = wrap.length - 1; i >= from; i--)\n node = wrap[i].create(null, Fragment.from(node));\n return node;\n}\n// Used to group adjacent nodes wrapped in similar parents by\n// normalizeSiblings into the same parent node\nfunction addToSibling(wrap, lastWrap, node, sibling, depth) {\n if (depth < wrap.length && depth < lastWrap.length && wrap[depth] == lastWrap[depth]) {\n let inner = addToSibling(wrap, lastWrap, node, sibling.lastChild, depth + 1);\n if (inner)\n return sibling.copy(sibling.content.replaceChild(sibling.childCount - 1, inner));\n let match = sibling.contentMatchAt(sibling.childCount);\n if (match.matchType(depth == wrap.length - 1 ? node.type : wrap[depth + 1]))\n return sibling.copy(sibling.content.append(Fragment.from(withWrappers(node, wrap, depth + 1))));\n }\n}\nfunction closeRight(node, depth) {\n if (depth == 0)\n return node;\n let fragment = node.content.replaceChild(node.childCount - 1, closeRight(node.lastChild, depth - 1));\n let fill = node.contentMatchAt(node.childCount).fillBefore(Fragment.empty, true);\n return node.copy(fragment.append(fill));\n}\nfunction closeRange(fragment, side, from, to, depth, openEnd) {\n let node = side < 0 ? fragment.firstChild : fragment.lastChild, inner = node.content;\n if (fragment.childCount > 1)\n openEnd = 0;\n if (depth < to - 1)\n inner = closeRange(inner, side, from, to, depth + 1, openEnd);\n if (depth >= from)\n inner = side < 0 ? node.contentMatchAt(0).fillBefore(inner, openEnd <= depth).append(inner)\n : inner.append(node.contentMatchAt(node.childCount).fillBefore(Fragment.empty, true));\n return fragment.replaceChild(side < 0 ? 0 : fragment.childCount - 1, node.copy(inner));\n}\nfunction closeSlice(slice, openStart, openEnd) {\n if (openStart < slice.openStart)\n slice = new Slice(closeRange(slice.content, -1, openStart, slice.openStart, 0, slice.openEnd), openStart, slice.openEnd);\n if (openEnd < slice.openEnd)\n slice = new Slice(closeRange(slice.content, 1, openEnd, slice.openEnd, 0, 0), slice.openStart, openEnd);\n return slice;\n}\n// Trick from jQuery -- some elements must be wrapped in other\n// elements for innerHTML to work. I.e. if you do `div.innerHTML =\n// \"..\"` the table cells are ignored.\nconst wrapMap = {\n thead: [\"table\"],\n tbody: [\"table\"],\n tfoot: [\"table\"],\n caption: [\"table\"],\n colgroup: [\"table\"],\n col: [\"table\", \"colgroup\"],\n tr: [\"table\", \"tbody\"],\n td: [\"table\", \"tbody\", \"tr\"],\n th: [\"table\", \"tbody\", \"tr\"]\n};\nlet _detachedDoc = null;\nfunction detachedDoc() {\n return _detachedDoc || (_detachedDoc = document.implementation.createHTMLDocument(\"title\"));\n}\nfunction readHTML(html) {\n let metas = /^(\\s*]*>)*/.exec(html);\n if (metas)\n html = html.slice(metas[0].length);\n let elt = detachedDoc().createElement(\"div\");\n let firstTag = /<([a-z][^>\\s]+)/i.exec(html), wrap;\n if (wrap = firstTag && wrapMap[firstTag[1].toLowerCase()])\n html = wrap.map(n => \"<\" + n + \">\").join(\"\") + html + wrap.map(n => \"\").reverse().join(\"\");\n elt.innerHTML = html;\n if (wrap)\n for (let i = 0; i < wrap.length; i++)\n elt = elt.querySelector(wrap[i]) || elt;\n return elt;\n}\n// Webkit browsers do some hard-to-predict replacement of regular\n// spaces with non-breaking spaces when putting content on the\n// clipboard. This tries to convert such non-breaking spaces (which\n// will be wrapped in a plain span on Chrome, a span with class\n// Apple-converted-space on Safari) back to regular spaces.\nfunction restoreReplacedSpaces(dom) {\n let nodes = dom.querySelectorAll(chrome ? \"span:not([class]):not([style])\" : \"span.Apple-converted-space\");\n for (let i = 0; i < nodes.length; i++) {\n let node = nodes[i];\n if (node.childNodes.length == 1 && node.textContent == \"\\u00a0\" && node.parentNode)\n node.parentNode.replaceChild(dom.ownerDocument.createTextNode(\" \"), node);\n }\n}\nfunction addContext(slice, context) {\n if (!slice.size)\n return slice;\n let schema = slice.content.firstChild.type.schema, array;\n try {\n array = JSON.parse(context);\n }\n catch (e) {\n return slice;\n }\n let { content, openStart, openEnd } = slice;\n for (let i = array.length - 2; i >= 0; i -= 2) {\n let type = schema.nodes[array[i]];\n if (!type || type.hasRequiredAttrs())\n break;\n content = Fragment.from(type.create(array[i + 1], content));\n openStart++;\n openEnd++;\n }\n return new Slice(content, openStart, openEnd);\n}\n\n// A collection of DOM events that occur within the editor, and callback functions\n// to invoke when the event fires.\nconst handlers = {};\nconst editHandlers = {};\nconst passiveHandlers = { touchstart: true, touchmove: true };\nclass InputState {\n constructor() {\n this.shiftKey = false;\n this.mouseDown = null;\n this.lastKeyCode = null;\n this.lastKeyCodeTime = 0;\n this.lastClick = { time: 0, x: 0, y: 0, type: \"\" };\n this.lastSelectionOrigin = null;\n this.lastSelectionTime = 0;\n this.lastIOSEnter = 0;\n this.lastIOSEnterFallbackTimeout = -1;\n this.lastFocus = 0;\n this.lastTouch = 0;\n this.lastAndroidDelete = 0;\n this.composing = false;\n this.compositionNode = null;\n this.composingTimeout = -1;\n this.compositionNodes = [];\n this.compositionEndedAt = -2e8;\n this.compositionID = 1;\n // Set to a composition ID when there are pending changes at compositionend\n this.compositionPendingChanges = 0;\n this.domChangeCount = 0;\n this.eventHandlers = Object.create(null);\n this.hideSelectionGuard = null;\n }\n}\nfunction initInput(view) {\n for (let event in handlers) {\n let handler = handlers[event];\n view.dom.addEventListener(event, view.input.eventHandlers[event] = (event) => {\n if (eventBelongsToView(view, event) && !runCustomHandler(view, event) &&\n (view.editable || !(event.type in editHandlers)))\n handler(view, event);\n }, passiveHandlers[event] ? { passive: true } : undefined);\n }\n // On Safari, for reasons beyond my understanding, adding an input\n // event handler makes an issue where the composition vanishes when\n // you press enter go away.\n if (safari)\n view.dom.addEventListener(\"input\", () => null);\n ensureListeners(view);\n}\nfunction setSelectionOrigin(view, origin) {\n view.input.lastSelectionOrigin = origin;\n view.input.lastSelectionTime = Date.now();\n}\nfunction destroyInput(view) {\n view.domObserver.stop();\n for (let type in view.input.eventHandlers)\n view.dom.removeEventListener(type, view.input.eventHandlers[type]);\n clearTimeout(view.input.composingTimeout);\n clearTimeout(view.input.lastIOSEnterFallbackTimeout);\n}\nfunction ensureListeners(view) {\n view.someProp(\"handleDOMEvents\", currentHandlers => {\n for (let type in currentHandlers)\n if (!view.input.eventHandlers[type])\n view.dom.addEventListener(type, view.input.eventHandlers[type] = event => runCustomHandler(view, event));\n });\n}\nfunction runCustomHandler(view, event) {\n return view.someProp(\"handleDOMEvents\", handlers => {\n let handler = handlers[event.type];\n return handler ? handler(view, event) || event.defaultPrevented : false;\n });\n}\nfunction eventBelongsToView(view, event) {\n if (!event.bubbles)\n return true;\n if (event.defaultPrevented)\n return false;\n for (let node = event.target; node != view.dom; node = node.parentNode)\n if (!node || node.nodeType == 11 ||\n (node.pmViewDesc && node.pmViewDesc.stopEvent(event)))\n return false;\n return true;\n}\nfunction dispatchEvent(view, event) {\n if (!runCustomHandler(view, event) && handlers[event.type] &&\n (view.editable || !(event.type in editHandlers)))\n handlers[event.type](view, event);\n}\neditHandlers.keydown = (view, _event) => {\n let event = _event;\n view.input.shiftKey = event.keyCode == 16 || event.shiftKey;\n if (inOrNearComposition(view, event))\n return;\n view.input.lastKeyCode = event.keyCode;\n view.input.lastKeyCodeTime = Date.now();\n // Suppress enter key events on Chrome Android, because those tend\n // to be part of a confused sequence of composition events fired,\n // and handling them eagerly tends to corrupt the input.\n if (android && chrome && event.keyCode == 13)\n return;\n if (event.keyCode != 229)\n view.domObserver.forceFlush();\n // On iOS, if we preventDefault enter key presses, the virtual\n // keyboard gets confused. So the hack here is to set a flag that\n // makes the DOM change code recognize that what just happens should\n // be replaced by whatever the Enter key handlers do.\n if (ios && event.keyCode == 13 && !event.ctrlKey && !event.altKey && !event.metaKey) {\n let now = Date.now();\n view.input.lastIOSEnter = now;\n view.input.lastIOSEnterFallbackTimeout = setTimeout(() => {\n if (view.input.lastIOSEnter == now) {\n view.someProp(\"handleKeyDown\", f => f(view, keyEvent(13, \"Enter\")));\n view.input.lastIOSEnter = 0;\n }\n }, 200);\n }\n else if (view.someProp(\"handleKeyDown\", f => f(view, event)) || captureKeyDown(view, event)) {\n event.preventDefault();\n }\n else {\n setSelectionOrigin(view, \"key\");\n }\n};\neditHandlers.keyup = (view, event) => {\n if (event.keyCode == 16)\n view.input.shiftKey = false;\n};\neditHandlers.keypress = (view, _event) => {\n let event = _event;\n if (inOrNearComposition(view, event) || !event.charCode ||\n event.ctrlKey && !event.altKey || mac && event.metaKey)\n return;\n if (view.someProp(\"handleKeyPress\", f => f(view, event))) {\n event.preventDefault();\n return;\n }\n let sel = view.state.selection;\n if (!(sel instanceof TextSelection) || !sel.$from.sameParent(sel.$to)) {\n let text = String.fromCharCode(event.charCode);\n if (!/[\\r\\n]/.test(text) && !view.someProp(\"handleTextInput\", f => f(view, sel.$from.pos, sel.$to.pos, text)))\n view.dispatch(view.state.tr.insertText(text).scrollIntoView());\n event.preventDefault();\n }\n};\nfunction eventCoords(event) { return { left: event.clientX, top: event.clientY }; }\nfunction isNear(event, click) {\n let dx = click.x - event.clientX, dy = click.y - event.clientY;\n return dx * dx + dy * dy < 100;\n}\nfunction runHandlerOnContext(view, propName, pos, inside, event) {\n if (inside == -1)\n return false;\n let $pos = view.state.doc.resolve(inside);\n for (let i = $pos.depth + 1; i > 0; i--) {\n if (view.someProp(propName, f => i > $pos.depth ? f(view, pos, $pos.nodeAfter, $pos.before(i), event, true)\n : f(view, pos, $pos.node(i), $pos.before(i), event, false)))\n return true;\n }\n return false;\n}\nfunction updateSelection(view, selection, origin) {\n if (!view.focused)\n view.focus();\n if (view.state.selection.eq(selection))\n return;\n let tr = view.state.tr.setSelection(selection);\n if (origin == \"pointer\")\n tr.setMeta(\"pointer\", true);\n view.dispatch(tr);\n}\nfunction selectClickedLeaf(view, inside) {\n if (inside == -1)\n return false;\n let $pos = view.state.doc.resolve(inside), node = $pos.nodeAfter;\n if (node && node.isAtom && NodeSelection.isSelectable(node)) {\n updateSelection(view, new NodeSelection($pos), \"pointer\");\n return true;\n }\n return false;\n}\nfunction selectClickedNode(view, inside) {\n if (inside == -1)\n return false;\n let sel = view.state.selection, selectedNode, selectAt;\n if (sel instanceof NodeSelection)\n selectedNode = sel.node;\n let $pos = view.state.doc.resolve(inside);\n for (let i = $pos.depth + 1; i > 0; i--) {\n let node = i > $pos.depth ? $pos.nodeAfter : $pos.node(i);\n if (NodeSelection.isSelectable(node)) {\n if (selectedNode && sel.$from.depth > 0 &&\n i >= sel.$from.depth && $pos.before(sel.$from.depth + 1) == sel.$from.pos)\n selectAt = $pos.before(sel.$from.depth);\n else\n selectAt = $pos.before(i);\n break;\n }\n }\n if (selectAt != null) {\n updateSelection(view, NodeSelection.create(view.state.doc, selectAt), \"pointer\");\n return true;\n }\n else {\n return false;\n }\n}\nfunction handleSingleClick(view, pos, inside, event, selectNode) {\n return runHandlerOnContext(view, \"handleClickOn\", pos, inside, event) ||\n view.someProp(\"handleClick\", f => f(view, pos, event)) ||\n (selectNode ? selectClickedNode(view, inside) : selectClickedLeaf(view, inside));\n}\nfunction handleDoubleClick(view, pos, inside, event) {\n return runHandlerOnContext(view, \"handleDoubleClickOn\", pos, inside, event) ||\n view.someProp(\"handleDoubleClick\", f => f(view, pos, event));\n}\nfunction handleTripleClick(view, pos, inside, event) {\n return runHandlerOnContext(view, \"handleTripleClickOn\", pos, inside, event) ||\n view.someProp(\"handleTripleClick\", f => f(view, pos, event)) ||\n defaultTripleClick(view, inside, event);\n}\nfunction defaultTripleClick(view, inside, event) {\n if (event.button != 0)\n return false;\n let doc = view.state.doc;\n if (inside == -1) {\n if (doc.inlineContent) {\n updateSelection(view, TextSelection.create(doc, 0, doc.content.size), \"pointer\");\n return true;\n }\n return false;\n }\n let $pos = doc.resolve(inside);\n for (let i = $pos.depth + 1; i > 0; i--) {\n let node = i > $pos.depth ? $pos.nodeAfter : $pos.node(i);\n let nodePos = $pos.before(i);\n if (node.inlineContent)\n updateSelection(view, TextSelection.create(doc, nodePos + 1, nodePos + 1 + node.content.size), \"pointer\");\n else if (NodeSelection.isSelectable(node))\n updateSelection(view, NodeSelection.create(doc, nodePos), \"pointer\");\n else\n continue;\n return true;\n }\n}\nfunction forceDOMFlush(view) {\n return endComposition(view);\n}\nconst selectNodeModifier = mac ? \"metaKey\" : \"ctrlKey\";\nhandlers.mousedown = (view, _event) => {\n let event = _event;\n view.input.shiftKey = event.shiftKey;\n let flushed = forceDOMFlush(view);\n let now = Date.now(), type = \"singleClick\";\n if (now - view.input.lastClick.time < 500 && isNear(event, view.input.lastClick) && !event[selectNodeModifier]) {\n if (view.input.lastClick.type == \"singleClick\")\n type = \"doubleClick\";\n else if (view.input.lastClick.type == \"doubleClick\")\n type = \"tripleClick\";\n }\n view.input.lastClick = { time: now, x: event.clientX, y: event.clientY, type };\n let pos = view.posAtCoords(eventCoords(event));\n if (!pos)\n return;\n if (type == \"singleClick\") {\n if (view.input.mouseDown)\n view.input.mouseDown.done();\n view.input.mouseDown = new MouseDown(view, pos, event, !!flushed);\n }\n else if ((type == \"doubleClick\" ? handleDoubleClick : handleTripleClick)(view, pos.pos, pos.inside, event)) {\n event.preventDefault();\n }\n else {\n setSelectionOrigin(view, \"pointer\");\n }\n};\nclass MouseDown {\n constructor(view, pos, event, flushed) {\n this.view = view;\n this.pos = pos;\n this.event = event;\n this.flushed = flushed;\n this.delayedSelectionSync = false;\n this.mightDrag = null;\n this.startDoc = view.state.doc;\n this.selectNode = !!event[selectNodeModifier];\n this.allowDefault = event.shiftKey;\n let targetNode, targetPos;\n if (pos.inside > -1) {\n targetNode = view.state.doc.nodeAt(pos.inside);\n targetPos = pos.inside;\n }\n else {\n let $pos = view.state.doc.resolve(pos.pos);\n targetNode = $pos.parent;\n targetPos = $pos.depth ? $pos.before() : 0;\n }\n const target = flushed ? null : event.target;\n const targetDesc = target ? view.docView.nearestDesc(target, true) : null;\n this.target = targetDesc && targetDesc.dom.nodeType == 1 ? targetDesc.dom : null;\n let { selection } = view.state;\n if (event.button == 0 &&\n targetNode.type.spec.draggable && targetNode.type.spec.selectable !== false ||\n selection instanceof NodeSelection && selection.from <= targetPos && selection.to > targetPos)\n this.mightDrag = {\n node: targetNode,\n pos: targetPos,\n addAttr: !!(this.target && !this.target.draggable),\n setUneditable: !!(this.target && gecko && !this.target.hasAttribute(\"contentEditable\"))\n };\n if (this.target && this.mightDrag && (this.mightDrag.addAttr || this.mightDrag.setUneditable)) {\n this.view.domObserver.stop();\n if (this.mightDrag.addAttr)\n this.target.draggable = true;\n if (this.mightDrag.setUneditable)\n setTimeout(() => {\n if (this.view.input.mouseDown == this)\n this.target.setAttribute(\"contentEditable\", \"false\");\n }, 20);\n this.view.domObserver.start();\n }\n view.root.addEventListener(\"mouseup\", this.up = this.up.bind(this));\n view.root.addEventListener(\"mousemove\", this.move = this.move.bind(this));\n setSelectionOrigin(view, \"pointer\");\n }\n done() {\n this.view.root.removeEventListener(\"mouseup\", this.up);\n this.view.root.removeEventListener(\"mousemove\", this.move);\n if (this.mightDrag && this.target) {\n this.view.domObserver.stop();\n if (this.mightDrag.addAttr)\n this.target.removeAttribute(\"draggable\");\n if (this.mightDrag.setUneditable)\n this.target.removeAttribute(\"contentEditable\");\n this.view.domObserver.start();\n }\n if (this.delayedSelectionSync)\n setTimeout(() => selectionToDOM(this.view));\n this.view.input.mouseDown = null;\n }\n up(event) {\n this.done();\n if (!this.view.dom.contains(event.target))\n return;\n let pos = this.pos;\n if (this.view.state.doc != this.startDoc)\n pos = this.view.posAtCoords(eventCoords(event));\n this.updateAllowDefault(event);\n if (this.allowDefault || !pos) {\n setSelectionOrigin(this.view, \"pointer\");\n }\n else if (handleSingleClick(this.view, pos.pos, pos.inside, event, this.selectNode)) {\n event.preventDefault();\n }\n else if (event.button == 0 &&\n (this.flushed ||\n // Safari ignores clicks on draggable elements\n (safari && this.mightDrag && !this.mightDrag.node.isAtom) ||\n // Chrome will sometimes treat a node selection as a\n // cursor, but still report that the node is selected\n // when asked through getSelection. You'll then get a\n // situation where clicking at the point where that\n // (hidden) cursor is doesn't change the selection, and\n // thus doesn't get a reaction from ProseMirror. This\n // works around that.\n (chrome && !this.view.state.selection.visible &&\n Math.min(Math.abs(pos.pos - this.view.state.selection.from), Math.abs(pos.pos - this.view.state.selection.to)) <= 2))) {\n updateSelection(this.view, Selection.near(this.view.state.doc.resolve(pos.pos)), \"pointer\");\n event.preventDefault();\n }\n else {\n setSelectionOrigin(this.view, \"pointer\");\n }\n }\n move(event) {\n this.updateAllowDefault(event);\n setSelectionOrigin(this.view, \"pointer\");\n if (event.buttons == 0)\n this.done();\n }\n updateAllowDefault(event) {\n if (!this.allowDefault && (Math.abs(this.event.x - event.clientX) > 4 ||\n Math.abs(this.event.y - event.clientY) > 4))\n this.allowDefault = true;\n }\n}\nhandlers.touchstart = view => {\n view.input.lastTouch = Date.now();\n forceDOMFlush(view);\n setSelectionOrigin(view, \"pointer\");\n};\nhandlers.touchmove = view => {\n view.input.lastTouch = Date.now();\n setSelectionOrigin(view, \"pointer\");\n};\nhandlers.contextmenu = view => forceDOMFlush(view);\nfunction inOrNearComposition(view, event) {\n if (view.composing)\n return true;\n // See https://www.stum.de/2016/06/24/handling-ime-events-in-javascript/.\n // On Japanese input method editors (IMEs), the Enter key is used to confirm character\n // selection. On Safari, when Enter is pressed, compositionend and keydown events are\n // emitted. The keydown event triggers newline insertion, which we don't want.\n // This method returns true if the keydown event should be ignored.\n // We only ignore it once, as pressing Enter a second time *should* insert a newline.\n // Furthermore, the keydown event timestamp must be close to the compositionEndedAt timestamp.\n // This guards against the case where compositionend is triggered without the keyboard\n // (e.g. character confirmation may be done with the mouse), and keydown is triggered\n // afterwards- we wouldn't want to ignore the keydown event in this case.\n if (safari && Math.abs(event.timeStamp - view.input.compositionEndedAt) < 500) {\n view.input.compositionEndedAt = -2e8;\n return true;\n }\n return false;\n}\n// Drop active composition after 5 seconds of inactivity on Android\nconst timeoutComposition = android ? 5000 : -1;\neditHandlers.compositionstart = editHandlers.compositionupdate = view => {\n if (!view.composing) {\n view.domObserver.flush();\n let { state } = view, $pos = state.selection.$to;\n if (state.selection instanceof TextSelection &&\n (state.storedMarks ||\n (!$pos.textOffset && $pos.parentOffset && $pos.nodeBefore.marks.some(m => m.type.spec.inclusive === false)))) {\n // Need to wrap the cursor in mark nodes different from the ones in the DOM context\n view.markCursor = view.state.storedMarks || $pos.marks();\n endComposition(view, true);\n view.markCursor = null;\n }\n else {\n endComposition(view, !state.selection.empty);\n // In firefox, if the cursor is after but outside a marked node,\n // the inserted text won't inherit the marks. So this moves it\n // inside if necessary.\n if (gecko && state.selection.empty && $pos.parentOffset && !$pos.textOffset && $pos.nodeBefore.marks.length) {\n let sel = view.domSelectionRange();\n for (let node = sel.focusNode, offset = sel.focusOffset; node && node.nodeType == 1 && offset != 0;) {\n let before = offset < 0 ? node.lastChild : node.childNodes[offset - 1];\n if (!before)\n break;\n if (before.nodeType == 3) {\n let sel = view.domSelection();\n if (sel)\n sel.collapse(before, before.nodeValue.length);\n break;\n }\n else {\n node = before;\n offset = -1;\n }\n }\n }\n }\n view.input.composing = true;\n }\n scheduleComposeEnd(view, timeoutComposition);\n};\neditHandlers.compositionend = (view, event) => {\n if (view.composing) {\n view.input.composing = false;\n view.input.compositionEndedAt = event.timeStamp;\n view.input.compositionPendingChanges = view.domObserver.pendingRecords().length ? view.input.compositionID : 0;\n view.input.compositionNode = null;\n if (view.input.compositionPendingChanges)\n Promise.resolve().then(() => view.domObserver.flush());\n view.input.compositionID++;\n scheduleComposeEnd(view, 20);\n }\n};\nfunction scheduleComposeEnd(view, delay) {\n clearTimeout(view.input.composingTimeout);\n if (delay > -1)\n view.input.composingTimeout = setTimeout(() => endComposition(view), delay);\n}\nfunction clearComposition(view) {\n if (view.composing) {\n view.input.composing = false;\n view.input.compositionEndedAt = timestampFromCustomEvent();\n }\n while (view.input.compositionNodes.length > 0)\n view.input.compositionNodes.pop().markParentsDirty();\n}\nfunction findCompositionNode(view) {\n let sel = view.domSelectionRange();\n if (!sel.focusNode)\n return null;\n let textBefore = textNodeBefore$1(sel.focusNode, sel.focusOffset);\n let textAfter = textNodeAfter$1(sel.focusNode, sel.focusOffset);\n if (textBefore && textAfter && textBefore != textAfter) {\n let descAfter = textAfter.pmViewDesc, lastChanged = view.domObserver.lastChangedTextNode;\n if (textBefore == lastChanged || textAfter == lastChanged)\n return lastChanged;\n if (!descAfter || !descAfter.isText(textAfter.nodeValue)) {\n return textAfter;\n }\n else if (view.input.compositionNode == textAfter) {\n let descBefore = textBefore.pmViewDesc;\n if (!(!descBefore || !descBefore.isText(textBefore.nodeValue)))\n return textAfter;\n }\n }\n return textBefore || textAfter;\n}\nfunction timestampFromCustomEvent() {\n let event = document.createEvent(\"Event\");\n event.initEvent(\"event\", true, true);\n return event.timeStamp;\n}\n/**\n@internal\n*/\nfunction endComposition(view, restarting = false) {\n if (android && view.domObserver.flushingSoon >= 0)\n return;\n view.domObserver.forceFlush();\n clearComposition(view);\n if (restarting || view.docView && view.docView.dirty) {\n let sel = selectionFromDOM(view);\n if (sel && !sel.eq(view.state.selection))\n view.dispatch(view.state.tr.setSelection(sel));\n else if ((view.markCursor || restarting) && !view.state.selection.empty)\n view.dispatch(view.state.tr.deleteSelection());\n else\n view.updateState(view.state);\n return true;\n }\n return false;\n}\nfunction captureCopy(view, dom) {\n // The extra wrapper is somehow necessary on IE/Edge to prevent the\n // content from being mangled when it is put onto the clipboard\n if (!view.dom.parentNode)\n return;\n let wrap = view.dom.parentNode.appendChild(document.createElement(\"div\"));\n wrap.appendChild(dom);\n wrap.style.cssText = \"position: fixed; left: -10000px; top: 10px\";\n let sel = getSelection(), range = document.createRange();\n range.selectNodeContents(dom);\n // Done because IE will fire a selectionchange moving the selection\n // to its start when removeAllRanges is called and the editor still\n // has focus (which will mess up the editor's selection state).\n view.dom.blur();\n sel.removeAllRanges();\n sel.addRange(range);\n setTimeout(() => {\n if (wrap.parentNode)\n wrap.parentNode.removeChild(wrap);\n view.focus();\n }, 50);\n}\n// This is very crude, but unfortunately both these browsers _pretend_\n// that they have a clipboard API—all the objects and methods are\n// there, they just don't work, and they are hard to test.\nconst brokenClipboardAPI = (ie && ie_version < 15) ||\n (ios && webkit_version < 604);\nhandlers.copy = editHandlers.cut = (view, _event) => {\n let event = _event;\n let sel = view.state.selection, cut = event.type == \"cut\";\n if (sel.empty)\n return;\n // IE and Edge's clipboard interface is completely broken\n let data = brokenClipboardAPI ? null : event.clipboardData;\n let slice = sel.content(), { dom, text } = serializeForClipboard(view, slice);\n if (data) {\n event.preventDefault();\n data.clearData();\n data.setData(\"text/html\", dom.innerHTML);\n data.setData(\"text/plain\", text);\n }\n else {\n captureCopy(view, dom);\n }\n if (cut)\n view.dispatch(view.state.tr.deleteSelection().scrollIntoView().setMeta(\"uiEvent\", \"cut\"));\n};\nfunction sliceSingleNode(slice) {\n return slice.openStart == 0 && slice.openEnd == 0 && slice.content.childCount == 1 ? slice.content.firstChild : null;\n}\nfunction capturePaste(view, event) {\n if (!view.dom.parentNode)\n return;\n let plainText = view.input.shiftKey || view.state.selection.$from.parent.type.spec.code;\n let target = view.dom.parentNode.appendChild(document.createElement(plainText ? \"textarea\" : \"div\"));\n if (!plainText)\n target.contentEditable = \"true\";\n target.style.cssText = \"position: fixed; left: -10000px; top: 10px\";\n target.focus();\n let plain = view.input.shiftKey && view.input.lastKeyCode != 45;\n setTimeout(() => {\n view.focus();\n if (target.parentNode)\n target.parentNode.removeChild(target);\n if (plainText)\n doPaste(view, target.value, null, plain, event);\n else\n doPaste(view, target.textContent, target.innerHTML, plain, event);\n }, 50);\n}\nfunction doPaste(view, text, html, preferPlain, event) {\n let slice = parseFromClipboard(view, text, html, preferPlain, view.state.selection.$from);\n if (view.someProp(\"handlePaste\", f => f(view, event, slice || Slice.empty)))\n return true;\n if (!slice)\n return false;\n let singleNode = sliceSingleNode(slice);\n let tr = singleNode\n ? view.state.tr.replaceSelectionWith(singleNode, preferPlain)\n : view.state.tr.replaceSelection(slice);\n view.dispatch(tr.scrollIntoView().setMeta(\"paste\", true).setMeta(\"uiEvent\", \"paste\"));\n return true;\n}\nfunction getText(clipboardData) {\n let text = clipboardData.getData(\"text/plain\") || clipboardData.getData(\"Text\");\n if (text)\n return text;\n let uris = clipboardData.getData(\"text/uri-list\");\n return uris ? uris.replace(/\\r?\\n/g, \" \") : \"\";\n}\neditHandlers.paste = (view, _event) => {\n let event = _event;\n // Handling paste from JavaScript during composition is very poorly\n // handled by browsers, so as a dodgy but preferable kludge, we just\n // let the browser do its native thing there, except on Android,\n // where the editor is almost always composing.\n if (view.composing && !android)\n return;\n let data = brokenClipboardAPI ? null : event.clipboardData;\n let plain = view.input.shiftKey && view.input.lastKeyCode != 45;\n if (data && doPaste(view, getText(data), data.getData(\"text/html\"), plain, event))\n event.preventDefault();\n else\n capturePaste(view, event);\n};\nclass Dragging {\n constructor(slice, move, node) {\n this.slice = slice;\n this.move = move;\n this.node = node;\n }\n}\nconst dragCopyModifier = mac ? \"altKey\" : \"ctrlKey\";\nhandlers.dragstart = (view, _event) => {\n let event = _event;\n let mouseDown = view.input.mouseDown;\n if (mouseDown)\n mouseDown.done();\n if (!event.dataTransfer)\n return;\n let sel = view.state.selection;\n let pos = sel.empty ? null : view.posAtCoords(eventCoords(event));\n let node;\n if (pos && pos.pos >= sel.from && pos.pos <= (sel instanceof NodeSelection ? sel.to - 1 : sel.to)) ;\n else if (mouseDown && mouseDown.mightDrag) {\n node = NodeSelection.create(view.state.doc, mouseDown.mightDrag.pos);\n }\n else if (event.target && event.target.nodeType == 1) {\n let desc = view.docView.nearestDesc(event.target, true);\n if (desc && desc.node.type.spec.draggable && desc != view.docView)\n node = NodeSelection.create(view.state.doc, desc.posBefore);\n }\n let draggedSlice = (node || view.state.selection).content();\n let { dom, text, slice } = serializeForClipboard(view, draggedSlice);\n // Pre-120 Chrome versions clear files when calling `clearData` (#1472)\n if (!event.dataTransfer.files.length || !chrome || chrome_version > 120)\n event.dataTransfer.clearData();\n event.dataTransfer.setData(brokenClipboardAPI ? \"Text\" : \"text/html\", dom.innerHTML);\n // See https://github.com/ProseMirror/prosemirror/issues/1156\n event.dataTransfer.effectAllowed = \"copyMove\";\n if (!brokenClipboardAPI)\n event.dataTransfer.setData(\"text/plain\", text);\n view.dragging = new Dragging(slice, !event[dragCopyModifier], node);\n};\nhandlers.dragend = view => {\n let dragging = view.dragging;\n window.setTimeout(() => {\n if (view.dragging == dragging)\n view.dragging = null;\n }, 50);\n};\neditHandlers.dragover = editHandlers.dragenter = (_, e) => e.preventDefault();\neditHandlers.drop = (view, _event) => {\n let event = _event;\n let dragging = view.dragging;\n view.dragging = null;\n if (!event.dataTransfer)\n return;\n let eventPos = view.posAtCoords(eventCoords(event));\n if (!eventPos)\n return;\n let $mouse = view.state.doc.resolve(eventPos.pos);\n let slice = dragging && dragging.slice;\n if (slice) {\n view.someProp(\"transformPasted\", f => { slice = f(slice, view); });\n }\n else {\n slice = parseFromClipboard(view, getText(event.dataTransfer), brokenClipboardAPI ? null : event.dataTransfer.getData(\"text/html\"), false, $mouse);\n }\n let move = !!(dragging && !event[dragCopyModifier]);\n if (view.someProp(\"handleDrop\", f => f(view, event, slice || Slice.empty, move))) {\n event.preventDefault();\n return;\n }\n if (!slice)\n return;\n event.preventDefault();\n let insertPos = slice ? dropPoint(view.state.doc, $mouse.pos, slice) : $mouse.pos;\n if (insertPos == null)\n insertPos = $mouse.pos;\n let tr = view.state.tr;\n if (move) {\n let { node } = dragging;\n if (node)\n node.replace(tr);\n else\n tr.deleteSelection();\n }\n let pos = tr.mapping.map(insertPos);\n let isNode = slice.openStart == 0 && slice.openEnd == 0 && slice.content.childCount == 1;\n let beforeInsert = tr.doc;\n if (isNode)\n tr.replaceRangeWith(pos, pos, slice.content.firstChild);\n else\n tr.replaceRange(pos, pos, slice);\n if (tr.doc.eq(beforeInsert))\n return;\n let $pos = tr.doc.resolve(pos);\n if (isNode && NodeSelection.isSelectable(slice.content.firstChild) &&\n $pos.nodeAfter && $pos.nodeAfter.sameMarkup(slice.content.firstChild)) {\n tr.setSelection(new NodeSelection($pos));\n }\n else {\n let end = tr.mapping.map(insertPos);\n tr.mapping.maps[tr.mapping.maps.length - 1].forEach((_from, _to, _newFrom, newTo) => end = newTo);\n tr.setSelection(selectionBetween(view, $pos, tr.doc.resolve(end)));\n }\n view.focus();\n view.dispatch(tr.setMeta(\"uiEvent\", \"drop\"));\n};\nhandlers.focus = view => {\n view.input.lastFocus = Date.now();\n if (!view.focused) {\n view.domObserver.stop();\n view.dom.classList.add(\"ProseMirror-focused\");\n view.domObserver.start();\n view.focused = true;\n setTimeout(() => {\n if (view.docView && view.hasFocus() && !view.domObserver.currentSelection.eq(view.domSelectionRange()))\n selectionToDOM(view);\n }, 20);\n }\n};\nhandlers.blur = (view, _event) => {\n let event = _event;\n if (view.focused) {\n view.domObserver.stop();\n view.dom.classList.remove(\"ProseMirror-focused\");\n view.domObserver.start();\n if (event.relatedTarget && view.dom.contains(event.relatedTarget))\n view.domObserver.currentSelection.clear();\n view.focused = false;\n }\n};\nhandlers.beforeinput = (view, _event) => {\n let event = _event;\n // We should probably do more with beforeinput events, but support\n // is so spotty that I'm still waiting to see where they are going.\n // Very specific hack to deal with backspace sometimes failing on\n // Chrome Android when after an uneditable node.\n if (chrome && android && event.inputType == \"deleteContentBackward\") {\n view.domObserver.flushSoon();\n let { domChangeCount } = view.input;\n setTimeout(() => {\n if (view.input.domChangeCount != domChangeCount)\n return; // Event already had some effect\n // This bug tends to close the virtual keyboard, so we refocus\n view.dom.blur();\n view.focus();\n if (view.someProp(\"handleKeyDown\", f => f(view, keyEvent(8, \"Backspace\"))))\n return;\n let { $cursor } = view.state.selection;\n // Crude approximation of backspace behavior when no command handled it\n if ($cursor && $cursor.pos > 0)\n view.dispatch(view.state.tr.delete($cursor.pos - 1, $cursor.pos).scrollIntoView());\n }, 50);\n }\n};\n// Make sure all handlers get registered\nfor (let prop in editHandlers)\n handlers[prop] = editHandlers[prop];\n\nfunction compareObjs(a, b) {\n if (a == b)\n return true;\n for (let p in a)\n if (a[p] !== b[p])\n return false;\n for (let p in b)\n if (!(p in a))\n return false;\n return true;\n}\nclass WidgetType {\n constructor(toDOM, spec) {\n this.toDOM = toDOM;\n this.spec = spec || noSpec;\n this.side = this.spec.side || 0;\n }\n map(mapping, span, offset, oldOffset) {\n let { pos, deleted } = mapping.mapResult(span.from + oldOffset, this.side < 0 ? -1 : 1);\n return deleted ? null : new Decoration(pos - offset, pos - offset, this);\n }\n valid() { return true; }\n eq(other) {\n return this == other ||\n (other instanceof WidgetType &&\n (this.spec.key && this.spec.key == other.spec.key ||\n this.toDOM == other.toDOM && compareObjs(this.spec, other.spec)));\n }\n destroy(node) {\n if (this.spec.destroy)\n this.spec.destroy(node);\n }\n}\nclass InlineType {\n constructor(attrs, spec) {\n this.attrs = attrs;\n this.spec = spec || noSpec;\n }\n map(mapping, span, offset, oldOffset) {\n let from = mapping.map(span.from + oldOffset, this.spec.inclusiveStart ? -1 : 1) - offset;\n let to = mapping.map(span.to + oldOffset, this.spec.inclusiveEnd ? 1 : -1) - offset;\n return from >= to ? null : new Decoration(from, to, this);\n }\n valid(_, span) { return span.from < span.to; }\n eq(other) {\n return this == other ||\n (other instanceof InlineType && compareObjs(this.attrs, other.attrs) &&\n compareObjs(this.spec, other.spec));\n }\n static is(span) { return span.type instanceof InlineType; }\n destroy() { }\n}\nclass NodeType {\n constructor(attrs, spec) {\n this.attrs = attrs;\n this.spec = spec || noSpec;\n }\n map(mapping, span, offset, oldOffset) {\n let from = mapping.mapResult(span.from + oldOffset, 1);\n if (from.deleted)\n return null;\n let to = mapping.mapResult(span.to + oldOffset, -1);\n if (to.deleted || to.pos <= from.pos)\n return null;\n return new Decoration(from.pos - offset, to.pos - offset, this);\n }\n valid(node, span) {\n let { index, offset } = node.content.findIndex(span.from), child;\n return offset == span.from && !(child = node.child(index)).isText && offset + child.nodeSize == span.to;\n }\n eq(other) {\n return this == other ||\n (other instanceof NodeType && compareObjs(this.attrs, other.attrs) &&\n compareObjs(this.spec, other.spec));\n }\n destroy() { }\n}\n/**\nDecoration objects can be provided to the view through the\n[`decorations` prop](https://prosemirror.net/docs/ref/#view.EditorProps.decorations). They come in\nseveral variants—see the static members of this class for details.\n*/\nclass Decoration {\n /**\n @internal\n */\n constructor(\n /**\n The start position of the decoration.\n */\n from, \n /**\n The end position. Will be the same as `from` for [widget\n decorations](https://prosemirror.net/docs/ref/#view.Decoration^widget).\n */\n to, \n /**\n @internal\n */\n type) {\n this.from = from;\n this.to = to;\n this.type = type;\n }\n /**\n @internal\n */\n copy(from, to) {\n return new Decoration(from, to, this.type);\n }\n /**\n @internal\n */\n eq(other, offset = 0) {\n return this.type.eq(other.type) && this.from + offset == other.from && this.to + offset == other.to;\n }\n /**\n @internal\n */\n map(mapping, offset, oldOffset) {\n return this.type.map(mapping, this, offset, oldOffset);\n }\n /**\n Creates a widget decoration, which is a DOM node that's shown in\n the document at the given position. It is recommended that you\n delay rendering the widget by passing a function that will be\n called when the widget is actually drawn in a view, but you can\n also directly pass a DOM node. `getPos` can be used to find the\n widget's current document position.\n */\n static widget(pos, toDOM, spec) {\n return new Decoration(pos, pos, new WidgetType(toDOM, spec));\n }\n /**\n Creates an inline decoration, which adds the given attributes to\n each inline node between `from` and `to`.\n */\n static inline(from, to, attrs, spec) {\n return new Decoration(from, to, new InlineType(attrs, spec));\n }\n /**\n Creates a node decoration. `from` and `to` should point precisely\n before and after a node in the document. That node, and only that\n node, will receive the given attributes.\n */\n static node(from, to, attrs, spec) {\n return new Decoration(from, to, new NodeType(attrs, spec));\n }\n /**\n The spec provided when creating this decoration. Can be useful\n if you've stored extra information in that object.\n */\n get spec() { return this.type.spec; }\n /**\n @internal\n */\n get inline() { return this.type instanceof InlineType; }\n /**\n @internal\n */\n get widget() { return this.type instanceof WidgetType; }\n}\nconst none = [], noSpec = {};\n/**\nA collection of [decorations](https://prosemirror.net/docs/ref/#view.Decoration), organized in such\na way that the drawing algorithm can efficiently use and compare\nthem. This is a persistent data structure—it is not modified,\nupdates create a new value.\n*/\nclass DecorationSet {\n /**\n @internal\n */\n constructor(local, children) {\n this.local = local.length ? local : none;\n this.children = children.length ? children : none;\n }\n /**\n Create a set of decorations, using the structure of the given\n document. This will consume (modify) the `decorations` array, so\n you must make a copy if you want need to preserve that.\n */\n static create(doc, decorations) {\n return decorations.length ? buildTree(decorations, doc, 0, noSpec) : empty;\n }\n /**\n Find all decorations in this set which touch the given range\n (including decorations that start or end directly at the\n boundaries) and match the given predicate on their spec. When\n `start` and `end` are omitted, all decorations in the set are\n considered. When `predicate` isn't given, all decorations are\n assumed to match.\n */\n find(start, end, predicate) {\n let result = [];\n this.findInner(start == null ? 0 : start, end == null ? 1e9 : end, result, 0, predicate);\n return result;\n }\n findInner(start, end, result, offset, predicate) {\n for (let i = 0; i < this.local.length; i++) {\n let span = this.local[i];\n if (span.from <= end && span.to >= start && (!predicate || predicate(span.spec)))\n result.push(span.copy(span.from + offset, span.to + offset));\n }\n for (let i = 0; i < this.children.length; i += 3) {\n if (this.children[i] < end && this.children[i + 1] > start) {\n let childOff = this.children[i] + 1;\n this.children[i + 2].findInner(start - childOff, end - childOff, result, offset + childOff, predicate);\n }\n }\n }\n /**\n Map the set of decorations in response to a change in the\n document.\n */\n map(mapping, doc, options) {\n if (this == empty || mapping.maps.length == 0)\n return this;\n return this.mapInner(mapping, doc, 0, 0, options || noSpec);\n }\n /**\n @internal\n */\n mapInner(mapping, node, offset, oldOffset, options) {\n let newLocal;\n for (let i = 0; i < this.local.length; i++) {\n let mapped = this.local[i].map(mapping, offset, oldOffset);\n if (mapped && mapped.type.valid(node, mapped))\n (newLocal || (newLocal = [])).push(mapped);\n else if (options.onRemove)\n options.onRemove(this.local[i].spec);\n }\n if (this.children.length)\n return mapChildren(this.children, newLocal || [], mapping, node, offset, oldOffset, options);\n else\n return newLocal ? new DecorationSet(newLocal.sort(byPos), none) : empty;\n }\n /**\n Add the given array of decorations to the ones in the set,\n producing a new set. Consumes the `decorations` array. Needs\n access to the current document to create the appropriate tree\n structure.\n */\n add(doc, decorations) {\n if (!decorations.length)\n return this;\n if (this == empty)\n return DecorationSet.create(doc, decorations);\n return this.addInner(doc, decorations, 0);\n }\n addInner(doc, decorations, offset) {\n let children, childIndex = 0;\n doc.forEach((childNode, childOffset) => {\n let baseOffset = childOffset + offset, found;\n if (!(found = takeSpansForNode(decorations, childNode, baseOffset)))\n return;\n if (!children)\n children = this.children.slice();\n while (childIndex < children.length && children[childIndex] < childOffset)\n childIndex += 3;\n if (children[childIndex] == childOffset)\n children[childIndex + 2] = children[childIndex + 2].addInner(childNode, found, baseOffset + 1);\n else\n children.splice(childIndex, 0, childOffset, childOffset + childNode.nodeSize, buildTree(found, childNode, baseOffset + 1, noSpec));\n childIndex += 3;\n });\n let local = moveSpans(childIndex ? withoutNulls(decorations) : decorations, -offset);\n for (let i = 0; i < local.length; i++)\n if (!local[i].type.valid(doc, local[i]))\n local.splice(i--, 1);\n return new DecorationSet(local.length ? this.local.concat(local).sort(byPos) : this.local, children || this.children);\n }\n /**\n Create a new set that contains the decorations in this set, minus\n the ones in the given array.\n */\n remove(decorations) {\n if (decorations.length == 0 || this == empty)\n return this;\n return this.removeInner(decorations, 0);\n }\n removeInner(decorations, offset) {\n let children = this.children, local = this.local;\n for (let i = 0; i < children.length; i += 3) {\n let found;\n let from = children[i] + offset, to = children[i + 1] + offset;\n for (let j = 0, span; j < decorations.length; j++)\n if (span = decorations[j]) {\n if (span.from > from && span.to < to) {\n decorations[j] = null;\n (found || (found = [])).push(span);\n }\n }\n if (!found)\n continue;\n if (children == this.children)\n children = this.children.slice();\n let removed = children[i + 2].removeInner(found, from + 1);\n if (removed != empty) {\n children[i + 2] = removed;\n }\n else {\n children.splice(i, 3);\n i -= 3;\n }\n }\n if (local.length)\n for (let i = 0, span; i < decorations.length; i++)\n if (span = decorations[i]) {\n for (let j = 0; j < local.length; j++)\n if (local[j].eq(span, offset)) {\n if (local == this.local)\n local = this.local.slice();\n local.splice(j--, 1);\n }\n }\n if (children == this.children && local == this.local)\n return this;\n return local.length || children.length ? new DecorationSet(local, children) : empty;\n }\n forChild(offset, node) {\n if (this == empty)\n return this;\n if (node.isLeaf)\n return DecorationSet.empty;\n let child, local;\n for (let i = 0; i < this.children.length; i += 3)\n if (this.children[i] >= offset) {\n if (this.children[i] == offset)\n child = this.children[i + 2];\n break;\n }\n let start = offset + 1, end = start + node.content.size;\n for (let i = 0; i < this.local.length; i++) {\n let dec = this.local[i];\n if (dec.from < end && dec.to > start && (dec.type instanceof InlineType)) {\n let from = Math.max(start, dec.from) - start, to = Math.min(end, dec.to) - start;\n if (from < to)\n (local || (local = [])).push(dec.copy(from, to));\n }\n }\n if (local) {\n let localSet = new DecorationSet(local.sort(byPos), none);\n return child ? new DecorationGroup([localSet, child]) : localSet;\n }\n return child || empty;\n }\n /**\n @internal\n */\n eq(other) {\n if (this == other)\n return true;\n if (!(other instanceof DecorationSet) ||\n this.local.length != other.local.length ||\n this.children.length != other.children.length)\n return false;\n for (let i = 0; i < this.local.length; i++)\n if (!this.local[i].eq(other.local[i]))\n return false;\n for (let i = 0; i < this.children.length; i += 3)\n if (this.children[i] != other.children[i] ||\n this.children[i + 1] != other.children[i + 1] ||\n !this.children[i + 2].eq(other.children[i + 2]))\n return false;\n return true;\n }\n /**\n @internal\n */\n locals(node) {\n return removeOverlap(this.localsInner(node));\n }\n /**\n @internal\n */\n localsInner(node) {\n if (this == empty)\n return none;\n if (node.inlineContent || !this.local.some(InlineType.is))\n return this.local;\n let result = [];\n for (let i = 0; i < this.local.length; i++) {\n if (!(this.local[i].type instanceof InlineType))\n result.push(this.local[i]);\n }\n return result;\n }\n forEachSet(f) { f(this); }\n}\n/**\nThe empty set of decorations.\n*/\nDecorationSet.empty = new DecorationSet([], []);\n/**\n@internal\n*/\nDecorationSet.removeOverlap = removeOverlap;\nconst empty = DecorationSet.empty;\n// An abstraction that allows the code dealing with decorations to\n// treat multiple DecorationSet objects as if it were a single object\n// with (a subset of) the same interface.\nclass DecorationGroup {\n constructor(members) {\n this.members = members;\n }\n map(mapping, doc) {\n const mappedDecos = this.members.map(member => member.map(mapping, doc, noSpec));\n return DecorationGroup.from(mappedDecos);\n }\n forChild(offset, child) {\n if (child.isLeaf)\n return DecorationSet.empty;\n let found = [];\n for (let i = 0; i < this.members.length; i++) {\n let result = this.members[i].forChild(offset, child);\n if (result == empty)\n continue;\n if (result instanceof DecorationGroup)\n found = found.concat(result.members);\n else\n found.push(result);\n }\n return DecorationGroup.from(found);\n }\n eq(other) {\n if (!(other instanceof DecorationGroup) ||\n other.members.length != this.members.length)\n return false;\n for (let i = 0; i < this.members.length; i++)\n if (!this.members[i].eq(other.members[i]))\n return false;\n return true;\n }\n locals(node) {\n let result, sorted = true;\n for (let i = 0; i < this.members.length; i++) {\n let locals = this.members[i].localsInner(node);\n if (!locals.length)\n continue;\n if (!result) {\n result = locals;\n }\n else {\n if (sorted) {\n result = result.slice();\n sorted = false;\n }\n for (let j = 0; j < locals.length; j++)\n result.push(locals[j]);\n }\n }\n return result ? removeOverlap(sorted ? result : result.sort(byPos)) : none;\n }\n // Create a group for the given array of decoration sets, or return\n // a single set when possible.\n static from(members) {\n switch (members.length) {\n case 0: return empty;\n case 1: return members[0];\n default: return new DecorationGroup(members.every(m => m instanceof DecorationSet) ? members :\n members.reduce((r, m) => r.concat(m instanceof DecorationSet ? m : m.members), []));\n }\n }\n forEachSet(f) {\n for (let i = 0; i < this.members.length; i++)\n this.members[i].forEachSet(f);\n }\n}\nfunction mapChildren(oldChildren, newLocal, mapping, node, offset, oldOffset, options) {\n let children = oldChildren.slice();\n // Mark the children that are directly touched by changes, and\n // move those that are after the changes.\n for (let i = 0, baseOffset = oldOffset; i < mapping.maps.length; i++) {\n let moved = 0;\n mapping.maps[i].forEach((oldStart, oldEnd, newStart, newEnd) => {\n let dSize = (newEnd - newStart) - (oldEnd - oldStart);\n for (let i = 0; i < children.length; i += 3) {\n let end = children[i + 1];\n if (end < 0 || oldStart > end + baseOffset - moved)\n continue;\n let start = children[i] + baseOffset - moved;\n if (oldEnd >= start) {\n children[i + 1] = oldStart <= start ? -2 : -1;\n }\n else if (oldStart >= baseOffset && dSize) {\n children[i] += dSize;\n children[i + 1] += dSize;\n }\n }\n moved += dSize;\n });\n baseOffset = mapping.maps[i].map(baseOffset, -1);\n }\n // Find the child nodes that still correspond to a single node,\n // recursively call mapInner on them and update their positions.\n let mustRebuild = false;\n for (let i = 0; i < children.length; i += 3)\n if (children[i + 1] < 0) { // Touched nodes\n if (children[i + 1] == -2) {\n mustRebuild = true;\n children[i + 1] = -1;\n continue;\n }\n let from = mapping.map(oldChildren[i] + oldOffset), fromLocal = from - offset;\n if (fromLocal < 0 || fromLocal >= node.content.size) {\n mustRebuild = true;\n continue;\n }\n // Must read oldChildren because children was tagged with -1\n let to = mapping.map(oldChildren[i + 1] + oldOffset, -1), toLocal = to - offset;\n let { index, offset: childOffset } = node.content.findIndex(fromLocal);\n let childNode = node.maybeChild(index);\n if (childNode && childOffset == fromLocal && childOffset + childNode.nodeSize == toLocal) {\n let mapped = children[i + 2]\n .mapInner(mapping, childNode, from + 1, oldChildren[i] + oldOffset + 1, options);\n if (mapped != empty) {\n children[i] = fromLocal;\n children[i + 1] = toLocal;\n children[i + 2] = mapped;\n }\n else {\n children[i + 1] = -2;\n mustRebuild = true;\n }\n }\n else {\n mustRebuild = true;\n }\n }\n // Remaining children must be collected and rebuilt into the appropriate structure\n if (mustRebuild) {\n let decorations = mapAndGatherRemainingDecorations(children, oldChildren, newLocal, mapping, offset, oldOffset, options);\n let built = buildTree(decorations, node, 0, options);\n newLocal = built.local;\n for (let i = 0; i < children.length; i += 3)\n if (children[i + 1] < 0) {\n children.splice(i, 3);\n i -= 3;\n }\n for (let i = 0, j = 0; i < built.children.length; i += 3) {\n let from = built.children[i];\n while (j < children.length && children[j] < from)\n j += 3;\n children.splice(j, 0, built.children[i], built.children[i + 1], built.children[i + 2]);\n }\n }\n return new DecorationSet(newLocal.sort(byPos), children);\n}\nfunction moveSpans(spans, offset) {\n if (!offset || !spans.length)\n return spans;\n let result = [];\n for (let i = 0; i < spans.length; i++) {\n let span = spans[i];\n result.push(new Decoration(span.from + offset, span.to + offset, span.type));\n }\n return result;\n}\nfunction mapAndGatherRemainingDecorations(children, oldChildren, decorations, mapping, offset, oldOffset, options) {\n // Gather all decorations from the remaining marked children\n function gather(set, oldOffset) {\n for (let i = 0; i < set.local.length; i++) {\n let mapped = set.local[i].map(mapping, offset, oldOffset);\n if (mapped)\n decorations.push(mapped);\n else if (options.onRemove)\n options.onRemove(set.local[i].spec);\n }\n for (let i = 0; i < set.children.length; i += 3)\n gather(set.children[i + 2], set.children[i] + oldOffset + 1);\n }\n for (let i = 0; i < children.length; i += 3)\n if (children[i + 1] == -1)\n gather(children[i + 2], oldChildren[i] + oldOffset + 1);\n return decorations;\n}\nfunction takeSpansForNode(spans, node, offset) {\n if (node.isLeaf)\n return null;\n let end = offset + node.nodeSize, found = null;\n for (let i = 0, span; i < spans.length; i++) {\n if ((span = spans[i]) && span.from > offset && span.to < end) {\n (found || (found = [])).push(span);\n spans[i] = null;\n }\n }\n return found;\n}\nfunction withoutNulls(array) {\n let result = [];\n for (let i = 0; i < array.length; i++)\n if (array[i] != null)\n result.push(array[i]);\n return result;\n}\n// Build up a tree that corresponds to a set of decorations. `offset`\n// is a base offset that should be subtracted from the `from` and `to`\n// positions in the spans (so that we don't have to allocate new spans\n// for recursive calls).\nfunction buildTree(spans, node, offset, options) {\n let children = [], hasNulls = false;\n node.forEach((childNode, localStart) => {\n let found = takeSpansForNode(spans, childNode, localStart + offset);\n if (found) {\n hasNulls = true;\n let subtree = buildTree(found, childNode, offset + localStart + 1, options);\n if (subtree != empty)\n children.push(localStart, localStart + childNode.nodeSize, subtree);\n }\n });\n let locals = moveSpans(hasNulls ? withoutNulls(spans) : spans, -offset).sort(byPos);\n for (let i = 0; i < locals.length; i++)\n if (!locals[i].type.valid(node, locals[i])) {\n if (options.onRemove)\n options.onRemove(locals[i].spec);\n locals.splice(i--, 1);\n }\n return locals.length || children.length ? new DecorationSet(locals, children) : empty;\n}\n// Used to sort decorations so that ones with a low start position\n// come first, and within a set with the same start position, those\n// with an smaller end position come first.\nfunction byPos(a, b) {\n return a.from - b.from || a.to - b.to;\n}\n// Scan a sorted array of decorations for partially overlapping spans,\n// and split those so that only fully overlapping spans are left (to\n// make subsequent rendering easier). Will return the input array if\n// no partially overlapping spans are found (the common case).\nfunction removeOverlap(spans) {\n let working = spans;\n for (let i = 0; i < working.length - 1; i++) {\n let span = working[i];\n if (span.from != span.to)\n for (let j = i + 1; j < working.length; j++) {\n let next = working[j];\n if (next.from == span.from) {\n if (next.to != span.to) {\n if (working == spans)\n working = spans.slice();\n // Followed by a partially overlapping larger span. Split that\n // span.\n working[j] = next.copy(next.from, span.to);\n insertAhead(working, j + 1, next.copy(span.to, next.to));\n }\n continue;\n }\n else {\n if (next.from < span.to) {\n if (working == spans)\n working = spans.slice();\n // The end of this one overlaps with a subsequent span. Split\n // this one.\n working[i] = span.copy(span.from, next.from);\n insertAhead(working, j, span.copy(next.from, span.to));\n }\n break;\n }\n }\n }\n return working;\n}\nfunction insertAhead(array, i, deco) {\n while (i < array.length && byPos(deco, array[i]) > 0)\n i++;\n array.splice(i, 0, deco);\n}\n// Get the decorations associated with the current props of a view.\nfunction viewDecorations(view) {\n let found = [];\n view.someProp(\"decorations\", f => {\n let result = f(view.state);\n if (result && result != empty)\n found.push(result);\n });\n if (view.cursorWrapper)\n found.push(DecorationSet.create(view.state.doc, [view.cursorWrapper.deco]));\n return DecorationGroup.from(found);\n}\n\nconst observeOptions = {\n childList: true,\n characterData: true,\n characterDataOldValue: true,\n attributes: true,\n attributeOldValue: true,\n subtree: true\n};\n// IE11 has very broken mutation observers, so we also listen to DOMCharacterDataModified\nconst useCharData = ie && ie_version <= 11;\nclass SelectionState {\n constructor() {\n this.anchorNode = null;\n this.anchorOffset = 0;\n this.focusNode = null;\n this.focusOffset = 0;\n }\n set(sel) {\n this.anchorNode = sel.anchorNode;\n this.anchorOffset = sel.anchorOffset;\n this.focusNode = sel.focusNode;\n this.focusOffset = sel.focusOffset;\n }\n clear() {\n this.anchorNode = this.focusNode = null;\n }\n eq(sel) {\n return sel.anchorNode == this.anchorNode && sel.anchorOffset == this.anchorOffset &&\n sel.focusNode == this.focusNode && sel.focusOffset == this.focusOffset;\n }\n}\nclass DOMObserver {\n constructor(view, handleDOMChange) {\n this.view = view;\n this.handleDOMChange = handleDOMChange;\n this.queue = [];\n this.flushingSoon = -1;\n this.observer = null;\n this.currentSelection = new SelectionState;\n this.onCharData = null;\n this.suppressingSelectionUpdates = false;\n this.lastChangedTextNode = null;\n this.observer = window.MutationObserver &&\n new window.MutationObserver(mutations => {\n for (let i = 0; i < mutations.length; i++)\n this.queue.push(mutations[i]);\n // IE11 will sometimes (on backspacing out a single character\n // text node after a BR node) call the observer callback\n // before actually updating the DOM, which will cause\n // ProseMirror to miss the change (see #930)\n if (ie && ie_version <= 11 && mutations.some(m => m.type == \"childList\" && m.removedNodes.length ||\n m.type == \"characterData\" && m.oldValue.length > m.target.nodeValue.length))\n this.flushSoon();\n else\n this.flush();\n });\n if (useCharData) {\n this.onCharData = e => {\n this.queue.push({ target: e.target, type: \"characterData\", oldValue: e.prevValue });\n this.flushSoon();\n };\n }\n this.onSelectionChange = this.onSelectionChange.bind(this);\n }\n flushSoon() {\n if (this.flushingSoon < 0)\n this.flushingSoon = window.setTimeout(() => { this.flushingSoon = -1; this.flush(); }, 20);\n }\n forceFlush() {\n if (this.flushingSoon > -1) {\n window.clearTimeout(this.flushingSoon);\n this.flushingSoon = -1;\n this.flush();\n }\n }\n start() {\n if (this.observer) {\n this.observer.takeRecords();\n this.observer.observe(this.view.dom, observeOptions);\n }\n if (this.onCharData)\n this.view.dom.addEventListener(\"DOMCharacterDataModified\", this.onCharData);\n this.connectSelection();\n }\n stop() {\n if (this.observer) {\n let take = this.observer.takeRecords();\n if (take.length) {\n for (let i = 0; i < take.length; i++)\n this.queue.push(take[i]);\n window.setTimeout(() => this.flush(), 20);\n }\n this.observer.disconnect();\n }\n if (this.onCharData)\n this.view.dom.removeEventListener(\"DOMCharacterDataModified\", this.onCharData);\n this.disconnectSelection();\n }\n connectSelection() {\n this.view.dom.ownerDocument.addEventListener(\"selectionchange\", this.onSelectionChange);\n }\n disconnectSelection() {\n this.view.dom.ownerDocument.removeEventListener(\"selectionchange\", this.onSelectionChange);\n }\n suppressSelectionUpdates() {\n this.suppressingSelectionUpdates = true;\n setTimeout(() => this.suppressingSelectionUpdates = false, 50);\n }\n onSelectionChange() {\n if (!hasFocusAndSelection(this.view))\n return;\n if (this.suppressingSelectionUpdates)\n return selectionToDOM(this.view);\n // Deletions on IE11 fire their events in the wrong order, giving\n // us a selection change event before the DOM changes are\n // reported.\n if (ie && ie_version <= 11 && !this.view.state.selection.empty) {\n let sel = this.view.domSelectionRange();\n // Selection.isCollapsed isn't reliable on IE\n if (sel.focusNode && isEquivalentPosition(sel.focusNode, sel.focusOffset, sel.anchorNode, sel.anchorOffset))\n return this.flushSoon();\n }\n this.flush();\n }\n setCurSelection() {\n this.currentSelection.set(this.view.domSelectionRange());\n }\n ignoreSelectionChange(sel) {\n if (!sel.focusNode)\n return true;\n let ancestors = new Set, container;\n for (let scan = sel.focusNode; scan; scan = parentNode(scan))\n ancestors.add(scan);\n for (let scan = sel.anchorNode; scan; scan = parentNode(scan))\n if (ancestors.has(scan)) {\n container = scan;\n break;\n }\n let desc = container && this.view.docView.nearestDesc(container);\n if (desc && desc.ignoreMutation({\n type: \"selection\",\n target: container.nodeType == 3 ? container.parentNode : container\n })) {\n this.setCurSelection();\n return true;\n }\n }\n pendingRecords() {\n if (this.observer)\n for (let mut of this.observer.takeRecords())\n this.queue.push(mut);\n return this.queue;\n }\n flush() {\n let { view } = this;\n if (!view.docView || this.flushingSoon > -1)\n return;\n let mutations = this.pendingRecords();\n if (mutations.length)\n this.queue = [];\n let sel = view.domSelectionRange();\n let newSel = !this.suppressingSelectionUpdates && !this.currentSelection.eq(sel) && hasFocusAndSelection(view) && !this.ignoreSelectionChange(sel);\n let from = -1, to = -1, typeOver = false, added = [];\n if (view.editable) {\n for (let i = 0; i < mutations.length; i++) {\n let result = this.registerMutation(mutations[i], added);\n if (result) {\n from = from < 0 ? result.from : Math.min(result.from, from);\n to = to < 0 ? result.to : Math.max(result.to, to);\n if (result.typeOver)\n typeOver = true;\n }\n }\n }\n if (gecko && added.length) {\n let brs = added.filter(n => n.nodeName == \"BR\");\n if (brs.length == 2) {\n let [a, b] = brs;\n if (a.parentNode && a.parentNode.parentNode == b.parentNode)\n b.remove();\n else\n a.remove();\n }\n else {\n let { focusNode } = this.currentSelection;\n for (let br of brs) {\n let parent = br.parentNode;\n if (parent && parent.nodeName == \"LI\" && (!focusNode || blockParent(view, focusNode) != parent))\n br.remove();\n }\n }\n }\n let readSel = null;\n // If it looks like the browser has reset the selection to the\n // start of the document after focus, restore the selection from\n // the state\n if (from < 0 && newSel && view.input.lastFocus > Date.now() - 200 &&\n Math.max(view.input.lastTouch, view.input.lastClick.time) < Date.now() - 300 &&\n selectionCollapsed(sel) && (readSel = selectionFromDOM(view)) &&\n readSel.eq(Selection.near(view.state.doc.resolve(0), 1))) {\n view.input.lastFocus = 0;\n selectionToDOM(view);\n this.currentSelection.set(sel);\n view.scrollToSelection();\n }\n else if (from > -1 || newSel) {\n if (from > -1) {\n view.docView.markDirty(from, to);\n checkCSS(view);\n }\n this.handleDOMChange(from, to, typeOver, added);\n if (view.docView && view.docView.dirty)\n view.updateState(view.state);\n else if (!this.currentSelection.eq(sel))\n selectionToDOM(view);\n this.currentSelection.set(sel);\n }\n }\n registerMutation(mut, added) {\n // Ignore mutations inside nodes that were already noted as inserted\n if (added.indexOf(mut.target) > -1)\n return null;\n let desc = this.view.docView.nearestDesc(mut.target);\n if (mut.type == \"attributes\" &&\n (desc == this.view.docView || mut.attributeName == \"contenteditable\" ||\n // Firefox sometimes fires spurious events for null/empty styles\n (mut.attributeName == \"style\" && !mut.oldValue && !mut.target.getAttribute(\"style\"))))\n return null;\n if (!desc || desc.ignoreMutation(mut))\n return null;\n if (mut.type == \"childList\") {\n for (let i = 0; i < mut.addedNodes.length; i++) {\n let node = mut.addedNodes[i];\n added.push(node);\n if (node.nodeType == 3)\n this.lastChangedTextNode = node;\n }\n if (desc.contentDOM && desc.contentDOM != desc.dom && !desc.contentDOM.contains(mut.target))\n return { from: desc.posBefore, to: desc.posAfter };\n let prev = mut.previousSibling, next = mut.nextSibling;\n if (ie && ie_version <= 11 && mut.addedNodes.length) {\n // IE11 gives us incorrect next/prev siblings for some\n // insertions, so if there are added nodes, recompute those\n for (let i = 0; i < mut.addedNodes.length; i++) {\n let { previousSibling, nextSibling } = mut.addedNodes[i];\n if (!previousSibling || Array.prototype.indexOf.call(mut.addedNodes, previousSibling) < 0)\n prev = previousSibling;\n if (!nextSibling || Array.prototype.indexOf.call(mut.addedNodes, nextSibling) < 0)\n next = nextSibling;\n }\n }\n let fromOffset = prev && prev.parentNode == mut.target\n ? domIndex(prev) + 1 : 0;\n let from = desc.localPosFromDOM(mut.target, fromOffset, -1);\n let toOffset = next && next.parentNode == mut.target\n ? domIndex(next) : mut.target.childNodes.length;\n let to = desc.localPosFromDOM(mut.target, toOffset, 1);\n return { from, to };\n }\n else if (mut.type == \"attributes\") {\n return { from: desc.posAtStart - desc.border, to: desc.posAtEnd + desc.border };\n }\n else { // \"characterData\"\n this.lastChangedTextNode = mut.target;\n return {\n from: desc.posAtStart,\n to: desc.posAtEnd,\n // An event was generated for a text change that didn't change\n // any text. Mark the dom change to fall back to assuming the\n // selection was typed over with an identical value if it can't\n // find another change.\n typeOver: mut.target.nodeValue == mut.oldValue\n };\n }\n }\n}\nlet cssChecked = new WeakMap();\nlet cssCheckWarned = false;\nfunction checkCSS(view) {\n if (cssChecked.has(view))\n return;\n cssChecked.set(view, null);\n if (['normal', 'nowrap', 'pre-line'].indexOf(getComputedStyle(view.dom).whiteSpace) !== -1) {\n view.requiresGeckoHackNode = gecko;\n if (cssCheckWarned)\n return;\n 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.\");\n cssCheckWarned = true;\n }\n}\nfunction rangeToSelectionRange(view, range) {\n let anchorNode = range.startContainer, anchorOffset = range.startOffset;\n let focusNode = range.endContainer, focusOffset = range.endOffset;\n let currentAnchor = view.domAtPos(view.state.selection.anchor);\n // Since such a range doesn't distinguish between anchor and head,\n // use a heuristic that flips it around if its end matches the\n // current anchor.\n if (isEquivalentPosition(currentAnchor.node, currentAnchor.offset, focusNode, focusOffset))\n [anchorNode, anchorOffset, focusNode, focusOffset] = [focusNode, focusOffset, anchorNode, anchorOffset];\n return { anchorNode, anchorOffset, focusNode, focusOffset };\n}\n// Used to work around a Safari Selection/shadow DOM bug\n// Based on https://github.com/codemirror/dev/issues/414 fix\nfunction safariShadowSelectionRange(view, selection) {\n if (selection.getComposedRanges) {\n let range = selection.getComposedRanges(view.root)[0];\n if (range)\n return rangeToSelectionRange(view, range);\n }\n let found;\n function read(event) {\n event.preventDefault();\n event.stopImmediatePropagation();\n found = event.getTargetRanges()[0];\n }\n // Because Safari (at least in 2018-2022) doesn't provide regular\n // access to the selection inside a shadowRoot, we have to perform a\n // ridiculous hack to get at it—using `execCommand` to trigger a\n // `beforeInput` event so that we can read the target range from the\n // event.\n view.dom.addEventListener(\"beforeinput\", read, true);\n document.execCommand(\"indent\");\n view.dom.removeEventListener(\"beforeinput\", read, true);\n return found ? rangeToSelectionRange(view, found) : null;\n}\nfunction blockParent(view, node) {\n for (let p = node.parentNode; p && p != view.dom; p = p.parentNode) {\n let desc = view.docView.nearestDesc(p, true);\n if (desc && desc.node.isBlock)\n return p;\n }\n return null;\n}\n\n// Note that all referencing and parsing is done with the\n// start-of-operation selection and document, since that's the one\n// that the DOM represents. If any changes came in in the meantime,\n// the modification is mapped over those before it is applied, in\n// readDOMChange.\nfunction parseBetween(view, from_, to_) {\n let { node: parent, fromOffset, toOffset, from, to } = view.docView.parseRange(from_, to_);\n let domSel = view.domSelectionRange();\n let find;\n let anchor = domSel.anchorNode;\n if (anchor && view.dom.contains(anchor.nodeType == 1 ? anchor : anchor.parentNode)) {\n find = [{ node: anchor, offset: domSel.anchorOffset }];\n if (!selectionCollapsed(domSel))\n find.push({ node: domSel.focusNode, offset: domSel.focusOffset });\n }\n // Work around issue in Chrome where backspacing sometimes replaces\n // the deleted content with a random BR node (issues #799, #831)\n if (chrome && view.input.lastKeyCode === 8) {\n for (let off = toOffset; off > fromOffset; off--) {\n let node = parent.childNodes[off - 1], desc = node.pmViewDesc;\n if (node.nodeName == \"BR\" && !desc) {\n toOffset = off;\n break;\n }\n if (!desc || desc.size)\n break;\n }\n }\n let startDoc = view.state.doc;\n let parser = view.someProp(\"domParser\") || DOMParser.fromSchema(view.state.schema);\n let $from = startDoc.resolve(from);\n let sel = null, doc = parser.parse(parent, {\n topNode: $from.parent,\n topMatch: $from.parent.contentMatchAt($from.index()),\n topOpen: true,\n from: fromOffset,\n to: toOffset,\n preserveWhitespace: $from.parent.type.whitespace == \"pre\" ? \"full\" : true,\n findPositions: find,\n ruleFromNode,\n context: $from\n });\n if (find && find[0].pos != null) {\n let anchor = find[0].pos, head = find[1] && find[1].pos;\n if (head == null)\n head = anchor;\n sel = { anchor: anchor + from, head: head + from };\n }\n return { doc, sel, from, to };\n}\nfunction ruleFromNode(dom) {\n let desc = dom.pmViewDesc;\n if (desc) {\n return desc.parseRule();\n }\n else if (dom.nodeName == \"BR\" && dom.parentNode) {\n // Safari replaces the list item or table cell with a BR\n // directly in the list node (?!) if you delete the last\n // character in a list item or table cell (#708, #862)\n if (safari && /^(ul|ol)$/i.test(dom.parentNode.nodeName)) {\n let skip = document.createElement(\"div\");\n skip.appendChild(document.createElement(\"li\"));\n return { skip };\n }\n else if (dom.parentNode.lastChild == dom || safari && /^(tr|table)$/i.test(dom.parentNode.nodeName)) {\n return { ignore: true };\n }\n }\n else if (dom.nodeName == \"IMG\" && dom.getAttribute(\"mark-placeholder\")) {\n return { ignore: true };\n }\n return null;\n}\nconst isInline = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;\nfunction readDOMChange(view, from, to, typeOver, addedNodes) {\n let compositionID = view.input.compositionPendingChanges || (view.composing ? view.input.compositionID : 0);\n view.input.compositionPendingChanges = 0;\n if (from < 0) {\n let origin = view.input.lastSelectionTime > Date.now() - 50 ? view.input.lastSelectionOrigin : null;\n let newSel = selectionFromDOM(view, origin);\n if (newSel && !view.state.selection.eq(newSel)) {\n if (chrome && android &&\n view.input.lastKeyCode === 13 && Date.now() - 100 < view.input.lastKeyCodeTime &&\n view.someProp(\"handleKeyDown\", f => f(view, keyEvent(13, \"Enter\"))))\n return;\n let tr = view.state.tr.setSelection(newSel);\n if (origin == \"pointer\")\n tr.setMeta(\"pointer\", true);\n else if (origin == \"key\")\n tr.scrollIntoView();\n if (compositionID)\n tr.setMeta(\"composition\", compositionID);\n view.dispatch(tr);\n }\n return;\n }\n let $before = view.state.doc.resolve(from);\n let shared = $before.sharedDepth(to);\n from = $before.before(shared + 1);\n to = view.state.doc.resolve(to).after(shared + 1);\n let sel = view.state.selection;\n let parse = parseBetween(view, from, to);\n let doc = view.state.doc, compare = doc.slice(parse.from, parse.to);\n let preferredPos, preferredSide;\n // Prefer anchoring to end when Backspace is pressed\n if (view.input.lastKeyCode === 8 && Date.now() - 100 < view.input.lastKeyCodeTime) {\n preferredPos = view.state.selection.to;\n preferredSide = \"end\";\n }\n else {\n preferredPos = view.state.selection.from;\n preferredSide = \"start\";\n }\n view.input.lastKeyCode = null;\n let change = findDiff(compare.content, parse.doc.content, parse.from, preferredPos, preferredSide);\n if (change)\n view.input.domChangeCount++;\n if ((ios && view.input.lastIOSEnter > Date.now() - 225 || android) &&\n addedNodes.some(n => n.nodeType == 1 && !isInline.test(n.nodeName)) &&\n (!change || change.endA >= change.endB) &&\n view.someProp(\"handleKeyDown\", f => f(view, keyEvent(13, \"Enter\")))) {\n view.input.lastIOSEnter = 0;\n return;\n }\n if (!change) {\n if (typeOver && sel instanceof TextSelection && !sel.empty && sel.$head.sameParent(sel.$anchor) &&\n !view.composing && !(parse.sel && parse.sel.anchor != parse.sel.head)) {\n change = { start: sel.from, endA: sel.to, endB: sel.to };\n }\n else {\n if (parse.sel) {\n let sel = resolveSelection(view, view.state.doc, parse.sel);\n if (sel && !sel.eq(view.state.selection)) {\n let tr = view.state.tr.setSelection(sel);\n if (compositionID)\n tr.setMeta(\"composition\", compositionID);\n view.dispatch(tr);\n }\n }\n return;\n }\n }\n // Handle the case where overwriting a selection by typing matches\n // the start or end of the selected content, creating a change\n // that's smaller than what was actually overwritten.\n if (view.state.selection.from < view.state.selection.to &&\n change.start == change.endB &&\n view.state.selection instanceof TextSelection) {\n if (change.start > view.state.selection.from && change.start <= view.state.selection.from + 2 &&\n view.state.selection.from >= parse.from) {\n change.start = view.state.selection.from;\n }\n else if (change.endA < view.state.selection.to && change.endA >= view.state.selection.to - 2 &&\n view.state.selection.to <= parse.to) {\n change.endB += (view.state.selection.to - change.endA);\n change.endA = view.state.selection.to;\n }\n }\n // IE11 will insert a non-breaking space _ahead_ of the space after\n // the cursor space when adding a space before another space. When\n // that happened, adjust the change to cover the space instead.\n if (ie && ie_version <= 11 && change.endB == change.start + 1 &&\n change.endA == change.start && change.start > parse.from &&\n parse.doc.textBetween(change.start - parse.from - 1, change.start - parse.from + 1) == \" \\u00a0\") {\n change.start--;\n change.endA--;\n change.endB--;\n }\n let $from = parse.doc.resolveNoCache(change.start - parse.from);\n let $to = parse.doc.resolveNoCache(change.endB - parse.from);\n let $fromA = doc.resolve(change.start);\n let inlineChange = $from.sameParent($to) && $from.parent.inlineContent && $fromA.end() >= change.endA;\n let nextSel;\n // If this looks like the effect of pressing Enter (or was recorded\n // as being an iOS enter press), just dispatch an Enter key instead.\n if (((ios && view.input.lastIOSEnter > Date.now() - 225 &&\n (!inlineChange || addedNodes.some(n => n.nodeName == \"DIV\" || n.nodeName == \"P\"))) ||\n (!inlineChange && $from.pos < parse.doc.content.size && !$from.sameParent($to) &&\n (nextSel = Selection.findFrom(parse.doc.resolve($from.pos + 1), 1, true)) &&\n nextSel.head == $to.pos)) &&\n view.someProp(\"handleKeyDown\", f => f(view, keyEvent(13, \"Enter\")))) {\n view.input.lastIOSEnter = 0;\n return;\n }\n // Same for backspace\n if (view.state.selection.anchor > change.start &&\n looksLikeBackspace(doc, change.start, change.endA, $from, $to) &&\n view.someProp(\"handleKeyDown\", f => f(view, keyEvent(8, \"Backspace\")))) {\n if (android && chrome)\n view.domObserver.suppressSelectionUpdates(); // #820\n return;\n }\n // Chrome Android will occasionally, during composition, delete the\n // entire composition and then immediately insert it again. This is\n // used to detect that situation.\n if (chrome && android && change.endB == change.start)\n view.input.lastAndroidDelete = Date.now();\n // This tries to detect Android virtual keyboard\n // enter-and-pick-suggestion action. That sometimes (see issue\n // #1059) first fires a DOM mutation, before moving the selection to\n // the newly created block. And then, because ProseMirror cleans up\n // the DOM selection, it gives up moving the selection entirely,\n // leaving the cursor in the wrong place. When that happens, we drop\n // the new paragraph from the initial change, and fire a simulated\n // enter key afterwards.\n if (android && !inlineChange && $from.start() != $to.start() && $to.parentOffset == 0 && $from.depth == $to.depth &&\n parse.sel && parse.sel.anchor == parse.sel.head && parse.sel.head == change.endA) {\n change.endB -= 2;\n $to = parse.doc.resolveNoCache(change.endB - parse.from);\n setTimeout(() => {\n view.someProp(\"handleKeyDown\", function (f) { return f(view, keyEvent(13, \"Enter\")); });\n }, 20);\n }\n let chFrom = change.start, chTo = change.endA;\n let tr, storedMarks, markChange;\n if (inlineChange) {\n if ($from.pos == $to.pos) { // Deletion\n // IE11 sometimes weirdly moves the DOM selection around after\n // backspacing out the first element in a textblock\n if (ie && ie_version <= 11 && $from.parentOffset == 0) {\n view.domObserver.suppressSelectionUpdates();\n setTimeout(() => selectionToDOM(view), 20);\n }\n tr = view.state.tr.delete(chFrom, chTo);\n storedMarks = doc.resolve(change.start).marksAcross(doc.resolve(change.endA));\n }\n else if ( // Adding or removing a mark\n change.endA == change.endB &&\n (markChange = isMarkChange($from.parent.content.cut($from.parentOffset, $to.parentOffset), $fromA.parent.content.cut($fromA.parentOffset, change.endA - $fromA.start())))) {\n tr = view.state.tr;\n if (markChange.type == \"add\")\n tr.addMark(chFrom, chTo, markChange.mark);\n else\n tr.removeMark(chFrom, chTo, markChange.mark);\n }\n else if ($from.parent.child($from.index()).isText && $from.index() == $to.index() - ($to.textOffset ? 0 : 1)) {\n // Both positions in the same text node -- simply insert text\n let text = $from.parent.textBetween($from.parentOffset, $to.parentOffset);\n if (view.someProp(\"handleTextInput\", f => f(view, chFrom, chTo, text)))\n return;\n tr = view.state.tr.insertText(text, chFrom, chTo);\n }\n }\n if (!tr)\n tr = view.state.tr.replace(chFrom, chTo, parse.doc.slice(change.start - parse.from, change.endB - parse.from));\n if (parse.sel) {\n let sel = resolveSelection(view, tr.doc, parse.sel);\n // Chrome Android will sometimes, during composition, report the\n // selection in the wrong place. If it looks like that is\n // happening, don't update the selection.\n // Edge just doesn't move the cursor forward when you start typing\n // in an empty block or between br nodes.\n if (sel && !(chrome && android && view.composing && sel.empty &&\n (change.start != change.endB || view.input.lastAndroidDelete < Date.now() - 100) &&\n (sel.head == chFrom || sel.head == tr.mapping.map(chTo) - 1) ||\n ie && sel.empty && sel.head == chFrom))\n tr.setSelection(sel);\n }\n if (storedMarks)\n tr.ensureMarks(storedMarks);\n if (compositionID)\n tr.setMeta(\"composition\", compositionID);\n view.dispatch(tr.scrollIntoView());\n}\nfunction resolveSelection(view, doc, parsedSel) {\n if (Math.max(parsedSel.anchor, parsedSel.head) > doc.content.size)\n return null;\n return selectionBetween(view, doc.resolve(parsedSel.anchor), doc.resolve(parsedSel.head));\n}\n// Given two same-length, non-empty fragments of inline content,\n// determine whether the first could be created from the second by\n// removing or adding a single mark type.\nfunction isMarkChange(cur, prev) {\n let curMarks = cur.firstChild.marks, prevMarks = prev.firstChild.marks;\n let added = curMarks, removed = prevMarks, type, mark, update;\n for (let i = 0; i < prevMarks.length; i++)\n added = prevMarks[i].removeFromSet(added);\n for (let i = 0; i < curMarks.length; i++)\n removed = curMarks[i].removeFromSet(removed);\n if (added.length == 1 && removed.length == 0) {\n mark = added[0];\n type = \"add\";\n update = (node) => node.mark(mark.addToSet(node.marks));\n }\n else if (added.length == 0 && removed.length == 1) {\n mark = removed[0];\n type = \"remove\";\n update = (node) => node.mark(mark.removeFromSet(node.marks));\n }\n else {\n return null;\n }\n let updated = [];\n for (let i = 0; i < prev.childCount; i++)\n updated.push(update(prev.child(i)));\n if (Fragment.from(updated).eq(cur))\n return { mark, type };\n}\nfunction looksLikeBackspace(old, start, end, $newStart, $newEnd) {\n if ( // The content must have shrunk\n end - start <= $newEnd.pos - $newStart.pos ||\n // newEnd must point directly at or after the end of the block that newStart points into\n skipClosingAndOpening($newStart, true, false) < $newEnd.pos)\n return false;\n let $start = old.resolve(start);\n // Handle the case where, rather than joining blocks, the change just removed an entire block\n if (!$newStart.parent.isTextblock) {\n let after = $start.nodeAfter;\n return after != null && end == start + after.nodeSize;\n }\n // Start must be at the end of a block\n if ($start.parentOffset < $start.parent.content.size || !$start.parent.isTextblock)\n return false;\n let $next = old.resolve(skipClosingAndOpening($start, true, true));\n // The next textblock must start before end and end near it\n if (!$next.parent.isTextblock || $next.pos > end ||\n skipClosingAndOpening($next, true, false) < end)\n return false;\n // The fragments after the join point must match\n return $newStart.parent.content.cut($newStart.parentOffset).eq($next.parent.content);\n}\nfunction skipClosingAndOpening($pos, fromEnd, mayOpen) {\n let depth = $pos.depth, end = fromEnd ? $pos.end() : $pos.pos;\n while (depth > 0 && (fromEnd || $pos.indexAfter(depth) == $pos.node(depth).childCount)) {\n depth--;\n end++;\n fromEnd = false;\n }\n if (mayOpen) {\n let next = $pos.node(depth).maybeChild($pos.indexAfter(depth));\n while (next && !next.isLeaf) {\n next = next.firstChild;\n end++;\n }\n }\n return end;\n}\nfunction findDiff(a, b, pos, preferredPos, preferredSide) {\n let start = a.findDiffStart(b, pos);\n if (start == null)\n return null;\n let { a: endA, b: endB } = a.findDiffEnd(b, pos + a.size, pos + b.size);\n if (preferredSide == \"end\") {\n let adjust = Math.max(0, start - Math.min(endA, endB));\n preferredPos -= endA + adjust - start;\n }\n if (endA < start && a.size < b.size) {\n let move = preferredPos <= start && preferredPos >= endA ? start - preferredPos : 0;\n start -= move;\n if (start && start < b.size && isSurrogatePair(b.textBetween(start - 1, start + 1)))\n start += move ? 1 : -1;\n endB = start + (endB - endA);\n endA = start;\n }\n else if (endB < start) {\n let move = preferredPos <= start && preferredPos >= endB ? start - preferredPos : 0;\n start -= move;\n if (start && start < a.size && isSurrogatePair(a.textBetween(start - 1, start + 1)))\n start += move ? 1 : -1;\n endA = start + (endA - endB);\n endB = start;\n }\n return { start, endA, endB };\n}\nfunction isSurrogatePair(str) {\n if (str.length != 2)\n return false;\n let a = str.charCodeAt(0), b = str.charCodeAt(1);\n return a >= 0xDC00 && a <= 0xDFFF && b >= 0xD800 && b <= 0xDBFF;\n}\n\n/**\n@internal\n*/\nconst __serializeForClipboard = serializeForClipboard;\n/**\n@internal\n*/\nconst __parseFromClipboard = parseFromClipboard;\n/**\n@internal\n*/\nconst __endComposition = endComposition;\n/**\nAn editor view manages the DOM structure that represents an\neditable document. Its state and behavior are determined by its\n[props](https://prosemirror.net/docs/ref/#view.DirectEditorProps).\n*/\nclass EditorView {\n /**\n Create a view. `place` may be a DOM node that the editor should\n be appended to, a function that will place it into the document,\n or an object whose `mount` property holds the node to use as the\n document container. If it is `null`, the editor will not be\n added to the document.\n */\n constructor(place, props) {\n this._root = null;\n /**\n @internal\n */\n this.focused = false;\n /**\n Kludge used to work around a Chrome bug @internal\n */\n this.trackWrites = null;\n this.mounted = false;\n /**\n @internal\n */\n this.markCursor = null;\n /**\n @internal\n */\n this.cursorWrapper = null;\n /**\n @internal\n */\n this.lastSelectedViewDesc = undefined;\n /**\n @internal\n */\n this.input = new InputState;\n this.prevDirectPlugins = [];\n this.pluginViews = [];\n /**\n Holds `true` when a hack node is needed in Firefox to prevent the\n [space is eaten issue](https://github.com/ProseMirror/prosemirror/issues/651)\n @internal\n */\n this.requiresGeckoHackNode = false;\n /**\n When editor content is being dragged, this object contains\n information about the dragged slice and whether it is being\n copied or moved. At any other time, it is null.\n */\n this.dragging = null;\n this._props = props;\n this.state = props.state;\n this.directPlugins = props.plugins || [];\n this.directPlugins.forEach(checkStateComponent);\n this.dispatch = this.dispatch.bind(this);\n this.dom = (place && place.mount) || document.createElement(\"div\");\n if (place) {\n if (place.appendChild)\n place.appendChild(this.dom);\n else if (typeof place == \"function\")\n place(this.dom);\n else if (place.mount)\n this.mounted = true;\n }\n this.editable = getEditable(this);\n updateCursorWrapper(this);\n this.nodeViews = buildNodeViews(this);\n this.docView = docViewDesc(this.state.doc, computeDocDeco(this), viewDecorations(this), this.dom, this);\n this.domObserver = new DOMObserver(this, (from, to, typeOver, added) => readDOMChange(this, from, to, typeOver, added));\n this.domObserver.start();\n initInput(this);\n this.updatePluginViews();\n }\n /**\n Holds `true` when a\n [composition](https://w3c.github.io/uievents/#events-compositionevents)\n is active.\n */\n get composing() { return this.input.composing; }\n /**\n The view's current [props](https://prosemirror.net/docs/ref/#view.EditorProps).\n */\n get props() {\n if (this._props.state != this.state) {\n let prev = this._props;\n this._props = {};\n for (let name in prev)\n this._props[name] = prev[name];\n this._props.state = this.state;\n }\n return this._props;\n }\n /**\n Update the view's props. Will immediately cause an update to\n the DOM.\n */\n update(props) {\n if (props.handleDOMEvents != this._props.handleDOMEvents)\n ensureListeners(this);\n let prevProps = this._props;\n this._props = props;\n if (props.plugins) {\n props.plugins.forEach(checkStateComponent);\n this.directPlugins = props.plugins;\n }\n this.updateStateInner(props.state, prevProps);\n }\n /**\n Update the view by updating existing props object with the object\n given as argument. Equivalent to `view.update(Object.assign({},\n view.props, props))`.\n */\n setProps(props) {\n let updated = {};\n for (let name in this._props)\n updated[name] = this._props[name];\n updated.state = this.state;\n for (let name in props)\n updated[name] = props[name];\n this.update(updated);\n }\n /**\n Update the editor's `state` prop, without touching any of the\n other props.\n */\n updateState(state) {\n this.updateStateInner(state, this._props);\n }\n updateStateInner(state, prevProps) {\n var _a;\n let prev = this.state, redraw = false, updateSel = false;\n // When stored marks are added, stop composition, so that they can\n // be displayed.\n if (state.storedMarks && this.composing) {\n clearComposition(this);\n updateSel = true;\n }\n this.state = state;\n let pluginsChanged = prev.plugins != state.plugins || this._props.plugins != prevProps.plugins;\n if (pluginsChanged || this._props.plugins != prevProps.plugins || this._props.nodeViews != prevProps.nodeViews) {\n let nodeViews = buildNodeViews(this);\n if (changedNodeViews(nodeViews, this.nodeViews)) {\n this.nodeViews = nodeViews;\n redraw = true;\n }\n }\n if (pluginsChanged || prevProps.handleDOMEvents != this._props.handleDOMEvents) {\n ensureListeners(this);\n }\n this.editable = getEditable(this);\n updateCursorWrapper(this);\n let innerDeco = viewDecorations(this), outerDeco = computeDocDeco(this);\n let scroll = prev.plugins != state.plugins && !prev.doc.eq(state.doc) ? \"reset\"\n : state.scrollToSelection > prev.scrollToSelection ? \"to selection\" : \"preserve\";\n let updateDoc = redraw || !this.docView.matchesNode(state.doc, outerDeco, innerDeco);\n if (updateDoc || !state.selection.eq(prev.selection))\n updateSel = true;\n let oldScrollPos = scroll == \"preserve\" && updateSel && this.dom.style.overflowAnchor == null && storeScrollPos(this);\n if (updateSel) {\n this.domObserver.stop();\n // Work around an issue in Chrome, IE, and Edge where changing\n // the DOM around an active selection puts it into a broken\n // state where the thing the user sees differs from the\n // selection reported by the Selection object (#710, #973,\n // #1011, #1013, #1035).\n let forceSelUpdate = updateDoc && (ie || chrome) && !this.composing &&\n !prev.selection.empty && !state.selection.empty && selectionContextChanged(prev.selection, state.selection);\n if (updateDoc) {\n // If the node that the selection points into is written to,\n // Chrome sometimes starts misreporting the selection, so this\n // tracks that and forces a selection reset when our update\n // did write to the node.\n let chromeKludge = chrome ? (this.trackWrites = this.domSelectionRange().focusNode) : null;\n if (this.composing)\n this.input.compositionNode = findCompositionNode(this);\n if (redraw || !this.docView.update(state.doc, outerDeco, innerDeco, this)) {\n this.docView.updateOuterDeco(outerDeco);\n this.docView.destroy();\n this.docView = docViewDesc(state.doc, outerDeco, innerDeco, this.dom, this);\n }\n if (chromeKludge && !this.trackWrites)\n forceSelUpdate = true;\n }\n // Work around for an issue where an update arriving right between\n // a DOM selection change and the \"selectionchange\" event for it\n // can cause a spurious DOM selection update, disrupting mouse\n // drag selection.\n if (forceSelUpdate ||\n !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) &&\n anchorInRightPlace(this))) {\n selectionToDOM(this, forceSelUpdate);\n }\n else {\n syncNodeSelection(this, state.selection);\n this.domObserver.setCurSelection();\n }\n this.domObserver.start();\n }\n this.updatePluginViews(prev);\n if (((_a = this.dragging) === null || _a === void 0 ? void 0 : _a.node) && !prev.doc.eq(state.doc))\n this.updateDraggedNode(this.dragging, prev);\n if (scroll == \"reset\") {\n this.dom.scrollTop = 0;\n }\n else if (scroll == \"to selection\") {\n this.scrollToSelection();\n }\n else if (oldScrollPos) {\n resetScrollPos(oldScrollPos);\n }\n }\n /**\n @internal\n */\n scrollToSelection() {\n let startDOM = this.domSelectionRange().focusNode;\n if (this.someProp(\"handleScrollToSelection\", f => f(this))) ;\n else if (this.state.selection instanceof NodeSelection) {\n let target = this.docView.domAfterPos(this.state.selection.from);\n if (target.nodeType == 1)\n scrollRectIntoView(this, target.getBoundingClientRect(), startDOM);\n }\n else {\n scrollRectIntoView(this, this.coordsAtPos(this.state.selection.head, 1), startDOM);\n }\n }\n destroyPluginViews() {\n let view;\n while (view = this.pluginViews.pop())\n if (view.destroy)\n view.destroy();\n }\n updatePluginViews(prevState) {\n if (!prevState || prevState.plugins != this.state.plugins || this.directPlugins != this.prevDirectPlugins) {\n this.prevDirectPlugins = this.directPlugins;\n this.destroyPluginViews();\n for (let i = 0; i < this.directPlugins.length; i++) {\n let plugin = this.directPlugins[i];\n if (plugin.spec.view)\n this.pluginViews.push(plugin.spec.view(this));\n }\n for (let i = 0; i < this.state.plugins.length; i++) {\n let plugin = this.state.plugins[i];\n if (plugin.spec.view)\n this.pluginViews.push(plugin.spec.view(this));\n }\n }\n else {\n for (let i = 0; i < this.pluginViews.length; i++) {\n let pluginView = this.pluginViews[i];\n if (pluginView.update)\n pluginView.update(this, prevState);\n }\n }\n }\n updateDraggedNode(dragging, prev) {\n let sel = dragging.node, found = -1;\n if (this.state.doc.nodeAt(sel.from) == sel.node) {\n found = sel.from;\n }\n else {\n let movedPos = sel.from + (this.state.doc.content.size - prev.doc.content.size);\n let moved = movedPos > 0 && this.state.doc.nodeAt(movedPos);\n if (moved == sel.node)\n found = movedPos;\n }\n this.dragging = new Dragging(dragging.slice, dragging.move, found < 0 ? undefined : NodeSelection.create(this.state.doc, found));\n }\n someProp(propName, f) {\n let prop = this._props && this._props[propName], value;\n if (prop != null && (value = f ? f(prop) : prop))\n return value;\n for (let i = 0; i < this.directPlugins.length; i++) {\n let prop = this.directPlugins[i].props[propName];\n if (prop != null && (value = f ? f(prop) : prop))\n return value;\n }\n let plugins = this.state.plugins;\n if (plugins)\n for (let i = 0; i < plugins.length; i++) {\n let prop = plugins[i].props[propName];\n if (prop != null && (value = f ? f(prop) : prop))\n return value;\n }\n }\n /**\n Query whether the view has focus.\n */\n hasFocus() {\n // Work around IE not handling focus correctly if resize handles are shown.\n // If the cursor is inside an element with resize handles, activeElement\n // will be that element instead of this.dom.\n if (ie) {\n // If activeElement is within this.dom, and there are no other elements\n // setting `contenteditable` to false in between, treat it as focused.\n let node = this.root.activeElement;\n if (node == this.dom)\n return true;\n if (!node || !this.dom.contains(node))\n return false;\n while (node && this.dom != node && this.dom.contains(node)) {\n if (node.contentEditable == 'false')\n return false;\n node = node.parentElement;\n }\n return true;\n }\n return this.root.activeElement == this.dom;\n }\n /**\n Focus the editor.\n */\n focus() {\n this.domObserver.stop();\n if (this.editable)\n focusPreventScroll(this.dom);\n selectionToDOM(this);\n this.domObserver.start();\n }\n /**\n Get the document root in which the editor exists. This will\n usually be the top-level `document`, but might be a [shadow\n DOM](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Shadow_DOM)\n root if the editor is inside one.\n */\n get root() {\n let cached = this._root;\n if (cached == null)\n for (let search = this.dom.parentNode; search; search = search.parentNode) {\n if (search.nodeType == 9 || (search.nodeType == 11 && search.host)) {\n if (!search.getSelection)\n Object.getPrototypeOf(search).getSelection = () => search.ownerDocument.getSelection();\n return this._root = search;\n }\n }\n return cached || document;\n }\n /**\n When an existing editor view is moved to a new document or\n shadow tree, call this to make it recompute its root.\n */\n updateRoot() {\n this._root = null;\n }\n /**\n Given a pair of viewport coordinates, return the document\n position that corresponds to them. May return null if the given\n coordinates aren't inside of the editor. When an object is\n returned, its `pos` property is the position nearest to the\n coordinates, and its `inside` property holds the position of the\n inner node that the position falls inside of, or -1 if it is at\n the top level, not in any node.\n */\n posAtCoords(coords) {\n return posAtCoords(this, coords);\n }\n /**\n Returns the viewport rectangle at a given document position.\n `left` and `right` will be the same number, as this returns a\n flat cursor-ish rectangle. If the position is between two things\n that aren't directly adjacent, `side` determines which element\n is used. When < 0, the element before the position is used,\n otherwise the element after.\n */\n coordsAtPos(pos, side = 1) {\n return coordsAtPos(this, pos, side);\n }\n /**\n Find the DOM position that corresponds to the given document\n position. When `side` is negative, find the position as close as\n possible to the content before the position. When positive,\n prefer positions close to the content after the position. When\n zero, prefer as shallow a position as possible.\n \n Note that you should **not** mutate the editor's internal DOM,\n only inspect it (and even that is usually not necessary).\n */\n domAtPos(pos, side = 0) {\n return this.docView.domFromPos(pos, side);\n }\n /**\n Find the DOM node that represents the document node after the\n given position. May return `null` when the position doesn't point\n in front of a node or if the node is inside an opaque node view.\n \n This is intended to be able to call things like\n `getBoundingClientRect` on that DOM node. Do **not** mutate the\n editor DOM directly, or add styling this way, since that will be\n immediately overriden by the editor as it redraws the node.\n */\n nodeDOM(pos) {\n let desc = this.docView.descAt(pos);\n return desc ? desc.nodeDOM : null;\n }\n /**\n Find the document position that corresponds to a given DOM\n position. (Whenever possible, it is preferable to inspect the\n document structure directly, rather than poking around in the\n DOM, but sometimes—for example when interpreting an event\n target—you don't have a choice.)\n \n The `bias` parameter can be used to influence which side of a DOM\n node to use when the position is inside a leaf node.\n */\n posAtDOM(node, offset, bias = -1) {\n let pos = this.docView.posFromDOM(node, offset, bias);\n if (pos == null)\n throw new RangeError(\"DOM position not inside the editor\");\n return pos;\n }\n /**\n Find out whether the selection is at the end of a textblock when\n moving in a given direction. When, for example, given `\"left\"`,\n it will return true if moving left from the current cursor\n position would leave that position's parent textblock. Will apply\n to the view's current state by default, but it is possible to\n pass a different state.\n */\n endOfTextblock(dir, state) {\n return endOfTextblock(this, state || this.state, dir);\n }\n /**\n Run the editor's paste logic with the given HTML string. The\n `event`, if given, will be passed to the\n [`handlePaste`](https://prosemirror.net/docs/ref/#view.EditorProps.handlePaste) hook.\n */\n pasteHTML(html, event) {\n return doPaste(this, \"\", html, false, event || new ClipboardEvent(\"paste\"));\n }\n /**\n Run the editor's paste logic with the given plain-text input.\n */\n pasteText(text, event) {\n return doPaste(this, text, null, true, event || new ClipboardEvent(\"paste\"));\n }\n /**\n Removes the editor from the DOM and destroys all [node\n views](https://prosemirror.net/docs/ref/#view.NodeView).\n */\n destroy() {\n if (!this.docView)\n return;\n destroyInput(this);\n this.destroyPluginViews();\n if (this.mounted) {\n this.docView.update(this.state.doc, [], viewDecorations(this), this);\n this.dom.textContent = \"\";\n }\n else if (this.dom.parentNode) {\n this.dom.parentNode.removeChild(this.dom);\n }\n this.docView.destroy();\n this.docView = null;\n clearReusedRange();\n }\n /**\n This is true when the view has been\n [destroyed](https://prosemirror.net/docs/ref/#view.EditorView.destroy) (and thus should not be\n used anymore).\n */\n get isDestroyed() {\n return this.docView == null;\n }\n /**\n Used for testing.\n */\n dispatchEvent(event) {\n return dispatchEvent(this, event);\n }\n /**\n Dispatch a transaction. Will call\n [`dispatchTransaction`](https://prosemirror.net/docs/ref/#view.DirectEditorProps.dispatchTransaction)\n when given, and otherwise defaults to applying the transaction to\n the current state and calling\n [`updateState`](https://prosemirror.net/docs/ref/#view.EditorView.updateState) with the result.\n This method is bound to the view instance, so that it can be\n easily passed around.\n */\n dispatch(tr) {\n let dispatchTransaction = this._props.dispatchTransaction;\n if (dispatchTransaction)\n dispatchTransaction.call(this, tr);\n else\n this.updateState(this.state.apply(tr));\n }\n /**\n @internal\n */\n domSelectionRange() {\n let sel = this.domSelection();\n if (!sel)\n return { focusNode: null, focusOffset: 0, anchorNode: null, anchorOffset: 0 };\n return safari && this.root.nodeType === 11 &&\n deepActiveElement(this.dom.ownerDocument) == this.dom && safariShadowSelectionRange(this, sel) || sel;\n }\n /**\n @internal\n */\n domSelection() {\n return this.root.getSelection();\n }\n}\nfunction computeDocDeco(view) {\n let attrs = Object.create(null);\n attrs.class = \"ProseMirror\";\n attrs.contenteditable = String(view.editable);\n view.someProp(\"attributes\", value => {\n if (typeof value == \"function\")\n value = value(view.state);\n if (value)\n for (let attr in value) {\n if (attr == \"class\")\n attrs.class += \" \" + value[attr];\n else if (attr == \"style\")\n attrs.style = (attrs.style ? attrs.style + \";\" : \"\") + value[attr];\n else if (!attrs[attr] && attr != \"contenteditable\" && attr != \"nodeName\")\n attrs[attr] = String(value[attr]);\n }\n });\n if (!attrs.translate)\n attrs.translate = \"no\";\n return [Decoration.node(0, view.state.doc.content.size, attrs)];\n}\nfunction updateCursorWrapper(view) {\n if (view.markCursor) {\n let dom = document.createElement(\"img\");\n dom.className = \"ProseMirror-separator\";\n dom.setAttribute(\"mark-placeholder\", \"true\");\n dom.setAttribute(\"alt\", \"\");\n view.cursorWrapper = { dom, deco: Decoration.widget(view.state.selection.from, dom, { raw: true, marks: view.markCursor }) };\n }\n else {\n view.cursorWrapper = null;\n }\n}\nfunction getEditable(view) {\n return !view.someProp(\"editable\", value => value(view.state) === false);\n}\nfunction selectionContextChanged(sel1, sel2) {\n let depth = Math.min(sel1.$anchor.sharedDepth(sel1.head), sel2.$anchor.sharedDepth(sel2.head));\n return sel1.$anchor.start(depth) != sel2.$anchor.start(depth);\n}\nfunction buildNodeViews(view) {\n let result = Object.create(null);\n function add(obj) {\n for (let prop in obj)\n if (!Object.prototype.hasOwnProperty.call(result, prop))\n result[prop] = obj[prop];\n }\n view.someProp(\"nodeViews\", add);\n view.someProp(\"markViews\", add);\n return result;\n}\nfunction changedNodeViews(a, b) {\n let nA = 0, nB = 0;\n for (let prop in a) {\n if (a[prop] != b[prop])\n return true;\n nA++;\n }\n for (let _ in b)\n nB++;\n return nA != nB;\n}\nfunction checkStateComponent(plugin) {\n if (plugin.spec.state || plugin.spec.filterTransaction || plugin.spec.appendTransaction)\n throw new RangeError(\"Plugins passed directly to the view must not have a state component\");\n}\n\nexport { Decoration, DecorationSet, EditorView, __endComposition, __parseFromClipboard, __serializeForClipboard };\n","import { keydownHandler } from 'prosemirror-keymap';\nimport { Selection, NodeSelection, TextSelection, Plugin } from 'prosemirror-state';\nimport { Slice, Fragment } from 'prosemirror-model';\nimport { DecorationSet, Decoration } from 'prosemirror-view';\n\n/**\nGap cursor selections are represented using this class. Its\n`$anchor` and `$head` properties both point at the cursor position.\n*/\nclass GapCursor extends Selection {\n /**\n Create a gap cursor.\n */\n constructor($pos) {\n super($pos, $pos);\n }\n map(doc, mapping) {\n let $pos = doc.resolve(mapping.map(this.head));\n return GapCursor.valid($pos) ? new GapCursor($pos) : Selection.near($pos);\n }\n content() { return Slice.empty; }\n eq(other) {\n return other instanceof GapCursor && other.head == this.head;\n }\n toJSON() {\n return { type: \"gapcursor\", pos: this.head };\n }\n /**\n @internal\n */\n static fromJSON(doc, json) {\n if (typeof json.pos != \"number\")\n throw new RangeError(\"Invalid input for GapCursor.fromJSON\");\n return new GapCursor(doc.resolve(json.pos));\n }\n /**\n @internal\n */\n getBookmark() { return new GapBookmark(this.anchor); }\n /**\n @internal\n */\n static valid($pos) {\n let parent = $pos.parent;\n if (parent.isTextblock || !closedBefore($pos) || !closedAfter($pos))\n return false;\n let override = parent.type.spec.allowGapCursor;\n if (override != null)\n return override;\n let deflt = parent.contentMatchAt($pos.index()).defaultType;\n return deflt && deflt.isTextblock;\n }\n /**\n @internal\n */\n static findGapCursorFrom($pos, dir, mustMove = false) {\n search: for (;;) {\n if (!mustMove && GapCursor.valid($pos))\n return $pos;\n let pos = $pos.pos, next = null;\n // Scan up from this position\n for (let d = $pos.depth;; d--) {\n let parent = $pos.node(d);\n if (dir > 0 ? $pos.indexAfter(d) < parent.childCount : $pos.index(d) > 0) {\n next = parent.child(dir > 0 ? $pos.indexAfter(d) : $pos.index(d) - 1);\n break;\n }\n else if (d == 0) {\n return null;\n }\n pos += dir;\n let $cur = $pos.doc.resolve(pos);\n if (GapCursor.valid($cur))\n return $cur;\n }\n // And then down into the next node\n for (;;) {\n let inside = dir > 0 ? next.firstChild : next.lastChild;\n if (!inside) {\n if (next.isAtom && !next.isText && !NodeSelection.isSelectable(next)) {\n $pos = $pos.doc.resolve(pos + next.nodeSize * dir);\n mustMove = false;\n continue search;\n }\n break;\n }\n next = inside;\n pos += dir;\n let $cur = $pos.doc.resolve(pos);\n if (GapCursor.valid($cur))\n return $cur;\n }\n return null;\n }\n }\n}\nGapCursor.prototype.visible = false;\nGapCursor.findFrom = GapCursor.findGapCursorFrom;\nSelection.jsonID(\"gapcursor\", GapCursor);\nclass GapBookmark {\n constructor(pos) {\n this.pos = pos;\n }\n map(mapping) {\n return new GapBookmark(mapping.map(this.pos));\n }\n resolve(doc) {\n let $pos = doc.resolve(this.pos);\n return GapCursor.valid($pos) ? new GapCursor($pos) : Selection.near($pos);\n }\n}\nfunction closedBefore($pos) {\n for (let d = $pos.depth; d >= 0; d--) {\n let index = $pos.index(d), parent = $pos.node(d);\n // At the start of this parent, look at next one\n if (index == 0) {\n if (parent.type.spec.isolating)\n return true;\n continue;\n }\n // See if the node before (or its first ancestor) is closed\n for (let before = parent.child(index - 1);; before = before.lastChild) {\n if ((before.childCount == 0 && !before.inlineContent) || before.isAtom || before.type.spec.isolating)\n return true;\n if (before.inlineContent)\n return false;\n }\n }\n // Hit start of document\n return true;\n}\nfunction closedAfter($pos) {\n for (let d = $pos.depth; d >= 0; d--) {\n let index = $pos.indexAfter(d), parent = $pos.node(d);\n if (index == parent.childCount) {\n if (parent.type.spec.isolating)\n return true;\n continue;\n }\n for (let after = parent.child(index);; after = after.firstChild) {\n if ((after.childCount == 0 && !after.inlineContent) || after.isAtom || after.type.spec.isolating)\n return true;\n if (after.inlineContent)\n return false;\n }\n }\n return true;\n}\n\n/**\nCreate a gap cursor plugin. When enabled, this will capture clicks\nnear and arrow-key-motion past places that don't have a normally\nselectable position nearby, and create a gap cursor selection for\nthem. The cursor is drawn as an element with class\n`ProseMirror-gapcursor`. You can either include\n`style/gapcursor.css` from the package's directory or add your own\nstyles to make it visible.\n*/\nfunction gapCursor() {\n return new Plugin({\n props: {\n decorations: drawGapCursor,\n createSelectionBetween(_view, $anchor, $head) {\n return $anchor.pos == $head.pos && GapCursor.valid($head) ? new GapCursor($head) : null;\n },\n handleClick,\n handleKeyDown,\n handleDOMEvents: { beforeinput: beforeinput }\n }\n });\n}\nconst handleKeyDown = keydownHandler({\n \"ArrowLeft\": arrow(\"horiz\", -1),\n \"ArrowRight\": arrow(\"horiz\", 1),\n \"ArrowUp\": arrow(\"vert\", -1),\n \"ArrowDown\": arrow(\"vert\", 1)\n});\nfunction arrow(axis, dir) {\n const dirStr = axis == \"vert\" ? (dir > 0 ? \"down\" : \"up\") : (dir > 0 ? \"right\" : \"left\");\n return function (state, dispatch, view) {\n let sel = state.selection;\n let $start = dir > 0 ? sel.$to : sel.$from, mustMove = sel.empty;\n if (sel instanceof TextSelection) {\n if (!view.endOfTextblock(dirStr) || $start.depth == 0)\n return false;\n mustMove = false;\n $start = state.doc.resolve(dir > 0 ? $start.after() : $start.before());\n }\n let $found = GapCursor.findGapCursorFrom($start, dir, mustMove);\n if (!$found)\n return false;\n if (dispatch)\n dispatch(state.tr.setSelection(new GapCursor($found)));\n return true;\n };\n}\nfunction handleClick(view, pos, event) {\n if (!view || !view.editable)\n return false;\n let $pos = view.state.doc.resolve(pos);\n if (!GapCursor.valid($pos))\n return false;\n let clickPos = view.posAtCoords({ left: event.clientX, top: event.clientY });\n if (clickPos && clickPos.inside > -1 && NodeSelection.isSelectable(view.state.doc.nodeAt(clickPos.inside)))\n return false;\n view.dispatch(view.state.tr.setSelection(new GapCursor($pos)));\n return true;\n}\n// This is a hack that, when a composition starts while a gap cursor\n// is active, quickly creates an inline context for the composition to\n// happen in, to avoid it being aborted by the DOM selection being\n// moved into a valid position.\nfunction beforeinput(view, event) {\n if (event.inputType != \"insertCompositionText\" || !(view.state.selection instanceof GapCursor))\n return false;\n let { $from } = view.state.selection;\n let insert = $from.parent.contentMatchAt($from.index()).findWrapping(view.state.schema.nodes.text);\n if (!insert)\n return false;\n let frag = Fragment.empty;\n for (let i = insert.length - 1; i >= 0; i--)\n frag = Fragment.from(insert[i].createAndFill(null, frag));\n let tr = view.state.tr.replace($from.pos, $from.pos, new Slice(frag, 0, 0));\n tr.setSelection(TextSelection.near(tr.doc.resolve($from.pos + 1)));\n view.dispatch(tr);\n return false;\n}\nfunction drawGapCursor(state) {\n if (!(state.selection instanceof GapCursor))\n return null;\n let node = document.createElement(\"div\");\n node.className = \"ProseMirror-gapcursor\";\n return DecorationSet.create(state.doc, [Decoration.widget(state.selection.head, node, { key: \"gapcursor\" })]);\n}\n\nexport { GapCursor, gapCursor };\n","export default function crelt() {\n var elt = arguments[0]\n if (typeof elt == \"string\") elt = document.createElement(elt)\n var i = 1, next = arguments[1]\n if (next && typeof next == \"object\" && next.nodeType == null && !Array.isArray(next)) {\n for (var name in next) if (Object.prototype.hasOwnProperty.call(next, name)) {\n var value = next[name]\n if (typeof value == \"string\") elt.setAttribute(name, value)\n else if (value != null) elt[name] = value\n }\n i++\n }\n for (; i < arguments.length; i++) add(elt, arguments[i])\n return elt\n}\n\nfunction add(elt, child) {\n if (typeof child == \"string\") {\n elt.appendChild(document.createTextNode(child))\n } else if (child == null) {\n } else if (child.nodeType != null) {\n elt.appendChild(child)\n } else if (Array.isArray(child)) {\n for (var i = 0; i < child.length; i++) add(elt, child[i])\n } else {\n throw new RangeError(\"Unsupported child node: \" + child)\n }\n}\n","import { liftTarget, replaceStep, ReplaceStep, canJoin, joinPoint, canSplit, ReplaceAroundStep, findWrapping } from 'prosemirror-transform';\nimport { Slice, Fragment } from 'prosemirror-model';\nimport { NodeSelection, Selection, TextSelection, AllSelection, SelectionRange } from 'prosemirror-state';\n\n/**\nDelete the selection, if there is one.\n*/\nconst deleteSelection = (state, dispatch) => {\n if (state.selection.empty)\n return false;\n if (dispatch)\n dispatch(state.tr.deleteSelection().scrollIntoView());\n return true;\n};\nfunction atBlockStart(state, view) {\n let { $cursor } = state.selection;\n if (!$cursor || (view ? !view.endOfTextblock(\"backward\", state)\n : $cursor.parentOffset > 0))\n return null;\n return $cursor;\n}\n/**\nIf the selection is empty and at the start of a textblock, try to\nreduce the distance between that block and the one before it—if\nthere's a block directly before it that can be joined, join them.\nIf not, try to move the selected block closer to the next one in\nthe document structure by lifting it out of its parent or moving it\ninto a parent of the previous block. Will use the view for accurate\n(bidi-aware) start-of-textblock detection if given.\n*/\nconst joinBackward = (state, dispatch, view) => {\n let $cursor = atBlockStart(state, view);\n if (!$cursor)\n return false;\n let $cut = findCutBefore($cursor);\n // If there is no node before this, try to lift\n if (!$cut) {\n let range = $cursor.blockRange(), target = range && liftTarget(range);\n if (target == null)\n return false;\n if (dispatch)\n dispatch(state.tr.lift(range, target).scrollIntoView());\n return true;\n }\n let before = $cut.nodeBefore;\n // Apply the joining algorithm\n if (deleteBarrier(state, $cut, dispatch, -1))\n return true;\n // If the node below has no content and the node above is\n // selectable, delete the node below and select the one above.\n if ($cursor.parent.content.size == 0 &&\n (textblockAt(before, \"end\") || NodeSelection.isSelectable(before))) {\n for (let depth = $cursor.depth;; depth--) {\n let delStep = replaceStep(state.doc, $cursor.before(depth), $cursor.after(depth), Slice.empty);\n if (delStep && delStep.slice.size < delStep.to - delStep.from) {\n if (dispatch) {\n let tr = state.tr.step(delStep);\n tr.setSelection(textblockAt(before, \"end\")\n ? Selection.findFrom(tr.doc.resolve(tr.mapping.map($cut.pos, -1)), -1)\n : NodeSelection.create(tr.doc, $cut.pos - before.nodeSize));\n dispatch(tr.scrollIntoView());\n }\n return true;\n }\n if (depth == 1 || $cursor.node(depth - 1).childCount > 1)\n break;\n }\n }\n // If the node before is an atom, delete it\n if (before.isAtom && $cut.depth == $cursor.depth - 1) {\n if (dispatch)\n dispatch(state.tr.delete($cut.pos - before.nodeSize, $cut.pos).scrollIntoView());\n return true;\n }\n return false;\n};\n/**\nA more limited form of [`joinBackward`]($commands.joinBackward)\nthat only tries to join the current textblock to the one before\nit, if the cursor is at the start of a textblock.\n*/\nconst joinTextblockBackward = (state, dispatch, view) => {\n let $cursor = atBlockStart(state, view);\n if (!$cursor)\n return false;\n let $cut = findCutBefore($cursor);\n return $cut ? joinTextblocksAround(state, $cut, dispatch) : false;\n};\n/**\nA more limited form of [`joinForward`]($commands.joinForward)\nthat only tries to join the current textblock to the one after\nit, if the cursor is at the end of a textblock.\n*/\nconst joinTextblockForward = (state, dispatch, view) => {\n let $cursor = atBlockEnd(state, view);\n if (!$cursor)\n return false;\n let $cut = findCutAfter($cursor);\n return $cut ? joinTextblocksAround(state, $cut, dispatch) : false;\n};\nfunction joinTextblocksAround(state, $cut, dispatch) {\n let before = $cut.nodeBefore, beforeText = before, beforePos = $cut.pos - 1;\n for (; !beforeText.isTextblock; beforePos--) {\n if (beforeText.type.spec.isolating)\n return false;\n let child = beforeText.lastChild;\n if (!child)\n return false;\n beforeText = child;\n }\n let after = $cut.nodeAfter, afterText = after, afterPos = $cut.pos + 1;\n for (; !afterText.isTextblock; afterPos++) {\n if (afterText.type.spec.isolating)\n return false;\n let child = afterText.firstChild;\n if (!child)\n return false;\n afterText = child;\n }\n let step = replaceStep(state.doc, beforePos, afterPos, Slice.empty);\n if (!step || step.from != beforePos ||\n step instanceof ReplaceStep && step.slice.size >= afterPos - beforePos)\n return false;\n if (dispatch) {\n let tr = state.tr.step(step);\n tr.setSelection(TextSelection.create(tr.doc, beforePos));\n dispatch(tr.scrollIntoView());\n }\n return true;\n}\nfunction textblockAt(node, side, only = false) {\n for (let scan = node; scan; scan = (side == \"start\" ? scan.firstChild : scan.lastChild)) {\n if (scan.isTextblock)\n return true;\n if (only && scan.childCount != 1)\n return false;\n }\n return false;\n}\n/**\nWhen the selection is empty and at the start of a textblock, select\nthe node before that textblock, if possible. This is intended to be\nbound to keys like backspace, after\n[`joinBackward`](https://prosemirror.net/docs/ref/#commands.joinBackward) or other deleting\ncommands, as a fall-back behavior when the schema doesn't allow\ndeletion at the selected point.\n*/\nconst selectNodeBackward = (state, dispatch, view) => {\n let { $head, empty } = state.selection, $cut = $head;\n if (!empty)\n return false;\n if ($head.parent.isTextblock) {\n if (view ? !view.endOfTextblock(\"backward\", state) : $head.parentOffset > 0)\n return false;\n $cut = findCutBefore($head);\n }\n let node = $cut && $cut.nodeBefore;\n if (!node || !NodeSelection.isSelectable(node))\n return false;\n if (dispatch)\n dispatch(state.tr.setSelection(NodeSelection.create(state.doc, $cut.pos - node.nodeSize)).scrollIntoView());\n return true;\n};\nfunction findCutBefore($pos) {\n if (!$pos.parent.type.spec.isolating)\n for (let i = $pos.depth - 1; i >= 0; i--) {\n if ($pos.index(i) > 0)\n return $pos.doc.resolve($pos.before(i + 1));\n if ($pos.node(i).type.spec.isolating)\n break;\n }\n return null;\n}\nfunction atBlockEnd(state, view) {\n let { $cursor } = state.selection;\n if (!$cursor || (view ? !view.endOfTextblock(\"forward\", state)\n : $cursor.parentOffset < $cursor.parent.content.size))\n return null;\n return $cursor;\n}\n/**\nIf the selection is empty and the cursor is at the end of a\ntextblock, try to reduce or remove the boundary between that block\nand the one after it, either by joining them or by moving the other\nblock closer to this one in the tree structure. Will use the view\nfor accurate start-of-textblock detection if given.\n*/\nconst joinForward = (state, dispatch, view) => {\n let $cursor = atBlockEnd(state, view);\n if (!$cursor)\n return false;\n let $cut = findCutAfter($cursor);\n // If there is no node after this, there's nothing to do\n if (!$cut)\n return false;\n let after = $cut.nodeAfter;\n // Try the joining algorithm\n if (deleteBarrier(state, $cut, dispatch, 1))\n return true;\n // If the node above has no content and the node below is\n // selectable, delete the node above and select the one below.\n if ($cursor.parent.content.size == 0 &&\n (textblockAt(after, \"start\") || NodeSelection.isSelectable(after))) {\n let delStep = replaceStep(state.doc, $cursor.before(), $cursor.after(), Slice.empty);\n if (delStep && delStep.slice.size < delStep.to - delStep.from) {\n if (dispatch) {\n let tr = state.tr.step(delStep);\n tr.setSelection(textblockAt(after, \"start\") ? Selection.findFrom(tr.doc.resolve(tr.mapping.map($cut.pos)), 1)\n : NodeSelection.create(tr.doc, tr.mapping.map($cut.pos)));\n dispatch(tr.scrollIntoView());\n }\n return true;\n }\n }\n // If the next node is an atom, delete it\n if (after.isAtom && $cut.depth == $cursor.depth - 1) {\n if (dispatch)\n dispatch(state.tr.delete($cut.pos, $cut.pos + after.nodeSize).scrollIntoView());\n return true;\n }\n return false;\n};\n/**\nWhen the selection is empty and at the end of a textblock, select\nthe node coming after that textblock, if possible. This is intended\nto be bound to keys like delete, after\n[`joinForward`](https://prosemirror.net/docs/ref/#commands.joinForward) and similar deleting\ncommands, to provide a fall-back behavior when the schema doesn't\nallow deletion at the selected point.\n*/\nconst selectNodeForward = (state, dispatch, view) => {\n let { $head, empty } = state.selection, $cut = $head;\n if (!empty)\n return false;\n if ($head.parent.isTextblock) {\n if (view ? !view.endOfTextblock(\"forward\", state) : $head.parentOffset < $head.parent.content.size)\n return false;\n $cut = findCutAfter($head);\n }\n let node = $cut && $cut.nodeAfter;\n if (!node || !NodeSelection.isSelectable(node))\n return false;\n if (dispatch)\n dispatch(state.tr.setSelection(NodeSelection.create(state.doc, $cut.pos)).scrollIntoView());\n return true;\n};\nfunction findCutAfter($pos) {\n if (!$pos.parent.type.spec.isolating)\n for (let i = $pos.depth - 1; i >= 0; i--) {\n let parent = $pos.node(i);\n if ($pos.index(i) + 1 < parent.childCount)\n return $pos.doc.resolve($pos.after(i + 1));\n if (parent.type.spec.isolating)\n break;\n }\n return null;\n}\n/**\nJoin the selected block or, if there is a text selection, the\nclosest ancestor block of the selection that can be joined, with\nthe sibling above it.\n*/\nconst joinUp = (state, dispatch) => {\n let sel = state.selection, nodeSel = sel instanceof NodeSelection, point;\n if (nodeSel) {\n if (sel.node.isTextblock || !canJoin(state.doc, sel.from))\n return false;\n point = sel.from;\n }\n else {\n point = joinPoint(state.doc, sel.from, -1);\n if (point == null)\n return false;\n }\n if (dispatch) {\n let tr = state.tr.join(point);\n if (nodeSel)\n tr.setSelection(NodeSelection.create(tr.doc, point - state.doc.resolve(point).nodeBefore.nodeSize));\n dispatch(tr.scrollIntoView());\n }\n return true;\n};\n/**\nJoin the selected block, or the closest ancestor of the selection\nthat can be joined, with the sibling after it.\n*/\nconst joinDown = (state, dispatch) => {\n let sel = state.selection, point;\n if (sel instanceof NodeSelection) {\n if (sel.node.isTextblock || !canJoin(state.doc, sel.to))\n return false;\n point = sel.to;\n }\n else {\n point = joinPoint(state.doc, sel.to, 1);\n if (point == null)\n return false;\n }\n if (dispatch)\n dispatch(state.tr.join(point).scrollIntoView());\n return true;\n};\n/**\nLift the selected block, or the closest ancestor block of the\nselection that can be lifted, out of its parent node.\n*/\nconst lift = (state, dispatch) => {\n let { $from, $to } = state.selection;\n let range = $from.blockRange($to), target = range && liftTarget(range);\n if (target == null)\n return false;\n if (dispatch)\n dispatch(state.tr.lift(range, target).scrollIntoView());\n return true;\n};\n/**\nIf the selection is in a node whose type has a truthy\n[`code`](https://prosemirror.net/docs/ref/#model.NodeSpec.code) property in its spec, replace the\nselection with a newline character.\n*/\nconst newlineInCode = (state, dispatch) => {\n let { $head, $anchor } = state.selection;\n if (!$head.parent.type.spec.code || !$head.sameParent($anchor))\n return false;\n if (dispatch)\n dispatch(state.tr.insertText(\"\\n\").scrollIntoView());\n return true;\n};\nfunction defaultBlockAt(match) {\n for (let i = 0; i < match.edgeCount; i++) {\n let { type } = match.edge(i);\n if (type.isTextblock && !type.hasRequiredAttrs())\n return type;\n }\n return null;\n}\n/**\nWhen the selection is in a node with a truthy\n[`code`](https://prosemirror.net/docs/ref/#model.NodeSpec.code) property in its spec, create a\ndefault block after the code block, and move the cursor there.\n*/\nconst exitCode = (state, dispatch) => {\n let { $head, $anchor } = state.selection;\n if (!$head.parent.type.spec.code || !$head.sameParent($anchor))\n return false;\n let above = $head.node(-1), after = $head.indexAfter(-1), type = defaultBlockAt(above.contentMatchAt(after));\n if (!type || !above.canReplaceWith(after, after, type))\n return false;\n if (dispatch) {\n let pos = $head.after(), tr = state.tr.replaceWith(pos, pos, type.createAndFill());\n tr.setSelection(Selection.near(tr.doc.resolve(pos), 1));\n dispatch(tr.scrollIntoView());\n }\n return true;\n};\n/**\nIf a block node is selected, create an empty paragraph before (if\nit is its parent's first child) or after it.\n*/\nconst createParagraphNear = (state, dispatch) => {\n let sel = state.selection, { $from, $to } = sel;\n if (sel instanceof AllSelection || $from.parent.inlineContent || $to.parent.inlineContent)\n return false;\n let type = defaultBlockAt($to.parent.contentMatchAt($to.indexAfter()));\n if (!type || !type.isTextblock)\n return false;\n if (dispatch) {\n let side = (!$from.parentOffset && $to.index() < $to.parent.childCount ? $from : $to).pos;\n let tr = state.tr.insert(side, type.createAndFill());\n tr.setSelection(TextSelection.create(tr.doc, side + 1));\n dispatch(tr.scrollIntoView());\n }\n return true;\n};\n/**\nIf the cursor is in an empty textblock that can be lifted, lift the\nblock.\n*/\nconst liftEmptyBlock = (state, dispatch) => {\n let { $cursor } = state.selection;\n if (!$cursor || $cursor.parent.content.size)\n return false;\n if ($cursor.depth > 1 && $cursor.after() != $cursor.end(-1)) {\n let before = $cursor.before();\n if (canSplit(state.doc, before)) {\n if (dispatch)\n dispatch(state.tr.split(before).scrollIntoView());\n return true;\n }\n }\n let range = $cursor.blockRange(), target = range && liftTarget(range);\n if (target == null)\n return false;\n if (dispatch)\n dispatch(state.tr.lift(range, target).scrollIntoView());\n return true;\n};\n/**\nCreate a variant of [`splitBlock`](https://prosemirror.net/docs/ref/#commands.splitBlock) that uses\na custom function to determine the type of the newly split off block.\n*/\nfunction splitBlockAs(splitNode) {\n return (state, dispatch) => {\n let { $from, $to } = state.selection;\n if (state.selection instanceof NodeSelection && state.selection.node.isBlock) {\n if (!$from.parentOffset || !canSplit(state.doc, $from.pos))\n return false;\n if (dispatch)\n dispatch(state.tr.split($from.pos).scrollIntoView());\n return true;\n }\n if (!$from.parent.isBlock)\n return false;\n if (dispatch) {\n let atEnd = $to.parentOffset == $to.parent.content.size;\n let tr = state.tr;\n if (state.selection instanceof TextSelection || state.selection instanceof AllSelection)\n tr.deleteSelection();\n let deflt = $from.depth == 0 ? null : defaultBlockAt($from.node(-1).contentMatchAt($from.indexAfter(-1)));\n let splitType = splitNode && splitNode($to.parent, atEnd, $from);\n let types = splitType ? [splitType] : atEnd && deflt ? [{ type: deflt }] : undefined;\n let can = canSplit(tr.doc, tr.mapping.map($from.pos), 1, types);\n if (!types && !can && canSplit(tr.doc, tr.mapping.map($from.pos), 1, deflt ? [{ type: deflt }] : undefined)) {\n if (deflt)\n types = [{ type: deflt }];\n can = true;\n }\n if (can) {\n tr.split(tr.mapping.map($from.pos), 1, types);\n if (!atEnd && !$from.parentOffset && $from.parent.type != deflt) {\n let first = tr.mapping.map($from.before()), $first = tr.doc.resolve(first);\n if (deflt && $from.node(-1).canReplaceWith($first.index(), $first.index() + 1, deflt))\n tr.setNodeMarkup(tr.mapping.map($from.before()), deflt);\n }\n }\n dispatch(tr.scrollIntoView());\n }\n return true;\n };\n}\n/**\nSplit the parent block of the selection. If the selection is a text\nselection, also delete its content.\n*/\nconst splitBlock = splitBlockAs();\n/**\nActs like [`splitBlock`](https://prosemirror.net/docs/ref/#commands.splitBlock), but without\nresetting the set of active marks at the cursor.\n*/\nconst splitBlockKeepMarks = (state, dispatch) => {\n return splitBlock(state, dispatch && (tr => {\n let marks = state.storedMarks || (state.selection.$to.parentOffset && state.selection.$from.marks());\n if (marks)\n tr.ensureMarks(marks);\n dispatch(tr);\n }));\n};\n/**\nMove the selection to the node wrapping the current selection, if\nany. (Will not select the document node.)\n*/\nconst selectParentNode = (state, dispatch) => {\n let { $from, to } = state.selection, pos;\n let same = $from.sharedDepth(to);\n if (same == 0)\n return false;\n pos = $from.before(same);\n if (dispatch)\n dispatch(state.tr.setSelection(NodeSelection.create(state.doc, pos)));\n return true;\n};\n/**\nSelect the whole document.\n*/\nconst selectAll = (state, dispatch) => {\n if (dispatch)\n dispatch(state.tr.setSelection(new AllSelection(state.doc)));\n return true;\n};\nfunction joinMaybeClear(state, $pos, dispatch) {\n let before = $pos.nodeBefore, after = $pos.nodeAfter, index = $pos.index();\n if (!before || !after || !before.type.compatibleContent(after.type))\n return false;\n if (!before.content.size && $pos.parent.canReplace(index - 1, index)) {\n if (dispatch)\n dispatch(state.tr.delete($pos.pos - before.nodeSize, $pos.pos).scrollIntoView());\n return true;\n }\n if (!$pos.parent.canReplace(index, index + 1) || !(after.isTextblock || canJoin(state.doc, $pos.pos)))\n return false;\n if (dispatch)\n dispatch(state.tr\n .clearIncompatible($pos.pos, before.type, before.contentMatchAt(before.childCount))\n .join($pos.pos)\n .scrollIntoView());\n return true;\n}\nfunction deleteBarrier(state, $cut, dispatch, dir) {\n let before = $cut.nodeBefore, after = $cut.nodeAfter, conn, match;\n let isolated = before.type.spec.isolating || after.type.spec.isolating;\n if (!isolated && joinMaybeClear(state, $cut, dispatch))\n return true;\n let canDelAfter = !isolated && $cut.parent.canReplace($cut.index(), $cut.index() + 1);\n if (canDelAfter &&\n (conn = (match = before.contentMatchAt(before.childCount)).findWrapping(after.type)) &&\n match.matchType(conn[0] || after.type).validEnd) {\n if (dispatch) {\n let end = $cut.pos + after.nodeSize, wrap = Fragment.empty;\n for (let i = conn.length - 1; i >= 0; i--)\n wrap = Fragment.from(conn[i].create(null, wrap));\n wrap = Fragment.from(before.copy(wrap));\n let tr = state.tr.step(new ReplaceAroundStep($cut.pos - 1, end, $cut.pos, end, new Slice(wrap, 1, 0), conn.length, true));\n let joinAt = end + 2 * conn.length;\n if (canJoin(tr.doc, joinAt))\n tr.join(joinAt);\n dispatch(tr.scrollIntoView());\n }\n return true;\n }\n let selAfter = after.type.spec.isolating || (dir > 0 && isolated) ? null : Selection.findFrom($cut, 1);\n let range = selAfter && selAfter.$from.blockRange(selAfter.$to), target = range && liftTarget(range);\n if (target != null && target >= $cut.depth) {\n if (dispatch)\n dispatch(state.tr.lift(range, target).scrollIntoView());\n return true;\n }\n if (canDelAfter && textblockAt(after, \"start\", true) && textblockAt(before, \"end\")) {\n let at = before, wrap = [];\n for (;;) {\n wrap.push(at);\n if (at.isTextblock)\n break;\n at = at.lastChild;\n }\n let afterText = after, afterDepth = 1;\n for (; !afterText.isTextblock; afterText = afterText.firstChild)\n afterDepth++;\n if (at.canReplace(at.childCount, at.childCount, afterText.content)) {\n if (dispatch) {\n let end = Fragment.empty;\n for (let i = wrap.length - 1; i >= 0; i--)\n end = Fragment.from(wrap[i].copy(end));\n let tr = 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));\n dispatch(tr.scrollIntoView());\n }\n return true;\n }\n }\n return false;\n}\nfunction selectTextblockSide(side) {\n return function (state, dispatch) {\n let sel = state.selection, $pos = side < 0 ? sel.$from : sel.$to;\n let depth = $pos.depth;\n while ($pos.node(depth).isInline) {\n if (!depth)\n return false;\n depth--;\n }\n if (!$pos.node(depth).isTextblock)\n return false;\n if (dispatch)\n dispatch(state.tr.setSelection(TextSelection.create(state.doc, side < 0 ? $pos.start(depth) : $pos.end(depth))));\n return true;\n };\n}\n/**\nMoves the cursor to the start of current text block.\n*/\nconst selectTextblockStart = selectTextblockSide(-1);\n/**\nMoves the cursor to the end of current text block.\n*/\nconst selectTextblockEnd = selectTextblockSide(1);\n// Parameterized commands\n/**\nWrap the selection in a node of the given type with the given\nattributes.\n*/\nfunction wrapIn(nodeType, attrs = null) {\n return function (state, dispatch) {\n let { $from, $to } = state.selection;\n let range = $from.blockRange($to), wrapping = range && findWrapping(range, nodeType, attrs);\n if (!wrapping)\n return false;\n if (dispatch)\n dispatch(state.tr.wrap(range, wrapping).scrollIntoView());\n return true;\n };\n}\n/**\nReturns a command that tries to set the selected textblocks to the\ngiven node type with the given attributes.\n*/\nfunction setBlockType(nodeType, attrs = null) {\n return function (state, dispatch) {\n let applicable = false;\n for (let i = 0; i < state.selection.ranges.length && !applicable; i++) {\n let { $from: { pos: from }, $to: { pos: to } } = state.selection.ranges[i];\n state.doc.nodesBetween(from, to, (node, pos) => {\n if (applicable)\n return false;\n if (!node.isTextblock || node.hasMarkup(nodeType, attrs))\n return;\n if (node.type == nodeType) {\n applicable = true;\n }\n else {\n let $pos = state.doc.resolve(pos), index = $pos.index();\n applicable = $pos.parent.canReplaceWith(index, index + 1, nodeType);\n }\n });\n }\n if (!applicable)\n return false;\n if (dispatch) {\n let tr = state.tr;\n for (let i = 0; i < state.selection.ranges.length; i++) {\n let { $from: { pos: from }, $to: { pos: to } } = state.selection.ranges[i];\n tr.setBlockType(from, to, nodeType, attrs);\n }\n dispatch(tr.scrollIntoView());\n }\n return true;\n };\n}\nfunction markApplies(doc, ranges, type, enterAtoms) {\n for (let i = 0; i < ranges.length; i++) {\n let { $from, $to } = ranges[i];\n let can = $from.depth == 0 ? doc.inlineContent && doc.type.allowsMarkType(type) : false;\n doc.nodesBetween($from.pos, $to.pos, (node, pos) => {\n if (can || !enterAtoms && node.isAtom && node.isInline && pos >= $from.pos && pos + node.nodeSize <= $to.pos)\n return false;\n can = node.inlineContent && node.type.allowsMarkType(type);\n });\n if (can)\n return true;\n }\n return false;\n}\nfunction removeInlineAtoms(ranges) {\n let result = [];\n for (let i = 0; i < ranges.length; i++) {\n let { $from, $to } = ranges[i];\n $from.doc.nodesBetween($from.pos, $to.pos, (node, pos) => {\n if (node.isAtom && node.content.size && node.isInline && pos >= $from.pos && pos + node.nodeSize <= $to.pos) {\n if (pos + 1 > $from.pos)\n result.push(new SelectionRange($from, $from.doc.resolve(pos + 1)));\n $from = $from.doc.resolve(pos + 1 + node.content.size);\n return false;\n }\n });\n if ($from.pos < $to.pos)\n result.push(new SelectionRange($from, $to));\n }\n return result;\n}\n/**\nCreate a command function that toggles the given mark with the\ngiven attributes. Will return `false` when the current selection\ndoesn't support that mark. This will remove the mark if any marks\nof that type exist in the selection, or add it otherwise. If the\nselection is empty, this applies to the [stored\nmarks](https://prosemirror.net/docs/ref/#state.EditorState.storedMarks) instead of a range of the\ndocument.\n*/\nfunction toggleMark(markType, attrs = null, options) {\n let removeWhenPresent = (options && options.removeWhenPresent) !== false;\n let enterAtoms = (options && options.enterInlineAtoms) !== false;\n return function (state, dispatch) {\n let { empty, $cursor, ranges } = state.selection;\n if ((empty && !$cursor) || !markApplies(state.doc, ranges, markType, enterAtoms))\n return false;\n if (dispatch) {\n if ($cursor) {\n if (markType.isInSet(state.storedMarks || $cursor.marks()))\n dispatch(state.tr.removeStoredMark(markType));\n else\n dispatch(state.tr.addStoredMark(markType.create(attrs)));\n }\n else {\n let add, tr = state.tr;\n if (!enterAtoms)\n ranges = removeInlineAtoms(ranges);\n if (removeWhenPresent) {\n add = !ranges.some(r => state.doc.rangeHasMark(r.$from.pos, r.$to.pos, markType));\n }\n else {\n add = !ranges.every(r => {\n let missing = false;\n tr.doc.nodesBetween(r.$from.pos, r.$to.pos, (node, pos, parent) => {\n if (missing)\n return false;\n missing = !markType.isInSet(node.marks) && !!parent && parent.type.allowsMarkType(markType) &&\n !(node.isText && /^\\s*$/.test(node.textBetween(Math.max(0, r.$from.pos - pos), Math.min(node.nodeSize, r.$to.pos - pos))));\n });\n return !missing;\n });\n }\n for (let i = 0; i < ranges.length; i++) {\n let { $from, $to } = ranges[i];\n if (!add) {\n tr.removeMark($from.pos, $to.pos, markType);\n }\n else {\n let from = $from.pos, to = $to.pos, start = $from.nodeAfter, end = $to.nodeBefore;\n let spaceStart = start && start.isText ? /^\\s*/.exec(start.text)[0].length : 0;\n let spaceEnd = end && end.isText ? /\\s*$/.exec(end.text)[0].length : 0;\n if (from + spaceStart < to) {\n from += spaceStart;\n to -= spaceEnd;\n }\n tr.addMark(from, to, markType.create(attrs));\n }\n }\n dispatch(tr.scrollIntoView());\n }\n }\n return true;\n };\n}\nfunction wrapDispatchForJoin(dispatch, isJoinable) {\n return (tr) => {\n if (!tr.isGeneric)\n return dispatch(tr);\n let ranges = [];\n for (let i = 0; i < tr.mapping.maps.length; i++) {\n let map = tr.mapping.maps[i];\n for (let j = 0; j < ranges.length; j++)\n ranges[j] = map.map(ranges[j]);\n map.forEach((_s, _e, from, to) => ranges.push(from, to));\n }\n // Figure out which joinable points exist inside those ranges,\n // by checking all node boundaries in their parent nodes.\n let joinable = [];\n for (let i = 0; i < ranges.length; i += 2) {\n let from = ranges[i], to = ranges[i + 1];\n let $from = tr.doc.resolve(from), depth = $from.sharedDepth(to), parent = $from.node(depth);\n for (let index = $from.indexAfter(depth), pos = $from.after(depth + 1); pos <= to; ++index) {\n let after = parent.maybeChild(index);\n if (!after)\n break;\n if (index && joinable.indexOf(pos) == -1) {\n let before = parent.child(index - 1);\n if (before.type == after.type && isJoinable(before, after))\n joinable.push(pos);\n }\n pos += after.nodeSize;\n }\n }\n // Join the joinable points\n joinable.sort((a, b) => a - b);\n for (let i = joinable.length - 1; i >= 0; i--) {\n if (canJoin(tr.doc, joinable[i]))\n tr.join(joinable[i]);\n }\n dispatch(tr);\n };\n}\n/**\nWrap a command so that, when it produces a transform that causes\ntwo joinable nodes to end up next to each other, those are joined.\nNodes are considered joinable when they are of the same type and\nwhen the `isJoinable` predicate returns true for them or, if an\narray of strings was passed, if their node type name is in that\narray.\n*/\nfunction autoJoin(command, isJoinable) {\n let canJoin = Array.isArray(isJoinable) ? (node) => isJoinable.indexOf(node.type.name) > -1\n : isJoinable;\n return (state, dispatch, view) => command(state, dispatch && wrapDispatchForJoin(dispatch, canJoin), view);\n}\n/**\nCombine a number of command functions into a single function (which\ncalls them one by one until one returns true).\n*/\nfunction chainCommands(...commands) {\n return function (state, dispatch, view) {\n for (let i = 0; i < commands.length; i++)\n if (commands[i](state, dispatch, view))\n return true;\n return false;\n };\n}\nlet backspace = chainCommands(deleteSelection, joinBackward, selectNodeBackward);\nlet del = chainCommands(deleteSelection, joinForward, selectNodeForward);\n/**\nA basic keymap containing bindings not specific to any schema.\nBinds the following keys (when multiple commands are listed, they\nare chained with [`chainCommands`](https://prosemirror.net/docs/ref/#commands.chainCommands)):\n\n* **Enter** to `newlineInCode`, `createParagraphNear`, `liftEmptyBlock`, `splitBlock`\n* **Mod-Enter** to `exitCode`\n* **Backspace** and **Mod-Backspace** to `deleteSelection`, `joinBackward`, `selectNodeBackward`\n* **Delete** and **Mod-Delete** to `deleteSelection`, `joinForward`, `selectNodeForward`\n* **Mod-Delete** to `deleteSelection`, `joinForward`, `selectNodeForward`\n* **Mod-a** to `selectAll`\n*/\nconst pcBaseKeymap = {\n \"Enter\": chainCommands(newlineInCode, createParagraphNear, liftEmptyBlock, splitBlock),\n \"Mod-Enter\": exitCode,\n \"Backspace\": backspace,\n \"Mod-Backspace\": backspace,\n \"Shift-Backspace\": backspace,\n \"Delete\": del,\n \"Mod-Delete\": del,\n \"Mod-a\": selectAll\n};\n/**\nA copy of `pcBaseKeymap` that also binds **Ctrl-h** like Backspace,\n**Ctrl-d** like Delete, **Alt-Backspace** like Ctrl-Backspace, and\n**Ctrl-Alt-Backspace**, **Alt-Delete**, and **Alt-d** like\nCtrl-Delete.\n*/\nconst macBaseKeymap = {\n \"Ctrl-h\": pcBaseKeymap[\"Backspace\"],\n \"Alt-Backspace\": pcBaseKeymap[\"Mod-Backspace\"],\n \"Ctrl-d\": pcBaseKeymap[\"Delete\"],\n \"Ctrl-Alt-Backspace\": pcBaseKeymap[\"Mod-Delete\"],\n \"Alt-Delete\": pcBaseKeymap[\"Mod-Delete\"],\n \"Alt-d\": pcBaseKeymap[\"Mod-Delete\"],\n \"Ctrl-a\": selectTextblockStart,\n \"Ctrl-e\": selectTextblockEnd\n};\nfor (let key in pcBaseKeymap)\n macBaseKeymap[key] = pcBaseKeymap[key];\nconst mac = typeof navigator != \"undefined\" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform)\n // @ts-ignore\n : typeof os != \"undefined\" && os.platform ? os.platform() == \"darwin\" : false;\n/**\nDepending on the detected platform, this will hold\n[`pcBasekeymap`](https://prosemirror.net/docs/ref/#commands.pcBaseKeymap) or\n[`macBaseKeymap`](https://prosemirror.net/docs/ref/#commands.macBaseKeymap).\n*/\nconst baseKeymap = mac ? macBaseKeymap : pcBaseKeymap;\n\nexport { autoJoin, baseKeymap, chainCommands, createParagraphNear, deleteSelection, exitCode, joinBackward, joinDown, joinForward, joinTextblockBackward, joinTextblockForward, joinUp, lift, liftEmptyBlock, macBaseKeymap, newlineInCode, pcBaseKeymap, selectAll, selectNodeBackward, selectNodeForward, selectParentNode, selectTextblockEnd, selectTextblockStart, setBlockType, splitBlock, splitBlockAs, splitBlockKeepMarks, toggleMark, wrapIn };\n","import crel from 'crelt';\nimport { joinUp, lift, selectParentNode, setBlockType, wrapIn } from 'prosemirror-commands';\nimport { undo, redo } from 'prosemirror-history';\nimport { Plugin } from 'prosemirror-state';\n\nconst SVG = \"http://www.w3.org/2000/svg\";\nconst XLINK = \"http://www.w3.org/1999/xlink\";\nconst prefix$2 = \"ProseMirror-icon\";\nfunction hashPath(path) {\n let hash = 0;\n for (let i = 0; i < path.length; i++)\n hash = (((hash << 5) - hash) + path.charCodeAt(i)) | 0;\n return hash;\n}\nfunction getIcon(root, icon) {\n let doc = (root.nodeType == 9 ? root : root.ownerDocument) || document;\n let node = doc.createElement(\"div\");\n node.className = prefix$2;\n if (icon.path) {\n let { path, width, height } = icon;\n let name = \"pm-icon-\" + hashPath(path).toString(16);\n if (!doc.getElementById(name))\n buildSVG(root, name, icon);\n let svg = node.appendChild(doc.createElementNS(SVG, \"svg\"));\n svg.style.width = (width / height) + \"em\";\n let use = svg.appendChild(doc.createElementNS(SVG, \"use\"));\n use.setAttributeNS(XLINK, \"href\", /([^#]*)/.exec(doc.location.toString())[1] + \"#\" + name);\n }\n else if (icon.dom) {\n node.appendChild(icon.dom.cloneNode(true));\n }\n else {\n let { text, css } = icon;\n node.appendChild(doc.createElement(\"span\")).textContent = text || '';\n if (css)\n node.firstChild.style.cssText = css;\n }\n return node;\n}\nfunction buildSVG(root, name, data) {\n let [doc, top] = root.nodeType == 9 ? [root, root.body] : [root.ownerDocument || document, root];\n let collection = doc.getElementById(prefix$2 + \"-collection\");\n if (!collection) {\n collection = doc.createElementNS(SVG, \"svg\");\n collection.id = prefix$2 + \"-collection\";\n collection.style.display = \"none\";\n top.insertBefore(collection, top.firstChild);\n }\n let sym = doc.createElementNS(SVG, \"symbol\");\n sym.id = name;\n sym.setAttribute(\"viewBox\", \"0 0 \" + data.width + \" \" + data.height);\n let path = sym.appendChild(doc.createElementNS(SVG, \"path\"));\n path.setAttribute(\"d\", data.path);\n collection.appendChild(sym);\n}\n\nconst prefix$1 = \"ProseMirror-menu\";\n/**\nAn icon or label that, when clicked, executes a command.\n*/\nclass MenuItem {\n /**\n Create a menu item.\n */\n constructor(\n /**\n The spec used to create this item.\n */\n spec) {\n this.spec = spec;\n }\n /**\n Renders the icon according to its [display\n spec](https://prosemirror.net/docs/ref/#menu.MenuItemSpec.display), and adds an event handler which\n executes the command when the representation is clicked.\n */\n render(view) {\n let spec = this.spec;\n let dom = spec.render ? spec.render(view)\n : spec.icon ? getIcon(view.root, spec.icon)\n : spec.label ? crel(\"div\", null, translate(view, spec.label))\n : null;\n if (!dom)\n throw new RangeError(\"MenuItem without icon or label property\");\n if (spec.title) {\n const title = (typeof spec.title === \"function\" ? spec.title(view.state) : spec.title);\n dom.setAttribute(\"title\", translate(view, title));\n }\n if (spec.class)\n dom.classList.add(spec.class);\n if (spec.css)\n dom.style.cssText += spec.css;\n dom.addEventListener(\"mousedown\", e => {\n e.preventDefault();\n if (!dom.classList.contains(prefix$1 + \"-disabled\"))\n spec.run(view.state, view.dispatch, view, e);\n });\n function update(state) {\n if (spec.select) {\n let selected = spec.select(state);\n dom.style.display = selected ? \"\" : \"none\";\n if (!selected)\n return false;\n }\n let enabled = true;\n if (spec.enable) {\n enabled = spec.enable(state) || false;\n setClass(dom, prefix$1 + \"-disabled\", !enabled);\n }\n if (spec.active) {\n let active = enabled && spec.active(state) || false;\n setClass(dom, prefix$1 + \"-active\", active);\n }\n return true;\n }\n return { dom, update };\n }\n}\nfunction translate(view, text) {\n return view._props.translate ? view._props.translate(text) : text;\n}\nlet lastMenuEvent = { time: 0, node: null };\nfunction markMenuEvent(e) {\n lastMenuEvent.time = Date.now();\n lastMenuEvent.node = e.target;\n}\nfunction isMenuEvent(wrapper) {\n return Date.now() - 100 < lastMenuEvent.time &&\n lastMenuEvent.node && wrapper.contains(lastMenuEvent.node);\n}\n/**\nA drop-down menu, displayed as a label with a downwards-pointing\ntriangle to the right of it.\n*/\nclass Dropdown {\n /**\n Create a dropdown wrapping the elements.\n */\n constructor(content, \n /**\n @internal\n */\n options = {}) {\n this.options = options;\n this.options = options || {};\n this.content = Array.isArray(content) ? content : [content];\n }\n /**\n Render the dropdown menu and sub-items.\n */\n render(view) {\n let content = renderDropdownItems(this.content, view);\n let win = view.dom.ownerDocument.defaultView || window;\n let label = crel(\"div\", { class: prefix$1 + \"-dropdown \" + (this.options.class || \"\"),\n style: this.options.css }, translate(view, this.options.label || \"\"));\n if (this.options.title)\n label.setAttribute(\"title\", translate(view, this.options.title));\n let wrap = crel(\"div\", { class: prefix$1 + \"-dropdown-wrap\" }, label);\n let open = null;\n let listeningOnClose = null;\n let close = () => {\n if (open && open.close()) {\n open = null;\n win.removeEventListener(\"mousedown\", listeningOnClose);\n }\n };\n label.addEventListener(\"mousedown\", e => {\n e.preventDefault();\n markMenuEvent(e);\n if (open) {\n close();\n }\n else {\n open = this.expand(wrap, content.dom);\n win.addEventListener(\"mousedown\", listeningOnClose = () => {\n if (!isMenuEvent(wrap))\n close();\n });\n }\n });\n function update(state) {\n let inner = content.update(state);\n wrap.style.display = inner ? \"\" : \"none\";\n return inner;\n }\n return { dom: wrap, update };\n }\n /**\n @internal\n */\n expand(dom, items) {\n let menuDOM = crel(\"div\", { class: prefix$1 + \"-dropdown-menu \" + (this.options.class || \"\") }, items);\n let done = false;\n function close() {\n if (done)\n return false;\n done = true;\n dom.removeChild(menuDOM);\n return true;\n }\n dom.appendChild(menuDOM);\n return { close, node: menuDOM };\n }\n}\nfunction renderDropdownItems(items, view) {\n let rendered = [], updates = [];\n for (let i = 0; i < items.length; i++) {\n let { dom, update } = items[i].render(view);\n rendered.push(crel(\"div\", { class: prefix$1 + \"-dropdown-item\" }, dom));\n updates.push(update);\n }\n return { dom: rendered, update: combineUpdates(updates, rendered) };\n}\nfunction combineUpdates(updates, nodes) {\n return (state) => {\n let something = false;\n for (let i = 0; i < updates.length; i++) {\n let up = updates[i](state);\n nodes[i].style.display = up ? \"\" : \"none\";\n if (up)\n something = true;\n }\n return something;\n };\n}\n/**\nRepresents a submenu wrapping a group of elements that start\nhidden and expand to the right when hovered over or tapped.\n*/\nclass DropdownSubmenu {\n /**\n Creates a submenu for the given group of menu elements. The\n following options are recognized:\n */\n constructor(content, \n /**\n @internal\n */\n options = {}) {\n this.options = options;\n this.content = Array.isArray(content) ? content : [content];\n }\n /**\n Renders the submenu.\n */\n render(view) {\n let items = renderDropdownItems(this.content, view);\n let win = view.dom.ownerDocument.defaultView || window;\n let label = crel(\"div\", { class: prefix$1 + \"-submenu-label\" }, translate(view, this.options.label || \"\"));\n let wrap = crel(\"div\", { class: prefix$1 + \"-submenu-wrap\" }, label, crel(\"div\", { class: prefix$1 + \"-submenu\" }, items.dom));\n let listeningOnClose = null;\n label.addEventListener(\"mousedown\", e => {\n e.preventDefault();\n markMenuEvent(e);\n setClass(wrap, prefix$1 + \"-submenu-wrap-active\", false);\n if (!listeningOnClose)\n win.addEventListener(\"mousedown\", listeningOnClose = () => {\n if (!isMenuEvent(wrap)) {\n wrap.classList.remove(prefix$1 + \"-submenu-wrap-active\");\n win.removeEventListener(\"mousedown\", listeningOnClose);\n listeningOnClose = null;\n }\n });\n });\n function update(state) {\n let inner = items.update(state);\n wrap.style.display = inner ? \"\" : \"none\";\n return inner;\n }\n return { dom: wrap, update };\n }\n}\n/**\nRender the given, possibly nested, array of menu elements into a\ndocument fragment, placing separators between them (and ensuring no\nsuperfluous separators appear when some of the groups turn out to\nbe empty).\n*/\nfunction renderGrouped(view, content) {\n let result = document.createDocumentFragment();\n let updates = [], separators = [];\n for (let i = 0; i < content.length; i++) {\n let items = content[i], localUpdates = [], localNodes = [];\n for (let j = 0; j < items.length; j++) {\n let { dom, update } = items[j].render(view);\n let span = crel(\"span\", { class: prefix$1 + \"item\" }, dom);\n result.appendChild(span);\n localNodes.push(span);\n localUpdates.push(update);\n }\n if (localUpdates.length) {\n updates.push(combineUpdates(localUpdates, localNodes));\n if (i < content.length - 1)\n separators.push(result.appendChild(separator()));\n }\n }\n function update(state) {\n let something = false, needSep = false;\n for (let i = 0; i < updates.length; i++) {\n let hasContent = updates[i](state);\n if (i)\n separators[i - 1].style.display = needSep && hasContent ? \"\" : \"none\";\n needSep = hasContent;\n if (hasContent)\n something = true;\n }\n return something;\n }\n return { dom: result, update };\n}\nfunction separator() {\n return crel(\"span\", { class: prefix$1 + \"separator\" });\n}\n/**\nA set of basic editor-related icons. Contains the properties\n`join`, `lift`, `selectParentNode`, `undo`, `redo`, `strong`, `em`,\n`code`, `link`, `bulletList`, `orderedList`, and `blockquote`, each\nholding an object that can be used as the `icon` option to\n`MenuItem`.\n*/\nconst icons = {\n join: {\n width: 800, height: 900,\n path: \"M0 75h800v125h-800z M0 825h800v-125h-800z M250 400h100v-100h100v100h100v100h-100v100h-100v-100h-100z\"\n },\n lift: {\n width: 1024, height: 1024,\n path: \"M219 310v329q0 7-5 12t-12 5q-8 0-13-5l-164-164q-5-5-5-13t5-13l164-164q5-5 13-5 7 0 12 5t5 12zM1024 749v109q0 7-5 12t-12 5h-987q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h987q7 0 12 5t5 12zM1024 530v109q0 7-5 12t-12 5h-621q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h621q7 0 12 5t5 12zM1024 310v109q0 7-5 12t-12 5h-621q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h621q7 0 12 5t5 12zM1024 91v109q0 7-5 12t-12 5h-987q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h987q7 0 12 5t5 12z\"\n },\n selectParentNode: { text: \"\\u2b1a\", css: \"font-weight: bold\" },\n undo: {\n width: 1024, height: 1024,\n path: \"M761 1024c113-206 132-520-313-509v253l-384-384 384-384v248c534-13 594 472 313 775z\"\n },\n redo: {\n width: 1024, height: 1024,\n path: \"M576 248v-248l384 384-384 384v-253c-446-10-427 303-313 509-280-303-221-789 313-775z\"\n },\n strong: {\n width: 805, height: 1024,\n path: \"M317 869q42 18 80 18 214 0 214-191 0-65-23-102-15-25-35-42t-38-26-46-14-48-6-54-1q-41 0-57 5 0 30-0 90t-0 90q0 4-0 38t-0 55 2 47 6 38zM309 442q24 4 62 4 46 0 81-7t62-25 42-51 14-81q0-40-16-70t-45-46-61-24-70-8q-28 0-74 7 0 28 2 86t2 86q0 15-0 45t-0 45q0 26 0 39zM0 950l1-53q8-2 48-9t60-15q4-6 7-15t4-19 3-18 1-21 0-19v-37q0-561-12-585-2-4-12-8t-25-6-28-4-27-2-17-1l-2-47q56-1 194-6t213-5q13 0 39 0t38 0q40 0 78 7t73 24 61 40 42 59 16 78q0 29-9 54t-22 41-36 32-41 25-48 22q88 20 146 76t58 141q0 57-20 102t-53 74-78 48-93 27-100 8q-25 0-75-1t-75-1q-60 0-175 6t-132 6z\"\n },\n em: {\n width: 585, height: 1024,\n path: \"M0 949l9-48q3-1 46-12t63-21q16-20 23-57 0-4 35-165t65-310 29-169v-14q-13-7-31-10t-39-4-33-3l10-58q18 1 68 3t85 4 68 1q27 0 56-1t69-4 56-3q-2 22-10 50-17 5-58 16t-62 19q-4 10-8 24t-5 22-4 26-3 24q-15 84-50 239t-44 203q-1 5-7 33t-11 51-9 47-3 32l0 10q9 2 105 17-1 25-9 56-6 0-18 0t-18 0q-16 0-49-5t-49-5q-78-1-117-1-29 0-81 5t-69 6z\"\n },\n code: {\n width: 896, height: 1024,\n path: \"M608 192l-96 96 224 224-224 224 96 96 288-320-288-320zM288 192l-288 320 288 320 96-96-224-224 224-224-96-96z\"\n },\n link: {\n width: 951, height: 1024,\n path: \"M832 694q0-22-16-38l-118-118q-16-16-38-16-24 0-41 18 1 1 10 10t12 12 8 10 7 14 2 15q0 22-16 38t-38 16q-8 0-15-2t-14-7-10-8-12-12-10-10q-18 17-18 41 0 22 16 38l117 118q15 15 38 15 22 0 38-14l84-83q16-16 16-38zM430 292q0-22-16-38l-117-118q-16-16-38-16-22 0-38 15l-84 83q-16 16-16 38 0 22 16 38l118 118q15 15 38 15 24 0 41-17-1-1-10-10t-12-12-8-10-7-14-2-15q0-22 16-38t38-16q8 0 15 2t14 7 10 8 12 12 10 10q18-17 18-41zM941 694q0 68-48 116l-84 83q-47 47-116 47-69 0-116-48l-117-118q-47-47-47-116 0-70 50-119l-50-50q-49 50-118 50-68 0-116-48l-118-118q-48-48-48-116t48-116l84-83q47-47 116-47 69 0 116 48l117 118q47 47 47 116 0 70-50 119l50 50q49-50 118-50 68 0 116 48l118 118q48 48 48 116z\"\n },\n bulletList: {\n width: 768, height: 896,\n path: \"M0 512h128v-128h-128v128zM0 256h128v-128h-128v128zM0 768h128v-128h-128v128zM256 512h512v-128h-512v128zM256 256h512v-128h-512v128zM256 768h512v-128h-512v128z\"\n },\n orderedList: {\n width: 768, height: 896,\n path: \"M320 512h448v-128h-448v128zM320 768h448v-128h-448v128zM320 128v128h448v-128h-448zM79 384h78v-256h-36l-85 23v50l43-2v185zM189 590c0-36-12-78-96-78-33 0-64 6-83 16l1 66c21-10 42-15 67-15s32 11 32 28c0 26-30 58-110 112v50h192v-67l-91 2c49-30 87-66 87-113l1-1z\"\n },\n blockquote: {\n width: 640, height: 896,\n path: \"M0 448v256h256v-256h-128c0 0 0-128 128-128v-128c0 0-256 0-256 256zM640 320v-128c0 0-256 0-256 256v256h256v-256h-128c0 0 0-128 128-128z\"\n }\n};\n/**\nMenu item for the `joinUp` command.\n*/\nconst joinUpItem = new MenuItem({\n title: \"Join with above block\",\n run: joinUp,\n select: state => joinUp(state),\n icon: icons.join\n});\n/**\nMenu item for the `lift` command.\n*/\nconst liftItem = new MenuItem({\n title: \"Lift out of enclosing block\",\n run: lift,\n select: state => lift(state),\n icon: icons.lift\n});\n/**\nMenu item for the `selectParentNode` command.\n*/\nconst selectParentNodeItem = new MenuItem({\n title: \"Select parent node\",\n run: selectParentNode,\n select: state => selectParentNode(state),\n icon: icons.selectParentNode\n});\n/**\nMenu item for the `undo` command.\n*/\nlet undoItem = new MenuItem({\n title: \"Undo last change\",\n run: undo,\n enable: state => undo(state),\n icon: icons.undo\n});\n/**\nMenu item for the `redo` command.\n*/\nlet redoItem = new MenuItem({\n title: \"Redo last undone change\",\n run: redo,\n enable: state => redo(state),\n icon: icons.redo\n});\n/**\nBuild a menu item for wrapping the selection in a given node type.\nAdds `run` and `select` properties to the ones present in\n`options`. `options.attrs` may be an object that provides\nattributes for the wrapping node.\n*/\nfunction wrapItem(nodeType, options) {\n let passedOptions = {\n run(state, dispatch) {\n return wrapIn(nodeType, options.attrs)(state, dispatch);\n },\n select(state) {\n return wrapIn(nodeType, options.attrs)(state);\n }\n };\n for (let prop in options)\n passedOptions[prop] = options[prop];\n return new MenuItem(passedOptions);\n}\n/**\nBuild a menu item for changing the type of the textblock around the\nselection to the given type. Provides `run`, `active`, and `select`\nproperties. Others must be given in `options`. `options.attrs` may\nbe an object to provide the attributes for the textblock node.\n*/\nfunction blockTypeItem(nodeType, options) {\n let command = setBlockType(nodeType, options.attrs);\n let passedOptions = {\n run: command,\n enable(state) { return command(state); },\n active(state) {\n let { $from, to, node } = state.selection;\n if (node)\n return node.hasMarkup(nodeType, options.attrs);\n return to <= $from.end() && $from.parent.hasMarkup(nodeType, options.attrs);\n }\n };\n for (let prop in options)\n passedOptions[prop] = options[prop];\n return new MenuItem(passedOptions);\n}\n// Work around classList.toggle being broken in IE11\nfunction setClass(dom, cls, on) {\n if (on)\n dom.classList.add(cls);\n else\n dom.classList.remove(cls);\n}\n\nconst prefix = \"ProseMirror-menubar\";\nfunction isIOS() {\n if (typeof navigator == \"undefined\")\n return false;\n let agent = navigator.userAgent;\n return !/Edge\\/\\d/.test(agent) && /AppleWebKit/.test(agent) && /Mobile\\/\\w+/.test(agent);\n}\n/**\nA plugin that will place a menu bar above the editor. Note that\nthis involves wrapping the editor in an additional `
`.\n*/\nfunction menuBar(options) {\n return new Plugin({\n view(editorView) { return new MenuBarView(editorView, options); }\n });\n}\nclass MenuBarView {\n constructor(editorView, options) {\n this.editorView = editorView;\n this.options = options;\n this.spacer = null;\n this.maxHeight = 0;\n this.widthForMaxHeight = 0;\n this.floating = false;\n this.scrollHandler = null;\n this.wrapper = crel(\"div\", { class: prefix + \"-wrapper\" });\n this.menu = this.wrapper.appendChild(crel(\"div\", { class: prefix }));\n this.menu.className = prefix;\n if (editorView.dom.parentNode)\n editorView.dom.parentNode.replaceChild(this.wrapper, editorView.dom);\n this.wrapper.appendChild(editorView.dom);\n let { dom, update } = renderGrouped(this.editorView, this.options.content);\n this.contentUpdate = update;\n this.menu.appendChild(dom);\n this.update();\n if (options.floating && !isIOS()) {\n this.updateFloat();\n let potentialScrollers = getAllWrapping(this.wrapper);\n this.scrollHandler = (e) => {\n let root = this.editorView.root;\n if (!(root.body || root).contains(this.wrapper))\n potentialScrollers.forEach(el => el.removeEventListener(\"scroll\", this.scrollHandler));\n else\n this.updateFloat(e.target.getBoundingClientRect ? e.target : undefined);\n };\n potentialScrollers.forEach(el => el.addEventListener('scroll', this.scrollHandler));\n }\n }\n update() {\n this.contentUpdate(this.editorView.state);\n if (this.floating) {\n this.updateScrollCursor();\n }\n else {\n if (this.menu.offsetWidth != this.widthForMaxHeight) {\n this.widthForMaxHeight = this.menu.offsetWidth;\n this.maxHeight = 0;\n }\n if (this.menu.offsetHeight > this.maxHeight) {\n this.maxHeight = this.menu.offsetHeight;\n this.menu.style.minHeight = this.maxHeight + \"px\";\n }\n }\n }\n updateScrollCursor() {\n let selection = this.editorView.root.getSelection();\n if (!selection.focusNode)\n return;\n let rects = selection.getRangeAt(0).getClientRects();\n let selRect = rects[selectionIsInverted(selection) ? 0 : rects.length - 1];\n if (!selRect)\n return;\n let menuRect = this.menu.getBoundingClientRect();\n if (selRect.top < menuRect.bottom && selRect.bottom > menuRect.top) {\n let scrollable = findWrappingScrollable(this.wrapper);\n if (scrollable)\n scrollable.scrollTop -= (menuRect.bottom - selRect.top);\n }\n }\n updateFloat(scrollAncestor) {\n let parent = this.wrapper, editorRect = parent.getBoundingClientRect(), top = scrollAncestor ? Math.max(0, scrollAncestor.getBoundingClientRect().top) : 0;\n if (this.floating) {\n if (editorRect.top >= top || editorRect.bottom < this.menu.offsetHeight + 10) {\n this.floating = false;\n this.menu.style.position = this.menu.style.left = this.menu.style.top = this.menu.style.width = \"\";\n this.menu.style.display = \"\";\n this.spacer.parentNode.removeChild(this.spacer);\n this.spacer = null;\n }\n else {\n let border = (parent.offsetWidth - parent.clientWidth) / 2;\n this.menu.style.left = (editorRect.left + border) + \"px\";\n this.menu.style.display = editorRect.top > (this.editorView.dom.ownerDocument.defaultView || window).innerHeight\n ? \"none\" : \"\";\n if (scrollAncestor)\n this.menu.style.top = top + \"px\";\n }\n }\n else {\n if (editorRect.top < top && editorRect.bottom >= this.menu.offsetHeight + 10) {\n this.floating = true;\n let menuRect = this.menu.getBoundingClientRect();\n this.menu.style.left = menuRect.left + \"px\";\n this.menu.style.width = menuRect.width + \"px\";\n if (scrollAncestor)\n this.menu.style.top = top + \"px\";\n this.menu.style.position = \"fixed\";\n this.spacer = crel(\"div\", { class: prefix + \"-spacer\", style: `height: ${menuRect.height}px` });\n parent.insertBefore(this.spacer, this.menu);\n }\n }\n }\n destroy() {\n if (this.wrapper.parentNode)\n this.wrapper.parentNode.replaceChild(this.editorView.dom, this.wrapper);\n }\n}\n// Not precise, but close enough\nfunction selectionIsInverted(selection) {\n if (selection.anchorNode == selection.focusNode)\n return selection.anchorOffset > selection.focusOffset;\n return selection.anchorNode.compareDocumentPosition(selection.focusNode) == Node.DOCUMENT_POSITION_FOLLOWING;\n}\nfunction findWrappingScrollable(node) {\n for (let cur = node.parentNode; cur; cur = cur.parentNode)\n if (cur.scrollHeight > cur.clientHeight)\n return cur;\n}\nfunction getAllWrapping(node) {\n let res = [node.ownerDocument.defaultView || window];\n for (let cur = node.parentNode; cur; cur = cur.parentNode)\n res.push(cur);\n return res;\n}\n\nexport { Dropdown, DropdownSubmenu, MenuItem, blockTypeItem, icons, joinUpItem, liftItem, menuBar, redoItem, renderGrouped, selectParentNodeItem, undoItem, wrapItem };\n","import { Plugin } from 'prosemirror-state';\nimport { findWrapping, canJoin } from 'prosemirror-transform';\n\n/**\nInput rules are regular expressions describing a piece of text\nthat, when typed, causes something to happen. This might be\nchanging two dashes into an emdash, wrapping a paragraph starting\nwith `\"> \"` into a blockquote, or something entirely different.\n*/\nclass InputRule {\n // :: (RegExp, union)\n /**\n Create an input rule. The rule applies when the user typed\n something and the text directly in front of the cursor matches\n `match`, which should end with `$`.\n \n The `handler` can be a string, in which case the matched text, or\n the first matched group in the regexp, is replaced by that\n string.\n \n Or a it can be a function, which will be called with the match\n array produced by\n [`RegExp.exec`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec),\n as well as the start and end of the matched range, and which can\n return a [transaction](https://prosemirror.net/docs/ref/#state.Transaction) that describes the\n rule's effect, or null to indicate the input was not handled.\n */\n constructor(\n /**\n @internal\n */\n match, handler, options = {}) {\n this.match = match;\n this.match = match;\n this.handler = typeof handler == \"string\" ? stringHandler(handler) : handler;\n this.undoable = options.undoable !== false;\n this.inCode = options.inCode || false;\n }\n}\nfunction stringHandler(string) {\n return function (state, match, start, end) {\n let insert = string;\n if (match[1]) {\n let offset = match[0].lastIndexOf(match[1]);\n insert += match[0].slice(offset + match[1].length);\n start += offset;\n let cutOff = start - end;\n if (cutOff > 0) {\n insert = match[0].slice(offset - cutOff, offset) + insert;\n start = end;\n }\n }\n return state.tr.insertText(insert, start, end);\n };\n}\nconst MAX_MATCH = 500;\n/**\nCreate an input rules plugin. When enabled, it will cause text\ninput that matches any of the given rules to trigger the rule's\naction.\n*/\nfunction inputRules({ rules }) {\n let plugin = new Plugin({\n state: {\n init() { return null; },\n apply(tr, prev) {\n let stored = tr.getMeta(this);\n if (stored)\n return stored;\n return tr.selectionSet || tr.docChanged ? null : prev;\n }\n },\n props: {\n handleTextInput(view, from, to, text) {\n return run(view, from, to, text, rules, plugin);\n },\n handleDOMEvents: {\n compositionend: (view) => {\n setTimeout(() => {\n let { $cursor } = view.state.selection;\n if ($cursor)\n run(view, $cursor.pos, $cursor.pos, \"\", rules, plugin);\n });\n }\n }\n },\n isInputRules: true\n });\n return plugin;\n}\nfunction run(view, from, to, text, rules, plugin) {\n if (view.composing)\n return false;\n let state = view.state, $from = state.doc.resolve(from);\n let textBefore = $from.parent.textBetween(Math.max(0, $from.parentOffset - MAX_MATCH), $from.parentOffset, null, \"\\ufffc\") + text;\n for (let i = 0; i < rules.length; i++) {\n let rule = rules[i];\n if ($from.parent.type.spec.code) {\n if (!rule.inCode)\n continue;\n }\n else if (rule.inCode === \"only\") {\n continue;\n }\n let match = rule.match.exec(textBefore);\n let tr = match && rule.handler(state, match, from - (match[0].length - text.length), to);\n if (!tr)\n continue;\n if (rule.undoable)\n tr.setMeta(plugin, { transform: tr, from, to, text });\n view.dispatch(tr);\n return true;\n }\n return false;\n}\n/**\nThis is a command that will undo an input rule, if applying such a\nrule was the last thing that the user did.\n*/\nconst undoInputRule = (state, dispatch) => {\n let plugins = state.plugins;\n for (let i = 0; i < plugins.length; i++) {\n let plugin = plugins[i], undoable;\n if (plugin.spec.isInputRules && (undoable = plugin.getState(state))) {\n if (dispatch) {\n let tr = state.tr, toUndo = undoable.transform;\n for (let j = toUndo.steps.length - 1; j >= 0; j--)\n tr.step(toUndo.steps[j].invert(toUndo.docs[j]));\n if (undoable.text) {\n let marks = tr.doc.resolve(undoable.from).marks();\n tr.replaceWith(undoable.from, undoable.to, state.schema.text(undoable.text, marks));\n }\n else {\n tr.delete(undoable.from, undoable.to);\n }\n dispatch(tr);\n }\n return true;\n }\n }\n return false;\n};\n\n/**\nConverts double dashes to an emdash.\n*/\nconst emDash = new InputRule(/--$/, \"—\");\n/**\nConverts three dots to an ellipsis character.\n*/\nconst ellipsis = new InputRule(/\\.\\.\\.$/, \"…\");\n/**\n“Smart” opening double quotes.\n*/\nconst openDoubleQuote = new InputRule(/(?:^|[\\s\\{\\[\\(\\<'\"\\u2018\\u201C])(\")$/, \"“\");\n/**\n“Smart” closing double quotes.\n*/\nconst closeDoubleQuote = new InputRule(/\"$/, \"”\");\n/**\n“Smart” opening single quotes.\n*/\nconst openSingleQuote = new InputRule(/(?:^|[\\s\\{\\[\\(\\<'\"\\u2018\\u201C])(')$/, \"‘\");\n/**\n“Smart” closing single quotes.\n*/\nconst closeSingleQuote = new InputRule(/'$/, \"’\");\n/**\nSmart-quote related input rules.\n*/\nconst smartQuotes = [openDoubleQuote, closeDoubleQuote, openSingleQuote, closeSingleQuote];\n\n/**\nBuild an input rule for automatically wrapping a textblock when a\ngiven string is typed. The `regexp` argument is\ndirectly passed through to the `InputRule` constructor. You'll\nprobably want the regexp to start with `^`, so that the pattern can\nonly occur at the start of a textblock.\n\n`nodeType` is the type of node to wrap in. If it needs attributes,\nyou can either pass them directly, or pass a function that will\ncompute them from the regular expression match.\n\nBy default, if there's a node with the same type above the newly\nwrapped node, the rule will try to [join](https://prosemirror.net/docs/ref/#transform.Transform.join) those\ntwo nodes. You can pass a join predicate, which takes a regular\nexpression match and the node before the wrapped node, and can\nreturn a boolean to indicate whether a join should happen.\n*/\nfunction wrappingInputRule(regexp, nodeType, getAttrs = null, joinPredicate) {\n return new InputRule(regexp, (state, match, start, end) => {\n let attrs = getAttrs instanceof Function ? getAttrs(match) : getAttrs;\n let tr = state.tr.delete(start, end);\n let $start = tr.doc.resolve(start), range = $start.blockRange(), wrapping = range && findWrapping(range, nodeType, attrs);\n if (!wrapping)\n return null;\n tr.wrap(range, wrapping);\n let before = tr.doc.resolve(start - 1).nodeBefore;\n if (before && before.type == nodeType && canJoin(tr.doc, start - 1) &&\n (!joinPredicate || joinPredicate(match, before)))\n tr.join(start - 1);\n return tr;\n });\n}\n/**\nBuild an input rule that changes the type of a textblock when the\nmatched text is typed into it. You'll usually want to start your\nregexp with `^` to that it is only matched at the start of a\ntextblock. The optional `getAttrs` parameter can be used to compute\nthe new node's attributes, and works the same as in the\n`wrappingInputRule` function.\n*/\nfunction textblockTypeInputRule(regexp, nodeType, getAttrs = null) {\n return new InputRule(regexp, (state, match, start, end) => {\n let $start = state.doc.resolve(start);\n let attrs = getAttrs instanceof Function ? getAttrs(match) : getAttrs;\n if (!$start.node(-1).canReplaceWith($start.index(-1), $start.indexAfter(-1), nodeType))\n return null;\n return state.tr\n .delete(start, end)\n .setBlockType(start, start, nodeType, attrs);\n });\n}\n\nexport { InputRule, closeDoubleQuote, closeSingleQuote, ellipsis, emDash, inputRules, openDoubleQuote, openSingleQuote, smartQuotes, textblockTypeInputRule, undoInputRule, wrappingInputRule };\n","// src/selection.ts\nimport { Selection as Selection3 } from \"prosemirror-state\";\n\n// src/helpers.ts\nimport { NodeSelection as NodeSelection2 } from \"prosemirror-state\";\nimport { Fragment as Fragment2, Node as PMNode2 } from \"prosemirror-model\";\n\n// src/transforms.ts\nimport { NodeSelection, Selection } from \"prosemirror-state\";\nimport {\n Fragment,\n Node as PMNode\n} from \"prosemirror-model\";\nvar removeParentNodeOfType = (nodeType) => (tr) => {\n const parent = findParentNodeOfType(nodeType)(tr.selection);\n if (parent) {\n return removeNodeAtPos(parent.pos)(tr);\n }\n return tr;\n};\nvar replaceParentNodeOfType = (nodeType, content) => (tr) => {\n if (!Array.isArray(nodeType)) {\n nodeType = [nodeType];\n }\n for (let i = 0, count = nodeType.length; i < count; i++) {\n const parent = findParentNodeOfType(nodeType[i])(tr.selection);\n if (parent) {\n const newTr = replaceNodeAtPos(parent.pos, content)(tr);\n if (newTr !== tr) {\n return newTr;\n }\n }\n }\n return tr;\n};\nvar removeSelectedNode = (tr) => {\n if (isNodeSelection(tr.selection)) {\n const from = tr.selection.$from.pos;\n const to = tr.selection.$to.pos;\n return cloneTr(tr.delete(from, to));\n }\n return tr;\n};\nvar replaceSelectedNode = (content) => (tr) => {\n if (isNodeSelection(tr.selection)) {\n const { $from, $to } = tr.selection;\n if (content instanceof Fragment && $from.parent.canReplace(\n $from.index(),\n $from.indexAfter(),\n content\n ) || content instanceof PMNode && $from.parent.canReplaceWith(\n $from.index(),\n $from.indexAfter(),\n content.type\n )) {\n return cloneTr(\n tr.replaceWith($from.pos, $to.pos, content).setSelection(new NodeSelection(tr.doc.resolve($from.pos)))\n );\n }\n }\n return tr;\n};\nvar setTextSelection = (position, dir = 1) => (tr) => {\n const nextSelection = Selection.findFrom(\n tr.doc.resolve(position),\n dir,\n true\n );\n if (nextSelection) {\n return tr.setSelection(nextSelection);\n }\n return tr;\n};\nvar isSelectableNode = (node) => Boolean(node instanceof PMNode && node.type && node.type.spec.selectable);\nvar shouldSelectNode = (node) => isSelectableNode(node) && node.type.isLeaf;\nvar setSelection = (node, pos, tr) => {\n if (shouldSelectNode(node)) {\n return tr.setSelection(new NodeSelection(tr.doc.resolve(pos)));\n }\n return setTextSelection(pos)(tr);\n};\nvar safeInsert = (content, position, tryToReplace) => (tr) => {\n const hasPosition = typeof position === \"number\";\n const { $from } = tr.selection;\n const $insertPos = hasPosition ? tr.doc.resolve(position) : isNodeSelection(tr.selection) ? tr.doc.resolve($from.pos + 1) : $from;\n const { parent } = $insertPos;\n if (isNodeSelection(tr.selection) && tryToReplace) {\n const oldTr = tr;\n tr = replaceSelectedNode(content)(tr);\n if (oldTr !== tr) {\n return tr;\n }\n }\n if (isEmptyParagraph(parent)) {\n const oldTr = tr;\n tr = replaceParentNodeOfType(parent.type, content)(tr);\n if (oldTr !== tr) {\n const pos = isSelectableNode(content) ? (\n // for selectable node, selection position would be the position of the replaced parent\n $insertPos.before($insertPos.depth)\n ) : $insertPos.pos;\n return setSelection(content, pos, tr);\n }\n }\n if (canInsert($insertPos, content)) {\n tr.insert($insertPos.pos, content);\n const pos = hasPosition ? $insertPos.pos : isSelectableNode(content) ? (\n // for atom nodes selection position after insertion is the previous pos\n tr.selection.$anchor.pos - 1\n ) : tr.selection.$anchor.pos;\n return cloneTr(setSelection(content, pos, tr));\n }\n for (let i = $insertPos.depth; i > 0; i--) {\n const pos = $insertPos.after(i);\n const $pos = tr.doc.resolve(pos);\n if (canInsert($pos, content)) {\n tr.insert(pos, content);\n return cloneTr(setSelection(content, pos, tr));\n }\n }\n return tr;\n};\nvar setParentNodeMarkup = (nodeType, type, attrs, marks) => (tr) => {\n const parent = findParentNodeOfType(nodeType)(tr.selection);\n if (parent) {\n return cloneTr(\n tr.setNodeMarkup(\n parent.pos,\n type,\n Object.assign({}, parent.node.attrs, attrs),\n marks\n )\n );\n }\n return tr;\n};\nvar selectParentNodeOfType = (nodeType) => (tr) => {\n if (!isNodeSelection(tr.selection)) {\n const parent = findParentNodeOfType(nodeType)(tr.selection);\n if (parent) {\n return cloneTr(\n tr.setSelection(NodeSelection.create(tr.doc, parent.pos))\n );\n }\n }\n return tr;\n};\nvar removeNodeBefore = (tr) => {\n const position = findPositionOfNodeBefore(tr.selection);\n if (typeof position === \"number\") {\n return removeNodeAtPos(position)(tr);\n }\n return tr;\n};\n\n// src/helpers.ts\nvar isNodeSelection = (selection) => {\n return selection instanceof NodeSelection2;\n};\nvar equalNodeType = (nodeType, node) => {\n return Array.isArray(nodeType) && nodeType.indexOf(node.type) > -1 || node.type === nodeType;\n};\nvar cloneTr = (tr) => {\n return Object.assign(Object.create(tr), tr).setTime(Date.now());\n};\nvar replaceNodeAtPos = (position, content) => (tr) => {\n const node = tr.doc.nodeAt(position);\n const $pos = tr.doc.resolve(position);\n if (!node) {\n return tr;\n }\n if (canReplace($pos, content)) {\n tr = tr.replaceWith(position, position + node.nodeSize, content);\n const start = tr.selection.$from.pos - 1;\n tr = setTextSelection(Math.max(start, 0), -1)(tr);\n tr = setTextSelection(tr.selection.$from.start())(tr);\n return cloneTr(tr);\n }\n return tr;\n};\nvar canReplace = ($pos, content) => {\n const node = $pos.node($pos.depth);\n return node && node.type.validContent(\n content instanceof Fragment2 ? content : Fragment2.from(content)\n );\n};\nvar removeNodeAtPos = (position) => (tr) => {\n const node = tr.doc.nodeAt(position);\n if (!node) {\n return tr;\n }\n return cloneTr(tr.delete(position, position + node.nodeSize));\n};\nvar canInsert = ($pos, content) => {\n const index = $pos.index();\n if (content instanceof Fragment2) {\n return $pos.parent.canReplace(index, index, content);\n } else if (content instanceof PMNode2) {\n return $pos.parent.canReplaceWith(index, index, content.type);\n }\n return false;\n};\nvar isEmptyParagraph = (node) => {\n return !node || node.type.name === \"paragraph\" && node.nodeSize === 2;\n};\n\n// src/selection.ts\nvar findParentNode = (predicate) => ({ $from, $to }, validateSameParent = false) => {\n if (validateSameParent && !$from.sameParent($to)) {\n let depth = Math.min($from.depth, $to.depth);\n while (depth >= 0) {\n const fromNode = $from.node(depth);\n const toNode = $to.node(depth);\n if (toNode === fromNode) {\n if (predicate(fromNode)) {\n return {\n // Return the resolved pos\n pos: depth > 0 ? $from.before(depth) : 0,\n start: $from.start(depth),\n depth,\n node: fromNode\n };\n }\n }\n depth = depth - 1;\n }\n return;\n }\n return findParentNodeClosestToPos($from, predicate);\n};\nvar findParentNodeClosestToPos = ($pos, predicate) => {\n for (let i = $pos.depth; i > 0; i--) {\n const node = $pos.node(i);\n if (predicate(node)) {\n return {\n pos: i > 0 ? $pos.before(i) : 0,\n start: $pos.start(i),\n depth: i,\n node\n };\n }\n }\n};\nvar findParentDomRef = (predicate, domAtPos) => (selection) => {\n const parent = findParentNode(predicate)(selection);\n if (parent) {\n return findDomRefAtPos(parent.pos, domAtPos);\n }\n};\nvar hasParentNode = (predicate) => (selection) => {\n return !!findParentNode(predicate)(selection);\n};\nvar findParentNodeOfType = (nodeType) => (selection) => {\n return findParentNode((node) => equalNodeType(nodeType, node))(selection);\n};\nvar findParentNodeOfTypeClosestToPos = ($pos, nodeType) => {\n return findParentNodeClosestToPos(\n $pos,\n (node) => equalNodeType(nodeType, node)\n );\n};\nvar hasParentNodeOfType = (nodeType) => (selection) => {\n return hasParentNode((node) => equalNodeType(nodeType, node))(selection);\n};\nvar findParentDomRefOfType = (nodeType, domAtPos) => (selection) => {\n return findParentDomRef(\n (node) => equalNodeType(nodeType, node),\n domAtPos\n )(selection);\n};\nvar findSelectedNodeOfType = (nodeType) => (selection) => {\n if (isNodeSelection(selection)) {\n const { node, $from } = selection;\n if (equalNodeType(nodeType, node)) {\n return {\n node,\n start: $from.start(),\n pos: $from.pos,\n depth: $from.depth\n };\n }\n }\n};\nvar findPositionOfNodeBefore = (selection) => {\n const { nodeBefore } = selection.$from;\n const maybeSelection = Selection3.findFrom(selection.$from, -1);\n if (maybeSelection && nodeBefore) {\n const parent = findParentNodeOfType(nodeBefore.type)(maybeSelection);\n if (parent) {\n return parent.pos;\n }\n return maybeSelection.$from.pos;\n }\n};\nvar findDomRefAtPos = (position, domAtPos) => {\n const dom = domAtPos(position);\n const node = dom.node.childNodes[dom.offset];\n if (dom.node.nodeType === Node.TEXT_NODE && dom.node.parentNode) {\n return dom.node.parentNode;\n }\n if (!node || node.nodeType === Node.TEXT_NODE) {\n return dom.node;\n }\n return node;\n};\n\n// src/node.ts\nvar flatten = (node, descend = true) => {\n if (!node) {\n throw new Error('Invalid \"node\" parameter');\n }\n const result = [];\n node.descendants((child, pos) => {\n result.push({ node: child, pos });\n if (!descend) {\n return false;\n }\n });\n return result;\n};\nvar findChildren = (node, predicate, descend = true) => {\n if (!node) {\n throw new Error('Invalid \"node\" parameter');\n } else if (!predicate) {\n throw new Error('Invalid \"predicate\" parameter');\n }\n return flatten(node, descend).filter((child) => predicate(child.node));\n};\nvar findTextNodes = (node, descend = true) => {\n return findChildren(node, (child) => child.isText, descend);\n};\nvar findInlineNodes = (node, descend = true) => {\n return findChildren(node, (child) => child.isInline, descend);\n};\nvar findBlockNodes = (node, descend = true) => {\n return findChildren(node, (child) => child.isBlock, descend);\n};\nvar findChildrenByAttr = (node, predicate, descend = true) => {\n return findChildren(node, (child) => !!predicate(child.attrs), descend);\n};\nvar findChildrenByType = (node, nodeType, descend = true) => {\n return findChildren(node, (child) => child.type === nodeType, descend);\n};\nvar findChildrenByMark = (node, markType, descend = true) => {\n return findChildren(\n node,\n (child) => Boolean(markType.isInSet(child.marks)),\n descend\n );\n};\nvar contains = (node, nodeType) => {\n return !!findChildrenByType(node, nodeType).length;\n};\nexport {\n canInsert,\n contains,\n findBlockNodes,\n findChildren,\n findChildrenByAttr,\n findChildrenByMark,\n findChildrenByType,\n findDomRefAtPos,\n findInlineNodes,\n findParentDomRef,\n findParentDomRefOfType,\n findParentNode,\n findParentNodeClosestToPos,\n findParentNodeOfType,\n findParentNodeOfTypeClosestToPos,\n findPositionOfNodeBefore,\n findSelectedNodeOfType,\n findTextNodes,\n flatten,\n hasParentNode,\n hasParentNodeOfType,\n isNodeSelection,\n removeNodeBefore,\n removeParentNodeOfType,\n removeSelectedNode,\n replaceParentNodeOfType,\n replaceSelectedNode,\n safeInsert,\n selectParentNodeOfType,\n setParentNodeMarkup,\n setTextSelection\n};\n//# sourceMappingURL=index.js.map\n","import { findWrapping, ReplaceAroundStep, canSplit, liftTarget, canJoin } from 'prosemirror-transform';\nimport { NodeRange, Fragment, Slice } from 'prosemirror-model';\nimport { Selection } from 'prosemirror-state';\n\nconst olDOM = [\"ol\", 0], ulDOM = [\"ul\", 0], liDOM = [\"li\", 0];\n/**\nAn ordered list [node spec](https://prosemirror.net/docs/ref/#model.NodeSpec). Has a single\nattribute, `order`, which determines the number at which the list\nstarts counting, and defaults to 1. Represented as an `
    `\nelement.\n*/\nconst orderedList = {\n attrs: { order: { default: 1, validate: \"number\" } },\n parseDOM: [{ tag: \"ol\", getAttrs(dom) {\n return { order: dom.hasAttribute(\"start\") ? +dom.getAttribute(\"start\") : 1 };\n } }],\n toDOM(node) {\n return node.attrs.order == 1 ? olDOM : [\"ol\", { start: node.attrs.order }, 0];\n }\n};\n/**\nA bullet list node spec, represented in the DOM as `