@edmissioncrm/editor 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +111 -2
- package/THIRD_PARTY_LICENSES.md +2728 -0
- package/dist/index.cjs +287 -0
- package/dist/index.js +47736 -0
- package/index.d.ts +144 -0
- package/package.json +49 -4
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("react/jsx-runtime"),v=require("react"),ca=require("react-dom"),Cg=':root{--edm-bg: #f4f6f8;--edm-panel: #ffffff;--edm-panel-border: #dfe4ea;--edm-text: #1f2937;--edm-muted: #6b7280;--edm-accent: #2d6cdf;--edm-accent-strong: #1e57be;--edm-surface: #f8fafc;--edm-canvas: #ffffff;--edm-radius-xl: 18px;--edm-radius-lg: 14px;--edm-radius-md: 10px;--edm-shadow: 0 8px 24px rgba(15, 23, 42, .06);--edm-font: "Inter", "Segoe UI", sans-serif;--mc-control-h: 36px;--mc-control-radius: 8px;--mc-control-pad-x: 12px;--mc-control-font: .86rem;--mc-gap: 10px;--mc-primary: #242424;--mc-primary-text: #ffffff}.edm-shell--dark{--edm-bg: #10151f;--edm-panel: #151c28;--edm-panel-border: #2a3444;--edm-text: #edf2f7;--edm-muted: #94a3b8;--edm-accent: #6ea8ff;--edm-accent-strong: #8cbcff;--edm-surface: #0f1724;--edm-canvas: #ffffff;--edm-shadow: 0 16px 36px rgba(0, 0, 0, .32)}*{box-sizing:border-box}body{margin:0;font-family:var(--edm-font);color:var(--edm-text);background:var(--edm-bg)}button,input,textarea,select{font:inherit}.edm-shell{position:relative;display:grid;grid-template-columns:minmax(0,1fr) 320px;height:100%;min-height:0;gap:14px;padding:14px;background:var(--edm-bg);overflow:hidden}.edm-shell--preview .edm-sidebar-right,.edm-shell--preview .edm-sidebar-resizer,.edm-shell--preview .edm-sidebar-collapse{display:none}.edm-sidebar,.edm-inspector,.edm-canvas,.edm-toolbar{border:1px solid var(--edm-panel-border);background:var(--edm-panel);box-shadow:var(--edm-shadow)}.edm-sidebar,.edm-inspector{border-radius:var(--edm-radius-xl);padding:16px}.edm-sidebar-right{position:relative;min-width:0;min-height:0;overflow:visible}.edm-sidebar-right.is-collapsed{padding:16px 10px}.edm-sidebar-resizer{position:absolute;left:-12px;top:14px;bottom:14px;width:16px;cursor:col-resize}.edm-sidebar-resizer:before{content:"";position:absolute;left:7px;top:0;bottom:0;width:2px;border-radius:999px;background:#dde4ec}.edm-sidebar-collapse{position:absolute;left:-22px;top:50%;transform:translateY(-50%);width:36px;height:36px;display:grid;place-items:center;border:1px solid rgba(45,108,223,.22);border-radius:999px;background:linear-gradient(180deg,#fff,#f8fbff);color:var(--edm-accent-strong);box-shadow:0 12px 28px #0f172a24;cursor:pointer;z-index:12;transition:transform .14s ease,box-shadow .14s ease,border-color .14s ease,background .14s ease}.edm-sidebar-collapse svg{width:16px;height:16px}.edm-sidebar-collapse:hover,.edm-sidebar-collapse:focus-visible{border-color:#2d6cdf66;background:linear-gradient(180deg,#fff,#edf4ff);box-shadow:0 14px 32px #0f172a2e;transform:translateY(-50%) scale(1.03)}.edm-workspace{display:grid;grid-template-rows:auto minmax(320px,1fr);gap:14px;min-height:0;overflow:hidden}.edm-toolbar{border-radius:var(--edm-radius-xl);padding:10px 12px;display:flex;justify-content:center;align-items:center;gap:14px}.edm-toolbar-main{flex:1;display:flex;justify-content:space-between;align-items:center;gap:14px}.edm-toolbar-group{display:flex;align-items:center;gap:8px}.edm-toolbar-group-center{justify-content:center}.edm-toolbar-icon{position:relative;width:36px;height:36px;display:grid;place-items:center;border:1px solid var(--edm-panel-border);background:#f8fafc;color:var(--edm-muted);border-radius:9px;cursor:pointer}.edm-toolbar-icon svg{width:18px;height:18px}.edm-toolbar-icon--custom{padding:0 8px;min-width:36px;width:auto}.edm-toolbar-custom-label{font-size:.72rem;font-weight:700;letter-spacing:.04em}.edm-toolbar-icon:after,.edm-action-icon:after{content:attr(data-tooltip);position:absolute;left:50%;bottom:calc(100% + 8px);transform:translate(-50%) translateY(4px);white-space:nowrap;background:#111827f0;color:#fff;font-size:.72rem;line-height:1;padding:7px 9px;border-radius:8px;opacity:0;pointer-events:none;transition:opacity .14s ease,transform .14s ease;z-index:20}.edm-toolbar-icon:after{top:calc(100% + 8px);bottom:auto;transform:translate(-50%) translateY(-4px)}.edm-toolbar-icon:hover:after,.edm-toolbar-icon:focus-visible:after,.edm-action-icon:hover:after,.edm-action-icon:focus-visible:after{opacity:1;transform:translate(-50%) translateY(0)}.edm-toolbar-icon.is-active{color:var(--edm-accent);border-color:#2d6cdf4d;background:#2d6cdf0f}.edm-toolbar-group:last-child .edm-toolbar-icon:after{left:auto;right:0;transform:translateY(-4px)}.edm-toolbar-group:last-child .edm-toolbar-icon:hover:after,.edm-toolbar-group:last-child .edm-toolbar-icon:focus-visible:after{transform:translateY(0)}.edm-palette-card,.edm-block-card{border:0;border-radius:var(--edm-radius-md)}.edm-palette-card{cursor:pointer}.edm-toolbar-icon:disabled,.edm-action-icon:disabled{opacity:.45;cursor:not-allowed}.edm-canvas{border-radius:var(--edm-radius-xl);padding:14px}.edm-canvas{display:grid;grid-template-rows:1fr;background:#f8fafc;min-height:0;overflow:auto;overscroll-behavior:contain}.edm-panel-title{display:flex;justify-content:space-between;align-items:start;gap:10px;position:sticky;top:0;z-index:4;background:var(--edm-panel);padding-bottom:8px}.edm-panel-title span{font-size:.95rem;font-weight:600}.edm-panel-title small,.edm-eyebrow{color:var(--edm-muted)}.edm-palette-grid{display:grid;gap:8px;margin-top:12px}.edm-layout-grid{margin-bottom:18px}.edm-section-title{margin-top:12px}.edm-palette-card{text-align:left;padding:12px;background:#fff;border:1px solid var(--edm-panel-border);display:grid;gap:5px}.edm-palette-card span{color:var(--edm-muted);font-size:.82rem}.edm-canvas-stack{display:grid;gap:12px;align-content:start;overflow:visible;padding:2px}.edm-canvas-dropzone{min-height:100%;border-radius:14px;transition:background .14s ease,box-shadow .14s ease,transform .14s ease}.edm-canvas-dropzone.is-over{background:#2d6cdf0f;box-shadow:inset 0 0 0 1px #2d6cdf2e;transform:translateY(-1px)}.edm-canvas-dropzone.is-empty{min-height:520px}.edm-empty-canvas{min-height:520px;border:1px dashed #d7dee7;border-radius:16px;background:radial-gradient(circle at top,rgba(45,108,223,.06),transparent 42%),linear-gradient(180deg,#fff,#f8fafc);display:grid;place-items:center;text-align:center;gap:14px;padding:40px 24px;color:var(--edm-muted)}.edm-empty-canvas strong{color:var(--edm-text);font-size:1.05rem}.edm-empty-canvas p{margin:0;max-width:320px;line-height:1.6}.edm-empty-canvas-illustration{width:110px;height:74px;position:relative}.edm-empty-canvas-illustration span{position:absolute;border:1px solid #d7dee7;border-radius:12px;background:#ffffffeb;box-shadow:0 10px 24px #0f172a0f}.edm-empty-canvas-illustration span:nth-child(1){top:18px;right:14px;bottom:0;left:14px}.edm-empty-canvas-illustration span:nth-child(2){width:34px;height:24px;left:0;top:24px}.edm-empty-canvas-illustration span:nth-child(3){width:34px;height:24px;right:0;top:24px}.edm-stage{width:100%;margin:0 auto;transition:max-width .16s ease}.edm-stage--desktop{max-width:760px}.edm-stage--mobile{max-width:420px}.edm-row-surface{position:relative;background:transparent;border:1px solid transparent;border-radius:14px;padding:6px;margin-top:10px;display:grid;gap:8px;align-content:start;transition:border-color .14s ease,box-shadow .14s ease,opacity .14s ease}.edm-row-surface.is-selected{border-color:transparent}.edm-row-surface:before,.edm-row-surface:after{content:"";position:absolute;left:14px;right:14px;height:3px;border-radius:999px;background:#2d6cdf;opacity:0;transform:scaleX(.72);transition:opacity .14s ease,transform .14s ease;pointer-events:none}.edm-row-surface:before{top:-8px}.edm-row-surface:after{bottom:-8px}.edm-row-surface.is-dragging{opacity:.54;box-shadow:0 14px 30px #0f172a1f}.edm-row-surface.is-row-over{border-color:#2d6cdf57}.edm-row-surface.is-row-over-top:before,.edm-row-surface.is-row-over-bottom:after{opacity:1;transform:scaleX(1)}.edm-row-surface.is-free-layout{outline:1px dashed rgba(45,108,223,.4);outline-offset:-4px;background-image:linear-gradient(rgba(45,108,223,.04) 1px,transparent 1px),linear-gradient(90deg,rgba(45,108,223,.04) 1px,transparent 1px);background-size:24px 24px}.edm-free-layout-badge{position:absolute;top:8px;left:8px;z-index:2;padding:2px 8px;border-radius:999px;font-size:11px;font-weight:600;letter-spacing:.02em;color:#2d6cdf;background:#2d6cdf1a;border:1px solid rgba(45,108,223,.28);pointer-events:none}.edm-row-header{position:absolute;top:auto;bottom:-22px;right:10px;z-index:6}.edm-row-header .edm-inline-actions,.edm-column-meta .edm-inline-actions,.edm-block-card-top .edm-inline-actions{opacity:0;pointer-events:none;transition:opacity .14s ease}.edm-row-surface:hover:not(:has(.edm-block-card:hover)):not(:has(.edm-column-surface:hover)) .edm-row-header .edm-inline-actions,.edm-column-surface:hover:not(:has(.edm-block-card:hover)) .edm-column-meta .edm-inline-actions,.edm-block-card:hover .edm-block-card-top .edm-inline-actions,.edm-block-card.is-selected .edm-block-card-top .edm-inline-actions{opacity:1;pointer-events:auto}.edm-row-surface:hover .edm-column-resize-handle,.edm-row-surface.is-selected .edm-column-resize-handle{opacity:1;pointer-events:auto}.edm-columns-grid{display:flex;gap:10px;align-items:start}.edm-column-surface{position:relative;min-width:0;padding:4px;border-radius:10px;border:1px solid transparent;background:transparent;transition:border-color .14s ease,box-shadow .14s ease}.edm-column-surface:hover{border-color:#2d6cdf24}.edm-column-resize-handle{position:absolute;top:50%;right:-11px;transform:translateY(-50%);width:22px;height:44px;border:1px solid rgba(45,108,223,.28);background:#fff;color:#2d6cdf;border-radius:999px;display:grid;place-items:center;cursor:ew-resize;opacity:0;pointer-events:none;box-shadow:0 8px 18px #0f172a14;z-index:6}.edm-column-resize-handle svg{width:14px;height:14px}.edm-column-surface.is-selected{border-color:transparent}.edm-column-surface.is-over{border-color:#2d6cdf66;background:linear-gradient(180deg,#2d6cdf0a,#2d6cdf03);box-shadow:0 0 0 3px #2d6cdf14}.edm-column-meta{position:absolute;top:8px;right:8px;z-index:4}.edm-column-stack{display:flex;flex-direction:column;padding-top:36px}.edm-block-stack-item{display:flex;flex-direction:column}.edm-block-slot{position:relative;height:12px;flex:0 0 12px}.edm-block-slot:before{content:"";position:absolute;left:10px;right:10px;top:50%;height:3px;border-radius:999px;background:transparent;transform:translateY(-50%) scaleX(.76);transition:background .14s ease,transform .14s ease}.edm-block-slot.is-over:before{background:#2d6cdf;transform:translateY(-50%) scaleX(1)}.edm-block-slot.is-over:after{content:"Drop here";position:absolute;right:12px;top:50%;transform:translateY(-50%);color:#2d6cdf;font-size:.72rem;font-weight:600}.edm-block-card{position:relative;width:100%;background:transparent;border:1px solid transparent;border-radius:var(--edm-radius-md);display:grid;gap:8px;padding:6px 8px;transition:border-color .14s ease,box-shadow .14s ease,background .14s ease}.edm-block-card:hover{border-color:#2d6cdf29;background:#2d6cdf06}.edm-block-card.is-selected{border-color:#2d6cdf6b;box-shadow:0 0 0 3px #2d6cdf14}.edm-block-card-body{width:100%;text-align:left;background:transparent;border:0;padding:0;display:grid;gap:8px;cursor:pointer}.edm-block-card-body--resizable{position:relative}.edm-media-resize{position:absolute;pointer-events:none;box-shadow:0 0 0 1.5px var(--edm-accent, #2f6df6);border-radius:6px;z-index:5}.edm-media-resize-handle{position:absolute;width:12px;height:12px;margin:-6px 0 0 -6px;padding:0;border:1.5px solid var(--edm-accent, #2f6df6);background:#fff;border-radius:50%;box-shadow:0 1px 3px #00000040;pointer-events:auto;touch-action:none;cursor:pointer}.edm-media-resize-handle--nw{top:0;left:0;cursor:nwse-resize}.edm-media-resize-handle--n{top:0;left:50%;cursor:ns-resize}.edm-media-resize-handle--ne{top:0;left:100%;cursor:nesw-resize}.edm-media-resize-handle--e{top:50%;left:100%;cursor:ew-resize}.edm-media-resize-handle--se{top:100%;left:100%;cursor:nwse-resize}.edm-media-resize-handle--s{top:100%;left:50%;cursor:ns-resize}.edm-media-resize-handle--sw{top:100%;left:0;cursor:nesw-resize}.edm-media-resize-handle--w{top:50%;left:0;cursor:ew-resize}.edm-media-resize-badge{position:absolute;top:-26px;left:50%;transform:translate(-50%);padding:2px 8px;border-radius:999px;background:var(--edm-accent, #2f6df6);color:#fff;font-size:11px;font-weight:600;white-space:nowrap;pointer-events:none}.edm-table-editor{display:grid;gap:8px}.edm-table-grid{display:grid;gap:4px}.edm-table-cell{display:flex;min-width:0;border-radius:6px;padding:2px;cursor:cell}.edm-table-cell.is-selected{background:color-mix(in srgb,var(--edm-accent, #2f6df6) 16%,transparent);box-shadow:inset 0 0 0 1px var(--edm-accent, #2f6df6)}.edm-table-cell.is-merged .edm-table-cell-input{border-style:dashed;border-color:var(--edm-accent, #2f6df6)}.edm-table-cell-input{width:100%;min-width:0;padding:6px 8px;border:1px solid var(--edm-panel-border, #e6ecea);border-radius:6px;font-size:12px;font-family:inherit;background:var(--edm-surface, #fff);color:inherit}.edm-table-cell-input:focus{outline:none;border-color:var(--edm-accent, #2f6df6)}.edm-table-hint{margin:0;font-size:11px;line-height:1.4;color:var(--edm-muted, #7a8699)}.edm-qa-panel{width:min(560px,92vw);max-height:82vh;overflow:auto;padding:18px;border-radius:16px;background:var(--edm-panel, #fff);box-shadow:0 24px 60px #0f172a47}.edm-qa-drawer{position:fixed;top:64px;right:12px;bottom:12px;width:min(340px,92vw);overflow:auto;padding:16px;border:1px solid var(--edm-panel-border, #e6ecea);border-radius:14px;background:var(--edm-panel, #fff);box-shadow:0 18px 48px #0f172a38;z-index:40}.edm-toolbar-icon{position:relative}.edm-toolbar-badge{position:absolute;top:-4px;right:-4px;min-width:16px;height:16px;padding:0 4px;border-radius:999px;font-size:10px;font-weight:700;line-height:16px;text-align:center;color:#fff}.edm-toolbar-badge--error{background:#dc2626}.edm-toolbar-badge--warning{background:#d97706}.edm-toolbar-badge--info{background:#2563eb}.edm-qa-empty{padding:24px;text-align:center;color:#16a34a;font-weight:600}.edm-qa-list{list-style:none;margin:12px 0 0;padding:0;display:flex;flex-direction:column;gap:8px}.edm-qa-item{display:flex;align-items:flex-start;gap:10px;padding:10px 12px;border:1px solid var(--edm-panel-border, #e6ecea);border-radius:10px}.edm-qa-item.is-clickable{cursor:pointer}.edm-qa-item.is-clickable:hover{border-color:var(--edm-accent, #2f6df6);background:var(--edm-surface-muted, #f4f8f7)}.edm-qa-badge{flex:0 0 auto;width:20px;height:20px;border-radius:999px;display:grid;place-items:center;font-size:12px;font-weight:700;color:#fff}.edm-qa-badge--error{background:#dc2626}.edm-qa-badge--warning{background:#d97706}.edm-qa-badge--info{background:#2563eb}.edm-qa-body{display:flex;flex-direction:column;gap:2px;flex:1}.edm-qa-message{font-size:13px;color:var(--edm-text, #14213d)}.edm-qa-hint{font-size:12px;color:var(--edm-muted, #6b7280)}.edm-qa-jump{flex:0 0 auto;align-self:center;font-size:12px;font-weight:600;color:var(--edm-accent, #2f6df6)}.edm-theme-panel{width:min(560px,92vw);max-height:86vh;overflow:auto;padding:18px;border-radius:16px;background:var(--edm-panel, #fff);box-shadow:0 24px 60px #0f172a47}.edm-theme-body{display:flex;flex-direction:column;gap:18px;margin-top:8px}.edm-theme-presets{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.edm-theme-preset{display:flex;flex-direction:column;align-items:stretch;gap:6px;padding:8px;border:1px solid var(--edm-panel-border, #e6ecea);border-radius:10px;background:var(--edm-surface, #fff);color:var(--edm-text, #14213d);cursor:pointer}.edm-theme-preset:hover{border-color:var(--edm-accent, #2f6df6)}.edm-theme-preset.is-active{border-color:var(--edm-accent, #2f6df6);box-shadow:0 0 0 1px var(--edm-accent, #2f6df6)}.edm-theme-preset-swatch{display:flex;height:28px;border-radius:6px;overflow:hidden;border:1px solid var(--edm-panel-border, #e6ecea)}.edm-theme-preset-swatch>span{flex:1}.edm-theme-preset-name{font-size:12px;text-align:center}.edm-theme-section{display:flex;flex-direction:column;gap:8px}.edm-theme-section h4{margin:0;font-size:13px;font-weight:600;color:var(--edm-text, #14213d)}.edm-theme-hint{margin:0;font-size:12px;color:var(--edm-muted, #6b7280)}.edm-theme-hint code,.edm-theme-section code{font-size:11.5px;padding:1px 4px;border-radius:4px;background:var(--edm-surface-muted, #f1f5f4)}.edm-theme-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 14px}.edm-theme-field{display:flex;flex-direction:column;gap:4px}.edm-theme-field>label{font-size:12px;color:var(--edm-muted, #6b7280);text-transform:capitalize}.edm-theme-field select,.edm-theme-field>input[type=text],.edm-theme-color input[type=text]{height:32px;padding:0 8px;border:1px solid var(--edm-panel-border, #e6ecea);border-radius:8px;background:var(--edm-surface, #fff);color:var(--edm-text, #14213d);font:inherit;font-size:13px;min-width:0}.edm-theme-color{display:flex;align-items:center;gap:6px}.edm-theme-color input[type=color]{flex:0 0 auto;width:32px;height:32px;padding:2px;border:1px solid var(--edm-panel-border, #e6ecea);border-radius:8px;background:var(--edm-surface, #fff);cursor:pointer}.edm-theme-color input[type=text]{flex:1 1 auto}.edm-theme-remove{flex:0 0 auto;width:26px;height:26px;border:none;border-radius:6px;background:transparent;color:var(--edm-muted, #6b7280);font-size:18px;line-height:1;cursor:pointer}.edm-theme-remove:hover{background:var(--edm-surface-muted, #f4f8f7);color:#dc2626}.edm-theme-add{display:flex;gap:8px;margin-top:4px}.edm-theme-add input{flex:1 1 auto;height:32px;padding:0 8px;border:1px solid var(--edm-panel-border, #e6ecea);border-radius:8px;background:var(--edm-surface, #fff);color:var(--edm-text, #14213d);font:inherit;font-size:13px;min-width:0}.edm-theme-css{width:100%;min-height:120px;padding:10px 12px;border:1px solid var(--edm-panel-border, #e6ecea);border-radius:10px;background:var(--edm-surface, #fff);color:var(--edm-text, #14213d);font-family:ui-monospace,SF Mono,Menlo,Consolas,monospace;font-size:12.5px;line-height:1.5;resize:vertical}.edm-theme-apply{margin-top:14px;display:flex;flex-direction:column;gap:6px}.edm-theme-apply-button{align-self:flex-start;height:34px;padding:0 16px;border:1px solid var(--edm-primary, #0f9c8e);border-radius:9px;background:var(--edm-primary, #0f9c8e);color:#fff;font:inherit;font-size:13px;font-weight:600;cursor:pointer;transition:filter .15s ease}.edm-theme-apply-button:hover{filter:brightness(1.06)}.edm-preview-client-select{height:30px;padding:0 8px;border:1px solid var(--edm-panel-border, #e6ecea);border-radius:8px;background:var(--edm-surface, #fff);color:var(--edm-text, #14213d);font:inherit;font-size:13px;cursor:pointer}.edm-preview-shell{display:flex;flex-direction:column;align-items:center;gap:12px;width:100%}.edm-preview-client-notes{max-width:660px;width:100%;padding:12px 14px;border:1px solid var(--edm-panel-border, #e6ecea);border-radius:10px;background:var(--edm-surface-muted, #f4f8f7);font-size:12px;color:var(--edm-muted, #6b7280)}.edm-preview-client-notes-title{display:block;margin-bottom:4px;font-weight:600;color:var(--edm-text, #14213d)}.edm-preview-client-notes ul{margin:0;padding-left:16px}.edm-block-preview--custom{width:100%}.edm-custom-missing{padding:12px;border:1px dashed var(--edm-panel-border, #e6ecea);border-radius:8px;color:var(--edm-muted, #7a8699);font-size:13px}.edm-custom-missing code{color:var(--edm-text, #14213d)}.edm-context-menu{position:fixed;z-index:3000;min-width:200px;max-width:280px;padding:6px;border-radius:12px;background:var(--edm-panel, #ffffff);border:1px solid var(--edm-panel-border, #e6ecea);box-shadow:0 12px 32px #0f172a2e;display:flex;flex-direction:column;gap:1px;font-size:13px}.edm-context-menu-item{display:flex;align-items:center;justify-content:space-between;gap:16px;width:100%;padding:8px 10px;border:none;border-radius:7px;background:transparent;color:var(--edm-text, #14213d);font:inherit;text-align:left;cursor:pointer}.edm-context-menu-item:hover:not(:disabled),.edm-context-menu-item:focus-visible{background:var(--edm-surface-muted, #f1f5f9);outline:none}.edm-context-menu-item:disabled{opacity:.4;cursor:default}.edm-context-menu-item.is-danger{color:#dc2626}.edm-context-menu-item.is-danger:hover:not(:disabled){background:#dc26261a}.edm-context-menu-shortcut{font-size:11px;color:var(--edm-muted, #7a8699)}.edm-context-menu-divider{height:1px;margin:4px 6px;background:var(--edm-panel-border, #e6ecea)}.edm-table-canvas{table-layout:auto}.edm-table-canvas-cell{cursor:text;outline:none}.edm-table-canvas-cell:focus,.edm-table-canvas-cell.is-selected{box-shadow:inset 0 0 0 2px var(--edm-accent, #2f6df6)}.edm-table-merge-actions,.edm-table-editor-actions{display:flex;flex-wrap:wrap;gap:6px}.edm-table-merge-actions button,.edm-table-editor-actions button{flex:1 1 auto;padding:6px 8px;border:1px solid var(--edm-panel-border, #e6ecea);border-radius:7px;background:var(--edm-surface, #fff);color:inherit;font-size:12px;font-weight:600;cursor:pointer}.edm-table-merge-actions button:hover:not(:disabled),.edm-table-editor-actions button:hover{border-color:var(--edm-accent, #2f6df6);color:var(--edm-accent, #2f6df6)}.edm-table-merge-actions button:disabled,.edm-table-editor-actions button:disabled{opacity:.45;cursor:default}.edm-table-editor-actions button:disabled:hover{border-color:var(--edm-panel-border, #e6ecea);color:inherit}.edm-block-card-top,.edm-inline-actions{display:flex;justify-content:space-between;align-items:center;gap:8px}.edm-block-card-top{position:absolute;top:100%;bottom:auto;left:auto;right:8px;margin-top:-14px;width:max-content;justify-content:flex-end;z-index:6;opacity:0;pointer-events:none;transition:opacity .14s ease}.edm-block-card:hover .edm-block-card-top,.edm-block-card.is-selected .edm-block-card-top{opacity:1}.edm-block-card-top .edm-inline-actions{pointer-events:auto}.edm-inline-actions{flex-wrap:wrap;justify-content:flex-end}.edm-action-icon{position:relative;width:30px;height:30px;display:grid;place-items:center;border:1px solid var(--edm-panel-border);background:#fff;color:var(--edm-muted);border-radius:8px;cursor:pointer;padding:0;transform:translateY(3px);transition:color .14s ease,border-color .14s ease,transform .14s ease,box-shadow .14s ease}.edm-action-icon--drag{cursor:grab;color:#fff;border-color:transparent;background:#2d6cdf}.edm-action-icon--drag:hover{background:#245bc4}.edm-action-icon--drag:active{cursor:grabbing}.edm-action-icon svg{width:15px;height:15px}.edm-action-icon:hover{color:var(--edm-text);border-color:#ccd4de;transform:translateY(0);box-shadow:0 6px 14px #0f172a14}.edm-empty-column{min-height:92px;padding:14px 12px;border:1px dashed #d7dee7;border-radius:10px;color:var(--edm-muted);text-align:center;background:#f8fafc;display:grid;place-items:center;gap:6px;font-size:.82rem}.edm-empty-column strong{color:var(--edm-text);font-size:.84rem}.edm-empty-column span{max-width:220px;line-height:1.5}.edm-column-surface.is-over .edm-empty-column{background:#f0f6ff;border-color:#2d6cdf73;color:#2d6cdf}.edm-block-pill{display:inline-flex;width:fit-content;padding:4px 8px;border-radius:999px;background:#eef2f7;color:var(--edm-text, #4b5563);font-size:.72rem;text-transform:uppercase;letter-spacing:.08em}.edm-block-preview{width:100%;overflow:hidden;color:var(--edm-token-text, var(--edm-text))}.edm-block-preview>*:first-child{margin-top:0!important}.edm-block-preview>*:last-child{margin-bottom:0!important}.edm-block-preview img{display:block;width:100%;max-width:100%;height:auto}.edm-block-preview a{pointer-events:none}.edm-block-preview table{width:auto;max-width:100%}.edm-block-preview--text,.edm-block-preview--heading{min-height:56px}.edm-block-preview--divider{min-height:20px}.edm-block-preview--spacer{border:1px dashed #d7dee7;border-radius:10px;background:linear-gradient(90deg,#2d6cdf0d,#2d6cdf03),repeating-linear-gradient(90deg,rgba(45,108,223,.08) 0,rgba(45,108,223,.08) 8px,transparent 8px,transparent 16px);padding:10px 12px}.edm-block-preview--spacer div{min-height:18px}.edm-block-preview--video,.edm-block-preview--form,.edm-block-preview--countdown,.edm-block-preview--raw-html{border-radius:12px}.edm-block-preview--social,.edm-block-preview--navigation{min-height:40px}.edm-drag-overlay{width:min(280px,42vw);border:1px solid rgba(45,108,223,.16);background:#fffffff5;border-radius:14px;box-shadow:0 18px 40px #0f172a2e;padding:12px;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}.edm-drag-overlay--block{display:grid;gap:10px}.edm-drag-overlay--tile{display:grid;gap:12px;min-height:88px}.edm-drag-overlay-header{display:flex;align-items:center;justify-content:space-between;gap:12px}.edm-drag-overlay-icon{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;border:1px solid rgba(15,23,42,.08);background:#f8fafc;color:var(--edm-text);font-size:.86rem;font-weight:700}.edm-layout-ghost{display:flex;gap:8px}.edm-layout-ghost span{min-height:52px;border-radius:10px;border:1px solid rgba(15,23,42,.08);background:linear-gradient(180deg,#fff,#f8fafc);display:grid;place-items:center;color:var(--edm-muted);font-size:.76rem;font-weight:600}.edm-preview-frame{width:100%;height:100%;border:0;border-radius:10px;background:#fff}.edm-preview-stage{min-height:100%;padding:18px;border-radius:14px;background:#e9edf2;overflow:auto}.edm-inspector-fields{display:grid;gap:0;margin-top:6px}.edm-inspector-primary-field{display:grid;gap:0}.edm-inspector-primary-field input{min-height:46px;font-size:.96rem;font-weight:600}.edm-inspector-section{display:block;border:0;border-radius:0;background:transparent;box-shadow:none;overflow:visible}.edm-inspector-section+.edm-inspector-section{border-top:1px solid var(--edm-panel-border)}.edm-inspector-section-header{width:100%;border:0;background:transparent;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 2px 11px;cursor:pointer;color:var(--edm-text)}.edm-inspector-section-heading{display:flex;align-items:center;gap:10px;min-width:0;font-size:.92rem;font-weight:600}.edm-inspector-section-heading>span:not(.edm-inspector-section-icon){min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.edm-inspector-section-icon,.edm-inspector-section-chevron{display:grid;place-items:center;flex-shrink:0}.edm-inspector-section-icon{width:20px;height:20px;border-radius:6px;background:transparent;color:var(--edm-muted)}.edm-inspector-section-icon svg,.edm-inspector-section-chevron svg{width:15px;height:15px}.edm-inspector-section-chevron{color:var(--edm-muted)}.edm-inspector-section-body{display:block;padding:0 2px 10px;border-top:0}.edm-inspector-fieldset{display:block;padding:0;margin:0;border:0;min-width:0}.edm-inspector-fieldset.is-disabled{opacity:.58}.edm-inspector-section.is-collapsed .edm-inspector-section-body{display:none}.edm-inspector-inline-grid{display:contents}.edm-inspector-quad-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.edm-toggle-field,.edm-toggle-row{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 12px}.edm-toggle-field>label,.edm-toggle-row>label{flex:1 1 auto;min-width:0;margin-bottom:0}.edm-toggle-field>.edm-switch,.edm-toggle-row>.edm-switch{flex:0 0 auto}.edm-upload-actions{display:grid;grid-template-columns:repeat(auto-fit,minmax(110px,1fr));gap:var(--mc-gap);margin:8px 0}.edm-upload-actions>.edm-upload-button,.edm-upload-actions>.edm-secondary-button{width:100%;min-width:0}.edm-upload-button{border:1px solid transparent;background:var(--mc-primary);color:var(--mc-primary-text)}.edm-upload-button:disabled{opacity:.6;cursor:progress}.edm-upload-status{margin:6px 0 0;font-size:12px;color:var(--edm-muted, #6b7280)}.edm-ai-image{margin-top:8px}.edm-ai-image>label{display:block;font-size:12px;color:var(--edm-muted, #6b7280);margin-bottom:4px}.edm-ai-image-row{display:flex;gap:6px}.edm-ai-image-row>input{flex:1 1 auto;height:32px;padding:0 8px;border:1px solid var(--edm-panel-border, #e6ecea);border-radius:8px;background:var(--edm-surface, #fff);color:var(--edm-text, #14213d);font:inherit;font-size:13px;min-width:0}.edm-field-note{margin:6px 0 0;font-size:12px;line-height:1.5;color:var(--edm-muted, #6b7280)}.edm-slide-editor{border:1px solid var(--edm-panel-border, #e6ecea);border-radius:10px;padding:10px 12px;margin-bottom:10px}.edm-slide-editor-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px}.edm-slide-editor-head strong{font-size:12.5px}.edm-slide-editor-actions{display:flex;gap:4px}.edm-slide-editor-actions button{width:24px;height:24px;border:1px solid var(--edm-panel-border, #e6ecea);border-radius:6px;background:var(--edm-surface, #fff);color:var(--edm-text, #14213d);font-size:13px;line-height:1;cursor:pointer}.edm-slide-editor-actions button:disabled{opacity:.4;cursor:default}.edm-slide-editor-actions button:last-child:hover:not(:disabled){border-color:#dc2626;color:#dc2626}.edm-checkbox-row{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--edm-text, #14213d);cursor:pointer}.edm-checkbox-row input[type=checkbox]{width:auto}.edm-field-note code{font-size:11.5px;padding:1px 4px;border-radius:4px;background:var(--edm-surface-muted, #f1f5f4)}.edm-upload-status--error{color:#dc2626}.edm-upload-dropzone{box-sizing:border-box;width:100%;min-height:96px;border:1px dashed var(--edm-panel-border);border-radius:12px;display:grid;place-items:center;padding:16px;margin-bottom:8px;text-align:center;color:var(--edm-muted);background:#fafbfc;cursor:pointer}.edm-inspector-fields input[type=range]{width:100%;min-width:0;padding:0;border:0;background:transparent;accent-color:var(--edm-accent, #2d6cdf)}.edm-segmented{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0;border:1px solid var(--edm-panel-border);border-radius:10px;overflow:hidden}.edm-segmented--align{grid-template-columns:repeat(4,minmax(0,1fr))}.edm-segmented-button{position:relative;border:0;background:#fff;color:var(--edm-text);min-height:40px;cursor:pointer;display:grid;place-items:center}.edm-segmented-button svg{width:16px;height:16px}.edm-segmented-button+.edm-segmented-button{border-left:1px solid var(--edm-panel-border)}.edm-segmented-button.is-active{background:#242424;color:#fff}.edm-segmented-button:after{content:attr(data-tooltip);position:absolute;left:50%;bottom:calc(100% + 8px);transform:translate(-50%) translateY(4px);white-space:nowrap;background:#111827f0;color:#fff;font-size:.72rem;line-height:1;padding:7px 9px;border-radius:8px;opacity:0;pointer-events:none;transition:opacity .14s ease,transform .14s ease;z-index:20}.edm-segmented-button:hover:after,.edm-segmented-button:focus-visible:after{opacity:1;transform:translate(-50%) translateY(0)}.edm-switch{width:44px;height:26px;border:0;border-radius:999px;background:#dbe2ea;cursor:pointer;padding:3px;display:flex;align-items:center;transition:background .14s ease}.edm-switch span{width:20px;height:20px;border-radius:999px;background:#fff;box-shadow:0 2px 6px #0f172a29;transform:translate(0);transition:transform .14s ease}.edm-switch.is-active{background:#242424}.edm-switch.is-active span{transform:translate(18px)}.edm-inspector-list{display:grid;gap:12px}.edm-inspector-list-stack{display:grid;gap:10px}.edm-inspector-list-item{display:grid;gap:8px;padding:12px;border:1px solid var(--edm-panel-border);border-radius:12px;background:#f8fafc}.edm-social-picker{display:flex;flex-wrap:wrap;gap:10px}.edm-social-selected-stack{display:grid;gap:12px}.edm-social-link-card{display:grid;gap:12px;padding:14px;border:1px solid var(--edm-panel-border);border-radius:14px;background:#fff}.edm-social-link-card-top,.edm-social-link-meta{display:flex;align-items:center;justify-content:space-between;gap:12px}.edm-social-link-meta{justify-content:flex-start}.edm-social-link-badge{width:34px;height:34px;border-radius:999px;display:grid;place-items:center;background:var(--edm-social-color, #6b7280);color:#fff;font-size:.82rem;font-weight:700;text-transform:lowercase}.edm-social-option{width:40px;height:40px;border:1px solid rgba(15,23,42,.08);border-radius:999px;display:grid;place-items:center;background:var(--edm-social-color, #6b7280);color:#fff;cursor:pointer;padding:0;text-transform:lowercase;font-weight:700;font-size:.78rem;box-shadow:inset 0 1px #ffffff3d}.edm-social-option.is-selected{box-shadow:0 0 0 2px #2d6cdf2e;border-color:#2d6cdf73}.edm-social-option span{transform:translateY(-.5px)}.edm-inspector-fields label{display:inline-block;margin:0;font-size:.82rem;color:var(--edm-muted);flex:0 0 auto}.edm-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.edm-grid-two{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.edm-inline-field-actions{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:8px 10px}.edm-inline-field-actions>input{flex:1 1 120px;min-width:0}.edm-inline-field-actions>button,.edm-inline-field-actions>.edm-secondary-button{flex:0 1 auto;min-width:0}.edm-inline-field-actions label{margin-bottom:0}.edm-structure-tabs{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center;border-bottom:1px solid var(--edm-panel-border);padding-bottom:10px}.edm-structure-tab-list{display:flex;flex-wrap:wrap;gap:12px}.edm-structure-tab{border:0;border-bottom:2px solid transparent;background:transparent;padding:8px 0;margin-right:12px;color:var(--edm-muted);cursor:pointer}.edm-structure-tab.is-active{color:var(--edm-text);border-bottom-color:var(--edm-text)}.edm-structure-actions{display:flex;gap:8px;justify-content:flex-end}.edm-inspector-fields input,.edm-inspector-fields select,.edm-inspector-fields textarea,.edm-meta-row{width:100%;min-width:0;max-width:100%;box-sizing:border-box;border:1px solid var(--edm-panel-border);border-radius:8px;padding:8px 10px;background:#fff;color:var(--edm-text);font-size:.86rem}.edm-inspector-fields input[type=color]{width:42px;min-height:30px;height:30px;padding:2px;border-radius:8px}.edm-inspector-fieldset>div:not(.edm-inspector-inline-grid),.edm-inspector-inline-grid>div{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 12px;min-height:46px;padding:4px 0;border-top:1px solid var(--edm-panel-border)}.edm-inspector-fieldset>div select,.edm-inspector-inline-grid>div select{width:auto;min-width:96px;max-width:168px;flex:0 1 auto}.edm-inspector-fieldset>div input[type=number],.edm-inspector-inline-grid>div input[type=number]{width:auto;min-width:72px;max-width:96px;flex:0 0 auto;text-align:left}.edm-inspector-fieldset>div .edm-segmented,.edm-inspector-inline-grid>div .edm-segmented{flex:1 1 auto;width:auto;min-width:0;max-width:220px}.edm-inspector-fieldset>div:has(>textarea),.edm-inspector-fieldset>div:has(>input[type=text]),.edm-inspector-fieldset>div:has(>input[type=url]),.edm-inspector-fieldset>div:has(>input[type=range]),.edm-inspector-inline-grid>div:has(>textarea),.edm-inspector-inline-grid>div:has(>input[type=text]),.edm-inspector-inline-grid>div:has(>input[type=url]),.edm-inspector-inline-grid>div:has(>input[type=range]){flex-direction:column;align-items:stretch;gap:6px}.edm-inspector-section-body>.edm-toggle-row,.edm-inspector-section-body>.edm-inline-field-actions{min-height:46px;padding:6px 0;border-top:1px solid var(--edm-panel-border)}.edm-secondary-button,.edm-upload-button{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-height:var(--mc-control-h);padding:0 var(--mc-control-pad-x);border-radius:var(--mc-control-radius);font-size:var(--mc-control-font);font-weight:500;line-height:1.15;text-align:center;cursor:pointer}.edm-secondary-button{border:1px solid var(--edm-panel-border);background:#fff;color:var(--edm-text)}.edm-secondary-button:hover{border-color:var(--edm-accent);color:var(--edm-accent-strong)}.edm-asset-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#0f172a6b;display:grid;place-items:center;padding:20px;z-index:80}.edm-confirm-dialog{width:min(420px,100%);background:#fff;border:1px solid var(--edm-panel-border);border-radius:16px;box-shadow:0 24px 60px #0f172a2e;padding:22px 24px}.edm-confirm-dialog h3{margin:0 0 8px;font-size:1.05rem;text-transform:capitalize}.edm-confirm-dialog p{margin:0 0 20px;color:var(--edm-muted);font-size:.9rem;line-height:1.5}.edm-confirm-actions{display:flex;justify-content:flex-end;gap:10px}.edm-danger-button{padding:9px 18px;border-radius:10px;border:0;background:#e5484d;color:#fff;font-weight:600;cursor:pointer;transition:background .14s ease}.edm-danger-button:hover{background:#cf3a3f}.edm-asset-dialog{width:min(920px,100%);max-height:min(84vh,860px);overflow:auto;background:#fff;border:1px solid var(--edm-panel-border);border-radius:20px;box-shadow:0 24px 60px #0f172a2e;padding:18px;display:grid;gap:16px}.edm-compare-dialog{width:min(1180px,100%);max-height:min(88vh,920px);overflow:auto;background:#fff;border:1px solid var(--edm-panel-border);border-radius:20px;box-shadow:0 24px 60px #0f172a2e;padding:18px;display:grid;gap:16px}.edm-compare-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.edm-compare-pane{display:grid;gap:12px;min-height:0}.edm-compare-pane .edm-preview-frame{min-height:70vh;border:1px solid var(--edm-panel-border)}.edm-asset-header{display:flex;justify-content:space-between;align-items:start;gap:16px}.edm-asset-header p{margin:6px 0 0;color:var(--edm-muted)}.edm-asset-toolbar{display:flex;flex-wrap:wrap;gap:12px}.edm-asset-connectors{display:grid;gap:12px}.edm-asset-connector-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px}.edm-asset-connector-card{border:1px solid var(--edm-panel-border);background:#fff;border-radius:14px;padding:14px;display:grid;gap:8px;text-align:left;cursor:pointer}.edm-asset-connector-card.is-connected{border-color:#2d6cdf59;box-shadow:0 0 0 3px #2d6cdf14}.edm-asset-connector-icon{width:32px;height:32px;border-radius:10px;display:grid;place-items:center;background:#f1f5f9;color:#111827;font-weight:700}.edm-asset-connector-status,.edm-asset-error{color:var(--edm-muted);font-size:.8rem}.edm-asset-search{flex:1 1 240px;min-height:42px;border:1px solid var(--edm-panel-border);border-radius:12px;padding:0 14px}.edm-asset-dropzone{min-height:76px;border:1px dashed #d7dee7;border-radius:14px;padding:18px;display:grid;place-items:center;text-align:center;color:var(--edm-muted);background:#fafbfc}.edm-asset-source-row{display:flex;flex-wrap:wrap;gap:10px}.edm-asset-source{border:1px solid var(--edm-panel-border);background:#fff;color:var(--edm-text);border-radius:999px;min-height:34px;padding:0 14px;cursor:pointer}.edm-asset-source.is-active{background:#242424;border-color:#242424;color:#fff}.edm-asset-source--connector{display:inline-flex;align-items:center;gap:7px}.edm-asset-source-icon{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:6px;font-size:11px;font-weight:700;background:var(--edm-accent-soft, #d7f2ee);color:var(--edm-accent, #0f766e)}.edm-asset-source--connector.is-connected:after{content:"";width:7px;height:7px;border-radius:50%;background:#16c9b6}.edm-asset-source--connector.is-active .edm-asset-source-icon{background:#ffffff2e;color:#fff}.edm-asset-connect-state{display:flex;flex-direction:column;align-items:center;gap:12px;text-align:center;padding:34px 18px;border:1px dashed var(--edm-panel-border);border-radius:14px;color:var(--edm-muted, #55636b)}.edm-asset-connect-state p{margin:0;max-width:40ch}.edm-asset-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:14px}.edm-asset-card{border:1px solid var(--edm-panel-border);background:#fff;border-radius:16px;overflow:hidden;padding:0;display:grid;text-align:left;cursor:pointer}.edm-asset-card-image{width:100%;aspect-ratio:4 / 3;object-fit:cover;display:block;background:#eef2f7}.edm-asset-card-label,.edm-asset-card-meta{padding:0 12px}.edm-asset-card-label{padding-top:12px;font-weight:600;color:var(--edm-text)}.edm-asset-card-meta{padding-bottom:12px;color:var(--edm-muted)}.edm-template-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#0f172a6b;display:grid;place-items:center;padding:20px;z-index:80}.edm-template-dialog{width:min(980px,100%);max-height:min(86vh,900px);overflow:auto;background:#fff;border:1px solid var(--edm-panel-border);border-radius:20px;box-shadow:0 24px 60px #0f172a2e;padding:18px;display:grid;gap:18px}.edm-template-header{display:flex;justify-content:space-between;align-items:start;gap:16px}.edm-template-header p{margin:6px 0 0;color:var(--edm-muted)}.edm-template-section,.edm-template-toolbar{display:grid;gap:12px}.edm-template-filter-row{display:flex;flex-wrap:wrap;gap:8px}.edm-template-filter{border:1px solid var(--edm-panel-border);background:#fff;color:var(--edm-muted);border-radius:999px;min-height:34px;padding:0 12px;cursor:pointer}.edm-template-filter.is-active{background:#111827;border-color:#111827;color:#fff}.edm-template-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px}.edm-template-card{border:1px solid var(--edm-panel-border);background:#fff;border-radius:16px;padding:16px;display:grid;gap:8px;text-align:left;cursor:pointer}.edm-template-card-static{cursor:default}.edm-template-card-kicker{font-size:.72rem;letter-spacing:.08em;text-transform:uppercase;color:var(--edm-muted)}.edm-template-card p,.edm-template-card small{margin:0;color:var(--edm-muted)}.edm-template-card-actions,.edm-template-actions{display:flex;flex-wrap:wrap;gap:10px}.edm-data-grid{display:grid;gap:10px}.edm-data-card{display:grid;gap:8px;padding:12px;border:1px solid var(--edm-panel-border);border-radius:12px;background:#fff}.edm-data-card-top{display:flex;justify-content:space-between;align-items:center;gap:10px}.edm-data-card-top small{color:var(--edm-muted)}.edm-helper-note{padding:10px 12px;border-radius:10px;background:#f8fafc;color:var(--edm-muted);font-size:.88rem}.edm-richtext-shell{min-width:0;max-width:100%;box-sizing:border-box;border:1px solid var(--edm-panel-border);border-radius:10px;overflow:hidden;background:#fff}.edm-richtext-editor{min-width:0;overflow-wrap:anywhere}.edm-richtext-shell--canvas{border-color:#2d6cdf2e;box-shadow:0 14px 30px #0f172a14}.edm-richtext-shell--canvas .edm-richtext-toolbar{position:sticky;top:0;z-index:2;gap:8px;padding:10px 12px;background:#fffffffa;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}.edm-richtext-shell--canvas .edm-richtext-editor{min-height:140px;padding:18px 18px 22px}.edm-richtext-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px;padding:8px 10px;border-bottom:1px solid var(--edm-panel-border);background:#f8fafc}.edm-richtext-group{display:flex;align-items:center;flex-wrap:wrap;gap:4px;min-width:0}.edm-richtext-group-grow{flex:1 1 auto;min-width:0}.edm-richtext-button{display:inline-grid;place-items:center;border:1px solid var(--edm-panel-border);background:#fff;color:var(--edm-text);min-height:30px;padding:0 9px;font-size:.82rem;border-radius:7px;white-space:nowrap;cursor:pointer;transition:background .14s ease,color .14s ease,border-color .14s ease,box-shadow .14s ease}.edm-richtext-button--icon{width:32px;padding:0}.edm-richtext-button--icon svg{width:15px;height:15px;display:block}.edm-richtext-button.is-active{background:#242424;color:#fff;border-color:#242424;box-shadow:0 6px 16px #0f172a1f}.edm-richtext-button:hover:not(:disabled){border-color:#ccd4de;box-shadow:0 4px 12px #0f172a14}.edm-richtext-button:disabled{opacity:.48;cursor:not-allowed}.edm-richtext-control{min-height:30px;border:1px solid var(--edm-panel-border);border-radius:7px;background:#fff;color:var(--edm-text);font-size:.82rem;padding:0 8px}select.edm-richtext-control{padding-right:26px;max-width:100%;text-overflow:ellipsis}.edm-richtext-group-grow .edm-richtext-control{flex:1 1 0;width:100%;min-width:0;max-width:100%}.edm-richtext-color{width:40px;min-width:40px;padding:3px}.edm-emoji{position:relative}.edm-emoji-trigger{font-size:1rem;line-height:1;min-width:36px;padding:0 8px;display:grid;place-items:center}.edm-emoji-popover{position:fixed;z-index:1000;width:250px;max-height:260px;overflow-y:auto;padding:10px;background:var(--edm-panel);border:1px solid var(--edm-panel-border);border-radius:12px;box-shadow:0 16px 40px #0f172a38}.edm-emoji-heading{font-size:.68rem;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:var(--edm-muted);margin:4px 2px 6px}.edm-emoji-grid{display:grid;grid-template-columns:repeat(8,1fr);gap:2px;margin-bottom:4px}.edm-emoji-item{border:0;background:transparent;border-radius:8px;cursor:pointer;font-size:1.15rem;line-height:1;padding:6px 0;display:grid;place-items:center}.edm-emoji-item:hover{background:var(--edm-panel-border)}.edm-richtext-ai-trigger{display:inline-flex;align-items:center;gap:5px;padding:0 9px;color:#fff;background:linear-gradient(135deg,#7c3aed,#2f6df6);border:0;font-weight:700}.edm-richtext-ai-trigger:hover:not(:disabled){filter:brightness(1.06)}.edm-richtext-ai-trigger:disabled{opacity:.6;cursor:default}.edm-ai-popover{position:fixed;z-index:1000;width:210px;padding:6px;background:var(--edm-panel);border:1px solid var(--edm-panel-border);border-radius:12px;box-shadow:0 16px 40px #0f172a38}.edm-ai-heading{font-size:.68rem;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:var(--edm-muted);margin:4px 6px 6px}.edm-ai-item{display:block;width:100%;text-align:left;border:0;background:transparent;border-radius:8px;cursor:pointer;font-size:.85rem;color:var(--edm-text);padding:8px 10px}.edm-ai-item:hover{background:var(--edm-panel-border)}.edm-richtext-editor{min-height:220px;padding:16px;outline:none;color:var(--edm-text)}.edm-richtext-editor p,.edm-richtext-editor ul,.edm-richtext-editor ol{margin:0 0 .9em}.edm-richtext-editor ul,.edm-richtext-editor ol{padding-left:1.3em}.edm-richtext-editor a{color:var(--edm-accent-strong)}.edm-block-card-body--editor{cursor:text}.edm-rawhtml-ai-error{margin:4px 2px 0;color:#c0392b;font-size:12px}.edm-table-cell-toolbar{margin-bottom:10px}.edm-table-cell-toolbar-hint{margin:4px 2px 0;color:var(--edm-muted, #9ca3af);font-size:12px}.edm-rawhtml-wysiwyg{min-height:60px;padding:6px 8px;border:1px dashed transparent;border-radius:8px;outline:none;cursor:text}.edm-rawhtml-wysiwyg:focus{border-color:var(--edm-primary, #0f9c8e);background:var(--edm-surface, #fff)}.edm-rawhtml-wysiwyg:empty:before{content:"Type your content…";color:var(--edm-muted, #9ca3af)}.edm-field-canvas-editor{margin-bottom:10px}.edm-field-canvas-input{min-height:34px;margin-top:8px;padding:7px 10px;border:1px solid var(--edm-border, #e2e8f0);border-radius:8px;background:var(--edm-surface, #fff);outline:none;cursor:text;font-size:14px;color:var(--edm-text, #14213d)}.edm-field-canvas-input:focus{border-color:var(--edm-primary, #0f9c8e);box-shadow:0 0 0 3px color-mix(in srgb,var(--edm-primary, #0f9c8e) 18%,transparent)}.edm-field-canvas-input:empty:before{content:"Type here…";color:var(--edm-muted, #9ca3af)}.edm-field-canvas-hint{margin:6px 2px 0;font-size:11px;line-height:1.4;color:var(--edm-muted, #9ca3af)}.edm-field-canvas-picker{display:flex;align-items:center;gap:8px;margin-bottom:8px;font-size:12px;color:var(--edm-muted, #6b7280)}.edm-field-canvas-picker span{font-weight:600;text-transform:uppercase;letter-spacing:.04em;font-size:10px}.edm-field-canvas-picker select{flex:0 1 auto;padding:4px 8px;border:1px solid var(--edm-border, #e2e8f0);border-radius:6px;background:var(--edm-surface, #fff);color:var(--edm-text, #14213d);font-size:12px}.edm-heading-inline-content{min-height:74px;padding:16px 18px;outline:none;color:var(--edm-text);font-size:clamp(1.2rem,2vw,1.8rem);font-weight:700;line-height:1.35}.edm-heading-inline-content a{color:var(--edm-accent-strong)}.edm-block-card.is-condition-hidden{opacity:.72}.edm-conditional-note{margin-bottom:10px;padding:8px 10px;border-radius:10px;background:#f59e0b1f;color:#92400e;font-size:.82rem;font-weight:600}.edm-merge-tag-chip{display:inline-flex;align-items:center;padding:.18rem .55rem;border-radius:999px;background:#eef2f7;border:1px solid #d7dee7;color:var(--edm-text);font-size:.92em;white-space:nowrap}.edm-empty-state{margin-top:12px;padding:14px;border-radius:10px;background:#f8fafc;color:var(--edm-muted)}.edm-token-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.edm-token-grid>div{display:grid;gap:8px}.edm-history-panel{margin-top:16px;display:grid;gap:12px;min-width:0}.edm-history-toolbar{display:grid;gap:10px}.edm-history-search{min-height:40px;border:1px solid var(--edm-panel-border);border-radius:10px;padding:0 12px}.edm-history-list{display:grid;gap:8px;max-height:320px;min-width:0;overflow-y:auto;overflow-x:hidden}.edm-history-card{text-align:left;border:1px solid var(--edm-panel-border);background:#fff;border-radius:10px;padding:12px;display:grid;gap:4px;min-width:0}.edm-history-card.is-latest{border-color:#2d6cdf59;box-shadow:0 0 0 3px #2d6cdf14}.edm-history-card-top,.edm-history-card-meta{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0;flex-wrap:wrap}.edm-history-card-top>strong{min-width:0;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.edm-history-card-top .edm-inline-actions{opacity:1;pointer-events:auto;flex-shrink:0}.edm-history-kind{display:inline-flex;align-items:center;min-height:22px;padding:0 8px;border-radius:999px;background:#eef2f7;color:#475569;font-size:.72rem;font-weight:600}.edm-history-kind--autosave{background:#ecfdf5;color:#0f766e}.edm-history-kind--manual{background:#eff6ff;color:#1d4ed8}.edm-history-kind--latest{background:#111827;color:#fff}.edm-history-card span,.edm-history-card small{color:var(--edm-muted)}.edm-builder-panel{display:grid;grid-template-columns:minmax(0,1fr) 64px;gap:14px;min-height:100%;height:100%;min-height:0}.edm-branding-badge{margin-top:14px;padding:10px 12px;border-top:1px solid var(--edm-panel-border);color:var(--edm-muted);font-size:.8rem;font-weight:600}.edm-shell[data-edm-dir=rtl],.edm-shell[data-edm-dir=rtl] .edm-toolbar-main,.edm-shell[data-edm-dir=rtl] .edm-builder-panel,.edm-shell[data-edm-dir=rtl] .edm-mode-rail{direction:rtl}.edm-sidebar-right.is-collapsed .edm-builder-panel{grid-template-columns:1fr}.edm-builder-content{display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden}.edm-builder-scroll{display:flex;flex-direction:column;flex:1 1 auto;min-width:0;min-height:0;overflow-x:hidden;overflow-y:auto;padding-right:4px;scrollbar-width:none;-ms-overflow-style:none}.edm-content-panel,.edm-inspector-fields{min-width:0}.edm-inspector-fields{grid-template-columns:minmax(0,1fr)}.edm-builder-scroll::-webkit-scrollbar{width:0;height:0}.edm-sidebar-right.is-collapsed .edm-builder-content{display:none}.edm-content-panel,.edm-body-panel,.edm-blocks-panel{display:grid;gap:14px;flex:1 1 auto;min-height:0}.edm-content-panel{display:flex;flex-direction:column}.edm-mode-rail{display:grid;grid-auto-rows:min-content;gap:8px;padding-left:10px;border-left:1px solid var(--edm-panel-border)}.edm-sidebar-right.is-collapsed .edm-mode-rail{padding-left:0;border-left:0}.edm-mode-button{border:1px solid var(--edm-panel-border);background:#f8fafc;border-radius:12px;padding:10px 8px;display:grid;gap:6px;justify-items:center;color:var(--edm-muted);cursor:pointer}.edm-mode-button span{font-size:1.05rem;line-height:1}.edm-mode-button small{font-size:.68rem}.edm-mode-button.is-active{background:#fff;border-color:#2d6cdf4d;color:var(--edm-text);box-shadow:0 0 0 2px #2d6cdf0f}.edm-tool-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:12px}.edm-tool-grid--content{grid-template-columns:repeat(auto-fit,minmax(74px,1fr));gap:8px;margin-top:8px}.edm-tool-grid--content .edm-tool-tile{min-height:74px;padding:8px 4px;gap:7px}.edm-tool-grid--content .edm-tool-tile span{font-size:.7rem}.edm-panel-footer{flex:0 0 auto;display:flex;justify-content:center;align-items:center;padding:10px 0 4px;background:var(--edm-panel);border-top:1px solid var(--edm-panel-border)}.edm-content-footer{display:flex;justify-content:center;align-items:center;padding:8px 0 2px}.edm-content-footer small{color:var(--edm-muted);text-align:center}.edm-content-footer-logo{display:block;width:100%;max-width:180px;height:36px;margin:6px auto 0;object-fit:contain;object-position:center}.edm-wl-logo{min-height:42px}.edm-layout-section{display:grid;gap:10px}.edm-layout-section label{font-size:.82rem;color:var(--edm-muted)}.edm-layout-grid{display:grid;gap:10px}.edm-layout-tile{width:100%;border:1px solid var(--edm-panel-border);background:#fff;border-radius:10px;padding:12px;min-height:52px;cursor:grab}.edm-layout-tile.is-dragging,.edm-layout-tile:active{cursor:grabbing}.edm-layout-preview{display:flex;gap:0;width:100%;min-height:28px;border:1px solid #d9e0e8;border-radius:6px;overflow:hidden;background:#fff}.edm-layout-preview span{display:block;min-height:28px;border-right:1px solid #d9e0e8;background:linear-gradient(180deg,#fff,#fbfdff)}.edm-layout-preview span:last-child{border-right:0}.edm-tool-tile{border:1px solid var(--edm-panel-border);background:#fff;border-radius:10px;min-height:94px;padding:10px;display:grid;justify-items:center;align-content:center;gap:10px;cursor:grab;text-align:center}.edm-tool-tile:active{cursor:grabbing}.edm-tool-icon{display:grid;place-items:center;width:28px;height:28px;color:#4b5563;font-size:1.1rem;font-weight:600}.edm-tool-label{font-size:.78rem;letter-spacing:.04em;text-transform:uppercase;color:var(--edm-text)}@media(max-width:1280px){.edm-shell{grid-template-columns:minmax(0,1fr) 320px}}@media(max-width:960px){.edm-shell{grid-template-columns:1fr}.edm-workspace{grid-template-rows:auto minmax(420px,1fr)}.edm-toolbar{flex-direction:column;align-items:start}.edm-toolbar-main{width:100%;flex-wrap:wrap}.edm-columns-grid{flex-direction:column}.edm-column-surface{width:100%!important}.edm-builder-panel,.edm-inspector-inline-grid{grid-template-columns:1fr}.edm-asset-header,.edm-template-header{flex-direction:column}.edm-mode-rail{grid-template-columns:repeat(3,1fr);padding-left:0;padding-top:10px;border-left:0;border-top:1px solid var(--edm-panel-border)}}.edm-export-menu{position:relative;display:inline-flex}.edm-export-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:45;border:0;background:transparent;cursor:default}.edm-export-list{position:absolute;top:calc(100% + 6px);right:0;z-index:46;min-width:190px;margin:0;padding:6px;list-style:none;border:1px solid var(--edm-panel-border, #e6ecea);border-radius:12px;background:var(--edm-panel, #fff);box-shadow:0 18px 48px #0f172a38}.edm-export-item{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;padding:8px 10px;border:0;border-radius:8px;background:transparent;font:inherit;color:var(--edm-text, #14213d);cursor:pointer}.edm-export-item:hover{background:var(--edm-surface, #f3f5f9)}.edm-export-ext{font-size:11px;color:var(--edm-muted, #6b7280)}.edm-assistant-drawer{position:fixed;top:64px;right:12px;bottom:12px;width:min(360px,94vw);display:flex;flex-direction:column;padding:16px;border:1px solid var(--edm-panel-border, #e6ecea);border-radius:14px;background:var(--edm-panel, #fff);box-shadow:0 18px 48px #0f172a38;z-index:40}.edm-assistant-messages{flex:1;min-height:0;overflow:auto;display:flex;flex-direction:column;gap:8px;margin:12px 0;padding-right:4px}.edm-assistant-empty{color:var(--edm-muted, #6b7280);font-size:13px}.edm-assistant-empty ul{margin:6px 0 0;padding-left:18px}.edm-assistant-msg{max-width:90%;padding:8px 11px;border-radius:12px;font-size:13px;line-height:1.4;white-space:pre-wrap;word-break:break-word}.edm-assistant-msg--user{align-self:flex-end;background:var(--edm-accent, #2563eb);color:#fff}.edm-assistant-msg--assistant{align-self:flex-start;background:var(--edm-surface, #f3f5f9);color:var(--edm-text, #14213d)}.edm-assistant-msg.is-busy{opacity:.7;font-style:italic}.edm-assistant-input{display:flex;gap:8px;align-items:flex-end}.edm-assistant-input textarea{flex:1;resize:none;padding:8px 10px;border:1px solid var(--edm-panel-border, #e6ecea);border-radius:10px;font:inherit;font-size:13px}',Tg="edmission-editor-styles";if(typeof document<"u"&&Cg&&!document.getElementById(Tg)){const e=document.createElement("style");e.id=Tg,e.textContent=Cg,document.head.appendChild(e)}function gT(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return v.useMemo(()=>r=>{t.forEach(i=>i(r))},t)}const Bd=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Lo(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function mm(e){return"nodeType"in e}function _n(e){var t,n;return e?Lo(e)?e:mm(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function fm(e){const{Document:t}=_n(e);return e instanceof t}function al(e){return Lo(e)?!1:e instanceof _n(e).HTMLElement}function mx(e){return e instanceof _n(e).SVGElement}function jo(e){return e?Lo(e)?e.document:mm(e)?fm(e)?e:al(e)||mx(e)?e.ownerDocument:document:document:document}const _r=Bd?v.useLayoutEffect:v.useEffect;function Pd(e){const t=v.useRef(e);return _r(()=>{t.current=e}),v.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}function AT(){const e=v.useRef(null),t=v.useCallback((r,i)=>{e.current=setInterval(r,i)},[]),n=v.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Ha(e,t){t===void 0&&(t=[e]);const n=v.useRef(e);return _r(()=>{n.current!==e&&(n.current=e)},t),n}function ll(e,t){const n=v.useRef();return v.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function vc(e){const t=Pd(e),n=v.useRef(null),r=v.useCallback(i=>{i!==n.current&&(t==null||t(i,n.current)),n.current=i},[]);return[n,r]}function wc(e){const t=v.useRef();return v.useEffect(()=>{t.current=e},[e]),t.current}let ju={};function cl(e,t){return v.useMemo(()=>{if(t)return t;const n=ju[e]==null?0:ju[e]+1;return ju[e]=n,e+"-"+n},[e,t])}function fx(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((s,o)=>{const a=Object.entries(o);for(const[l,d]of a){const u=s[l];u!=null&&(s[l]=u+e*d)}return s},{...t})}}const Ao=fx(1),kc=fx(-1);function bT(e){return"clientX"in e&&"clientY"in e}function Fd(e){if(!e)return!1;const{KeyboardEvent:t}=_n(e.target);return t&&e instanceof t}function yT(e){if(!e)return!1;const{TouchEvent:t}=_n(e.target);return t&&e instanceof t}function Ec(e){if(yT(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return bT(e)?{x:e.clientX,y:e.clientY}:null}const mi=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[mi.Translate.toString(e),mi.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Sg="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function xT(e){return e.matches(Sg)?e:e.querySelector(Sg)}const vT={display:"none"};function wT(e){let{id:t,value:n}=e;return v.createElement("div",{id:t,style:vT},n)}function kT(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const i={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return v.createElement("div",{id:t,style:i,role:"status","aria-live":r,"aria-atomic":!0},n)}function ET(){const[e,t]=v.useState("");return{announce:v.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const gx=v.createContext(null);function CT(e){const t=v.useContext(gx);v.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function TT(){const[e]=v.useState(()=>new Set),t=v.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[v.useCallback(r=>{let{type:i,event:s}=r;e.forEach(o=>{var a;return(a=o[i])==null?void 0:a.call(o,s)})},[e]),t]}const ST={draggable:`
|
|
2
|
+
To pick up a draggable item, press the space bar.
|
|
3
|
+
While dragging, use the arrow keys to move the item.
|
|
4
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
5
|
+
`},_T={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function NT(e){let{announcements:t=_T,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=ST}=e;const{announce:s,announcement:o}=ET(),a=cl("DndLiveRegion"),[l,d]=v.useState(!1);if(v.useEffect(()=>{d(!0)},[]),CT(v.useMemo(()=>({onDragStart(h){let{active:p}=h;s(t.onDragStart({active:p}))},onDragMove(h){let{active:p,over:m}=h;t.onDragMove&&s(t.onDragMove({active:p,over:m}))},onDragOver(h){let{active:p,over:m}=h;s(t.onDragOver({active:p,over:m}))},onDragEnd(h){let{active:p,over:m}=h;s(t.onDragEnd({active:p,over:m}))},onDragCancel(h){let{active:p,over:m}=h;s(t.onDragCancel({active:p,over:m}))}}),[s,t])),!l)return null;const u=v.createElement(v.Fragment,null,v.createElement(wT,{id:r,value:i.draggable}),v.createElement(kT,{id:a,announcement:o}));return n?ca.createPortal(u,n):u}var Qt;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Qt||(Qt={}));function Cc(){}function IT(e,t){return v.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function DT(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return v.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const Nr=Object.freeze({x:0,y:0});function Ax(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function MT(e,t){const n=Ec(e);if(!n)return"0 0";const r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+"% "+r.y+"%"}function bx(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function OT(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function RT(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function LT(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function _g(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const jT=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=_g(t,t.left,t.top),s=[];for(const o of r){const{id:a}=o,l=n.get(a);if(l){const d=Ax(_g(l),i);s.push({id:a,data:{droppableContainer:o,value:d}})}}return s.sort(bx)};function BT(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),o=i-r,a=s-n;if(r<i&&n<s){const l=t.width*t.height,d=e.width*e.height,u=o*a,h=u/(l+d-u);return Number(h.toFixed(4))}return 0}const PT=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=[];for(const s of r){const{id:o}=s,a=n.get(o);if(a){const l=BT(a,t);l>0&&i.push({id:o,data:{droppableContainer:s,value:l}})}}return i.sort(OT)};function FT(e,t){const{top:n,left:r,bottom:i,right:s}=t;return n<=e.y&&e.y<=i&&r<=e.x&&e.x<=s}const $T=e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:r}=e;if(!r)return[];const i=[];for(const s of t){const{id:o}=s,a=n.get(o);if(a&&FT(r,a)){const d=RT(a).reduce((h,p)=>h+Ax(r,p),0),u=Number((d/4).toFixed(4));i.push({id:o,data:{droppableContainer:s,value:u}})}}return i.sort(bx)};function HT(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function yx(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Nr}function UT(e){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];return i.reduce((o,a)=>({...o,top:o.top+e*a.y,bottom:o.bottom+e*a.y,left:o.left+e*a.x,right:o.right+e*a.x}),{...n})}}const GT=UT(1);function xx(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function WT(e,t,n){const r=xx(t);if(!r)return e;const{scaleX:i,scaleY:s,x:o,y:a}=r,l=e.left-o-(1-i)*parseFloat(n),d=e.top-a-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),u=i?e.width/i:e.width,h=s?e.height/s:e.height;return{width:u,height:h,top:d,right:l+u,bottom:d+h,left:l}}const YT={ignoreTransform:!1};function Bo(e,t){t===void 0&&(t=YT);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:u}=_n(e).getComputedStyle(e);d&&(n=WT(n,d,u))}const{top:r,left:i,width:s,height:o,bottom:a,right:l}=n;return{top:r,left:i,width:s,height:o,bottom:a,right:l}}function Ng(e){return Bo(e,{ignoreTransform:!0})}function zT(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function KT(e,t){return t===void 0&&(t=_n(e).getComputedStyle(e)),t.position==="fixed"}function QT(e,t){t===void 0&&(t=_n(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const s=t[i];return typeof s=="string"?n.test(s):!1})}function gm(e,t){const n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(fm(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!al(i)||mx(i)||n.includes(i))return n;const s=_n(e).getComputedStyle(i);return i!==e&&QT(i,s)&&n.push(i),KT(i,s)?n:r(i.parentNode)}return e?r(e):n}function vx(e){const[t]=gm(e,1);return t??null}function Bu(e){return!Bd||!e?null:Lo(e)?e:mm(e)?fm(e)||e===jo(e).scrollingElement?window:al(e)?e:null:null}function wx(e){return Lo(e)?e.scrollX:e.scrollLeft}function kx(e){return Lo(e)?e.scrollY:e.scrollTop}function Qh(e){return{x:wx(e),y:kx(e)}}var en;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(en||(en={}));function Ex(e){return!Bd||!e?!1:e===document.scrollingElement}function Cx(e){const t={x:0,y:0},n=Ex(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},i=e.scrollTop<=t.y,s=e.scrollLeft<=t.x,o=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:i,isLeft:s,isBottom:o,isRight:a,maxScroll:r,minScroll:t}}const VT={x:.2,y:.2};function qT(e,t,n,r,i){let{top:s,left:o,right:a,bottom:l}=n;r===void 0&&(r=10),i===void 0&&(i=VT);const{isTop:d,isBottom:u,isLeft:h,isRight:p}=Cx(e),m={x:0,y:0},g={x:0,y:0},b={height:t.height*i.y,width:t.width*i.x};return!d&&s<=t.top+b.height?(m.y=en.Backward,g.y=r*Math.abs((t.top+b.height-s)/b.height)):!u&&l>=t.bottom-b.height&&(m.y=en.Forward,g.y=r*Math.abs((t.bottom-b.height-l)/b.height)),!p&&a>=t.right-b.width?(m.x=en.Forward,g.x=r*Math.abs((t.right-b.width-a)/b.width)):!h&&o<=t.left+b.width&&(m.x=en.Backward,g.x=r*Math.abs((t.left+b.width-o)/b.width)),{direction:m,speed:g}}function JT(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:o}=window;return{top:0,left:0,right:s,bottom:o,width:s,height:o}}const{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function Tx(e){return e.reduce((t,n)=>Ao(t,Qh(n)),Nr)}function ZT(e){return e.reduce((t,n)=>t+wx(n),0)}function XT(e){return e.reduce((t,n)=>t+kx(n),0)}function Sx(e,t){if(t===void 0&&(t=Bo),!e)return;const{top:n,left:r,bottom:i,right:s}=t(e);vx(e)&&(i<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const eS=[["x",["left","right"],ZT],["y",["top","bottom"],XT]];class Am{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=gm(n),i=Tx(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,o,a]of eS)for(const l of o)Object.defineProperty(this,l,{get:()=>{const d=a(r),u=i[s]-d;return this.rect[l]+u},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Aa{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var i;(i=this.target)==null||i.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function tS(e){const{EventTarget:t}=_n(e);return e instanceof t?e:jo(e)}function Pu(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var nr;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(nr||(nr={}));function Ig(e){e.preventDefault()}function nS(e){e.stopPropagation()}var st;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(st||(st={}));const _x={start:[st.Space,st.Enter],cancel:[st.Esc],end:[st.Space,st.Enter,st.Tab]},rS=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case st.Right:return{...n,x:n.x+25};case st.Left:return{...n,x:n.x-25};case st.Down:return{...n,y:n.y+25};case st.Up:return{...n,y:n.y-25}}};class Nx{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Aa(jo(n)),this.windowListeners=new Aa(_n(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(nr.Resize,this.handleCancel),this.windowListeners.add(nr.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(nr.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Sx(r),n(Nr)}handleKeyDown(t){if(Fd(t)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:s=_x,coordinateGetter:o=rS,scrollBehavior:a="smooth"}=i,{code:l}=t;if(s.end.includes(l)){this.handleEnd(t);return}if(s.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:d}=r.current,u=d?{x:d.left,y:d.top}:Nr;this.referenceCoordinates||(this.referenceCoordinates=u);const h=o(t,{active:n,context:r.current,currentCoordinates:u});if(h){const p=kc(h,u),m={x:0,y:0},{scrollableAncestors:g}=r.current;for(const b of g){const A=t.code,{isTop:y,isRight:w,isLeft:C,isBottom:E,maxScroll:S,minScroll:k}=Cx(b),I=JT(b),L={x:Math.min(A===st.Right?I.right-I.width/2:I.right,Math.max(A===st.Right?I.left:I.left+I.width/2,h.x)),y:Math.min(A===st.Down?I.bottom-I.height/2:I.bottom,Math.max(A===st.Down?I.top:I.top+I.height/2,h.y))},R=A===st.Right&&!w||A===st.Left&&!C,B=A===st.Down&&!E||A===st.Up&&!y;if(R&&L.x!==h.x){const O=b.scrollLeft+p.x,Y=A===st.Right&&O<=S.x||A===st.Left&&O>=k.x;if(Y&&!p.y){b.scrollTo({left:O,behavior:a});return}Y?m.x=b.scrollLeft-O:m.x=A===st.Right?b.scrollLeft-S.x:b.scrollLeft-k.x,m.x&&b.scrollBy({left:-m.x,behavior:a});break}else if(B&&L.y!==h.y){const O=b.scrollTop+p.y,Y=A===st.Down&&O<=S.y||A===st.Up&&O>=k.y;if(Y&&!p.x){b.scrollTo({top:O,behavior:a});return}Y?m.y=b.scrollTop-O:m.y=A===st.Down?b.scrollTop-S.y:b.scrollTop-k.y,m.y&&b.scrollBy({top:-m.y,behavior:a});break}}this.handleMove(t,Ao(kc(h,this.referenceCoordinates),m))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Nx.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=_x,onActivation:i}=t,{active:s}=n;const{code:o}=e.nativeEvent;if(r.start.includes(o)){const a=s.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function Dg(e){return!!(e&&"distance"in e)}function Mg(e){return!!(e&&"delay"in e)}class bm{constructor(t,n,r){var i;r===void 0&&(r=tS(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:s}=t,{target:o}=s;this.props=t,this.events=n,this.document=jo(o),this.documentListeners=new Aa(this.document),this.listeners=new Aa(r),this.windowListeners=new Aa(_n(o)),this.initialCoordinates=(i=Ec(s))!=null?i:Nr,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(nr.Resize,this.handleCancel),this.windowListeners.add(nr.DragStart,Ig),this.windowListeners.add(nr.VisibilityChange,this.handleCancel),this.windowListeners.add(nr.ContextMenu,Ig),this.documentListeners.add(nr.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Mg(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Dg(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:i}=this.props;i(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(nr.Click,nS,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(nr.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:i,props:s}=this,{onMove:o,options:{activationConstraint:a}}=s;if(!i)return;const l=(n=Ec(t))!=null?n:Nr,d=kc(i,l);if(!r&&a){if(Dg(a)){if(a.tolerance!=null&&Pu(d,a.tolerance))return this.handleCancel();if(Pu(d,a.distance))return this.handleStart()}if(Mg(a)&&Pu(d,a.tolerance))return this.handleCancel();this.handlePending(a,d);return}t.cancelable&&t.preventDefault(),o(l)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===st.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const iS={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ym extends bm{constructor(t){const{event:n}=t,r=jo(n.target);super(t,iS,r)}}ym.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const sS={move:{name:"mousemove"},end:{name:"mouseup"}};var Vh;(function(e){e[e.RightClick=2]="RightClick"})(Vh||(Vh={}));class oS extends bm{constructor(t){super(t,sS,jo(t.event.target))}}oS.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Vh.RightClick?!1:(r==null||r({event:n}),!0)}}];const Fu={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class aS extends bm{constructor(t){super(t,Fu)}static setup(){return window.addEventListener(Fu.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Fu.move.name,t)};function t(){}}}aS.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:i}=n;return i.length>1?!1:(r==null||r({event:n}),!0)}}];var ba;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(ba||(ba={}));var Tc;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Tc||(Tc={}));function lS(e){let{acceleration:t,activator:n=ba.Pointer,canScroll:r,draggingRect:i,enabled:s,interval:o=5,order:a=Tc.TreeOrder,pointerCoordinates:l,scrollableAncestors:d,scrollableAncestorRects:u,delta:h,threshold:p}=e;const m=dS({delta:h,disabled:!s}),[g,b]=AT(),A=v.useRef({x:0,y:0}),y=v.useRef({x:0,y:0}),w=v.useMemo(()=>{switch(n){case ba.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case ba.DraggableRect:return i}},[n,i,l]),C=v.useRef(null),E=v.useCallback(()=>{const k=C.current;if(!k)return;const I=A.current.x*y.current.x,L=A.current.y*y.current.y;k.scrollBy(I,L)},[]),S=v.useMemo(()=>a===Tc.TreeOrder?[...d].reverse():d,[a,d]);v.useEffect(()=>{if(!s||!d.length||!w){b();return}for(const k of S){if((r==null?void 0:r(k))===!1)continue;const I=d.indexOf(k),L=u[I];if(!L)continue;const{direction:R,speed:B}=qT(k,L,w,t,p);for(const O of["x","y"])m[O][R[O]]||(B[O]=0,R[O]=0);if(B.x>0||B.y>0){b(),C.current=k,g(E,o),A.current=B,y.current=R;return}}A.current={x:0,y:0},y.current={x:0,y:0},b()},[t,E,r,b,s,o,JSON.stringify(w),JSON.stringify(m),g,d,S,u,JSON.stringify(p)])}const cS={x:{[en.Backward]:!1,[en.Forward]:!1},y:{[en.Backward]:!1,[en.Forward]:!1}};function dS(e){let{delta:t,disabled:n}=e;const r=wc(t);return ll(i=>{if(n||!r||!i)return cS;const s={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[en.Backward]:i.x[en.Backward]||s.x===-1,[en.Forward]:i.x[en.Forward]||s.x===1},y:{[en.Backward]:i.y[en.Backward]||s.y===-1,[en.Forward]:i.y[en.Forward]||s.y===1}}},[n,t,r])}function uS(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return ll(i=>{var s;return t==null?null:(s=r??i)!=null?s:null},[r,t])}function hS(e,t){return v.useMemo(()=>e.reduce((n,r)=>{const{sensor:i}=r,s=i.activators.map(o=>({eventName:o.eventName,handler:t(o.handler,r)}));return[...n,...s]},[]),[e,t])}var Ua;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Ua||(Ua={}));var qh;(function(e){e.Optimized="optimized"})(qh||(qh={}));const Og=new Map;function pS(e,t){let{dragging:n,dependencies:r,config:i}=t;const[s,o]=v.useState(null),{frequency:a,measure:l,strategy:d}=i,u=v.useRef(e),h=A(),p=Ha(h),m=v.useCallback(function(y){y===void 0&&(y=[]),!p.current&&o(w=>w===null?y:w.concat(y.filter(C=>!w.includes(C))))},[p]),g=v.useRef(null),b=ll(y=>{if(h&&!n)return Og;if(!y||y===Og||u.current!==e||s!=null){const w=new Map;for(let C of e){if(!C)continue;if(s&&s.length>0&&!s.includes(C.id)&&C.rect.current){w.set(C.id,C.rect.current);continue}const E=C.node.current,S=E?new Am(l(E),E):null;C.rect.current=S,S&&w.set(C.id,S)}return w}return y},[e,s,n,h,l]);return v.useEffect(()=>{u.current=e},[e]),v.useEffect(()=>{h||m()},[n,h]),v.useEffect(()=>{s&&s.length>0&&o(null)},[JSON.stringify(s)]),v.useEffect(()=>{h||typeof a!="number"||g.current!==null||(g.current=setTimeout(()=>{m(),g.current=null},a))},[a,h,m,...r]),{droppableRects:b,measureDroppableContainers:m,measuringScheduled:s!=null};function A(){switch(d){case Ua.Always:return!1;case Ua.BeforeDragging:return n;default:return!n}}}function xm(e,t){return ll(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function mS(e,t){return xm(e,t)}function fS(e){let{callback:t,disabled:n}=e;const r=Pd(t),i=v.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return v.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function $d(e){let{callback:t,disabled:n}=e;const r=Pd(t),i=v.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return v.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function gS(e){return new Am(Bo(e),e)}function Rg(e,t,n){t===void 0&&(t=gS);const[r,i]=v.useState(null);function s(){i(l=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=l??n)!=null?d:null}const u=t(e);return JSON.stringify(l)===JSON.stringify(u)?l:u})}const o=fS({callback(l){if(e)for(const d of l){const{type:u,target:h}=d;if(u==="childList"&&h instanceof HTMLElement&&h.contains(e)){s();break}}}}),a=$d({callback:s});return _r(()=>{s(),e?(a==null||a.observe(e),o==null||o.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),o==null||o.disconnect())},[e]),r}function AS(e){const t=xm(e);return yx(e,t)}const Lg=[];function bS(e){const t=v.useRef(e),n=ll(r=>e?r&&r!==Lg&&e&&t.current&&e.parentNode===t.current.parentNode?r:gm(e):Lg,[e]);return v.useEffect(()=>{t.current=e},[e]),n}function yS(e){const[t,n]=v.useState(null),r=v.useRef(e),i=v.useCallback(s=>{const o=Bu(s.target);o&&n(a=>a?(a.set(o,Qh(o)),new Map(a)):null)},[]);return v.useEffect(()=>{const s=r.current;if(e!==s){o(s);const a=e.map(l=>{const d=Bu(l);return d?(d.addEventListener("scroll",i,{passive:!0}),[d,Qh(d)]):null}).filter(l=>l!=null);n(a.length?new Map(a):null),r.current=e}return()=>{o(e),o(s)};function o(a){a.forEach(l=>{const d=Bu(l);d==null||d.removeEventListener("scroll",i)})}},[i,e]),v.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,o)=>Ao(s,o),Nr):Tx(e):Nr,[e,t])}function jg(e,t){t===void 0&&(t=[]);const n=v.useRef(null);return v.useEffect(()=>{n.current=null},t),v.useEffect(()=>{const r=e!==Nr;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?kc(e,n.current):Nr}function xS(e){v.useEffect(()=>{if(!Bd)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function vS(e,t){return v.useMemo(()=>e.reduce((n,r)=>{let{eventName:i,handler:s}=r;return n[i]=o=>{s(o,t)},n},{}),[e,t])}function Ix(e){return v.useMemo(()=>e?zT(e):null,[e])}const Bg=[];function wS(e,t){t===void 0&&(t=Bo);const[n]=e,r=Ix(n?_n(n):null),[i,s]=v.useState(Bg);function o(){s(()=>e.length?e.map(l=>Ex(l)?r:new Am(t(l),l)):Bg)}const a=$d({callback:o});return _r(()=>{a==null||a.disconnect(),o(),e.forEach(l=>a==null?void 0:a.observe(l))},[e]),i}function Dx(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return al(t)?t:e}function kS(e){let{measure:t}=e;const[n,r]=v.useState(null),i=v.useCallback(d=>{for(const{target:u}of d)if(al(u)){r(h=>{const p=t(u);return h?{...h,width:p.width,height:p.height}:p});break}},[t]),s=$d({callback:i}),o=v.useCallback(d=>{const u=Dx(d);s==null||s.disconnect(),u&&(s==null||s.observe(u)),r(u?t(u):null)},[t,s]),[a,l]=vc(o);return v.useMemo(()=>({nodeRef:a,rect:n,setRef:l}),[n,a,l])}const ES=[{sensor:ym,options:{}},{sensor:Nx,options:{}}],CS={current:{}},cc={draggable:{measure:Ng},droppable:{measure:Ng,strategy:Ua.WhileDragging,frequency:qh.Optimized},dragOverlay:{measure:Bo}};class ya extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const TS={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ya,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Cc},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:cc,measureDroppableContainers:Cc,windowRect:null,measuringScheduled:!1},Mx={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Cc,draggableNodes:new Map,over:null,measureDroppableContainers:Cc},dl=v.createContext(Mx),Ox=v.createContext(TS);function SS(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ya}}}function _S(e,t){switch(t.type){case Qt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Qt.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Qt.DragEnd:case Qt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Qt.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new ya(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case Qt.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const o=new ya(e.droppable.containers);return o.set(n,{...s,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case Qt.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const s=new ya(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function NS(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=v.useContext(dl),s=wc(r),o=wc(n==null?void 0:n.id);return v.useEffect(()=>{if(!t&&!r&&s&&o!=null){if(!Fd(s)||document.activeElement===s.target)return;const a=i.get(o);if(!a)return;const{activatorNode:l,node:d}=a;if(!l.current&&!d.current)return;requestAnimationFrame(()=>{for(const u of[l.current,d.current]){if(!u)continue;const h=xT(u);if(h){h.focus();break}}})}},[r,t,i,o,s]),null}function Rx(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((i,s)=>s({transform:i,...r}),n):n}function IS(e){return v.useMemo(()=>({draggable:{...cc.draggable,...e==null?void 0:e.draggable},droppable:{...cc.droppable,...e==null?void 0:e.droppable},dragOverlay:{...cc.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function DS(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e;const s=v.useRef(!1),{x:o,y:a}=typeof i=="boolean"?{x:i,y:i}:i;_r(()=>{if(!o&&!a||!t){s.current=!1;return}if(s.current||!r)return;const d=t==null?void 0:t.node.current;if(!d||d.isConnected===!1)return;const u=n(d),h=yx(u,r);if(o||(h.x=0),a||(h.y=0),s.current=!0,Math.abs(h.x)>0||Math.abs(h.y)>0){const p=vx(d);p&&p.scrollBy({top:h.y,left:h.x})}},[t,o,a,r,n])}const Hd=v.createContext({...Nr,scaleX:1,scaleY:1});var Ti;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Ti||(Ti={}));const MS=v.memo(function(t){var n,r,i,s;let{id:o,accessibility:a,autoScroll:l=!0,children:d,sensors:u=ES,collisionDetection:h=PT,measuring:p,modifiers:m,...g}=t;const b=v.useReducer(_S,void 0,SS),[A,y]=b,[w,C]=TT(),[E,S]=v.useState(Ti.Uninitialized),k=E===Ti.Initialized,{draggable:{active:I,nodes:L,translate:R},droppable:{containers:B}}=A,O=I!=null?L.get(I):null,Y=v.useRef({initial:null,translated:null}),Q=v.useMemo(()=>{var ct;return I!=null?{id:I,data:(ct=O==null?void 0:O.data)!=null?ct:CS,rect:Y}:null},[I,O]),W=v.useRef(null),[ie,J]=v.useState(null),[H,te]=v.useState(null),G=Ha(g,Object.values(g)),M=cl("DndDescribedBy",o),F=v.useMemo(()=>B.getEnabled(),[B]),ce=IS(p),{droppableRects:ve,measureDroppableContainers:Ne,measuringScheduled:ye}=pS(F,{dragging:k,dependencies:[R.x,R.y],config:ce.droppable}),xe=uS(L,I),ht=v.useMemo(()=>H?Ec(H):null,[H]),wt=Vs(),jt=mS(xe,ce.draggable.measure);DS({activeNode:I!=null?L.get(I):null,config:wt.layoutShiftCompensation,initialRect:jt,measure:ce.draggable.measure});const de=Rg(xe,ce.draggable.measure,jt),pt=Rg(xe?xe.parentElement:null),mt=v.useRef({activatorEvent:null,active:null,activeNode:xe,collisionRect:null,collisions:null,droppableRects:ve,draggableNodes:L,draggingNode:null,draggingNodeRect:null,droppableContainers:B,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ee=B.getNodeFor((n=mt.current.over)==null?void 0:n.id),Ot=kS({measure:ce.dragOverlay.measure}),Jt=(r=Ot.nodeRef.current)!=null?r:xe,Tt=k?(i=Ot.rect)!=null?i:de:null,xn=!!(Ot.nodeRef.current&&Ot.rect),et=AS(xn?null:de),ee=Ix(Jt?_n(Jt):null),z=bS(k?Ee??xe:null),fe=wS(z),Z=Rx(m,{transform:{x:R.x-et.x,y:R.y-et.y,scaleX:1,scaleY:1},activatorEvent:H,active:Q,activeNodeRect:de,containerNodeRect:pt,draggingNodeRect:Tt,over:mt.current.over,overlayNodeRect:Ot.rect,scrollableAncestors:z,scrollableAncestorRects:fe,windowRect:ee}),Oe=ht?Ao(ht,R):null,je=yS(z),rt=jg(je),it=jg(je,[de]),He=Ao(Z,rt),Pe=Tt?GT(Tt,Z):null,Nn=Q&&Pe?h({active:Q,collisionRect:Pe,droppableRects:ve,droppableContainers:F,pointerCoordinates:Oe}):null,Xi=LT(Nn,"id"),[In,Dr]=v.useState(null),es=xn?Z:Ao(Z,it),ts=HT(es,(s=In==null?void 0:In.rect)!=null?s:null,de),lt=v.useRef(null),we=v.useCallback((ct,Ft)=>{let{sensor:ft,options:vn}=Ft;if(W.current==null)return;const Ye=L.get(W.current);if(!Ye)return;const oe=ct.nativeEvent,he=new ft({active:W.current,activeNode:Ye,event:oe,options:vn,context:mt,onAbort(_t){if(!L.get(_t))return;const{onDragAbort:dt}=G.current,bt={id:_t};dt==null||dt(bt),w({type:"onDragAbort",event:bt})},onPending(_t,xt,dt,bt){if(!L.get(_t))return;const{onDragPending:kt}=G.current,$n={id:_t,constraint:xt,initialCoordinates:dt,offset:bt};kt==null||kt($n),w({type:"onDragPending",event:$n})},onStart(_t){const xt=W.current;if(xt==null)return;const dt=L.get(xt);if(!dt)return;const{onDragStart:bt}=G.current,mr={activatorEvent:oe,active:{id:xt,data:dt.data,rect:Y}};ca.unstable_batchedUpdates(()=>{bt==null||bt(mr),S(Ti.Initializing),y({type:Qt.DragStart,initialCoordinates:_t,active:xt}),w({type:"onDragStart",event:mr}),J(lt.current),te(oe)})},onMove(_t){y({type:Qt.DragMove,coordinates:_t})},onEnd:St(Qt.DragEnd),onCancel:St(Qt.DragCancel)});lt.current=he;function St(_t){return async function(){const{active:dt,collisions:bt,over:mr,scrollAdjustedTranslate:kt}=mt.current;let $n=null;if(dt&&kt){const{cancelDrop:fr}=G.current;$n={activatorEvent:oe,active:dt,collisions:bt,delta:kt,over:mr},_t===Qt.DragEnd&&typeof fr=="function"&&await Promise.resolve(fr($n))&&(_t=Qt.DragCancel)}W.current=null,ca.unstable_batchedUpdates(()=>{y({type:_t}),S(Ti.Uninitialized),Dr(null),J(null),te(null),lt.current=null;const fr=_t===Qt.DragEnd?"onDragEnd":"onDragCancel";if($n){const qn=G.current[fr];qn==null||qn($n),w({type:fr,event:$n})}})}}},[L]),ue=v.useCallback((ct,Ft)=>(ft,vn)=>{const Ye=ft.nativeEvent,oe=L.get(vn);if(W.current!==null||!oe||Ye.dndKit||Ye.defaultPrevented)return;const he={active:oe};ct(ft,Ft.options,he)===!0&&(Ye.dndKit={capturedBy:Ft.sensor},W.current=vn,we(ft,Ft))},[L,we]),hr=hS(u,ue);xS(u),_r(()=>{de&&E===Ti.Initializing&&S(Ti.Initialized)},[de,E]),v.useEffect(()=>{const{onDragMove:ct}=G.current,{active:Ft,activatorEvent:ft,collisions:vn,over:Ye}=mt.current;if(!Ft||!ft)return;const oe={active:Ft,activatorEvent:ft,collisions:vn,delta:{x:He.x,y:He.y},over:Ye};ca.unstable_batchedUpdates(()=>{ct==null||ct(oe),w({type:"onDragMove",event:oe})})},[He.x,He.y]),v.useEffect(()=>{const{active:ct,activatorEvent:Ft,collisions:ft,droppableContainers:vn,scrollAdjustedTranslate:Ye}=mt.current;if(!ct||W.current==null||!Ft||!Ye)return;const{onDragOver:oe}=G.current,he=vn.get(Xi),St=he&&he.rect.current?{id:he.id,rect:he.rect.current,data:he.data,disabled:he.disabled}:null,_t={active:ct,activatorEvent:Ft,collisions:ft,delta:{x:Ye.x,y:Ye.y},over:St};ca.unstable_batchedUpdates(()=>{Dr(St),oe==null||oe(_t),w({type:"onDragOver",event:_t})})},[Xi]),_r(()=>{mt.current={activatorEvent:H,active:Q,activeNode:xe,collisionRect:Pe,collisions:Nn,droppableRects:ve,draggableNodes:L,draggingNode:Jt,draggingNodeRect:Tt,droppableContainers:B,over:In,scrollableAncestors:z,scrollAdjustedTranslate:He},Y.current={initial:Tt,translated:Pe}},[Q,xe,Nn,Pe,L,Jt,Tt,ve,B,In,z,He]),lS({...wt,delta:R,draggingRect:Pe,pointerCoordinates:Oe,scrollableAncestors:z,scrollableAncestorRects:fe});const Qs=v.useMemo(()=>({active:Q,activeNode:xe,activeNodeRect:de,activatorEvent:H,collisions:Nn,containerNodeRect:pt,dragOverlay:Ot,draggableNodes:L,droppableContainers:B,droppableRects:ve,over:In,measureDroppableContainers:Ne,scrollableAncestors:z,scrollableAncestorRects:fe,measuringConfiguration:ce,measuringScheduled:ye,windowRect:ee}),[Q,xe,de,H,Nn,pt,Ot,L,B,ve,In,Ne,z,fe,ce,ye,ee]),pr=v.useMemo(()=>({activatorEvent:H,activators:hr,active:Q,activeNodeRect:de,ariaDescribedById:{draggable:M},dispatch:y,draggableNodes:L,over:In,measureDroppableContainers:Ne}),[H,hr,Q,de,y,M,L,In,Ne]);return v.createElement(gx.Provider,{value:C},v.createElement(dl.Provider,{value:pr},v.createElement(Ox.Provider,{value:Qs},v.createElement(Hd.Provider,{value:ts},d)),v.createElement(NS,{disabled:(a==null?void 0:a.restoreFocus)===!1})),v.createElement(NT,{...a,hiddenTextDescribedById:M}));function Vs(){const ct=(ie==null?void 0:ie.autoScrollEnabled)===!1,Ft=typeof l=="object"?l.enabled===!1:l===!1,ft=k&&!ct&&!Ft;return typeof l=="object"?{...l,enabled:ft}:{enabled:ft}}}),OS=v.createContext(null),Pg="button",RS="Draggable";function vm(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const s=cl(RS),{activators:o,activatorEvent:a,active:l,activeNodeRect:d,ariaDescribedById:u,draggableNodes:h,over:p}=v.useContext(dl),{role:m=Pg,roleDescription:g="draggable",tabIndex:b=0}=i??{},A=(l==null?void 0:l.id)===t,y=v.useContext(A?Hd:OS),[w,C]=vc(),[E,S]=vc(),k=vS(o,t),I=Ha(n);_r(()=>(h.set(t,{id:t,key:s,node:w,activatorNode:E,data:I}),()=>{const R=h.get(t);R&&R.key===s&&h.delete(t)}),[h,t]);const L=v.useMemo(()=>({role:m,tabIndex:b,"aria-disabled":r,"aria-pressed":A&&m===Pg?!0:void 0,"aria-roledescription":g,"aria-describedby":u.draggable}),[r,m,b,A,g,u.draggable]);return{active:l,activatorEvent:a,activeNodeRect:d,attributes:L,isDragging:A,listeners:r?void 0:k,node:w,over:p,setNodeRef:C,setActivatorNodeRef:S,transform:y}}function Lx(){return v.useContext(Ox)}const LS="Droppable",jS={timeout:25};function Ud(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const s=cl(LS),{active:o,dispatch:a,over:l,measureDroppableContainers:d}=v.useContext(dl),u=v.useRef({disabled:n}),h=v.useRef(!1),p=v.useRef(null),m=v.useRef(null),{disabled:g,updateMeasurementsFor:b,timeout:A}={...jS,...i},y=Ha(b??r),w=v.useCallback(()=>{if(!h.current){h.current=!0;return}m.current!=null&&clearTimeout(m.current),m.current=setTimeout(()=>{d(Array.isArray(y.current)?y.current:[y.current]),m.current=null},A)},[A]),C=$d({callback:w,disabled:g||!o}),E=v.useCallback((L,R)=>{C&&(R&&(C.unobserve(R),h.current=!1),L&&C.observe(L))},[C]),[S,k]=vc(E),I=Ha(t);return v.useEffect(()=>{!C||!S.current||(C.disconnect(),h.current=!1,C.observe(S.current))},[S,C]),v.useEffect(()=>(a({type:Qt.RegisterDroppable,element:{id:r,key:s,disabled:n,node:S,rect:p,data:I}}),()=>a({type:Qt.UnregisterDroppable,key:s,id:r})),[r]),v.useEffect(()=>{n!==u.current.disabled&&(a({type:Qt.SetDroppableDisabled,id:r,key:s,disabled:n}),u.current.disabled=n)},[r,s,n,a]),{active:o,rect:p,isOver:(l==null?void 0:l.id)===r,node:S,over:l,setNodeRef:k}}function BS(e){let{animation:t,children:n}=e;const[r,i]=v.useState(null),[s,o]=v.useState(null),a=wc(n);return!n&&!r&&a&&i(a),_r(()=>{if(!s)return;const l=r==null?void 0:r.key,d=r==null?void 0:r.props.id;if(l==null||d==null){i(null);return}Promise.resolve(t(d,s)).then(()=>{i(null)})},[t,r,s]),v.createElement(v.Fragment,null,n,r?v.cloneElement(r,{ref:o}):null)}const PS={x:0,y:0,scaleX:1,scaleY:1};function FS(e){let{children:t}=e;return v.createElement(dl.Provider,{value:Mx},v.createElement(Hd.Provider,{value:PS},t))}const $S={position:"fixed",touchAction:"none"},HS=e=>Fd(e)?"transform 250ms ease":void 0,US=v.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:s,className:o,rect:a,style:l,transform:d,transition:u=HS}=e;if(!a)return null;const h=i?d:{...d,scaleX:1,scaleY:1},p={...$S,width:a.width,height:a.height,top:a.top,left:a.left,transform:mi.Transform.toString(h),transformOrigin:i&&r?MT(r,a):void 0,transition:typeof u=="function"?u(r):u,...l};return v.createElement(n,{className:o,style:p,ref:t},s)}),GS=e=>t=>{let{active:n,dragOverlay:r}=t;const i={},{styles:s,className:o}=e;if(s!=null&&s.active)for(const[a,l]of Object.entries(s.active))l!==void 0&&(i[a]=n.node.style.getPropertyValue(a),n.node.style.setProperty(a,l));if(s!=null&&s.dragOverlay)for(const[a,l]of Object.entries(s.dragOverlay))l!==void 0&&r.node.style.setProperty(a,l);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(const[l,d]of Object.entries(i))n.node.style.setProperty(l,d);o!=null&&o.active&&n.node.classList.remove(o.active)}},WS=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:mi.Transform.toString(t)},{transform:mi.Transform.toString(n)}]},YS={duration:250,easing:"ease",keyframes:WS,sideEffects:GS({styles:{active:{opacity:"0"}}})};function zS(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return Pd((s,o)=>{if(t===null)return;const a=n.get(s);if(!a)return;const l=a.node.current;if(!l)return;const d=Dx(o);if(!d)return;const{transform:u}=_n(o).getComputedStyle(o),h=xx(u);if(!h)return;const p=typeof t=="function"?t:KS(t);return Sx(l,i.draggable.measure),p({active:{id:s,data:a.data,node:l,rect:i.draggable.measure(l)},draggableNodes:n,dragOverlay:{node:o,rect:i.dragOverlay.measure(d)},droppableContainers:r,measuringConfiguration:i,transform:h})})}function KS(e){const{duration:t,easing:n,sideEffects:r,keyframes:i}={...YS,...e};return s=>{let{active:o,dragOverlay:a,transform:l,...d}=s;if(!t)return;const u={x:a.rect.left-o.rect.left,y:a.rect.top-o.rect.top},h={scaleX:l.scaleX!==1?o.rect.width*l.scaleX/a.rect.width:1,scaleY:l.scaleY!==1?o.rect.height*l.scaleY/a.rect.height:1},p={x:l.x-u.x,y:l.y-u.y,...h},m=i({...d,active:o,dragOverlay:a,transform:{initial:l,final:p}}),[g]=m,b=m[m.length-1];if(JSON.stringify(g)===JSON.stringify(b))return;const A=r==null?void 0:r({active:o,dragOverlay:a,...d}),y=a.node.animate(m,{duration:t,easing:n,fill:"forwards"});return new Promise(w=>{y.onfinish=()=>{A==null||A(),w()}})}}let Fg=0;function QS(e){return v.useMemo(()=>{if(e!=null)return Fg++,Fg},[e])}const VS=v.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:i,transition:s,modifiers:o,wrapperElement:a="div",className:l,zIndex:d=999}=e;const{activatorEvent:u,active:h,activeNodeRect:p,containerNodeRect:m,draggableNodes:g,droppableContainers:b,dragOverlay:A,over:y,measuringConfiguration:w,scrollableAncestors:C,scrollableAncestorRects:E,windowRect:S}=Lx(),k=v.useContext(Hd),I=QS(h==null?void 0:h.id),L=Rx(o,{activatorEvent:u,active:h,activeNodeRect:p,containerNodeRect:m,draggingNodeRect:A.rect,over:y,overlayNodeRect:A.rect,scrollableAncestors:C,scrollableAncestorRects:E,transform:k,windowRect:S}),R=xm(p),B=zS({config:r,draggableNodes:g,droppableContainers:b,measuringConfiguration:w}),O=R?A.setRef:void 0;return v.createElement(FS,null,v.createElement(BS,{animation:B},h&&I?v.createElement(US,{key:I,id:h.id,ref:O,as:a,activatorEvent:u,adjustScale:t,className:l,transition:s,rect:R,style:{zIndex:d,...i},transform:L},n):null))});function jx(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function qS(e,t){return e.reduce((n,r,i)=>{const s=t.get(r);return s&&(n[i]=s),n},Array(e.length))}function Bl(e){return e!==null&&e>=0}function JS(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function ZS(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Bx=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e;const s=jx(t,r,n),o=t[i],a=s[i];return!a||!o?null:{x:a.left-o.left,y:a.top-o.top,scaleX:a.width/o.width,scaleY:a.height/o.height}},Pl={scaleX:1,scaleY:1},Px=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:i,rects:s,overIndex:o}=e;const a=(t=s[n])!=null?t:r;if(!a)return null;if(i===n){const d=s[o];return d?{x:0,y:n<o?d.top+d.height-(a.top+a.height):d.top-a.top,...Pl}:null}const l=XS(s,i,n);return i>n&&i<=o?{x:0,y:-a.height-l,...Pl}:i<n&&i>=o?{x:0,y:a.height+l,...Pl}:{x:0,y:0,...Pl}};function XS(e,t,n){const r=e[t],i=e[t-1],s=e[t+1];return r?n<t?i?r.top-(i.top+i.height):s?s.top-(r.top+r.height):0:s?s.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}const Fx="Sortable",$x=v.createContext({activeIndex:-1,containerId:Fx,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Bx,disabled:{draggable:!1,droppable:!1}});function Hx(e){let{children:t,id:n,items:r,strategy:i=Bx,disabled:s=!1}=e;const{active:o,dragOverlay:a,droppableRects:l,over:d,measureDroppableContainers:u}=Lx(),h=cl(Fx,n),p=a.rect!==null,m=v.useMemo(()=>r.map(k=>typeof k=="object"&&"id"in k?k.id:k),[r]),g=o!=null,b=o?m.indexOf(o.id):-1,A=d?m.indexOf(d.id):-1,y=v.useRef(m),w=!JS(m,y.current),C=A!==-1&&b===-1||w,E=ZS(s);_r(()=>{w&&g&&u(m)},[w,m,g,u]),v.useEffect(()=>{y.current=m},[m]);const S=v.useMemo(()=>({activeIndex:b,containerId:h,disabled:E,disableTransforms:C,items:m,overIndex:A,useDragOverlay:p,sortedRects:qS(m,l),strategy:i}),[b,h,E.draggable,E.droppable,C,m,A,l,p,i]);return v.createElement($x.Provider,{value:S},t)}const e_=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return jx(n,r,i).indexOf(t)},t_=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:s,newIndex:o,previousItems:a,previousContainerId:l,transition:d}=e;return!d||!r||a!==s&&i===o?!1:n?!0:o!==i&&t===l},n_={duration:200,easing:"ease"},Ux="transform",r_=mi.Transition.toString({property:Ux,duration:0,easing:"linear"}),i_={roleDescription:"sortable"};function s_(e){let{disabled:t,index:n,node:r,rect:i}=e;const[s,o]=v.useState(null),a=v.useRef(n);return _r(()=>{if(!t&&n!==a.current&&r.current){const l=i.current;if(l){const d=Bo(r.current,{ignoreTransform:!0}),u={x:l.left-d.left,y:l.top-d.top,scaleX:l.width/d.width,scaleY:l.height/d.height};(u.x||u.y)&&o(u)}}n!==a.current&&(a.current=n)},[t,n,r,i]),v.useEffect(()=>{s&&o(null)},[s]),s}function Gx(e){let{animateLayoutChanges:t=t_,attributes:n,disabled:r,data:i,getNewIndex:s=e_,id:o,strategy:a,resizeObserverConfig:l,transition:d=n_}=e;const{items:u,containerId:h,activeIndex:p,disabled:m,disableTransforms:g,sortedRects:b,overIndex:A,useDragOverlay:y,strategy:w}=v.useContext($x),C=o_(r,m),E=u.indexOf(o),S=v.useMemo(()=>({sortable:{containerId:h,index:E,items:u},...i}),[h,i,E,u]),k=v.useMemo(()=>u.slice(u.indexOf(o)),[u,o]),{rect:I,node:L,isOver:R,setNodeRef:B}=Ud({id:o,data:S,disabled:C.droppable,resizeObserverConfig:{updateMeasurementsFor:k,...l}}),{active:O,activatorEvent:Y,activeNodeRect:Q,attributes:W,setNodeRef:ie,listeners:J,isDragging:H,over:te,setActivatorNodeRef:G,transform:M}=vm({id:o,data:S,attributes:{...i_,...n},disabled:C.draggable}),F=gT(B,ie),ce=!!O,ve=ce&&!g&&Bl(p)&&Bl(A),Ne=!y&&H,ye=Ne&&ve?M:null,ht=ve?ye??(a??w)({rects:b,activeNodeRect:Q,activeIndex:p,overIndex:A,index:E}):null,wt=Bl(p)&&Bl(A)?s({id:o,items:u,activeIndex:p,overIndex:A}):E,jt=O==null?void 0:O.id,de=v.useRef({activeId:jt,items:u,newIndex:wt,containerId:h}),pt=u!==de.current.items,mt=t({active:O,containerId:h,isDragging:H,isSorting:ce,id:o,index:E,items:u,newIndex:de.current.newIndex,previousItems:de.current.items,previousContainerId:de.current.containerId,transition:d,wasDragging:de.current.activeId!=null}),Ee=s_({disabled:!mt,index:E,node:L,rect:I});return v.useEffect(()=>{ce&&de.current.newIndex!==wt&&(de.current.newIndex=wt),h!==de.current.containerId&&(de.current.containerId=h),u!==de.current.items&&(de.current.items=u)},[ce,wt,h,u]),v.useEffect(()=>{if(jt===de.current.activeId)return;if(jt!=null&&de.current.activeId==null){de.current.activeId=jt;return}const Jt=setTimeout(()=>{de.current.activeId=jt},50);return()=>clearTimeout(Jt)},[jt]),{active:O,activeIndex:p,attributes:W,data:S,rect:I,index:E,newIndex:wt,items:u,isOver:R,isSorting:ce,isDragging:H,listeners:J,node:L,overIndex:A,over:te,setNodeRef:F,setActivatorNodeRef:G,setDroppableNodeRef:B,setDraggableNodeRef:ie,transform:Ee??ht,transition:Ot()};function Ot(){if(Ee||pt&&de.current.newIndex===E)return r_;if(!(Ne&&!Fd(Y)||!d)&&(ce||mt))return mi.Transition.toString({...d,property:Ux})}}function o_(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}st.Down,st.Right,st.Up,st.Left;var nt;(function(e){e.assertEqual=i=>{};function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const s={};for(const o of i)s[o]=o;return s},e.getValidEnumValues=i=>{const s=e.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(const a of s)o[a]=i[a];return e.objectValues(o)},e.objectValues=i=>e.objectKeys(i).map(function(s){return i[s]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},e.find=(i,s)=>{for(const o of i)if(s(o))return o},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}e.joinValues=r,e.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(nt||(nt={}));var $g;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})($g||($g={}));const ke=nt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Si=e=>{switch(typeof e){case"undefined":return ke.undefined;case"string":return ke.string;case"number":return Number.isNaN(e)?ke.nan:ke.number;case"boolean":return ke.boolean;case"function":return ke.function;case"bigint":return ke.bigint;case"symbol":return ke.symbol;case"object":return Array.isArray(e)?ke.array:e===null?ke.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ke.promise:typeof Map<"u"&&e instanceof Map?ke.map:typeof Set<"u"&&e instanceof Set?ke.set:typeof Date<"u"&&e instanceof Date?ke.date:ke.object;default:return ke.unknown}},se=nt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);let Rs=class Wx extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(s){return s.message},r={_errors:[]},i=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let a=r,l=0;for(;l<o.path.length;){const d=o.path[l];l===o.path.length-1?(a[d]=a[d]||{_errors:[]},a[d]._errors.push(n(o))):a[d]=a[d]||{_errors:[]},a=a[d],l++}}};return i(this),r}static assert(t){if(!(t instanceof Wx))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,nt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)if(i.path.length>0){const s=i.path[0];n[s]=n[s]||[],n[s].push(t(i))}else r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};Rs.create=e=>new Rs(e);const Jh=(e,t)=>{let n;switch(e.code){case se.invalid_type:e.received===ke.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case se.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,nt.jsonStringifyReplacer)}`;break;case se.unrecognized_keys:n=`Unrecognized key(s) in object: ${nt.joinValues(e.keys,", ")}`;break;case se.invalid_union:n="Invalid input";break;case se.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${nt.joinValues(e.options)}`;break;case se.invalid_enum_value:n=`Invalid enum value. Expected ${nt.joinValues(e.options)}, received '${e.received}'`;break;case se.invalid_arguments:n="Invalid function arguments";break;case se.invalid_return_type:n="Invalid function return type";break;case se.invalid_date:n="Invalid date";break;case se.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:nt.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case se.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case se.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case se.custom:n="Invalid input";break;case se.invalid_intersection_types:n="Intersection results could not be merged";break;case se.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case se.not_finite:n="Number must be finite";break;default:n=t.defaultError,nt.assertNever(e)}return{message:n}};let a_=Jh;function l_(){return a_}const c_=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,s=[...n,...i.path||[]],o={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let a="";const l=r.filter(d=>!!d).slice().reverse();for(const d of l)a=d(o,{data:t,defaultError:a}).message;return{...i,path:s,message:a}};function ge(e,t){const n=l_(),r=c_({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Jh?void 0:Jh].filter(i=>!!i)});e.common.issues.push(r)}class Cn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return Be;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n){const s=await i.key,o=await i.value;r.push({key:s,value:o})}return Cn.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return Be;s.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(r[s.value]=o.value)}return{status:t.value,value:r}}}const Be=Object.freeze({status:"aborted"}),Zh=e=>({status:"dirty",value:e}),ur=e=>({status:"valid",value:e}),Hg=e=>e.status==="aborted",Ug=e=>e.status==="dirty",vo=e=>e.status==="valid",Sc=e=>typeof Promise<"u"&&e instanceof Promise;var Ce;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Ce||(Ce={}));let Yr=class{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};const Gg=(e,t)=>{if(vo(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Rs(e.common.issues);return this._error=n,this._error}}};function We(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(s,o)=>{const{message:a}=e;return s.code==="invalid_enum_value"?{message:a??o.defaultError}:typeof o.data>"u"?{message:a??r??o.defaultError}:s.code!=="invalid_type"?{message:o.defaultError}:{message:a??n??o.defaultError}},description:i}}let Je=class{get description(){return this._def.description}_getType(t){return Si(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Si(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Cn,ctx:{common:t.parent.common,data:t.data,parsedType:Si(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Sc(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Si(t)},i=this._parseSync({data:t,path:r.path,parent:r});return Gg(r,i)}"~validate"(t){var n,r;const i={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Si(t)};if(!this["~standard"].async)try{const s=this._parseSync({data:t,path:[],parent:i});return vo(s)?{value:s.value}:{issues:i.common.issues}}catch(s){(r=(n=s==null?void 0:s.message)==null?void 0:n.toLowerCase())!=null&&r.includes("encountered")&&(this["~standard"].async=!0),i.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:i}).then(s=>vo(s)?{value:s.value}:{issues:i.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Si(t)},i=this._parse({data:t,path:r.path,parent:r}),s=await(Sc(i)?i:Promise.resolve(i));return Gg(r,s)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,s)=>{const o=t(i),a=()=>s.addIssue({code:se.custom,...r(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new ko({schema:this,typeName:Le.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Pi.create(this,this._def)}nullable(){return Eo.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Gr.create(this)}promise(){return Ic.create(this,this._def)}or(t){return _c.create([this,t],this._def)}and(t){return Nc.create(this,t,this._def)}transform(t){return new ko({...We(this._def),schema:this,typeName:Le.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new lp({...We(this._def),innerType:this,defaultValue:n,typeName:Le.ZodDefault})}brand(){return new O_({typeName:Le.ZodBranded,type:this,...We(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new cp({...We(this._def),innerType:this,catchValue:n,typeName:Le.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return R_.create(this,t)}readonly(){return dp.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};const d_=/^c[^\s-]{8,}$/i,u_=/^[0-9a-z]+$/,h_=/^[0-9A-HJKMNP-TV-Z]{26}$/i,p_=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,m_=/^[a-z0-9_-]{21}$/i,f_=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,g_=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,A_=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,b_="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let $u;const y_=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,x_=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,v_=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,w_=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,k_=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,E_=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Yx="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",C_=new RegExp(`^${Yx}$`);function zx(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function T_(e){return new RegExp(`^${zx(e)}$`)}function S_(e){let t=`${Yx}T${zx(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function __(e,t){return!!((t==="v4"||!t)&&y_.test(e)||(t==="v6"||!t)&&v_.test(e))}function N_(e,t){if(!f_.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||t&&i.alg!==t)}catch{return!1}}function I_(e,t){return!!((t==="v4"||!t)&&x_.test(e)||(t==="v6"||!t)&&w_.test(e))}class li extends Je{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ke.string){const i=this._getOrReturnCtx(t);return ge(i,{code:se.invalid_type,expected:ke.string,received:i.parsedType}),Be}const n=new Cn;let r;for(const i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(r=this._getOrReturnCtx(t,r),ge(r,{code:se.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")t.data.length>i.value&&(r=this._getOrReturnCtx(t,r),ge(r,{code:se.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){const s=t.data.length>i.value,o=t.data.length<i.value;(s||o)&&(r=this._getOrReturnCtx(t,r),s?ge(r,{code:se.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&ge(r,{code:se.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")A_.test(t.data)||(r=this._getOrReturnCtx(t,r),ge(r,{validation:"email",code:se.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")$u||($u=new RegExp(b_,"u")),$u.test(t.data)||(r=this._getOrReturnCtx(t,r),ge(r,{validation:"emoji",code:se.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")p_.test(t.data)||(r=this._getOrReturnCtx(t,r),ge(r,{validation:"uuid",code:se.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")m_.test(t.data)||(r=this._getOrReturnCtx(t,r),ge(r,{validation:"nanoid",code:se.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")d_.test(t.data)||(r=this._getOrReturnCtx(t,r),ge(r,{validation:"cuid",code:se.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")u_.test(t.data)||(r=this._getOrReturnCtx(t,r),ge(r,{validation:"cuid2",code:se.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")h_.test(t.data)||(r=this._getOrReturnCtx(t,r),ge(r,{validation:"ulid",code:se.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{r=this._getOrReturnCtx(t,r),ge(r,{validation:"url",code:se.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(r=this._getOrReturnCtx(t,r),ge(r,{validation:"regex",code:se.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(r=this._getOrReturnCtx(t,r),ge(r,{code:se.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(r=this._getOrReturnCtx(t,r),ge(r,{code:se.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(r=this._getOrReturnCtx(t,r),ge(r,{code:se.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?S_(i).test(t.data)||(r=this._getOrReturnCtx(t,r),ge(r,{code:se.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?C_.test(t.data)||(r=this._getOrReturnCtx(t,r),ge(r,{code:se.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?T_(i).test(t.data)||(r=this._getOrReturnCtx(t,r),ge(r,{code:se.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?g_.test(t.data)||(r=this._getOrReturnCtx(t,r),ge(r,{validation:"duration",code:se.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?__(t.data,i.version)||(r=this._getOrReturnCtx(t,r),ge(r,{validation:"ip",code:se.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?N_(t.data,i.alg)||(r=this._getOrReturnCtx(t,r),ge(r,{validation:"jwt",code:se.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?I_(t.data,i.version)||(r=this._getOrReturnCtx(t,r),ge(r,{validation:"cidr",code:se.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?k_.test(t.data)||(r=this._getOrReturnCtx(t,r),ge(r,{validation:"base64",code:se.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?E_.test(t.data)||(r=this._getOrReturnCtx(t,r),ge(r,{validation:"base64url",code:se.invalid_string,message:i.message}),n.dirty()):nt.assertNever(i);return{status:n.value,value:t.data}}_regex(t,n,r){return this.refinement(i=>t.test(i),{validation:n,code:se.invalid_string,...Ce.errToObj(r)})}_addCheck(t){return new li({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ce.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ce.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ce.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ce.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Ce.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ce.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ce.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ce.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Ce.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Ce.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Ce.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ce.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Ce.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...Ce.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...Ce.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Ce.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Ce.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Ce.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Ce.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Ce.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Ce.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Ce.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Ce.errToObj(n)})}nonempty(t){return this.min(1,Ce.errToObj(t))}trim(){return new li({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new li({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new li({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}li.create=e=>new li({checks:[],typeName:Le.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...We(e)});function D_(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,s=Number.parseInt(e.toFixed(i).replace(".","")),o=Number.parseInt(t.toFixed(i).replace(".",""));return s%o/10**i}let Xh=class ep extends Je{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ke.number){const i=this._getOrReturnCtx(t);return ge(i,{code:se.invalid_type,expected:ke.number,received:i.parsedType}),Be}let n;const r=new Cn;for(const i of this._def.checks)i.kind==="int"?nt.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),ge(n,{code:se.invalid_type,expected:"integer",received:"float",message:i.message}),r.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),ge(n,{code:se.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),ge(n,{code:se.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="multipleOf"?D_(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),ge(n,{code:se.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),ge(n,{code:se.not_finite,message:i.message}),r.dirty()):nt.assertNever(i);return{status:r.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ce.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ce.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ce.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ce.toString(n))}setLimit(t,n,r,i){return new ep({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ce.toString(i)}]})}_addCheck(t){return new ep({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ce.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ce.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ce.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ce.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ce.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ce.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Ce.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ce.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ce.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&nt.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}};Xh.create=e=>new Xh({checks:[],typeName:Le.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...We(e)});let Wg=class tp extends Je{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==ke.bigint)return this._getInvalidInput(t);let n;const r=new Cn;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),ge(n,{code:se.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),ge(n,{code:se.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),ge(n,{code:se.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):nt.assertNever(i);return{status:r.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return ge(n,{code:se.invalid_type,expected:ke.bigint,received:n.parsedType}),Be}gte(t,n){return this.setLimit("min",t,!0,Ce.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ce.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ce.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ce.toString(n))}setLimit(t,n,r,i){return new tp({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ce.toString(i)}]})}_addCheck(t){return new tp({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ce.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ce.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ce.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ce.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ce.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};Wg.create=e=>new Wg({checks:[],typeName:Le.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...We(e)});class np extends Je{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ke.boolean){const n=this._getOrReturnCtx(t);return ge(n,{code:se.invalid_type,expected:ke.boolean,received:n.parsedType}),Be}return ur(t.data)}}np.create=e=>new np({typeName:Le.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...We(e)});let Yg=class Kx extends Je{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ke.date){const i=this._getOrReturnCtx(t);return ge(i,{code:se.invalid_type,expected:ke.date,received:i.parsedType}),Be}if(Number.isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return ge(i,{code:se.invalid_date}),Be}const n=new Cn;let r;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(r=this._getOrReturnCtx(t,r),ge(r,{code:se.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(r=this._getOrReturnCtx(t,r),ge(r,{code:se.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):nt.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Kx({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Ce.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Ce.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}};Yg.create=e=>new Yg({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Le.ZodDate,...We(e)});let zg=class extends Je{_parse(t){if(this._getType(t)!==ke.symbol){const n=this._getOrReturnCtx(t);return ge(n,{code:se.invalid_type,expected:ke.symbol,received:n.parsedType}),Be}return ur(t.data)}};zg.create=e=>new zg({typeName:Le.ZodSymbol,...We(e)});class Kg extends Je{_parse(t){if(this._getType(t)!==ke.undefined){const n=this._getOrReturnCtx(t);return ge(n,{code:se.invalid_type,expected:ke.undefined,received:n.parsedType}),Be}return ur(t.data)}}Kg.create=e=>new Kg({typeName:Le.ZodUndefined,...We(e)});let Qg=class extends Je{_parse(t){if(this._getType(t)!==ke.null){const n=this._getOrReturnCtx(t);return ge(n,{code:se.invalid_type,expected:ke.null,received:n.parsedType}),Be}return ur(t.data)}};Qg.create=e=>new Qg({typeName:Le.ZodNull,...We(e)});let rp=class extends Je{constructor(){super(...arguments),this._any=!0}_parse(t){return ur(t.data)}};rp.create=e=>new rp({typeName:Le.ZodAny,...We(e)});let Vg=class extends Je{constructor(){super(...arguments),this._unknown=!0}_parse(t){return ur(t.data)}};Vg.create=e=>new Vg({typeName:Le.ZodUnknown,...We(e)});let Wi=class extends Je{_parse(t){const n=this._getOrReturnCtx(t);return ge(n,{code:se.invalid_type,expected:ke.never,received:n.parsedType}),Be}};Wi.create=e=>new Wi({typeName:Le.ZodNever,...We(e)});class qg extends Je{_parse(t){if(this._getType(t)!==ke.undefined){const n=this._getOrReturnCtx(t);return ge(n,{code:se.invalid_type,expected:ke.void,received:n.parsedType}),Be}return ur(t.data)}}qg.create=e=>new qg({typeName:Le.ZodVoid,...We(e)});class Gr extends Je{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==ke.array)return ge(n,{code:se.invalid_type,expected:ke.array,received:n.parsedType}),Be;if(i.exactLength!==null){const o=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(o||a)&&(ge(n,{code:o?se.too_big:se.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(ge(n,{code:se.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(ge(n,{code:se.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,a)=>i.type._parseAsync(new Yr(n,o,n.path,a)))).then(o=>Cn.mergeArray(r,o));const s=[...n.data].map((o,a)=>i.type._parseSync(new Yr(n,o,n.path,a)));return Cn.mergeArray(r,s)}get element(){return this._def.type}min(t,n){return new Gr({...this._def,minLength:{value:t,message:Ce.toString(n)}})}max(t,n){return new Gr({...this._def,maxLength:{value:t,message:Ce.toString(n)}})}length(t,n){return new Gr({...this._def,exactLength:{value:t,message:Ce.toString(n)}})}nonempty(t){return this.min(1,t)}}Gr.create=(e,t)=>new Gr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Le.ZodArray,...We(t)});function lo(e){if(e instanceof fi){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Pi.create(lo(r))}return new fi({...e._def,shape:()=>t})}else return e instanceof Gr?new Gr({...e._def,type:lo(e.element)}):e instanceof Pi?Pi.create(lo(e.unwrap())):e instanceof Eo?Eo.create(lo(e.unwrap())):e instanceof Ga?Ga.create(e.items.map(t=>lo(t))):e}let fi=class vr extends Je{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=nt.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==ke.object){const l=this._getOrReturnCtx(t);return ge(l,{code:se.invalid_type,expected:ke.object,received:l.parsedType}),Be}const{status:n,ctx:r}=this._processInputParams(t),{shape:i,keys:s}=this._getCached(),o=[];if(!(this._def.catchall instanceof Wi&&this._def.unknownKeys==="strip"))for(const l in r.data)s.includes(l)||o.push(l);const a=[];for(const l of s){const d=i[l],u=r.data[l];a.push({key:{status:"valid",value:l},value:d._parse(new Yr(r,u,r.path,l)),alwaysSet:l in r.data})}if(this._def.catchall instanceof Wi){const l=this._def.unknownKeys;if(l==="passthrough")for(const d of o)a.push({key:{status:"valid",value:d},value:{status:"valid",value:r.data[d]}});else if(l==="strict")o.length>0&&(ge(r,{code:se.unrecognized_keys,keys:o}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const d of o){const u=r.data[d];a.push({key:{status:"valid",value:d},value:l._parse(new Yr(r,u,r.path,d)),alwaysSet:d in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const l=[];for(const d of a){const u=await d.key,h=await d.value;l.push({key:u,value:h,alwaysSet:d.alwaysSet})}return l}).then(l=>Cn.mergeObjectSync(n,l)):Cn.mergeObjectSync(n,a)}get shape(){return this._def.shape()}strict(t){return Ce.errToObj,new vr({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,s;const o=((s=(i=this._def).errorMap)==null?void 0:s.call(i,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:Ce.errToObj(t).message??o}:{message:o}}}:{}})}strip(){return new vr({...this._def,unknownKeys:"strip"})}passthrough(){return new vr({...this._def,unknownKeys:"passthrough"})}extend(t){return new vr({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new vr({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Le.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new vr({...this._def,catchall:t})}pick(t){const n={};for(const r of nt.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new vr({...this._def,shape:()=>n})}omit(t){const n={};for(const r of nt.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new vr({...this._def,shape:()=>n})}deepPartial(){return lo(this)}partial(t){const n={};for(const r of nt.objectKeys(this.shape)){const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}return new vr({...this._def,shape:()=>n})}required(t){const n={};for(const r of nt.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof Pi;)i=i._def.innerType;n[r]=i}return new vr({...this._def,shape:()=>n})}keyof(){return Vx(nt.objectKeys(this.shape))}};fi.create=(e,t)=>new fi({shape:()=>e,unknownKeys:"strip",catchall:Wi.create(),typeName:Le.ZodObject,...We(t)});fi.strictCreate=(e,t)=>new fi({shape:()=>e,unknownKeys:"strict",catchall:Wi.create(),typeName:Le.ZodObject,...We(t)});fi.lazycreate=(e,t)=>new fi({shape:e,unknownKeys:"strip",catchall:Wi.create(),typeName:Le.ZodObject,...We(t)});let _c=class extends Je{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(a=>new Rs(a.ctx.common.issues));return ge(n,{code:se.invalid_union,unionErrors:o}),Be}if(n.common.async)return Promise.all(r.map(async s=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(i);{let s;const o=[];for(const l of r){const d={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:d});if(u.status==="valid")return u;u.status==="dirty"&&!s&&(s={result:u,ctx:d}),d.common.issues.length&&o.push(d.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(l=>new Rs(l));return ge(n,{code:se.invalid_union,unionErrors:a}),Be}}get options(){return this._def.options}};_c.create=(e,t)=>new _c({options:e,typeName:Le.ZodUnion,...We(t)});function ip(e,t){const n=Si(e),r=Si(t);if(e===t)return{valid:!0,data:e};if(n===ke.object&&r===ke.object){const i=nt.objectKeys(t),s=nt.objectKeys(e).filter(a=>i.indexOf(a)!==-1),o={...e,...t};for(const a of s){const l=ip(e[a],t[a]);if(!l.valid)return{valid:!1};o[a]=l.data}return{valid:!0,data:o}}else if(n===ke.array&&r===ke.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let s=0;s<e.length;s++){const o=e[s],a=t[s],l=ip(o,a);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===ke.date&&r===ke.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}let Nc=class extends Je{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(s,o)=>{if(Hg(s)||Hg(o))return Be;const a=ip(s.value,o.value);return a.valid?((Ug(s)||Ug(o))&&n.dirty(),{status:n.value,value:a.data}):(ge(r,{code:se.invalid_intersection_types}),Be)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};Nc.create=(e,t,n)=>new Nc({left:e,right:t,typeName:Le.ZodIntersection,...We(n)});let Ga=class Qx extends Je{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ke.array)return ge(r,{code:se.invalid_type,expected:ke.array,received:r.parsedType}),Be;if(r.data.length<this._def.items.length)return ge(r,{code:se.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Be;!this._def.rest&&r.data.length>this._def.items.length&&(ge(r,{code:se.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((s,o)=>{const a=this._def.items[o]||this._def.rest;return a?a._parse(new Yr(r,s,r.path,o)):null}).filter(s=>!!s);return r.common.async?Promise.all(i).then(s=>Cn.mergeArray(n,s)):Cn.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new Qx({...this._def,rest:t})}};Ga.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ga({items:e,typeName:Le.ZodTuple,rest:null,...We(t)})};let M_=class sp extends Je{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ke.object)return ge(r,{code:se.invalid_type,expected:ke.object,received:r.parsedType}),Be;const i=[],s=this._def.keyType,o=this._def.valueType;for(const a in r.data)i.push({key:s._parse(new Yr(r,a,r.path,a)),value:o._parse(new Yr(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?Cn.mergeObjectAsync(n,i):Cn.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Je?new sp({keyType:t,valueType:n,typeName:Le.ZodRecord,...We(r)}):new sp({keyType:li.create(),valueType:t,typeName:Le.ZodRecord,...We(n)})}},Jg=class extends Je{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ke.map)return ge(r,{code:se.invalid_type,expected:ke.map,received:r.parsedType}),Be;const i=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([a,l],d)=>({key:i._parse(new Yr(r,a,r.path,[d,"key"])),value:s._parse(new Yr(r,l,r.path,[d,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of o){const d=await l.key,u=await l.value;if(d.status==="aborted"||u.status==="aborted")return Be;(d.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(d.value,u.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of o){const d=l.key,u=l.value;if(d.status==="aborted"||u.status==="aborted")return Be;(d.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(d.value,u.value)}return{status:n.value,value:a}}}};Jg.create=(e,t,n)=>new Jg({valueType:t,keyType:e,typeName:Le.ZodMap,...We(n)});let Zg=class op extends Je{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ke.set)return ge(r,{code:se.invalid_type,expected:ke.set,received:r.parsedType}),Be;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(ge(r,{code:se.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(ge(r,{code:se.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const s=this._def.valueType;function o(l){const d=new Set;for(const u of l){if(u.status==="aborted")return Be;u.status==="dirty"&&n.dirty(),d.add(u.value)}return{status:n.value,value:d}}const a=[...r.data.values()].map((l,d)=>s._parse(new Yr(r,l,r.path,d)));return r.common.async?Promise.all(a).then(l=>o(l)):o(a)}min(t,n){return new op({...this._def,minSize:{value:t,message:Ce.toString(n)}})}max(t,n){return new op({...this._def,maxSize:{value:t,message:Ce.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};Zg.create=(e,t)=>new Zg({valueType:e,minSize:null,maxSize:null,typeName:Le.ZodSet,...We(t)});class Xg extends Je{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Xg.create=(e,t)=>new Xg({getter:e,typeName:Le.ZodLazy,...We(t)});let ap=class extends Je{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return ge(n,{received:n.data,code:se.invalid_literal,expected:this._def.value}),Be}return{status:"valid",value:t.data}}get value(){return this._def.value}};ap.create=(e,t)=>new ap({value:e,typeName:Le.ZodLiteral,...We(t)});function Vx(e,t){return new wo({values:e,typeName:Le.ZodEnum,...We(t)})}class wo extends Je{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return ge(n,{expected:nt.joinValues(r),received:n.parsedType,code:se.invalid_type}),Be}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return ge(n,{received:n.data,code:se.invalid_enum_value,options:r}),Be}return ur(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return wo.create(t,{...this._def,...n})}exclude(t,n=this._def){return wo.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}wo.create=Vx;class eA extends Je{_parse(t){const n=nt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==ke.string&&r.parsedType!==ke.number){const i=nt.objectValues(n);return ge(r,{expected:nt.joinValues(i),received:r.parsedType,code:se.invalid_type}),Be}if(this._cache||(this._cache=new Set(nt.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const i=nt.objectValues(n);return ge(r,{received:r.data,code:se.invalid_enum_value,options:i}),Be}return ur(t.data)}get enum(){return this._def.values}}eA.create=(e,t)=>new eA({values:e,typeName:Le.ZodNativeEnum,...We(t)});let Ic=class extends Je{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ke.promise&&n.common.async===!1)return ge(n,{code:se.invalid_type,expected:ke.promise,received:n.parsedType}),Be;const r=n.parsedType===ke.promise?n.data:Promise.resolve(n.data);return ur(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}};Ic.create=(e,t)=>new Ic({type:e,typeName:Le.ZodPromise,...We(t)});let ko=class extends Je{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Le.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,s={addIssue:o=>{ge(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const o=i.transform(r.data,s);if(r.common.async)return Promise.resolve(o).then(async a=>{if(n.value==="aborted")return Be;const l=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return l.status==="aborted"?Be:l.status==="dirty"||n.value==="dirty"?Zh(l.value):l});{if(n.value==="aborted")return Be;const a=this._def.schema._parseSync({data:o,path:r.path,parent:r});return a.status==="aborted"?Be:a.status==="dirty"||n.value==="dirty"?Zh(a.value):a}}if(i.type==="refinement"){const o=a=>{const l=i.refinement(a,s);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Be:(a.status==="dirty"&&n.dirty(),o(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?Be:(a.status==="dirty"&&n.dirty(),o(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!vo(o))return Be;const a=i.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>vo(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:n.value,value:a})):Be);nt.assertNever(i)}};ko.create=(e,t,n)=>new ko({schema:e,typeName:Le.ZodEffects,effect:t,...We(n)});ko.createWithPreprocess=(e,t,n)=>new ko({schema:t,effect:{type:"preprocess",transform:e},typeName:Le.ZodEffects,...We(n)});class Pi extends Je{_parse(t){return this._getType(t)===ke.undefined?ur(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Pi.create=(e,t)=>new Pi({innerType:e,typeName:Le.ZodOptional,...We(t)});let Eo=class extends Je{_parse(t){return this._getType(t)===ke.null?ur(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Eo.create=(e,t)=>new Eo({innerType:e,typeName:Le.ZodNullable,...We(t)});let lp=class extends Je{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===ke.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};lp.create=(e,t)=>new lp({innerType:e,typeName:Le.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...We(t)});class cp extends Je{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Sc(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Rs(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Rs(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}cp.create=(e,t)=>new cp({innerType:e,typeName:Le.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...We(t)});let tA=class extends Je{_parse(t){if(this._getType(t)!==ke.nan){const n=this._getOrReturnCtx(t);return ge(n,{code:se.invalid_type,expected:ke.nan,received:n.parsedType}),Be}return{status:"valid",value:t.data}}};tA.create=e=>new tA({typeName:Le.ZodNaN,...We(e)});let O_=class extends Je{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},R_=class qx extends Je{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Be:i.status==="dirty"?(n.dirty(),Zh(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Be:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new qx({in:t,out:n,typeName:Le.ZodPipeline})}},dp=class extends Je{_parse(t){const n=this._def.innerType._parse(t),r=i=>(vo(i)&&(i.value=Object.freeze(i.value)),i);return Sc(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}};dp.create=(e,t)=>new dp({innerType:e,typeName:Le.ZodReadonly,...We(t)});var Le;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Le||(Le={}));const Ve=li.create,sr=Xh.create,kr=np.create,L_=rp.create;Wi.create;const ul=Gr.create,dr=fi.create;_c.create;Nc.create;Ga.create;const xa=M_.create,j_=ap.create,Co=wo.create;Ic.create;Pi.create;Eo.create;const B_=["heading","text","image","button","divider","spacer","social","video","raw-html","navigation","form","countdown","gif","table","carousel","custom"];dr({label:Ve(),value:Ve(),sample:Ve().optional()});const P_=dr({id:Ve(),type:Co(B_),values:xa(Ve(),L_()),locked:kr().optional(),content_locked:kr().optional(),style_locked:kr().optional(),delete_locked:kr().optional(),move_locked:kr().optional(),hide_desktop:kr().optional(),hide_mobile:kr().optional(),visible_if:Ve().optional(),dark_mode_styles:xa(Ve(),Ve()).optional(),mobile_styles:xa(Ve(),Ve()).optional(),global_block_id:Ve().optional(),position:dr({x:sr(),y:sr(),width:sr(),height:sr(),z:sr().optional()}).optional()}),F_=dr({background_color:Ve().optional(),padding:sr().optional(),border_style:Ve().optional(),border_width:sr().optional(),border_color:Ve().optional()}).default({}),$_=dr({id:Ve(),width:sr().min(0).max(100),blocks:ul(P_),settings:F_}),H_=dr({id:Ve(),columns:ul($_).min(1),settings:dr({background_color:Ve().optional(),content_background_color:Ve().optional(),background_image:Ve().optional(),padding:Ve().optional(),layout_locked:kr().optional(),hide_desktop:kr().optional(),hide_mobile:kr().optional(),role:Co(["header","footer"]).optional(),layout_mode:Co(["stack","free"]).optional(),min_height:sr().optional()}).default({})}),U_=dr({background_color:Ve(),content_width:sr().min(320).max(1200),font_family:Ve(),text_color:Ve().default("#14213d"),content_align:Co(["left","center","right"]).default("center"),font_weight:Co(["400","500","600","700"]).default("400"),subject_line:Ve().default(""),preheader_text:Ve().default(""),link_color:Ve().default("#2563eb"),link_underline:kr().default(!0),html_title:Ve().default(""),custom_css:Ve().optional(),rows:ul(H_)}),Jx={schema_version:j_("2.0"),id:Ve(),title:Ve(),display_mode:Co(["email","web","popup","document"]),counters:xa(Ve(),sr()).default({}),design_tokens:xa(Ve(),Ve()).default({}),global_blocks:ul(dr({id:Ve(),synced_at:Ve()})).default([]),body:U_},G_=dr({id:Ve(),label:Ve(),weight:sr().min(0).max(1).default(.5),design:dr(Jx)}),Zx=dr({...Jx,ab_variants:ul(G_).optional()}),Br="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAyAAAAGQCAIAAADZR5NjAAAF60lEQVR42u3WsQkAAAgEsd9/WLFwAGcQLAOZ4KpL9QAA8CgSAAAYLAAAgwUAYLAAADBYAAAGCwDAYAEAYLAAAAwWAIDBAgDAYAEAGCwAAIMFAGCwAAAwWAAABgsAwGABAGCwAAAMFgCAwQIAwGABABgsAACDBQCAwQIAMFgAAAYLAMBgAQBgsAAADBYAgMECAMBgAQAYLAAAgwUAgMECADBYAAAGCwAAgwUAYLAAAAwWAIDBAgDAYAEAGCwAAIMFAIDBAgAwWAAABgsAAIMFAGCwAAAMFgAABgsAwGABABgsAACDBQCAwQIAMFgAAAYLAACDBQBgsAAADBYAAAYLAMBgAQAYLAAAgwUAgMECADBYAAAGCwAAgwUAYLAAAAwWAAAGCwDAYAEAGCwAAAwWAIDBAgAwWAAABgsAAIMFAGCwAAAMFgAABgsAwGABABgsAAAMFgCAwQIAMFgAABgsAACDBQBgsAAADBYAAAYLAMBgAQAYLAAADBYAgMECADBYAAAYLAAAgwUAYLAAADBYAAAGCwDAYAEAGCwAAAwWAIDBAgAwWAAAGCwAAIMFAGCwAAAwWAAABgsAwGABABgsAAAMFgCAwQIAMFgAABgsAACDBQBgsAAAMFgAAAYLAMBgAQBgsAAADBYAgMECADBYAAAYLAAAgwUAYLAAADBYAAAGCwDAYAEAYLAAAAwWAIDBAgDAYAEAGCwAAIMFAGCwAAAwWAAABgsAwGABAGCwAAAMFgCAwQIAwGABABgsAACDBQCAwQIAMFgAAAYLAMBgAQBgsAAADBYAgMECAMBgAQAYLAAAgwUAgMECADBYAAAGCwDAYKkAAGCwAAAMFgCAwQIAwGABABgsAACDBQCAwQIAMFgAAAYLAACDBQBgsAAADBYAgMECAMBgAQAYLAAAgwUAgMECADBYAAAGCwAAgwUAYLAAAAwWAAAGCwDAYAEAGCwAAIMFAIDBAgAwWAAABgsAAIMFAGCwAAAMFgAABgsAwGABABgsAAAMFgCAwQIAMFgAAAYLAACDBQBgsAAADBYAAAYLAMBgAQAYLAAADBYAgMECADBYAAAGSwUAAIMFAGCwAAAMFgAABgsAwGABABgsAAAMFgCAwQIAMFgAABgsAACDBQBgsAAADBYAAAYLAMBgAQAYLAAADBYAgMECADBYAAAYLAAAgwUAYLAAADBYAAAGCwDAYAEAGCwAAAwWAIDBAgAwWAAAGCwAAIMFAGCwAAAwWAAABgsAwGABAGCwAAAMFgCAwQIAMFgAABgsAACDBQBgsAAAMFgAAAYLAMBgAQBgsAAADBYAgMECADBYEgAAGCwAAIMFAGCwAAAwWAAABgsAwGABAGCwAAAMFgCAwQIAwGABABgsAACDBQBgsAAAMFgAAAYLAMBgAQBgsAAADBYAgMECAMBgAQAYLAAAgwUAgMECADBYAAAGCwDAYAEAYLAAAAwWAIDBAgDAYAEAGCwAAIMFAIDBAgAwWAAABgsAAIMFAGCwAAAMFgCAwQIAwGABABgsAACDBQCAwQIAMFgAAAYLAACDBQBgsAAADBYAAAYLAMBgAQAYLAAAgwUAgMECADBYAAAGCwAAgwUAYLAAAAwWAAAGCwDAYAEAGCwAAIMFAIDBAgAwWAAABgsAAIMFAGCwAAAMFgAABgsAwGABABgsAAAMFgCAwQIAMFgAAAYLAACDBQBgsAAADBYAAAYLAMBgAQAYLAAADBYAgMECADBYAAAYLAAAgwUAYLAAAAwWAAAGCwDAYAEAGCwAAAwWAIDBAgAwWAAAGCwAAIMFAGCwAAAwWAAABgsAwGABABgsAAAMFgCAwQIAMFgAABgsAACDBQBgsAAAMFgAAAYLAMBgAQAYLAAADBYAgMECADBYAAAYLAAAgwUAYLAAADBYAAAGCwDAYAEAYLAAAAwWAIDBAgAwWAAAGCwAAIMFAGCwAAAwWAAABgsAwGABAGCwAAAMFgCAwQIAwGABABgsAACDBQBgsAAAMFgAAAYLAMBgAQBwsYvUMptgUox1AAAAAElFTkSuQmCC",Dc=e=>`${e}-${Math.random().toString(36).slice(2,10)}`,W_=()=>({background_color:"#ffffff",padding:12,border_style:"none",border_width:0,border_color:"#d9dce5"}),ms=[{id:"single",label:"1 Column",description:"Full-width hero or message section.",widths:[100]},{id:"halves",label:"2 Columns",description:"Balanced side-by-side content.",widths:[50,50]},{id:"feature-left",label:"Feature Left",description:"Wide content area with supporting sidebar.",widths:[66,34]},{id:"feature-right",label:"Feature Right",description:"Sidebar first, feature content second.",widths:[34,66]},{id:"triple",label:"3 Columns",description:"Three-up cards or icon groups.",widths:[33.33,33.33,33.34]}],Y_={heading:{text:"Heading",tag:"h1",font_family:"body",font_weight:"400",font_size:22,color:"token.text",align:"left",line_height:140,letter_spacing:0,inherit_link_styles:!0,container_padding:"token.spacing"},text:{html:"<p>Write a compelling message for your audience.</p>",font_family:"body",font_weight:"400",color:"token.text",font_size:16,align:"left",line_height:140,letter_spacing:0,inherit_link_styles:!0,container_padding:"token.spacing"},image:{src:Br,alt:"Campaign visual",href:"",target:"_blank",align:"center",width:100,auto_width:!1,padding:10,border_style:"none",border_width:0,border_color:"#14213d",border_radius:18,text_wrap:"none",crop_aspect:"free",focal_x:50,focal_y:50,brightness:100,contrast:100,saturation:100,grayscale:0,blur:0},button:{label:"Shop now",href:"https://example.com",action_type:"open-website",background_color:"#ef476f",color:"#ffffff",align:"left",target:"_blank",auto_width:!0,width:40,font_size:16,font_weight:"600",font_family:"body",line_height:120,letter_spacing:0,border_radius:999,border_style:"none",border_width:0,border_color:"#ef476f",container_padding:"token.spacing",padding_top:14,padding_right:22,padding_bottom:14,padding_left:22},divider:{color:"#d9dce5",thickness:1,style:"solid",width:100,align:"center",container_padding:"token.spacing",padding_top:8,padding_bottom:8},spacer:{height:24,background_color:"transparent",container_padding:0},social:{items:[{network:"facebook",label:"Facebook",href:"https://facebook.com"},{network:"instagram",label:"Instagram",href:"https://instagram.com"},{network:"linkedin",label:"LinkedIn",href:"https://linkedin.com"}],icon_type:"circle",align:"center",color:"#14213d",icon_color:"#ffffff",icon_size:32,spacing:5,container_padding:"token.spacing",target:"_blank"},video:{title:"Product walkthrough",url:"https://example.com/video",thumbnail:Br,alt:"Video preview",target:"_blank",align:"center",width:100,auto_width:!1,padding:10,crop_aspect:"wide",focal_x:50,focal_y:50,brightness:100,contrast:100,saturation:100,grayscale:0,blur:0},"raw-html":{html:'<table role="presentation" width="100%"><tr><td>Custom HTML block</td></tr></table>',background_color:"#ffffff",padding:0,border_radius:0},navigation:{items:[{label:"Home",href:"https://example.com"},{label:"Products",href:"https://example.com/products"},{label:"Contact",href:"https://example.com/contact"}],align:"center",color:"#14213d",font_size:14,font_weight:"600",spacing:20,container_padding:"token.spacing",target:"_blank"},form:{headline:"Join the waitlist",button_label:"Notify me",button_color:"#14213d",button_text_color:"#ffffff",field_placeholder:"name@example.com",background_color:"#ffffff",border_color:"#d9dce5",padding:18,border_radius:18},countdown:{label:"Offer ends in",end_date:"2026-12-31T23:59:59.000Z",background_color:"#14213d",color:"#ffffff",align:"center",padding:18,border_radius:18},gif:{src:Br,alt:"Animated illustration",href:"",target:"_blank",align:"center",width:100,auto_width:!1,padding:10,border_style:"none",border_width:0,border_color:"#14213d",border_radius:18,text_wrap:"none",crop_aspect:"free",focal_x:50,focal_y:50,brightness:100,contrast:100,saturation:100,grayscale:0,blur:0},carousel:{slides:[{src:Br,alt:"Slide 1",href:"",caption:""},{src:Br,alt:"Slide 2",href:"",caption:""},{src:Br,alt:"Slide 3",href:"",caption:""}],align:"center",width:100,gap:12,border_radius:12,show_caption:!1,target:"_blank",container_padding:"token.spacing"},custom:{_tool:""},table:{rows:[["Feature","Free","Pro"],["Drag-and-drop editor","Yes","Yes"],["Exports & versions","—","Yes"],["AI assist","—","Yes"]],header_row:!0,header_background:"#14213d",header_color:"#ffffff",footer_row:!1,footer_background:"#14213d",footer_color:"#ffffff",border_style:"solid",border_width:1,border_color:"#e6ecea",cell_padding:10,striped:!0,stripe_color:"#f4f8f7",font_family:"body",font_weight:"400",font_size:14,text_color:"#14213d",line_height:140,letter_spacing:0,align:"left",width:100,container_padding:"token.spacing",min_rows:1,max_rows:20,min_columns:1,max_columns:8}},Yt=e=>({id:Dc(e),type:e,values:structuredClone(Y_[e]),...e==="heading"?{hide_desktop:!1,hide_mobile:!1}:{}}),z_=e=>{var t;return((t=ms.find(n=>n.id===e))==null?void 0:t.widths)??[100]},Mt=(e="single",t={})=>{const n=z_(e);return{id:Dc("row"),settings:{background_color:"#fffaf2",content_background_color:"#ffffff",background_image:"",padding:"32px",layout_locked:!1},columns:n.map((r,i)=>{var s;return{id:Dc("column"),width:r,blocks:((s=t.initialBlocks)==null?void 0:s[i])??[],settings:W_()}})}},hl=()=>({schema_version:"2.0",id:Dc("design"),title:"Untitled design",display_mode:"email",counters:{},design_tokens:{primary:"#14213d",accent:"#ef476f",background:"#f5f1ea",text:"#1f2937",radius:"18px",spacing:"24px"},global_blocks:[],body:{background_color:"#f5f1ea",content_width:680,font_family:'"Inter Tight", "Avenir Next", sans-serif',text_color:"#14213d",content_align:"center",font_weight:"400",subject_line:"",preheader_text:"",link_color:"#2563eb",link_underline:!0,html_title:"",rows:[]}}),Hs=(e,t,n="#f5f1ea")=>{const r=hl();return{...r,title:e,body:{...r.body,background_color:n,rows:t}}},Us=(e,t="#ef476f")=>({...e,design_tokens:{...e.design_tokens,accent:t}}),Gs=e=>{const t=Yt("heading");return t.values.text=e,t.values.tag="h1",t.values.font_size=30,t.values.font_weight="700",t.values.align="left",t.values.container_padding=4,t},zr=e=>{const t=Yt("text");return t.values.html=e,t.values.container_padding=4,t},Gd=(e,t)=>{const n=Yt("image");return n.values.src=e,n.values.alt=t,n.values.padding=0,n},Po=(e,t,n="#ef476f")=>{const r=Yt("button");return r.values.label=e,r.values.href=t,r.values.background_color=n,r.values.align="left",r.values.auto_width=!0,r},wm=()=>{const e=Yt("social");return e.values.align="center",e},K_=()=>{const e=Yt("divider");return e.values.container_padding=2,e},Q_=e=>{const t=Yt("countdown");return t.values.label=e,t},V_=(e,t)=>{const n=Yt("video");return n.values.title=e,n.values.url=t,n},q_=(e,t)=>{const n=Yt("raw-html");return n.values.html=`<table role="presentation" width="100%"><tr><td style="padding:16px;border:1px solid #d9dce5;border-radius:14px;"><strong>${e}</strong><div style="margin-top:8px;color:#5c677d;">${t}</div></td></tr></table>`,n},J_=()=>{const e=Yt("navigation");return e.values.align="center",e},Z_=(e,t)=>{const n=Yt("form");return n.values.headline=e,n.values.button_label=t,n},nA=e=>{const t=Gs(e.heroTitle),n=zr(`<p>${e.heroBody}</p>`),r=Po(e.ctaLabel??"Read more",e.ctaHref??"https://example.com",e.accent),i=Gd(e.image??Br,e.imageAlt??e.name),s=zr("<p>Use this editorial layout for announcements, weekly digests, founder letters, or category highlights.</p>");return Us(Hs(e.name,[Mt("single",{initialBlocks:[[t,n,r]]}),Mt("halves",{initialBlocks:[[i],[s]]}),Mt("single",{initialBlocks:[[wm()]]})],e.background_color),e.accent)},X_=e=>{const t=Gs(e.heroTitle),n=zr(`<p>${e.heroBody}</p>`),r=Q_("Offer ends in"),i=Yt("gif");i.values.align="center";const s=Po(e.ctaLabel??"Shop now",e.ctaHref??"https://example.com",e.accent);return s.values.align="justify",Us(Hs(e.name,[Mt("single",{initialBlocks:[[t,n]]}),Mt("halves",{initialBlocks:[[r],[i]]}),Mt("single",{initialBlocks:[[s]]})],e.background_color??"#fff7ed"),e.accent??"#f97316")},eN=e=>{const t=Gs(e.heroTitle),n=zr(`<p>${e.heroBody}</p>`),r=q_("Details","Reference {{order_id}}<br />Status updates and account information appear here."),i=Po(e.ctaLabel??"View details",e.ctaHref??"https://example.com",e.accent??"#2563eb");return Us(Hs(e.name,[Mt("single",{initialBlocks:[[t,n,K_(),r,i]]})],e.background_color??"#f8fafc"),e.accent??"#2563eb")},tN=e=>{const t=Gs(e.heroTitle),n=zr(`<p>${e.heroBody}</p>`),r=V_(e.name,e.ctaHref??"https://example.com/register"),i=Po(e.ctaLabel??"Reserve your seat",e.ctaHref??"https://example.com/register",e.accent??"#7c3aed");return i.values.align="justify",Us(Hs(e.name,[Mt("single",{initialBlocks:[[t,n]]}),Mt("single",{initialBlocks:[[r,i]]})],e.background_color??"#faf5ff"),e.accent??"#7c3aed")},nN=e=>{const t=Gs(e.heroTitle),n=zr(`<p>${e.heroBody}</p>`),r=Z_("Join the update list",e.ctaLabel??"Keep me posted"),i=Gd(e.image??Br,e.imageAlt??e.name);return Us(Hs(e.name,[Mt("single",{initialBlocks:[[t,n]]}),Mt("halves",{initialBlocks:[[i],[r]]}),Mt("single",{initialBlocks:[[wm()]]})],e.background_color??"#f0fdf4"),e.accent??"#16a34a")},rN=e=>{const t=Gs(e.heroTitle),n=zr(`<p>${e.heroBody}</p>`),r=Gd(e.image??Br,e.imageAlt??e.name),i=Po(e.ctaLabel??"Shop collection",e.ctaHref??"https://example.com/shop",e.accent??"#db2777"),s=zr("<p>Highlight your collection with an image-led spotlight and a simple path to conversion.</p>");return Us(Hs(e.name,[Mt("single",{initialBlocks:[[t,n]]}),Mt("feature-right",{initialBlocks:[[s,i],[r]]}),Mt("single",{initialBlocks:[[wm()]]})],e.background_color??"#fff1f2"),e.accent??"#db2777")},iN=e=>{const t=Gs(e.heroTitle),n=zr(`<p>${e.heroBody}</p>`),r=J_(),i=Gd(e.image??Br,e.imageAlt??e.name),s=Po(e.ctaLabel??"Explore update",e.ctaHref??"https://example.com/product",e.accent??"#2563eb");return Us(Hs(e.name,[Mt("single",{initialBlocks:[[r]]}),Mt("single",{initialBlocks:[[t,n]]}),Mt("halves",{initialBlocks:[[i],[zr("<p>Share releases, onboarding flows, and lifecycle moments with a clean SaaS layout.</p>"),s]]})],e.background_color??"#eff6ff"),e.accent??"#2563eb")},sN=[{id:"newsletter-digest",name:"Newsletter Digest",category:"Editorial",description:"Weekly editorial digest with a hero message, feature image, and social footer.",heroTitle:"Weekly Dispatch",heroBody:"Bring your audience behind the scenes with one polished email every Friday.",ctaLabel:"Read the full story",ctaHref:"https://example.com/newsletter",pattern:"editorial"},{id:"founder-letter",name:"Founder Letter",category:"Editorial",description:"Personal note format for launches, milestones, and company updates.",heroTitle:"A note from the founder",heroBody:"Share milestones, roadmap context, and thoughtful updates in a more personal layout.",ctaLabel:"Read the letter",ctaHref:"https://example.com/founder",pattern:"editorial",accent:"#0f766e"},{id:"community-roundup",name:"Community Roundup",category:"Editorial",description:"Monthly digest for community wins, highlights, and top conversations.",heroTitle:"This month in the community",heroBody:"Pull together the best stories, updates, and member highlights from the past month.",ctaLabel:"See all highlights",ctaHref:"https://example.com/community",pattern:"editorial",accent:"#7c3aed"},{id:"flash-sale",name:"Flash Sale",category:"Promo",description:"Urgency-led promo with countdown, motion, and a direct CTA.",heroTitle:"Flash Sale Starts Now",heroBody:"Launch a limited-time campaign with a clear deadline and one bold call to action.",ctaLabel:"Shop the sale",ctaHref:"https://example.com/sale",pattern:"promo",accent:"#f97316"},{id:"seasonal-launch",name:"Seasonal Launch",category:"Promo",description:"Seasonal collection launch with a simple promo-focused structure.",heroTitle:"The seasonal collection is here",heroBody:"Showcase a timely drop with motion, urgency, and a direct path to browse.",ctaLabel:"Explore the collection",ctaHref:"https://example.com/seasonal",pattern:"promo",accent:"#ea580c"},{id:"membership-upgrade",name:"Membership Upgrade",category:"Promo",description:"Conversion-focused upgrade email with strong urgency and clear next step.",heroTitle:"Upgrade your membership",heroBody:"Encourage existing customers to unlock more benefits with a stronger plan.",ctaLabel:"Upgrade now",ctaHref:"https://example.com/upgrade",pattern:"promo",accent:"#8b5cf6"},{id:"order-confirmation",name:"Order Confirmation",category:"Transactional",description:"Receipt-style email with order details and a follow-up CTA.",heroTitle:"Order Confirmed",heroBody:"Your order {{order_id}} is being packed and prepared for dispatch.",ctaLabel:"Track your package",ctaHref:"https://example.com/track",pattern:"transactional",accent:"#2563eb"},{id:"shipping-update",name:"Shipping Update",category:"Transactional",description:"Shipment update template with status summary and track action.",heroTitle:"Your shipment is on the way",heroBody:"Keep customers informed with delivery status, timing, and next steps.",ctaLabel:"View delivery status",ctaHref:"https://example.com/shipping",pattern:"transactional",accent:"#0f766e"},{id:"password-reset",name:"Password Reset",category:"Transactional",description:"Simple security email with direct next action.",heroTitle:"Reset your password",heroBody:"Use this secure email template to help customers recover account access.",ctaLabel:"Reset password",ctaHref:"https://example.com/reset",pattern:"transactional",accent:"#1d4ed8"},{id:"invoice-notice",name:"Invoice Notice",category:"Transactional",description:"Billing email with invoice summary and payment action.",heroTitle:"Your invoice is ready",heroBody:"Share invoice details, due dates, and billing links in a clean transactional layout.",ctaLabel:"View invoice",ctaHref:"https://example.com/invoice",pattern:"transactional",accent:"#475569"},{id:"renewal-reminder",name:"Renewal Reminder",category:"Transactional",description:"Subscription renewal reminder with a clear account CTA.",heroTitle:"Your plan renews soon",heroBody:"Keep renewals simple with clear plan timing and account management options.",ctaLabel:"Manage subscription",ctaHref:"https://example.com/renewal",pattern:"transactional",accent:"#2563eb"},{id:"webinar-invite",name:"Webinar Invite",category:"Events",description:"Webinar announcement with video teaser and full-width registration CTA.",heroTitle:"Live Product Webinar",heroBody:"Join our team for a short walkthrough and live Q&A session.",ctaLabel:"Reserve your seat",ctaHref:"https://example.com/register",pattern:"event",accent:"#7c3aed"},{id:"event-reminder",name:"Event Reminder",category:"Events",description:"Reminder template for online or in-person events.",heroTitle:"You're invited tomorrow",heroBody:"Keep attendance high with a concise reminder and a strong register or join action.",ctaLabel:"Add to calendar",ctaHref:"https://example.com/reminder",pattern:"event",accent:"#0f766e"},{id:"conference-recap",name:"Conference Recap",category:"Events",description:"Post-event recap with highlights and follow-up CTA.",heroTitle:"Highlights from the summit",heroBody:"Wrap an event with top takeaways, recordings, and the next action for attendees.",ctaLabel:"Watch the replay",ctaHref:"https://example.com/replay",pattern:"event",accent:"#d97706"},{id:"waitlist-invite",name:"Waitlist Invite",category:"Community",description:"Simple list-building template for new launches and private betas.",heroTitle:"Join the waitlist",heroBody:"Collect interest before launch with a clean signup-driven layout.",ctaLabel:"Join the list",ctaHref:"https://example.com/waitlist",pattern:"community",accent:"#16a34a"},{id:"nonprofit-appeal",name:"Nonprofit Appeal",category:"Community",description:"Donation appeal with clear story, image, and signup/support action.",heroTitle:"Support this month's mission",heroBody:"Tell the story behind your campaign and turn interest into meaningful support.",ctaLabel:"Support now",ctaHref:"https://example.com/donate",pattern:"community",accent:"#dc2626"},{id:"volunteer-recruitment",name:"Volunteer Recruitment",category:"Community",description:"Recruitment email for community programs and events.",heroTitle:"Volunteer with us",heroBody:"Invite your audience to get involved with a clear commitment path and follow-up list.",ctaLabel:"Sign up",ctaHref:"https://example.com/volunteer",pattern:"community",accent:"#0f766e"},{id:"product-spotlight",name:"Product Spotlight",category:"Ecommerce",description:"Image-led campaign to feature a hero product or collection.",heroTitle:"Meet the new collection",heroBody:"Highlight a new product line with a standout visual and direct CTA.",ctaLabel:"Shop now",ctaHref:"https://example.com/shop",pattern:"commerce",accent:"#db2777"},{id:"cart-abandonment",name:"Cart Abandonment",category:"Ecommerce",description:"Recovery email with a focused reminder and return-to-cart action.",heroTitle:"You left something behind",heroBody:"Recover lost conversions with a concise reminder and a strong return path.",ctaLabel:"Return to cart",ctaHref:"https://example.com/cart",pattern:"commerce",accent:"#be123c"},{id:"back-in-stock",name:"Back in Stock",category:"Ecommerce",description:"Inventory alert template with a quick action to buy before it sells out again.",heroTitle:"Back in stock",heroBody:"Notify shoppers the moment an in-demand item is available again.",ctaLabel:"Shop before it sells out",ctaHref:"https://example.com/restock",pattern:"commerce",accent:"#ea580c"},{id:"upsell-cross-sell",name:"Upsell Cross-Sell",category:"Ecommerce",description:"Post-purchase or bundle campaign with merchandising support.",heroTitle:"Complete the setup",heroBody:"Recommend the right add-ons after purchase with an easy conversion path.",ctaLabel:"See recommendations",ctaHref:"https://example.com/recommendations",pattern:"commerce",accent:"#7c3aed"},{id:"welcome-series",name:"Welcome Series",category:"SaaS",description:"Clean onboarding template for the first welcome message.",heroTitle:"Welcome aboard",heroBody:"Introduce your product, your value, and the first step users should take next.",ctaLabel:"Get started",ctaHref:"https://example.com/get-started",pattern:"saas",accent:"#2563eb"},{id:"feature-release",name:"Feature Release",category:"SaaS",description:"Release email for new features, updates, and launch notes.",heroTitle:"A new feature is live",heroBody:"Show what changed, who it helps, and where to explore it in product.",ctaLabel:"Explore the update",ctaHref:"https://example.com/release",pattern:"saas",accent:"#0f766e"},{id:"trial-conversion",name:"Trial Conversion",category:"SaaS",description:"Conversion-focused lifecycle email for expiring trials.",heroTitle:"Your trial ends soon",heroBody:"Turn active evaluators into paying customers with a clear value reminder.",ctaLabel:"Choose a plan",ctaHref:"https://example.com/pricing",pattern:"saas",accent:"#4f46e5"},{id:"customer-feedback",name:"Customer Feedback",category:"SaaS",description:"Feedback collection template for product teams and success teams.",heroTitle:"We'd love your feedback",heroBody:"Ask for product feedback in a clean, trust-building format with one simple action.",ctaLabel:"Share feedback",ctaHref:"https://example.com/feedback",pattern:"saas",accent:"#2563eb"},{id:"app-announcement",name:"App Announcement",category:"SaaS",description:"Product announcement layout with supporting screenshot and CTA.",heroTitle:"A fresh update to the app",heroBody:"Announce interface changes, improvements, and new ways to work faster.",ctaLabel:"See what's new",ctaHref:"https://example.com/whats-new",pattern:"saas",accent:"#0284c7"},{id:"restaurant-opening",name:"Restaurant Opening",category:"Hospitality",description:"Venue opening campaign with warm visual storytelling and booking CTA.",heroTitle:"We're opening our doors",heroBody:"Create excitement for a new opening, menu launch, or special chef event.",ctaLabel:"Book a table",ctaHref:"https://example.com/book",pattern:"commerce",accent:"#b45309",background_color:"#fff7ed"},{id:"hotel-offer",name:"Hotel Offer",category:"Hospitality",description:"Seasonal hotel or staycation offer with a direct booking CTA.",heroTitle:"Escape for the weekend",heroBody:"Promote a limited-time stay offer with a premium hospitality feel.",ctaLabel:"Book your stay",ctaHref:"https://example.com/stay",pattern:"commerce",accent:"#0f766e",background_color:"#ecfeff"},{id:"travel-guide",name:"Travel Guide",category:"Hospitality",description:"Destination guide email with editorial storytelling and curated recommendations.",heroTitle:"Your city guide is ready",heroBody:"Share a local guide, itinerary, or handpicked travel recommendations.",ctaLabel:"Read the guide",ctaHref:"https://example.com/guide",pattern:"editorial",accent:"#0891b2",background_color:"#f0fdfa"},{id:"referral-program",name:"Referral Program",category:"Lifecycle",description:"Referral launch email that explains the reward and makes sharing easy.",heroTitle:"Invite a friend, earn rewards",heroBody:"Launch a referral offer with a simple value prop and one clear next step.",ctaLabel:"Start referring",ctaHref:"https://example.com/referral",pattern:"promo",accent:"#2563eb",background_color:"#eff6ff"},{id:"creator-drop",name:"Creator Drop",category:"Creator",description:"Creator-style drop announcement with strong urgency and motion.",heroTitle:"The new drop is live",heroBody:"Announce a limited release with a strong visual, timer, and direct purchase path.",ctaLabel:"Get the drop",ctaHref:"https://example.com/drop",pattern:"promo",accent:"#e11d48",background_color:"#fff1f2"},{id:"course-enrollment",name:"Course Enrollment",category:"Education",description:"Course or cohort launch email with a clear join action.",heroTitle:"Enrollment is open",heroBody:"Promote a course, cohort, or masterclass with a simple educational funnel.",ctaLabel:"Enroll now",ctaHref:"https://example.com/course",pattern:"event",accent:"#7c3aed",background_color:"#faf5ff"},{id:"real-estate-listing",name:"Real Estate Listing",category:"Real Estate",description:"Property spotlight layout for listings, open houses, and neighborhood features.",heroTitle:"A new listing just hit the market",heroBody:"Showcase a property with strong visuals, key details, and an inquiry CTA.",ctaLabel:"Schedule a tour",ctaHref:"https://example.com/listing",pattern:"commerce",accent:"#0f766e",background_color:"#f8fafc"}],oN=e=>{switch(e.pattern){case"editorial":return nA(e);case"promo":return X_(e);case"transactional":return eN(e);case"event":return tN(e);case"community":return nN(e);case"commerce":return rN(e);case"saas":return iN(e);default:return nA(e)}},aN=sN.map(e=>({id:e.id,name:e.name,category:e.category,description:e.description,design:oN(e)}));function Xx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function lN(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var rA={exports:{}},at;(function(e){e.Root="root",e.Text="text",e.Directive="directive",e.Comment="comment",e.Script="script",e.Style="style",e.Tag="tag",e.CDATA="cdata",e.Doctype="doctype"})(at||(at={}));function cN(e){return e.type===at.Tag||e.type===at.Script||e.type===at.Style}const dN=at.Root,uN=at.Text,hN=at.Directive,pN=at.Comment,mN=at.Script,fN=at.Style,gN=at.Tag,AN=at.CDATA,bN=at.Doctype;class ev{constructor(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}get parentNode(){return this.parent}set parentNode(t){this.parent=t}get previousSibling(){return this.prev}set previousSibling(t){this.prev=t}get nextSibling(){return this.next}set nextSibling(t){this.next=t}cloneNode(t=!1){return Ya(this,t)}}let km=class extends ev{constructor(t){super(),this.data=t}get nodeValue(){return this.data}set nodeValue(t){this.data=t}},Wa=class extends km{constructor(){super(...arguments),this.type=at.Text}get nodeType(){return 3}},Em=class extends km{constructor(){super(...arguments),this.type=at.Comment}get nodeType(){return 8}},Cm=class extends km{constructor(t,n){super(n),this.name=t,this.type=at.Directive}get nodeType(){return 1}};class Tm extends ev{constructor(t){super(),this.children=t}get firstChild(){var t;return(t=this.children[0])!==null&&t!==void 0?t:null}get lastChild(){return this.children.length>0?this.children[this.children.length-1]:null}get childNodes(){return this.children}set childNodes(t){this.children=t}}class tv extends Tm{constructor(){super(...arguments),this.type=at.CDATA}get nodeType(){return 4}}let Ls=class extends Tm{constructor(){super(...arguments),this.type=at.Root}get nodeType(){return 9}},Sm=class extends Tm{constructor(t,n,r=[],i=t==="script"?at.Script:t==="style"?at.Style:at.Tag){super(r),this.name=t,this.attribs=n,this.type=i}get nodeType(){return 1}get tagName(){return this.name}set tagName(t){this.name=t}get attributes(){return Object.keys(this.attribs).map(t=>{var n,r;return{name:t,value:this.attribs[t],namespace:(n=this["x-attribsNamespace"])===null||n===void 0?void 0:n[t],prefix:(r=this["x-attribsPrefix"])===null||r===void 0?void 0:r[t]}})}};function Re(e){return cN(e)}function Wd(e){return e.type===at.CDATA}function Wr(e){return e.type===at.Text}function Yd(e){return e.type===at.Comment}function up(e){return e.type===at.Directive}function Qi(e){return e.type===at.Root}function Ht(e){return Object.prototype.hasOwnProperty.call(e,"children")}function Ya(e,t=!1){let n;if(Wr(e))n=new Wa(e.data);else if(Yd(e))n=new Em(e.data);else if(Re(e)){const r=t?Hu(e.children):[],i=new Sm(e.name,{...e.attribs},r);r.forEach(s=>s.parent=i),e.namespace!=null&&(i.namespace=e.namespace),e["x-attribsNamespace"]&&(i["x-attribsNamespace"]={...e["x-attribsNamespace"]}),e["x-attribsPrefix"]&&(i["x-attribsPrefix"]={...e["x-attribsPrefix"]}),n=i}else if(Wd(e)){const r=t?Hu(e.children):[],i=new tv(r);r.forEach(s=>s.parent=i),n=i}else if(Qi(e)){const r=t?Hu(e.children):[],i=new Ls(r);r.forEach(s=>s.parent=i),e["x-mode"]&&(i["x-mode"]=e["x-mode"]),n=i}else if(up(e)){const r=new Cm(e.name,e.data);e["x-name"]!=null&&(r["x-name"]=e["x-name"],r["x-publicId"]=e["x-publicId"],r["x-systemId"]=e["x-systemId"]),n=r}else throw new Error(`Not implemented yet: ${e.type}`);return n.startIndex=e.startIndex,n.endIndex=e.endIndex,e.sourceCodeLocation!=null&&(n.sourceCodeLocation=e.sourceCodeLocation),n}function Hu(e){const t=e.map(n=>Ya(n,!0));for(let n=1;n<t.length;n++)t[n].prev=t[n-1],t[n-1].next=t[n];return t}const iA={withStartIndices:!1,withEndIndices:!1,xmlMode:!1};class yN{constructor(t,n,r){this.dom=[],this.root=new Ls(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof n=="function"&&(r=n,n=iA),typeof t=="object"&&(n=t,t=void 0),this.callback=t??null,this.options=n??iA,this.elementCB=r??null}onparserinit(t){this.parser=t}onreset(){this.dom=[],this.root=new Ls(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null}onend(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))}onerror(t){this.handleCallback(t)}onclosetag(){this.lastNode=null;const t=this.tagStack.pop();this.options.withEndIndices&&(t.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(t)}onopentag(t,n){const r=this.options.xmlMode?at.Tag:void 0,i=new Sm(t,n,void 0,r);this.addNode(i),this.tagStack.push(i)}ontext(t){const{lastNode:n}=this;if(n&&n.type===at.Text)n.data+=t,this.options.withEndIndices&&(n.endIndex=this.parser.endIndex);else{const r=new Wa(t);this.addNode(r),this.lastNode=r}}oncomment(t){if(this.lastNode&&this.lastNode.type===at.Comment){this.lastNode.data+=t;return}const n=new Em(t);this.addNode(n),this.lastNode=n}oncommentend(){this.lastNode=null}oncdatastart(){const t=new Wa(""),n=new tv([t]);this.addNode(n),t.parent=n,this.lastNode=t}oncdataend(){this.lastNode=null}onprocessinginstruction(t,n){const r=new Cm(t,n);this.addNode(r)}handleCallback(t){if(typeof this.callback=="function")this.callback(t,this.dom);else if(t)throw t}addNode(t){const n=this.tagStack[this.tagStack.length-1],r=n.children[n.children.length-1];this.options.withStartIndices&&(t.startIndex=this.parser.startIndex),this.options.withEndIndices&&(t.endIndex=this.parser.endIndex),n.children.push(t),r&&(t.prev=r,r.next=t),t.parent=n,this.lastNode=null}}const nv=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),rv=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0)));var Uu;const xN=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),hp=(Uu=String.fromCodePoint)!==null&&Uu!==void 0?Uu:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function vN(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=xN.get(e))!==null&&t!==void 0?t:e}var tn;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(tn||(tn={}));const wN=32;var Oi;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Oi||(Oi={}));function pp(e){return e>=tn.ZERO&&e<=tn.NINE}function kN(e){return e>=tn.UPPER_A&&e<=tn.UPPER_F||e>=tn.LOWER_A&&e<=tn.LOWER_F}function EN(e){return e>=tn.UPPER_A&&e<=tn.UPPER_Z||e>=tn.LOWER_A&&e<=tn.LOWER_Z||pp(e)}function CN(e){return e===tn.EQUALS||EN(e)}var Zt;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Zt||(Zt={}));var $r;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})($r||($r={}));let iv=class{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=Zt.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=$r.Strict}startEntity(t){this.decodeMode=t,this.state=Zt.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Zt.EntityStart:return t.charCodeAt(n)===tn.NUM?(this.state=Zt.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Zt.NamedEntity,this.stateNamedEntity(t,n));case Zt.NumericStart:return this.stateNumericStart(t,n);case Zt.NumericDecimal:return this.stateNumericDecimal(t,n);case Zt.NumericHex:return this.stateNumericHex(t,n);case Zt.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|wN)===tn.LOWER_X?(this.state=Zt.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Zt.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,i){if(n!==r){const s=r-n;this.result=this.result*Math.pow(i,s)+parseInt(t.substr(n,s),i),this.consumed+=s}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(pp(i)||kN(i))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(pp(i))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(i,2)}return this.addToNumericResult(t,r,n,10),-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===tn.SEMI)this.consumed+=1;else if(this.decodeMode===$r.Strict)return 0;return this.emitCodePoint(vN(this.result),this.consumed),this.errors&&(t!==tn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let i=r[this.treeIndex],s=(i&Oi.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const o=t.charCodeAt(n);if(this.treeIndex=TN(r,i,this.treeIndex+Math.max(1,s),o),this.treeIndex<0)return this.result===0||this.decodeMode===$r.Attribute&&(s===0||CN(o))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],s=(i&Oi.VALUE_LENGTH)>>14,s!==0){if(o===tn.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==$r.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,i=(r[n]&Oi.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[t]&~Oi.VALUE_LENGTH:i[t+1],r),n===3&&this.emitCodePoint(i[t+2],r),r}end(){var t;switch(this.state){case Zt.NamedEntity:return this.result!==0&&(this.decodeMode!==$r.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Zt.NumericDecimal:return this.emitNumericEntity(0,2);case Zt.NumericHex:return this.emitNumericEntity(0,3);case Zt.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Zt.EntityStart:return 0}}};function sv(e){let t="";const n=new iv(e,r=>t+=hp(r));return function(r,i){let s=0,o=0;for(;(o=r.indexOf("&",o))>=0;){t+=r.slice(s,o),n.startEntity(i);const l=n.write(r,o+1);if(l<0){s=o+n.end();break}s=o+l,o=l===0?s+1:s}const a=t+r.slice(s);return t="",a}}function TN(e,t,n,r){const i=(t&Oi.BRANCH_LENGTH)>>7,s=t&Oi.JUMP_TABLE;if(i===0)return s!==0&&r===s?n:-1;if(s){const l=r-s;return l<0||l>=i?-1:e[n+l]-1}let o=n,a=o+i-1;for(;o<=a;){const l=o+a>>>1,d=e[l];if(d<r)o=l+1;else if(d>r)a=l-1;else return e[l+i]}return-1}sv(nv);sv(rv);const sA=/["&'<>$\x80-\uFFFF]/g,SN=new Map([[34,"""],[38,"&"],[39,"'"],[60,"<"],[62,">"]]),_N=String.prototype.codePointAt!=null?(e,t)=>e.codePointAt(t):((e,t)=>(e.charCodeAt(t)&64512)===55296?(e.charCodeAt(t)-55296)*1024+e.charCodeAt(t+1)-56320+65536:e.charCodeAt(t));function ov(e){let t="",n=0,r;for(;(r=sA.exec(e))!==null;){const i=r.index,s=e.charCodeAt(i),o=SN.get(s);o!==void 0?(t+=e.substring(n,i)+o,n=i+1):(t+=`${e.substring(n,i)}&#x${_N(e,i).toString(16)};`,n=sA.lastIndex+=+((s&64512)===55296))}return t+e.substr(n)}function av(e,t){return function(n){let r,i=0,s="";for(;r=e.exec(n);)i!==r.index&&(s+=n.substring(i,r.index)),s+=t.get(r[0].charCodeAt(0)),i=r.index+1;return s+n.substring(i)}}const NN=av(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])),IN=av(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]])),DN=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),MN=new Map(["definitionURL","attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),ON=new Set(["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"]);function RN(e){return e.replace(/"/g,""")}function LN(e,t){var n;if(!e)return;const r=((n=t.encodeEntities)!==null&&n!==void 0?n:t.decodeEntities)===!1?RN:t.xmlMode||t.encodeEntities!=="utf8"?ov:NN;return Object.keys(e).map(i=>{var s,o;const a=(s=e[i])!==null&&s!==void 0?s:"";return t.xmlMode==="foreign"&&(i=(o=MN.get(i))!==null&&o!==void 0?o:i),!t.emptyAttrs&&!t.xmlMode&&a===""?i:`${i}="${r(a)}"`}).join(" ")}const oA=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]);function zd(e,t={}){const n="length"in e?e:[e];let r="";for(let i=0;i<n.length;i++)r+=jN(n[i],t);return r}function jN(e,t){switch(e.type){case dN:return zd(e.children,t);case bN:case hN:return $N(e);case pN:return GN(e);case AN:return UN(e);case mN:case fN:case gN:return FN(e,t);case uN:return HN(e,t)}}const BN=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"]),PN=new Set(["svg","math"]);function FN(e,t){var n;t.xmlMode==="foreign"&&(e.name=(n=DN.get(e.name))!==null&&n!==void 0?n:e.name,e.parent&&BN.has(e.parent.name)&&(t={...t,xmlMode:!1})),!t.xmlMode&&PN.has(e.name)&&(t={...t,xmlMode:"foreign"});let r=`<${e.name}`;const i=LN(e.attribs,t);return i&&(r+=` ${i}`),e.children.length===0&&(t.xmlMode?t.selfClosingTags!==!1:t.selfClosingTags&&oA.has(e.name))?(t.xmlMode||(r+=" "),r+="/>"):(r+=">",e.children.length>0&&(r+=zd(e.children,t)),(t.xmlMode||!oA.has(e.name))&&(r+=`</${e.name}>`)),r}function $N(e){return`<${e.data}>`}function HN(e,t){var n;let r=e.data||"";return((n=t.encodeEntities)!==null&&n!==void 0?n:t.decodeEntities)!==!1&&!(!t.xmlMode&&e.parent&&ON.has(e.parent.name))&&(r=t.xmlMode||t.encodeEntities!=="utf8"?ov(r):IN(r)),r}function UN(e){return`<![CDATA[${e.children[0].data}]]>`}function GN(e){return`<!--${e.data}-->`}function lv(e,t){return zd(e,t)}function WN(e,t){return Ht(e)?e.children.map(n=>lv(n,t)).join(""):""}function dc(e){return Array.isArray(e)?e.map(dc).join(""):Re(e)?e.name==="br"?`
|
|
6
|
+
`:dc(e.children):Wd(e)?dc(e.children):Wr(e)?e.data:""}function To(e){return Array.isArray(e)?e.map(To).join(""):Ht(e)&&!Yd(e)?To(e.children):Wr(e)?e.data:""}function Mc(e){return Array.isArray(e)?e.map(Mc).join(""):Ht(e)&&(e.type===at.Tag||Wd(e))?Mc(e.children):Wr(e)?e.data:""}function Kd(e){return Ht(e)?e.children:[]}function cv(e){return e.parent||null}function dv(e){const t=cv(e);if(t!=null)return Kd(t);const n=[e];let{prev:r,next:i}=e;for(;r!=null;)n.unshift(r),{prev:r}=r;for(;i!=null;)n.push(i),{next:i}=i;return n}function YN(e,t){var n;return(n=e.attribs)===null||n===void 0?void 0:n[t]}function zN(e,t){return e.attribs!=null&&Object.prototype.hasOwnProperty.call(e.attribs,t)&&e.attribs[t]!=null}function KN(e){return e.name}function _m(e){let{next:t}=e;for(;t!==null&&!Re(t);)({next:t}=t);return t}function Nm(e){let{prev:t}=e;for(;t!==null&&!Re(t);)({prev:t}=t);return t}function Ws(e){if(e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),e.parent){const t=e.parent.children,n=t.lastIndexOf(e);n>=0&&t.splice(n,1)}e.next=null,e.prev=null,e.parent=null}function QN(e,t){const n=t.prev=e.prev;n&&(n.next=t);const r=t.next=e.next;r&&(r.prev=t);const i=t.parent=e.parent;if(i){const s=i.children;s[s.lastIndexOf(e)]=t,e.parent=null}}function VN(e,t){if(Ws(t),t.next=null,t.parent=e,e.children.push(t)>1){const n=e.children[e.children.length-2];n.next=t,t.prev=n}else t.prev=null}function qN(e,t){Ws(t);const{parent:n}=e,r=e.next;if(t.next=r,t.prev=e,e.next=t,t.parent=n,r){if(r.prev=t,n){const i=n.children;i.splice(i.lastIndexOf(r),0,t)}}else n&&n.children.push(t)}function JN(e,t){if(Ws(t),t.parent=e,t.prev=null,e.children.unshift(t)!==1){const n=e.children[1];n.prev=t,t.next=n}else t.next=null}function ZN(e,t){Ws(t);const{parent:n}=e;if(n){const r=n.children;r.splice(r.indexOf(e),0,t)}e.prev&&(e.prev.next=t),t.parent=n,t.prev=e.prev,t.next=e,e.prev=t}function pl(e,t,n=!0,r=1/0){return Im(e,Array.isArray(t)?t:[t],n,r)}function Im(e,t,n,r){const i=[],s=[Array.isArray(t)?t:[t]],o=[0];for(;;){if(o[0]>=s[0].length){if(o.length===1)return i;s.shift(),o.shift();continue}const a=s[0][o[0]++];if(e(a)&&(i.push(a),--r<=0))return i;n&&Ht(a)&&a.children.length>0&&(o.unshift(0),s.unshift(a.children))}}function XN(e,t){return t.find(e)}function Dm(e,t,n=!0){const r=Array.isArray(t)?t:[t];for(let i=0;i<r.length;i++){const s=r[i];if(Re(s)&&e(s))return s;if(n&&Ht(s)&&s.children.length>0){const o=Dm(e,s.children,!0);if(o)return o}}return null}function uv(e,t){return(Array.isArray(t)?t:[t]).some(n=>Re(n)&&e(n)||Ht(n)&&uv(e,n.children))}function eI(e,t){const n=[],r=[Array.isArray(t)?t:[t]],i=[0];for(;;){if(i[0]>=r[0].length){if(r.length===1)return n;r.shift(),i.shift();continue}const s=r[0][i[0]++];Re(s)&&e(s)&&n.push(s),Ht(s)&&s.children.length>0&&(i.unshift(0),r.unshift(s.children))}}const Oc={tag_name(e){return typeof e=="function"?t=>Re(t)&&e(t.name):e==="*"?Re:t=>Re(t)&&t.name===e},tag_type(e){return typeof e=="function"?t=>e(t.type):t=>t.type===e},tag_contains(e){return typeof e=="function"?t=>Wr(t)&&e(t.data):t=>Wr(t)&&t.data===e}};function Mm(e,t){return typeof t=="function"?n=>Re(n)&&t(n.attribs[e]):n=>Re(n)&&n.attribs[e]===t}function tI(e,t){return n=>e(n)||t(n)}function hv(e){const t=Object.keys(e).map(n=>{const r=e[n];return Object.prototype.hasOwnProperty.call(Oc,n)?Oc[n](r):Mm(n,r)});return t.length===0?null:t.reduce(tI)}function nI(e,t){const n=hv(e);return n?n(t):!0}function rI(e,t,n,r=1/0){const i=hv(e);return i?pl(i,t,n,r):[]}function iI(e,t,n=!0){return Array.isArray(t)||(t=[t]),Dm(Mm("id",e),t,n)}function Fo(e,t,n=!0,r=1/0){return pl(Oc.tag_name(e),t,n,r)}function sI(e,t,n=!0,r=1/0){return pl(Mm("class",e),t,n,r)}function oI(e,t,n=!0,r=1/0){return pl(Oc.tag_type(e),t,n,r)}function aI(e){let t=e.length;for(;--t>=0;){const n=e[t];if(t>0&&e.lastIndexOf(n,t-1)>=0){e.splice(t,1);continue}for(let r=n.parent;r;r=r.parent)if(e.includes(r)){e.splice(t,1);break}}return e}var rr;(function(e){e[e.DISCONNECTED=1]="DISCONNECTED",e[e.PRECEDING=2]="PRECEDING",e[e.FOLLOWING=4]="FOLLOWING",e[e.CONTAINS=8]="CONTAINS",e[e.CONTAINED_BY=16]="CONTAINED_BY"})(rr||(rr={}));function pv(e,t){const n=[],r=[];if(e===t)return 0;let i=Ht(e)?e:e.parent;for(;i;)n.unshift(i),i=i.parent;for(i=Ht(t)?t:t.parent;i;)r.unshift(i),i=i.parent;const s=Math.min(n.length,r.length);let o=0;for(;o<s&&n[o]===r[o];)o++;if(o===0)return rr.DISCONNECTED;const a=n[o-1],l=a.children,d=n[o],u=r[o];return l.indexOf(d)>l.indexOf(u)?a===t?rr.FOLLOWING|rr.CONTAINED_BY:rr.FOLLOWING:a===e?rr.PRECEDING|rr.CONTAINS:rr.PRECEDING}function $o(e){return e=e.filter((t,n,r)=>!r.includes(t,n+1)),e.sort((t,n)=>{const r=pv(t,n);return r&rr.PRECEDING?-1:r&rr.FOLLOWING?1:0}),e}function lI(e){const t=Rc(pI,e);return t?t.name==="feed"?cI(t):dI(t):null}function cI(e){var t;const n=e.children,r={type:"atom",items:Fo("entry",n).map(o=>{var a;const{children:l}=o,d={media:mv(l)};Ln(d,"id","id",l),Ln(d,"title","title",l);const u=(a=Rc("link",l))===null||a===void 0?void 0:a.attribs.href;u&&(d.link=u);const h=Ri("summary",l)||Ri("content",l);h&&(d.description=h);const p=Ri("updated",l);return p&&(d.pubDate=new Date(p)),d})};Ln(r,"id","id",n),Ln(r,"title","title",n);const i=(t=Rc("link",n))===null||t===void 0?void 0:t.attribs.href;i&&(r.link=i),Ln(r,"description","subtitle",n);const s=Ri("updated",n);return s&&(r.updated=new Date(s)),Ln(r,"author","email",n,!0),r}function dI(e){var t,n;const r=(n=(t=Rc("channel",e.children))===null||t===void 0?void 0:t.children)!==null&&n!==void 0?n:[],i={type:e.name.substr(0,3),id:"",items:Fo("item",e.children).map(o=>{const{children:a}=o,l={media:mv(a)};Ln(l,"id","guid",a),Ln(l,"title","title",a),Ln(l,"link","link",a),Ln(l,"description","description",a);const d=Ri("pubDate",a)||Ri("dc:date",a);return d&&(l.pubDate=new Date(d)),l})};Ln(i,"title","title",r),Ln(i,"link","link",r),Ln(i,"description","description",r);const s=Ri("lastBuildDate",r);return s&&(i.updated=new Date(s)),Ln(i,"author","managingEditor",r,!0),i}const uI=["url","type","lang"],hI=["fileSize","bitrate","framerate","samplingrate","channels","duration","height","width"];function mv(e){return Fo("media:content",e).map(t=>{const{attribs:n}=t,r={medium:n.medium,isDefault:!!n.isDefault};for(const i of uI)n[i]&&(r[i]=n[i]);for(const i of hI)n[i]&&(r[i]=parseInt(n[i],10));return n.expression&&(r.expression=n.expression),r})}function Rc(e,t){return Fo(e,t,!0,1)[0]}function Ri(e,t,n=!1){return To(Fo(e,t,n,1)).trim()}function Ln(e,t,n,r,i=!1){const s=Ri(n,r,i);s&&(e[t]=s)}function pI(e){return e==="rss"||e==="feed"||e==="rdf:RDF"}const Qd=Object.freeze(Object.defineProperty({__proto__:null,get DocumentPosition(){return rr},append:qN,appendChild:VN,compareDocumentPosition:pv,existsOne:uv,filter:pl,find:Im,findAll:eI,findOne:Dm,findOneChild:XN,getAttributeValue:YN,getChildren:Kd,getElementById:iI,getElements:rI,getElementsByClassName:sI,getElementsByTagName:Fo,getElementsByTagType:oI,getFeed:lI,getInnerHTML:WN,getName:KN,getOuterHTML:lv,getParent:cv,getSiblings:dv,getText:dc,hasAttrib:zN,hasChildren:Ht,innerText:Mc,isCDATA:Wd,isComment:Yd,isDocument:Qi,isTag:Re,isText:Wr,nextElementSibling:_m,prepend:ZN,prependChild:JN,prevElementSibling:Nm,removeElement:Ws,removeSubsets:aI,replaceElement:QN,testElement:nI,textContent:To,uniqueSort:$o},Symbol.toStringTag,{value:"Module"})),mI={_useHtmlParser2:!1};function mp(e,t){if(!e)return t??mI;const n={_useHtmlParser2:!!e.xmlMode,...t,...e};return e.xml?(n._useHtmlParser2=!0,n.xmlMode=!0,e.xml!==!0&&Object.assign(n,e.xml)):e.xmlMode&&(n._useHtmlParser2=!0),n}function fv(e,t,n){return e?e(t??e._root.children,null,void 0,n).toString():""}function fI(e,t){return typeof e=="object"&&e!=null&&!("length"in e)&&!("type"in e)}function gI(e,t){const n=fI(e)?(t=e,void 0):e,r={...this===null||this===void 0?void 0:this._options,...mp(t)};return fv(this,n,r)}function AI(e){const t={...this._options,xmlMode:!0};return fv(this,e,t)}function za(e){const t=e??(this?this.root():[]);let n="";for(let r=0;r<t.length;r++)n+=To(t[r]);return n}function bI(e,t,n=typeof t=="boolean"?t:!1){if(!e||typeof e!="string")return null;typeof t=="boolean"&&(n=t);const r=this.load(e,this._options,!1);return n||r("script").remove(),[...r.root()[0].children]}function yI(){return this(this._root)}function Om(e,t){if(t===e)return!1;let n=t;for(;n&&n!==n.parent;)if(n=n.parent,n===e)return!0;return!1}function xI(e){return this.root().extract(e)}function gv(e,t){if(!aA(e)||!aA(t))return;let n=e.length;const r=+t.length;for(let i=0;i<r;i++)e[n++]=t[i];return e.length=n,e}function aA(e){if(Array.isArray(e))return!0;if(typeof e!="object"||e===null||!("length"in e)||typeof e.length!="number"||e.length<0)return!1;for(let t=0;t<e.length;t++)if(!(t in e))return!1;return!0}const vI=Object.freeze(Object.defineProperty({__proto__:null,contains:Om,extract:xI,html:gI,merge:gv,parseHTML:bI,root:yI,text:za,xml:AI},Symbol.toStringTag,{value:"Module"}));function ui(e){return e.cheerio!=null}function wI(e){return e.replace(/[._-](\w|$)/g,(t,n)=>n.toUpperCase())}function kI(e){return e.replace(/[A-Z]/g,"-$&").toLowerCase()}function Lt(e,t){const n=e.length;for(let r=0;r<n;r++)t(e[r],r);return e}var fs;(function(e){e[e.LowerA=97]="LowerA",e[e.LowerZ=122]="LowerZ",e[e.UpperA=65]="UpperA",e[e.UpperZ=90]="UpperZ",e[e.Exclamation=33]="Exclamation"})(fs||(fs={}));function fp(e){const t=e.indexOf("<");if(t<0||t>e.length-3)return!1;const n=e.charCodeAt(t+1);return(n>=fs.LowerA&&n<=fs.LowerZ||n>=fs.UpperA&&n<=fs.UpperZ||n===fs.Exclamation)&&e.includes(">",t+2)}const Ka=Object.prototype.hasOwnProperty,Qa=/\s+/,gp="data-",Rm=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,EI=/^{[^]*}$|^\[[^]*]$/;function Lc(e,t,n){var r;if(!(!e||!Re(e))){if((r=e.attribs)!==null&&r!==void 0||(e.attribs={}),!t)return e.attribs;if(Ka.call(e.attribs,t))return!n&&Rm.test(t)?t:e.attribs[t];if(e.name==="option"&&t==="value")return za(e.children);if(e.name==="input"&&(e.attribs.type==="radio"||e.attribs.type==="checkbox")&&t==="value")return"on"}}function bo(e,t,n){n===null?bv(e,t):e.attribs[t]=`${n}`}function CI(e,t){if(typeof e=="object"||t!==void 0){if(typeof t=="function"){if(typeof e!="string")throw new Error("Bad combination of arguments.");return Lt(this,(n,r)=>{Re(n)&&bo(n,e,t.call(n,r,n.attribs[e]))})}return Lt(this,n=>{if(Re(n))if(typeof e=="object")for(const r of Object.keys(e)){const i=e[r];bo(n,r,i)}else bo(n,e,t)})}return arguments.length>1?this:Lc(this[0],e,this.options.xmlMode)}function lA(e,t,n){return t in e?e[t]:!n&&Rm.test(t)?Lc(e,t,!1)!==void 0:Lc(e,t,n)}function Gu(e,t,n,r){t in e?e[t]=n:bo(e,t,!r&&Rm.test(t)?n?"":null:`${n}`)}function TI(e,t){var n;if(typeof e=="string"&&t===void 0){const r=this[0];if(!r||!Re(r))return;switch(e){case"style":{const i=this.css(),s=Object.keys(i);for(let o=0;o<s.length;o++)i[o]=s[o];return i.length=s.length,i}case"tagName":case"nodeName":return r.name.toUpperCase();case"href":case"src":{const i=(n=r.attribs)===null||n===void 0?void 0:n[e];return typeof URL<"u"&&(e==="href"&&(r.tagName==="a"||r.tagName==="link")||e==="src"&&(r.tagName==="img"||r.tagName==="iframe"||r.tagName==="audio"||r.tagName==="video"||r.tagName==="source"))&&i!==void 0&&this.options.baseURI?new URL(i,this.options.baseURI).href:i}case"innerText":return Mc(r);case"textContent":return To(r);case"outerHTML":return this.clone().wrap("<container />").parent().html();case"innerHTML":return this.html();default:return lA(r,e,this.options.xmlMode)}}if(typeof e=="object"||t!==void 0){if(typeof t=="function"){if(typeof e=="object")throw new TypeError("Bad combination of arguments.");return Lt(this,(r,i)=>{Re(r)&&Gu(r,e,t.call(r,i,lA(r,e,this.options.xmlMode)),this.options.xmlMode)})}return Lt(this,r=>{if(Re(r))if(typeof e=="object")for(const i of Object.keys(e)){const s=e[i];Gu(r,i,s,this.options.xmlMode)}else Gu(r,e,t,this.options.xmlMode)})}}function cA(e,t,n){var r;(r=e.data)!==null&&r!==void 0||(e.data={}),typeof t=="object"?Object.assign(e.data,t):typeof t=="string"&&n!==void 0&&(e.data[t]=n)}function SI(e){for(const t of Object.keys(e.attribs)){if(!t.startsWith(gp))continue;const n=wI(t.slice(gp.length));Ka.call(e.data,n)||(e.data[n]=Av(e.attribs[t]))}return e.data}function _I(e,t){const n=gp+kI(t),r=e.data;if(Ka.call(r,t))return r[t];if(Ka.call(e.attribs,n))return r[t]=Av(e.attribs[n])}function Av(e){if(e==="null")return null;if(e==="true")return!0;if(e==="false")return!1;const t=Number(e);if(e===String(t))return t;if(EI.test(e))try{return JSON.parse(e)}catch{}return e}function NI(e,t){var n;const r=this[0];if(!r||!Re(r))return;const i=r;return(n=i.data)!==null&&n!==void 0||(i.data={}),e==null?SI(i):typeof e=="object"||t!==void 0?(Lt(this,s=>{Re(s)&&(typeof e=="object"?cA(s,e):cA(s,e,t))}),this):_I(i,e)}function II(e){const t=arguments.length===0,n=this[0];if(!n||!Re(n))return t?void 0:this;switch(n.name){case"textarea":return this.text(e);case"select":{const r=this.find("option:selected");if(!t){if(this.attr("multiple")==null&&typeof e=="object")return this;this.find("option").removeAttr("selected");const i=typeof e=="object"?e:[e];for(const s of i)this.find(`option[value="${s}"]`).attr("selected","");return this}return this.attr("multiple")?r.toArray().map(i=>za(i.children)):r.attr("value")}case"input":case"option":return t?this.attr("value"):this.attr("value",e)}}function bv(e,t){!e.attribs||!Ka.call(e.attribs,t)||delete e.attribs[t]}function jc(e){return e?e.trim().split(Qa):[]}function DI(e){const t=jc(e);for(const n of t)Lt(this,r=>{Re(r)&&bv(r,n)});return this}function MI(e){return this.toArray().some(t=>{const n=Re(t)&&t.attribs.class;let r=-1;if(n&&e.length>0)for(;(r=n.indexOf(e,r+1))>-1;){const i=r+e.length;if((r===0||Qa.test(n[r-1]))&&(i===n.length||Qa.test(n[i])))return!0}return!1})}function yv(e){if(typeof e=="function")return Lt(this,(r,i)=>{if(Re(r)){const s=r.attribs.class||"";yv.call([r],e.call(r,i,s))}});if(!e||typeof e!="string")return this;const t=e.split(Qa),n=this.length;for(let r=0;r<n;r++){const i=this[r];if(!Re(i))continue;const s=Lc(i,"class",!1);if(s){let o=` ${s} `;for(const a of t){const l=`${a} `;o.includes(` ${l}`)||(o+=l)}bo(i,"class",o.trim())}else bo(i,"class",t.join(" ").trim())}return this}function xv(e){if(typeof e=="function")return Lt(this,(i,s)=>{Re(i)&&xv.call([i],e.call(i,s,i.attribs.class||""))});const t=jc(e),n=t.length,r=arguments.length===0;return Lt(this,i=>{if(Re(i))if(r)i.attribs.class="";else{const s=jc(i.attribs.class);let o=!1;for(let a=0;a<n;a++){const l=s.indexOf(t[a]);l>=0&&(s.splice(l,1),o=!0,a--)}o&&(i.attribs.class=s.join(" "))}})}function vv(e,t){if(typeof e=="function")return Lt(this,(o,a)=>{Re(o)&&vv.call([o],e.call(o,a,o.attribs.class||"",t),t)});if(!e||typeof e!="string")return this;const n=e.split(Qa),r=n.length,i=typeof t=="boolean"?t?1:-1:0,s=this.length;for(let o=0;o<s;o++){const a=this[o];if(!Re(a))continue;const l=jc(a.attribs.class);for(let d=0;d<r;d++){const u=l.indexOf(n[d]);i>=0&&u<0?l.push(n[d]):i<=0&&u>=0&&l.splice(u,1)}a.attribs.class=l.join(" ")}return this}const OI=Object.freeze(Object.defineProperty({__proto__:null,addClass:yv,attr:CI,data:NI,hasClass:MI,prop:TI,removeAttr:DI,removeClass:xv,toggleClass:vv,val:II},Symbol.toStringTag,{value:"Module"}));var Ie;(function(e){e.Attribute="attribute",e.Pseudo="pseudo",e.PseudoElement="pseudo-element",e.Tag="tag",e.Universal="universal",e.Adjacent="adjacent",e.Child="child",e.Descendant="descendant",e.Parent="parent",e.Sibling="sibling",e.ColumnCombinator="column-combinator"})(Ie||(Ie={}));var Vt;(function(e){e.Any="any",e.Element="element",e.End="end",e.Equals="equals",e.Exists="exists",e.Hyphen="hyphen",e.Not="not",e.Start="start"})(Vt||(Vt={}));const dA=/^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,RI=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,LI=new Map([[126,Vt.Element],[94,Vt.Start],[36,Vt.End],[42,Vt.Any],[33,Vt.Not],[124,Vt.Hyphen]]),jI=new Set(["has","not","matches","is","where","host","host-context"]);function va(e){switch(e.type){case Ie.Adjacent:case Ie.Child:case Ie.Descendant:case Ie.Parent:case Ie.Sibling:case Ie.ColumnCombinator:return!0;default:return!1}}const BI=new Set(["contains","icontains"]);function PI(e,t,n){const r=parseInt(t,16)-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,r&1023|56320)}function Ko(e){return e.replace(RI,PI)}function Wu(e){return e===39||e===34}function uA(e){return e===32||e===9||e===10||e===12||e===13}function Vd(e){const t=[],n=wv(t,`${e}`,0);if(n<e.length)throw new Error(`Unmatched selector: ${e.slice(n)}`);return t}function wv(e,t,n){let r=[];function i(p){const m=t.slice(n+p).match(dA);if(!m)throw new Error(`Expected name, found ${t.slice(n)}`);const[g]=m;return n+=p+g.length,Ko(g)}function s(p){for(n+=p;n<t.length&&uA(t.charCodeAt(n));)n++}function o(){n+=1;const p=n;let m=1;for(;m>0&&n<t.length;n++)t.charCodeAt(n)===40&&!a(n)?m++:t.charCodeAt(n)===41&&!a(n)&&m--;if(m)throw new Error("Parenthesis not matched");return Ko(t.slice(p,n-1))}function a(p){let m=0;for(;t.charCodeAt(--p)===92;)m++;return(m&1)===1}function l(){if(r.length>0&&va(r[r.length-1]))throw new Error("Did not expect successive traversals.")}function d(p){if(r.length>0&&r[r.length-1].type===Ie.Descendant){r[r.length-1].type=p;return}l(),r.push({type:p})}function u(p,m){r.push({type:Ie.Attribute,name:p,action:m,value:i(1),namespace:null,ignoreCase:"quirks"})}function h(){if(r.length&&r[r.length-1].type===Ie.Descendant&&r.pop(),r.length===0)throw new Error("Empty sub-selector");e.push(r)}if(s(0),t.length===n)return n;e:for(;n<t.length;){const p=t.charCodeAt(n);switch(p){case 32:case 9:case 10:case 12:case 13:{(r.length===0||r[0].type!==Ie.Descendant)&&(l(),r.push({type:Ie.Descendant})),s(1);break}case 62:{d(Ie.Child),s(1);break}case 60:{d(Ie.Parent),s(1);break}case 126:{d(Ie.Sibling),s(1);break}case 43:{d(Ie.Adjacent),s(1);break}case 46:{u("class",Vt.Element);break}case 35:{u("id",Vt.Equals);break}case 91:{s(1);let m,g=null;t.charCodeAt(n)===124?m=i(1):t.startsWith("*|",n)?(g="*",m=i(2)):(m=i(0),t.charCodeAt(n)===124&&t.charCodeAt(n+1)!==61&&(g=m,m=i(1))),s(0);let b=Vt.Exists;const A=LI.get(t.charCodeAt(n));if(A){if(b=A,t.charCodeAt(n+1)!==61)throw new Error("Expected `=`");s(2)}else t.charCodeAt(n)===61&&(b=Vt.Equals,s(1));let y="",w=null;if(b!=="exists"){if(Wu(t.charCodeAt(n))){const S=t.charCodeAt(n);let k=n+1;for(;k<t.length&&(t.charCodeAt(k)!==S||a(k));)k+=1;if(t.charCodeAt(k)!==S)throw new Error("Attribute value didn't end");y=Ko(t.slice(n+1,k)),n=k+1}else{const S=n;for(;n<t.length&&(!uA(t.charCodeAt(n))&&t.charCodeAt(n)!==93||a(n));)n+=1;y=Ko(t.slice(S,n))}s(0);const E=t.charCodeAt(n)|32;E===115?(w=!1,s(1)):E===105&&(w=!0,s(1))}if(t.charCodeAt(n)!==93)throw new Error("Attribute selector didn't terminate");n+=1;const C={type:Ie.Attribute,name:m,action:b,value:y,namespace:g,ignoreCase:w};r.push(C);break}case 58:{if(t.charCodeAt(n+1)===58){r.push({type:Ie.PseudoElement,name:i(2).toLowerCase(),data:t.charCodeAt(n)===40?o():null});continue}const m=i(1).toLowerCase();let g=null;if(t.charCodeAt(n)===40)if(jI.has(m)){if(Wu(t.charCodeAt(n+1)))throw new Error(`Pseudo-selector ${m} cannot be quoted`);if(g=[],n=wv(g,t,n+1),t.charCodeAt(n)!==41)throw new Error(`Missing closing parenthesis in :${m} (${t})`);n+=1}else{if(g=o(),BI.has(m)){const b=g.charCodeAt(0);b===g.charCodeAt(g.length-1)&&Wu(b)&&(g=g.slice(1,-1))}g=Ko(g)}r.push({type:Ie.Pseudo,name:m,data:g});break}case 44:{h(),r=[],s(1);break}default:{if(t.startsWith("/*",n)){const b=t.indexOf("*/",n+2);if(b<0)throw new Error("Comment was not terminated");n=b+2,r.length===0&&s(0);break}let m=null,g;if(p===42)n+=1,g="*";else if(p===124){if(g="",t.charCodeAt(n+1)===124){d(Ie.ColumnCombinator),s(2);break}}else if(dA.test(t.slice(n)))g=i(0);else break e;t.charCodeAt(n)===124&&t.charCodeAt(n+1)!==124&&(m=g,t.charCodeAt(n+1)===42?(g="*",n+=2):g=i(1)),r.push(g==="*"?{type:Ie.Universal,namespace:m}:{type:Ie.Tag,name:g,namespace:m})}}}return h(),n}var hA,pA;function FI(){return pA||(pA=1,hA={trueFunc:function(){return!0},falseFunc:function(){return!1}}),hA}var Bc=FI();const Ke=Xx(Bc),kv=new Map([[Ie.Universal,50],[Ie.Tag,30],[Ie.Attribute,1],[Ie.Pseudo,0]]);function Lm(e){return!kv.has(e.type)}const $I=new Map([[Vt.Exists,10],[Vt.Equals,8],[Vt.Not,7],[Vt.Start,6],[Vt.End,6],[Vt.Any,5]]);function HI(e){const t=e.map(Ev);for(let n=1;n<e.length;n++){const r=t[n];if(!(r<0))for(let i=n-1;i>=0&&r<t[i];i--){const s=e[i+1];e[i+1]=e[i],e[i]=s,t[i+1]=t[i],t[i]=r}}}function Ev(e){var t,n;let r=(t=kv.get(e.type))!==null&&t!==void 0?t:-1;return e.type===Ie.Attribute?(r=(n=$I.get(e.action))!==null&&n!==void 0?n:4,e.action===Vt.Equals&&e.name==="id"&&(r=9),e.ignoreCase&&(r>>=1)):e.type===Ie.Pseudo&&(e.data?e.name==="has"||e.name==="contains"?r=0:Array.isArray(e.data)?(r=Math.min(...e.data.map(i=>Math.min(...i.map(Ev)))),r<0&&(r=0)):r=2:r=3),r}const UI=/[-[\]{}()*+?.,\\^$|#\s]/g;function mA(e){return e.replace(UI,"\\$&")}const GI=new Set(["accept","accept-charset","align","alink","axis","bgcolor","charset","checked","clear","codetype","color","compact","declare","defer","dir","direction","disabled","enctype","face","frame","hreflang","http-equiv","lang","language","link","media","method","multiple","nohref","noresize","noshade","nowrap","readonly","rel","rev","rules","scope","scrolling","selected","shape","target","text","type","valign","valuetype","vlink"]);function ls(e,t){return typeof e.ignoreCase=="boolean"?e.ignoreCase:e.ignoreCase==="quirks"?!!t.quirksMode:!t.xmlMode&&GI.has(e.name)}const WI={equals(e,t,n){const{adapter:r}=n,{name:i}=t;let{value:s}=t;return ls(t,n)?(s=s.toLowerCase(),o=>{const a=r.getAttributeValue(o,i);return a!=null&&a.length===s.length&&a.toLowerCase()===s&&e(o)}):o=>r.getAttributeValue(o,i)===s&&e(o)},hyphen(e,t,n){const{adapter:r}=n,{name:i}=t;let{value:s}=t;const o=s.length;return ls(t,n)?(s=s.toLowerCase(),function(a){const l=r.getAttributeValue(a,i);return l!=null&&(l.length===o||l.charAt(o)==="-")&&l.substr(0,o).toLowerCase()===s&&e(a)}):function(a){const l=r.getAttributeValue(a,i);return l!=null&&(l.length===o||l.charAt(o)==="-")&&l.substr(0,o)===s&&e(a)}},element(e,t,n){const{adapter:r}=n,{name:i,value:s}=t;if(/\s/.test(s))return Ke.falseFunc;const o=new RegExp(`(?:^|\\s)${mA(s)}(?:$|\\s)`,ls(t,n)?"i":"");return function(a){const l=r.getAttributeValue(a,i);return l!=null&&l.length>=s.length&&o.test(l)&&e(a)}},exists(e,{name:t},{adapter:n}){return r=>n.hasAttrib(r,t)&&e(r)},start(e,t,n){const{adapter:r}=n,{name:i}=t;let{value:s}=t;const o=s.length;return o===0?Ke.falseFunc:ls(t,n)?(s=s.toLowerCase(),a=>{const l=r.getAttributeValue(a,i);return l!=null&&l.length>=o&&l.substr(0,o).toLowerCase()===s&&e(a)}):a=>{var l;return!!(!((l=r.getAttributeValue(a,i))===null||l===void 0)&&l.startsWith(s))&&e(a)}},end(e,t,n){const{adapter:r}=n,{name:i}=t;let{value:s}=t;const o=-s.length;return o===0?Ke.falseFunc:ls(t,n)?(s=s.toLowerCase(),a=>{var l;return((l=r.getAttributeValue(a,i))===null||l===void 0?void 0:l.substr(o).toLowerCase())===s&&e(a)}):a=>{var l;return!!(!((l=r.getAttributeValue(a,i))===null||l===void 0)&&l.endsWith(s))&&e(a)}},any(e,t,n){const{adapter:r}=n,{name:i,value:s}=t;if(s==="")return Ke.falseFunc;if(ls(t,n)){const o=new RegExp(mA(s),"i");return function(a){const l=r.getAttributeValue(a,i);return l!=null&&l.length>=s.length&&o.test(l)&&e(a)}}return o=>{var a;return!!(!((a=r.getAttributeValue(o,i))===null||a===void 0)&&a.includes(s))&&e(o)}},not(e,t,n){const{adapter:r}=n,{name:i}=t;let{value:s}=t;return s===""?o=>!!r.getAttributeValue(o,i)&&e(o):ls(t,n)?(s=s.toLowerCase(),o=>{const a=r.getAttributeValue(o,i);return(a==null||a.length!==s.length||a.toLowerCase()!==s)&&e(o)}):o=>r.getAttributeValue(o,i)!==s&&e(o)}},YI=new Set([9,10,12,13,32]),fA=48,zI=57;function KI(e){if(e=e.trim().toLowerCase(),e==="even")return[2,0];if(e==="odd")return[2,1];let t=0,n=0,r=s(),i=o();if(t<e.length&&e.charAt(t)==="n"&&(t++,n=r*(i??1),a(),t<e.length?(r=s(),a(),i=o()):r=i=0),i===null||t<e.length)throw new Error(`n-th rule couldn't be parsed ('${e}')`);return[n,r*i];function s(){return e.charAt(t)==="-"?(t++,-1):(e.charAt(t)==="+"&&t++,1)}function o(){const l=t;let d=0;for(;t<e.length&&e.charCodeAt(t)>=fA&&e.charCodeAt(t)<=zI;)d=d*10+(e.charCodeAt(t)-fA),t++;return t===l?null:d}function a(){for(;t<e.length&&YI.has(e.charCodeAt(t));)t++}}function QI(e){const t=e[0],n=e[1]-1;if(n<0&&t<=0)return Ke.falseFunc;if(t===-1)return s=>s<=n;if(t===0)return s=>s===n;if(t===1)return n<0?Ke.trueFunc:s=>s>=n;const r=Math.abs(t),i=(n%r+r)%r;return t>1?s=>s>=n&&s%r===i:s=>s<=n&&s%r===i}function Fl(e){return QI(KI(e))}function $l(e,t){return n=>{const r=t.getParent(n);return r!=null&&t.isTag(r)&&e(n)}}const Ap={contains(e,t,{adapter:n}){return function(r){return e(r)&&n.getText(r).includes(t)}},icontains(e,t,{adapter:n}){const r=t.toLowerCase();return function(i){return e(i)&&n.getText(i).toLowerCase().includes(r)}},"nth-child"(e,t,{adapter:n,equals:r}){const i=Fl(t);return i===Ke.falseFunc?Ke.falseFunc:i===Ke.trueFunc?$l(e,n):function(s){const o=n.getSiblings(s);let a=0;for(let l=0;l<o.length&&!r(s,o[l]);l++)n.isTag(o[l])&&a++;return i(a)&&e(s)}},"nth-last-child"(e,t,{adapter:n,equals:r}){const i=Fl(t);return i===Ke.falseFunc?Ke.falseFunc:i===Ke.trueFunc?$l(e,n):function(s){const o=n.getSiblings(s);let a=0;for(let l=o.length-1;l>=0&&!r(s,o[l]);l--)n.isTag(o[l])&&a++;return i(a)&&e(s)}},"nth-of-type"(e,t,{adapter:n,equals:r}){const i=Fl(t);return i===Ke.falseFunc?Ke.falseFunc:i===Ke.trueFunc?$l(e,n):function(s){const o=n.getSiblings(s);let a=0;for(let l=0;l<o.length;l++){const d=o[l];if(r(s,d))break;n.isTag(d)&&n.getName(d)===n.getName(s)&&a++}return i(a)&&e(s)}},"nth-last-of-type"(e,t,{adapter:n,equals:r}){const i=Fl(t);return i===Ke.falseFunc?Ke.falseFunc:i===Ke.trueFunc?$l(e,n):function(s){const o=n.getSiblings(s);let a=0;for(let l=o.length-1;l>=0;l--){const d=o[l];if(r(s,d))break;n.isTag(d)&&n.getName(d)===n.getName(s)&&a++}return i(a)&&e(s)}},root(e,t,{adapter:n}){return r=>{const i=n.getParent(r);return(i==null||!n.isTag(i))&&e(r)}},scope(e,t,n,r){const{equals:i}=n;return!r||r.length===0?Ap.root(e,t,n):r.length===1?s=>i(r[0],s)&&e(s):s=>r.includes(s)&&e(s)},hover:Yu("isHovered"),visited:Yu("isVisited"),active:Yu("isActive")};function Yu(e){return function(t,n,{adapter:r}){const i=r[e];return typeof i!="function"?Ke.falseFunc:function(s){return i(s)&&t(s)}}}const gA={empty(e,{adapter:t}){return!t.getChildren(e).some(n=>t.isTag(n)||t.getText(n)!=="")},"first-child"(e,{adapter:t,equals:n}){if(t.prevElementSibling)return t.prevElementSibling(e)==null;const r=t.getSiblings(e).find(i=>t.isTag(i));return r!=null&&n(e,r)},"last-child"(e,{adapter:t,equals:n}){const r=t.getSiblings(e);for(let i=r.length-1;i>=0;i--){if(n(e,r[i]))return!0;if(t.isTag(r[i]))break}return!1},"first-of-type"(e,{adapter:t,equals:n}){const r=t.getSiblings(e),i=t.getName(e);for(let s=0;s<r.length;s++){const o=r[s];if(n(e,o))return!0;if(t.isTag(o)&&t.getName(o)===i)break}return!1},"last-of-type"(e,{adapter:t,equals:n}){const r=t.getSiblings(e),i=t.getName(e);for(let s=r.length-1;s>=0;s--){const o=r[s];if(n(e,o))return!0;if(t.isTag(o)&&t.getName(o)===i)break}return!1},"only-of-type"(e,{adapter:t,equals:n}){const r=t.getName(e);return t.getSiblings(e).every(i=>n(e,i)||!t.isTag(i)||t.getName(i)!==r)},"only-child"(e,{adapter:t,equals:n}){return t.getSiblings(e).every(r=>n(e,r)||!t.isTag(r))}};function AA(e,t,n,r){if(n===null){if(e.length>r)throw new Error(`Pseudo-class :${t} requires an argument`)}else if(e.length===r)throw new Error(`Pseudo-class :${t} doesn't have any arguments`)}const VI={"any-link":":is(a, area, link)[href]",link:":any-link:not(:visited)",disabled:`:is(
|
|
7
|
+
:is(button, input, select, textarea, optgroup, option)[disabled],
|
|
8
|
+
optgroup[disabled] > option,
|
|
9
|
+
fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *)
|
|
10
|
+
)`,enabled:":not(:disabled)",checked:":is(:is(input[type=radio], input[type=checkbox])[checked], option:selected)",required:":is(input, select, textarea)[required]",optional:":is(input, select, textarea):not([required])",selected:"option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)",checkbox:"[type=checkbox]",file:"[type=file]",password:"[type=password]",radio:"[type=radio]",reset:"[type=reset]",image:"[type=image]",submit:"[type=submit]",parent:":not(:empty)",header:":is(h1, h2, h3, h4, h5, h6)",button:":is(button, input[type=button])",input:":is(input, textarea, select, button)",text:"input:is(:not([type!='']), [type=text])"},Cv={};function qI(e,t){return e===Ke.falseFunc?Ke.falseFunc:n=>t.isTag(n)&&e(n)}function Tv(e,t){const n=t.getSiblings(e);if(n.length<=1)return[];const r=n.indexOf(e);return r<0||r===n.length-1?[]:n.slice(r+1).filter(t.isTag)}function bp(e){return{xmlMode:!!e.xmlMode,lowerCaseAttributeNames:!!e.lowerCaseAttributeNames,lowerCaseTags:!!e.lowerCaseTags,quirksMode:!!e.quirksMode,cacheResults:!!e.cacheResults,pseudos:e.pseudos,adapter:e.adapter,equals:e.equals}}const zu=(e,t,n,r,i)=>{const s=i(t,bp(n),r);return s===Ke.trueFunc?e:s===Ke.falseFunc?Ke.falseFunc:o=>s(o)&&e(o)},Ku={is:zu,matches:zu,where:zu,not(e,t,n,r,i){const s=i(t,bp(n),r);return s===Ke.falseFunc?e:s===Ke.trueFunc?Ke.falseFunc:o=>!s(o)&&e(o)},has(e,t,n,r,i){const{adapter:s}=n,o=bp(n);o.relativeSelector=!0;const a=t.some(u=>u.some(Lm))?[Cv]:void 0,l=i(t,o,a);if(l===Ke.falseFunc)return Ke.falseFunc;const d=qI(l,s);if(a&&l!==Ke.trueFunc){const{shouldTestNextSiblings:u=!1}=l;return h=>{if(!e(h))return!1;a[0]=h;const p=s.getChildren(h),m=u?[...p,...Tv(h,s)]:p;return s.existsOne(d,m)}}return u=>e(u)&&s.existsOne(d,s.getChildren(u))}};function JI(e,t,n,r,i){var s;const{name:o,data:a}=t;if(Array.isArray(a)){if(!(o in Ku))throw new Error(`Unknown pseudo-class :${o}(${a})`);return Ku[o](e,a,n,r,i)}const l=(s=n.pseudos)===null||s===void 0?void 0:s[o],d=typeof l=="string"?l:VI[o];if(typeof d=="string"){if(a!=null)throw new Error(`Pseudo ${o} doesn't have any arguments`);const u=Vd(d);return Ku.is(e,u,n,r,i)}if(typeof l=="function")return AA(l,o,a,1),u=>l(u,a)&&e(u);if(o in Ap)return Ap[o](e,a,n,r);if(o in gA){const u=gA[o];return AA(u,o,a,2),h=>u(h,n,a)&&e(h)}throw new Error(`Unknown pseudo-class :${o}`)}function Qu(e,t){const n=t.getParent(e);return n&&t.isTag(n)?n:null}function ZI(e,t,n,r,i){const{adapter:s,equals:o}=n;switch(t.type){case Ie.PseudoElement:throw new Error("Pseudo-elements are not supported by css-select");case Ie.ColumnCombinator:throw new Error("Column combinators are not yet supported by css-select");case Ie.Attribute:{if(t.namespace!=null)throw new Error("Namespaced attributes are not yet supported by css-select");return(!n.xmlMode||n.lowerCaseAttributeNames)&&(t.name=t.name.toLowerCase()),WI[t.action](e,t,n)}case Ie.Pseudo:return JI(e,t,n,r,i);case Ie.Tag:{if(t.namespace!=null)throw new Error("Namespaced tag names are not yet supported by css-select");let{name:a}=t;return(!n.xmlMode||n.lowerCaseTags)&&(a=a.toLowerCase()),function(l){return s.getName(l)===a&&e(l)}}case Ie.Descendant:{if(n.cacheResults===!1||typeof WeakSet>"u")return function(l){let d=l;for(;d=Qu(d,s);)if(e(d))return!0;return!1};const a=new WeakSet;return function(l){let d=l;for(;d=Qu(d,s);)if(!a.has(d)){if(s.isTag(d)&&e(d))return!0;a.add(d)}return!1}}case"_flexibleDescendant":return function(a){let l=a;do if(e(l))return!0;while(l=Qu(l,s));return!1};case Ie.Parent:return function(a){return s.getChildren(a).some(l=>s.isTag(l)&&e(l))};case Ie.Child:return function(a){const l=s.getParent(a);return l!=null&&s.isTag(l)&&e(l)};case Ie.Sibling:return function(a){const l=s.getSiblings(a);for(let d=0;d<l.length;d++){const u=l[d];if(o(a,u))break;if(s.isTag(u)&&e(u))return!0}return!1};case Ie.Adjacent:return s.prevElementSibling?function(a){const l=s.prevElementSibling(a);return l!=null&&e(l)}:function(a){const l=s.getSiblings(a);let d;for(let u=0;u<l.length;u++){const h=l[u];if(o(a,h))break;s.isTag(h)&&(d=h)}return!!d&&e(d)};case Ie.Universal:{if(t.namespace!=null&&t.namespace!=="*")throw new Error("Namespaced universal selectors are not yet supported by css-select");return e}}}function Sv(e){return e.type===Ie.Pseudo&&(e.name==="scope"||Array.isArray(e.data)&&e.data.some(t=>t.some(Sv)))}const XI={type:Ie.Descendant},e2={type:"_flexibleDescendant"},t2={type:Ie.Pseudo,name:"scope",data:null};function n2(e,{adapter:t},n){const r=!!(n!=null&&n.every(i=>{const s=t.isTag(i)&&t.getParent(i);return i===Cv||s&&t.isTag(s)}));for(const i of e){if(!(i.length>0&&Lm(i[0])&&i[0].type!==Ie.Descendant))if(r&&!i.some(Sv))i.unshift(XI);else continue;i.unshift(t2)}}function _v(e,t,n){var r;e.forEach(HI),n=(r=t.context)!==null&&r!==void 0?r:n;const i=Array.isArray(n),s=n&&(Array.isArray(n)?n:[n]);if(t.relativeSelector!==!1)n2(e,t,s);else if(e.some(l=>l.length>0&&Lm(l[0])))throw new Error("Relative selectors are not allowed when the `relativeSelector` option is disabled");let o=!1;const a=e.map(l=>{if(l.length>=2){const[d,u]=l;d.type!==Ie.Pseudo||d.name!=="scope"||(i&&u.type===Ie.Descendant?l[1]=e2:(u.type===Ie.Adjacent||u.type===Ie.Sibling)&&(o=!0))}return r2(l,t,s)}).reduce(i2,Ke.falseFunc);return a.shouldTestNextSiblings=o,a}function r2(e,t,n){var r;return e.reduce((i,s)=>i===Ke.falseFunc?Ke.falseFunc:ZI(i,s,t,n,_v),(r=t.rootFunc)!==null&&r!==void 0?r:Ke.trueFunc)}function i2(e,t){return t===Ke.falseFunc||e===Ke.trueFunc?e:e===Ke.falseFunc||t===Ke.trueFunc?t:function(n){return e(n)||t(n)}}const Nv=(e,t)=>e===t,s2={adapter:Qd,equals:Nv};function o2(e){var t,n,r,i;const s=e??s2;return(t=s.adapter)!==null&&t!==void 0||(s.adapter=Qd),(n=s.equals)!==null&&n!==void 0||(s.equals=(i=(r=s.adapter)===null||r===void 0?void 0:r.equals)!==null&&i!==void 0?i:Nv),s}function a2(e){return function(t,n,r){const i=o2(n);return e(t,i,r)}}const jm=a2(_v);function Iv(e,t,n=!1){return n&&(e=l2(e,t)),Array.isArray(e)?t.removeSubsets(e):t.getChildren(e)}function l2(e,t){const n=Array.isArray(e)?e.slice(0):[e],r=n.length;for(let i=0;i<r;i++){const s=Tv(n[i],t);n.push(...s)}return n}const c2=new Set(["first","last","eq","gt","nth","lt","even","odd"]);function Pc(e){return e.type!=="pseudo"?!1:c2.has(e.name)?!0:e.name==="not"&&Array.isArray(e.data)?e.data.some(t=>t.some(Pc)):!1}function d2(e,t,n){const r=t!=null?parseInt(t,10):NaN;switch(e){case"first":return 1;case"nth":case"eq":return isFinite(r)?r>=0?r+1:1/0:0;case"lt":return isFinite(r)?r>=0?Math.min(r,n):1/0:0;case"gt":return isFinite(r)?1/0:0;case"odd":return 2*n;case"even":return 2*n-1;case"last":case"not":return 1/0}}function u2(e){for(;e.parent;)e=e.parent;return e}function Bm(e){const t=[],n=[];for(const r of e)r.some(Pc)?t.push(r):n.push(r);return[n,t]}const h2={type:Ie.Universal,namespace:null},p2={type:Ie.Pseudo,name:"scope",data:null};function Dv(e,t,n={}){return Mv([e],t,n)}function Mv(e,t,n={}){if(typeof t=="function")return e.some(t);const[r,i]=Bm(Vd(t));return r.length>0&&e.some(jm(r,n))||i.some(s=>Lv(s,e,n).length>0)}function m2(e,t,n,r){const i=typeof n=="string"?parseInt(n,10):NaN;switch(e){case"first":case"lt":return t;case"last":return t.length>0?[t[t.length-1]]:t;case"nth":case"eq":return isFinite(i)&&Math.abs(i)<t.length?[i<0?t[t.length+i]:t[i]]:[];case"gt":return isFinite(i)?t.slice(i+1):[];case"even":return t.filter((s,o)=>o%2===0);case"odd":return t.filter((s,o)=>o%2===1);case"not":{const s=new Set(Rv(n,t,r));return t.filter(o=>!s.has(o))}}}function Ov(e,t,n={}){return Rv(Vd(e),t,n)}function Rv(e,t,n){if(t.length===0)return[];const[r,i]=Bm(e);let s;if(r.length){const o=xp(t,r,n);if(i.length===0)return o;o.length&&(s=new Set(o))}for(let o=0;o<i.length&&(s==null?void 0:s.size)!==t.length;o++){const a=i[o];if((s?t.filter(d=>Re(d)&&!s.has(d)):t).length===0)break;const l=Lv(a,t,n);if(l.length)if(s)l.forEach(d=>s.add(d));else{if(o===i.length-1)return l;s=new Set(l)}}return typeof s<"u"?s.size===t.length?t:t.filter(o=>s.has(o)):[]}function Lv(e,t,n){var r;if(e.some(va)){const i=(r=n.root)!==null&&r!==void 0?r:u2(t[0]),s={...n,context:t,relativeSelector:!1};return e.push(p2),Fc(i,e,s,!0,t.length)}return Fc(t,e,n,!1,t.length)}function f2(e,t,n={},r=1/0){if(typeof e=="function")return jv(t,e);const[i,s]=Bm(Vd(e)),o=s.map(a=>Fc(t,a,n,!0,r));return i.length&&o.push(yp(t,i,n,r)),o.length===0?[]:o.length===1?o[0]:$o(o.reduce((a,l)=>[...a,...l]))}function Fc(e,t,n,r,i){const s=t.findIndex(Pc),o=t.slice(0,s),a=t[s],l=t.length-1===s?i:1/0,d=d2(a.name,a.data,l);if(d===0)return[];const u=(o.length===0&&!Array.isArray(e)?Kd(e).filter(Re):o.length===0?(Array.isArray(e)?e:[e]).filter(Re):r||o.some(va)?yp(e,[o],n,d):xp(e,[o],n)).slice(0,d);let h=m2(a.name,u,a.data,n);if(h.length===0||t.length===s+1)return h;const p=t.slice(s+1),m=p.some(va);if(m){if(va(p[0])){const{type:g}=p[0];(g===Ie.Sibling||g===Ie.Adjacent)&&(h=Iv(h,Qd,!0)),p.unshift(h2)}n={...n,relativeSelector:!1,rootFunc:g=>h.includes(g)}}else n.rootFunc&&n.rootFunc!==Bc.trueFunc&&(n={...n,rootFunc:Bc.trueFunc});return p.some(Pc)?Fc(h,p,n,!1,i):m?yp(h,[p],n,i):xp(h,[p],n)}function yp(e,t,n,r){const i=jm(t,n,e);return jv(e,i,r)}function jv(e,t,n=1/0){const r=Iv(e,Qd,t.shouldTestNextSiblings);return Im(i=>Re(i)&&t(i),r,!0,n)}function xp(e,t,n){const r=(Array.isArray(e)?e:[e]).filter(Re);if(r.length===0)return r;const i=jm(t,n);return i===Bc.trueFunc?r:r.filter(i)}const g2=/^\s*[+~]/;function A2(e){if(!e)return this._make([]);if(typeof e!="string"){const t=ui(e)?e.toArray():[e],n=this.toArray();return this._make(t.filter(r=>n.some(i=>Om(i,r))))}return this._findBySelector(e,Number.POSITIVE_INFINITY)}function b2(e,t){var n;const r=this.toArray(),i=g2.test(e)?r:this.children().toArray(),s={context:r,root:(n=this._root)===null||n===void 0?void 0:n[0],xmlMode:this.options.xmlMode,lowerCaseTags:this.options.lowerCaseTags,lowerCaseAttributeNames:this.options.lowerCaseAttributeNames,pseudos:this.options.pseudos,quirksMode:this.options.quirksMode};return this._make(f2(e,i,s,t))}function Pm(e){return function(t,...n){return function(r){var i;let s=e(t,this);return r&&(s=Hm(s,r,this.options.xmlMode,(i=this._root)===null||i===void 0?void 0:i[0])),this._make(this.length>1&&s.length>1?n.reduce((o,a)=>a(o),s):s)}}}const ml=Pm((e,t)=>{let n=[];for(let r=0;r<t.length;r++){const i=e(t[r]);i.length>0&&(n=n.concat(i))}return n}),Fm=Pm((e,t)=>{const n=[];for(let r=0;r<t.length;r++){const i=e(t[r]);i!==null&&n.push(i)}return n});function $m(e,...t){let n=null;const r=Pm((i,s)=>{const o=[];return Lt(s,a=>{for(let l;(l=i(a))&&!(n!=null&&n(l,o.length));a=l)o.push(l)}),o})(e,...t);return function(i,s){n=typeof i=="string"?a=>Dv(a,i,this.options):i?fl(i):null;const o=r.call(this,s);return n=null,o}}function Ho(e){return e.length>1?Array.from(new Set(e)):e}const y2=Fm(({parent:e})=>e&&!Qi(e)?e:null,Ho),x2=ml(e=>{const t=[];for(;e.parent&&!Qi(e.parent);)t.push(e.parent),e=e.parent;return t},$o,e=>e.reverse()),v2=$m(({parent:e})=>e&&!Qi(e)?e:null,$o,e=>e.reverse());function w2(e){var t;const n=[];if(!e)return this._make(n);const r={xmlMode:this.options.xmlMode,root:(t=this._root)===null||t===void 0?void 0:t[0]},i=typeof e=="string"?s=>Dv(s,e,r):fl(e);return Lt(this,s=>{for(s&&!Qi(s)&&!Re(s)&&(s=s.parent);s&&Re(s);){if(i(s,0)){n.includes(s)||n.push(s);break}s=s.parent}}),this._make(n)}const k2=Fm(e=>_m(e)),E2=ml(e=>{const t=[];for(;e.next;)e=e.next,Re(e)&&t.push(e);return t},Ho),C2=$m(e=>_m(e),Ho),T2=Fm(e=>Nm(e)),S2=ml(e=>{const t=[];for(;e.prev;)e=e.prev,Re(e)&&t.push(e);return t},Ho),_2=$m(e=>Nm(e),Ho),N2=ml(e=>dv(e).filter(t=>Re(t)&&t!==e),$o),I2=ml(e=>Kd(e).filter(Re),Ho);function D2(){const e=this.toArray().reduce((t,n)=>Ht(n)?t.concat(n.children):t,[]);return this._make(e)}function M2(e){let t=0;const n=this.length;for(;t<n&&e.call(this[t],t,this[t])!==!1;)++t;return this}function O2(e){let t=[];for(let n=0;n<this.length;n++){const r=this[n],i=e.call(r,n,r);i!=null&&(t=t.concat(i))}return this._make(t)}function fl(e){return typeof e=="function"?(t,n)=>e.call(t,n,t):ui(e)?t=>Array.prototype.includes.call(e,t):function(t){return e===t}}function R2(e){var t;return this._make(Hm(this.toArray(),e,this.options.xmlMode,(t=this._root)===null||t===void 0?void 0:t[0]))}function Hm(e,t,n,r){return typeof t=="string"?Ov(t,e,{xmlMode:n,root:r}):e.filter(fl(t))}function L2(e){const t=this.toArray();return typeof e=="string"?Mv(t.filter(Re),e,this.options):e?t.some(fl(e)):!1}function j2(e){let t=this.toArray();if(typeof e=="string"){const n=new Set(Ov(e,t,this.options));t=t.filter(r=>!n.has(r))}else{const n=fl(e);t=t.filter((r,i)=>!n(r,i))}return this._make(t)}function B2(e){return this.filter(typeof e=="string"?`:has(${e})`:(t,n)=>this._make(n).find(e).length>0)}function P2(){return this.length>1?this._make(this[0]):this}function F2(){return this.length>0?this._make(this[this.length-1]):this}function $2(e){var t;return e=+e,e===0&&this.length<=1?this:(e<0&&(e=this.length+e),this._make((t=this[e])!==null&&t!==void 0?t:[]))}function H2(e){return e==null?this.toArray():this[e<0?this.length+e:e]}function U2(){return Array.prototype.slice.call(this)}function G2(e){let t,n;return e==null?(t=this.parent().children(),n=this[0]):typeof e=="string"?(t=this._make(e),n=this[0]):(t=this,n=ui(e)?e[0]:e),Array.prototype.indexOf.call(t,n)}function W2(e,t){return this._make(Array.prototype.slice.call(this,e,t))}function Y2(){var e;return(e=this.prevObject)!==null&&e!==void 0?e:this._make([])}function z2(e,t){const n=this._make(e,t),r=$o([...this.get(),...n.get()]);return this._make(r)}function K2(e){return this.prevObject?this.add(e?this.prevObject.filter(e):this.prevObject):this}const Q2=Object.freeze(Object.defineProperty({__proto__:null,_findBySelector:b2,add:z2,addBack:K2,children:I2,closest:w2,contents:D2,each:M2,end:Y2,eq:$2,filter:R2,filterArray:Hm,find:A2,first:P2,get:H2,has:B2,index:G2,is:L2,last:F2,map:O2,next:k2,nextAll:E2,nextUntil:C2,not:j2,parent:y2,parents:x2,parentsUntil:v2,prev:T2,prevAll:S2,prevUntil:_2,siblings:N2,slice:W2,toArray:U2},Symbol.toStringTag,{value:"Module"}));function V2(e){return function(t,n,r,i){if(typeof Buffer<"u"&&Buffer.isBuffer(t)&&(t=t.toString()),typeof t=="string")return e(t,n,r,i);const s=t;if(!Array.isArray(s)&&Qi(s))return s;const o=new Ls([]);return js(s,o),o}}function js(e,t){const n=Array.isArray(e)?e:[e];t?t.children=n:t=null;for(let r=0;r<n.length;r++){const i=n[r];i.parent&&i.parent.children!==n&&Ws(i),t?(i.prev=n[r-1]||null,i.next=n[r+1]||null):i.prev=i.next=null,i.parent=t}return t}function q2(e,t){if(e==null)return[];if(typeof e=="string")return this._parse(e,this.options,!1,null).children.slice(0);if("length"in e){if(e.length===1)return this._makeDomArray(e[0],t);const n=[];for(let r=0;r<e.length;r++){const i=e[r];if(typeof i=="object"){if(i==null)continue;if(!("length"in i)){n.push(t?Ya(i,!0):i);continue}}n.push(...this._makeDomArray(i,t))}return n}return[t?Ya(e,!0):e]}function Bv(e){return function(...t){const n=this.length-1;return Lt(this,(r,i)=>{if(!Ht(r))return;const s=typeof t[0]=="function"?t[0].call(r,i,this._render(r.children)):t,o=this._makeDomArray(s,i<n);e(o,r.children,r)})}}function Vi(e,t,n,r,i){var s,o;const a=[t,n,...r],l=t===0?null:e[t-1],d=t+n>=e.length?null:e[t+n];for(let u=0;u<r.length;++u){const h=r[u],p=h.parent;if(p){const m=p.children.indexOf(h);m>-1&&(p.children.splice(m,1),i===p&&t>m&&a[0]--)}h.parent=i,h.prev&&(h.prev.next=(s=h.next)!==null&&s!==void 0?s:null),h.next&&(h.next.prev=(o=h.prev)!==null&&o!==void 0?o:null),h.prev=u===0?l:r[u-1],h.next=u===r.length-1?d:r[u+1]}return l&&(l.next=r[0]),d&&(d.prev=r[r.length-1]),e.splice(...a)}function J2(e){return(ui(e)?e:this._make(e)).append(this),this}function Z2(e){return(ui(e)?e:this._make(e)).prepend(this),this}const X2=Bv((e,t,n)=>{Vi(t,t.length,0,e,n)}),eD=Bv((e,t,n)=>{Vi(t,0,0,e,n)});function Pv(e){return function(t){const n=this.length-1,r=this.parents().last();for(let i=0;i<this.length;i++){const s=this[i],o=typeof t=="function"?t.call(s,i,s):typeof t=="string"&&!fp(t)?r.find(t).clone():t,[a]=this._makeDomArray(o,i<n);if(!a||!Ht(a))continue;let l=a,d=0;for(;d<l.children.length;){const u=l.children[d];Re(u)?(l=u,d=0):d++}e(s,l,[a])}return this}}const tD=Pv((e,t,n)=>{const{parent:r}=e;if(!r)return;const i=r.children,s=i.indexOf(e);js([e],t),Vi(i,s,0,n,r)}),nD=Pv((e,t,n)=>{Ht(e)&&(js(e.children,t),js(n,e))});function rD(e){return this.parent(e).not("body").each((t,n)=>{this._make(n).replaceWith(n.children)}),this}function iD(e){const t=this[0];if(t){const n=this._make(typeof e=="function"?e.call(t,0,t):e).insertBefore(t);let r;for(let s=0;s<n.length;s++)n[s].type==="tag"&&(r=n[s]);let i=0;for(;r&&i<r.children.length;){const s=r.children[i];s.type==="tag"?(r=s,i=0):i++}r&&this._make(r).append(this)}return this}function sD(...e){const t=this.length-1;return Lt(this,(n,r)=>{if(!Ht(n)||!n.parent)return;const i=n.parent.children,s=i.indexOf(n);if(s<0)return;const o=typeof e[0]=="function"?e[0].call(n,r,this._render(n.children)):e,a=this._makeDomArray(o,r<t);Vi(i,s+1,0,a,n.parent)})}function oD(e){typeof e=="string"&&(e=this._make(e)),this.remove();const t=[];for(const n of this._makeDomArray(e)){const r=this.clone().toArray(),{parent:i}=n;if(!i)continue;const s=i.children,o=s.indexOf(n);o<0||(Vi(s,o+1,0,r,i),t.push(...r))}return this._make(t)}function aD(...e){const t=this.length-1;return Lt(this,(n,r)=>{if(!Ht(n)||!n.parent)return;const i=n.parent.children,s=i.indexOf(n);if(s<0)return;const o=typeof e[0]=="function"?e[0].call(n,r,this._render(n.children)):e,a=this._makeDomArray(o,r<t);Vi(i,s,0,a,n.parent)})}function lD(e){const t=this._make(e);this.remove();const n=[];return Lt(t,r=>{const i=this.clone().toArray(),{parent:s}=r;if(!s)return;const o=s.children,a=o.indexOf(r);a<0||(Vi(o,a,0,i,s),n.push(...i))}),this._make(n)}function cD(e){const t=e?this.filter(e):this;return Lt(t,n=>{Ws(n),n.prev=n.next=n.parent=null}),this}function dD(e){return Lt(this,(t,n)=>{const{parent:r}=t;if(!r)return;const i=r.children,s=typeof e=="function"?e.call(t,n,t):e,o=this._makeDomArray(s);js(o,null);const a=i.indexOf(t);Vi(i,a,1,o,r),o.includes(t)||(t.parent=t.prev=t.next=null)})}function uD(){return Lt(this,e=>{if(Ht(e)){for(const t of e.children)t.next=t.prev=t.parent=null;e.children.length=0}})}function hD(e){if(e===void 0){const t=this[0];return!t||!Ht(t)?null:this._render(t.children)}return Lt(this,t=>{if(!Ht(t))return;for(const r of t.children)r.next=r.prev=r.parent=null;const n=ui(e)?e.toArray():this._parse(`${e}`,this.options,!1,t).children;js(n,t)})}function pD(){return this._render(this)}function mD(e){return e===void 0?za(this):typeof e=="function"?Lt(this,(t,n)=>this._make(t).text(e.call(t,n,za([t])))):Lt(this,t=>{if(!Ht(t))return;for(const r of t.children)r.next=r.prev=r.parent=null;const n=new Wa(`${e}`);js(n,t)})}function fD(){const e=Array.prototype.map.call(this.get(),n=>Ya(n,!0)),t=new Ls(e);for(const n of e)n.parent=t;return this._make(e)}const gD=Object.freeze(Object.defineProperty({__proto__:null,_makeDomArray:q2,after:sD,append:X2,appendTo:J2,before:aD,clone:fD,empty:uD,html:hD,insertAfter:oD,insertBefore:lD,prepend:eD,prependTo:Z2,remove:cD,replaceWith:dD,text:mD,toString:pD,unwrap:rD,wrap:tD,wrapAll:iD,wrapInner:nD},Symbol.toStringTag,{value:"Module"}));function AD(e,t){if(e!=null&&t!=null||typeof e=="object"&&!Array.isArray(e))return Lt(this,(n,r)=>{Re(n)&&Fv(n,e,t,r)});if(this.length!==0)return $v(this[0],e)}function Fv(e,t,n,r){if(typeof t=="string"){const i=$v(e),s=typeof n=="function"?n.call(e,r,i[t]):n;s===""?delete i[t]:s!=null&&(i[t]=s),e.attribs.style=bD(i)}else if(typeof t=="object"){const i=Object.keys(t);for(let s=0;s<i.length;s++){const o=i[s];Fv(e,o,t[o],s)}}}function $v(e,t){if(!e||!Re(e))return;const n=yD(e.attribs.style);if(typeof t=="string")return n[t];if(Array.isArray(t)){const r={};for(const i of t)n[i]!=null&&(r[i]=n[i]);return r}return n}function bD(e){return Object.keys(e).reduce((t,n)=>`${t}${t?" ":""}${n}: ${e[n]};`,"")}function yD(e){if(e=(e||"").trim(),!e)return{};const t={};let n;for(const r of e.split(";")){const i=r.indexOf(":");if(i<1||i===r.length-1){const s=r.trimEnd();s.length>0&&n!==void 0&&(t[n]+=`;${s}`)}else n=r.slice(0,i).trim(),t[n]=r.slice(i+1).trim()}return t}const xD=Object.freeze(Object.defineProperty({__proto__:null,css:AD},Symbol.toStringTag,{value:"Module"})),bA="input,select,textarea,keygen",vD=/%20/g,yA=/\r?\n/g;function wD(){return this.serializeArray().map(e=>`${encodeURIComponent(e.name)}=${encodeURIComponent(e.value)}`).join("&").replace(vD,"+")}function kD(){return this.map((e,t)=>{const n=this._make(t);return Re(t)&&t.name==="form"?n.find(bA).toArray():n.filter(bA).toArray()}).filter('[name!=""]:enabled:not(:submit, :button, :image, :reset, :file):matches([checked], :not(:checkbox, :radio))').map((e,t)=>{var n;const r=this._make(t),i=r.attr("name"),s=(n=r.val())!==null&&n!==void 0?n:"";return Array.isArray(s)?s.map(o=>({name:i,value:o.replace(yA,`\r
|
|
11
|
+
`)})):{name:i,value:s.replace(yA,`\r
|
|
12
|
+
`)}}).toArray()}const ED=Object.freeze(Object.defineProperty({__proto__:null,serialize:wD,serializeArray:kD},Symbol.toStringTag,{value:"Module"}));function CD(e){var t;return typeof e=="string"?{selector:e,value:"textContent"}:{selector:e.selector,value:(t=e.value)!==null&&t!==void 0?t:"textContent"}}function TD(e){const t={};for(const n in e){const r=e[n],i=Array.isArray(r),{selector:s,value:o}=CD(i?r[0]:r),a=typeof o=="function"?o:typeof o=="string"?l=>this._make(l).prop(o):l=>this._make(l).extract(o);if(i)t[n]=this._findBySelector(s,Number.POSITIVE_INFINITY).map((l,d)=>a(d,n,t)).get();else{const l=this._findBySelector(s,1);t[n]=l.length>0?a(l[0],n,t):void 0}}return t}const SD=Object.freeze(Object.defineProperty({__proto__:null,extract:TD},Symbol.toStringTag,{value:"Module"}));let gl=class{constructor(t,n,r){if(this.length=0,this.options=r,this._root=n,t){for(let i=0;i<t.length;i++)this[i]=t[i];this.length=t.length}}};gl.prototype.cheerio="[cheerio object]";gl.prototype.splice=Array.prototype.splice;gl.prototype[Symbol.iterator]=Array.prototype[Symbol.iterator];Object.assign(gl.prototype,OI,Q2,gD,xD,ED,SD);function _D(e,t){return function n(r,i,s=!0){if(r==null)throw new Error("cheerio.load() expects a string");const o=mp(i),a=e(r,o,s,null);class l extends gl{_make(h,p){const m=d(h,p);return m.prevObject=this,m}_parse(h,p,m,g){return e(h,p,m,g)}_render(h){return t(h,this.options)}}function d(u,h,p=a,m){if(u&&ui(u))return u;const g=mp(m,o),b=typeof p=="string"?[e(p,g,!1,null)]:"length"in p?p:[p],A=ui(b)?b:new l(b,null,g);if(A._root=A,!u)return new l(void 0,A,g);const y=typeof u=="string"&&fp(u)?e(u,g,!1,null).children:ND(u)?[u]:Array.isArray(u)?u:void 0,w=new l(y,A,g);if(y)return w;if(typeof u!="string")throw new TypeError("Unexpected type of selector");let C=u;const E=h?typeof h=="string"?fp(h)?new l([e(h,g,!1,null)],A,g):(C=`${h} ${C}`,A):ui(h)?h:new l(Array.isArray(h)?h:[h],A,g):A;return E?E.find(C):w}return Object.assign(d,vI,{load:n,_root:a,_options:o,fn:l.prototype,prototype:l.prototype}),d}}function ND(e){return!!e.name||e.type==="root"||e.type==="text"||e.type==="comment"}const ID=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),It="�";var T;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(T||(T={}));const Rn={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function Hv(e){return e>=55296&&e<=57343}function DD(e){return e>=56320&&e<=57343}function MD(e,t){return(e-55296)*1024+9216+t}function Uv(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function Gv(e){return e>=64976&&e<=65007||ID.has(e)}var U;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(U||(U={}));const OD=65536;class RD{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=OD,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:r,col:i,offset:s}=this,o=i+n,a=s+n;return{code:t,startLine:r,endLine:r,startCol:o,endCol:o,startOffset:a,endOffset:a}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(DD(n))return this.pos++,this._addGap(),MD(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,T.EOF;return this._err(U.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r<t.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==t.charCodeAt(r))return!1;return!0}peek(t){const n=this.pos+t;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,T.EOF;const r=this.html.charCodeAt(n);return r===T.CARRIAGE_RETURN?T.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,T.EOF;let t=this.html.charCodeAt(this.pos);return t===T.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,T.LINE_FEED):t===T.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,Hv(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===T.LINE_FEED||t===T.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){Uv(t)?this._err(U.controlCharacterInInputStream):Gv(t)&&this._err(U.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var tt;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(tt||(tt={}));function Wv(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const LD=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),jD=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function BD(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=jD.get(e))!==null&&t!==void 0?t:e}var nn;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(nn||(nn={}));const PD=32;var Li;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Li||(Li={}));function vp(e){return e>=nn.ZERO&&e<=nn.NINE}function FD(e){return e>=nn.UPPER_A&&e<=nn.UPPER_F||e>=nn.LOWER_A&&e<=nn.LOWER_F}function $D(e){return e>=nn.UPPER_A&&e<=nn.UPPER_Z||e>=nn.LOWER_A&&e<=nn.LOWER_Z||vp(e)}function HD(e){return e===nn.EQUALS||$D(e)}var Xt;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Xt||(Xt={}));var ai;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(ai||(ai={}));class UD{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=Xt.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=ai.Strict}startEntity(t){this.decodeMode=t,this.state=Xt.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Xt.EntityStart:return t.charCodeAt(n)===nn.NUM?(this.state=Xt.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Xt.NamedEntity,this.stateNamedEntity(t,n));case Xt.NumericStart:return this.stateNumericStart(t,n);case Xt.NumericDecimal:return this.stateNumericDecimal(t,n);case Xt.NumericHex:return this.stateNumericHex(t,n);case Xt.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|PD)===nn.LOWER_X?(this.state=Xt.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Xt.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,i){if(n!==r){const s=r-n;this.result=this.result*Math.pow(i,s)+Number.parseInt(t.substr(n,s),i),this.consumed+=s}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(vp(i)||FD(i))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(vp(i))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(i,2)}return this.addToNumericResult(t,r,n,10),-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===nn.SEMI)this.consumed+=1;else if(this.decodeMode===ai.Strict)return 0;return this.emitCodePoint(BD(this.result),this.consumed),this.errors&&(t!==nn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let i=r[this.treeIndex],s=(i&Li.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const o=t.charCodeAt(n);if(this.treeIndex=GD(r,i,this.treeIndex+Math.max(1,s),o),this.treeIndex<0)return this.result===0||this.decodeMode===ai.Attribute&&(s===0||HD(o))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],s=(i&Li.VALUE_LENGTH)>>14,s!==0){if(o===nn.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==ai.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,i=(r[n]&Li.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[t]&~Li.VALUE_LENGTH:i[t+1],r),n===3&&this.emitCodePoint(i[t+2],r),r}end(){var t;switch(this.state){case Xt.NamedEntity:return this.result!==0&&(this.decodeMode!==ai.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Xt.NumericDecimal:return this.emitNumericEntity(0,2);case Xt.NumericHex:return this.emitNumericEntity(0,3);case Xt.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Xt.EntityStart:return 0}}}function GD(e,t,n,r){const i=(t&Li.BRANCH_LENGTH)>>7,s=t&Li.JUMP_TABLE;if(i===0)return s!==0&&r===s?n:-1;if(s){const l=r-s;return l<0||l>=i?-1:e[n+l]-1}let o=n,a=o+i-1;for(;o<=a;){const l=o+a>>>1,d=e[l];if(d<r)o=l+1;else if(d>r)a=l-1;else return e[l+i]}return-1}var K;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(K||(K={}));var Es;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(Es||(Es={}));var zn;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(zn||(zn={}));var P;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(P||(P={}));var f;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(f||(f={}));const WD=new Map([[P.A,f.A],[P.ADDRESS,f.ADDRESS],[P.ANNOTATION_XML,f.ANNOTATION_XML],[P.APPLET,f.APPLET],[P.AREA,f.AREA],[P.ARTICLE,f.ARTICLE],[P.ASIDE,f.ASIDE],[P.B,f.B],[P.BASE,f.BASE],[P.BASEFONT,f.BASEFONT],[P.BGSOUND,f.BGSOUND],[P.BIG,f.BIG],[P.BLOCKQUOTE,f.BLOCKQUOTE],[P.BODY,f.BODY],[P.BR,f.BR],[P.BUTTON,f.BUTTON],[P.CAPTION,f.CAPTION],[P.CENTER,f.CENTER],[P.CODE,f.CODE],[P.COL,f.COL],[P.COLGROUP,f.COLGROUP],[P.DD,f.DD],[P.DESC,f.DESC],[P.DETAILS,f.DETAILS],[P.DIALOG,f.DIALOG],[P.DIR,f.DIR],[P.DIV,f.DIV],[P.DL,f.DL],[P.DT,f.DT],[P.EM,f.EM],[P.EMBED,f.EMBED],[P.FIELDSET,f.FIELDSET],[P.FIGCAPTION,f.FIGCAPTION],[P.FIGURE,f.FIGURE],[P.FONT,f.FONT],[P.FOOTER,f.FOOTER],[P.FOREIGN_OBJECT,f.FOREIGN_OBJECT],[P.FORM,f.FORM],[P.FRAME,f.FRAME],[P.FRAMESET,f.FRAMESET],[P.H1,f.H1],[P.H2,f.H2],[P.H3,f.H3],[P.H4,f.H4],[P.H5,f.H5],[P.H6,f.H6],[P.HEAD,f.HEAD],[P.HEADER,f.HEADER],[P.HGROUP,f.HGROUP],[P.HR,f.HR],[P.HTML,f.HTML],[P.I,f.I],[P.IMG,f.IMG],[P.IMAGE,f.IMAGE],[P.INPUT,f.INPUT],[P.IFRAME,f.IFRAME],[P.KEYGEN,f.KEYGEN],[P.LABEL,f.LABEL],[P.LI,f.LI],[P.LINK,f.LINK],[P.LISTING,f.LISTING],[P.MAIN,f.MAIN],[P.MALIGNMARK,f.MALIGNMARK],[P.MARQUEE,f.MARQUEE],[P.MATH,f.MATH],[P.MENU,f.MENU],[P.META,f.META],[P.MGLYPH,f.MGLYPH],[P.MI,f.MI],[P.MO,f.MO],[P.MN,f.MN],[P.MS,f.MS],[P.MTEXT,f.MTEXT],[P.NAV,f.NAV],[P.NOBR,f.NOBR],[P.NOFRAMES,f.NOFRAMES],[P.NOEMBED,f.NOEMBED],[P.NOSCRIPT,f.NOSCRIPT],[P.OBJECT,f.OBJECT],[P.OL,f.OL],[P.OPTGROUP,f.OPTGROUP],[P.OPTION,f.OPTION],[P.P,f.P],[P.PARAM,f.PARAM],[P.PLAINTEXT,f.PLAINTEXT],[P.PRE,f.PRE],[P.RB,f.RB],[P.RP,f.RP],[P.RT,f.RT],[P.RTC,f.RTC],[P.RUBY,f.RUBY],[P.S,f.S],[P.SCRIPT,f.SCRIPT],[P.SEARCH,f.SEARCH],[P.SECTION,f.SECTION],[P.SELECT,f.SELECT],[P.SOURCE,f.SOURCE],[P.SMALL,f.SMALL],[P.SPAN,f.SPAN],[P.STRIKE,f.STRIKE],[P.STRONG,f.STRONG],[P.STYLE,f.STYLE],[P.SUB,f.SUB],[P.SUMMARY,f.SUMMARY],[P.SUP,f.SUP],[P.TABLE,f.TABLE],[P.TBODY,f.TBODY],[P.TEMPLATE,f.TEMPLATE],[P.TEXTAREA,f.TEXTAREA],[P.TFOOT,f.TFOOT],[P.TD,f.TD],[P.TH,f.TH],[P.THEAD,f.THEAD],[P.TITLE,f.TITLE],[P.TR,f.TR],[P.TRACK,f.TRACK],[P.TT,f.TT],[P.U,f.U],[P.UL,f.UL],[P.SVG,f.SVG],[P.VAR,f.VAR],[P.WBR,f.WBR],[P.XMP,f.XMP]]);function qd(e){var t;return(t=WD.get(e))!==null&&t!==void 0?t:f.UNKNOWN}const X=f,YD={[K.HTML]:new Set([X.ADDRESS,X.APPLET,X.AREA,X.ARTICLE,X.ASIDE,X.BASE,X.BASEFONT,X.BGSOUND,X.BLOCKQUOTE,X.BODY,X.BR,X.BUTTON,X.CAPTION,X.CENTER,X.COL,X.COLGROUP,X.DD,X.DETAILS,X.DIR,X.DIV,X.DL,X.DT,X.EMBED,X.FIELDSET,X.FIGCAPTION,X.FIGURE,X.FOOTER,X.FORM,X.FRAME,X.FRAMESET,X.H1,X.H2,X.H3,X.H4,X.H5,X.H6,X.HEAD,X.HEADER,X.HGROUP,X.HR,X.HTML,X.IFRAME,X.IMG,X.INPUT,X.LI,X.LINK,X.LISTING,X.MAIN,X.MARQUEE,X.MENU,X.META,X.NAV,X.NOEMBED,X.NOFRAMES,X.NOSCRIPT,X.OBJECT,X.OL,X.P,X.PARAM,X.PLAINTEXT,X.PRE,X.SCRIPT,X.SECTION,X.SELECT,X.SOURCE,X.STYLE,X.SUMMARY,X.TABLE,X.TBODY,X.TD,X.TEMPLATE,X.TEXTAREA,X.TFOOT,X.TH,X.THEAD,X.TITLE,X.TR,X.TRACK,X.UL,X.WBR,X.XMP]),[K.MATHML]:new Set([X.MI,X.MO,X.MN,X.MS,X.MTEXT,X.ANNOTATION_XML]),[K.SVG]:new Set([X.TITLE,X.FOREIGN_OBJECT,X.DESC]),[K.XLINK]:new Set,[K.XML]:new Set,[K.XMLNS]:new Set},wp=new Set([X.H1,X.H2,X.H3,X.H4,X.H5,X.H6]),zD=new Set([P.STYLE,P.SCRIPT,P.XMP,P.IFRAME,P.NOEMBED,P.NOFRAMES,P.PLAINTEXT]);function KD(e,t){return zD.has(e)||t&&e===P.NOSCRIPT}var N;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(N||(N={}));const Bn={DATA:N.DATA,RCDATA:N.RCDATA,RAWTEXT:N.RAWTEXT,SCRIPT_DATA:N.SCRIPT_DATA,PLAINTEXT:N.PLAINTEXT,CDATA_SECTION:N.CDATA_SECTION};function QD(e){return e>=T.DIGIT_0&&e<=T.DIGIT_9}function da(e){return e>=T.LATIN_CAPITAL_A&&e<=T.LATIN_CAPITAL_Z}function VD(e){return e>=T.LATIN_SMALL_A&&e<=T.LATIN_SMALL_Z}function ki(e){return VD(e)||da(e)}function xA(e){return ki(e)||QD(e)}function Hl(e){return e+32}function Yv(e){return e===T.SPACE||e===T.LINE_FEED||e===T.TABULATION||e===T.FORM_FEED}function vA(e){return Yv(e)||e===T.SOLIDUS||e===T.GREATER_THAN_SIGN}function qD(e){return e===T.NULL?U.nullCharacterReference:e>1114111?U.characterReferenceOutsideUnicodeRange:Hv(e)?U.surrogateCharacterReference:Gv(e)?U.noncharacterCharacterReference:Uv(e)||e===T.CARRIAGE_RETURN?U.controlCharacterReference:null}let JD=class{constructor(e,t){this.options=e,this.handler=t,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=N.DATA,this.returnState=N.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new RD(t),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new UD(LD,(n,r)=>{this.preprocessor.pos=this.entityStartPos+r-1,this._flushCodePointConsumedAsCharacterReference(n)},t.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(U.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:n=>{this._err(U.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+n)},validateNumericCharacterReference:n=>{const r=qD(n);r&&this._err(r,1)}}:void 0)}_err(e,t=0){var n,r;(r=(n=this.handler).onParseError)===null||r===void 0||r.call(n,this.preprocessor.getError(e,t))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e==null||e())}write(e,t,n){this.active=!0,this.preprocessor.write(e,t),this._runParsingLoop(),this.paused||n==null||n()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let t=0;t<e;t++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,t){return this.preprocessor.startsWith(e,t)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:tt.START_TAG,tagName:"",tagID:f.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:tt.END_TAG,tagName:"",tagID:f.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:tt.COMMENT,data:"",location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:tt.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,t){this.currentCharacterToken={type:e,chars:t,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e,t;const n=this.currentToken;if(Wv(n,this.currentAttr.name)===null){if(n.attrs.push(this.currentAttr),n.location&&this.currentLocation){const r=(e=(t=n.location).attrs)!==null&&e!==void 0?e:t.attrs=Object.create(null);r[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(U.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const e=this.currentToken;this.prepareToken(e),e.tagID=qd(e.tagName),e.type===tt.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(U.endTagWithAttributes),e.selfClosing&&this._err(U.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case tt.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case tt.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case tt.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:tt.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,t){if(this.currentCharacterToken)if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=t;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(e,t)}_emitCodePoint(e){const t=Yv(e)?tt.WHITESPACE_CHARACTER:e===T.NULL?tt.NULL_CHARACTER:tt.CHARACTER;this._appendCharToCurrentCharacterToken(t,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(tt.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=N.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?ai.Attribute:ai.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===N.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===N.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===N.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case N.DATA:{this._stateData(e);break}case N.RCDATA:{this._stateRcdata(e);break}case N.RAWTEXT:{this._stateRawtext(e);break}case N.SCRIPT_DATA:{this._stateScriptData(e);break}case N.PLAINTEXT:{this._statePlaintext(e);break}case N.TAG_OPEN:{this._stateTagOpen(e);break}case N.END_TAG_OPEN:{this._stateEndTagOpen(e);break}case N.TAG_NAME:{this._stateTagName(e);break}case N.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(e);break}case N.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(e);break}case N.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(e);break}case N.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(e);break}case N.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(e);break}case N.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(e);break}case N.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(e);break}case N.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(e);break}case N.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(e);break}case N.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(e);break}case N.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(e);break}case N.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(e);break}case N.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(e);break}case N.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(e);break}case N.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(e);break}case N.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(e);break}case N.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(e);break}case N.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(e);break}case N.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(e);break}case N.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(e);break}case N.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(e);break}case N.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(e);break}case N.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(e);break}case N.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(e);break}case N.ATTRIBUTE_NAME:{this._stateAttributeName(e);break}case N.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(e);break}case N.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(e);break}case N.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(e);break}case N.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(e);break}case N.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(e);break}case N.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(e);break}case N.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(e);break}case N.BOGUS_COMMENT:{this._stateBogusComment(e);break}case N.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(e);break}case N.COMMENT_START:{this._stateCommentStart(e);break}case N.COMMENT_START_DASH:{this._stateCommentStartDash(e);break}case N.COMMENT:{this._stateComment(e);break}case N.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(e);break}case N.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(e);break}case N.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(e);break}case N.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(e);break}case N.COMMENT_END_DASH:{this._stateCommentEndDash(e);break}case N.COMMENT_END:{this._stateCommentEnd(e);break}case N.COMMENT_END_BANG:{this._stateCommentEndBang(e);break}case N.DOCTYPE:{this._stateDoctype(e);break}case N.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(e);break}case N.DOCTYPE_NAME:{this._stateDoctypeName(e);break}case N.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(e);break}case N.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(e);break}case N.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(e);break}case N.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(e);break}case N.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(e);break}case N.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(e);break}case N.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break}case N.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(e);break}case N.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(e);break}case N.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(e);break}case N.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(e);break}case N.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(e);break}case N.BOGUS_DOCTYPE:{this._stateBogusDoctype(e);break}case N.CDATA_SECTION:{this._stateCdataSection(e);break}case N.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(e);break}case N.CDATA_SECTION_END:{this._stateCdataSectionEnd(e);break}case N.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case N.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(e);break}default:throw new Error("Unknown state")}}_stateData(e){switch(e){case T.LESS_THAN_SIGN:{this.state=N.TAG_OPEN;break}case T.AMPERSAND:{this._startCharacterReference();break}case T.NULL:{this._err(U.unexpectedNullCharacter),this._emitCodePoint(e);break}case T.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case T.AMPERSAND:{this._startCharacterReference();break}case T.LESS_THAN_SIGN:{this.state=N.RCDATA_LESS_THAN_SIGN;break}case T.NULL:{this._err(U.unexpectedNullCharacter),this._emitChars(It);break}case T.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case T.LESS_THAN_SIGN:{this.state=N.RAWTEXT_LESS_THAN_SIGN;break}case T.NULL:{this._err(U.unexpectedNullCharacter),this._emitChars(It);break}case T.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case T.LESS_THAN_SIGN:{this.state=N.SCRIPT_DATA_LESS_THAN_SIGN;break}case T.NULL:{this._err(U.unexpectedNullCharacter),this._emitChars(It);break}case T.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case T.NULL:{this._err(U.unexpectedNullCharacter),this._emitChars(It);break}case T.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateTagOpen(e){if(ki(e))this._createStartTagToken(),this.state=N.TAG_NAME,this._stateTagName(e);else switch(e){case T.EXCLAMATION_MARK:{this.state=N.MARKUP_DECLARATION_OPEN;break}case T.SOLIDUS:{this.state=N.END_TAG_OPEN;break}case T.QUESTION_MARK:{this._err(U.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=N.BOGUS_COMMENT,this._stateBogusComment(e);break}case T.EOF:{this._err(U.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(U.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=N.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(ki(e))this._createEndTagToken(),this.state=N.TAG_NAME,this._stateTagName(e);else switch(e){case T.GREATER_THAN_SIGN:{this._err(U.missingEndTagName),this.state=N.DATA;break}case T.EOF:{this._err(U.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(U.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=N.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){const t=this.currentToken;switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=N.BEFORE_ATTRIBUTE_NAME;break}case T.SOLIDUS:{this.state=N.SELF_CLOSING_START_TAG;break}case T.GREATER_THAN_SIGN:{this.state=N.DATA,this.emitCurrentTagToken();break}case T.NULL:{this._err(U.unexpectedNullCharacter),t.tagName+=It;break}case T.EOF:{this._err(U.eofInTag),this._emitEOFToken();break}default:t.tagName+=String.fromCodePoint(da(e)?Hl(e):e)}}_stateRcdataLessThanSign(e){e===T.SOLIDUS?this.state=N.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=N.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){ki(e)?(this.state=N.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars("</"),this.state=N.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const t=this.currentToken;switch(t.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=N.BEFORE_ATTRIBUTE_NAME,!1;case T.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=N.SELF_CLOSING_START_TAG,!1;case T.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=N.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=N.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===T.SOLIDUS?this.state=N.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=N.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){ki(e)?(this.state=N.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars("</"),this.state=N.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=N.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case T.SOLIDUS:{this.state=N.SCRIPT_DATA_END_TAG_OPEN;break}case T.EXCLAMATION_MARK:{this.state=N.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=N.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){ki(e)?(this.state=N.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars("</"),this.state=N.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=N.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===T.HYPHEN_MINUS?(this.state=N.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=N.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===T.HYPHEN_MINUS?(this.state=N.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=N.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case T.HYPHEN_MINUS:{this.state=N.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=N.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case T.NULL:{this._err(U.unexpectedNullCharacter),this._emitChars(It);break}case T.EOF:{this._err(U.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case T.HYPHEN_MINUS:{this.state=N.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=N.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case T.NULL:{this._err(U.unexpectedNullCharacter),this.state=N.SCRIPT_DATA_ESCAPED,this._emitChars(It);break}case T.EOF:{this._err(U.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=N.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case T.HYPHEN_MINUS:{this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=N.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case T.GREATER_THAN_SIGN:{this.state=N.SCRIPT_DATA,this._emitChars(">");break}case T.NULL:{this._err(U.unexpectedNullCharacter),this.state=N.SCRIPT_DATA_ESCAPED,this._emitChars(It);break}case T.EOF:{this._err(U.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=N.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===T.SOLIDUS?this.state=N.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:ki(e)?(this._emitChars("<"),this.state=N.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=N.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){ki(e)?(this.state=N.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("</"),this.state=N.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=N.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(Rn.SCRIPT,!1)&&vA(this.preprocessor.peek(Rn.SCRIPT.length))){this._emitCodePoint(e);for(let t=0;t<Rn.SCRIPT.length;t++)this._emitCodePoint(this._consume());this.state=N.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=N.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case T.HYPHEN_MINUS:{this.state=N.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=N.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case T.NULL:{this._err(U.unexpectedNullCharacter),this._emitChars(It);break}case T.EOF:{this._err(U.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case T.HYPHEN_MINUS:{this.state=N.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=N.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case T.NULL:{this._err(U.unexpectedNullCharacter),this.state=N.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(It);break}case T.EOF:{this._err(U.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=N.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case T.HYPHEN_MINUS:{this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=N.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case T.GREATER_THAN_SIGN:{this.state=N.SCRIPT_DATA,this._emitChars(">");break}case T.NULL:{this._err(U.unexpectedNullCharacter),this.state=N.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(It);break}case T.EOF:{this._err(U.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=N.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===T.SOLIDUS?(this.state=N.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=N.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(Rn.SCRIPT,!1)&&vA(this.preprocessor.peek(Rn.SCRIPT.length))){this._emitCodePoint(e);for(let t=0;t<Rn.SCRIPT.length;t++)this._emitCodePoint(this._consume());this.state=N.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=N.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.SOLIDUS:case T.GREATER_THAN_SIGN:case T.EOF:{this.state=N.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case T.EQUALS_SIGN:{this._err(U.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=N.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=N.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:case T.SOLIDUS:case T.GREATER_THAN_SIGN:case T.EOF:{this._leaveAttrName(),this.state=N.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case T.EQUALS_SIGN:{this._leaveAttrName(),this.state=N.BEFORE_ATTRIBUTE_VALUE;break}case T.QUOTATION_MARK:case T.APOSTROPHE:case T.LESS_THAN_SIGN:{this._err(U.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break}case T.NULL:{this._err(U.unexpectedNullCharacter),this.currentAttr.name+=It;break}default:this.currentAttr.name+=String.fromCodePoint(da(e)?Hl(e):e)}}_stateAfterAttributeName(e){switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.SOLIDUS:{this.state=N.SELF_CLOSING_START_TAG;break}case T.EQUALS_SIGN:{this.state=N.BEFORE_ATTRIBUTE_VALUE;break}case T.GREATER_THAN_SIGN:{this.state=N.DATA,this.emitCurrentTagToken();break}case T.EOF:{this._err(U.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=N.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.QUOTATION_MARK:{this.state=N.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case T.APOSTROPHE:{this.state=N.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case T.GREATER_THAN_SIGN:{this._err(U.missingAttributeValue),this.state=N.DATA,this.emitCurrentTagToken();break}default:this.state=N.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case T.QUOTATION_MARK:{this.state=N.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case T.AMPERSAND:{this._startCharacterReference();break}case T.NULL:{this._err(U.unexpectedNullCharacter),this.currentAttr.value+=It;break}case T.EOF:{this._err(U.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case T.APOSTROPHE:{this.state=N.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case T.AMPERSAND:{this._startCharacterReference();break}case T.NULL:{this._err(U.unexpectedNullCharacter),this.currentAttr.value+=It;break}case T.EOF:{this._err(U.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this._leaveAttrValue(),this.state=N.BEFORE_ATTRIBUTE_NAME;break}case T.AMPERSAND:{this._startCharacterReference();break}case T.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=N.DATA,this.emitCurrentTagToken();break}case T.NULL:{this._err(U.unexpectedNullCharacter),this.currentAttr.value+=It;break}case T.QUOTATION_MARK:case T.APOSTROPHE:case T.LESS_THAN_SIGN:case T.EQUALS_SIGN:case T.GRAVE_ACCENT:{this._err(U.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break}case T.EOF:{this._err(U.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this._leaveAttrValue(),this.state=N.BEFORE_ATTRIBUTE_NAME;break}case T.SOLIDUS:{this._leaveAttrValue(),this.state=N.SELF_CLOSING_START_TAG;break}case T.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=N.DATA,this.emitCurrentTagToken();break}case T.EOF:{this._err(U.eofInTag),this._emitEOFToken();break}default:this._err(U.missingWhitespaceBetweenAttributes),this.state=N.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case T.GREATER_THAN_SIGN:{const t=this.currentToken;t.selfClosing=!0,this.state=N.DATA,this.emitCurrentTagToken();break}case T.EOF:{this._err(U.eofInTag),this._emitEOFToken();break}default:this._err(U.unexpectedSolidusInTag),this.state=N.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){const t=this.currentToken;switch(e){case T.GREATER_THAN_SIGN:{this.state=N.DATA,this.emitCurrentComment(t);break}case T.EOF:{this.emitCurrentComment(t),this._emitEOFToken();break}case T.NULL:{this._err(U.unexpectedNullCharacter),t.data+=It;break}default:t.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(Rn.DASH_DASH,!0)?(this._createCommentToken(Rn.DASH_DASH.length+1),this.state=N.COMMENT_START):this._consumeSequenceIfMatch(Rn.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Rn.DOCTYPE.length+1),this.state=N.DOCTYPE):this._consumeSequenceIfMatch(Rn.CDATA_START,!0)?this.inForeignNode?this.state=N.CDATA_SECTION:(this._err(U.cdataInHtmlContent),this._createCommentToken(Rn.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=N.BOGUS_COMMENT):this._ensureHibernation()||(this._err(U.incorrectlyOpenedComment),this._createCommentToken(2),this.state=N.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case T.HYPHEN_MINUS:{this.state=N.COMMENT_START_DASH;break}case T.GREATER_THAN_SIGN:{this._err(U.abruptClosingOfEmptyComment),this.state=N.DATA;const t=this.currentToken;this.emitCurrentComment(t);break}default:this.state=N.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){const t=this.currentToken;switch(e){case T.HYPHEN_MINUS:{this.state=N.COMMENT_END;break}case T.GREATER_THAN_SIGN:{this._err(U.abruptClosingOfEmptyComment),this.state=N.DATA,this.emitCurrentComment(t);break}case T.EOF:{this._err(U.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break}default:t.data+="-",this.state=N.COMMENT,this._stateComment(e)}}_stateComment(e){const t=this.currentToken;switch(e){case T.HYPHEN_MINUS:{this.state=N.COMMENT_END_DASH;break}case T.LESS_THAN_SIGN:{t.data+="<",this.state=N.COMMENT_LESS_THAN_SIGN;break}case T.NULL:{this._err(U.unexpectedNullCharacter),t.data+=It;break}case T.EOF:{this._err(U.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break}default:t.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){const t=this.currentToken;switch(e){case T.EXCLAMATION_MARK:{t.data+="!",this.state=N.COMMENT_LESS_THAN_SIGN_BANG;break}case T.LESS_THAN_SIGN:{t.data+="<";break}default:this.state=N.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===T.HYPHEN_MINUS?this.state=N.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=N.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===T.HYPHEN_MINUS?this.state=N.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=N.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==T.GREATER_THAN_SIGN&&e!==T.EOF&&this._err(U.nestedComment),this.state=N.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){const t=this.currentToken;switch(e){case T.HYPHEN_MINUS:{this.state=N.COMMENT_END;break}case T.EOF:{this._err(U.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break}default:t.data+="-",this.state=N.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){const t=this.currentToken;switch(e){case T.GREATER_THAN_SIGN:{this.state=N.DATA,this.emitCurrentComment(t);break}case T.EXCLAMATION_MARK:{this.state=N.COMMENT_END_BANG;break}case T.HYPHEN_MINUS:{t.data+="-";break}case T.EOF:{this._err(U.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break}default:t.data+="--",this.state=N.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){const t=this.currentToken;switch(e){case T.HYPHEN_MINUS:{t.data+="--!",this.state=N.COMMENT_END_DASH;break}case T.GREATER_THAN_SIGN:{this._err(U.incorrectlyClosedComment),this.state=N.DATA,this.emitCurrentComment(t);break}case T.EOF:{this._err(U.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break}default:t.data+="--!",this.state=N.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=N.BEFORE_DOCTYPE_NAME;break}case T.GREATER_THAN_SIGN:{this.state=N.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break}case T.EOF:{this._err(U.eofInDoctype),this._createDoctypeToken(null);const t=this.currentToken;t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(U.missingWhitespaceBeforeDoctypeName),this.state=N.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(da(e))this._createDoctypeToken(String.fromCharCode(Hl(e))),this.state=N.DOCTYPE_NAME;else switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.NULL:{this._err(U.unexpectedNullCharacter),this._createDoctypeToken(It),this.state=N.DOCTYPE_NAME;break}case T.GREATER_THAN_SIGN:{this._err(U.missingDoctypeName),this._createDoctypeToken(null);const t=this.currentToken;t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=N.DATA;break}case T.EOF:{this._err(U.eofInDoctype),this._createDoctypeToken(null);const t=this.currentToken;t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=N.DOCTYPE_NAME}}_stateDoctypeName(e){const t=this.currentToken;switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=N.AFTER_DOCTYPE_NAME;break}case T.GREATER_THAN_SIGN:{this.state=N.DATA,this.emitCurrentDoctype(t);break}case T.NULL:{this._err(U.unexpectedNullCharacter),t.name+=It;break}case T.EOF:{this._err(U.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:t.name+=String.fromCodePoint(da(e)?Hl(e):e)}}_stateAfterDoctypeName(e){const t=this.currentToken;switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.GREATER_THAN_SIGN:{this.state=N.DATA,this.emitCurrentDoctype(t);break}case T.EOF:{this._err(U.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Rn.PUBLIC,!1)?this.state=N.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Rn.SYSTEM,!1)?this.state=N.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(U.invalidCharacterSequenceAfterDoctypeName),t.forceQuirks=!0,this.state=N.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){const t=this.currentToken;switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=N.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case T.QUOTATION_MARK:{this._err(U.missingWhitespaceAfterDoctypePublicKeyword),t.publicId="",this.state=N.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{this._err(U.missingWhitespaceAfterDoctypePublicKeyword),t.publicId="",this.state=N.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case T.GREATER_THAN_SIGN:{this._err(U.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=N.DATA,this.emitCurrentDoctype(t);break}case T.EOF:{this._err(U.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(U.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=N.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){const t=this.currentToken;switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.QUOTATION_MARK:{t.publicId="",this.state=N.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{t.publicId="",this.state=N.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case T.GREATER_THAN_SIGN:{this._err(U.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=N.DATA,this.emitCurrentDoctype(t);break}case T.EOF:{this._err(U.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(U.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=N.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){const t=this.currentToken;switch(e){case T.QUOTATION_MARK:{this.state=N.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case T.NULL:{this._err(U.unexpectedNullCharacter),t.publicId+=It;break}case T.GREATER_THAN_SIGN:{this._err(U.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=N.DATA;break}case T.EOF:{this._err(U.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:t.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){const t=this.currentToken;switch(e){case T.APOSTROPHE:{this.state=N.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case T.NULL:{this._err(U.unexpectedNullCharacter),t.publicId+=It;break}case T.GREATER_THAN_SIGN:{this._err(U.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=N.DATA;break}case T.EOF:{this._err(U.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:t.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){const t=this.currentToken;switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=N.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case T.GREATER_THAN_SIGN:{this.state=N.DATA,this.emitCurrentDoctype(t);break}case T.QUOTATION_MARK:{this._err(U.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId="",this.state=N.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{this._err(U.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId="",this.state=N.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case T.EOF:{this._err(U.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(U.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=N.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){const t=this.currentToken;switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.GREATER_THAN_SIGN:{this.emitCurrentDoctype(t),this.state=N.DATA;break}case T.QUOTATION_MARK:{t.systemId="",this.state=N.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{t.systemId="",this.state=N.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case T.EOF:{this._err(U.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(U.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=N.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){const t=this.currentToken;switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=N.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case T.QUOTATION_MARK:{this._err(U.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId="",this.state=N.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{this._err(U.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId="",this.state=N.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case T.GREATER_THAN_SIGN:{this._err(U.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=N.DATA,this.emitCurrentDoctype(t);break}case T.EOF:{this._err(U.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(U.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=N.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){const t=this.currentToken;switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.QUOTATION_MARK:{t.systemId="",this.state=N.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{t.systemId="",this.state=N.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case T.GREATER_THAN_SIGN:{this._err(U.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=N.DATA,this.emitCurrentDoctype(t);break}case T.EOF:{this._err(U.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(U.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=N.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){const t=this.currentToken;switch(e){case T.QUOTATION_MARK:{this.state=N.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case T.NULL:{this._err(U.unexpectedNullCharacter),t.systemId+=It;break}case T.GREATER_THAN_SIGN:{this._err(U.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=N.DATA;break}case T.EOF:{this._err(U.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:t.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){const t=this.currentToken;switch(e){case T.APOSTROPHE:{this.state=N.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case T.NULL:{this._err(U.unexpectedNullCharacter),t.systemId+=It;break}case T.GREATER_THAN_SIGN:{this._err(U.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=N.DATA;break}case T.EOF:{this._err(U.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:t.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){const t=this.currentToken;switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.GREATER_THAN_SIGN:{this.emitCurrentDoctype(t),this.state=N.DATA;break}case T.EOF:{this._err(U.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break}default:this._err(U.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=N.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){const t=this.currentToken;switch(e){case T.GREATER_THAN_SIGN:{this.emitCurrentDoctype(t),this.state=N.DATA;break}case T.NULL:{this._err(U.unexpectedNullCharacter);break}case T.EOF:{this.emitCurrentDoctype(t),this._emitEOFToken();break}}}_stateCdataSection(e){switch(e){case T.RIGHT_SQUARE_BRACKET:{this.state=N.CDATA_SECTION_BRACKET;break}case T.EOF:{this._err(U.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===T.RIGHT_SQUARE_BRACKET?this.state=N.CDATA_SECTION_END:(this._emitChars("]"),this.state=N.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case T.GREATER_THAN_SIGN:{this.state=N.DATA;break}case T.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=N.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0)if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(T.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&xA(this.preprocessor.peek(1))?N.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){xA(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===T.SEMICOLON&&this._err(U.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}};const zv=new Set([f.DD,f.DT,f.LI,f.OPTGROUP,f.OPTION,f.P,f.RB,f.RP,f.RT,f.RTC]),wA=new Set([...zv,f.CAPTION,f.COLGROUP,f.TBODY,f.TD,f.TFOOT,f.TH,f.THEAD,f.TR]),$c=new Set([f.APPLET,f.CAPTION,f.HTML,f.MARQUEE,f.OBJECT,f.TABLE,f.TD,f.TEMPLATE,f.TH]),ZD=new Set([...$c,f.OL,f.UL]),XD=new Set([...$c,f.BUTTON]),kA=new Set([f.ANNOTATION_XML,f.MI,f.MN,f.MO,f.MS,f.MTEXT]),EA=new Set([f.DESC,f.FOREIGN_OBJECT,f.TITLE]),eM=new Set([f.TR,f.TEMPLATE,f.HTML]),tM=new Set([f.TBODY,f.TFOOT,f.THEAD,f.TEMPLATE,f.HTML]),nM=new Set([f.TABLE,f.TEMPLATE,f.HTML]),rM=new Set([f.TD,f.TH]);let iM=class{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=f.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===f.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===K.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,n){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,n,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const i=this._indexOf(t)+1;this.items.splice(i,0,n),this.tagIDs.splice(i,0,r),this.stackTop++,i===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,i===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==K.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<t)}}popUntilElementPopped(t){const n=this._indexOf(t);this.shortenToLength(Math.max(n,0))}popUntilPopped(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(wp,K.HTML)}popUntilTableCellPopped(){this.popUntilPopped(rM,K.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,n){for(let r=this.stackTop;r>=0;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(nM,K.HTML)}clearBackToTableBodyContext(){this.clearBackTo(tM,K.HTML)}clearBackToTableRowContext(){this.clearBackTo(eM,K.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===f.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===f.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const i=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case K.HTML:{if(i===t)return!0;if(n.has(i))return!1;break}case K.SVG:{if(EA.has(i))return!1;break}case K.MATHML:{if(kA.has(i))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,$c)}hasInListItemScope(t){return this.hasInDynamicScope(t,ZD)}hasInButtonScope(t){return this.hasInDynamicScope(t,XD)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case K.HTML:{if(wp.has(n))return!0;if($c.has(n))return!1;break}case K.SVG:{if(EA.has(n))return!1;break}case K.MATHML:{if(kA.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===K.HTML)switch(this.tagIDs[n]){case t:return!0;case f.TABLE:case f.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===K.HTML)switch(this.tagIDs[t]){case f.TBODY:case f.THEAD:case f.TFOOT:return!0;case f.TABLE:case f.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===K.HTML)switch(this.tagIDs[n]){case t:return!0;case f.OPTION:case f.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&zv.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&wA.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&wA.has(this.currentTagId);)this.pop()}};const Vu=3;var Pr;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Pr||(Pr={}));const CA={type:Pr.Marker};let sM=class{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],i=n.length,s=this.treeAdapter.getTagName(t),o=this.treeAdapter.getNamespaceURI(t);for(let a=0;a<this.entries.length;a++){const l=this.entries[a];if(l.type===Pr.Marker)break;const{element:d}=l;if(this.treeAdapter.getTagName(d)===s&&this.treeAdapter.getNamespaceURI(d)===o){const u=this.treeAdapter.getAttrList(d);u.length===i&&r.push({idx:a,attrs:u})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<Vu)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<Vu)return;const i=new Map(n.map(o=>[o.name,o.value]));let s=0;for(let o=0;o<r.length;o++){const a=r[o];a.attrs.every(l=>i.get(l.name)===l.value)&&(s+=1,s>=Vu&&this.entries.splice(a.idx,1))}}insertMarker(){this.entries.unshift(CA)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:Pr.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:Pr.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(CA);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===Pr.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===Pr.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===Pr.Element&&n.element===t)}};const si={createDocument(){return{nodeName:"#document",mode:zn.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const i=e.childNodes.find(s=>s.nodeName==="#documentType");if(i)i.name=t,i.publicId=n,i.systemId=r;else{const s={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};si.appendChild(e,s)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(si.isTextNode(n)){n.value+=t;return}}si.appendChild(e,si.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&si.isTextNode(r)?r.value+=t:si.insertBefore(e,si.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},Kv="html",oM="about:legacy-compat",aM="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",Qv=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],lM=[...Qv,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],cM=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),Vv=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],dM=[...Vv,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function TA(e,t){return t.some(n=>e.startsWith(n))}function uM(e){return e.name===Kv&&e.publicId===null&&(e.systemId===null||e.systemId===oM)}function hM(e){if(e.name!==Kv)return zn.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===aM)return zn.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),cM.has(n))return zn.QUIRKS;let r=t===null?lM:Qv;if(TA(n,r))return zn.QUIRKS;if(r=t===null?Vv:dM,TA(n,r))return zn.LIMITED_QUIRKS}return zn.NO_QUIRKS}const SA={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},pM="definitionurl",mM="definitionURL",fM=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),gM=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:K.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:K.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:K.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:K.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:K.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:K.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:K.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:K.XML}],["xml:space",{prefix:"xml",name:"space",namespace:K.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:K.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:K.XMLNS}]]),AM=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),bM=new Set([f.B,f.BIG,f.BLOCKQUOTE,f.BODY,f.BR,f.CENTER,f.CODE,f.DD,f.DIV,f.DL,f.DT,f.EM,f.EMBED,f.H1,f.H2,f.H3,f.H4,f.H5,f.H6,f.HEAD,f.HR,f.I,f.IMG,f.LI,f.LISTING,f.MENU,f.META,f.NOBR,f.OL,f.P,f.PRE,f.RUBY,f.S,f.SMALL,f.SPAN,f.STRONG,f.STRIKE,f.SUB,f.SUP,f.TABLE,f.TT,f.U,f.UL,f.VAR]);function yM(e){const t=e.tagID;return t===f.FONT&&e.attrs.some(({name:n})=>n===Es.COLOR||n===Es.SIZE||n===Es.FACE)||bM.has(t)}function qv(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===pM){e.attrs[t].name=mM;break}}function Jv(e){for(let t=0;t<e.attrs.length;t++){const n=fM.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function Um(e){for(let t=0;t<e.attrs.length;t++){const n=gM.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function xM(e){const t=AM.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=qd(e.tagName))}function vM(e,t){return t===K.MATHML&&(e===f.MI||e===f.MO||e===f.MN||e===f.MS||e===f.MTEXT)}function wM(e,t,n){if(t===K.MATHML&&e===f.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===Es.ENCODING){const i=n[r].value.toLowerCase();return i===SA.TEXT_HTML||i===SA.APPLICATION_XML}}return t===K.SVG&&(e===f.FOREIGN_OBJECT||e===f.DESC||e===f.TITLE)}function kM(e,t,n,r){return(!r||r===K.HTML)&&wM(e,t,n)||(!r||r===K.MATHML)&&vM(e,t)}const EM="hidden",CM=8,TM=3;var D;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(D||(D={}));const SM={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},Zv=new Set([f.TABLE,f.TBODY,f.TFOOT,f.THEAD,f.TR]),_A={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:si,onParseError:null};let Xv=class{constructor(t,n,r=null,i=null){this.fragmentContext=r,this.scriptHandler=i,this.currentToken=null,this.stopped=!1,this.insertionMode=D.INITIAL,this.originalInsertionMode=D.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={..._A,...t},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new JD(this.options,this),this.activeFormattingElements=new sM(this.treeAdapter),this.fragmentContextID=r?qd(this.treeAdapter.getTagName(r)):f.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new iM(this.document,this.treeAdapter,this)}static parse(t,n){const r=new this(n);return r.tokenizer.write(t,!0),r.document}static getFragmentParser(t,n){const r={..._A,...n};t??(t=r.treeAdapter.createElement(P.TEMPLATE,K.HTML,[]));const i=r.treeAdapter.createElement("documentmock",K.HTML,[]),s=new this(r,i,t);return s.fragmentContextID===f.TEMPLATE&&s.tmplInsertionModeStack.unshift(D.IN_TEMPLATE),s._initTokenizerForFragmentParsing(),s._insertFakeRootElement(),s._resetInsertionMode(),s._findFormInFragmentContext(),s}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,r){var i;if(!this.onParseError)return;const s=(i=t.location)!==null&&i!==void 0?i:SM,o={code:n,startLine:s.startLine,startCol:s.startCol,startOffset:s.startOffset,endLine:r?s.startLine:s.endLine,endCol:r?s.startCol:s.endCol,endOffset:r?s.startOffset:s.endOffset};this.onParseError(o)}onItemPush(t,n,r){var i,s;(s=(i=this.treeAdapter).onItemPush)===null||s===void 0||s.call(i,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,i;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(i=(r=this.treeAdapter).onItemPop)===null||i===void 0||i.call(r,t,this.openElements.current),n){let s,o;this.openElements.stackTop===0&&this.fragmentContext?(s=this.fragmentContext,o=this.fragmentContextID):{current:s,currentTagId:o}=this.openElements,this._setContextModes(s,o)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===K.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,K.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=D.TEXT}switchToPlaintextParsing(){this.insertionMode=D.TEXT,this.originalInsertionMode=D.IN_BODY,this.tokenizer.state=Bn.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===P.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==K.HTML))switch(this.fragmentContextID){case f.TITLE:case f.TEXTAREA:{this.tokenizer.state=Bn.RCDATA;break}case f.STYLE:case f.XMP:case f.IFRAME:case f.NOEMBED:case f.NOFRAMES:case f.NOSCRIPT:{this.tokenizer.state=Bn.RAWTEXT;break}case f.SCRIPT:{this.tokenizer.state=Bn.SCRIPT_DATA;break}case f.PLAINTEXT:{this.tokenizer.state=Bn.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",i=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,i),t.location){const s=this.treeAdapter.getChildNodes(this.document).find(o=>this.treeAdapter.isDocumentTypeNode(o));s&&this.treeAdapter.setNodeSourceCodeLocation(s,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,K.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,K.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(P.HTML,K.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,f.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const i=this.treeAdapter.getChildNodes(n),s=r?i.lastIndexOf(r):i.length,o=i[s-1];if(this.treeAdapter.getNodeSourceCodeLocation(o)){const{endLine:a,endCol:l,endOffset:d}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(o,{endLine:a,endCol:l,endOffset:d})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(o,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,i=this.treeAdapter.getTagName(t),s=n.type===tt.END_TAG&&i===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,s)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===f.SVG&&this.treeAdapter.getTagName(n)===P.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===K.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===f.MGLYPH||t.tagID===f.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,K.HTML)}_processToken(t){switch(t.type){case tt.CHARACTER:{this.onCharacter(t);break}case tt.NULL_CHARACTER:{this.onNullCharacter(t);break}case tt.COMMENT:{this.onComment(t);break}case tt.DOCTYPE:{this.onDoctype(t);break}case tt.START_TAG:{this._processStartTag(t);break}case tt.END_TAG:{this.onEndTag(t);break}case tt.EOF:{this.onEof(t);break}case tt.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const i=this.treeAdapter.getNamespaceURI(n),s=this.treeAdapter.getAttrList(n);return kM(t,i,s,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(i=>i.type===Pr.Marker||this.openElements.contains(i.element)),r=n===-1?t-1:n-1;for(let i=r;i>=0;i--){const s=this.activeFormattingElements.entries[i];this._insertElement(s.token,this.treeAdapter.getNamespaceURI(s.element)),s.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=D.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(f.P),this.openElements.popUntilTagNamePopped(f.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case f.TR:{this.insertionMode=D.IN_ROW;return}case f.TBODY:case f.THEAD:case f.TFOOT:{this.insertionMode=D.IN_TABLE_BODY;return}case f.CAPTION:{this.insertionMode=D.IN_CAPTION;return}case f.COLGROUP:{this.insertionMode=D.IN_COLUMN_GROUP;return}case f.TABLE:{this.insertionMode=D.IN_TABLE;return}case f.BODY:{this.insertionMode=D.IN_BODY;return}case f.FRAMESET:{this.insertionMode=D.IN_FRAMESET;return}case f.SELECT:{this._resetInsertionModeForSelect(t);return}case f.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case f.HTML:{this.insertionMode=this.headElement?D.AFTER_HEAD:D.BEFORE_HEAD;return}case f.TD:case f.TH:{if(t>0){this.insertionMode=D.IN_CELL;return}break}case f.HEAD:{if(t>0){this.insertionMode=D.IN_HEAD;return}break}}this.insertionMode=D.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===f.TEMPLATE)break;if(r===f.TABLE){this.insertionMode=D.IN_SELECT_IN_TABLE;return}}this.insertionMode=D.IN_SELECT}_isElementCausesFosterParenting(t){return Zv.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case f.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===K.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case f.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const r=this.treeAdapter.getNamespaceURI(t);return YD[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){rR(this,t);return}switch(this.insertionMode){case D.INITIAL:{Qo(this,t);break}case D.BEFORE_HTML:{wa(this,t);break}case D.BEFORE_HEAD:{ka(this,t);break}case D.IN_HEAD:{Ea(this,t);break}case D.IN_HEAD_NO_SCRIPT:{Ca(this,t);break}case D.AFTER_HEAD:{Ta(this,t);break}case D.IN_BODY:case D.IN_CAPTION:case D.IN_CELL:case D.IN_TEMPLATE:{t1(this,t);break}case D.TEXT:case D.IN_SELECT:case D.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case D.IN_TABLE:case D.IN_TABLE_BODY:case D.IN_ROW:{qu(this,t);break}case D.IN_TABLE_TEXT:{a1(this,t);break}case D.IN_COLUMN_GROUP:{Hc(this,t);break}case D.AFTER_BODY:{Uc(this,t);break}case D.AFTER_AFTER_BODY:{uc(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){nR(this,t);return}switch(this.insertionMode){case D.INITIAL:{Qo(this,t);break}case D.BEFORE_HTML:{wa(this,t);break}case D.BEFORE_HEAD:{ka(this,t);break}case D.IN_HEAD:{Ea(this,t);break}case D.IN_HEAD_NO_SCRIPT:{Ca(this,t);break}case D.AFTER_HEAD:{Ta(this,t);break}case D.TEXT:{this._insertCharacters(t);break}case D.IN_TABLE:case D.IN_TABLE_BODY:case D.IN_ROW:{qu(this,t);break}case D.IN_COLUMN_GROUP:{Hc(this,t);break}case D.AFTER_BODY:{Uc(this,t);break}case D.AFTER_AFTER_BODY:{uc(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){kp(this,t);return}switch(this.insertionMode){case D.INITIAL:case D.BEFORE_HTML:case D.BEFORE_HEAD:case D.IN_HEAD:case D.IN_HEAD_NO_SCRIPT:case D.AFTER_HEAD:case D.IN_BODY:case D.IN_TABLE:case D.IN_CAPTION:case D.IN_COLUMN_GROUP:case D.IN_TABLE_BODY:case D.IN_ROW:case D.IN_CELL:case D.IN_SELECT:case D.IN_SELECT_IN_TABLE:case D.IN_TEMPLATE:case D.IN_FRAMESET:case D.AFTER_FRAMESET:{kp(this,t);break}case D.IN_TABLE_TEXT:{Vo(this,t);break}case D.AFTER_BODY:{RM(this,t);break}case D.AFTER_AFTER_BODY:case D.AFTER_AFTER_FRAMESET:{LM(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case D.INITIAL:{jM(this,t);break}case D.BEFORE_HEAD:case D.IN_HEAD:case D.IN_HEAD_NO_SCRIPT:case D.AFTER_HEAD:{this._err(t,U.misplacedDoctype);break}case D.IN_TABLE_TEXT:{Vo(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,U.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?iR(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case D.INITIAL:{Qo(this,t);break}case D.BEFORE_HTML:{BM(this,t);break}case D.BEFORE_HEAD:{FM(this,t);break}case D.IN_HEAD:{Ir(this,t);break}case D.IN_HEAD_NO_SCRIPT:{UM(this,t);break}case D.AFTER_HEAD:{WM(this,t);break}case D.IN_BODY:{bn(this,t);break}case D.IN_TABLE:{So(this,t);break}case D.IN_TABLE_TEXT:{Vo(this,t);break}case D.IN_CAPTION:{$O(this,t);break}case D.IN_COLUMN_GROUP:{Ym(this,t);break}case D.IN_TABLE_BODY:{Xd(this,t);break}case D.IN_ROW:{eu(this,t);break}case D.IN_CELL:{GO(this,t);break}case D.IN_SELECT:{d1(this,t);break}case D.IN_SELECT_IN_TABLE:{YO(this,t);break}case D.IN_TEMPLATE:{KO(this,t);break}case D.AFTER_BODY:{VO(this,t);break}case D.IN_FRAMESET:{qO(this,t);break}case D.AFTER_FRAMESET:{ZO(this,t);break}case D.AFTER_AFTER_BODY:{eR(this,t);break}case D.AFTER_AFTER_FRAMESET:{tR(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?sR(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case D.INITIAL:{Qo(this,t);break}case D.BEFORE_HTML:{PM(this,t);break}case D.BEFORE_HEAD:{$M(this,t);break}case D.IN_HEAD:{HM(this,t);break}case D.IN_HEAD_NO_SCRIPT:{GM(this,t);break}case D.AFTER_HEAD:{YM(this,t);break}case D.IN_BODY:{Zd(this,t);break}case D.TEXT:{IO(this,t);break}case D.IN_TABLE:{Va(this,t);break}case D.IN_TABLE_TEXT:{Vo(this,t);break}case D.IN_CAPTION:{HO(this,t);break}case D.IN_COLUMN_GROUP:{UO(this,t);break}case D.IN_TABLE_BODY:{Ep(this,t);break}case D.IN_ROW:{c1(this,t);break}case D.IN_CELL:{WO(this,t);break}case D.IN_SELECT:{u1(this,t);break}case D.IN_SELECT_IN_TABLE:{zO(this,t);break}case D.IN_TEMPLATE:{QO(this,t);break}case D.AFTER_BODY:{p1(this,t);break}case D.IN_FRAMESET:{JO(this,t);break}case D.AFTER_FRAMESET:{XO(this,t);break}case D.AFTER_AFTER_BODY:{uc(this,t);break}}}onEof(t){switch(this.insertionMode){case D.INITIAL:{Qo(this,t);break}case D.BEFORE_HTML:{wa(this,t);break}case D.BEFORE_HEAD:{ka(this,t);break}case D.IN_HEAD:{Ea(this,t);break}case D.IN_HEAD_NO_SCRIPT:{Ca(this,t);break}case D.AFTER_HEAD:{Ta(this,t);break}case D.IN_BODY:case D.IN_TABLE:case D.IN_CAPTION:case D.IN_COLUMN_GROUP:case D.IN_TABLE_BODY:case D.IN_ROW:case D.IN_CELL:case D.IN_SELECT:case D.IN_SELECT_IN_TABLE:{s1(this,t);break}case D.TEXT:{DO(this,t);break}case D.IN_TABLE_TEXT:{Vo(this,t);break}case D.IN_TEMPLATE:{h1(this,t);break}case D.AFTER_BODY:case D.IN_FRAMESET:case D.AFTER_FRAMESET:case D.AFTER_AFTER_BODY:case D.AFTER_AFTER_FRAMESET:{Wm(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===T.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case D.IN_HEAD:case D.IN_HEAD_NO_SCRIPT:case D.AFTER_HEAD:case D.TEXT:case D.IN_COLUMN_GROUP:case D.IN_SELECT:case D.IN_SELECT_IN_TABLE:case D.IN_FRAMESET:case D.AFTER_FRAMESET:{this._insertCharacters(t);break}case D.IN_BODY:case D.IN_CAPTION:case D.IN_CELL:case D.IN_TEMPLATE:case D.AFTER_BODY:case D.AFTER_AFTER_BODY:case D.AFTER_AFTER_FRAMESET:{e1(this,t);break}case D.IN_TABLE:case D.IN_TABLE_BODY:case D.IN_ROW:{qu(this,t);break}case D.IN_TABLE_TEXT:{o1(this,t);break}}}};function _M(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):i1(e,t),n}function NM(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function IM(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let s=0,o=i;o!==n;s++,o=i){i=e.openElements.getCommonAncestor(o);const a=e.activeFormattingElements.getElementEntry(o),l=a&&s>=TM;!a||l?(l&&e.activeFormattingElements.removeEntry(a),e.openElements.remove(o)):(o=DM(e,a),r===t&&(e.activeFormattingElements.bookmark=a),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function DM(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function MM(e,t,n){const r=e.treeAdapter.getTagName(t),i=qd(r);if(e._isElementCausesFosterParenting(i))e._fosterParentElement(n);else{const s=e.treeAdapter.getNamespaceURI(t);i===f.TEMPLATE&&s===K.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function OM(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,s=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,s),e.treeAdapter.appendChild(t,s),e.activeFormattingElements.insertElementAfterBookmark(s,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,s,i.tagID)}function Gm(e,t){for(let n=0;n<CM;n++){const r=_M(e,t);if(!r)break;const i=NM(e,r);if(!i)break;e.activeFormattingElements.bookmark=r;const s=IM(e,i,r.element),o=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(s),o&&MM(e,o,s),OM(e,i,r)}}function kp(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function RM(e,t){e._appendCommentNode(t,e.openElements.items[0])}function LM(e,t){e._appendCommentNode(t,e.document)}function Wm(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],i=e.treeAdapter.getNodeSourceCodeLocation(r);if(i&&!i.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const s=e.openElements.items[1],o=e.treeAdapter.getNodeSourceCodeLocation(s);o&&!o.endTag&&e._setEndLocation(s,t)}}}}function jM(e,t){e._setDocumentType(t);const n=t.forceQuirks?zn.QUIRKS:hM(t);uM(t)||e._err(t,U.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=D.BEFORE_HTML}function Qo(e,t){e._err(t,U.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,zn.QUIRKS),e.insertionMode=D.BEFORE_HTML,e._processToken(t)}function BM(e,t){t.tagID===f.HTML?(e._insertElement(t,K.HTML),e.insertionMode=D.BEFORE_HEAD):wa(e,t)}function PM(e,t){const n=t.tagID;(n===f.HTML||n===f.HEAD||n===f.BODY||n===f.BR)&&wa(e,t)}function wa(e,t){e._insertFakeRootElement(),e.insertionMode=D.BEFORE_HEAD,e._processToken(t)}function FM(e,t){switch(t.tagID){case f.HTML:{bn(e,t);break}case f.HEAD:{e._insertElement(t,K.HTML),e.headElement=e.openElements.current,e.insertionMode=D.IN_HEAD;break}default:ka(e,t)}}function $M(e,t){const n=t.tagID;n===f.HEAD||n===f.BODY||n===f.HTML||n===f.BR?ka(e,t):e._err(t,U.endTagWithoutMatchingOpenElement)}function ka(e,t){e._insertFakeElement(P.HEAD,f.HEAD),e.headElement=e.openElements.current,e.insertionMode=D.IN_HEAD,e._processToken(t)}function Ir(e,t){switch(t.tagID){case f.HTML:{bn(e,t);break}case f.BASE:case f.BASEFONT:case f.BGSOUND:case f.LINK:case f.META:{e._appendElement(t,K.HTML),t.ackSelfClosing=!0;break}case f.TITLE:{e._switchToTextParsing(t,Bn.RCDATA);break}case f.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Bn.RAWTEXT):(e._insertElement(t,K.HTML),e.insertionMode=D.IN_HEAD_NO_SCRIPT);break}case f.NOFRAMES:case f.STYLE:{e._switchToTextParsing(t,Bn.RAWTEXT);break}case f.SCRIPT:{e._switchToTextParsing(t,Bn.SCRIPT_DATA);break}case f.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=D.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(D.IN_TEMPLATE);break}case f.HEAD:{e._err(t,U.misplacedStartTagForHeadElement);break}default:Ea(e,t)}}function HM(e,t){switch(t.tagID){case f.HEAD:{e.openElements.pop(),e.insertionMode=D.AFTER_HEAD;break}case f.BODY:case f.BR:case f.HTML:{Ea(e,t);break}case f.TEMPLATE:{Ys(e,t);break}default:e._err(t,U.endTagWithoutMatchingOpenElement)}}function Ys(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==f.TEMPLATE&&e._err(t,U.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(f.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,U.endTagWithoutMatchingOpenElement)}function Ea(e,t){e.openElements.pop(),e.insertionMode=D.AFTER_HEAD,e._processToken(t)}function UM(e,t){switch(t.tagID){case f.HTML:{bn(e,t);break}case f.BASEFONT:case f.BGSOUND:case f.HEAD:case f.LINK:case f.META:case f.NOFRAMES:case f.STYLE:{Ir(e,t);break}case f.NOSCRIPT:{e._err(t,U.nestedNoscriptInHead);break}default:Ca(e,t)}}function GM(e,t){switch(t.tagID){case f.NOSCRIPT:{e.openElements.pop(),e.insertionMode=D.IN_HEAD;break}case f.BR:{Ca(e,t);break}default:e._err(t,U.endTagWithoutMatchingOpenElement)}}function Ca(e,t){const n=t.type===tt.EOF?U.openElementsLeftAfterEof:U.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=D.IN_HEAD,e._processToken(t)}function WM(e,t){switch(t.tagID){case f.HTML:{bn(e,t);break}case f.BODY:{e._insertElement(t,K.HTML),e.framesetOk=!1,e.insertionMode=D.IN_BODY;break}case f.FRAMESET:{e._insertElement(t,K.HTML),e.insertionMode=D.IN_FRAMESET;break}case f.BASE:case f.BASEFONT:case f.BGSOUND:case f.LINK:case f.META:case f.NOFRAMES:case f.SCRIPT:case f.STYLE:case f.TEMPLATE:case f.TITLE:{e._err(t,U.abandonedHeadElementChild),e.openElements.push(e.headElement,f.HEAD),Ir(e,t),e.openElements.remove(e.headElement);break}case f.HEAD:{e._err(t,U.misplacedStartTagForHeadElement);break}default:Ta(e,t)}}function YM(e,t){switch(t.tagID){case f.BODY:case f.HTML:case f.BR:{Ta(e,t);break}case f.TEMPLATE:{Ys(e,t);break}default:e._err(t,U.endTagWithoutMatchingOpenElement)}}function Ta(e,t){e._insertFakeElement(P.BODY,f.BODY),e.insertionMode=D.IN_BODY,Jd(e,t)}function Jd(e,t){switch(t.type){case tt.CHARACTER:{t1(e,t);break}case tt.WHITESPACE_CHARACTER:{e1(e,t);break}case tt.COMMENT:{kp(e,t);break}case tt.START_TAG:{bn(e,t);break}case tt.END_TAG:{Zd(e,t);break}case tt.EOF:{s1(e,t);break}}}function e1(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function t1(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function zM(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function KM(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function QM(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,K.HTML),e.insertionMode=D.IN_FRAMESET)}function VM(e,t){e.openElements.hasInButtonScope(f.P)&&e._closePElement(),e._insertElement(t,K.HTML)}function qM(e,t){e.openElements.hasInButtonScope(f.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&wp.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,K.HTML)}function JM(e,t){e.openElements.hasInButtonScope(f.P)&&e._closePElement(),e._insertElement(t,K.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function ZM(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(f.P)&&e._closePElement(),e._insertElement(t,K.HTML),n||(e.formElement=e.openElements.current))}function XM(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const i=e.openElements.tagIDs[r];if(n===f.LI&&i===f.LI||(n===f.DD||n===f.DT)&&(i===f.DD||i===f.DT)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.popUntilTagNamePopped(i);break}if(i!==f.ADDRESS&&i!==f.DIV&&i!==f.P&&e._isSpecialElement(e.openElements.items[r],i))break}e.openElements.hasInButtonScope(f.P)&&e._closePElement(),e._insertElement(t,K.HTML)}function eO(e,t){e.openElements.hasInButtonScope(f.P)&&e._closePElement(),e._insertElement(t,K.HTML),e.tokenizer.state=Bn.PLAINTEXT}function tO(e,t){e.openElements.hasInScope(f.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(f.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,K.HTML),e.framesetOk=!1}function nO(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(P.A);n&&(Gm(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,K.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function rO(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,K.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function iO(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(f.NOBR)&&(Gm(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,K.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function sO(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,K.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function oO(e,t){e.treeAdapter.getDocumentMode(e.document)!==zn.QUIRKS&&e.openElements.hasInButtonScope(f.P)&&e._closePElement(),e._insertElement(t,K.HTML),e.framesetOk=!1,e.insertionMode=D.IN_TABLE}function n1(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,K.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function r1(e){const t=Wv(e,Es.TYPE);return t!=null&&t.toLowerCase()===EM}function aO(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,K.HTML),r1(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function lO(e,t){e._appendElement(t,K.HTML),t.ackSelfClosing=!0}function cO(e,t){e.openElements.hasInButtonScope(f.P)&&e._closePElement(),e._appendElement(t,K.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function dO(e,t){t.tagName=P.IMG,t.tagID=f.IMG,n1(e,t)}function uO(e,t){e._insertElement(t,K.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Bn.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=D.TEXT}function hO(e,t){e.openElements.hasInButtonScope(f.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Bn.RAWTEXT)}function pO(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Bn.RAWTEXT)}function NA(e,t){e._switchToTextParsing(t,Bn.RAWTEXT)}function mO(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,K.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===D.IN_TABLE||e.insertionMode===D.IN_CAPTION||e.insertionMode===D.IN_TABLE_BODY||e.insertionMode===D.IN_ROW||e.insertionMode===D.IN_CELL?D.IN_SELECT_IN_TABLE:D.IN_SELECT}function fO(e,t){e.openElements.currentTagId===f.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,K.HTML)}function gO(e,t){e.openElements.hasInScope(f.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,K.HTML)}function AO(e,t){e.openElements.hasInScope(f.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(f.RTC),e._insertElement(t,K.HTML)}function bO(e,t){e._reconstructActiveFormattingElements(),qv(t),Um(t),t.selfClosing?e._appendElement(t,K.MATHML):e._insertElement(t,K.MATHML),t.ackSelfClosing=!0}function yO(e,t){e._reconstructActiveFormattingElements(),Jv(t),Um(t),t.selfClosing?e._appendElement(t,K.SVG):e._insertElement(t,K.SVG),t.ackSelfClosing=!0}function IA(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,K.HTML)}function bn(e,t){switch(t.tagID){case f.I:case f.S:case f.B:case f.U:case f.EM:case f.TT:case f.BIG:case f.CODE:case f.FONT:case f.SMALL:case f.STRIKE:case f.STRONG:{rO(e,t);break}case f.A:{nO(e,t);break}case f.H1:case f.H2:case f.H3:case f.H4:case f.H5:case f.H6:{qM(e,t);break}case f.P:case f.DL:case f.OL:case f.UL:case f.DIV:case f.DIR:case f.NAV:case f.MAIN:case f.MENU:case f.ASIDE:case f.CENTER:case f.FIGURE:case f.FOOTER:case f.HEADER:case f.HGROUP:case f.DIALOG:case f.DETAILS:case f.ADDRESS:case f.ARTICLE:case f.SEARCH:case f.SECTION:case f.SUMMARY:case f.FIELDSET:case f.BLOCKQUOTE:case f.FIGCAPTION:{VM(e,t);break}case f.LI:case f.DD:case f.DT:{XM(e,t);break}case f.BR:case f.IMG:case f.WBR:case f.AREA:case f.EMBED:case f.KEYGEN:{n1(e,t);break}case f.HR:{cO(e,t);break}case f.RB:case f.RTC:{gO(e,t);break}case f.RT:case f.RP:{AO(e,t);break}case f.PRE:case f.LISTING:{JM(e,t);break}case f.XMP:{hO(e,t);break}case f.SVG:{yO(e,t);break}case f.HTML:{zM(e,t);break}case f.BASE:case f.LINK:case f.META:case f.STYLE:case f.TITLE:case f.SCRIPT:case f.BGSOUND:case f.BASEFONT:case f.TEMPLATE:{Ir(e,t);break}case f.BODY:{KM(e,t);break}case f.FORM:{ZM(e,t);break}case f.NOBR:{iO(e,t);break}case f.MATH:{bO(e,t);break}case f.TABLE:{oO(e,t);break}case f.INPUT:{aO(e,t);break}case f.PARAM:case f.TRACK:case f.SOURCE:{lO(e,t);break}case f.IMAGE:{dO(e,t);break}case f.BUTTON:{tO(e,t);break}case f.APPLET:case f.OBJECT:case f.MARQUEE:{sO(e,t);break}case f.IFRAME:{pO(e,t);break}case f.SELECT:{mO(e,t);break}case f.OPTION:case f.OPTGROUP:{fO(e,t);break}case f.NOEMBED:case f.NOFRAMES:{NA(e,t);break}case f.FRAMESET:{QM(e,t);break}case f.TEXTAREA:{uO(e,t);break}case f.NOSCRIPT:{e.options.scriptingEnabled?NA(e,t):IA(e,t);break}case f.PLAINTEXT:{eO(e,t);break}case f.COL:case f.TH:case f.TD:case f.TR:case f.HEAD:case f.FRAME:case f.TBODY:case f.TFOOT:case f.THEAD:case f.CAPTION:case f.COLGROUP:break;default:IA(e,t)}}function xO(e,t){if(e.openElements.hasInScope(f.BODY)&&(e.insertionMode=D.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function vO(e,t){e.openElements.hasInScope(f.BODY)&&(e.insertionMode=D.AFTER_BODY,p1(e,t))}function wO(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function kO(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(f.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(f.FORM):n&&e.openElements.remove(n))}function EO(e){e.openElements.hasInButtonScope(f.P)||e._insertFakeElement(P.P,f.P),e._closePElement()}function CO(e){e.openElements.hasInListItemScope(f.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(f.LI),e.openElements.popUntilTagNamePopped(f.LI))}function TO(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function SO(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function _O(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function NO(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(P.BR,f.BR),e.openElements.pop(),e.framesetOk=!1}function i1(e,t){const n=t.tagName,r=t.tagID;for(let i=e.openElements.stackTop;i>0;i--){const s=e.openElements.items[i],o=e.openElements.tagIDs[i];if(r===o&&(r!==f.UNKNOWN||e.treeAdapter.getTagName(s)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=i&&e.openElements.shortenToLength(i);break}if(e._isSpecialElement(s,o))break}}function Zd(e,t){switch(t.tagID){case f.A:case f.B:case f.I:case f.S:case f.U:case f.EM:case f.TT:case f.BIG:case f.CODE:case f.FONT:case f.NOBR:case f.SMALL:case f.STRIKE:case f.STRONG:{Gm(e,t);break}case f.P:{EO(e);break}case f.DL:case f.UL:case f.OL:case f.DIR:case f.DIV:case f.NAV:case f.PRE:case f.MAIN:case f.MENU:case f.ASIDE:case f.BUTTON:case f.CENTER:case f.FIGURE:case f.FOOTER:case f.HEADER:case f.HGROUP:case f.DIALOG:case f.ADDRESS:case f.ARTICLE:case f.DETAILS:case f.SEARCH:case f.SECTION:case f.SUMMARY:case f.LISTING:case f.FIELDSET:case f.BLOCKQUOTE:case f.FIGCAPTION:{wO(e,t);break}case f.LI:{CO(e);break}case f.DD:case f.DT:{TO(e,t);break}case f.H1:case f.H2:case f.H3:case f.H4:case f.H5:case f.H6:{SO(e);break}case f.BR:{NO(e);break}case f.BODY:{xO(e,t);break}case f.HTML:{vO(e,t);break}case f.FORM:{kO(e);break}case f.APPLET:case f.OBJECT:case f.MARQUEE:{_O(e,t);break}case f.TEMPLATE:{Ys(e,t);break}default:i1(e,t)}}function s1(e,t){e.tmplInsertionModeStack.length>0?h1(e,t):Wm(e,t)}function IO(e,t){var n;t.tagID===f.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function DO(e,t){e._err(t,U.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function qu(e,t){if(e.openElements.currentTagId!==void 0&&Zv.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=D.IN_TABLE_TEXT,t.type){case tt.CHARACTER:{a1(e,t);break}case tt.WHITESPACE_CHARACTER:{o1(e,t);break}}else Al(e,t)}function MO(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,K.HTML),e.insertionMode=D.IN_CAPTION}function OO(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,K.HTML),e.insertionMode=D.IN_COLUMN_GROUP}function RO(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(P.COLGROUP,f.COLGROUP),e.insertionMode=D.IN_COLUMN_GROUP,Ym(e,t)}function LO(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,K.HTML),e.insertionMode=D.IN_TABLE_BODY}function jO(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(P.TBODY,f.TBODY),e.insertionMode=D.IN_TABLE_BODY,Xd(e,t)}function BO(e,t){e.openElements.hasInTableScope(f.TABLE)&&(e.openElements.popUntilTagNamePopped(f.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function PO(e,t){r1(t)?e._appendElement(t,K.HTML):Al(e,t),t.ackSelfClosing=!0}function FO(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,K.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function So(e,t){switch(t.tagID){case f.TD:case f.TH:case f.TR:{jO(e,t);break}case f.STYLE:case f.SCRIPT:case f.TEMPLATE:{Ir(e,t);break}case f.COL:{RO(e,t);break}case f.FORM:{FO(e,t);break}case f.TABLE:{BO(e,t);break}case f.TBODY:case f.TFOOT:case f.THEAD:{LO(e,t);break}case f.INPUT:{PO(e,t);break}case f.CAPTION:{MO(e,t);break}case f.COLGROUP:{OO(e,t);break}default:Al(e,t)}}function Va(e,t){switch(t.tagID){case f.TABLE:{e.openElements.hasInTableScope(f.TABLE)&&(e.openElements.popUntilTagNamePopped(f.TABLE),e._resetInsertionMode());break}case f.TEMPLATE:{Ys(e,t);break}case f.BODY:case f.CAPTION:case f.COL:case f.COLGROUP:case f.HTML:case f.TBODY:case f.TD:case f.TFOOT:case f.TH:case f.THEAD:case f.TR:break;default:Al(e,t)}}function Al(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Jd(e,t),e.fosterParentingEnabled=n}function o1(e,t){e.pendingCharacterTokens.push(t)}function a1(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Vo(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)Al(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const l1=new Set([f.CAPTION,f.COL,f.COLGROUP,f.TBODY,f.TD,f.TFOOT,f.TH,f.THEAD,f.TR]);function $O(e,t){const n=t.tagID;l1.has(n)?e.openElements.hasInTableScope(f.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(f.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=D.IN_TABLE,So(e,t)):bn(e,t)}function HO(e,t){const n=t.tagID;switch(n){case f.CAPTION:case f.TABLE:{e.openElements.hasInTableScope(f.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(f.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=D.IN_TABLE,n===f.TABLE&&Va(e,t));break}case f.BODY:case f.COL:case f.COLGROUP:case f.HTML:case f.TBODY:case f.TD:case f.TFOOT:case f.TH:case f.THEAD:case f.TR:break;default:Zd(e,t)}}function Ym(e,t){switch(t.tagID){case f.HTML:{bn(e,t);break}case f.COL:{e._appendElement(t,K.HTML),t.ackSelfClosing=!0;break}case f.TEMPLATE:{Ir(e,t);break}default:Hc(e,t)}}function UO(e,t){switch(t.tagID){case f.COLGROUP:{e.openElements.currentTagId===f.COLGROUP&&(e.openElements.pop(),e.insertionMode=D.IN_TABLE);break}case f.TEMPLATE:{Ys(e,t);break}case f.COL:break;default:Hc(e,t)}}function Hc(e,t){e.openElements.currentTagId===f.COLGROUP&&(e.openElements.pop(),e.insertionMode=D.IN_TABLE,e._processToken(t))}function Xd(e,t){switch(t.tagID){case f.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,K.HTML),e.insertionMode=D.IN_ROW;break}case f.TH:case f.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(P.TR,f.TR),e.insertionMode=D.IN_ROW,eu(e,t);break}case f.CAPTION:case f.COL:case f.COLGROUP:case f.TBODY:case f.TFOOT:case f.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=D.IN_TABLE,So(e,t));break}default:So(e,t)}}function Ep(e,t){const n=t.tagID;switch(t.tagID){case f.TBODY:case f.TFOOT:case f.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=D.IN_TABLE);break}case f.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=D.IN_TABLE,Va(e,t));break}case f.BODY:case f.CAPTION:case f.COL:case f.COLGROUP:case f.HTML:case f.TD:case f.TH:case f.TR:break;default:Va(e,t)}}function eu(e,t){switch(t.tagID){case f.TH:case f.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,K.HTML),e.insertionMode=D.IN_CELL,e.activeFormattingElements.insertMarker();break}case f.CAPTION:case f.COL:case f.COLGROUP:case f.TBODY:case f.TFOOT:case f.THEAD:case f.TR:{e.openElements.hasInTableScope(f.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=D.IN_TABLE_BODY,Xd(e,t));break}default:So(e,t)}}function c1(e,t){switch(t.tagID){case f.TR:{e.openElements.hasInTableScope(f.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=D.IN_TABLE_BODY);break}case f.TABLE:{e.openElements.hasInTableScope(f.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=D.IN_TABLE_BODY,Ep(e,t));break}case f.TBODY:case f.TFOOT:case f.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(f.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=D.IN_TABLE_BODY,Ep(e,t));break}case f.BODY:case f.CAPTION:case f.COL:case f.COLGROUP:case f.HTML:case f.TD:case f.TH:break;default:Va(e,t)}}function GO(e,t){const n=t.tagID;l1.has(n)?(e.openElements.hasInTableScope(f.TD)||e.openElements.hasInTableScope(f.TH))&&(e._closeTableCell(),eu(e,t)):bn(e,t)}function WO(e,t){const n=t.tagID;switch(n){case f.TD:case f.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=D.IN_ROW);break}case f.TABLE:case f.TBODY:case f.TFOOT:case f.THEAD:case f.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),c1(e,t));break}case f.BODY:case f.CAPTION:case f.COL:case f.COLGROUP:case f.HTML:break;default:Zd(e,t)}}function d1(e,t){switch(t.tagID){case f.HTML:{bn(e,t);break}case f.OPTION:{e.openElements.currentTagId===f.OPTION&&e.openElements.pop(),e._insertElement(t,K.HTML);break}case f.OPTGROUP:{e.openElements.currentTagId===f.OPTION&&e.openElements.pop(),e.openElements.currentTagId===f.OPTGROUP&&e.openElements.pop(),e._insertElement(t,K.HTML);break}case f.HR:{e.openElements.currentTagId===f.OPTION&&e.openElements.pop(),e.openElements.currentTagId===f.OPTGROUP&&e.openElements.pop(),e._appendElement(t,K.HTML),t.ackSelfClosing=!0;break}case f.INPUT:case f.KEYGEN:case f.TEXTAREA:case f.SELECT:{e.openElements.hasInSelectScope(f.SELECT)&&(e.openElements.popUntilTagNamePopped(f.SELECT),e._resetInsertionMode(),t.tagID!==f.SELECT&&e._processStartTag(t));break}case f.SCRIPT:case f.TEMPLATE:{Ir(e,t);break}}}function u1(e,t){switch(t.tagID){case f.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===f.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===f.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===f.OPTGROUP&&e.openElements.pop();break}case f.OPTION:{e.openElements.currentTagId===f.OPTION&&e.openElements.pop();break}case f.SELECT:{e.openElements.hasInSelectScope(f.SELECT)&&(e.openElements.popUntilTagNamePopped(f.SELECT),e._resetInsertionMode());break}case f.TEMPLATE:{Ys(e,t);break}}}function YO(e,t){const n=t.tagID;n===f.CAPTION||n===f.TABLE||n===f.TBODY||n===f.TFOOT||n===f.THEAD||n===f.TR||n===f.TD||n===f.TH?(e.openElements.popUntilTagNamePopped(f.SELECT),e._resetInsertionMode(),e._processStartTag(t)):d1(e,t)}function zO(e,t){const n=t.tagID;n===f.CAPTION||n===f.TABLE||n===f.TBODY||n===f.TFOOT||n===f.THEAD||n===f.TR||n===f.TD||n===f.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(f.SELECT),e._resetInsertionMode(),e.onEndTag(t)):u1(e,t)}function KO(e,t){switch(t.tagID){case f.BASE:case f.BASEFONT:case f.BGSOUND:case f.LINK:case f.META:case f.NOFRAMES:case f.SCRIPT:case f.STYLE:case f.TEMPLATE:case f.TITLE:{Ir(e,t);break}case f.CAPTION:case f.COLGROUP:case f.TBODY:case f.TFOOT:case f.THEAD:{e.tmplInsertionModeStack[0]=D.IN_TABLE,e.insertionMode=D.IN_TABLE,So(e,t);break}case f.COL:{e.tmplInsertionModeStack[0]=D.IN_COLUMN_GROUP,e.insertionMode=D.IN_COLUMN_GROUP,Ym(e,t);break}case f.TR:{e.tmplInsertionModeStack[0]=D.IN_TABLE_BODY,e.insertionMode=D.IN_TABLE_BODY,Xd(e,t);break}case f.TD:case f.TH:{e.tmplInsertionModeStack[0]=D.IN_ROW,e.insertionMode=D.IN_ROW,eu(e,t);break}default:e.tmplInsertionModeStack[0]=D.IN_BODY,e.insertionMode=D.IN_BODY,bn(e,t)}}function QO(e,t){t.tagID===f.TEMPLATE&&Ys(e,t)}function h1(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(f.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Wm(e,t)}function VO(e,t){t.tagID===f.HTML?bn(e,t):Uc(e,t)}function p1(e,t){var n;if(t.tagID===f.HTML){if(e.fragmentContext||(e.insertionMode=D.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===f.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else Uc(e,t)}function Uc(e,t){e.insertionMode=D.IN_BODY,Jd(e,t)}function qO(e,t){switch(t.tagID){case f.HTML:{bn(e,t);break}case f.FRAMESET:{e._insertElement(t,K.HTML);break}case f.FRAME:{e._appendElement(t,K.HTML),t.ackSelfClosing=!0;break}case f.NOFRAMES:{Ir(e,t);break}}}function JO(e,t){t.tagID===f.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==f.FRAMESET&&(e.insertionMode=D.AFTER_FRAMESET))}function ZO(e,t){switch(t.tagID){case f.HTML:{bn(e,t);break}case f.NOFRAMES:{Ir(e,t);break}}}function XO(e,t){t.tagID===f.HTML&&(e.insertionMode=D.AFTER_AFTER_FRAMESET)}function eR(e,t){t.tagID===f.HTML?bn(e,t):uc(e,t)}function uc(e,t){e.insertionMode=D.IN_BODY,Jd(e,t)}function tR(e,t){switch(t.tagID){case f.HTML:{bn(e,t);break}case f.NOFRAMES:{Ir(e,t);break}}}function nR(e,t){t.chars=It,e._insertCharacters(t)}function rR(e,t){e._insertCharacters(t),e.framesetOk=!1}function m1(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==K.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function iR(e,t){if(yM(t))m1(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===K.MATHML?qv(t):r===K.SVG&&(xM(t),Jv(t)),Um(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function sR(e,t){if(t.tagID===f.P||t.tagID===f.BR){m1(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===K.HTML){e._endTagOutsideForeignContent(t);break}const i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}function f1(e,t){return function(n){let r,i=0,s="";for(;r=e.exec(n);)i!==r.index&&(s+=n.substring(i,r.index)),s+=t.get(r[0].charCodeAt(0)),i=r.index+1;return s+n.substring(i)}}const oR=f1(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])),aR=f1(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]])),lR=new Set([P.AREA,P.BASE,P.BASEFONT,P.BGSOUND,P.BR,P.COL,P.EMBED,P.FRAME,P.HR,P.IMG,P.INPUT,P.KEYGEN,P.LINK,P.META,P.PARAM,P.SOURCE,P.TRACK,P.WBR]);function cR(e,t){return t.treeAdapter.isElementNode(e)&&t.treeAdapter.getNamespaceURI(e)===K.HTML&&lR.has(t.treeAdapter.getTagName(e))}const dR={treeAdapter:si,scriptingEnabled:!0};function uR(e,t){const n={...dR,...t};return g1(e,n)}function hR(e,t){let n="";const r=t.treeAdapter.isElementNode(e)&&t.treeAdapter.getTagName(e)===P.TEMPLATE&&t.treeAdapter.getNamespaceURI(e)===K.HTML?t.treeAdapter.getTemplateContent(e):e,i=t.treeAdapter.getChildNodes(r);if(i)for(const s of i)n+=g1(s,t);return n}function g1(e,t){return t.treeAdapter.isElementNode(e)?pR(e,t):t.treeAdapter.isTextNode(e)?fR(e,t):t.treeAdapter.isCommentNode(e)?gR(e,t):t.treeAdapter.isDocumentTypeNode(e)?AR(e,t):""}function pR(e,t){const n=t.treeAdapter.getTagName(e);return`<${n}${mR(e,t)}>${cR(e,t)?"":`${hR(e,t)}</${n}>`}`}function mR(e,{treeAdapter:t}){let n="";for(const r of t.getAttrList(e)){if(n+=" ",r.namespace)switch(r.namespace){case K.XML:{n+=`xml:${r.name}`;break}case K.XMLNS:{r.name!=="xmlns"&&(n+="xmlns:"),n+=r.name;break}case K.XLINK:{n+=`xlink:${r.name}`;break}default:n+=`${r.prefix}:${r.name}`}else n+=r.name;n+=`="${oR(r.value)}"`}return n}function fR(e,t){const{treeAdapter:n}=t,r=n.getTextNodeContent(e),i=n.getParentNode(e),s=i&&n.isElementNode(i)&&n.getTagName(i);return s&&n.getNamespaceURI(i)===K.HTML&&KD(s,t.scriptingEnabled)?r:aR(r)}function gR(e,{treeAdapter:t}){return`<!--${t.getCommentNodeContent(e)}-->`}function AR(e,{treeAdapter:t}){return`<!DOCTYPE ${t.getDocumentTypeNodeName(e)}>`}function bR(e,t){return Xv.parse(e,t)}function yR(e,t,n){typeof e=="string"&&(n=t,t=e,e=null);const r=Xv.getFragmentParser(e,n);return r.tokenizer.write(t,!0),r.getFragment()}function DA(e){const t=e.includes('"')?"'":'"';return t+e+t}function xR(e,t,n){let r="!DOCTYPE ";return e&&(r+=e),t?r+=` PUBLIC ${DA(t)}`:n&&(r+=" SYSTEM"),n&&(r+=` ${DA(n)}`),r}const _i={isCommentNode:Yd,isElementNode:Re,isTextNode:Wr,createDocument(){const e=new Ls([]);return e["x-mode"]=zn.NO_QUIRKS,e},createDocumentFragment(){return new Ls([])},createElement(e,t,n){const r=Object.create(null),i=Object.create(null),s=Object.create(null);for(let a=0;a<n.length;a++){const l=n[a].name;r[l]=n[a].value,i[l]=n[a].namespace,s[l]=n[a].prefix}const o=new Sm(e,r,[]);return o.namespace=t,o["x-attribsNamespace"]=i,o["x-attribsPrefix"]=s,o},createCommentNode(e){return new Em(e)},createTextNode(e){return new Wa(e)},appendChild(e,t){const n=e.children[e.children.length-1];n&&(n.next=t,t.prev=n),e.children.push(t),t.parent=e},insertBefore(e,t,n){const r=e.children.indexOf(n),{prev:i}=n;i&&(i.next=t,t.prev=i),n.prev=t,t.next=n,e.children.splice(r,0,t),t.parent=e},setTemplateContent(e,t){_i.appendChild(e,t)},getTemplateContent(e){return e.children[0]},setDocumentType(e,t,n,r){const i=xR(t,n,r);let s=e.children.find(o=>up(o)&&o.name==="!doctype");s?s.data=i??null:(s=new Cm("!doctype",i),_i.appendChild(e,s)),s["x-name"]=t,s["x-publicId"]=n,s["x-systemId"]=r},setDocumentMode(e,t){e["x-mode"]=t},getDocumentMode(e){return e["x-mode"]},detachNode(e){if(e.parent){const t=e.parent.children.indexOf(e),{prev:n,next:r}=e;e.prev=null,e.next=null,n&&(n.next=r),r&&(r.prev=n),e.parent.children.splice(t,1),e.parent=null}},insertText(e,t){const n=e.children[e.children.length-1];n&&Wr(n)?n.data+=t:_i.appendChild(e,_i.createTextNode(t))},insertTextBefore(e,t,n){const r=e.children[e.children.indexOf(n)-1];r&&Wr(r)?r.data+=t:_i.insertBefore(e,_i.createTextNode(t),n)},adoptAttributes(e,t){for(let n=0;n<t.length;n++){const r=t[n].name;e.attribs[r]===void 0&&(e.attribs[r]=t[n].value,e["x-attribsNamespace"][r]=t[n].namespace,e["x-attribsPrefix"][r]=t[n].prefix)}},getFirstChild(e){return e.children[0]},getChildNodes(e){return e.children},getParentNode(e){return e.parent},getAttrList(e){return e.attributes},getTagName(e){return e.name},getNamespaceURI(e){return e.namespace},getTextNodeContent(e){return e.data},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){var t;return(t=e["x-name"])!==null&&t!==void 0?t:""},getDocumentTypeNodePublicId(e){var t;return(t=e["x-publicId"])!==null&&t!==void 0?t:""},getDocumentTypeNodeSystemId(e){var t;return(t=e["x-systemId"])!==null&&t!==void 0?t:""},isDocumentTypeNode(e){return up(e)&&e.name==="!doctype"},setNodeSourceCodeLocation(e,t){t&&(e.startIndex=t.startOffset,e.endIndex=t.endOffset),e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){t.endOffset!=null&&(e.endIndex=t.endOffset),e.sourceCodeLocation={...e.sourceCodeLocation,...t}}};function vR(e,t,n,r){var i;return(i=t.treeAdapter)!==null&&i!==void 0||(t.treeAdapter=_i),t.scriptingEnabled!==!1&&(t.scriptingEnabled=!0),n?bR(e,t):yR(r,e,t)}const wR={treeAdapter:_i};function kR(e){const t="length"in e?e:[e];for(let r=0;r<t.length;r+=1){const i=t[r];Qi(i)&&Array.prototype.splice.call(t,r,1,...i.children)}let n="";for(let r=0;r<t.length;r+=1){const i=t[r];n+=uR(i,wR)}return n}var Me;(function(e){e[e.Tab=9]="Tab",e[e.NewLine=10]="NewLine",e[e.FormFeed=12]="FormFeed",e[e.CarriageReturn=13]="CarriageReturn",e[e.Space=32]="Space",e[e.ExclamationMark=33]="ExclamationMark",e[e.Number=35]="Number",e[e.Amp=38]="Amp",e[e.SingleQuote=39]="SingleQuote",e[e.DoubleQuote=34]="DoubleQuote",e[e.Dash=45]="Dash",e[e.Slash=47]="Slash",e[e.Zero=48]="Zero",e[e.Nine=57]="Nine",e[e.Semi=59]="Semi",e[e.Lt=60]="Lt",e[e.Eq=61]="Eq",e[e.Gt=62]="Gt",e[e.Questionmark=63]="Questionmark",e[e.UpperA=65]="UpperA",e[e.LowerA=97]="LowerA",e[e.UpperF=70]="UpperF",e[e.LowerF=102]="LowerF",e[e.UpperZ=90]="UpperZ",e[e.LowerZ=122]="LowerZ",e[e.LowerX=120]="LowerX",e[e.OpeningSquareBracket=91]="OpeningSquareBracket"})(Me||(Me={}));var q;(function(e){e[e.Text=1]="Text",e[e.BeforeTagName=2]="BeforeTagName",e[e.InTagName=3]="InTagName",e[e.InSelfClosingTag=4]="InSelfClosingTag",e[e.BeforeClosingTagName=5]="BeforeClosingTagName",e[e.InClosingTagName=6]="InClosingTagName",e[e.AfterClosingTagName=7]="AfterClosingTagName",e[e.BeforeAttributeName=8]="BeforeAttributeName",e[e.InAttributeName=9]="InAttributeName",e[e.AfterAttributeName=10]="AfterAttributeName",e[e.BeforeAttributeValue=11]="BeforeAttributeValue",e[e.InAttributeValueDq=12]="InAttributeValueDq",e[e.InAttributeValueSq=13]="InAttributeValueSq",e[e.InAttributeValueNq=14]="InAttributeValueNq",e[e.BeforeDeclaration=15]="BeforeDeclaration",e[e.InDeclaration=16]="InDeclaration",e[e.InProcessingInstruction=17]="InProcessingInstruction",e[e.BeforeComment=18]="BeforeComment",e[e.CDATASequence=19]="CDATASequence",e[e.InSpecialComment=20]="InSpecialComment",e[e.InCommentLike=21]="InCommentLike",e[e.BeforeSpecialS=22]="BeforeSpecialS",e[e.BeforeSpecialT=23]="BeforeSpecialT",e[e.SpecialStartSequence=24]="SpecialStartSequence",e[e.InSpecialTag=25]="InSpecialTag",e[e.InEntity=26]="InEntity"})(q||(q={}));function ri(e){return e===Me.Space||e===Me.NewLine||e===Me.Tab||e===Me.FormFeed||e===Me.CarriageReturn}function Ul(e){return e===Me.Slash||e===Me.Gt||ri(e)}function ER(e){return e>=Me.LowerA&&e<=Me.LowerZ||e>=Me.UpperA&&e<=Me.UpperZ}var Hr;(function(e){e[e.NoValue=0]="NoValue",e[e.Unquoted=1]="Unquoted",e[e.Single=2]="Single",e[e.Double=3]="Double"})(Hr||(Hr={}));const an={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101]),TextareaEnd:new Uint8Array([60,47,116,101,120,116,97,114,101,97])};let CR=class{constructor({xmlMode:t=!1,decodeEntities:n=!0},r){this.cbs=r,this.state=q.Text,this.buffer="",this.sectionStart=0,this.index=0,this.entityStart=0,this.baseState=q.Text,this.isSpecial=!1,this.running=!0,this.offset=0,this.currentSequence=void 0,this.sequenceIndex=0,this.xmlMode=t,this.decodeEntities=n,this.entityDecoder=new iv(t?rv:nv,(i,s)=>this.emitCodePoint(i,s))}reset(){this.state=q.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=q.Text,this.currentSequence=void 0,this.running=!0,this.offset=0}write(t){this.offset+=this.buffer.length,this.buffer=t,this.parse()}end(){this.running&&this.finish()}pause(){this.running=!1}resume(){this.running=!0,this.index<this.buffer.length+this.offset&&this.parse()}stateText(t){t===Me.Lt||!this.decodeEntities&&this.fastForwardTo(Me.Lt)?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=q.BeforeTagName,this.sectionStart=this.index):this.decodeEntities&&t===Me.Amp&&this.startEntity()}stateSpecialStartSequence(t){const n=this.sequenceIndex===this.currentSequence.length;if(!(n?Ul(t):(t|32)===this.currentSequence[this.sequenceIndex]))this.isSpecial=!1;else if(!n){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=q.InTagName,this.stateInTagName(t)}stateInSpecialTag(t){if(this.sequenceIndex===this.currentSequence.length){if(t===Me.Gt||ri(t)){const n=this.index-this.currentSequence.length;if(this.sectionStart<n){const r=this.index;this.index=n,this.cbs.ontext(this.sectionStart,n),this.index=r}this.isSpecial=!1,this.sectionStart=n+2,this.stateInClosingTagName(t);return}this.sequenceIndex=0}(t|32)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:this.sequenceIndex===0?this.currentSequence===an.TitleEnd?this.decodeEntities&&t===Me.Amp&&this.startEntity():this.fastForwardTo(Me.Lt)&&(this.sequenceIndex=1):this.sequenceIndex=+(t===Me.Lt)}stateCDATASequence(t){t===an.Cdata[this.sequenceIndex]?++this.sequenceIndex===an.Cdata.length&&(this.state=q.InCommentLike,this.currentSequence=an.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.state=q.InDeclaration,this.stateInDeclaration(t))}fastForwardTo(t){for(;++this.index<this.buffer.length+this.offset;)if(this.buffer.charCodeAt(this.index-this.offset)===t)return!0;return this.index=this.buffer.length+this.offset-1,!1}stateInCommentLike(t){t===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===an.CdataEnd?this.cbs.oncdata(this.sectionStart,this.index,2):this.cbs.oncomment(this.sectionStart,this.index,2),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=q.Text):this.sequenceIndex===0?this.fastForwardTo(this.currentSequence[0])&&(this.sequenceIndex=1):t!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)}isTagStartChar(t){return this.xmlMode?!Ul(t):ER(t)}startSpecial(t,n){this.isSpecial=!0,this.currentSequence=t,this.sequenceIndex=n,this.state=q.SpecialStartSequence}stateBeforeTagName(t){if(t===Me.ExclamationMark)this.state=q.BeforeDeclaration,this.sectionStart=this.index+1;else if(t===Me.Questionmark)this.state=q.InProcessingInstruction,this.sectionStart=this.index+1;else if(this.isTagStartChar(t)){const n=t|32;this.sectionStart=this.index,this.xmlMode?this.state=q.InTagName:n===an.ScriptEnd[2]?this.state=q.BeforeSpecialS:n===an.TitleEnd[2]?this.state=q.BeforeSpecialT:this.state=q.InTagName}else t===Me.Slash?this.state=q.BeforeClosingTagName:(this.state=q.Text,this.stateText(t))}stateInTagName(t){Ul(t)&&(this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=q.BeforeAttributeName,this.stateBeforeAttributeName(t))}stateBeforeClosingTagName(t){ri(t)||(t===Me.Gt?this.state=q.Text:(this.state=this.isTagStartChar(t)?q.InClosingTagName:q.InSpecialComment,this.sectionStart=this.index))}stateInClosingTagName(t){(t===Me.Gt||ri(t))&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=q.AfterClosingTagName,this.stateAfterClosingTagName(t))}stateAfterClosingTagName(t){(t===Me.Gt||this.fastForwardTo(Me.Gt))&&(this.state=q.Text,this.sectionStart=this.index+1)}stateBeforeAttributeName(t){t===Me.Gt?(this.cbs.onopentagend(this.index),this.isSpecial?(this.state=q.InSpecialTag,this.sequenceIndex=0):this.state=q.Text,this.sectionStart=this.index+1):t===Me.Slash?this.state=q.InSelfClosingTag:ri(t)||(this.state=q.InAttributeName,this.sectionStart=this.index)}stateInSelfClosingTag(t){t===Me.Gt?(this.cbs.onselfclosingtag(this.index),this.state=q.Text,this.sectionStart=this.index+1,this.isSpecial=!1):ri(t)||(this.state=q.BeforeAttributeName,this.stateBeforeAttributeName(t))}stateInAttributeName(t){(t===Me.Eq||Ul(t))&&(this.cbs.onattribname(this.sectionStart,this.index),this.sectionStart=this.index,this.state=q.AfterAttributeName,this.stateAfterAttributeName(t))}stateAfterAttributeName(t){t===Me.Eq?this.state=q.BeforeAttributeValue:t===Me.Slash||t===Me.Gt?(this.cbs.onattribend(Hr.NoValue,this.sectionStart),this.sectionStart=-1,this.state=q.BeforeAttributeName,this.stateBeforeAttributeName(t)):ri(t)||(this.cbs.onattribend(Hr.NoValue,this.sectionStart),this.state=q.InAttributeName,this.sectionStart=this.index)}stateBeforeAttributeValue(t){t===Me.DoubleQuote?(this.state=q.InAttributeValueDq,this.sectionStart=this.index+1):t===Me.SingleQuote?(this.state=q.InAttributeValueSq,this.sectionStart=this.index+1):ri(t)||(this.sectionStart=this.index,this.state=q.InAttributeValueNq,this.stateInAttributeValueNoQuotes(t))}handleInAttributeValue(t,n){t===n||!this.decodeEntities&&this.fastForwardTo(n)?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(n===Me.DoubleQuote?Hr.Double:Hr.Single,this.index+1),this.state=q.BeforeAttributeName):this.decodeEntities&&t===Me.Amp&&this.startEntity()}stateInAttributeValueDoubleQuotes(t){this.handleInAttributeValue(t,Me.DoubleQuote)}stateInAttributeValueSingleQuotes(t){this.handleInAttributeValue(t,Me.SingleQuote)}stateInAttributeValueNoQuotes(t){ri(t)||t===Me.Gt?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(Hr.Unquoted,this.index),this.state=q.BeforeAttributeName,this.stateBeforeAttributeName(t)):this.decodeEntities&&t===Me.Amp&&this.startEntity()}stateBeforeDeclaration(t){t===Me.OpeningSquareBracket?(this.state=q.CDATASequence,this.sequenceIndex=0):this.state=t===Me.Dash?q.BeforeComment:q.InDeclaration}stateInDeclaration(t){(t===Me.Gt||this.fastForwardTo(Me.Gt))&&(this.cbs.ondeclaration(this.sectionStart,this.index),this.state=q.Text,this.sectionStart=this.index+1)}stateInProcessingInstruction(t){(t===Me.Gt||this.fastForwardTo(Me.Gt))&&(this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=q.Text,this.sectionStart=this.index+1)}stateBeforeComment(t){t===Me.Dash?(this.state=q.InCommentLike,this.currentSequence=an.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=q.InDeclaration}stateInSpecialComment(t){(t===Me.Gt||this.fastForwardTo(Me.Gt))&&(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=q.Text,this.sectionStart=this.index+1)}stateBeforeSpecialS(t){const n=t|32;n===an.ScriptEnd[3]?this.startSpecial(an.ScriptEnd,4):n===an.StyleEnd[3]?this.startSpecial(an.StyleEnd,4):(this.state=q.InTagName,this.stateInTagName(t))}stateBeforeSpecialT(t){const n=t|32;n===an.TitleEnd[3]?this.startSpecial(an.TitleEnd,4):n===an.TextareaEnd[3]?this.startSpecial(an.TextareaEnd,4):(this.state=q.InTagName,this.stateInTagName(t))}startEntity(){this.baseState=this.state,this.state=q.InEntity,this.entityStart=this.index,this.entityDecoder.startEntity(this.xmlMode?$r.Strict:this.baseState===q.Text||this.baseState===q.InSpecialTag?$r.Legacy:$r.Attribute)}stateInEntity(){const t=this.entityDecoder.write(this.buffer,this.index-this.offset);t>=0?(this.state=this.baseState,t===0&&(this.index=this.entityStart)):this.index=this.offset+this.buffer.length-1}cleanup(){this.running&&this.sectionStart!==this.index&&(this.state===q.Text||this.state===q.InSpecialTag&&this.sequenceIndex===0?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):(this.state===q.InAttributeValueDq||this.state===q.InAttributeValueSq||this.state===q.InAttributeValueNq)&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))}shouldContinue(){return this.index<this.buffer.length+this.offset&&this.running}parse(){for(;this.shouldContinue();){const t=this.buffer.charCodeAt(this.index-this.offset);switch(this.state){case q.Text:{this.stateText(t);break}case q.SpecialStartSequence:{this.stateSpecialStartSequence(t);break}case q.InSpecialTag:{this.stateInSpecialTag(t);break}case q.CDATASequence:{this.stateCDATASequence(t);break}case q.InAttributeValueDq:{this.stateInAttributeValueDoubleQuotes(t);break}case q.InAttributeName:{this.stateInAttributeName(t);break}case q.InCommentLike:{this.stateInCommentLike(t);break}case q.InSpecialComment:{this.stateInSpecialComment(t);break}case q.BeforeAttributeName:{this.stateBeforeAttributeName(t);break}case q.InTagName:{this.stateInTagName(t);break}case q.InClosingTagName:{this.stateInClosingTagName(t);break}case q.BeforeTagName:{this.stateBeforeTagName(t);break}case q.AfterAttributeName:{this.stateAfterAttributeName(t);break}case q.InAttributeValueSq:{this.stateInAttributeValueSingleQuotes(t);break}case q.BeforeAttributeValue:{this.stateBeforeAttributeValue(t);break}case q.BeforeClosingTagName:{this.stateBeforeClosingTagName(t);break}case q.AfterClosingTagName:{this.stateAfterClosingTagName(t);break}case q.BeforeSpecialS:{this.stateBeforeSpecialS(t);break}case q.BeforeSpecialT:{this.stateBeforeSpecialT(t);break}case q.InAttributeValueNq:{this.stateInAttributeValueNoQuotes(t);break}case q.InSelfClosingTag:{this.stateInSelfClosingTag(t);break}case q.InDeclaration:{this.stateInDeclaration(t);break}case q.BeforeDeclaration:{this.stateBeforeDeclaration(t);break}case q.BeforeComment:{this.stateBeforeComment(t);break}case q.InProcessingInstruction:{this.stateInProcessingInstruction(t);break}case q.InEntity:{this.stateInEntity();break}}this.index++}this.cleanup()}finish(){this.state===q.InEntity&&(this.entityDecoder.end(),this.state=this.baseState),this.handleTrailingData(),this.cbs.onend()}handleTrailingData(){const t=this.buffer.length+this.offset;this.sectionStart>=t||(this.state===q.InCommentLike?this.currentSequence===an.CdataEnd?this.cbs.oncdata(this.sectionStart,t,0):this.cbs.oncomment(this.sectionStart,t,0):this.state===q.InTagName||this.state===q.BeforeAttributeName||this.state===q.BeforeAttributeValue||this.state===q.AfterAttributeName||this.state===q.InAttributeName||this.state===q.InAttributeValueSq||this.state===q.InAttributeValueDq||this.state===q.InAttributeValueNq||this.state===q.InClosingTagName||this.cbs.ontext(this.sectionStart,t))}emitCodePoint(t,n){this.baseState!==q.Text&&this.baseState!==q.InSpecialTag?(this.sectionStart<this.entityStart&&this.cbs.onattribdata(this.sectionStart,this.entityStart),this.sectionStart=this.entityStart+n,this.index=this.sectionStart-1,this.cbs.onattribentity(t)):(this.sectionStart<this.entityStart&&this.cbs.ontext(this.sectionStart,this.entityStart),this.sectionStart=this.entityStart+n,this.index=this.sectionStart-1,this.cbs.ontextentity(t,this.sectionStart))}};const ro=new Set(["input","option","optgroup","select","button","datalist","textarea"]),gt=new Set(["p"]),MA=new Set(["thead","tbody"]),OA=new Set(["dd","dt"]),RA=new Set(["rt","rp"]),TR=new Map([["tr",new Set(["tr","th","td"])],["th",new Set(["th"])],["td",new Set(["thead","th","td"])],["body",new Set(["head","link","script"])],["li",new Set(["li"])],["p",gt],["h1",gt],["h2",gt],["h3",gt],["h4",gt],["h5",gt],["h6",gt],["select",ro],["input",ro],["output",ro],["button",ro],["datalist",ro],["textarea",ro],["option",new Set(["option"])],["optgroup",new Set(["optgroup","option"])],["dd",OA],["dt",OA],["address",gt],["article",gt],["aside",gt],["blockquote",gt],["details",gt],["div",gt],["dl",gt],["fieldset",gt],["figcaption",gt],["figure",gt],["footer",gt],["form",gt],["header",gt],["hr",gt],["main",gt],["nav",gt],["ol",gt],["pre",gt],["section",gt],["table",gt],["ul",gt],["rt",RA],["rp",RA],["tbody",MA],["tfoot",MA]]),SR=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]),LA=new Set(["math","svg"]),jA=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignobject","desc","title"]),_R=/\s|\//;let NR=class{constructor(t,n={}){var r,i,s,o,a,l;this.options=n,this.startIndex=0,this.endIndex=0,this.openTagStart=0,this.tagname="",this.attribname="",this.attribvalue="",this.attribs=null,this.stack=[],this.buffers=[],this.bufferOffset=0,this.writeIndex=0,this.ended=!1,this.cbs=t??{},this.htmlMode=!this.options.xmlMode,this.lowerCaseTagNames=(r=n.lowerCaseTags)!==null&&r!==void 0?r:this.htmlMode,this.lowerCaseAttributeNames=(i=n.lowerCaseAttributeNames)!==null&&i!==void 0?i:this.htmlMode,this.recognizeSelfClosing=(s=n.recognizeSelfClosing)!==null&&s!==void 0?s:!this.htmlMode,this.tokenizer=new((o=n.Tokenizer)!==null&&o!==void 0?o:CR)(this.options,this),this.foreignContext=[!this.htmlMode],(l=(a=this.cbs).onparserinit)===null||l===void 0||l.call(a,this)}ontext(t,n){var r,i;const s=this.getSlice(t,n);this.endIndex=n-1,(i=(r=this.cbs).ontext)===null||i===void 0||i.call(r,s),this.startIndex=n}ontextentity(t,n){var r,i;this.endIndex=n-1,(i=(r=this.cbs).ontext)===null||i===void 0||i.call(r,hp(t)),this.startIndex=n}isVoidElement(t){return this.htmlMode&&SR.has(t)}onopentagname(t,n){this.endIndex=n;let r=this.getSlice(t,n);this.lowerCaseTagNames&&(r=r.toLowerCase()),this.emitOpenTag(r)}emitOpenTag(t){var n,r,i,s;this.openTagStart=this.startIndex,this.tagname=t;const o=this.htmlMode&&TR.get(t);if(o)for(;this.stack.length>0&&o.has(this.stack[0]);){const a=this.stack.shift();(r=(n=this.cbs).onclosetag)===null||r===void 0||r.call(n,a,!0)}this.isVoidElement(t)||(this.stack.unshift(t),this.htmlMode&&(LA.has(t)?this.foreignContext.unshift(!0):jA.has(t)&&this.foreignContext.unshift(!1))),(s=(i=this.cbs).onopentagname)===null||s===void 0||s.call(i,t),this.cbs.onopentag&&(this.attribs={})}endOpenTag(t){var n,r;this.startIndex=this.openTagStart,this.attribs&&((r=(n=this.cbs).onopentag)===null||r===void 0||r.call(n,this.tagname,this.attribs,t),this.attribs=null),this.cbs.onclosetag&&this.isVoidElement(this.tagname)&&this.cbs.onclosetag(this.tagname,!0),this.tagname=""}onopentagend(t){this.endIndex=t,this.endOpenTag(!1),this.startIndex=t+1}onclosetag(t,n){var r,i,s,o,a,l,d,u;this.endIndex=n;let h=this.getSlice(t,n);if(this.lowerCaseTagNames&&(h=h.toLowerCase()),this.htmlMode&&(LA.has(h)||jA.has(h))&&this.foreignContext.shift(),this.isVoidElement(h))this.htmlMode&&h==="br"&&((o=(s=this.cbs).onopentagname)===null||o===void 0||o.call(s,"br"),(l=(a=this.cbs).onopentag)===null||l===void 0||l.call(a,"br",{},!0),(u=(d=this.cbs).onclosetag)===null||u===void 0||u.call(d,"br",!1));else{const p=this.stack.indexOf(h);if(p!==-1)for(let m=0;m<=p;m++){const g=this.stack.shift();(i=(r=this.cbs).onclosetag)===null||i===void 0||i.call(r,g,m!==p)}else this.htmlMode&&h==="p"&&(this.emitOpenTag("p"),this.closeCurrentTag(!0))}this.startIndex=n+1}onselfclosingtag(t){this.endIndex=t,this.recognizeSelfClosing||this.foreignContext[0]?(this.closeCurrentTag(!1),this.startIndex=t+1):this.onopentagend(t)}closeCurrentTag(t){var n,r;const i=this.tagname;this.endOpenTag(t),this.stack[0]===i&&((r=(n=this.cbs).onclosetag)===null||r===void 0||r.call(n,i,!t),this.stack.shift())}onattribname(t,n){this.startIndex=t;const r=this.getSlice(t,n);this.attribname=this.lowerCaseAttributeNames?r.toLowerCase():r}onattribdata(t,n){this.attribvalue+=this.getSlice(t,n)}onattribentity(t){this.attribvalue+=hp(t)}onattribend(t,n){var r,i;this.endIndex=n,(i=(r=this.cbs).onattribute)===null||i===void 0||i.call(r,this.attribname,this.attribvalue,t===Hr.Double?'"':t===Hr.Single?"'":t===Hr.NoValue?void 0:null),this.attribs&&!Object.prototype.hasOwnProperty.call(this.attribs,this.attribname)&&(this.attribs[this.attribname]=this.attribvalue),this.attribvalue=""}getInstructionName(t){const n=t.search(_R);let r=n<0?t:t.substr(0,n);return this.lowerCaseTagNames&&(r=r.toLowerCase()),r}ondeclaration(t,n){this.endIndex=n;const r=this.getSlice(t,n);if(this.cbs.onprocessinginstruction){const i=this.getInstructionName(r);this.cbs.onprocessinginstruction(`!${i}`,`!${r}`)}this.startIndex=n+1}onprocessinginstruction(t,n){this.endIndex=n;const r=this.getSlice(t,n);if(this.cbs.onprocessinginstruction){const i=this.getInstructionName(r);this.cbs.onprocessinginstruction(`?${i}`,`?${r}`)}this.startIndex=n+1}oncomment(t,n,r){var i,s,o,a;this.endIndex=n,(s=(i=this.cbs).oncomment)===null||s===void 0||s.call(i,this.getSlice(t,n-r)),(a=(o=this.cbs).oncommentend)===null||a===void 0||a.call(o),this.startIndex=n+1}oncdata(t,n,r){var i,s,o,a,l,d,u,h,p,m;this.endIndex=n;const g=this.getSlice(t,n-r);!this.htmlMode||this.options.recognizeCDATA?((s=(i=this.cbs).oncdatastart)===null||s===void 0||s.call(i),(a=(o=this.cbs).ontext)===null||a===void 0||a.call(o,g),(d=(l=this.cbs).oncdataend)===null||d===void 0||d.call(l)):((h=(u=this.cbs).oncomment)===null||h===void 0||h.call(u,`[CDATA[${g}]]`),(m=(p=this.cbs).oncommentend)===null||m===void 0||m.call(p)),this.startIndex=n+1}onend(){var t,n;if(this.cbs.onclosetag){this.endIndex=this.startIndex;for(let r=0;r<this.stack.length;r++)this.cbs.onclosetag(this.stack[r],!0)}(n=(t=this.cbs).onend)===null||n===void 0||n.call(t)}reset(){var t,n,r,i;(n=(t=this.cbs).onreset)===null||n===void 0||n.call(t),this.tokenizer.reset(),this.tagname="",this.attribname="",this.attribs=null,this.stack.length=0,this.startIndex=0,this.endIndex=0,(i=(r=this.cbs).onparserinit)===null||i===void 0||i.call(r,this),this.buffers.length=0,this.foreignContext.length=0,this.foreignContext.unshift(!this.htmlMode),this.bufferOffset=0,this.writeIndex=0,this.ended=!1}parseComplete(t){this.reset(),this.end(t)}getSlice(t,n){for(;t-this.bufferOffset>=this.buffers[0].length;)this.shiftBuffer();let r=this.buffers[0].slice(t-this.bufferOffset,n-this.bufferOffset);for(;n-this.bufferOffset>this.buffers[0].length;)this.shiftBuffer(),r+=this.buffers[0].slice(0,n-this.bufferOffset);return r}shiftBuffer(){this.bufferOffset+=this.buffers[0].length,this.writeIndex--,this.buffers.shift()}write(t){var n,r;if(this.ended){(r=(n=this.cbs).onerror)===null||r===void 0||r.call(n,new Error(".write() after done!"));return}this.buffers.push(t),this.tokenizer.running&&(this.tokenizer.write(t),this.writeIndex++)}end(t){var n,r;if(this.ended){(r=(n=this.cbs).onerror)===null||r===void 0||r.call(n,new Error(".end() after done!"));return}t&&this.write(t),this.ended=!0,this.tokenizer.end()}pause(){this.tokenizer.pause()}resume(){for(this.tokenizer.resume();this.tokenizer.running&&this.writeIndex<this.buffers.length;)this.tokenizer.write(this.buffers[this.writeIndex++]);this.ended&&this.tokenizer.end()}parseChunk(t){this.write(t)}done(t){this.end(t)}};function IR(e,t){const n=new yN(void 0,t);return new NR(n,t).end(e),n.root}const DR=V2((e,t,n,r)=>t._useHtmlParser2?IR(e,t):vR(e,t,n,r)),MR=_D(DR,(e,t)=>t._useHtmlParser2?zd(e,t):kR(e)),OR=Object.freeze(Object.defineProperty({__proto__:null,contains:Om,load:MR,merge:gv},Symbol.toStringTag,{value:"Module"})),RR=lN(OR);var BA={},PA={exports:{}},FA={exports:{}},$A;function zm(){return $A||($A=1,(function(e,t){e.exports=n;function n(i){return r.bind(null,i)}function r(i){var s=[].slice.call(arguments,1);s.unshift("["+i+"]"),process.stderr.write(s.join(" ")+`
|
|
13
|
+
`)}})(FA)),FA.exports}var HA;function A1(){return HA||(HA=1,(function(e,t){zm()("lex"),e.exports=n;function n(r){var i="",s,o=0,a=-1,l=0,d=1,u="before-selector",h=[u],p={},m=[],g=["media","keyframes",{name:"-webkit-keyframes",type:"keyframes",prefix:"-webkit-"},{name:"-moz-keyframes",type:"keyframes",prefix:"-moz-"},{name:"-ms-keyframes",type:"keyframes",prefix:"-ms-"},{name:"-o-keyframes",type:"keyframes",prefix:"-o-"},"font-face",{name:"import",state:"before-at-value"},{name:"charset",state:"before-at-value"},"supports","viewport",{name:"namespace",state:"before-at-value"},"document",{name:"-moz-document",type:"document",prefix:"-moz-"},"page"];function b(){return L(),r[a]}function A(H){return H?h[h.length-1-H]:u}function y(H){var te=a+1;return H===r.slice(te,te+H.length)}function w(H){var te=r.slice(a).indexOf(H);return te>0?te:!1}function C(H){return H===E(1)}function E(H){return r[a+(H||1)]}function S(){var H=h.pop();return u=h[h.length-1],H}function k(H){return u=H,h.push(u),h.length}function I(H){var te=u;return h[h.length-1]=u=H,te}function L(H){if((H||1)==1)r[a]==`
|
|
14
|
+
`?(d++,o=1):o++,a++;else{var te=r.slice(a,a+H).split(`
|
|
15
|
+
`);te.length>1&&(d+=te.length-1,o=1),o+=te[te.length-1].length,a=a+H}}function R(){p.end={line:d,col:o},m.push(p),i="",p={}}function B(H){p={type:H,start:{line:d,col:o}}}for(;s=b();)switch(s){case" ":switch(A()){case"selector":case"value":case"value-paren":case"at-group":case"at-value":case"comment":case"double-string":case"single-string":i+=s;break}break;case`
|
|
16
|
+
`:case" ":case"\r":case"\f":switch(A()){case"value":case"value-paren":case"at-group":case"comment":case"single-string":case"double-string":case"selector":i+=s;break;case"at-value":s===`
|
|
17
|
+
`&&(p.value=i.trim(),R(),S());break}break;case":":switch(A()){case"name":p.name=i.trim(),i="",I("before-value");break;case"before-selector":i+=s,B("selector"),k("selector");break;case"before-value":I("value"),i+=s;break;default:i+=s;break}break;case";":switch(A()){case"name":case"before-value":case"value":i.trim().length>0&&(p.value=i.trim(),R()),I("before-name");break;case"value-paren":i+=s;break;case"at-value":p.value=i.trim(),R(),S();break;case"before-name":break;default:i+=s;break}break;case"{":switch(A()){case"selector":if(E(-1)==="\\"){i+=s;break}p.text=i.trim(),R(),I("before-name"),l=l+1;break;case"at-group":switch(p.name=i.trim(),p.type){case"font-face":case"viewport":case"page":k("before-name");break;default:k("before-selector")}R(),l=l+1;break;case"name":case"at-rule":p.name=i.trim(),R(),k("before-name"),l=l+1;break;case"comment":case"double-string":case"single-string":i+=s;break;case"before-value":I("value"),i+=s;break}break;case"}":switch(A()){case"before-name":case"name":case"before-value":case"value":i&&(p.value=i.trim()),p.name&&p.value&&R(),B("end"),R(),S(),A()==="at-group"&&(B("at-group-end"),R(),S()),l>0&&(l=l-1);break;case"at-group":case"before-selector":case"selector":if(E(-1)==="\\"){i+=s;break}l>0&&A(1)==="at-group"&&(B("at-group-end"),R()),l>1&&S(),l>0&&(l=l-1);break;case"double-string":case"single-string":case"comment":i+=s;break}break;case'"':case"'":switch(A()){case"double-string":s==='"'&&E(-1)!=="\\"&&S();break;case"single-string":s==="'"&&E(-1)!=="\\"&&S();break;case"before-at-value":I("at-value"),k(s==='"'?"double-string":"single-string");break;case"before-value":I("value"),k(s==='"'?"double-string":"single-string");break;case"comment":break;default:E(-1)!=="\\"&&k(s==='"'?"double-string":"single-string")}i+=s;break;case"/":switch(A()){case"comment":case"double-string":case"single-string":i+=s;break;case"before-value":case"selector":case"name":case"value":if(C("*")){var O=w("*/");O&&L(O+1)}else A()=="before-value"&&I("value"),i+=s;break;default:C("*")?(B("comment"),k("comment"),L()):i+=s;break}break;case"*":switch(A()){case"comment":C("/")?(p.text=i,L(),R(),S()):i+=s;break;case"before-selector":i+=s,B("selector"),k("selector");break;case"before-value":I("value"),i+=s;break;default:i+=s}break;case"@":switch(A()){case"comment":case"double-string":case"single-string":i+=s;break;case"before-value":I("value"),i+=s;break;default:for(var Y=!1,Q,W,ie=0,J=g.length;!Y&&ie<J;++ie)W=g[ie],Q=W.name||W,y(Q)&&(Y=!0,B(Q),k(W.state||"at-group"),L(Q.length),W.prefix&&(p.prefix=W.prefix),W.type&&(p.type=W.type));Y||(i+=s);break}break;case"(":switch(A()){case"value":k("value-paren");break;case"before-value":I("value");break}i+=s;break;case")":switch(A()){case"value-paren":S();break;case"before-value":I("value");break}i+=s;break;default:switch(A()){case"before-selector":B("selector"),k("selector");break;case"before-name":B("property"),I("name");break;case"before-value":I("value");break;case"before-at-value":I("at-value");break}i+=s;break}return m}})(PA)),PA.exports}var UA={exports:{}},GA;function LR(){return GA||(GA=1,(function(e,t){zm()("parse");var n=A1();e.exports=a;var r,i,s,o;function a(S,k){k||(k={}),r=!!k.comments,s=!!k.position,i=0,o=Array.isArray(S)?S.slice():n(S);for(var I,L=[],R;R=d();)I=y(R),I&&L.push(I);return{type:"stylesheet",stylesheet:{rules:L}}}function l(S,k){k||(k={});for(var I,L=["type","name","value"],R={},B=0;B<L.length;++B)I=L[B],S[I]&&(R[I]=k[I]||S[I]);for(L=Object.keys(k),B=0;B<L.length;++B)I=L[B],R[I]||(R[I]=k[I]);return s&&(R.position={start:S.start,end:S.end}),R}function d(){var S=o.shift();return S}function u(S){i=i+1;var k={};switch(S.type){case"font-face":case"viewport":k.declarations=C();break;case"page":k.prefix=S.prefix,k.declarations=C();break;default:k.prefix=S.prefix,k.rules=E()}return l(S,k)}function h(S){return l(S)}function p(S){return l(S)}function m(S){return l(S,{text:S.text})}function g(S){return l(S)}function b(S){return l(S)}function A(S){function k(I){return I.trim()}return l(S,{type:"rule",selectors:S.text.split(",").map(k),declarations:C()})}function y(S){switch(S.type){case"property":return b(S);case"selector":return A(S);case"at-group-end":i=i-1;return;case"media":case"keyframes":return u(S);case"comment":if(r)return m(S);break;case"charset":return p(S);case"import":return h(S);case"namespace":return g(S);case"font-face":case"supports":case"viewport":case"document":case"page":return u(S)}}function w(S){for(var k,I=[],L;(L=d())&&S&&S(L);)k=y(L),k&&I.push(k);return L&&L.type!=="end"&&o.unshift(L),I}function C(){return w(function(S){return S.type==="property"||S.type==="comment"})}function E(){return w(function(){return i})}})(UA)),UA.exports}var WA={exports:{}},YA;function jR(){return YA||(YA=1,(function(e,t){zm()("stringify");var n,r,i,s,o,a;e.exports=l;function l(E,S){S||(S={}),i=S.indentation||"",r=!!S.compress,n=!!S.comments,s=1,r?o=a="":(o=`
|
|
18
|
+
`,a=" ");var k=g(E.stylesheet.rules,w).join(`
|
|
19
|
+
`).trim();return k}function d(E){if(E){s+=E;return}return r?"":Array(s).join(i||"")}function u(E){return"@"+E.type+" "+E.value+";"+o}function h(E){var S="",k=E.prefix||"";E.name&&(S=" "+E.name);var I=E.type!=="page";return"@"+k+E.type+S+a+b(E,I)+o}function p(E){return n?"/*"+(E.text||"")+"*/"+o:""}function m(E){var S;return E.selectors?S=E.selectors.join(","+o):(S="@"+E.type,S+=E.name?" "+E.name:""),d()+S+a+b(E)+o}function g(E,S){return E.reduce(function(k,I){var L=I.type==="comment"?p(I):S(I);return L&&k.push(L),k},[])}function b(E,S){var k=E.declarations,I=y;return E.rules&&(k=E.rules,I=m),k=A(k,I),k&&(k=o+k+(S?"":o)),"{"+k+d()+"}"}function A(E,S){if(!E)return"";d(1);var k=g(E,S);return d(-1),k.length?k.join(o):""}function y(E){if(E.type==="property")return C(E)}function w(E){switch(E.type){case"rule":return m(E);case"media":case"keyframes":return h(E);case"comment":return p(E);case"import":case"charset":case"namespace":return u(E);case"font-face":case"supports":case"viewport":case"document":case"page":return h(E)}}function C(E){var S=E.name?E.name+":"+a:"";return d()+S+E.value+";"}})(WA)),WA.exports}var zA,KA;function BR(){return KA||(KA=1,zA={lex:A1(),parse:LR(),stringify:jR()}),zA}var QA={exports:{}},Ju,VA;function PR(){if(VA)return Ju;VA=1;var e=/([-.*+?^${}()|[\]\/\\])/g,t=/\\/g,n=function(h){return(h+"").replace(e,"\\$1")},r=function(h){return(h+"").replace(t,"")},i=RegExp(`^(?:\\s*(,)\\s*|\\s*(<combinator>+)\\s*|(\\s+)|(<unicode>+|\\*)|\\#(<unicode>+)|\\.(<unicode>+)|\\[\\s*(<unicode1>+)(?:\\s*([*^$!~|]?=)(?:\\s*(?:(["']?)(.*?)\\9)))?\\s*\\](?!\\])|(:+)(<unicode>+)(?:\\((?:(?:(["'])([^\\13]*)\\13)|((?:\\([^)]+\\)|[^()]*)+))\\))?)`.replace(/<combinator>/,"["+n(">+~`!@$%^&={}\\;</")+"]").replace(/<unicode>/g,"(?:[\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])").replace(/<unicode1>/g,"(?:[:\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])")),s=function(h){this.combinator=h||" ",this.tag="*"};s.prototype.toString=function(){if(!this.raw){var h="",p,m;if(h+=this.tag||"*",this.id&&(h+="#"+this.id),this.classes&&(h+="."+this.classList.join(".")),this.attributes)for(p=0;m=this.attributes[p++];)h+="["+m.name+(m.operator?m.operator+'"'+m.value+'"':"")+"]";if(this.pseudos)for(p=0;m=this.pseudos[p++];)h+=":"+m.name,m.value&&(h+="("+m.value+")");this.raw=h}return this.raw};var o=function(){this.length=0};o.prototype.toString=function(){if(!this.raw){for(var h="",p=0,m;m=this[p++];)p!==1&&(h+=" "),m.combinator!==" "&&(h+=m.combinator+" "),h+=m;this.raw=h}return this.raw};var a=function(h,p,m,g,b,A,y,w,C,E,S,k,I,L,R,B){var O,Y;if((p||!this.length)&&(O=this[this.length++]=new o,p))return"";if(O||(O=this[this.length-1]),(m||g||!O.length)&&(Y=O[O.length++]=new s(m)),Y||(Y=O[O.length-1]),b)Y.tag=r(b);else if(A)Y.id=r(A);else if(y){var Q=r(y),W=Y.classes||(Y.classes={});if(!W[Q]){W[Q]=n(y);var ie=Y.classList||(Y.classList=[]);ie.push(Q),ie.sort()}}else I?(B=B||R,(Y.pseudos||(Y.pseudos=[])).push({type:k.length==1?"class":"element",name:r(I),escapedName:n(I),value:B?r(B):null,escapedValue:B?n(B):null})):w&&(S=S?n(S):null,(Y.attributes||(Y.attributes=[])).push({operator:C,name:r(w),escapedName:n(w),value:S?r(S):null,escapedValue:S?n(S):null}));return""},l=function(h){this.length=0;for(var p=this,m=h,g;h;){if(g=h.replace(i,function(){return a.apply(p,arguments)}),g===h)throw new Error(m+" is an invalid expression");h=g}};l.prototype.toString=function(){if(!this.raw){for(var h=[],p=0,m;m=this[p++];)h.push(m);this.raw=h.join(", ")}return this.raw};var d={},u=function(h){return h==null?null:(h=(""+h).replace(/^\s+|\s+$/g,""),d[h]||(d[h]=new l(h)))};return Ju=u,Ju}var qA;function FR(){return qA||(qA=1,(function(e,t){var n=PR();e.exports=r;function r(s,o){this.text=s,this.spec=void 0,this.styleAttribute=o||!1}r.prototype.parsed=function(){return this.tokens||(this.tokens=i(this.text)),this.tokens},r.prototype.specificity=function(){var s=this.styleAttribute;return this.spec||(this.spec=o(this.text,this.parsed())),this.spec;function o(a,l){for(var d=l||i(a),u=[s?1:0,0,0,0],h=[],p=0;p<d.length;p++){var m=d[p],g=m.pseudos;if(m.id&&u[1]++,m.attributes&&(u[2]+=m.attributes.length),m.classList&&(u[2]+=m.classList.length),m.tag&&m.tag!=="*"&&u[3]++,g){u[3]+=g.length;for(var b=0;b<g.length;b++)g[b].name==="not"&&(h.push(g[b].value),u[3]--)}}for(var A=h.length;A--;)for(var y=o(h[A]),w=4;w--;)u[w]+=y[w];return u}};function i(s){try{return n(s)[0]}catch{return[]}}})(QA)),QA.exports}var JA={exports:{}},ZA;function $R(){return ZA||(ZA=1,(function(e,t){e.exports=r;var n=Km();function r(i,s,o,a,l){this.prop=i,this.value=s,this.selector=o,this.priority=a||0,this.additionalPriority=l||[]}r.prototype.compareFunc=function(i){var s=[];s.push.apply(s,this.selector.specificity()),s.push.apply(s,this.additionalPriority),s[0]+=this.priority;var o=[];return o.push.apply(o,i.selector.specificity()),o.push.apply(o,i.additionalPriority),o[0]+=i.priority,n.compareFunc(s,o)},r.prototype.compare=function(i){var s=this.compareFunc(i);return s===1?this:i},r.prototype.toString=function(){return this.prop+": "+this.value.replace(/['"]+/g,"")+";"}})(JA)),JA.exports}var XA;function Km(){return XA||(XA=1,(function(e){var t=BR(),n=FR(),r=$R();e.Selector=n,e.Property=r;/**
|
|
20
|
+
* Returns an array of the selectors.
|
|
21
|
+
*
|
|
22
|
+
* @license Sizzle CSS Selector Engine - MIT
|
|
23
|
+
* @param {String} selectorText from mensch
|
|
24
|
+
* @api public
|
|
25
|
+
*/e.extract=function(i){for(var s=0,o=[],a="",l=0,d=i.length;l<d;l++){var u=i.charAt(l);s?((u==="]"||u===")")&&s--,a+=u):u===","?(o.push(a),a=""):((u==="["||u==="(")&&s++,(a.length||u!==","&&u!==`
|
|
26
|
+
`&&u!==" ")&&(a+=u))}return a.length&&o.push(a),o},e.parseCSS=function(i){var s=t.parse(i,{position:!0,comments:!0}),o=typeof s.stylesheet<"u"&&s.stylesheet.rules?s.stylesheet.rules:[],a=[],l=!1,d=!1;if(o.length>0&&o[0].type==="comment"&&o[0].text){var u=o[0].text.trim();u==="juice ignore"&&(d=!0)}if(d)return a;for(var h=0,p=o.length;h<p;h++){if(o[h].type==="comment"){if(!o[h].text)continue;var m=o[h].text.trim();m==="juice start ignore"?l=!0:m==="juice end ignore"?l=!1:m==="juice ignore next"&&h++;continue}if(!l&&o[h].type=="rule"){var g=o[h],b=g.selectors,A=[];if(g.declarations)for(var y=!1,w=0;w<g.declarations.length;w++){var C=g.declarations[w];if(C.type==="comment"&&C.text){var E=C.text.trim();if(E==="juice ignore next"){y=!0;continue}}if(y&&C.type==="property"){y=!1;continue}C.type==="property"&&A.push(C)}if(A.length>0)for(var S=0,k=b.length;S<k;S++)a.push([b[S],A])}}return a},e.getPreservedText=function(i,s,o){var a=t.parse(i,{position:!0,comments:!0}),l=typeof a.stylesheet<"u"&&a.stylesheet.rules?a.stylesheet.rules:[],d=[],u=!1,h=[],p=!1,m=new Set;if(l.length>0&&l[0].type==="comment"&&l[0].text){var g=l[0].text.trim();g==="juice ignore"&&(p=!0)}if(p)return`
|
|
27
|
+
`+i+`
|
|
28
|
+
`;for(var b=0;b<l.length;b++){if(l[b].type==="comment"&&l[b].text){var A=l[b].text.trim();A==="juice ignore next"&&b+1<l.length&&m.add(b+1)}if(l[b].type==="rule"&&l[b].declarations){for(var y=0;y<l[b].declarations.length;y++)if(l[b].declarations[y].type==="comment"&&l[b].declarations[y].text){var w=l[b].declarations[y].text.trim();if(w==="juice ignore next"){m.add(b);break}}}}for(var b=l.length-1;b>=0;b--){var C=l[b];if(C.type==="comment"){if(!C.text)continue;var A=C.text.trim();A==="juice end ignore"?(u=!0,h.push(C)):A==="juice start ignore"&&(u=!1,h.push(C),h.length>0&&(d.unshift(t.stringify({stylesheet:{rules:h.reverse()}},{comments:!0,indentation:" "})),h=[]));continue}if(u){h.push(C);continue}if(m.has(b)){d.unshift(t.stringify({stylesheet:{rules:[C]}},{comments:!0,indentation:" "}));continue}(s.fontFaces&&C.type==="font-face"||s.mediaQueries&&C.type==="media"||s.keyFrames&&C.type==="keyframes"||s.pseudos&&C.selectors&&this.matchesPseudo(C.selectors[0],o)||s.preservedSelectors&&C.selectors&&C.selectors.some(function(S){return e.matchesPreservedSelector(S,s.preservedSelectors)}))&&d.unshift(t.stringify({stylesheet:{rules:[C]}},{comments:!1,indentation:" "})),C.position.start}return d.length===0?!1:`
|
|
29
|
+
`+d.join(`
|
|
30
|
+
`)+`
|
|
31
|
+
`},e.normalizeLineEndings=function(i){return i.replace(/\r\n/g,`
|
|
32
|
+
`).replace(/\n/g,`\r
|
|
33
|
+
`)},e.matchesPseudo=function(i,s){return s.find(function(o){return i.indexOf(":"+o)>-1})},e.matchesPreservedSelector=function(i,s){if(!s||s.length===0)return!1;for(var o=0;o<s.length;o++){var a=s[o];if(i===a||i.indexOf(a)!==-1)return!0}return!1},e.removeInlinedSelectorsFromCSS=function(i,s,o,a){for(var l=t.parse(i,{position:!0,comments:!0}),d=typeof l.stylesheet<"u"&&l.stylesheet.rules?l.stylesheet.rules:[],u=[],h=0;h<d.length;h++){var p=d[h];if(p.type!=="rule"){u.push(p);continue}if(p.selectors&&o.preservePseudos&&this.matchesPseudo(p.selectors[0],a)){u.push(p);continue}if(p.selectors&&o.preservedSelectors&&p.selectors.some(function(b){return e.matchesPreservedSelector(b,o.preservedSelectors)})){u.push(p);continue}var m=p.selectors.filter(function(b){return!s.has(b)});if(m.length>0){var g=Object.assign({},p,{selectors:m});u.push(g)}}return u.length===0?"":t.stringify({stylesheet:{rules:u}},{comments:!1,indentation:" "})},e.compareFunc=function(i,s){for(var o=Math.min(i.length,s.length),a=0;a<o;a++)if(i[a]!==s[a])return i[a]>s[a]?1:-1;return i.length-s.length},e.compare=function(i,s){return e.compareFunc(i,s)==1?i:s},e.getDefaultOptions=function(i){var s=Object.assign({extraCss:"",insertPreservedExtraCss:!0,applyStyleTags:!0,removeStyleTags:!0,removeInlinedSelectors:!1,preserveMediaQueries:!0,preserveFontFaces:!0,preserveKeyFrames:!0,preservePseudos:!0,preservedSelectors:[],applyWidthAttributes:!0,applyHeightAttributes:!0,applyAttributesTableElements:!0,resolveCSSVariables:!0,inlineDuplicateProperties:!1,url:""},i);return s.webResources=s.webResources||{},s}})(BA)),BA}var eb;function HR(){return eb||(eb=1,(function(e){var t=RR;Km();var n=function(i,s,o){const{xmlMode:a,...l}=s;return s=Object.assign({xml:{decodeEntities:!1,xmlMode:a}},l),i=o(i),t.load(i,s)},r=function(){var i=[],s=function(a){var l=e.exports.codeBlocks;return Object.keys(l).forEach(function(d){var u=new RegExp(l[d].start+"([\\S\\s]*?)"+l[d].end,"g");a=a.replace(u,function(h,p){return i.push(h),"JUICE_CODE_BLOCK_"+(i.length-1)+"_"})}),a},o=function(a){for(var l=0;l<i.length;l++){var d=new RegExp("JUICE_CODE_BLOCK_"+l+'_(="")?',"gi");a=a.replace(d,function(){return i[l]})}return a};return{encodeEntities:s,decodeEntities:o}};e.exports=function(i,s,o,a){var l=r(),d=n(i,s,l.encodeEntities),u=[d];u.push.apply(u,a);var h=o.apply(void 0,u)||d;return s&&s.xmlMode?l.decodeEntities(h.xml()):l.decodeEntities(h.html())},e.exports.codeBlocks={EJS:{start:"<%",end:"%>"},HBS:{start:"{{",end:"}}"}}})(rA)),rA.exports}var tb={},nb={},rb={},ib;function sb(){return ib||(ib=1,(function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.fromCodePoint=void 0,e.replaceCodePoint=r,e.decodeCodePoint=i;const n=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);e.fromCodePoint=(t=String.fromCodePoint)!==null&&t!==void 0?t:(s=>{let o="";return s>65535&&(s-=65536,o+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),o+=String.fromCharCode(s),o});function r(s){var o;return s>=55296&&s<=57343||s>1114111?65533:(o=n.get(s))!==null&&o!==void 0?o:s}function i(s){return(0,e.fromCodePoint)(r(s))}})(rb)),rb}var qo={},Gl={},ob;function b1(){if(ob)return Gl;ob=1,Object.defineProperty(Gl,"__esModule",{value:!0}),Gl.decodeBase64=e;function e(t){const n=typeof atob=="function"?atob(t):typeof Buffer.from=="function"?Buffer.from(t,"base64").toString("binary"):new Buffer(t,"base64").toString("binary"),r=n.length&-2,i=new Uint16Array(r/2);for(let s=0,o=0;s<r;s+=2){const a=n.charCodeAt(s),l=n.charCodeAt(s+1);i[o++]=a|l<<8}return i}return Gl}var ab;function lb(){if(ab)return qo;ab=1,Object.defineProperty(qo,"__esModule",{value:!0}),qo.htmlDecodeTree=void 0;const e=b1();return qo.htmlDecodeTree=(0,e.decodeBase64)("QR08ALkAAgH6AYsDNQR2BO0EPgXZBQEGLAbdBxMISQrvCmQLfQurDKQNLw4fD4YPpA+6D/IPAAAAAAAAAAAAAAAAKhBMEY8TmxUWF2EYLBkxGuAa3RsJHDscWR8YIC8jSCSIJcMl6ie3Ku8rEC0CLjoupS7kLgAIRU1hYmNmZ2xtbm9wcnN0dVQAWgBeAGUAaQBzAHcAfgCBAIQAhwCSAJoAoACsALMAbABpAGcAO4DGAMZAUAA7gCYAJkBjAHUAdABlADuAwQDBQHIiZXZlAAJhAAFpeW0AcgByAGMAO4DCAMJAEGRyAADgNdgE3XIAYQB2AGUAO4DAAMBA8CFoYZFj4SFjcgBhZAAAoFMqAAFncIsAjgBvAG4ABGFmAADgNdg43fAlbHlGdW5jdGlvbgCgYSBpAG4AZwA7gMUAxUAAAWNzpACoAHIAAOA12Jzc6SFnbgCgVCJpAGwAZABlADuAwwDDQG0AbAA7gMQAxEAABGFjZWZvcnN1xQDYANoA7QDxAPYA+QD8AAABY3LJAM8AayNzbGFzaAAAoBYidgHTANUAAKDnKmUAZAAAoAYjeQARZIABY3J0AOAA5QDrAGEidXNlAACgNSLuI291bGxpcwCgLCFhAJJjcgAA4DXYBd1wAGYAAOA12Dnd5SF2ZdhiYwDyAOoAbSJwZXEAAKBOIgAHSE9hY2RlZmhpbG9yc3UXARoBHwE6AVIBVQFiAWQBZgGCAakB6QHtAfIBYwB5ACdkUABZADuAqQCpQIABY3B5ACUBKAE1AfUhdGUGYWmg0iJ0KGFsRGlmZmVyZW50aWFsRAAAoEUhbCJleXMAAKAtIQACYWVpb0EBRAFKAU0B8iFvbgxhZABpAGwAO4DHAMdAcgBjAAhhbiJpbnQAAKAwIm8AdAAKYQABZG5ZAV0BaSJsbGEAuGB0I2VyRG90ALdg8gA5AWkAp2NyImNsZQAAAkRNUFRwAXQBeQF9AW8AdAAAoJkiaSJudXMAAKCWIuwhdXMAoJUiaSJtZXMAAKCXIm8AAAFjc4cBlAFrKndpc2VDb250b3VySW50ZWdyYWwAAKAyImUjQ3VybHkAAAFEUZwBpAFvJXVibGVRdW90ZQAAoB0gdSJvdGUAAKAZIAACbG5wdbABtgHNAdgBbwBuAGWgNyIAoHQqgAFnaXQAvAHBAcUB8iJ1ZW50AKBhIm4AdAAAoC8i7yV1ckludGVncmFsAKAuIgABZnLRAdMBAKACIe8iZHVjdACgECJuLnRlckNsb2Nrd2lzZUNvbnRvdXJJbnRlZ3JhbAAAoDMi7yFzcwCgLypjAHIAAOA12J7ccABDoNMiYQBwAACgTSKABURKU1phY2VmaW9zAAsCEgIVAhgCGwIsAjQCOQI9AnMCfwNvoEUh9CJyYWhkAKARKWMAeQACZGMAeQAFZGMAeQAPZIABZ3JzACECJQIoAuchZXIAoCEgcgAAoKEhaAB2AACg5CoAAWF5MAIzAvIhb24OYRRkbAB0oAciYQCUY3IAAOA12AfdAAFhZkECawIAAWNtRQJnAvIjaXRpY2FsAAJBREdUUAJUAl8CYwJjInV0ZQC0YG8AdAFZAloC2WJiJGxlQWN1dGUA3WJyImF2ZQBgYGkibGRlANxi7yFuZACgxCJmJWVyZW50aWFsRAAAoEYhcAR9AgAAAAAAAIECjgIAABoDZgAA4DXYO91EoagAhQKJAm8AdAAAoNwgcSJ1YWwAAKBQIuIhbGUAA0NETFJVVpkCqAK1Au8C/wIRA28AbgB0AG8AdQByAEkAbgB0AGUAZwByAGEA7ADEAW8AdAKvAgAAAACwAqhgbiNBcnJvdwAAoNMhAAFlb7kC0AJmAHQAgAFBUlQAwQLGAs0CciJyb3cAAKDQIekkZ2h0QXJyb3cAoNQhZQDlACsCbgBnAAABTFLWAugC5SFmdAABQVLcAuECciJyb3cAAKD4J+kkZ2h0QXJyb3cAoPon6SRnaHRBcnJvdwCg+SdpImdodAAAAUFU9gL7AnIicm93AACg0iFlAGUAAKCoInAAQQIGAwAAAAALA3Iicm93AACg0SFvJHduQXJyb3cAAKDVIWUlcnRpY2FsQmFyAACgJSJuAAADQUJMUlRhJAM2AzoDWgNxA3oDciJyb3cAAKGTIUJVLAMwA2EAcgAAoBMpcCNBcnJvdwAAoPUhciJldmUAEWPlIWZ00gJDAwAASwMAAFIDaSVnaHRWZWN0b3IAAKBQKWUkZVZlY3RvcgAAoF4p5SJjdG9yQqC9IWEAcgAAoFYpaSJnaHQA1AFiAwAAaQNlJGVWZWN0b3IAAKBfKeUiY3RvckKgwSFhAHIAAKBXKWUAZQBBoKQiciJyb3cAAKCnIXIAcgBvAPcAtAIAAWN0gwOHA3IAAOA12J/c8iFvaxBhAAhOVGFjZGZnbG1vcHFzdHV4owOlA6kDsAO/A8IDxgPNA9ID8gP9AwEEFAQeBCAEJQRHAEphSAA7gNAA0EBjAHUAdABlADuAyQDJQIABYWl5ALYDuQO+A/Ihb24aYXIAYwA7gMoAykAtZG8AdAAWYXIAAOA12AjdcgBhAHYAZQA7gMgAyEDlIm1lbnQAoAgiAAFhcNYD2QNjAHIAEmF0AHkAUwLhAwAAAADpA20lYWxsU3F1YXJlAACg+yVlJ3J5U21hbGxTcXVhcmUAAKCrJQABZ3D2A/kDbwBuABhhZgAA4DXYPN3zImlsb26VY3UAAAFhaQYEDgRsAFSgdSppImxkZQAAoEIi7CNpYnJpdW0AoMwhAAFjaRgEGwRyAACgMCFtAACgcyphAJdjbQBsADuAywDLQAABaXApBC0E8yF0cwCgAyLvJG5lbnRpYWxFAKBHIYACY2Zpb3MAPQQ/BEMEXQRyBHkAJGRyAADgNdgJ3WwibGVkAFMCTAQAAAAAVARtJWFsbFNxdWFyZQAAoPwlZSdyeVNtYWxsU3F1YXJlAACgqiVwA2UEAABpBAAAAABtBGYAAOA12D3dwSFsbACgACLyI2llcnRyZgCgMSFjAPIAcQQABkpUYWJjZGZnb3JzdIgEiwSOBJMElwSkBKcEqwStBLIE5QTqBGMAeQADZDuAPgA+QO0hbWFkoJMD3GNyImV2ZQAeYYABZWl5AJ0EoASjBOQhaWwiYXIAYwAcYRNkbwB0ACBhcgAA4DXYCt0AoNkicABmAADgNdg+3eUiYXRlcgADRUZHTFNUvwTIBM8E1QTZBOAEcSJ1YWwATKBlIuUhc3MAoNsidSRsbEVxdWFsAACgZyJyI2VhdGVyAACgoirlIXNzAKB3IuwkYW50RXF1YWwAoH4qaSJsZGUAAKBzImMAcgAA4DXYotwAoGsiAARBYWNmaW9zdfkE/QQFBQgFCwUTBSIFKwVSIkRjeQAqZAABY3QBBQQFZQBrAMdiXmDpIXJjJGFyAACgDCFsJWJlcnRTcGFjZQAAoAsh8AEYBQAAGwVmAACgDSHpJXpvbnRhbExpbmUAoAAlAAFjdCYFKAXyABIF8iFvayZhbQBwAEQBMQU5BW8AdwBuAEgAdQBtAPAAAAFxInVhbAAAoE8iAAdFSk9hY2RmZ21ub3N0dVMFVgVZBVwFYwVtBXAFcwV6BZAFtgXFBckFzQVjAHkAFWTsIWlnMmFjAHkAAWRjAHUAdABlADuAzQDNQAABaXlnBWwFcgBjADuAzgDOQBhkbwB0ADBhcgAAoBEhcgBhAHYAZQA7gMwAzEAAoREhYXB/BYsFAAFjZ4MFhQVyACphaSNuYXJ5SQAAoEghbABpAGUA8wD6AvQBlQUAAKUFZaAsIgABZ3KaBZ4F8iFhbACgKyLzI2VjdGlvbgCgwiJpI3NpYmxlAAABQ1SsBbEFbyJtbWEAAKBjIGkibWVzAACgYiCAAWdwdAC8Bb8FwwVvAG4ALmFmAADgNdhA3WEAmWNjAHIAAKAQIWkibGRlAChh6wHSBQAA1QVjAHkABmRsADuAzwDPQIACY2Zvc3UA4QXpBe0F8gX9BQABaXnlBegFcgBjADRhGWRyAADgNdgN3XAAZgAA4DXYQd3jAfcFAAD7BXIAAOA12KXc8iFjeQhk6yFjeQRkgANISmFjZm9zAAwGDwYSBhUGHQYhBiYGYwB5ACVkYwB5AAxk8CFwYZpjAAFleRkGHAbkIWlsNmEaZHIAAOA12A7dcABmAADgNdhC3WMAcgAA4DXYptyABUpUYWNlZmxtb3N0AD0GQAZDBl4GawZkB2gHcAd0B80H2gdjAHkACWQ7gDwAPECAAmNtbnByAEwGTwZSBlUGWwb1IXRlOWHiIWRhm2NnAACg6ifsI2FjZXRyZgCgEiFyAACgniGAAWFleQBkBmcGagbyIW9uPWHkIWlsO2EbZAABZnNvBjQHdAAABUFDREZSVFVWYXKABp4GpAbGBssG3AYDByEHwQIqBwABbnKEBowGZyVsZUJyYWNrZXQAAKDoJ/Ihb3cAoZAhQlKTBpcGYQByAACg5CHpJGdodEFycm93AKDGIWUjaWxpbmcAAKAII28A9QGqBgAAsgZiJWxlQnJhY2tldAAAoOYnbgDUAbcGAAC+BmUkZVZlY3RvcgAAoGEp5SJjdG9yQqDDIWEAcgAAoFkpbCJvb3IAAKAKI2kiZ2h0AAABQVbSBtcGciJyb3cAAKCUIeUiY3RvcgCgTikAAWVy4AbwBmUAAKGjIkFW5gbrBnIicm93AACgpCHlImN0b3IAoFopaSNhbmdsZQBCorIi+wYAAAAA/wZhAHIAAKDPKXEidWFsAACgtCJwAIABRFRWAAoHEQcYB+8kd25WZWN0b3IAoFEpZSRlVmVjdG9yAACgYCnlImN0b3JCoL8hYQByAACgWCnlImN0b3JCoLwhYQByAACgUilpAGcAaAB0AGEAcgByAG8A9wDMAnMAAANFRkdMU1Q/B0cHTgdUB1gHXwfxJXVhbEdyZWF0ZXIAoNoidSRsbEVxdWFsAACgZiJyI2VhdGVyAACgdiLlIXNzAKChKuwkYW50RXF1YWwAoH0qaSJsZGUAAKByInIAAOA12A/dZaDYIuYjdGFycm93AKDaIWkiZG90AD9hgAFucHcAege1B7kHZwAAAkxSbHKCB5QHmwerB+UhZnQAAUFSiAeNB3Iicm93AACg9SfpJGdodEFycm93AKD3J+kkZ2h0QXJyb3cAoPYn5SFmdAABYXLcAqEHaQBnAGgAdABhAHIAcgBvAPcA5wJpAGcAaAB0AGEAcgByAG8A9wDuAmYAAOA12EPdZQByAAABTFK/B8YHZSRmdEFycm93AACgmSHpJGdodEFycm93AKCYIYABY2h0ANMH1QfXB/IAWgYAoLAh8iFva0FhAKBqIgAEYWNlZmlvc3XpB+wH7gf/BwMICQgOCBEIcAAAoAUpeQAcZAABZGzyB/kHaSR1bVNwYWNlAACgXyBsI2ludHJmAACgMyFyAADgNdgQ3e4jdXNQbHVzAKATInAAZgAA4DXYRN1jAPIA/gecY4AESmFjZWZvc3R1ACEIJAgoCDUIgQiFCDsKQApHCmMAeQAKZGMidXRlAENhgAFhZXkALggxCDQI8iFvbkdh5CFpbEVhHWSAAWdzdwA7CGEIfQjhInRpdmWAAU1UVgBECEwIWQhlJWRpdW1TcGFjZQAAoAsgaABpAAABY25SCFMIawBTAHAAYQBjAOUASwhlAHIAeQBUAGgAaQDuAFQI9CFlZAABR0xnCHUIcgBlAGEAdABlAHIARwByAGUAYQB0AGUA8gDrBGUAcwBzAEwAZQBzAPMA2wdMImluZQAKYHIAAOA12BHdAAJCbnB0jAiRCJkInAhyImVhawAAoGAgwiZyZWFraW5nU3BhY2WgYGYAAKAVIUOq7CqzCMIIzQgAAOcIGwkAAAAAAAAtCQAAbwkAAIcJAACdCcAJGQoAADQKAAFvdbYIvAjuI2dydWVudACgYiJwIkNhcAAAoG0ibyh1YmxlVmVydGljYWxCYXIAAKAmIoABbHF4ANII1wjhCOUibWVudACgCSL1IWFsVKBgImkibGRlAADgQiI4A2kic3RzAACgBCJyI2VhdGVyAACjbyJFRkdMU1T1CPoIAgkJCQ0JFQlxInVhbAAAoHEidSRsbEVxdWFsAADgZyI4A3IjZWF0ZXIAAOBrIjgD5SFzcwCgeSLsJGFudEVxdWFsAOB+KjgDaSJsZGUAAKB1IvUhbXBEASAJJwnvI3duSHVtcADgTiI4A3EidWFsAADgTyI4A2UAAAFmczEJRgn0JFRyaWFuZ2xlQqLqIj0JAAAAAEIJYQByAADgzyk4A3EidWFsAACg7CJzAICibiJFR0xTVABRCVYJXAlhCWkJcSJ1YWwAAKBwInIjZWF0ZXIAAKB4IuUhc3MA4GoiOAPsJGFudEVxdWFsAOB9KjgDaSJsZGUAAKB0IuUic3RlZAABR0x1CX8J8iZlYXRlckdyZWF0ZXIA4KIqOAPlI3NzTGVzcwDgoSo4A/IjZWNlZGVzAKGAIkVTjwmVCXEidWFsAADgryo4A+wkYW50RXF1YWwAoOAiAAFlaaAJqQl2JmVyc2VFbGVtZW50AACgDCLnJWh0VHJpYW5nbGVCousitgkAAAAAuwlhAHIAAODQKTgDcSJ1YWwAAKDtIgABcXXDCeAJdSNhcmVTdQAAAWJwywnVCfMhZXRF4I8iOANxInVhbAAAoOIi5SJyc2V0ReCQIjgDcSJ1YWwAAKDjIoABYmNwAOYJ8AkNCvMhZXRF4IIi0iBxInVhbAAAoIgi4yJlZWRzgKGBIkVTVAD6CQAKBwpxInVhbAAA4LAqOAPsJGFudEVxdWFsAKDhImkibGRlAADgfyI4A+UicnNldEXggyLSIHEidWFsAACgiSJpImxkZQCAoUEiRUZUACIKJwouCnEidWFsAACgRCJ1JGxsRXF1YWwAAKBHImkibGRlAACgSSJlJXJ0aWNhbEJhcgAAoCQiYwByAADgNdip3GkAbABkAGUAO4DRANFAnWMAB0VhY2RmZ21vcHJzdHV2XgphCmgKcgp2CnoKgQqRCpYKqwqtCrsKyArNCuwhaWdSYWMAdQB0AGUAO4DTANNAAAFpeWwKcQpyAGMAO4DUANRAHmRiImxhYwBQYXIAAOA12BLdcgBhAHYAZQA7gNIA0kCAAWFlaQCHCooKjQpjAHIATGFnAGEAqWNjInJvbgCfY3AAZgAA4DXYRt3lI25DdXJseQABRFGeCqYKbyV1YmxlUXVvdGUAAKAcIHUib3RlAACgGCAAoFQqAAFjbLEKtQpyAADgNdiq3GEAcwBoADuA2ADYQGkAbAHACsUKZABlADuA1QDVQGUAcwAAoDcqbQBsADuA1gDWQGUAcgAAAUJQ0wrmCgABYXLXCtoKcgAAoD4gYQBjAAABZWvgCuIKAKDeI2UAdAAAoLQjYSVyZW50aGVzaXMAAKDcI4AEYWNmaGlsb3JzAP0KAwsFCwkLCwsMCxELIwtaC3IjdGlhbEQAAKACInkAH2RyAADgNdgT3WkApmOgY/Ujc01pbnVzsWAAAWlwFQsgC24AYwBhAHIAZQBwAGwAYQBuAOUACgVmAACgGSGAobsqZWlvACoLRQtJC+MiZWRlc4CheiJFU1QANAs5C0ALcSJ1YWwAAKCvKuwkYW50RXF1YWwAoHwiaSJsZGUAAKB+Im0AZQAAoDMgAAFkcE0LUQv1IWN0AKAPIm8jcnRpb24AYaA3ImwAAKAdIgABY2leC2ILcgAA4DXYq9yoYwACVWZvc2oLbwtzC3cLTwBUADuAIgAiQHIAAOA12BTdcABmAACgGiFjAHIAAOA12KzcAAZCRWFjZWZoaW9yc3WPC5MLlwupC7YL2AvbC90LhQyTDJoMowzhIXJyAKAQKUcAO4CuAK5AgAFjbnIAnQugC6ML9SF0ZVRhZwAAoOsncgB0oKAhbAAAoBYpgAFhZXkArwuyC7UL8iFvblhh5CFpbFZhIGR2oBwhZSJyc2UAAAFFVb8LzwsAAWxxwwvIC+UibWVudACgCyL1JGlsaWJyaXVtAKDLIXAmRXF1aWxpYnJpdW0AAKBvKXIAAKAcIW8AoWPnIWh0AARBQ0RGVFVWYewLCgwQDDIMNwxeDHwM9gIAAW5y8Av4C2clbGVCcmFja2V0AACg6SfyIW93AKGSIUJM/wsDDGEAcgAAoOUhZSRmdEFycm93AACgxCFlI2lsaW5nAACgCSNvAPUBFgwAAB4MYiVsZUJyYWNrZXQAAKDnJ24A1AEjDAAAKgxlJGVWZWN0b3IAAKBdKeUiY3RvckKgwiFhAHIAAKBVKWwib29yAACgCyMAAWVyOwxLDGUAAKGiIkFWQQxGDHIicm93AACgpiHlImN0b3IAoFspaSNhbmdsZQBCorMiVgwAAAAAWgxhAHIAAKDQKXEidWFsAACgtSJwAIABRFRWAGUMbAxzDO8kd25WZWN0b3IAoE8pZSRlVmVjdG9yAACgXCnlImN0b3JCoL4hYQByAACgVCnlImN0b3JCoMAhYQByAACgUykAAXB1iQyMDGYAAKAdIe4kZEltcGxpZXMAoHAp6SRnaHRhcnJvdwCg2yEAAWNongyhDHIAAKAbIQCgsSHsJGVEZWxheWVkAKD0KYAGSE9hY2ZoaW1vcXN0dQC/DMgMzAzQDOIM5gwKDQ0NFA0ZDU8NVA1YDQABQ2PDDMYMyCFjeSlkeQAoZEYiVGN5ACxkYyJ1dGUAWmEAorwqYWVpedgM2wzeDOEM8iFvbmBh5CFpbF5hcgBjAFxhIWRyAADgNdgW3e8hcnQAAkRMUlXvDPYM/QwEDW8kd25BcnJvdwAAoJMhZSRmdEFycm93AACgkCHpJGdodEFycm93AKCSIXAjQXJyb3cAAKCRIechbWGjY+EkbGxDaXJjbGUAoBgicABmAADgNdhK3XICHw0AAAAAIg10AACgGiLhIXJlgKGhJUlTVQAqDTINSg3uJXRlcnNlY3Rpb24AoJMidQAAAWJwNw1ADfMhZXRFoI8icSJ1YWwAAKCRIuUicnNldEWgkCJxInVhbAAAoJIibiJpb24AAKCUImMAcgAA4DXYrtxhAHIAAKDGIgACYmNtcF8Nag2ODZANc6DQImUAdABFoNAicSJ1YWwAAKCGIgABY2huDYkNZSJlZHMAgKF7IkVTVAB4DX0NhA1xInVhbAAAoLAq7CRhbnRFcXVhbACgfSJpImxkZQAAoH8iVABoAGEA9ADHCwCgESIAodEiZXOVDZ8NciJzZXQARaCDInEidWFsAACghyJlAHQAAKDRIoAFSFJTYWNmaGlvcnMAtQ27Db8NyA3ODdsN3w3+DRgOHQ4jDk8AUgBOADuA3gDeQMEhREUAoCIhAAFIY8MNxg1jAHkAC2R5ACZkAAFidcwNzQ0JYKRjgAFhZXkA1A3XDdoN8iFvbmRh5CFpbGJhImRyAADgNdgX3QABZWnjDe4N8gHoDQAA7Q3lImZvcmUAoDQiYQCYYwABY27yDfkNayNTcGFjZQAA4F8gCiDTInBhY2UAoAkg7CFkZYChPCJFRlQABw4MDhMOcSJ1YWwAAKBDInUkbGxFcXVhbAAAoEUiaSJsZGUAAKBIInAAZgAA4DXYS93pI3BsZURvdACg2yAAAWN0Jw4rDnIAAOA12K/c8iFva2Zh4QpFDlYOYA5qDgAAbg5yDgAAAAAAAAAAAAB5DnwOqA6zDgAADg8RDxYPGg8AAWNySA5ODnUAdABlADuA2gDaQHIAb6CfIeMhaXIAoEkpcgDjAVsOAABdDnkADmR2AGUAbGEAAWl5Yw5oDnIAYwA7gNsA20AjZGIibGFjAHBhcgAA4DXYGN1yAGEAdgBlADuA2QDZQOEhY3JqYQABZGl/Dp8OZQByAAABQlCFDpcOAAFhcokOiw5yAF9gYQBjAAABZWuRDpMOAKDfI2UAdAAAoLUjYSVyZW50aGVzaXMAAKDdI28AbgBQoMMi7CF1cwCgjiIAAWdwqw6uDm8AbgByYWYAAOA12EzdAARBREVUYWRwc78O0g7ZDuEOBQPqDvMOBw9yInJvdwDCoZEhyA4AAMwOYQByAACgEilvJHduQXJyb3cAAKDFIW8kd25BcnJvdwAAoJUhcSV1aWxpYnJpdW0AAKBuKWUAZQBBoKUiciJyb3cAAKClIW8AdwBuAGEAcgByAG8A9wAQA2UAcgAAAUxS+Q4AD2UkZnRBcnJvdwAAoJYh6SRnaHRBcnJvdwCglyFpAGyg0gNvAG4ApWPpIW5nbmFjAHIAAOA12LDcaSJsZGUAaGFtAGwAO4DcANxAgAREYmNkZWZvc3YALQ8xDzUPNw89D3IPdg97D4AP4SFzaACgqyJhAHIAAKDrKnkAEmThIXNobKCpIgCg5ioAAWVyQQ9DDwCgwSKAAWJ0eQBJD00Paw9hAHIAAKAWIGmgFiDjIWFsAAJCTFNUWA9cD18PZg9hAHIAAKAjIukhbmV8YGUkcGFyYXRvcgAAoFgnaSJsZGUAAKBAItQkaGluU3BhY2UAoAogcgAA4DXYGd1wAGYAAOA12E3dYwByAADgNdix3GQiYXNoAACgqiKAAmNlZm9zAI4PkQ+VD5kPng/pIXJjdGHkIWdlAKDAInIAAOA12BrdcABmAADgNdhO3WMAcgAA4DXYstwAAmZpb3OqD64Prw+0D3IAAOA12BvdnmNwAGYAAOA12E/dYwByAADgNdiz3IAEQUlVYWNmb3N1AMgPyw/OD9EP2A/gD+QP6Q/uD2MAeQAvZGMAeQAHZGMAeQAuZGMAdQB0AGUAO4DdAN1AAAFpedwP3w9yAGMAdmErZHIAAOA12BzdcABmAADgNdhQ3WMAcgAA4DXYtNxtAGwAeGEABEhhY2RlZm9z/g8BEAUQDRAQEB0QIBAkEGMAeQAWZGMidXRlAHlhAAFheQkQDBDyIW9ufWEXZG8AdAB7YfIBFRAAABwQbwBXAGkAZAB0AOgAVAhhAJZjcgAAoCghcABmAACgJCFjAHIAAOA12LXc4QtCEEkQTRAAAGcQbRByEAAAAAAAAAAAeRCKEJcQ8hD9EAAAGxEhETIROREAAD4RYwB1AHQAZQA7gOEA4UByImV2ZQADYYCiPiJFZGl1eQBWEFkQWxBgEGUQAOA+IjMDAKA/InIAYwA7gOIA4kB0AGUAO4C0ALRAMGRsAGkAZwA7gOYA5kByoGEgAOA12B7dcgBhAHYAZQA7gOAA4EAAAWVwfBCGEAABZnCAEIQQ8yF5bQCgNSHoAIMQaABhALFjAAFhcI0QWwAAAWNskRCTEHIAAWFnAACgPypkApwQAAAAALEQAKInImFkc3ajEKcQqRCuEG4AZAAAoFUqAKBcKmwib3BlAACgWCoAoFoqAKMgImVsbXJzersQvRDAEN0Q5RDtEACgpCllAACgICJzAGQAYaAhImEEzhDQENIQ1BDWENgQ2hDcEACgqCkAoKkpAKCqKQCgqykAoKwpAKCtKQCgrikAoK8pdAB2oB8iYgBkoL4iAKCdKQABcHTpEOwQaAAAoCIixWDhIXJyAKB8IwABZ3D1EPgQbwBuAAVhZgAA4DXYUt0Ao0giRWFlaW9wBxEJEQ0RDxESERQRAKBwKuMhaXIAoG8qAKBKImQAAKBLInMAJ2DyIW94ZaBIIvEADhFpAG4AZwA7gOUA5UCAAWN0eQAmESoRKxFyAADgNdi23CpgbQBwAGWgSCLxAPgBaQBsAGQAZQA7gOMA40BtAGwAO4DkAORAAAFjaUERRxFvAG4AaQBuAPQA6AFuAHQAAKARKgAITmFiY2RlZmlrbG5vcHJzdWQRaBGXEZ8RpxGrEdIR1hErEjASexKKEn0RThNbE3oTbwB0AACg7SoAAWNybBGJEWsAAAJjZXBzdBF4EX0RghHvIW5nAKBMInAjc2lsb24A9mNyImltZQAAoDUgaQBtAGWgPSJxAACgzSJ2AY0RkRFlAGUAAKC9ImUAZABnoAUjZQAAoAUjcgBrAHSgtSPiIXJrAKC2IwABb3mjEaYRbgDnAHcRMWTxIXVvAKAeIIACY21wcnQAtBG5Eb4RwRHFEeEhdXPloDUi5ABwInR5dgAAoLApcwDpAH0RbgBvAPUA6gCAAWFodwDLEcwRzhGyYwCgNiHlIWVuAKBsInIAAOA12B/dZwCAA2Nvc3R1dncA4xHyEQUSEhIhEiYSKRKAAWFpdQDpEesR7xHwAKMFcgBjAACg7yVwAACgwyKAAWRwdAD4EfwRABJvAHQAAKAAKuwhdXMAoAEqaSJtZXMAAKACKnECCxIAAAAADxLjIXVwAKAGKmEAcgAAoAUm8iNpYW5nbGUAAWR1GhIeEu8hd24AoL0lcAAAoLMlcCJsdXMAAKAEKmUA5QBCD+UAkg9hInJvdwAAoA0pgAFha28ANhJoEncSAAFjbjoSZRJrAIABbHN0AEESRxJNEm8jemVuZ2UAAKDrKXEAdQBhAHIA5QBcBPIjaWFuZ2xlgKG0JWRscgBYElwSYBLvIXduAKC+JeUhZnQAoMIlaSJnaHQAAKC4JWsAAKAjJLEBbRIAAHUSsgFxEgAAcxIAoJIlAKCRJTQAAKCTJWMAawAAoIglAAFlb38ShxJx4D0A5SD1IWl2AOBhIuUgdAAAoBAjAAJwdHd4kRKVEpsSnxJmAADgNdhT3XSgpSJvAG0AAKClIvQhaWUAoMgiAAZESFVWYmRobXB0dXayEsES0RLgEvcS+xIKExoTHxMjEygTNxMAAkxSbHK5ErsSvRK/EgCgVyUAoFQlAKBWJQCgUyUAolAlRFVkdckSyxLNEs8SAKBmJQCgaSUAoGQlAKBnJQACTFJsctgS2hLcEt4SAKBdJQCgWiUAoFwlAKBZJQCjUSVITFJobHLrEu0S7xLxEvMS9RIAoGwlAKBjJQCgYCUAoGslAKBiJQCgXyVvAHgAAKDJKQACTFJscgITBBMGEwgTAKBVJQCgUiUAoBAlAKAMJQCiACVEVWR1EhMUExYTGBMAoGUlAKBoJQCgLCUAoDQlaSJudXMAAKCfIuwhdXMAoJ4iaSJtZXMAAKCgIgACTFJsci8TMRMzEzUTAKBbJQCgWCUAoBglAKAUJQCjAiVITFJobHJCE0QTRhNIE0oTTBMAoGolAKBhJQCgXiUAoDwlAKAkJQCgHCUAAWV2UhNVE3YA5QD5AGIAYQByADuApgCmQAACY2Vpb2ITZhNqE24TcgAA4DXYt9xtAGkAAKBPIG0A5aA9IogRbAAAoVwAYmh0E3YTAKDFKfMhdWIAoMgnbAF+E4QTbABloCIgdAAAoCIgcAAAoU4iRWWJE4sTAKCuKvGgTyI8BeEMqRMAAN8TABQDFB8UAAAjFDQUAAAAAIUUAAAAAI0UAAAAANcU4xT3FPsUAACIFQAAlhWAAWNwcgCuE7ET1RP1IXRlB2GAoikiYWJjZHMAuxO/E8QTzhPSE24AZAAAoEQqciJjdXAAAKBJKgABYXXIE8sTcAAAoEsqcAAAoEcqbwB0AACgQCoA4CkiAP4AAWVv2RPcE3QAAKBBIO4ABAUAAmFlaXXlE+8T9RP4E/AB6hMAAO0TcwAAoE0qbwBuAA1hZABpAGwAO4DnAOdAcgBjAAlhcABzAHOgTCptAACgUCpvAHQAC2GAAWRtbgAIFA0UEhRpAGwAO4C4ALhAcCJ0eXYAAKCyKXQAAIGiADtlGBQZFKJAcgBkAG8A9ABiAXIAAOA12CDdgAFjZWkAKBQqFDIUeQBHZGMAawBtoBMn4SFyawCgEyfHY3IAAKPLJUVjZWZtcz8UQRRHFHcUfBSAFACgwykAocYCZWxGFEkUcQAAoFciZQBhAlAUAAAAAGAUciJyb3cAAAFsclYUWhTlIWZ0AKC6IWkiZ2h0AACguyGAAlJTYWNkAGgUaRRrFG8UcxSuYACgyCRzAHQAAKCbIukhcmMAoJoi4SFzaACgnSJuImludAAAoBAqaQBkAACg7yrjIWlyAKDCKfUhYnN1oGMmaQB0AACgYybsApMUmhS2FAAAwxRvAG4AZaA6APGgVCKrAG0CnxQAAAAAoxRhAHSgLABAYAChASJmbKcUqRTuABMNZQAAAW14rhSyFOUhbnQAoAEiZQDzANIB5wG6FAAAwBRkoEUibwB0AACgbSpuAPQAzAGAAWZyeQDIFMsUzhQA4DXYVN1vAOQA1wEAgakAO3MeAdMUcgAAoBchAAFhb9oU3hRyAHIAAKC1IXMAcwAAoBcnAAFjdeYU6hRyAADgNdi43AABYnDuFPIUZaDPKgCg0SploNAqAKDSKuQhb3QAoO8igANkZWxwcnZ3AAYVEBUbFSEVRBVlFYQV4SFycgABbHIMFQ4VAKA4KQCgNSlwAhYVAAAAABkVcgAAoN4iYwAAoN8i4SFycnCgtiEAoD0pgKIqImJjZG9zACsVMBU6FT4VQRVyImNhcAAAoEgqAAFhdTQVNxVwAACgRipwAACgSipvAHQAAKCNInIAAKBFKgDgKiIA/gACYWxydksVURVuFXMVcgByAG2gtyEAoDwpeQCAAWV2dwBYFWUVaRVxAHACXxUAAAAAYxVyAGUA4wAXFXUA4wAZFWUAZQAAoM4iZSJkZ2UAAKDPImUAbgA7gKQApEBlI2Fycm93AAABbHJ7FX8V5SFmdACgtiFpImdodAAAoLchZQDkAG0VAAFjaYsVkRVvAG4AaQBuAPQAkwFuAHQAAKAxImwiY3R5AACgLSOACUFIYWJjZGVmaGlqbG9yc3R1d3oAuBW7Fb8V1RXgFegV+RUKFhUWHxZUFlcWZRbFFtsW7xb7FgUXChdyAPIAtAJhAHIAAKBlKQACZ2xyc8YVyhXOFdAV5yFlcgCgICDlIXRoAKA4IfIA9QxoAHagECAAoKMiawHZFd4VYSJyb3cAAKAPKWEA4wBfAgABYXnkFecV8iFvbg9hNGQAoUYhYW/tFfQVAAFnciEC8RVyAACgyiF0InNlcQAAoHcqgAFnbG0A/xUCFgUWO4CwALBAdABhALRjcCJ0eXYAAKCxKQABaXIOFhIW8yFodACgfykA4DXYId1hAHIAAAFschsWHRYAoMMhAKDCIYACYWVnc3YAKBauAjYWOhY+Fm0AAKHEIm9zLhY0Fm4AZABzoMQi9SFpdACgZiZhIm1tYQDdY2kAbgAAoPIiAKH3AGlvQxZRFmQAZQAAgfcAO29KFksW90BuI3RpbWVzAACgxyJuAPgAUBZjAHkAUmRjAG8CXhYAAAAAYhZyAG4AAKAeI28AcAAAoA0jgAJscHR1dwBuFnEWdRaSFp4W7CFhciRgZgAA4DXYVd0AotkCZW1wc30WhBaJFo0WcQBkoFAibwB0AACgUSJpIm51cwAAoDgi7CF1cwCgFCLxInVhcmUAoKEiYgBsAGUAYgBhAHIAdwBlAGQAZwDlANcAbgCAAWFkaAClFqoWtBZyAHIAbwD3APUMbwB3AG4AYQByAHIAbwB3APMA8xVhI3Jwb29uAAABbHK8FsAWZQBmAPQAHBZpAGcAaAD0AB4WYgHJFs8WawBhAHIAbwD3AJILbwLUFgAAAADYFnIAbgAAoB8jbwBwAACgDCOAAWNvdADhFukW7BYAAXJ55RboFgDgNdi53FVkbAAAoPYp8iFvaxFhAAFkcvMW9xZvAHQAAKDxImkA5qC/JVsSAAFhaP8WAhdyAPIANQNhAPIA1wvhIm5nbGUAoKYpAAFjaQ4XEBd5AF9k5yJyYXJyAKD/JwAJRGFjZGVmZ2xtbm9wcXJzdHV4MRc4F0YXWxcyBF4XaRd5F40XrBe0F78X2RcVGCEYLRg1GEAYAAFEbzUXgRZvAPQA+BUAAWNzPBdCF3UAdABlADuA6QDpQPQhZXIAoG4qAAJhaW95TRdQF1YXWhfyIW9uG2FyAGOgViI7gOoA6kDsIW9uAKBVIk1kbwB0ABdhAAFEcmIXZhdvAHQAAKBSIgDgNdgi3XKhmipuF3QXYQB2AGUAO4DoAOhAZKCWKm8AdAAAoJgqgKGZKmlscwCAF4UXhxfuInRlcnMAoOcjAKATIWSglSpvAHQAAKCXKoABYXBzAJMXlheiF2MAcgATYXQAeQBzogUinxcAAAAAoRdlAHQAAKAFInAAMaADIDMBqRerFwCgBCAAoAUgAAFnc7AXsRdLYXAAAKACIAABZ3C4F7sXbwBuABlhZgAA4DXYVt2AAWFscwDFF8sXzxdyAHOg1SJsAACg4yl1AHMAAKBxKmkAAKG1A2x21RfYF28AbgC1Y/VjAAJjc3V24BfoF/0XEBgAAWlv5BdWF3IAYwAAoFYiaQLuFwAAAADwF+0ADQThIW50AAFnbPUX+Rd0AHIAAKCWKuUhc3MAoJUqgAFhZWkAAxgGGAoYbABzAD1gcwB0AACgXyJ2AESgYSJEAACgeCrwImFyc2wAoOUpAAFEYRkYHRhvAHQAAKBTInIAcgAAoHEpgAFjZGkAJxgqGO0XcgAAoC8hbwD0AIwCAAFhaDEYMhi3YzuA8ADwQAABbXI5GD0YbAA7gOsA60BvAACgrCCAAWNpcABGGEgYSxhsACFgcwD0ACwEAAFlb08YVxhjAHQAYQB0AGkAbwDuABoEbgBlAG4AdABpAGEAbADlADME4Ql1GAAAgRgAAIMYiBgAAAAAoRilGAAAqhgAALsYvhjRGAAA1xgnGWwAbABpAG4AZwBkAG8AdABzAGUA8QBlF3kARGRtImFsZQAAoEAmgAFpbHIAjRiRGJ0Y7CFpZwCgA/tpApcYAAAAAJoYZwAAoAD7aQBnAACgBPsA4DXYI93sIWlnAKAB++whaWcA4GYAagCAAWFsdACvGLIYthh0AACgbSZpAGcAAKAC+24AcwAAoLElbwBmAJJh8AHCGAAAxhhmAADgNdhX3QABYWvJGMwYbADsAGsEdqDUIgCg2SphI3J0aW50AACgDSoAAWFv2hgiGQABY3PeGB8ZsQPnGP0YBRkSGRUZAAAdGbID7xjyGPQY9xj5GAAA+xg7gL0AvUAAoFMhO4C8ALxAAKBVIQCgWSEAoFshswEBGQAAAxkAoFQhAKBWIbQCCxkOGQAAAAAQGTuAvgC+QACgVyEAoFwhNQAAoFghtgEZGQAAGxkAoFohAKBdITgAAKBeIWwAAKBEIHcAbgAAoCIjYwByAADgNdi73IAIRWFiY2RlZmdpamxub3JzdHYARhlKGVoZXhlmGWkZkhmWGZkZnRmgGa0ZxhnLGc8Z4BkjGmygZyIAoIwqgAFjbXAAUBlTGVgZ9SF0ZfVhbQBhAOSgswM6FgCghipyImV2ZQAfYQABaXliGWUZcgBjAB1hM2RvAHQAIWGAoWUibHFzAMYEcBl6GfGhZSLOBAAAdhlsAGEAbgD0AN8EgKF+KmNkbACBGYQZjBljAACgqSpvAHQAb6CAKmyggioAoIQqZeDbIgD+cwAAoJQqcgAA4DXYJN3noGsirATtIWVsAKA3IWMAeQBTZIChdyJFYWoApxmpGasZAKCSKgCgpSoAoKQqAAJFYWVztBm2Gb0ZwhkAoGkicABwoIoq8iFveACgiipxoIgq8aCIKrUZaQBtAACg5yJwAGYAAOA12FjdYQB2AOUAYwIAAWNp0xnWGXIAAKAKIW0AAKFzImVs3BneGQCgjioAoJAqAIM+ADtjZGxxco0E6xn0GfgZ/BkBGgABY2nvGfEZAKCnKnIAAKB6Km8AdAAAoNci0CFhcgCglSl1ImVzdAAAoHwqgAJhZGVscwAKGvQZFhrVBCAa8AEPGgAAFBpwAHIAbwD4AFkZcgAAoHgpcQAAAWxxxAQbGmwAZQBzAPMASRlpAO0A5AQAAWVuJxouGnIjdG5lcXEAAOBpIgD+xQAsGgAFQWFiY2Vma29zeUAaQxpmGmoabRqDGocalhrCGtMacgDyAMwCAAJpbG1yShpOGlAaVBpyAHMA8ABxD2YAvWBpAGwA9AASBQABZHJYGlsaYwB5AEpkAKGUIWN3YBpkGmkAcgAAoEgpAKCtIWEAcgAAoA8h6SFyYyVhgAFhbHIAcxp7Gn8a8iF0c3WgZSZpAHQAAKBlJuwhaXAAoCYg4yFvbgCguSJyAADgNdgl3XMAAAFld4wakRphInJvdwAAoCUpYSJyb3cAAKAmKYACYW1vcHIAnxqjGqcauhq+GnIAcgAAoP8h9CFodACgOyJrAAABbHKsGrMaZSRmdGFycm93AACgqSHpJGdodGFycm93AKCqIWYAAOA12Fnd4iFhcgCgFSCAAWNsdADIGswa0BpyAADgNdi93GEAcwDoAGka8iFvaydhAAFicNca2xr1IWxsAKBDIOghZW4AoBAg4Qr2GgAA/RoAAAgbExsaGwAAIRs7GwAAAAA+G2IbmRuVG6sbAACyG80b0htjAHUAdABlADuA7QDtQAChYyBpeQEbBhtyAGMAO4DuAO5AOGQAAWN4CxsNG3kANWRjAGwAO4ChAKFAAAFmcssCFhsA4DXYJt1yAGEAdgBlADuA7ADsQIChSCFpbm8AJxsyGzYbAAFpbisbLxtuAHQAAKAMKnQAAKAtIuYhaW4AoNwpdABhAACgKSHsIWlnM2GAAWFvcABDG1sbXhuAAWNndABJG0sbWRtyACthgAFlbHAAcQVRG1UbaQBuAOUAyAVhAHIA9AByBWgAMWFmAACgtyJlAGQAtWEAoggiY2ZvdGkbbRt1G3kb4SFyZQCgBSFpAG4AdKAeImkAZQAAoN0pZABvAPQAWxsAoisiY2VscIEbhRuPG5QbYQBsAACguiIAAWdyiRuNG2UAcgDzACMQ4wCCG2EicmhrAACgFyryIW9kAKA8KgACY2dwdJ8boRukG6gbeQBRZG8AbgAvYWYAAOA12FrdYQC5Y3UAZQBzAHQAO4C/AL9AAAFjabUbuRtyAADgNdi+3G4AAKIIIkVkc3bCG8QbyBvQAwCg+SJvAHQAAKD1Inag9CIAoPMiaaBiIOwhZGUpYesB1hsAANkbYwB5AFZkbAA7gO8A70AAA2NmbW9zdeYb7hvyG/Ub+hsFHAABaXnqG+0bcgBjADVhOWRyAADgNdgn3eEhdGg3YnAAZgAA4DXYW93jAf8bAAADHHIAAOA12L/c8iFjeVhk6yFjeVRkAARhY2ZnaGpvcxUcGhwiHCYcKhwtHDAcNRzwIXBhdqC6A/BjAAFleR4cIRzkIWlsN2E6ZHIAAOA12CjdciJlZW4AOGFjAHkARWRjAHkAXGRwAGYAAOA12FzdYwByAADgNdjA3IALQUJFSGFiY2RlZmdoamxtbm9wcnN0dXYAXhxtHHEcdRx5HN8cBx0dHTwd3B3tHfEdAR4EHh0eLB5FHrwewx7hHgkfPR9LH4ABYXJ0AGQcZxxpHHIA8gBvB/IAxQLhIWlsAKAbKeEhcnIAoA4pZ6BmIgCgiyphAHIAAKBiKWMJjRwAAJAcAACVHAAAAAAAAAAAAACZHJwcAACmHKgcrRwAANIc9SF0ZTph7SJwdHl2AKC0KXIAYQDuAFoG4iFkYbtjZwAAoegnZGyhHKMcAKCRKeUAiwYAoIUqdQBvADuAqwCrQHIAgKOQIWJmaGxwc3QAuhy/HMIcxBzHHMoczhxmoOQhcwAAoB8pcwAAoB0p6wCyGnAAAKCrIWwAAKA5KWkAbQAAoHMpbAAAoKIhAKGrKmFl1hzaHGkAbAAAoBkpc6CtKgDgrSoA/oABYWJyAOUc6RztHHIAcgAAoAwpcgBrAACgcicAAWFr8Rz4HGMAAAFla/Yc9xx7YFtgAAFlc/wc/hwAoIspbAAAAWR1Ax0FHQCgjykAoI0pAAJhZXV5Dh0RHRodHB3yIW9uPmEAAWRpFR0YHWkAbAA8YewAowbiAPccO2QAAmNxcnMkHScdLB05HWEAAKA2KXUAbwDyoBwgqhEAAWR1MB00HeghYXIAoGcpcyJoYXIAAKBLKWgAAKCyIQCiZCJmZ3FzRB1FB5Qdnh10AIACYWhscnQATh1WHWUdbB2NHXIicm93AHSgkCFhAOkAzxxhI3Jwb29uAAABZHVeHWId7yF3bgCgvSFwAACgvCHlJGZ0YXJyb3dzAKDHIWkiZ2h0AIABYWhzAHUdex2DHXIicm93APOglCGdBmEAcgBwAG8AbwBuAPMAzgtxAHUAaQBnAGEAcgByAG8A9wBlGugkcmVldGltZXMAoMsi8aFkIk0HAACaHWwAYQBuAPQAXgcAon0qY2Rnc6YdqR2xHbcdYwAAoKgqbwB0AG+gfypyoIEqAKCDKmXg2iIA/nMAAKCTKoACYWRlZ3MAwB3GHcod1h3ZHXAAcAByAG8A+ACmHG8AdAAAoNYicQAAAWdxzx3SHXQA8gBGB2cAdADyAHQcdADyAFMHaQDtAGMHgAFpbHIA4h3mHeod8yFodACgfClvAG8A8gDKBgDgNdgp3UWgdiIAoJEqYQH1Hf4dcgAAAWR1YB35HWygvCEAoGopbABrAACghCVjAHkAWWQAomoiYWNodAweDx4VHhkecgDyAGsdbwByAG4AZQDyAGAW4SFyZACgaylyAGkAAKD6JQABaW8hHiQe5CFvdEBh9SFzdGGgsCPjIWhlAKCwIwACRWFlczMeNR48HkEeAKBoInAAcKCJKvIhb3gAoIkqcaCHKvGghyo0HmkAbQAAoOYiAARhYm5vcHR3elIeXB5fHoUelh6mHqsetB4AAW5yVh5ZHmcAAKDsJ3IAAKD9IXIA6wCwBmcAgAFsbXIAZh52Hnse5SFmdAABYXKIB2weaQBnAGgAdABhAHIAcgBvAPcAkwfhInBzdG8AoPwnaQBnAGgAdABhAHIAcgBvAPcAmgdwI2Fycm93AAABbHKNHpEeZQBmAPQAxhxpImdodAAAoKwhgAFhZmwAnB6fHqIecgAAoIUpAOA12F3ddQBzAACgLSppIm1lcwAAoDQqYQGvHrMecwB0AACgFyLhAIoOZaHKJbkeRhLuIWdlAKDKJWEAcgBsoCgAdAAAoJMpgAJhY2htdADMHs8e1R7bHt0ecgDyAJ0GbwByAG4AZQDyANYWYQByAGSgyyEAoG0pAKAOIHIAaQAAoL8iAANhY2hpcXTrHu8e1QfzHv0eBh/xIXVvAKA5IHIAAOA12MHcbQDloXIi+h4AAPweAKCNKgCgjyoAAWJ19xwBH28AcqAYIACgGiDyIW9rQmEAhDwAO2NkaGlscXJCBhcfxh0gHyQfKB8sHzEfAAFjaRsfHR8AoKYqcgAAoHkqcgBlAOUAkx3tIWVzAKDJIuEhcnIAoHYpdSJlc3QAAKB7KgABUGk1HzkfYQByAACglillocMlAgdfEnIAAAFkdUIfRx9zImhhcgAAoEop6CFhcgCgZikAAWVuTx9WH3IjdG5lcXEAAOBoIgD+xQBUHwAHRGFjZGVmaGlsbm9wc3VuH3Ifoh+rH68ftx+7H74f5h/uH/MfBwj/HwsgxCFvdACgOiIAAmNscHJ5H30fiR+eH3IAO4CvAK9AAAFldIEfgx8AoEImZaAgJ3MAZQAAoCAnc6CmIXQAbwCAoaYhZGx1AJQfmB+cH28AdwDuAHkDZQBmAPQA6gbwAOkO6yFlcgCgriUAAW95ph+qH+0hbWEAoCkqPGThIXNoAKAUIOElc3VyZWRhbmdsZQCgISJyAADgNdgq3W8AAKAnIYABY2RuAMQfyR/bH3IAbwA7gLUAtUBhoiMi0B8AANMf1x9zAPQAKxFpAHIAAKDwKm8AdAA7gLcAt0B1AHMA4qESIh4TAADjH3WgOCIAoCoqYwHqH+0fcAAAoNsq8gB+GnAAbAB1APMACAgAAWRw9x/7H+UhbHMAoKciZgAA4DXYXt0AAWN0AyAHIHIAAOA12MLc8CFvcwCgPiJsobwDECAVIPQiaW1hcACguCJhAPAAEyAADEdMUlZhYmNkZWZnaGlqbG1vcHJzdHV2dzwgRyBmIG0geSCqILgg2iDeIBEhFSEyIUMhTSFQIZwhnyHSIQAiIyKLIrEivyIUIwABZ3RAIEMgAODZIjgD9uBrItIgBwmAAWVsdABNIF8gYiBmAHQAAAFhclMgWCByInJvdwAAoM0h6SRnaHRhcnJvdwCgziEA4NgiOAP24Goi0iBfCekkZ2h0YXJyb3cAoM8hAAFEZHEgdSDhIXNoAKCvIuEhc2gAoK4igAJiY25wdACCIIYgiSCNIKIgbABhAACgByL1IXRlRGFnAADgICLSIACiSSJFaW9wlSCYIJwgniAA4HAqOANkAADgSyI4A3MASWFyAG8A+AAyCnUAcgBhoG4mbADzoG4mmwjzAa8gAACzIHAAO4CgAKBAbQBwAOXgTiI4AyoJgAJhZW91eQDBIMogzSDWINkg8AHGIAAAyCAAoEMqbwBuAEhh5CFpbEZhbgBnAGSgRyJvAHQAAOBtKjgDcAAAoEIqPWThIXNoAKATIACjYCJBYWRxc3jpIO0g+SD+IAIhDCFyAHIAAKDXIXIAAAFocvIg9SBrAACgJClvoJch9wAGD28AdAAA4FAiOAN1AGkA9gC7CAABZWkGIQohYQByAACgKCntAN8I6SFzdPOgBCLlCHIAAOA12CvdAAJFZXN0/wgcISshLiHxoXEiIiEAABMJ8aFxIgAJAAAnIWwAYQBuAPQAEwlpAO0AGQlyoG8iAKBvIoABQWFwADghOyE/IXIA8gBeIHIAcgAAoK4hYQByAACg8ipzogsiSiEAAAAAxwtkoPwiAKD6ImMAeQBaZIADQUVhZGVzdABcIV8hYiFmIWkhkyGWIXIA8gBXIADgZiI4A3IAcgAAoJohcgAAoCUggKFwImZxcwBwIYQhjiF0AAABYXJ1IXohcgByAG8A9wBlIWkAZwBoAHQAYQByAHIAbwD3AD4h8aFwImAhAACKIWwAYQBuAPQAZwlz4H0qOAMAoG4iaQDtAG0JcqBuImkA5aDqIkUJaQDkADoKAAFwdKMhpyFmAADgNdhf3YCBrAA7aW4AriGvIcchrEBuAIChCSJFZHYAtyG6Ib8hAOD5IjgDbwB0AADg9SI4A+EB1gjEIcYhAKD3IgCg9iJpAHagDCLhAagJzyHRIQCg/iIAoP0igAFhb3IA2CHsIfEhcgCAoSYiYXN0AOAh5SHpIWwAbABlAOwAywhsAADg/SrlIADgAiI4A2wiaW50AACgFCrjoYAi9yEAAPohdQDlAJsJY+CvKjgDZaCAIvEAkwkAAkFhaXQHIgoiFyIeInIA8gBsIHIAcgAAoZshY3cRIhQiAOAzKTgDAOCdITgDZyRodGFycm93AACgmyFyAGkA5aDrIr4JgANjaGltcHF1AC8iPCJHIpwhTSJQIloigKGBImNlcgA2Iv0JOSJ1AOUABgoA4DXYw9zvIXJ0bQKdIQAAAABEImEAcgDhAOEhbQBloEEi8aBEIiYKYQDyAMsIcwB1AAABYnBWIlgi5QDUCeUA3wmAAWJjcABgInMieCKAoYQiRWVzAGci7glqIgDgxSo4A2UAdABl4IIi0iBxAPGgiCJoImMAZaCBIvEA/gmAoYUiRWVzAH8iFgqCIgDgxio4A2UAdABl4IMi0iBxAPGgiSKAIgACZ2lscpIilCKaIpwi7AAMCWwAZABlADuA8QDxQOcAWwlpI2FuZ2xlAAABbHKkIqoi5SFmdGWg6iLxAEUJaSJnaHQAZaDrIvEAvgltoL0DAKEjAGVzuCK8InIAbwAAoBYhcAAAoAcggARESGFkZ2lscnMAziLSItYi2iLeIugi7SICIw8j4SFzaACgrSLhIXJyAKAEKXAAAOBNItIg4SFzaACgrCIAAWV04iLlIgDgZSLSIADgPgDSIG4iZmluAACg3imAAUFldADzIvci+iJyAHIAAKACKQDgZCLSIHLgPADSIGkAZQAA4LQi0iAAAUF0BiMKI3IAcgAAoAMp8iFpZQDgtSLSIGkAbQAA4Dwi0iCAAUFhbgAaIx4jKiNyAHIAAKDWIXIAAAFociMjJiNrAACgIylvoJYh9wD/DuUhYXIAoCcpUxJqFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVCMAAF4jaSN/I4IjjSOeI8AUAAAAAKYjwCMAANoj3yMAAO8jHiQvJD8kRCQAAWNzVyNsFHUAdABlADuA8wDzQAABaXlhI2cjcgBjoJoiO4D0APRAPmSAAmFiaW9zAHEjdCN3I3EBeiNzAOgAdhTsIWFjUWF2AACgOCrvIWxkAKC8KewhaWdTYQABY3KFI4kjaQByAACgvykA4DXYLN1vA5QjAAAAAJYjAACcI24A22JhAHYAZQA7gPIA8kAAoMEpAAFibaEjjAphAHIAAKC1KQACYWNpdKwjryO6I70jcgDyAFkUAAFpcrMjtiNyAACgvinvIXNzAKC7KW4A5QDZCgCgwCmAAWFlaQDFI8gjyyNjAHIATWFnAGEAyWOAAWNkbgDRI9Qj1iPyIW9uv2MAoLYpdQDzAHgBcABmAADgNdhg3YABYWVsAOQj5yPrI3IAAKC3KXIAcAAAoLkpdQDzAHwBAKMoImFkaW9zdvkj/CMPJBMkFiQbJHIA8gBeFIChXSplZm0AAyQJJAwkcgBvoDQhZgAAoDQhO4CqAKpAO4C6ALpA5yFvZgCgtiJyAACgVipsIm9wZQAAoFcqAKBbKoABY2xvACMkJSQrJPIACCRhAHMAaAA7gPgA+EBsAACgmCJpAGwBMyQ4JGQAZQA7gPUA9UBlAHMAYaCXInMAAKA2Km0AbAA7gPYA9kDiIWFyAKA9I+EKXiQAAHokAAB8JJQkAACYJKkkAAAAALUkEQsAAPAkAAAAAAQleiUAAIMlcgCAoSUiYXN0AGUkbyQBCwCBtgA7bGokayS2QGwAZQDsABgDaQJ1JAAAAAB4JG0AAKDzKgCg/Sp5AD9kcgCAAmNpbXB0AIUkiCSLJJkSjyRuAHQAJWBvAGQALmBpAGwAAKAwIOUhbmsAoDEgcgAA4DXYLd2AAWltbwCdJKAkpCR2oMYD1WNtAGEA9AD+B24AZQAAoA4m9KHAA64kAAC0JGMjaGZvcmsAAKDUItZjAAFhdbgkxCRuAAABY2u9JMIkawBooA8hAKAOIfYAaRpzAACkKwBhYmNkZW1zdNMkIRPXJNsk4STjJOck6yTjIWlyAKAjKmkAcgAAoCIqAAFvdYsW3yQAoCUqAKByKm4AO4CxALFAaQBtAACgJip3AG8AAKAnKoABaXB1APUk+iT+JO4idGludACgFSpmAADgNdhh3W4AZAA7gKMAo0CApHoiRWFjZWlub3N1ABMlFSUYJRslTCVRJVklSSV1JQCgsypwAACgtyp1AOUAPwtjoK8qgKJ6ImFjZW5zACclLSU0JTYlSSVwAHAAcgBvAPgAFyV1AHIAbAB5AGUA8QA/C/EAOAuAAWFlcwA8JUElRSXwInByb3gAoLkqcQBxAACgtSppAG0AAKDoImkA7QBEC20AZQDzoDIgIguAAUVhcwBDJVclRSXwAEAlgAFkZnAATwtfJXElgAFhbHMAZSVpJW0l7CFhcgCgLiPpIW5lAKASI/UhcmYAoBMjdKAdIu8AWQvyIWVsAKCwIgABY2l9JYElcgAA4DXYxdzIY24iY3NwAACgCCAAA2Zpb3BzdZElKxuVJZolnyWkJXIAAOA12C7dcABmAADgNdhi3XIiaW1lAACgVyBjAHIAAOA12MbcgAFhZW8AqiW6JcAldAAAAWVpryW2JXIAbgBpAG8AbgDzABkFbgB0AACgFipzAHQAZaA/APEACRj0AG0LgApBQkhhYmNkZWZoaWxtbm9wcnN0dXgA4yXyJfYl+iVpJpAmpia9JtUm5ib4JlonaCdxJ3UnnietJ7EnyCfiJ+cngAFhcnQA6SXsJe4lcgDyAJkM8gD6AuEhaWwAoBwpYQByAPIA3BVhAHIAAKBkKYADY2RlbnFydAAGJhAmEyYYJiYmKyZaJgABZXUKJg0mAOA9IjEDdABlAFVhaQDjACAN7SJwdHl2AKCzKWcAgKHpJ2RlbAAgJiImJCYAoJIpAKClKeUA9wt1AG8AO4C7ALtAcgAApZIhYWJjZmhscHN0dz0mQCZFJkcmSiZMJk4mUSZVJlgmcAAAoHUpZqDlIXMAAKAgKQCgMylzAACgHinrALka8ACVHmwAAKBFKWkAbQAAoHQpbAAAoKMhAKCdIQABYWleJmImaQBsAACgGilvAG6gNiJhAGwA8wB2C4ABYWJyAG8mciZ2JnIA8gAvEnIAawAAoHMnAAFha3omgSZjAAABZWt/JoAmfWBdYAABZXOFJocmAKCMKWwAAAFkdYwmjiYAoI4pAKCQKQACYWV1eZcmmiajJqUm8iFvbllhAAFkaZ4moSZpAGwAV2HsAA8M4gCAJkBkAAJjbHFzrSawJrUmuiZhAACgNylkImhhcgAAoGkpdQBvAPKgHSCjAWgAAKCzIYABYWNnAMMm0iaUC2wAgKEcIWlwcwDLJs4migxuAOUAoAxhAHIA9ADaC3QAAKCtJYABaWxyANsm3ybjJvMhaHQAoH0pbwBvAPIANgwA4DXYL90AAWFv6ib1JnIAAAFkde8m8SYAoMEhbKDAIQCgbCl2oMED8WOAAWducwD+Jk4nUCdoAHQAAANhaGxyc3QKJxInISc1Jz0nRydyInJvdwB0oJIhYQDpAFYmYSNycG9vbgAAAWR1GiceJ28AdwDuAPAmcAAAoMAh5SFmdAABYWgnJy0ncgByAG8AdwDzAAkMYQByAHAAbwBvAG4A8wATBGklZ2h0YXJyb3dzAACgySFxAHUAaQBnAGEAcgByAG8A9wBZJugkcmVldGltZXMAoMwiZwDaYmkAbgBnAGQAbwB0AHMAZQDxABwYgAFhaG0AYCdjJ2YncgDyAAkMYQDyABMEAKAPIG8idXN0AGGgsSPjIWhlAKCxI+0haWQAoO4qAAJhYnB0fCeGJ4knmScAAW5ygCeDJ2cAAKDtJ3IAAKD+IXIA6wAcDIABYWZsAI8nkieVJ3IAAKCGKQDgNdhj3XUAcwAAoC4qaSJtZXMAAKA1KgABYXCiJ6gncgBnoCkAdAAAoJQp7yJsaW50AKASKmEAcgDyADwnAAJhY2hxuCe8J6EMwCfxIXVvAKA6IHIAAOA12MfcAAFidYAmxCdvAPKgGSCoAYABaGlyAM4n0ifWJ3IAZQDlAE0n7SFlcwCgyiJpAIChuSVlZmwAXAxjEt4n9CFyaQCgzinsInVoYXIAoGgpAKAeIWENBSgJKA0oSyhVKIYoAACLKLAoAAAAAOMo5ygAABApJCkxKW0pcSmHKaYpAACYKgAAAACxKmMidXRlAFthcQB1AO8ABR+ApHsiRWFjZWlucHN5ABwoHignKCooLygyKEEoRihJKACgtCrwASMoAAAlKACguCpvAG4AYWF1AOUAgw1koLAqaQBsAF9hcgBjAF1hgAFFYXMAOCg6KD0oAKC2KnAAAKC6KmkAbQAAoOki7yJsaW50AKATKmkA7QCIDUFkbwB0AGKixSKRFgAAAABTKACgZiqAA0FhY21zdHgAYChkKG8ocyh1KHkogihyAHIAAKDYIXIAAAFocmkoayjrAJAab6CYIfcAzAd0ADuApwCnQGkAO2D3IWFyAKApKW0AAAFpbn4ozQBuAHUA8wDOAHQAAKA2J3IA7+A12DDdIxkAAmFjb3mRKJUonSisKHIAcAAAoG8mAAFoeZkonChjAHkASWRIZHIAdABtAqUoAAAAAKgoaQDkAFsPYQByAGEA7ABsJDuArQCtQAABZ22zKLsobQBhAAChwwNmdroouijCY4CjPCJkZWdsbnByAMgozCjPKNMo1yjaKN4obwB0AACgairxoEMiCw5FoJ4qAKCgKkWgnSoAoJ8qZQAAoEYi7CF1cwCgJCrhIXJyAKByKWEAcgDyAPwMAAJhZWl07Sj8KAEpCCkAAWxz8Sj4KGwAcwBlAHQAbQDpAH8oaABwAACgMyrwImFyc2wAoOQpAAFkbFoPBSllAACgIyNloKoqc6CsKgDgrCoA/oABZmxwABUpGCkfKfQhY3lMZGKgLwBhoMQpcgAAoD8jZgAA4DXYZN1hAAABZHIoKRcDZQBzAHWgYCZpAHQAAKBgJoABY3N1ADYpRilhKQABYXU6KUApcABzoJMiAOCTIgD+cABzoJQiAOCUIgD+dQAAAWJwSylWKQChjyJlcz4NUCllAHQAZaCPIvEAPw0AoZAiZXNIDVspZQB0AGWgkCLxAEkNAKGhJWFmZilbBHIAZQFrKVwEAKChJWEAcgDyAAMNAAJjZW10dyl7KX8pgilyAADgNdjI3HQAbQDuAM4AaQDsAAYpYQByAOYAVw0AAWFyiimOKXIA5qAGJhESAAFhbpIpoylpImdodAAAAWVwmSmgKXAAcwBpAGwAbwDuANkXaADpAKAkcwCvYIACYmNtbnAArin8KY4NJSooKgCkgiJFZGVtbnByc7wpvinCKcgpzCnUKdgp3CkAoMUqbwB0AACgvSpkoIYibwB0AACgwyr1IWx0AKDBKgABRWXQKdIpAKDLKgCgiiLsIXVzAKC/KuEhcnIAoHkpgAFlaXUA4inxKfQpdAAAoYIiZW7oKewpcQDxoIYivSllAHEA8aCKItEpbQAAoMcqAAFicPgp+ikAoNUqAKDTKmMAgKJ7ImFjZW5zAAcqDSoUKhYqRihwAHAAcgBvAPgAIyh1AHIAbAB5AGUA8QCDDfEAfA2AAWFlcwAcKiIqPShwAHAAcgBvAPgAPChxAPEAOShnAACgaiYApoMiMTIzRWRlaGxtbnBzPCo/KkIqRSpHKlIqWCpjKmcqaypzKncqO4C5ALlAO4CyALJAO4CzALNAAKDGKgABb3NLKk4qdAAAoL4qdQBiAACg2CpkoIcibwB0AACgxCpzAAABb3VdKmAqbAAAoMknYgAAoNcq4SFycgCgeyn1IWx0AKDCKgABRWVvKnEqAKDMKgCgiyLsIXVzAKDAKoABZWl1AH0qjCqPKnQAAKGDImVugyqHKnEA8aCHIkYqZQBxAPGgiyJwKm0AAKDIKgABYnCTKpUqAKDUKgCg1iqAAUFhbgCdKqEqrCpyAHIAAKDZIXIAAAFocqYqqCrrAJUab6CZIfcAxQf3IWFyAKAqKWwAaQBnADuA3wDfQOELzyrZKtwq6SrsKvEqAAD1KjQrAAAAAAAAAAAAAEwrbCsAAHErvSsAAAAAAADRK3IC1CoAAAAA2CrnIWV0AKAWI8RjcgDrAOUKgAFhZXkA4SrkKucq8iFvbmVh5CFpbGNhQmRvAPQAIg5sInJlYwAAoBUjcgAA4DXYMd0AAmVpa2/7KhIrKCsuK/IBACsAAAkrZQAAATRm6g0EK28AcgDlAOsNYQBzorgDECsAAAAAEit5AG0A0WMAAWNuFislK2sAAAFhcxsrIStwAHAAcgBvAPgAFw5pAG0AAKA8InMA8AD9DQABYXMsKyEr8AAXDnIAbgA7gP4A/kDsATgrOyswG2QA5QBnAmUAcwCAgdcAO2JkAEMrRCtJK9dAYaCgInIAAKAxKgCgMCqAAWVwcwBRK1MraSvhAAkh4qKkIlsrXysAAAAAYytvAHQAAKA2I2kAcgAAoPEqb+A12GXdcgBrAACg2irhAHgociJpbWUAAKA0IIABYWlwAHYreSu3K2QA5QC+DYADYWRlbXBzdACFK6MrmiunK6wrsCuzK24iZ2xlAACitSVkbHFykCuUK5ornCvvIXduAKC/JeUhZnRloMMl8QACBwCgXCJpImdodABloLkl8QBdDG8AdAAAoOwlaSJudXMAAKA6KuwhdXMAoDkqYgAAoM0p6SFtZQCgOyrlInppdW0AoOIjgAFjaHQAwivKK80rAAFyecYrySsA4DXYydxGZGMAeQBbZPIhb2tnYQABaW/UK9creAD0ANERaCJlYWQAAAFsct4r5ytlAGYAdABhAHIAcgBvAPcAXQbpJGdodGFycm93AKCgIQAJQUhhYmNkZmdobG1vcHJzdHV3CiwNLBEsHSwnLDEsQCxLLFIsYix6LIQsjyzLLOgs7Sz/LAotcgDyAAkDYQByAACgYykAAWNyFSwbLHUAdABlADuA+gD6QPIACQ1yAOMBIywAACUseQBeZHYAZQBtYQABaXkrLDAscgBjADuA+wD7QENkgAFhYmgANyw6LD0scgDyANEO7CFhY3FhYQDyAOAOAAFpckQsSCzzIWh0AKB+KQDgNdgy3XIAYQB2AGUAO4D5APlAYQFWLF8scgAAAWxyWixcLACgvyEAoL4hbABrAACggCUAAWN0Zix2LG8CbCwAAAAAcyxyAG4AZaAcI3IAAKAcI28AcAAAoA8jcgBpAACg+CUAAWFsfiyBLGMAcgBrYTuAqACoQAABZ3CILIssbwBuAHNhZgAA4DXYZt0AA2FkaGxzdZksniynLLgsuyzFLHIAcgBvAPcACQ1vAHcAbgBhAHIAcgBvAPcA2A5hI3Jwb29uAAABbHKvLLMsZQBmAPQAWyxpAGcAaAD0AF0sdQDzAKYOaQAAocUDaGzBLMIs0mNvAG4AxWPwI2Fycm93cwCgyCGAAWNpdADRLOEs5CxvAtcsAAAAAN4scgBuAGWgHSNyAACgHSNvAHAAAKAOI24AZwBvYXIAaQAAoPklYwByAADgNdjK3IABZGlyAPMs9yz6LG8AdAAAoPAi7CFkZWlhaQBmoLUlAKC0JQABYW0DLQYtcgDyAMosbAA7gPwA/EDhIm5nbGUAoKcpgAdBQkRhY2RlZmxub3Byc3oAJy0qLTAtNC2bLZ0toS2/LcMtxy3TLdgt3C3gLfwtcgDyABADYQByAHag6CoAoOkqYQBzAOgA/gIAAW5yOC08LechcnQAoJwpgANla25wcnN0AJkpSC1NLVQtXi1iLYItYQBwAHAA4QAaHG8AdABoAGkAbgDnAKEXgAFoaXIAoSmzJFotbwBwAPQAdCVooJUh7wD4JgABaXVmLWotZwBtAOEAuygAAWJwbi14LXMjZXRuZXEAceCKIgD+AODLKgD+cyNldG5lcQBx4IsiAP4A4MwqAP4AAWhyhi2KLWUAdADhABIraSNhbmdsZQAAAWxyki2WLeUhZnQAoLIiaSJnaHQAAKCzInkAMmThIXNoAKCiIoABZWxyAKcttC24LWKiKCKuLQAAAACyLWEAcgAAoLsicQAAoFoi7CFpcACg7iIAAWJ0vC1eD2EA8gBfD3IAAOA12DPddAByAOkAlS1zAHUAAAFicM0t0C0A4IIi0iAA4IMi0iBwAGYAAOA12GfdcgBvAPAAWQt0AHIA6QCaLQABY3XkLegtcgAA4DXYy9wAAWJw7C30LW4AAAFFZXUt8S0A4IoiAP5uAAABRWV/LfktAOCLIgD+6SJnemFnAKCaKYADY2Vmb3BycwANLhAuJS4pLiMuLi40LukhcmN1YQABZGkULiEuAAFiZxguHC5hAHIAAKBfKmUAcaAnIgCgWSLlIXJwAKAYIXIAAOA12DTdcABmAADgNdho3WWgQCJhAHQA6ABqD2MAcgAA4DXYzNzjCuQRUC4AAFQuAABYLmIuAAAAAGMubS5wLnQuAAAAAIguki4AAJouJxIqEnQAcgDpAB0ScgAA4DXYNd0AAUFhWy5eLnIA8gDnAnIA8gCTB75jAAFBYWYuaS5yAPIA4AJyAPIAjAdhAPAAeh5pAHMAAKD7IoABZHB0APgReS6DLgABZmx9LoAuAOA12GnddQDzAP8RaQBtAOUABBIAAUFhiy6OLnIA8gDuAnIA8gCaBwABY3GVLgoScgAA4DXYzdwAAXB0nS6hLmwAdQDzACUScgDpACASAARhY2VmaW9zdbEuvC7ELsguzC7PLtQu2S5jAAABdXm2LrsudABlADuA/QD9QE9kAAFpecAuwy5yAGMAd2FLZG4AO4ClAKVAcgAA4DXYNt1jAHkAV2RwAGYAAOA12GrdYwByAADgNdjO3AABY23dLt8ueQBOZGwAO4D/AP9AAAVhY2RlZmhpb3N38y73Lv8uAi8MLxAvEy8YLx0vIi9jInV0ZQB6YQABYXn7Lv4u8iFvbn5hN2RvAHQAfGEAAWV0Bi8KL3QAcgDmAB8QYQC2Y3IAAOA12DfdYwB5ADZk5yJyYXJyAKDdIXAAZgAA4DXYa91jAHIAAOA12M/cAAFqbiYvKC8AoA0gagAAoAwg"),qo}var Jo={},cb;function db(){if(cb)return Jo;cb=1,Object.defineProperty(Jo,"__esModule",{value:!0}),Jo.xmlDecodeTree=void 0;const e=b1();return Jo.xmlDecodeTree=(0,e.decodeBase64)("AAJhZ2xxBwARABMAFQBtAg0AAAAAAA8AcAAmYG8AcwAnYHQAPmB0ADxg9SFvdCJg"),Jo}var Zo={},ub;function UR(){if(ub)return Zo;ub=1,Object.defineProperty(Zo,"__esModule",{value:!0}),Zo.BinTrieFlags=void 0;var e;return(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.FLAG13=8192]="FLAG13",t[t.BRANCH_LENGTH=8064]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(e||(Zo.BinTrieFlags=e={})),Zo}var hb;function pb(){return hb||(hb=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.xmlDecodeTree=e.htmlDecodeTree=e.replaceCodePoint=e.fromCodePoint=e.decodeCodePoint=e.EntityDecoder=e.DecodingMode=void 0,e.determineBranch=b,e.decodeHTML=w,e.decodeHTMLAttribute=C,e.decodeHTMLStrict=E,e.decodeXML=S;const t=sb(),n=lb(),r=db(),i=UR();var s;(function(R){R[R.NUM=35]="NUM",R[R.SEMI=59]="SEMI",R[R.EQUALS=61]="EQUALS",R[R.ZERO=48]="ZERO",R[R.NINE=57]="NINE",R[R.LOWER_A=97]="LOWER_A",R[R.LOWER_F=102]="LOWER_F",R[R.LOWER_X=120]="LOWER_X",R[R.LOWER_Z=122]="LOWER_Z",R[R.UPPER_A=65]="UPPER_A",R[R.UPPER_F=70]="UPPER_F",R[R.UPPER_Z=90]="UPPER_Z"})(s||(s={}));const o=32;function a(R){return R>=s.ZERO&&R<=s.NINE}function l(R){return R>=s.UPPER_A&&R<=s.UPPER_F||R>=s.LOWER_A&&R<=s.LOWER_F}function d(R){return R>=s.UPPER_A&&R<=s.UPPER_Z||R>=s.LOWER_A&&R<=s.LOWER_Z||a(R)}function u(R){return R===s.EQUALS||d(R)}var h;(function(R){R[R.EntityStart=0]="EntityStart",R[R.NumericStart=1]="NumericStart",R[R.NumericDecimal=2]="NumericDecimal",R[R.NumericHex=3]="NumericHex",R[R.NamedEntity=4]="NamedEntity"})(h||(h={}));var p;(function(R){R[R.Legacy=0]="Legacy",R[R.Strict=1]="Strict",R[R.Attribute=2]="Attribute"})(p||(e.DecodingMode=p={}));class m{constructor(B,O,Y){this.decodeTree=B,this.emitCodePoint=O,this.errors=Y,this.state=h.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=p.Strict,this.runConsumed=0}startEntity(B){this.decodeMode=B,this.state=h.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(B,O){switch(this.state){case h.EntityStart:return B.charCodeAt(O)===s.NUM?(this.state=h.NumericStart,this.consumed+=1,this.stateNumericStart(B,O+1)):(this.state=h.NamedEntity,this.stateNamedEntity(B,O));case h.NumericStart:return this.stateNumericStart(B,O);case h.NumericDecimal:return this.stateNumericDecimal(B,O);case h.NumericHex:return this.stateNumericHex(B,O);case h.NamedEntity:return this.stateNamedEntity(B,O)}}stateNumericStart(B,O){return O>=B.length?-1:(B.charCodeAt(O)|o)===s.LOWER_X?(this.state=h.NumericHex,this.consumed+=1,this.stateNumericHex(B,O+1)):(this.state=h.NumericDecimal,this.stateNumericDecimal(B,O))}stateNumericHex(B,O){for(;O<B.length;){const Y=B.charCodeAt(O);if(a(Y)||l(Y)){const Q=Y<=s.NINE?Y-s.ZERO:(Y|o)-s.LOWER_A+10;this.result=this.result*16+Q,this.consumed++,O++}else return this.emitNumericEntity(Y,3)}return-1}stateNumericDecimal(B,O){for(;O<B.length;){const Y=B.charCodeAt(O);if(a(Y))this.result=this.result*10+(Y-s.ZERO),this.consumed++,O++;else return this.emitNumericEntity(Y,2)}return-1}emitNumericEntity(B,O){var Y;if(this.consumed<=O)return(Y=this.errors)===null||Y===void 0||Y.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(B===s.SEMI)this.consumed+=1;else if(this.decodeMode===p.Strict)return 0;return this.emitCodePoint((0,t.replaceCodePoint)(this.result),this.consumed),this.errors&&(B!==s.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(B,O){const{decodeTree:Y}=this;let Q=Y[this.treeIndex],W=(Q&i.BinTrieFlags.VALUE_LENGTH)>>14;for(;O<B.length;){if(W===0&&(Q&i.BinTrieFlags.FLAG13)!==0){const J=(Q&i.BinTrieFlags.BRANCH_LENGTH)>>7;if(this.runConsumed===0){const H=Q&i.BinTrieFlags.JUMP_TABLE;if(B.charCodeAt(O)!==H)return this.result===0?0:this.emitNotTerminatedNamedEntity();O++,this.excess++,this.runConsumed++}for(;this.runConsumed<J;){if(O>=B.length)return-1;const H=this.runConsumed-1,te=Y[this.treeIndex+1+(H>>1)],G=H%2===0?te&255:te>>8&255;if(B.charCodeAt(O)!==G)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();O++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(J>>1),Q=Y[this.treeIndex],W=(Q&i.BinTrieFlags.VALUE_LENGTH)>>14}if(O>=B.length)break;const ie=B.charCodeAt(O);if(ie===s.SEMI&&W!==0&&(Q&i.BinTrieFlags.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,W,this.consumed+this.excess);if(this.treeIndex=b(Y,Q,this.treeIndex+Math.max(1,W),ie),this.treeIndex<0)return this.result===0||this.decodeMode===p.Attribute&&(W===0||u(ie))?0:this.emitNotTerminatedNamedEntity();if(Q=Y[this.treeIndex],W=(Q&i.BinTrieFlags.VALUE_LENGTH)>>14,W!==0){if(ie===s.SEMI)return this.emitNamedEntityData(this.treeIndex,W,this.consumed+this.excess);this.decodeMode!==p.Strict&&(Q&i.BinTrieFlags.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}O++,this.excess++}return-1}emitNotTerminatedNamedEntity(){var B;const{result:O,decodeTree:Y}=this,Q=(Y[O]&i.BinTrieFlags.VALUE_LENGTH)>>14;return this.emitNamedEntityData(O,Q,this.consumed),(B=this.errors)===null||B===void 0||B.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(B,O,Y){const{decodeTree:Q}=this;return this.emitCodePoint(O===1?Q[B]&~(i.BinTrieFlags.VALUE_LENGTH|i.BinTrieFlags.FLAG13):Q[B+1],Y),O===3&&this.emitCodePoint(Q[B+2],Y),Y}end(){var B;switch(this.state){case h.NamedEntity:return this.result!==0&&(this.decodeMode!==p.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case h.NumericDecimal:return this.emitNumericEntity(0,2);case h.NumericHex:return this.emitNumericEntity(0,3);case h.NumericStart:return(B=this.errors)===null||B===void 0||B.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case h.EntityStart:return 0}}}e.EntityDecoder=m;function g(R){let B="";const O=new m(R,Y=>B+=(0,t.fromCodePoint)(Y));return function(Y,Q){let W=0,ie=0;for(;(ie=Y.indexOf("&",ie))>=0;){B+=Y.slice(W,ie),O.startEntity(Q);const H=O.write(Y,ie+1);if(H<0){W=ie+O.end();break}W=ie+H,ie=H===0?W+1:W}const J=B+Y.slice(W);return B="",J}}function b(R,B,O,Y){const Q=(B&i.BinTrieFlags.BRANCH_LENGTH)>>7,W=B&i.BinTrieFlags.JUMP_TABLE;if(Q===0)return W!==0&&Y===W?O:-1;if(W){const te=Y-W;return te<0||te>=Q?-1:R[O+te]-1}const ie=Q+1>>1;let J=0,H=Q-1;for(;J<=H;){const te=J+H>>>1,G=te>>1,M=R[O+G]>>(te&1)*8&255;if(M<Y)J=te+1;else if(M>Y)H=te-1;else return R[O+ie+te]}return-1}const A=g(n.htmlDecodeTree),y=g(r.xmlDecodeTree);function w(R,B=p.Legacy){return A(R,B)}function C(R){return A(R,p.Attribute)}function E(R){return A(R,p.Strict)}function S(R){return y(R,p.Strict)}var k=sb();Object.defineProperty(e,"decodeCodePoint",{enumerable:!0,get:function(){return k.decodeCodePoint}}),Object.defineProperty(e,"fromCodePoint",{enumerable:!0,get:function(){return k.fromCodePoint}}),Object.defineProperty(e,"replaceCodePoint",{enumerable:!0,get:function(){return k.replaceCodePoint}});var I=lb();Object.defineProperty(e,"htmlDecodeTree",{enumerable:!0,get:function(){return I.htmlDecodeTree}});var L=db();Object.defineProperty(e,"xmlDecodeTree",{enumerable:!0,get:function(){return L.xmlDecodeTree}})})(nb)),nb}var Xo={},mb={},fb;function Cp(){return fb||(fb=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.escapeText=e.escapeAttribute=e.escapeUTF8=e.escape=e.XML_BITSET_VALUE=e.getCodePoint=void 0,e.encodeXML=n;const t=new Map([[34,"""],[38,"&"],[39,"'"],[60,"<"],[62,">"]]);e.getCodePoint=String.prototype.codePointAt==null?(i,s)=>(i.charCodeAt(s)&64512)===55296?(i.charCodeAt(s)-55296)*1024+i.charCodeAt(s+1)-56320+65536:i.charCodeAt(s):((i,s)=>i.codePointAt(s)),e.XML_BITSET_VALUE=1342177476;function n(i){let s,o=0;const{length:a}=i;for(let l=0;l<a;l++){const d=i.charCodeAt(l);if(d<128&&((e.XML_BITSET_VALUE>>>d&1)===0||d>=64||d<32))continue;if(s===void 0?s=i.substring(0,l):o!==l&&(s+=i.substring(o,l)),d<64){s+=t.get(d),o=l+1;continue}const u=(0,e.getCodePoint)(i,l);s+=`&#x${u.toString(16)};`,u!==d&&l++,o=l+1}return s===void 0?i:(o<a&&(s+=i.substr(o)),s)}e.escape=n;function r(i,s){return function(o){let a,l=0,d="";for(;a=i.exec(o);)l!==a.index&&(d+=o.substring(l,a.index)),d+=s.get(a[0].charCodeAt(0)),l=a.index+1;return d+o.substring(l)}}e.escapeUTF8=r(/["&'<>]/g,t),e.escapeAttribute=r(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])),e.escapeText=r(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]]))})(mb)),mb}var ea={},Wl={},gb;function GR(){if(gb)return Wl;gb=1,Object.defineProperty(Wl,"__esModule",{value:!0}),Wl.parseEncodeTrie=e;function e(t){const n=new Map,r=t.length;let i=0,s=-1;function o(){const l=i;for(;i<r;){const d=t.charAt(i);if((d<"0"||d>"9")&&(d<"a"||d>"z"))break;i++}return i===l?0:Number.parseInt(t.slice(l,i),36)}function a(){if(t[i]!=="&")throw new Error(`Child entry missing value near index ${i}`);const l=i,d=t.indexOf(";",i+1);if(d===-1)throw new Error(`Unterminated entity starting at index ${l}`);return i=d+1,t.slice(l,i)}for(;i<r;){const l=o(),d=s===-1?l:s+l+1;let u;if(t[i]==="&"&&(u=a()),t[i]==="{"){i++;let h=o(),p=h;const m=a();if(t[i]==="{")throw new Error("Unexpected nested '{' beyond depth 2");if(t[i]==="}")n.set(d,{value:u,next:p,nextValue:m}),i++;else{const g=new Map;g.set(p,m);let b=p;for(;i<r&&t[i]!=="}";){h=o(),p=b+h+1;const A=a();if(t[i]==="{")throw new Error("Unexpected nested '{' beyond depth 2");g.set(p,A),b=p}if(t[i]!=="}")throw new Error("Unterminated child block");i++,n.set(d,{value:u,next:g})}}else{if(u===void 0)throw new Error(`Malformed encode trie: missing value at index ${i}`);n.set(d,u)}s=d}return n}return Wl}var Ab;function WR(){if(Ab)return ea;Ab=1,Object.defineProperty(ea,"__esModule",{value:!0}),ea.htmlTrie=void 0;const e=GR();return ea.htmlTrie=(0,e.parseEncodeTrie)("9	
m!"#$%&'()*+,1./a:;<{6he<⃒}={6hx=⃥}>{6he>⃒}?@q[\]^_`5{2yfj}k{|}y ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿĀāĂ㥹ĆćĈĉĊċČčĎďĐđĒē2ĖėĘęĚěĜĝĞğĠġĢ1ĤĥĦħĨĩĪī2ĮįİıIJijĴĵĶķĸĹĺĻļĽľĿŀŁłŃńŅņŇňʼnŊŋŌō2ŐőŒœŔŕŖŗŘřŚśŜŝŞşŠšŢţŤťŦŧŨũŪūŬŭŮůŰűŲųŴŵŶŷŸŹźŻżŽžjƒyƵ1rǵ1tȷ3yˆˇg˘˙˚˛˜˝1f̑3jΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ1ΣΤΥΦΧΨΩ7αβγδεζηθικλμνξοπρςστυφχψω7ϑϒ2ϕϖ5Ϝϝiϰϱ3ϵ϶aЁЂЃЄЅІЇЈЉЊЋЌ1ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя1ёђѓєѕіїјљњћќ1ўџ5gi    1    ​‌‍‎‏‐2–—―‖1‘’‚1“”„1†‡•2‥…9‰‱′″‴‵3‹›3‾2⁁1⁃⁄a⁏7⁗7 {6bu  }⁠⁡⁢⁣20€1a⃛⃜11ℂ2℅4ℊℋℌℍℎℏℐℑℒℓ1ℕ№℗℘ℙℚℛℜℝ℞3™1ℤ2℧ℨ℩2ℬℭ1ℯℰℱ1ℳℴℵℶℷℸcⅅⅆⅇⅈa⅓⅔⅕⅖⅗⅘⅙⅚⅛⅜⅝⅞1d←↑→↓↔↕↖↗↘↙↚↛1↝{mw↝̸}↞↟↠↡↢↣↤↥↦↧1↩↪↫↬↭↮1↰↱↲↳1↵↶↷2↺↻↼↽↾↿⇀⇁⇂⇃⇄⇅⇆⇇⇈⇉⇊⇋⇌⇍⇎⇏⇐⇑⇒⇓⇔⇕⇖⇗⇘⇙⇚⇛1⇝6⇤⇥f⇵7⇽⇾⇿∀∁∂{mw∂̸}∃∄∅1∇∈∉1∋∌2∏∐∑−∓∔1∖∗∘1√2∝∞∟∠{6he∠⃒}∡∢∣∤∥∦∧∨∩{1e68∩︀}∪{1e68∪︀}∫∬∭∮∯∰∱∲∳∴∵∶∷∸1∺∻∼{6he∼⃒}∽{mp∽̱}∾{mr∾̳}∿≀≁≂{mw≂̸}≃≄≅≆≇≈≉≊≋{mw≋̸}≌≍{6he≍⃒}≎{mw≎̸}≏{mw≏̸}≐{mw≐̸}≑≒≓≔≕≖≗1≙≚1≜2≟≠≡{6hx≡⃥}≢1≤{6he≤⃒}≥{6he≥⃒}≦{mw≦̸}≧{mw≧̸}≨{1e68≨︀}≩{1e68≩︀}≪{mw≪̸5uh≪⃒}≫{mw≫̸5uh≫⃒}≬≭≮≯≰≱≲≳≴≵≶≷≸≹≺≻≼≽≾≿{mw≿̸}⊀⊁⊂{6he⊂⃒}⊃{6he⊃⃒}⊄⊅⊆⊇⊈⊉⊊{1e68⊊︀}⊋{1e68⊋︀}1⊍⊎⊏{mw⊏̸}⊐{mw⊐̸}⊑⊒⊓{1e68⊓︀}⊔{1e68⊔︀}⊕⊖⊗⊘⊙⊚⊛1⊝⊞⊟⊠⊡⊢⊣⊤⊥1⊧⊨⊩⊪⊫⊬⊭⊮⊯⊰1⊲⊳⊴{6he⊴⃒}⊵{6he⊵⃒}⊶⊷⊸⊹⊺⊻1⊽⊾⊿⋀⋁⋂⋃⋄⋅⋆⋇⋈⋉⋊⋋⋌⋍⋎⋏⋐⋑⋒⋓⋔⋕⋖⋗⋘{mw⋘̸}⋙{mw⋙̸}⋚{1e68⋚︀}⋛{1e68⋛︀}2⋞⋟⋠⋡⋢⋣2⋦⋧⋨⋩⋪⋫⋬⋭⋮⋯⋰⋱⋲⋳⋴⋵{mw⋵̸}⋶⋷1⋹{mw⋹̸}⋺⋻⋼⋽⋾6⌅⌆1⌈⌉⌊⌋⌌⌍⌎⌏⌐1⌒⌓1⌕⌖5⌜⌝⌞⌟2⌢⌣9⌭⌮7⌶6⌽1⌿1o⍼1f⎰⎱2⎴⎵⎶11⏜⏝⏞⏟2⏢4⏧1n␣4kⓈ1j─1│9┌3┐3└3┘3├7┤7┬7┴7┼j═║╒╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡╢╣╤╥╦╧╨╩╪╫╬j▀3▄3█8░▒▓d□8▪▫1▭▮2▱1△▴▵2▸▹3▽▾▿2◂◃6◊○w◬2◯8◸◹◺◻◼8★☆7☎1d♀1♂t♠2♣1♥♦3♪2♭♮♯4j✓3✗8✠l✶x❘p❲❳2c⟈⟉s⟦⟧⟨⟩⟪⟫⟬⟭7⟵⟶⟷⟸⟹⟺1⟼2⟿76⤂⤃⤄⤅6⤌⤍⤎⤏⤐⤑⤒⤓2⤖2⤙⤚⤛⤜⤝⤞⤟⤠2⤣⤤⤥⤦⤧⤨⤩⤪8⤳{mw⤳̸}1⤵⤶⤷⤸⤹2⤼⤽7⥅2⥈⥉⥊⥋2⥎⥏⥐⥑⥒⥓⥔⥕⥖⥗⥘⥙⥚⥛⥜⥝⥞⥟⥠⥡⥢⥣⥤⥥⥦⥧⥨⥩⥪⥫⥬⥭⥮⥯⥰⥱⥲⥳⥴⥵⥶1⥸⥹1⥻⥼⥽⥾⥿5⦅⦆4⦋⦌⦍⦎⦏⦐⦑⦒⦓⦔⦕⦖3⦚1⦜⦝6⦤⦥⦦⦧⦨⦩⦪⦫⦬⦭⦮⦯⦰⦱⦲⦳⦴⦵⦶⦷1⦹1⦻⦼1⦾⦿⧀⧁⧂⧃⧄⧅3⧉3⧍⧎⧏{mw⧏̸}⧐{mw⧐̸}b⧜⧝⧞4⧣⧤⧥5⧫8⧴1⧶9⨀⨁⨂1⨄1⨆5⨌⨍2⨐⨑⨒⨓⨔⨕⨖⨗a⨢⨣⨤⨥⨦⨧1⨩⨪2⨭⨮⨯⨰⨱1⨳⨴⨵⨶⨷⨸⨹⨺⨻⨼2⨿⩀1⩂⩃⩄⩅⩆⩇⩈⩉⩊⩋⩌⩍2⩐2⩓⩔⩕⩖⩗⩘1⩚⩛⩜⩝1⩟6⩦3⩪2⩭{mw⩭̸}⩮⩯⩰{mw⩰̸}⩱⩲⩳⩴⩵1⩷⩸⩹⩺⩻⩼⩽{mw⩽̸}⩾{mw⩾̸}⩿⪀⪁⪂⪃⪄⪅⪆⪇⪈⪉⪊⪋⪌⪍⪎⪏⪐⪑⪒⪓⪔⪕⪖⪗⪘⪙⪚2⪝⪞⪟⪠⪡{mw⪡̸}⪢{mw⪢̸}1⪤⪥⪦⪧⪨⪩⪪⪫⪬{1e68⪬︀}⪭{1e68⪭︀}⪮⪯{mw⪯̸}⪰{mw⪰̸}2⪳⪴⪵⪶⪷⪸⪹⪺⪻⪼⪽⪾⪿⫀⫁⫂⫃⫄⫅{mw⫅̸}⫆{mw⫆̸}⫇⫈2⫋{1e68⫋︀}⫌{1e68⫌︀}2⫏⫐⫑⫒⫓⫔⫕⫖⫗⫘⫙⫚⫛8⫤1⫦⫧⫨⫩1⫫⫬⫭⫮⫯⫰⫱⫲⫳9⫽{6hx⫽⃥}y7r{17ks𝒜1𝒞𝒟2𝒢2𝒥𝒦2𝒩𝒪𝒫𝒬1𝒮𝒯𝒰𝒱𝒲𝒳𝒴𝒵𝒶𝒷𝒸𝒹1𝒻1𝒽𝒾𝒿𝓀𝓁𝓂𝓃1𝓅𝓆𝓇𝓈𝓉𝓊𝓋𝓌𝓍𝓎𝓏1g𝔄𝔅1𝔇𝔈𝔉𝔊2𝔍𝔎𝔏𝔐𝔑𝔒𝔓𝔔1𝔖𝔗𝔘𝔙𝔚𝔛𝔜1𝔞𝔟𝔠𝔡𝔢𝔣𝔤𝔥𝔦𝔧𝔨𝔩𝔪𝔫𝔬𝔭𝔮𝔯𝔰𝔱𝔲𝔳𝔴𝔵𝔶𝔷𝔸𝔹1𝔻𝔼𝔽𝔾1𝕀𝕁𝕂𝕃𝕄1𝕆3𝕊𝕋𝕌𝕍𝕎𝕏𝕐1𝕒𝕓𝕔𝕕𝕖𝕗𝕘𝕙𝕚𝕛𝕜𝕝𝕞𝕟𝕠𝕡𝕢𝕣𝕤𝕥𝕦𝕧𝕨𝕩𝕪𝕫}6vefffiflffiffl"),ea}var bb;function yb(){if(bb)return Xo;bb=1,Object.defineProperty(Xo,"__esModule",{value:!0}),Xo.encodeHTML=i,Xo.encodeNonAsciiHTML=s;const e=Cp(),t=WR(),n=new Uint32Array([5632,4227923966,4160749569,939524097]),r=new Uint32Array([0,e.XML_BITSET_VALUE,0,0]);function i(a){return o(n,a)}function s(a){return o(r,a)}function o(a,l){let d,u=0;const{length:h}=l;for(let p=0;p<h;p++){const m=l.charCodeAt(p);if(m<128&&!(a[m>>>5]>>>m&1))continue;d===void 0?d=l.substring(0,p):u!==p&&(d+=l.substring(u,p));let g=t.htmlTrie.get(m);if(typeof g=="object"){if(p+1<h){const b=l.charCodeAt(p+1),A=typeof g.next=="number"?g.next===b?g.nextValue:void 0:g.next.get(b);if(A!==void 0){d+=A,p++,u=p+1;continue}}g=g.value}if(g===void 0){const b=(0,e.getCodePoint)(l,p);d+=`&#x${b.toString(16)};`,b!==m&&p++,u=p+1}else d+=g,u=p+1}return d===void 0?l:(u<h&&(d+=l.substr(u)),d)}return Xo}var xb;function YR(){return xb||(xb=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.escapeUTF8=e.escapeText=e.escapeAttribute=e.encodeXML=e.encodeNonAsciiHTML=e.encodeHTML5=e.encodeHTML4=e.encodeHTML=e.EntityDecoder=e.decodeXMLStrict=e.decodeXML=e.decodeHTML5Strict=e.decodeHTML4Strict=e.decodeHTMLStrict=e.decodeHTMLAttribute=e.decodeHTML5=e.decodeHTML4=e.decodeHTML=e.DecodingMode=e.EncodingMode=e.EntityLevel=void 0,e.decode=o,e.decodeStrict=a,e.encode=l;const t=pb(),n=yb(),r=Cp();var i;(function(p){p[p.XML=0]="XML",p[p.HTML=1]="HTML"})(i||(e.EntityLevel=i={}));var s;(function(p){p[p.UTF8=0]="UTF8",p[p.ASCII=1]="ASCII",p[p.Extensive=2]="Extensive",p[p.Attribute=3]="Attribute",p[p.Text=4]="Text"})(s||(e.EncodingMode=s={}));function o(p,m=i.XML){if((typeof m=="number"?m:m.level)===i.HTML){const g=typeof m=="object"?m.mode:void 0;return(0,t.decodeHTML)(p,g)}return(0,t.decodeXML)(p)}function a(p,m=i.XML){var g;const b=typeof m=="number"?{level:m}:m;return(g=b.mode)!==null&&g!==void 0||(b.mode=t.DecodingMode.Strict),o(p,b)}function l(p,m=i.XML){const{mode:g=s.Extensive,level:b=i.XML}=typeof m=="number"?{level:m}:m;switch(g){case s.UTF8:return(0,r.escapeUTF8)(p);case s.Attribute:return(0,r.escapeAttribute)(p);case s.Text:return(0,r.escapeText)(p);case s.ASCII:return b===i.HTML?(0,n.encodeNonAsciiHTML)(p):(0,r.encodeXML)(p);case s.Extensive:default:return b===i.HTML?(0,n.encodeHTML)(p):(0,r.encodeXML)(p)}}var d=pb();Object.defineProperty(e,"DecodingMode",{enumerable:!0,get:function(){return d.DecodingMode}}),Object.defineProperty(e,"decodeHTML",{enumerable:!0,get:function(){return d.decodeHTML}}),Object.defineProperty(e,"decodeHTML4",{enumerable:!0,get:function(){return d.decodeHTML}}),Object.defineProperty(e,"decodeHTML5",{enumerable:!0,get:function(){return d.decodeHTML}}),Object.defineProperty(e,"decodeHTMLAttribute",{enumerable:!0,get:function(){return d.decodeHTMLAttribute}}),Object.defineProperty(e,"decodeHTMLStrict",{enumerable:!0,get:function(){return d.decodeHTMLStrict}}),Object.defineProperty(e,"decodeHTML4Strict",{enumerable:!0,get:function(){return d.decodeHTMLStrict}}),Object.defineProperty(e,"decodeHTML5Strict",{enumerable:!0,get:function(){return d.decodeHTMLStrict}}),Object.defineProperty(e,"decodeXML",{enumerable:!0,get:function(){return d.decodeXML}}),Object.defineProperty(e,"decodeXMLStrict",{enumerable:!0,get:function(){return d.decodeXML}}),Object.defineProperty(e,"EntityDecoder",{enumerable:!0,get:function(){return d.EntityDecoder}});var u=yb();Object.defineProperty(e,"encodeHTML",{enumerable:!0,get:function(){return u.encodeHTML}}),Object.defineProperty(e,"encodeHTML4",{enumerable:!0,get:function(){return u.encodeHTML}}),Object.defineProperty(e,"encodeHTML5",{enumerable:!0,get:function(){return u.encodeHTML}}),Object.defineProperty(e,"encodeNonAsciiHTML",{enumerable:!0,get:function(){return u.encodeNonAsciiHTML}});var h=Cp();Object.defineProperty(e,"encodeXML",{enumerable:!0,get:function(){return h.encodeXML}}),Object.defineProperty(e,"escape",{enumerable:!0,get:function(){return h.escape}}),Object.defineProperty(e,"escapeAttribute",{enumerable:!0,get:function(){return h.escapeAttribute}}),Object.defineProperty(e,"escapeText",{enumerable:!0,get:function(){return h.escapeText}}),Object.defineProperty(e,"escapeUTF8",{enumerable:!0,get:function(){return h.escapeUTF8}})})(tb)),tb}var Zu={},vb;function zR(){return vb||(vb=1,Zu.romanize=function(e){if(isNaN(e))return NaN;for(var t=String(+e).split(""),n=["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM","","X","XX","XXX","XL","L","LX","LXX","LXXX","XC","","I","II","III","IV","V","VI","VII","VIII","IX"],r="",i=3;i--;)r=(n[+t.pop()+i*10]||"")+r;return Array(+t.join("")+1).join("M")+r},Zu.alphanumeric=function(e){for(var t="",n;e>0;)n=(e-1)%26,t=String.fromCharCode(65+n)+t,e=(e-n)/26|0;return t||void 0}),Zu}var Xu,wb;function KR(){if(wb)return Xu;wb=1;const e=r=>{let i="";do i=(Math.random()+1).toString(36).substring(2);while(r.indexOf(i)!==-1);return i},t=(r,i)=>{let s=/([a-z\-]+)\s*\(\s*([^\(\)]*?)\s*(?:,\s*([^\(\)]*?)\s*)?\s*\)/i,o=[],a,l=e(i);for(;(a=s.exec(i))!==null;){let u=`${o.length}`;if(a[1].toLowerCase()=="var"){const p=n(r,a[2]);if(p){i=i.replace(a[0],p);continue}if(a[3]){i=i.replace(a[0],a[3]);continue}}let h=`${l}${u.padStart(5,"-")}`;i=i.replace(a[0],h),o.push({placeholder:h,replace:a[0]})}for(var d=o.length-1;d>=0;d--){const u=o[d];i=i.replace(u.placeholder,u.replace)}return i},n=(r,i)=>{for(;r;){if(r.styleProps&&i in r.styleProps)return r.styleProps[i].value;var r=r.pseudoElementParent||r.parent}};return Xu={replaceVariables:t,findVariableValue:n},Xu}var eh,kb;function QR(){if(kb)return eh;kb=1;var{decode:e}=YR(),t=Km(),n=zR(),r=KR();return eh=function(i){i.ignoredPseudos=["hover","active","focus","visited","link"],i.widthElements=["TABLE","TD","TH","IMG"],i.heightElements=["TABLE","TD","TH","IMG"],i.tableElements=["TABLE","TH","TR","TD","CAPTION","COLGROUP","COL","THEAD","TBODY","TFOOT"],i.nonVisualElements=["HEAD","TITLE","BASE","LINK","STYLE","META","SCRIPT","NOSCRIPT"],i.styleToAttribute={"background-color":"bgcolor","background-image":"background","text-align":"align","vertical-align":"valign"},i.excludedProperties=[],i.juiceDocument=p,i.inlineDocument=s;function s(A,y,w){w=w||{};var C=t.parseCSS(y),E=[],S="style",k={},I=w.removeInlinedSelectors?new Set:null;w.styleAttributeName&&(S=w.styleAttributeName);function L(J){var H=J[0],te=J[1],G=new t.Selector(H),M=G.parsed();if(M){for(var F=d(M),ce=0;ce<M.length;++ce){var ve=M[ce];if(ve.pseudos)for(var Ne=0;Ne<ve.pseudos.length;++Ne){var ye=ve.pseudos[Ne];if(i.ignoredPseudos.indexOf(ye.name)>=0)return}}if(F){var xe=M[M.length-1],ht=xe.pseudos;xe.pseudos=h(xe.pseudos),H=M.toString(),xe.pseudos=ht}var wt;try{wt=A(H)}catch{return}var jt=!1;wt.each(function(){var de=this;if(de.name&&i.nonVisualElements.indexOf(de.name.toUpperCase())>=0)return;if(jt=!0,de.counterProps||(de.counterProps=de.parent&&de.parent.counterProps?Object.create(de.parent.counterProps):{}),F){var pt="pseudo"+F,mt=de[pt];mt||(mt=de[pt]=A("<span />").get(0),mt.pseudoElementType=F,mt.pseudoElementParent=de,mt.counterProps=de.counterProps,de[pt]=mt),de=mt}if(!de.styleProps){if(de.styleProps={},A(de).attr(S)){var Ee=A(de).attr(S),Ot=w.decodeStyleAttributes?e(Ee):Ee,Jt="* { "+Ot+" } ";et(t.parseCSS(Jt)[0][1],new t.Selector("<style>",!0))}E.push(de)}function Tt(ee,z){for(var fe=z.split(/\s+/),Z=0;Z<fe.length;Z++){var Oe=fe[Z],je=parseInt(fe[Z+1],10);isNaN(je)?ee.counterProps[Oe]=k[Oe]=0:ee.counterProps[Oe]=k[fe[Z++]]=je}}function xn(ee,z){for(var fe=z.split(/\s+/),Z=0;Z<fe.length;Z++){var Oe=fe[Z];if(ee.counterProps[Oe]!==void 0){var je=parseInt(fe[Z+1],10);isNaN(je)?ee.counterProps[Oe]=k[Oe]+=1:ee.counterProps[Oe]=k[fe[Z++]]+=je}}}function et(ee,z){for(var fe=0,Z=ee.length;fe<Z;fe++)if(ee[fe].type=="property"){var Oe=ee[fe].name,je=ee[fe].value;Oe==="counter-reset"&&Tt(de,je),Oe==="counter-increment"&&xn(de,je);var rt=je.match(/!important$/)!==null;rt&&!w.preserveImportant&&(je=o(je));var it=[ee[fe].position.start.line,ee[fe].position.start.col],He=new t.Property(Oe,je,z,rt?2:0,it),Pe=de.styleProps[Oe];if(i.excludedProperties.indexOf(Oe)<0)if(w.inlineDuplicateProperties)if(Pe)if(Pe.selector===z)He.nextProp=Pe,de.styleProps[Oe]=He;else{for(var Nn=Pe;Nn.nextProp;)Nn=Nn.nextProp;Nn.nextProp=He}else de.styleProps[Oe]=He;else(Pe&&Pe.compare(He)===He||!Pe)&&(Pe&&Pe.selector!==z?delete de.styleProps[Oe]:Pe&&(He.nextProp=Pe),de.styleProps[Oe]=He)}}et(te,G)}),jt&&I&&I.add(J[0])}}function R(J){Object.keys(J.styleProps).length;var H=[];Object.keys(J.styleProps).forEach(function(G){for(var M=J.styleProps[G];typeof M<"u";)H.push(M),M=M.nextProp}),H.sort(function(G,M){return G.compareFunc(M)});var te=H.filter(function(G){return w.resolveCSSVariables&&G.prop.indexOf("--")===0?!1:G.prop!=="content"}).map(function(G){return w.resolveCSSVariables&&(G.value=r.replaceVariables(J,G.value)),G.prop+": "+G.value.replace(/["]/g,"'")+";"}).join(" ");te&&A(J).attr(S,te)}function B(J){if(J.pseudoElementType&&J.styleProps.content){var H=l(J);H.img?(J.name="img",A(J).attr("src",H.img)):A(J).text(H);var te=J.pseudoElementParent;J.pseudoElementType==="before"?A(te).prepend(J):A(te).append(J)}}function O(J,H){if(J.name){var te=J.name.toUpperCase();if(i[H+"Elements"].indexOf(te)>-1){for(var G in J.styleProps)if(J.styleProps[G].prop===H){var M=J.styleProps[G].value;if(w.preserveImportant&&(M=o(M)),M.match(/(px|auto)/)){var F=M.replace("px","");A(J).attr(H,F);return}if(i.tableElements.indexOf(te)>-1&&M.match(/\%/)){A(J).attr(H,M);return}}}}}function Y(J){return J.indexOf("url(")!==0?J:J.replace(/^url\((["'])?([^"']+)\1\)$/,"$2")}function Q(J){if(J.name){var H=J.name.toUpperCase(),te=Object.keys(i.styleToAttribute);if(i.tableElements.indexOf(H)>-1){for(var G in J.styleProps)if(te.indexOf(J.styleProps[G].prop)>-1){var M=i.styleToAttribute[J.styleProps[G].prop],F=J.styleProps[G].value;if(w.preserveImportant&&(F=o(F)),M==="background"&&(F=Y(F)),/(linear|radial)-gradient\(/i.test(F))continue;A(J).attr(M,F)}}}}if(C.forEach(L),E.forEach(R),w.inlinePseudoElements&&E.forEach(B),w.applyWidthAttributes&&E.forEach(function(J){O(J,"width")}),w.applyHeightAttributes&&E.forEach(function(J){O(J,"height")}),w.applyAttributesTableElements&&E.forEach(Q),w.insertPreservedExtraCss&&w.extraCss){var W=t.getPreservedText(w.extraCss,{mediaQueries:w.preserveMediaQueries,fontFaces:w.preserveFontFaces,keyFrames:w.preserveKeyFrames,preservedSelectors:w.preservedSelectors});if(W){var ie=null;w.insertPreservedExtraCss!==!0?ie=A(w.insertPreservedExtraCss):(ie=A("head"),ie.length||(ie=A("body")),ie.length||(ie=A.root())),ie.first().append("<style>"+W+"</style>")}}return I}function o(A){return A.replace(/\s*!important$/,"")}function a(A,y){switch(y){case"lower-roman":return n.romanize(A).toLowerCase();case"upper-roman":return n.romanize(A);case"lower-latin":case"lower-alpha":return n.alphanumeric(A).toLowerCase();case"upper-latin":case"upper-alpha":return n.alphanumeric(A);default:return A.toString()}}function l(A){var y=A.styleProps.content.value;if(y==="none"||y==="normal")return"";var w=y.match(/^\s*url\s*\(\s*(.*?)\s*\)\s*$/i);if(w){var C=w[1].replace(/^['"]|['"]$/g,"");return{img:C}}for(var E=[],S=y.split(/['"]/),k=0;k<S.length;k++)if(S[k]!==""){var I=S[k].match(/var\s*\(\s*(.*?)\s*(,\s*(.*?)\s*)?\s*\)/i);if(I){var L=r.findVariableValue(A,I[1])||I[2];E.push(L.replace(/^['"]|['"]$/g,""));continue}var R=S[k].match(/counter\s*\(\s*(.*?)\s*(,\s*(.*?)\s*)?\s*\)/i);if(R&&R[1]in A.counterProps){var B=A.counterProps[R[1]];E.push(a(B,R[3]));continue}var O=S[k].match(/attr\s*\(\s*(.*?)\s*\)/i);if(O){var Y=O[1];E.push(A.pseudoElementParent?A.pseudoElementParent.attribs[Y]:A.attribs[Y]);continue}E.push(S[k])}return y=E.join(""),y=y.replace(/\\/g,""),y}function d(A){if(A.length!==0){var y=A[A.length-1].pseudos;if(y){for(var w=0;w<y.length;w++)if(u(y[w]))return y[w].name}}}function u(A){return A.name==="before"||A.name==="after"}function h(A){return A.filter(function(y){return!u(y)})}function p(A,y){y=t.getDefaultOptions(y);var w=new Set;y.removeInlinedSelectors&&!y.removeStyleTags&&A("style[data-embed]").each(function(){w.add(this)});var C=b(A,y);C+=`
|
|
34
|
+
`+y.extraCss;var E=s(A,C,y);return E&&!y.removeStyleTags&&m(A,E,y,w),A}function m(A,y,w,C){var E=A("style");E.each(function(){var S=this,k=S.childNodes;if(k.length===1&&!(C&&C.has(S))){var I=k[0].nodeValue,L=t.removeInlinedSelectorsFromCSS(I,y,w,i.ignoredPseudos);L&&L.trim()?S.childNodes[0].nodeValue=L:A(S).remove()}})}function g(A,y){var w=[],C=A("style"),E,S,k;return C.each(function(){if(k=this,E=k.childNodes,E.length!==1){y.removeStyleTags&&A(k).remove();return}if(S=E[0].data,y.applyStyleTags&&A(k).attr("data-embed")===void 0&&w.push(S),y.removeStyleTags&&A(k).attr("data-embed")===void 0){var I=k.childNodes[0].nodeValue,L=t.getPreservedText(I,{mediaQueries:y.preserveMediaQueries,fontFaces:y.preserveFontFaces,keyFrames:y.preserveKeyFrames,pseudos:y.preservePseudos,preservedSelectors:y.preservedSelectors},i.ignoredPseudos);L?k.childNodes[0].nodeValue=L:A(k).remove()}A(k).removeAttr("data-embed")}),w}function b(A,y){var w=g(A,y),C=w.join(`
|
|
35
|
+
`);return C}return i},eh}var th,Eb;function VR(){if(Eb)return th;Eb=1;var e=HR(),t=QR(),n=t(function(i,s){return e(i,{xmlMode:s&&s.xmlMode},r,[s])}),r=function(i,s){return n.juiceDocument(i,s)};return n.inlineContent=function(i,s,o){return e(i,{xmlMode:o&&o.xmlMode},n.inlineDocument,[s,o])},n.codeBlocks=e.codeBlocks,th=n,th}var qR=VR();const y1=Xx(qR),x1=/\{\{([^}]*)\}\}/g,Cs=e=>`{{${e}}}`,JR=(e={})=>Object.fromEntries(Object.entries(e).map(([t,n])=>[t,n==null?"":String(n)])),Ur=(e,t={})=>e.replace(x1,(n,r)=>{const i=t[r.trim()];return i==null?`{{${r.trim()}}}`:String(i)}),ZR=(e,t={},n=["[[","]]"])=>{if(Object.keys(t).length===0)return e;const r=a=>a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),[i,s]=n,o=new RegExp(`${r(i)}\\s*([\\w.\\-]+)\\s*${r(s)}`,"g");return e.replace(o,(a,l)=>{const d=t[l.trim()];return d==null?a:String(d)})},XR=e=>{const t=Array.from(e.matchAll(x1));return Array.from(new Set(t.map(n=>{var r;return(r=n[1])==null?void 0:r.trim()}).filter(Boolean)))},eL=e=>{const t=Object.values(e.values).flatMap(n=>typeof n=="string"?[n]:Array.isArray(n)?n.flatMap(r=>typeof r=="string"?[r]:r&&typeof r=="object"?Object.values(r).filter(i=>typeof i=="string"):[]):[]);return[e.visible_if??"",...t]},tL=e=>{const t=new Set;for(const n of e.body.rows)for(const r of n.columns)for(const i of r.blocks)for(const s of eL(i))for(const o of XR(s))t.add(o);return Array.from(t).sort((n,r)=>n.localeCompare(r))},nL=(e,t={})=>{const n=JR(t);return e?{...n,...e.values}:n},rL=["===","!==","==","!=","<=",">=","&&","||","<",">","+","-","!"],iL=e=>{const t=[];let n=0;for(;n<e.length;){const r=e[n];if(r===" "||r===" "||r===`
|
|
36
|
+
`||r==="\r"){n+=1;continue}if(r==="{"&&e[n+1]==="{"){const s=e.indexOf("}}",n+2);if(s===-1)throw new Error("unterminated merge tag");t.push({kind:"tag",key:e.slice(n+2,s).trim()}),n=s+2;continue}if(r==='"'||r==="'"){let s=n+1,o="";for(;s<e.length&&e[s]!==r;){if(e[s]==="\\"&&s+1<e.length){o+=e[s+1],s+=2;continue}o+=e[s],s+=1}if(s>=e.length)throw new Error("unterminated string");t.push({kind:"value",value:o}),n=s+1;continue}if(r>="0"&&r<="9"||r==="."&&e[n+1]>="0"&&e[n+1]<="9"){let s=n;for(;s<e.length&&(e[s]>="0"&&e[s]<="9"||e[s]===".");)s+=1;const o=Number(e.slice(n,s));if(!Number.isFinite(o))throw new Error("invalid number");t.push({kind:"value",value:o}),n=s;continue}if(/[A-Za-z_]/.test(r)){let s=n;for(;s<e.length&&/[A-Za-z0-9_]/.test(e[s]);)s+=1;const o=e.slice(n,s);o==="true"?t.push({kind:"value",value:!0}):o==="false"?t.push({kind:"value",value:!1}):o==="null"?t.push({kind:"value",value:null}):t.push({kind:"tag",key:o}),n=s;continue}if(r==="("||r===")"){t.push({kind:"paren",paren:r}),n+=1;continue}const i=rL.find(s=>e.startsWith(s,n));if(i){t.push({kind:"op",op:i}),n+=i.length;continue}throw new Error(`unexpected character: ${r}`)}return t},Gc=(e,t)=>{if(e===null||t===null||typeof e==typeof t)return e===t;if(typeof e=="boolean")return Gc(Number(e),t);if(typeof t=="boolean")return Gc(e,Number(t));if(typeof e=="number"&&typeof t=="string"){const n=Number(t);return!Number.isNaN(n)&&e===n}if(typeof e=="string"&&typeof t=="number"){const n=Number(e);return!Number.isNaN(n)&&n===t}return String(e)===String(t)},sL=(e,t)=>{let n=0;const r=m=>t[m]??"",i=(...m)=>{const g=e[n];return g&&g.kind==="op"&&m.includes(g.op)?(n+=1,g.op):null},s=()=>{const m=e[n];if(!m)throw new Error("unexpected end of expression");if(m.kind==="paren"&&m.paren==="("){n+=1;const g=h(),b=e[n];if(!b||b.kind!=="paren"||b.paren!==")")throw new Error("expected )");return n+=1,g}if(m.kind==="value")return n+=1,m.value;if(m.kind==="tag")return n+=1,r(m.key);throw new Error("unexpected token")},o=()=>{const m=i("!","-");return m==="!"?!o():m==="-"?-Number(o()):s()},a=()=>{let m=o();for(;;){const g=i("+","-");if(!g)return m;const b=o();m=g==="+"?typeof m=="number"&&typeof b=="number"?m+b:`${m??""}${b??""}`:Number(m)-Number(b)}},l=()=>{let m=a();for(;;){const g=i("<",">","<=",">=");if(!g)return m;const b=a();if(typeof m=="string"&&typeof b=="string")m=g==="<"?m<b:g===">"?m>b:g==="<="?m<=b:m>=b;else{const A=Number(m),y=Number(b);m=g==="<"?A<y:g===">"?A>y:g==="<="?A<=y:A>=y}}},d=()=>{let m=l();for(;;){const g=i("===","!==","==","!=");if(!g)return m;const b=l();m=g==="==="?m===b:g==="!=="?m!==b:g==="=="?Gc(m,b):!Gc(m,b)}},u=()=>{let m=d();for(;i("&&");){const g=d();m=m&&g}return m};function h(){let m=u();for(;i("||");){const g=u();m=m||g}return m}const p=h();if(n!==e.length)throw new Error("unexpected trailing tokens");return!!p},v1=(e,t={})=>{if(!(e!=null&&e.trim()))return!0;try{const n=iL(e);return n.length===0?!0:sL(n,t)}catch{return!0}},Cb="token.",hc=(e,t)=>{if(typeof e=="string"&&e.startsWith(Cb)){const n=e.slice(Cb.length);return t[n]??e}return e},oL=(e,t)=>Object.fromEntries(Object.entries(e).map(([n,r])=>[n,hc(r,t)])),w1=e=>{const t=e.design_tokens??{};return{...e,body:{...e.body,rows:e.body.rows.map(n=>({...n,settings:{...n.settings,background_color:hc(n.settings.background_color,t),content_background_color:hc(n.settings.content_background_color,t)},columns:n.columns.map(r=>({...r,settings:{...r.settings,background_color:hc(r.settings.background_color,t)},blocks:r.blocks.map(i=>({...i,values:oL(i.values,t)}))}))}))}}},Tb=e=>{const t=Math.floor(Number(e??1));return Number.isFinite(t)&&t>1?t:1},aL=e=>{if(typeof e=="string")return{text:e,colspan:1,rowspan:1};if(e&&typeof e=="object"){const t=e;return{text:String(t.text??""),colspan:Tb(t.colspan),rowspan:Tb(t.rowspan)}}return{text:"",colspan:1,rowspan:1}},tu=e=>{const t=(Array.isArray(e)?e:[]).map(r=>Array.isArray(r)?r.map(aL):[]),n=t.reduce((r,i)=>Math.max(r,i.length),0);for(const r of t)for(;r.length<n;)r.push({text:"",colspan:1,rowspan:1});return t},k1=e=>{var t;const n=e.map(r=>r.map(()=>!1));for(let r=0;r<e.length;r++)for(let i=0;i<e[r].length;i++){if(n[r][i])continue;const{colspan:s,rowspan:o}=e[r][i];if(!(s<=1&&o<=1))for(let a=0;a<o;a++)for(let l=0;l<s;l++){if(a===0&&l===0)continue;const d=r+a,u=i+l;d<e.length&&u<(((t=e[d])==null?void 0:t.length)??0)&&(n[d][u]=!0)}}return n},lL=e=>{var t;const n=e.map(r=>r.map(()=>null));for(let r=0;r<e.length;r++)for(let i=0;i<e[r].length;i++){const{colspan:s,rowspan:o}=e[r][i];for(let a=0;a<o;a++)for(let l=0;l<s;l++){const d=r+a,u=i+l;d<e.length&&u<(((t=e[d])==null?void 0:t.length)??0)&&!n[d][u]&&(n[d][u]={r,c:i})}}return n},nu=(e,t,n,r,i)=>{var s;let o=Math.min(t,r),a=Math.min(n,i),l=Math.max(t,r),d=Math.max(n,i);const u=lL(e);let h=!0;for(;h;){h=!1;for(let p=o;p<=l;p++)for(let m=a;m<=d;m++){const g=(s=u[p])==null?void 0:s[m];if(!g)continue;const b=e[g.r][g.c],A=g.r+b.rowspan-1,y=g.c+b.colspan-1;g.r<o&&(o=g.r,h=!0),g.c<a&&(a=g.c,h=!0),A>l&&(l=A,h=!0),y>d&&(d=y,h=!0)}}return{r1:o,c1:a,r2:l,c2:d}},E1=e=>e.map(t=>t.map(n=>({...n}))),C1=(e,t,n,r,i)=>{var s;const{r1:o,c1:a,r2:l,c2:d}=nu(e,t,n,r,i),u=E1(e);for(let h=o;h<=l;h++)for(let p=a;p<=d;p++)(s=u[h])!=null&&s[p]&&(u[h][p].colspan=1,u[h][p].rowspan=1,h===o&&p===a||(u[h][p].text=""));return u[o][a].colspan=d-a+1,u[o][a].rowspan=l-o+1,u},T1=(e,t,n)=>{var r;const i=E1(e);return(r=i[t])!=null&&r[n]&&(i[t][n].colspan=1,i[t][n].rowspan=1),i},Tp=e=>{const t=e.length;return e.map((n,r)=>n.map((i,s)=>({text:i.text,colspan:Math.min(Math.max(1,i.colspan),n.length-s),rowspan:Math.min(Math.max(1,i.rowspan),t-r)})))},Wc=e=>e.map(t=>t.map(n=>n.colspan===1&&n.rowspan===1?n.text:{...n})),nh=600,rh=400,$e=e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),Te=(e,t="")=>String(e??t).replace(/[<>"'`;{}\\]/g,""),cL=e=>e.replace(/<span[^>]*data-merge-tag[^>]*>(.*?)<\/span>/g,"$1"),dL=e=>{const t=/^\s*<p(?:\s[^>]*)?>([\s\S]*)<\/p>\s*$/i.exec(e);return t&&!/<p[\s>]/i.test(t[1])?t[1]:e},ih=e=>e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">"),uL=e=>`<span data-merge-tag="${ih(e)}" data-merge-label="${ih(e)}" class="edm-merge-tag-chip">{{${ih(e)}}}</span>`,Sb=e=>e.replace(/\{\{\s*([^}]+?)\s*\}\}/g,(t,n)=>uL(n.trim())),hL=e=>/class\s*=/i.test(e)?/edm-merge-tag-chip/.test(e)?e:e.replace(/class\s*=\s*(["'])(.*?)\1/i,(t,n,r)=>`class=${n}${r} edm-merge-tag-chip${n}`):e.replace(/^<span/i,'<span class="edm-merge-tag-chip"'),pL=e=>{const t=/<span[^>]*data-merge-tag[^>]*>[\s\S]*?<\/span>/gi;let n="",r=0,i;for(;(i=t.exec(e))!==null;)n+=Sb(e.slice(r,i.index)),n+=hL(i[0]),r=i.index+i[0].length;return n+=Sb(e.slice(r)),n},sh=(e,t,n)=>n==="chip"?pL(e):Ur(cL(e),t),ln=(e,t="#")=>{const n=e.trim();return n&&(/^(https?:|mailto:|tel:|cid:|#)/i.test(n)||/^data:image\//i.test(n)||/^\{\{[^}]+\}\}([/?#].*)?$/.test(n))?n:t},_b={unsubscribe:"{{unsubscribe_url}}","view-in-browser":"{{web_version_url}}"},Qm=(e,t)=>_b[e]?_b[e]:t.trim(),mL=(e,t)=>{const n=t.trim();if(!n)return"#";if(e==="send-email")return ln(n.startsWith("mailto:")?n:`mailto:${n}`);if(e==="call-phone"){const r=n.replace(/\s+/g,"");return ln(r.startsWith("tel:")?r:`tel:${r}`)}return ln(n)},S1=["script","style","iframe","object","embed","link","base","meta","form","svg","math","noscript","template","source","frame","frameset"],fL=new Set(["href","src","xlink:href","action","formaction","poster","background","cite","data","ping"]),gL=e=>{const t=e.replace(/[- ]+/g,"").toLowerCase();return/^(javascript|vbscript|livescript|mocha):/i.test(t)?!1:/^data:/i.test(t)?/^data:image\/(png|jpe?g|gif|webp|bmp|x-icon|avif);/i.test(t):!0},AL=()=>{const e=globalThis.document;return e&&typeof e.createElement=="function"?e:null},bL=1,yL=(e,t)=>{const n=e.createElement("template");n.innerHTML=t;const r=[],i=e.createTreeWalker(n.content,bL);for(let s=i.nextNode();s;s=i.nextNode()){const o=s;if(S1.includes(o.tagName.toLowerCase())){r.push(o);continue}for(const a of Array.from(o.attributes)){const l=a.name.toLowerCase();(l.startsWith("on")||l==="srcdoc"||l==="srcset"||fL.has(l)&&!gL(a.value)||l==="style"&&/expression\s*\(|(javascript|vbscript|data)\s*:|@import/i.test(a.value))&&o.removeAttribute(a.name)}}for(const s of r)s.remove();return n.innerHTML},xL=e=>{let t=e;for(const n of S1)t=t.replace(new RegExp(`<${n}\\b[\\s\\S]*?</${n}>`,"gi"),"").replace(new RegExp(`<${n}\\b[^>]*>`,"gi"),"").replace(new RegExp(`</${n}>`,"gi"),"");return t.replace(/[\s/]on[a-z-]+\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/gi," ").replace(/(\s(?:href|src|xlink:href|action|formaction|poster|background|cite|data|ping))\s*=\s*(?:"(?:[\s]|&#?\w+;)*(?:javascript|vbscript|data\s*:\s*(?:text\/html|image\/svg))[\s\S]*?"|'(?:[\s]|&#?\w+;)*(?:javascript|vbscript|data\s*:\s*(?:text\/html|image\/svg))[\s\S]*?'|(?:javascript|vbscript|data\s*:\s*(?:text\/html|image\/svg))[^\s>]*)/gi,'$1="#"')},or=e=>{const t=AL();return t?yL(t,e):xL(e)},_1=e=>(e??"").replace(/<\/?\s*style[^>]*>/gi,"").replace(/<\/?\s*script[^>]*>/gi,"").replace(/<!\[CDATA\[|\]\]>/g,"").trim(),Vm=e=>e.replace(/>\s+</g,"><").replace(/\s{2,}/g," ").trim(),vL=e=>{var t;return((t=e.match(/<body[^>]*>([\s\S]*?)<\/body>/i))==null?void 0:t[1])??e},wL=e=>(e.match(/<style[\s\S]*?<\/style>/gi)??[]).join(""),kL=e=>e.replace(/ /gi," ").replace(/&/gi,"&").replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/'/gi,"'"),N1=e=>!!(e.dark_mode_styles&&Object.keys(e.dark_mode_styles).length>0),I1=e=>!!(e.mobile_styles&&Object.keys(e.mobile_styles).length>0),Nb=e=>["edm-block-wrap",N1(e)?`mc-dm-${e.id}`:"",I1(e)?`mc-mb-${e.id}`:"",e.hide_desktop?"edm-desktop-hidden":"",e.hide_mobile?"edm-mobile-hidden":""].filter(Boolean).join(" "),D1=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),EL=e=>{const t=[];for(const n of e.body.rows)for(const r of n.columns)for(const i of r.blocks){if(!N1(i))continue;const s=Object.entries(i.dark_mode_styles??{}).map(([o,a])=>`${D1(o)}:${a} !important;`).join("");t.push(`.mc-dm-${i.id},.mc-dm-${i.id} *{${s}}`)}return t.length>0?`@media (prefers-color-scheme: dark){${t.join("")}}`:""},CL=e=>{const t=[];for(const n of e.body.rows)for(const r of n.columns)for(const i of r.blocks){if(!I1(i))continue;const s=Object.entries(i.mobile_styles??{}).map(([o,a])=>`${D1(o)}:${a} !important;`).join("");t.push(`.mc-mb-${i.id},.mc-mb-${i.id} *{${s}}`)}return t.length>0?`@media only screen and (max-width: 620px){${t.join("")}}`:""},TL=e=>["edm-row-wrap",e.settings.hide_desktop?"edm-desktop-hidden":"",e.settings.hide_mobile?"edm-mobile-hidden":""].filter(Boolean).join(" "),SL=(e,t="transparent",n="0",r="",i="")=>`<table role="presentation" class="${i}" width="100%" cellpadding="0" cellspacing="0" style="border-collapse:collapse;background:${t};${r}"><tr><td style="padding:${n};">${e}</td></tr></table>`,oh=(e,t)=>{const n=String(t.align??"center"),r=$e(n==="justify"?"center":n),i=Number(t.padding??0),s=Math.min(100,Math.max(5,Number(t.width??100))),o=!!t.auto_width,a=n==="justify"?"100%":o?"auto":`${s}%`;return`<div style="padding:${i}px;text-align:${r};">${e.replace("__MEDIA_WIDTH__",a)}</div>`},Ib=e=>`filter:brightness(${Math.max(0,Number(e.brightness??100))}%) contrast(${Math.max(0,Number(e.contrast??100))}%) saturate(${Math.max(0,Number(e.saturation??100))}%) grayscale(${Math.max(0,Number(e.grayscale??0))}%) blur(${Math.max(0,Number(e.blur??0))}px);`,Db=e=>`${Math.max(0,Math.min(100,Number(e.focal_x??50)))}% ${Math.max(0,Math.min(100,Number(e.focal_y??50)))}%`,Mb={square:"1 / 1",portrait:"4 / 5",landscape:"4 / 3",wide:"16 / 9"},Ob=(e,t)=>{const n=String(e.crop_aspect??"free");return n==="free"||!Mb[n]?t:`<div style="display:inline-block;width:__MEDIA_WIDTH__;max-width:100%;overflow:hidden;border-radius:${Math.max(0,Number(e.border_radius??18))}px;aspect-ratio:${Mb[n]};">${t}</div>`},cs=(e,t="center")=>{const n=String(e??t);return n==="left"||n==="center"||n==="right"?n:t},Zr=(e,t=10)=>{if(typeof e=="number"&&Number.isFinite(e))return`${Math.max(0,e)}px`;if(typeof e=="string"){const n=e.trim();if(/^\d+(\.\d+)?$/.test(n))return`${n}px`;if(/^\d+(\.\d+)?(px|em|rem|%)$/.test(n))return n;const r=parseFloat(n);if(Number.isFinite(r))return`${Math.max(0,r)}px`}return`${t}px`},_L={facebook:{short:"f",color:"#1877f2"},twitter:{short:"x",color:"#111827"},linkedin:{short:"in",color:"#0a66c2"},instagram:{short:"ig",color:"#e1306c"},pinterest:{short:"p",color:"#e60023"},youtube:{short:"yt",color:"#ff0000"},whatsapp:{short:"wa",color:"#25d366"},telegram:{short:"tg",color:"#229ed9"},tiktok:{short:"tt",color:"#111827"},spotify:{short:"sp",color:"#1db954"},reddit:{short:"rd",color:"#ff4500"},discord:{short:"dc",color:"#5865f2"},github:{short:"gh",color:"#24292f"},dribbble:{short:"db",color:"#ea4c89"},mail:{short:"@",color:"#111827"}},NL=(e,t,n)=>{switch(e){case"circle-black":return{background:"#111827",color:"#ffffff",radius:"999px"};case"circle-white":return{background:"#ffffff",color:t,radius:"999px",border:`1px solid ${t}`};case"round":return{background:t,color:n,radius:"12px"};case"round-black":return{background:"#111827",color:"#ffffff",radius:"12px"};case"square":return{background:t,color:n,radius:"4px"};case"square-black":return{background:"#111827",color:"#ffffff",radius:"4px"};case"circle":default:return{background:t,color:n,radius:"999px"}}},IL=e=>{if(!/<style[\s>]/i.test(e))return e;try{const t=y1(e,{removeStyleTags:!0,preserveMediaQueries:!0}),n=t.match(/<body[^>]*>([\s\S]*?)<\/body>/i);return(n?n[1]:t).replace(/<\/?(?:html|head|body)[^>]*>/gi,"").trim()}catch{return e}},Yc=(e,t={})=>{var n;const r=t.mergeTags??{},i=l=>Ur(String(l),r),s=e.values,o=t.sanitize!==!1,a=(l,d="")=>{const u=sh(String(l??d),r,t.mergeTagDisplay);return o?or(u):u};switch(e.type){case"heading":{const l=["h1","h2","h3","h4"].includes(String(s.tag??"h1"))?String(s.tag??"h1"):"h1",d=String(s.font_family??"body"),u=d==="body"?"inherit":Te(d),h=s.inherit_link_styles?"":`.${l}-links a{color:${Te(s.color,"#1a2b4a")} !important;text-decoration:none !important;}`,p=sh(dL(String(s.text??"Heading")),r,t.mergeTagDisplay);return`<div class="${s.inherit_link_styles?"":`${l}-links`}" style="padding:${Zr(s.container_padding)} 0;"><${l} style="margin:0;color:${Te(s.color,"#1a2b4a")};font-family:${u};font-weight:${Math.max(400,Math.min(700,Number(s.font_weight??400)))};font-size:${Math.max(12,Number(s.font_size??22))}px;line-height:${Math.max(80,Number(s.line_height??140))}%;letter-spacing:${Math.max(0,Number(s.letter_spacing??0))}px;text-align:${cs(s.align,"left")};">${o?or(p):p}</${l}>${h?`<style>${h}</style>`:""}</div>`}case"text":{const l=sh(String(s.html??""),r,t.mergeTagDisplay),d=String(s.color??"").trim(),u=!d||d==="#14213d"?"inherit":Te(d),h=String(s.font_family??"body"),p=h==="body"?"inherit":Te(h),m=s.inherit_link_styles?"":`<style>.edm-text-block a{color:${u} !important;text-decoration:none !important;}</style>`;return`<div style="padding:${Zr(s.container_padding)} 0;"><div class="edm-text-block" style="color:${u};font-family:${p};font-weight:${Math.max(400,Math.min(700,Number(s.font_weight??400)))};font-size:${Math.max(10,Number(s.font_size??16))}px;line-height:${Math.max(80,Number(s.line_height??140))}%;letter-spacing:${Math.max(0,Number(s.letter_spacing??0))}px;text-align:${cs(s.align,"left")};">${o?or(l):l}</div>${m}</div>`}case"image":case"gif":{if(t.amp){const y=$e(ln(i(s.src??""),"")),w=$e(i(s.alt??"")),C=`<amp-img src="${y}" alt="${w}" width="${nh}" height="${rh}" layout="responsive"></amp-img>`,E=s.href?`<a href="${$e(ln(i(s.href)))}" target="${$e(String(s.target??"_blank"))}">${C}</a>`:C;return oh(E,s)}const l=Te(s.border_style,"none"),d=Math.max(0,Number(s.border_width??0)),u=Te(s.border_color,"#14213d"),h=l==="none"||d===0?"border:0;":`border:${d}px ${l} ${u};`,p=Math.max(0,Number(s.border_radius??18)),m=`<img src="${$e(ln(i(s.src??""),""))}" alt="${$e(i(s.alt??""))}" style="display:inline-block;width:100%;max-width:100%;height:auto;${h}border-radius:${p}px;object-fit:cover;object-position:${Db(s)};${Ib(s)}" />`,g=Ob(s,m.replace("width:100%;max-width:100%;","width:100%;max-width:100%;")).replace(/<img /,"<img ").replace("width:100%;max-width:100%;",String(s.crop_aspect??"free")==="free"?"width:__MEDIA_WIDTH__;max-width:100%;":"width:100%;max-width:100%;height:100%;"),b=s.href?`<a href="${$e(ln(i(s.href??"#")))}" target="${$e(String(s.target??"_blank"))}" style="display:inline-block;text-decoration:none;">${g}</a>`:g,A=String(s.text_wrap??"none");if(A==="left"||A==="right"){const y=Math.min(100,Math.max(5,Number(s.width??40)));return`<span style="display:inline-block;float:${A};width:${y}%;max-width:100%;margin:${A==="left"?"0 18px 12px 0":"0 0 12px 18px"};">${b.replace("__MEDIA_WIDTH__","100%")}</span>`}return oh(b,s)}case"carousel":{const l=Array.isArray(s.slides)?s.slides:[],d=cs(s.align,"center"),u=Math.max(0,Number(s.border_radius??12)),h=Math.max(0,Number(s.gap??12)),p=Math.min(100,Math.max(10,Number(s.width??100))),m=Zr(s.container_padding),g=!!s.show_caption,b=d==="left"?"0 auto 0 0":d==="right"?"0 0 0 auto":"0 auto";if(!l.length)return`<div style="padding:${m} 0;text-align:${d};color:#94a3b8;font-size:13px;">Add slides to the carousel.</div>`;if(t.amp){const y=l.map(w=>{const C=$e(ln(i(w.src??""),"")),E=$e(i(w.alt??"")),S=`<amp-img src="${C}" alt="${E}" width="${nh}" height="${rh}" layout="responsive"></amp-img>`;return w.href?`<a href="${$e(ln(i(w.href)))}" target="${$e(String(w.target??s.target??"_blank"))}">${S}</a>`:S}).join("");return`<div class="edm-carousel" style="padding:${m} 0;"><amp-carousel width="${nh}" height="${rh}" layout="responsive" type="slides">${y}</amp-carousel></div>`}const A=l.map((y,w)=>{const C=$e(ln(i(y.src??""),"")),E=$e(i(y.alt??"")),S=`<img src="${C}" alt="${E}" width="600" style="display:block;width:100%;max-width:100%;height:auto;border:0;border-radius:${u}px;" />`,k=y.href?`<a href="${$e(ln(i(y.href)))}" target="${$e(String(y.target??s.target??"_blank"))}" style="text-decoration:none;">${S}</a>`:S,I=g&&y.caption?`<div style="font-size:13px;color:#64748b;margin-top:6px;text-align:${d};">${a(y.caption)}</div>`:"";return`<div class="edm-carousel-slide" style="${w<l.length-1?`margin-bottom:${h}px;`:""}">${k}${I}</div>`}).join("");return`<div class="edm-carousel" style="padding:${m} 0;"><div style="max-width:${p}%;margin:${b};">${A}</div></div>`}case"button":{const l=String(s.align??"left"),d=l==="justify",u=$e(d?"center":l),h=!!s.auto_width,p=Math.max(20,Math.min(100,Number(s.width??40))),m=d?"100%":h?"auto":`${p}%`,g=d||!h?"block":"inline-block",b=d||!h?"100%":"auto",A=Math.max(0,Number(s.padding_top??14)),y=Math.max(0,Number(s.padding_right??22)),w=Math.max(0,Number(s.padding_bottom??14)),C=Math.max(0,Number(s.padding_left??22)),E=Math.max(400,Math.min(700,Number(s.font_weight??600))),S=Math.max(80,Math.min(200,Number(s.line_height??120))),k=Math.max(0,Number(s.letter_spacing??0)),I=String(s.font_family??"body"),L=I==="body"?"inherit":Te(I),R=Te(s.border_style,"none"),B=Math.max(0,Number(s.border_width??0)),O=Te(s.border_color??s.background_color,"#ef476f"),Y=R==="none"||B===0?"border:none;":`border:${B}px ${R} ${O};`,Q=Zr(s.container_padding),W=String(s.action_type??"open-website"),ie=mL(W,i(Qm(W,String(s.href??""))));return`<div style="padding:${Q} 0;"><table role="presentation" class="edm-button-table" cellpadding="0" cellspacing="0" style="border-collapse:separate;width:${m};"><tr><td align="${u}"><a class="edm-button-link" href="${$e(ie)}" target="${$e(String(s.target??"_blank"))}" style="display:${g};width:${b};box-sizing:border-box;background:${Te(s.background_color,"#ef476f")};color:${Te(s.color,"#ffffff")};padding:${A}px ${y}px ${w}px ${C}px;border-radius:${Number(s.border_radius??999)}px;text-decoration:none;font-weight:${E};font-size:${Number(s.font_size??16)}px;line-height:${S}%;letter-spacing:${k}px;font-family:${L};text-align:center;${Y}">${a(s.label,"Click")}</a></td></tr></table></div>`}case"divider":{const l=Math.min(100,Math.max(10,Number(s.width??100))),d=String(s.align??"center"),u=d==="left"?"0 auto 0 0":d==="right"?"0 0 0 auto":"0 auto";return`<div style="padding:${Zr(s.container_padding??s.padding_top)};"><hr style="border:0;border-top:${Number(s.thickness??1)}px ${Te(s.style,"solid")} ${Te(s.color,"#d9dce5")};width:${l}%;margin:${u};" /></div>`}case"spacer":return`<div style="padding:${Zr(s.container_padding,0)} 0;"><div style="height:${Number(s.height??24)}px;line-height:${Number(s.height??24)}px;background:${Te(s.background_color,"transparent")};"> </div></div>`;case"social":return`<div class="edm-social" style="padding:${Zr(s.container_padding)} 0;text-align:${cs(s.align)};">${(Array.isArray(s.items)?s.items:[]).map((l,d,u)=>{const h=String(l.network??"").toLowerCase(),p=_L[h]??{short:String(l.label??"S").slice(0,2).toUpperCase(),color:String(s.color??"#14213d")},m=Math.max(20,Number(s.icon_size??32)),g=Math.max(0,Number(s.spacing??5)),b=NL(String(s.icon_type??"circle"),Te(p.color),Te(s.icon_color,"#ffffff")),A="border"in b?b.border:"none";return`<a href="${$e(ln(i(l.href??"#")))}" target="${$e(String(s.target??"_blank"))}" aria-label="${$e(i(l.label??"Social"))}" style="display:inline-grid;place-items:center;width:${m}px;height:${m}px;margin-right:${d===u.length-1?0:g}px;background:${b.background};color:${b.color};border-radius:${b.radius};border:${A};text-decoration:none;font-size:${Math.max(10,Math.round(m*.34))}px;font-weight:700;letter-spacing:0.02em;text-transform:lowercase;">${$e(p.short)}</a>`}).join("")}</div>`;case"video":{const l=s.thumbnail?`
|
|
37
|
+
<a href="${$e(ln(i(s.url??"#")))}" target="${$e(String(s.target??"_blank"))}" style="display:inline-block;width:__MEDIA_WIDTH__;max-width:100%;text-decoration:none;color:inherit;">
|
|
38
|
+
<div style="position:relative;border:1px solid #d9dce5;border-radius:18px;overflow:hidden;background:#111827;">
|
|
39
|
+
${Ob(s,`<img src="${$e(ln(i(s.thumbnail??""),""))}" alt="${$e(i(s.alt??"Video preview"))}" style="display:block;width:100%;max-width:100%;height:auto;opacity:0.88;object-fit:cover;object-position:${Db(s)};${Ib(s)}" />`).replace("width:100%;max-width:100%;height:auto;",String(s.crop_aspect??"free")==="free"?"width:100%;max-width:100%;height:auto;":"width:100%;max-width:100%;height:100%;")}
|
|
40
|
+
<span style="position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:68px;height:68px;border-radius:999px;background:rgba(17,24,39,0.78);display:grid;place-items:center;color:#ffffff;font-size:24px;">▶</span>
|
|
41
|
+
</div>
|
|
42
|
+
<div style="margin-top:10px;font-weight:600;color:#14213d;">${a(s.title,"Video")}</div>
|
|
43
|
+
</a>
|
|
44
|
+
`:`<div style="padding:18px;border:1px solid #d9dce5;border-radius:18px;"><strong>${a(s.title,"Video")}</strong><div style="margin-top:8px;color:#5c677d;">${$e(String(s.url??""))}</div></div>`;return oh(l,s)}case"raw-html":{const l=IL(Ur(String(s.html??""),r));return`<div style="padding:${Math.max(0,Number(s.padding??0))}px;background:${Te(s.background_color,"transparent")};border-radius:${Math.max(0,Number(s.border_radius??0))}px;">${o?or(l):l}</div>`}case"navigation":return`<div class="edm-navigation" style="padding:${Zr(s.container_padding)} 0;text-align:${cs(s.align)};">${(Array.isArray(s.items)?s.items:[]).map(l=>`<a href="${$e(ln(i(l.href??"#")))}" target="${$e(String(s.target??"_blank"))}" style="display:inline-block;margin:0 ${Math.max(0,Number(s.spacing??20))/2}px;color:${Te(s.color,"#14213d")};text-decoration:none;font-weight:${Math.max(400,Math.min(700,Number(s.font_weight??600)))};font-size:${Math.max(10,Number(s.font_size??14))}px;">${a(l.label,"Link")}</a>`).join("")}</div>`;case"form":return`<div style="padding:${Math.max(0,Number(s.padding??18))}px;border:1px solid ${Te(s.border_color,"#d9dce5")};border-radius:${Math.max(0,Number(s.border_radius??18))}px;background:${Te(s.background_color,"#ffffff")};"><div style="font-weight:600;margin-bottom:12px;">${a(s.headline,"Join the list")}</div><div style="padding:12px 14px;background:#ffffff;border:1px solid ${Te(s.border_color,"#d9dce5")};border-radius:12px;color:#8d99ae;">${a(s.field_placeholder,"name@example.com")}</div><div style="margin-top:12px;display:inline-block;background:${Te(s.button_color,"#14213d")};color:${Te(s.button_text_color,"#ffffff")};padding:12px 18px;border-radius:999px;">${a(s.button_label,"Submit")}</div></div>`;case"countdown":return`<div style="padding:${Math.max(0,Number(s.padding??18))}px;border-radius:${Math.max(0,Number(s.border_radius??18))}px;background:${Te(s.background_color,"#14213d")};color:${Te(s.color,"#ffffff")};text-align:${cs(s.align)};"><div style="font-size:12px;letter-spacing:0.12em;text-transform:uppercase;opacity:0.72;">${$e(Ur(String(s.label??"Countdown"),r))}</div><div style="font-size:24px;font-weight:700;margin-top:8px;">${$e(Ur(String(s.end_date??""),r))}</div></div>`;case"table":{const l=tu(s.rows),d=k1(l),u=l.length-1,h=!!(s.header_row??!0),p=!!s.footer_row&&u>(h?0:-1),m=Te(s.border_style,"solid"),g=Math.max(0,Number(s.border_width??1)),b=Te(s.border_color,"#e6ecea"),A=m==="none"||g===0?"":`border:${g}px ${m} ${b};`,y=Math.max(0,Number(s.cell_padding??10)),w=Math.max(10,Number(s.font_size??14)),C=Te(s.text_color,"#14213d"),E=Math.max(400,Math.min(700,Number(s.font_weight??400))),S=Math.max(80,Math.min(200,Number(s.line_height??140))),k=Math.max(0,Number(s.letter_spacing??0)),I=String(s.font_family??"body"),L=I==="body"?"inherit":Te(I),R=cs(s.align,"left"),B=Te(s.header_background,"#14213d"),O=Te(s.header_color,"#ffffff"),Y=Te(s.footer_background,"#14213d"),Q=Te(s.footer_color,"#ffffff"),W=!!s.striped,ie=Te(s.stripe_color,"#f4f8f7"),J=Math.min(100,Math.max(10,Number(s.width??100))),H=Zr(s.container_padding),te=(F,ce,ve)=>{const Ne=ce==="header"?"th":"td",ye=ce==="header"?O:ce==="footer"?Q:C,xe=ce==="body"?E:700,ht=`${F.colspan>1?` colspan="${F.colspan}"`:""}${F.rowspan>1?` rowspan="${F.rowspan}"`:""}`;return`<${Ne}${ht} style="${A}padding:${y}px;font-family:${L};font-size:${w}px;line-height:${S}%;letter-spacing:${k}px;color:${ye};font-weight:${xe};text-align:${R};background:${ve};">${$e(Ur(F.text,r))}</${Ne}>`};let G=-1;const M=l.map((F,ce)=>{const ve=h&&ce===0?"header":p&&ce===u?"footer":"body";ve==="body"&&(G+=1);const Ne=ve==="header"?B:ve==="footer"?Y:W&&G%2===1?ie:"#ffffff";return`<tr>${F.map((ye,xe)=>{var ht;return(ht=d[ce])!=null&&ht[xe]?"":te(ye,ve,Ne)}).join("")}</tr>`}).join("");return`<div style="padding:${H} 0;"><table role="presentation" cellpadding="0" cellspacing="0" style="width:${J}%;border-collapse:collapse;">${M}</table></div>`}case"custom":{const l=String(s._tool??""),d=l?(n=t.tools)==null?void 0:n[l]:void 0,u=(()=>{if(d)try{return String(d(s)??"")}catch{}return typeof s._html=="string"?s._html:""})();return o?or(u):u}default:return""}},DL=(e,t={})=>{const n=e.columns.map(s=>{var o,a,l,d,u;const h=Math.max(1,Math.floor(s.width)),p=Te((o=s.settings)==null?void 0:o.background_color,"transparent"),m=`${Math.max(0,Number(((a=s.settings)==null?void 0:a.padding)??12))}px`,g=Te((l=s.settings)==null?void 0:l.border_style,"none"),b=Math.max(0,Number(((d=s.settings)==null?void 0:d.border_width)??0)),A=Te((u=s.settings)==null?void 0:u.border_color,"#d9dce5"),y=g==="none"||b===0?"border:none;":`border:${b}px ${g} ${A};`,w=s.blocks.filter(I=>v1(I.visible_if,t.mergeTags)),C=I=>`<div class="${Nb(I)}">${Yc(I,t)}</div>`,E=I=>{const L=String(I.values.text_wrap??"none");return(I.type==="image"||I.type==="gif")&&(L==="left"||L==="right")},S=[];for(let I=0;I<w.length;I+=1){const L=w[I];if(E(L)&&I+1<w.length){const R=w.slice(I+1).map(C).join("");S.push(`<div class="${Nb(L)}" style="overflow:hidden;">${Yc(L,t)}${R}</div>`);break}S.push(C(L))}const k=S.join("");return`<td class="edm-column-cell" width="${h}%" valign="top" style="width:${h}%;padding:${m};background:${p};${y}">${k}</td>`}).join(""),r=e.settings.background_image?`background-image:url('${$e(ln(String(e.settings.background_image),""))}');background-size:cover;background-position:center;`:"",i=Te(e.settings.content_background_color,"transparent");return SL(`<table role="presentation" class="edm-row-table" width="100%" cellpadding="0" cellspacing="0" style="border-collapse:collapse;background:${i};"><tr>${n}</tr></table>`,Te(e.settings.background_color,"transparent"),Te(e.settings.padding,"0"),r,TL(e))},ML=e=>`
|
|
45
|
+
:root {
|
|
46
|
+
--edm-token-primary: ${Te(e.design_tokens.primary??e.body.text_color)};
|
|
47
|
+
--edm-token-accent: ${Te(e.design_tokens.accent??e.body.link_color)};
|
|
48
|
+
--edm-token-background: ${Te(e.design_tokens.background??e.body.background_color)};
|
|
49
|
+
--edm-token-text: ${Te(e.design_tokens.text??e.body.text_color)};
|
|
50
|
+
--edm-token-radius: ${Te(e.design_tokens.radius??"18px")};
|
|
51
|
+
--edm-token-spacing: ${Te(e.design_tokens.spacing??"24px")};
|
|
52
|
+
}
|
|
53
|
+
body, table, td, a { -webkit-text-size-adjust:100%; -ms-text-size-adjust:100%; }
|
|
54
|
+
table, td { mso-table-lspace:0pt; mso-table-rspace:0pt; }
|
|
55
|
+
img { -ms-interpolation-mode:bicubic; border:0; outline:none; text-decoration:none; }
|
|
56
|
+
body { margin:0; padding:0; width:100% !important; background:${Te(e.body.background_color)}; color:${Te(e.body.text_color)}; }
|
|
57
|
+
.edm-shell { width:100%; background:${Te(e.body.background_color)}; font-family:${Te(e.body.font_family)}; color:${Te(e.body.text_color)}; font-weight:${e.body.font_weight}; }
|
|
58
|
+
.edm-inner { width:100%; max-width:${e.body.content_width}px; margin:${e.body.content_align==="left"?"0 auto 0 0":e.body.content_align==="right"?"0 0 0 auto":"0 auto"}; }
|
|
59
|
+
.edm-row-table { width:100%; }
|
|
60
|
+
.edm-column-cell { vertical-align:top; }
|
|
61
|
+
.edm-block-wrap { margin-bottom:18px; }
|
|
62
|
+
.edm-block-wrap:last-child { margin-bottom:0; }
|
|
63
|
+
.edm-button-table { max-width:100%; }
|
|
64
|
+
.edm-button-link { max-width:100%; word-break:break-word; }
|
|
65
|
+
.edm-text-block p:first-child { margin-top:0; }
|
|
66
|
+
.edm-text-block p:last-child { margin-bottom:0; }
|
|
67
|
+
.edm-text-block a, .edm-shell .edm-navigation a, .edm-shell .edm-social a { color:${Te(e.body.link_color)} !important; text-decoration:${e.body.link_underline?"underline":"none"} !important; }
|
|
68
|
+
.edm-preheader { display:none !important; visibility:hidden; mso-hide:all; opacity:0; color:transparent; height:0; width:0; overflow:hidden; }
|
|
69
|
+
@media only screen and (max-width: 620px) {
|
|
70
|
+
.edm-inner { width:100% !important; max-width:100% !important; }
|
|
71
|
+
.edm-row-table, .edm-row-table tbody, .edm-row-table tr, .edm-column-cell { display:block !important; width:100% !important; }
|
|
72
|
+
.edm-column-cell { padding-left:12px !important; padding-right:12px !important; }
|
|
73
|
+
.edm-block-wrap { margin-bottom:14px !important; }
|
|
74
|
+
.edm-button-table { width:100% !important; }
|
|
75
|
+
.edm-button-link { display:block !important; width:100% !important; }
|
|
76
|
+
.edm-navigation a, .edm-social a { margin-right:8px !important; margin-left:0 !important; }
|
|
77
|
+
.edm-mobile-hidden { display:none !important; max-height:0 !important; overflow:hidden !important; mso-hide:all !important; }
|
|
78
|
+
}
|
|
79
|
+
@media only screen and (min-width: 621px) {
|
|
80
|
+
.edm-desktop-hidden { display:none !important; max-height:0 !important; overflow:hidden !important; mso-hide:all !important; }
|
|
81
|
+
}
|
|
82
|
+
`,OL=(e,t)=>t?y1(e,{preserveMediaQueries:!0,removeStyleTags:!1}):e,Sp=e=>{const t=e.filter(i=>{var s;return((s=i.settings)==null?void 0:s.role)==="header"}),n=e.filter(i=>{var s;return((s=i.settings)==null?void 0:s.role)==="footer"}),r=e.filter(i=>{var s,o;return((s=i.settings)==null?void 0:s.role)!=="header"&&((o=i.settings)==null?void 0:o.role)!=="footer"});return[...t,...r,...n]},Qn=(e,t={})=>{const n=t.resolveTokens===!1?e:w1(e),r=Sp(n.body.rows).map(g=>DL(g,t)).join(""),i=n.body.content_align==="left"?"left":n.body.content_align==="right"?"right":"center",s=`${n.body.preheader_text?`<div class="edm-preheader">${$e(n.body.preheader_text)}</div>`:""}<table role="presentation" class="edm-shell" width="100%" cellpadding="0" cellspacing="0" style="border-collapse:collapse;background:${Te(n.body.background_color)};font-family:${Te(n.body.font_family)};color:${Te(n.body.text_color)};font-weight:${n.body.font_weight};"><tr><td align="${i}"><!--[if mso | IE]><table role="presentation" align="${i}" border="0" cellspacing="0" cellpadding="0" width="${n.body.content_width}"><tr><td><![endif]--><table role="presentation" class="edm-inner" width="100%" cellpadding="0" cellspacing="0" style="width:100%;max-width:${n.body.content_width}px;margin:0 auto;border-collapse:collapse;">${r}</table><!--[if mso | IE]></td></tr></table><![endif]--></td></tr></table>`,o=_1(n.body.custom_css),a=`${ML(n)}${EL(n)}${CL(n)}${o?`
|
|
83
|
+
/* custom */
|
|
84
|
+
${o}`:""}`,l=n.body.subject_line?`<meta name="x-edm-subject" content="${$e(n.body.subject_line)}" />`:"",d=(t.fontImports??[]).map(g=>`<link href="${$e(ln(g))}" rel="stylesheet" />`).join(""),u=`<!doctype html><html><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width,initial-scale=1" /><meta http-equiv="x-ua-compatible" content="ie=edge" />${l}<title>${$e(n.body.html_title||n.title)}</title>${d}<style>${a}</style></head><body style="margin:0;padding:0;">${s}</body></html>`,h=OL(u,t.inlineCss!==!1),p=t.fullDocument?h:`${wL(h)}${vL(h)}`,m=t.designTags?ZR(p,t.designTags,t.designTagsDelimiters):p;return t.minify?Vm(m):m},RL="<style amp4email-boilerplate>body{visibility:hidden}</style>",LL='<script async src="https://cdn.ampproject.org/v0.js"><\/script>',jL='<script async custom-element="amp-carousel" src="https://cdn.ampproject.org/v0/amp-carousel-0.1.js"><\/script>',BL=e=>e.replace(/!important/gi,"").replace(/position\s*:\s*fixed/gi,"position:static").trim(),ru=(e,t={})=>{var n;const r=Qn(e,{...t,amp:!0,fullDocument:!0,inlineCss:!1,minify:!1}),i=BL((r.match(/<style(?![^>]*amp4email-boilerplate)[^>]*>[\s\S]*?<\/style>/gi)??[]).map(l=>l.replace(/<\/?style[^>]*>/gi,"")).join(`
|
|
85
|
+
`)),s=(((n=r.match(/<body[^>]*>([\s\S]*?)<\/body>/i))==null?void 0:n[1])??"").replace(/<style[\s\S]*?<\/style>/gi,"").replace(/<!--\[if[\s\S]*?<!\[endif\]-->/gi,"").trim(),o=/<amp-carousel/.test(s),a=`<!doctype html><html amp4email><head>${`<meta charset="utf-8" /><meta name="viewport" content="width=device-width" /><title>${$e(e.body.html_title||e.title)}</title>${RL}${LL}${o?jL:""}<style amp-custom>${i}</style>`}</head><body>${s}</body></html>`;return t.minify?Vm(a):a},M1=(e,t={})=>{const n=Qn(e,{...t,fullDocument:!1,inlineCss:!1,minify:!1}).replace(/<style[\s\S]*?<\/style>/gi," ").replace(/<script[\s\S]*?<\/script>/gi," ").replace(/<br\s*\/?>/gi,`
|
|
86
|
+
`).replace(/<\/(p|div|h1|h2|h3|h4|tr|table|section)>/gi,`
|
|
87
|
+
`).replace(/<li[^>]*>/gi,`
|
|
88
|
+
- `).replace(/<\/li>/gi,"").replace(/<[^>]+>/g," ").replace(/\n{3,}/g,`
|
|
89
|
+
|
|
90
|
+
`).replace(/[ \t]{2,}/g," ").trim();return kL(n)},PL=(e,t={})=>{const n=e.ab_variants??[],r=Math.max(0,1-n.reduce((i,s)=>i+s.weight,0));return[{id:"base",label:"Original",weight:Number(r.toFixed(4)),html:Qn({...e,ab_variants:void 0},t)},...n.map(i=>({id:i.id,label:i.label,weight:i.weight,html:Qn(i.design,t)}))]},FL=(e,t={})=>{const n=Qn(e,{...t,fullDocument:!1}),r=t.pageSize==="a4"?"A4":"letter",i=t.margin??"0.5in",s=e.body.content_width,o=$e(e.body.html_title||e.title),a=`@page{size:${r};margin:${i};}@media print{body{background:#ffffff;}.edm-doc{box-shadow:none;margin:0;max-width:none;}}body{margin:0;padding:24px;background:#f3f4f6;font-family:${Te(e.body.font_family)};color:${Te(e.body.text_color)};}.edm-doc{max-width:${s}px;margin:0 auto;background:${Te(e.body.background_color)};box-shadow:0 1px 6px rgba(0,0,0,0.12);}`,l=`<!doctype html><html><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width,initial-scale=1" /><title>${o}</title><style>${a}</style></head><body><div class="edm-doc">${n}</div></body></html>`;return t.minify?Vm(l):l},O1=e=>e.replace(/ /gi," ").replace(/&/gi,"&").replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/'|'/gi,"'"),qm=e=>O1(e.replace(/<[^>]+>/g," ")).replace(/\s+/g," ").trim(),ta=(e,t)=>{const n=e.match(new RegExp(`\\b${t}\\s*=\\s*("([^"]*)"|'([^']*)'|([^\\s>]+))`,"i"));return n?O1(n[2]??n[3]??n[4]??""):""},$L=e=>{let t=e.replace(/<!--[\s\S]*?-->/g,"").replace(/<script\b[\s\S]*?<\/script>/gi,"").replace(/<style\b[\s\S]*?<\/style>/gi,"").replace(/<head\b[\s\S]*?<\/head>/gi,"");const n=t.match(/<body\b[^>]*>([\s\S]*?)<\/body>/i);return n?n[1]:t},HL=2e4,UL=5e3,GL=(e,t)=>{const n=qm(t);if(!n)return null;const r=Yt("heading");return r.values.tag=`h${Math.min(Math.max(e,1),4)}`,r.values.text=n,r},Rb=e=>{if(!qm(e))return null;const t=Yt("text");return t.values.html=or(e.trim()),t},Lb=(e,t,n)=>{if(!e)return null;const r=Yt("image");return r.values.src=e,r.values.alt=t,n&&(r.values.href=n),r},WL=(e,t)=>{if(!e)return null;const n=Yt("button");return n.values.label=e,n.values.href=t||"#",n.values.action_type="open-website",n},YL=[{re:/<h([1-6])\b[^>]*>([\s\S]*?)<\/h\1>/gi,build:e=>GL(Number(e[1]),e[2])},{re:/<a\b([^>]*)>([\s\S]*?)<\/a>/gi,build:e=>{const t=ta(`<a ${e[1]}>`,"href"),n=e[2].match(/<img\b[^>]*>/i);return n?Lb(ta(n[0],"src"),ta(n[0],"alt"),t):WL(qm(e[2]),t)}},{re:/<img\b[^>]*>/gi,build:e=>Lb(ta(e[0],"src"),ta(e[0],"alt"),"")},{re:/<hr\b[^>]*\/?>/gi,build:()=>Yt("divider")},{re:/<p\b[^>]*>([\s\S]*?)<\/p>/gi,build:e=>Rb(e[1])},{re:/<(ul|ol)\b[^>]*>([\s\S]*?)<\/\1>/gi,build:e=>Rb(e[0])}],zL=(e,t={})=>{const n=hl();t.title&&(n.title=t.title);const r=$L(String(e??"")),i=[],s=[];e:for(const a of YL)for(const l of r.matchAll(a.re))if(s.push({index:l.index,end:l.index+l[0].length,matcher:a,m:l}),s.length>=HL)break e;s.sort((a,l)=>a.index-l.index||l.end-a.end);let o=0;for(const a of s){if(a.index<o)continue;const l=a.matcher.build(a.m);if(l&&(i.push(l),i.length>=UL))break;o=a.end}if(i.length===0){const a=Yt("raw-html"),l=or(r.trim());return a.values.html=l||"<p></p>",n.body.rows=[Mt("single",{initialBlocks:[[a]]})],{design:n,blockCount:1,usedFallback:!0}}return n.body.rows=i.map(a=>Mt("single",{initialBlocks:[[a]]})),{design:n,blockCount:i.length,usedFallback:!1}},KL="2.0",jb=[{from:"1.0",to:"2.0",migrate:XL}],Cr=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),zc=e=>Array.isArray(e)?e:[],QL=e=>{if(typeof e=="number"&&Number.isFinite(e))return Bb(e);if(typeof e=="string"){const t=Number.parseInt(e.replace(/px$/i,"").trim(),10);if(Number.isFinite(t))return Bb(t)}return 600},Bb=e=>Math.min(900,Math.max(320,e)),VL={abVariants:"ab_variants",actionType:"action_type",autoWidth:"auto_width",backgroundColor:"background_color",backgroundImage:"background_image",borderColor:"border_color",borderRadius:"border_radius",borderStyle:"border_style",borderWidth:"border_width",buttonColor:"button_color",buttonLabel:"button_label",buttonTextColor:"button_text_color",containerPadding:"container_padding",contentAlign:"content_align",contentBackgroundColor:"content_background_color",contentLocked:"content_locked",contentWidth:"content_width",cropAspect:"crop_aspect",darkModeStyles:"dark_mode_styles",deleteLocked:"delete_locked",designTokens:"design_tokens",displayMode:"display_mode",endDate:"end_date",fieldPlaceholder:"field_placeholder",focalX:"focal_x",focalY:"focal_y",fontFamily:"font_family",fontSize:"font_size",fontWeight:"font_weight",globalBlockId:"global_block_id",globalBlocks:"global_blocks",hideDesktop:"hide_desktop",hideMobile:"hide_mobile",htmlTitle:"html_title",iconColor:"icon_color",iconSize:"icon_size",iconType:"icon_type",inheritLinkStyles:"inherit_link_styles",layoutLocked:"layout_locked",letterSpacing:"letter_spacing",lineHeight:"line_height",linkColor:"link_color",linkUnderline:"link_underline",moveLocked:"move_locked",paddingBottom:"padding_bottom",paddingLeft:"padding_left",paddingRight:"padding_right",paddingTop:"padding_top",preheaderText:"preheader_text",schemaVersion:"schema_version",styleLocked:"style_locked",subjectLine:"subject_line",syncedAt:"synced_at",textColor:"text_color",visibleIf:"visible_if"},qL=new Set(["darkModeStyles","dark_mode_styles","designTokens","design_tokens"]),_p=e=>{if(Array.isArray(e))return e.map(_p);if(Cr(e)){const t={};for(const[n,r]of Object.entries(e))t[VL[n]??n]=qL.has(n)?r:_p(r);return t}return e};function JL(e,t){const n=Cr(e)?e:{},r=zc(n.blocks??n.contents),i=typeof n.width=="number"&&Number.isFinite(n.width)?n.width:Math.round(100/Math.max(1,t));return{...n,width:i,blocks:r.map(s=>{const o=Cr(s)?s:{};return{...o,values:Cr(o.values)?o.values:{}}}),settings:Cr(n.settings)?n.settings:{}}}function ZL(e){const t=Cr(e)?e:{},n=zc(t.columns);return{...t,columns:n.map(r=>JL(r,n.length)),settings:Cr(t.settings)?t.settings:{}}}function XL(e){const t=Cr(e.body)?e.body:{};return{...e,schemaVersion:"2.0",title:typeof e.title=="string"?e.title:typeof e.name=="string"?e.name:"Untitled design",displayMode:e.displayMode==="web"||e.displayMode==="popup"?e.displayMode:"email",counters:Cr(e.counters)?e.counters:{},designTokens:Cr(e.designTokens)?e.designTokens:{},globalBlocks:zc(e.globalBlocks),body:{...t,backgroundColor:typeof t.backgroundColor=="string"?t.backgroundColor:"#f4f5f7",contentWidth:QL(t.contentWidth),fontFamily:typeof t.fontFamily=="string"?t.fontFamily:"Arial, Helvetica, sans-serif",rows:zc(t.rows).map(ZL)}}}function ej(e){let t=Cr(e)?{...e}:{},n=typeof t.schema_version=="string"?t.schema_version:typeof t.schemaVersion=="string"?t.schemaVersion:"1.0";for(let r=0;r<=jb.length&&n!==KL;r++){const i=jb.find(s=>s.from===n);if(!i)break;t=i.migrate(t),n=i.to}return t=_p(t),Zx.parse(t)}const Jm=e=>String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),Yn=e=>Jm(e).replace(/"/g,"""),tj=(e,t)=>{const n=e.values;switch(e.type){case"heading":case"text":return`<mj-text color="${Yn(n.color??"#1a2b4a")}" align="${Yn(n.align??"left")}">${Ur(String(n.html??n.text??""),t)}</mj-text>`;case"button":{const r=Ur(Qm(String(n.action_type??"open-website"),String(n.href??""))||"#",t);return`<mj-button href="${Yn(r)}" background-color="${Yn(n.background_color??"#ef476f")}" color="${Yn(n.color??"#ffffff")}">${Jm(Ur(String(n.label??"Click"),t))}</mj-button>`}case"image":return`<mj-image src="${Yn(n.src??"")}" alt="${Yn(n.alt??"")}" />`;case"divider":return`<mj-divider border-color="${Yn(n.color??"#cccccc")}" />`;case"spacer":return`<mj-spacer height="${Math.max(0,Number(n.height??24))}px" />`;case"social":return`<mj-social>${(Array.isArray(n.items)?n.items:[]).map(r=>`<mj-social-element name="${Yn(r.label??"link")}" href="${Yn(r.href??"#")}" />`).join("")}</mj-social>`;case"raw-html":return`<mj-raw>${Ur(String(n.html??""),t)}</mj-raw>`;default:return`<mj-raw>${Yc(e,{mergeTags:t})}</mj-raw>`}},nj=(e,t)=>`<mj-section background-color="${Yn(e.settings.content_background_color??"#ffffff")}">${e.columns.map(n=>`<mj-column width="${Math.max(1,Math.floor(n.width))}%">${n.blocks.map(r=>tj(r,t)).join("")}</mj-column>`).join("")}</mj-section>`,Zm=(e,t={})=>{const n=t.mergeTags??{},r=e.body.rows.map(i=>nj(i,n)).join("");return`<mjml><mj-head><mj-title>${Jm(e.body.html_title||e.title)}</mj-title><mj-attributes><mj-all font-family="${Yn(e.body.font_family)}" /></mj-attributes></mj-head><mj-body background-color="${Yn(e.body.background_color)}" width="${e.body.content_width}px">${r}</mj-body></mjml>`},Np=[{id:"apple-mail",label:"Apple Mail",engine:"webkit",width:660,mobile:!1,notes:["WebKit, near-full CSS support. The most forgiving desktop client."]},{id:"gmail",label:"Gmail (Web)",engine:"blink",width:660,mobile:!1,notes:["Supports <style>, but clips the message past ~102KB.","No @font-face web fonts."]},{id:"gmail-mobile",label:"Gmail (Mobile)",engine:"blink",width:380,mobile:!0,notes:["Strips <style>, inline CSS only.","No media queries → no responsive/dark-mode rules."]},{id:"outlook",label:"Outlook (Windows)",engine:"word",width:660,mobile:!1,notes:["Word rendering engine, the strictest client.","No border-radius, box-shadow, background-image, or media queries.","Ignores max-width; use fixed table widths."]},{id:"outlook-web",label:"Outlook.com",engine:"blink",width:660,mobile:!1,notes:["Web engine, much better than desktop Outlook, but strips some <style> rules."]},{id:"yahoo",label:"Yahoo Mail",engine:"blink",width:660,mobile:!1,notes:["Good CSS support; rewrites some class/id names."]}],Pb=e=>e.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),rj=e=>e.replace(/<style([^>]*)>([\s\S]*?)<\/style>/gi,(t,n,r)=>{const i=r.replace(/@media[^{]*\{(?:[^{}]*\{[^{}]*\})*[^{}]*\}/gi,"");return`<style${n}>${i}</style>`}),ij=(e,t)=>{const n=new Set(t.map(r=>r.toLowerCase()));return e.replace(/style="([^"]*)"/gi,(r,i)=>{const s=i.split(";").map(o=>o.trim()).filter(o=>{if(!o)return!1;const a=o.slice(0,o.indexOf(":")).trim().toLowerCase();return!n.has(a)});return`style="${s.join("; ")}${s.length?";":""}"`})},sj=["border-radius","box-shadow","background-image","max-width","transform","transition","filter","object-fit"],oj=(e,t)=>{const n=Np.find(r=>r.id===t);if(!n)return e;switch(n.engine){case"word":{let r=Pb(e);return r=ij(r,sj),r}case"blink":return n.mobile?Pb(e):rj(e);case"webkit":default:return e}},aj=["","#","https://example.com","https://example.com/","http://example.com"],lj=["act now","click here","limited time","100% free","risk free","double your","cash bonus","winner","congratulations","guaranteed","no credit check","this is not spam","buy now"],Fb=e=>String(e??"").replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim(),cj=e=>{const t=e.values,n=[],r=i=>{typeof i=="string"&&n.push(i)};e.type==="button"?r(Qm(String(t.action_type??"open-website"),String(t.href??""))):r(t.href),r(t.url);for(const i of Array.isArray(t.items)?t.items:[])r(i==null?void 0:i.href);if(typeof t.html=="string")for(const i of t.html.matchAll(/href="([^"]*)"/gi))n.push(i[1]);return n},$b=e=>{const t=String(e??"").trim().replace(/^#/,"");if(!/^[0-9a-f]{3}$|^[0-9a-f]{6}$/i.test(t))return null;const n=t.length===3?t.split("").map(r=>r+r).join(""):t;return[parseInt(n.slice(0,2),16),parseInt(n.slice(2,4),16),parseInt(n.slice(4,6),16)]},Hb=([e,t,n])=>{const r=i=>{const s=i/255;return s<=.03928?s/12.92:((s+.055)/1.055)**2.4};return .2126*r(e)+.7152*r(t)+.0722*r(n)},dj=(e,t)=>{const n=$b(e),r=$b(t);if(!n||!r)return null;const i=Hb(n),s=Hb(r);return(Math.max(i,s)+.05)/(Math.min(i,s)+.05)},uj=(e,t)=>{var n;for(const r of((n=e.body)==null?void 0:n.rows)??[])for(const i of r.columns??[])for(const s of i.blocks??[])t(s)},hj=(e,t={})=>{const n=[],r=u=>n.push(u),i=e.body??{};let s=!1;const o=new Set,a=u=>{const h=u.toLowerCase();for(const p of lj)h.includes(p)&&o.add(p)},l=String(i.subject_line??"").trim();l?l.length>70&&r({id:"subject-long",severity:"info",category:"deliverability",message:`Subject is ${l.length} characters, most inboxes truncate past ~70.`,hint:"Shorten the subject."}):r({id:"subject-missing",severity:"warning",category:"deliverability",message:"No subject line set.",hint:"Add a subject in Body settings."}),a(l),String(i.preheader_text??"").trim()||r({id:"preheader-missing",severity:"info",category:"deliverability",message:"No preheader text, inboxes will show the first line of the email instead.",hint:"Set a preheader in Body settings."}),uj(e,u=>{const h=u.values;for(const p of cj(u)){const m=p.trim();(/^unsubscribe/i.test(m)||/unsubscribe/i.test(m)||/\{\{\s*unsubscribe/i.test(m))&&(s=!0),/^javascript:/i.test(m)?r({id:`link-js-${u.id}`,severity:"error",category:"links",blockId:u.id,message:"A link uses an unsafe javascript: URL, email clients block it.",hint:"Use a normal https:// URL."}):aj.includes(m.toLowerCase())&&r({id:`link-placeholder-${u.id}`,severity:"warning",category:"links",blockId:u.id,message:"A link still points at a placeholder / empty URL.",hint:"Set the real destination."})}if((u.type==="image"||u.type==="gif")&&!String(h.alt??"").trim()&&r({id:`alt-${u.id}`,severity:"warning",category:"accessibility",blockId:u.id,message:`${u.type==="gif"?"GIF":"Image"} has no alt text, bad for screen readers and blocked-image views.`,hint:"Add descriptive alt text."}),u.type==="button"){const p=dj(String(h.color??"#ffffff"),String(h.background_color??"#000000"));p!==null&&p<4.5&&r({id:`contrast-${u.id}`,severity:"warning",category:"accessibility",blockId:u.id,message:`Button text contrast is ${p.toFixed(1)}:1, below the 4.5:1 readability guideline.`,hint:"Darken/lighten the button or text color."})}typeof h.html=="string"&&a(Fb(h.html)),typeof h.text=="string"&&a(Fb(h.text)),typeof h.label=="string"&&a(String(h.label))}),s||r({id:"no-unsubscribe",severity:"warning",category:"deliverability",message:"No unsubscribe link found, required for marketing email (CAN-SPAM/GDPR).",hint:"Add a link with an {{unsubscribe_url}} merge tag."}),o.size>0&&r({id:"spam-words",severity:"info",category:"deliverability",message:`Possible spam-trigger phrases: ${[...o].join(", ")}.`,hint:"Reword to avoid spam filters."});for(const u of t.validators??[]){let h=[];try{h=u.run(e)??[]}catch{continue}h.forEach((p,m)=>{r({...p,id:p.id??`custom-${u.id}-${m}`,category:p.category??"custom"})})}const d={error:0,warning:1,info:2};return n.sort((u,h)=>d[u.severity]-d[h.severity])},pj=(()=>{const e=new Uint32Array(256);for(let t=0;t<256;t+=1){let n=t;for(let r=0;r<8;r+=1)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n>>>0}return e})(),mj=e=>{let t=4294967295;for(let n=0;n<e.length;n+=1)t=pj[(t^e[n])&255]^t>>>8;return(t^4294967295)>>>0},R1=new TextEncoder,fj=e=>typeof e=="string"?R1.encode(e):e,Rt=(e,t)=>{e.push(t&255,t>>>8&255)},Gn=(e,t)=>{e.push(t&255,t>>>8&255,t>>>16&255,t>>>24&255)},ah=(e,t)=>{for(let n=0;n<t.length;n+=1)e.push(t[n])},Ub=0,Gb=33,Wb=2048,gj=e=>{const t=[],n=[];for(const o of e){const a=R1.encode(o.name),l=fj(o.data),d=mj(l),u=l.length,h=t.length;Gn(t,67324752),Rt(t,20),Rt(t,Wb),Rt(t,0),Rt(t,Ub),Rt(t,Gb),Gn(t,d),Gn(t,u),Gn(t,u),Rt(t,a.length),Rt(t,0),ah(t,a),ah(t,l),Gn(n,33639248),Rt(n,20),Rt(n,20),Rt(n,Wb),Rt(n,0),Rt(n,Ub),Rt(n,Gb),Gn(n,d),Gn(n,u),Gn(n,u),Rt(n,a.length),Rt(n,0),Rt(n,0),Rt(n,0),Rt(n,0),Gn(n,0),Gn(n,h),ah(n,a)}const r=t.length,i=n.length,s=[];return Gn(s,101010256),Rt(s,0),Rt(s,0),Rt(s,e.length),Rt(s,e.length),Gn(s,i),Gn(s,r),Rt(s,0),Uint8Array.from([...t,...n,...s])},L1=(e,t={})=>{const{includeAmp:n=!0,includeMjml:r=!0,includePlainText:i=!0,includeJson:s=!0,...o}=t,a=[{name:"index.html",data:Qn(e,{...o,fullDocument:!0})}];r&&a.push({name:"email.mjml",data:Zm(e,o)}),n&&a.push({name:"email.amp.html",data:ru(e,o)}),i&&a.push({name:"email.txt",data:M1(e,o)}),s&&a.push({name:"design.json",data:JSON.stringify(e,null,2)});const l=[`# ${e.title||"Email"}`,"","Exported from Edm.","","Files:","- index.html, the HTML email (send this).",r?"- email.mjml, MJML source.":"",n?"- email.amp.html, AMP-for-Email (interactive) part.":"",i?"- email.txt, plain-text alternative.":"",s?"- design.json, Edm design (re-open/edit in the builder).":""].filter(Boolean).join(`
|
|
91
|
+
`);return a.push({name:"README.txt",data:`${l}
|
|
92
|
+
`}),gj(a)},Aj=[{id:"html",label:"HTML",extension:"html",mimeType:"text/html",run:(e,t)=>Qn(e,{...t,fullDocument:!0})},{id:"mjml",label:"MJML",extension:"mjml",mimeType:"text/plain",run:(e,t)=>Zm(e,t)},{id:"amp",label:"AMP for Email",extension:"amp.html",mimeType:"text/html",run:(e,t)=>ru(e,t)},{id:"text",label:"Plain text",extension:"txt",mimeType:"text/plain",run:(e,t)=>M1(e,t)},{id:"json",label:"Design JSON",extension:"json",mimeType:"application/json",run:e=>JSON.stringify(e,null,2)},{id:"zip",label:"ZIP bundle",extension:"zip",mimeType:"application/zip",binary:!0,run:(e,t)=>L1(e,t)}],bj=(e=[])=>{const t=new Map(e.map(i=>[i.id,i])),n=Aj.map(i=>t.get(i.id)??i),r=new Set(n.map(i=>i.id));for(const i of e)r.has(i.id)||(n.push(i),r.add(i.id));return n},yj=e=>Zx.parse(e),Yb=e=>{let t;const n=new Set,r=(d,u)=>{const h=typeof d=="function"?d(t):d;if(!Object.is(h,t)){const p=t;t=u??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(m=>m(t,p))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>l,subscribe:d=>(n.add(d),()=>n.delete(d))},l=t=e(r,i,a);return a},xj=(e=>e?Yb(e):Yb),vj=e=>e;function wj(e,t=vj){const n=v.useSyncExternalStore(e.subscribe,v.useCallback(()=>t(e.getState()),[e,t]),v.useCallback(()=>t(e.getInitialState()),[e,t]));return v.useDebugValue(n),n}const zb=e=>{const t=xj(e),n=r=>wj(t,r);return Object.assign(n,t),n},kj=(e=>e?zb(e):zb);function Ej(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Yl={exports:{}},mn={};/**
|
|
93
|
+
* @license React
|
|
94
|
+
* react-dom.production.js
|
|
95
|
+
*
|
|
96
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
97
|
+
*
|
|
98
|
+
* This source code is licensed under the MIT license found in the
|
|
99
|
+
* LICENSE file in the root directory of this source tree.
|
|
100
|
+
*/var Kb;function Cj(){if(Kb)return mn;Kb=1;var e=v;function t(l){var d="https://react.dev/errors/"+l;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)d+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+l+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function s(l,d,u){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:h==null?null:""+h,children:l,containerInfo:d,implementation:u}}var o=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function a(l,d){if(l==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return mn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,mn.createPortal=function(l,d){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(t(299));return s(l,d,null,u)},mn.flushSync=function(l){var d=o.T,u=r.p;try{if(o.T=null,r.p=2,l)return l()}finally{o.T=d,r.p=u,r.d.f()}},mn.preconnect=function(l,d){typeof l=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(l,d))},mn.prefetchDNS=function(l){typeof l=="string"&&r.d.D(l)},mn.preinit=function(l,d){if(typeof l=="string"&&d&&typeof d.as=="string"){var u=d.as,h=a(u,d.crossOrigin),p=typeof d.integrity=="string"?d.integrity:void 0,m=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;u==="style"?r.d.S(l,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:h,integrity:p,fetchPriority:m}):u==="script"&&r.d.X(l,{crossOrigin:h,integrity:p,fetchPriority:m,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},mn.preinitModule=function(l,d){if(typeof l=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var u=a(d.as,d.crossOrigin);r.d.M(l,{crossOrigin:u,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(l)},mn.preload=function(l,d){if(typeof l=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var u=d.as,h=a(u,d.crossOrigin);r.d.L(l,u,{crossOrigin:h,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},mn.preloadModule=function(l,d){if(typeof l=="string")if(d){var u=a(d.as,d.crossOrigin);r.d.m(l,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:u,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(l)},mn.requestFormReset=function(l){r.d.r(l)},mn.unstable_batchedUpdates=function(l,d){return l(d)},mn.useFormState=function(l,d,u){return o.H.useFormState(l,d,u)},mn.useFormStatus=function(){return o.H.useHostTransitionStatus()},mn.version="19.2.5",mn}var kn={};/**
|
|
101
|
+
* @license React
|
|
102
|
+
* react-dom.development.js
|
|
103
|
+
*
|
|
104
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
105
|
+
*
|
|
106
|
+
* This source code is licensed under the MIT license found in the
|
|
107
|
+
* LICENSE file in the root directory of this source tree.
|
|
108
|
+
*/var Qb;function Tj(){return Qb||(Qb=1,process.env.NODE_ENV!=="production"&&(function(){function e(){}function t(h){return""+h}function n(h,p,m){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;try{t(g);var b=!1}catch{b=!0}return b&&(console.error("The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",typeof Symbol=="function"&&Symbol.toStringTag&&g[Symbol.toStringTag]||g.constructor.name||"Object"),t(g)),{$$typeof:d,key:g==null?null:""+g,children:h,containerInfo:p,implementation:m}}function r(h,p){if(h==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}function i(h){return h===null?"`null`":h===void 0?"`undefined`":h===""?"an empty string":'something with type "'+typeof h+'"'}function s(h){return h===null?"`null`":h===void 0?"`undefined`":h===""?"an empty string":typeof h=="string"?JSON.stringify(h):typeof h=="number"?"`"+h+"`":'something with type "'+typeof h+'"'}function o(){var h=u.H;return h===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
109
|
+
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
110
|
+
2. You might be breaking the Rules of Hooks
|
|
111
|
+
3. You might have more than one copy of React in the same app
|
|
112
|
+
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),h}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var a=v,l={d:{f:e,r:function(){throw Error("Invalid form element. requestFormReset must be passed a form that was rendered by React.")},D:e,C:e,L:e,m:e,X:e,S:e,M:e},p:0,findDOMNode:null},d=Symbol.for("react.portal"),u=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;typeof Map=="function"&&Map.prototype!=null&&typeof Map.prototype.forEach=="function"&&typeof Set=="function"&&Set.prototype!=null&&typeof Set.prototype.clear=="function"&&typeof Set.prototype.forEach=="function"||console.error("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),kn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,kn.createPortal=function(h,p){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error("Target container is not a DOM element.");return n(h,p,null,m)},kn.flushSync=function(h){var p=u.T,m=l.p;try{if(u.T=null,l.p=2,h)return h()}finally{u.T=p,l.p=m,l.d.f()&&console.error("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.")}},kn.preconnect=function(h,p){typeof h=="string"&&h?p!=null&&typeof p!="object"?console.error("ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.",s(p)):p!=null&&typeof p.crossOrigin!="string"&&console.error("ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.",i(p.crossOrigin)):console.error("ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",i(h)),typeof h=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,l.d.C(h,p))},kn.prefetchDNS=function(h){if(typeof h!="string"||!h)console.error("ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",i(h));else if(1<arguments.length){var p=arguments[1];typeof p=="object"&&p.hasOwnProperty("crossOrigin")?console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",s(p)):console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",s(p))}typeof h=="string"&&l.d.D(h)},kn.preinit=function(h,p){if(typeof h=="string"&&h?p==null||typeof p!="object"?console.error("ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.",s(p)):p.as!=="style"&&p.as!=="script"&&console.error('ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are "style" and "script".',s(p.as)):console.error("ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",i(h)),typeof h=="string"&&p&&typeof p.as=="string"){var m=p.as,g=r(m,p.crossOrigin),b=typeof p.integrity=="string"?p.integrity:void 0,A=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;m==="style"?l.d.S(h,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:g,integrity:b,fetchPriority:A}):m==="script"&&l.d.X(h,{crossOrigin:g,integrity:b,fetchPriority:A,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},kn.preinitModule=function(h,p){var m="";if(typeof h=="string"&&h||(m+=" The `href` argument encountered was "+i(h)+"."),p!==void 0&&typeof p!="object"?m+=" The `options` argument encountered was "+i(p)+".":p&&"as"in p&&p.as!=="script"&&(m+=" The `as` option encountered was "+s(p.as)+"."),m)console.error("ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s",m);else switch(m=p&&typeof p.as=="string"?p.as:"script",m){case"script":break;default:m=s(m),console.error('ReactDOM.preinitModule(): Currently the only supported "as" type for this function is "script" but received "%s" instead. This warning was generated for `href` "%s". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)',m,h)}typeof h=="string"&&(typeof p=="object"&&p!==null?(p.as==null||p.as==="script")&&(m=r(p.as,p.crossOrigin),l.d.M(h,{crossOrigin:m,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})):p==null&&l.d.M(h))},kn.preload=function(h,p){var m="";if(typeof h=="string"&&h||(m+=" The `href` argument encountered was "+i(h)+"."),p==null||typeof p!="object"?m+=" The `options` argument encountered was "+i(p)+".":typeof p.as=="string"&&p.as||(m+=" The `as` option encountered was "+i(p.as)+"."),m&&console.error('ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel="preload" as="..." />` tag.%s',m),typeof h=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){m=p.as;var g=r(m,p.crossOrigin);l.d.L(h,m,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},kn.preloadModule=function(h,p){var m="";typeof h=="string"&&h||(m+=" The `href` argument encountered was "+i(h)+"."),p!==void 0&&typeof p!="object"?m+=" The `options` argument encountered was "+i(p)+".":p&&"as"in p&&typeof p.as!="string"&&(m+=" The `as` option encountered was "+i(p.as)+"."),m&&console.error('ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel="modulepreload" as="..." />` tag.%s',m),typeof h=="string"&&(p?(m=r(p.as,p.crossOrigin),l.d.m(h,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:m,integrity:typeof p.integrity=="string"?p.integrity:void 0})):l.d.m(h))},kn.requestFormReset=function(h){l.d.r(h)},kn.unstable_batchedUpdates=function(h,p){return h(p)},kn.useFormState=function(h,p,m){return o().useFormState(h,p,m)},kn.useFormStatus=function(){return o().useHostTransitionStatus()},kn.version="19.2.5",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),kn}var Vb;function Sj(){if(Vb)return Yl.exports;Vb=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function")){if(process.env.NODE_ENV!=="production")throw new Error("^_^");try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}}return process.env.NODE_ENV==="production"?(e(),Yl.exports=Cj()):Yl.exports=Tj(),Yl.exports}var Ts=Sj();const _j=Ej(Ts),Ei=(e,t)=>{var n;return!!((n=e==null?void 0:e.features)!=null&&n[t])},Ip=(e,t)=>!(e!=null&&e.allowed_blocks)||e.allowed_blocks.includes(t),ds=(e,t)=>!(e!=null&&e.allowed_toolbar_actions)||e.allowed_toolbar_actions.includes(t),lh=(e,t)=>!(e!=null&&e.allowed_panels)||e.allowed_panels.includes(t),Nj=e=>(e==null?void 0:e.read_only)===!0,na=(e,t,n)=>(t==null?void 0:t.allow_ai)!==!1&&Ei(e,n),Ij=e=>(e==null?void 0:e.allow_exports)!==!1,Dp=[{type:"heading",title:"Heading",description:"Single-line headline with heading styles.",icon:"heading"},{type:"text",title:"Text",description:"Rich text, merge tags, and formatting.",icon:"text"},{type:"image",title:"Image",description:"Hero images, product shots, and banners.",icon:"image"},{type:"button",title:"Button",description:"CTA buttons with email-safe styling.",icon:"button"},{type:"divider",title:"Divider",description:"Visual separation between sections.",icon:"divider"},{type:"spacer",title:"Spacer",description:"Vertical breathing room and rhythm.",icon:"spacer"},{type:"social",title:"Social",description:"Linked social icons or labels.",icon:"social"},{type:"video",title:"Video",description:"Linked video teaser blocks.",icon:"video"},{type:"raw-html",title:"HTML",description:"Advanced HTML for power users.",icon:"html"},{type:"navigation",title:"Menu",description:"Inline menu links for headers.",icon:"menu"},{type:"form",title:"Form",description:"Landing page capture block.",icon:"form"},{type:"countdown",title:"Timer",description:"Urgency-driven launch or sale timer.",icon:"timer"},{type:"gif",title:"GIF",description:"Animated media block.",icon:"gif"},{type:"table",title:"Table",description:"Rows and columns of content.",icon:"table"},{type:"carousel",title:"Carousel",description:"Image slider (stacks in email).",icon:"carousel"}],Yi=e=>{switch(e){case"undo":return c.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[c.jsx("path",{d:"M8 5 4 9l4 4",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"}),c.jsx("path",{d:"M5 9h6a5 5 0 1 1 0 10h-1",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})]});case"redo":return c.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[c.jsx("path",{d:"m12 5 4 4-4 4",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"}),c.jsx("path",{d:"M15 9H9a5 5 0 1 0 0 10h1",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})]});case"desktop":return c.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[c.jsx("rect",{x:"3.5",y:"4.5",width:"13",height:"9",rx:"1.5",fill:"none",stroke:"currentColor",strokeWidth:"1.6"}),c.jsx("path",{d:"M8 16h4m-5.5-2.5h7",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]});case"mobile":return c.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[c.jsx("rect",{x:"6.5",y:"2.5",width:"7",height:"15",rx:"1.8",fill:"none",stroke:"currentColor",strokeWidth:"1.6"}),c.jsx("path",{d:"M9 5h2",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),c.jsx("circle",{cx:"10",cy:"15",r:"0.8",fill:"currentColor"})]});case"preview":return c.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[c.jsx("path",{d:"M2.5 10s2.8-4.5 7.5-4.5 7.5 4.5 7.5 4.5-2.8 4.5-7.5 4.5S2.5 10 2.5 10Z",fill:"none",stroke:"currentColor",strokeWidth:"1.6"}),c.jsx("circle",{cx:"10",cy:"10",r:"2.2",fill:"none",stroke:"currentColor",strokeWidth:"1.6"})]});case"compare":return c.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[c.jsx("rect",{x:"3.5",y:"4.5",width:"5.5",height:"11",rx:"1.2",fill:"none",stroke:"currentColor",strokeWidth:"1.6"}),c.jsx("rect",{x:"11",y:"4.5",width:"5.5",height:"11",rx:"1.2",fill:"none",stroke:"currentColor",strokeWidth:"1.6"}),c.jsx("path",{d:"M10 4.5v11",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]});case"edit":return c.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[c.jsx("path",{d:"m4 13.5 8.8-8.8 2.5 2.5L6.5 16H4v-2.5Z",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),c.jsx("path",{d:"m11.8 5.7 2.5 2.5",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]});case"check":return c.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[c.jsx("path",{d:"M10 2.5 4 4.8v4.4c0 3.4 2.4 6.4 6 8 3.6-1.6 6-4.6 6-8V4.8L10 2.5Z",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),c.jsx("path",{d:"m7.4 9.8 1.9 1.9 3.4-3.6",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]});case"amp":return c.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:c.jsx("path",{d:"M11 2 4.5 11H9l-1 7 7.5-9H11l1-7Z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"})});case"palette":return c.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[c.jsx("path",{d:"M10 2.5c-4.1 0-7.5 3.1-7.5 7 0 2.7 2.2 4.5 4.8 4.5H9c.7 0 1.2.6 1.2 1.2 0 .3-.1.6-.3.9-.2.3-.3.6-.3.9 0 .6.5 1 1.1 1 4.1 0 7.5-3.4 7.5-7.5s-3.4-8-8.2-8Z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),c.jsx("circle",{cx:"6.6",cy:"9",r:"1",fill:"currentColor"}),c.jsx("circle",{cx:"9.6",cy:"6.4",r:"1",fill:"currentColor"}),c.jsx("circle",{cx:"13.2",cy:"7.2",r:"1",fill:"currentColor"})]});case"save":return c.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[c.jsx("path",{d:"M4 4.5h9l3 3V15.5a1.5 1.5 0 0 1-1.5 1.5h-9A1.5 1.5 0 0 1 4 15.5v-11Z",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),c.jsx("path",{d:"M7 4.5v4h5v-4M7 15h6",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]});case"json":return c.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[c.jsx("path",{d:"M8 4.5c-1.7 0-2.7 1.2-2.7 3v1.2c0 .9-.4 1.6-1.3 1.9.9.3 1.3 1 1.3 1.9v1.2c0 1.8 1 3 2.7 3",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),c.jsx("path",{d:"M12 4.5c1.7 0 2.7 1.2 2.7 3v1.2c0 .9.4 1.6 1.3 1.9-.9.3-1.3 1-1.3 1.9v1.2c0 1.8-1 3-2.7 3",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),c.jsx("circle",{cx:"10",cy:"10",r:"1",fill:"currentColor"})]});case"html":return c.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:c.jsx("path",{d:"m7.5 6.5-3 3.5 3 3.5M12.5 6.5l3 3.5-3 3.5M11.2 5 8.8 15",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})});case"duplicate":return c.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[c.jsx("rect",{x:"6",y:"6",width:"9",height:"9",rx:"1.5",fill:"none",stroke:"currentColor",strokeWidth:"1.6"}),c.jsx("path",{d:"M4.5 12V5.5A1.5 1.5 0 0 1 6 4h6.5",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]});case"delete":return c.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:c.jsx("path",{d:"M5.5 6.5h9M8 6.5V5h4v1.5M7 8.5v6m3-6v6m3-6v6M6.5 6.5l.6 9.2A1.5 1.5 0 0 0 8.6 17h2.8a1.5 1.5 0 0 0 1.5-1.3l.6-9.2",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})});case"drag":return c.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[c.jsx("circle",{cx:"7",cy:"6.5",r:"1",fill:"currentColor"}),c.jsx("circle",{cx:"13",cy:"6.5",r:"1",fill:"currentColor"}),c.jsx("circle",{cx:"7",cy:"10",r:"1",fill:"currentColor"}),c.jsx("circle",{cx:"13",cy:"10",r:"1",fill:"currentColor"}),c.jsx("circle",{cx:"7",cy:"13.5",r:"1",fill:"currentColor"}),c.jsx("circle",{cx:"13",cy:"13.5",r:"1",fill:"currentColor"})]});case"up":return c.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:c.jsx("path",{d:"m6 11 4-4 4 4",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})});case"down":return c.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:c.jsx("path",{d:"m6 9 4 4 4-4",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})});case"columns":return c.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[c.jsx("rect",{x:"3.5",y:"5",width:"4",height:"10",rx:"1",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}),c.jsx("rect",{x:"8",y:"5",width:"4",height:"10",rx:"1",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}),c.jsx("rect",{x:"12.5",y:"5",width:"4",height:"10",rx:"1",fill:"none",stroke:"currentColor",strokeWidth:"1.5"})]});case"align-left":return c.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:c.jsx("path",{d:"M4 5.5h10M4 9h7M4 12.5h10M4 16h6",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})});case"align-center":return c.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:c.jsx("path",{d:"M5 5.5h10M6.5 9h7M5 12.5h10M7 16h6",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})});case"align-right":return c.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:c.jsx("path",{d:"M6 5.5h10M9 9h7M6 12.5h10M10 16h6",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})});case"align-justify":return c.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:c.jsx("path",{d:"M4 5.5h12M4 9h12M4 12.5h12M4 16h12",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})});case"section-image":return c.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[c.jsx("rect",{x:"3.5",y:"4.5",width:"13",height:"11",rx:"2",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}),c.jsx("circle",{cx:"8",cy:"8",r:"1.3",fill:"currentColor"}),c.jsx("path",{d:"m5.5 13 3-3 2.5 2.5 2-1.8 1.5 2.3",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]});case"section-action":return c.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[c.jsx("path",{d:"M6 4.5 14.5 10 6 15.5V4.5Z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),c.jsx("path",{d:"m11.5 11 2.5 4",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]});case"section-general":return c.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[c.jsx("circle",{cx:"10",cy:"10",r:"2.2",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}),c.jsx("path",{d:"M10 4.5v1.4M10 14.1v1.4M15.5 10h-1.4M5.9 10H4.5M13.9 6.1l-1 1M7.1 12.9l-1 1M13.9 13.9l-1-1M7.1 7.1l-1-1",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]});case"section-responsive":return c.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[c.jsx("rect",{x:"2.8",y:"4.5",width:"8.7",height:"6.5",rx:"1.2",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}),c.jsx("path",{d:"M6.2 13h1.9M5.5 11.8h3.3",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),c.jsx("rect",{x:"13.3",y:"5",width:"3.9",height:"9.8",rx:"1.1",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}),c.jsx("circle",{cx:"15.25",cy:"13.1",r:"0.45",fill:"currentColor"})]});case"chevron-up":return c.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:c.jsx("path",{d:"m6 12 4-4 4 4",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})});case"chevron-down":return c.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:c.jsx("path",{d:"m6 8 4 4 4-4",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})});case"collapse":return c.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:c.jsx("path",{d:"m12 5-5 5 5 5",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})});case"expand":return c.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:c.jsx("path",{d:"m8 5 5 5-5 5",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})});case"download":return c.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[c.jsx("path",{d:"M10 3v9m0 0 3.2-3.2M10 12 6.8 8.8",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"}),c.jsx("path",{d:"M4 14.5v1A1.5 1.5 0 0 0 5.5 17h9a1.5 1.5 0 0 0 1.5-1.5v-1",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]});case"sparkles":return c.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[c.jsx("path",{d:"M10 3.2 11.3 7l3.8 1.3-3.8 1.3L10 13.4 8.7 9.6 4.9 8.3 8.7 7 10 3.2Z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),c.jsx("path",{d:"M15.5 12.5 16 14l1.5.5-1.5.5-.5 1.5-.5-1.5L13.5 14l1.5-.5.5-1.5Z",fill:"currentColor"})]});default:return null}},Ss=e=>{switch(e){case"heading":return"H";case"text":return"A";case"image":return"▣";case"button":return"▭";case"divider":return"─";case"spacer":return"↕";case"social":return"○";case"video":return"▶";case"html":return"</>";case"menu":return"≡";case"form":return"▤";case"timer":return"◷";case"gif":return"GIF";case"table":return"▥";case"carousel":return"⧉";case"layout":return"▦";case"content":return"◈";case"blocks":return"◌";case"body":return"▢";case"history":return"↺";default:return e||"□"}},Wn=({icon:e,label:t,active:n,disabled:r,badge:i,badgeTone:s="error",onClick:o})=>c.jsxs("button",{type:"button",className:`edm-toolbar-icon${n?" is-active":""}`,"aria-label":t,"data-tooltip":t,disabled:r,onClick:o,children:[Yi(e),i?c.jsx("span",{className:`edm-toolbar-badge edm-toolbar-badge--${s}`,"aria-hidden":"true",children:i}):null]}),ch=({label:e,icon:t,onClick:n})=>c.jsx("button",{type:"button",className:"edm-toolbar-icon edm-toolbar-icon--custom","aria-label":e,"data-tooltip":e,onClick:()=>void n(),children:t??c.jsx("span",{className:"edm-toolbar-custom-label",children:e.slice(0,2).toUpperCase()})}),Dt=({icon:e,label:t,disabled:n,onClick:r,dragHandleProps:i})=>c.jsx("button",{type:"button",className:`edm-action-icon${i?" edm-action-icon--drag":""}`,"aria-label":t,"data-tooltip":t,disabled:n,onClick:s=>{s.stopPropagation(),r==null||r()},...i??{},children:Yi(e)}),me=({title:e,icon:t,open:n,onToggle:r,children:i})=>c.jsxs("div",{className:`edm-inspector-section${n?"":" is-collapsed"}`,children:[c.jsxs("button",{type:"button",className:"edm-inspector-section-header","aria-expanded":n,onClick:r,children:[c.jsxs("span",{className:"edm-inspector-section-heading",children:[c.jsx("span",{className:"edm-inspector-section-icon","aria-hidden":"true",children:Yi(t)}),c.jsx("span",{children:e})]}),c.jsx("span",{className:"edm-inspector-section-chevron","aria-hidden":"true",children:Yi(n?"chevron-up":"chevron-down")})]}),n&&c.jsx("div",{className:"edm-inspector-section-body",children:i})]}),gs=({disabled:e,children:t})=>c.jsx("fieldset",{className:`edm-inspector-fieldset${e?" is-disabled":""}`,disabled:e,children:t}),Dj=({mergeTags:e,previewContexts:t,activePreviewContextId:n,availableMergeTagKeys:r,onSelectPreviewContext:i,onCreatePreviewContext:s,onDeletePreviewContext:o,onUpdatePreviewValue:a,onAddMergeTag:l,onUpdateMergeTag:d,onRemoveMergeTag:u})=>{const h=t.find(m=>m.id===n)??t[0]??null,p=r.filter(m=>!e[m]);return c.jsxs("div",{className:"edm-inspector-fields",children:[c.jsxs(me,{title:"Preview Data",icon:"preview",open:!0,onToggle:()=>{},children:[c.jsxs("div",{className:"edm-inline-field-actions",children:[c.jsx("label",{children:"Active Context"}),c.jsxs("div",{className:"edm-inline-actions",children:[c.jsx(Dt,{icon:"duplicate",label:"Save current context",onClick:s}),c.jsx(Dt,{icon:"delete",label:"Delete current context",onClick:()=>h&&o(h.id),disabled:t.length<=1||!h})]})]}),c.jsx("div",{children:c.jsx("select",{value:n,onChange:m=>i(m.target.value),children:t.map(m=>c.jsx("option",{value:m.id,children:m.name},m.id))})}),Object.entries(e).length===0?c.jsxs("div",{className:"edm-empty-state",children:[c.jsx("h3",{children:"No merge tags yet"}),c.jsx("p",{children:"Add a merge tag below to start testing dynamic sample data."})]}):c.jsx("div",{className:"edm-data-grid",children:Object.entries(e).map(([m,g])=>c.jsxs("div",{className:"edm-data-card",children:[c.jsxs("div",{className:"edm-data-card-top",children:[c.jsx("strong",{children:g.label}),c.jsx("small",{children:Cs(m)})]}),c.jsx("input",{value:(h==null?void 0:h.values[m])??g.sample??"",placeholder:"Sample value",onChange:b=>a(m,b.target.value)})]},m))})]}),c.jsxs(me,{title:"Merge Tags",icon:"section-action",open:!0,onToggle:()=>{},children:[c.jsxs("div",{className:"edm-inline-field-actions",children:[c.jsx("label",{children:"Defined Tags"}),c.jsx("button",{type:"button",className:"edm-secondary-button",onClick:l,children:"Add Tag"})]}),Object.keys(e).length===0?c.jsxs("div",{className:"edm-empty-state",children:[c.jsx("h3",{children:"No merge tags configured"}),c.jsx("p",{children:"Create tags for names, order data, account fields, or anything your app resolves later."})]}):c.jsx("div",{className:"edm-data-grid",children:Object.entries(e).map(([m,g])=>c.jsxs("div",{className:"edm-data-card",children:[c.jsxs("div",{className:"edm-data-card-top",children:[c.jsx("strong",{children:Cs(m)}),c.jsx(Dt,{icon:"delete",label:`Remove ${m}`,onClick:()=>u(m)})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Label"}),c.jsx("input",{value:g.label,onChange:b=>d(m,{label:b.target.value})})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Default Sample"}),c.jsx("input",{value:g.sample??"",onChange:b=>d(m,{sample:b.target.value})})]})]},m))}),p.length>0?c.jsxs("div",{className:"edm-helper-note",children:["Design is already referencing: ",p.map(m=>Cs(m)).join(", ")]}):null]})]})},j1="edm-global-blocks",B1=(e,t)=>({...e,body:{...e.body,rows:e.body.rows.map(n=>({...n,columns:n.columns.map(r=>({...r,blocks:r.blocks.map(t)}))}))}}),Mj=e=>{const t=new Set;for(const n of e.body.rows)for(const r of n.columns)for(const i of r.blocks)i.global_block_id&&t.add(i.global_block_id);return[...t]},Oj=(e,t,n)=>B1(e,r=>r.global_block_id===t?{...structuredClone(n),id:r.id,global_block_id:t}:r),Rj=(e,t)=>B1(e,n=>n.id===t?{...n,global_block_id:void 0}:n),qb=(e,t)=>{const n=Mj(e),r=new Map(e.global_blocks.map(i=>[i.id,i.synced_at]));return{...e,global_blocks:n.map(i=>({id:i,synced_at:r.get(i)??t}))}},Lj=()=>{if(typeof window>"u")return[];try{const e=window.localStorage.getItem(j1);return e?JSON.parse(e):[]}catch{return[]}},Jb=e=>{typeof window>"u"||window.localStorage.setItem(j1,JSON.stringify(e))},P1="edm-comments",jj=(e,t,n,r,i)=>({id:e,blockId:t,author:n,text:r,createdAt:i,resolved:!1,replies:[]}),Bj=(e,t,n)=>e.map(r=>r.id===t?{...r,replies:[...r.replies,n]}:r),Pj=(e,t,n)=>e.map(r=>r.id===t?{...r,resolved:n}:r),Fj=(e,t)=>e.filter(n=>n.id!==t),$j=(e,t)=>e.filter(n=>n.blockId!==t),Hj=(e,t)=>e.filter(n=>n.blockId===t),Uj=(e,t)=>e.filter(n=>!n.resolved&&(t===void 0||n.blockId===t)).length,Gj=()=>{if(typeof window>"u")return[];try{const e=window.localStorage.getItem(P1);return e?JSON.parse(e):[]}catch{return[]}},ra=e=>{typeof window>"u"||window.localStorage.setItem(P1,JSON.stringify(e))},Mp=50,F1=30,dh=hl(),Fr=e=>`${e}-${Math.random().toString(36).slice(2,10)}`,Sa=e=>structuredClone(e),Zb=e=>JSON.stringify(e),xi=e=>{var t,n;return((n=(t=e.body.rows[0])==null?void 0:t.columns[0])==null?void 0:n.id)??null},Xb=e=>{const t=Number((100/e.columns.length).toFixed(2)),n=t*e.columns.length,r=Number((100-n).toFixed(2));return{...e,columns:e.columns.map((i,s)=>({...i,width:s===e.columns.length-1?Number((t+r).toFixed(2)):t}))}},pc=e=>({...structuredClone(e),id:Fr(e.type)}),uh=(e,t)=>{const n=Yt(e);return{...n,values:{...n.values,...t??{}}}},ua=()=>({background_color:"#ffffff",padding:12,border_style:"none",border_width:0,border_color:"#d9dce5"}),Wj=e=>({...structuredClone(e),id:Fr("row"),columns:e.columns.map(t=>({...structuredClone(t),id:Fr("column"),settings:t.settings??ua(),blocks:t.blocks.map(n=>pc(n))}))}),Yj={single:[100],halves:[50,50],"feature-left":[66,34],"feature-right":[34,66],triple:[33.33,33.33,33.34]},zj=e=>{const t=e.map(o=>Math.max(1,Number(o)||0)),n=t.reduce((o,a)=>o+a,0);if(n<=0)return t;const r=t.map(o=>Number((o/n*100).toFixed(2))),i=r.reduce((o,a)=>o+a,0),s=Number((100-i).toFixed(2));return r.map((o,a)=>a===r.length-1?Number((o+s).toFixed(2)):o)},mc=(e,t,n)=>({id:Fr("snapshot"),label:t,createdAt:new Date().toISOString(),kind:n,design:Sa(e)}),Kj=e=>e.slice(0,F1),er=(e,t)=>{for(const n of e.body.rows)for(const r of n.columns){const i=r.blocks.findIndex(s=>s.id===t);if(i!==-1)return{row:n,column:r,blockIndex:i}}return null},us=(e,t)=>e.body.rows.find(n=>n.id===t)??null,zl=(e,t)=>{for(const n of e.body.rows){const r=n.columns.find(i=>i.id===t);if(r)return r}return null},e0=(e,t)=>{for(const n of e.body.rows)if(n.columns.some(r=>r.id===t))return n;return null},xr=e=>!!(e!=null&&e.settings.layout_locked),$1=e=>!!(e!=null&&e.locked),Qj=e=>!!(e!=null&&e.locked||e!=null&&e.content_locked),Vj=e=>!!(e!=null&&e.locked||e!=null&&e.style_locked),qj=e=>!!(e!=null&&e.locked||e!=null&&e.delete_locked),t0=e=>!!(e!=null&&e.locked||e!=null&&e.move_locked),Jj=new Set(["text","html","src","alt","href","url","thumbnail","title","label","items","headline","button_label","field_placeholder","end_date","action_type","target"]),Zj=new Set(["tag","font_family","font_weight","font_size","color","align","line_height","letter_spacing","inherit_link_styles","container_padding","background_color","content_background_color","background_image","padding","padding_top","padding_right","padding_bottom","padding_left","border_style","border_width","border_color","border_radius","width","height","auto_width","spacing","icon_type","icon_color","icon_size","button_color","button_text_color","thickness","style"]),Xj=(e,t)=>{if($1(e))return{};const n=Object.entries(t).filter(([r])=>!(Jj.has(r)&&Qj(e)||Zj.has(r)&&Vj(e)));return Object.fromEntries(n)},fn=(e,t)=>({...e,body:{...e.body,rows:e.body.rows.map(n=>({...n,columns:n.columns.map(r=>t(n,r))}))}}),Xe=(e,t,n={})=>({design:t,selectedBlockId:n.selectedBlockId===void 0?e.selectedBlockId:n.selectedBlockId,selectedColumnId:n.selectedColumnId===void 0?e.selectedColumnId:n.selectedColumnId,historyPast:[...e.historyPast,Sa(e.design)].slice(-Mp),historyFuture:[],snapshots:e.snapshots,canUndo:!0,canRedo:!1,lastEditKey:null}),eB=(e,t,n)=>{const r=e.snapshots[0];return r&&Zb(r.design)===Zb(e.design)?e:{...e,snapshots:Kj([mc(e.design,t,n),...e.snapshots])}},be=kj((e,t)=>({design:dh,selectedBlockId:null,selectedColumnId:xi(dh),historyPast:[],historyFuture:[],snapshots:[mc(dh,"Initial canvas","manual")],global_blocks:Lj(),comments:Gj(),heatmap:{},canUndo:!1,canRedo:!1,lastEditKey:null,openLibraryForBlockId:null,tableSelection:null,clipboardBlock:null,customExporters:{},setTableSelection:n=>e({tableSelection:n}),setCustomExporters:n=>e({customExporters:n}),setDesign:n=>e(r=>r.design===n?r:{design:n,selectedColumnId:xi(n),selectedBlockId:null,historyPast:[],historyFuture:[],snapshots:[mc(n,"Loaded design","manual"),...r.snapshots].slice(0,F1),canUndo:!1,canRedo:!1}),selectBlock:(n,r)=>e(i=>{var s;return{selectedBlockId:n,tableSelection:i.tableSelection&&i.tableSelection.blockId===n?i.tableSelection:null,selectedColumnId:r??(n?(s=er(i.design,n))==null?void 0:s.column.id:i.selectedColumnId)??null}}),requestAssetLibrary:n=>e(r=>{var i;return{selectedBlockId:n,selectedColumnId:((i=er(r.design,n))==null?void 0:i.column.id)??r.selectedColumnId,openLibraryForBlockId:n}}),clearAssetLibraryRequest:()=>e({openLibraryForBlockId:null}),selectColumn:n=>e({selectedColumnId:n,selectedBlockId:null}),addRow:n=>e(r=>{var i;const s=Mt(n),o={...r.design,body:{...r.design.body,rows:[...r.design.body.rows,s]}};return Xe(r,o,{selectedColumnId:((i=s.columns[0])==null?void 0:i.id)??r.selectedColumnId,selectedBlockId:null})}),addRowAtIndex:(n,r)=>e(i=>{var s;const o=Mt(n),a=[...i.design.body.rows],l=Math.max(0,Math.min(r,a.length));a.splice(l,0,o);const d={...i.design,body:{...i.design.body,rows:a}};return Xe(i,d,{selectedColumnId:((s=o.columns[0])==null?void 0:s.id)??i.selectedColumnId,selectedBlockId:null})}),duplicateRow:n=>e(r=>{var i;const s=r.design.body.rows.findIndex(l=>l.id===n);if(s===-1||xr(r.design.body.rows[s]))return r;const o=Wj(r.design.body.rows[s]),a=[...r.design.body.rows];return a.splice(s+1,0,o),Xe(r,{...r.design,body:{...r.design.body,rows:a}},{selectedColumnId:((i=o.columns[0])==null?void 0:i.id)??r.selectedColumnId,selectedBlockId:null})}),moveRow:(n,r)=>e(i=>{const s=i.design.body.rows.findIndex(d=>d.id===n),o=r==="up"?s-1:s+1;if(s===-1||xr(i.design.body.rows[s])||o<0||o>=i.design.body.rows.length||xr(i.design.body.rows[o]))return i;const a=[...i.design.body.rows],[l]=a.splice(s,1);return a.splice(o,0,l),Xe(i,{...i.design,body:{...i.design.body,rows:a}})}),reorderRows:(n,r)=>e(i=>{if(n===r)return i;const s=[...i.design.body.rows],o=s.findIndex(d=>d.id===n),a=s.findIndex(d=>d.id===r);if(o===-1||a===-1||xr(s[o])||xr(s[a]))return i;const[l]=s.splice(o,1);return s.splice(a,0,l),Xe(i,{...i.design,body:{...i.design.body,rows:s}})}),removeRow:n=>e(r=>{const i=us(r.design,n);if(xr(i))return r;const s=r.design.body.rows.filter(o=>o.id!==n);return s.length===r.design.body.rows.length?r:Xe(r,{...r.design,body:{...r.design.body,rows:s}},{selectedColumnId:xi({...r.design,body:{...r.design.body,rows:s}}),selectedBlockId:null})}),addColumn:n=>e(r=>{var i;const s=us(r.design,n);if(!s||s.columns.length>=4||xr(s))return r;const o={...r.design,body:{...r.design.body,rows:r.design.body.rows.map(l=>l.id===n?Xb({...l,columns:[...l.columns,{id:Fr("column"),width:100,blocks:[],settings:ua()}]}):l)}},a=us(o,n);return Xe(r,o,{selectedColumnId:(a&&((i=a.columns[a.columns.length-1])==null?void 0:i.id))??r.selectedColumnId,selectedBlockId:null})}),removeColumn:n=>e(r=>{var i;const s=e0(r.design,n);if(!s||s.columns.length<=1||xr(s))return r;const o=s.columns.findIndex(h=>h.id===n),a=s.columns[o];if(!a)return r;const l=o===0?0:o-1,d={...r.design,body:{...r.design.body,rows:r.design.body.rows.map(h=>{if(h.id!==s.id)return h;const p=h.columns.filter(m=>m.id!==n).map((m,g)=>g===l?{...m,blocks:[...a.blocks,...m.blocks]}:m);return Xb({...h,columns:p})})}},u=us(d,s.id);return Xe(r,d,{selectedColumnId:((i=u==null?void 0:u.columns[Math.min(l,u.columns.length-1)])==null?void 0:i.id)??r.selectedColumnId,selectedBlockId:null})}),setRowLayout:(n,r)=>e(i=>{var s;const o=us(i.design,n);if(!o||xr(o))return i;const a=Yj[r]??[100],l=o.columns.map(h=>({...h,settings:h.settings??ua()})),d=a.map((h,p)=>{const m=l[p];return m?{...m,width:h}:{id:Fr("column"),width:h,blocks:[],settings:ua()}});if(l.length>a.length){const h=l.slice(a.length).flatMap(p=>p.blocks);h.length>0&&(d[d.length-1]={...d[d.length-1],blocks:[...d[d.length-1].blocks,...h]})}const u={...i.design,body:{...i.design.body,rows:i.design.body.rows.map(h=>h.id===n?{...h,columns:d}:h)}};return Xe(i,u,{selectedColumnId:((s=d[0])==null?void 0:s.id)??i.selectedColumnId,selectedBlockId:null})}),setRowColumnWidths:(n,r)=>e(i=>{const s=us(i.design,n);if(!s||s.columns.length!==r.length||xr(s))return i;const o=zj(r),a={...i.design,body:{...i.design.body,rows:i.design.body.rows.map(l=>l.id===n?{...l,columns:l.columns.map((d,u)=>({...d,width:o[u]??d.width}))}:l)}};return Xe(i,a)}),updateRowSettings:(n,r)=>e(i=>Xe(i,{...i.design,body:{...i.design.body,rows:i.design.body.rows.map(s=>s.id===n?{...s,settings:{...s.settings,...r}}:s)}})),updateColumnSettings:(n,r)=>e(i=>{const s=e0(i.design,n);return xr(s)?i:Xe(i,fn(i.design,(o,a)=>a.id===n?{...a,settings:{...a.settings??ua(),...r}}:a))}),addBlock:(n,r,i)=>e(s=>{var o;const a=r??s.selectedColumnId??xi(s.design),l=uh(n,i);if(!a){const u=Mt("single",{initialBlocks:[[l]]}),h={...s.design,body:{...s.design.body,rows:[...s.design.body.rows,u]}};return Xe(s,h,{selectedColumnId:((o=u.columns[0])==null?void 0:o.id)??null,selectedBlockId:l.id})}const d=fn(s.design,(u,h)=>h.id===a?{...h,blocks:[...h.blocks,l]}:h);return Xe(s,d,{selectedColumnId:a,selectedBlockId:l.id})}),addBlockAtIndex:(n,r,i,s)=>e(o=>{if(!zl(o.design,r))return o;const a=uh(n,s),l=fn(o.design,(d,u)=>{if(u.id!==r)return u;const h=[...u.blocks],p=Math.max(0,Math.min(i,h.length));return h.splice(p,0,a),{...u,blocks:h}});return Xe(o,l,{selectedColumnId:r,selectedBlockId:a.id})}),addBlockAsRow:(n,r)=>e(i=>{var s;const o=uh(n,r),a=Mt("single",{initialBlocks:[[o]]}),l={...i.design,body:{...i.design.body,rows:[...i.design.body.rows,a]}};return Xe(i,l,{selectedColumnId:((s=a.columns[0])==null?void 0:s.id)??null,selectedBlockId:o.id})}),updateBody:n=>e(r=>Xe(r,{...r.design,body:{...r.design.body,...n}})),updateDesignTokens:n=>e(r=>{const i={};for(const[s,o]of Object.entries({...r.design.design_tokens,...n}))typeof o=="string"&&(i[s]=o);return Xe(r,{...r.design,design_tokens:i})}),updateBlock:(n,r)=>e(i=>{const s=er(i.design,n);if(!s)return i;const o=Xj(s.column.blocks[s.blockIndex],r);if(Object.keys(o).length===0)return i;const a=fn(i.design,(d,u)=>({...u,blocks:u.blocks.map(h=>h.id===n?{...h,values:{...h.values,...o}}:h)})),l=Object.keys(o).every(d=>d==="text"||d==="html")?`text:${n}`:null;return l&&i.lastEditKey===l?{...i,design:a,historyFuture:[],canRedo:!1}:{...Xe(i,a),lastEditKey:l}}),updateBlockMeta:(n,r)=>e(i=>Xe(i,fn(i.design,(s,o)=>({...o,blocks:o.blocks.map(a=>a.id===n?{...a,...r}:a)})))),duplicateBlock:n=>e(r=>{const i=er(r.design,n);if(!i||$1(i.column.blocks[i.blockIndex]))return r;const s=pc(i.column.blocks[i.blockIndex]),o=fn(r.design,(a,l)=>{if(l.id!==i.column.id)return l;const d=[...l.blocks];return d.splice(i.blockIndex+1,0,s),{...l,blocks:d}});return Xe(r,o,{selectedBlockId:s.id,selectedColumnId:i.column.id})}),copyBlock:n=>e(r=>{const i=er(r.design,n);return i?{clipboardBlock:pc(i.column.blocks[i.blockIndex])}:r}),cutBlock:n=>{t().copyBlock(n),t().removeBlock(n)},pasteBlock:(n,r)=>e(i=>{const s=i.clipboardBlock;if(!s)return i;const o=n??i.selectedColumnId;if(!o)return i;const a=pc(s),l=fn(i.design,(d,u)=>{if(u.id!==o)return u;const h=[...u.blocks],p=r?h.findIndex(g=>g.id===r):-1,m=p>=0?p+1:h.length;return h.splice(m,0,a),{...u,blocks:h}});return Xe(i,l,{selectedBlockId:a.id,selectedColumnId:o})}),moveBlockDirection:(n,r)=>e(i=>{const s=er(i.design,n);if(!s)return i;const{column:o,blockIndex:a}=s,l=r==="up"?a-1:a+1;if(l<0||l>=o.blocks.length)return i;const d=fn(i.design,(u,h)=>{if(h.id!==o.id)return h;const p=[...h.blocks],[m]=p.splice(a,1);return p.splice(l,0,m),{...h,blocks:p}});return Xe(i,d,{selectedBlockId:n,selectedColumnId:o.id})}),removeBlock:n=>e(r=>{var i;const s=er(r.design,n);if(!s||qj(s.column.blocks[s.blockIndex]))return r;const o=fn(r.design,(u,h)=>h.id===s.column.id?{...h,blocks:h.blocks.filter(p=>p.id!==n)}:h),a=us(o,s.row.id),l=o.body.rows.length===1&&(a==null?void 0:a.columns.length)===1&&((i=a.columns[0])==null?void 0:i.blocks.length)===0?{...o,body:{...o.body,rows:[]}}:o,d=$j(r.comments,n);return d.length!==r.comments.length&&ra(d),{...Xe(r,l,{selectedBlockId:null,selectedColumnId:xi(l)}),comments:d}}),moveBlock:(n,r,i,s="before")=>e(o=>{var a;const l=er(o.design,n);if(!l||r===n||t0(l.column.blocks[l.blockIndex]))return o;const d=i??(r?(a=er(o.design,r))==null?void 0:a.column.id:null)??l.column.id;if(!d||!zl(o.design,d))return o;const u=l.column.blocks[l.blockIndex];if(d===l.column.id){const m=[...l.column.blocks],g=m.findIndex(A=>A.id===n);if(g===-1)return o;const[b]=m.splice(g,1);if(!r)m.push(b);else{const A=m.findIndex(y=>y.id===r);A===-1?m.push(b):m.splice(A+(s==="after"?1:0),0,b)}return Xe(o,fn(o.design,(A,y)=>y.id===l.column.id?{...y,blocks:m}:y),{selectedBlockId:n,selectedColumnId:d})}let h=fn(o.design,(m,g)=>g.id===l.column.id?{...g,blocks:g.blocks.filter(b=>b.id!==n)}:g);const p=zl(h,d);return p?(h=fn(h,(m,g)=>{if(g.id!==d)return g;const b=[...g.blocks],A=r?p.blocks.findIndex(w=>w.id===r):p.blocks.length,y=A===-1?b.length:A+(s==="after"?1:0);return b.splice(y,0,u),{...g,blocks:b}}),Xe(o,h,{selectedBlockId:n,selectedColumnId:d})):o}),moveBlockToIndex:(n,r,i)=>e(s=>{const o=er(s.design,n),a=zl(s.design,r);if(!o||!a||t0(o.column.blocks[o.blockIndex]))return s;const l=o.column.blocks[o.blockIndex];if(o.column.id===r){const u=[...o.column.blocks],h=u.findIndex(g=>g.id===n);if(h===-1)return s;const[p]=u.splice(h,1),m=Math.max(0,Math.min(i-(h<i?1:0),u.length));return u.splice(m,0,p),Xe(s,fn(s.design,(g,b)=>b.id===r?{...b,blocks:u}:b),{selectedBlockId:n,selectedColumnId:r})}let d=fn(s.design,(u,h)=>h.id===o.column.id?{...h,blocks:h.blocks.filter(p=>p.id!==n)}:h);return d=fn(d,(u,h)=>{if(h.id!==r)return h;const p=[...h.blocks],m=Math.max(0,Math.min(i,p.length));return p.splice(m,0,l),{...h,blocks:p}}),Xe(s,d,{selectedBlockId:n,selectedColumnId:r})}),saveSnapshot:(n="Saved version",r="manual")=>e(i=>eB(i,n,r)),restoreSnapshot:n=>e(r=>{const i=r.snapshots.find(s=>s.id===n);return i?{...Xe(r,Sa(i.design),{selectedBlockId:null,selectedColumnId:xi(i.design)}),snapshots:r.snapshots}:r}),clearSnapshots:()=>e(n=>({...n,snapshots:[mc(n.design,"Current state","manual")]})),saveBlockAsGlobal:(n,r)=>e(i=>{const s=er(i.design,n);if(!s)return i;const o=s.column.blocks[s.blockIndex],a=Fr("global"),l=new Date().toISOString(),d=[{id:a,name:r.trim()||"Global block",block:{...structuredClone(o),id:a,global_block_id:a},updatedAt:l},...i.global_blocks];Jb(d);const u=fn(i.design,(h,p)=>({...p,blocks:p.blocks.map(m=>m.id===n?{...m,global_block_id:a}:m)}));return{...Xe(i,qb(u,l)),global_blocks:d}}),updateGlobalBlock:(n,r)=>e(i=>{const s=i.global_blocks.find(d=>d.id===n);if(!s)return i;const o={...s.block,values:{...s.block.values,...r}},a={...s,block:o,updatedAt:new Date().toISOString()},l=i.global_blocks.map(d=>d.id===n?a:d);return Jb(l),{...Xe(i,Oj(i.design,n,o)),global_blocks:l}}),detachGlobalBlock:n=>e(r=>Xe(r,qb(Rj(r.design,n),new Date().toISOString()))),addAbVariant:n=>e(r=>{var i;const{ab_variants:s,...o}=r.design,a={id:Fr("variant"),label:n.trim()||`Variant ${(((i=r.design.ab_variants)==null?void 0:i.length)??0)+1}`,weight:.5,design:structuredClone(o)};return Xe(r,{...r.design,ab_variants:[...r.design.ab_variants??[],a]})}),removeAbVariant:n=>e(r=>{const i=(r.design.ab_variants??[]).filter(s=>s.id!==n);return Xe(r,{...r.design,ab_variants:i.length>0?i:void 0})}),exportAbVariants:()=>PL(t().design,{fullDocument:!0}),addComment:(n,r,i)=>e(s=>{const o=jj(Fr("comment"),n,r,i,new Date().toISOString()),a=[...s.comments,o];return ra(a),{comments:a}}),addCommentReply:(n,r,i)=>e(s=>{const o=Bj(s.comments,n,{id:Fr("reply"),author:r,text:i,createdAt:new Date().toISOString()});return ra(o),{comments:o}}),resolveComment:(n,r)=>e(i=>{const s=Pj(i.comments,n,r);return ra(s),{comments:s}}),removeComment:n=>e(r=>{const i=Fj(r.comments,n);return ra(i),{comments:i}}),loadHeatmap:n=>e({heatmap:n}),undo:()=>e(n=>{if(n.historyPast.length===0)return n;const r=n.historyPast[n.historyPast.length-1],i=n.historyPast.slice(0,-1);return{...n,design:r,selectedBlockId:null,selectedColumnId:xi(r),historyPast:i,historyFuture:[Sa(n.design),...n.historyFuture].slice(0,Mp),canUndo:i.length>0,canRedo:!0,lastEditKey:null}}),redo:()=>e(n=>{if(n.historyFuture.length===0)return n;const[r,...i]=n.historyFuture;return{...n,design:r,selectedBlockId:null,selectedColumnId:xi(r),historyPast:[...n.historyPast,Sa(n.design)].slice(-Mp),historyFuture:i,canUndo:!0,canRedo:i.length>0,lastEditKey:null}}),exportHtml:()=>Qn(t().design,{fullDocument:!0,tools:t().customExporters}),exportMjml:()=>Zm(t().design)})),tB=(e,t)=>{var n;return t?((n=er(e,t))==null?void 0:n.column.blocks.find(r=>r.id===t))??null:null},Kt=({value:e,onChange:t,mergeTags:n,placeholder:r,ariaLabel:i,type:s="text",disabled:o=!1})=>{const[a,l]=v.useState(!1),d=Object.entries(n??{});return c.jsxs("div",{className:"edm-merge-input",children:[c.jsx("input",{type:s,value:e,placeholder:r,"aria-label":i,disabled:o,onChange:u=>t(u.target.value)}),d.length>0&&!o?c.jsxs("div",{className:"edm-merge-input-menu",children:[c.jsx("button",{type:"button",className:"edm-merge-input-trigger","aria-label":"Insert merge tag","aria-haspopup":"menu","aria-expanded":a,title:"Insert merge tag",onClick:()=>l(u=>!u),children:"{ }"}),a?c.jsx("ul",{className:"edm-merge-input-list",role:"menu",children:d.map(([u,h])=>c.jsx("li",{role:"none",children:c.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{t(`${e}${h.value}`),l(!1)},children:[h.label,c.jsx("span",{className:"edm-merge-input-token",children:h.value})]})},u))}):null]}):null]})},nB=({design:e,mergeTags:t,mergeTagDefinitions:n,aiAdapter:r,design_tokens:i,background_color:s,content_width:o,font_family:a,customFonts:l,text_color:d,content_align:u,font_weight:h,subject_line:p,preheader_text:m,link_color:g,link_underline:b,html_title:A,onChange:y,onChangeTokens:w,onApplyGeneratedDesign:C})=>{const[E,S]=v.useState(""),[k,I]=v.useState([]),[L,R]=v.useState(null),[B,O]=v.useState(null),[Y,Q]=v.useState(""),W=be(G=>G.addAbVariant),ie=be(G=>G.removeAbVariant),J=e.ab_variants??[];v.useEffect(()=>{I([]),O(null),R(null)},[e.id]);const H=async()=>{if(r)try{R("draft"),O(null);const G=await r.generateDesignFromPrompt({prompt:E.trim()||"Create a promotional email with a hero, social proof, and a strong CTA.",design:e,mergeTags:t});G.design&&C(G.design)}catch(G){O(G instanceof Error?G.message:"Unable to generate a draft.")}finally{R(null)}},te=async()=>{if(r)try{R("subject"),O(null);const G=await r.generateSubjectLines({prompt:E.trim()||p||m||e.title,design:e,count:5});I(G.subjects)}catch(G){O(G instanceof Error?G.message:"Unable to generate subject lines.")}finally{R(null)}};return c.jsxs("div",{className:"edm-inspector-fields",children:[c.jsxs(me,{title:"General",icon:"section-general",open:!0,onToggle:()=>{},children:[c.jsxs("div",{children:[c.jsx("label",{children:"Text Color"}),c.jsx("input",{type:"color",value:d,onChange:G=>y({text_color:G.target.value})})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Background Color"}),c.jsx("input",{type:"color",value:s,onChange:G=>y({background_color:G.target.value})})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Content Width"}),c.jsx("input",{type:"number",min:320,max:1200,value:o,onChange:G=>y({content_width:Number(G.target.value||680)})})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Content Alignment"}),c.jsx("div",{className:"edm-segmented edm-segmented--align",children:[{value:"left",label:"Left",icon:"align-left"},{value:"center",label:"Center",icon:"align-center"},{value:"right",label:"Right",icon:"align-right"}].map(G=>c.jsx("button",{type:"button",className:`edm-segmented-button${u===G.value?" is-active":""}`,"aria-label":G.label,"data-tooltip":G.label,onClick:()=>y({content_align:G.value}),children:Yi(G.icon)},G.value))})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Font Family"}),c.jsxs("select",{value:a,onChange:G=>y({font_family:G.target.value}),children:[c.jsx("option",{value:"Arial, sans-serif",children:"Arial"}),c.jsx("option",{value:"Helvetica, Arial, sans-serif",children:"Helvetica"}),c.jsx("option",{value:"Georgia, serif",children:"Georgia"}),c.jsx("option",{value:"Tahoma, sans-serif",children:"Tahoma"}),c.jsx("option",{value:"Verdana, sans-serif",children:"Verdana"}),c.jsx("option",{value:'"Inter Tight", "Avenir Next", sans-serif',children:"Inter Tight"}),(l??[]).map(G=>c.jsx("option",{value:G.value,children:G.label},G.value))]})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Font Weight"}),c.jsxs("select",{value:h,onChange:G=>y({font_weight:G.target.value}),children:[c.jsx("option",{value:"400",children:"Regular"}),c.jsx("option",{value:"500",children:"Medium"}),c.jsx("option",{value:"600",children:"Semibold"}),c.jsx("option",{value:"700",children:"Bold"})]})]})]}),c.jsxs(me,{title:"Design Tokens",icon:"section-general",open:!0,onToggle:()=>{},children:[c.jsxs("div",{className:"edm-token-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Primary"}),c.jsx("input",{type:"color",value:i.primary??"#14213d",onChange:G=>w({primary:G.target.value})})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Accent"}),c.jsx("input",{type:"color",value:i.accent??"#ef476f",onChange:G=>w({accent:G.target.value})})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Canvas Background"}),c.jsx("input",{type:"color",value:i.background??s,onChange:G=>w({background:G.target.value})})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Base Text"}),c.jsx("input",{type:"color",value:i.text??d,onChange:G=>w({text:G.target.value})})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Radius"}),c.jsx("input",{value:i.radius??"18px",onChange:G=>w({radius:G.target.value}),placeholder:"18px"})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Spacing"}),c.jsx("input",{value:i.spacing??"24px",onChange:G=>w({spacing:G.target.value}),placeholder:"24px"})]})]}),c.jsx("div",{className:"edm-helper-note",children:"Design tokens feed exported CSS variables and give host apps a consistent theme surface."})]}),c.jsxs(me,{title:"Email Settings",icon:"section-general",open:!0,onToggle:()=>{},children:[c.jsxs("div",{children:[c.jsx("label",{children:"Subject Line"}),c.jsx(Kt,{value:p,onChange:G=>y({subject_line:G}),mergeTags:n,ariaLabel:"Subject line"})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Preheader Text"}),c.jsx(Kt,{value:m,onChange:G=>y({preheader_text:G}),mergeTags:n,ariaLabel:"Preheader text"})]})]}),c.jsxs(me,{title:"A/B Variants",icon:"compare",open:!0,onToggle:()=>{},children:[c.jsxs("div",{className:"edm-inline-field-actions",children:[c.jsx("input",{value:Y,placeholder:"Variant name","aria-label":"Variant name",onChange:G=>Q(G.target.value)}),c.jsx("button",{type:"button",className:"edm-secondary-button",onClick:()=>{W(Y),Q("")},children:"Add Variant"})]}),J.length===0?c.jsx("div",{className:"edm-helper-note",children:"Add a variant to A/B test this email. Each variant is a full copy you can edit and export independently."}):c.jsx("div",{className:"edm-data-grid",children:J.map(G=>c.jsxs("div",{className:"edm-data-card",children:[c.jsxs("div",{className:"edm-data-card-top",children:[c.jsx("strong",{children:G.label}),c.jsx(Dt,{icon:"delete",label:`Remove ${G.label}`,onClick:()=>ie(G.id)})]}),c.jsxs("small",{children:[Math.round(G.weight*100),"% traffic"]})]},G.id))})]}),c.jsxs(me,{title:"Links",icon:"section-action",open:!0,onToggle:()=>{},children:[c.jsxs("div",{children:[c.jsx("label",{children:"Color"}),c.jsx("input",{type:"color",value:g,onChange:G=>y({link_color:G.target.value})})]}),c.jsxs("div",{className:"edm-toggle-row",children:[c.jsx("label",{children:"Underline"}),c.jsx("button",{type:"button",className:`edm-switch${b?" is-active":""}`,onClick:()=>y({link_underline:!b}),"aria-pressed":b,children:c.jsx("span",{})})]})]}),c.jsx(me,{title:"Accessibility",icon:"section-responsive",open:!0,onToggle:()=>{},children:c.jsxs("div",{children:[c.jsx("label",{children:"HTML Title"}),c.jsx("input",{value:A,onChange:G=>y({html_title:G.target.value})})]})}),r?c.jsxs(me,{title:"AI Studio",icon:"section-action",open:!0,onToggle:()=>{},children:[c.jsxs("div",{children:[c.jsx("label",{children:"Prompt"}),c.jsx("textarea",{rows:4,value:E,onChange:G=>S(G.target.value),placeholder:"Describe the email you want to generate or the campaign angle for subject lines."})]}),c.jsxs("div",{className:"edm-inline-actions",children:[c.jsx("button",{type:"button",className:"edm-secondary-button",onClick:()=>void H(),disabled:L==="draft",children:L==="draft"?"Generating...":"Generate Draft"}),c.jsx("button",{type:"button",className:"edm-secondary-button",onClick:()=>void te(),disabled:L==="subject",children:L==="subject"?"Generating...":"Generate Subject Lines"})]}),k.length>0?c.jsx("div",{className:"edm-inspector-list-stack",children:k.map((G,M)=>c.jsx("button",{type:"button",className:"edm-secondary-button edm-secondary-button--full",onClick:()=>y({subject_line:G}),children:G},`${G}-${M}`))}):null,B?c.jsx("div",{className:"edm-helper-note",children:B}):null]}):null]})},hh=[{id:"classic",name:"Classic",tokens:{primary:"#14213d",accent:"#ef476f",background:"#f5f1ea",text:"#1f2937",radius:"18px",spacing:"24px"},body:{font_family:'"Inter Tight", "Avenir Next", sans-serif',text_color:"#14213d",link_color:"#2563eb",background_color:"#f5f1ea"}},{id:"midnight",name:"Midnight",tokens:{primary:"#0b1120",accent:"#38bdf8",background:"#0f172a",text:"#e2e8f0",radius:"14px",spacing:"24px"},body:{font_family:"Helvetica, Arial, sans-serif",text_color:"#e2e8f0",link_color:"#38bdf8",background_color:"#0f172a"}},{id:"sunrise",name:"Sunrise",tokens:{primary:"#b45309",accent:"#f97316",background:"#fff7ed",text:"#431407",radius:"20px",spacing:"24px"},body:{font_family:"Georgia, serif",text_color:"#431407",link_color:"#c2410c",background_color:"#fff7ed"}},{id:"forest",name:"Forest",tokens:{primary:"#14532d",accent:"#22c55e",background:"#f0fdf4",text:"#052e16",radius:"12px",spacing:"24px"},body:{font_family:"Verdana, sans-serif",text_color:"#052e16",link_color:"#15803d",background_color:"#f0fdf4"}},{id:"mono",name:"Mono",tokens:{primary:"#111827",accent:"#6b7280",background:"#ffffff",text:"#111827",radius:"6px",spacing:"24px"},body:{font_family:"Arial, sans-serif",text_color:"#111827",link_color:"#111827",background_color:"#ffffff"}},{id:"candy",name:"Candy",tokens:{primary:"#6d28d9",accent:"#ec4899",background:"#faf5ff",text:"#3b0764",radius:"24px",spacing:"24px"},body:{font_family:"Tahoma, sans-serif",text_color:"#3b0764",link_color:"#7c3aed",background_color:"#faf5ff"}}],rB=e=>({tokens:{...e.tokens},body:{...e.body}}),H1=[{key:"primary",label:"Primary"},{key:"accent",label:"Accent"},{key:"background",label:"Background"},{key:"text",label:"Text"}],n0=new Set([...H1.map(e=>e.key),"radius","spacing"]),r0=[{value:"Arial, sans-serif",label:"Arial"},{value:"Helvetica, Arial, sans-serif",label:"Helvetica"},{value:"Georgia, serif",label:"Georgia"},{value:"Tahoma, sans-serif",label:"Tahoma"},{value:"Verdana, sans-serif",label:"Verdana"},{value:'"Inter Tight", "Avenir Next", sans-serif',label:"Inter Tight"}],i0=e=>e&&/^#([0-9a-f]{6})$/i.test(e)?e:"#000000",iB=({design:e,customFonts:t,onUpdateBody:n,onUpdateTokens:r,onApplyThemeToBlocks:i,onClose:s})=>{var o;const[a,l]=v.useState(!1),d=e.design_tokens??{},u=v.useMemo(()=>{const k=new Set(r0.map(I=>I.value));return[...r0,...(t??[]).filter(I=>!k.has(I.value))]},[t]),h=v.useMemo(()=>Object.entries(d).filter(([k])=>!n0.has(k)),[d]),[p,m]=v.useState(""),g=(k,I)=>r({[k]:I}),b={background:"background_color",text:"text_color",accent:"link_color"},A=(k,I)=>{r({[k]:I});const L=b[k];L&&n({[L]:I})},y=k=>r({[k]:void 0}),w=()=>{const k=p.trim().replace(/[^a-z0-9_]/gi,"_").toLowerCase();!k||n0.has(k)||k in d||(r({[k]:"#000000"}),m(""))},C=u.some(k=>k.value===e.body.font_family),E=k=>{const I=hh.find(B=>B.id===k);if(!I)return;const{tokens:L,body:R}=rB(I);r(L),n(R)},S=(o=hh.find(k=>k.tokens.primary===d.primary&&k.tokens.accent===d.accent&&k.body.background_color===e.body.background_color))==null?void 0:o.id;return c.jsxs("div",{className:"edm-theme-panel",onClick:k=>k.stopPropagation(),children:[c.jsxs("div",{className:"edm-asset-header",children:[c.jsxs("div",{children:[c.jsx("h3",{children:"Theme & custom CSS"}),c.jsx("p",{children:"Brand this email. Changes apply live to the design and its export."})]}),c.jsx("button",{type:"button",className:"edm-secondary-button",onClick:s,children:"Close"})]}),c.jsxs("div",{className:"edm-theme-body",children:[c.jsxs("section",{className:"edm-theme-section",children:[c.jsx("h4",{children:"Built-in themes"}),c.jsx("p",{className:"edm-theme-hint",children:"One-click palettes. Pick one, then fine-tune below."}),c.jsx("div",{className:"edm-theme-presets",children:hh.map(k=>c.jsxs("button",{type:"button",className:`edm-theme-preset${S===k.id?" is-active":""}`,"aria-label":`Apply ${k.name} theme`,"aria-pressed":S===k.id,onClick:()=>E(k.id),children:[c.jsxs("span",{className:"edm-theme-preset-swatch",style:{background:k.body.background_color},children:[c.jsx("span",{style:{background:k.tokens.primary}}),c.jsx("span",{style:{background:k.tokens.accent}}),c.jsx("span",{style:{background:k.tokens.text}})]}),c.jsx("span",{className:"edm-theme-preset-name",children:k.name})]},k.id))})]}),c.jsxs("section",{className:"edm-theme-section",children:[c.jsx("h4",{children:"Brand colors"}),c.jsx("div",{className:"edm-theme-grid",children:H1.map(({key:k,label:I})=>c.jsxs("div",{className:"edm-theme-field",children:[c.jsx("label",{children:I}),c.jsxs("div",{className:"edm-theme-color",children:[c.jsx("input",{type:"color","aria-label":`${I} color`,value:i0(d[k]),onChange:L=>A(k,L.target.value)}),c.jsx("input",{type:"text","aria-label":`${I} value`,value:d[k]??"",placeholder:"#000000",onChange:L=>A(k,L.target.value)})]})]},k))})]}),c.jsxs("section",{className:"edm-theme-section",children:[c.jsx("h4",{children:"Font & spacing"}),c.jsxs("div",{className:"edm-theme-grid",children:[c.jsxs("div",{className:"edm-theme-field",children:[c.jsx("label",{children:"Brand font"}),c.jsxs("select",{value:C?e.body.font_family:"",onChange:k=>n({font_family:k.target.value}),children:[!C&&c.jsx("option",{value:"",children:"Custom…"}),u.map(k=>c.jsx("option",{value:k.value,children:k.label},k.value))]})]}),c.jsxs("div",{className:"edm-theme-field",children:[c.jsx("label",{children:"Corner radius"}),c.jsx("input",{type:"text",value:d.radius??"",placeholder:"18px",onChange:k=>g("radius",k.target.value)})]}),c.jsxs("div",{className:"edm-theme-field",children:[c.jsx("label",{children:"Spacing"}),c.jsx("input",{type:"text",value:d.spacing??"",placeholder:"24px",onChange:k=>g("spacing",k.target.value)})]})]}),i?c.jsxs("div",{className:"edm-theme-apply",children:[c.jsx("button",{type:"button",className:"edm-theme-apply-button",onClick:()=>{i(),l(!0),window.setTimeout(()=>l(!1),1800)},children:a?"✓ Applied to all blocks":"Apply theme to all blocks"}),c.jsx("p",{className:"edm-theme-hint",children:"Snaps every text block's color and every block's spacing to the tokens above, so an existing template follows the brand in one click. You can still restyle any single block afterward, a per-block value always wins over the theme."})]}):null]}),c.jsxs("section",{className:"edm-theme-section",children:[c.jsx("h4",{children:"Custom tokens"}),c.jsxs("p",{className:"edm-theme-hint",children:["Named tokens you can reference anywhere a value accepts ",c.jsx("code",{children:"token.<name>"}),"."]}),h.length>0&&c.jsx("div",{className:"edm-theme-grid",children:h.map(([k,I])=>c.jsxs("div",{className:"edm-theme-field",children:[c.jsx("label",{children:k}),c.jsxs("div",{className:"edm-theme-color",children:[c.jsx("input",{type:"color","aria-label":`${k} color`,value:i0(I),onChange:L=>g(k,L.target.value)}),c.jsx("input",{type:"text","aria-label":`${k} value`,value:I,onChange:L=>g(k,L.target.value)}),c.jsx("button",{type:"button",className:"edm-theme-remove","aria-label":`Remove ${k}`,onClick:()=>y(k),children:"×"})]})]},k))}),c.jsxs("div",{className:"edm-theme-add",children:[c.jsx("input",{type:"text",value:p,placeholder:"token name",onChange:k=>m(k.target.value),onKeyDown:k=>{k.key==="Enter"&&(k.preventDefault(),w())}}),c.jsx("button",{type:"button",className:"edm-secondary-button",onClick:w,children:"Add token"})]})]}),c.jsxs("section",{className:"edm-theme-section",children:[c.jsx("h4",{children:"Custom CSS"}),c.jsxs("p",{className:"edm-theme-hint",children:["Injected into the email's ",c.jsx("code",{children:"<head>"}),", target the"," ",c.jsx("code",{children:".edm-*"})," classes. Applies to the preview and every export."]}),c.jsx("textarea",{className:"edm-theme-css",spellCheck:!1,value:e.body.custom_css??"",placeholder:".edm-button-link { text-transform: uppercase; }",onChange:k=>n({custom_css:k.target.value})})]})]})]})},sB=({label:e,icon:t,onClick:n,draggableId:r})=>{const i=vm({id:r??`static-${e}`,disabled:!r});return c.jsxs("button",{ref:i.setNodeRef,type:"button",className:"edm-tool-tile",onClick:n,...i.listeners,...i.attributes,children:[c.jsx("span",{className:"edm-tool-icon","aria-hidden":"true",children:Ss(t)}),c.jsx("span",{className:"edm-tool-label",children:e})]})},Op=({preset:e,onClick:t})=>{const{attributes:n,listeners:r,setNodeRef:i,isDragging:s}=vm({id:`palette-row:${e.id}`});return c.jsx("button",{ref:i,type:"button",className:`edm-layout-tile${s?" is-dragging":""}`,onClick:t,...n,...r,children:c.jsx("div",{className:"edm-layout-preview","aria-hidden":"true",children:e.widths.map((o,a)=>c.jsx("span",{style:{width:`${o}%`}},`${e.id}-${a}`))})})},oB=({row:e,selectedColumnId:t,onApplyLayout:n,onAddColumn:r,onRemoveColumn:i,onUpdateColumnSettings:s,onUpdateRowSettings:o,builderMode:a="email"})=>{var l;const[d,u]=v.useState(t??((l=e==null?void 0:e.columns[0])==null?void 0:l.id)??null),h=v.useRef(null);if(v.useEffect(()=>{var w;u(t??((w=e==null?void 0:e.columns[0])==null?void 0:w.id)??null)},[e==null?void 0:e.id,e==null?void 0:e.columns,t]),!e)return c.jsxs("div",{className:"edm-empty-state",children:[c.jsx("h3",{children:"No structure selected"}),c.jsx("p",{children:"Select a row or column on the canvas to edit layout and structure styling."})]});const p=e.columns.find(w=>w.id===d)??e.columns[0]??null,m=e.settings??{},g=(p==null?void 0:p.settings)??{},b=!!m.layout_locked,A=(w,C)=>c.jsx("button",{type:"button",className:`edm-switch${w?" is-active":""}`,onClick:C,"aria-pressed":w,children:c.jsx("span",{})}),y=async w=>{if(!w)return;const C=await new Promise((E,S)=>{const k=new FileReader;k.onload=()=>E(String(k.result??"")),k.onerror=()=>S(k.error),k.readAsDataURL(w)});o({background_image:C})};return c.jsxs("div",{className:"edm-inspector-fields",children:[c.jsxs(me,{title:"Section",icon:"section-general",open:!0,onToggle:()=>{},children:[c.jsxs("div",{children:[c.jsx("label",{children:"Section role"}),c.jsxs("select",{value:m.role??"",onChange:w=>o({role:w.target.value?w.target.value:void 0}),children:[c.jsx("option",{value:"",children:"Body (default)"}),c.jsx("option",{value:"header",children:"Header"}),c.jsx("option",{value:"footer",children:"Footer"})]})]}),c.jsx("div",{className:"edm-helper-note",children:"Header rows pin to the top and footer rows to the bottom of the email, in the preview, the export, and the canvas, no matter where they sit in the list."})]}),a==="page"?c.jsxs(me,{title:"Layout mode",icon:"section-responsive",open:!0,onToggle:()=>{},children:[c.jsxs("div",{children:[c.jsx("label",{children:"Section layout"}),c.jsxs("select",{value:m.layout_mode??"stack",onChange:w=>o({layout_mode:w.target.value==="free"?"free":"stack"}),children:[c.jsx("option",{value:"stack",children:"Stacked (normal flow)"}),c.jsx("option",{value:"free",children:"Freeform (drag anywhere)"})]})]}),m.layout_mode==="free"?c.jsxs("div",{children:[c.jsx("label",{children:"Canvas height (px)"}),c.jsx("input",{type:"number",min:0,value:m.min_height??320,onChange:w=>{const C=Number(w.target.value);o({min_height:Number.isFinite(C)?Math.max(0,C):0})}})]}):null,c.jsx("div",{className:"edm-helper-note",children:m.layout_mode==="free"?"Blocks in this section are positioned freely (X/Y/size in each block's Position panel). On mobile they stack back into normal order automatically.":"Freeform lets you place blocks anywhere on a canvas, ideal for landing pages. Email always stacks."})]}):null,c.jsxs(me,{title:"Protection",icon:"section-general",open:!0,onToggle:()=>{},children:[c.jsxs("div",{className:"edm-toggle-row",children:[c.jsx("label",{children:"Protect Layout"}),A(b,()=>o({layout_locked:!b}))]}),c.jsx("div",{className:"edm-helper-note",children:"Protected rows keep their structure intact: row move/delete, column add/remove, layout changes, and column resizing are disabled."})]}),c.jsx(me,{title:"Columns",icon:"columns",open:!0,onToggle:()=>{},children:c.jsx(gs,{disabled:b,children:c.jsx("div",{className:"edm-layout-grid",children:ms.map(w=>c.jsx(Op,{preset:w,onClick:()=>n(w.id)},w.id))})})}),c.jsxs(me,{title:"Column Properties",icon:"columns",open:!0,onToggle:()=>{},children:[c.jsxs("div",{className:"edm-structure-tabs",children:[c.jsx("div",{className:"edm-structure-tab-list",children:e.columns.map((w,C)=>c.jsxs("button",{type:"button",className:`edm-structure-tab${(p==null?void 0:p.id)===w.id?" is-active":""}`,onClick:()=>u(w.id),children:["Column ",C+1]},w.id))}),c.jsxs("div",{className:"edm-structure-actions",children:[c.jsx(Dt,{icon:"delete",label:"Delete column",onClick:()=>p&&i(p.id),disabled:e.columns.length<=1||!p||b}),c.jsx(Dt,{icon:"columns",label:"Add column",onClick:r,disabled:e.columns.length>=4||b})]})]}),p&&c.jsxs(gs,{disabled:b,children:[c.jsxs("div",{children:[c.jsx("label",{children:"Background Color"}),c.jsx("input",{type:"color",value:String(g.background_color??"#ffffff"),onChange:w=>s(p.id,{background_color:w.target.value})})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Padding"}),c.jsx("input",{type:"number",min:0,max:60,value:Number(g.padding??12),onChange:w=>s(p.id,{padding:Number(w.target.value||0)})})]}),c.jsxs("div",{className:"edm-grid-two",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Border Style"}),c.jsxs("select",{value:String(g.border_style??"none"),onChange:w=>s(p.id,{border_style:w.target.value}),children:[c.jsx("option",{value:"none",children:"None"}),c.jsx("option",{value:"solid",children:"Solid"}),c.jsx("option",{value:"dashed",children:"Dashed"}),c.jsx("option",{value:"dotted",children:"Dotted"})]})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Border Width"}),c.jsx("input",{type:"number",min:0,max:12,value:Number(g.border_width??0),onChange:w=>s(p.id,{border_width:Number(w.target.value||0)})})]})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Border Color"}),c.jsx("input",{type:"color",value:String(g.border_color??"#d9dce5"),onChange:w=>s(p.id,{border_color:w.target.value})})]})]})]}),c.jsxs(me,{title:"Row Properties",icon:"section-general",open:!0,onToggle:()=>{},children:[c.jsxs("div",{children:[c.jsx("label",{children:"Background Color"}),c.jsx("input",{type:"color",value:String(m.background_color??"#fffaf2"),onChange:w=>o({background_color:w.target.value})})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Content Background Color"}),c.jsx("input",{type:"color",value:String(m.content_background_color??"#ffffff"),onChange:w=>o({content_background_color:w.target.value})})]}),c.jsxs("div",{className:"edm-inline-field-actions",children:[c.jsx("label",{children:"Background Image"}),c.jsx("button",{type:"button",className:"edm-secondary-button",onClick:()=>{var w;return(w=h.current)==null?void 0:w.click()},children:"Upload Image"})]}),c.jsx("input",{ref:h,type:"file",accept:"image/*",hidden:!0,onChange:w=>{var C;y(((C=w.target.files)==null?void 0:C[0])??null),w.target.value=""}}),c.jsxs("div",{children:[c.jsx("label",{children:"Image URL"}),c.jsx("input",{value:String(m.background_image??""),placeholder:"https://",onChange:w=>o({background_image:w.target.value})})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Padding"}),c.jsx("input",{value:String(m.padding??"32px"),onChange:w=>o({padding:w.target.value})})]})]}),c.jsxs(me,{title:"Responsive Design",icon:"section-responsive",open:!0,onToggle:()=>{},children:[c.jsxs("div",{className:"edm-toggle-row",children:[c.jsx("label",{children:"Hide on Desktop"}),A(!!m.hide_desktop,()=>o({hide_desktop:!m.hide_desktop}))]}),c.jsxs("div",{className:"edm-toggle-row",children:[c.jsx("label",{children:"Hide on Mobile"}),A(!!m.hide_mobile,()=>o({hide_mobile:!m.hide_mobile}))]})]})]})},Xm=v.createContext({}),aB=async e=>new Promise((t,n)=>{const r=new FileReader;r.onload=()=>t(String(r.result??"")),r.onerror=()=>n(r.error),r.readAsDataURL(e)}),lB=e=>e.replace(/\.[^.]+$/,""),Rp=async(e,t,n,r)=>{const i=lB(e.name);if(n){const s=await n(e,{kind:t,onProgress:r});return{url:s.url,alt:s.alt??i}}return{url:await aB(e),alt:i}},cB={image:["image"],gif:["gif"],video:["video","image"],pdf:["pdf"]},ia={},dB=(e,t)=>{const n=new Set,r=[];for(const s of[...e,...t])for(const o of s.items)n.has(o.id)||(n.add(o.id),r.push(o));const i=t[0]??e[0];return[{id:(i==null?void 0:i.id)??"connected",label:(i==null?void 0:i.label)??"Connected",items:r}]},uB=({open:e,kind:t,sources:n,connectors:r,onImageUpload:i,onClose:s,onSelect:o})=>{const a=v.useRef(null),[l,d]=v.useState(!1),[u,h]=v.useState(null),[p,m]=v.useState("all"),[g,b]=v.useState(""),[A,y]=v.useState(()=>({...ia})),[w,C]=v.useState(()=>{var M;const F={};for(const ce of Object.keys(ia))(M=ia[ce])!=null&&M.some(ve=>ve.items.length>0)&&(F[ce]="connected");return F}),[E,S]=v.useState({}),k=cB[t],I=M=>k.includes(M.kind),L=v.useMemo(()=>n.map(M=>({...M,items:M.items.filter(I)})).filter(M=>M.items.length>0),[t,n]),R=M=>(A[M]??[]).flatMap(F=>F.items).filter(I),B=v.useMemo(()=>{const M=Object.values(A).flat();return[...n,...M].flatMap(F=>F.items).filter(I)},[A,t,n]),O=v.useMemo(()=>{var M;return p==="all"?B:r!=null&&r.some(F=>F.id===p)?R(p):((M=L.find(F=>F.id===p))==null?void 0:M.items)??[]},[p,B,L,A]),Y=v.useMemo(()=>{const M=g.trim().toLowerCase();return M?O.filter(F=>[F.label,F.alt??"",...F.tags??[]].join(" ").toLowerCase().includes(M)):O},[O,g]),Q=async(M,F=!1)=>{var ce;F||C(ve=>({...ve,[M.id]:"loading"})),S(ve=>({...ve,[M.id]:null}));try{const ve=await M.onConnect(),Ne=Array.isArray(ve)?ve:[ve];y(ye=>{const xe=F?Ne:dB(ye[M.id]??[],Ne);return ia[M.id]=xe,{...ye,[M.id]:xe}}),C(ye=>({...ye,[M.id]:"connected"}))}catch(ve){S(ye=>({...ye,[M.id]:ve instanceof Error?ve.message:"Unable to connect this source."}));const Ne=(ce=ia[M.id])==null?void 0:ce.some(ye=>ye.items.length>0);C(ye=>({...ye,[M.id]:Ne?"connected":"error"}))}},W=(r==null?void 0:r.find(M=>M.id===p))??null,ie=W?w[W.id]??"idle":"connected";if(v.useEffect(()=>{W&&((w[W.id]??"idle")==="idle"?Q(W):W.requiresAuth||Q(W,!0))},[p]),v.useEffect(()=>{e&&(b(""),m("all"))},[t,e]),v.useEffect(()=>{if(!e)return;const M=F=>{F.key==="Escape"&&s()};return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[s,e]),!e)return null;const J=async M=>{if(M){h(null),d(!0);try{const{url:F,alt:ce}=await Rp(M,t,i);o({id:`upload-${Date.now()}`,label:M.name,url:F,thumbnailUrl:F,kind:t,alt:ce})}catch(F){h(F instanceof Error?F.message:"Upload failed")}finally{d(!1)}}},H=M=>{var F;J(((F=M.target.files)==null?void 0:F[0])??null),M.target.value=""},te=t==="video"?"Thumbnail":t==="gif"?"GIF":t==="pdf"?"PDF":"Image",G=t==="video"?"Video Thumbnail":t==="gif"?"GIF Library":t==="pdf"?"PDF Library":"Image Library";return c.jsx("div",{className:"edm-asset-overlay",role:"presentation",onClick:s,children:c.jsxs("div",{className:"edm-asset-dialog",role:"dialog","aria-modal":"true","aria-label":`${t} asset manager`,onClick:M=>M.stopPropagation(),children:[c.jsxs("div",{className:"edm-asset-header",children:[c.jsxs("div",{children:[c.jsx("strong",{children:G}),c.jsx("p",{children:"Pick from starter assets, search the library, or connect your own source."})]}),c.jsx("button",{type:"button",className:"edm-secondary-button",onClick:s,children:"Close"})]}),c.jsxs("div",{className:"edm-asset-toolbar",children:[c.jsx("input",{className:"edm-asset-search",placeholder:"Search media",value:g,onChange:M=>b(M.target.value)}),c.jsx("input",{ref:a,type:"file",accept:"image/*",hidden:!0,onChange:H}),c.jsx("button",{type:"button",className:"edm-upload-button",disabled:l,onClick:()=>{var M;return(M=a.current)==null?void 0:M.click()},children:l?"Uploading…":`Upload ${te}`})]}),u&&c.jsx("p",{className:"edm-upload-status edm-upload-status--error",role:"alert",children:u}),c.jsx("div",{className:"edm-asset-dropzone",onDragOver:M=>M.preventDefault(),onDrop:M=>{var F;M.preventDefault(),J(((F=M.dataTransfer.files)==null?void 0:F[0])??null)},children:"Drop a file here to upload it into the current block."}),c.jsxs("div",{className:"edm-asset-source-row",children:[c.jsx("button",{type:"button",className:`edm-asset-source${p==="all"?" is-active":""}`,onClick:()=>m("all"),children:"All"}),L.map(M=>c.jsx("button",{type:"button",className:`edm-asset-source${p===M.id?" is-active":""}`,onClick:()=>m(M.id),children:M.label},M.id)),r==null?void 0:r.map(M=>{const F=w[M.id]??"idle";return c.jsxs("button",{type:"button",className:`edm-asset-source edm-asset-source--connector${p===M.id?" is-active":""}${F==="connected"?" is-connected":""}`,onClick:()=>m(M.id),children:[c.jsx("span",{className:"edm-asset-source-icon","aria-hidden":"true",children:M.icon??M.label.slice(0,1)}),M.label]},M.id)})]}),W&&ie!=="connected"&&c.jsx("div",{className:"edm-asset-connect-state",children:ie==="loading"?c.jsx("p",{children:W.requiresAuth?"Waiting for authorization…":"Loading assets…"}):c.jsxs(c.Fragment,{children:[c.jsx("p",{children:W.description??`Connect ${W.label} to browse your assets.`}),E[W.id]&&c.jsx("p",{className:"edm-asset-error",children:E[W.id]}),c.jsx("button",{type:"button",className:"edm-upload-button",onClick:()=>void Q(W),children:W.authLabel??`Connect ${W.label}`})]})}),W&&ie==="connected"&&c.jsx("div",{className:"edm-asset-connect-more",children:c.jsxs("button",{type:"button",className:"edm-secondary-button",onClick:()=>void Q(W),children:["+ Pick more from ",W.label]})}),c.jsxs("div",{className:"edm-asset-grid",children:[Y.map(M=>c.jsxs("button",{type:"button",className:"edm-asset-card",onClick:()=>o(M),children:[c.jsx("img",{src:M.thumbnailUrl??M.url,alt:M.alt??M.label,className:"edm-asset-card-image"}),c.jsx("span",{className:"edm-asset-card-label",children:M.label}),c.jsx("small",{className:"edm-asset-card-meta",children:M.kind==="video"?"Thumbnail":M.kind.toUpperCase()})]},M.id)),Y.length===0&&!(W&&ie!=="connected")&&c.jsxs("div",{className:"edm-empty-state",children:[c.jsx("h3",{children:"No assets found"}),c.jsx("p",{children:"Try a different search term, switch sources, or upload a new file."})]})]})]})})},ph=({value:e,onChange:t,tokens:n,ariaLabel:r})=>{const i=typeof e=="string"&&e.startsWith("token."),s=i?e.slice(6):"",o=i?(n==null?void 0:n[s])??"#000000":e||"#000000",a=Object.entries(n??{});return c.jsxs("div",{className:"edm-token-color",children:[i?c.jsxs("div",{className:"edm-token-color-chip",children:[c.jsx("span",{className:"edm-token-color-swatch","aria-hidden":"true",style:{background:o}}),c.jsx("span",{className:"edm-token-color-name",children:`token.${s}`}),c.jsx("button",{type:"button",className:"edm-secondary-button",onClick:()=>t(o),children:"Use custom"})]}):c.jsx("input",{type:"color",value:e||"#000000","aria-label":r,onChange:l=>t(l.target.value)}),a.length>0?c.jsxs("select",{"aria-label":"Bind to design token",value:i?s:"",onChange:l=>{l.target.value&&t(`token.${l.target.value}`)},children:[c.jsx("option",{value:"",children:"Custom…"}),a.map(([l])=>c.jsx("option",{value:l,children:`token.${l}`},l))]}):null]})},fc=[{id:"facebook",label:"Facebook",short:"f",color:"#1877f2"},{id:"twitter",label:"Twitter",short:"x",color:"#111827"},{id:"linkedin",label:"LinkedIn",short:"in",color:"#0a66c2"},{id:"instagram",label:"Instagram",short:"ig",color:"#e1306c"},{id:"pinterest",label:"Pinterest",short:"p",color:"#e60023"},{id:"youtube",label:"YouTube",short:"yt",color:"#ff0000"},{id:"whatsapp",label:"WhatsApp",short:"wa",color:"#25d366"},{id:"telegram",label:"Telegram",short:"tg",color:"#229ed9"},{id:"tiktok",label:"TikTok",short:"tt",color:"#111827"},{id:"spotify",label:"Spotify",short:"sp",color:"#1db954"},{id:"reddit",label:"Reddit",short:"rd",color:"#ff4500"},{id:"discord",label:"Discord",short:"dc",color:"#5865f2"},{id:"github",label:"GitHub",short:"gh",color:"#24292f"},{id:"dribbble",label:"Dribbble",short:"db",color:"#ea4c89"},{id:"mail",label:"Email",short:"@",color:"#111827"}],hB={facebook:"https://facebook.com",twitter:"https://x.com",linkedin:"https://linkedin.com",instagram:"https://instagram.com",pinterest:"https://pinterest.com",youtube:"https://youtube.com",whatsapp:"https://wa.me/15551234567",telegram:"https://t.me/username",tiktok:"https://tiktok.com",spotify:"https://spotify.com",reddit:"https://reddit.com",discord:"https://discord.com",github:"https://github.com",dribbble:"https://dribbble.com",mail:"mailto:team@example.com"},pB=Object.fromEntries(fc.map(e=>[e.id,e]));function mB({fields:e,values:t,onChange:n}){return c.jsx(c.Fragment,{children:e.map(r=>{const i=t[r.key],s=o=>n({[r.key]:o});return c.jsxs("div",{children:[c.jsx("label",{children:r.label}),r.type==="textarea"?c.jsx("textarea",{value:String(i??""),placeholder:r.placeholder,onChange:o=>s(o.target.value)}):r.type==="color"?c.jsx("input",{type:"color",value:String(i??"#000000"),onChange:o=>s(o.target.value)}):r.type==="number"?c.jsx("input",{type:"number",min:r.min,max:r.max,value:Number(i??0),onChange:o=>s(Number(o.target.value))}):r.type==="select"?c.jsx("select",{value:String(i??""),onChange:o=>s(o.target.value),children:(r.options??[]).map(o=>c.jsx("option",{value:o.value,children:o.label},o.value))}):r.type==="toggle"?c.jsx("div",{className:"edm-toggle-field",children:c.jsx("input",{type:"checkbox",checked:!!i,onChange:o=>s(o.target.checked)})}):c.jsx("input",{type:r.type==="url"?"url":"text",value:String(i??""),placeholder:r.placeholder,onChange:o=>s(o.target.value)})]},r.key)})})}function fB({rows:e,onChange:t,blockId:n,minRows:r=1,maxRows:i=20,minCols:s=1,maxCols:o=8}){var a,l,d,u,h;const p=be(k=>k.tableSelection),m=be(k=>k.setTableSelection),g=tu(e),b=((a=g[0])==null?void 0:a.length)??0,A=k=>t(Wc(Tp(k))),y=p&&p.blockId===n?p:null,w=y?nu(g,y.anchor.r,y.anchor.c,y.focus.r,y.focus.c):null,C=w?w.r1!==w.r2||w.c1!==w.c2:!1,E=y&&y.anchor.r===y.focus.r&&y.anchor.c===y.focus.c?y.anchor:null,S=E&&(((d=(l=g[E.r])==null?void 0:l[E.c])==null?void 0:d.colspan)??1)*(((h=(u=g[E.r])==null?void 0:u[E.c])==null?void 0:h.rowspan)??1)>1?E:null;return c.jsxs("div",{className:"edm-table-editor",children:[c.jsx("p",{className:"edm-table-hint",children:"Click a cell on the canvas to edit it. Shift-click to select a range, then Merge; select a merged cell to Split."}),(C||S)&&c.jsxs("div",{className:"edm-table-merge-actions",children:[c.jsx("button",{type:"button",onClick:()=>{!w||!C||(A(C1(g,w.r1,w.c1,w.r2,w.c2)),m({blockId:n,anchor:{r:w.r1,c:w.c1},focus:{r:w.r1,c:w.c1}}))},disabled:!C,children:"⊟ Merge cells"}),c.jsx("button",{type:"button",onClick:()=>{S&&A(T1(g,S.r,S.c))},disabled:!S,children:"⊞ Split cell"})]}),c.jsxs("div",{className:"edm-table-editor-actions",children:[c.jsx("button",{type:"button",disabled:g.length>=i,onClick:()=>g.length<i&&A([...g,Array.from({length:Math.max(1,b)},()=>({text:"Cell",colspan:1,rowspan:1}))]),children:"+ Row"}),c.jsx("button",{type:"button",disabled:g.length<=r,onClick:()=>g.length>r&&A(g.slice(0,-1)),children:"− Row"}),c.jsx("button",{type:"button",disabled:b>=o,onClick:()=>b<o&&A(g.map(k=>[...k,{text:"Cell",colspan:1,rowspan:1}])),children:"+ Column"}),c.jsx("button",{type:"button",disabled:b<=s,onClick:()=>b>s&&A(g.map(k=>k.slice(0,-1))),children:"− Column"})]})]})}const gB=({block:e,design:t,mergeTags:n,previewMergeTags:r,aiAdapter:i,aiAllowed:s,assetSources:o,assetConnectors:a,onImageUpload:l,onChange:d,onMetaChange:u,freeformEnabled:h})=>{const p=v.useRef(null),[m,g]=v.useState({}),[b,A]=v.useState(null),y=v.useRef(null),[w,C]=v.useState(null),[E,S]=v.useState(null),[k,I]=v.useState(null),[L,R]=v.useState(""),[B,O]=v.useState(null),[Y,Q]=v.useState(""),[W,ie]=v.useState(null),[J,H]=v.useState(!1),[te,G]=v.useState(null),[M,F]=v.useState(""),ce=be(_=>_.saveBlockAsGlobal),ve=be(_=>_.detachGlobalBlock),[Ne,ye]=v.useState(""),xe=be(_=>_.comments),ht=be(_=>_.addComment),wt=be(_=>_.resolveComment),jt=be(_=>_.removeComment),de=be(_=>_.openLibraryForBlockId),pt=be(_=>_.clearAssetLibraryRequest),mt=v.useContext(Xm);if(v.useEffect(()=>{g({}),A(null),R(""),O(null),ie(null)},[e==null?void 0:e.id,e==null?void 0:e.type]),v.useEffect(()=>{if(!de||!e||de!==e.id)return;const _=e.type==="image"?"image":e.type==="gif"?"gif":e.type==="video"?"video":null;_&&A(_),pt()},[de,e,pt]),!e)return c.jsxs("div",{className:"edm-empty-state",children:[c.jsx("h3",{children:"No block selected"}),c.jsx("p",{children:"Pick a block on the canvas to edit its content and styling."})]});const Ee=e.values,Ot=!!e.locked,Jt=!!(e.locked||e.content_locked),Tt=!!(e.locked||e.style_locked),xn=!!(e.locked||e.delete_locked),et=!!(e.locked||e.move_locked),ee=(_,j)=>d({[_]:j}),z=_=>j=>ee(_,j.target.value),fe=_=>j=>ee(_,j),Z=(_,j)=>pe=>ee(_,Number(pe.target.value||j)),Oe=Array.isArray(Ee.items)?Ee.items.filter(_=>typeof _=="object"&&_!==null).map(_=>({label:String(_.label??""),href:String(_.href??""),network:String(_.network??"")})):[],je=(_,j,pe)=>{const qe=Oe.map((Nt,vt)=>vt===_?{...Nt,[j]:pe}:Nt);ee("items",qe)},rt=()=>ee("items",[...Oe,{label:"New link",href:"https://example.com"}]),it=_=>ee("items",Oe.filter((j,pe)=>pe!==_)),He=Array.isArray(Ee.slides)?Ee.slides.filter(_=>typeof _=="object"&&_!==null):[],Pe=(_,j,pe)=>ee("slides",He.map((qe,Nt)=>Nt===_?{...qe,[j]:pe}:qe)),Nn=()=>ee("slides",[...He,{src:"",alt:`Slide ${He.length+1}`,href:"",caption:""}]),Xi=_=>ee("slides",He.filter((j,pe)=>pe!==_)),In=(_,j)=>{const pe=_+j;if(pe<0||pe>=He.length)return;const qe=[...He];[qe[_],qe[pe]]=[qe[pe],qe[_]],ee("slides",qe)},Dr=Oe.map(_=>{var j;return{..._,network:_.network||((j=fc.find(pe=>pe.label.toLowerCase()===_.label.toLowerCase()))==null?void 0:j.id)||""}}),es=_=>{const j=fc.find(pe=>pe.id===_);!j||Dr.some(pe=>pe.network===_)||ee("items",[...Dr,{network:j.id,label:j.label,href:hB[j.id]}])},ts=_=>{var j;return typeof _=="string"&&_.startsWith("token.")?((j=t.design_tokens)==null?void 0:j[_.slice(6)])??_:_},lt=(_,j)=>{const pe=ts(Ee[_]);return typeof pe=="string"&&pe.trim()?pe:j},we=(_,j="")=>String(Ee[_]??j),ue=(_,j)=>{const pe=ts(Ee[_]);if(typeof pe=="string"){const qe=parseFloat(pe);return Number.isFinite(qe)?qe:j}return Number(pe??j)},hr=[{value:"body",label:"Body Font"},{value:"Arial, sans-serif",label:"Arial"},{value:'"Helvetica Neue", Helvetica, Arial, sans-serif',label:"Helvetica"},{value:"Georgia, serif",label:"Georgia"},{value:'"Trebuchet MS", sans-serif',label:"Trebuchet"}],Qs=e.type==="video"?"thumbnail":"src",pr=(e.type,"image/*"),Vs=e.type==="gif"?"gif":"image",ct=async _=>{if(_){G(null),H(!0);try{const{url:j}=await Rp(_,Vs,l);ee(Qs,j)}catch(j){G(j instanceof Error?j.message:"Upload failed")}finally{H(!1)}}},Ft=J?c.jsx("p",{className:"edm-upload-status",role:"status",children:"Uploading…"}):te?c.jsx("p",{className:"edm-upload-status edm-upload-status--error",role:"alert",children:te}):null,ft=_=>c.jsx("div",{className:"edm-segmented edm-segmented--align",children:[{value:"left",label:"Left",icon:"align-left"},{value:"center",label:"Center",icon:"align-center"},{value:"right",label:"Right",icon:"align-right"},{value:"justify",label:"Justify",icon:"align-justify"}].map(j=>c.jsx("button",{type:"button",className:`edm-segmented-button${we(_,"center")===j.value?" is-active":""}`,"aria-label":j.label,"data-tooltip":j.label,onClick:()=>ee(_,j.value),children:Yi(j.icon)},j.value))}),vn=_=>c.jsx("div",{className:"edm-segmented edm-segmented--align",children:["h1","h2","h3","h4"].map(j=>c.jsx("button",{type:"button",className:`edm-segmented-button${we(_,"h1")===j?" is-active":""}`,"aria-label":j.toUpperCase(),"data-tooltip":j.toUpperCase(),onClick:()=>ee(_,j),children:j.toUpperCase()},j))}),Ye=(_,j)=>c.jsx("button",{type:"button",className:`edm-switch${_?" is-active":""}`,role:"switch","aria-checked":_,onClick:j,children:c.jsx("span",{})}),oe=_=>m[_]??!0,he=_=>g(j=>({...j,[_]:!(j[_]??!0)})),St=e.mobile_styles??{},_t=(_,j)=>{const pe={...St};j===null||j===""?delete pe[_]:pe[_]=j,u({mobile_styles:Object.keys(pe).length?pe:void 0})},xt=(St["font-size"]??"").replace(/px$/,""),dt=_=>c.jsxs(me,{title:"Responsive Design",icon:"section-responsive",open:oe(_),onToggle:()=>he(_),children:[c.jsxs("div",{className:"edm-toggle-row",children:[c.jsx("label",{children:"Hide on Desktop"}),Ye(!!e.hide_desktop,()=>u({hide_desktop:!e.hide_desktop}))]}),c.jsxs("div",{className:"edm-toggle-row",children:[c.jsx("label",{children:"Hide on Mobile"}),Ye(!!e.hide_mobile,()=>u({hide_mobile:!e.hide_mobile}))]}),c.jsx("div",{className:"edm-helper-note",children:"Mobile overrides (applied on screens ≤ 620px):"}),c.jsxs("div",{children:[c.jsx("label",{children:"Mobile font size (px)"}),c.jsx("input",{type:"number",min:8,max:80,value:xt,placeholder:"—","aria-label":"Mobile font size",onChange:j=>_t("font-size",j.target.value?`${j.target.value}px`:null)})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Mobile alignment"}),c.jsxs("select",{value:St["text-align"]??"","aria-label":"Mobile alignment",onChange:j=>_t("text-align",j.target.value||null),children:[c.jsx("option",{value:"",children:"Inherit"}),c.jsx("option",{value:"left",children:"Left"}),c.jsx("option",{value:"center",children:"Center"}),c.jsx("option",{value:"right",children:"Right"})]})]})]}),bt=_=>c.jsxs("select",{value:we(_,"free"),onChange:z(_),children:[c.jsx("option",{value:"free",children:"Free"}),c.jsx("option",{value:"square",children:"Square"}),c.jsx("option",{value:"portrait",children:"Portrait"}),c.jsx("option",{value:"landscape",children:"Landscape"}),c.jsx("option",{value:"wide",children:"Wide"})]}),mr=_=>c.jsxs(me,{title:"Enhancements",icon:"section-general",open:oe(_),onToggle:()=>he(_),children:[c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Crop"}),bt("crop_aspect")]}),c.jsxs("div",{children:[c.jsx("label",{children:"Focus X"}),c.jsx("input",{type:"range",min:0,max:100,value:ue("focal_x",50),onChange:Z("focal_x",50)})]})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Focus Y"}),c.jsx("input",{type:"range",min:0,max:100,value:ue("focal_y",50),onChange:Z("focal_y",50)})]}),c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Brightness"}),c.jsx("input",{type:"range",min:0,max:200,value:ue("brightness",100),onChange:Z("brightness",100)})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Contrast"}),c.jsx("input",{type:"range",min:0,max:200,value:ue("contrast",100),onChange:Z("contrast",100)})]})]}),c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Saturation"}),c.jsx("input",{type:"range",min:0,max:200,value:ue("saturation",100),onChange:Z("saturation",100)})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Grayscale"}),c.jsx("input",{type:"range",min:0,max:100,value:ue("grayscale",0),onChange:Z("grayscale",0)})]})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Blur"}),c.jsx("input",{type:"range",min:0,max:20,value:ue("blur",0),onChange:Z("blur",0)})]})]}),kt=_=>{if(w!==null){const pe=w;ee("slides",He.map((qe,Nt)=>Nt===pe?{...qe,src:_.url,..._.alt?{alt:_.alt}:{}}:qe)),C(null),A(null);return}const j={};e.type==="video"?j.thumbnail=_.thumbnailUrl??_.url:j.src=_.url,_.alt&&(j.alt=_.alt),d(j),A(null)},$n=async(_,j)=>{if(j){I(null),S(_);try{const{url:pe,alt:qe}=await Rp(j,"image",l),Nt=qe&&!String((He[_]??{}).alt??"").trim();ee("slides",He.map((vt,rs)=>rs===_?{...vt,src:pe,...Nt?{alt:qe}:{}}:vt))}catch(pe){I(pe instanceof Error?pe.message:"Upload failed")}finally{S(null)}}},fr=async()=>{if(!(!i||!(e.type==="text"||e.type==="heading"||e.type==="raw-html")))try{O("rewrite"),ie(null);const _=await i.rewriteText({prompt:L.trim()||"Improve the copy while preserving the intent, formatting and merge tags.",block:e,design:t,mergeTags:r}),j=_.html??(_.text?`<p>${_.text}</p>`:null);j&&(e.type==="text"||e.type==="raw-html"?d({html:j}):d({text:j}))}catch(_){ie(_ instanceof Error?_.message:"Unable to rewrite content.")}finally{O(null)}},qn=async()=>{if(!i||!["image","gif","video"].includes(e.type))return;const _=e.type==="video"?we("thumbnail"):we("src");if(!_){ie("Add media first before generating alt text.");return}try{O("alt"),ie(null);const j=await i.generateAltText({assetUrl:_,assetKind:e.type==="video"?"video":e.type==="gif"?"gif":"image",title:we("title"),currentAlt:we("alt"),design:t});d({alt:j.alt})}catch(j){ie(j instanceof Error?j.message:"Unable to generate alt text.")}finally{O(null)}},ns=async()=>{if(!(i!=null&&i.generateImage)||!["image","gif"].includes(e.type))return;const _=Y.trim();if(!_){ie("Describe the image you want to generate.");return}try{O("image"),ie(null);const j=await i.generateImage({prompt:_,design:t});d({src:j.url,...j.alt?{alt:j.alt}:{}}),Q("")}catch(j){ie(j instanceof Error?j.message:"Unable to generate an image.")}finally{O(null)}};return c.jsxs("div",{className:"edm-inspector-fields",children:[c.jsx(me,{title:"Global Block",icon:"duplicate",open:oe("global-block"),onToggle:()=>he("global-block"),children:e.global_block_id?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"edm-helper-note",children:"Linked global block, edits to the definition sync to every instance."}),c.jsx("button",{type:"button",className:"edm-secondary-button",onClick:()=>ve(e.id),children:"Detach from global"})]}):c.jsxs("div",{className:"edm-inline-field-actions",children:[c.jsx("input",{value:M,placeholder:"Global block name","aria-label":"Global block name",onChange:_=>F(_.target.value)}),c.jsx("button",{type:"button",className:"edm-secondary-button",onClick:()=>{ce(e.id,M),F("")},children:"Save as Global"})]})}),c.jsxs(me,{title:"Comments",icon:"section-action",open:oe("comments"),onToggle:()=>he("comments"),children:[c.jsx("div",{className:"edm-comment-list",children:Hj(xe,e.id).map(_=>c.jsxs("div",{className:`edm-comment${_.resolved?" is-resolved":""}`,children:[c.jsxs("div",{className:"edm-comment-top",children:[c.jsx("strong",{children:_.author}),c.jsxs("div",{className:"edm-inline-actions",children:[c.jsx("button",{type:"button",className:"edm-secondary-button",onClick:()=>wt(_.id,!_.resolved),children:_.resolved?"Reopen":"Resolve"}),c.jsx(Dt,{icon:"delete",label:"Delete comment",onClick:()=>jt(_.id)})]})]}),c.jsx("p",{children:_.text})]},_.id))}),c.jsxs("div",{className:"edm-inline-field-actions",children:[c.jsx("input",{value:Ne,placeholder:"Add a comment","aria-label":"Add a comment",onChange:_=>ye(_.target.value)}),c.jsx("button",{type:"button",className:"edm-secondary-button",disabled:!Ne.trim(),onClick:()=>{ht(e.id,"You",Ne.trim()),ye("")},children:"Comment"})]})]}),b&&c.jsx(uB,{open:!0,kind:b,sources:o,connectors:a,onImageUpload:l,onClose:()=>{A(null),C(null)},onSelect:kt}),e.type==="heading"&&c.jsxs(c.Fragment,{children:[c.jsx(me,{title:"Text",icon:"section-image",open:oe("heading-text"),onToggle:()=>he("heading-text"),children:c.jsxs(gs,{disabled:Tt,children:[c.jsxs("div",{children:[c.jsx("label",{children:"Heading Type"}),vn("tag")]}),c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Font Family"}),c.jsx("select",{value:we("font_family","body"),onChange:z("font_family"),children:hr.map(_=>c.jsx("option",{value:_.value,children:_.label},_.value))})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Font Weight"}),c.jsxs("select",{value:we("font_weight","400"),onChange:z("font_weight"),children:[c.jsx("option",{value:"400",children:"Regular"}),c.jsx("option",{value:"500",children:"Medium"}),c.jsx("option",{value:"600",children:"Semi Bold"}),c.jsx("option",{value:"700",children:"Bold"})]})]})]}),c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Font Size"}),c.jsx("input",{type:"number",min:12,max:72,value:ue("font_size",22),onChange:Z("font_size",22)})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Color"}),c.jsx("input",{type:"color",value:lt("color","#1a2b4a"),onChange:z("color")})]})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Text Align"}),ft("align")]}),c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Line Height"}),c.jsx("input",{type:"number",min:80,max:200,value:ue("line_height",140),onChange:Z("line_height",140)})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Letter Spacing"}),c.jsx("input",{type:"number",min:0,max:12,value:ue("letter_spacing",0),onChange:Z("letter_spacing",0)})]})]})]})}),c.jsx(me,{title:"Links",icon:"section-action",open:oe("heading-links"),onToggle:()=>he("heading-links"),children:c.jsxs("div",{className:"edm-toggle-row",children:[c.jsx("label",{children:"Inherit Body Styles"}),Ye(!!(Ee.inherit_link_styles??!0),()=>ee("inherit_link_styles",!(Ee.inherit_link_styles??!0)))]})}),c.jsx(me,{title:"General",icon:"section-general",open:oe("heading-general"),onToggle:()=>he("heading-general"),children:c.jsx(gs,{disabled:Tt,children:c.jsxs("div",{children:[c.jsx("label",{children:"Container Padding"}),c.jsx("input",{type:"number",min:0,max:40,value:ue("container_padding",10),onChange:Z("container_padding",10)})]})})}),s?c.jsxs(me,{title:"AI",icon:"section-action",open:oe("heading-ai"),onToggle:()=>he("heading-ai"),children:[c.jsxs("div",{children:[c.jsx("label",{children:"Rewrite Prompt"}),c.jsx("textarea",{rows:3,value:L,onChange:_=>R(_.target.value),placeholder:"Rewrite this heading in a clearer, more persuasive tone.",disabled:!i})]}),c.jsx("button",{type:"button",className:"edm-secondary-button",onClick:()=>void fr(),disabled:!i||B==="rewrite",children:B==="rewrite"?"Rewriting...":"Rewrite Heading"}),i?null:c.jsx("div",{className:"edm-helper-note",children:"Connect your own AI token to enable this (Pro & Enterprise). AI Pro has it built in."}),W?c.jsx("div",{className:"edm-helper-note",children:W}):null]}):null,dt("heading-responsive")]}),e.type==="text"&&c.jsxs(c.Fragment,{children:[c.jsx(me,{title:"Text",icon:"section-image",open:oe("text-main"),onToggle:()=>he("text-main"),children:c.jsxs(gs,{disabled:Tt,children:[c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Font Family"}),c.jsx("select",{value:we("font_family","body"),onChange:z("font_family"),children:hr.map(_=>c.jsx("option",{value:_.value,children:_.label},_.value))})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Font Weight"}),c.jsxs("select",{value:we("font_weight","400"),onChange:z("font_weight"),children:[c.jsx("option",{value:"400",children:"Regular"}),c.jsx("option",{value:"500",children:"Medium"}),c.jsx("option",{value:"600",children:"Semi Bold"}),c.jsx("option",{value:"700",children:"Bold"})]})]})]}),c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Font Size"}),c.jsx("input",{type:"number",min:10,max:72,value:ue("font_size",16),onChange:Z("font_size",16)})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Color"}),c.jsx("input",{type:"color",value:lt("color","#14213d"),onChange:z("color")})]})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Text Align"}),ft("align")]}),c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Line Height"}),c.jsx("input",{type:"number",min:80,max:200,value:ue("line_height",140),onChange:Z("line_height",140)})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Letter Spacing"}),c.jsx("input",{type:"number",min:0,max:12,value:ue("letter_spacing",0),onChange:Z("letter_spacing",0)})]})]})]})}),c.jsx(me,{title:"Links",icon:"section-action",open:oe("text-links"),onToggle:()=>he("text-links"),children:c.jsx(gs,{disabled:Tt,children:c.jsxs("div",{className:"edm-toggle-row",children:[c.jsx("label",{children:"Inherit Body Styles"}),Ye(!!(Ee.inherit_link_styles??!0),()=>ee("inherit_link_styles",!(Ee.inherit_link_styles??!0)))]})})}),c.jsx(me,{title:"General",icon:"section-general",open:oe("text-general"),onToggle:()=>he("text-general"),children:c.jsx(gs,{disabled:Tt,children:c.jsxs("div",{children:[c.jsx("label",{children:"Container Padding"}),c.jsx("input",{type:"number",min:0,max:40,value:ue("container_padding",10),onChange:Z("container_padding",10)})]})})}),s?c.jsxs(me,{title:"AI",icon:"section-action",open:oe("text-ai"),onToggle:()=>he("text-ai"),children:[c.jsxs("div",{children:[c.jsx("label",{children:"Rewrite Prompt"}),c.jsx("textarea",{rows:3,value:L,onChange:_=>R(_.target.value),placeholder:"Rewrite this paragraph in a more helpful, concise tone.",disabled:!i})]}),c.jsx("button",{type:"button",className:"edm-secondary-button",onClick:()=>void fr(),disabled:!i||B==="rewrite",children:B==="rewrite"?"Rewriting...":"Rewrite Text"}),i?null:c.jsx("div",{className:"edm-helper-note",children:"Connect your own AI token to enable this (Pro & Enterprise). AI Pro has it built in."}),W?c.jsx("div",{className:"edm-helper-note",children:W}):null]}):null,dt("text-responsive")]}),e.type==="image"&&c.jsxs(c.Fragment,{children:[c.jsxs(me,{title:"Image",icon:"section-image",open:oe("image-media"),onToggle:()=>he("image-media"),children:[c.jsx("input",{ref:p,type:"file",accept:pr,hidden:!0,onChange:_=>{var j;return void ct(((j=_.target.files)==null?void 0:j[0])??null)}}),c.jsxs("div",{className:"edm-upload-actions",children:[c.jsx("button",{type:"button",className:"edm-upload-button",onClick:()=>{var _;return(_=p.current)==null?void 0:_.click()},children:"Upload Image"}),c.jsx("button",{type:"button",className:"edm-secondary-button",onClick:()=>A("image"),children:"Open Library"})]}),Ft,(i==null?void 0:i.generateImage)&&c.jsxs("div",{className:"edm-ai-image",children:[c.jsx("label",{children:"Generate with AI"}),c.jsxs("div",{className:"edm-ai-image-row",children:[c.jsx("input",{type:"text",value:Y,placeholder:"Describe an image…","aria-label":"AI image prompt",onChange:_=>Q(_.target.value)}),c.jsx("button",{type:"button",className:"edm-secondary-button",disabled:B==="image",onClick:()=>void ns(),children:B==="image"?"Generating…":"Generate"})]})]}),c.jsxs("label",{className:"edm-upload-dropzone",onDragOver:_=>_.preventDefault(),onDrop:_=>{var j;_.preventDefault(),ct(((j=_.dataTransfer.files)==null?void 0:j[0])??null)},children:[c.jsx("span",{children:"Drop a new image here, or click to select files to upload."}),c.jsx("input",{type:"file",accept:pr,hidden:!0,onChange:_=>{var j;return void ct(((j=_.target.files)==null?void 0:j[0])??null)}})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Image URL"}),c.jsx(Kt,{value:we("src"),onChange:fe("src"),mergeTags:n,ariaLabel:"Image source"})]}),c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Width"}),c.jsx("input",{type:"range",min:10,max:100,value:ue("width",100),onChange:Z("width",100),disabled:!!Ee.auto_width})]}),c.jsxs("div",{className:"edm-toggle-field",children:[c.jsx("label",{children:"Auto Width"}),Ye(!!Ee.auto_width,()=>ee("auto_width",!Ee.auto_width))]})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Align"}),ft("align")]}),c.jsxs("div",{children:[c.jsx("label",{children:"Text Wrap"}),c.jsxs("select",{value:we("text_wrap","none"),onChange:z("text_wrap"),children:[c.jsx("option",{value:"none",children:"None (full width)"}),c.jsx("option",{value:"left",children:"Image left · text wraps right"}),c.jsx("option",{value:"right",children:"Image right · text wraps left"})]})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Alternate Text"}),c.jsx(Kt,{value:we("alt"),onChange:fe("alt"),mergeTags:n,ariaLabel:"Alt text"})]})]}),c.jsxs(me,{title:"Action",icon:"section-action",open:oe("image-action"),onToggle:()=>he("image-action"),children:[c.jsxs("div",{children:[c.jsx("label",{children:"Image Link"}),c.jsx(Kt,{value:we("href"),onChange:fe("href"),mergeTags:n,placeholder:"https://example.com",ariaLabel:"Link URL"})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Target"}),c.jsxs("select",{value:we("target","_blank"),onChange:z("target"),children:[c.jsx("option",{value:"_blank",children:"New Tab"}),c.jsx("option",{value:"_self",children:"Same Tab"})]})]})]}),c.jsxs(me,{title:"Border & Corners",icon:"section-general",open:oe("image-border"),onToggle:()=>he("image-border"),children:[c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Border Style"}),c.jsxs("select",{value:we("border_style","none"),onChange:z("border_style"),children:[c.jsx("option",{value:"none",children:"None"}),c.jsx("option",{value:"solid",children:"Solid"}),c.jsx("option",{value:"dashed",children:"Dashed"}),c.jsx("option",{value:"dotted",children:"Dotted"})]})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Border Width"}),c.jsx("input",{type:"number",min:0,max:20,value:ue("border_width",0),onChange:Z("border_width",0)})]})]}),c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Border Color"}),c.jsx("input",{type:"color",value:lt("border_color","#14213d"),onChange:z("border_color")})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Corner Radius"}),c.jsx("input",{type:"number",min:0,max:80,value:ue("border_radius",18),onChange:Z("border_radius",18)})]})]})]}),c.jsx(me,{title:"General",icon:"section-general",open:oe("image-general"),onToggle:()=>he("image-general"),children:c.jsxs("div",{children:[c.jsx("label",{children:"Container Padding"}),c.jsx("input",{type:"number",min:0,max:60,value:ue("padding",10),onChange:Z("padding",10)})]})}),mr("image-enhancements"),i?c.jsxs(me,{title:"AI",icon:"section-action",open:oe("image-ai"),onToggle:()=>he("image-ai"),children:[c.jsxs("div",{children:[c.jsx("label",{children:"Context"}),c.jsx("textarea",{rows:2,value:L,onChange:_=>R(_.target.value),placeholder:"Describe the campaign context to improve the alt text."})]}),c.jsx("button",{type:"button",className:"edm-secondary-button",onClick:()=>void qn(),disabled:B==="alt",children:B==="alt"?"Generating...":"Generate Alt Text"}),W?c.jsx("div",{className:"edm-helper-note",children:W}):null]}):null,c.jsxs(me,{title:"Responsive Design",icon:"section-responsive",open:oe("image-responsive"),onToggle:()=>he("image-responsive"),children:[c.jsxs("div",{className:"edm-toggle-row",children:[c.jsx("label",{children:"Hide on Desktop"}),Ye(!!e.hide_desktop,()=>u({hide_desktop:!e.hide_desktop}))]}),c.jsxs("div",{className:"edm-toggle-row",children:[c.jsx("label",{children:"Hide on Mobile"}),Ye(!!e.hide_mobile,()=>u({hide_mobile:!e.hide_mobile}))]})]})]}),e.type==="gif"&&c.jsxs(c.Fragment,{children:[c.jsxs(me,{title:"GIF",icon:"section-image",open:oe("gif-media"),onToggle:()=>he("gif-media"),children:[c.jsx("input",{ref:p,type:"file",accept:pr,hidden:!0,onChange:_=>{var j;return void ct(((j=_.target.files)==null?void 0:j[0])??null)}}),c.jsxs("div",{className:"edm-upload-actions",children:[c.jsx("button",{type:"button",className:"edm-upload-button",onClick:()=>{var _;return(_=p.current)==null?void 0:_.click()},children:"Upload GIF"}),c.jsx("button",{type:"button",className:"edm-secondary-button",onClick:()=>A("gif"),children:"Open Library"})]}),Ft,c.jsxs("label",{className:"edm-upload-dropzone",onDragOver:_=>_.preventDefault(),onDrop:_=>{var j;_.preventDefault(),ct(((j=_.dataTransfer.files)==null?void 0:j[0])??null)},children:[c.jsx("span",{children:"Drop a new GIF here, or click to select files to upload."}),c.jsx("input",{type:"file",accept:pr,hidden:!0,onChange:_=>{var j;return void ct(((j=_.target.files)==null?void 0:j[0])??null)}})]}),c.jsxs("div",{children:[c.jsx("label",{children:"GIF URL"}),c.jsx(Kt,{value:we("src"),onChange:fe("src"),mergeTags:n,ariaLabel:"Image source"})]}),c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Width"}),c.jsx("input",{type:"range",min:10,max:100,value:ue("width",100),onChange:Z("width",100),disabled:!!Ee.auto_width})]}),c.jsxs("div",{className:"edm-toggle-field",children:[c.jsx("label",{children:"Auto Width"}),Ye(!!Ee.auto_width,()=>ee("auto_width",!Ee.auto_width))]})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Align"}),ft("align")]}),c.jsxs("div",{children:[c.jsx("label",{children:"Text Wrap"}),c.jsxs("select",{value:we("text_wrap","none"),onChange:z("text_wrap"),children:[c.jsx("option",{value:"none",children:"None (full width)"}),c.jsx("option",{value:"left",children:"GIF left · text wraps right"}),c.jsx("option",{value:"right",children:"GIF right · text wraps left"})]})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Alternate Text"}),c.jsx(Kt,{value:we("alt"),onChange:fe("alt"),mergeTags:n,ariaLabel:"Alt text"})]})]}),c.jsxs(me,{title:"Action",icon:"section-action",open:oe("gif-action"),onToggle:()=>he("gif-action"),children:[c.jsxs("div",{children:[c.jsx("label",{children:"GIF Link"}),c.jsx(Kt,{value:we("href"),onChange:fe("href"),mergeTags:n,placeholder:"https://example.com",ariaLabel:"Link URL"})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Target"}),c.jsxs("select",{value:we("target","_blank"),onChange:z("target"),children:[c.jsx("option",{value:"_blank",children:"New Tab"}),c.jsx("option",{value:"_self",children:"Same Tab"})]})]})]}),c.jsxs(me,{title:"Border & Corners",icon:"section-general",open:oe("gif-border"),onToggle:()=>he("gif-border"),children:[c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Border Style"}),c.jsxs("select",{value:we("border_style","none"),onChange:z("border_style"),children:[c.jsx("option",{value:"none",children:"None"}),c.jsx("option",{value:"solid",children:"Solid"}),c.jsx("option",{value:"dashed",children:"Dashed"}),c.jsx("option",{value:"dotted",children:"Dotted"})]})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Border Width"}),c.jsx("input",{type:"number",min:0,max:20,value:ue("border_width",0),onChange:Z("border_width",0)})]})]}),c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Border Color"}),c.jsx("input",{type:"color",value:lt("border_color","#14213d"),onChange:z("border_color")})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Corner Radius"}),c.jsx("input",{type:"number",min:0,max:80,value:ue("border_radius",18),onChange:Z("border_radius",18)})]})]})]}),c.jsx(me,{title:"General",icon:"section-general",open:oe("gif-general"),onToggle:()=>he("gif-general"),children:c.jsxs("div",{children:[c.jsx("label",{children:"Container Padding"}),c.jsx("input",{type:"number",min:0,max:60,value:ue("padding",10),onChange:Z("padding",10)})]})}),mr("gif-enhancements"),i?c.jsxs(me,{title:"AI",icon:"section-action",open:oe("gif-ai"),onToggle:()=>he("gif-ai"),children:[c.jsxs("div",{children:[c.jsx("label",{children:"Context"}),c.jsx("textarea",{rows:2,value:L,onChange:_=>R(_.target.value),placeholder:"Describe the animation context to improve the alt text."})]}),c.jsx("button",{type:"button",className:"edm-secondary-button",onClick:()=>void qn(),disabled:B==="alt",children:B==="alt"?"Generating...":"Generate Alt Text"}),W?c.jsx("div",{className:"edm-helper-note",children:W}):null]}):null,c.jsxs(me,{title:"Responsive Design",icon:"section-responsive",open:oe("gif-responsive"),onToggle:()=>he("gif-responsive"),children:[c.jsxs("div",{className:"edm-toggle-row",children:[c.jsx("label",{children:"Hide on Desktop"}),Ye(!!e.hide_desktop,()=>u({hide_desktop:!e.hide_desktop}))]}),c.jsxs("div",{className:"edm-toggle-row",children:[c.jsx("label",{children:"Hide on Mobile"}),Ye(!!e.hide_mobile,()=>u({hide_mobile:!e.hide_mobile}))]})]})]}),e.type==="button"&&c.jsxs(c.Fragment,{children:[c.jsxs(me,{title:"Action",icon:"section-action",open:oe("button-action"),onToggle:()=>he("button-action"),children:[c.jsxs("div",{children:[c.jsx("label",{children:"Action Type"}),c.jsxs("select",{value:we("action_type","open-website"),onChange:z("action_type"),children:[c.jsx("option",{value:"open-website",children:"Open Website"}),c.jsx("option",{value:"send-email",children:"Send Email"}),c.jsx("option",{value:"call-phone",children:"Call Phone"}),c.jsx("option",{value:"unsubscribe",children:"Unsubscribe"}),c.jsx("option",{value:"view-in-browser",children:"View in Browser"})]})]}),we("action_type","open-website")==="unsubscribe"||we("action_type","open-website")==="view-in-browser"?c.jsxs("p",{className:"edm-field-note",children:["The link is filled in at send time from"," ",c.jsx("code",{children:we("action_type","open-website")==="unsubscribe"?"{{unsubscribe_url}}":"{{web_version_url}}"}),". Most email platforms provide this automatically."]}):c.jsxs("div",{children:[c.jsx("label",{children:"Button Link"}),c.jsx(Kt,{value:we("href"),onChange:fe("href"),mergeTags:n,ariaLabel:"Button link",placeholder:we("action_type","open-website")==="send-email"?"team@example.com":we("action_type","open-website")==="call-phone"?"+1 555 123 4567":"https://example.com"})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Target"}),c.jsxs("select",{value:we("target","_blank"),onChange:z("target"),children:[c.jsx("option",{value:"_blank",children:"New Tab"}),c.jsx("option",{value:"_self",children:"Same Tab"})]})]})]}),c.jsxs(me,{title:"Button Options",icon:"section-image",open:oe("button-options"),onToggle:()=>he("button-options"),children:[c.jsxs("div",{children:[c.jsx("label",{children:"Button Label"}),c.jsx(Kt,{value:we("label"),onChange:fe("label"),mergeTags:n,ariaLabel:"Button label"})]}),c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Background"}),c.jsx(ph,{value:we("background_color","#ef476f"),onChange:fe("background_color"),tokens:t.design_tokens,ariaLabel:"Button background"})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Text Color"}),c.jsx(ph,{value:we("color","#ffffff"),onChange:fe("color"),tokens:t.design_tokens,ariaLabel:"Button text color"})]})]}),c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Width"}),c.jsx("input",{type:"range",min:20,max:100,value:ue("width",40),onChange:Z("width",40),disabled:!!Ee.auto_width})]}),c.jsxs("div",{className:"edm-toggle-field",children:[c.jsx("label",{children:"Auto Width"}),Ye(!!Ee.auto_width,()=>ee("auto_width",!Ee.auto_width))]})]}),c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Font Family"}),c.jsx("select",{value:we("font_family","body"),onChange:z("font_family"),children:hr.map(_=>c.jsx("option",{value:_.value,children:_.label},_.value))})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Font Weight"}),c.jsxs("select",{value:we("font_weight","600"),onChange:z("font_weight"),children:[c.jsx("option",{value:"400",children:"Regular"}),c.jsx("option",{value:"500",children:"Medium"}),c.jsx("option",{value:"600",children:"Semi Bold"}),c.jsx("option",{value:"700",children:"Bold"})]})]})]}),c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Font Size"}),c.jsx("input",{type:"number",min:10,max:36,value:ue("font_size",16),onChange:Z("font_size",16)})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Line Height"}),c.jsx("input",{type:"number",min:80,max:200,value:ue("line_height",120),onChange:Z("line_height",120)})]})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Letter Spacing"}),c.jsx("input",{type:"number",min:0,max:12,value:ue("letter_spacing",0),onChange:Z("letter_spacing",0)})]})]}),c.jsxs(me,{title:"Spacing",icon:"section-general",open:oe("button-spacing"),onToggle:()=>he("button-spacing"),children:[c.jsxs("div",{children:[c.jsx("label",{children:"Alignment"}),ft("align")]}),c.jsxs("div",{className:"edm-inspector-quad-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Top"}),c.jsx("input",{type:"number",min:4,max:32,value:ue("padding_top",14),onChange:Z("padding_top",14)})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Right"}),c.jsx("input",{type:"number",min:8,max:40,value:ue("padding_right",22),onChange:Z("padding_right",22)})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Left"}),c.jsx("input",{type:"number",min:8,max:40,value:ue("padding_left",22),onChange:Z("padding_left",22)})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Bottom"}),c.jsx("input",{type:"number",min:4,max:32,value:ue("padding_bottom",14),onChange:Z("padding_bottom",14)})]})]}),c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Border Style"}),c.jsxs("select",{value:we("border_style","none"),onChange:z("border_style"),children:[c.jsx("option",{value:"none",children:"None"}),c.jsx("option",{value:"solid",children:"Solid"}),c.jsx("option",{value:"dashed",children:"Dashed"}),c.jsx("option",{value:"dotted",children:"Dotted"})]})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Border Width"}),c.jsx("input",{type:"number",min:0,max:8,value:ue("border_width",0),onChange:Z("border_width",0)})]})]}),c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Border Color"}),c.jsx("input",{type:"color",value:lt("border_color","#ef476f"),onChange:z("border_color")})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Rounded Border"}),c.jsx("input",{type:"number",min:0,max:40,value:ue("border_radius",999),onChange:Z("border_radius",999)})]})]})]}),c.jsx(me,{title:"General",icon:"section-general",open:oe("button-general"),onToggle:()=>he("button-general"),children:c.jsxs("div",{children:[c.jsx("label",{children:"Container Padding"}),c.jsx("input",{type:"number",min:0,max:40,value:ue("container_padding",10),onChange:Z("container_padding",10)})]})}),dt("button-responsive")]}),e.type==="divider"&&c.jsxs(c.Fragment,{children:[c.jsxs(me,{title:"Line",icon:"section-image",open:oe("divider-main"),onToggle:()=>he("divider-main"),children:[c.jsxs("div",{children:[c.jsx("label",{children:"Width"}),c.jsx("input",{type:"range",min:10,max:100,value:ue("width",100),onChange:Z("width",100)})]}),c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Line"}),c.jsxs("select",{value:we("style","solid"),onChange:z("style"),children:[c.jsx("option",{value:"solid",children:"Solid"}),c.jsx("option",{value:"dashed",children:"Dashed"}),c.jsx("option",{value:"dotted",children:"Dotted"})]})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Thickness"}),c.jsx("input",{type:"number",min:1,max:8,value:ue("thickness",1),onChange:Z("thickness",1)})]})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Line Color"}),c.jsx("input",{type:"color",value:lt("color","#d9dce5"),onChange:z("color")})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Align"}),ft("align")]})]}),c.jsx(me,{title:"General",icon:"section-general",open:oe("divider-general"),onToggle:()=>he("divider-general"),children:c.jsxs("div",{children:[c.jsx("label",{children:"Container Padding"}),c.jsx("input",{type:"number",min:0,max:40,value:ue("container_padding",10),onChange:Z("container_padding",10)})]})}),dt("divider-responsive")]}),e.type==="spacer"&&c.jsxs(c.Fragment,{children:[c.jsxs(me,{title:"Space",icon:"section-general",open:oe("spacer-main"),onToggle:()=>he("spacer-main"),children:[c.jsxs("div",{children:[c.jsx("label",{children:"Height"}),c.jsx("input",{type:"range",min:8,max:120,value:ue("height",24),onChange:Z("height",24)})]}),c.jsxs("div",{className:"edm-meta-row",children:[ue("height",24)," px"]})]}),c.jsxs(me,{title:"General",icon:"section-general",open:oe("spacer-general"),onToggle:()=>he("spacer-general"),children:[c.jsxs("div",{children:[c.jsx("label",{children:"Background Color"}),c.jsx("input",{type:"color",value:lt("background_color","#ffffff"),onChange:z("background_color")})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Container Padding"}),c.jsx("input",{type:"number",min:0,max:40,value:ue("container_padding",0),onChange:Z("container_padding",0)})]})]}),dt("spacer-responsive")]}),e.type==="social"&&c.jsxs(c.Fragment,{children:[c.jsxs(me,{title:"Icons",icon:"section-image",open:oe("social-icons"),onToggle:()=>he("social-icons"),children:[c.jsxs("div",{children:[c.jsx("label",{children:"Icon Type"}),c.jsxs("select",{value:we("icon_type","circle"),onChange:z("icon_type"),children:[c.jsx("option",{value:"circle",children:"Circle"}),c.jsx("option",{value:"circle-black",children:"Circle Black"}),c.jsx("option",{value:"circle-white",children:"Circle White"}),c.jsx("option",{value:"round",children:"Round"}),c.jsx("option",{value:"round-black",children:"Round Black"}),c.jsx("option",{value:"square",children:"Square"}),c.jsx("option",{value:"square-black",children:"Square Black"})]})]}),c.jsx("div",{className:"edm-social-selected-stack",children:Dr.map((_,j)=>{const pe=pB[_.network],qe=(pe==null?void 0:pe.label)??_.label??"Social";return c.jsxs("div",{className:"edm-social-link-card",children:[c.jsxs("div",{className:"edm-social-link-card-top",children:[c.jsxs("div",{className:"edm-social-link-meta",children:[c.jsx("span",{className:"edm-social-link-badge",style:{"--edm-social-color":(pe==null?void 0:pe.color)??"#6b7280"},children:(pe==null?void 0:pe.short)??qe.slice(0,2)}),c.jsx("strong",{children:qe})]}),c.jsx(Dt,{icon:"delete",label:`Remove ${qe}`,onClick:()=>it(j)})]}),c.jsxs("div",{children:[c.jsx("label",{children:"URL"}),c.jsx(Kt,{value:_.href,onChange:Nt=>je(j,"href",Nt),mergeTags:n,placeholder:"https://example.com",ariaLabel:"Social link URL"})]})]},`${_.network||_.label}-${j}`)})}),c.jsxs("div",{className:"edm-panel-title",children:[c.jsx("span",{children:"More Options"}),c.jsx("small",{children:"Click icons to add"})]}),c.jsx("div",{className:"edm-social-picker",children:fc.map(_=>{const j=Dr.some(pe=>pe.network===_.id);return c.jsx("button",{type:"button",className:`edm-social-option${j?" is-selected":""}`,"aria-label":_.label,title:_.label,onClick:()=>es(_.id),style:{"--edm-social-color":_.color},children:c.jsx("span",{children:_.short})},_.id)})})]}),c.jsxs(me,{title:"General",icon:"section-general",open:oe("social-general"),onToggle:()=>he("social-general"),children:[c.jsxs("div",{children:[c.jsx("label",{children:"Align"}),ft("align")]}),c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Icon Size"}),c.jsx("input",{type:"number",min:20,max:48,value:ue("icon_size",32),onChange:Z("icon_size",32)})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Icon Spacing"}),c.jsx("input",{type:"number",min:0,max:24,value:ue("spacing",5),onChange:Z("spacing",5)})]})]}),c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Icon Color"}),c.jsx("input",{type:"color",value:lt("icon_color","#ffffff"),onChange:z("icon_color")})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Target"}),c.jsxs("select",{value:we("target","_blank"),onChange:z("target"),children:[c.jsx("option",{value:"_blank",children:"New Tab"}),c.jsx("option",{value:"_self",children:"Same Tab"})]})]})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Container Padding"}),c.jsx("input",{type:"number",min:0,max:40,value:ue("container_padding",10),onChange:Z("container_padding",10)})]})]}),dt("social-responsive")]}),e.type==="navigation"&&c.jsxs(c.Fragment,{children:[c.jsx(me,{title:"Menu Items",icon:"section-image",open:oe("navigation-items"),onToggle:()=>he("navigation-items"),children:c.jsxs("div",{className:"edm-inspector-list",children:[c.jsxs("div",{className:"edm-panel-title",children:[c.jsx("span",{children:"Navigation"}),c.jsxs("small",{children:[Oe.length," items"]})]}),c.jsx("div",{className:"edm-inspector-list-stack",children:Oe.map((_,j)=>c.jsxs("div",{className:"edm-inspector-list-item",children:[c.jsxs("div",{className:"edm-social-link-card-top",children:[c.jsx("strong",{children:`Link ${j+1}`}),c.jsx(Dt,{icon:"delete",label:`Remove link ${j+1}`,onClick:()=>it(j)})]}),c.jsx(Kt,{value:_.label,onChange:pe=>je(j,"label",pe),mergeTags:n,placeholder:"Label",ariaLabel:`Menu label ${j+1}`}),c.jsx(Kt,{value:_.href,onChange:pe=>je(j,"href",pe),mergeTags:n,placeholder:"https://example.com",ariaLabel:`Menu URL ${j+1}`})]},`${_.label}-${j}`))}),c.jsx("button",{type:"button",className:"edm-secondary-button",onClick:rt,children:"Add Item"})]})}),c.jsxs(me,{title:"Style",icon:"section-general",open:oe("navigation-style"),onToggle:()=>he("navigation-style"),children:[c.jsxs("div",{children:[c.jsx("label",{children:"Align"}),ft("align")]}),c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Link Color"}),c.jsx("input",{type:"color",value:lt("color","#14213d"),onChange:z("color")})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Spacing"}),c.jsx("input",{type:"number",min:0,max:40,value:ue("spacing",20),onChange:Z("spacing",20)})]})]}),c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Font Size"}),c.jsx("input",{type:"number",min:10,max:24,value:ue("font_size",14),onChange:Z("font_size",14)})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Font Weight"}),c.jsxs("select",{value:we("font_weight","600"),onChange:z("font_weight"),children:[c.jsx("option",{value:"400",children:"Regular"}),c.jsx("option",{value:"500",children:"Medium"}),c.jsx("option",{value:"600",children:"Semi Bold"}),c.jsx("option",{value:"700",children:"Bold"})]})]})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Target"}),c.jsxs("select",{value:we("target","_blank"),onChange:z("target"),children:[c.jsx("option",{value:"_blank",children:"New Tab"}),c.jsx("option",{value:"_self",children:"Same Tab"})]})]})]}),c.jsx(me,{title:"General",icon:"section-general",open:oe("navigation-general"),onToggle:()=>he("navigation-general"),children:c.jsxs("div",{children:[c.jsx("label",{children:"Container Padding"}),c.jsx("input",{type:"number",min:0,max:40,value:ue("container_padding",10),onChange:Z("container_padding",10)})]})}),dt("navigation-responsive")]}),e.type==="table"&&c.jsxs(c.Fragment,{children:[c.jsxs(me,{title:"Table",icon:"section-general",open:oe("table-cells"),onToggle:()=>he("table-cells"),children:[c.jsx(fB,{rows:Ee.rows,onChange:_=>ee("rows",_),blockId:e.id,minRows:ue("min_rows",1),maxRows:ue("max_rows",20),minCols:ue("min_columns",1),maxCols:ue("max_columns",8)}),c.jsxs("div",{className:"edm-toggle-field",children:[c.jsx("label",{children:"Header row"}),Ye(!!(Ee.header_row??!0),()=>ee("header_row",!(Ee.header_row??!0)))]}),c.jsxs("div",{className:"edm-toggle-field",children:[c.jsx("label",{children:"Footer row"}),Ye(!!Ee.footer_row,()=>ee("footer_row",!Ee.footer_row))]})]}),c.jsxs(me,{title:"Style",icon:"section-general",open:oe("table-style"),onToggle:()=>he("table-style"),children:[c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Header Background"}),c.jsx("input",{type:"color",value:lt("header_background","#14213d"),onChange:z("header_background")})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Header Text"}),c.jsx("input",{type:"color",value:lt("header_color","#ffffff"),onChange:z("header_color")})]})]}),Ee.footer_row?c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Footer Background"}),c.jsx("input",{type:"color",value:lt("footer_background","#14213d"),onChange:z("footer_background")})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Footer Text"}),c.jsx("input",{type:"color",value:lt("footer_color","#ffffff"),onChange:z("footer_color")})]})]}):null,c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Font Family"}),c.jsx("select",{value:we("font_family","body"),onChange:z("font_family"),children:hr.map(_=>c.jsx("option",{value:_.value,children:_.label},_.value))})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Font Weight"}),c.jsxs("select",{value:we("font_weight","400"),onChange:z("font_weight"),children:[c.jsx("option",{value:"400",children:"Regular"}),c.jsx("option",{value:"500",children:"Medium"}),c.jsx("option",{value:"600",children:"Semi Bold"}),c.jsx("option",{value:"700",children:"Bold"})]})]})]}),c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Border Style"}),c.jsxs("select",{value:we("border_style","solid"),onChange:z("border_style"),children:[c.jsx("option",{value:"none",children:"None"}),c.jsx("option",{value:"solid",children:"Solid"}),c.jsx("option",{value:"dashed",children:"Dashed"}),c.jsx("option",{value:"dotted",children:"Dotted"})]})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Border Width"}),c.jsx("input",{type:"number",min:0,max:6,value:ue("border_width",1),onChange:Z("border_width",1)})]})]}),c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Border Color"}),c.jsx("input",{type:"color",value:lt("border_color","#e6ecea"),onChange:z("border_color")})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Cell Padding"}),c.jsx("input",{type:"number",min:0,max:30,value:ue("cell_padding",10),onChange:Z("cell_padding",10)})]})]}),c.jsxs("div",{className:"edm-toggle-field",children:[c.jsx("label",{children:"Striped rows"}),Ye(!!Ee.striped,()=>ee("striped",!Ee.striped))]}),Ee.striped?c.jsxs("div",{children:[c.jsx("label",{children:"Stripe Color"}),c.jsx("input",{type:"color",value:lt("stripe_color","#f4f8f7"),onChange:z("stripe_color")})]}):null,c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Font Size"}),c.jsx("input",{type:"number",min:10,max:24,value:ue("font_size",14),onChange:Z("font_size",14)})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Text Color"}),c.jsx("input",{type:"color",value:lt("text_color","#14213d"),onChange:z("text_color")})]})]}),c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Line Height"}),c.jsx("input",{type:"number",min:80,max:200,value:ue("line_height",140),onChange:Z("line_height",140)})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Letter Spacing"}),c.jsx("input",{type:"number",min:0,max:12,value:ue("letter_spacing",0),onChange:Z("letter_spacing",0)})]})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Cell Align"}),ft("align")]}),c.jsxs("div",{children:[c.jsx("label",{children:"Width"}),c.jsx("input",{type:"range",min:10,max:100,value:ue("width",100),onChange:Z("width",100)})]})]}),c.jsx(me,{title:"General",icon:"section-general",open:oe("table-general"),onToggle:()=>he("table-general"),children:c.jsxs("div",{children:[c.jsx("label",{children:"Container Padding"}),c.jsx("input",{type:"number",min:0,max:40,value:ue("container_padding",10),onChange:Z("container_padding",10)})]})}),dt("table-responsive")]}),e.type==="custom"&&(()=>{const _=mt[String(Ee._tool??"")],j=pe=>{const qe={...Ee,...pe};let Nt="";if(_)try{Nt=String(_.exportHtml(qe)??"")}catch{}d({...pe,_html:Nt})};return c.jsxs(c.Fragment,{children:[c.jsx(me,{title:(_==null?void 0:_.label)??"Custom block",icon:"section-general",open:oe("custom-fields"),onToggle:()=>he("custom-fields"),children:_!=null&&_.inspector&&_.inspector.length>0?c.jsx(mB,{fields:_.inspector,values:Ee,onChange:j}):c.jsx("p",{className:"edm-table-hint",children:"This block has no editable settings."})}),dt("custom-responsive")]})})(),e.type==="video"&&c.jsxs(c.Fragment,{children:[c.jsxs(me,{title:"Video",icon:"section-image",open:oe("video-media"),onToggle:()=>he("video-media"),children:[c.jsx("input",{ref:p,type:"file",accept:"image/*",hidden:!0,onChange:_=>{var j;return void ct(((j=_.target.files)==null?void 0:j[0])??null)}}),c.jsxs("div",{className:"edm-upload-actions",children:[c.jsx("button",{type:"button",className:"edm-upload-button",onClick:()=>{var _;return(_=p.current)==null?void 0:_.click()},children:"Upload Thumbnail"}),c.jsx("button",{type:"button",className:"edm-secondary-button",onClick:()=>A("video"),children:"Open Library"})]}),Ft,c.jsxs("label",{className:"edm-upload-dropzone",onDragOver:_=>_.preventDefault(),onDrop:_=>{var j;_.preventDefault(),ct(((j=_.dataTransfer.files)==null?void 0:j[0])??null)},children:[c.jsx("span",{children:"Drop a preview image here, or click to select a thumbnail."}),c.jsx("input",{type:"file",accept:"image/*",hidden:!0,onChange:_=>{var j;return void ct(((j=_.target.files)==null?void 0:j[0])??null)}})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Thumbnail URL"}),c.jsx(Kt,{value:we("thumbnail"),onChange:fe("thumbnail"),mergeTags:n,ariaLabel:"Thumbnail URL"})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Video Title"}),c.jsx("input",{value:we("title"),onChange:z("title")})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Video URL"}),c.jsx(Kt,{value:we("url"),onChange:fe("url"),mergeTags:n,ariaLabel:"Video URL"})]}),c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Width"}),c.jsx("input",{type:"range",min:10,max:100,value:ue("width",100),onChange:Z("width",100),disabled:!!Ee.auto_width})]}),c.jsxs("div",{className:"edm-toggle-field",children:[c.jsx("label",{children:"Auto Width"}),Ye(!!Ee.auto_width,()=>ee("auto_width",!Ee.auto_width))]})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Align"}),ft("align")]}),c.jsxs("div",{children:[c.jsx("label",{children:"Alternate Text"}),c.jsx(Kt,{value:we("alt"),onChange:fe("alt"),mergeTags:n,ariaLabel:"Alt text"})]})]}),c.jsxs(me,{title:"Action",icon:"section-action",open:oe("video-action"),onToggle:()=>he("video-action"),children:[c.jsxs("div",{children:[c.jsx("label",{children:"Open Link"}),c.jsx("input",{value:we("url"),onChange:z("url"),placeholder:"https://example.com/video"})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Target"}),c.jsxs("select",{value:we("target","_blank"),onChange:z("target"),children:[c.jsx("option",{value:"_blank",children:"New Tab"}),c.jsx("option",{value:"_self",children:"Same Tab"})]})]})]}),c.jsx(me,{title:"General",icon:"section-general",open:oe("video-general"),onToggle:()=>he("video-general"),children:c.jsxs("div",{children:[c.jsx("label",{children:"Container Padding"}),c.jsx("input",{type:"number",min:0,max:60,value:ue("padding",10),onChange:Z("padding",10)})]})}),mr("video-enhancements"),i?c.jsxs(me,{title:"AI",icon:"section-action",open:oe("video-ai"),onToggle:()=>he("video-ai"),children:[c.jsxs("div",{children:[c.jsx("label",{children:"Context"}),c.jsx("textarea",{rows:2,value:L,onChange:_=>R(_.target.value),placeholder:"Describe the video context to improve the thumbnail alt text."})]}),c.jsx("button",{type:"button",className:"edm-secondary-button",onClick:()=>void qn(),disabled:B==="alt",children:B==="alt"?"Generating...":"Generate Alt Text"}),W?c.jsx("div",{className:"edm-helper-note",children:W}):null]}):null,c.jsxs(me,{title:"Responsive Design",icon:"section-responsive",open:oe("video-responsive"),onToggle:()=>he("video-responsive"),children:[c.jsxs("div",{className:"edm-toggle-row",children:[c.jsx("label",{children:"Hide on Desktop"}),Ye(!!e.hide_desktop,()=>u({hide_desktop:!e.hide_desktop}))]}),c.jsxs("div",{className:"edm-toggle-row",children:[c.jsx("label",{children:"Hide on Mobile"}),Ye(!!e.hide_mobile,()=>u({hide_mobile:!e.hide_mobile}))]})]})]}),e.type==="raw-html"&&c.jsxs(c.Fragment,{children:[c.jsx(me,{title:"HTML",icon:"section-image",open:oe("html-main"),onToggle:()=>he("html-main"),children:c.jsxs("div",{children:[c.jsx("label",{children:"HTML Markup"}),c.jsx("textarea",{rows:12,value:we("html"),onChange:z("html")})]})}),c.jsxs(me,{title:"General",icon:"section-general",open:oe("html-general"),onToggle:()=>he("html-general"),children:[c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Container Padding"}),c.jsx("input",{type:"number",min:0,max:40,value:ue("padding",0),onChange:Z("padding",0)})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Corner Radius"}),c.jsx("input",{type:"number",min:0,max:40,value:ue("border_radius",0),onChange:Z("border_radius",0)})]})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Background Color"}),c.jsx("input",{type:"color",value:lt("background_color","#ffffff"),onChange:z("background_color")})]})]}),s?c.jsxs(me,{title:"AI",icon:"section-action",open:oe("html-ai"),onToggle:()=>he("html-ai"),children:[c.jsxs("div",{children:[c.jsx("label",{children:"Improve with AI"}),c.jsx("textarea",{rows:3,value:L,onChange:_=>R(_.target.value),placeholder:"Refine this HTML, keep it email-safe and preserve merge tags.",disabled:!i})]}),c.jsx("button",{type:"button",className:"edm-secondary-button",onClick:()=>void fr(),disabled:!i||B==="rewrite",children:B==="rewrite"?"Rewriting...":"Improve HTML"}),i?null:c.jsx("div",{className:"edm-helper-note",children:"Connect your own AI token to enable this (Pro & Enterprise). AI Pro has it built in."}),W?c.jsx("div",{className:"edm-helper-note",children:W}):null]}):null,dt("html-responsive")]}),e.type==="form"&&c.jsxs(c.Fragment,{children:[c.jsxs(me,{title:"Form",icon:"section-image",open:oe("form-main"),onToggle:()=>he("form-main"),children:[c.jsxs("div",{children:[c.jsx("label",{children:"Headline"}),c.jsx("input",{value:we("headline"),onChange:z("headline")})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Field Placeholder"}),c.jsx("input",{value:we("field_placeholder","name@example.com"),onChange:z("field_placeholder")})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Button Label"}),c.jsx("input",{value:we("button_label"),onChange:z("button_label")})]})]}),c.jsxs(me,{title:"Style",icon:"section-general",open:oe("form-style"),onToggle:()=>he("form-style"),children:[c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Background Color"}),c.jsx("input",{type:"color",value:lt("background_color","#ffffff"),onChange:z("background_color")})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Border Color"}),c.jsx("input",{type:"color",value:lt("border_color","#d9dce5"),onChange:z("border_color")})]})]}),c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Button Color"}),c.jsx("input",{type:"color",value:lt("button_color","#14213d"),onChange:z("button_color")})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Button Text Color"}),c.jsx("input",{type:"color",value:lt("button_text_color","#ffffff"),onChange:z("button_text_color")})]})]}),c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Padding"}),c.jsx("input",{type:"number",min:0,max:40,value:ue("padding",18),onChange:Z("padding",18)})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Corner Radius"}),c.jsx("input",{type:"number",min:0,max:40,value:ue("border_radius",18),onChange:Z("border_radius",18)})]})]})]}),dt("form-responsive")]}),e.type==="carousel"&&c.jsxs(c.Fragment,{children:[c.jsxs(me,{title:"Slides",icon:"section-image",open:oe("carousel-slides"),onToggle:()=>he("carousel-slides"),children:[He.length===0&&c.jsx("p",{className:"edm-field-note",children:"No slides yet, add one below."}),c.jsx("input",{ref:y,type:"file",accept:"image/*",hidden:!0,onChange:_=>{var j;const pe=((j=_.target.files)==null?void 0:j[0])??null,qe=w;_.target.value="",C(null),qe!==null&&$n(qe,pe)}}),He.map((_,j)=>c.jsxs("div",{className:"edm-slide-editor",children:[c.jsxs("div",{className:"edm-slide-editor-head",children:[c.jsxs("strong",{children:["Slide ",j+1]}),c.jsxs("div",{className:"edm-slide-editor-actions",children:[c.jsx("button",{type:"button","aria-label":`Move slide ${j+1} up`,disabled:j===0,onClick:()=>In(j,-1),children:"↑"}),c.jsx("button",{type:"button","aria-label":`Move slide ${j+1} down`,disabled:j===He.length-1,onClick:()=>In(j,1),children:"↓"}),c.jsx("button",{type:"button","aria-label":`Remove slide ${j+1}`,onClick:()=>Xi(j),children:"×"})]})]}),c.jsxs("div",{className:"edm-upload-actions",children:[c.jsx("button",{type:"button",className:"edm-upload-button",disabled:E===j,onClick:()=>{var pe;C(j),I(null),(pe=y.current)==null||pe.click()},children:E===j?"Uploading…":"Upload"}),c.jsx("button",{type:"button",className:"edm-secondary-button",onClick:()=>{C(j),A("image")},children:"Open Library"})]}),k&&w===j?c.jsx("p",{className:"edm-upload-status edm-upload-status--error",role:"alert",children:k}):null,c.jsx("label",{children:"Image URL"}),c.jsx(Kt,{value:String(_.src??""),onChange:pe=>Pe(j,"src",pe),mergeTags:n,ariaLabel:`Slide ${j+1} image URL`,placeholder:"https://…/image.jpg"}),c.jsx("label",{children:"Alt text"}),c.jsx("input",{type:"text",value:String(_.alt??""),"aria-label":`Slide ${j+1} alt text`,onChange:pe=>Pe(j,"alt",pe.target.value)}),c.jsx("label",{children:"Link (optional)"}),c.jsx(Kt,{value:String(_.href??""),onChange:pe=>Pe(j,"href",pe),mergeTags:n,ariaLabel:`Slide ${j+1} link`,placeholder:"https://example.com"}),!!Ee.show_caption&&c.jsxs(c.Fragment,{children:[c.jsx("label",{children:"Caption"}),c.jsx("input",{type:"text",value:String(_.caption??""),"aria-label":`Slide ${j+1} caption`,onChange:pe=>Pe(j,"caption",pe.target.value)})]})]},j)),c.jsx("button",{type:"button",className:"edm-secondary-button",onClick:Nn,children:"Add slide"})]}),c.jsxs(me,{title:"Layout",icon:"section-general",open:oe("carousel-layout"),onToggle:()=>he("carousel-layout"),children:[c.jsxs("div",{children:[c.jsx("label",{children:"Align"}),c.jsxs("select",{value:we("align","center"),onChange:z("align"),children:[c.jsx("option",{value:"left",children:"Left"}),c.jsx("option",{value:"center",children:"Center"}),c.jsx("option",{value:"right",children:"Right"})]})]}),c.jsxs("div",{children:[c.jsxs("label",{children:["Max width (",ue("width",100),"%)"]}),c.jsx("input",{type:"range",min:20,max:100,value:ue("width",100),onChange:_=>ee("width",Number(_.target.value))})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Gap between slides (px)"}),c.jsx("input",{type:"number",min:0,max:64,value:ue("gap",12),onChange:_=>ee("gap",Number(_.target.value))})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Corner radius (px)"}),c.jsx("input",{type:"number",min:0,max:40,value:ue("border_radius",12),onChange:_=>ee("border_radius",Number(_.target.value))})]}),c.jsxs("label",{className:"edm-checkbox-row",children:[c.jsx("input",{type:"checkbox",checked:!!Ee.show_caption,onChange:_=>ee("show_caption",_.target.checked)}),"Show captions"]})]})]}),e.type==="countdown"&&c.jsxs(c.Fragment,{children:[c.jsxs(me,{title:"Timer",icon:"section-image",open:oe("countdown-main"),onToggle:()=>he("countdown-main"),children:[c.jsxs("div",{children:[c.jsx("label",{children:"Label"}),c.jsx(Kt,{value:we("label"),onChange:fe("label"),mergeTags:n,ariaLabel:"Button label"})]}),c.jsxs("div",{children:[c.jsx("label",{children:"End Date"}),c.jsx("input",{type:"datetime-local",value:we("end_date").slice(0,16),onChange:_=>ee("end_date",_.target.value?`${_.target.value}:00.000Z`:"")})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Align"}),ft("align")]})]}),c.jsxs(me,{title:"Style",icon:"section-general",open:oe("countdown-style"),onToggle:()=>he("countdown-style"),children:[c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Background Color"}),c.jsx("input",{type:"color",value:lt("background_color","#14213d"),onChange:z("background_color")})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Text Color"}),c.jsx(ph,{value:we("color","#ffffff"),onChange:fe("color"),tokens:t.design_tokens,ariaLabel:"Button text color"})]})]}),c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Padding"}),c.jsx("input",{type:"number",min:0,max:40,value:ue("padding",18),onChange:Z("padding",18)})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Corner Radius"}),c.jsx("input",{type:"number",min:0,max:40,value:ue("border_radius",18),onChange:Z("border_radius",18)})]})]})]}),dt("countdown-responsive")]}),c.jsxs(me,{title:"Protection",icon:"section-general",open:oe("block-protection"),onToggle:()=>he("block-protection"),children:[c.jsxs("div",{className:"edm-toggle-row",children:[c.jsx("label",{children:"Full Lock"}),Ye(!!e.locked,()=>u({locked:!e.locked}))]}),c.jsxs("div",{className:"edm-toggle-row",children:[c.jsx("label",{children:"Content Lock"}),Ye(!!e.content_locked,()=>u({content_locked:!e.content_locked}))]}),c.jsxs("div",{className:"edm-toggle-row",children:[c.jsx("label",{children:"Style Lock"}),Ye(!!e.style_locked,()=>u({style_locked:!e.style_locked}))]}),c.jsxs("div",{className:"edm-toggle-row",children:[c.jsx("label",{children:"Delete Lock"}),Ye(!!e.delete_locked,()=>u({delete_locked:!e.delete_locked}))]}),c.jsxs("div",{className:"edm-toggle-row",children:[c.jsx("label",{children:"Move Lock"}),Ye(!!e.move_locked,()=>u({move_locked:!e.move_locked}))]}),Ot||Jt||Tt||xn||et?c.jsx("div",{className:"edm-helper-note",children:"Locked blocks stay selectable, but protected actions and edits are disabled on the canvas and in the inspector."}):null]}),h?c.jsx(me,{title:"Position",icon:"section-responsive",open:oe("block-position"),onToggle:()=>he("block-position"),children:(()=>{const _=e.position??{x:0,y:0,width:100,height:80,z:1},j=vt=>{const rs=Number(vt);return Number.isFinite(rs)?rs:0},pe=vt=>Math.max(0,Math.min(100,vt)),qe=vt=>Math.max(0,vt),Nt=vt=>u({position:{..._,...vt}});return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"X (% left)"}),c.jsx("input",{type:"number",min:0,max:100,value:_.x,onChange:vt=>Nt({x:pe(j(vt.target.value))})})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Y (px top)"}),c.jsx("input",{type:"number",min:0,value:_.y,onChange:vt=>Nt({y:qe(j(vt.target.value))})})]})]}),c.jsxs("div",{className:"edm-inspector-inline-grid",children:[c.jsxs("div",{children:[c.jsx("label",{children:"Width (%)"}),c.jsx("input",{type:"number",min:0,max:100,value:_.width,onChange:vt=>Nt({width:pe(j(vt.target.value))})})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Height (px)"}),c.jsx("input",{type:"number",min:0,value:_.height,onChange:vt=>Nt({height:qe(j(vt.target.value))})})]})]}),c.jsxs("div",{children:[c.jsx("label",{children:"Layer (z-index)"}),c.jsx("input",{type:"number",value:_.z??1,onChange:vt=>Nt({z:Math.round(j(vt.target.value))})})]}),e.position?c.jsx("button",{type:"button",className:"edm-secondary-button",onClick:()=>u({position:void 0}),children:"Reset to normal flow"}):null,c.jsx("div",{className:"edm-helper-note",children:"Freeform position applies to the web page on desktop. On mobile, blocks stack back into normal flow automatically."})]})})()}):null,c.jsxs(me,{title:"Visibility",icon:"preview",open:oe("block-visibility"),onToggle:()=>he("block-visibility"),children:[c.jsxs("div",{children:[c.jsx("label",{children:"Visible If"}),c.jsx("input",{value:e.visible_if??"",placeholder:'{{first_name}} != "" && {{order_id}} != ""',onChange:_=>u({visible_if:_.target.value})})]}),c.jsxs("div",{className:"edm-helper-note",children:["Use merge tags with simple conditions like ",c.jsx("code",{children:'{{first_name}} != ""'})," or"," ",c.jsx("code",{children:'{{user_plan}} == "pro"'}),"."]})]})]})},AB=({x:e,y:t,items:n,onClose:r})=>{const i=v.useRef(null),[s,o]=v.useState({left:e,top:t});return v.useLayoutEffect(()=>{const a=i.current;if(!a)return;const l=a.getBoundingClientRect(),d=e>window.innerWidth/2,u=t>window.innerHeight/2,h=d?e-l.width:e,p=u?t-l.height:t,m=Math.max(8,Math.min(h,window.innerWidth-l.width-8)),g=Math.max(8,Math.min(p,window.innerHeight-l.height-8));o({left:m,top:g})},[e,t,n]),v.useEffect(()=>{const a=d=>{d.key==="Escape"&&r()},l=d=>{i.current&&!i.current.contains(d.target)&&r()};return window.addEventListener("keydown",a),window.addEventListener("mousedown",l,!0),window.addEventListener("resize",r),window.addEventListener("scroll",r,!0),()=>{window.removeEventListener("keydown",a),window.removeEventListener("mousedown",l,!0),window.removeEventListener("resize",r),window.removeEventListener("scroll",r,!0)}},[r]),Ts.createPortal(c.jsx("div",{ref:i,className:"edm-context-menu",style:{left:s.left,top:s.top},role:"menu",children:n.map((a,l)=>a==="divider"?c.jsx("div",{className:"edm-context-menu-divider",role:"separator"},`divider-${l}`):c.jsxs("button",{type:"button",role:"menuitem",className:`edm-context-menu-item${a.danger?" is-danger":""}`,disabled:a.disabled,onClick:()=>{a.onClick(),r()},children:[c.jsx("span",{className:"edm-context-menu-label",children:a.label}),a.shortcut?c.jsx("span",{className:"edm-context-menu-shortcut",children:a.shortcut}):null]},a.label))}),document.body)},U1=v.createContext(void 0);var mh={exports:{}},fh={};/**
|
|
113
|
+
* @license React
|
|
114
|
+
* use-sync-external-store-shim.production.js
|
|
115
|
+
*
|
|
116
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
117
|
+
*
|
|
118
|
+
* This source code is licensed under the MIT license found in the
|
|
119
|
+
* LICENSE file in the root directory of this source tree.
|
|
120
|
+
*/var s0;function bB(){if(s0)return fh;s0=1;var e=v;function t(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,s=e.useLayoutEffect,o=e.useDebugValue;function a(h,p){var m=p(),g=r({inst:{value:m,getSnapshot:p}}),b=g[0].inst,A=g[1];return s(function(){b.value=m,b.getSnapshot=p,l(b)&&A({inst:b})},[h,m,p]),i(function(){return l(b)&&A({inst:b}),h(function(){l(b)&&A({inst:b})})},[h]),o(m),m}function l(h){var p=h.getSnapshot;h=h.value;try{var m=p();return!n(h,m)}catch{return!0}}function d(h,p){return p()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:a;return fh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,fh}var o0={};/**
|
|
121
|
+
* @license React
|
|
122
|
+
* use-sync-external-store-shim.development.js
|
|
123
|
+
*
|
|
124
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
125
|
+
*
|
|
126
|
+
* This source code is licensed under the MIT license found in the
|
|
127
|
+
* LICENSE file in the root directory of this source tree.
|
|
128
|
+
*/var a0;function yB(){return a0||(a0=1,process.env.NODE_ENV!=="production"&&(function(){function e(m,g){return m===g&&(m!==0||1/m===1/g)||m!==m&&g!==g}function t(m,g){u||i.startTransition===void 0||(u=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var b=g();if(!h){var A=g();s(b,A)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),h=!0)}A=o({inst:{value:b,getSnapshot:g}});var y=A[0].inst,w=A[1];return l(function(){y.value=b,y.getSnapshot=g,n(y)&&w({inst:y})},[m,b,g]),a(function(){return n(y)&&w({inst:y}),m(function(){n(y)&&w({inst:y})})},[m]),d(b),b}function n(m){var g=m.getSnapshot;m=m.value;try{var b=g();return!s(m,b)}catch{return!0}}function r(m,g){return g()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var i=v,s=typeof Object.is=="function"?Object.is:e,o=i.useState,a=i.useEffect,l=i.useLayoutEffect,d=i.useDebugValue,u=!1,h=!1,p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;o0.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:p,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),o0}var l0;function ef(){return l0||(l0=1,process.env.NODE_ENV==="production"?mh.exports=bB():mh.exports=yB()),mh.exports}var G1=ef(),c0=Object.defineProperty,xB=(e,t)=>{let n={};for(var r in e)c0(n,r,{get:e[r],enumerable:!0});return c0(n,Symbol.toStringTag,{value:"Module"}),n};function cn(e){this.content=e}cn.prototype={constructor:cn,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),s=r.content.slice();return i==-1?s.push(n||e,t):(s[i+1]=t,n&&(s[i]=n)),new cn(s)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new cn(n)},addToStart:function(e,t){return new cn([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new cn(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),s=r.find(e);return i.splice(s==-1?i.length:s,0,t,n),new cn(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=cn.from(e),e.size?new cn(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=cn.from(e),e.size?new cn(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=cn.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}};cn.from=function(e){if(e instanceof cn)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new cn(t)};function W1(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),s=t.child(r);if(i==s){n+=i.nodeSize;continue}if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){let o=i.text,a=s.text,l=0;for(;o[l]==a[l];l++)n++;return l&&l<o.length&&l<a.length&&K1(o.charCodeAt(l-1))&&z1(o.charCodeAt(l))&&n--,n}if(i.content.size||s.content.size){let o=W1(i.content,s.content,n+1);if(o!=null)return o}n+=i.nodeSize}}function Y1(e,t,n,r){for(let i=e.childCount,s=t.childCount;;){if(i==0||s==0)return i==s?null:{a:n,b:r};let o=e.child(--i),a=t.child(--s),l=o.nodeSize;if(o==a){n-=l,r-=l;continue}if(!o.sameMarkup(a))return{a:n,b:r};if(o.isText&&o.text!=a.text){let d=o.text,u=a.text,h=d.length,p=u.length;for(;h>0&&p>0&&d[h-1]==u[p-1];)h--,p--,n--,r--;return h&&p&&h<d.length&&K1(d.charCodeAt(h-1))&&z1(d.charCodeAt(h))&&(n++,r++),{a:n,b:r}}if(o.content.size||a.content.size){let d=Y1(o.content,a.content,n-1,r-1);if(d)return d}n-=l,r-=l}}function z1(e){return e>=56320&&e<57344}function K1(e){return e>=55296&&e<56320}class V{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,n,r,i=0,s){for(let o=0,a=0;a<n;o++){let l=this.content[o],d=a+l.nodeSize;if(d>t&&r(l,i+a,s||null,o)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,t-u),Math.min(l.content.size,n-u),r,i+u)}a=d}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,i){let s="",o=!0;return this.nodesBetween(t,n,(a,l)=>{let d=a.isText?a.text.slice(Math.max(t,l)-l,n-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&d||a.isTextblock)&&r&&(o?o=!1:s+=r),s+=d},0),s}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),s=1);s<t.content.length;s++)i.push(t.content[s]);return new V(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let s=0,o=0;o<n;s++){let a=this.content[s],l=o+a.nodeSize;l>t&&((o<t||l>n)&&(a.isText?a=a.cut(Math.max(0,t-o),Math.min(a.text.length,n-o)):a=a.cut(Math.max(0,t-o-1),Math.min(a.content.size,n-o-1))),r.push(a),i+=a.nodeSize),o=l}return new V(r,i)}cutByIndex(t,n){return t==n?V.empty:t==0&&n==this.content.length?this:new V(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new V(i,s)}addToStart(t){return new V([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new V(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let n=this.content[t];if(!n)throw new RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];t(i,r,n),r+=i.nodeSize}}findDiffStart(t,n=0){return W1(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return Y1(this,t,n,r)}findIndex(t){if(t==0)return Kl(0,t);if(t==this.size)return Kl(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),s=r+i.nodeSize;if(s>=t)return s==t?Kl(n+1,s):Kl(n,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return V.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return V.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return V.empty;let n,r=0;for(let i=0;i<t.length;i++){let s=t[i];r+=s.nodeSize,i&&s.isText&&t[i-1].sameMarkup(s)?(n||(n=t.slice(0,i)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new V(n||t,r)}static from(t){if(!t)return V.empty;if(t instanceof V)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new V([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}V.empty=new V([],0);const gh={index:0,offset:0};function Kl(e,t){return gh.index=e,gh.offset=t,gh}function Kc(e,t){if(e===t)return!0;if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!Kc(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!Kc(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}let yt=class Lp{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,r=!1;for(let i=0;i<t.length;i++){let s=t[i];if(this.eq(s))return t;if(this.type.excludes(s.type))n||(n=t.slice(0,i));else{if(s.type.excludes(this.type))return t;!r&&s.type.rank>this.type.rank&&(n||(n=t.slice(0,i)),n.push(this),r=!0),n&&n.push(s)}}return n||(n=t.slice()),r||n.push(this),n}removeFromSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&Kc(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=t.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].eq(n[r]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return Lp.none;if(t instanceof Lp)return[t];let n=t.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};yt.none=[];class qa extends Error{}class Ae{constructor(t,n,r){this.content=t,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=V1(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new Ae(r,this.openStart,this.openEnd)}removeBetween(t,n){return new Ae(Q1(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return Ae.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Ae(V.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let s=t.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=t.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)i++;return new Ae(t,r,i)}}Ae.empty=new Ae(V.empty,0,0);function Q1(e,t,n){let{index:r,offset:i}=e.findIndex(t),s=e.maybeChild(r),{index:o,offset:a}=e.findIndex(n);if(i==t||s.isText){if(a!=n&&!e.child(o).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=o)throw new RangeError("Removing non-flat range");return e.replaceChild(r,s.copy(Q1(s.content,t-i-1,n-i-1)))}function V1(e,t,n,r,i,s){let{index:o,offset:a}=e.findIndex(t),l=e.maybeChild(o);if(a==t||l.isText)return s&&r<=0&&i<=0&&!s.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let d=V1(l.content,t-a-1,n,o==0?r-1:0,o==e.childCount-1?i-1:0,l);return d&&e.replaceChild(o,l.copy(d))}function vB(e,t,n){if(n.openStart>e.depth)throw new qa("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new qa("Inconsistent open depths");return q1(e,t,n,0)}function q1(e,t,n,r){let i=e.index(r),s=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=q1(e,t,n,r+1);return s.copy(s.content.replaceChild(i,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let o=e.parent,a=o.content;return Ns(o,a.cut(0,e.parentOffset).append(n.content).append(a.cut(t.parentOffset)))}else{let{start:o,end:a}=wB(n,e);return Ns(s,Z1(e,o,a,t,r))}else return Ns(s,Qc(e,t,r))}function J1(e,t){if(!t.type.compatibleContent(e.type))throw new qa("Cannot join "+t.type.name+" onto "+e.type.name)}function jp(e,t,n){let r=e.node(n);return J1(r,t.node(n)),r}function _s(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function _a(e,t,n,r){let i=(t||e).node(n),s=0,o=t?t.index(n):i.childCount;e&&(s=e.index(n),e.depth>n?s++:e.textOffset&&(_s(e.nodeAfter,r),s++));for(let a=s;a<o;a++)_s(i.child(a),r);t&&t.depth==n&&t.textOffset&&_s(t.nodeBefore,r)}function Ns(e,t){if(!e.type.validContent(t))throw new qa("Invalid content for node "+e.type.name);return e.copy(t)}function Z1(e,t,n,r,i){let s=e.depth>i&&jp(e,t,i+1),o=r.depth>i&&jp(n,r,i+1),a=[];return _a(null,e,i,a),s&&o&&t.index(i)==n.index(i)?(J1(s,o),_s(Ns(s,Z1(e,t,n,r,i+1)),a)):(s&&_s(Ns(s,Qc(e,t,i+1)),a),_a(t,n,i,a),o&&_s(Ns(o,Qc(n,r,i+1)),a)),_a(r,null,i,a),new V(a)}function Qc(e,t,n){let r=[];if(_a(null,e,n,r),e.depth>n){let i=jp(e,t,n+1);_s(Ns(i,Qc(e,t,n+1)),r)}return _a(t,null,n,r),new V(r)}function wB(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let i=n-1;i>=0;i--)r=t.node(i).copy(V.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}class Ja{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=t.child(n);return r?t.child(n).cut(r):i}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let s=0;s<t;s++)i+=r.child(s).nodeSize;return i}marks(){let t=this.parent,n=this.index();if(t.content.size==0)return yt.none;if(this.textOffset)return t.child(n).marks;let r=t.maybeChild(n-1),i=t.maybeChild(n);if(!r){let a=r;r=i,i=a}let s=r.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!i||!s[o].isInSet(i.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=t.parent.maybeChild(t.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!i||!r[s].isInSet(i.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);r>=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new Vc(this,t,r);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,s=n;for(let o=t;;){let{index:a,offset:l}=o.content.findIndex(s),d=s-l;if(r.push(o,a,i+l),!d||(o=o.child(a),o.isText))break;s=d-1,i+=l+1}return new Ja(n,r,s)}static resolveCached(t,n){let r=d0.get(t);if(r)for(let s=0;s<r.elts.length;s++){let o=r.elts[s];if(o.pos==n)return o}else d0.set(t,r=new kB);let i=r.elts[r.i]=Ja.resolve(t,n);return r.i=(r.i+1)%EB,i}}class kB{constructor(){this.elts=[],this.i=0}}const EB=12,d0=new WeakMap;class Vc{constructor(t,n,r){this.$from=t,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const CB=Object.create(null);let Is=class Bp{constructor(t,n,r,i=yt.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||V.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,n,r,i=0){this.content.nodesBetween(t,n,r,i,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,n,r,i){return this.content.textBetween(t,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,n,r){return this.type==t&&Kc(this.attrs,n||t.defaultAttrs||CB)&&yt.sameSet(this.marks,r||yt.none)}copy(t=null){return t==this.content?this:new Bp(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new Bp(this.type,this.attrs,this.content,t)}cut(t,n=this.content.size){return t==0&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,r=!1){if(t==n)return Ae.empty;let i=this.resolve(t),s=this.resolve(n),o=r?0:i.sharedDepth(n),a=i.start(o),l=i.node(o).content.cut(i.pos-a,s.pos-a);return new Ae(l,i.depth-o,s.depth-o)}replace(t,n,r){return vB(this.resolve(t),this.resolve(n),r)}nodeAt(t){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(t);if(n=n.maybeChild(r),!n)return null;if(i==t||n.isText)return n;t-=i+1}}childAfter(t){let{index:n,offset:r}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(t);if(r<t)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(t){return Ja.resolveCached(this,t)}resolveNoCache(t){return Ja.resolve(this,t)}rangeHasMark(t,n,r){let i=!1;return n>t&&this.nodesBetween(t,n,s=>(r.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),X1(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=V.empty,i=0,s=r.childCount){let o=this.contentMatchAt(t).matchFragment(r,i,s),a=o&&o.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=i;l<s;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(t,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(t).matchType(r),o=s&&s.matchFragment(this.content,n);return o?o.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let t=yt.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),t=r.addToSet(t)}if(!yt.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,r)}let i=V.fromJSON(t,n.content),s=t.nodeType(n.type).create(n.attrs,i,r);return s.type.checkAttrs(s.attrs),s}};Is.prototype.text=void 0;class qc extends Is{constructor(t,n,r,i){if(super(t,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):X1(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new qc(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new qc(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function X1(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Bs{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new TB(t,n);if(r.next==null)return Bs.empty;let i=ew(r);r.next&&r.err("Unexpected trailing text");let s=OB(MB(i));return RB(s,r),s}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,r=t.childCount){let i=this;for(let s=n;i&&s<r;s++)i=i.matchType(t.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let r=0;r<t.next.length;r++)if(this.next[n].type==t.next[r].type)return!0;return!1}fillBefore(t,n=!1,r=0){let i=[this];function s(o,a){let l=o.matchFragment(t,r);if(l&&(!n||l.validEnd))return V.from(a.map(d=>d.createAndFill()));for(let d=0;d<o.next.length;d++){let{type:u,next:h}=o.next[d];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(h)==-1){i.push(h);let p=s(h,a.concat(u));if(p)return p}}return null}return s(this,[])}findWrapping(t){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==t)return this.wrapCache[r+1];let n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}computeWrapping(t){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),s=i.match;if(s.matchType(t)){let o=[];for(let a=i;a.type;a=a.via)o.push(a.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:a,next:l}=s.next[o];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!i.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(r){t.push(r);for(let i=0;i<r.next.length;i++)t.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),t.map((r,i)=>{let s=i+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)s+=(o?", ":"")+r.next[o].type.name+"->"+t.indexOf(r.next[o].next);return s}).join(`
|
|
129
|
+
`)}}Bs.empty=new Bs(!0);class TB{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function ew(e){let t=[];do t.push(SB(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function SB(e){let t=[];do t.push(_B(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function _B(e){let t=DB(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=NB(e,t);else break;return t}function u0(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function NB(e,t){let n=u0(e),r=n;return e.eat(",")&&(e.next!="}"?r=u0(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function IB(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let s in n){let o=n[s];o.isInGroup(t)&&i.push(o)}return i.length==0&&e.err("No node type or group '"+t+"' found"),i}function DB(e){if(e.eat("(")){let t=ew(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=IB(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function MB(e){let t=[[]];return i(s(e,0),n()),t;function n(){return t.push([])-1}function r(o,a,l){let d={term:l,to:a};return t[o].push(d),d}function i(o,a){o.forEach(l=>l.to=a)}function s(o,a){if(o.type=="choice")return o.exprs.reduce((l,d)=>l.concat(s(d,a)),[]);if(o.type=="seq")for(let l=0;;l++){let d=s(o.exprs[l],a);if(l==o.exprs.length-1)return d;i(d,a=n())}else if(o.type=="star"){let l=n();return r(a,l),i(s(o.expr,l),l),[r(l)]}else if(o.type=="plus"){let l=n();return i(s(o.expr,a),l),i(s(o.expr,l),l),[r(l)]}else{if(o.type=="opt")return[r(a)].concat(s(o.expr,a));if(o.type=="range"){let l=a;for(let d=0;d<o.min;d++){let u=n();i(s(o.expr,l),u),l=u}if(o.max==-1)i(s(o.expr,l),l);else for(let d=o.min;d<o.max;d++){let u=n();r(l,u),i(s(o.expr,l),u),l=u}return[r(l)]}else{if(o.type=="name")return[r(a,void 0,o.value)];throw new Error("Unknown expr type")}}}}function tw(e,t){return t-e}function h0(e,t){let n=[];return r(t),n.sort(tw);function r(i){let s=e[i];if(s.length==1&&!s[0].term)return r(s[0].to);n.push(i);for(let o=0;o<s.length;o++){let{term:a,to:l}=s[o];!a&&n.indexOf(l)==-1&&r(l)}}}function OB(e){let t=Object.create(null);return n(h0(e,0));function n(r){let i=[];r.forEach(o=>{e[o].forEach(({term:a,to:l})=>{if(!a)return;let d;for(let u=0;u<i.length;u++)i[u][0]==a&&(d=i[u][1]);h0(e,l).forEach(u=>{d||i.push([a,d=[]]),d.indexOf(u)==-1&&d.push(u)})})});let s=t[r.join(",")]=new Bs(r.indexOf(e.length-1)>-1);for(let o=0;o<i.length;o++){let a=i[o][1].sort(tw);s.next.push({type:i[o][0],next:t[a.join(",")]||n(a)})}return s}}function RB(e,t){for(let n=0,r=[e];n<r.length;n++){let i=r[n],s=!i.validEnd,o=[];for(let a=0;a<i.next.length;a++){let{type:l,next:d}=i.next[a];o.push(l.name),s&&!(l.isText||l.hasRequiredAttrs())&&(s=!1),r.indexOf(d)==-1&&r.push(d)}s&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function nw(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function rw(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let s=e[r];if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function iw(e,t,n,r){for(let i in t)if(!(i in e))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let i in e)e[i].validate&&e[i].validate(t[i])}function sw(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new jB(e,r,t[r]);return n}let p0=class ow{constructor(t,n,r){this.name=t,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=sw(t,r.attrs),this.defaultAttrs=nw(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Bs.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(t){return this.groups.indexOf(t)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:rw(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Is(this,this.computeAttrs(t),V.from(n),yt.setFrom(r))}createChecked(t=null,n,r){return n=V.from(n),this.checkContent(n),new Is(this,this.computeAttrs(t),n,yt.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),n=V.from(n),n.size){let o=this.contentMatch.fillBefore(n);if(!o)return null;n=o.append(n)}let i=this.contentMatch.matchFragment(n),s=i&&i.fillBefore(V.empty,!0);return s?new Is(this,t,n.append(s),yt.setFrom(r)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let r=0;r<t.childCount;r++)if(!this.allowsMarks(t.child(r).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}checkAttrs(t){iw(this.attrs,t,"node",this.name)}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let n;for(let r=0;r<t.length;r++)this.allowsMarkType(t[r].type)?n&&n.push(t[r]):n||(n=t.slice(0,r));return n?n.length?n:yt.none:t}static compile(t,n){let r=Object.create(null);t.forEach((s,o)=>r[s]=new ow(s,n,o));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function LB(e,t,n){let r=n.split("|");return i=>{let s=i===null?"null":typeof i;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${s}`)}}class jB{constructor(t,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?LB(t,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class iu{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=sw(t,i.attrs),this.excluded=null;let s=nw(this.attrs);this.instance=s?new yt(this,s):null}create(t=null){return!t&&this.instance?this.instance:new yt(this,rw(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((s,o)=>r[s]=new iu(s,i++,n,o)),r}removeFromSet(t){for(var n=0;n<t.length;n++)t[n].type==this&&(t=t.slice(0,n).concat(t.slice(n+1)),n--);return t}isInSet(t){for(let n=0;n<t.length;n++)if(t[n].type==this)return t[n]}checkAttrs(t){iw(this.attrs,t,"mark",this.name)}excludes(t){return this.excluded.indexOf(t)>-1}}class aw{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in t)n[i]=t[i];n.nodes=cn.from(t.nodes),n.marks=cn.from(t.marks||{}),this.nodes=p0.compile(this.spec.nodes,this),this.marks=iu.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],o=s.spec.content||"",a=s.spec.marks;if(s.contentMatch=r[o]||(r[o]=Bs.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=a=="_"?null:a?m0(this,a.split(" ")):a==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:m0(this,o.split(" "))}this.nodeFromJSON=i=>Is.fromJSON(this,i),this.markFromJSON=i=>yt.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,r,i){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof p0){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,r,i)}text(t,n){let r=this.nodes.text;return new qc(r,r.defaultAttrs,t,yt.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function m0(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],s=e.marks[i],o=s;if(s)n.push(s);else for(let a in e.marks){let l=e.marks[a];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&n.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}function BB(e){return e.tag!=null}function PB(e){return e.style!=null}class Fi{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(BB(i))this.tags.push(i);else if(PB(i)){let s=/[^=]*/.exec(i.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=t.nodes[i.node];return s.contentMatch.matchType(s)})}parse(t,n={}){let r=new g0(this,n,!1);return r.addAll(t,yt.none,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new g0(this,n,!0);return r.addAll(t,yt.none,n.from,n.to),Ae.maxOpen(r.finish())}matchTag(t,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(HB(t,s.tag)&&(s.namespace===void 0||t.namespaceURI==s.namespace)&&(!s.context||n.matchesContext(s.context))){if(s.getAttrs){let o=s.getAttrs(t);if(o===!1)continue;s.attrs=o||void 0}return s}}}matchStyle(t,n,r,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let o=this.styles[s],a=o.style;if(!(a.indexOf(t)!=0||o.context&&!r.matchesContext(o.context)||a.length>t.length&&(a.charCodeAt(t.length)!=61||a.slice(t.length+1)!=n))){if(o.getAttrs){let l=o.getAttrs(n);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(t){let n=[];function r(i){let s=i.priority==null?50:i.priority,o=0;for(;o<n.length;o++){let a=n[o];if((a.priority==null?50:a.priority)<s)break}n.splice(o,0,i)}for(let i in t.marks){let s=t.marks[i].spec.parseDOM;s&&s.forEach(o=>{r(o=A0(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in t.nodes){let s=t.nodes[i].spec.parseDOM;s&&s.forEach(o=>{r(o=A0(o)),o.node||o.ignore||o.mark||(o.node=i)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new Fi(t,Fi.schemaRules(t)))}}const lw={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},FB={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},cw={ol:!0,ul:!0},Za=1,Pp=2,Na=4;function f0(e,t,n){return t!=null?(t?Za:0)|(t==="full"?Pp:0):e&&e.whitespace=="pre"?Za|Pp:n&~Na}class Ql{constructor(t,n,r,i,s,o){this.type=t,this.attrs=n,this.marks=r,this.solid=i,this.options=o,this.content=[],this.activeMarks=yt.none,this.match=s||(o&Na?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(V.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(t.type))?(this.match=r,i):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&Za)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let n=V.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(V.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!lw.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class g0{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,s,o=f0(null,n.preserveWhitespace,0)|(r?Na:0);i?s=new Ql(i.type,i.attrs,yt.none,!0,n.topMatch||i.type.contentMatch,o):r?s=new Ql(null,null,yt.none,!0,null,o):s=new Ql(t.schema.topNodeType,null,yt.none,!0,null,o),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,n){t.nodeType==3?this.addTextNode(t,n):t.nodeType==1&&this.addElement(t,n)}addTextNode(t,n){let r=t.nodeValue,i=this.top,s=i.options&Pp?"full":this.localPreserveWS||(i.options&Za)>0,{schema:o}=this.parser;if(s==="full"||i.inlineContext(t)||/[^ \t\r\n\u000c]/.test(r)){if(s)if(s==="full")r=r.replace(/\r\n?/g,`
|
|
130
|
+
`);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let a=r.split(/\r?\n|\r/);for(let l=0;l<a.length;l++)l&&this.insertNode(o.linebreakReplacement.create(),n,!0),a[l]&&this.insertNode(o.text(a[l]),n,!/\S/.test(a[l]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let a=i.content[i.content.length-1],l=t.previousSibling;(!a||l&&l.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(r=r.slice(1))}r&&this.insertNode(o.text(r),n,!/\S/.test(r)),this.findInText(t)}else this.findInside(t)}addElement(t,n,r){let i=this.localPreserveWS,s=this.top;(t.tagName=="PRE"||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let o=t.nodeName.toLowerCase(),a;cw.hasOwnProperty(o)&&this.parser.normalizeLists&&$B(t);let l=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(a=this.parser.matchTag(t,this,r));e:if(l?l.ignore:FB.hasOwnProperty(o))this.findInside(t),this.ignoreFallback(t,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(t=l.skip);let d,u=this.needsBlock;if(lw.hasOwnProperty(o))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),d=!0,s.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,n);break e}let h=l&&l.skip?n:this.readStyles(t,n);h&&this.addAll(t,h),d&&this.sync(s),this.needsBlock=u}else{let d=this.readStyles(t,n);d&&this.addElementByRule(t,l,d,l.consuming===!1?a:void 0)}this.localPreserveWS=i}leafFallback(t,n){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
|
|
131
|
+
`),n)}ignoreFallback(t,n){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(t,n){let r=t.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],o=r.getPropertyValue(s);if(o)for(let a=void 0;;){let l=this.parser.matchStyle(s,o,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(d=>!l.clearMark(d)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(t,n,r,i){let s,o;if(n.node)if(o=this.parser.schema.nodes[n.node],o.isLeaf)this.insertNode(o.create(n.attrs),r,t.nodeName=="BR")||this.leafFallback(t,r);else{let l=this.enter(o,n.attrs||null,r,n.preserveWhitespace);l&&(s=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let a=this.top;if(o&&o.isLeaf)this.findInside(t);else if(i)this.addElement(t,r,i);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=t;typeof n.contentElement=="string"?l=t.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(t):n.contentElement&&(l=n.contentElement),this.findAround(t,l,!0),this.addAll(l,r),this.findAround(t,l,!1)}s&&this.sync(a)&&this.open--}addAll(t,n,r,i){let s=r||0;for(let o=r?t.childNodes[r]:t.firstChild,a=i==null?null:t.childNodes[i];o!=a;o=o.nextSibling,++s)this.findAtPoint(t,s),this.addDOM(o,n);this.findAtPoint(t,s)}findPlace(t,n,r){let i,s;for(let o=this.open,a=0;o>=0;o--){let l=this.nodes[o],d=l.findWrapping(t);if(d&&(!i||i.length>d.length+a)&&(i=d,s=l,!d.length))break;if(l.solid){if(r)break;a+=2}}if(!i)return null;this.sync(s);for(let o=0;o<i.length;o++)n=this.enterInner(i[o],null,n,!1);return n}insertNode(t,n,r){if(t.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(n=this.enterInner(s,null,n))}let i=this.findPlace(t,n,r);if(i){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(t.type));let o=yt.none;for(let a of i.concat(t.marks))(s.type?s.type.allowsMarkType(a.type):b0(a.type,t.type))&&(o=a.addToSet(o));return s.content.push(t.mark(o)),!0}return!1}enter(t,n,r,i){let s=this.findPlace(t.create(n),r,!1);return s&&(s=this.enterInner(t,n,r,!0,i)),s}enterInner(t,n,r,i=!1,s){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(t);let a=f0(t,s,o.options);o.options&Na&&o.content.length==0&&(a|=Na);let l=yt.none;return r=r.filter(d=>(o.type?o.type.allowsMarkType(d.type):b0(d.type,t))?(l=d.addToSet(l),!1):!0),this.nodes.push(new Ql(t,n,l,i,null,a)),this.open++,r}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Za)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)t+=r[i].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==t&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&t.nodeType==1&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,r){if(t!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&t.nodeType==1&&t.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),s=-(r?r.depth+1:0)+(i?0:1),o=(a,l)=>{for(;a>=0;a--){let d=n[a];if(d==""){if(a==n.length-1||a==0)continue;for(;l>=s;l--)if(o(a-1,l))return!0;return!1}else{let u=l>0||l==0&&i?this.nodes[l].type:r&&l>=s?r.node(l-s).type:null;if(!u||u.name!=d&&!u.isInGroup(d))return!1;l--}}return!0};return o(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function $B(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&cw.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function HB(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function A0(e){let t={};for(let n in e)t[n]=e[n];return t}function b0(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let s=[],o=a=>{s.push(a);for(let l=0;l<a.edgeCount;l++){let{type:d,next:u}=a.edge(l);if(d==t||s.indexOf(u)<0&&o(u))return!0}};if(o(i.contentMatch))return!0}}class zs{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=Vl(n).createDocumentFragment());let i=r,s=[];return t.forEach(o=>{if(s.length||o.marks.length){let a=0,l=0;for(;a<s.length&&l<o.marks.length;){let d=o.marks[l];if(!this.marks[d.type.name]){l++;continue}if(!d.eq(s[a][0])||d.type.spec.spanning===!1)break;a++,l++}for(;a<s.length;)i=s.pop()[1];for(;l<o.marks.length;){let d=o.marks[l++],u=this.serializeMark(d,o.isInline,n);u&&(s.push([d,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(this.serializeNodeInner(o,n))}),r}serializeNodeInner(t,n){if(t.isText)return Vl(n).createTextNode(t.text);let{dom:r,contentDOM:i}=gc(Vl(n),this.nodes[t.type.name](t),null,t.attrs);if(i){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,i)}return r}serializeNode(t,n={}){let r=this.serializeNodeInner(t,n);for(let i=t.marks.length-1;i>=0;i--){let s=this.serializeMark(t.marks[i],t.isInline,n);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(t,n,r={}){let i=this.marks[t.type.name];return i&&gc(Vl(r),i(t,n),null,t.attrs)}static renderSpec(t,n,r=null,i){return typeof n=="string"?{dom:t.createTextNode(n)}:gc(t,n,r,i)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new zs(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=y0(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return y0(t.marks)}}function y0(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Vl(e){return e.document||window.document}const x0=new WeakMap;function UB(e){let t=x0.get(e);return t===void 0&&x0.set(e,t=GB(e)),t}function GB(e){let t=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")t||(t=[]),t.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(e),t}function gc(e,t,n,r){if(t.nodeType==1)return{dom:t};if(t.dom&&t.dom.nodeType==1)return t;let i=t[0],s;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(s=UB(r))&&s.indexOf(t)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let a,l=n?e.createElementNS(n,i):e.createElement(i),d=t[1],u=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){u=2;for(let h in d)if(d[h]!=null){let p=h.indexOf(" ");p>0?l.setAttributeNS(h.slice(0,p),h.slice(p+1),d[h]):h=="style"&&l.style?l.style.cssText=d[h]:l.setAttribute(h,d[h])}}for(let h=u;h<t.length;h++){let p=t[h];if(p===0){if(h<t.length-1||h>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else if(typeof p=="string")l.appendChild(e.createTextNode(p));else{let{dom:m,contentDOM:g}=gc(e,p,n,r);if(l.appendChild(m),g){if(a)throw new RangeError("Multiple content holes");a=g}}}return{dom:l,contentDOM:a}}const dw=65535,uw=Math.pow(2,16);function WB(e,t){return e+t*uw}function v0(e){return e&dw}function YB(e){return(e-(e&dw))/uw}const hw=1,pw=2,Ac=4,mw=8;class Fp{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&mw)>0}get deletedBefore(){return(this.delInfo&(hw|Ac))>0}get deletedAfter(){return(this.delInfo&(pw|Ac))>0}get deletedAcross(){return(this.delInfo&Ac)>0}}class Kn{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Kn.empty)return Kn.empty}recover(t){let n=0,r=v0(t);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+YB(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let i=0,s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>t)break;let d=this.ranges[a+s],u=this.ranges[a+o],h=l+d;if(t<=h){let p=d?t==l?-1:t==h?1:n:n,m=l+i+(p<0?0:u);if(r)return m;let g=t==(n<0?l:h)?null:WB(a/3,t-l),b=t==l?pw:t==h?hw:Ac;return(n<0?t!=l:t!=h)&&(b|=mw),new Fp(m,b,g)}i+=u-d}return r?t+i:new Fp(t+i,0,null)}touches(t,n){let r=0,i=v0(n),s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>t)break;let d=this.ranges[a+s],u=l+d;if(t<=u&&a==i*3)return!0;r+=this.ranges[a+o]-d}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let o=this.ranges[i],a=o-(this.inverted?s:0),l=o+(this.inverted?0:s),d=this.ranges[i+n],u=this.ranges[i+r];t(a,a+d,l,l+u),s+=u-d}}invert(){return new Kn(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?Kn.empty:new Kn(t<0?[0,-t,0]:[0,0,t])}}Kn.empty=new Kn([]);class Xa{constructor(t,n,r=0,i=t?t.length:0){this.mirror=n,this.from=r,this.to=i,this._maps=t||[],this.ownData=!(t||n)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new Xa(this._maps,this.mirror,t,n)}appendMap(t,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(t),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(t){for(let n=0,r=this._maps.length;n<t._maps.length;n++){let i=t.getMirror(n);this.appendMap(t._maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(t){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==t)return this.mirror[n+(n%2?-1:1)]}}setMirror(t,n){this.mirror||(this.mirror=[]),this.mirror.push(t,n)}appendMappingInverted(t){for(let n=t.maps.length-1,r=this._maps.length+t._maps.length;n>=0;n--){let i=t.getMirror(n);this.appendMap(t._maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let t=new Xa;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let r=this.from;r<this.to;r++)t=this._maps[r].map(t,n);return t}mapResult(t,n=1){return this._map(t,n,!1)}_map(t,n,r){let i=0;for(let s=this.from;s<this.to;s++){let o=this._maps[s],a=o.mapResult(t,n);if(a.recover!=null){let l=this.getMirror(s);if(l!=null&&l>s&&l<this.to){s=l,t=this._maps[l].recover(a.recover);continue}}i|=a.delInfo,t=a.pos}return r?t:new Fp(t,i,null)}}const Ah=Object.create(null);class yn{getMap(){return Kn.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Ah[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in Ah)throw new RangeError("Duplicate use of step JSON ID "+t);return Ah[t]=n,n.prototype.jsonID=t,n}}class Wt{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Wt(t,null)}static fail(t){return new Wt(null,t)}static fromReplace(t,n,r,i){try{return Wt.ok(t.replace(n,r,i))}catch(s){if(s instanceof qa)return Wt.fail(s.message);throw s}}}function tf(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let s=e.child(i);s.content.size&&(s=s.copy(tf(s.content,t,s))),s.isInline&&(s=t(s,n,i)),r.push(s)}return V.fromArray(r)}class ji extends yn{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=t.resolve(this.from),i=r.node(r.sharedDepth(this.to)),s=new Ae(tf(n.content,(o,a)=>!o.isAtom||!a.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),n.openStart,n.openEnd);return Wt.fromReplace(t,this.from,this.to,s)}invert(){return new Tr(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new ji(n.pos,r.pos,this.mark)}merge(t){return t instanceof ji&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new ji(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new ji(n.from,n.to,t.markFromJSON(n.mark))}}yn.jsonID("addMark",ji);class Tr extends yn{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new Ae(tf(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return Wt.fromReplace(t,this.from,this.to,r)}invert(){return new ji(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Tr(n.pos,r.pos,this.mark)}merge(t){return t instanceof Tr&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Tr(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Tr(n.from,n.to,t.markFromJSON(n.mark))}}yn.jsonID("removeMark",Tr);class Bi extends yn{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Wt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Wt.fromReplace(t,this.pos,this.pos+1,new Ae(V.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new Bi(this.pos,n.marks[i]);return new Bi(this.pos,this.mark)}}return new Ps(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Bi(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Bi(n.pos,t.markFromJSON(n.mark))}}yn.jsonID("addNodeMark",Bi);class Ps extends yn{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Wt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Wt.fromReplace(t,this.pos,this.pos+1,new Ae(V.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Bi(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Ps(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Ps(n.pos,t.markFromJSON(n.mark))}}yn.jsonID("removeNodeMark",Ps);class $t extends yn{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&$p(t,this.from,this.to)?Wt.fail("Structure replace would overwrite content"):Wt.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Kn([this.from,this.to-this.from,this.slice.size])}invert(t){return new $t(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&$t.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new $t(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof $t)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?Ae.empty:new Ae(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new $t(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?Ae.empty:new Ae(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new $t(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new $t(n.from,n.to,Ae.fromJSON(t,n.slice),!!n.structure)}}$t.MAP_BIAS=1;yn.jsonID("replace",$t);class rn extends yn{constructor(t,n,r,i,s,o,a=!1){super(),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=s,this.insert=o,this.structure=a}apply(t){if(this.structure&&($p(t,this.from,this.gapFrom)||$p(t,this.gapTo,this.to)))return Wt.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Wt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Wt.fromReplace(t,this.from,this.to,r):Wt.fail("Content does not fit in gap")}getMap(){return new Kn([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new rn(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||s>r.pos?null:new rn(n.pos,r.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new rn(n.from,n.to,n.gapFrom,n.gapTo,Ae.fromJSON(t,n.slice),n.insert,!!n.structure)}}yn.jsonID("replaceAround",rn);function $p(e,t,n){let r=e.resolve(t),i=n-t,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let o=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function zB(e,t,n,r){let i=[],s=[],o,a;e.doc.nodesBetween(t,n,(l,d,u)=>{if(!l.isInline)return;let h=l.marks;if(!r.isInSet(h)&&u.type.allowsMarkType(r.type)){let p=Math.max(d,t),m=Math.min(d+l.nodeSize,n),g=r.addToSet(h);for(let b=0;b<h.length;b++)h[b].isInSet(g)||(o&&o.to==p&&o.mark.eq(h[b])?o.to=m:i.push(o=new Tr(p,m,h[b])));a&&a.to==p?a.to=m:s.push(a=new ji(p,m,r))}}),i.forEach(l=>e.step(l)),s.forEach(l=>e.step(l))}function KB(e,t,n,r){let i=[],s=0;e.doc.nodesBetween(t,n,(o,a)=>{if(!o.isInline)return;s++;let l=null;if(r instanceof iu){let d=o.marks,u;for(;u=r.isInSet(d);)(l||(l=[])).push(u),d=u.removeFromSet(d)}else r?r.isInSet(o.marks)&&(l=[r]):l=o.marks;if(l&&l.length){let d=Math.min(a+o.nodeSize,n);for(let u=0;u<l.length;u++){let h=l[u],p;for(let m=0;m<i.length;m++){let g=i[m];g.step==s-1&&h.eq(i[m].style)&&(p=g)}p?(p.to=d,p.step=s):i.push({style:h,from:Math.max(a,t),to:d,step:s})}}}),i.forEach(o=>e.step(new Tr(o.from,o.to,o.style)))}function nf(e,t,n,r=n.contentMatch,i=!0){let s=e.doc.nodeAt(t),o=[],a=t+1;for(let l=0;l<s.childCount;l++){let d=s.child(l),u=a+d.nodeSize,h=r.matchType(d.type);if(!h)o.push(new $t(a,u,Ae.empty));else{r=h;for(let p=0;p<d.marks.length;p++)n.allowsMarkType(d.marks[p].type)||e.step(new Tr(a,u,d.marks[p]));if(i&&d.isText&&n.whitespace!="pre"){let p,m=/\r?\n|\r/g,g;for(;p=m.exec(d.text);)g||(g=new Ae(V.from(n.schema.text(" ",n.allowedMarks(d.marks))),0,0)),o.push(new $t(a+p.index,a+p.index+p[0].length,g))}}a=u}if(!r.validEnd){let l=r.fillBefore(V.empty,!0);e.replace(a,a,new Ae(l,0,0))}for(let l=o.length-1;l>=0;l--)e.step(o[l])}function QB(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Uo(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let s=e.$from.node(n),o=e.$from.index(n)+r,a=e.$to.indexAfter(n)-i;if(n<e.depth&&s.canReplace(o,a,t))return n;if(n==0||s.type.spec.isolating||!QB(s,o,a))break;o&&(r=1),a<s.childCount&&(i=1)}return null}function VB(e,t,n){let{$from:r,$to:i,depth:s}=t,o=r.before(s+1),a=i.after(s+1),l=o,d=a,u=V.empty,h=0;for(let g=s,b=!1;g>n;g--)b||r.index(g)>0?(b=!0,u=V.from(r.node(g).copy(u)),h++):l--;let p=V.empty,m=0;for(let g=s,b=!1;g>n;g--)b||i.after(g+1)<i.end(g)?(b=!0,p=V.from(i.node(g).copy(p)),m++):d++;e.step(new rn(l,d,o,a,new Ae(u.append(p),h,m),u.size-h,!0))}function rf(e,t,n=null,r=e){let i=qB(e,t),s=i&&JB(r,t);return s?i.map(w0).concat({type:t,attrs:n}).concat(s.map(w0)):null}function w0(e){return{type:e,attrs:null}}function qB(e,t){let{parent:n,startIndex:r,endIndex:i}=e,s=n.contentMatchAt(r).findWrapping(t);if(!s)return null;let o=s.length?s[0]:t;return n.canReplaceWith(r,i,o)?s:null}function JB(e,t){let{parent:n,startIndex:r,endIndex:i}=e,s=n.child(r),o=t.contentMatch.findWrapping(s.type);if(!o)return null;let a=(o.length?o[o.length-1]:t).contentMatch;for(let l=r;a&&l<i;l++)a=a.matchType(n.child(l).type);return!a||!a.validEnd?null:o}function ZB(e,t,n){let r=V.empty;for(let o=n.length-1;o>=0;o--){if(r.size){let a=n[o].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=V.from(n[o].type.create(n[o].attrs,r))}let i=t.start,s=t.end;e.step(new rn(i,s,i,s,new Ae(r,0,0),n.length,!0))}function XB(e,t,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=e.steps.length;e.doc.nodesBetween(t,n,(o,a)=>{let l=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(r,l)&&eP(e.doc,e.mapping.slice(s).map(a),r)){let d=null;if(r.schema.linebreakReplacement){let m=r.whitespace=="pre",g=!!r.contentMatch.matchType(r.schema.linebreakReplacement);m&&!g?d=!1:!m&&g&&(d=!0)}d===!1&&gw(e,o,a,s),nf(e,e.mapping.slice(s).map(a,1),r,void 0,d===null);let u=e.mapping.slice(s),h=u.map(a,1),p=u.map(a+o.nodeSize,1);return e.step(new rn(h,p,h+1,p-1,new Ae(V.from(r.create(l,null,o.marks)),0,0),1,!0)),d===!0&&fw(e,o,a,s),!1}})}function fw(e,t,n,r){t.forEach((i,s)=>{if(i.isText){let o,a=/\r?\n|\r/g;for(;o=a.exec(i.text);){let l=e.mapping.slice(r).map(n+1+s+o.index);e.replaceWith(l,l+1,t.type.schema.linebreakReplacement.create())}}})}function gw(e,t,n,r){t.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let o=e.mapping.slice(r).map(n+1+s);e.replaceWith(o,o+1,t.type.schema.text(`
|
|
132
|
+
`))}})}function eP(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function tP(e,t,n,r,i){let s=e.doc.nodeAt(t);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let o=n.create(r,null,i||s.marks);if(s.isLeaf)return e.replaceWith(t,t+s.nodeSize,o);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new rn(t,t+s.nodeSize,t+1,t+s.nodeSize-1,new Ae(V.from(o),0,0),1,!0))}function hi(e,t,n=1,r){let i=e.resolve(t),s=i.depth-n,o=r&&r[r.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let d=i.depth-1,u=n-2;d>s;d--,u--){let h=i.node(d),p=i.index(d);if(h.type.spec.isolating)return!1;let m=h.content.cutByIndex(p,h.childCount),g=r&&r[u+1];g&&(m=m.replaceChild(0,g.type.create(g.attrs)));let b=r&&r[u]||h;if(!h.canReplace(p+1,h.childCount)||!b.type.validContent(m))return!1}let a=i.indexAfter(s),l=r&&r[0];return i.node(s).canReplaceWith(a,a,l?l.type:i.node(s+1).type)}function nP(e,t,n=1,r){let i=e.doc.resolve(t),s=V.empty,o=V.empty;for(let a=i.depth,l=i.depth-n,d=n-1;a>l;a--,d--){s=V.from(i.node(a).copy(s));let u=r&&r[d];o=V.from(u?u.type.create(u.attrs,o):i.node(a).copy(o))}e.step(new $t(t,t,new Ae(s.append(o),n,n),!0))}function qi(e,t){let n=e.resolve(t),r=n.index();return Aw(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function rP(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let s=t.child(i),o=s.type==r?e.type.schema.nodes.text:s.type;if(n=n.matchType(o),!n||!e.type.allowsMarks(s.marks))return!1}return n.validEnd}function Aw(e,t){return!!(e&&t&&!e.isLeaf&&rP(e,t))}function su(e,t,n=-1){let r=e.resolve(t);for(let i=r.depth;;i--){let s,o,a=r.index(i);if(i==r.depth?(s=r.nodeBefore,o=r.nodeAfter):n>0?(s=r.node(i+1),a++,o=r.node(i).maybeChild(a)):(s=r.node(i).maybeChild(a-1),o=r.node(i+1)),s&&!s.isTextblock&&Aw(s,o)&&r.node(i).canReplace(a,a+1))return t;if(i==0)break;t=n<0?r.before(i):r.after(i)}}function iP(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,s=e.doc.resolve(t-n),o=s.node().type;if(i&&o.inlineContent){let u=o.whitespace=="pre",h=!!o.contentMatch.matchType(i);u&&!h?r=!1:!u&&h&&(r=!0)}let a=e.steps.length;if(r===!1){let u=e.doc.resolve(t+n);gw(e,u.node(),u.before(),a)}o.inlineContent&&nf(e,t+n-1,o,s.node().contentMatchAt(s.index()),r==null);let l=e.mapping.slice(a),d=l.map(t-n);if(e.step(new $t(d,l.map(t+n,-1),Ae.empty,!0)),r===!0){let u=e.doc.resolve(d);fw(e,u.node(),u.before(),e.steps.length)}return e}function sP(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let s=r.index(i);if(r.node(i).canReplaceWith(s,s,n))return r.before(i+1);if(s>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let s=r.indexAfter(i);if(r.node(i).canReplaceWith(s,s,n))return r.after(i+1);if(s<r.node(i).childCount)return null}return null}function bw(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let s=0;s<n.openStart;s++)i=i.firstChild.content;for(let s=1;s<=(n.openStart==0&&n.size?2:1);s++)for(let o=r.depth;o>=0;o--){let a=o==r.depth?0:r.pos<=(r.start(o+1)+r.end(o+1))/2?-1:1,l=r.index(o)+(a>0?1:0),d=r.node(o),u=!1;if(s==1)u=d.canReplace(l,l,i);else{let h=d.contentMatchAt(l).findWrapping(i.firstChild.type);u=h&&d.canReplaceWith(l,l,h[0])}if(u)return a==0?r.pos:a<0?r.before(o+1):r.after(o+1)}return null}function ou(e,t,n=t,r=Ae.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),s=e.resolve(n);return yw(i,s,r)?new $t(t,n,r):new oP(i,s,r).fit()}function yw(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class oP{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=V.empty;for(let i=0;i<=t.depth;i++){let s=t.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(t.indexAfter(i))})}for(let i=t.depth;i>0;i--)this.placed=V.from(t.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(t<0?this.$to:r.doc.resolve(t));if(!i)return null;let s=this.placed,o=r.depth,a=i.depth;for(;o&&a&&s.childCount==1;)s=s.firstChild.content,o--,a--;let l=new Ae(s,o,a);return t>-1?new rn(r.pos,t,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new $t(r.pos,i.pos,l):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<t;r++){let s=n.firstChild;if(n.childCount>1&&(i=0),s.type.spec.isolating&&i<=r){t=r;break}n=s.content}for(let n=1;n<=2;n++)for(let r=n==1?t:this.unplaced.openStart;r>=0;r--){let i,s=null;r?(s=bh(this.unplaced.content,r-1).firstChild,i=s.content):i=this.unplaced.content;let o=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:d}=this.frontier[a],u,h=null;if(n==1&&(o?d.matchType(o.type)||(h=d.fillBefore(V.from(o),!1)):s&&l.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:a,parent:s,inject:h};if(n==2&&o&&(u=d.findWrapping(o.type)))return{sliceDepth:r,frontierDepth:a,parent:s,wrap:u};if(s&&d.matchType(s.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=bh(t,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new Ae(t,n+1,Math.max(r,i.size+n>=t.size-r?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=bh(t,n);if(i.childCount<=1&&n>0){let s=t.size-n<=n+i.size;this.unplaced=new Ae(ha(t,n-1,1),n-1,s?n-1:r)}else this.unplaced=new Ae(ha(t,n,1),n,r)}placeNodes({sliceDepth:t,frontierDepth:n,parent:r,inject:i,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let b=0;b<s.length;b++)this.openFrontierNode(s[b]);let o=this.unplaced,a=r?r.content:o.content,l=o.openStart-t,d=0,u=[],{match:h,type:p}=this.frontier[n];if(i){for(let b=0;b<i.childCount;b++)u.push(i.child(b));h=h.matchFragment(i)}let m=a.size+t-(o.content.size-o.openEnd);for(;d<a.childCount;){let b=a.child(d),A=h.matchType(b.type);if(!A)break;d++,(d>1||l==0||b.content.size)&&(h=A,u.push(xw(b.mark(p.allowedMarks(b.marks)),d==1?l:0,d==a.childCount?m:-1)))}let g=d==a.childCount;g||(m=-1),this.placed=pa(this.placed,n,V.from(u)),this.frontier[n].match=h,g&&m<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let b=0,A=a;b<m;b++){let y=A.lastChild;this.frontier.push({type:y.type,match:y.contentMatchAt(y.childCount)}),A=y.content}this.unplaced=g?t==0?Ae.empty:new Ae(ha(o.content,t-1,1),t-1,m<0?o.openEnd:t-1):new Ae(ha(o.content,t,d),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!yh(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],s=n<t.depth&&t.end(n+1)==t.pos+(t.depth-(n+1)),o=yh(t,n,i,r,s);if(o){for(let a=n-1;a>=0;a--){let{match:l,type:d}=this.frontier[a],u=yh(t,a,d,l,!0);if(!u||u.childCount)continue e}return{depth:n,fit:o,move:s?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=pa(this.placed,n.depth,n.fit)),t=n.move;for(let r=n.depth+1;r<=t.depth;r++){let i=t.node(r),s=i.type.contentMatch.fillBefore(i.content,!0,t.index(r));this.openFrontierNode(i.type,i.attrs,s)}return t}openFrontierNode(t,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(t),this.placed=pa(this.placed,this.depth,V.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(V.empty,!0);t.childCount&&(this.placed=pa(this.placed,this.frontier.length,t))}}function ha(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(ha(e.firstChild.content,t-1,n)))}function pa(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(pa(e.lastChild.content,t-1,n)))}function bh(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function xw(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,xw(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(V.empty,!0)))),e.copy(r)}function yh(e,t,n,r,i){let s=e.node(t),o=i?e.indexAfter(t):e.index(t);if(o==s.childCount&&!n.compatibleContent(s.type))return null;let a=r.fillBefore(s.content,!0,o);return a&&!aP(n,s.content,o)?a:null}function aP(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function lP(e){return e.spec.defining||e.spec.definingForContent}function cP(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),s=e.doc.resolve(n);if(yw(i,s,r))return e.step(new $t(t,n,r));let o=ww(i,s);o[o.length-1]==0&&o.pop();let a=-(i.depth+1);o.unshift(a);for(let p=i.depth,m=i.pos-1;p>0;p--,m--){let g=i.node(p).type.spec;if(g.defining||g.definingAsContext||g.isolating)break;o.indexOf(p)>-1?a=p:i.before(p)==m&&o.splice(1,0,-p)}let l=o.indexOf(a),d=[],u=r.openStart;for(let p=r.content,m=0;;m++){let g=p.firstChild;if(d.push(g),m==r.openStart)break;p=g.content}for(let p=u-1;p>=0;p--){let m=d[p],g=lP(m.type);if(g&&!m.sameMarkup(i.node(Math.abs(a)-1)))u=p;else if(g||!m.type.isTextblock)break}for(let p=r.openStart;p>=0;p--){let m=(p+u+1)%(r.openStart+1),g=d[m];if(g)for(let b=0;b<o.length;b++){let A=o[(b+l)%o.length],y=!0;A<0&&(y=!1,A=-A);let w=i.node(A-1),C=i.index(A-1);if(w.canReplaceWith(C,C,g.type,g.marks))return e.replace(i.before(A),y?s.after(A):n,new Ae(vw(r.content,0,r.openStart,m),m,r.openEnd))}}let h=e.steps.length;for(let p=o.length-1;p>=0&&(e.replace(t,n,r),!(e.steps.length>h));p--){let m=o[p];m<0||(t=i.before(m),n=s.after(m))}}function vw(e,t,n,r,i){if(t<n){let s=e.firstChild;e=e.replaceChild(0,s.copy(vw(s.content,t+1,n,r,s)))}if(t>r){let s=i.contentMatchAt(0),o=s.fillBefore(e).append(e);e=o.append(s.matchFragment(o).fillBefore(V.empty,!0))}return e}function dP(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=sP(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new Ae(V.from(r),0,0))}function uP(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&r.parentOffset==0&&i.parentOffset==0){let o=r.sharedDepth(n),a=!1;for(let l=r.depth;l>o;l--)r.node(l).type.spec.isolating&&(a=!0);for(let l=i.depth;l>o;l--)i.node(l).type.spec.isolating&&(a=!0);if(!a){for(let l=r.depth;l>0&&t==r.start(l);l--)t=r.before(l);for(let l=i.depth;l>0&&n==i.start(l);l--)n=i.before(l);r=e.doc.resolve(t),i=e.doc.resolve(n)}}let s=ww(r,i);for(let o=0;o<s.length;o++){let a=s[o],l=o==s.length-1;if(l&&a==0||r.node(a).type.contentMatch.validEnd)return e.delete(r.start(a),i.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return e.delete(r.before(a),i.after(a))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(t-r.start(o)==r.depth-o&&n>r.end(o)&&i.end(o)-n!=i.depth-o&&r.start(o-1)==i.start(o-1)&&r.node(o-1).canReplace(r.index(o-1),i.index(o-1)))return e.delete(r.before(o),n);e.delete(t,n)}function ww(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let s=e.start(i);if(s<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(s==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==s-1)&&n.push(i)}return n}class yo extends yn{constructor(t,n,r){super(),this.pos=t,this.attr=n,this.value=r}apply(t){let n=t.nodeAt(this.pos);if(!n)return Wt.fail("No node at attribute step's position");let r=Object.create(null);for(let s in n.attrs)r[s]=n.attrs[s];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Wt.fromReplace(t,this.pos,this.pos+1,new Ae(V.from(i),0,n.isLeaf?0:1))}getMap(){return Kn.empty}invert(t){return new yo(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new yo(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new yo(n.pos,n.attr,n.value)}}yn.jsonID("attr",yo);class el extends yn{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let i in t.attrs)n[i]=t.attrs[i];n[this.attr]=this.value;let r=t.type.create(n,t.content,t.marks);return Wt.ok(r)}getMap(){return Kn.empty}invert(t){return new el(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new el(n.attr,n.value)}}yn.jsonID("docAttr",el);let _o=class extends Error{};_o=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};_o.prototype=Object.create(Error.prototype);_o.prototype.constructor=_o;_o.prototype.name="TransformError";class kw{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new Xa}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new _o(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let t=1e9,n=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let i=this.mapping.maps[r];r&&(t=i.map(t,1),n=i.map(n,-1)),i.forEach((s,o,a,l)=>{t=Math.min(t,a),n=Math.max(n,l)})}return t==1e9?null:{from:t,to:n}}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,r=Ae.empty){let i=ou(this.doc,t,n,r);return i&&this.step(i),this}replaceWith(t,n,r){return this.replace(t,n,new Ae(V.from(r),0,0))}delete(t,n){return this.replace(t,n,Ae.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,r){return cP(this,t,n,r),this}replaceRangeWith(t,n,r){return dP(this,t,n,r),this}deleteRange(t,n){return uP(this,t,n),this}lift(t,n){return VB(this,t,n),this}join(t,n=1){return iP(this,t,n),this}wrap(t,n){return ZB(this,t,n),this}setBlockType(t,n=t,r,i=null){return XB(this,t,n,r,i),this}setNodeMarkup(t,n,r=null,i){return tP(this,t,n,r,i),this}setNodeAttribute(t,n,r){return this.step(new yo(t,n,r)),this}setDocAttribute(t,n){return this.step(new el(t,n)),this}addNodeMark(t,n){return this.step(new Bi(t,n)),this}removeNodeMark(t,n){let r=this.doc.nodeAt(t);if(!r)throw new RangeError("No node at position "+t);if(n instanceof yt)n.isInSet(r.marks)&&this.step(new Ps(t,n));else{let i=r.marks,s,o=[];for(;s=n.isInSet(i);)o.push(new Ps(t,s)),i=s.removeFromSet(i);for(let a=o.length-1;a>=0;a--)this.step(o[a])}return this}split(t,n=1,r){return nP(this,t,n,r),this}addMark(t,n,r){return zB(this,t,n,r),this}removeMark(t,n,r){return KB(this,t,n,r),this}clearIncompatible(t,n,r){return nf(this,t,n,r),this}}const xh=Object.create(null);class Ge{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new hP(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n<t.length;n++)if(t[n].$from.pos!=t[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,n=Ae.empty){let r=n.content.lastChild,i=null;for(let a=0;a<n.openEnd;a++)i=r,r=r.lastChild;let s=t.steps.length,o=this.ranges;for(let a=0;a<o.length;a++){let{$from:l,$to:d}=o[a],u=t.mapping.slice(s);t.replaceRange(u.map(l.pos),u.map(d.pos),a?Ae.empty:n),a==0&&C0(t,s,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(t,n){let r=t.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:o,$to:a}=i[s],l=t.mapping.slice(r),d=l.map(o.pos),u=l.map(a.pos);s?t.deleteRange(d,u):(t.replaceRangeWith(d,u,n),C0(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let i=t.parent.inlineContent?new De(t):co(t.node(0),t.parent,t.pos,t.index(),n,r);if(i)return i;for(let s=t.depth-1;s>=0;s--){let o=n<0?co(t.node(0),t.node(s),t.before(s+1),t.index(s),n,r):co(t.node(0),t.node(s),t.after(s+1),t.index(s)+1,n,r);if(o)return o}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new Vn(t.node(0))}static atStart(t){return co(t,t,0,0,1)||new Vn(t)}static atEnd(t){return co(t,t,t.content.size,t.childCount,-1)||new Vn(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=xh[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in xh)throw new RangeError("Duplicate use of selection JSON ID "+t);return xh[t]=n,n.prototype.jsonID=t,n}getBookmark(){return De.between(this.$anchor,this.$head).getBookmark()}}Ge.prototype.visible=!0;class hP{constructor(t,n){this.$from=t,this.$to=n}}let k0=!1;function E0(e){!k0&&!e.parent.inlineContent&&(k0=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class De extends Ge{constructor(t,n=t){E0(t),E0(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return Ge.near(r);let i=t.resolve(n.map(this.anchor));return new De(i.parent.inlineContent?i:r,r)}replace(t,n=Ae.empty){if(super.replace(t,n),n==Ae.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof De&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new au(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new De(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){let i=t.resolve(n);return new this(i,r==n?i:t.resolve(r))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let s=Ge.findFrom(n,r,!0)||Ge.findFrom(n,-r,!0);if(s)n=s.$head;else return Ge.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(Ge.findFrom(t,-r,!0)||Ge.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new De(t,n)}}Ge.jsonID("text",De);class au{constructor(t,n){this.anchor=t,this.head=n}map(t){return new au(t.map(this.anchor),t.map(this.head))}resolve(t){return De.between(t.resolve(this.anchor),t.resolve(this.head))}}class _e extends Ge{constructor(t){let n=t.nodeAfter,r=t.node(0).resolve(t.pos+n.nodeSize);super(t,r),this.node=n}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),s=t.resolve(i);return r?Ge.near(s):new _e(s)}content(){return new Ae(V.from(this.node),0,0)}eq(t){return t instanceof _e&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new sf(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new _e(t.resolve(n.anchor))}static create(t,n){return new _e(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}_e.prototype.visible=!1;Ge.jsonID("node",_e);class sf{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new au(r,r):new sf(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&_e.isSelectable(r)?new _e(n):Ge.near(n)}}class Vn extends Ge{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=Ae.empty){if(n==Ae.empty){t.delete(0,t.doc.content.size);let r=Ge.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new Vn(t)}map(t){return new Vn(t)}eq(t){return t instanceof Vn}getBookmark(){return pP}}Ge.jsonID("all",Vn);const pP={map(){return this},resolve(e){return new Vn(e)}};function co(e,t,n,r,i,s=!1){if(t.inlineContent)return De.create(e,n);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let a=t.child(o);if(a.isAtom){if(!s&&_e.isSelectable(a))return _e.create(e,n-(i<0?a.nodeSize:0))}else{let l=co(e,a,n+i,i<0?a.childCount:0,i,s);if(l)return l}n+=a.nodeSize*i}return null}function C0(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof $t||i instanceof rn))return;let s=e.mapping.maps[r],o;s.forEach((a,l,d,u)=>{o==null&&(o=u)}),e.setSelection(Ge.near(e.doc.resolve(o),n))}const T0=1,ql=2,S0=4;class mP extends kw{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(this.updated|T0)&~ql,this.storedMarks=null,this}get selectionSet(){return(this.updated&T0)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=ql,this}ensureMarks(t){return yt.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&ql)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~ql,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let r=this.selection;return n&&(t=t.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||yt.none))),r.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,r){let i=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(i.text(t),!0):this.deleteSelection();{if(r==null&&(r=n),!t)return this.deleteRange(n,r);let s=this.storedMarks;if(!s){let o=this.doc.resolve(n);s=r==n?o.marks():o.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(t,s)),!this.selection.empty&&this.selection.to==n+t.length&&this.setSelection(Ge.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=S0,this}get scrolledIntoView(){return(this.updated&S0)>0}}function _0(e,t){return!t||!e?e:e.bind(t)}class ma{constructor(t,n,r){this.name=t,this.init=_0(n.init,r),this.apply=_0(n.apply,r)}}const fP=[new ma("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new ma("selection",{init(e,t){return e.selection||Ge.atStart(t.doc)},apply(e){return e.selection}}),new ma("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new ma("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class vh{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=fP.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new ma(r.key,r.spec.state,r))})}}class bs{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let n=[t],r=this.applyInner(t),i=null;for(;;){let s=!1;for(let o=0;o<this.config.plugins.length;o++){let a=this.config.plugins[o];if(a.spec.appendTransaction){let l=i?i[o].n:0,d=i?i[o].state:this,u=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,d,r);if(u&&r.filterTransaction(u,o)){if(u.setMeta("appendedTransaction",t),!i){i=[];for(let h=0;h<this.config.plugins.length;h++)i.push(h<o?{state:r,n:n.length}:{state:this,n:0})}n.push(u),r=r.applyInner(u),s=!0}i&&(i[o]={state:r,n:n.length})}}if(!s)return{state:r,transactions:n}}}applyInner(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new bs(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let s=r[i];n[s.name]=s.apply(t,this[s.name],this,n)}return n}get tr(){return new mP(this)}static create(t){let n=new vh(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new bs(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(t,r);return r}reconfigure(t){let n=new vh(this.schema,t.plugins),r=n.fields,i=new bs(n);for(let s=0;s<r.length;s++){let o=r[s].name;i[o]=this.hasOwnProperty(o)?this[o]:r[s].init(t,i)}return i}toJSON(t){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),t&&typeof t=="object")for(let r in t){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=t[r],s=i.spec.state;s&&s.toJSON&&(n[r]=s.toJSON.call(i,this[i.key]))}return n}static fromJSON(t,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let i=new vh(t.schema,t.plugins),s=new bs(i);return i.fields.forEach(o=>{if(o.name=="doc")s.doc=Is.fromJSON(t.schema,n.doc);else if(o.name=="selection")s.selection=Ge.fromJSON(s.doc,n.selection);else if(o.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],d=l.spec.state;if(l.key==o.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){s[o.name]=d.fromJSON.call(l,t,n[a],s);return}}s[o.name]=o.init(t,s)}}),s}}function Ew(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r=="handleDOMEvents"&&(i=Ew(i,t,{})),n[r]=i}return n}class Ct{constructor(t){this.spec=t,this.props={},t.props&&Ew(t.props,this,this.props),this.key=t.key?t.key.key:Cw("plugin")}getState(t){return t[this.key]}}const wh=Object.create(null);function Cw(e){return e in wh?e+"$"+ ++wh[e]:(wh[e]=0,e+"$")}class zt{constructor(t="key"){this.key=Cw(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const Tw=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function Sw(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const _w=(e,t,n)=>{let r=Sw(e,n);if(!r)return!1;let i=of(r);if(!i){let o=r.blockRange(),a=o&&Uo(o);return a==null?!1:(t&&t(e.tr.lift(o,a).scrollIntoView()),!0)}let s=i.nodeBefore;if(Bw(e,i,t,-1))return!0;if(r.parent.content.size==0&&(No(s,"end")||_e.isSelectable(s)))for(let o=r.depth;;o--){let a=ou(e.doc,r.before(o),r.after(o),Ae.empty);if(a&&a.slice.size<a.to-a.from){if(t){let l=e.tr.step(a);l.setSelection(No(s,"end")?Ge.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):_e.create(l.doc,i.pos-s.nodeSize)),t(l.scrollIntoView())}return!0}if(o==1||r.node(o-1).childCount>1)break}return s.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0):!1},gP=(e,t,n)=>{let r=Sw(e,n);if(!r)return!1;let i=of(r);return i?Nw(e,i,t):!1},AP=(e,t,n)=>{let r=Dw(e,n);if(!r)return!1;let i=af(r);return i?Nw(e,i,t):!1};function Nw(e,t,n){let r=t.nodeBefore,i=r,s=t.pos-1;for(;!i.isTextblock;s--){if(i.type.spec.isolating)return!1;let u=i.lastChild;if(!u)return!1;i=u}let o=t.nodeAfter,a=o,l=t.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let u=a.firstChild;if(!u)return!1;a=u}let d=ou(e.doc,s,l,Ae.empty);if(!d||d.from!=s||d instanceof $t&&d.slice.size>=l-s)return!1;if(n){let u=e.tr.step(d);u.setSelection(De.create(u.doc,s)),n(u.scrollIntoView())}return!0}function No(e,t,n=!1){for(let r=e;r;r=t=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const Iw=(e,t,n)=>{let{$head:r,empty:i}=e.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;s=of(r)}let o=s&&s.nodeBefore;return!o||!_e.isSelectable(o)?!1:(t&&t(e.tr.setSelection(_e.create(e.doc,s.pos-o.nodeSize)).scrollIntoView()),!0)};function of(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function Dw(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const Mw=(e,t,n)=>{let r=Dw(e,n);if(!r)return!1;let i=af(r);if(!i)return!1;let s=i.nodeAfter;if(Bw(e,i,t,1))return!0;if(r.parent.content.size==0&&(No(s,"start")||_e.isSelectable(s))){let o=ou(e.doc,r.before(),r.after(),Ae.empty);if(o&&o.slice.size<o.to-o.from){if(t){let a=e.tr.step(o);a.setSelection(No(s,"start")?Ge.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):_e.create(a.doc,a.mapping.map(i.pos))),t(a.scrollIntoView())}return!0}}return s.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),!0):!1},Ow=(e,t,n)=>{let{$head:r,empty:i}=e.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;s=af(r)}let o=s&&s.nodeAfter;return!o||!_e.isSelectable(o)?!1:(t&&t(e.tr.setSelection(_e.create(e.doc,s.pos)).scrollIntoView()),!0)};function af(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}const bP=(e,t)=>{let n=e.selection,r=n instanceof _e,i;if(r){if(n.node.isTextblock||!qi(e.doc,n.from))return!1;i=n.from}else if(i=su(e.doc,n.from,-1),i==null)return!1;if(t){let s=e.tr.join(i);r&&s.setSelection(_e.create(s.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(s.scrollIntoView())}return!0},yP=(e,t)=>{let n=e.selection,r;if(n instanceof _e){if(n.node.isTextblock||!qi(e.doc,n.to))return!1;r=n.to}else if(r=su(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},xP=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),s=i&&Uo(i);return s==null?!1:(t&&t(e.tr.lift(i,s).scrollIntoView()),!0)},Rw=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
|
|
133
|
+
`).scrollIntoView()),!0)};function lf(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const vP=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),s=n.indexAfter(-1),o=lf(i.contentMatchAt(s));if(!o||!i.canReplaceWith(s,s,o))return!1;if(t){let a=n.after(),l=e.tr.replaceWith(a,a,o.createAndFill());l.setSelection(Ge.near(l.doc.resolve(a),1)),t(l.scrollIntoView())}return!0},Lw=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof Vn||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=lf(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(t){let o=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=e.tr.insert(o,s.createAndFill());a.setSelection(De.create(a.doc,o+1)),t(a.scrollIntoView())}return!0},jw=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let s=n.before();if(hi(e.doc,s))return t&&t(e.tr.split(s).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Uo(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function wP(e){return(t,n)=>{let{$from:r,$to:i}=t.selection;if(t.selection instanceof _e&&t.selection.node.isBlock)return!r.parentOffset||!hi(t.doc,r.pos)?!1:(n&&n(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let s=[],o,a,l=!1,d=!1;for(let m=r.depth;;m--)if(r.node(m).isBlock){l=r.end(m)==r.pos+(r.depth-m),d=r.start(m)==r.pos-(r.depth-m),a=lf(r.node(m-1).contentMatchAt(r.indexAfter(m-1))),s.unshift(l&&a?{type:a}:null),o=m;break}else{if(m==1)return!1;s.unshift(null)}let u=t.tr;(t.selection instanceof De||t.selection instanceof Vn)&&u.deleteSelection();let h=u.mapping.map(r.pos),p=hi(u.doc,h,s.length,s);if(p||(s[0]=a?{type:a}:null,p=hi(u.doc,h,s.length,s)),!p)return!1;if(u.split(h,s.length,s),!l&&d&&r.node(o).type!=a){let m=u.mapping.map(r.before(o)),g=u.doc.resolve(m);a&&r.node(o-1).canReplaceWith(g.index(),g.index()+1,a)&&u.setNodeMarkup(u.mapping.map(r.before(o)),a)}return n&&n(u.scrollIntoView()),!0}}const kP=wP(),EP=(e,t)=>{let{$from:n,to:r}=e.selection,i,s=n.sharedDepth(r);return s==0?!1:(i=n.before(s),t&&t(e.tr.setSelection(_e.create(e.doc,i))),!0)};function CP(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,s=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(s-1,s)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(s,s+1)||!(i.isTextblock||qi(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function Bw(e,t,n,r){let i=t.nodeBefore,s=t.nodeAfter,o,a,l=i.type.spec.isolating||s.type.spec.isolating;if(!l&&CP(e,t,n))return!0;let d=!l&&t.parent.canReplace(t.index(),t.index()+1);if(d&&(o=(a=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&a.matchType(o[0]||s.type).validEnd){if(n){let m=t.pos+s.nodeSize,g=V.empty;for(let y=o.length-1;y>=0;y--)g=V.from(o[y].create(null,g));g=V.from(i.copy(g));let b=e.tr.step(new rn(t.pos-1,m,t.pos,m,new Ae(g,1,0),o.length,!0)),A=b.doc.resolve(m+2*o.length);A.nodeAfter&&A.nodeAfter.type==i.type&&qi(b.doc,A.pos)&&b.join(A.pos),n(b.scrollIntoView())}return!0}let u=s.type.spec.isolating||r>0&&l?null:Ge.findFrom(t,1),h=u&&u.$from.blockRange(u.$to),p=h&&Uo(h);if(p!=null&&p>=t.depth)return n&&n(e.tr.lift(h,p).scrollIntoView()),!0;if(d&&No(s,"start",!0)&&No(i,"end")){let m=i,g=[];for(;g.push(m),!m.isTextblock;)m=m.lastChild;let b=s,A=1;for(;!b.isTextblock;b=b.firstChild)A++;if(m.canReplace(m.childCount,m.childCount,b.content)){if(n){let y=V.empty;for(let C=g.length-1;C>=0;C--)y=V.from(g[C].copy(y));let w=e.tr.step(new rn(t.pos-g.length,t.pos+s.nodeSize,t.pos+A,t.pos+s.nodeSize-A,new Ae(y,g.length,0),0,!0));n(w.scrollIntoView())}return!0}}return!1}function Pw(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(n&&n(t.tr.setSelection(De.create(t.doc,e<0?i.start(s):i.end(s)))),!0):!1}}const TP=Pw(-1),SP=Pw(1);function _P(e,t=null){return function(n,r){let{$from:i,$to:s}=n.selection,o=i.blockRange(s),a=o&&rf(o,e,t);return a?(r&&r(n.tr.wrap(o,a).scrollIntoView()),!0):!1}}function N0(e,t=null){return function(n,r){let i=!1;for(let s=0;s<n.selection.ranges.length&&!i;s++){let{$from:{pos:o},$to:{pos:a}}=n.selection.ranges[s];n.doc.nodesBetween(o,a,(l,d)=>{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(e,t)))if(l.type==e)i=!0;else{let u=n.doc.resolve(d),h=u.index();i=u.parent.canReplaceWith(h,h+1,e)}})}if(!i)return!1;if(r){let s=n.tr;for(let o=0;o<n.selection.ranges.length;o++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[o];s.setBlockType(a,l,e,t)}r(s.scrollIntoView())}return!0}}function cf(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}cf(Tw,_w,Iw);cf(Tw,Mw,Ow);cf(Rw,Lw,jw,kP);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function NP(e,t=null){return function(n,r){let{$from:i,$to:s}=n.selection,o=i.blockRange(s);if(!o)return!1;let a=r?n.tr:null;return IP(a,o,e,t)?(r&&r(a.scrollIntoView()),!0):!1}}function IP(e,t,n,r=null){let i=!1,s=t,o=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let l=o.resolve(t.start-2);s=new Vc(l,l,t.depth),t.endIndex<t.parent.childCount&&(t=new Vc(t.$from,o.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let a=rf(s,n,r,t);return a?(e&&DP(e,t,a,i,n),!0):!1}function DP(e,t,n,r,i){let s=V.empty;for(let u=n.length-1;u>=0;u--)s=V.from(n[u].type.create(n[u].attrs,s));e.step(new rn(t.start-(r?2:0),t.end,t.start,t.end,new Ae(s,0,0),n.length,!0));let o=0;for(let u=0;u<n.length;u++)n[u].type==i&&(o=u+1);let a=n.length-o,l=t.start+n.length-(r?2:0),d=t.parent;for(let u=t.startIndex,h=t.endIndex,p=!0;u<h;u++,p=!1)!p&&hi(e.doc,l,a)&&(e.split(l,a),l+=2*a),l+=d.child(u).nodeSize;return e}function MP(e){return function(t,n){let{$from:r,$to:i}=t.selection,s=r.blockRange(i,o=>o.childCount>0&&o.firstChild.type==e);return s?n?r.node(s.depth-1).type==e?OP(t,n,e,s):RP(t,n,s):!0:!1}}function OP(e,t,n,r){let i=e.tr,s=r.end,o=r.$to.end(r.depth);s<o&&(i.step(new rn(s-1,o,s,o,new Ae(V.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Vc(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));const a=Uo(r);if(a==null)return!1;i.lift(r,a);let l=i.doc.resolve(i.mapping.map(s,-1)-1);return qi(i.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&i.join(l.pos),t(i.scrollIntoView()),!0}function RP(e,t,n){let r=e.tr,i=n.parent;for(let m=n.end,g=n.endIndex-1,b=n.startIndex;g>b;g--)m-=i.child(g).nodeSize,r.delete(m-1,m+1);let s=r.doc.resolve(n.start),o=s.nodeAfter;if(r.mapping.map(n.end)!=n.start+s.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==i.childCount,d=s.node(-1),u=s.index(-1);if(!d.canReplace(u+(a?0:1),u+1,o.content.append(l?V.empty:V.from(i))))return!1;let h=s.pos,p=h+o.nodeSize;return r.step(new rn(h-(a?1:0),p+(l?1:0),h+1,p-1,new Ae((a?V.empty:V.from(i.copy(V.empty))).append(l?V.empty:V.from(i.copy(V.empty))),a?0:1,l?0:1),a?0:1)),t(r.scrollIntoView()),!0}function LP(e){return function(t,n){let{$from:r,$to:i}=t.selection,s=r.blockRange(i,d=>d.childCount>0&&d.firstChild.type==e);if(!s)return!1;let o=s.startIndex;if(o==0)return!1;let a=s.parent,l=a.child(o-1);if(l.type!=e)return!1;if(n){let d=l.lastChild&&l.lastChild.type==a.type,u=V.from(d?e.create():null),h=new Ae(V.from(e.create(null,V.from(a.type.create(null,u)))),d?3:1,0),p=s.start,m=s.end;n(t.tr.step(new rn(p-(d?3:1),m,p,m,h,1,!0)).scrollIntoView())}return!0}}const dn=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Io=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let Hp=null;const oi=function(e,t,n){let r=Hp||(Hp=document.createRange());return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},jP=function(){Hp=null},Fs=function(e,t,n,r){return n&&(I0(e,t,n,r,-1)||I0(e,t,n,r,1))},BP=/^(img|br|input|textarea|hr)$/i;function I0(e,t,n,r,i){for(var s;;){if(e==n&&t==r)return!0;if(t==(i<0?0:ar(e))){let o=e.parentNode;if(!o||o.nodeType!=1||bl(e)||BP.test(e.nodeName)||e.contentEditable=="false")return!1;t=dn(e)+(i<0?0:1),e=o}else if(e.nodeType==1){let o=e.childNodes[t+(i<0?-1:0)];if(o.nodeType==1&&o.contentEditable=="false")if(!((s=o.pmViewDesc)===null||s===void 0)&&s.ignoreForSelection)t+=i;else return!1;else e=o,t=i<0?ar(e):0}else return!1}}function ar(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function PP(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable=="false")return null;e=e.childNodes[t-1],t=ar(e)}else if(e.parentNode&&!bl(e))t=dn(e),e=e.parentNode;else return null}}function FP(e,t){for(;;){if(e.nodeType==3&&t<e.nodeValue.length)return e;if(e.nodeType==1&&t<e.childNodes.length){if(e.contentEditable=="false")return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!bl(e))t=dn(e)+1,e=e.parentNode;else return null}}function $P(e,t,n){for(let r=t==0,i=t==ar(e);r||i;){if(e==n)return!0;let s=dn(e);if(e=e.parentNode,!e)return!1;r=r&&s==0,i=i&&s==ar(e)}}function bl(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const lu=function(e){return e.focusNode&&Fs(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function As(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function HP(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function UP(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(ar(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(ar(r.startContainer),r.startOffset)}}}const Kr=typeof navigator<"u"?navigator:null,D0=typeof document<"u"?document:null,Ji=Kr&&Kr.userAgent||"",Up=/Edge\/(\d+)/.exec(Ji),Fw=/MSIE \d/.exec(Ji),Gp=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ji),Pn=!!(Fw||Gp||Up),$i=Fw?document.documentMode:Gp?+Gp[1]:Up?+Up[1]:0,lr=!Pn&&/gecko\/(\d+)/i.test(Ji);lr&&+(/Firefox\/(\d+)/.exec(Ji)||[0,0])[1];const Wp=!Pn&&/Chrome\/(\d+)/.exec(Ji),hn=!!Wp,$w=Wp?+Wp[1]:0,An=!Pn&&!!Kr&&/Apple Computer/.test(Kr.vendor),Do=An&&(/Mobile\/\w+/.test(Ji)||!!Kr&&Kr.maxTouchPoints>2),ir=Do||(Kr?/Mac/.test(Kr.platform):!1),Hw=Kr?/Win/.test(Kr.platform):!1,ci=/Android \d/.test(Ji),yl=!!D0&&"webkitFontSmoothing"in D0.documentElement.style,GP=yl?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function WP(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Xr(e,t){return typeof e=="number"?e:e[t]}function YP(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function M0(e,t,n){if(!Yp(t)&&t.left==0)return;let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,s=e.dom.ownerDocument;for(let o=n||e.dom;o;){if(o.nodeType!=1){o=Io(o);continue}let a=o,l=a==s.body,d=l?WP(s):YP(a),u=0,h=0;if(t.top<d.top+Xr(r,"top")?h=-(d.top-t.top+Xr(i,"top")):t.bottom>d.bottom-Xr(r,"bottom")&&(h=t.bottom-t.top>d.bottom-d.top?t.top+Xr(i,"top")-d.top:t.bottom-d.bottom+Xr(i,"bottom")),t.left<d.left+Xr(r,"left")?u=-(d.left-t.left+Xr(i,"left")):t.right>d.right-Xr(r,"right")&&(u=t.right-d.right+Xr(i,"right")),u||h)if(l)s.defaultView.scrollBy(u,h);else{let m=a.scrollLeft,g=a.scrollTop;h&&(a.scrollTop+=h),u&&(a.scrollLeft+=u);let b=a.scrollLeft-m,A=a.scrollTop-g;t={left:t.left-b,top:t.top-A,right:t.right-b,bottom:t.bottom-A}}let p=l?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(p))break;o=p=="absolute"?o.offsetParent:Io(o)}}function zP(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let s=(t.left+t.right)/2,o=n+1;o<Math.min(innerHeight,t.bottom);o+=5){let a=e.root.elementFromPoint(s,o);if(!a||a==e.dom||!e.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=n-20){r=a,i=l.top;break}}return{refDOM:r,refTop:i,stack:Uw(e.dom)}}function Uw(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Io(r));return t}function KP({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;Gw(n,r==0?0:r-t)}function Gw(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:s}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=s&&(r.scrollLeft=s)}}let io=null;function QP(e){if(e.setActive)return e.setActive();if(io)return e.focus(io);let t=Uw(e);e.focus(io==null?{get preventScroll(){return io={preventScroll:!0},!0}}:void 0),io||(io=!1,Gw(t,0))}function Ww(e,t){let n,r=2e8,i,s=0,o=t.top,a=t.top,l,d;for(let u=e.firstChild,h=0;u;u=u.nextSibling,h++){let p;if(u.nodeType==1)p=u.getClientRects();else if(u.nodeType==3)p=oi(u).getClientRects();else continue;for(let m=0;m<p.length;m++){let g=p[m];if(g.top<=o&&g.bottom>=a){o=Math.max(g.bottom,o),a=Math.min(g.top,a);let b=g.left>t.left?g.left-t.left:g.right<t.left?t.left-g.right:0;if(b<r){n=u,r=b,i=b&&n.nodeType==3?{left:g.right<t.left?g.right:g.left,top:t.top}:t,u.nodeType==1&&b&&(s=h+(t.left>=(g.left+g.right)/2?1:0));continue}}else g.top>t.top&&!l&&g.left<=t.left&&g.right>=t.left&&(l=u,d={left:Math.max(g.left,Math.min(g.right,t.left)),top:g.top});!n&&(t.left>=g.right&&t.top>=g.top||t.left>=g.left&&t.top>=g.bottom)&&(s=h+1)}}return!n&&l&&(n=l,i=d,r=0),n&&n.nodeType==3?VP(n,i):!n||r&&n.nodeType==1?{node:e,offset:s}:Ww(n,i)}function VP(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let s=0;s<n;s++){r.setEnd(e,s+1),r.setStart(e,s);let o=Ci(r,1);if(o.top!=o.bottom&&df(t,o)){i={node:e,offset:s+(t.left>=(o.left+o.right)/2?1:0)};break}}return r.detach(),i||{node:e,offset:0}}function df(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function qP(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function JP(e,t,n){let{node:r,offset:i}=Ww(t,n),s=-1;if(r.nodeType==1&&!r.firstChild){let o=r.getBoundingClientRect();s=o.left!=o.right&&n.left>(o.left+o.right)/2?1:-1}return e.docView.posFromDOM(r,i,s)}function ZP(e,t,n,r){let i=-1;for(let s=t,o=!1;s!=e.dom;){let a=e.docView.nearestDesc(s,!0),l;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(a.dom.nodeName)&&(!o&&l.left>r.left||l.top>r.top?i=a.posBefore:(!o&&l.right<r.left||l.bottom<r.top)&&(i=a.posAfter),o=!0),!a.contentDOM&&i<0&&!a.node.isText))return(a.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?a.posBefore:a.posAfter;s=a.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function Yw(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),s=i;;){let o=e.childNodes[s];if(o.nodeType==1){let a=o.getClientRects();for(let l=0;l<a.length;l++){let d=a[l];if(df(t,d))return Yw(o,t,d)}}if((s=(s+1)%r)==i)break}return e}function XP(e,t){let n=e.dom.ownerDocument,r,i=0,s=UP(n,t.left,t.top);s&&({node:r,offset:i}=s);let o=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),a;if(!o||!e.dom.contains(o.nodeType!=1?o.parentNode:o)){let d=e.dom.getBoundingClientRect();if(!df(t,d)||(o=Yw(e.dom,t,d),!o))return null}if(An)for(let d=o;r&&d;d=Io(d))d.draggable&&(r=void 0);if(o=qP(o,t),r){if(lr&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let u=r.childNodes[i],h;u.nodeName=="IMG"&&(h=u.getBoundingClientRect()).right<=t.left&&h.bottom>t.top&&i++}let d;yl&&i&&r.nodeType==1&&(d=r.childNodes[i-1]).nodeType==1&&d.contentEditable=="false"&&d.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?a=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=ZP(e,r,i,t))}a==null&&(a=JP(e,o,t));let l=e.docView.nearestDesc(o,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function Yp(e){return e.top<e.bottom||e.left<e.right}function Ci(e,t){let n=e.getClientRects();if(n.length){let r=n[t<0?0:n.length-1];if(Yp(r))return r}return Array.prototype.find.call(n,Yp)||e.getBoundingClientRect()}const e3=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function zw(e,t,n){let{node:r,offset:i,atom:s}=e.docView.domFromPos(t,n<0?-1:1),o=yl||lr;if(r.nodeType==3)if(o&&(e3.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let a=Ci(oi(r,i,i),n);if(lr&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let l=Ci(oi(r,i-1,i-1),-1);if(l.top==a.top){let d=Ci(oi(r,i,i+1),-1);if(d.top!=a.top)return sa(d,d.left<l.left)}}return a}else{let a=i,l=i,d=n<0?1:-1;return n<0&&!i?(l++,d=-1):n>=0&&i==r.nodeValue.length?(a--,d=1):n<0?a--:l++,sa(Ci(oi(r,a,l),d),d<0)}if(!e.state.doc.resolve(t-(s||0)).parent.inlineContent){if(s==null&&i&&(n<0||i==ar(r))){let a=r.childNodes[i-1];if(a.nodeType==1)return kh(a.getBoundingClientRect(),!1)}if(s==null&&i<ar(r)){let a=r.childNodes[i];if(a.nodeType==1)return kh(a.getBoundingClientRect(),!0)}return kh(r.getBoundingClientRect(),n>=0)}if(s==null&&i&&(n<0||i==ar(r))){let a=r.childNodes[i-1],l=a.nodeType==3?oi(a,ar(a)-(o?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(l)return sa(Ci(l,1),!1)}if(s==null&&i<ar(r)){let a=r.childNodes[i];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let l=a?a.nodeType==3?oi(a,0,o?0:1):a.nodeType==1?a:null:null;if(l)return sa(Ci(l,-1),!0)}return sa(Ci(r.nodeType==3?oi(r):r,-n),n>=0)}function sa(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function kh(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function Kw(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function t3(e,t,n){let r=t.selection,i=n=="up"?r.$from:r.$to;return Kw(e,t,()=>{let{node:s}=e.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let a=e.docView.nearestDesc(s,!0);if(!a)break;if(a.node.isBlock){s=a.contentDOM||a.dom;break}s=a.dom.parentNode}let o=zw(e,i.pos,1);for(let a=s.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=oi(a,0,a.nodeValue.length).getClientRects();else continue;for(let d=0;d<l.length;d++){let u=l[d];if(u.bottom>u.top+1&&(n=="up"?o.top-u.top>(u.bottom-o.top)*2:u.bottom-o.bottom>(o.bottom-u.top)*2))return!1}}return!0})}const n3=/[\u0590-\u08ac]/;function r3(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,s=!i,o=i==r.parent.content.size,a=e.domSelection();return a?!n3.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?s:o:Kw(e,t,()=>{let{focusNode:l,focusOffset:d,anchorNode:u,anchorOffset:h}=e.domSelectionRange(),p=a.caretBidiLevel;a.modify("move",n,"character");let m=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:g,focusOffset:b}=e.domSelectionRange(),A=g&&!m.contains(g.nodeType==1?g:g.parentNode)||l==g&&d==b;try{a.collapse(u,h),l&&(l!=u||d!=h)&&a.extend&&a.extend(l,d)}catch{}return p!=null&&(a.caretBidiLevel=p),A}):r.pos==r.start()||r.pos==r.end()}let O0=null,R0=null,L0=!1;function i3(e,t,n){return O0==t&&R0==n?L0:(O0=t,R0=n,L0=n=="up"||n=="down"?t3(e,t,n):r3(e,t,n))}const cr=0,j0=1,ys=2,Sr=3;class xl{constructor(t,n,r,i){this.parent=t,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=cr,r.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,n,r){return!1}matchesHack(t){return!1}parseRule(t){return null}stopEvent(t){return!1}get size(){let t=0;for(let n=0;n<this.children.length;n++)t+=this.children[n].size;return t}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let t=0;t<this.children.length;t++)this.children[t].destroy()}posBeforeChild(t){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==t)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(t,n,r){if(this.contentDOM&&this.contentDOM.contains(t.nodeType==1?t:t.parentNode))if(r<0){let s,o;if(t==this.contentDOM)s=t.childNodes[n-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;s=t.previousSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.previousSibling;return s?this.posBeforeChild(o)+o.size:this.posAtStart}else{let s,o;if(t==this.contentDOM)s=t.childNodes[n];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;s=t.nextSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(o):this.posAtEnd}let i;if(t==this.dom&&this.contentDOM)i=n>dn(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let s=t;;s=s.parentNode){if(s==this.dom){i=!1;break}if(s.previousSibling)break}if(i==null&&n==t.childNodes.length)for(let s=t;;s=s.parentNode){if(s==this.dom){i=!0;break}if(s.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(t,n=!1){for(let r=!0,i=t;i;i=i.parentNode){let s=this.getDesc(i),o;if(s&&(!n||s.node))if(r&&(o=s.nodeDOM)&&!(o.nodeType==1?o.contains(t.nodeType==1?t:t.parentNode):o==t))r=!1;else return s}}getDesc(t){let n=t.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(t,n,r){for(let i=t;i;i=i.parentNode){let s=this.getDesc(i);if(s)return s.localPosFromDOM(t,n,r)}return-1}descAt(t){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],s=r+i.size;if(r==t&&s!=r){for(;!i.border&&i.children.length;)for(let o=0;o<i.children.length;o++){let a=i.children[o];if(a.size){i=a;break}}return i}if(t<s)return i.descAt(t-r-i.border);r=s}}domFromPos(t,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};let r=0,i=0;for(let s=0;r<this.children.length;r++){let o=this.children[r],a=s+o.size;if(a>t||o instanceof Vw){i=t-s;break}s=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let s;r&&!(s=this.children[r-1]).size&&s instanceof Qw&&s.side>=0;r--);if(n<=0){let s,o=!0;for(;s=r?this.children[r-1]:null,!(!s||s.dom.parentNode==this.contentDOM);r--,o=!1);return s&&n&&o&&!s.border&&!s.domAtom?s.domFromPos(s.size,n):{node:this.contentDOM,offset:s?dn(s.dom)+1:0}}else{let s,o=!0;for(;s=r<this.children.length?this.children[r]:null,!(!s||s.dom.parentNode==this.contentDOM);r++,o=!1);return s&&o&&!s.border&&!s.domAtom?s.domFromPos(0,n):{node:this.contentDOM,offset:s?dn(s.dom):this.contentDOM.childNodes.length}}}parseRange(t,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:t,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,s=-1;for(let o=r,a=0;;a++){let l=this.children[a],d=o+l.size;if(i==-1&&t<=d){let u=o+l.border;if(t>=u&&n<=d-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(t,n,u);t=o;for(let h=a;h>0;h--){let p=this.children[h-1];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(1)){i=dn(p.dom)+1;break}t-=p.size}i==-1&&(i=0)}if(i>-1&&(d>n||a==this.children.length-1)){n=d;for(let u=a+1;u<this.children.length;u++){let h=this.children[u];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(-1)){s=dn(h.dom);break}n+=h.size}s==-1&&(s=this.contentDOM.childNodes.length);break}o=d}return{node:this.contentDOM,from:t,to:n,fromOffset:i,toOffset:s}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[t<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(t)}domAfterPos(t){let{node:n,offset:r}=this.domFromPos(t,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+t);return n.childNodes[r]}setSelection(t,n,r,i=!1){let s=Math.min(t,n),o=Math.max(t,n);for(let m=0,g=0;m<this.children.length;m++){let b=this.children[m],A=g+b.size;if(s>g&&o<A)return b.setSelection(t-g-b.border,n-g-b.border,r,i);g=A}let a=this.domFromPos(t,t?-1:1),l=n==t?a:this.domFromPos(n,n?-1:1),d=r.root.getSelection(),u=r.domSelectionRange(),h=!1;if((lr||An)&&t==n){let{node:m,offset:g}=a;if(m.nodeType==3){if(h=!!(g&&m.nodeValue[g-1]==`
|
|
134
|
+
`),h&&g==m.nodeValue.length)for(let b=m,A;b;b=b.parentNode){if(A=b.nextSibling){A.nodeName=="BR"&&(a=l={node:A.parentNode,offset:dn(A)+1});break}let y=b.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let b=m.childNodes[g-1];h=b&&(b.nodeName=="BR"||b.contentEditable=="false")}}if(lr&&u.focusNode&&u.focusNode!=l.node&&u.focusNode.nodeType==1){let m=u.focusNode.childNodes[u.focusOffset];m&&m.contentEditable=="false"&&(i=!0)}if(!(i||h&&An)&&Fs(a.node,a.offset,u.anchorNode,u.anchorOffset)&&Fs(l.node,l.offset,u.focusNode,u.focusOffset))return;let p=!1;if((d.extend||t==n)&&!(h&&lr)){d.collapse(a.node,a.offset);try{t!=n&&d.extend(l.node,l.offset),p=!0}catch{}}if(!p){if(t>n){let g=a;a=l,l=g}let m=document.createRange();m.setEnd(l.node,l.offset),m.setStart(a.node,a.offset),d.removeAllRanges(),d.addRange(m)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,n){for(let r=0,i=0;i<this.children.length;i++){let s=this.children[i],o=r+s.size;if(r==o?t<=o&&n>=r:t<o&&n>r){let a=r+s.border,l=o-s.border;if(t>=a&&n<=l){this.dirty=t==r||n==o?ys:j0,t==a&&n==l&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=Sr:s.markDirty(t-a,n-a);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?ys:Sr}r=o}this.dirty=ys}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=t==1?ys:j0;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(t){return!1}}class Qw extends xl{constructor(t,n,r,i){let s,o=n.type.toDOM;if(typeof o=="function"&&(o=o(r,()=>{if(!s)return i;if(s.parent)return s.parent.posBeforeChild(s)})),!n.type.spec.raw){if(o.nodeType!=1){let a=document.createElement("span");a.appendChild(o),o=a}o.hasAttribute("contenteditable")||(o.contentEditable="false"),o.classList.add("ProseMirror-widget")}super(t,[],o,null),this.widget=n,this.widget=n,s=this}matchesWidget(t){return this.dirty==cr&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return n?n(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class s3 extends xl{constructor(t,n,r,i){super(t,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(t,n){return t!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class Hi extends xl{constructor(t,n,r,i,s){super(t,[],r,i),this.mark=n,this.spec=s}static create(t,n,r,i){let s=i.nodeViews[n.type.name],o=s&&s(n,i,r);return(!o||!o.dom)&&(o=zs.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Hi(t,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&Sr||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=Sr&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=cr){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=cr}}slice(t,n,r){let i=Hi.create(this.parent,this.mark,!0,r),s=this.children,o=this.size;n<o&&(s=Kp(s,n,o,r)),t>0&&(s=Kp(s,0,t,r));for(let a=0;a<s.length;a++)s[a].parent=i;return i.children=s,i}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class Ui extends xl{constructor(t,n,r,i,s,o,a){super(t,[],s,o),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=a}static create(t,n,r,i,s,o){let a=s.nodeViews[n.type.name],l,d=a&&a(n,s,()=>{if(!l)return o;if(l.parent)return l.parent.posBeforeChild(l)},r,i),u=d&&d.dom,h=d&&d.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:h}=zs.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!h&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let p=u;return u=Zw(u,r,n),d?l=new o3(t,n,r,i,u,h||null,p,d):n.isText?new cu(t,n,r,i,u,p):new Ui(t,n,r,i,u,h||null,p)}parseRule(t){if(this.node.type.spec.reparseInView)return null;let n={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(n.preserveWhitespace="full"),!this.contentDOM)n.getContent=()=>this.node.content;else if(!this.contentLost)n.contentElement=this.contentDOM;else{for(let r=this.children.length-1;r>=0;r--){let i=this.children[r];if(this.dom.contains(i.dom.parentNode)){n.contentElement=i.dom.parentNode;break}}if(!n.contentElement){let r=t&&t.find(i=>i.nodeType==1&&t.indexOf(i.parentNode)<0&&this.dom.contains(i));r?n.contentElement=r:n.getContent=()=>V.empty}}return n}matchesNode(t,n,r){return this.dirty==cr&&t.eq(this.node)&&Jc(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,n){let r=this.node.inlineContent,i=n,s=t.composing?this.localCompositionInfo(t,n):null,o=s&&s.pos>-1?s:null,a=s&&s.pos<0,l=new l3(this,o&&o.node,t);u3(this.node,this.innerDeco,(d,u,h)=>{d.spec.marks?l.syncToMarks(d.spec.marks,r,t,u):d.type.side>=0&&!h&&l.syncToMarks(u==this.node.childCount?yt.none:this.node.child(u).marks,r,t,u),l.placeWidget(d,t,i)},(d,u,h,p)=>{l.syncToMarks(d.marks,r,t,p);let m;l.findNodeMatch(d,u,h,p)||a&&t.state.selection.from>i&&t.state.selection.to<i+d.nodeSize&&(m=l.findIndexWithChild(s.node))>-1&&l.updateNodeAt(d,u,h,m,t)||l.updateNextNode(d,u,h,t,p,i)||l.addNode(d,u,h,t,i),i+=d.nodeSize}),l.syncToMarks([],r,t,0),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==ys)&&(o&&this.protectLocalComposition(t,o),qw(this.contentDOM,this.children,t),Do&&h3(this.dom))}localCompositionInfo(t,n){let{from:r,to:i}=t.state.selection;if(!(t.state.selection instanceof De)||r<n||i>n+this.node.content.size)return null;let s=t.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let o=s.nodeValue,a=p3(this.node.content,o,r-n,i-n);return a<0?null:{node:s,pos:a,text:o}}else return{node:s,pos:-1,text:""}}protectLocalComposition(t,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let s=n;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let o=new s3(this,s,n,i);t.input.compositionNodes.push(o),this.children=Kp(this.children,r,r+i.length,t,o)}update(t,n,r,i){return this.dirty==Sr||!t.sameMarkup(this.node)?!1:(this.updateInner(t,n,r,i),!0)}updateInner(t,n,r,i){this.updateOuterDeco(n),this.node=t,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=cr}updateOuterDeco(t){if(Jc(t,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Jw(this.dom,this.nodeDOM,zp(this.outerDeco,this.node,n),zp(t,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function B0(e,t,n,r,i){Zw(r,t,e);let s=new Ui(void 0,e,t,n,r,r,r);return s.contentDOM&&s.updateChildren(i,0),s}class cu extends Ui{constructor(t,n,r,i,s,o){super(t,n,r,i,s,null,o)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,n,r,i){return this.dirty==Sr||this.dirty!=cr&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=cr||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=t,this.dirty=cr,!0)}inParent(){let t=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(t,n,r)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,n,r){let i=this.node.cut(t,n),s=document.createTextNode(i.text);return new cu(this.parent,i,this.outerDeco,this.innerDeco,s,s)}markDirty(t,n){super.markDirty(t,n),this.dom!=this.nodeDOM&&(t==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Sr)}get domAtom(){return!1}isText(t){return this.node.text==t}}class Vw extends xl{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==cr&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class o3 extends Ui{constructor(t,n,r,i,s,o,a,l){super(t,n,r,i,s,o,a),this.spec=l}update(t,n,r,i){if(this.dirty==Sr)return!1;if(this.spec.update&&(this.node.type==t.type||this.spec.multiType)){let s=this.spec.update(t,n,r);return s&&this.updateInner(t,n,r,i),s}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,n,r,i){this.spec.setSelection?this.spec.setSelection(t,n,r.root):super.setSelection(t,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function qw(e,t,n){let r=e.firstChild,i=!1;for(let s=0;s<t.length;s++){let o=t[s],a=o.dom;if(a.parentNode==e){for(;a!=r;)r=P0(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(a,r);if(o instanceof Hi){let l=r?r.previousSibling:e.lastChild;qw(o.contentDOM,o.children,n),r=l?l.nextSibling:e.firstChild}}for(;r;)r=P0(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}const Ia=function(e){e&&(this.nodeName=e)};Ia.prototype=Object.create(null);const xs=[new Ia];function zp(e,t,n){if(e.length==0)return xs;let r=n?xs[0]:new Ia,i=[r];for(let s=0;s<e.length;s++){let o=e[s].type.attrs;if(o){o.nodeName&&i.push(r=new Ia(o.nodeName));for(let a in o){let l=o[a];l!=null&&(n&&i.length==1&&i.push(r=new Ia(t.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return i}function Jw(e,t,n,r){if(n==xs&&r==xs)return t;let i=t;for(let s=0;s<r.length;s++){let o=r[s],a=n[s];if(s){let l;a&&a.nodeName==o.nodeName&&i!=e&&(l=i.parentNode)&&l.nodeName.toLowerCase()==o.nodeName||(l=document.createElement(o.nodeName),l.pmIsDeco=!0,l.appendChild(i),a=xs[0]),i=l}a3(i,a||xs[0],o)}return i}function a3(e,t,n){for(let r in t)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let s=0;s<r.length;s++)i.indexOf(r[s])==-1&&e.classList.remove(r[s]);for(let s=0;s<i.length;s++)r.indexOf(i[s])==-1&&e.classList.add(i[s]);e.classList.length==0&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(t.style);)e.style.removeProperty(i[1])}n.style&&(e.style.cssText+=n.style)}}function Zw(e,t,n){return Jw(e,e,xs,zp(t,n,e.nodeType!=1))}function Jc(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function P0(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class l3{constructor(t,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=c3(t.node.content,t)}destroyBetween(t,n){if(t!=n){for(let r=t;r<n;r++)this.top.children[r].destroy();this.top.children.splice(t,n-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,n,r,i){let s=0,o=this.stack.length>>1,a=Math.min(o,t.length);for(;s<a&&(s==o-1?this.top:this.stack[s+1<<1]).matchesMark(t[s])&&t[s].type.spec.spanning!==!1;)s++;for(;s<o;)this.destroyRest(),this.top.dirty=cr,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<t.length;){this.stack.push(this.top,this.index+1);let l=-1,d=this.top.children.length;i<this.preMatch.index&&(d=Math.min(this.index+3,d));for(let u=this.index;u<d;u++){let h=this.top.children[u];if(h.matchesMark(t[o])&&!this.isLocked(h.dom)){l=u;break}}if(l<0&&this.index<this.top.children.length){let u=this.top.children[this.index];u instanceof Hi&&u.dirty!=Sr&&u.mark.type==t[o].type&&u.spec.update&&!this.isLocked(u.dom)&&u.spec.update(t[o])&&(u.mark=t[o],l=this.index,this.changed=!0)}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let u=Hi.create(this.top,t[o],n,r);this.top.children.splice(this.index,0,u),this.top=u,this.changed=!0}this.index=0,o++}}findNodeMatch(t,n,r,i){let s=-1,o;if(i>=this.preMatch.index&&(o=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&o.matchesNode(t,n,r))s=this.top.children.indexOf(o,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let d=this.top.children[a];if(d.matchesNode(t,n,r)&&!this.preMatch.matched.has(d)){s=a;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(t,n,r,i,s){let o=this.top.children[i];return o.dirty==Sr&&o.dom==o.contentDOM&&(o.dirty=ys),o.update(t,n,r,s)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(t){for(;;){let n=t.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=t.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}t=n}}updateNextNode(t,n,r,i,s,o){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof Ui){let d=this.preMatch.matched.get(l);if(d!=null&&d!=s)return!1;let u=l.dom,h,p=this.isLocked(u)&&!(t.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==t.text&&l.dirty!=Sr&&Jc(n,l.outerDeco));if(!p&&l.update(t,n,r,i))return this.destroyBetween(this.index,a),l.dom!=u&&(this.changed=!0),this.index++,!0;if(!p&&(h=this.recreateWrapper(l,t,n,r,i,o)))return this.destroyBetween(this.index,a),this.top.children[this.index]=h,h.contentDOM&&(h.dirty=ys,h.updateChildren(i,o+1),h.dirty=cr),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(t,n,r,i,s,o){if(t.dirty||n.isAtom||!t.children.length||!t.node.content.eq(n.content)||!Jc(r,t.outerDeco)||!i.eq(t.innerDeco))return null;let a=Ui.create(this.top,n,r,i,s,o);if(a.contentDOM){a.children=t.children,t.children=[];for(let l of a.children)l.parent=a}return t.destroy(),a}addNode(t,n,r,i,s){let o=Ui.create(this.top,t,n,r,i,s);o.contentDOM&&o.updateChildren(i,s+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(t,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(t)&&(t==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let s=new Qw(this.top,t,n,r);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let t=this.top.children[this.index-1],n=this.top;for(;t instanceof Hi;)n=t,t=n.children[n.children.length-1];(!t||!(t instanceof cu)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((An||hn)&&t&&t.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(t,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(t))this.index++;else{let r=document.createElement(t);t=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),t=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new Vw(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(t){return this.lock&&(t==this.lock||t.nodeType==1&&t.contains(this.lock.parentNode))}}function c3(e,t){let n=t,r=n.children.length,i=e.childCount,s=new Map,o=[];e:for(;i>0;){let a;for(;;)if(r){let d=n.children[r-1];if(d instanceof Hi)n=d,r=d.children.length;else{a=d,r--;break}}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=e.child(i-1))break;--i,s.set(a,i),o.push(a)}}return{index:i,matched:s,matches:o.reverse()}}function d3(e,t){return e.type.side-t.type.side}function u3(e,t,n,r){let i=t.locals(e),s=0;if(i.length==0){for(let d=0;d<e.childCount;d++){let u=e.child(d);r(u,i,t.forChild(s,u),d),s+=u.nodeSize}return}let o=0,a=[],l=null;for(let d=0;;){let u,h;for(;o<i.length&&i[o].to==s;){let A=i[o++];A.widget&&(u?(h||(h=[u])).push(A):u=A)}if(u)if(h){h.sort(d3);for(let A=0;A<h.length;A++)n(h[A],d,!!l)}else n(u,d,!!l);let p,m;if(l)m=-1,p=l,l=null;else if(d<e.childCount)m=d,p=e.child(d++);else break;for(let A=0;A<a.length;A++)a[A].to<=s&&a.splice(A--,1);for(;o<i.length&&i[o].from<=s&&i[o].to>s;)a.push(i[o++]);let g=s+p.nodeSize;if(p.isText){let A=g;o<i.length&&i[o].from<A&&(A=i[o].from);for(let y=0;y<a.length;y++)a[y].to<A&&(A=a[y].to);A<g&&(l=p.cut(A-s),p=p.cut(0,A-s),g=A,m=-1)}else for(;o<i.length&&i[o].to<g;)o++;let b=p.isInline&&!p.isLeaf?a.filter(A=>!A.inline):a.slice();r(p,b,t.forChild(s,p),m),s=g}}function h3(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}function p3(e,t,n,r){for(let i=0,s=0;i<e.childCount&&s<=r;){let o=e.child(i++),a=s;if(s+=o.nodeSize,!o.isText)continue;let l=o.text;for(;i<e.childCount;){let d=e.child(i++);if(s+=d.nodeSize,!d.isText)break;l+=d.text}if(s>=n){if(s>=r&&l.slice(r-t.length-a,r-a)==t)return r-t.length;let d=a<r?l.lastIndexOf(t,r-a-1):-1;if(d>=0&&d+t.length+a>=n)return a+d;if(n==r&&l.length>=r+t.length-a&&l.slice(r-a,r-a+t.length)==t)return r}}return-1}function Kp(e,t,n,r,i){let s=[];for(let o=0,a=0;o<e.length;o++){let l=e[o],d=a,u=a+=l.size;d>=n||u<=t?s.push(l):(d<t&&s.push(l.slice(0,t-d,r)),i&&(s.push(i),i=void 0),u>n&&s.push(l.slice(n-d,l.size,r)))}return s}function uf(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),s=i&&i.size==0,o=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let a=r.resolve(o),l,d;if(lu(n)){for(l=o;i&&!i.node;)i=i.parent;let h=i.node;if(i&&h.isAtom&&_e.isSelectable(h)&&i.parent&&!(h.isInline&&$P(n.focusNode,n.focusOffset,i.dom))){let p=i.posBefore;d=new _e(o==p?a:r.resolve(p))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let h=o,p=o;for(let m=0;m<n.rangeCount;m++){let g=n.getRangeAt(m);h=Math.min(h,e.docView.posFromDOM(g.startContainer,g.startOffset,1)),p=Math.max(p,e.docView.posFromDOM(g.endContainer,g.endOffset,-1))}if(h<0)return null;[l,o]=p==e.state.selection.anchor?[p,h]:[h,p],a=r.resolve(o)}else l=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let u=r.resolve(l);if(!d){let h=t=="pointer"||e.state.selection.head<a.pos&&!s?1:-1;d=hf(e,u,a,h)}return d}function Xw(e){return e.editable?e.hasFocus():tk(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function pi(e,t=!1){let n=e.state.selection;if(ek(e,n),!Xw(e))return;let r=e.input.mouseDown;if(!t&&hn&&r){let i=e.domSelectionRange(),s=e.domObserver.currentSelection;if(i.anchorNode&&s.anchorNode&&Fs(i.anchorNode,i.anchorOffset,s.anchorNode,s.anchorOffset)&&r.delaySelUpdate()){e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)f3(e);else{let{anchor:i,head:s}=n,o,a;F0&&!(n instanceof De)&&(n.$from.parent.inlineContent||(o=$0(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(a=$0(e,n.to))),e.docView.setSelection(i,s,e,t),F0&&(o&&H0(o),a&&H0(a)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&m3(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}const F0=An||hn&&$w<63;function $0(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,s=r?n.childNodes[r-1]:null;if(An&&i&&i.contentEditable=="false")return Eh(i);if((!i||i.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(i)return Eh(i);if(s)return Eh(s)}}function Eh(e){return e.contentEditable="true",An&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function H0(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function m3(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!Xw(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function f3(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName=="IMG";r?t.collapse(n.parentNode,dn(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&Pn&&$i<=11&&(n.disabled=!0,n.disabled=!1)}function ek(e,t){if(t instanceof _e){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(U0(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else U0(e)}function U0(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function hf(e,t,n,r){return e.someProp("createSelectionBetween",i=>i(e,t,n))||De.between(t,n,r)}function G0(e){return e.editable&&!e.hasFocus()?!1:tk(e)}function tk(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function g3(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return Fs(t.node,t.offset,n.anchorNode,n.anchorOffset)}function Qp(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),s=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return s&&Ge.findFrom(s,t)}function Ni(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function W0(e,t,n){let r=e.state.selection;if(r instanceof De)if(n.indexOf("s")>-1){let{$head:i}=r,s=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let o=e.state.doc.resolve(i.pos+s.nodeSize*(t<0?-1:1));return Ni(e,new De(r.$anchor,o))}else if(r.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let i=Qp(e.state,t);return i&&i instanceof _e?Ni(e,i):!1}else if(!(ir&&n.indexOf("m")>-1)){let i=r.$head,s=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter,o;if(!s||s.isText)return!1;let a=t<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(o=e.docView.descAt(a))&&!o.contentDOM?_e.isSelectable(s)?Ni(e,new _e(t<0?e.state.doc.resolve(i.pos-s.nodeSize):i)):yl?Ni(e,new De(e.state.doc.resolve(t<0?a:a+s.nodeSize))):!1:!1}}else return!1;else{if(r instanceof _e&&r.node.isInline)return Ni(e,new De(t>0?r.$to:r.$from));{let i=Qp(e.state,t);return i?Ni(e,i):!1}}}function Zc(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Da(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function so(e,t){return t<0?A3(e):b3(e)}function A3(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,s,o=!1;for(lr&&n.nodeType==1&&r<Zc(n)&&Da(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(Da(a,-1))i=n,s=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(nk(n))break;{let a=n.previousSibling;for(;a&&Da(a,-1);)i=n.parentNode,s=dn(a),a=a.previousSibling;if(a)n=a,r=Zc(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}o?Vp(e,n,r):i&&Vp(e,i,s)}function b3(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=Zc(n),s,o;for(;;)if(r<i){if(n.nodeType!=1)break;let a=n.childNodes[r];if(Da(a,1))s=n,o=++r;else break}else{if(nk(n))break;{let a=n.nextSibling;for(;a&&Da(a,1);)s=a.parentNode,o=dn(a)+1,a=a.nextSibling;if(a)n=a,r=0,i=Zc(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}}s&&Vp(e,s,o)}function nk(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function y3(e,t){for(;e&&t==e.childNodes.length&&!bl(e);)t=dn(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=0}}function x3(e,t){for(;e&&!t&&!bl(e);)t=dn(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=e.childNodes.length}}function Vp(e,t,n){if(t.nodeType!=3){let s,o;(o=y3(t,n))?(t=o,n=0):(s=x3(t,n))&&(t=s,n=s.nodeValue.length)}let r=e.domSelection();if(!r)return;if(lu(r)){let s=document.createRange();s.setEnd(t,n),s.setStart(t,n),r.removeAllRanges(),r.addRange(s)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&pi(e)},50)}function Y0(e,t){let n=e.state.doc.resolve(t);if(!(hn||Hw)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let i=e.coordsAtPos(t-1),s=(i.top+i.bottom)/2;if(s>r.top&&s<r.bottom&&Math.abs(i.left-r.left)>1)return i.left<r.left?"ltr":"rtl"}if(t<n.end()){let i=e.coordsAtPos(t+1),s=(i.top+i.bottom)/2;if(s>r.top&&s<r.bottom&&Math.abs(i.left-r.left)>1)return i.left>r.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function z0(e,t,n){let r=e.state.selection;if(r instanceof De&&!r.empty||n.indexOf("s")>-1||ir&&n.indexOf("m")>-1)return!1;let{$from:i,$to:s}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let o=Qp(e.state,t);if(o&&o instanceof _e)return Ni(e,o)}if(!i.parent.inlineContent){let o=t<0?i:s,a=r instanceof Vn?Ge.near(o,t):Ge.findFrom(o,t);return a?Ni(e,a):!1}return!1}function K0(e,t){if(!(e.state.selection instanceof De))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let s=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let o=e.state.tr;return t<0?o.delete(n.pos-s.nodeSize,n.pos):o.delete(n.pos,n.pos+s.nodeSize),e.dispatch(o),!0}return!1}function Q0(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function v3(e){if(!An||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let r=t.firstChild;Q0(e,r,"true"),setTimeout(()=>Q0(e,r,"false"),20)}return!1}function w3(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function k3(e,t){let n=t.keyCode,r=w3(t);if(n==8||ir&&n==72&&r=="c")return K0(e,-1)||so(e,-1);if(n==46&&!t.shiftKey||ir&&n==68&&r=="c")return K0(e,1)||so(e,1);if(n==13||n==27)return!0;if(n==37||ir&&n==66&&r=="c"){let i=n==37?Y0(e,e.state.selection.from)=="ltr"?-1:1:-1;return W0(e,i,r)||so(e,i)}else if(n==39||ir&&n==70&&r=="c"){let i=n==39?Y0(e,e.state.selection.from)=="ltr"?1:-1:1;return W0(e,i,r)||so(e,i)}else{if(n==38||ir&&n==80&&r=="c")return z0(e,-1,r)||so(e,-1);if(n==40||ir&&n==78&&r=="c")return v3(e)||z0(e,1,r)||so(e,1);if(r==(ir?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function pf(e,t){e.someProp("transformCopied",m=>{t=m(t,e)});let n=[],{content:r,openStart:i,openEnd:s}=t;for(;i>1&&s>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,s--;let m=r.firstChild;n.push(m.type.name,m.attrs!=m.type.defaultAttrs?m.attrs:null),r=m.content}let o=e.someProp("clipboardSerializer")||zs.fromSchema(e.state.schema),a=lk(),l=a.createElement("div");l.appendChild(o.serializeFragment(r,{document:a}));let d=l.firstChild,u,h=0;for(;d&&d.nodeType==1&&(u=ak[d.nodeName.toLowerCase()]);){for(let m=u.length-1;m>=0;m--){let g=a.createElement(u[m]);for(;l.firstChild;)g.appendChild(l.firstChild);l.appendChild(g),h++}d=l.firstChild}d&&d.nodeType==1&&d.setAttribute("data-pm-slice",`${i} ${s}${h?` -${h}`:""} ${JSON.stringify(n)}`);let p=e.someProp("clipboardTextSerializer",m=>m(t,e))||t.content.textBetween(0,t.content.size,`
|
|
135
|
+
|
|
136
|
+
`);return{dom:l,text:p,slice:t}}function rk(e,t,n,r,i){let s=i.parent.type.spec.code,o,a;if(!n&&!t)return null;let l=!!t&&(r||s||!n);if(l){if(e.someProp("transformPastedText",p=>{t=p(t,s||r,e)}),s)return a=new Ae(V.from(e.state.schema.text(t.replace(/\r\n?/g,`
|
|
137
|
+
`))),0,0),e.someProp("transformPasted",p=>{a=p(a,e,!0)}),a;let h=e.someProp("clipboardTextParser",p=>p(t,i,r,e));if(h)a=h;else{let p=i.marks(),{schema:m}=e.state,g=zs.fromSchema(m);o=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(b=>{let A=o.appendChild(document.createElement("p"));b&&A.appendChild(g.serializeNode(m.text(b,p)))})}}else e.someProp("transformPastedHTML",h=>{n=h(n,e)}),o=S3(n),yl&&_3(o);let d=o&&o.querySelector("[data-pm-slice]"),u=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let h=+u[3];h>0;h--){let p=o.firstChild;for(;p&&p.nodeType!=1;)p=p.nextSibling;if(!p)break;o=p}if(a||(a=(e.someProp("clipboardParser")||e.someProp("domParser")||Fi.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(l||u),context:i,ruleFromNode(h){return h.nodeName=="BR"&&!h.nextSibling&&h.parentNode&&!E3.test(h.parentNode.nodeName)?{ignore:!0}:null}})),u)a=N3(V0(a,+u[1],+u[2]),u[4]);else if(a=Ae.maxOpen(C3(a.content,i),!0),a.openStart||a.openEnd){let h=0,p=0;for(let m=a.content.firstChild;h<a.openStart&&!m.type.spec.isolating;h++,m=m.firstChild);for(let m=a.content.lastChild;p<a.openEnd&&!m.type.spec.isolating;p++,m=m.lastChild);a=V0(a,h,p)}return e.someProp("transformPasted",h=>{a=h(a,e,l)}),a}const E3=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function C3(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),i,s=[];if(e.forEach(o=>{if(!s)return;let a=r.findWrapping(o.type),l;if(!a)return s=null;if(l=s.length&&i.length&&sk(a,i,o,s[s.length-1],0))s[s.length-1]=l;else{s.length&&(s[s.length-1]=ok(s[s.length-1],i.length));let d=ik(o,a);s.push(d),r=r.matchType(d.type),i=a}}),s)return V.from(s)}return e}function ik(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,V.from(e));return e}function sk(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let s=sk(e,t,n,r.lastChild,i+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(V.from(ik(n,e,i+1))))}}function ok(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,ok(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(V.empty,!0);return e.copy(n.append(r))}function qp(e,t,n,r,i,s){let o=t<0?e.firstChild:e.lastChild,a=o.content;return e.childCount>1&&(s=0),i<r-1&&(a=qp(a,t,n,r,i+1,s)),i>=n&&(a=t<0?o.contentMatchAt(0).fillBefore(a,s<=i).append(a):a.append(o.contentMatchAt(o.childCount).fillBefore(V.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(a))}function V0(e,t,n){return t<e.openStart&&(e=new Ae(qp(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new Ae(qp(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const ak={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};function lk(){return document.implementation.createHTMLDocument("title")}let oa=null;function T3(e){let t=window.trustedTypes;if(!t)return e;if(!oa){if(oa=t.defaultPolicy)try{return oa.createHTML(e)}catch{}oa=t.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})}return oa.createHTML(e)}function S3(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=lk(),r=n.body,i=/<([a-z][^>\s]+)/i.exec(e),s;if((s=i&&ak[i[1].toLowerCase()])&&(e=s.map(o=>"<"+o+">").join("")+e+s.map(o=>"</"+o+">").reverse().join("")),r.innerHTML=T3(e),s)for(let o=0;o<s.length;o++)r=r.querySelector(s[o])||r;for(let o=0;o<n.styleSheets.length;o++){let a=n.styleSheets[o];for(let l=0;l<a.rules.length;l++){let d=a.rules[l];if(d instanceof CSSStyleRule){let u=r.querySelectorAll(d.selectorText);for(let h=0;h<u.length;h++)u[h].style.cssText+=d.style.cssText}}}return r}function _3(e){let t=e.querySelectorAll(hn?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}function N3(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:s,openEnd:o}=e;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;try{l.checkAttrs(r[a+1])}catch{break}i=V.from(l.create(r[a+1],i)),s++,o++}return new Ae(i,s,o)}const Tn={},Sn={},I3={touchstart:!0,touchmove:!0};class D3{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function M3(e){for(let t in Tn){let n=Tn[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=r=>{R3(e,r)&&!mf(e,r)&&(e.editable||!(r.type in Sn))&&n(e,r)},I3[t]?{passive:!0}:void 0)}An&&e.dom.addEventListener("input",()=>null),Jp(e)}function di(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function O3(e){e.input.mouseDown&&e.input.mouseDown.done(),e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function Jp(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=r=>mf(e,r))})}function mf(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function R3(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function L3(e,t){!mf(e,t)&&Tn[t.type]&&(e.editable||!(t.type in Sn))&&Tn[t.type](e,t)}Sn.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!hk(e)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(ci&&hn&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),Do&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",i=>i(e,As(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,n))||k3(e,n)?n.preventDefault():di(e,"key")};Sn.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};Sn.keypress=(e,t)=>{let n=t;if(hk(e)||!n.charCode||n.ctrlKey&&!n.altKey||ir&&n.metaKey)return;if(e.someProp("handleKeyPress",i=>i(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof De)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode),s=()=>e.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!e.someProp("handleTextInput",o=>o(e,r.$from.pos,r.$to.pos,i,s))&&e.dispatch(s()),n.preventDefault()}};function vl(e){return{left:e.clientX,top:e.clientY}}function j3(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function ff(e,t,n,r,i){if(r==-1)return!1;let s=e.state.doc.resolve(r);for(let o=s.depth+1;o>0;o--)if(e.someProp(t,a=>o>s.depth?a(e,n,s.nodeAfter,s.before(o),i,!0):a(e,n,s.node(o),s.before(o),i,!1)))return!0;return!1}function wl(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);r.setMeta("pointer",!0),e.dispatch(r)}function B3(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&_e.isSelectable(r)?(wl(e,new _e(n)),!0):!1}function P3(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof _e&&(r=n.node);let s=e.state.doc.resolve(t);for(let o=s.depth+1;o>0;o--){let a=o>s.depth?s.nodeAfter:s.node(o);if(_e.isSelectable(a)){r&&n.$from.depth>0&&o>=n.$from.depth&&s.before(n.$from.depth+1)==n.$from.pos?i=s.before(n.$from.depth):i=s.before(o);break}}return i!=null?(wl(e,_e.create(e.state.doc,i)),!0):!1}function F3(e,t,n,r,i){return ff(e,"handleClickOn",t,n,r)||e.someProp("handleClick",s=>s(e,t,r))||(i?P3(e,n):B3(e,n))}function $3(e,t,n,r){return ff(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",i=>i(e,t,r))}function H3(e,t,n,r){return ff(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",i=>i(e,t,r))||U3(e,n,r)}function U3(e,t,n){if(n.button!=0)return!1;let r=ck(e,t,!0),i=e.state.doc;return r?(wl(e,r),r instanceof De&&i.eq(e.state.doc)&&(e.input.mouseDown=new W3(e,r)),!0):!1}function ck(e,t,n){let r=e.state.doc;if(t==-1)return r.inlineContent?De.create(r,0,r.content.size):null;let i=r.resolve(t);for(let s=i.depth+1;s>0;s--){let o=s>i.depth?i.nodeAfter:i.node(s),a=i.before(s);if(o.inlineContent)return De.create(r,a+1,a+1+o.content.size);if(n&&_e.isSelectable(o))return _e.create(r,a)}return null}function gf(e){return Xc(e)}const dk=ir?"metaKey":"ctrlKey";Tn.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=gf(e),i=Date.now(),s="singleClick";i-e.input.lastClick.time<500&&j3(n,e.input.lastClick)&&!n[dk]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type=="singleClick"?s="doubleClick":e.input.lastClick.type=="doubleClick"&&(s="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:s,button:n.button},e.input.mouseDown&&e.input.mouseDown.done();let o=e.posAtCoords(vl(n));o&&(s=="singleClick"?e.input.mouseDown=new G3(e,o,n,!!r):(s=="doubleClick"?$3:H3)(e,o.pos,o.inside,n)?n.preventDefault():di(e,"pointer"))};class uk{constructor(t){this.view=t,this.mightDrag=null,t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(t){this.done()}move(t){t.buttons==0&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}}class G3 extends uk{constructor(t,n,r,i){super(t),this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.startDoc=t.state.doc,this.selectNode=!!r[dk],this.allowDefault=r.shiftKey;let s,o;if(n.inside>-1)s=t.state.doc.nodeAt(n.inside),o=n.inside;else{let u=t.state.doc.resolve(n.pos);s=u.parent,o=u.depth?u.before():0}const a=i?null:r.target,l=a?t.docView.nearestDesc(a,!0):null;this.target=l&&l.nodeDOM.nodeType==1?l.nodeDOM:null;let{selection:d}=t.state;r.button==0&&(s.type.spec.draggable&&s.type.spec.selectable!==!1||d instanceof _e&&d.from<=o&&d.to>o)&&(this.mightDrag={node:s,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&lr&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),di(t,"pointer")}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||pi(this.view)})}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(vl(t))),this.updateAllowDefault(t),this.allowDefault||!n?di(this.view,"pointer"):F3(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||An&&this.mightDrag&&!this.mightDrag.node.isAtom||hn&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(wl(this.view,Ge.near(this.view.state.doc.resolve(n.pos))),t.preventDefault()):di(this.view,"pointer")}move(t){this.updateAllowDefault(t),di(this.view,"pointer"),super.move(t)}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}}class W3 extends uk{constructor(t,n){super(t),this.startSelection=n,this.startDoc=t.state.doc}move(t){if(t.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}t.preventDefault(),di(this.view,"pointer");let n=this.view.posAtCoords(vl(t)),r=n&&ck(this.view,n.inside,!1);if(!r)return;let{doc:i}=this.view.state,s=this.startSelection,[o,a]=r.from<s.from?[s.to,r.from]:[s.from,r.to];wl(this.view,De.create(i,o,a))}}Tn.touchstart=e=>{e.input.lastTouch=Date.now(),gf(e),di(e,"pointer")};Tn.touchmove=e=>{e.input.lastTouch=Date.now(),di(e,"pointer")};Tn.contextmenu=e=>gf(e);function hk(e,t){return e.composing?!0:An&&Math.abs(Date.now()-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const Y3=ci?5e3:-1;Sn.compositionstart=Sn.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof De&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||hn&&Hw&&z3(e)))e.markCursor=e.state.storedMarks||n.marks(),Xc(e,!0),e.markCursor=null;else if(Xc(e,!t.selection.empty),lr&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=e.domSelectionRange();for(let i=r.focusNode,s=r.focusOffset;i&&i.nodeType==1&&s!=0;){let o=s<0?i.lastChild:i.childNodes[s-1];if(!o)break;if(o.nodeType==3){let a=e.domSelection();a&&a.collapse(o,o.nodeValue.length);break}else i=o,s=-1}}e.input.composing=!0}pk(e,Y3)};function z3(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return r.nodeType==1&&r.contentEditable=="false"}Sn.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now(),e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,pk(e,20))};function pk(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Xc(e),t))}function mk(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function K3(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=PP(t.focusNode,t.focusOffset),r=FP(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,s=e.domObserver.lastChangedTextNode;if(n==s||r==s)return s;if(!i||!i.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let o=n.pmViewDesc;if(!(!o||!o.isText(n.nodeValue)))return r}}return n||r}function Xc(e,t=!1){if(!(ci&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),mk(e),t||e.docView&&e.docView.dirty){let n=uf(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function Q3(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}const tl=Pn&&$i<15||Do&&GP<604;Tn.copy=Sn.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type=="cut";if(r.empty)return;let s=tl?null:n.clipboardData,o=r.content(),{dom:a,text:l}=pf(e,o);s?(n.preventDefault(),s.clearData(),s.setData("text/html",a.innerHTML),s.setData("text/plain",l)):Q3(e,a),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function V3(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function q3(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?nl(e,r.value,null,i,t):nl(e,r.textContent,r.innerHTML,i,t)},50)}function nl(e,t,n,r,i){let s=rk(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",l=>l(e,i,s||Ae.empty)))return!0;if(!s)return!1;let o=V3(s),a=o?e.state.tr.replaceSelectionWith(o,r):e.state.tr.replaceSelection(s);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function fk(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Sn.paste=(e,t)=>{let n=t;if(e.composing&&!ci)return;let r=tl?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&nl(e,fk(r),r.getData("text/html"),i,n)?n.preventDefault():q3(e,n)};class gk{constructor(t,n,r){this.slice=t,this.move=n,this.node=r}}const J3=ir?"altKey":"ctrlKey";function Ak(e,t){let n;return e.someProp("dragCopies",r=>{n=n||r(t)}),n!=null?!n:!t[J3]}Tn.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,s=i.empty?null:e.posAtCoords(vl(n)),o;if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof _e?i.to-1:i.to))){if(r&&r.mightDrag)o=_e.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let h=e.docView.nearestDesc(n.target,!0);h&&h.node.type.spec.draggable&&h!=e.docView&&(o=_e.create(e.state.doc,h.posBefore))}}let a=(o||e.state.selection).content(),{dom:l,text:d,slice:u}=pf(e,a);(!n.dataTransfer.files.length||!hn||$w>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(tl?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",tl||n.dataTransfer.setData("text/plain",d),e.dragging=new gk(u,Ak(e,n),o)};Tn.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};Sn.dragover=Sn.dragenter=(e,t)=>t.preventDefault();Sn.drop=(e,t)=>{try{Z3(e,t,e.dragging)}finally{e.dragging=null}};function Z3(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(vl(t));if(!r)return;let i=e.state.doc.resolve(r.pos),s=n&&n.slice;s?e.someProp("transformPasted",m=>{s=m(s,e,!1)}):s=rk(e,fk(t.dataTransfer),tl?null:t.dataTransfer.getData("text/html"),!1,i);let o=!!(n&&Ak(e,t));if(e.someProp("handleDrop",m=>m(e,t,s||Ae.empty,o))){t.preventDefault();return}if(!s)return;t.preventDefault();let a=s?bw(e.state.doc,i.pos,s):i.pos;a==null&&(a=i.pos);let l=e.state.tr;if(o){let{node:m}=n;m?m.replace(l):l.deleteSelection()}let d=l.mapping.map(a),u=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,h=l.doc;if(u?l.replaceRangeWith(d,d,s.content.firstChild):l.replaceRange(d,d,s),l.doc.eq(h))return;let p=l.doc.resolve(d);if(u&&_e.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))l.setSelection(new _e(p));else{let m=l.mapping.map(a);l.mapping.maps[l.mapping.maps.length-1].forEach((g,b,A,y)=>m=y),l.setSelection(hf(e,p,l.doc.resolve(m)))}e.focus(),e.dispatch(l.setMeta("uiEvent","drop"))}Tn.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&pi(e)},20))};Tn.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};Tn.beforeinput=(e,t)=>{if(ci&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:n}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=n||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",i=>i(e,As(8,"Backspace")))))return;let{$cursor:r}=e.state.selection;r&&r.pos>0&&e.dispatch(e.state.tr.delete(r.pos-1,r.pos).scrollIntoView())},50)}};for(let e in Sn)Tn[e]=Sn[e];function rl(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class ed{constructor(t,n){this.toDOM=t,this.spec=n||Ds,this.side=this.spec.side||0}map(t,n,r,i){let{pos:s,deleted:o}=t.mapResult(n.from+i,this.side<0?-1:1);return o?null:new En(s-r,s-r,this)}valid(){return!0}eq(t){return this==t||t instanceof ed&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&rl(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Gi{constructor(t,n){this.attrs=t,this.spec=n||Ds}map(t,n,r,i){let s=t.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,o=t.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return s>=o?null:new En(s,o,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof Gi&&rl(this.attrs,t.attrs)&&rl(this.spec,t.spec)}static is(t){return t.type instanceof Gi}destroy(){}}class Af{constructor(t,n){this.attrs=t,this.spec=n||Ds}map(t,n,r,i){let s=t.mapResult(n.from+i,1);if(s.deleted)return null;let o=t.mapResult(n.to+i,-1);return o.deleted||o.pos<=s.pos?null:new En(s.pos-r,o.pos-r,this)}valid(t,n){let{index:r,offset:i}=t.content.findIndex(n.from),s;return i==n.from&&!(s=t.child(r)).isText&&i+s.nodeSize==n.to}eq(t){return this==t||t instanceof Af&&rl(this.attrs,t.attrs)&&rl(this.spec,t.spec)}destroy(){}}class En{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new En(t,n,this.type)}eq(t,n=0){return this.type.eq(t.type)&&this.from+n==t.from&&this.to+n==t.to}map(t,n,r){return this.type.map(t,this,n,r)}static widget(t,n,r){return new En(t,t,new ed(n,r))}static inline(t,n,r,i){return new En(t,n,new Gi(r,i))}static node(t,n,r,i){return new En(t,n,new Af(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Gi}get widget(){return this.type instanceof ed}}const uo=[],Ds={};class ot{constructor(t,n){this.local=t.length?t:uo,this.children=n.length?n:uo}static create(t,n){return n.length?td(n,t,0,Ds):gn}find(t,n,r){let i=[];return this.findInner(t??0,n??1e9,i,0,r),i}findInner(t,n,r,i,s){for(let o=0;o<this.local.length;o++){let a=this.local[o];a.from<=n&&a.to>=t&&(!s||s(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<n&&this.children[o+1]>t){let a=this.children[o]+1;this.children[o+2].findInner(t-a,n-a,r,i+a,s)}}map(t,n,r){return this==gn||t.maps.length==0?this:this.mapInner(t,n,0,0,r||Ds)}mapInner(t,n,r,i,s){let o;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(t,r,i);l&&l.type.valid(n,l)?(o||(o=[])).push(l):s.onRemove&&s.onRemove(this.local[a].spec)}return this.children.length?X3(this.children,o||[],t,n,r,i,s):o?new ot(o.sort(Ms),uo):gn}add(t,n){return n.length?this==gn?ot.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,s=0;t.forEach((a,l)=>{let d=l+r,u;if(u=yk(n,a,d)){for(i||(i=this.children.slice());s<i.length&&i[s]<l;)s+=3;i[s]==l?i[s+2]=i[s+2].addInner(a,u,d+1):i.splice(s,0,l,l+a.nodeSize,td(u,a,d+1,Ds)),s+=3}});let o=bk(s?xk(n):n,-r);for(let a=0;a<o.length;a++)o[a].type.valid(t,o[a])||o.splice(a--,1);return new ot(o.length?this.local.concat(o).sort(Ms):this.local,i||this.children)}remove(t){return t.length==0||this==gn?this:this.removeInner(t,0)}removeInner(t,n){let r=this.children,i=this.local;for(let s=0;s<r.length;s+=3){let o,a=r[s]+n,l=r[s+1]+n;for(let u=0,h;u<t.length;u++)(h=t[u])&&h.from>a&&h.to<l&&(t[u]=null,(o||(o=[])).push(h));if(!o)continue;r==this.children&&(r=this.children.slice());let d=r[s+2].removeInner(o,a+1);d!=gn?r[s+2]=d:(r.splice(s,3),s-=3)}if(i.length){for(let s=0,o;s<t.length;s++)if(o=t[s])for(let a=0;a<i.length;a++)i[a].eq(o,n)&&(i==this.local&&(i=this.local.slice()),i.splice(a--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new ot(i,r):gn}forChild(t,n){if(this==gn)return this;if(n.isLeaf)return ot.empty;let r,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=t){this.children[a]==t&&(r=this.children[a+2]);break}let s=t+1,o=s+n.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<o&&l.to>s&&l.type instanceof Gi){let d=Math.max(s,l.from)-s,u=Math.min(o,l.to)-s;d<u&&(i||(i=[])).push(l.copy(d,u))}}if(i){let a=new ot(i.sort(Ms),uo);return r?new Mi([a,r]):a}return r||gn}eq(t){if(this==t)return!0;if(!(t instanceof ot)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0}locals(t){return bf(this.localsInner(t))}localsInner(t){if(this==gn)return uo;if(t.inlineContent||!this.local.some(Gi.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Gi||n.push(this.local[r]);return n}forEachSet(t){t(this)}}ot.empty=new ot([],[]);ot.removeOverlap=bf;const gn=ot.empty;class Mi{constructor(t){this.members=t}map(t,n){const r=this.members.map(i=>i.map(t,n,Ds));return Mi.from(r)}forChild(t,n){if(n.isLeaf)return ot.empty;let r=[];for(let i=0;i<this.members.length;i++){let s=this.members[i].forChild(t,n);s!=gn&&(s instanceof Mi?r=r.concat(s.members):r.push(s))}return Mi.from(r)}eq(t){if(!(t instanceof Mi)||t.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}locals(t){let n,r=!0;for(let i=0;i<this.members.length;i++){let s=this.members[i].localsInner(t);if(s.length)if(!n)n=s;else{r&&(n=n.slice(),r=!1);for(let o=0;o<s.length;o++)n.push(s[o])}}return n?bf(r?n:n.sort(Ms)):uo}static from(t){switch(t.length){case 0:return gn;case 1:return t[0];default:return new Mi(t.every(n=>n instanceof ot)?t:t.reduce((n,r)=>n.concat(r instanceof ot?r:r.members),[]))}}forEachSet(t){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(t)}}function X3(e,t,n,r,i,s,o){let a=e.slice();for(let d=0,u=s;d<n.maps.length;d++){let h=0;n.maps[d].forEach((p,m,g,b)=>{let A=b-g-(m-p);for(let y=0;y<a.length;y+=3){let w=a[y+1];if(w<0||p>w+u-h)continue;let C=a[y]+u-h;m>=C?a[y+1]=p<=C?-2:-1:p>=u&&A&&(a[y]+=A,a[y+1]+=A)}h+=A}),u=n.maps[d].map(u,-1)}let l=!1;for(let d=0;d<a.length;d+=3)if(a[d+1]<0){if(a[d+1]==-2){l=!0,a[d+1]=-1;continue}let u=n.map(e[d]+s),h=u-i;if(h<0||h>=r.content.size){l=!0;continue}let p=n.map(e[d+1]+s,-1),m=p-i,{index:g,offset:b}=r.content.findIndex(h),A=r.maybeChild(g);if(A&&b==h&&b+A.nodeSize==m){let y=a[d+2].mapInner(n,A,u+1,e[d]+s+1,o);y!=gn?(a[d]=h,a[d+1]=m,a[d+2]=y):(a[d+1]=-2,l=!0)}else l=!0}if(l){let d=eF(a,e,t,n,i,s,o),u=td(d,r,0,o);t=u.local;for(let h=0;h<a.length;h+=3)a[h+1]<0&&(a.splice(h,3),h-=3);for(let h=0,p=0;h<u.children.length;h+=3){let m=u.children[h];for(;p<a.length&&a[p]<m;)p+=3;a.splice(p,0,u.children[h],u.children[h+1],u.children[h+2])}}return new ot(t.sort(Ms),a)}function bk(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new En(i.from+t,i.to+t,i.type))}return n}function eF(e,t,n,r,i,s,o){function a(l,d){for(let u=0;u<l.local.length;u++){let h=l.local[u].map(r,i,d);h?n.push(h):o.onRemove&&o.onRemove(l.local[u].spec)}for(let u=0;u<l.children.length;u+=3)a(l.children[u+2],l.children[u]+d+1)}for(let l=0;l<e.length;l+=3)e[l+1]==-1&&a(e[l+2],t[l]+s+1);return n}function yk(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let s=0,o;s<e.length;s++)(o=e[s])&&o.from>n&&o.to<r&&((i||(i=[])).push(o),e[s]=null);return i}function xk(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function td(e,t,n,r){let i=[],s=!1;t.forEach((a,l)=>{let d=yk(e,a,l+n);if(d){s=!0;let u=td(d,a,n+l+1,r);u!=gn&&i.push(l,l+a.nodeSize,u)}});let o=bk(s?xk(e):e,-n).sort(Ms);for(let a=0;a<o.length;a++)o[a].type.valid(t,o[a])||(r.onRemove&&r.onRemove(o[a].spec),o.splice(a--,1));return o.length||i.length?new ot(o,i):gn}function Ms(e,t){return e.from-t.from||e.to-t.to}function bf(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let s=t[i];if(s.from==r.from){s.to!=r.to&&(t==e&&(t=e.slice()),t[i]=s.copy(s.from,r.to),q0(t,i+1,s.copy(r.to,s.to)));continue}else{s.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,s.from),q0(t,i,r.copy(s.from,r.to)));break}}}return t}function q0(e,t,n){for(;t<e.length&&Ms(n,e[t])>0;)t++;e.splice(t,0,n)}function Ch(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=gn&&t.push(r)}),e.cursorWrapper&&t.push(ot.create(e.state.doc,[e.cursorWrapper.deco])),Mi.from(t)}const tF={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},nF=Pn&&$i<=11;class rF{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class iF{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new rF,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);Pn&&$i<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():An&&t.composing&&r.some(i=>i.type=="childList"&&i.target.nodeName=="TR")?(t.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),nF&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,tF)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let n=0;n<t.length;n++)this.queue.push(t[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(G0(this.view)){if(this.suppressingSelectionUpdates)return pi(this.view);if(Pn&&$i<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&Fs(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let n=new Set,r;for(let s=t.focusNode;s;s=Io(s))n.add(s);for(let s=t.anchorNode;s;s=Io(s))if(n.has(s)){r=s;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=t.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&G0(t)&&!this.ignoreSelectionChange(r),s=-1,o=-1,a=!1,l=[];if(t.editable)for(let u=0;u<n.length;u++){let h=this.registerMutation(n[u],l);h&&(s=s<0?h.from:Math.min(h.from,s),o=o<0?h.to:Math.max(h.to,o),h.typeOver&&(a=!0))}if(l.some(u=>u.nodeName=="BR")&&(t.input.lastKeyCode==8||t.input.lastKeyCode==46||hn&&(t.composing||t.input.compositionEndedAt>Date.now()-50)&&n.some(u=>u.type=="childList"&&u.removedNodes.length))){for(let u of l)if(u.nodeName=="BR"&&u.parentNode){let h=u.nextSibling;for(;h&&h.nodeType==1;){if(h.contentEditable=="false"){u.parentNode.removeChild(u);break}h=h.firstChild}}}else if(lr&&l.length){let u=l.filter(h=>h.nodeName=="BR");if(u.length==2){let[h,p]=u;h.parentNode&&h.parentNode.parentNode==p.parentNode?p.remove():h.remove()}else{let{focusNode:h}=this.currentSelection;for(let p of u){let m=p.parentNode;m&&m.nodeName=="LI"&&(!h||aF(t,h)!=m)&&p.remove()}}}let d=null;s<0&&i&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&lu(r)&&(d=uf(t))&&d.eq(Ge.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,pi(t),this.currentSelection.set(r),t.scrollToSelection()):(s>-1||i)&&(s>-1&&(t.docView.markDirty(s,o),sF(t)),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,lF(t,l)),this.handleDOMChange(s,o,a,l),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||pi(t),this.currentSelection.set(r))}registerMutation(t,n){if(n.indexOf(t.target)>-1)return null;let r=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(r==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!r||r.ignoreMutation(t))return null;if(t.type=="childList"){for(let u=0;u<t.addedNodes.length;u++){let h=t.addedNodes[u];n.push(h),h.nodeType==3&&(this.lastChangedTextNode=h)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(t.target))return{from:r.posBefore,to:r.posAfter};let i=t.previousSibling,s=t.nextSibling;if(Pn&&$i<=11&&t.addedNodes.length)for(let u=0;u<t.addedNodes.length;u++){let{previousSibling:h,nextSibling:p}=t.addedNodes[u];(!h||Array.prototype.indexOf.call(t.addedNodes,h)<0)&&(i=h),(!p||Array.prototype.indexOf.call(t.addedNodes,p)<0)&&(s=p)}let o=i&&i.parentNode==t.target?dn(i)+1:0,a=r.localPosFromDOM(t.target,o,-1),l=s&&s.parentNode==t.target?dn(s):t.target.childNodes.length,d=r.localPosFromDOM(t.target,l,1);return{from:a,to:d}}else return t.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=t.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:t.target.nodeValue==t.oldValue})}}let J0=new WeakMap,Z0=!1;function sF(e){if(!J0.has(e)&&(J0.set(e,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=lr,Z0)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Z0=!0}}function X0(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,s=t.endOffset,o=e.domAtPos(e.state.selection.anchor);return Fs(o.node,o.offset,i,s)&&([n,r,i,s]=[i,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}}function oF(e,t){if(t.getComposedRanges){let i=t.getComposedRanges(e.root)[0];if(i)return X0(e,i)}let n;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0),n?X0(e,n):null}function aF(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let r=e.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function lF(e,t){var n;let{focusNode:r,focusOffset:i}=e.domSelectionRange();for(let s of t)if(((n=s.parentNode)===null||n===void 0?void 0:n.nodeName)=="TR"){let o=s.nextSibling;for(;o&&o.nodeName!="TD"&&o.nodeName!="TH";)o=o.nextSibling;if(o){let a=o;for(;;){let l=a.firstChild;if(!l||l.nodeType!=1||l.contentEditable=="false"||/^(BR|IMG)$/.test(l.nodeName))break;a=l}a.insertBefore(s,a.firstChild),r==s&&e.domSelection().collapse(s,i)}else s.parentNode.removeChild(s)}}function cF(e,t,n,r){let{node:i,fromOffset:s,toOffset:o,from:a,to:l}=e.docView.parseRange(t,n),d=e.domSelectionRange(),u,h=d.anchorNode;if(h&&e.dom.contains(h.nodeType==1?h:h.parentNode)&&(u=[{node:h,offset:d.anchorOffset}],lu(d)||u.push({node:d.focusNode,offset:d.focusOffset})),hn&&e.input.lastKeyCode===8)for(let y=o;y>s;y--){let w=i.childNodes[y-1],C=w.pmViewDesc;if(w.nodeName=="BR"&&!C){o=y;break}if(!C||C.size)break}let p=e.state.doc,m=e.someProp("domParser")||Fi.fromSchema(e.state.schema),g=p.resolve(a),b=null,A=m.parse(i,{topNode:g.parent,topMatch:g.parent.contentMatchAt(g.index()),topOpen:!0,from:s,to:o,preserveWhitespace:g.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:dF(r),context:g});if(u&&u[0].pos!=null){let y=u[0].pos,w=u[1]&&u[1].pos;w==null&&(w=y),b={anchor:y+a,head:w+a}}return{doc:A,sel:b,from:a,to:l}}const dF=e=>t=>{let n=t.pmViewDesc;if(n)return n.parseRule(e);if(t.nodeName=="BR"&&t.parentNode){if(An&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}else if(t.parentNode.lastChild==t||An&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null},uF=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function hF(e,t,n,r,i){let s=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let I=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,L=uf(e,I);if(L&&!e.state.selection.eq(L)){if(hn&&ci&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",B=>B(e,As(13,"Enter"))))return;let R=e.state.tr.setSelection(L);I=="pointer"?R.setMeta("pointer",!0):I=="key"&&R.scrollIntoView(),s&&R.setMeta("composition",s),e.dispatch(R)}return}let o=e.state.doc.resolve(t),a=o.sharedDepth(n);t=o.before(a+1),n=e.state.doc.resolve(n).after(a+1);let l=e.state.selection,d=cF(e,t,n,i),u=e.state.doc,h=u.slice(d.from,d.to),p,m;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(p=e.state.selection.to,m="end"):(p=e.state.selection.from,m="start"),e.input.lastKeyCode=null;let g=fF(h.content,d.doc.content,d.from,p,m);if(g&&e.input.domChangeCount++,(Do&&e.input.lastIOSEnter>Date.now()-225||ci)&&i.some(I=>I.nodeType==1&&!uF.test(I.nodeName))&&(!g||g.endA>=g.endB)&&e.someProp("handleKeyDown",I=>I(e,As(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!g)if(r&&l instanceof De&&!l.empty&&l.$head.sameParent(l.$anchor)&&!e.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))g={start:l.from,endA:l.to,endB:l.to};else{if(d.sel){let I=ey(e,e.state.doc,d.sel);if(I&&!I.eq(e.state.selection)){let L=e.state.tr.setSelection(I);s&&L.setMeta("composition",s),e.dispatch(L)}}return}e.state.selection.from<e.state.selection.to&&g.start==g.endB&&e.state.selection instanceof De&&(g.start>e.state.selection.from&&g.start<=e.state.selection.from+2&&e.state.selection.from>=d.from?g.start=e.state.selection.from:g.endA<e.state.selection.to&&g.endA>=e.state.selection.to-2&&e.state.selection.to<=d.to&&(g.endB+=e.state.selection.to-g.endA,g.endA=e.state.selection.to)),Pn&&$i<=11&&g.endB==g.start+1&&g.endA==g.start&&g.start>d.from&&d.doc.textBetween(g.start-d.from-1,g.start-d.from+1)==" "&&(g.start--,g.endA--,g.endB--);let b=d.doc.resolveNoCache(g.start-d.from),A=d.doc.resolveNoCache(g.endB-d.from),y=u.resolve(g.start),w=b.sameParent(A)&&b.parent.inlineContent&&y.end()>=g.endA;if((Do&&e.input.lastIOSEnter>Date.now()-225&&(!w||i.some(I=>I.nodeName=="DIV"||I.nodeName=="P"))||!w&&b.pos<d.doc.content.size&&(!b.sameParent(A)||!b.parent.inlineContent)&&b.pos<A.pos&&!/\S/.test(d.doc.textBetween(b.pos,A.pos,"","")))&&e.someProp("handleKeyDown",I=>I(e,As(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>g.start&&mF(u,g.start,g.endA,b,A)&&e.someProp("handleKeyDown",I=>I(e,As(8,"Backspace")))){ci&&hn&&e.domObserver.suppressSelectionUpdates();return}hn&&g.endB==g.start&&(e.input.lastChromeDelete=Date.now()),ci&&!w&&b.start()!=A.start()&&A.parentOffset==0&&b.depth==A.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==g.endA&&(g.endB-=2,A=d.doc.resolveNoCache(g.endB-d.from),setTimeout(()=>{e.someProp("handleKeyDown",function(I){return I(e,As(13,"Enter"))})},20));let C=g.start,E=g.endA,S=I=>{let L=I||e.state.tr.replace(C,E,d.doc.slice(g.start-d.from,g.endB-d.from));if(d.sel){let R=ey(e,L.doc,d.sel);R&&!(hn&&e.composing&&R.empty&&(g.start!=g.endB||e.input.lastChromeDelete<Date.now()-100)&&(R.head==C||R.head==L.mapping.map(E)-1)||Pn&&R.empty&&R.head==C)&&L.setSelection(R)}return s&&L.setMeta("composition",s),L.scrollIntoView()},k;if(w)if(b.pos==A.pos){Pn&&$i<=11&&b.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>pi(e),20));let I=S(e.state.tr.delete(C,E)),L=u.resolve(g.start).marksAcross(u.resolve(g.endA));L&&I.ensureMarks(L),e.dispatch(I)}else if(g.endA==g.endB&&(k=pF(b.parent.content.cut(b.parentOffset,A.parentOffset),y.parent.content.cut(y.parentOffset,g.endA-y.start())))){let I=S(e.state.tr);k.type=="add"?I.addMark(C,E,k.mark):I.removeMark(C,E,k.mark),e.dispatch(I)}else if(b.parent.child(b.index()).isText&&b.index()==A.index()-(A.textOffset?0:1)){let I=b.parent.textBetween(b.parentOffset,A.parentOffset),L=()=>S(e.state.tr.insertText(I,C,E));e.someProp("handleTextInput",R=>R(e,C,E,I,L))||e.dispatch(L())}else e.dispatch(S());else e.dispatch(S())}function ey(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:hf(e,t.resolve(n.anchor),t.resolve(n.head))}function pF(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,s=r,o,a,l;for(let u=0;u<r.length;u++)i=r[u].removeFromSet(i);for(let u=0;u<n.length;u++)s=n[u].removeFromSet(s);if(i.length==1&&s.length==0)a=i[0],o="add",l=u=>u.mark(a.addToSet(u.marks));else if(i.length==0&&s.length==1)a=s[0],o="remove",l=u=>u.mark(a.removeFromSet(u.marks));else return null;let d=[];for(let u=0;u<t.childCount;u++)d.push(l(t.child(u)));if(V.from(d).eq(e))return{mark:a,type:o}}function mF(e,t,n,r,i){if(n-t<=i.pos-r.pos||Th(r,!0,!1)<i.pos)return!1;let s=e.resolve(t);if(!r.parent.isTextblock){let a=s.nodeAfter;return a!=null&&n==t+a.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let o=e.resolve(Th(s,!0,!0));return!o.parent.isTextblock||o.pos>n||Th(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function Th(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let s=e.node(r).maybeChild(e.indexAfter(r));for(;s&&!s.isLeaf;)s=s.firstChild,i++}return i}function fF(e,t,n,r,i){let s=e.findDiffStart(t,n),o=n+e.size,a=n+t.size;if(s==null)return null;let{a:l,b:d}=e.findDiffEnd(t,o,a);if(i=="end"){let u=Math.max(0,s-Math.min(l,d));r-=l+u-s}if(l<s&&o<a){let u=r<=s&&r>=l?s-r:0;s-=u,d=s+(d-l),l=s}else if(d<s){let u=r<=s&&r>=d?s-r:0;s-=u,l=s+(l-d),d=s}return{start:s,endA:l,endB:d}}class vk{constructor(t,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new D3,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(sy),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=ry(this),ny(this),this.nodeViews=iy(this),this.docView=B0(this.state.doc,ty(this),Ch(this),this.dom,this),this.domObserver=new iF(this,(r,i,s,o)=>hF(this,r,i,s,o)),this.domObserver.start(),M3(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let n in t)this._props[n]=t[n];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&Jp(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(sy),this.directPlugins=t.plugins),this.updateStateInner(t.state,n)}setProps(t){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in t)n[r]=t[r];this.update(n)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,n){var r;let i=this.state,s=!1,o=!1;t.storedMarks&&this.composing&&(mk(this),o=!0),this.state=t;let a=i.plugins!=t.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let m=iy(this);AF(m,this.nodeViews)&&(this.nodeViews=m,s=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&Jp(this),this.editable=ry(this),ny(this);let l=Ch(this),d=ty(this),u=i.plugins!=t.plugins&&!i.doc.eq(t.doc)?"reset":t.scrollToSelection>i.scrollToSelection?"to selection":"preserve",h=s||!this.docView.matchesNode(t.doc,d,l);(h||!t.selection.eq(i.selection))&&(o=!0);let p=u=="preserve"&&o&&this.dom.style.overflowAnchor==null&&zP(this);if(o){this.domObserver.stop();let m=h&&(Pn||hn)&&!this.composing&&!i.selection.empty&&!t.selection.empty&&gF(i.selection,t.selection);if(h){let b=hn?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=K3(this)),(s||!this.docView.update(t.doc,d,l,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=B0(t.doc,d,l,this.dom,this)),b&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(m=!0)}let g=this.input.mouseDown;m||!(g&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&g3(this)&&g.delaySelUpdate())?pi(this,m):(ek(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,i),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():p&&KP(p)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!(!t||!this.dom.contains(t.nodeType==1?t:t.parentNode))&&!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof _e){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&M0(this,n.getBoundingClientRect(),t)}else M0(this,this.coordsAtPos(this.state.selection.head,1),t)}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,t)}}updateDraggedNode(t,n){let r=t.node,i=-1;if(r.from<this.state.doc.content.size&&this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let s=r.from+(this.state.doc.content.size-n.doc.content.size);(s>0&&s<this.state.doc.content.size&&this.state.doc.nodeAt(s))==r.node&&(i=s)}this.dragging=new gk(t.slice,t.move,i<0?void 0:_e.create(this.state.doc,i))}someProp(t,n){let r=this._props&&this._props[t],i;if(r!=null&&(i=n?n(r):r))return i;for(let o=0;o<this.directPlugins.length;o++){let a=this.directPlugins[o].props[t];if(a!=null&&(i=n?n(a):a))return i}let s=this.state.plugins;if(s)for(let o=0;o<s.length;o++){let a=s[o].props[t];if(a!=null&&(i=n?n(a):a))return i}}hasFocus(){if(Pn){let t=this.root.activeElement;if(t==this.dom)return!0;if(!t||!this.dom.contains(t))return!1;for(;t&&this.dom!=t&&this.dom.contains(t);){if(t.contentEditable=="false")return!1;t=t.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&QP(this.dom),pi(this),this.domObserver.start()}get root(){let t=this._root;if(t==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return t||document}updateRoot(){this._root=null}posAtCoords(t){return XP(this,t)}coordsAtPos(t,n=1){return zw(this,t,n)}domAtPos(t,n=0){return this.docView.domFromPos(t,n)}nodeDOM(t){let n=this.docView.descAt(t);return n?n.nodeDOM:null}posAtDOM(t,n,r=-1){let i=this.docView.posFromDOM(t,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(t,n){return i3(this,n||this.state,t)}pasteHTML(t,n){return nl(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return nl(this,t,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(t){return pf(this,t)}destroy(){this.docView&&(O3(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Ch(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,jP())}get isDestroyed(){return this.docView==null}dispatchEvent(t){return L3(this,t)}domSelectionRange(){let t=this.domSelection();return t?An&&this.root.nodeType===11&&HP(this.dom.ownerDocument)==this.dom&&oF(this,t)||t:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}vk.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function ty(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(e.state)),n)for(let r in n)r=="class"?t.class+=" "+n[r]:r=="style"?t.style=(t.style?t.style+";":"")+n[r]:!t[r]&&r!="contenteditable"&&r!="nodeName"&&(t[r]=String(n[r]))}),t.translate||(t.translate="no"),[En.node(0,e.state.doc.content.size,t)]}function ny(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:En.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function ry(e){return!e.someProp("editable",t=>t(e.state)===!1)}function gF(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function iy(e){let t=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(t,i)||(t[i]=r[i])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function AF(e,t){let n=0,r=0;for(let i in e){if(e[i]!=t[i])return!0;n++}for(let i in t)r++;return n!=r}function sy(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var zi={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},nd={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},bF=typeof navigator<"u"&&/Mac/.test(navigator.platform),yF=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var un=0;un<10;un++)zi[48+un]=zi[96+un]=String(un);for(var un=1;un<=24;un++)zi[un+111]="F"+un;for(var un=65;un<=90;un++)zi[un]=String.fromCharCode(un+32),nd[un]=String.fromCharCode(un);for(var Sh in zi)nd.hasOwnProperty(Sh)||(nd[Sh]=zi[Sh]);function xF(e){var t=bF&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||yF&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?nd:zi)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const vF=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),wF=typeof navigator<"u"&&/Win/.test(navigator.platform);function kF(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let r,i,s,o;for(let a=0;a<t.length-1;a++){let l=t[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))vF?o=!0:i=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),o&&(n="Meta-"+n),s&&(n="Shift-"+n),n}function EF(e){let t=Object.create(null);for(let n in e)t[kF(n)]=e[n];return t}function _h(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function CF(e){return new Ct({props:{handleKeyDown:wk(e)}})}function wk(e){let t=EF(e);return function(n,r){let i=xF(r),s,o=t[_h(i,r)];if(o&&o(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let a=t[_h(i,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(wF&&r.ctrlKey&&r.altKey)&&(s=zi[r.keyCode])&&s!=i){let a=t[_h(s,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}function du(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:i}=n,{storedMarks:s}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return s},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,s=n.storedMarks,n}}}var xo=class kk{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:n,state:r}=this,{view:i}=n,{tr:s}=r,o=this.buildProps(s);return Object.fromEntries(Object.entries(t).map(([a,l])=>[a,(...d)=>{const u=l(...d)(o);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(s),u}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,n=!0){const{rawCommands:r,editor:i,state:s}=this,{view:o}=i,a=[],l=!!t,d=t||s.tr,u=()=>(!l&&n&&!d.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(d),a.every(p=>p===!0)),h={...Object.fromEntries(Object.entries(r).map(([p,m])=>[p,(...g)=>{const b=this.buildProps(d,n),A=m(...g)(b);return a.push(A),h}])),run:u};return h}static createFakeChain(){const t=new Proxy({},{get:(n,r)=>{if(r!=="then")return r==="run"?()=>!1:()=>t}});return t}createCan(t){const{rawCommands:n,state:r}=this,i=!1,s=t||r.tr,o=this.buildProps(s,i);return{...Object.fromEntries(Object.entries(n).map(([a,l])=>[a,(...d)=>l(...d)({...o,dispatch:void 0})])),chain:()=>this.createChain(s,i)}}static createFallbackCan(){const t=kk.createFakeChain();return new Proxy({chain:()=>t},{get:(n,r)=>{if(r!=="then")return r==="chain"?n.chain:()=>!1}})}buildProps(t,n=!0){const{rawCommands:r,editor:i,state:s}=this,{view:o}=i,a={tr:t,editor:i,view:o,state:du({state:s,transaction:t}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(t,n),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(r).map(([l,d])=>[l,(...u)=>d(...u)(a)]))}};return a}};const TF=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{if(!e.isDestroyed){var n;t.dom.blur(),(n=window)===null||n===void 0||(n=n.getSelection())===null||n===void 0||n.removeAllRanges()}}),!0),SF=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),_F=()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:s,$to:o})=>{e.doc.nodesBetween(s.pos,o.pos,(a,l)=>{if(a.type.isText)return;const{doc:d,mapping:u}=t,h=d.resolve(u.map(l)),p=d.resolve(u.map(l+a.nodeSize)),m=h.blockRange(p);if(!m)return;const g=Uo(m);if(a.type.isTextblock){const{defaultType:b}=h.parent.contentMatchAt(h.index());t.setNodeMarkup(m.start,b)}(g||g===0)&&t.lift(m,g)})}),!0},NF=e=>t=>e(t),IF=()=>({state:e,dispatch:t})=>Lw(e,t),DF=(e,t)=>({editor:n,tr:r})=>{const{state:i}=n,s=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const o=r.mapping.map(t);return r.insert(o,s.content),r.setSelection(new De(r.doc.resolve(Math.max(o-1,0)))),!0},MF=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const i=e.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===r.type){if(t){const o=i.before(s),a=i.after(s);e.delete(o,a).scrollIntoView()}return!0}return!1};function qt(e,t){if(typeof e=="string"){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}const OF=e=>({tr:t,state:n,dispatch:r})=>{const i=qt(e,n.schema),s=t.selection.$anchor;for(let o=s.depth;o>0;o-=1)if(s.node(o).type===i){if(r){const a=s.before(o),l=s.after(o);t.delete(a,l).scrollIntoView()}return!0}return!1},RF=e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},LF=e=>e.content?/^text(\*|\+)/.test(e.content):!1,oy=(e,t,n)=>{if(!e.parent.isInline||n==="left"&&e.pos>e.start()||n==="right"&&e.pos<e.end())return e.pos;const r=t.nodes[e.parent.type.name].spec;return LF(r)?n==="left"?e.start()-1:e.end()+1:e.pos},jF=(e,t,n)=>({from:oy(e,n,"left"),to:oy(t,n,"right")}),BF=()=>({state:e,dispatch:t})=>{if(e.selection.empty)return!1;if(t){const n=e.tr,{ranges:r}=e.selection,i=n.steps.length;r.forEach(s=>{const o=n.mapping.slice(i),a=n.doc.resolve(o.map(s.$from.pos)),l=n.doc.resolve(o.map(s.$to.pos)),{from:d,to:u}=jF(a,l,e.schema);n.deleteRange(d,u)}),n.selection.empty||n.setSelection(De.near(n.doc.resolve(n.selection.from))),n.scrollIntoView(),t(n)}return!0},PF=()=>({commands:e})=>e.keyboardShortcut("Enter"),FF=()=>({state:e,dispatch:t})=>vP(e,t);function yf(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function rd(e,t,n={strict:!0}){const r=Object.keys(t);return r.length?r.every(i=>n.strict?t[i]===e[i]:yf(t[i])?t[i].test(e[i]):t[i]===e[i]):!0}function Ek(e,t,n={}){return e.find(r=>r.type===t&&rd(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function ay(e,t,n={}){return!!Ek(e,t,n)}function xf(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if((!r.node||!r.node.marks.some(l=>l.type===t))&&(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(l=>l.type===t))return;if(!n){const l=r.node.marks.find(d=>d.type===t);l&&(n=l.attrs)}if(!Ek([...r.node.marks],t,n))return;let i=r.index,s=e.start()+r.offset,o=i+1,a=s+r.node.nodeSize;for(;i>0&&ay([...e.parent.child(i-1).marks],t,n);)i-=1,s-=e.parent.child(i).nodeSize;for(;o<e.parent.childCount&&ay([...e.parent.child(o).marks],t,n);)a+=e.parent.child(o).nodeSize,o+=1;return{from:s,to:a}}function Ai(e,t){if(typeof e=="string"){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}const $F=(e,t)=>({tr:n,state:r,dispatch:i})=>{const s=Ai(e,r.schema),{doc:o,selection:a}=n,{$from:l,from:d,to:u}=a;if(i){const h=xf(l,s,t);if(h&&h.from<=d&&h.to>=u){const p=De.create(o,h.from,h.to);n.setSelection(p)}}return!0},HF=e=>t=>{const n=typeof e=="function"?e(t):e;for(let r=0;r<n.length;r+=1)if(n[r](t))return!0;return!1};function Ck(e){return e instanceof De}function vs(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function Zp(e,t=null){if(!t)return null;const n=Ge.atStart(e),r=Ge.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return r;const i=n.from,s=r.to;return t==="all"?De.create(e,vs(0,i,s),vs(e.content.size,i,s)):De.create(e,vs(t,i,s),vs(t,i,s))}function ly(){return["Android"].includes(navigator.platform)||/android/i.test(navigator.userAgent)}function id(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function UF(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}const GF=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:s})=>{t={scrollIntoView:!0,...t};const o=()=>{(id()||ly())&&r.dom.focus(),UF()&&!id()&&!ly()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t!=null&&t.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&e===null||e===!1)return!0}catch{return!1}if(s&&e===null&&!Ck(n.state.selection))return o(),!0;const a=Zp(i.doc,e)||n.state.selection,l=n.state.selection.eq(a);return s&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},WF=(e,t)=>n=>e.every((r,i)=>t(r,{...n,index:i})),YF=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),Tk=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&Tk(r)}return e};function Jl(e){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,"text/html").body;return Tk(n)}function Sk(e){return typeof(e==null?void 0:e.nodesBetween)=="function"}function Mo(e,t,n){if(Sk(e))return e;const r=typeof e=="object"&&e!==null;n={slice:!0,parseOptions:{},...n};const i=typeof e=="string";if(r)try{if(Array.isArray(e)&&e.length>0)return V.fromArray(e.map(o=>t.nodeFromJSON(o)));const s=t.nodeFromJSON(e);return n.errorOnInvalidContent&&s.check(),s}catch(s){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",s),Mo("",t,n)}if(i){if(n.errorOnInvalidContent){let o=!1,a="";const l=new aw({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:d=>(o=!0,a=typeof d=="string"?d:d.outerHTML,null)}]}})});if(n.slice?Fi.fromSchema(l).parseSlice(Jl(e),n.parseOptions):Fi.fromSchema(l).parse(Jl(e),n.parseOptions),n.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const s=Fi.fromSchema(t);return n.slice?s.parseSlice(Jl(e),n.parseOptions).content:s.parse(Jl(e),n.parseOptions)}return Mo("",t,n)}function _k(e){return!("type"in e)}function Nk(e,t,n){const r=e.steps.length-1;if(r<t)return;const i=e.steps[r];if(!(i instanceof $t||i instanceof rn))return;const s=e.mapping.maps[r];let o=0;s.forEach((a,l,d,u)=>{o===0&&(o=u)}),e.setSelection(Ge.near(e.doc.resolve(o),n))}const zF=(e,t,n)=>({tr:r,dispatch:i,editor:s})=>{if(i){n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;const l=A=>{s.emit("contentError",{editor:s,error:A,disableCollaboration:()=>{"collaboration"in s.storage&&typeof s.storage.collaboration=="object"&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},d={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{Mo(t,s.schema,{parseOptions:d,errorOnInvalidContent:!0})}catch(A){l(A)}try{var o;a=Mo(t,s.schema,{parseOptions:d,errorOnInvalidContent:(o=n.errorOnInvalidContent)!==null&&o!==void 0?o:s.options.enableContentCheck})}catch(A){return l(A),!1}let{from:u,to:h}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},p=!0,m=!0;const g=_k(a)?a.content:[a];if(g.forEach(A=>{A.check(),p=p?A.isText&&A.marks.length===0:!1,m=m?A.isBlock:!1}),u===h&&m){const{parent:A}=r.doc.resolve(u);A.isTextblock&&!A.type.spec.code&&!A.childCount&&(u-=1,h+=1)}let b;if(p)Array.isArray(t)?b=t.map(A=>A.text||"").join(""):Sk(t)?b=g.map(A=>{var y;return(y=A.text)!==null&&y!==void 0?y:""}).join(""):typeof t=="object"&&t&&t.text?b=t.text:b=t,r.insertText(b,u,h);else{b=V.from(g);const A=r.doc.resolve(u),y=A.node(),w=A.parentOffset===0,C=y.isText||y.isTextblock,E=y.content.size>0;w&&C&&E&&m&&(u=Math.max(0,u-1)),r.replaceWith(u,h,g)}n.updateSelection&&Nk(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:u,text:b}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:u,text:b})}return!0};function Ik(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const KF=(e={})=>({tr:t,dispatch:n,editor:r})=>{const{pos:i,attrs:s,content:o,updateSelection:a=!0}=e;let l;typeof i=="number"?l=t.doc.resolve(i):i?l=i:l=t.selection.$from;const d=Ik(l.parent.contentMatchAt(l.index()));if(!d)return!1;const u=Object.keys(d.spec.attrs||{}),h=s?Object.fromEntries(Object.entries(s).filter(([m])=>u.includes(m))):{};let p;if(o){const m=Mo(o,r.schema);p=d.createAndFill(h,m)}else p=d.createAndFill(h);return p?(n&&(t.insert(l.pos,p),a&&Nk(t,t.steps.length-1,-1)),!0):!1},QF=()=>({state:e,dispatch:t})=>bP(e,t),VF=()=>({state:e,dispatch:t})=>yP(e,t),qF=()=>({state:e,dispatch:t})=>_w(e,t),JF=()=>({state:e,dispatch:t})=>Mw(e,t),ZF=()=>({state:e,dispatch:t,tr:n})=>{try{const r=su(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},XF=()=>({state:e,dispatch:t,tr:n})=>{try{const r=su(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},e4=()=>({state:e,dispatch:t})=>gP(e,t),t4=()=>({state:e,dispatch:t})=>AP(e,t);function Dk(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function n4(e){const t=e.split(/-(?!$)/);let n=t[t.length-1];n==="Space"&&(n=" ");let r,i,s,o;for(let a=0;a<t.length-1;a+=1){const l=t[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))id()||Dk()?o=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),s&&(n=`Shift-${n}`),n}const r4=e=>({editor:t,view:n,tr:r,dispatch:i})=>{const s=n4(e).split(/-(?!$)/),o=s.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),a=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),l=t.captureTransaction(()=>{n.someProp("handleKeyDown",d=>d(n,a))});return l==null||l.steps.forEach(d=>{const u=d.map(r.mapping);u&&i&&r.maybeStep(u)}),!0};function gi(e,t,n={}){const{from:r,to:i,empty:s}=e.selection,o=t?qt(t,e.schema):null,a=[];e.doc.nodesBetween(r,i,(u,h)=>{if(u.isText)return;const p=Math.max(r,h),m=Math.min(i,h+u.nodeSize);a.push({node:u,from:p,to:m})});const l=i-r,d=a.filter(u=>o?o.name===u.node.type.name:!0).filter(u=>rd(u.node.attrs,n,{strict:!1}));return s?!!d.length:d.reduce((u,h)=>u+h.to-h.from,0)>=l}const i4=(e,t={})=>({state:n,dispatch:r})=>gi(n,qt(e,n.schema),t)?xP(n,r):!1,s4=()=>({state:e,dispatch:t})=>jw(e,t),o4=e=>({state:t,dispatch:n})=>{const r=qt(e,t.schema);return MP(r)(t,n)},a4=()=>({state:e,dispatch:t})=>Rw(e,t);function uu(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function cy(e,t){const n=typeof t=="string"?[t]:t;return Object.keys(e).reduce((r,i)=>(n.includes(i)||(r[i]=e[i]),r),{})}const l4=(e,t)=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=uu(typeof e=="string"?e:e.name,r.schema);if(!a)return!1;a==="node"&&(s=qt(e,r.schema)),a==="mark"&&(o=Ai(e,r.schema));let l=!1;return n.selection.ranges.forEach(d=>{r.doc.nodesBetween(d.$from.pos,d.$to.pos,(u,h)=>{s&&s===u.type&&(l=!0,i&&n.setNodeMarkup(h,void 0,cy(u.attrs,t))),o&&u.marks.length&&u.marks.forEach(p=>{o===p.type&&(l=!0,i&&n.addMark(h,h+u.nodeSize,o.create(cy(p.attrs,t))))})})}),l},c4=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),d4=()=>({tr:e,dispatch:t})=>{if(t){const n=new Vn(e.doc);e.setSelection(n)}return!0},u4=()=>({state:e,dispatch:t})=>Iw(e,t),h4=()=>({state:e,dispatch:t})=>Ow(e,t),p4=()=>({state:e,dispatch:t})=>EP(e,t),m4=()=>({state:e,dispatch:t})=>SP(e,t),f4=()=>({state:e,dispatch:t})=>TP(e,t);function Xp(e,t,n={},r={}){return Mo(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const g4=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:s,dispatch:o,commands:a})=>{const{doc:l}=s;if(r.preserveWhitespace!=="full"){const d=Xp(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});if(o){const u=_k(d)?d.content:[d];s.replaceWith(0,l.content.size,u).setMeta("preventUpdate",!n)}return!0}return o&&s.setMeta("preventUpdate",!n),a.insertContentAt({from:0,to:l.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})};function Mk(e,t){const n=Ai(t,e.schema),{from:r,to:i,empty:s}=e.selection,o=[];s?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,l=>{o.push(...l.marks)});const a=o.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function Ok(e,t){const n=new kw(e);return t.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function A4(e,t,n){const r=[];return e.nodesBetween(t.from,t.to,(i,s)=>{n(i)&&r.push({node:i,pos:s})}),r}function b4(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function hu(e){return t=>b4(t.$from,e)}function Se(e,t,n){return e.config[t]===void 0&&e.parent?Se(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?Se(e.parent,t,n):null}):e.config[t]}function vf(e){return e.map(t=>{const n=Se(t,"addExtensions",{name:t.name,options:t.options,storage:t.storage});return n?[t,...vf(n())]:t}).flat(10)}function wf(e,t){const n=zs.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function Rk(e){return typeof e=="function"}function ut(e,t=void 0,...n){return Rk(e)?t?e.bind(t)(...n):e(...n):e}function y4(e={}){return Object.keys(e).length===0&&e.constructor===Object}function Oo(e){return{baseExtensions:e.filter(t=>t.type==="extension"),nodeExtensions:e.filter(t=>t.type==="node"),markExtensions:e.filter(t=>t.type==="mark")}}function Lk(e){const t=[],{nodeExtensions:n,markExtensions:r}=Oo(e),i=[...n,...r],s={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=n.filter(d=>d.name!=="text").map(d=>d.name),a=r.map(d=>d.name),l=[...o,...a];return e.forEach(d=>{const u=Se(d,"addGlobalAttributes",{name:d.name,options:d.options,storage:d.storage,extensions:i});u&&u().forEach(h=>{let p;Array.isArray(h.types)?p=h.types:h.types==="*"?p=l:h.types==="nodes"?p=o:h.types==="marks"?p=a:p=[],p.forEach(m=>{Object.entries(h.attributes).forEach(([g,b])=>{t.push({type:m,name:g,attribute:{...s,...b}})})})})}),i.forEach(d=>{const u=Se(d,"addAttributes",{name:d.name,options:d.options,storage:d.storage});if(!u)return;const h=u();Object.entries(h).forEach(([p,m])=>{const g={...s,...m};typeof(g==null?void 0:g.default)=="function"&&(g.default=g.default()),g!=null&&g.isRequired&&(g==null?void 0:g.default)===void 0&&delete g.default,t.push({type:d.name,name:p,attribute:g})})}),t}function x4(e){const t=[];let n="",r=!1,i=!1,s=0;const o=e.length;for(let a=0;a<o;a+=1){const l=e[a];if(l==="'"&&!i){r=!r,n+=l;continue}if(l==='"'&&!r){i=!i,n+=l;continue}if(!r&&!i){if(l==="("){s+=1,n+=l;continue}if(l===")"&&s>0){s-=1,n+=l;continue}if(l===";"&&s===0){t.push(n),n="";continue}}n+=l}return n&&t.push(n),t}function dy(e){const t=[],n=x4(e||""),r=n.length;for(let i=0;i<r;i+=1){const s=n[i],o=s.indexOf(":");if(o===-1)continue;const a=s.slice(0,o).trim(),l=s.slice(o+1).trim();a&&l&&t.push([a,l])}return t}function Ut(...e){return e.filter(t=>!!t).reduce((t,n)=>{const r={...t};return Object.entries(n).forEach(([i,s])=>{if(i==="__proto__"){Object.defineProperty(r,i,{configurable:!0,enumerable:!0,value:s,writable:!0});return}if(!r[i]){r[i]=s;return}if(i==="class"){const o=s?String(s).split(" "):[],a=r[i]?r[i].split(" "):[],l=o.filter(d=>!a.includes(d));r[i]=[...a,...l].join(" ")}else if(i==="style"){const o=new Map([...dy(r[i]),...dy(s)]);r[i]=Array.from(o.entries()).map(([a,l])=>`${a}: ${l}`).join("; ")}else r[i]=s}),r},{})}function il(e,t){return t.filter(n=>n.type===e.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(e.attrs)||{}:{[n.name]:e.attrs[n.name]}).reduce((n,r)=>Ut(n,r),{})}function v4(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function uy(e,t){return"style"in e?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;const i=t.reduce((s,o)=>{const a=o.attribute.parseHTML?o.attribute.parseHTML(n):v4(n.getAttribute(o.name));return a==null?s:{...s,[o.name]:a}},{});return{...r,...i}}}}function hy(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&y4(n)?!1:n!=null))}function py(e){var t,n;const r={};return!(!(e==null||(t=e.attribute)===null||t===void 0)&&t.isRequired)&&"default"in((e==null?void 0:e.attribute)||{})&&(r.default=e.attribute.default),(e==null||(n=e.attribute)===null||n===void 0?void 0:n.validate)!==void 0&&(r.validate=e.attribute.validate),[e.name,r]}function w4(e,t){var n;const r=Lk(e),{nodeExtensions:i,markExtensions:s}=Oo(e),o=(n=i.find(d=>Se(d,"topNode")))===null||n===void 0?void 0:n.name,a=Object.fromEntries(i.map(d=>{const u=r.filter(A=>A.type===d.name),h={name:d.name,options:d.options,storage:d.storage,editor:t},p=hy({...e.reduce((A,y)=>{const w=Se(y,"extendNodeSchema",h);return{...A,...w?w(d):{}}},{}),content:ut(Se(d,"content",h)),marks:ut(Se(d,"marks",h)),group:ut(Se(d,"group",h)),inline:ut(Se(d,"inline",h)),atom:ut(Se(d,"atom",h)),selectable:ut(Se(d,"selectable",h)),draggable:ut(Se(d,"draggable",h)),code:ut(Se(d,"code",h)),whitespace:ut(Se(d,"whitespace",h)),linebreakReplacement:ut(Se(d,"linebreakReplacement",h)),defining:ut(Se(d,"defining",h)),isolating:ut(Se(d,"isolating",h)),attrs:Object.fromEntries(u.map(py))}),m=ut(Se(d,"parseHTML",h));m&&(p.parseDOM=m.map(A=>uy(A,u)));const g=Se(d,"renderHTML",h);g&&(p.toDOM=A=>g({node:A,HTMLAttributes:il(A,u)}));const b=Se(d,"renderText",h);return b&&(p.toText=b),[d.name,p]})),l=Object.fromEntries(s.map(d=>{const u=r.filter(b=>b.type===d.name),h={name:d.name,options:d.options,storage:d.storage,editor:t},p=hy({...e.reduce((b,A)=>{const y=Se(A,"extendMarkSchema",h);return{...b,...y?y(d):{}}},{}),inclusive:ut(Se(d,"inclusive",h)),excludes:ut(Se(d,"excludes",h)),group:ut(Se(d,"group",h)),spanning:ut(Se(d,"spanning",h)),code:ut(Se(d,"code",h)),attrs:Object.fromEntries(u.map(py))}),m=ut(Se(d,"parseHTML",h));m&&(p.parseDOM=m.map(b=>uy(b,u)));const g=Se(d,"renderHTML",h);return g&&(p.toDOM=b=>g({mark:b,HTMLAttributes:il(b,u)})),[d.name,p]}));return new aw({topNode:o,nodes:a,marks:l})}function k4(e){const t=e.filter((n,r)=>e.indexOf(n)!==r);return Array.from(new Set(t))}function Ma(e){return e.sort((t,n)=>{const r=Se(t,"priority")||100,i=Se(n,"priority")||100;return r>i?-1:r<i?1:0})}function jk(e){const t=Ma(vf(e)),n=k4(t.map(r=>r.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),t}function Bk(e,t,n){const{from:r,to:i}=t,{blockSeparator:s=`
|
|
138
|
+
|
|
139
|
+
`,textSerializers:o={}}=n||{};let a="";return e.nodesBetween(r,i,(l,d,u,h)=>{l.isBlock&&d>r&&(a+=s);const p=o==null?void 0:o[l.type.name];if(p)return u&&(a+=p({node:l,pos:d,parent:u,index:h,range:t})),!1;if(l.isText){var m;a+=l==null||(m=l.text)===null||m===void 0?void 0:m.slice(Math.max(r,d)-d,i-d)}}),a}function E4(e,t){return Bk(e,{from:0,to:e.content.size},t)}function Pk(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}function C4(e,t){const n=qt(t,e.schema),{from:r,to:i}=e.selection,s=[];e.doc.nodesBetween(r,i,a=>{s.push(a)});const o=s.reverse().find(a=>a.type.name===n.name);return o?{...o.attrs}:{}}function Fk(e,t){const n=uu(typeof t=="string"?t:t.name,e.schema);return n==="node"?C4(e,t):n==="mark"?Mk(e,t):{}}function T4(e,t=JSON.stringify){const n={};return e.filter(r=>{const i=t(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function S4(e){const t=T4(e);return t.length===1?t:t.filter((n,r)=>!t.filter((i,s)=>s!==r).some(i=>n.oldRange.from>=i.oldRange.from&&n.oldRange.to<=i.oldRange.to&&n.newRange.from>=i.newRange.from&&n.newRange.to<=i.newRange.to))}function pu(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach((i,s)=>{const o=[];if(i.ranges.length)i.forEach((a,l)=>{o.push({from:a,to:l})});else{const{from:a,to:l}=n[s];if(a===void 0||l===void 0)return;o.push({from:a,to:l})}o.forEach(({from:a,to:l})=>{const d=t.slice(s).map(a,-1),u=t.slice(s).map(l),h=t.invert().map(d,-1),p=t.invert().map(u);r.push({oldRange:{from:h,to:p},newRange:{from:d,to:u}})})}),S4(r)}function kf(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach(i=>{const s=xf(n.resolve(e),i.type);s&&r.push({mark:i,...s})}):n.nodesBetween(e,t,(i,s)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(o=>({from:s,to:s+i.nodeSize,mark:o})))}),r}const _4=(e,t,n,r=20)=>{const i=e.doc.resolve(n);let s=r,o=null;for(;s>0&&o===null;){const a=i.node(s);(a==null?void 0:a.type.name)===t?o=a:s-=1}return[o,s]},N4=e=>{const t=e.depth-1;if(t<0)return null;const n=e.index(t);return n===0?null:e.node(t).child(n-1)};function oo(e,t){return t.nodes[e]||t.marks[e]||null}function bc(e,t,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=e.find(s=>s.type===t&&s.name===r);return i?i.attribute.keepOnSplit:!1}))}const I4=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(i,s,o,a)=>{var l,d;const u=((l=(d=i.type.spec).toText)===null||l===void 0?void 0:l.call(d,{node:i,pos:s,parent:o,index:a}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?u:u.slice(0,Math.max(0,r-s))}),n};function em(e,t,n={}){const{empty:r,ranges:i}=e.selection,s=t?Ai(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(u=>s?s.name===u.type.name:!0).find(u=>rd(u.attrs,n,{strict:!1}));let o=0;const a=[];if(i.forEach(({$from:u,$to:h})=>{const p=u.pos,m=h.pos;e.doc.nodesBetween(p,m,(g,b)=>{if(s&&g.inlineContent&&!g.type.allowsMarkType(s))return!1;if(!g.isText&&!g.marks.length)return;const A=Math.max(p,b),y=Math.min(m,b+g.nodeSize),w=y-A;o+=w,a.push(...g.marks.map(C=>({mark:C,from:A,to:y})))})}),o===0)return!1;const l=a.filter(u=>s?s.name===u.mark.type.name:!0).filter(u=>rd(u.mark.attrs,n,{strict:!1})).reduce((u,h)=>u+h.to-h.from,0),d=a.filter(u=>s?u.mark.type!==s&&u.mark.type.excludes(s):!0).reduce((u,h)=>u+h.to-h.from,0);return(l>0?l+d:l)>=o}function D4(e,t,n={}){if(!t)return gi(e,null,n)||em(e,null,n);const r=uu(t,e.schema);return r==="node"?gi(e,t,n):r==="mark"?em(e,t,n):!1}const M4=(e,t)=>{const{$from:n,$to:r,$anchor:i}=e.selection;if(t){const s=hu(a=>a.type.name===t)(e.selection);if(!s)return!1;const o=e.doc.resolve(s.pos+1);return i.pos+1===o.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},O4=e=>{const{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function my(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}function Nh(e,t){const{nodeExtensions:n}=Oo(t),r=n.find(s=>s.name===e);if(!r)return!1;const i=ut(Se(r,"group",{name:r.name,options:r.options,storage:r.storage}));return typeof i!="string"?!1:i.split(" ").includes("list")}function kl(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){if(n){if(e.type.name==="hardBreak")return!0;if(e.isText){var r;return!/\S/.test((r=e.text)!==null&&r!==void 0?r:"")}}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let i=!0;return e.content.forEach(s=>{i!==!1&&(kl(s,{ignoreWhitespace:n,checkChildren:t})||(i=!1))}),i}return!1}function $k(e){return e instanceof _e}var Hk=class Uk{constructor(t){this.position=t}static fromJSON(t){return new Uk(t.position)}toJSON(){return{position:this.position}}};function R4(e,t){const n=t.mapping.mapResult(e.position);return{position:new Hk(n.pos),mapResult:n}}function L4(e){return new Hk(e)}function j4(e,t,n){const{selection:r}=t;let i=null;if(Ck(r)&&(i=r.$cursor),i){var s;const a=(s=e.storedMarks)!==null&&s!==void 0?s:i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(a)||!a.some(l=>l.type.excludes(n)))}const{ranges:o}=r;return o.some(({$from:a,$to:l})=>{let d=a.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(a.pos,l.pos,(u,h,p)=>{if(d)return!1;if(u.isInline){const m=!p||p.type.allowsMarkType(n),g=!!n.isInSet(u.marks)||!u.marks.some(b=>b.type.excludes(n));d=m&&g}return!d}),d})}const B4=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=n,{empty:o,ranges:a}=s,l=Ai(e,r.schema);if(i)if(o){const d=Mk(r,l);n.addStoredMark(l.create({...d,...t}))}else a.forEach(d=>{const u=d.$from.pos,h=d.$to.pos;r.doc.nodesBetween(u,h,(p,m)=>{const g=Math.max(m,u),b=Math.min(m+p.nodeSize,h);p.marks.find(A=>A.type===l)?p.marks.forEach(A=>{l===A.type&&n.addMark(g,b,l.create({...A.attrs,...t}))}):n.addMark(g,b,l.create(t))})});return j4(r,n,l)},P4=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),F4=(e,t={})=>({state:n,dispatch:r,chain:i})=>{const s=qt(e,n.schema);let o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),s.isTextblock?i().command(({commands:a})=>N0(s,{...o,...t})(n)?!0:a.clearNodes()).command(({state:a})=>N0(s,{...o,...t})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},$4=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,i=vs(e,0,r.content.size),s=_e.create(r,i);t.setSelection(s)}return!0},H4=(e,t)=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=r;let o,a;return typeof t=="number"?(o=t,a=t):t&&"from"in t&&"to"in t?(o=t.from,a=t.to):(o=s.from,a=s.to),i&&n.doc.nodesBetween(o,a,(l,d)=>{l.isText||n.setNodeMarkup(d,void 0,{...l.attrs,dir:e})}),!0},U4=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,{from:i,to:s}=typeof e=="number"?{from:e,to:e}:e,o=De.atStart(r).from,a=De.atEnd(r).to,l=vs(i,o,a),d=vs(s,o,a),u=De.create(r,l,d);t.setSelection(u)}return!0},G4=e=>({state:t,dispatch:n})=>{const r=qt(e,t.schema);return LP(r)(t,n)};function fy(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter(i=>t==null?void 0:t.includes(i.type.name));e.tr.ensureMarks(r)}}const W4=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{const{selection:s,doc:o}=t,{$from:a,$to:l}=s,d=i.extensionManager.attributes,u=bc(d,a.node().type.name,a.node().attrs);if(s instanceof _e&&s.node.isBlock)return!a.parentOffset||!hi(o,a.pos)?!1:(r&&(e&&fy(n,i.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const h=l.parentOffset===l.parent.content.size,p=a.depth===0?void 0:Ik(a.node(-1).contentMatchAt(a.indexAfter(-1)));let m=h&&p?[{type:p,attrs:u}]:void 0,g=hi(t.doc,t.mapping.map(a.pos),1,m);if(!m&&!g&&hi(t.doc,t.mapping.map(a.pos),1,p?[{type:p}]:void 0)&&(g=!0,m=p?[{type:p,attrs:u}]:void 0),r){if(g&&(s instanceof De&&t.deleteSelection(),t.split(t.mapping.map(a.pos),1,m),p&&!h&&!a.parentOffset&&a.parent.type!==p)){const b=t.mapping.map(a.before()),A=t.doc.resolve(b);a.node(-1).canReplaceWith(A.index(),A.index()+1,p)&&t.setNodeMarkup(t.mapping.map(a.before()),p)}e&&fy(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return g},Y4=(e,t={})=>({tr:n,state:r,dispatch:i,editor:s})=>{const o=qt(e,r.schema),{$from:a,$to:l}=r.selection,d=r.selection.node;if(d&&d.isBlock||a.depth<2||!a.sameParent(l))return!1;const u=a.node(-1);if(u.type!==o)return!1;const h=s.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==o||a.index(-2)!==a.node(-2).childCount-1)return!1;if(i){var p;let y=V.empty;const w=a.index(-1)?1:a.index(-2)?2:3;for(let L=a.depth-w;L>=a.depth-3;L-=1)y=V.from(a.node(L).copy(y));const C=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,E={...bc(h,a.node().type.name,a.node().attrs),...t},S=((p=o.contentMatch.defaultType)===null||p===void 0?void 0:p.createAndFill(E))||void 0;y=y.append(V.from(o.createAndFill(null,S)||void 0));const k=a.before(a.depth-(w-1));n.replace(k,a.after(-C),new Ae(y,4-w,0));let I=-1;n.doc.nodesBetween(k,n.doc.content.size,(L,R)=>{if(I>-1)return!1;L.isTextblock&&L.content.size===0&&(I=R+1)}),I>-1&&n.setSelection(De.near(n.doc.resolve(I))),n.scrollIntoView()}return!0}const m=l.pos===a.end()?u.contentMatchAt(0).defaultType:null,g={...bc(h,u.type.name,u.attrs),...t},b={...bc(h,a.node().type.name,a.node().attrs),...t};n.delete(a.pos,l.pos);const A=m?[{type:o,attrs:g},{type:m,attrs:b}]:[{type:o,attrs:g}];if(!hi(n.doc,a.pos,2))return!1;if(i){const{selection:y,storedMarks:w}=r,{splittableMarks:C}=s.extensionManager,E=w||y.$to.parentOffset&&y.$from.marks();if(n.split(a.pos,2,A).scrollIntoView(),!E||!i)return!0;const S=E.filter(k=>C.includes(k.type.name));n.ensureMarks(S)}return!0};function gy(e){return!e||e==="1"?null:e}function Gk(e,t){return gy(e)===gy(t)}const Ih=(e,t)=>{const n=hu(s=>s.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=e.doc.nodeAt(r);return!(n.node.type===(i==null?void 0:i.type)&&qi(e.doc,n.pos))||!Gk(n.node.attrs.type,i==null?void 0:i.attrs.type)||e.join(n.pos),!0},Dh=(e,t)=>{const n=hu(s=>s.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=e.doc.nodeAt(r);return!(n.node.type===(i==null?void 0:i.type)&&qi(e.doc,r))||!Gk(n.node.attrs.type,i==null?void 0:i.attrs.type)||e.join(r),!0};function z4(e){const t=e.doc,n=t.firstChild;if(!n)return null;const r=t.resolve(1),i=t.resolve(n.nodeSize-1);return De.between(r,i)}const K4=(e,t,n,r={})=>({editor:i,tr:s,state:o,dispatch:a,chain:l,commands:d,can:u})=>{const{extensions:h,splittableMarks:p}=i.extensionManager,m=qt(e,o.schema),g=qt(t,o.schema),{selection:b,storedMarks:A}=o,{$from:y,$to:w}=b,C=y.blockRange(w),E=A||b.$to.parentOffset&&b.$from.marks();if(!C)return!1;const S=hu(Q=>Nh(Q.type.name,h))(b),k=b.from===0&&b.to===o.doc.content.size,I=o.doc.content.content,L=I.length===1?I[0]:null,R=k&&L&&Nh(L.type.name,h)?{node:L,pos:0}:null,B=S??R,O=!!S&&C.depth>=1&&C.depth-S.depth<=1,Y=!!R;if((O||Y)&&B){if(B.node.type===m)return k&&Y?l().command(({tr:Q,dispatch:W})=>{const ie=z4(Q);return ie?(Q.setSelection(ie),W&&W(Q),!0):!1}).liftListItem(g).run():d.liftListItem(g);if(Nh(B.node.type.name,h)&&m.validContent(B.node.content))return l().command(()=>(s.setNodeMarkup(B.pos,m),!0)).command(()=>Ih(s,m)).command(()=>Dh(s,m)).run()}return!n||!E||!a?l().command(()=>u().wrapInList(m,r)?!0:d.clearNodes()).wrapInList(m,r).command(()=>Ih(s,m)).command(()=>Dh(s,m)).run():l().command(()=>{const Q=u().wrapInList(m,r),W=E.filter(ie=>p.includes(ie.type.name));return s.ensureMarks(W),Q?!0:d.clearNodes()}).wrapInList(m,r).command(()=>Ih(s,m)).command(()=>Dh(s,m)).run()},Q4=(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:s=!1}=n,o=Ai(e,r.schema);return em(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:s}):i.setMark(o,t)},V4=(e,t,n={})=>({state:r,commands:i})=>{const s=qt(e,r.schema),o=qt(t,r.schema),a=gi(r,s,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?i.setNode(o,l):i.setNode(s,{...l,...n})},q4=(e,t={})=>({state:n,commands:r})=>{const i=qt(e,n.schema);return gi(n,i,t)?r.lift(i):r.wrapIn(i,t)},J4=()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let s;if(i.spec.isInputRules&&(s=i.getState(e))){if(t){const o=e.tr,a=s.transform;for(let l=a.steps.length-1;l>=0;l-=1)o.step(a.steps[l].invert(a.docs[l]));if(s.text){const l=o.doc.resolve(s.from).marks();o.replaceWith(s.from,s.to,e.schema.text(s.text,l))}else o.delete(s.from,s.to)}return!0}}return!1},Z4=(e={})=>({tr:t,dispatch:n,editor:r})=>{const{ignoreClearable:i=!1}=e,{selection:s}=t,{empty:o,ranges:a}=s;if(o)return!0;const{nonClearableMarks:l}=r.extensionManager;if(n){const d=Object.values(r.schema.marks).filter(u=>i||!l.includes(u.name));a.forEach(u=>{for(const h of d)t.removeMark(u.$from.pos,u.$to.pos,h)})}return!0},X4=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{extendEmptyMarkRange:s=!1}=t,{selection:o}=n,a=Ai(e,r.schema),{$from:l,empty:d,ranges:u}=o;if(!i)return!0;if(d&&s){var h;let{from:p,to:m}=o;const g=xf(l,a,(h=l.marks().find(b=>b.type===a))===null||h===void 0?void 0:h.attrs);g&&(p=g.from,m=g.to),n.removeMark(p,m,a)}else u.forEach(p=>{n.removeMark(p.$from.pos,p.$to.pos,a)});return n.removeStoredMark(a),!0},e$=e=>({tr:t,state:n,dispatch:r})=>{const{selection:i}=n;let s,o;return typeof e=="number"?(s=e,o=e):e&&"from"in e&&"to"in e?(s=e.from,o=e.to):(s=i.from,o=i.to),r&&t.doc.nodesBetween(s,o,(a,l)=>{if(a.isText)return;const d={...a.attrs};delete d.dir,t.setNodeMarkup(l,void 0,d)}),!0},t$=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=uu(typeof e=="string"?e:e.name,r.schema);if(!a)return!1;a==="node"&&(s=qt(e,r.schema)),a==="mark"&&(o=Ai(e,r.schema));let l=!1;return n.selection.ranges.forEach(d=>{const u=d.$from.pos,h=d.$to.pos;let p,m,g,b;n.selection.empty?r.doc.nodesBetween(u,h,(A,y)=>{s&&s===A.type&&(l=!0,g=Math.max(y,u),b=Math.min(y+A.nodeSize,h),p=y,m=A)}):r.doc.nodesBetween(u,h,(A,y)=>{y<u&&s&&s===A.type&&(l=!0,g=Math.max(y,u),b=Math.min(y+A.nodeSize,h),p=y,m=A),y>=u&&y<=h&&(s&&s===A.type&&(l=!0,i&&n.setNodeMarkup(y,void 0,{...A.attrs,...t})),o&&A.marks.length&&A.marks.forEach(w=>{if(o===w.type&&(l=!0,i)){const C=Math.max(y,u),E=Math.min(y+A.nodeSize,h);n.addMark(C,E,o.create({...w.attrs,...t}))}}))}),m&&(p!==void 0&&i&&n.setNodeMarkup(p,void 0,{...m.attrs,...t}),o&&m.marks.length&&m.marks.forEach(A=>{o===A.type&&i&&n.addMark(g,b,o.create({...A.attrs,...t}))}))}),l},ho=new zt("__tiptap_decorations__"),n$=e=>({tr:t,dispatch:n})=>(n&&t.setMeta(ho,{type:"force",name:e}),!0),r$=(e,t={})=>({state:n,dispatch:r})=>{const i=qt(e,n.schema);return _P(i,t)(n,r)},i$=(e,t={})=>({state:n,dispatch:r})=>{const i=qt(e,n.schema);return NP(i,t)(n,r)};var s$=xB({blur:()=>TF,clearContent:()=>SF,clearNodes:()=>_F,command:()=>NF,createParagraphNear:()=>IF,cut:()=>DF,deleteCurrentNode:()=>MF,deleteNode:()=>OF,deleteRange:()=>RF,deleteSelection:()=>BF,enter:()=>PF,exitCode:()=>FF,extendMarkRange:()=>$F,first:()=>HF,focus:()=>GF,forEach:()=>WF,insertContent:()=>YF,insertContentAt:()=>zF,insertDefaultBlock:()=>KF,joinBackward:()=>qF,joinDown:()=>VF,joinForward:()=>JF,joinItemBackward:()=>ZF,joinItemForward:()=>XF,joinTextblockBackward:()=>e4,joinTextblockForward:()=>t4,joinUp:()=>QF,keyboardShortcut:()=>r4,lift:()=>i4,liftEmptyBlock:()=>s4,liftListItem:()=>o4,newlineInCode:()=>a4,resetAttributes:()=>l4,scrollIntoView:()=>c4,selectAll:()=>d4,selectNodeBackward:()=>u4,selectNodeForward:()=>h4,selectParentNode:()=>p4,selectTextblockEnd:()=>m4,selectTextblockStart:()=>f4,setContent:()=>g4,setMark:()=>B4,setMeta:()=>P4,setNode:()=>F4,setNodeSelection:()=>$4,setTextDirection:()=>H4,setTextSelection:()=>U4,sinkListItem:()=>G4,splitBlock:()=>W4,splitListItem:()=>Y4,toggleList:()=>K4,toggleMark:()=>Q4,toggleNode:()=>V4,toggleWrap:()=>q4,undoInputRule:()=>J4,unsetAllMarks:()=>Z4,unsetMark:()=>X4,unsetTextDirection:()=>e$,updateAttributes:()=>t$,updateDecorations:()=>n$,wrapIn:()=>r$,wrapInList:()=>i$});const po=new WeakMap;function o$(e,t){var n;po.set(e,((n=po.get(e))!==null&&n!==void 0?n:0)+1);try{return t()}finally{var r;const i=((r=po.get(e))!==null&&r!==void 0?r:1)-1;i>0?po.set(e,i):po.delete(e)}}function a$(e){return po.has(e)}var l$=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const n=this.callbacks[e];return n&&n.forEach(r=>r.apply(this,t)),this}off(e,t){const n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(r=>r!==t):delete this.callbacks[e]),this}once(e,t){const n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}};const Wk=typeof process<"u"&&process.env.NODE_ENV!=="production";function c$(e){return e.kind==="widget"}function Yk(e,t){const n=[],r=new Set;for(const i of e)i.kind==="widget"&&c$(i)&&r.add(i.key),n.push(i.toPMDecoration(t));return{decorations:n,widgetKeys:r}}function d$(e,t,n){const{decorations:r,widgetKeys:i}=Yk(t,n);return{set:ot.create(e,r),widgetKeys:i}}function zk({position:e,from:t,to:n,docSize:r}){return e<t?!1:e<n?!0:e===n&&n===r}function u$({decorations:e,from:t,to:n,docSize:r,extensionName:i,warnedExtensions:s}){return e.filter(o=>zk({position:o.anchor,from:t,to:n,docSize:r})?!0:(o.anchor===n||s.has(i)||(s.add(i),console.warn(`[tiptap warn]: Extension "${i}" returned a decoration outside the requested range [${t}, ${n}). It was ignored.`)),!1))}function Kk(e){var t;const n=(t=e.spec)===null||t===void 0?void 0:t.key;return typeof n=="string"?n:void 0}function h$(e){const t=new Map,n=new Map;for(const o of e.find()){var r,i,s;const a=Kk(o);if(!a)continue;const l=(r=o.spec.extensionName)!==null&&r!==void 0?r:"unknown",d=(i=t.get(a))!==null&&i!==void 0?i:new Set;d.add(l),t.set(a,d),n.set(a,((s=n.get(a))!==null&&s!==void 0?s:0)+1)}return Array.from(t,([o,a])=>({key:o,extensions:a})).filter(({key:o})=>{var a;return((a=n.get(o))!==null&&a!==void 0?a:0)>1})}function Qk(e){return e.jsonID==="attr"}function p$(e){let t=!1;if(e.getMap().forEach(()=>{t=!0}),t||Qk(e))return!0;const n=e;return typeof n.from=="number"&&typeof n.to=="number"}function m$(e,t){let n=null,r=0,i=0;for(let s=0;s<e.childCount&&!(i>t.to);s+=1){const o=i+e.child(s).nodeSize;o>=t.from&&(n===null&&(n=i),r=o),i=o}return n===null?null:{from:n,to:r}}function f$(e,t){if(e.steps.some(s=>!p$(s)))return{type:"full"};const n=pu(e).map(({newRange:s})=>s);e.steps.forEach((s,o)=>{if(!Qk(s))return;const a=e.mapping.slice(o);n.push({from:a.map(s.pos,-1),to:a.map(s.pos+1)})});const r=[];for(const s of n){const o=m$(t,s);o&&r.push(o)}r.sort((s,o)=>s.from-o.from);const i=[];for(const s of r){const o=i[i.length-1];o&&s.from<=o.to?o.to=Math.max(o.to,s.to):i.push({...s})}return{type:"ranges",ranges:i}}function Vk(e,t,n,r){return e.map(t,n,{onRemove:i=>{const s=i==null?void 0:i.key;typeof s=="string"&&r.delete(s)}})}function g$(e,t,n){var r,i;const s=(r=t.decorationSetsByExtension[e])!==null&&r!==void 0?r:ot.empty,o=new Set((i=t.widgetKeysByExtension[e])!==null&&i!==void 0?i:[]);return{set:Vk(s,n.mapping,n.doc,o),widgetKeys:o}}function Ay(e,t){const n=Object.values(t).flatMap(r=>r.find());return ot.create(e,n)}function by(e){const t=new Set;for(const n of Object.values(e))for(const r of n)t.add(r);return t}function A$(e,t){var n;switch((n=t.update)!==null&&n!==void 0?n:"document"){case"document":if(t.createInRange)throw new Error(`[tiptap error]: Extension "${e}" provides createInRange() but does not use the "changedRanges" decoration update strategy.`);return;case"changedRanges":if(!t.createInRange)throw new Error(`[tiptap error]: Extension "${e}" uses the "changedRanges" decoration update strategy but does not provide createInRange().`);return;case"manual":if(t.createInRange)throw new Error(`[tiptap error]: Extension "${e}" uses the "manual" decoration update strategy, which is not compatible with createInRange(). createInRange() requires the "changedRanges" strategy.`);if(t.shouldUpdate)throw new Error(`[tiptap error]: Extension "${e}" cannot combine the "manual" decoration update strategy with shouldUpdate().`);return;default:throw new Error(`[tiptap error]: Extension "${e}" uses an unknown decoration update strategy. Expected "document", "changedRanges", or "manual".`)}}function b$(e,t,n){return n?!0:e.update==="manual"?!1:e.shouldUpdate?e.shouldUpdate(t):t.tr.docChanged}const y$=new Set;var x$=class{constructor(e){this.warnedWidgetKeys=new Set,this.warnedOutOfRangeExtensions=new Set,this.handleBeforeTransaction=({nextState:t})=>{const n=ho.getState(t);n&&this.warnDuplicateWidgetKeys(n)},this.editor=e.editor,this.entries=this.resolveEntries(e.entries),this.entries.forEach(({name:t,spec:n})=>A$(t,n)),this.plugin=this.entries.length>0?this.createPlugin():null,this.editor.on("beforeTransaction",this.handleBeforeTransaction)}destroy(){this.editor.off("beforeTransaction",this.handleBeforeTransaction)}liveWidgetKeys(){var e,t;return(e=(t=ho.getState(this.editor.state))===null||t===void 0?void 0:t.widgetKeys)!==null&&e!==void 0?e:y$}get mountedView(){return this.editor.isDestroyed?null:this.editor.view}resolveEntries(e){const t=[];for(const{name:n,addDecorations:r}of e){const i=r();i&&t.push({name:n,spec:i})}return t}createPlugin(){const{editor:e,entries:t}=this;return new Ct({key:ho,state:{init:(n,r)=>{const i={},s={};for(const{name:a,spec:l}of t){const{set:d,widgetKeys:u}=this.buildFullSet(a,l,r);i[a]=d,s[a]=u}const o={decorationSetsByExtension:i,widgetKeysByExtension:s,mergedDecorationSet:this.buildMergedSet(r.doc,i),widgetKeys:by(s)};return this.warnDuplicateWidgetKeys(o),o},apply:(n,r,i,s)=>{const o=n.getMeta(ho),a=(o==null?void 0:o.type)==="force"&&!o.name,l=(o==null?void 0:o.type)==="force"?o.name:void 0,d={},u={},h=new Set;return o$(e,()=>{for(const{name:p,spec:m}of t){const g=a||l===p;if(b$(m,{editor:e,tr:n,oldState:i,newState:s},g))if(m.update==="changedRanges"&&n.docChanged&&!g){const b=this.applyChangedRangesRecompute(p,m,r,n,s);d[p]=b.set,u[p]=b.widgetKeys,h.add(p)}else{const{set:b,widgetKeys:A}=this.buildFullSet(p,m,s);d[p]=b,u[p]=A,h.add(p)}else{const b=g$(p,r,n);d[p]=b.set,u[p]=b.widgetKeys}}}),h.size===0&&!n.docChanged?r:{decorationSetsByExtension:d,widgetKeysByExtension:u,mergedDecorationSet:this.mergeAfterApply({entries:t,previous:r,tr:n,decorationSetsByExtension:d,recomputedNames:h}),widgetKeys:by(u)}}},props:{decorations(n){var r,i;return(r=(i=ho.getState(n))===null||i===void 0?void 0:i.mergedDecorationSet)!==null&&r!==void 0?r:ot.empty}}})}applyChangedRangesRecompute(e,t,n,r,i){const s=f$(r,i.doc);return s.type==="full"?this.buildFullSet(e,t,i):this.rebuildRanges(e,t,n,r,i,s.ranges)}rebuildRanges(e,t,n,r,i,s){var o,a;const l=(o=n.decorationSetsByExtension[e])!==null&&o!==void 0?o:ot.empty,d=new Set((a=n.widgetKeysByExtension[e])!==null&&a!==void 0?a:[]);let u=Vk(l,r.mapping,r.doc,d);const h=i.doc.content.size;for(const{from:p,to:m}of s){const g=u.find(p,m).filter(y=>zk({position:y.from,from:p,to:m,docSize:h}));for(const y of g){const w=Kk(y);w&&d.delete(w)}u=u.remove(g);const{decorations:b,widgetKeys:A}=Yk(u$({decorations:this.runCreate(e,"createInRange",()=>t.createInRange({editor:this.editor,state:i,view:this.mountedView,from:p,to:m})),from:p,to:m,docSize:h,extensionName:e,warnedExtensions:this.warnedOutOfRangeExtensions}),e);u=u.add(i.doc,b);for(const y of A)d.add(y)}return{set:u,widgetKeys:d}}buildFullSet(e,t,n){const r=this.runCreate(e,"create",()=>t.create({editor:this.editor,state:n,view:this.mountedView}));return d$(n.doc,r,e)}runCreate(e,t,n){try{return n()}catch(r){return console.error(`[tiptap error]: Extension "${e}" threw in \`addDecorations().${t}()\`. Its decorations were dropped for this update.`,r),[]}}warnDuplicateWidgetKeys(e){if(!Wk)return;if(e.widgetKeys.size===0){this.warnedWidgetKeys.clear();return}const t=h$(e.mergedDecorationSet),n=new Set(t.map(({key:r})=>r));for(const{key:r,extensions:i}of t){if(this.warnedWidgetKeys.has(r))continue;const s=Array.from(i).map(o=>`"${o}"`).join(", ");console.warn(`[tiptap warn]: Duplicate widget decoration key "${r}" in extension${i.size===1?"":"s"} ${s}. Widget decoration keys must be globally unique, otherwise ProseMirror misplaces the widget DOM. Use a stable, unique key (e.g. \`comment-\${id}\`).`)}this.warnedWidgetKeys=n}buildMergedSet(e,t){const n=Object.keys(t);return n.length===1?t[n[0]]:Ay(e,t)}mergeAfterApply({entries:e,previous:t,tr:n,decorationSetsByExtension:r,recomputedNames:i}){return e.length===1?r[e[0].name]:i.size===0?t.mergedDecorationSet.map(n.mapping,n.doc):Ay(n.doc,r)}};function v$(e,t){const{selection:n}=e,{$from:r}=n;if(n instanceof _e){const s=r.index();return r.parent.canReplaceWith(s,s+1,t)}let i=r.depth;for(;i>=0;){const s=r.index(i);if(r.node(i).contentMatchAt(s).matchType(t))return!0;i-=1}return!1}function w$(e,t,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const i=document.createElement("style");return t&&i.setAttribute("nonce",t),i.setAttribute("data-tiptap-style",""),i.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(i),i}function El(e,t){const n=e.getAttribute("style");if(!n)return null;const r=n.split(";").map(s=>s.trim()).filter(Boolean),i=t.toLowerCase();for(let s=r.length-1;s>=0;s-=1){const o=r[s],a=o.indexOf(":");if(a!==-1&&o.slice(0,a).trim().toLowerCase()===i)return o.slice(a+1).trim()}return null}function k$(e){return typeof e=="number"}function E$(e){return Object.prototype.toString.call(e).slice(8,-1)}function Zl(e){return E$(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function yy(e,t,n){const r=e.split(`
|
|
140
|
+
`),i=[];let s="",o=0;const a=t.baseIndentSize||2;for(;o<r.length;){const u=r[o],h=u.match(t.itemPattern);if(!h){if(i.length>0)break;if(u.trim()===""){o+=1,s=`${s}${u}
|
|
141
|
+
`;continue}else return}const p=t.extractItemData(h),{indentLevel:m,mainContent:g}=p;s=`${s}${u}
|
|
142
|
+
`;const b=[g];for(o+=1;o<r.length;){var l;const C=r[o];if(C.trim()===""){var d;const E=r.slice(o+1).findIndex(S=>S.trim()!=="");if(E===-1)break;if((((d=r[o+1+E].match(/^(\s*)/))===null||d===void 0||(d=d[1])===null||d===void 0?void 0:d.length)||0)>m){b.push(C),s=`${s}${C}
|
|
143
|
+
`,o+=1;continue}else break}if((((l=C.match(/^(\s*)/))===null||l===void 0||(l=l[1])===null||l===void 0?void 0:l.length)||0)>m)b.push(C),s=`${s}${C}
|
|
144
|
+
`,o+=1;else break}let A;const y=b.slice(1);if(y.length>0){const C=y.map(E=>E.slice(m+a)).join(`
|
|
145
|
+
`);C.trim()&&(t.customNestedParser?A=t.customNestedParser(C):A=n.blockTokens(C))}const w=t.createToken(p,A);i.push(w)}if(i.length!==0)return{items:i,raw:s}}const xy=4;function vy(e){let t=0;for(const n of e)t=n===" "?t+xy-t%xy:t+1;return t}function qk(e,t,n,r,i){if(!e||!Array.isArray(e.content))return"";const s=typeof n=="function"?n(r):n,[o,...a]=e.content;let l=`${s}${t.renderChildren([o])}`;return a&&a.length>0&&a.forEach((d,u)=>{var h,p;const m=(h=(p=t.renderChild)===null||p===void 0?void 0:p.call(t,d,u+1))!==null&&h!==void 0?h:t.renderChildren([d]);if(m!=null){const g=A=>{if(!(i!=null&&i.alignNestedToPrefix))return t.indent(A);const y=t.indent(""),w=vy(s);return(vy(y)>=w?y:" ".repeat(w))+A},b=m.split(`
|
|
146
|
+
`).map(A=>g(A||"")).join(`
|
|
147
|
+
`);l+=d.type==="paragraph"?`
|
|
148
|
+
|
|
149
|
+
${b}`:`
|
|
150
|
+
${b}`}}),l}function Jk(e,t){const n={...e};return Zl(e)&&Zl(t)&&Object.keys(t).forEach(r=>{Zl(t[r])&&Zl(e[r])?n[r]=Jk(e[r],t[r]):n[r]=t[r]}),n}function C$(e,t,n={}){const{state:r}=t,{doc:i,tr:s}=r,o=e;i.descendants((a,l)=>{const d=s.mapping.map(l),u=s.mapping.map(l)+a.nodeSize;let h=null;if(a.marks.forEach(m=>{if(m!==o)return!1;h=m}),!h)return;let p=!1;if(Object.keys(n).forEach(m=>{n[m]!==h.attrs[m]&&(p=!0)}),p){const m=e.type.create({...e.attrs,...n});s.removeMark(d,u,e.type),s.addMark(d,u,m)}}),s.docChanged&&t.view.dispatch(s)}var Cl=class{constructor(e){var t;this.find=e.find,this.handler=e.handler,this.undoable=(t=e.undoable)!==null&&t!==void 0?t:!0}};const T$=(e,t)=>{if(yf(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function Xl(e){var t;const{editor:n,from:r,to:i,text:s,rules:o,plugin:a}=e,{view:l}=n;if(l.composing)return!1;const d=l.state.doc.resolve(r);if(d.parent.type.spec.code||!((t=d.nodeBefore||d.nodeAfter)===null||t===void 0)&&t.marks.find(p=>p.type.spec.code))return!1;let u=!1;const h=I4(d)+s;return o.forEach(p=>{if(u)return;const m=T$(h,p.find);if(!m)return;const g=m[0].length-s.length;if(g>0){const S=d.parentOffset-g;if(S<0||d.parent.textBetween(S,d.parentOffset)!==m[0].slice(0,g))return}const b=l.state.tr,A=du({state:l.state,transaction:b}),y={from:r-(m[0].length-s.length),to:i},{commands:w,chain:C,can:E}=new xo({editor:n,state:A});p.handler({state:A,range:y,match:m,commands:w,chain:C,can:E})===null||!b.steps.length||(p.undoable&&b.setMeta(a,{transform:b,from:r,to:i,text:s}),l.dispatch(b),u=!0)}),u}function S$(e){const{editor:t,rules:n}=e,r=new Ct({state:{init(){return null},apply(i,s,o){const a=i.getMeta(r);if(a)return a;const l=i.getMeta("applyInputRules");return l&&setTimeout(()=>{let{text:d}=l;typeof d=="string"?d=d:d=wf(V.from(d),o.schema);const{from:u}=l,h=u+d.length;Xl({editor:t,from:u,to:h,text:d,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:s}},props:{handleTextInput(i,s,o,a){return Xl({editor:t,from:s,to:o,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&Xl({editor:t,from:s.pos,to:s.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,s){if(s.key!=="Enter")return!1;const{$cursor:o}=i.state.selection;return o?Xl({editor:t,from:o.pos,to:o.pos,text:`
|
|
151
|
+
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}var Ef=class{constructor(e={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...ut(Se(this,"addOptions",{name:this.name}))}}get storage(){return{...ut(Se(this,"addStorage",{name:this.name,options:this.options}))}}configure(e={}){const t=this.extend({...this.config,addOptions:()=>Jk(this.options,e)});return t.name=this.name,t.parent=this.parent,this.child=null,t}extend(e={}){const t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name="name"in e?e.name:t.parent.name,t}},Qr=class Zk extends Ef{constructor(...t){super(...t),this.type="mark"}static create(t={}){const n=typeof t=="function"?t():t;return new Zk(n)}static handleExit({editor:t,mark:n}){const{tr:r}=t.state,i=t.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!s.find(a=>(a==null?void 0:a.type.name)===n.name))return!1;const o=s.find(a=>(a==null?void 0:a.type.name)===n.name);return o&&r.removeStoredMark(o),r.insertText(" ",i.pos),t.view.dispatch(r),!0}return!1}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}},Xk=class{constructor(e){this.find=e.find,this.handler=e.handler}};const _$=(e,t,n)=>{if(yf(t))return[...e.matchAll(t)];const r=t(e,n);return r?r.map(i=>{const s=[i.text];return s.index=i.index,s.input=e,s.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),s.push(i.replaceWith)),s}):[]};function N$(e){const{editor:t,state:n,from:r,to:i,rule:s,pasteEvent:o,dropEvent:a}=e,{commands:l,chain:d,can:u}=new xo({editor:t,state:n}),h=[];return n.doc.nodesBetween(r,i,(p,m)=>{var g,b,A,y;if(!((g=p.type)===null||g===void 0||(g=g.spec)===null||g===void 0)&&g.code||!(p.isText||p.isTextblock||p.isInline))return;const w=(b=(A=(y=p.content)===null||y===void 0?void 0:y.size)!==null&&A!==void 0?A:p.nodeSize)!==null&&b!==void 0?b:0,C=Math.max(r,m),E=Math.min(i,m+w);if(C>=E)return;const S=p.isText?p.text||"":p.textBetween(C-m,E-m,void 0,"");_$(S,s.find,o).forEach(k=>{if(k.index===void 0)return;const I=C+k.index+1,L=I+k[0].length,R={from:n.tr.mapping.map(I),to:n.tr.mapping.map(L)},B=s.handler({state:n,range:R,match:k,commands:l,chain:d,can:u,pasteEvent:o,dropEvent:a});h.push(B)})}),h.every(p=>p!==null)}let ec=null;const I$=e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(t=n.clipboardData)===null||t===void 0||t.setData("text/html",e),n};function D$(e){const{editor:t,rules:n}=e;let r=null,i=!1,s=!1,o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const l=({state:d,from:u,to:h,rule:p,pasteEvt:m})=>{const g=d.tr,b=du({state:d,transaction:g});if(!(!N$({editor:t,state:b,from:Math.max(u-1,0),to:h.b-1,rule:p,pasteEvent:m,dropEvent:a})||!g.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,g}};return n.map(d=>new Ct({view(u){const h=m=>{var g;r=!((g=u.dom.parentElement)===null||g===void 0)&&g.contains(m.target)?u.dom.parentElement:null,r&&(ec=t)},p=()=>{ec&&(ec=null)};return window.addEventListener("dragstart",h),window.addEventListener("dragend",p),{destroy(){window.removeEventListener("dragstart",h),window.removeEventListener("dragend",p)}}},props:{handleDOMEvents:{drop:(u,h)=>{if(s=r===u.dom.parentElement,a=h,!s){const p=ec;p!=null&&p.isEditable&&setTimeout(()=>{const m=p.state.selection;m&&p.commands.deleteRange({from:m.from,to:m.to})},10)}return!1},paste:(u,h)=>{var p;const m=(p=h.clipboardData)===null||p===void 0?void 0:p.getData("text/html");return o=h,i=!!(m!=null&&m.includes("data-pm-slice")),!1}}},appendTransaction:(u,h,p)=>{const m=u[0],g=m.getMeta("uiEvent")==="paste"&&!i,b=m.getMeta("uiEvent")==="drop"&&!s,A=m.getMeta("applyPasteRules"),y=!!A;if(!g&&!b&&!y)return;if(y){let{text:E}=A;typeof E=="string"?E=E:E=wf(V.from(E),p.schema);const{from:S}=A,k=S+E.length,I=I$(E);return l({rule:d,state:p,from:S,to:{b:k},pasteEvt:I})}const w=h.doc.content.findDiffStart(p.doc.content),C=h.doc.content.findDiffEnd(p.doc.content);if(!(!k$(w)||!C||w===C.b))return l({rule:d,state:p,from:w,to:C,pasteEvt:o})}}))}var mu=class{constructor(e,t){this.splittableMarks=[],this.nonClearableMarks=[],this.decorationManager=null,this.editor=t,this.baseExtensions=e,this.extensions=jk(e),this.schema=w4(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{const n=Se(t,"addCommands",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:oo(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){const{editor:e}=this,t=Ma([...this.extensions].reverse()).flatMap(r=>{const i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:oo(r.name,this.schema)},s=[],o=Se(r,"addKeyboardShortcuts",i);let a={};if(r.type==="mark"&&Se(r,"exitable",i)&&(a.ArrowRight=()=>Qr.handleExit({editor:e,mark:r})),o){const p=Object.fromEntries(Object.entries(o()).map(([m,g])=>[m,()=>g({editor:e})]));a={...a,...p}}const l=CF(a);s.push(l);const d=Se(r,"addInputRules",i);if(my(r,e.options.enableInputRules)&&d){const p=d();if(p&&p.length){const m=S$({editor:e,rules:p}),g=Array.isArray(m)?m:[m];s.push(...g)}}const u=Se(r,"addPasteRules",i);if(my(r,e.options.enablePasteRules)&&u){const p=u();if(p&&p.length){const m=D$({editor:e,rules:p});s.push(...m)}}const h=Se(r,"addProseMirrorPlugins",i);if(h){const p=h();s.push(...p)}return s}),n=this.createDecorationPlugin();return n&&t.push(n),t}createDecorationPlugin(){var e;const{editor:t}=this;(e=this.decorationManager)===null||e===void 0||e.destroy();const n=[];return this.extensions.forEach(r=>{const i=Se(r,"addDecorations",{name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:oo(r.name,this.schema)});i&&n.push({name:r.name,addDecorations:i})}),this.decorationManager=new x$({editor:t,entries:n}),this.decorationManager.plugin}get attributes(){return Lk(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=Oo(this.extensions);return Object.fromEntries(t.filter(n=>!!Se(n,"addNodeView")).map(n=>{const r=this.attributes.filter(a=>a.type===n.name),i=Se(n,"addNodeView",{name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:e,type:qt(n.name,this.schema)});if(!i)return[];const s=i();if(!s)return[];const o=(a,l,d,u,h)=>{const p=il(a,r);return s({node:a,view:l,getPos:d,decorations:u,innerDecorations:h,editor:e,extension:n,HTMLAttributes:p})};return[n.name,o]}))}dispatchTransaction(e){const{editor:t}=this;return Ma([...this.extensions].reverse()).reduceRight((n,r)=>{const i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:oo(r.name,this.schema)},s=Se(r,"dispatchTransaction",i);return s?o=>{s.call(i,{transaction:o,next:n})}:n},e)}transformPastedHTML(e){const{editor:t}=this;return Ma([...this.extensions]).reduce((n,r)=>{const i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:oo(r.name,this.schema)},s=Se(r,"transformPastedHTML",i);return s?(o,a)=>{const l=n(o,a);return s.call(i,l)}:n},e||(n=>n))}get markViews(){const{editor:e}=this,{markExtensions:t}=Oo(this.extensions);return Object.fromEntries(t.filter(n=>!!Se(n,"addMarkView")).map(n=>{const r=this.attributes.filter(o=>o.type===n.name),i=Se(n,"addMarkView",{name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:e,type:Ai(n.name,this.schema)});if(!i)return[];const s=(o,a,l)=>{const d=il(o,r);return i()({mark:o,view:a,inline:l,editor:e,extension:n,HTMLAttributes:d,updateAttributes:u=>{C$(o,e,u)}})};return[n.name,s]}))}destroy(){var e;(e=this.decorationManager)===null||e===void 0||e.destroy(),this.extensions.forEach(t=>{let n=t;for(;n.parent;){const r=n.parent;r.child===n&&(r.child=null),n=r}}),this.extensions=[],this.baseExtensions=[],this.decorationManager=null,this.schema=null,this.editor=null}setupExtensions(){const e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(t=>[t.name,t.storage])),e.forEach(t=>{const n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:oo(t.name,this.schema)};if(t.type==="mark"){var r,i;(!((r=ut(Se(t,"keepOnSplit",n)))!==null&&r!==void 0)||r)&&this.splittableMarks.push(t.name),!((i=ut(Se(t,"clearable",n)))!==null&&i!==void 0)||i||this.nonClearableMarks.push(t.name)}const s=Se(t,"onBeforeCreate",n),o=Se(t,"onCreate",n),a=Se(t,"onUpdate",n),l=Se(t,"onSelectionUpdate",n),d=Se(t,"onTransaction",n),u=Se(t,"onFocus",n),h=Se(t,"onBlur",n),p=Se(t,"onDestroy",n);s&&this.editor.on("beforeCreate",s),o&&this.editor.on("create",o),a&&this.editor.on("update",a),l&&this.editor.on("selectionUpdate",l),d&&this.editor.on("transaction",d),u&&this.editor.on("focus",u),h&&this.editor.on("blur",h),p&&this.editor.on("destroy",p)})}};mu.resolve=jk;mu.sort=Ma;mu.flatten=vf;var At=class eE extends Ef{constructor(...t){super(...t),this.type="extension"}static create(t={}){const n=typeof t=="function"?t():t;return new eE(n)}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}};const M$=At.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Ct({key:new zt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,s=Pk(n),{blockSeparator:o}=this.options,a={...o!==void 0?{blockSeparator:o}:{},textSerializers:s};return[...i.ranges].sort((l,d)=>l.$from.pos-d.$from.pos).map(({$from:l,$to:d})=>Bk(r,{from:l.pos,to:d.pos},a)).join(o??`
|
|
152
|
+
|
|
153
|
+
`)}}})]}}),O$=At.create({name:"commands",addCommands(){return{...s$}}}),R$=At.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var n,r;const i=()=>{var s,o,a;if((s=(o=this.editor.options.coreExtensionOptions)===null||o===void 0||(o=o.delete)===null||o===void 0||(a=o.filterTransaction)===null||a===void 0?void 0:a.call(o,e))!==null&&s!==void 0?s:e.getMeta("y-sync$"))return;const l=Ok(e.before,[e,...t]);pu(l).forEach(u=>{l.mapping.mapResult(u.oldRange.from).deletedAfter&&l.mapping.mapResult(u.oldRange.to).deletedBefore&&l.before.nodesBetween(u.oldRange.from,u.oldRange.to,(h,p)=>{const m=p+h.nodeSize-2,g=u.oldRange.from<=p&&m<=u.oldRange.to;this.editor.emit("delete",{type:"node",node:h,from:p,to:m,newFrom:l.mapping.map(p),newTo:l.mapping.map(m),deletedRange:u.oldRange,newRange:u.newRange,partial:!g,editor:this.editor,transaction:e,combinedTransform:l})})});const d=l.mapping;l.steps.forEach((u,h)=>{if(u instanceof Tr){var p,m;const g=d.slice(h).map(u.from,-1),b=d.slice(h).map(u.to),A=d.invert().map(g,-1),y=d.invert().map(b),w=g>0?(p=l.doc.nodeAt(g-1))===null||p===void 0?void 0:p.marks.some(E=>E.eq(u.mark)):!1,C=(m=l.doc.nodeAt(b))===null||m===void 0?void 0:m.marks.some(E=>E.eq(u.mark));this.editor.emit("delete",{type:"mark",mark:u.mark,from:u.from,to:u.to,deletedRange:{from:A,to:y},newRange:{from:g,to:b},partial:!!(C||w),editor:this.editor,transaction:e,combinedTransform:l})}})};!((n=(r=this.editor.options.coreExtensionOptions)===null||r===void 0||(r=r.delete)===null||r===void 0?void 0:r.async)!==null&&n!==void 0)||n?setTimeout(i,0):i()}}),L$=At.create({name:"drop",addProseMirrorPlugins(){return[new Ct({key:new zt("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),j$=At.create({name:"editable",addProseMirrorPlugins(){return[new Ct({key:new zt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),B$=new zt("focusEvents"),P$=At.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new Ct({key:B$,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),F$=At.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:o})=>{const{selection:a,doc:l}=o,{empty:d,$anchor:u}=a,{pos:h,parent:p}=u,m=u.parent.isTextblock&&h>0?o.doc.resolve(h-1):u,g=m.parent.type.spec.isolating,b=u.pos-u.parentOffset,A=g&&m.parent.childCount===1?b===u.pos:Ge.atStart(l).from===h;return!d||!p.type.isTextblock||p.textContent.length||!A||A&&u.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return id()||Dk()?i:r},addProseMirrorPlugins(){return[new Ct({key:new zt("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(m=>m.getMeta("composition")))return;const r=e.some(m=>m.docChanged)&&!t.doc.eq(n.doc),i=e.some(m=>m.getMeta("preventClearDocument"));if(!r||i)return;const{empty:s,from:o,to:a}=t.selection,l=Ge.atStart(t.doc).from,d=Ge.atEnd(t.doc).to;if(s||!(o===l&&a===d)||!kl(n.doc))return;const u=n.tr,h=du({state:n,transaction:u}),{commands:p}=new xo({editor:this.editor,state:h});if(p.clearNodes(),!!u.steps.length)return u}})]}}),$$=At.create({name:"paste",addProseMirrorPlugins(){return[new Ct({key:new zt("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),H$=At.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new Ct({key:new zt("tabindex"),props:{attributes:()=>{var e;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(e=this.options.value)!==null&&e!==void 0?e:"0"}}}})]}}),U$=At.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:e}=Oo(this.extensions);return[{types:e.filter(t=>t.name!=="text").map(t=>t.name),attributes:{dir:{default:this.options.direction,parseHTML:t=>{const n=t.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:t=>t.dir?{dir:t.dir}:{}}}}]},addProseMirrorPlugins(){return[new Ct({key:new zt("textDirection"),props:{attributes:()=>{const e=this.options.direction;return e?{dir:e}:{}}}})]}});let wy=!1;function G$(e){if(wy)return;wy=!0;let t;try{t=$t.fromJSON(e,{from:0,to:0}).slice.content}catch{return}t instanceof V||console.warn("[tiptap warn]: prosemirror-model is loaded more than once. Wrapping and splitting nodes will fail. Deduplicate it in your lock file, or alias it to a single copy in your bundler.")}var W$=class fa{get name(){return this.node.type.name}constructor(t,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=t,this.editor=n,this.currentNode=i}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var t;return(t=this.actualDepth)!==null&&t!==void 0?t:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(t){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},t)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const t=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(t);return new fa(n,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new fa(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new fa(t,this.editor)}get children(){const t=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,s=n.isAtom&&!n.isText,o=n.isInline,a=this.pos+r+(s?0:1);if(a<0||a>this.resolvedPos.doc.nodeSize-2)return;const l=this.resolvedPos.doc.resolve(a);if(!i&&!o&&l.depth<=this.depth)return;const d=new fa(l,this.editor,i,i||o?n:null);i&&(d.actualDepth=this.depth+1),t.push(d)}),t}get firstChild(){return this.children[0]||null}get lastChild(){const t=this.children;return t[t.length-1]||null}closest(t,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===t)if(Object.keys(n).length>0){const s=i.node.attrs,o=Object.keys(n);for(let a=0;a<o.length;a+=1){const l=o[a];if(s[l]!==n[l])break}}else r=i;i=i.parent}return r}querySelector(t,n={}){return this.querySelectorAll(t,n,!0)[0]||null}querySelectorAll(t,n={},r=!1){let i=[];if(!this.children||this.children.length===0)return i;const s=Object.keys(n);return this.children.forEach(o=>{r&&i.length>0||(o.node.type.name===t&&s.every(a=>n[a]===o.node.attrs[a])&&i.push(o),!(r&&i.length>0)&&(i=i.concat(o.querySelectorAll(t,n,r))))}),i}setAttribute(t){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...t}),this.editor.view.dispatch(n)}};const Y$=`.ProseMirror {
|
|
154
|
+
position: relative;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.ProseMirror {
|
|
158
|
+
word-wrap: break-word;
|
|
159
|
+
white-space: pre-wrap;
|
|
160
|
+
white-space: break-spaces;
|
|
161
|
+
-webkit-font-variant-ligatures: none;
|
|
162
|
+
font-variant-ligatures: none;
|
|
163
|
+
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.ProseMirror [contenteditable="false"] {
|
|
167
|
+
white-space: normal;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
|
|
171
|
+
white-space: pre-wrap;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.ProseMirror pre {
|
|
175
|
+
white-space: pre-wrap;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
img.ProseMirror-separator {
|
|
179
|
+
display: inline !important;
|
|
180
|
+
border: none !important;
|
|
181
|
+
margin: 0 !important;
|
|
182
|
+
width: 0 !important;
|
|
183
|
+
height: 0 !important;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.ProseMirror-gapcursor {
|
|
187
|
+
display: none;
|
|
188
|
+
pointer-events: none;
|
|
189
|
+
position: absolute;
|
|
190
|
+
margin: 0;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.ProseMirror-gapcursor:after {
|
|
194
|
+
content: "";
|
|
195
|
+
display: block;
|
|
196
|
+
position: absolute;
|
|
197
|
+
top: -2px;
|
|
198
|
+
width: 20px;
|
|
199
|
+
border-top: 1px solid black;
|
|
200
|
+
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
@keyframes ProseMirror-cursor-blink {
|
|
204
|
+
to {
|
|
205
|
+
visibility: hidden;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.ProseMirror-hideselection *::selection {
|
|
210
|
+
background: transparent;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.ProseMirror-hideselection *::-moz-selection {
|
|
214
|
+
background: transparent;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.ProseMirror-hideselection * {
|
|
218
|
+
caret-color: transparent;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
222
|
+
display: block;
|
|
223
|
+
}`;var z$=class extends l${constructor(e={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.hasWarnedStaleDecorationRead=!1,this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:R4,createMappablePosition:L4},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:r,moved:i})=>this.options.onDrop(n,r,i)),this.on("paste",({event:n,slice:r})=>this.options.onPaste(n,r)),this.on("delete",this.options.onDelete);const t=this.createDoc();if(!this.editorState){const n=Zp(t,this.options.autofocus);this.editorState=bs.create({doc:t,schema:this.schema,selection:n||void 0})}G$(this.schema),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(e),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){this.editorState=this.editorView.state;const e=this.editorView.dom;e!=null&&e.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn("Failed to remove CSS element:",e)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager?this.commandManager.chain():xo.createFakeChain()}can(){return this.commandManager?this.commandManager.can():xo.createFallbackCan()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=w$(Y$,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t==="state")return this.editorState;if(t in e)return Reflect.get(e,t);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return Wk&&!this.hasWarnedStaleDecorationRead&&a$(this)&&(this.hasWarnedStaleDecorationRead=!0,console.warn("[tiptap warn]: `editor.state` was read while decoration `create()` was running. It returns the pre-transaction document. Use the `state` argument passed to `create()` instead. Helpers like `editor.isActive()` read `editor.state` too, so pass `state` to their standalone versions instead of calling them on the editor.")),this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){const n=Rk(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;const t=this.state.plugins;let n=t;if([].concat(e).forEach(i=>{const s=typeof i=="string"?`${i}$`:i.key;n=n.filter(o=>!o.key.startsWith(s))}),t.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var e,t;const n=[...this.options.enableCoreExtensions?[j$,M$.configure({blockSeparator:(e=this.options.coreExtensionOptions)===null||e===void 0||(e=e.clipboardTextSerializer)===null||e===void 0?void 0:e.blockSeparator}),O$,P$,F$,H$.configure({value:(t=this.options.coreExtensionOptions)===null||t===void 0||(t=t.tabindex)===null||t===void 0?void 0:t.value}),L$,$$,R$,U$.configure({direction:this.options.textDirection})].filter(r=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[r.name]!==!1:!0):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(r==null?void 0:r.type));this.extensionManager=new mu(n,this)}createCommandManager(){this.commandManager=new xo({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=Xp(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(t.message))throw t;const n=Xp(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1});return this.editorState=bs.create({doc:n,schema:this.schema,selection:Zp(n,this.options.autofocus)||void 0}),this.emit("contentError",{editor:this,error:t,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(r=>r.name!=="collaboration"),this.createExtensionManager()}}),this.editorState.doc}return e}createView(e){const{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,s=t.transformPastedHTML,o=this.extensionManager.transformPastedHTML(s);this.editorView=new vk(e,{...t,attributes:{role:"textbox",...t==null?void 0:t.attributes},dispatchTransaction:i,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const a=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(a),this.prependClass(),this.injectCSS();const l=this.view.dom;l.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(d=>{var u;return(u=this.capturedTransaction)===null||u===void 0?void 0:u.step(d)});return}const{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),i=n.includes(e),s=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),!i)return;this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const o=n.findLast(d=>d.getMeta("focus")||d.getMeta("blur")),a=o==null?void 0:o.getMeta("focus"),l=o==null?void 0:o.getMeta("blur");a&&this.emit("focus",{editor:this,event:a.event,transaction:o}),l&&this.emit("blur",{editor:this,event:l.event,transaction:o}),!(e.getMeta("preventUpdate")||!n.some(d=>d.docChanged)||s.doc.eq(t.doc))&&this.emit("update",{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return Fk(this.state,e)}isActive(e,t){const n=typeof e=="string"?e:null,r=typeof e=="string"?t:e;return D4(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return wf(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t=`
|
|
224
|
+
|
|
225
|
+
`,textSerializers:n={}}=e||{};return E4(this.state.doc,{blockSeparator:t,textSerializers:{...Pk(this.schema),...n}})}get isEmpty(){return kl(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var e,t;return(e=(t=this.editorView)===null||t===void 0?void 0:t.isDestroyed)!==null&&e!==void 0?e:!0}$node(e,t){var n;return((n=this.$doc)===null||n===void 0?void 0:n.querySelector(e,t))||null}$nodes(e,t){var n;return((n=this.$doc)===null||n===void 0?void 0:n.querySelectorAll(e,t))||null}$pos(e){const t=this.state.doc.resolve(e),n=e>0&&t.nodeAfter&&!t.nodeAfter.isText&&t.nodeAfter.isAtom?t.nodeAfter:null;return new W$(t,this,!1,n)}get $doc(){return this.$pos(0)}};function $s(e){return new Cl({find:e.find,handler:({state:t,range:n,match:r})=>{const i=ut(e.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:s}=t,o=r[r.length-1],a=r[0];if(o){const l=a.search(/\S/),d=n.from+a.indexOf(o),u=d+o.length;if(kf(n.from,n.to,t.doc).filter(p=>p.mark.type.excluded.find(m=>m===e.type&&m!==p.mark.type)).filter(p=>p.to>d).length)return null;u<n.to&&s.delete(u,n.to),d>n.from&&s.delete(n.from+l,d);const h=n.from+l+o.length;s.addMark(n.from+l,h,e.type.create(i||{})),s.removeStoredMark(e.type)}},undoable:e.undoable})}function K$(e){return new Cl({find:e.find,handler:({state:t,range:n,match:r})=>{const i=ut(e.getAttributes,void 0,r)||{},{tr:s}=t,o=n.from;let a=n.to;const l=e.type.create(i);if(r[1]){let d=o+r[0].lastIndexOf(r[1]);d>a?d=a:a=d+r[1].length;const u=r[0][r[0].length-1];s.insertText(u,o+r[0].length-1),s.replaceWith(d,a,l)}else if(r[0]){const d=e.type.isInline?o:o-1;s.insert(d,e.type.create(i)).delete(s.mapping.map(o),s.mapping.map(a))}s.scrollIntoView()},undoable:e.undoable})}function tm(e){return new Cl({find:e.find,handler:({state:t,range:n,match:r})=>{const i=t.doc.resolve(n.from),s=ut(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,s)},undoable:e.undoable})}function Ro(e){return new Cl({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{const s=ut(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),a=o.doc.resolve(n.from).blockRange(),l=a&&rf(a,e.type,s);if(!l)return null;if(o.wrap(a,l),e.keepMarks&&e.editor){const{selection:u,storedMarks:h}=t,{splittableMarks:p}=e.editor.extensionManager,m=h||u.$to.parentOffset&&u.$from.marks();if(m){const g=m.filter(b=>p.includes(b.type.name));o.ensureMarks(g)}}if(e.keepAttributes){const u=e.type.name==="bulletList"||e.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(u,s).run()}const d=o.doc.resolve(n.from-1).nodeBefore;d&&d.type===e.type&&qi(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,d))&&o.join(n.from-1)},undoable:e.undoable})}var Fn=class tE extends Ef{constructor(...t){super(...t),this.type="node"}static create(t={}){const n=typeof t=="function"?t():t;return new tE(n)}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}};function Ki(e){return new Xk({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{const s=ut(e.getAttributes,void 0,r,i);if(s===!1||s===null)return null;const{tr:o}=t,a=r[r.length-1],l=r[0];let d=n.to;if(a){const u=l.search(/\S/),h=n.from+l.indexOf(a),p=h+a.length;if(kf(n.from,n.to,t.doc).filter(m=>m.mark.type.excluded.find(g=>g===e.type&&g!==m.mark.type)).filter(m=>m.to>h).length)return null;p<n.to&&o.delete(p,n.to),h>n.from&&o.delete(n.from+u,h),d=n.from+u+a.length,o.addMark(n.from+u,d,e.type.create(s||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(e.type)}}})}const{getOwnPropertyNames:Q$,getOwnPropertySymbols:V$}=Object,{hasOwnProperty:q$}=Object.prototype;function Mh(e,t){return function(n,r,i){return e(n,r,i)&&t(n,r,i)}}function tc(e){return function(t,n,r){if(!t||!n||typeof t!="object"||typeof n!="object")return e(t,n,r);const{cache:i}=r,s=i.get(t),o=i.get(n);if(s&&o)return s===n&&o===t;i.set(t,n),i.set(n,t);const a=e(t,n,r);return i.delete(t),i.delete(n),a}}function J$(e){return e!=null?e[Symbol.toStringTag]:void 0}function ky(e){return Q$(e).concat(V$(e))}const Z$=Object.hasOwn||((e,t)=>q$.call(e,t));function Ks(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const X$="__v",eH="__o",tH="_owner",{getOwnPropertyDescriptor:Ey,keys:Cy}=Object;function nH(e,t){return e.byteLength===t.byteLength&&sd(new Uint8Array(e),new Uint8Array(t))}function rH(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function iH(e,t){return e.byteLength===t.byteLength&&sd(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function sH(e,t){return Ks(e.getTime(),t.getTime())}function oH(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function aH(e,t){return e===t}function Ty(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const i=new Array(r),s=e.entries();let o,a,l=0;for(;(o=s.next())&&!o.done;){const d=t.entries();let u=!1,h=0;for(;(a=d.next())&&!a.done;){if(i[h]){h++;continue}const p=o.value,m=a.value;if(n.equals(p[0],m[0],l,h,e,t,n)&&n.equals(p[1],m[1],p[0],m[0],e,t,n)){u=i[h]=!0;break}h++}if(!u)return!1;l++}return!0}const lH=Ks;function cH(e,t,n){const r=Cy(e);let i=r.length;if(Cy(t).length!==i)return!1;for(;i-- >0;)if(!nE(e,t,n,r[i]))return!1;return!0}function aa(e,t,n){const r=ky(e);let i=r.length;if(ky(t).length!==i)return!1;let s,o,a;for(;i-- >0;)if(s=r[i],!nE(e,t,n,s)||(o=Ey(e,s),a=Ey(t,s),(o||a)&&(!o||!a||o.configurable!==a.configurable||o.enumerable!==a.enumerable||o.writable!==a.writable)))return!1;return!0}function dH(e,t){return Ks(e.valueOf(),t.valueOf())}function uH(e,t){return e.source===t.source&&e.flags===t.flags}function Sy(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const i=new Array(r),s=e.values();let o,a;for(;(o=s.next())&&!o.done;){const l=t.values();let d=!1,u=0;for(;(a=l.next())&&!a.done;){if(!i[u]&&n.equals(o.value,a.value,o.value,a.value,e,t,n)){d=i[u]=!0;break}u++}if(!d)return!1}return!0}function sd(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function hH(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function nE(e,t,n,r){return(r===tH||r===eH||r===X$)&&(e.$$typeof||t.$$typeof)?!0:Z$(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const pH="[object ArrayBuffer]",mH="[object Arguments]",fH="[object Boolean]",gH="[object DataView]",AH="[object Date]",bH="[object Error]",yH="[object Map]",xH="[object Number]",vH="[object Object]",wH="[object RegExp]",kH="[object Set]",EH="[object String]",CH={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},TH="[object URL]",SH=Object.prototype.toString;function _H({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:s,areMapsEqual:o,areNumbersEqual:a,areObjectsEqual:l,arePrimitiveWrappersEqual:d,areRegExpsEqual:u,areSetsEqual:h,areTypedArraysEqual:p,areUrlsEqual:m,unknownTagComparators:g}){return function(b,A,y){if(b===A)return!0;if(b==null||A==null)return!1;const w=typeof b;if(w!==typeof A)return!1;if(w!=="object")return w==="number"?a(b,A,y):w==="function"?s(b,A,y):!1;const C=b.constructor;if(C!==A.constructor)return!1;if(C===Object)return l(b,A,y);if(Array.isArray(b))return t(b,A,y);if(C===Date)return r(b,A,y);if(C===RegExp)return u(b,A,y);if(C===Map)return o(b,A,y);if(C===Set)return h(b,A,y);const E=SH.call(b);if(E===AH)return r(b,A,y);if(E===wH)return u(b,A,y);if(E===yH)return o(b,A,y);if(E===kH)return h(b,A,y);if(E===vH)return typeof b.then!="function"&&typeof A.then!="function"&&l(b,A,y);if(E===TH)return m(b,A,y);if(E===bH)return i(b,A,y);if(E===mH)return l(b,A,y);if(CH[E])return p(b,A,y);if(E===pH)return e(b,A,y);if(E===gH)return n(b,A,y);if(E===fH||E===xH||E===EH)return d(b,A,y);if(g){let S=g[E];if(!S){const k=J$(b);k&&(S=g[k])}if(S)return S(b,A,y)}return!1}}function NH({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:nH,areArraysEqual:n?aa:rH,areDataViewsEqual:iH,areDatesEqual:sH,areErrorsEqual:oH,areFunctionsEqual:aH,areMapsEqual:n?Mh(Ty,aa):Ty,areNumbersEqual:lH,areObjectsEqual:n?aa:cH,arePrimitiveWrappersEqual:dH,areRegExpsEqual:uH,areSetsEqual:n?Mh(Sy,aa):Sy,areTypedArraysEqual:n?Mh(sd,aa):sd,areUrlsEqual:hH,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const i=tc(r.areArraysEqual),s=tc(r.areMapsEqual),o=tc(r.areObjectsEqual),a=tc(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:i,areMapsEqual:s,areObjectsEqual:o,areSetsEqual:a})}return r}function IH(e){return function(t,n,r,i,s,o,a){return e(t,n,a)}}function DH({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(o,a){const{cache:l=e?new WeakMap:void 0,meta:d}=n();return t(o,a,{cache:l,equals:r,meta:d,strict:i})};if(e)return function(o,a){return t(o,a,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};const s={cache:void 0,equals:r,meta:void 0,strict:i};return function(o,a){return t(o,a,s)}}const MH=Zi();Zi({strict:!0});Zi({circular:!0});Zi({circular:!0,strict:!0});Zi({createInternalComparator:()=>Ks});Zi({strict:!0,createInternalComparator:()=>Ks});Zi({circular:!0,createInternalComparator:()=>Ks});Zi({circular:!0,createInternalComparator:()=>Ks,strict:!0});function Zi(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,s=NH(e),o=_H(s),a=n?n(o):IH(o);return DH({circular:t,comparator:o,createState:r,equals:a,strict:i})}var Oh={exports:{}},Rh={};/**
|
|
226
|
+
* @license React
|
|
227
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
228
|
+
*
|
|
229
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
230
|
+
*
|
|
231
|
+
* This source code is licensed under the MIT license found in the
|
|
232
|
+
* LICENSE file in the root directory of this source tree.
|
|
233
|
+
*/var _y;function OH(){if(_y)return Rh;_y=1;var e=v,t=ef();function n(d,u){return d===u&&(d!==0||1/d===1/u)||d!==d&&u!==u}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,s=e.useRef,o=e.useEffect,a=e.useMemo,l=e.useDebugValue;return Rh.useSyncExternalStoreWithSelector=function(d,u,h,p,m){var g=s(null);if(g.current===null){var b={hasValue:!1,value:null};g.current=b}else b=g.current;g=a(function(){function y(k){if(!w){if(w=!0,C=k,k=p(k),m!==void 0&&b.hasValue){var I=b.value;if(m(I,k))return E=I}return E=k}if(I=E,r(C,k))return I;var L=p(k);return m!==void 0&&m(I,L)?(C=k,I):(C=k,E=L)}var w=!1,C,E,S=h===void 0?null:h;return[function(){return y(u())},S===null?void 0:function(){return y(S())}]},[u,h,p,m]);var A=i(d,g[0],g[1]);return o(function(){b.hasValue=!0,b.value=A},[A]),l(A),A},Rh}var Ny={};/**
|
|
234
|
+
* @license React
|
|
235
|
+
* use-sync-external-store-shim/with-selector.development.js
|
|
236
|
+
*
|
|
237
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
238
|
+
*
|
|
239
|
+
* This source code is licensed under the MIT license found in the
|
|
240
|
+
* LICENSE file in the root directory of this source tree.
|
|
241
|
+
*/var Iy;function RH(){return Iy||(Iy=1,process.env.NODE_ENV!=="production"&&(function(){function e(d,u){return d===u&&(d!==0||1/d===1/u)||d!==d&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=v,n=ef(),r=typeof Object.is=="function"?Object.is:e,i=n.useSyncExternalStore,s=t.useRef,o=t.useEffect,a=t.useMemo,l=t.useDebugValue;Ny.useSyncExternalStoreWithSelector=function(d,u,h,p,m){var g=s(null);if(g.current===null){var b={hasValue:!1,value:null};g.current=b}else b=g.current;g=a(function(){function y(k){if(!w){if(w=!0,C=k,k=p(k),m!==void 0&&b.hasValue){var I=b.value;if(m(I,k))return E=I}return E=k}if(I=E,r(C,k))return I;var L=p(k);return m!==void 0&&m(I,L)?(C=k,I):(C=k,E=L)}var w=!1,C,E,S=h===void 0?null:h;return[function(){return y(u())},S===null?void 0:function(){return y(S())}]},[u,h,p,m]);var A=i(d,g[0],g[1]);return o(function(){b.hasValue=!0,b.value=A},[A]),l(A),A},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Ny}var Dy;function LH(){return Dy||(Dy=1,process.env.NODE_ENV==="production"?Oh.exports=OH():Oh.exports=RH()),Oh.exports}var jH=LH();const BH=(...e)=>t=>{e.forEach(n=>{typeof n=="function"?n(t):n&&(n.current=t)})},PH=({contentComponent:e})=>{const t=G1.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getServerSnapshot);return c.jsx(c.Fragment,{children:Object.values(t)})};function FH(){const e=new Set;let t={},n=!1;const r=()=>{n||!e.size||(n=!0,queueMicrotask(()=>{n=!1,e.forEach(i=>i())}))};return{subscribe(i){return e.add(i),()=>{e.delete(i)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(i,s){t={...t,[i]:_j.createPortal(s.reactElement,s.element,i)},r()},removeRenderer(i){const s={...t};delete s[i],t=s,r()}}}var $H=class extends v.Component{constructor(e){super(e),this.editorContentRef=v.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var e;const t=this.props.editor;if(t&&!t.isDestroyed&&!((e=t.view.dom)===null||e===void 0)&&e.parentNode){if(t.contentComponent)return;const n=this.editorContentRef.current;n.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:n}),t.contentComponent=FH(),t.createNodeViews(),t.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){const e=this.props.editor;if(e){e.isEditorContentInitialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null;try{var t;if(!(!((t=e.view.dom)===null||t===void 0)&&t.parentNode))return;const n=document.createElement("div");n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n})}catch{}}}render(){const{editor:e,innerRef:t,...n}=this.props;return c.jsxs(c.Fragment,{children:[c.jsx("div",{ref:BH(t,this.editorContentRef),...n}),(e==null?void 0:e.contentComponent)&&c.jsx(PH,{contentComponent:e.contentComponent})]})}};const HH=v.forwardRef((e,t)=>{const n=v.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return v.createElement($H,{key:n,innerRef:t,...e})}),rE=v.memo(HH),UH=typeof window<"u"?v.useLayoutEffect:v.useEffect;var GH=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){let t;const n=i=>{(i==null?void 0:i.transaction)!==void 0&&i.transaction===t||(t=i==null?void 0:i.transaction,this.transactionNumber+=1,this.subscribers.forEach(s=>s()))},r=this.editor;return r.on("transaction",n),r.on("update",n),()=>{r.off("transaction",n),r.off("update",n)}}}};function WH(e){var t;const[n]=v.useState(()=>new GH(e.editor)),r=jH.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,(t=e.equalityFn)!==null&&t!==void 0?t:MH);return UH(()=>n.watch(e.editor),[e.editor,n]),v.useDebugValue(r),r}const My=process.env.NODE_ENV!=="production",iE=typeof window>"u",YH=iE||!!(typeof window<"u"&&window.next);var zH=class sE{constructor(t){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=t,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(t){this.editor=t,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){const t=this.options.current.immediatelyRender;let n=t??!0;return iE?(n&&My&&console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches"),n=!1):YH&&t===void 0&&(n=!1,My&&console.warn("Next.js detected. `immediatelyRender` defaults to false to avoid hydration mismatches. Pass `immediatelyRender: true` explicitly if you are rendering the editor only on the client.")),n?this.createEditor():null}createEditor(){const t={...this.options.current,onBeforeCreate:(...n)=>{var r,i;return(r=(i=this.options.current).onBeforeCreate)===null||r===void 0?void 0:r.call(i,...n)},onBlur:(...n)=>{var r,i;return(r=(i=this.options.current).onBlur)===null||r===void 0?void 0:r.call(i,...n)},onCreate:(...n)=>{var r,i;return(r=(i=this.options.current).onCreate)===null||r===void 0?void 0:r.call(i,...n)},onDestroy:(...n)=>{var r,i;return(r=(i=this.options.current).onDestroy)===null||r===void 0?void 0:r.call(i,...n)},onFocus:(...n)=>{var r,i;return(r=(i=this.options.current).onFocus)===null||r===void 0?void 0:r.call(i,...n)},onSelectionUpdate:(...n)=>{var r,i;return(r=(i=this.options.current).onSelectionUpdate)===null||r===void 0?void 0:r.call(i,...n)},onTransaction:(...n)=>{var r,i;return(r=(i=this.options.current).onTransaction)===null||r===void 0?void 0:r.call(i,...n)},onUpdate:(...n)=>{var r,i;return(r=(i=this.options.current).onUpdate)===null||r===void 0?void 0:r.call(i,...n)},onContentError:(...n)=>{var r,i;return(r=(i=this.options.current).onContentError)===null||r===void 0?void 0:r.call(i,...n)},onDrop:(...n)=>{var r,i;return(r=(i=this.options.current).onDrop)===null||r===void 0?void 0:r.call(i,...n)},onPaste:(...n)=>{var r,i;return(r=(i=this.options.current).onPaste)===null||r===void 0?void 0:r.call(i,...n)},onDelete:(...n)=>{var r,i;return(r=(i=this.options.current).onDelete)===null||r===void 0?void 0:r.call(i,...n)},onMount:(...n)=>{var r,i;return(r=(i=this.options.current).onMount)===null||r===void 0?void 0:r.call(i,...n)},onUnmount:(...n)=>{var r,i;return(r=(i=this.options.current).onUnmount)===null||r===void 0?void 0:r.call(i,...n)}};return new z$(t)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(t){return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)}}static compareOptions(t,n){return Object.keys(t).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&t.extensions&&n.extensions?t.extensions.length!==n.extensions.length?!1:t.extensions.every((i,s)=>{var o;return i===((o=n.extensions)===null||o===void 0?void 0:o[s])}):t[r]===n[r])}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?sE.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(t){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=t;return}if(this.previousDeps.length===t.length&&this.previousDeps.every((n,r)=>n===t[r]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=t}scheduleDestroy(){const t=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===t){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===t&&this.setEditor(null))},1)}};function KH(e={},t=[]){const n=v.useRef(e);n.current=e;const[r]=v.useState(()=>new zH(n)),i=G1.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return v.useDebugValue(i),v.useEffect(r.onRender(t)),WH({editor:i,selector:({transactionNumber:s})=>e.shouldRerenderOnTransaction===!1||e.shouldRerenderOnTransaction===void 0?null:e.immediatelyRender&&s===0?0:s+1}),i}const oE=v.createContext({editor:null});oE.Consumer;const QH=v.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),VH=()=>v.useContext(QH);v.forwardRef((e,t)=>{const{onDragStart:n}=VH(),r=e.as||"div";return c.jsx(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});v.createContext({markViewContentRef:()=>{}});const Cf=v.createContext({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});Cf.displayName="TiptapContext";const qH=()=>v.useContext(Cf);function aE({children:e,...t}){const n="editor"in t?t.editor:t.instance;if(!n)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const r=v.useMemo(()=>({editor:n}),[n]),i=v.useMemo(()=>({editor:n}),[n]);return c.jsx(oE.Provider,{value:i,children:c.jsx(Cf.Provider,{value:r,children:e})})}aE.displayName="Tiptap";function lE({...e}){const{editor:t}=qH();return c.jsx(rE,{editor:t,...e})}lE.displayName="Tiptap.Content";Object.assign(aE,{Content:lE});const JH=[{label:"Improve writing",instruction:"Improve the writing to be clearer and more compelling. Keep the meaning and any merge tags."},{label:"Fix spelling & grammar",instruction:"Fix spelling and grammar only. Keep the wording, tone, and merge tags."},{label:"Make shorter",instruction:"Make this more concise while keeping the key message and merge tags."},{label:"Make longer",instruction:"Expand this with a little more helpful detail. Keep the tone and merge tags."},{label:"More professional",instruction:"Rewrite in a more professional, polished tone. Keep the merge tags."},{label:"More friendly",instruction:"Rewrite in a warmer, friendlier tone. Keep the merge tags."}],ZH=()=>c.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",width:"14",height:"14",children:c.jsx("path",{d:"M12 2l1.9 4.9L19 9l-5.1 2.1L12 16l-1.9-4.9L5 9l5.1-2.1L12 2zm7 11l.9 2.3L22 16l-2.1.7L19 19l-.9-2.3L16 16l2.1-.7L19 13z"})}),XH=["😀","😃","😄","😁","😊","🙂","😉","😍","😎","🤩","🥳","🤔","😅","😂","😇","😴","👍","👎","👏","🙌","🙏","💪","👋","🤝","❤️","🔥","✨","🎉","🎊","⭐","🚀","💡","✅","❌","⚠️","📌","📣","💯","💰","📈"],e5=["14px","16px","18px","20px","24px","28px"],t5=()=>c.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[c.jsx("path",{d:"M10 13a5 5 0 0 0 7.07 0l1.93-1.93a5 5 0 0 0-7.07-7.07l-1.1 1.1"}),c.jsx("path",{d:"M14 11a5 5 0 0 0-7.07 0L5 12.93a5 5 0 0 0 7.07 7.07l1.1-1.1"})]}),n5=()=>c.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[c.jsx("path",{d:"m18.84 12.25 1.72-1.71a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),c.jsx("path",{d:"m5.17 11.75-1.71 1.71a5 5 0 0 0 7.07 7.07l1.71-1.71"}),c.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"5"}),c.jsx("line",{x1:"2",y1:"8",x2:"5",y2:"8"}),c.jsx("line",{x1:"16",y1:"19",x2:"16",y2:"22"}),c.jsx("line",{x1:"19",y1:"16",x2:"22",y2:"16"})]}),r5=[{mark:"bold",label:"B",title:"Bold"},{mark:"italic",label:"I",title:"Italic"},{mark:"underline",label:"U",title:"Underline"},{mark:"strike",label:"S",title:"Strikethrough"},{mark:"subscript",label:"x₁",title:"Subscript"},{mark:"superscript",label:"x¹",title:"Superscript"}],fu=({active:e,onToggle:t,onLink:n,onUnlink:r,onInsertEmoji:i,onInsertMergeTag:s,mergeTagOptions:o,showLists:a=!0,showFontControls:l=!0,fontSize:d="16px",onFontSize:u,color:h="#14213d",onColor:p,disabled:m=!1,showAi:g=!1,onAi:b,aiBusy:A=!1,showFormatting:y=!0})=>{const[w,C]=v.useState(!1),[E,S]=v.useState(null),[k,I]=v.useState([]),L=v.useRef(null),R=v.useRef(null),[B,O]=v.useState(!1),[Y,Q]=v.useState(null),W=v.useRef(null),ie=v.useRef(null),J=()=>{var M;if(B){O(!1);return}const F=(M=W.current)==null?void 0:M.getBoundingClientRect();if(F){const ce=Math.max(8,Math.min(F.left,window.innerWidth-210-8));Q({top:F.bottom+6,left:ce})}O(!0)};v.useEffect(()=>{if(!B)return;const M=F=>{var ce,ve;const Ne=F.target;(ce=W.current)!=null&&ce.contains(Ne)||(ve=ie.current)!=null&&ve.contains(Ne)||O(!1)};return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[B]);const H=M=>F=>{F.preventDefault(),M()},te=()=>{var M;if(w){C(!1);return}const F=(M=L.current)==null?void 0:M.getBoundingClientRect();if(F){const ce=Math.max(8,Math.min(F.right-250,window.innerWidth-250-8));S({top:F.bottom+6,left:ce})}C(!0)},G=M=>{i(M),I(F=>[M,...F.filter(ce=>ce!==M)].slice(0,8)),C(!1)};return v.useEffect(()=>{if(!w)return;const M=F=>{var ce,ve;const Ne=F.target;(ce=L.current)!=null&&ce.contains(Ne)||(ve=R.current)!=null&&ve.contains(Ne)||C(!1)};return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[w]),c.jsxs("div",{className:"edm-richtext-toolbar",children:[g&&b&&c.jsx("div",{className:"edm-richtext-group edm-richtext-ai",children:c.jsxs("button",{ref:W,type:"button",className:"edm-richtext-button edm-richtext-ai-trigger",title:"Improve with AI","aria-label":"Improve with AI","aria-haspopup":"menu","aria-expanded":B,disabled:m||A,onClick:J,children:[c.jsx(ZH,{}),c.jsx("span",{children:A?"Improving…":"AI"})]})}),y&&c.jsx("div",{className:"edm-richtext-group",children:r5.map(M=>c.jsx("button",{type:"button",title:M.title,"aria-label":M.title,disabled:m,className:`edm-richtext-button${e[M.mark]?" is-active":""}`,onMouseDown:H(()=>t(M.mark)),children:M.label},M.mark))}),y&&a&&c.jsxs("div",{className:"edm-richtext-group",children:[c.jsx("button",{type:"button",title:"Bullet list","aria-label":"Bullet list",disabled:m,className:`edm-richtext-button${e.bulletList?" is-active":""}`,onMouseDown:H(()=>t("bulletList")),children:"Bullets"}),c.jsx("button",{type:"button",title:"Numbered list","aria-label":"Numbered list",disabled:m,className:`edm-richtext-button${e.orderedList?" is-active":""}`,onMouseDown:H(()=>t("orderedList")),children:"Numbers"})]}),y&&c.jsxs("div",{className:"edm-richtext-group",children:[c.jsx("button",{type:"button",title:"Link","aria-label":"Link",disabled:m,className:`edm-richtext-button edm-richtext-button--icon${e.link?" is-active":""}`,onMouseDown:H(n),children:c.jsx(t5,{})}),c.jsx("button",{type:"button",title:"Remove link","aria-label":"Remove link",disabled:m,className:"edm-richtext-button edm-richtext-button--icon",onMouseDown:H(r),children:c.jsx(n5,{})})]}),y&&l&&c.jsxs("div",{className:"edm-richtext-group",children:[c.jsx("select",{className:"edm-richtext-control",title:"Font size","aria-label":"Font size",disabled:m,value:d,onChange:M=>u==null?void 0:u(M.target.value),children:e5.map(M=>c.jsx("option",{value:M,children:parseInt(M,10)},M))}),c.jsx("input",{type:"color",className:"edm-richtext-control edm-richtext-color",title:"Text color","aria-label":"Text color",disabled:m,value:h,onChange:M=>p==null?void 0:p(M.target.value)})]}),y&&c.jsx("div",{className:"edm-richtext-group edm-emoji",children:c.jsx("button",{ref:L,type:"button",className:"edm-richtext-button edm-emoji-trigger",title:"Insert emoji","aria-label":"Insert emoji","aria-haspopup":"menu","aria-expanded":w,disabled:m,onClick:te,children:c.jsx("span",{"aria-hidden":"true",children:"😊"})})}),w&&E&&Ts.createPortal(c.jsxs("div",{ref:R,className:"edm-emoji-popover",role:"menu",style:{top:E.top,left:E.left},children:[k.length>0&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"edm-emoji-heading",children:"Recent"}),c.jsx("div",{className:"edm-emoji-grid",children:k.map(M=>c.jsx("button",{type:"button",className:"edm-emoji-item",onClick:()=>G(M),children:M},`recent-${M}`))})]}),c.jsx("div",{className:"edm-emoji-heading",children:"Emojis"}),c.jsx("div",{className:"edm-emoji-grid",children:XH.map(M=>c.jsx("button",{type:"button",className:"edm-emoji-item",onClick:()=>G(M),children:M},M))})]}),document.body),B&&Y&&b&&Ts.createPortal(c.jsxs("div",{ref:ie,className:"edm-ai-popover",role:"menu",style:{top:Y.top,left:Y.left},children:[c.jsx("div",{className:"edm-ai-heading",children:"Improve with AI"}),JH.map(M=>c.jsx("button",{type:"button",className:"edm-ai-item",role:"menuitem",onMouseDown:F=>{F.preventDefault(),O(!1),b(M.instruction)},children:M.label},M.label))]}),document.body),o.length>0&&c.jsx("div",{className:"edm-richtext-group edm-richtext-group-grow",children:c.jsxs("select",{className:"edm-richtext-control edm-merge-select",title:"Insert a merge tag","aria-label":"Insert a merge tag",disabled:m,value:"",onChange:M=>{const F=M.target.value;F&&s(F)},children:[c.jsx("option",{value:"",children:"Insert merge tag…"}),o.map(M=>c.jsx("option",{value:M.key,children:M.label},M.key))]})})]})},i5=20,cE=(e,t=0)=>{const n=[];return!e.children.length||t>i5||Array.from(e.children).forEach(r=>{r.tagName==="SPAN"?n.push(r):r.children.length&&n.push(...cE(r,t+1))}),n},s5=e=>{if(!e.children.length)return;const t=cE(e);t&&t.forEach(n=>{var r;const i=n.getAttribute("style"),s=(r=n.parentElement)===null||r===void 0||(r=r.closest("span"))===null||r===void 0?void 0:r.getAttribute("style");n.setAttribute("style",`${s};${i}`)})},Tf=Qr.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!0}},parseHTML(){return[{tag:"span",consuming:!1,getAttrs:e=>e.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&s5(e),{}):!1}]},renderHTML({HTMLAttributes:e}){return["span",Ut(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleTextStyle:e=>({commands:t})=>t.toggleMark(this.name,e),removeEmptyTextStyle:()=>({tr:e})=>{const{selection:t}=e;return e.doc.nodesBetween(t.from,t.to,(n,r)=>{if(!n.isInline)return!0;n.marks.filter(i=>i.type===this.type).some(i=>Object.values(i.attrs).some(s=>!!s))||e.removeMark(r,r+n.nodeSize,this.type)}),!0}}}}),o5=At.create({name:"backgroundColor",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:e=>{var t;const n=(t=El(e,"background-color"))!==null&&t!==void 0?t:e.style.backgroundColor;return n==null?void 0:n.replace(/['"]+/g,"")},renderHTML:e=>e.backgroundColor?{style:`background-color: ${e.backgroundColor}`}:{}}}}]},addCommands(){return{setBackgroundColor:e=>({chain:t})=>t().setMark("textStyle",{backgroundColor:e}).run(),unsetBackgroundColor:()=>({chain:e})=>e().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()}}}),dE=At.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:e=>{var t;const n=(t=El(e,"color"))!==null&&t!==void 0?t:e.style.color;return n==null?void 0:n.replace(/['"]+/g,"")},renderHTML:e=>e.color?{style:`color: ${e.color}`}:{}}}}]},addCommands(){return{setColor:e=>({chain:t})=>t().setMark("textStyle",{color:e}).run(),unsetColor:()=>({chain:e})=>e().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),a5=At.create({name:"fontFamily",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:e=>{var t;return(t=El(e,"font-family"))!==null&&t!==void 0?t:e.style.fontFamily},renderHTML:e=>e.fontFamily?{style:`font-family: ${e.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:e=>({chain:t})=>t().setMark("textStyle",{fontFamily:e}).run(),unsetFontFamily:()=>({chain:e})=>e().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}}),l5=At.create({name:"fontSize",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:e=>{var t;return(t=El(e,"font-size"))!==null&&t!==void 0?t:e.style.fontSize},renderHTML:e=>e.fontSize?{style:`font-size: ${e.fontSize}`}:{}}}}]},addCommands(){return{setFontSize:e=>({chain:t})=>t().setMark("textStyle",{fontSize:e}).run(),unsetFontSize:()=>({chain:e})=>e().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}),c5=At.create({name:"lineHeight",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:e=>{var t;return(t=El(e,"line-height"))!==null&&t!==void 0?t:e.style.lineHeight},renderHTML:e=>e.lineHeight?{style:`line-height: ${e.lineHeight}`}:{}}}}]},addCommands(){return{setLineHeight:e=>({chain:t})=>t().setMark("textStyle",{lineHeight:e}).run(),unsetLineHeight:()=>({chain:e})=>e().setMark("textStyle",{lineHeight:null}).removeEmptyTextStyle().run()}}});At.create({name:"textStyleKit",addExtensions(){const e=[];return this.options.backgroundColor!==!1&&e.push(o5.configure(this.options.backgroundColor)),this.options.color!==!1&&e.push(dE.configure(this.options.color)),this.options.fontFamily!==!1&&e.push(a5.configure(this.options.fontFamily)),this.options.fontSize!==!1&&e.push(l5.configure(this.options.fontSize)),this.options.lineHeight!==!1&&e.push(c5.configure(this.options.lineHeight)),this.options.textStyle!==!1&&e.push(Tf.configure(this.options.textStyle)),e}});var d5=dE;const u5="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",h5="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",nm="numeric",rm="ascii",im="alpha",Oa="asciinumeric",ga="alphanumeric",sm="domain",uE="emoji",p5="scheme",m5="slashscheme",Lh="whitespace";function f5(e,t){return e in t||(t[e]=[]),t[e]}function ws(e,t,n){t[nm]&&(t[Oa]=!0,t[ga]=!0),t[rm]&&(t[Oa]=!0,t[im]=!0),t[Oa]&&(t[ga]=!0),t[im]&&(t[ga]=!0),t[ga]&&(t[sm]=!0),t[uE]&&(t[sm]=!0);for(const r in t){const i=f5(r,n);i.indexOf(e)<0&&i.push(e)}}function g5(e,t){const n={};for(const r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function jn(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}jn.groups={};jn.prototype={accepts(){return!!this.t},go(e){const t=this,n=t.j[e];if(n)return n;for(let r=0;r<t.jr.length;r++){const i=t.jr[r][0],s=t.jr[r][1];if(s&&i.test(e))return s}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let i=0;i<e.length;i++)this.tt(e[i],t,n,r)},tr(e,t,n,r){r=r||jn.groups;let i;return t&&t.j?i=t:(i=new jn(t),n&&r&&ws(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this;const s=e.length;if(!s)return i;for(let o=0;o<s-1;o++)i=i.tt(e[o]);return i.tt(e[s-1],t,n,r)},tt(e,t,n,r){r=r||jn.groups;const i=this;if(t&&t.j)return i.j[e]=t,t;const s=t;let o,a=i.go(e);if(a?(o=new jn,Object.assign(o.j,a.j),o.jr.push.apply(o.jr,a.jr),o.jd=a.jd,o.t=a.t):o=new jn,s){if(r)if(o.t&&typeof o.t=="string"){const l=Object.assign(g5(o.t,r),n);ws(s,l,r)}else n&&ws(s,n,r);o.t=s}return i.j[e]=o,o}};const ze=(e,t,n,r,i)=>e.ta(t,n,r,i),Bt=(e,t,n,r,i)=>e.tr(t,n,r,i),Oy=(e,t,n,r,i)=>e.ts(t,n,r,i),re=(e,t,n,r,i)=>e.tt(t,n,r,i),ii="WORD",om="UWORD",hE="ASCIINUMERICAL",pE="ALPHANUMERICAL",sl="LOCALHOST",am="TLD",lm="UTLD",yc="SCHEME",mo="SLASH_SCHEME",Sf="NUM",cm="WS",_f="NL",Ra="OPENBRACE",La="CLOSEBRACE",od="OPENBRACKET",ad="CLOSEBRACKET",ld="OPENPAREN",cd="CLOSEPAREN",dd="OPENANGLEBRACKET",ud="CLOSEANGLEBRACKET",hd="FULLWIDTHLEFTPAREN",pd="FULLWIDTHRIGHTPAREN",md="LEFTCORNERBRACKET",fd="RIGHTCORNERBRACKET",gd="LEFTWHITECORNERBRACKET",Ad="RIGHTWHITECORNERBRACKET",bd="FULLWIDTHLESSTHAN",yd="FULLWIDTHGREATERTHAN",xd="AMPERSAND",vd="APOSTROPHE",wd="ASTERISK",Ii="AT",kd="BACKSLASH",Ed="BACKTICK",Cd="CARET",ks="COLON",Nf="COMMA",Td="DOLLAR",Rr="DOT",Sd="EQUALS",If="EXCLAMATION",tr="HYPHEN",ja="PERCENT",_d="PIPE",Nd="PLUS",Id="POUND",Ba="QUERY",Df="QUOTE",mE="FULLWIDTHMIDDLEDOT",Mf="SEMI",Lr="SLASH",Pa="TILDE",Dd="UNDERSCORE",fE="EMOJI",Md="SYM";var gE=Object.freeze({__proto__:null,ALPHANUMERICAL:pE,AMPERSAND:xd,APOSTROPHE:vd,ASCIINUMERICAL:hE,ASTERISK:wd,AT:Ii,BACKSLASH:kd,BACKTICK:Ed,CARET:Cd,CLOSEANGLEBRACKET:ud,CLOSEBRACE:La,CLOSEBRACKET:ad,CLOSEPAREN:cd,COLON:ks,COMMA:Nf,DOLLAR:Td,DOT:Rr,EMOJI:fE,EQUALS:Sd,EXCLAMATION:If,FULLWIDTHGREATERTHAN:yd,FULLWIDTHLEFTPAREN:hd,FULLWIDTHLESSTHAN:bd,FULLWIDTHMIDDLEDOT:mE,FULLWIDTHRIGHTPAREN:pd,HYPHEN:tr,LEFTCORNERBRACKET:md,LEFTWHITECORNERBRACKET:gd,LOCALHOST:sl,NL:_f,NUM:Sf,OPENANGLEBRACKET:dd,OPENBRACE:Ra,OPENBRACKET:od,OPENPAREN:ld,PERCENT:ja,PIPE:_d,PLUS:Nd,POUND:Id,QUERY:Ba,QUOTE:Df,RIGHTCORNERBRACKET:fd,RIGHTWHITECORNERBRACKET:Ad,SCHEME:yc,SEMI:Mf,SLASH:Lr,SLASH_SCHEME:mo,SYM:Md,TILDE:Pa,TLD:am,UNDERSCORE:Dd,UTLD:lm,UWORD:om,WORD:ii,WS:cm});const ei=/[a-z]/,la=new RegExp("\\p{L}","u"),jh=new RegExp("\\p{Emoji}","u"),ti=/\d/,Bh=/\s/,Ry="\r",Ph=`
|
|
242
|
+
`,A5="️",b5="",Fh="";let nc=null,rc=null;function y5(e=[]){const t={};jn.groups=t;const n=new jn;nc==null&&(nc=Ly(u5)),rc==null&&(rc=Ly(h5)),re(n,"'",vd),re(n,"{",Ra),re(n,"}",La),re(n,"[",od),re(n,"]",ad),re(n,"(",ld),re(n,")",cd),re(n,"<",dd),re(n,">",ud),re(n,"(",hd),re(n,")",pd),re(n,"「",md),re(n,"」",fd),re(n,"『",gd),re(n,"』",Ad),re(n,"<",bd),re(n,">",yd),re(n,"&",xd),re(n,"*",wd),re(n,"@",Ii),re(n,"`",Ed),re(n,"^",Cd),re(n,":",ks),re(n,",",Nf),re(n,"$",Td),re(n,".",Rr),re(n,"=",Sd),re(n,"!",If),re(n,"-",tr),re(n,"%",ja),re(n,"|",_d),re(n,"+",Nd),re(n,"#",Id),re(n,"?",Ba),re(n,'"',Df),re(n,"/",Lr),re(n,";",Mf),re(n,"~",Pa),re(n,"_",Dd),re(n,"\\",kd),re(n,"・",mE);const r=Bt(n,ti,Sf,{[nm]:!0});Bt(r,ti,r);const i=Bt(r,ei,hE,{[Oa]:!0}),s=Bt(r,la,pE,{[ga]:!0}),o=Bt(n,ei,ii,{[rm]:!0});Bt(o,ti,i),Bt(o,ei,o),Bt(i,ti,i),Bt(i,ei,i);const a=Bt(n,la,om,{[im]:!0});Bt(a,ei),Bt(a,ti,s),Bt(a,la,a),Bt(s,ti,s),Bt(s,ei),Bt(s,la,s);const l=re(n,Ph,_f,{[Lh]:!0}),d=re(n,Ry,cm,{[Lh]:!0}),u=Bt(n,Bh,cm,{[Lh]:!0});re(n,Fh,u),re(d,Ph,l),re(d,Fh,u),Bt(d,Bh,u),re(u,Ry),re(u,Ph),Bt(u,Bh,u),re(u,Fh,u);const h=Bt(n,jh,fE,{[uE]:!0});re(h,"#"),Bt(h,jh,h),re(h,A5,h);const p=re(h,b5);re(p,"#"),Bt(p,jh,h);const m=[[ei,o],[ti,i]],g=[[ei,null],[la,a],[ti,s]];for(let b=0;b<nc.length;b++)vi(n,nc[b],am,ii,m);for(let b=0;b<rc.length;b++)vi(n,rc[b],lm,om,g);ws(am,{tld:!0,ascii:!0},t),ws(lm,{utld:!0,alpha:!0},t),vi(n,"file",yc,ii,m),vi(n,"mailto",yc,ii,m),vi(n,"http",mo,ii,m),vi(n,"https",mo,ii,m),vi(n,"ftp",mo,ii,m),vi(n,"ftps",mo,ii,m),ws(yc,{scheme:!0,ascii:!0},t),ws(mo,{slashscheme:!0,ascii:!0},t),e=e.sort((b,A)=>b[0]>A[0]?1:-1);for(let b=0;b<e.length;b++){const A=e[b][0],y=e[b][1]?{[p5]:!0}:{[m5]:!0};A.indexOf("-")>=0?y[sm]=!0:ei.test(A)?ti.test(A)?y[Oa]=!0:y[rm]=!0:y[nm]=!0,Oy(n,A,A,y)}return Oy(n,"localhost",sl,{ascii:!0}),n.jd=new jn(Md),{start:n,tokens:Object.assign({groups:t},gE)}}function AE(e,t){const n=x5(t.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,i=[];let s=0,o=0;for(;o<r;){let a=e,l=null,d=0,u=null,h=-1,p=-1;for(;o<r&&(l=a.go(n[o]));)a=l,a.accepts()?(h=0,p=0,u=a):h>=0&&(h+=n[o].length,p++),d+=n[o].length,s+=n[o].length,o++;s-=h,o-=p,d-=h,i.push({t:u.t,v:t.slice(s-d,s),s:s-d,e:s})}return i}function x5(e){const t=[],n=e.length;let r=0;for(;r<n;){let i=e.charCodeAt(r),s,o=i<55296||i>56319||r+1===n||(s=e.charCodeAt(r+1))<56320||s>57343?e[r]:e.slice(r,r+2);t.push(o),r+=o.length}return t}function vi(e,t,n,r,i){let s;const o=t.length;for(let a=0;a<o-1;a++){const l=t[a];e.j[l]?s=e.j[l]:(s=new jn(r),s.jr=i.slice(),e.j[l]=s),e=s}return s=new jn(n),s.jr=i.slice(),e.j[t[o-1]]=s,s}function Ly(e){const t=[],n=[];let r=0,i="0123456789";for(;r<e.length;){let s=0;for(;i.indexOf(e[r+s])>=0;)s++;if(s>0){t.push(n.join(""));for(let o=parseInt(e.substring(r,r+s),10);o>0;o--)n.pop();r+=s}else n.push(e[r]),r++}return t}const ol={defaultProtocol:"http",events:null,format:jy,formatHref:jy,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Of(e,t=null){let n=Object.assign({},ol);e&&(n=Object.assign(n,e instanceof Of?e.o:e));const r=n.ignoreTags,i=[];for(let s=0;s<r.length;s++)i.push(r[s].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}Of.prototype={o:ol,ignoreTags:[],defaultRender(e){return e},check(e){return this.get("validate",e.toString(),e)},get(e,t,n){const r=t!=null;let i=this.o[e];return i&&(typeof i=="object"?(i=n.t in i?i[n.t]:ol[e],typeof i=="function"&&r&&(i=i(t,n))):typeof i=="function"&&r&&(i=i(t,n.t,n)),i)},getObj(e,t,n){let r=this.o[e];return typeof r=="function"&&t!=null&&(r=r(t,n.t,n)),r},render(e){const t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}};function jy(e){return e}function bE(e,t){this.t="token",this.v=e,this.tk=t}bE.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){const t=this.toString(),n=e.get("truncate",t,this),r=e.get("format",t,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=ol.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){const t=this,n=this.toHref(e.get("defaultProtocol")),r=e.get("formatHref",n,this),i=e.get("tagName",n,t),s=this.toFormattedString(e),o={},a=e.get("className",n,t),l=e.get("target",n,t),d=e.get("rel",n,t),u=e.getObj("attributes",n,t),h=e.getObj("events",n,t);return o.href=r,a&&(o.class=a),l&&(o.target=l),d&&(o.rel=d),u&&Object.assign(o,u),{tagName:i,attributes:o,content:s,eventListeners:h}}};function gu(e,t){class n extends bE{constructor(i,s){super(i,s),this.t=e}}for(const r in t)n.prototype[r]=t[r];return n.t=e,n}const v5=gu("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),By=gu("text"),w5=gu("nl"),ic=gu("url",{isLink:!0,toHref(e=ol.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){const e=this.tk;return e.length>=2&&e[0].t!==sl&&e[1].t===ks}}),Xn=e=>new jn(e);function k5({groups:e}){const t=e.domain.concat([xd,wd,Ii,kd,Ed,Cd,Td,Sd,tr,Sf,ja,_d,Nd,Id,Lr,Md,Pa,Dd]),n=[vd,ks,Nf,Rr,If,ja,Ba,Df,Mf,dd,ud,Ra,La,ad,od,ld,cd,hd,pd,md,fd,gd,Ad,bd,yd],r=[xd,vd,wd,kd,Ed,Cd,Td,Sd,tr,Ra,La,ja,_d,Nd,Id,Ba,Lr,Md,Pa,Dd],i=Xn(),s=re(i,Pa);ze(s,r,s),ze(s,e.domain,s);const o=Xn(),a=Xn(),l=Xn();ze(i,e.domain,o),ze(i,e.scheme,a),ze(i,e.slashscheme,l),ze(o,r,s),ze(o,e.domain,o);const d=re(o,Ii);re(s,Ii,d),re(a,Ii,d),re(l,Ii,d);const u=re(s,Rr);ze(u,r,s),ze(u,e.domain,s);const h=Xn();ze(d,e.domain,h),ze(h,e.domain,h);const p=re(h,Rr);ze(p,e.domain,h);const m=Xn(v5);ze(p,e.tld,m),ze(p,e.utld,m),re(d,sl,m);const g=re(h,tr);re(g,tr,g),ze(g,e.domain,h),ze(m,e.domain,h),re(m,Rr,p),re(m,tr,g);const b=re(o,tr),A=re(o,Rr);re(b,tr,b),ze(b,e.domain,o),ze(A,r,s),ze(A,e.domain,o);const y=Xn(ic);ze(A,e.tld,y),ze(A,e.utld,y),ze(y,e.domain,o),ze(y,r,s),re(y,Rr,A),re(y,tr,b),re(y,Ii,d);const w=re(y,ks),C=Xn(ic);ze(w,e.numeric,C);const E=Xn(ic),S=Xn();ze(E,t,E),ze(E,n,S),ze(S,t,E),ze(S,n,S),re(y,Lr,E),re(C,Lr,E);const k=re(a,ks),I=re(l,ks),L=re(I,Lr),R=re(L,Lr);ze(a,e.domain,o),re(a,Rr,A),re(a,tr,b),ze(l,e.domain,o),re(l,Rr,A),re(l,tr,b),ze(k,e.domain,E),re(k,Lr,E),re(k,Ba,E),ze(R,e.domain,E),ze(R,t,E),re(R,Lr,E);const B=[[Ra,La],[od,ad],[ld,cd],[dd,ud],[hd,pd],[md,fd],[gd,Ad],[bd,yd]];for(let O=0;O<B.length;O++){const[Y,Q]=B[O],W=re(E,Y);re(S,Y,W);const ie=Xn(ic);ze(W,t,ie);const J=Xn();ze(W,n,J),re(W,Q,E),ze(ie,t,ie),ze(ie,n,J),ze(J,t,ie),ze(J,n,J),re(ie,Q,E),re(J,Q,E)}return re(i,sl,y),re(i,_f,w5),{start:i,tokens:gE}}function E5(e,t,n){let r=n.length,i=0,s=[],o=[];for(;i<r;){let a=e,l=null,d=null,u=0,h=null,p=-1;for(;i<r&&!(l=a.go(n[i].t));)o.push(n[i++]);for(;i<r&&(d=l||a.go(n[i].t));)l=null,a=d,a.accepts()?(p=0,h=a):p>=0&&p++,i++,u++;if(p<0)i-=u,i<r&&(o.push(n[i]),i++);else{o.length>0&&(s.push($h(By,t,o)),o=[]),i-=p,u-=p;const m=h.t,g=n.slice(i-u,i);s.push($h(m,t,g))}}return o.length>0&&s.push($h(By,t,o)),s}function $h(e,t,n){const r=n[0].s,i=n[n.length-1].e,s=t.slice(r,i);return new e(s,n)}const C5=typeof console<"u"&&console&&console.warn||(()=>{}),T5="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Et={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function S5(){return jn.groups={},Et.scanner=null,Et.parser=null,Et.tokenQueue=[],Et.pluginQueue=[],Et.customSchemes=[],Et.initialized=!1,Et}function Py(e,t=!1){if(Et.initialized&&C5(`linkifyjs: already initialized - will not register custom scheme "${e}" ${T5}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw new Error(`linkifyjs: incorrect scheme format.
|
|
243
|
+
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
244
|
+
2. Cannot start or end with "-"
|
|
245
|
+
3. "-" cannot repeat`);Et.customSchemes.push([e,t])}function _5(){Et.scanner=y5(Et.customSchemes);for(let e=0;e<Et.tokenQueue.length;e++)Et.tokenQueue[e][1]({scanner:Et.scanner});Et.parser=k5(Et.scanner.tokens);for(let e=0;e<Et.pluginQueue.length;e++)Et.pluginQueue[e][1]({scanner:Et.scanner,parser:Et.parser});return Et.initialized=!0,Et}function Rf(e){return Et.initialized||_5(),E5(Et.parser.start,e,AE(Et.scanner.start,e))}Rf.scan=AE;function yE(e,t=null,n=null){if(t&&typeof t=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}const r=new Of(n),i=Rf(e),s=[];for(let o=0;o<i.length;o++){const a=i[o];a.isLink&&(!t||a.t===t)&&r.check(a)&&s.push(a.toFormattedObject(r))}return s}const Lf="[\0- -\u2029 ]",N5=new RegExp(Lf),I5=new RegExp(`${Lf}$`),D5=new RegExp(Lf,"g");function M5(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?["()","[]"].includes(e[0].value+e[2].value):!1}function O5(e){return new Ct({key:new zt("autolink"),appendTransaction:(t,n,r)=>{const i=t.some(l=>l.docChanged)&&!n.doc.eq(r.doc),s=t.some(l=>l.getMeta("preventAutolink"));if(!i||s)return;const{tr:o}=r,a=Ok(n.doc,[...t]);if(pu(a).forEach(({newRange:l})=>{const d=A4(r.doc,l,p=>p.isTextblock);let u,h;if(d.length>1)u=d[0],h=r.doc.textBetween(u.pos,u.pos+u.node.nodeSize,void 0," ");else if(d.length){const p=r.doc.textBetween(l.from,l.to," "," ");if(!I5.test(p))return;u=d[0],h=r.doc.textBetween(u.pos,l.to,void 0," ")}if(u&&h){const p=h.split(N5).filter(Boolean);if(p.length<=0)return!1;const m=p[p.length-1],g=u.pos+h.lastIndexOf(m);if(!m)return!1;const b=Rf(m).map(A=>A.toObject(e.defaultProtocol));if(!M5(b))return!1;b.filter(A=>A.isLink).map(A=>({...A,from:g+A.start+1,to:g+A.end+1})).filter(A=>r.schema.marks.code?!r.doc.rangeHasMark(A.from,A.to,r.schema.marks.code):!0).filter(A=>e.validate(A.value)).filter(A=>e.shouldAutoLink(A.value)).forEach(A=>{kf(A.from,A.to,r.doc).some(y=>y.mark.type===e.type)||o.addMark(A.from,A.to,e.type.create({href:A.href}))})}}),!!o.steps.length)return o}})}function R5(e){return new Ct({key:new zt("handleClickLink"),props:{handleClick:(t,n,r)=>{if(r.button!==0||!t.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{const l=r.target;if(!l)return!1;const d=e.editor.view.dom;i=l.closest("a"),i&&!d.contains(i)&&(i=null)}if(!i)return!1;let s=!1;if(e.enableClickSelection&&(s=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){var o,a;const l=Fk(t.state,e.type.name),d=(o=i.href)!==null&&o!==void 0?o:l.href,u=(a=i.target)!==null&&a!==void 0?a:l.target;d&&(window.open(d,u),s=!0)}return s}}})}const L5=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,j5=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function xE(e,t){let n=0;for(let r=t-1;r>=0&&e[r]==="\\";r-=1)n+=1;return n%2===1}function B5(e,t){let n=0,r=0;for(;r<t;){if(e[r]!=="`"){r+=1;continue}if(n===0&&xE(e,r)){r+=1;continue}let i=0;for(;r<t&&e[r]==="`";)i+=1,r+=1;n===0?n=i:i===n&&(n=0)}return n>0}function vE(e,t,n){var r,i;const[,s,o]=t;return(t.index?e[t.index-1]:void 0)==="!"||xE(e,(r=t.index)!==null&&r!==void 0?r:0)||B5(e,(i=t.index)!==null&&i!==void 0?i:0)?!1:!!s.trim()&&n(o)}function wE(e){var t,n;const[r,i,s,,o,a,l]=e,d=(t=o??a)!==null&&t!==void 0?t:l;return{index:(n=e.index)!==null&&n!==void 0?n:0,text:r,replaceWith:i,data:{href:s,title:d||null,markdown:!0}}}function P5(e,t){return e.index<t.index+t.text.length&&t.index<e.index+e.text.length}function kE(e){var t,n,r;return{href:(t=e.data)===null||t===void 0?void 0:t.href,title:(n=(r=e.data)===null||r===void 0?void 0:r.title)!==null&&n!==void 0?n:null}}function F5(e){const t=$s({find:n=>{const r=L5.exec(n);return!r||!vE(n,r,e.isAllowedHref)?null:wE(r)},type:e.type,getAttributes:kE});return new Cl({find:t.find,handler:n=>{const r=t.handler(n);return r!==null&&n.state.tr.steps.length&&n.state.tr.setMeta("preventAutolink",!0),r}})}function $5(e){const t=Ki({find:n=>{var r,i;const s=[];for(const a of n.matchAll(j5))vE(n,a,e.isAllowedHref)&&s.push(wE(a));const o=((r=(i=e.findPlainUrls)===null||i===void 0?void 0:i.call(e,n))!==null&&r!==void 0?r:[]).filter(a=>!s.some(l=>P5(l,a)));return[...s,...o]},type:e.type,getAttributes:kE});return new Xk({find:t.find,handler:n=>{var r;const i=t.handler(n);return i!==null&&n.state.tr.steps.length&&!((r=n.match.data)===null||r===void 0)&&r.markdown&&n.state.tr.setMeta("preventAutolink",!0),i}})}function H5(e){return new Ct({key:new zt("handlePasteLink"),props:{handlePaste:(t,n,r)=>{const{shouldAutoLink:i}=e,{state:s}=t,{selection:o}=s,{empty:a}=o;if(a)return!1;let l="";r.content.forEach(u=>{l+=u.textContent});const d=yE(l,{defaultProtocol:e.defaultProtocol}).find(u=>u.isLink&&u.value===l);return!l||!d||i!==void 0&&!i(d.value)?!1:e.editor.commands.setMark(e.type,{href:d.href})}}})}function ni(e,t){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&n.push(i)}),!e||e.replace(D5,"").match(new RegExp(`^(?:(?:${n.map(r=>r.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|")}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,"i"))}const EE=Qr.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e=="string"){Py(e);return}Py(e.scheme,e.optionalSlashes)})},onDestroy(){S5()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,markdownLinks:!1,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!ni(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{const t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes("@"))return!0;const r=(e.includes("@")?e.split("@").pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}}},addAttributes(){var e,t,n;return{href:{default:null,parseHTML(r){return r.getAttribute("href")}},target:{default:(e=this.options.HTMLAttributes.target)!==null&&e!==void 0?e:null},rel:{default:(t=this.options.HTMLAttributes.rel)!==null&&t!==void 0?t:null},class:{default:(n=this.options.HTMLAttributes.class)!==null&&n!==void 0?n:null},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{const t=e.getAttribute("href");return!t||!this.options.isAllowedUri(t,{defaultValidate:n=>!!ni(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:t=>!!ni(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Ut(this.options.HTMLAttributes,e),0]:["a",Ut(this.options.HTMLAttributes,{...e,href:""}),0]},markdownTokenName:"link",parseMarkdown:(e,t)=>t.applyMark("link",t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{var n,r,i,s;const o=(n=(r=e.attrs)===null||r===void 0?void 0:r.href)!==null&&n!==void 0?n:"",a=(i=(s=e.attrs)===null||s===void 0?void 0:s.title)!==null&&i!==void 0?i:"",l=t.renderChildren(e);return a?`[${l}](${o} "${a}")`:`[${l}](${o})`},addCommands(){return{setLink:e=>({chain:t})=>{const{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:r=>!!ni(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta("preventAutolink",!0).run():!1},toggleLink:e=>({chain:t})=>{const{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:r=>!!ni(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addInputRules(){return this.options.markdownLinks?[F5({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:t=>!!ni(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})})]:[]},addPasteRules(){const e=t=>{const n=[];if(t){const{protocols:r,defaultProtocol:i}=this.options;yE(t).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:o=>!!ni(o,r),protocols:r,defaultProtocol:i})).forEach(s=>{this.options.shouldAutoLink(s.value)&&n.push({text:s.value,data:{href:s.href},index:s.start})})}return n};return this.options.markdownLinks?[$5({type:this.type,isAllowedHref:t=>this.options.isAllowedUri(t,{defaultValidate:n=>!!ni(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:e})]:[Ki({find:e,type:this.type,getAttributes:t=>{var n;return{href:(n=t.data)===null||n===void 0?void 0:n.href}}})]},addProseMirrorPlugins(){const e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(O5({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!ni(i,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(R5({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(H5({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}});var U5=EE;const CE=new WeakSet,TE=new WeakSet;function hs(e){const t=e;return CE.add(t),t}function dm(e){return Array.isArray(e)&&CE.has(e)}function SE(e){return e.flatMap(t=>t==null?[]:Array.isArray(t)&&TE.has(t)&&!dm(t)?SE(t):[t])}function G5(e,t){if(e==="slot")return 0;if(e instanceof Function){const i=e(t);return Array.isArray(i)&&!dm(i)&&!TE.has(i)?hs(i):i}const{children:n,...r}=t??{};if(e==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");if(Array.isArray(n)){if(dm(n))return hs([e,r,n]);if(n.length===0)return hs([e,r]);const i=SE(n);return i.length===0?hs([e,r]):hs([e,r,...i])}return n!=null?hs([e,r,n]):hs([e,r])}const Od=(e,t)=>G5(e,t),W5=(e,t)=>{var n;const{state:r}=e,{selection:i}=r;if(!i.empty)return!1;const{$from:s}=i;if(s.parentOffset!==0)return!1;const o=s.depth-1;if(o<0)return!1;const a=s.node(o),l=s.index(o);if(l===0)return!1;if(a.type===t)return e.commands.lift(t.name);const d=a.child(l-1);if(d.type!==t||!(!((n=d.lastChild)===null||n===void 0)&&n.isTextblock))return!1;const u=s.before()-1-1;return e.commands.command(({tr:h,dispatch:p})=>{if(!p)return!0;const m=s.parent.content,g=new Ae(m,0,0);return h.replace(u,s.after(),g),h.setSelection(De.create(h.doc,u+m.size)),h.scrollIntoView(),p(h),!0})},Y5=/^\s*>\s$/,z5=Fn.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:e}){return Od("blockquote",{...Ut(this.options.HTMLAttributes,e),children:Od("slot",{})})},parseMarkdown:(e,t)=>{var n;const r=(n=t.parseBlockChildren)!==null&&n!==void 0?n:t.parseChildren;return t.createNode("blockquote",void 0,r(e.tokens||[]))},renderMarkdown:(e,t)=>{if(!e.content)return"";const n=">",r=[];return e.content.forEach((i,s)=>{var o,a;const l=((o=(a=t.renderChild)===null||a===void 0?void 0:a.call(t,i,s))!==null&&o!==void 0?o:t.renderChildren([i])).split(`
|
|
246
|
+
`).map(d=>d.trim()===""?n:`${n} ${d}`);r.push(l.join(`
|
|
247
|
+
`))}),r.join(`
|
|
248
|
+
${n}
|
|
249
|
+
`)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>W5(this.editor,this.type)}},addInputRules(){return[Ro({find:Y5,type:this.type})]}}),K5=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Q5=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,V5=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,q5=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,J5=Qr.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return Od("strong",{...Ut(this.options.HTMLAttributes,e),children:Od("slot",{})})},markdownTokenName:"strong",parseMarkdown:(e,t)=>t.applyMark("bold",t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[$s({find:K5,type:this.type}),$s({find:V5,type:this.type})]},addPasteRules(){return[Ki({find:Q5,type:this.type}),Ki({find:q5,type:this.type})]}}),Z5=e=>{const t=/`([^`]+)`(?!`)$/.exec(e);return!t||t.index>0&&e[t.index-1]==="`"?null:{index:t.index,text:t[0],replaceWith:t[1]}},X5=e=>{const t=/`([^`]+)`(?!`)/g,n=[];let r;for(;(r=t.exec(e))!==null;)r.index>0&&e[r.index-1]==="`"||n.push({index:r.index,text:r[0],replaceWith:r[1]});return n},eU=Qr.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:e}){return["code",Ut(this.options.HTMLAttributes,e),0]},markdownTokenName:"codespan",parseMarkdown:(e,t)=>t.applyMark("code",[{type:"text",text:e.text||""}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:"",addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[$s({find:Z5,type:this.type})]},addPasteRules(){return[Ki({find:X5,type:this.type})]}}),Hh=4,tU=/^```([a-z]+)?[\s\n]$/,nU=/^~~~([a-z]+)?[\s\n]$/,rU=Fn.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:Hh,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options;return n&&[...((t=e.firstElementChild)===null||t===void 0?void 0:t.classList)||[]].filter(i=>i.startsWith(n)).map(i=>i.replace(n,""))[0]||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:e,HTMLAttributes:t}){return["pre",Ut(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(e,t)=>{var n,r;return((n=e.raw)===null||n===void 0?void 0:n.startsWith("```"))===!1&&((r=e.raw)===null||r===void 0?void 0:r.startsWith("~~~"))===!1&&e.codeBlockStyle!=="indented"?[]:t.createNode("codeBlock",{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[])},renderMarkdown:(e,t)=>{var n;let r="";const i=((n=e.attrs)===null||n===void 0?void 0:n.language)||"";return e.content?r=[`\`\`\`${i}`,t.renderChildren(e.content),"```"].join(`
|
|
250
|
+
`):r=`\`\`\`${i}
|
|
251
|
+
|
|
252
|
+
\`\`\``,r},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;const n=(t=this.options.tabSize)!==null&&t!==void 0?t:Hh,{state:r}=e,{selection:i}=r,{$from:s,empty:o}=i;if(s.parent.type!==this.type)return!1;const a=" ".repeat(n);return o?e.commands.insertContent(a):e.commands.command(({tr:l})=>{const{from:d,to:u}=i,h=r.doc.textBetween(d,u,`
|
|
253
|
+
`,`
|
|
254
|
+
`).split(`
|
|
255
|
+
`).map(p=>a+p).join(`
|
|
256
|
+
`);return l.replaceWith(d,u,r.schema.text(h)),!0})},"Shift-Tab":({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;const n=(t=this.options.tabSize)!==null&&t!==void 0?t:Hh,{state:r}=e,{selection:i}=r,{$from:s,empty:o}=i;return s.parent.type!==this.type?!1:o?e.commands.command(({tr:a})=>{var l;const{pos:d}=s,u=s.start(),h=s.end(),p=r.doc.textBetween(u,h,`
|
|
257
|
+
`,`
|
|
258
|
+
`).split(`
|
|
259
|
+
`);let m=0,g=0;const b=d-u;for(let C=0;C<p.length;C+=1){if(g+p[C].length>=b){m=C;break}g+=p[C].length+1}const A=((l=p[m].match(/^ */))===null||l===void 0?void 0:l[0])||"",y=Math.min(A.length,n);if(y===0)return!0;let w=u;for(let C=0;C<m;C+=1)w+=p[C].length+1;return a.delete(w,w+y),d-w<=y&&a.setSelection(De.create(a.doc,w)),!0}):e.commands.command(({tr:a})=>{const{from:l,to:d}=i,u=r.doc.textBetween(l,d,`
|
|
260
|
+
`,`
|
|
261
|
+
`).split(`
|
|
262
|
+
`).map(h=>{var p;const m=((p=h.match(/^ */))===null||p===void 0?void 0:p[0])||"",g=Math.min(m.length,n);return h.slice(g)}).join(`
|
|
263
|
+
`);return a.replaceWith(l,d,r.schema.text(u)),!0})},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const s=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(`
|
|
264
|
+
|
|
265
|
+
`);return!s||!o?!1:e.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowUp:({editor:e})=>{if(!this.options.exitOnArrowUp)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type||r.parentOffset!==0)return!1;const s=r.before();return s>0?!1:e.commands.insertDefaultBlock({pos:s})},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:s}=n;if(!s||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;const o=i.after();return o===void 0?!1:r.nodeAt(o)?e.commands.command(({tr:a})=>(a.setSelection(Ge.near(r.resolve(o))),!0)):e.commands.exitCode()}}},addInputRules(){return[tm({find:tU,type:this.type,getAttributes:e=>({language:e[1]})}),tm({find:nU,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new Ct({key:new zt("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,s=i==null?void 0:i.mode;if(!n||!s)return!1;const{tr:o,schema:a}=e.state,l=a.text(n.replace(/\r\n?/g,`
|
|
266
|
+
`));return o.replaceSelectionWith(this.type.create({language:s},l)),o.selection.$from.parent.type!==this.type&&o.setSelection(De.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),e.dispatch(o),!0}}})]}}),iU=Fn.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
267
|
+
|
|
268
|
+
`):""}),sU=Fn.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",Ut(this.options.HTMLAttributes,e)]},renderText(){return`
|
|
269
|
+
`},renderMarkdown:()=>`
|
|
270
|
+
`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:i,storedMarks:s}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:a}=r.extensionManager,l=s||i.$to.parentOffset&&i.$from.marks();return t().insertContent({type:this.name}).command(({tr:d,dispatch:u})=>{if(u&&l&&o){const h=l.filter(p=>a.includes(p.type.name));d.ensureMarks(h)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),oU=Fn.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,Ut(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode("heading",{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{var n;const r=!((n=e.attrs)===null||n===void 0)&&n.level?parseInt(e.attrs.level,10):1,i="#".repeat(r);return e.content?`${i} ${t.renderChildren(e.content)}`:""},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,"paragraph",e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>tm({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),aU=Fn.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:e}){return["hr",Ut(this.options.HTMLAttributes,e)]},markdownTokenName:"hr",parseMarkdown:(e,t)=>t.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!v$(t,t.schema.nodes[this.name]))return!1;const{selection:n}=t,{$to:r}=n,i=e();return $k(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:s,tr:o,dispatch:a})=>{if(a){const{$to:l}=o.selection,d=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?o.setSelection(De.create(o.doc,l.pos+1)):l.nodeAfter.isBlock?o.setSelection(_e.create(o.doc,l.pos)):o.setSelection(De.create(o.doc,l.pos));else{const u=s.schema.nodes[this.options.nextNodeType]||l.parent.type.contentMatch.defaultType,h=u==null?void 0:u.create();h&&(o.insert(d,h),o.setSelection(De.create(o.doc,d+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[K$({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),lU=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,cU=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,dU=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,uU=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,hU=Qr.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>e.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",Ut(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(e,t)=>t.applyMark("italic",t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[$s({find:lU,type:this.type}),$s({find:dU,type:this.type})]},addPasteRules(){return[Ki({find:cU,type:this.type}),Ki({find:uU,type:this.type})]}}),pU="listItem",Fy="textStyle",$y=/^\s*([-+*])\s$/,_E=Fn.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",Ut(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>e.type!=="list"||e.ordered?[]:{type:"bulletList",content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
271
|
+
`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(pU,this.editor.getAttributes(Fy)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=Ro({find:$y,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Ro({find:$y,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Fy),editor:this.editor})),[e]}}),mU=(e,t,n)=>{const{selection:r}=e;if(!r.empty)return null;const{$from:i}=r;if(!i.parent.isTextblock||i.parentOffset!==i.parent.content.size)return null;let s=-1;for(let m=i.depth;m>0;m-=1)if(i.node(m).type.name===t){s=m;break}if(s<0)return null;const o=i.node(s),a=i.index(s);if(a+1>=o.childCount)return null;const l=o.child(a+1);if(!n.includes(l.type.name))return null;const d=e.schema.nodes[t];let u=!1;if(l.forEach(m=>{m.type===d&&m.childCount>1&&(u=!0)}),!u)return null;const h=e.doc.resolve(i.after()).nodeAfter;if(!h||!n.includes(h.type.name))return null;const p=[];return h.forEach(m=>{p.push(m)}),p.length===0?null:{listItemDepth:s,nestedList:h,nestedListPos:i.after(),insertPos:i.after(s),items:p}},fU=(e,t,n,r)=>{const i=mU(e,n,r);if(!i)return!1;const{selection:s}=e,{nestedList:o,nestedListPos:a,insertPos:l,items:d}=i,u=e.tr;u.delete(a,a+o.nodeSize);const h=u.mapping.map(l);return u.insert(h,V.from(d)),u.setSelection(s.map(u.doc,u.mapping)),t&&t(u),!0},gU=(e,t,n)=>fU(e.state,e.view.dispatch,t,n),NE=(e,t)=>At.create({name:`${e}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){const n=()=>gU(this.editor,e,t);return{Delete:n,"Mod-Delete":n}}}),IE=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]],sc="abcdefghijklmnopqrstuvwxyz",DE=String.raw`\d+|[ivxlcdmIVXLCDM]+|${"[a-zA-Z]{1,2}"}`;function Au(e){let t=e,n="";for(const[r,i]of IE)for(;t>=r;)n+=i,t-=r;return n}function jf(e){return Au(e).toUpperCase()}function ME(e){const t=e.toLowerCase();let n=0,r=0;for(;n<t.length;){let i=!1;for(const[s,o]of IE)if(t.startsWith(o,n)){r+=s,n+=o.length,i=!0;break}if(!i)return 0}return r}function AU(e){if(!/^[ivxlcdmIVXLCDM]+$/.test(e))return!1;const t=ME(e);return t<=0?!1:(e===e.toLowerCase()?Au(t):jf(t))===e}function bU(e){const t=e.toLowerCase();if(t.length===1)return t.charCodeAt(0)-97+1;if(t.length===2){const n=t.charCodeAt(0)-97,r=t.charCodeAt(1)-97;return(n+1)*26+r+1}return 0}function Rd(e){if(e<=26)return sc[e-1];const t=Math.floor((e-1)/26)-1,n=(e-1)%26;return t<0?sc[n]:sc[t]+sc[n]}function bu(e){if(!(!e||/^\d+$/.test(e))){if(AU(e))return e===e.toLowerCase()?"i":"I";if(/^[a-z]{1,2}$/.test(e))return"a";if(/^[A-Z]{1,2}$/.test(e))return"A"}}function Bf(e){if(/^\d+$/.test(e))return parseInt(e,10);const t=bu(e);if(t==="i"||t==="I")return ME(e);if(t==="a"||t==="A"){const r=bU(e);return r>0?r:1}const n=parseInt(e,10);return Number.isNaN(n)?1:n}function yU(e,t){if(e==="numeric")return String(t);switch(e){case"a":return Rd(t);case"A":return Rd(t).toUpperCase();case"i":return Au(t);case"I":return jf(t);default:return String(t)}}function xU(e){var t;if(e.length===0)return!1;const n=(t=bu(e[0]))!==null&&t!==void 0?t:"numeric",r=Bf(e[0]);if(r<1)return!1;for(let i=0;i<e.length;i++){const s=yU(n,r+i);if(e[i]!==s)return!1}return!0}function vU(e){return{type:bu(e),start:Bf(e)}}function wU(e){const{type:t,start:n}=vU(e),r={};return t&&(r.type=t),n!==1&&(r.start=n),r}function kU(e,t,n=". "){const r=t+1;if(!e||e==="1")return`${r}${n}`;switch(e){case"a":return`${Rd(r)}${n}`;case"A":return`${Rd(r).toUpperCase()}${n}`;case"i":return`${Au(r)}${n}`;case"I":return`${jf(r)}${n}`;default:return`${r}${n}`}}function EU(e){var t,n;const r=(t=e.tokens)===null||t===void 0?void 0:t[0];return!!(e.text&&((n=e.tokens)===null||n===void 0?void 0:n.length)===1&&(r==null?void 0:r.type)==="list"&&r.ordered&&r.raw===e.text)}function CU(e,t){return t.tokenizeInline?t.parseInline(t.tokenizeInline(e)):t.parseInline([{type:"text",raw:e,text:e}])}const OE=Fn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",Ut(this.options.HTMLAttributes,e),0]},markdownTokenName:"list_item",parseMarkdown:(e,t)=>{var n;if(e.type!=="list_item")return[];const r=(n=t.parseBlockChildren)!==null&&n!==void 0?n:t.parseChildren;let i=[];if(e.tokens&&e.tokens.length>0){if(EU(e))return{type:"listItem",content:[{type:"paragraph",content:CU(e.text||"",t)}]};if(e.tokens.some(s=>s.type==="paragraph"))i=r(e.tokens);else{const s=e.tokens[0];if(s&&s.type==="text"&&s.tokens&&s.tokens.length>0){if(i=[{type:"paragraph",content:t.parseInline(s.tokens)}],e.tokens.length>1){const o=r(e.tokens.slice(1));i.push(...o)}}else i=r(e.tokens)}}return i.length===0&&(i=[{type:"paragraph",content:[]}]),{type:"listItem",content:i}},renderMarkdown:(e,t,n)=>qk(e,t,r=>{if(r.parentType==="bulletList")return"- ";if(r.parentType==="orderedList"){var i,s;const o=((i=r.meta)===null||i===void 0||(i=i.parentAttrs)===null||i===void 0?void 0:i.start)||1;return kU((s=r.meta)===null||s===void 0||(s=s.parentAttrs)===null||s===void 0?void 0:s.type,o-1+(r.index||0),". ")}return"- "},n,{alignNestedToPrefix:(n==null?void 0:n.parentType)==="orderedList"}),addExtensions(){return[NE(this.name,[this.options.bulletListTypeName,this.options.orderedListTypeName])]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Pf=(e,t)=>{const{$from:n}=t.selection,r=qt(e,t.schema);let i=null,s=n.depth,o=n.pos,a=null;for(;s>0&&a===null;)i=n.node(s),i.type===r?a=s:(s-=1,o-=1);return a===null?null:{$pos:t.doc.resolve(o),depth:a}},RE=(e,t)=>{const n=Pf(e,t);if(!n)return!1;const[,r]=_4(t,e,n.$pos.pos+4);return r},TU=(e,t,n)=>{const{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),s=e.doc.resolve(i).node();return!(!s||!n.includes(s.type.name))},Hy=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!gi(e.state,t)&&TU(e.state,t,n)){const{$anchor:s}=e.state.selection,o=e.state.doc.resolve(s.before()-1),a=[];o.node().descendants((u,h)=>{u.type.name===t&&a.push({node:u,pos:h})});const l=a.at(-1);if(!l)return!1;const d=e.state.doc.resolve(o.start()+l.pos+1);return e.chain().cut({from:s.start()-1,to:s.end()+1},d.end()).joinForward().run()}if(!gi(e.state,t)||!O4(e.state))return!1;const{$from:r}=e.state.selection,i=r.depth-1;return r.node(i).type!==e.schema.nodes[t]||r.index(i)!==0?!1:e.chain().liftListItem(t).run()},SU=(e,t)=>{const n=RE(e,t),r=Pf(e,t);return!r||!n?!1:n>r.depth},_U=(e,t)=>{const n=RE(e,t),r=Pf(e,t);return!r||!n?!1:n<r.depth},Uy=(e,t)=>{if(!gi(e.state,t)||!M4(e.state,t))return!1;const{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:SU(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():_U(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},NU=(e,t,n)=>{const{state:r}=e,{selection:i}=r;if(!i.empty)return!1;const{$from:s}=i;if(s.parentOffset!==0||!s.parent.isTextblock||gi(r,t))return!1;const o=N4(s);if(!o||!n.includes(o.type.name))return!1;const a=o.lastChild;if(!a||a.type.name!==t)return!1;const l=s.parent;if(!a.canReplace(a.childCount,a.childCount,V.from(l)))return!1;const d=s.before(),u=s.after(),h=d-2;return e.commands.command(({tr:p,dispatch:m})=>(m&&(p.delete(d,u).insert(h,V.from(l)),p.setSelection(De.create(p.doc,h+1)),p.scrollIntoView()),!0))},LE=At.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&Uy(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&Uy(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&Hy(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&Hy(e,n,r)&&(t=!0)}),t},Tab:({editor:e})=>{for(const{itemName:t,wrapperNames:n}of this.options.listTypes)if(e.state.schema.nodes[t]!==void 0&&NU(e,t,n))return!0;return!1}}}}),um=new RegExp(`^(\\s*)(${DE})([.)])\\s+(.*)$`),IU=/^\s/,fo={heading:/^#{1,6}(?:\s|$)/,bulletItem:/^[-+*]\s+/,codeFence:/^(?:```|~~~)/,blockMath:/^\$\$/,thematicBreak:/^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/};function DU(e){return um.test(e.trimStart())}function MU(e){const t=e.trimStart();return fo.bulletItem.test(t)||DU(t)||fo.heading.test(t)||fo.thematicBreak.test(t)&&!t.startsWith("-")||/^>\s?/.test(t)||fo.codeFence.test(t)||fo.blockMath.test(t)}function OU(e){return Object.values(fo).some(t=>t.test(e))}function RU(e){const t=[],n=[];let r=!1;return e.forEach(i=>{if(r){n.push(i);return}if(i.trim()===""){r=!0,n.push(i);return}if(t.length>0&&MU(i)){r=!0,n.push(i);return}t.push(i)}),{paragraphLines:t,blockLines:n}}function LU(e){const t=[];let n=0,r=0;for(;n<e.length;){const i=e[n],s=i.match(um);if(!s)break;const[,o,a,l,d]=s,u=o.length,h=parseInt(a,10),p=isNaN(h)?bu(a):void 0,m=isNaN(h)?Bf(a):h,g=[d];let b=n+1;const A=[i];let y=!1;for(;b<e.length;){const w=e[b];if(w.match(um))break;if(w.trim()==="")A.push(w),g.push(""),y=!0,b+=1;else if(w.match(IU)){const C=w.length-w.trimStart().length,E=u+a.length+1;A.push(w),g.push(w.slice(Math.min(C,E))),b+=1}else{if(y||OU(w))break;A.push(w),g.push(w),b+=1}}t.push({indent:u,number:m,type:p,content:g.join(`
|
|
272
|
+
`).trim(),contentLines:g,raw:A.join(`
|
|
273
|
+
`)}),r=b,n=b}return[t,r]}const jU=new RegExp(`^(${DE})([.)])\\s+(.+)$`);function BU(e){const t=e.split(`
|
|
274
|
+
`).filter(r=>r.trim().length>0);if(t.length===0)return null;const n=[];for(const r of t){const i=r.trim().match(jU);if(!i)return null;n.push({marker:i[1],content:i[3]})}return xU(n.map(r=>r.marker))?{type:"orderedList",attrs:wU(n[0].marker),content:n.map(r=>({type:"listItem",content:[{type:"paragraph",content:[{type:"text",text:r.content}]}]}))}:null}function jE(e,t,n){const r=[];let i=0;for(;i<e.length;){const s=e[i];if(s.indent===t){const{paragraphLines:o,blockLines:a}=RU(s.contentLines),l=o.join(`
|
|
275
|
+
`).trim(),d=[];l&&d.push({type:"paragraph",raw:l,tokens:n.inlineTokens(l)});const u=a.join(`
|
|
276
|
+
`).trim();if(u){const m=n.blockTokens(u);d.push(...m)}let h=i+1;const p=[];for(;h<e.length&&e[h].indent>t;)p.push(e[h]),h+=1;if(p.length>0){const m=jE(p,Math.min(...p.map(g=>g.indent)),n);d.push({type:"list",ordered:!0,start:p[0].number,typeMarker:p[0].type,items:m,raw:p.map(g=>g.raw).join(`
|
|
277
|
+
`)})}r.push({type:"list_item",raw:s.raw,tokens:d}),i=h}else i+=1}return r}function PU(e,t){return e.map(n=>{if(n.type!=="list_item")return t.parseChildren([n])[0];const r=[];return n.tokens&&n.tokens.length>0&&n.tokens.forEach(i=>{if(i.type==="paragraph"||i.type==="list"||i.type==="blockquote"||i.type==="code")r.push(...t.parseChildren([i]));else if(i.type==="text"&&i.tokens){const s=t.parseChildren([i]);r.push({type:"paragraph",content:s})}else{const s=t.parseChildren([i]);s.length>0&&r.push(...s)}}),{type:"listItem",content:r}})}const FU="listItem",Gy="textStyle",Wy=/^(\d+)\.\s$/;function Yy(e){const t=e.match(/list-style-type\s*:\s*([^;]+)/i);if(!t)return null;switch(t[1].trim().toLowerCase()){case"upper-roman":return"I";case"lower-roman":return"i";case"upper-alpha":case"upper-latin":return"A";case"lower-alpha":case"lower-latin":return"a";default:return null}}const BE=Fn.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:null,parseHTML:e=>{const t=e.getAttribute("type");if(t)return t;const n=e.getAttribute("style");if(n){const i=Yy(n);if(i)return i}const r=e.querySelector("li");if(r){const i=r.getAttribute("style");if(i){const s=Yy(i);if(s)return s}}return null}}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:e}){const{start:t,type:n,...r}=e,i=Ut(this.options.HTMLAttributes,r);return t!==1&&(i.start=t),n&&n!=="1"&&(i.type=n),["ol",i,0]},markdownTokenName:"list",parseMarkdown:(e,t)=>{if(e.type!=="list"||!e.ordered)return[];const n=e.start||1,r=e.typeMarker,i=e.items?PU(e.items,t):[],s={};return n!==1&&(s.start=n),r&&(s.type=r),Object.keys(s).length>0?{type:"orderedList",attrs:s,content:i}:{type:"orderedList",content:i}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
278
|
+
`):"",markdownTokenizer:{name:"orderedList",level:"block",start:()=>-1,tokenize:(e,t,n)=>{var r,i;const s=e.split(`
|
|
279
|
+
`),[o,a]=LU(s);if(o.length===0)return;const l=jE(o,o[0].indent,n);if(l.length!==0)return{type:"list",ordered:!0,start:((r=o[0])===null||r===void 0?void 0:r.number)||1,typeMarker:(i=o[0])===null||i===void 0?void 0:i.type,items:l,raw:s.slice(0,a).join(`
|
|
280
|
+
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(FU,this.editor.getAttributes(Gy)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new Ct({props:{handlePaste:(e,t)=>{var n,r;const i=(n=t.clipboardData)===null||n===void 0?void 0:n.getData("text/html");if(i!=null&&i.trim())return!1;const s=(r=t.clipboardData)===null||r===void 0?void 0:r.getData("text/plain");if(!s)return!1;const o=BU(s);if(!o)return!1;try{const a=e.state.schema.nodeFromJSON(o),l=e.state.tr.replaceSelectionWith(a);return e.dispatch(l),!0}catch{return!1}}}})]},addInputRules(){const e=(n,r)=>(!r.attrs.type||r.attrs.type==="1")&&r.childCount+r.attrs.start===+n[1];let t=Ro({find:Wy,type:this.type,getAttributes:n=>({start:+n[1]}),joinPredicate:e});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Ro({find:Wy,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:n=>({start:+n[1],...this.editor.getAttributes(Gy)}),joinPredicate:e,editor:this.editor})),[t]}}),$U=/^\s*(\[([( |x])?\])\s$/,HU="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0",UU=(e,t,n)=>{var r;return(n==null||(r=n.checkboxLabel)===null||r===void 0?void 0:r.call(n,e,t))||`Task item checkbox for ${e.textContent||"empty task item"}`},GU=Fn.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{const t=e.getAttribute("data-checked");return t===""||t==="true"},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51,contentElement:e=>{var t;return(t=e.querySelector("div"))!==null&&t!==void 0?t:e}}]},renderHTML({node:e,HTMLAttributes:t}){return["li",Ut(this.options.HTMLAttributes,t,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:e.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(e,t)=>{const n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode("paragraph",{},t.parseInline(e.tokens))):e.text?n.push(t.createNode("paragraph",{},[t.createNode("text",{text:e.text})])):n.push(t.createNode("paragraph",{},[])),e.nestedTokens&&e.nestedTokens.length>0){const r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode("taskItem",{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>{var n;const r=`- [${!((n=e.attrs)===null||n===void 0)&&n.checked?"x":" "}] `;return qk(e,t,r)},addExtensions(){return this.options.nested?[NE(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){const e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{const i=document.createElement("li"),s=document.createElement("label"),o=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div");o.style.cssText=HU;const d=h=>{const p=UU(h,h.attrs.checked,this.options.a11y);a.setAttribute("aria-label",p),o.textContent=p};d(e),s.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",h=>h.preventDefault()),a.addEventListener("change",h=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:p}=h.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:m})=>{const g=n();if(typeof g!="number")return!1;const b=m.doc.nodeAt(g);return m.setNodeMarkup(g,void 0,{...b==null?void 0:b.attrs,checked:p}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,p)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([h,p])=>{i.setAttribute(h,p)}),i.dataset.checked=e.attrs.checked,a.checked=e.attrs.checked,s.append(a,o),i.append(s,l),Object.entries(t).forEach(([h,p])=>{i.setAttribute(h,p)});let u=new Set(Object.keys(t));return{dom:i,contentDOM:l,update:h=>{if(h.type!==this.type)return!1;i.dataset.checked=h.attrs.checked,a.checked=h.attrs.checked,d(h);const p=r.extensionManager.attributes,m=il(h,p),g=new Set(Object.keys(m)),b=this.options.HTMLAttributes;return u.forEach(A=>{g.has(A)||(A in b?i.setAttribute(A,b[A]):i.removeAttribute(A))}),Object.entries(m).forEach(([A,y])=>{y==null?A in b?i.setAttribute(A,b[A]):i.removeAttribute(A):i.setAttribute(A,y)}),u=g,!0}}}},addInputRules(){return[Ro({find:$U,type:this.type,getAttributes:e=>({checked:e[e.length-1]==="x"})})]}}),WU=Fn.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return["ul",Ut(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode("taskList",{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
281
|
+
`):"",markdownTokenizer:{name:"taskList",level:"block",start(e){var t;const n=(t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))===null||t===void 0?void 0:t.index;return n!==void 0?n:-1},tokenize(e,t,n){const r=s=>{const o=yy(s,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:a=>({indentLevel:a[1].length,mainContent:a[4],checked:a[3].toLowerCase()==="x"}),createToken:(a,l)=>({type:"taskItem",raw:"",mainContent:a.mainContent,indentLevel:a.indentLevel,checked:a.checked,text:a.mainContent,tokens:n.inlineTokens(a.mainContent),nestedTokens:l}),customNestedParser:r},n);if(o){const a={type:"taskList",raw:o.raw,items:o.items},l=s.slice(o.raw.length);return l.trim()?[a,...n.blockTokens(l)]:[a]}return n.blockTokens(s)},i=yy(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:s=>({indentLevel:s[1].length,mainContent:s[4],checked:s[3].toLowerCase()==="x"}),createToken:(s,o)=>({type:"taskItem",raw:"",mainContent:s.mainContent,indentLevel:s.indentLevel,checked:s.checked,text:s.mainContent,tokens:n.inlineTokens(s.mainContent),nestedTokens:o}),customNestedParser:r},n);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});At.create({name:"listKit",addExtensions(){const e=[];return this.options.bulletList!==!1&&e.push(_E.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(OE.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(LE.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(BE.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(GU.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(WU.configure(this.options.taskList)),e}});const oc=" ",Uh=" ",YU=Fn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",Ut(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{const n=e.tokens||[];if(n.length===1&&n[0].type==="image")return t.parseChildren([n[0]]);const r=t.parseInline(n);return n.length===1&&n[0].type==="text"&&(n[0].raw===oc||n[0].text===oc||n[0].raw===Uh||n[0].text===Uh)&&r.length===1&&r[0].type==="text"&&(r[0].text===oc||r[0].text===Uh)?t.createNode("paragraph",void 0,[]):t.createNode("paragraph",void 0,r)},renderMarkdown:(e,t,n)=>{if(!e)return"";const r=Array.isArray(e.content)?e.content:[];if(r.length===0){var i,s;const o=Array.isArray(n==null||(i=n.previousNode)===null||i===void 0?void 0:i.content)?n.previousNode.content:[];return(n==null||(s=n.previousNode)===null||s===void 0?void 0:s.type)==="paragraph"&&o.length===0?oc:""}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),zU=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,KU=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,QU=Qr.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["s",Ut(this.options.HTMLAttributes,e),0]},markdownTokenName:"del",parseMarkdown:(e,t)=>t.applyMark("strike",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[$s({find:zU,type:this.type})]},addPasteRules(){return[Ki({find:KU,type:this.type})]}}),VU=Fn.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""}),PE=Qr.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["u",Ut(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||"underline",t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:"underline",level:"inline",start(e){return e.indexOf("++")},tokenize(e,t,n){const r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;const i=r[2].trim();return{type:"underline",raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});var qU=PE;function JU(e={}){return new Ct({view(t){return new ZU(t,e)}})}class ZU{constructor(t,n){var r;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let s=o=>{this[i](o)};return t.dom.addEventListener(i,s),{name:i,handler:s}})}destroy(){this.handlers.forEach(({name:t,handler:n})=>this.editorView.dom.removeEventListener(t,n))}update(t,n){this.cursorPos!=null&&n.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,t==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent,r,i=this.editorView.dom,s=i.getBoundingClientRect(),o=s.width/i.offsetWidth,a=s.height/i.offsetHeight;if(n){let h=t.nodeBefore,p=t.nodeAfter;if(h||p){let m=this.editorView.nodeDOM(this.cursorPos-(h?h.nodeSize:0));if(m){let g=m.getBoundingClientRect(),b=h?g.bottom:g.top;h&&p&&(b=(b+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let A=this.width/2*a;r={left:g.left,right:g.right,top:b-A,bottom:b+A}}}}if(!r){let h=this.editorView.coordsAtPos(this.cursorPos),p=this.width/2*o;r={left:h.left-p,right:h.left+p,top:h.top,bottom:h.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let d,u;if(!l||l==document.body&&getComputedStyle(l).position=="static")d=-pageXOffset,u=-pageYOffset;else{let h=l.getBoundingClientRect(),p=h.width/l.offsetWidth,m=h.height/l.offsetHeight;d=h.left-l.scrollLeft*p,u=h.top-l.scrollTop*m}this.element.style.left=(r.left-d)/o+"px",this.element.style.top=(r.top-u)/a+"px",this.element.style.width=(r.right-r.left)/o+"px",this.element.style.height=(r.bottom-r.top)/a+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),t)}dragover(t){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,s=typeof i=="function"?i(this.editorView,n,t):i;if(n&&!s){let o=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=bw(this.editorView.state.doc,o,this.editorView.dragging.slice);a!=null&&(o=a)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}}class Pt extends Ge{constructor(t){super(t,t)}map(t,n){let r=t.resolve(n.map(this.head));return Pt.valid(r)?new Pt(r):Ge.near(r)}content(){return Ae.empty}eq(t){return t instanceof Pt&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Pt(t.resolve(n.pos))}getBookmark(){return new Ff(this.anchor)}static valid(t){let n=t.parent;if(n.inlineContent||!XU(t)||!e6(t))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(t.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(t,n,r=!1){e:for(;;){if(!r&&Pt.valid(t))return t;let i=t.pos,s=null;for(let o=t.depth;;o--){let a=t.node(o);if(n>0?t.indexAfter(o)<a.childCount:t.index(o)>0){s=a.child(n>0?t.indexAfter(o):t.index(o)-1);break}else if(o==0)return null;i+=n;let l=t.doc.resolve(i);if(Pt.valid(l))return l}for(;;){let o=n>0?s.firstChild:s.lastChild;if(!o){if(s.isAtom&&!s.isText&&!_e.isSelectable(s)){t=t.doc.resolve(i+s.nodeSize*n),r=!1;continue e}break}s=o,i+=n;let a=t.doc.resolve(i);if(Pt.valid(a))return a}return null}}}Pt.prototype.visible=!1;Pt.findFrom=Pt.findGapCursorFrom;Ge.jsonID("gapcursor",Pt);class Ff{constructor(t){this.pos=t}map(t){return new Ff(t.map(this.pos))}resolve(t){let n=t.resolve(this.pos);return Pt.valid(n)?new Pt(n):Ge.near(n)}}function FE(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function XU(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||FE(i.type))return!0;if(i.inlineContent)return!1}}return!0}function e6(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||FE(i.type))return!0;if(i.inlineContent)return!1}}return!0}function t6(){return new Ct({props:{decorations:s6,createSelectionBetween(e,t,n){return t.pos==n.pos&&Pt.valid(n)?new Pt(n):null},handleClick:r6,handleKeyDown:n6,handleDOMEvents:{beforeinput:i6}}})}const n6=wk({ArrowLeft:ac("horiz",-1),ArrowRight:ac("horiz",1),ArrowUp:ac("vert",-1),ArrowDown:ac("vert",1)});function ac(e,t){const n=e=="vert"?t>0?"down":"up":t>0?"right":"left";return function(r,i,s){let o=r.selection,a=t>0?o.$to:o.$from,l=o.empty;if(o instanceof De){if(!s.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(t>0?a.after():a.before())}let d=Pt.findGapCursorFrom(a,t,l);return d?(i&&i(r.tr.setSelection(new Pt(d))),!0):!1}}function r6(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!Pt.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&_e.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new Pt(r))),!0)}function i6(e,t){if(t.inputType!="insertCompositionText"||!(e.state.selection instanceof Pt))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=V.empty;for(let o=r.length-1;o>=0;o--)i=V.from(r[o].createAndFill(null,i));let s=e.state.tr.replace(n.pos,n.pos,new Ae(i,0,0));return s.setSelection(De.near(s.doc.resolve(n.pos+1))),e.dispatch(s),!1}function s6(e){if(!(e.selection instanceof Pt))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",ot.create(e.doc,[En.widget(e.selection.head,t,{key:"gapcursor"})])}var Ld=200,sn=function(){};sn.prototype.append=function(e){return e.length?(e=sn.from(e),!this.length&&e||e.length<Ld&&this.leafAppend(e)||this.length<Ld&&e.leafPrepend(this)||this.appendInner(e)):this};sn.prototype.prepend=function(e){return e.length?sn.from(e).append(this):this};sn.prototype.appendInner=function(e){return new o6(this,e)};sn.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?sn.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))};sn.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};sn.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)};sn.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(i,s){return r.push(e(i,s))},t,n),r};sn.from=function(e){return e instanceof sn?e:e&&e.length?new $E(e):sn.empty};var $E=(function(e){function t(r){e.call(this),this.values=r}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(r,i){return r==0&&i==this.length?this:new t(this.values.slice(r,i))},t.prototype.getInner=function(r){return this.values[r]},t.prototype.forEachInner=function(r,i,s,o){for(var a=i;a<s;a++)if(r(this.values[a],o+a)===!1)return!1},t.prototype.forEachInvertedInner=function(r,i,s,o){for(var a=i-1;a>=s;a--)if(r(this.values[a],o+a)===!1)return!1},t.prototype.leafAppend=function(r){if(this.length+r.length<=Ld)return new t(this.values.concat(r.flatten()))},t.prototype.leafPrepend=function(r){if(this.length+r.length<=Ld)return new t(r.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t})(sn);sn.empty=new $E([]);var o6=(function(e){function t(n,r){e.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(n){return n<this.left.length?this.left.get(n):this.right.get(n-this.left.length)},t.prototype.forEachInner=function(n,r,i,s){var o=this.left.length;if(r<o&&this.left.forEachInner(n,r,Math.min(i,o),s)===!1||i>o&&this.right.forEachInner(n,Math.max(r-o,0),Math.min(this.length,i)-o,s+o)===!1)return!1},t.prototype.forEachInvertedInner=function(n,r,i,s){var o=this.left.length;if(r>o&&this.right.forEachInvertedInner(n,r-o,Math.max(i,o)-o,s+o)===!1||i<o&&this.left.forEachInvertedInner(n,Math.min(r,o),i,s)===!1)return!1},t.prototype.sliceInner=function(n,r){if(n==0&&r==this.length)return this;var i=this.left.length;return r<=i?this.left.slice(n,r):n>=i?this.right.slice(n-i,r-i):this.left.slice(n,i).append(this.right.slice(0,r-i))},t.prototype.leafAppend=function(n){var r=this.right.leafAppend(n);if(r)return new t(this.left,r)},t.prototype.leafPrepend=function(n){var r=this.left.leafPrepend(n);if(r)return new t(r,this.right)},t.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new t(this.left,new t(this.right,n)):new t(this,n)},t})(sn);const a6=500;class Er{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,s;n&&(i=this.remapping(r,this.items.length),s=i.maps.length);let o=t.tr,a,l,d=[],u=[];return this.items.forEach((h,p)=>{if(!h.step){i||(i=this.remapping(r,p+1),s=i.maps.length),s--,u.push(h);return}if(i){u.push(new jr(h.map));let m=h.step.map(i.slice(s)),g;m&&o.maybeStep(m).doc&&(g=o.mapping.maps[o.mapping.maps.length-1],d.push(new jr(g,void 0,void 0,d.length+u.length))),s--,g&&i.appendMap(g,s)}else o.maybeStep(h.step);if(h.selection)return a=i?h.selection.map(i.slice(s)):h.selection,l=new Er(this.items.slice(0,r).append(u.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:o,selection:a}}addTransform(t,n,r,i){let s=[],o=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let u=0;u<t.steps.length;u++){let h=t.steps[u].invert(t.docs[u]),p=new jr(t.mapping.maps[u],h,n),m;(m=l&&l.merge(p))&&(p=m,u?s.pop():a=a.slice(0,a.length-1)),s.push(p),n&&(o++,n=void 0),i||(l=p)}let d=o-r.depth;return d>c6&&(a=l6(a,d),o-=d),new Er(a.append(s),o)}remapping(t,n){let r=new Xa;return this.items.forEach((i,s)=>{let o=i.mirrorOffset!=null&&s-i.mirrorOffset>=t?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,o)},t,n),r}addMaps(t){return this.eventCount==0?this:new Er(this.items.append(t.map(n=>new jr(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),s=t.mapping,o=t.steps.length,a=this.eventCount;this.items.forEach(p=>{p.selection&&a--},i);let l=n;this.items.forEach(p=>{let m=s.getMirror(--l);if(m==null)return;o=Math.min(o,m);let g=s.maps[m];if(p.step){let b=t.steps[m].invert(t.docs[m]),A=p.selection&&p.selection.map(s.slice(l+1,m));A&&a++,r.push(new jr(g,b,A))}else r.push(new jr(g))},i);let d=[];for(let p=n;p<o;p++)d.push(new jr(s.maps[p]));let u=this.items.slice(0,i).append(d).append(r),h=new Er(u,a);return h.emptyItemCount()>a6&&(h=h.compress(this.items.length-r.length)),h}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],s=0;return this.items.forEach((o,a)=>{if(a>=t)i.push(o),o.selection&&s++;else if(o.step){let l=o.step.map(n.slice(r)),d=l&&l.getMap();if(r--,d&&n.appendMap(d,r),l){let u=o.selection&&o.selection.map(n.slice(r));u&&s++;let h=new jr(d.invert(),l,u),p,m=i.length-1;(p=i.length&&i[m].merge(h))?i[m]=p:i.push(h)}}else o.map&&r--},this.items.length,0),new Er(sn.from(i.reverse()),s)}}Er.empty=new Er(sn.empty,0);function l6(e,t){let n;return e.forEach((r,i)=>{if(r.selection&&t--==0)return n=i,!1}),e.slice(n)}class jr{constructor(t,n,r,i){this.map=t,this.step=n,this.selection=r,this.mirrorOffset=i}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new jr(n.getMap().invert(),n,this.selection)}}}class Di{constructor(t,n,r,i,s){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=s}}const c6=20;function d6(e,t,n,r){let i=n.getMeta(Os),s;if(i)return i.historyState;n.getMeta(p6)&&(e=new Di(e.done,e.undone,null,0,-1));let o=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(o&&o.getMeta(Os))return o.getMeta(Os).redo?new Di(e.done.addTransform(n,void 0,r,xc(t)),e.undone,zy(n.mapping.maps),e.prevTime,e.prevComposition):new Di(e.done,e.undone.addTransform(n,void 0,r,xc(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=e.prevTime==0||!o&&e.prevComposition!=a&&(e.prevTime<(n.time||0)-r.newGroupDelay||!u6(n,e.prevRanges)),d=o?Gh(e.prevRanges,n.mapping):zy(n.mapping.maps);return new Di(e.done.addTransform(n,l?t.selection.getBookmark():void 0,r,xc(t)),Er.empty,d,n.time,a??e.prevComposition)}else return(s=n.getMeta("rebased"))?new Di(e.done.rebased(n,s),e.undone.rebased(n,s),Gh(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Di(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Gh(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function u6(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((r,i)=>{for(let s=0;s<t.length;s+=2)r<=t[s+1]&&i>=t[s]&&(n=!0)}),n}function zy(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((r,i,s,o)=>t.push(s,o));return t}function Gh(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),s=t.map(e[r+1],-1);i<=s&&n.push(i,s)}return n}function h6(e,t,n){let r=xc(t),i=Os.get(t).spec.config,s=(n?e.undone:e.done).popEvent(t,r);if(!s)return null;let o=s.selection.resolve(s.transform.doc),a=(n?e.done:e.undone).addTransform(s.transform,t.selection.getBookmark(),i,r),l=new Di(n?a:s.remaining,n?s.remaining:a,null,0,-1);return s.transform.setSelection(o).setMeta(Os,{redo:n,historyState:l})}let Wh=!1,Ky=null;function xc(e){let t=e.plugins;if(Ky!=t){Wh=!1,Ky=t;for(let n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){Wh=!0;break}}return Wh}const Os=new zt("history"),p6=new zt("closeHistory");function m6(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Ct({key:Os,state:{init(){return new Di(Er.empty,Er.empty,null,0,-1)},apply(t,n,r){return d6(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(t,n){let r=n.inputType,i=r=="historyUndo"?UE:r=="historyRedo"?GE:null;return!i||!t.editable?!1:(n.preventDefault(),i(t.state,t.dispatch))}}}})}function HE(e,t){return(n,r)=>{let i=Os.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let s=h6(i,n,e);s&&r(s.scrollIntoView())}return!0}}const UE=HE(!1),GE=HE(!0);At.create({name:"characterCount",addOptions(){return{limit:null,autoTrim:!0,mode:"textSize",textCounter:e=>e.length,wordCounter:e=>e.split(" ").filter(t=>t!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{const t=(e==null?void 0:e.node)||this.editor.state.doc;if(((e==null?void 0:e.mode)||this.options.mode)==="textSize"){const n=t.textBetween(0,t.content.size,void 0," ");return this.options.textCounter(n)}return t.nodeSize},this.storage.words=e=>{const t=(e==null?void 0:e.node)||this.editor.state.doc,n=t.textBetween(0,t.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new Ct({key:new zt("characterCount"),appendTransaction:(t,n,r)=>{if(e)return;const i=this.options.limit,s=this.options.autoTrim;if(i==null||i===0||s===!1){e=!0;return}const o=this.storage.characters({node:r.doc});if(o>i){const a=o-i,l=0,d=a;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const u=r.tr.deleteRange(l,d);return e=!0,u}e=!0},filterTransaction:(t,n)=>{const r=this.options.limit;if(!t.docChanged||r===0||r===null||r===void 0)return!0;const i=this.storage.characters({node:n.doc}),s=this.storage.characters({node:t.doc});if(s<=r||i>r&&s>r&&s<=i)return!0;if(i>r&&s>r&&s>i||!t.getMeta("paste"))return!1;const o=t.selection.$head.pos,a=o-(s-r),l=o;return t.deleteRange(a,l),!(this.storage.characters({node:t.doc})>r)}})]}});const f6=At.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[JU(this.options)]}});At.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new Ct({key:new zt("focus"),props:{decorations:({doc:e,selection:t})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,s=[];if(!n||!r)return ot.create(e,[]);let o=0;this.options.mode==="deepest"&&e.descendants((l,d)=>{if(!l.isText){if(!(i>=d&&i<=d+l.nodeSize-1))return!1;o+=1}});let a=0;return e.descendants((l,d)=>{if(l.isText||!(i>=d&&i<=d+l.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&o-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";s.push(En.node(d,d+l.nodeSize,{class:this.options.className}))}),ot.create(e,s)}}})]}});const g6=At.create({name:"gapCursor",addProseMirrorPlugins(){return[t6()]},extendNodeSchema(e){var t;const n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:(t=ut(Se(e,"allowGapCursor",n)))!==null&&t!==void 0?t:null}}}),WE="placeholder",Qy=new zt("tiptap__placeholder");function YE(e){const{editor:t,placeholder:n,dataAttribute:r,pos:i,node:s,isEmptyDoc:o,hasAnchor:a,classes:{emptyNode:l,emptyEditor:d}}=e,u=[l];return o&&u.push(d),En.node(i,i+s.nodeSize,{class:u.join(" "),[r]:typeof n=="function"?n({editor:t,node:s,pos:i,hasAnchor:a}):n})}function zE(e,t){return typeof e=="function"?e(t):e}function KE({editor:e,options:t,dataAttribute:n,doc:r,selection:i,from:s,to:o}){const{anchor:a}=i,l=[],d=e.isEmpty;return r.nodesBetween(s,o,(u,h)=>{const p=a>=h&&a<=h+u.nodeSize,m=!u.isLeaf&&kl(u);return u.type.isTextblock&&(p||!t.showOnlyCurrent)&&m&&l.push(YE({editor:e,isEmptyDoc:d,dataAttribute:n,hasAnchor:p,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:zE(t.emptyNodeClass,{editor:e,node:u,pos:h,hasAnchor:p})},node:u,pos:h})),t.includeChildren}),l}function QE({editor:e,options:t,dataAttribute:n,doc:r,selection:i}){if(!(e.isEditable||!t.showOnlyWhenEditable))return null;const{anchor:s}=i,o=[],a=e.isEmpty;if(t.showOnlyCurrent&&!t.includeChildren){const l=r.resolve(s),d=l.depth>0?l.node(1):l.nodeAfter,u=l.depth>0?l.before(1):s;if(d&&d.type.isTextblock&&kl(d)){const h=s>=u&&s<=u+d.nodeSize;o.push(YE({editor:e,isEmptyDoc:a,dataAttribute:n,hasAnchor:h,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:zE(t.emptyNodeClass,{editor:e,node:d,pos:u,hasAnchor:h})},node:d,pos:u}))}}else o.push(...KE({editor:e,options:t,dataAttribute:n,doc:r,selection:i,from:0,to:r.content.size}));return ot.create(r,o)}function Fa(e,t){const n=e.resolve(t);if(n.depth===0){var r;const s=(r=n.nodeAfter)!==null&&r!==void 0?r:n.nodeBefore;if(!s)return{from:t,to:t};const o=n.nodeAfter?t:t-s.nodeSize;return{from:o,to:o+s.nodeSize}}const i=n.before(1);return{from:i,to:i+n.node(1).nodeSize}}function $a(e,t){return{from:Math.max(0,t.from-1),to:Math.min(e.content.size,t.to-1)}}function A6(e,t,n){const r=[];return e.forEach((i,s)=>{const o=s,a=o+i.nodeSize,l=o+1,d=a+1;l<n&&d>t&&r.push({from:o,to:a})}),r}function b6(e){if(e.length===0)return[];const t=[...e].sort((r,i)=>r.from-i.from),n=[{...t[0]}];for(let r=1;r<t.length;r+=1){const i=n[n.length-1],s=t[r];s.from<=i.to?i.to=Math.max(i.to,s.to):n.push({...s})}return n}function y6(e,t){const n=A6(e,t.from,t.to);return n.push($a(e,Fa(e,t.from))),t.to>t.from?n.push($a(e,Fa(e,Math.min(t.to,e.content.size+1)-1))):t.from<e.content.size+1&&n.push($a(e,Fa(e,Math.min(t.from+1,e.content.size)))),n}function x6(e,t,n){const r=[];if(e.docChanged){const i=pu(e);for(const s of i)r.push(...y6(n.doc,s.newRange))}return e.selectionSet&&(r.push($a(n.doc,Fa(n.doc,e.mapping.map(t.selection.anchor)))),r.push($a(n.doc,Fa(n.doc,n.selection.anchor)))),b6(r)}function v6(e,t,n){const r=Math.max(0,Math.min(e,n.content.size));return{from:r,to:Math.max(r,Math.min(t,n.content.size))}}function w6({decorations:e,ranges:t,editor:n,options:r,dataAttribute:i,doc:s,selection:o}){let a=e;for(const l of t){const{from:d,to:u}=v6(l.from,l.to,s),h=a.find(d,u).filter(m=>m.from>=d&&m.to<=u);h.length&&(a=a.remove(h));const p=KE({editor:n,options:r,dataAttribute:i,doc:s,selection:o,from:d,to:u});p.length&&(a=a.add(s,p))}return a}function k6({editor:e,options:t,dataAttribute:n}){return{init(r,i){return QE({editor:e,options:t,dataAttribute:n,doc:i.doc,selection:i.selection})??ot.empty},apply(r,i,s,o){return!r.docChanged&&!r.selectionSet?i:w6({decorations:i.map(r.mapping,r.doc),ranges:x6(r,s,o),editor:e,options:t,dataAttribute:n,doc:o.doc,selection:o.selection})}}}function E6(e){return e.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}function C6({editor:e,options:t}){const n=t.dataAttribute?`data-${E6(t.dataAttribute)}`:`data-${WE}`,r=t.showOnlyCurrent&&!t.includeChildren;return new Ct({key:Qy,...r?{}:{state:k6({editor:e,options:t,dataAttribute:n})},props:{decorations:r?({doc:i,selection:s})=>QE({editor:e,options:t,dataAttribute:n,doc:i,selection:s}):i=>{var s;return t.showOnlyWhenEditable&&!e.isEditable?ot.empty:(s=Qy.getState(i))!==null&&s!==void 0?s:ot.empty}}})}At.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:WE,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[C6({editor:this.editor,options:this.options})]}});function hm(e,t){return!e.selection.empty&&!$k(e.selection)&&t.isEditable}function T6(e,t){return hm(e,t)&&!t.isFocused&&!t.view.dragging}function S6(){var e;(e=window.getSelection())===null||e===void 0||e.removeAllRanges()}function _6(e){e.focus()}At.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:e,options:t}=this;return[new Ct({key:new zt("selection"),props:{decorations(n){return T6(n,e)?ot.create(n.doc,[En.inline(n.selection.from,n.selection.to,{class:t.className})]):null},handleDOMEvents:{blur(n){return hm(n.state,e)&&S6(),!1},focus(n){return hm(n.state,e)&&requestAnimationFrame(()=>{!e.isDestroyed&&n.hasFocus()&&_6(n)}),!1}}}})]}});function Vy({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||(t==null?void 0:t.type)===e}const N6=At.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var e;const t=new zt(this.name),n=this.options.node||((e=this.editor.schema.topNodeType.contentMatch.defaultType)===null||e===void 0?void 0:e.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,i])=>i).filter(i=>(this.options.notAfter||[]).concat(n).includes(i.name));return[new Ct({key:t,appendTransaction:(i,s,o)=>{const{doc:a,tr:l,schema:d}=o,u=t.getState(o),h=a.content.size,p=d.nodes[n];if(!i.some(m=>m.getMeta("skipTrailingNode"))&&u)return l.insert(h,p.create())},state:{init:(i,s)=>{const o=s.tr.doc.lastChild;return!Vy({node:o,types:r})},apply:(i,s)=>{if(!i.docChanged||i.getMeta("__uniqueIDTransaction"))return s;const o=i.doc.lastChild;return!Vy({node:o,types:r})}}})]}}),I6=At.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>UE(e,t),redo:()=>({state:e,dispatch:t})=>GE(e,t)}},addProseMirrorPlugins(){return[m6(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),D6=At.create({name:"starterKit",addExtensions(){const e=[];if(this.options.bold!==!1&&e.push(J5.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(z5.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(_E.configure(this.options.bulletList)),this.options.code!==!1&&e.push(eU.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(rU.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(iU.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(f6.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(g6.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(sU.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(oU.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(I6.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(aU.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(hU.configure(this.options.italic)),this.options.listItem!==!1&&e.push(OE.configure(this.options.listItem)),this.options.listKeymap!==!1){var t;e.push(LE.configure((t=this.options)===null||t===void 0?void 0:t.listKeymap))}if(this.options.link!==!1){var n;e.push(EE.configure((n=this.options)===null||n===void 0?void 0:n.link))}if(this.options.orderedList!==!1&&e.push(BE.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(YU.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(QU.configure(this.options.strike)),this.options.text!==!1&&e.push(VU.configure(this.options.text)),this.options.underline!==!1){var r;e.push(PE.configure((r=this.options)===null||r===void 0?void 0:r.underline))}if(this.options.trailingNode!==!1){var i;e.push(N6.configure((i=this.options)===null||i===void 0?void 0:i.trailingNode))}return e}});var M6=D6;const O6=Tf.extend({addGlobalAttributes(){return[{types:["textStyle"],attributes:{fontSize:{default:null,parseHTML:e=>e.style.fontSize||null,renderHTML:e=>e.fontSize?{style:`font-size: ${e.fontSize}`}:{}}}}]}}),R6=Fn.create({name:"mergeTag",group:"inline",inline:!0,atom:!0,selectable:!0,addAttributes(){return{key:{default:"",parseHTML:e=>e.getAttribute("data-merge-tag")||"",renderHTML:()=>({})},label:{default:"",parseHTML:e=>e.getAttribute("data-merge-label")||"",renderHTML:()=>({})},value:{default:"",parseHTML:e=>e.textContent||"",renderHTML:()=>({})}}},parseHTML(){return[{tag:"span[data-merge-tag]"}]},renderHTML({node:e,HTMLAttributes:t}){const n=String(e.attrs.key??""),r=String(e.attrs.value||(n?`{{${n}}}`:""));return["span",Ut(t,{"data-merge-tag":n,"data-merge-label":String(e.attrs.label??n),class:"edm-merge-tag-chip"}),r]},addCommands(){return{insertMergeTag:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}}}),L6=Qr.create({name:"subscript",parseHTML(){return[{tag:"sub"}]},renderHTML({HTMLAttributes:e}){return["sub",e,0]},addCommands(){return{toggleSubscript:()=>({commands:e})=>(e.unsetMark("superscript"),e.toggleMark(this.name))}}}),j6=Qr.create({name:"superscript",parseHTML(){return[{tag:"sup"}]},renderHTML({HTMLAttributes:e}){return["sup",e,0]},addCommands(){return{toggleSuperscript:()=>({commands:e})=>(e.unsetMark("subscript"),e.toggleMark(this.name))}}}),qy=({value:e,mergeTags:t,variant:n="panel",mode:r="text",onChange:i,onAiRewrite:s})=>{const[o,a]=v.useState(!1),l=v.useMemo(()=>Object.entries(t??{}).map(([A,y])=>({key:A,label:y.label,value:y.value})),[t]),d=KH({extensions:[M6.configure({heading:!1}),U5.configure({openOnClick:!1,autolink:!0,defaultProtocol:"https"}),qU,Tf,O6,d5,R6,L6,j6],content:e,immediatelyRender:!1,onUpdate:({editor:A})=>{i(A.getHTML())},editorProps:{attributes:{class:"edm-richtext-editor"}}});v.useEffect(()=>{if(!d)return;const A=e||"<p></p>";d.getHTML()!==A&&d.commands.setContent(A,{emitUpdate:!1})},[d,e]);const u=()=>{if(!d)return;const A=d.getAttributes("link").href,y=window.prompt("Enter a link URL",A??"https://");if(y!==null){if(y.trim()===""){d.chain().focus().unsetLink().run();return}d.chain().focus().extendMarkRange("link").setLink({href:y}).run()}},h=A=>{if(!d)return;const y=l.find(w=>w.key===A);y&&d.chain().focus().insertMergeTag({key:y.key,label:y.label,value:y.value}).insertContent(" ").run()},p=async A=>{if(!d||!s||o)return;const{from:y,to:w,empty:C}=d.state.selection;let E;if(!C&&typeof window<"u"){const S=window.getSelection();if(S&&S.rangeCount&&!S.isCollapsed){const k=document.createElement("div");k.appendChild(S.getRangeAt(0).cloneContents()),E=k.innerHTML.trim()||void 0}}try{a(!0);const S=await s(A,d.getHTML(),E);S&&d&&(E?d.chain().focus().insertContentAt({from:y,to:w},S).run():d.commands.setContent(S,{emitUpdate:!1}),i(d.getHTML()),d.commands.focus())}catch{}finally{a(!1)}},m=(d==null?void 0:d.getAttributes("textStyle").fontSize)??"16px",g=(d==null?void 0:d.getAttributes("textStyle").color)??"#14213d",b=r==="heading";return c.jsxs("div",{className:`edm-richtext-shell${n==="canvas"?" edm-richtext-shell--canvas":""}`,children:[c.jsx(fu,{active:{bold:d==null?void 0:d.isActive("bold"),italic:d==null?void 0:d.isActive("italic"),underline:d==null?void 0:d.isActive("underline"),strike:d==null?void 0:d.isActive("strike"),subscript:d==null?void 0:d.isActive("subscript"),superscript:d==null?void 0:d.isActive("superscript"),bulletList:d==null?void 0:d.isActive("bulletList"),orderedList:d==null?void 0:d.isActive("orderedList"),link:d==null?void 0:d.isActive("link")},onToggle:A=>{const y=d==null?void 0:d.chain().focus();y&&(A==="bold"?y.toggleBold().run():A==="italic"?y.toggleItalic().run():A==="underline"?y.toggleUnderline().run():A==="strike"?y.toggleStrike().run():A==="subscript"?y.toggleSubscript().run():A==="superscript"?y.toggleSuperscript().run():A==="bulletList"?y.toggleBulletList().run():A==="orderedList"&&y.toggleOrderedList().run())},onLink:u,onUnlink:()=>d==null?void 0:d.chain().focus().unsetLink().run(),onInsertEmoji:A=>d==null?void 0:d.chain().focus().insertContent(A).run(),onInsertMergeTag:h,mergeTagOptions:l,showLists:!b,showFontControls:!b,fontSize:m,onFontSize:A=>d==null?void 0:d.chain().focus().setMark("textStyle",{fontSize:A}).run(),color:g,onColor:A=>d==null?void 0:d.chain().focus().setColor(A).run(),disabled:!d,showAi:!!s,aiBusy:o,onAi:A=>void p(A)}),c.jsx(rE,{editor:d})]})},B6=e=>!Number.isFinite(e)||e<=0?"none":e<.1?"low":e<.3?"medium":"high",P6={none:"transparent",low:"#22c55e",medium:"#f59e0b",high:"#ef4444"},F6=e=>P6[B6(e)],$6=(e,t)=>{const n=e[t];return n?F6(n.ctr):"transparent"},H6=({block:e,design:t,mergeTags:n,previewMergeTags:r,aiAdapter:i,onChange:s})=>{const o=String(e.values.html??""),a=v.useRef(null),l=v.useRef(null),[d,u]=v.useState(!1),[h,p]=v.useState(null),m=Object.entries(n??{}).map(([y,w])=>({key:y,label:w.label??y,token:w.value}));v.useEffect(()=>{const y=a.current;y&&o!==l.current&&(y.innerHTML=or(o),l.current=o)},[o]);const g=()=>{const y=a.current;y&&(l.current=y.innerHTML,s(y.innerHTML))},b=y=>{const w=a.current;if(!w)return;w.focus();const C=window.getSelection();if(C&&C.rangeCount>0&&w.contains(C.anchorNode)){const E=C.getRangeAt(0);E.deleteContents();const S=document.createTextNode(y);E.insertNode(S),E.setStartAfter(S),E.collapse(!0),C.removeAllRanges(),C.addRange(E)}else w.appendChild(document.createTextNode(y));g()},A=async y=>{if(!(i!=null&&i.rewriteText)||d)return;const w=a.current;let C,E=null;const S=typeof window<"u"?window.getSelection():null;if(w&&S&&S.rangeCount>0&&!S.isCollapsed&&w.contains(S.anchorNode)){E=S.getRangeAt(0).cloneRange();const k=document.createElement("div");k.appendChild(E.cloneContents()),C=k.innerHTML.trim()||void 0}try{u(!0),p(null);const k=await i.rewriteText({prompt:y,block:{...e,values:{...e.values,html:o}},design:t,mergeTags:r,selectedText:C}),I=typeof k.html=="string"&&k.html.trim()?k.html:typeof k.text=="string"&&k.text.trim()?k.text:null;if(!I)return;if(C&&E&&w)try{w.focus();const L=E.createContextualFragment(or(I));E.deleteContents(),E.insertNode(L),g()}catch{s(I)}else s(I)}catch(k){p(k instanceof Error?k.message:"Unable to run AI on this block.")}finally{u(!1)}};return c.jsxs("div",{className:"edm-richtext-shell edm-richtext-shell--canvas",onClick:y=>y.stopPropagation(),children:[c.jsx(fu,{showFormatting:!1,active:{},onToggle:()=>{},onLink:()=>{},onUnlink:()=>{},onInsertEmoji:y=>b(y),onInsertMergeTag:y=>b(Cs(y)),mergeTagOptions:m,showAi:!!(i!=null&&i.rewriteText),onAi:y=>void A(y),aiBusy:d}),h?c.jsx("p",{className:"edm-rawhtml-ai-error",children:h}):null,c.jsx("div",{ref:a,className:"edm-rawhtml-wysiwyg edm-block-preview",contentEditable:!0,suppressContentEditableWarning:!0,role:"textbox","aria-multiline":"true","aria-label":"Custom HTML content",onInput:g,onBlur:g})]})},VE=(e,t)=>Array.isArray(e.values[t])?e.values[t]:[],U6=(e,t,n,r)=>{const i=VE(e,t),s=i.length?[...i]:[{}],o=Math.max(0,Math.min(n,s.length-1));return s[o]={...s[o],...r},s},G6={button:{get:e=>String(e.values.label??""),set:(e,t)=>({label:t}),rich:!0,ai:!0,label:"Button label"},form:{get:e=>String(e.values.headline??""),set:(e,t)=>({headline:t}),rich:!1,ai:!0,label:"Form headline"},navigation:{rich:!0,ai:!0,list:{key:"items",field:"label",itemLabel:(e,t)=>`Link ${t+1}`,labelFor:e=>`Menu link ${e+1}`}},social:{rich:!1,ai:!0,list:{key:"items",field:"href",itemLabel:(e,t)=>String(e.network||e.label||`Item ${t+1}`),labelFor:e=>`Social link ${e+1} (URL or merge tag)`}}},W6=e=>e.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim(),Y6=({block:e,config:t,design:n,mergeTags:r,previewMergeTags:i,aiAdapter:s,onInlineUpdate:o})=>{var a,l;const d=v.useRef(null),u=v.useRef(null),[h,p]=v.useState(!1),[m,g]=v.useState(null),[b,A]=v.useState({}),[y,w]=v.useState(0),C=t.list?VE(e,t.list.key):null,E=C?Math.max(0,Math.min(y,Math.max(0,C.length-1))):0,S=t.list?String(((a=C==null?void 0:C[E])==null?void 0:a[t.list.field])??""):((l=t.get)==null?void 0:l.call(t,e))??"",k=t.list?t.list.labelFor(E):t.label??"",I=F=>{var ce;return t.list?{[t.list.key]:U6(e,t.list.key,E,{[t.list.field]:F})}:((ce=t.set)==null?void 0:ce.call(t,e,F))??{}},L=Object.entries(r??{}).map(([F,ce])=>({key:F,label:ce.label??F,token:ce.value})),R=t.ai&&!!(s!=null&&s.rewriteText),B=["insert a merge tag",t.ai?"use AI":null,t.rich?"format the text":null].filter(F=>!!F),O=B.length===1?B[0]:`${B.slice(0,-1).join(", ")} or ${B[B.length-1]}`;v.useEffect(()=>{const F=d.current;F&&S!==u.current&&(t.rich?F.innerHTML=or(S):F.textContent=S,u.current=S)},[S,t.rich]);const Y=()=>{const F=d.current;return F?t.rich?F.innerHTML:F.textContent??"":""},Q=()=>{const F=Y();u.current=F,o(I(F))},W=()=>{t.rich&&A({bold:document.queryCommandState("bold"),italic:document.queryCommandState("italic"),underline:document.queryCommandState("underline"),strike:document.queryCommandState("strikeThrough")})},ie=F=>{const ce=d.current;if(!ce)return;ce.focus();const ve=window.getSelection();if(ve&&ve.rangeCount>0&&ce.contains(ve.anchorNode)){const Ne=ve.getRangeAt(0);Ne.deleteContents();const ye=document.createTextNode(F);Ne.insertNode(ye),Ne.setStartAfter(ye),Ne.collapse(!0),ve.removeAllRanges(),ve.addRange(Ne)}else ce.appendChild(document.createTextNode(F));Q()},J={bold:"bold",italic:"italic",underline:"underline",strike:"strikeThrough",subscript:"subscript",superscript:"superscript"},H=F=>{var ce;(ce=d.current)==null||ce.focus(),J[F]&&document.execCommand(J[F]),Q(),W()},te=()=>{var F;const ce=window.prompt("Link URL","https://");ce&&((F=d.current)==null||F.focus(),document.execCommand("createLink",!1,ce),Q())},G=()=>{var F;(F=d.current)==null||F.focus(),document.execCommand("unlink"),Q()},M=async F=>{if(!(s!=null&&s.rewriteText)||h)return;const ce=d.current;let ve,Ne=null;const ye=typeof window<"u"?window.getSelection():null;if(ce&&ye&&ye.rangeCount>0&&!ye.isCollapsed&&ce.contains(ye.anchorNode))if(Ne=ye.getRangeAt(0).cloneRange(),t.rich){const xe=document.createElement("div");xe.appendChild(Ne.cloneContents()),ve=xe.innerHTML.trim()||void 0}else ve=Ne.toString().trim()||void 0;try{p(!0),g(null);const xe=await s.rewriteText({prompt:F,block:{...e,type:"text",values:{...e.values,html:`<p>${S}</p>`}},design:n,mergeTags:i,selectedText:ve}),ht=typeof xe.html=="string"&&xe.html.trim()?xe.html.trim():typeof xe.text=="string"&&xe.text.trim()?xe.text.trim():null;if(!ht)return;const wt=t.rich?ht:W6(ht);if(ve!==void 0&&Ne&&ce)try{ce.focus(),Ne.deleteContents(),Ne.insertNode(t.rich?Ne.createContextualFragment(or(wt)):document.createTextNode(wt)),Q()}catch{o(I(wt))}else o(I(wt))}catch(xe){g(xe instanceof Error?xe.message:"Unable to run AI on this field.")}finally{p(!1)}};return c.jsxs("div",{className:"edm-richtext-shell edm-richtext-shell--canvas edm-field-canvas-editor",onClick:F=>F.stopPropagation(),onMouseDown:F=>F.stopPropagation(),children:[C&&C.length>1?c.jsxs("label",{className:"edm-field-canvas-picker",children:[c.jsx("span",{children:"Editing"}),c.jsx("select",{value:E,onChange:F=>w(Number(F.target.value)),"aria-label":"Choose which item to edit",children:C.map((F,ce)=>{var ve;return c.jsx("option",{value:ce,children:(ve=t.list)==null?void 0:ve.itemLabel(F,ce)},ce)})})]}):null,c.jsx(fu,{showFormatting:t.rich,showLists:!1,showFontControls:!1,active:b,onToggle:F=>H(F),onLink:te,onUnlink:G,onInsertEmoji:F=>ie(F),onInsertMergeTag:F=>ie(Cs(F)),mergeTagOptions:L,showAi:R,onAi:F=>void M(F),aiBusy:h}),c.jsx("div",{ref:d,className:"edm-field-canvas-input",contentEditable:!0,suppressContentEditableWarning:!0,role:"textbox","aria-label":k,onInput:Q,onBlur:Q,onKeyUp:W,onMouseUp:W,onFocus:W}),c.jsxs("p",{className:"edm-field-canvas-hint",children:[k,", ",O,". Manage the rest in the panel."]}),m?c.jsx("p",{className:"edm-rawhtml-ai-error",children:m}):null]})},z6=e=>{const t=e.trim();return/^<(?:p|h[1-6]|div|ul|ol|blockquote)[\s>]/i.test(t)?t:`<p>${t||"Heading"}</p>`},$f=v.memo(({block:e,previewMergeTags:t})=>{const n=v.useMemo(()=>or(Yc(e,{mergeTags:t,mergeTagDisplay:"chip"})),[e,t]);return c.jsx("div",{className:`edm-block-preview edm-block-preview--${e.type}`,dangerouslySetInnerHTML:{__html:n}})});$f.displayName="BlockCanvasPreview";const K6=({block:e})=>{const t=v.useContext(Xm)[String(e.values._tool??"")];return t?c.jsx("div",{className:"edm-block-preview edm-block-preview--custom",children:t.render(e.values)}):c.jsxs("div",{className:"edm-block-preview edm-custom-missing",children:["Unknown tool: ",c.jsx("code",{children:String(e.values._tool??"")})]})},Q6=({tag:e,value:t,editable:n,selected:r,colSpan:i,rowSpan:s,style:o,onPick:a,onCommit:l,onFocusCell:d})=>{const u=v.useRef(null);return v.useEffect(()=>{const h=u.current;h&&document.activeElement!==h&&h.textContent!==t&&(h.textContent=t)},[t]),c.jsx(e,{ref:u,colSpan:i,rowSpan:s,suppressContentEditableWarning:!0,contentEditable:n,className:`edm-table-canvas-cell${r?" is-selected":""}`,style:o,onMouseDown:h=>{h.button===0&&(h.shiftKey&&h.preventDefault(),a(h.shiftKey))},onKeyDown:h=>{h.stopPropagation(),h.key==="Enter"&&!h.shiftKey&&(h.preventDefault(),h.currentTarget.blur())},onFocus:()=>d==null?void 0:d(u.current),onBlur:h=>l(h.currentTarget.textContent??"")})},wi=(e,t)=>{const n=Number(e);return Number.isFinite(n)?n:t},V6=({block:e,editable:t,isSelected:n,mergeTags:r,previewMergeTags:i,design:s,aiAdapter:o,onInlineUpdate:a,onSelect:l})=>{const d=be(ee=>ee.tableSelection),u=v.useRef(null),h=v.useRef(null),[p,m]=v.useState(null),[g,b]=v.useState(!1),A=()=>{var ee;if(u.current&&u.current.el.isConnected)return u.current;const z=(ee=h.current)==null?void 0:ee.querySelector("th,td");return z?{el:z,r:0,c:0}:null},y=Object.entries(r??{}).map(([ee,z])=>({key:ee,label:z.label??ee,token:z.value})),w=be(ee=>ee.setTableSelection),C=e.values,E=tu(C.rows),S=k1(E),k=E.length-1,I=!!(C.header_row??!0),L=!!C.footer_row&&k>(I?0:-1),R=String(C.border_style??"solid"),B=Math.max(0,wi(C.border_width,1)),O=String(C.border_color??"#e6ecea"),Y=R==="none"||B===0?void 0:`${B}px ${R} ${O}`,Q=Math.max(0,wi(C.cell_padding,10)),W=Math.max(10,wi(C.font_size,14)),ie=String(C.text_color??"#14213d"),J=Math.max(400,Math.min(700,wi(C.font_weight,400))),H=Math.max(80,Math.min(200,wi(C.line_height,140))),te=Math.max(0,wi(C.letter_spacing,0)),G=String(C.font_family??"body"),M=G==="body"?"inherit":G,F=String(C.align??"left"),ce=String(C.header_background??"#14213d"),ve=String(C.header_color??"#ffffff"),Ne=String(C.footer_background??"#14213d"),ye=String(C.footer_color??"#ffffff"),xe=!!C.striped,ht=String(C.stripe_color??"#f4f8f7"),wt=Math.min(100,Math.max(10,wi(C.width,100))),jt=Math.max(0,wi(C.container_padding,10)),de=d&&d.blockId===e.id?d:null,pt=de?nu(E,de.anchor.r,de.anchor.c,de.focus.r,de.focus.c):null,mt=(ee,z)=>pt?ee>=pt.r1&&ee<=pt.r2&&z>=pt.c1&&z<=pt.c2:!1,Ee=(ee,z,fe)=>{var Z,Oe;if(((Oe=(Z=E[ee])==null?void 0:Z[z])==null?void 0:Oe.text)===fe)return;const je=E.map((rt,it)=>it===ee?rt.map((He,Pe)=>Pe===z?{...He,text:fe}:He):rt);a({rows:Wc(je)})},Ot=(ee,z,fe)=>{l(),w(fe&&de?{blockId:e.id,anchor:de.anchor,focus:{r:ee,c:z}}:{blockId:e.id,anchor:{r:ee,c:z},focus:{r:ee,c:z}})},Jt=ee=>{const z=A();if(!z)return;const{el:fe,r:Z,c:Oe}=z;fe.focus();const je=window.getSelection();if(je&&je.rangeCount>0&&fe.contains(je.anchorNode)){const rt=je.getRangeAt(0);rt.deleteContents();const it=document.createTextNode(ee);rt.insertNode(it),rt.setStartAfter(it),rt.collapse(!0),je.removeAllRanges(),je.addRange(rt)}else fe.textContent=`${fe.textContent??""}${ee}`;Ee(Z,Oe,fe.textContent??"")},Tt=async ee=>{const z=A();if(!(o!=null&&o.rewriteText)||!z||g)return;const{el:fe,r:Z,c:Oe}=z;let je,rt=null;const it=typeof window<"u"?window.getSelection():null;it&&it.rangeCount>0&&!it.isCollapsed&&fe.contains(it.anchorNode)&&(rt=it.getRangeAt(0).cloneRange(),je=rt.toString().trim()||void 0);try{b(!0);const He=await o.rewriteText({prompt:ee,block:{...e,type:"text",values:{...e.values,html:`<p>${fe.textContent??""}</p>`}},design:s,mergeTags:i,selectedText:je}),Pe=(He.text??He.html??"").replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim();if(!Pe)return;if(je&&rt&&fe.contains(rt.commonAncestorContainer))try{fe.focus(),rt.deleteContents(),rt.insertNode(document.createTextNode(Pe)),Ee(Z,Oe,fe.textContent??"")}catch{fe.textContent=Pe,Ee(Z,Oe,Pe)}else fe.textContent=Pe,Ee(Z,Oe,Pe)}catch{}finally{b(!1)}},xn=t&&n&&(y.length>0||!!(o!=null&&o.rewriteText));let et=-1;return c.jsxs("div",{style:{padding:`${jt}px 0`,maxWidth:"100%",overflowX:"auto"},children:[xn?c.jsxs("div",{className:"edm-richtext-shell edm-richtext-shell--canvas edm-table-cell-toolbar",onMouseDown:ee=>ee.stopPropagation(),children:[c.jsx(fu,{showFormatting:!1,active:{},onToggle:()=>{},onLink:()=>{},onUnlink:()=>{},onInsertEmoji:ee=>Jt(ee),onInsertMergeTag:ee=>Jt(Cs(ee)),mergeTagOptions:y,showAi:!!(o!=null&&o.rewriteText),onAi:ee=>void Tt(ee),aiBusy:g}),c.jsx("p",{className:"edm-table-cell-toolbar-hint",children:p?"Merge tag and AI apply to the selected cell.":"Click a cell to target it, otherwise these apply to the first cell."})]}):null,c.jsx("table",{ref:h,className:"edm-table-canvas",style:{width:`${wt}%`,borderCollapse:"collapse"},children:c.jsx("tbody",{children:E.map((ee,z)=>{const fe=I&&z===0?"header":L&&z===k?"footer":"body";fe==="body"&&(et+=1);const Z=fe==="header"?ce:fe==="footer"?Ne:xe&&et%2===1?ht:"#ffffff",Oe=fe==="header"?ve:fe==="footer"?ye:ie,je=fe==="body"?J:700;return c.jsx("tr",{children:ee.map((rt,it)=>{var He;return(He=S[z])!=null&&He[it]?null:c.jsx(Q6,{tag:fe==="header"?"th":"td",value:rt.text,editable:t,selected:mt(z,it),colSpan:rt.colspan>1?rt.colspan:void 0,rowSpan:rt.rowspan>1?rt.rowspan:void 0,style:{border:Y,padding:Q,fontFamily:M,fontSize:W,lineHeight:`${H}%`,letterSpacing:te,color:Oe,fontWeight:je,textAlign:F,background:Z},onPick:Pe=>Ot(z,it,Pe),onCommit:Pe=>Ee(z,it,Pe),onFocusCell:Pe=>{Pe&&(u.current={el:Pe,r:z,c:it}),m({r:z,c:it})}},it)})},z)})})})]})},q6=[{pos:"nw",gx:-1,gy:-1},{pos:"n",gx:0,gy:-1},{pos:"ne",gx:1,gy:-1},{pos:"e",gx:1,gy:0},{pos:"se",gx:1,gy:1},{pos:"s",gx:0,gy:1},{pos:"sw",gx:-1,gy:1},{pos:"w",gx:-1,gy:0}],J6=new Set(["image","gif","video"]),Z6=({bodyRef:e,width:t,align:n,onCommit:r})=>{const[i,s]=v.useState(null),[o,a]=v.useState(null),l=()=>{const u=e.current,h=u==null?void 0:u.querySelector("img, video");if(!u||!h){s(null);return}const p=u.getBoundingClientRect(),m=h.getBoundingClientRect();s({top:m.top-p.top,left:m.left-p.left,width:m.width,height:m.height})};if(v.useLayoutEffect(()=>{var u;l();const h=(u=e.current)==null?void 0:u.querySelector("img, video");if(!h)return;const p=()=>l();h.addEventListener("load",p);const m=typeof ResizeObserver<"u"?new ResizeObserver(()=>l()):null;return m==null||m.observe(h),()=>{h.removeEventListener("load",p),m==null||m.disconnect()}},[e,t]),!i)return null;const d=(u,h)=>p=>{p.preventDefault(),p.stopPropagation();const m=e.current,g=m==null?void 0:m.querySelector("img, video");if(!m||!g)return;const b=g.closest("span[style*='float']")??g,A=m.clientWidth||1,y=p.clientX,w=p.clientY,C=Math.max(5,Math.min(100,t||100)),E=A*C/100,S=n==="center"?2:1;let k=C;const I=R=>{const B=(R.clientX-y)*u+(R.clientY-w)*h,O=E+B*S;k=Math.max(5,Math.min(100,Math.round(O/A*100))),b.style.width=`${k}%`,a(k),l()},L=()=>{window.removeEventListener("pointermove",I),window.removeEventListener("pointerup",L),a(null),r(k)};window.addEventListener("pointermove",I),window.addEventListener("pointerup",L)};return c.jsxs("div",{className:"edm-media-resize",style:{top:i.top,left:i.left,width:i.width,height:i.height},onClick:u=>u.stopPropagation(),children:[q6.map(u=>c.jsx("button",{type:"button",className:`edm-media-resize-handle edm-media-resize-handle--${u.pos}`,"aria-label":`Resize ${u.pos}`,onPointerDown:d(u.gx,u.gy)},u.pos)),o!==null?c.jsxs("span",{className:"edm-media-resize-badge",children:[o,"%"]}):null]})},lc=({block:e,label:t,icon:n,widths:r})=>{if(e){const i=Dp.find(s=>s.type===e.type);return c.jsxs("div",{className:"edm-drag-overlay edm-drag-overlay--block",children:[c.jsxs("div",{className:"edm-drag-overlay-header",children:[c.jsx("span",{className:"edm-block-pill",children:(i==null?void 0:i.title)??e.type}),c.jsx("span",{className:"edm-drag-overlay-icon",children:Ss((i==null?void 0:i.icon)??e.type)})]}),c.jsx($f,{block:e})]})}return r!=null&&r.length?c.jsxs("div",{className:"edm-drag-overlay edm-drag-overlay--tile",children:[c.jsxs("div",{className:"edm-drag-overlay-header",children:[c.jsx("span",{className:"edm-tool-label",children:t??"Layout"}),c.jsx("span",{className:"edm-drag-overlay-icon",children:Ss(n??"layout")})]}),c.jsx("div",{className:"edm-layout-ghost",children:r.map((i,s)=>c.jsxs("span",{style:{flex:i},children:[Math.round(i),"%"]},`${i}-${s}`))})]}):c.jsx("div",{className:"edm-drag-overlay edm-drag-overlay--tile",children:c.jsxs("div",{className:"edm-drag-overlay-header",children:[c.jsx("span",{className:"edm-tool-label",children:t??"Block"}),c.jsx("span",{className:"edm-drag-overlay-icon",children:Ss(n??"content")})]})})},X6=({children:e,empty:t})=>{const{setNodeRef:n,isOver:r}=Ud({id:"canvas-root"});return c.jsx("div",{ref:n,className:`edm-canvas-dropzone${r?" is-over":""}${t?" is-empty":""}`,children:e})},Jy=({columnId:e,index:t})=>{const{setNodeRef:n,isOver:r}=Ud({id:`slot:${e}:${t}`});return c.jsx("div",{ref:n,className:`edm-block-slot${r?" is-over":""}`})},e8=({block:e,columnId:t,isSelected:n,isInlineEditing:r,mergeTags:i,previewMergeTags:s,isConditionVisible:o,onInlineUpdate:a,onSelect:l,onEnterInlineEdit:d,onDuplicate:u,onRemove:h,onContextMenu:p})=>{const m=be(H=>Uj(H.comments,e.id)),g=be(H=>$6(H.heatmap,e.id)),b=be(H=>H.requestAssetLibrary),A=v.useContext(U1),y=be(H=>H.design),w=A&&(e.type==="text"||e.type==="heading")?async(H,te,G)=>{const M=e.type==="heading"?{...e,values:{...e.values,text:te}}:{...e,values:{...e.values,html:te}},F=await A.rewriteText({prompt:H,block:M,design:y,mergeTags:s,selectedText:G});return typeof F.html=="string"&&F.html.trim()?F.html.trim():typeof F.text=="string"&&F.text.trim()?F.text.trim():null}:void 0,C=!!e.locked,E=!!(e.locked||e.content_locked),S=!!(e.locked||e.delete_locked),k=!!(e.locked||e.move_locked),{attributes:I,listeners:L,setNodeRef:R,transform:B,transition:O}=Gx({id:e.id,disabled:k}),Y=e.type==="text"||e.type==="heading"||e.type==="raw-html",Q=G6[e.type],W=v.useRef(null),ie=J6.has(e.type),J=ie&&n&&!E;return c.jsxs("div",{ref:R,className:`edm-block-card${n?" is-selected":""}${o?"":" is-condition-hidden"}`,onContextMenu:p?H=>{H.preventDefault(),H.stopPropagation(),l(),p(H.clientX,H.clientY)}:void 0,style:{transform:mi.Transform.toString(B),transition:O,...g!=="transparent"?{boxShadow:`inset 0 0 0 3px ${g}`}:{}},"data-column-id":t,children:[c.jsxs("div",{className:"edm-block-card-top",children:[c.jsx("span",{className:"edm-block-pill",children:e.type}),e.global_block_id?c.jsx("span",{className:"edm-block-pill edm-block-pill--global",title:"Linked global block",children:"⟳ Global"}):null,m>0?c.jsxs("span",{className:"edm-block-pill edm-block-pill--comment",title:`${m} open comment${m===1?"":"s"}`,children:["💬 ",m]}):null,c.jsxs("div",{className:"edm-inline-actions",children:[c.jsx(Dt,{icon:"duplicate",label:"Duplicate block",onClick:u,disabled:C}),c.jsx(Dt,{icon:"delete",label:"Delete block",onClick:h,disabled:S}),c.jsx(Dt,{icon:"drag",label:"Drag block",disabled:k,dragHandleProps:{...I,...L,onClick:H=>H.stopPropagation()}})]})]}),r&&e.type==="text"?c.jsx("div",{className:"edm-block-card-body edm-block-card-body--editor",onClick:H=>H.stopPropagation(),children:c.jsx(qy,{value:String(e.values.html??"<p></p>"),mergeTags:i,variant:"canvas",onChange:H=>a({html:H}),onAiRewrite:w})}):r&&e.type==="heading"?c.jsx("div",{className:"edm-block-card-body edm-block-card-body--editor",onClick:H=>H.stopPropagation(),children:c.jsx(qy,{value:z6(String(e.values.text??"Heading")),mergeTags:i,mode:"heading",variant:"canvas",onChange:H=>a({text:H}),onAiRewrite:w})}):r&&e.type==="raw-html"?c.jsx("div",{className:"edm-block-card-body edm-block-card-body--editor",onClick:H=>H.stopPropagation(),children:c.jsx(H6,{block:e,design:y,mergeTags:i,previewMergeTags:s,aiAdapter:A,onChange:H=>a({html:H})})}):c.jsxs("div",{ref:W,className:`edm-block-card-body${J?" edm-block-card-body--resizable":""}`,role:"button",tabIndex:0,onClick:H=>{if(H.stopPropagation(),Y&&!E){d();return}l()},onDoubleClick:ie&&!E?H=>{H.stopPropagation(),l(),b(e.id)}:void 0,onKeyDown:H=>{if(H.key==="Enter"||H.key===" "){if(H.preventDefault(),H.stopPropagation(),Y&&!E){d();return}l()}},children:[!o&&e.visible_if?c.jsx("div",{className:"edm-conditional-note",children:"Hidden for current preview context"}):null,Q&&n&&!E?c.jsx(Y6,{block:e,config:Q,design:y,mergeTags:i,previewMergeTags:s,aiAdapter:A,onInlineUpdate:a}):null,e.type==="table"?c.jsx(V6,{block:e,editable:!E,isSelected:n,mergeTags:i,previewMergeTags:s,design:y,aiAdapter:A,onInlineUpdate:a,onSelect:l}):e.type==="custom"?c.jsx(K6,{block:e}):c.jsx($f,{block:e,previewMergeTags:s}),J?c.jsx(Z6,{bodyRef:W,width:Number(e.values.width??100),align:e.values.text_wrap==="left"||e.values.text_wrap==="right"?"left":String(e.values.align??"center"),onCommit:H=>a({width:H,auto_width:!1})}):null]})]})},t8=({column:e,displayWidth:t,canResize:n,hasOpenConfig:r,selectedBlockId:i,inlineEditingBlockId:s,selectedColumnId:o,mergeTags:a,previewMergeTags:l,onClearSelection:d,onSelectColumn:u,onSelectBlock:h,onRemoveColumn:p,onDuplicateBlock:m,onRemoveBlock:g,onUpdateBlock:b,onEnterInlineEdit:A,onResizeStart:y,onBlockContextMenu:w,onColumnContextMenu:C})=>{var E,S,k,I,L;const{setNodeRef:R,isOver:B}=Ud({id:`column:${e.id}`});return c.jsxs("div",{ref:R,className:`edm-column-surface${o===e.id?" is-selected":""}${B?" is-over":""}`,style:{width:`${t}%`,background:String(((E=e.settings)==null?void 0:E.background_color)??"transparent"),padding:`${Number(((S=e.settings)==null?void 0:S.padding)??12)}px`,borderStyle:String(((k=e.settings)==null?void 0:k.border_style)??"solid"),borderWidth:`${Number(((I=e.settings)==null?void 0:I.border_width)??1)}px`,borderColor:String(((L=e.settings)==null?void 0:L.border_color)??"transparent")},onClick:()=>{if(r){d();return}u(e.id)},onContextMenu:C?O=>{O.defaultPrevented||(O.preventDefault(),O.stopPropagation(),u(e.id),C(e.id,O.clientX,O.clientY))}:void 0,role:"presentation",children:[c.jsx("div",{className:"edm-column-meta",children:c.jsxs("div",{className:"edm-inline-actions",children:[c.jsx(Dt,{icon:"columns",label:"Select column",onClick:()=>u(e.id)}),c.jsx(Dt,{icon:"delete",label:"Delete column",onClick:()=>p(e.id)})]})}),c.jsx(Hx,{items:e.blocks.map(O=>O.id),strategy:Px,children:c.jsxs("div",{className:"edm-column-stack",children:[c.jsx(Jy,{columnId:e.id,index:0}),e.blocks.map((O,Y)=>c.jsxs("div",{className:"edm-block-stack-item",children:[c.jsx(e8,{block:O,columnId:e.id,isSelected:i===O.id,isInlineEditing:s===O.id,mergeTags:a,previewMergeTags:l,isConditionVisible:v1(O.visible_if,l),onInlineUpdate:Q=>b(O.id,Q),onSelect:()=>h(O.id,e.id),onEnterInlineEdit:()=>A(O.id,e.id),onDuplicate:()=>m(O.id),onRemove:()=>g(O.id),onContextMenu:w?(Q,W)=>w(O.id,e.id,Q,W):void 0}),c.jsx(Jy,{columnId:e.id,index:Y+1})]},O.id)),e.blocks.length===0&&c.jsxs("div",{className:"edm-empty-column",children:[c.jsx("strong",{children:"Drop block here"}),c.jsx("span",{children:"Drag from the right panel or click a content tile."})]})]})}),n&&c.jsx("button",{type:"button",className:"edm-column-resize-handle","aria-label":"Resize columns",title:"Resize columns",onPointerDown:y,onClick:O=>O.stopPropagation(),children:Yi("drag")})]})},n8=({row:e,rowIndex:t,rowCount:n,isSelected:r,isRowOver:i,rowDropSide:s,hasOpenConfig:o,selectedBlockId:a,inlineEditingBlockId:l,selectedColumnId:d,mergeTags:u,previewMergeTags:h,onClearSelection:p,onMoveRow:m,onAddColumn:g,onDuplicateRow:b,onRemoveRow:A,onSelectRow:y,onSelectColumn:w,onSelectBlock:C,onRemoveColumn:E,onDuplicateBlock:S,onRemoveBlock:k,onUpdateBlock:I,onEnterInlineEdit:L,onResizeColumns:R,onBlockContextMenu:B,onColumnContextMenu:O,onRowContextMenu:Y})=>{const Q=!!e.settings.layout_locked,W=v.useRef(null),[ie,J]=v.useState(()=>e.columns.map(ye=>ye.width)),H=v.useRef(ie),{attributes:te,listeners:G,setNodeRef:M,transform:F,transition:ce,isDragging:ve}=Gx({id:`row:${e.id}`,disabled:Q});v.useEffect(()=>{J(e.columns.map(ye=>ye.width))},[e.columns]),v.useEffect(()=>{H.current=ie},[ie]);const Ne=(ye,xe)=>{var ht,wt,jt;xe.preventDefault(),xe.stopPropagation(),y(e.id);const de=((ht=W.current)==null?void 0:ht.getBoundingClientRect().width)??0;if(!de||ye<0||ye>=e.columns.length-1)return;const pt=xe.clientX,mt=[...ie],Ee=mt[ye]??((wt=e.columns[ye])==null?void 0:wt.width)??50,Ot=mt[ye+1]??((jt=e.columns[ye+1])==null?void 0:jt.width)??50,Jt=Ee+Ot,Tt=12,xn=ee=>{const z=(ee.clientX-pt)/de*100,fe=Math.min(Jt-Tt,Math.max(Tt,Ee+z)),Z=Number((Jt-fe).toFixed(2)),Oe=[...mt];Oe[ye]=Number(fe.toFixed(2)),Oe[ye+1]=Z,J(Oe)},et=()=>{window.removeEventListener("pointermove",xn),window.removeEventListener("pointerup",et);const ee=[...H.current];ee[ye]=ee[ye]??Ee,ee[ye+1]=ee[ye+1]??Ot,R(e.id,ee)};window.addEventListener("pointermove",xn),window.addEventListener("pointerup",et)};return c.jsxs("section",{ref:M,className:`edm-row-surface${r?" is-selected":""}${ve?" is-dragging":""}${i?" is-row-over":""}${s?` is-row-over-${s}`:""}${e.settings.layout_mode==="free"?" is-free-layout":""}`,style:{transform:mi.Transform.toString(F),transition:ce,background:String(e.settings.content_background_color??"transparent"),backgroundImage:e.settings.background_image?`url(${e.settings.background_image})`:void 0,backgroundSize:e.settings.background_image?"cover":void 0,backgroundPosition:e.settings.background_image?"center":void 0,minHeight:e.settings.layout_mode==="free"?`${e.settings.min_height??320}px`:void 0},onClick:ye=>{if(ye.target===ye.currentTarget){if(o){p();return}y(e.id)}},onContextMenu:Y?ye=>{ye.target===ye.currentTarget&&(ye.preventDefault(),y(e.id),Y(e.id,ye.clientX,ye.clientY))}:void 0,children:[c.jsxs("div",{className:"edm-row-header",children:[c.jsxs("div",{className:"edm-inline-actions",children:[c.jsx(Dt,{icon:"drag",label:"Drag row",disabled:Q,dragHandleProps:{...te,...G}}),c.jsx(Dt,{icon:"up",label:"Move row up",onClick:()=>m(e.id,"up"),disabled:t===0||Q}),c.jsx(Dt,{icon:"down",label:"Move row down",onClick:()=>m(e.id,"down"),disabled:t===n-1||Q}),c.jsx(Dt,{icon:"columns",label:"Add column",onClick:()=>g(e.id),disabled:e.columns.length>=4||Q}),c.jsx(Dt,{icon:"duplicate",label:"Duplicate row",onClick:()=>b(e.id),disabled:Q}),c.jsx(Dt,{icon:"delete",label:"Delete row",onClick:()=>A(e.id),disabled:Q})]}),e.settings.layout_mode==="free"?c.jsx("span",{className:"edm-free-layout-badge",children:"Freeform canvas"}):null]}),c.jsx("div",{ref:W,className:"edm-columns-grid",children:e.columns.map((ye,xe)=>c.jsx(t8,{column:ye,displayWidth:ie[xe]??ye.width,canResize:xe<e.columns.length-1&&!Q,hasOpenConfig:o,selectedBlockId:a,inlineEditingBlockId:l,selectedColumnId:d,mergeTags:u,previewMergeTags:h,onClearSelection:p,onSelectColumn:w,onSelectBlock:C,onRemoveColumn:E,onDuplicateBlock:S,onRemoveBlock:k,onUpdateBlock:I,onEnterInlineEdit:L,onResizeStart:ht=>Ne(xe,ht),onBlockContextMenu:B,onColumnContextMenu:O},ye.id))})]})},r8=360,Zy=320,i8=86,s8=960,qE="edm-editor-templates",Yh=(e,t)=>{const n=Math.max(Zy,Math.floor(t*.5));return Math.min(Math.max(e,Zy),n)},o8=()=>{if(typeof window>"u")return[];try{const e=window.localStorage.getItem(qE);return e?JSON.parse(e):[]}catch{return[]}},Xy=e=>{typeof window>"u"||window.localStorage.setItem(qE,JSON.stringify(e))},zh=e=>new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}),JE=e=>Object.fromEntries(Object.entries(e??{}).map(([t,n])=>[t,n.sample??n.value])),ex=e=>({id:"preview-context-default",name:"Default",values:JE(e)}),Kh=(e,t)=>{for(const n of e.body.rows)for(const r of n.columns){const i=r.blocks.find(s=>s.id===t);if(i)return i}return null},tx=(e,t)=>{const n=new Set;for(const r of e.body.rows)for(const i of r.columns)for(const s of i.blocks)Ip(t,s.type)||n.add(s.type);return[...n]},jd=(e,t)=>e.body.rows.find(n=>n.columns.some(r=>r.id===t))??null,ZE=(e,t)=>e.body.rows.find(n=>n.columns.some(r=>r.blocks.some(i=>i.id===t)))??null,a8=(e,t)=>{for(const n of e.body.rows)for(const r of n.columns){const i=r.blocks.findIndex(s=>s.id===t);if(i!==-1)return{columnId:r.id,index:i}}return null},pm=e=>{if(!e.startsWith("slot:"))return null;const[,t,n]=e.split(":"),r=Number(n);return!t||Number.isNaN(r)?null:{columnId:t,index:r}},l8=e=>{const t=$T(e);return t.length>0?t:jT(e)},nx=(e,t,n)=>{const r=a8(e,n);if(!r||!t.over)return null;const i=t.active.rect.current.translated??t.active.rect.current.initial,s=t.over.rect;if(!i||!s)return{columnId:r.columnId,index:r.index+1};const o=i.top+i.height/2<s.top+s.height/2;return{columnId:r.columnId,index:r.index+(o?0:1)}},rx=(e,t,n)=>{var r;const i=jd(e,n),s=(i==null?void 0:i.columns.find(p=>p.id===n))??null;if(!s||s.blocks.length===0)return 0;const o=t.active.rect.current.translated??t.active.rect.current.initial,a=(r=t.over)==null?void 0:r.rect;if(!o||!a||a.height<=0)return s.blocks.length;const l=o.top+o.height/2,d=Math.max(0,Math.min(a.height,l-a.top)),u=s.blocks.length+1,h=Math.floor(d/a.height*u);return Math.max(0,Math.min(s.blocks.length,h))},c8=(e,t,n)=>{var r,i,s,o,a;if(n==="canvas-root")return e.body.rows.length;if(n.startsWith("row:")){const u=n.replace("row:",""),h=e.body.rows.findIndex(b=>b.id===u);if(h===-1)return e.body.rows.length;const p=t.active.rect.current.translated??t.active.rect.current.initial,m=(r=t.over)==null?void 0:r.rect;if(!p||!m)return h+1;const g=p.top+p.height/2<m.top+m.height/2;return h+(g?0:1)}const l=pm(n),d=((i=ZE(e,n))==null?void 0:i.id)??(n.startsWith("column:")?(s=jd(e,n.replace("column:","")))==null?void 0:s.id:null)??(l?(o=jd(e,l.columnId))==null?void 0:o.id:null)??null;if(d){const u=e.body.rows.findIndex(g=>g.id===d);if(u===-1)return e.body.rows.length;const h=t.active.rect.current.translated??t.active.rect.current.initial,p=(a=t.over)==null?void 0:a.rect;if(!h||!p)return u+1;const m=h.top+h.height/2<p.top+p.height/2;return u+(m?0:1)}return e.body.rows.length},ix=e=>new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}),d8=({open:e,starterTemplates:t,savedTemplates:n,sharedTemplates:r,onClose:i,onSelectStarter:s,onSelectSaved:o,onSelectShared:a,onDeleteSaved:l,onDeleteShared:d})=>{const[u,h]=v.useState(""),[p,m]=v.useState("All");if(!e)return null;const g=v.useMemo(()=>["All",...Array.from(new Set(t.map(A=>A.category)))],[t]),b=v.useMemo(()=>{const A=u.trim().toLowerCase();return t.filter(y=>{const w=p==="All"||y.category===p,C=!A||[y.name,y.category,y.description].some(E=>E.toLowerCase().includes(A));return w&&C})},[p,u,t]);return c.jsx("div",{className:"edm-template-overlay",role:"presentation",onClick:i,children:c.jsxs("div",{className:"edm-template-dialog",role:"dialog","aria-modal":"true","aria-label":"Template library",onClick:A=>A.stopPropagation(),children:[c.jsxs("div",{className:"edm-template-header",children:[c.jsxs("div",{children:[c.jsx("strong",{children:"Template Library"}),c.jsx("p",{children:"Start from shipped templates or reuse designs saved locally or shared across your team."})]}),c.jsx("button",{type:"button",className:"edm-secondary-button",onClick:i,children:"Close"})]}),c.jsxs("div",{className:"edm-template-section",children:[c.jsxs("div",{className:"edm-panel-title",children:[c.jsx("span",{children:"Starter Templates"}),c.jsxs("small",{children:[t.length," shipped"]})]}),c.jsxs("div",{className:"edm-template-toolbar",children:[c.jsx("input",{value:u,onChange:A=>h(A.target.value),placeholder:"Search templates"}),c.jsx("div",{className:"edm-template-filter-row",children:g.map(A=>c.jsx("button",{type:"button",className:`edm-template-filter${p===A?" is-active":""}`,onClick:()=>m(A),children:A},A))})]}),c.jsx("div",{className:"edm-template-grid",children:b.map(A=>c.jsxs("button",{type:"button",className:"edm-template-card",onClick:()=>s(A),children:[c.jsx("span",{className:"edm-template-card-kicker",children:A.category}),c.jsx("strong",{children:A.name}),c.jsx("p",{children:A.description}),c.jsxs("small",{children:[A.design.body.rows.length," rows,"," ",A.design.body.rows.reduce((y,w)=>y+w.columns.length,0)," columns"]})]},A.id))}),b.length===0?c.jsxs("div",{className:"edm-empty-state",children:[c.jsx("h3",{children:"No templates match"}),c.jsx("p",{children:"Try a different category or search term."})]}):null]}),c.jsxs("div",{className:"edm-template-section",children:[c.jsxs("div",{className:"edm-panel-title",children:[c.jsx("span",{children:"Saved Locally"}),c.jsxs("small",{children:[n.length," saved"]})]}),n.length===0?c.jsxs("div",{className:"edm-empty-state",children:[c.jsx("h3",{children:"No saved templates yet"}),c.jsx("p",{children:"Use the save action from the Body panel to store the current design for later reuse."})]}):c.jsx("div",{className:"edm-template-grid",children:n.map(A=>c.jsxs("div",{className:"edm-template-card edm-template-card-static",children:[c.jsx("span",{className:"edm-template-card-kicker",children:"Saved"}),c.jsx("strong",{children:A.name}),c.jsxs("p",{children:["Saved ",ix(A.savedAt)]}),c.jsxs("small",{children:[A.design.body.rows.length," rows,"," ",A.design.body.rows.reduce((y,w)=>y+w.columns.length,0)," columns"]}),c.jsxs("div",{className:"edm-template-card-actions",children:[c.jsx("button",{type:"button",className:"edm-secondary-button",onClick:()=>o(A),children:"Load"}),c.jsx("button",{type:"button",className:"edm-secondary-button",onClick:()=>l(A.id),children:"Delete"})]})]},A.id))})]}),c.jsxs("div",{className:"edm-template-section",children:[c.jsxs("div",{className:"edm-panel-title",children:[c.jsx("span",{children:"Shared With Team"}),c.jsxs("small",{children:[r.length," shared"]})]}),r.length===0?c.jsxs("div",{className:"edm-empty-state",children:[c.jsx("h3",{children:"No team templates yet"}),c.jsx("p",{children:"Use the shared save action from the Body panel to publish reusable team templates."})]}):c.jsx("div",{className:"edm-template-grid",children:r.map(A=>c.jsxs("div",{className:"edm-template-card edm-template-card-static",children:[c.jsx("span",{className:"edm-template-card-kicker",children:"Team"}),c.jsx("strong",{children:A.name}),c.jsxs("p",{children:["Shared ",ix(A.savedAt),A.owner?` by ${A.owner}`:""]}),c.jsxs("small",{children:[A.design.body.rows.length," rows,"," ",A.design.body.rows.reduce((y,w)=>y+w.columns.length,0)," columns"]}),c.jsxs("div",{className:"edm-template-card-actions",children:[c.jsx("button",{type:"button",className:"edm-secondary-button",onClick:()=>a(A),children:"Load"}),c.jsx("button",{type:"button",className:"edm-secondary-button",onClick:()=>d(A.id),children:"Delete"})]})]},A.id))})]})]})})},u8=e=>e==="image/gif"?"gif":e.startsWith("video/")?"video":e==="application/pdf"?"pdf":"image",h8=["image/png","image/jpeg","image/gif","image/webp","image/svg+xml","image/bmp","video/mp4","video/webm","video/quicktime","application/pdf"].join(","),p8=()=>new Promise((e,t)=>{var n,r;if((r=(n=window.google)==null?void 0:n.accounts)!=null&&r.oauth2)return e();const i=document.getElementById("edm-gis-script");if(i){i.addEventListener("load",()=>e()),i.addEventListener("error",()=>t(new Error("Failed to load Google sign-in.")));return}const s=document.createElement("script");s.id="edm-gis-script",s.src="https://accounts.google.com/gsi/client",s.async=!0,s.onload=()=>e(),s.onerror=()=>t(new Error("Failed to load Google sign-in.")),document.head.appendChild(s)}),m8=()=>new Promise((e,t)=>{var n,r;const i=window;if((n=i.google)!=null&&n.picker)return e();const s=()=>i.gapi.load("picker",{callback:()=>e(),onerror:()=>t(new Error("Failed to load the Google Picker."))});if((r=i.gapi)!=null&&r.load)return s();const o=document.getElementById("edm-gapi-script");if(o){o.addEventListener("load",s),o.addEventListener("error",()=>t(new Error("Failed to load the Google Picker.")));return}const a=document.createElement("script");a.id="edm-gapi-script",a.src="https://apis.google.com/js/api.js",a.async=!0,a.onload=s,a.onerror=()=>t(new Error("Failed to load the Google Picker.")),document.head.appendChild(a)});let ao=null;const f8=async(e,t)=>{if(!e)throw new Error("Google Drive isn't configured yet (missing Google client id).");return ao&&ao.clientId===e&&ao.scope===t&&ao.expiresAt>Date.now()+6e4?ao.token:(await p8(),new Promise((n,r)=>{window.google.accounts.oauth2.initTokenClient({client_id:e,scope:t,callback:i=>{i!=null&&i.access_token?(ao={clientId:e,scope:t,token:i.access_token,expiresAt:Date.now()+(Number(i.expires_in)||3600)*1e3},n(i.access_token)):r(new Error("Google Drive access was not granted."))}}).requestAccessToken()}))},g8=e=>{const t=String(e.id),n=e.name||"Drive file",r=String(e.mimeType||""),i=u8(r),s=o=>`https://lh3.googleusercontent.com/d/${t}=w${o}`;return{id:t,label:n,url:i==="image"||i==="gif"?s(1200):`https://drive.google.com/uc?export=view&id=${t}`,thumbnailUrl:s(400),kind:i,alt:n}},A8=async(e,t)=>{try{await fetch(`https://www.googleapis.com/drive/v3/files/${encodeURIComponent(e)}/permissions?supportsAllDrives=true`,{method:"POST",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"},body:JSON.stringify({role:"reader",type:"anyone"})})}catch{}},b8=e=>new Promise((t,n)=>{const r=window.google.picker,i=new r.DocsView(r.ViewId.DOCS).setIncludeFolders(!1).setSelectFolderEnabled(!1).setMimeTypes(h8).setMode(r.DocsViewMode.GRID),s=new r.PickerBuilder().setOAuthToken(e.token).addView(i).enableFeature(r.Feature.MULTISELECT_ENABLED).setCallback(o=>{o.action===r.Action.PICKED?t(Array.isArray(o.docs)?o.docs.map(g8):[]):o.action===r.Action.CANCEL&&n(new Error("No files selected. Click Connect Google Drive to pick files."))});e.developerKey&&s.setDeveloperKey(e.developerKey),e.appId&&s.setAppId(e.appId),s.build().setVisible(!0)}),y8=({clientId:e,developerKey:t,appId:n,scope:r="https://www.googleapis.com/auth/drive.file",label:i="Google Drive"})=>({id:"google-drive",label:i,icon:"▲",description:"Pick images, GIFs, videos or PDFs from your Google Drive.",requiresAuth:!0,authLabel:"Connect Google Drive",onConnect:async()=>{if(!e)throw new Error("Google Drive isn't configured yet (missing Google client id).");await m8();const s=await f8(e,r),o=await b8({token:s,developerKey:t,appId:n});return await Promise.all(o.map(a=>A8(a.id,s))),{id:"google-drive",label:i,items:o}}}),x8=e=>/\.gif$/i.test(e)?"gif":/\.(mp4|webm|mov|m4v)$/i.test(e)?"video":/\.pdf$/i.test(e)?"pdf":"image",v8=async(e,t)=>{const n=await fetch(e.listEndpoint,{headers:e.headers,credentials:"include"});if(!n.ok)throw new Error("Unable to load assets from your S3 endpoint. Check the URL and its response.");const r=await n.json(),i=(Array.isArray(r==null?void 0:r.items)?r.items:Array.isArray(r)?r:[]).filter(s=>s&&typeof s.url=="string").map(s=>{var o;const a=s.label??s.name??((o=s.key)==null?void 0:o.split("/").pop())??"S3 asset";return{id:String(s.id??s.key??s.url),label:a,url:s.url,thumbnailUrl:s.thumbnailUrl??s.url,kind:s.kind??x8(s.url.split("?")[0]),alt:s.alt??a}});return{id:"amazon-s3-private",label:t,items:i}},w8=e=>{const t=e.label??"Amazon S3";return{id:"amazon-s3",label:t,icon:"S",description:"Your private S3 bucket",onConnect:async()=>v8(e,t)}},k8="edMission CRM",E8="data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22340%22%20height%3D%2272%22%20viewBox%3D%220%200%20340%2072%22%20fill%3D%22none%22%3E%3Cg%3E%3Cpath%20d%3D%22M35.8311%201.008C55.2497%201.00811%2070.9921%2016.8036%2070.9922%2036.2883C70.9922%2055.7731%2055.2498%2071.5684%2035.8311%2071.5685C16.4122%2071.5685%200.669922%2055.7731%200.669922%2036.2883C0.670031%2016.8035%2016.4123%201.008%2035.8311%201.008ZM36.165%2013.4396C23.5893%2013.4398%2013.3948%2023.6698%2013.3945%2036.2883C13.3947%2048.9068%2023.5893%2059.1357%2036.165%2059.1359C48.741%2059.1359%2058.9364%2048.9069%2058.9365%2036.2883C58.9363%2023.6697%2048.7409%2013.4396%2036.165%2013.4396ZM7.72656%2035.1242C7.71095%2035.5103%207.70215%2035.8983%207.70215%2036.2883C7.70215%2036.7753%207.71399%2037.2595%207.73828%2037.7404C7.71429%2037.2596%207.70215%2036.7751%207.70215%2036.2883C7.70215%2035.8984%207.71113%2035.5103%207.72656%2035.1242ZM7.73828%2034.8234C7.74321%2034.7256%207.7519%2034.628%207.75781%2034.5305C7.75184%2034.628%207.74327%2034.7256%207.73828%2034.8234Z%22%20fill%3D%22url%28%23paint0_linear_8667_43989%29%22%2F%3E%0A%3Cpath%20d%3D%22M44.3698%2049.4348C46.8399%2050.2693%2048.4381%2050.999%2050.1124%2052.8471C51.7867%2054.6951%2052.2982%2056.3582%2052.2391%2058.8429C52.191%2060.868%2051.6625%2061.8825%2050.6147%2063.7672C49.5501%2065.6822%2047.6009%2067.7993%2047.0986%2068.1353C46.5963%2068.4713%2044.3785%2070.0636%2042.4105%2070.8233C39.7518%2071.8496%2038.0594%2071.9792%2035.2109%2071.9993C32.2331%2072.0204%2030.5651%2071.5486%2027.6764%2070.8233C23.6596%2069.8148%2017.7978%2066.9593%2017.7978%2066.9593C17.7978%2066.9593%2012.1351%2063.2496%209.25876%2060.0712C7.14844%2057.7392%204.57064%2053.5191%204.57064%2053.5191C4.57064%2053.5191%202.85106%2049.9032%202.05915%2047.471C1.28594%2045.0962%200.947964%2043.7215%200.552254%2041.2549C0.0939445%2038.3982%20-0.0999146%2036.7524%200.0499535%2033.8628C0.226563%2030.4576%200.472847%2028.4648%201.72428%2025.2947C2.57561%2023.1381%203.18132%2021.8403%204.57064%2020.0866C6.23289%2017.9884%208.67517%2017.1906%2010.9331%2017.5666C13.191%2017.9426%2014.151%2018.4387%2015.1189%2020.0866C16.1481%2021.8388%2015.4964%2022.92%2014.9016%2024.8643C13.952%2027.9689%2011.2624%2028.6245%209.25876%2031.1748C7.04418%2033.9936%204.88334%2035.4953%204.57064%2039.0709C4.20252%2043.2803%206.11701%2046.0012%209.25876%2048.815C13.0802%2052.2376%2021.9837%2052.0071%2021.9837%2052.0071C21.9837%2052.0071%2028.3858%2051.222%2032.3645%2050.159C36.333%2049.0988%2039.9185%2047.9308%2044.3698%2049.4348Z%22%20fill%3D%22url%28%23paint1_linear_8667_43989%29%22%2F%3E%0A%3Cpath%20d%3D%22M44.7055%2056.3873C46.7725%2055.1004%2049.7285%2052.6912%2049.7285%2052.6912C49.7285%2052.6912%2048.2814%2051.2525%2047.217%2050.5072C46.2327%2049.8179%2045.6802%2049.3658%2044.5381%2048.9952C43.3495%2048.6095%2042.401%2048.4586%2041.1894%2048.3967C39.9779%2048.3348%2039.5124%2048.5247%2038.3431%2048.6592C37.0039%2048.8133%2034.9944%2049.4992%2034.9944%2049.4992C33.7409%2049.8554%2033.0596%2050.1267%2031.8132%2050.5072C30.7047%2050.8457%2030.0959%2051.0862%2028.9668%2051.3472C27.8041%2051.6161%2027.0694%2051.7647%2025.953%2051.8512C24.8367%2051.9378%2024.353%2051.8512%2023.2741%2051.8512H20.4277C19.3162%2051.8512%2018.5888%2051.9228%2017.414%2051.8512C15.9648%2051.7629%2013.7304%2051.3472%2013.7304%2051.3472C13.7304%2051.3472%2014.2614%2052.6224%2014.735%2053.3633C15.2865%2054.2259%2015.6751%2054.6669%2016.4094%2055.3793C17.1803%2056.1273%2017.7073%2056.4424%2018.586%2057.0593C19.5968%2057.769%2020.1581%2058.1925%2021.2649%2058.7393C22.749%2059.4725%2023.6818%2059.6681%2025.2833%2060.0833C26.5745%2060.4182%2027.3044%2060.6282%2028.632%2060.7554C29.8648%2060.8735%2030.5687%2060.8308%2031.8016%2060.7561L31.8132%2060.7554C33.5947%2060.6474%2034.5994%2060.5051%2036.3339%2060.0833C37.9415%2059.6925%2038.8294%2059.3875%2040.3523%2058.7393C42.1298%2057.9827%2043.0649%2057.4088%2044.7055%2056.3873Z%22%20fill%3D%22url%28%23paint2_linear_8667_43989%29%22%2F%3E%0A%3Cpath%20d%3D%22M1.05194%2037.238C1.11908%2038.3591%201.3868%2040.0941%201.3868%2040.0941L2.3914%2036.734C2.3914%2036.734%203.56343%2034.718%203.8983%2034.046C4.23316%2033.374%206.57722%2031.022%206.57722%2031.022C6.57722%2031.022%208.31183%2029.6976%209.25615%2028.8379C10.2005%2027.9783%2010.6555%2027.574%2011.4328%2026.6539C12.4061%2025.5017%2013.2739%2024.9343%2013.6094%2023.4619C13.8134%2022.5664%2013.8889%2021.9845%2013.6094%2021.1098C13.31%2020.1727%2012.9656%2019.5612%2012.1025%2019.0938C11.1243%2018.5641%209.25615%2019.0938%209.25615%2019.0938C8.58642%2019.3738%207.55423%2019.8403%206.57722%2020.6058C5.60022%2021.3714%204.35159%2023.0163%204.35159%2023.0163C4.35159%2023.0163%203.52877%2024.298%203.06113%2025.3099L3.0492%2025.3357C2.52529%2026.4693%202.22363%2027.1219%201.8891%2028.3339C1.60499%2029.3632%201.54411%2029.9657%201.3868%2031.022C1.20219%2032.2617%201.11546%2032.9622%201.05194%2034.214C0.992083%2035.3934%200.981327%2036.0592%201.05194%2037.238Z%22%20fill%3D%22url%28%23paint3_linear_8667_43989%29%22%2F%3E%0A%3Cpath%20d%3D%22M27.6302%2022.5652C25.1601%2021.7307%2023.5619%2021.0009%2021.8876%2019.1529C20.2133%2017.3049%2019.7018%2015.6418%2019.7609%2013.1571C19.809%2011.132%2020.3375%2010.1175%2021.3853%208.23279C22.4499%206.31783%2024.3991%204.20073%2024.9014%203.86473C25.4037%203.52872%2027.6215%201.93637%2029.5895%201.17669C32.2482%200.150426%2033.9406%200.0208478%2036.7891%200.000678743C39.7669%20-0.0204048%2041.4349%200.451407%2044.3236%201.17669C48.3404%202.1852%2054.2022%205.04074%2054.2022%205.04074C54.2022%205.04074%2059.8649%208.7504%2062.7412%2011.9288C64.8516%2014.2608%2067.4294%2018.4809%2067.4294%2018.4809C67.4294%2018.4809%2069.1489%2022.0968%2069.9409%2024.529C70.7141%2026.9038%2071.052%2028.2785%2071.4477%2030.7451C71.9061%2033.6018%2072.0999%2035.2476%2071.95%2038.1372C71.7734%2041.5423%2071.5272%2043.5351%2070.2757%2046.7053C69.4244%2048.8619%2069.123%2050.3345%2067.4294%2051.9133C65.4723%2053.7377%2063.7021%2054.8722%2061.0669%2054.4334C59.1863%2054.1202%2057.849%2053.5613%2056.8811%2051.9133C55.8519%2050.1611%2056.0842%2048.5754%2056.8811%2046.7053C58.0985%2043.8486%2060.7376%2043.3755%2062.7412%2040.8252C64.9558%2038.0064%2067.1167%2036.5047%2067.4294%2032.9291C67.7975%2028.7197%2065.883%2025.9988%2062.7412%2023.185C58.9198%2019.7624%2050.0163%2019.9929%2050.0163%2019.9929C50.0163%2019.9929%2043.6142%2020.778%2039.6355%2021.841C35.667%2022.9012%2032.0815%2024.0692%2027.6302%2022.5652Z%22%20fill%3D%22url%28%23paint4_linear_8667_43989%29%22%2F%3E%0A%3Cpath%20d%3D%22M71.0067%2034.4405C70.9395%2033.3195%2070.6718%2031.5845%2070.6718%2031.5845L69.6672%2034.9445C69.6672%2034.9445%2068.4952%2036.9605%2068.1603%2037.6325C67.8254%2038.3045%2065.4814%2040.6566%2065.4814%2040.6566C65.4814%2040.6566%2063.7468%2041.9809%2062.8024%2042.8406C61.8581%2043.7003%2061.4031%2044.1045%2060.6258%2045.0246C59.6525%2046.1768%2058.7847%2046.7442%2058.4492%2048.2167C58.2452%2049.1121%2058.1697%2049.694%2058.4492%2050.5687C58.7486%2051.5059%2059.093%2052.1173%2059.9561%2052.5847C60.9343%2053.1144%2062.8024%2052.5847%2062.8024%2052.5847C63.4722%2052.3047%2065.4814%2051.0727%2065.4814%2051.0727L67.658%2048.8887C68.1603%2048.3847%2068.5298%2047.3805%2068.9975%2046.3686L69.0094%2046.3428C69.5333%2045.2093%2069.835%2044.5566%2070.1695%2043.3446C70.4536%2042.3153%2070.5145%2041.7129%2070.6718%2040.6566C70.8564%2039.4169%2070.9431%2038.7164%2071.0067%2037.4645C71.0665%2036.2851%2071.0773%2035.6193%2071.0067%2034.4405Z%22%20fill%3D%22url%28%23paint5_linear_8667_43989%29%22%2F%3E%0A%3Cpath%20d%3D%22M27.1221%2015.8657C25.0552%2017.1526%2022.0991%2019.5618%2022.0991%2019.5618C22.0991%2019.5618%2023.5463%2021.0005%2024.6106%2021.7458C25.595%2022.4351%2026.1474%2022.8873%2027.2895%2023.2578C28.4782%2023.6435%2029.4267%2023.7944%2030.6382%2023.8563C31.8497%2023.9182%2032.3153%2023.7284%2033.4846%2023.5938C34.8238%2023.4398%2036.8332%2022.7538%2036.8332%2022.7538C38.0868%2022.3977%2038.7681%2022.1264%2040.0144%2021.7458C41.1229%2021.4074%2041.7317%2021.1669%2042.8608%2020.9058C44.0235%2020.637%2044.7582%2020.4884%2045.8746%2020.4018C46.991%2020.3152%2047.4746%2020.4018%2048.5535%2020.4018H51.3999C52.5115%2020.4018%2053.2389%2020.3302%2054.4137%2020.4018C55.8628%2020.4901%2058.0972%2020.9058%2058.0972%2020.9058C58.0972%2020.9058%2057.5663%2019.6307%2057.0926%2018.8898C56.5411%2018.0272%2056.1525%2017.5861%2055.4183%2016.8737C54.6473%2016.1258%2054.1203%2015.8107%2053.2416%2015.1937C52.2308%2014.484%2051.6696%2014.0605%2050.5627%2013.5137C49.0787%2012.7806%2048.1459%2012.585%2046.5443%2012.1697C45.2531%2011.8349%2044.5233%2011.6249%2043.1957%2011.4977C41.9628%2011.3796%2041.2589%2011.4222%2040.026%2011.497L40.0144%2011.4977C38.233%2011.6057%2037.2283%2011.7479%2035.4938%2012.1697C33.8861%2012.5606%2032.9982%2012.8655%2031.4754%2013.5137C29.6978%2014.2703%2028.7628%2014.8442%2027.1221%2015.8657Z%22%20fill%3D%22url%28%23paint6_linear_8667_43989%29%22%2F%3E%0A%3Cdefs%3E%0A%3ClinearGradient%20id%3D%22paint0_linear_8667_43989%22%20x1%3D%2226.1199%22%20y1%3D%2227.8882%22%20x2%3D%2244.4222%22%20y2%3D%2243.4512%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%0A%3Cstop%20stop-color%3D%22%2372DE3A%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%239217E4%22%2F%3E%0A%3C%2FlinearGradient%3E%0A%3ClinearGradient%20id%3D%22paint1_linear_8667_43989%22%20x1%3D%223.51618%22%20y1%3D%2244.7307%22%20x2%3D%2248.734%22%20y2%3D%2253.4098%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%0A%3Cstop%20stop-color%3D%22%2359B2F0%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%235228EB%22%2F%3E%0A%3C%2FlinearGradient%3E%0A%3ClinearGradient%20id%3D%22paint2_linear_8667_43989%22%20x1%3D%2242.6963%22%20y1%3D%2252.7527%22%20x2%3D%2223.5186%22%20y2%3D%2246.5525%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%0A%3Cstop%20stop-color%3D%22%2359B2F0%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%235228EB%22%2F%3E%0A%3C%2FlinearGradient%3E%0A%3ClinearGradient%20id%3D%22paint3_linear_8667_43989%22%20x1%3D%2212.9311%22%20y1%3D%2229.4792%22%20x2%3D%221.61891%22%20y2%3D%2228.1146%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%0A%3Cstop%20stop-color%3D%22%2359B2F0%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%234D28D2%22%2F%3E%0A%3C%2FlinearGradient%3E%0A%3ClinearGradient%20id%3D%22paint4_linear_8667_43989%22%20x1%3D%2239.0111%22%20y1%3D%226.88809%22%20x2%3D%2272.1015%22%20y2%3D%2238.1923%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%0A%3Cstop%20stop-color%3D%22%23FFDD6E%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FC951F%22%2F%3E%0A%3C%2FlinearGradient%3E%0A%3ClinearGradient%20id%3D%22paint5_linear_8667_43989%22%20x1%3D%2268.1453%22%20y1%3D%2242.3366%22%20x2%3D%2258.7477%22%20y2%3D%2246.8371%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%0A%3Cstop%20stop-color%3D%22%23FFDD6E%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FC951F%22%2F%3E%0A%3C%2FlinearGradient%3E%0A%3ClinearGradient%20id%3D%22paint6_linear_8667_43989%22%20x1%3D%2252.9068%22%20y1%3D%2217.8083%22%20x2%3D%2222.0914%22%20y2%3D%2223.8169%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%0A%3Cstop%20stop-color%3D%22%23FAD351%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FC951F%22%2F%3E%0A%3C%2FlinearGradient%3E%0A%3C%2Fdefs%3E%3C%2Fg%3E%3Ctext%20x%3D%2286%22%20y%3D%2247%22%20font-family%3D%22Inter%2C%20-apple-system%2C%20Segoe%20UI%2C%20Helvetica%2C%20Arial%2C%20sans-serif%22%20font-size%3D%2228%22%20font-weight%3D%22600%22%20fill%3D%22%232b3445%22%3EedMission%20CRM%3C%2Ftext%3E%3C%2Fsvg%3E",XE=/\{\{[^}]+\}\}/g,C8=/\[\[MTG(\d+)\]\]/g,T8=e=>{const t=[];return{masked:e.replace(XE,n=>{const r=t.length;return t.push(n),`[[MTG${r}]]`}),tags:t}},sx=(e,t)=>{if(!t.length)return e;const n=e.replace(C8,(s,o)=>t[Number(o)]??""),r=new Map;for(const s of n.match(XE)??[])r.set(s,(r.get(s)??0)+1);const i=[];for(const s of t){const o=r.get(s)??0;o>0?r.set(s,o-1):i.push(s)}return i.length?n.trim()?`${n.replace(/\s+$/,"")} ${i.join(" ")}`:i.join(" "):n},S8=e=>e&&{...e,rewriteText:async t=>{var n;const r=((n=t.block)==null?void 0:n.values)??{},i=typeof t.selectedText=="string"&&t.selectedText.length>0,s=i?t.selectedText:String(r.html??r.text??""),{masked:o,tags:a}=T8(s);if(!a.length)return e.rewriteText(t);const l=i?{...t,selectedText:o}:{...t,block:{...t.block,values:{...r,html:o,text:o}}},d=await e.rewriteText(l);return{text:typeof d.text=="string"?sx(d.text,a):d.text,html:typeof d.html=="string"?sx(d.html,a):d.html}}},_8=e=>{switch(e){case"page":return 960;case"document":return 816;case"popup":return 480;default:return 600}},N8=e=>{const t=e??{};return(t.plugins??[]).reduce((n,r)=>{var i;return((i=r.extendConfig)==null?void 0:i.call(r,n))??n},t)},I8=e=>{var t;const n=(t=e==null?void 0:e.ui)==null?void 0:t.panels;return{content:(n==null?void 0:n.content)!==!1,blocks:(n==null?void 0:n.blocks)!==!1,body:(n==null?void 0:n.body)!==!1}},D8=e=>e?{...e.bg?{"--edm-bg":e.bg}:{},...e.panel?{"--edm-panel":e.panel}:{},...e.panelBorder?{"--edm-panel-border":e.panelBorder}:{},...e.text?{"--edm-text":e.text}:{},...e.muted?{"--edm-muted":e.muted}:{},...e.accent?{"--edm-accent":e.accent}:{},...e.accentStrong?{"--edm-accent-strong":e.accentStrong}:{},...e.surface?{"--edm-surface":e.surface}:{},...e.canvas?{"--edm-canvas":e.canvas}:{},...e.font?{"--edm-font":e.font}:{},...e.radiusXl?{"--edm-radius-xl":e.radiusXl}:{},...e.radiusLg?{"--edm-radius-lg":e.radiusLg}:{},...e.radiusMd?{"--edm-radius-md":e.radiusMd}:{},...e.shadow?{"--edm-shadow":e.shadow}:{}}:{},eC={content:"Content",blocks:"Blocks",body:"Body",contentPrompt:"Click or drag into the selected column",selectColumnFirst:"Select a column first",layoutLibraryPrompt:"Drag a layout structure into the canvas",bodyCanvasWidth:"{width}px canvas",startBlankCanvas:"Start from a blank canvas",startBlankCanvasHelp:"Drag any block here to create your first row, or click a block from the content library.",allBlocksAvailable:"All supported blocks are available here. Click or drag them into the canvas.",draggingComponent:"Dragging component",previewDesign:"Preview design",backToEdit:"Back to edit",desktopView:"Desktop view",mobileView:"Mobile view",undo:"Undo",redo:"Redo",saveVersion:"Save version",copyDesignJson:"Copy design JSON",copyExportedHtml:"Copy exported HTML",expandRightPanel:"Expand right panel",collapseRightPanel:"Collapse right panel",contentTools:"Content tools",blockInspector:"Block inspector",bodySettings:"Body settings",templateLibrary:"Template Library",assetLibrary:"Asset Library"},ox={en:eC,hi:{content:"कॉन्टेंट",blocks:"ब्लॉक्स",body:"बॉडी",contentPrompt:"चुने गए कॉलम में क्लिक करें या ड्रैग करें",selectColumnFirst:"पहले एक कॉलम चुनें",layoutLibraryPrompt:"कैनवास में लेआउट स्ट्रक्चर ड्रैग करें",bodyCanvasWidth:"{width}px कैनवास",startBlankCanvas:"खाली कैनवास से शुरू करें",startBlankCanvasHelp:"अपनी पहली रो बनाने के लिए कोई भी ब्लॉक यहां ड्रैग करें, या कंटेंट लाइब्रेरी से ब्लॉक पर क्लिक करें।",allBlocksAvailable:"सभी समर्थित ब्लॉक यहां उपलब्ध हैं। क्लिक करें या उन्हें कैनवास में ड्रैग करें।",draggingComponent:"कंपोनेंट ड्रैग हो रहा है",previewDesign:"डिज़ाइन प्रीव्यू",backToEdit:"एडिट पर वापस जाएं",desktopView:"डेस्कटॉप व्यू",mobileView:"मोबाइल व्यू",undo:"पूर्ववत",redo:"दोहराएं",saveVersion:"वर्ज़न सेव करें",copyDesignJson:"डिज़ाइन JSON कॉपी करें",copyExportedHtml:"एक्सपोर्टेड HTML कॉपी करें",expandRightPanel:"राइट पैनल फैलाएं",collapseRightPanel:"राइट पैनल समेटें",contentTools:"कॉन्टेंट टूल्स",blockInspector:"ब्लॉक इंस्पेक्टर",bodySettings:"बॉडी सेटिंग्स",templateLibrary:"टेम्पलेट लाइब्रेरी",assetLibrary:"एसेट लाइब्रेरी"},ar:{content:"المحتوى",blocks:"الكتل",body:"الهيكل",contentPrompt:"انقر أو اسحب إلى العمود المحدد",selectColumnFirst:"اختر عمودًا أولاً",layoutLibraryPrompt:"اسحب تخطيطًا إلى مساحة العمل",bodyCanvasWidth:"لوحة بعرض {width}px",startBlankCanvas:"ابدأ بلوحة فارغة",startBlankCanvasHelp:"اسحب أي كتلة هنا لإنشاء الصف الأول، أو انقر على كتلة من مكتبة المحتوى.",allBlocksAvailable:"كل الكتل المدعومة متاحة هنا. انقر أو اسحبها إلى اللوحة.",draggingComponent:"جارٍ سحب المكوّن",previewDesign:"معاينة التصميم",backToEdit:"العودة إلى التحرير",desktopView:"عرض سطح المكتب",mobileView:"عرض الجوال",undo:"تراجع",redo:"إعادة",saveVersion:"حفظ الإصدار",copyDesignJson:"نسخ JSON التصميم",copyExportedHtml:"نسخ HTML المصدّر",expandRightPanel:"توسيع اللوحة اليمنى",collapseRightPanel:"طي اللوحة اليمنى",contentTools:"أدوات المحتوى",blockInspector:"مفتش الكتلة",bodySettings:"إعدادات الهيكل",templateLibrary:"مكتبة القوالب",assetLibrary:"مكتبة الأصول"}},M8=(e="en",t)=>({...eC,...ox[e]??ox.en,...t??{}}),O8=({activatorEvent:e,draggingNodeRect:t,transform:n})=>{var r;if(!t||!e)return n;const i=e,s=((r=i.touches)==null?void 0:r[0])??i,o=s.clientX,a=s.clientY;return typeof o!="number"||typeof a!="number"?n:{...n,x:n.x+(o-t.left)-t.width/2,y:n.y+(a-t.top)-t.height/2}},R8=({initialDesign:e,mergeTags:t,previewContexts:n,assetSources:r,assetConnectors:i,config:s,sharedTemplates:o,onSaveSharedTemplate:a,onDeleteSharedTemplate:l,onDesignChange:d})=>{var u,h,p,m,g,b,A,y,w,C,E,S,k,I,L,R,B;const O=v.useMemo(()=>N8(s),[s]),Y=O.tools??[],Q=v.useMemo(()=>Object.fromEntries(Y.map(x=>[x.id,x])),[Y]),W=v.useMemo(()=>Object.fromEntries(Y.map(x=>[x.id,x.exportHtml])),[Y]),ie=v.useMemo(()=>O.fonts??[],[O.fonts]),J=v.useMemo(()=>ie.map(x=>x.url).filter(x=>!!x),[ie]),H=x=>{const $=structuredClone(x.values);let ne="";try{ne=String(x.exportHtml($)??"")}catch{}return{_tool:x.id,...$,_html:ne}},te=v.useMemo(()=>{var x,$;return M8((x=O.localization)==null?void 0:x.locale,($=O.localization)==null?void 0:$.messages)},[(u=O.localization)==null?void 0:u.locale,(h=O.localization)==null?void 0:h.messages]),G=v.useMemo(()=>I8(O),[O]),M=O.entitlements,F=O.policy,ce=Ei(M,"preview.inbox"),ve=Ei(M,"qa.audit"),Ne=Ei(M,"appearance.custom_themes"),ye=c.jsx("img",{className:"edm-content-footer-logo edm-wl-logo",src:((p=O.branding)==null?void 0:p.paletteLogoUrl)||E8,alt:((m=O.branding)==null?void 0:m.paletteLogoAlt)||k8}),xe=v.useMemo(()=>({content:G.content&&lh(M,"content"),blocks:G.blocks&&lh(M,"blocks"),body:G.body&&lh(M,"body")}),[G,M]),ht=Nj(F)||O.role==="viewer",wt=na(M,F,"ai.generate")||na(M,F,"ai.rewrite")||na(M,F,"ai.subjects")||na(M,F,"ai.alt_text"),jt=na(M,F,"ai.assistant"),de=wt||jt,pt=v.useMemo(()=>{var x;return de?S8((x=O.ai)==null?void 0:x.adapter):void 0},[de,(g=O.ai)==null?void 0:g.adapter]),mt=!ht&&jt&&!!(pt!=null&&pt.editDesign),Ee=Ij(F),Ot=O.builder??"email",Jt=v.useMemo(()=>bj(O.exporters),[O.exporters]),[Tt,xn]=v.useState(""),[et,ee]=v.useState(xe.content?"content":xe.blocks?"blocks":"body"),[z,fe]=v.useState("library"),[Z,Oe]=v.useState(null),[je,rt]=v.useState("edit"),[it,He]=v.useState("desktop"),[Pe,Nn]=v.useState("default"),[Xi,In]=v.useState(!1),[Dr,es]=v.useState(!1),[ts,lt]=v.useState(!1),[we,ue]=v.useState(!1),[hr,Qs]=v.useState(""),[pr,Vs]=v.useState(!1),[ct,Ft]=v.useState([]),[ft,vn]=v.useState(null),[Ye,oe]=v.useState(null),[he,St]=v.useState(null),[_t,xt]=v.useState(null),[dt,bt]=v.useState(null),[mr,kt]=v.useState(null),[$n,fr]=v.useState(()=>typeof window>"u"?1440:window.innerWidth),[qn,ns]=v.useState(()=>Yh(r8,typeof window>"u"?1440:window.innerWidth)),[_,j]=v.useState(!1),[pe,qe]=v.useState(!1),[Nt,vt]=v.useState([]),[rs,xu]=v.useState(o??[]),[qs,Tl]=v.useState(t??{}),[is,ss]=v.useState(()=>n!=null&&n.length?n:[ex(t)]),[Sl,_l]=v.useState(()=>{var x;return((x=n==null?void 0:n[0])==null?void 0:x.id)??"preview-context-default"}),[Vf,qf]=v.useState(null),[Js,gr]=v.useState(null),Jf=v.useRef(!1),Zs=v.useRef(qn),Zf=v.useRef(null),le=be(x=>x.design),pn=be(x=>x.selectedBlockId),Ar=be(x=>x.selectedColumnId),cC=be(x=>x.canUndo),dC=be(x=>x.canRedo),Vr=be(x=>x.snapshots),bi=be(x=>x.setDesign),Xf=be(x=>x.addRow),uC=be(x=>x.addRowAtIndex),eg=be(x=>x.duplicateRow),vu=be(x=>x.moveRow),hC=be(x=>x.reorderRows),tg=be(x=>x.removeRow),Nl=be(x=>x.addColumn),ng=be(x=>x.removeColumn),pC=be(x=>x.setRowLayout),mC=be(x=>x.setRowColumnWidths),fC=be(x=>x.updateRowSettings),gC=be(x=>x.updateColumnSettings),wu=be(x=>x.addBlock),ku=be(x=>x.addBlockAtIndex),AC=be(x=>x.addBlockAsRow),Eu=be(x=>x.updateBody),rg=be(x=>x.updateDesignTokens),bC=v.useCallback(()=>{const x=structuredClone(le);for(const $ of x.body.rows)for(const ne of $.columns)for(const ae of ne.blocks){const Fe=ae.values;(ae.type==="heading"||ae.type==="text")&&(Fe.color="token.text"),ae.type==="table"&&(Fe.text_color="token.text"),"container_padding"in Fe&&(Fe.container_padding="token.spacing")}bi(x)},[le,bi]),Go=be(x=>x.selectColumn),Wo=be(x=>x.selectBlock),Il=be(x=>x.updateBlock),ig=be(x=>x.updateBlockMeta),Dl=be(x=>x.duplicateBlock),sg=be(x=>x.removeBlock),qr=v.useCallback((x,$)=>{vn({kind:x,id:$})},[]),yC=v.useCallback(()=>{vn(x=>((x==null?void 0:x.kind)==="block"?sg(x.id):(x==null?void 0:x.kind)==="row"?tg(x.id):(x==null?void 0:x.kind)==="column"&&ng(x.id),null))},[sg,tg,ng]),xC=be(x=>x.moveBlock),Cu=be(x=>x.moveBlockToIndex),yi=be(x=>x.saveSnapshot),vC=be(x=>x.restoreSnapshot),wC=be(x=>x.clearSnapshots),Tu=be(x=>x.undo),Ml=be(x=>x.redo),kC=be(x=>x.copyBlock),EC=be(x=>x.cutBlock),og=be(x=>x.pasteBlock),ag=be(x=>x.moveBlockDirection),lg=be(x=>x.clipboardBlock),Su=be(x=>x.tableSelection),CC=be(x=>x.setTableSelection),cg=be(x=>x.setCustomExporters);v.useEffect(()=>{const x=$=>{const ne=$.target;if(ne&&(ne.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(ne.tagName)))return;const ae=$.metaKey||$.ctrlKey,Fe=$.key.toLowerCase();ae&&Fe==="z"?($.preventDefault(),$.shiftKey?Ml():Tu()):ae&&Fe==="y"?($.preventDefault(),Ml()):ae&&Fe==="s"?($.preventDefault(),yi(void 0,"manual")):ae&&Fe==="d"&&pn?($.preventDefault(),Dl(pn)):$.key==="Delete"&&pn&&($.preventDefault(),qr("block",pn))};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[Tu,Ml,yi,Dl,qr,pn]),v.useEffect(()=>{e&&bi(e)},[e,bi]),v.useEffect(()=>{vt(o8())},[]),v.useEffect(()=>{xu(o??[])},[o]),v.useEffect(()=>{et==="content"&&xe.content||et==="blocks"&&xe.blocks||et==="body"&&xe.body||ee(xe.content?"content":xe.blocks?"blocks":"body")},[xe,et]),v.useEffect(()=>{Tl(t??{})},[t]),v.useEffect(()=>{var x;ss(n!=null&&n.length?n:[ex(t)]),_l(((x=n==null?void 0:n[0])==null?void 0:x.id)??"preview-context-default")},[t,n]);const Ol=v.useMemo(()=>is.find(x=>x.id===Sl)??is[0]??null,[Sl,is]),Hn=v.useMemo(()=>nL(Ol,JE(qs)),[Ol,qs]);v.useEffect(()=>{cg(W)},[W,cg]);const dg=v.useRef(!1);v.useEffect(()=>{if(dg.current)return;dg.current=!0;const x=_8(Ot);Ot!=="email"&&le.body.rows.length===0&&le.body.content_width!==x&&Eu({content_width:x})},[]),v.useEffect(()=>{d==null||d(le),xn(Qn(le,{fullDocument:!0,mergeTags:Hn,tools:W,fontImports:J}))},[le,d,Hn,W,J]),v.useEffect(()=>{(!pn||pn!==Js)&&gr(null)},[Js,pn]),v.useEffect(()=>{if(!Js)return;const x=$=>{const ne=$.target;ne instanceof Element&&(ne.closest(".edm-block-card, .edm-sidebar-right, .edm-toolbar, [role='dialog'], [role='menu'], [role='listbox']")||yg())};return document.addEventListener("pointerdown",x),()=>{document.removeEventListener("pointerdown",x)}},[Js]),v.useEffect(()=>{if(!Jf.current){Jf.current=!0;return}const x=window.setTimeout(()=>{yi("Auto-save","autosave")},1500);return()=>window.clearTimeout(x)},[le,yi]);const Jn=v.useMemo(()=>tB(le,pn),[le,pn]),Xs=v.useMemo(()=>Vr.find(x=>x.id===Vf)??null,[Vf,Vr]),[_u,TC]=v.useState(""),ug=v.useMemo(()=>{const x=_u.trim().toLowerCase();return x?Vr.filter($=>[$.label,$.kind,zh($.createdAt)].join(" ").toLowerCase().includes(x)):Vr},[_u,Vr]),SC=v.useMemo(()=>Xs?Qn(Xs.design,{fullDocument:!0,mergeTags:Hn}):"",[Xs,Hn]),br=v.useMemo(()=>(pn?ZE(le,pn):null)??(Ar?jd(le,Ar):null),[le,pn,Ar]),_C=v.useMemo(()=>r??[],[r]),NC=v.useMemo(()=>{var x,$,ne;return[...i??[],...($=(x=O.assets)==null?void 0:x.googleDrive)!=null&&$.clientId?[y8({clientId:O.assets.googleDrive.clientId,developerKey:O.assets.googleDrive.developerKey,appId:O.assets.googleDrive.appId,scope:O.assets.googleDrive.scope})]:[],...(ne=O.assets)!=null&&ne.s3Connector?[O.assets.s3Connector]:[]]},[i,(b=O.assets)==null?void 0:b.googleDrive,(A=O.assets)==null?void 0:A.s3Connector]),hg=v.useMemo(()=>_t?Kh(le,_t):null,[_t,le]),pg=v.useMemo(()=>le.body.rows.findIndex(x=>x.id===dt),[dt,le.body.rows]),IC=DT(IT(ym,{activationConstraint:{distance:8}})),as=$n<=s8,DC=v.useMemo(()=>{var x;return D8((x=O.appearance)==null?void 0:x.theme)},[(y=O.appearance)==null?void 0:y.theme]),MC=v.useMemo(()=>{const x=le.design_tokens??{},$={"--edm-token-primary":x.primary??le.body.text_color,"--edm-token-accent":x.accent??le.body.link_color,"--edm-token-background":x.background??le.body.background_color,"--edm-token-text":x.text??le.body.text_color,"--edm-token-radius":x.radius??"18px","--edm-token-spacing":x.spacing??"24px"};for(const[ne,ae]of Object.entries(x))typeof ae=="string"&&ae.length>0&&($[`--edm-token-${ne}`]=ae);return $},[le.design_tokens,le.body.text_color,le.body.link_color,le.body.background_color]),mg=v.useMemo(()=>{const x=_1(le.body.custom_css);return x?`@scope (.edm-stage) {
|
|
282
|
+
${x}
|
|
283
|
+
}`:""},[le.body.custom_css]),fg=((w=O.appearance)==null?void 0:w.direction)??"ltr",gg=v.useMemo(()=>{var x;const $=(x=O.appearance)==null?void 0:x.customCss,ne=(Array.isArray($)?$.join(`
|
|
284
|
+
`):$??"").trim();return ne?ne.replace(/<\/?\s*(?:style|script)[^>]*>/gi,""):""},[(C=O.appearance)==null?void 0:C.customCss]),Dn=(E=O.ui)==null?void 0:E.toolbar,Nu=((Dn==null?void 0:Dn.customActions)??[]).filter(x=>ds(M,x.id)),OC=Nu.filter(x=>(x.placement??"right")==="left"),RC=Nu.filter(x=>x.placement==="center"),LC=Nu.filter(x=>(x.placement??"right")==="right"),jC=(Dn==null?void 0:Dn.undoRedo)!==!1&&ds(M,"undo_redo")&&Ei(M,"editor.undo_redo"),BC=(Dn==null?void 0:Dn.saveVersion)!==!1&&ds(M,"save_version")&&Ei(M,"editor.save_version"),PC=(Dn==null?void 0:Dn.deviceToggle)!==!1&&ds(M,"device_toggle"),FC=(Dn==null?void 0:Dn.preview)!==!1&&ds(M,"preview"),Iu=(Dn==null?void 0:Dn.exportJson)!==!1&&ds(M,"export_json")&&Ei(M,"editor.export_json"),Rl=(Dn==null?void 0:Dn.exportHtml)!==!1&&ds(M,"export_html")&&Ei(M,"editor.export_html"),$C=je==="preview"?{gridTemplateColumns:"1fr"}:as?void 0:{gridTemplateColumns:`minmax(0, 1fr) ${as?$n:_?i8:qn}px`},Du=v.useMemo(()=>w1(le),[le]),Mr=Du.body,Mu=it==="desktop"?{maxWidth:`${Mr.content_width}px`,marginLeft:Mr.content_align==="left"?"0":"auto",marginRight:Mr.content_align==="right"?"0":"auto",background:Mr.background_color,fontFamily:Mr.font_family,fontWeight:Mr.font_weight}:{maxWidth:`${Math.min(Mr.content_width,420)}px`,marginLeft:"auto",marginRight:"auto",background:Mr.background_color,fontFamily:Mr.font_family,fontWeight:Mr.font_weight},Ag=v.useMemo(()=>Jn?Dp.find(x=>x.type===Jn.type)??null:null,[Jn]),HC=v.useMemo(()=>tL(le),[le]),UC=v.useMemo(()=>[...Dp.filter(x=>Ip(M,x.type)).map(x=>({key:x.type,label:x.title,icon:x.icon,draggableId:`palette:${x.type}`,onClick:()=>wu(x.type,Ar)})),...Y.map(x=>({key:`custom:${x.id}`,label:x.label,icon:x.icon??"content",draggableId:`palette:custom:${x.id}`,onClick:()=>wu("custom",Ar,H(x))}))],[wu,M,Ar,Y]),bg=x=>{const $=x.replace("palette:","");if($.startsWith("custom:")){const ae=Y.find(Fe=>Fe.id===$.replace("custom:",""));return ae?{type:"custom",initialValues:H(ae),allowed:!0}:null}const ne=$;return{type:ne,allowed:Ip(M,ne)}};v.useEffect(()=>{const x=()=>{const $=window.innerWidth;fr($),ns(ne=>Yh(ne,$))};return x(),window.addEventListener("resize",x),()=>window.removeEventListener("resize",x)},[]);const Yo=x=>{x==="content"&&!xe.content||x==="blocks"&&!xe.blocks||x==="body"&&!xe.body||(ee(x),_&&!as&&(j(!1),ns(Zs.current)))},GC=()=>{gr(null),fe("library"),xe.blocks&&Yo("blocks")},eo=()=>{fe("selection"),xe.blocks&&Yo("blocks")},yg=()=>{gr(null),Wo(null,null),Go(null),fe("library"),Yo(xe.content?"content":xe.blocks?"blocks":"body")},WC=x=>{var $,ne,ae,Fe;if(x.kind==="block"){const{blockId:Qe,columnId:Zn}=x,on=le.body.rows.flatMap(yr=>yr.columns).find(yr=>yr.blocks.some(Un=>Un.id===Qe)),Mn=on?on.blocks.findIndex(yr=>yr.id===Qe):-1,to=(on==null?void 0:on.blocks.length)??0,Jr=Mn>=0?on==null?void 0:on.blocks[Mn]:void 0,zo=!!(Jr!=null&&Jr.locked),Eg=!!(Jr!=null&&Jr.locked||Jr!=null&&Jr.delete_locked),Lu=[];if((Jr==null?void 0:Jr.type)==="table"){const yr=tu(Jr.values.rows),Un=Su&&Su.blockId===Qe?Su:null,On=Un?nu(yr,Un.anchor.r,Un.anchor.c,Un.focus.r,Un.focus.c):null,fT=On?On.r1!==On.r2||On.c1!==On.c2:!1,no=Un&&Un.anchor.r===Un.focus.r&&Un.anchor.c===Un.focus.c?Un.anchor:null,jl=no&&(((ne=($=yr[no.r])==null?void 0:$[no.c])==null?void 0:ne.colspan)??1)*(((Fe=(ae=yr[no.r])==null?void 0:ae[no.c])==null?void 0:Fe.rowspan)??1)>1?no:null;Lu.push({label:"Merge cells",disabled:!fT,onClick:()=>{On&&(Il(Qe,{rows:Wc(Tp(C1(yr,On.r1,On.c1,On.r2,On.c2)))}),CC({blockId:Qe,anchor:{r:On.r1,c:On.c1},focus:{r:On.r1,c:On.c1}}))}},{label:"Split cell",disabled:!jl,onClick:()=>{jl&&Il(Qe,{rows:Wc(Tp(T1(yr,jl.r,jl.c)))})}})}return[{label:"Edit settings",onClick:()=>{Wo(Qe,Zn),gr(null),eo()}},...Lu.length?["divider",...Lu]:[],"divider",{label:"Cut",shortcut:"⌘X",disabled:Eg,onClick:()=>EC(Qe)},{label:"Copy",shortcut:"⌘C",onClick:()=>kC(Qe)},{label:"Paste",shortcut:"⌘V",disabled:!lg,onClick:()=>og(Zn,Qe)},{label:"Duplicate",shortcut:"⌘D",disabled:zo,onClick:()=>Dl(Qe)},"divider",{label:"Move up",disabled:zo||Mn<=0,onClick:()=>ag(Qe,"up")},{label:"Move down",disabled:zo||Mn<0||Mn>=to-1,onClick:()=>ag(Qe,"down")},"divider",{label:zo?"Unlock":"Lock",onClick:()=>ig(Qe,{locked:!zo})},"divider",{label:"Delete",danger:!0,shortcut:"Del",disabled:Eg,onClick:()=>qr("block",Qe)}]}if(x.kind==="row"){const{rowId:Qe}=x,Zn=le.body.rows.findIndex(to=>to.id===Qe),on=le.body.rows[Zn],Mn=!!(on!=null&&on.settings.layout_locked);return[{label:"Edit settings",onClick:()=>{var to;Go(((to=on==null?void 0:on.columns[0])==null?void 0:to.id)??null),gr(null),eo()}},"divider",{label:"Duplicate row",disabled:Mn,onClick:()=>eg(Qe)},{label:"Add column",disabled:Mn||((on==null?void 0:on.columns.length)??0)>=4,onClick:()=>Nl(Qe)},"divider",{label:"Move up",disabled:Mn||Zn<=0,onClick:()=>vu(Qe,"up")},{label:"Move down",disabled:Mn||Zn>=le.body.rows.length-1,onClick:()=>vu(Qe,"down")},"divider",{label:"Delete row",danger:!0,disabled:Mn,onClick:()=>qr("row",Qe)}]}const{columnId:Ue}=x,Ze=le.body.rows.find(Qe=>Qe.columns.some(Zn=>Zn.id===Ue)),Gt=!!(Ze!=null&&Ze.settings.layout_locked);return[{label:"Edit settings",onClick:()=>{Go(Ue),gr(null),eo()}},"divider",{label:"Paste here",shortcut:"⌘V",disabled:!lg,onClick:()=>og(Ue)},{label:"Add column",disabled:Gt||((Ze==null?void 0:Ze.columns.length)??0)>=4,onClick:()=>Ze&&Nl(Ze.id)},"divider",{label:"Delete column",danger:!0,disabled:Gt,onClick:()=>qr("column",Ue)}]},YC=()=>{if(!as){if(_){j(!1),ns(Zs.current);return}Zs.current=qn,j(!0)}},zC=x=>{if(as)return;x.preventDefault(),_&&(j(!1),ns(Zs.current));const $=x.clientX,ne=_?Zs.current:qn,ae=Ue=>{const Ze=Yh(ne-(Ue.clientX-$),window.innerWidth);ns(Ze),Zs.current=Ze},Fe=()=>{window.removeEventListener("pointermove",ae),window.removeEventListener("pointerup",Fe)};window.addEventListener("pointermove",ae),window.addEventListener("pointerup",Fe)},KC=x=>{const $=String(x.active.id);if($.startsWith("row:")){bt($.replace("row:","")),kt(null),oe(null),St(null),xt(null);return}if($.startsWith("palette:")){const ne=bg($);if(!ne||!ne.allowed)return;oe(ne.type),St(null),xt(null),bt(null),kt(null);return}if($.startsWith("palette-row:")){St($.replace("palette-row:","")),oe(null),xt(null),bt(null),kt(null);return}bt(null),kt(null),xt($)},QC=x=>{var $;if(!dt)return;const ne=($=x.over)!=null&&$.id?String(x.over.id):null;if(ne!=null&&ne.startsWith("row:")){kt(ne.replace("row:",""));return}kt(null)},VC=x=>{var $;if(!x.active.id||!(($=x.over)!=null&&$.id)){oe(null),St(null),xt(null),bt(null),kt(null);return}const ne=String(x.active.id),ae=String(x.over.id);if(ne.startsWith("row:")){ae.startsWith("row:")&&hC(ne.replace("row:",""),ae.replace("row:","")),oe(null),St(null),xt(null),bt(null),kt(null);return}if(ne.startsWith("palette:")){const Ze=bg(ne);if(!Ze||!Ze.allowed){oe(null),St(null),xt(null),bt(null),kt(null);return}const Gt=Ze.type,Qe=Ze.initialValues,Zn=pm(ae),on=Kh(le,ae)?nx(le,x,ae):null;if(ae==="canvas-root"){AC(Gt,Qe),oe(null),xt(null),bt(null),kt(null);return}if(Zn)ku(Gt,Zn.columnId,Zn.index,Qe);else if(on)ku(Gt,on.columnId,on.index,Qe);else if(ae.startsWith("column:")){const Mn=ae.replace("column:","");ku(Gt,Mn,rx(le,x,Mn),Qe)}oe(null),St(null),xt(null),bt(null),kt(null);return}if(ne.startsWith("palette-row:")){const Ze=ne.replace("palette-row:",""),Gt=c8(le,x,ae);uC(Ze,Gt),oe(null),St(null),xt(null),bt(null),kt(null);return}const Fe=pm(ae),Ue=Kh(le,ae)?nx(le,x,ae):null;if(Fe){Cu(ne,Fe.columnId,Fe.index),oe(null),St(null),xt(null),bt(null),kt(null);return}if(Ue){Cu(ne,Ue.columnId,Ue.index),oe(null),St(null),xt(null),bt(null),kt(null);return}if(ae.startsWith("column:")){const Ze=ae.replace("column:","");Cu(ne,Ze,rx(le,x,Ze)),oe(null),St(null),xt(null),bt(null),kt(null);return}xC(ne,ae),oe(null),St(null),xt(null),bt(null),kt(null)},qC=()=>{oe(null),St(null),xt(null),bt(null),kt(null)},JC=async()=>{const x=Qn(le,{fullDocument:!0,mergeTags:Hn,tools:W,fontImports:J});xn(x),typeof navigator<"u"&&navigator.clipboard&&await navigator.clipboard.writeText(x)},ZC=async()=>{const x=ru(le,{mergeTags:Hn,tools:W,fontImports:J});return typeof navigator<"u"&&navigator.clipboard&&await navigator.clipboard.writeText(x),x},XC=async()=>{const x=JSON.stringify(le,null,2);typeof navigator<"u"&&navigator.clipboard&&await navigator.clipboard.writeText(x)},eT=()=>{if(typeof document>"u")return;const x=new Blob([JSON.stringify(le,null,2)],{type:"application/json"}),$=document.createElement("a");$.href=URL.createObjectURL(x),$.download=`${(le.title||"edm-design").toLowerCase().replace(/\s+/g,"-")}.json`,$.click(),URL.revokeObjectURL($.href)},tT=async x=>{if(lt(!1),!(typeof document>"u"))try{const $=await x.run(le,{mergeTags:Hn,tools:W,fontImports:J}),ne=String(le.title||"email").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,60)||"email",ae=$ instanceof Uint8Array?$.slice().buffer:$,Fe=new Blob([ae],{type:x.mimeType}),Ue=document.createElement("a");Ue.href=URL.createObjectURL(Fe),Ue.download=`${ne}.${x.extension}`,Ue.click(),URL.revokeObjectURL(Ue.href)}catch($){window.alert($ instanceof Error?$.message:"Export failed.")}},xg=async()=>{const x=hr.trim();if(!x||pr||!(pt!=null&&pt.editDesign))return;const $={id:`msg-${Math.random().toString(36).slice(2,10)}`,role:"user",content:x},ne=ct.map(({role:ae,content:Fe})=>({role:ae,content:Fe}));Ft(ae=>[...ae,$]),Qs(""),Vs(!0);try{const ae=await pt.editDesign({message:x,design:le,history:ne,mergeTags:Hn});ae.design&&(yi("Before AI assistant edit","autosave"),bi(ae.design)),Ft(Fe=>[...Fe,{id:`msg-${Math.random().toString(36).slice(2,10)}`,role:"assistant",content:ae.summary||"Done."}])}catch(ae){Ft(Fe=>[...Fe,{id:`msg-${Math.random().toString(36).slice(2,10)}`,role:"assistant",content:ae instanceof Error?`Sorry, ${ae.message}`:"Sorry, something went wrong."}])}finally{Vs(!1)}},nT=async x=>{if(x)try{const $=await x.text(),ne=ej(JSON.parse($)),ae=tx(ne,M);if(ae.length>0){window.alert(`This design contains restricted blocks for the current plan: ${ae.join(", ")}.`);return}bi(ne)}catch($){window.alert($ instanceof Error?$.message:"Unable to import that design.")}},rT=()=>{const x=window.prompt("Template name",le.title||"My template");if(!x)return;const $=[{id:`template-${Math.random().toString(36).slice(2,10)}`,name:x,savedAt:new Date().toISOString(),design:structuredClone(le)},...Nt];vt($),Xy($),yi(`Template saved: ${x}`,"manual")},iT=async()=>{const x=window.prompt("Shared template name",le.title||"Team template");if(!x)return;const $={id:`shared-template-${Math.random().toString(36).slice(2,10)}`,name:x,savedAt:new Date().toISOString(),design:structuredClone(le),scope:"team",owner:"Team"},ne=[$,...rs];xu(ne),await(a==null?void 0:a($)),yi(`Shared template saved: ${x}`,"manual")},Ou=x=>{const $=tx(x,M);if($.length>0){window.alert(`This template contains restricted blocks for the current plan: ${$.join(", ")}.`);return}bi(x),qe(!1)},sT=x=>{const $=Nt.filter(ne=>ne.id!==x);vt($),Xy($)},oT=async x=>{xu($=>$.filter(ne=>ne.id!==x)),await(l==null?void 0:l(x))},aT=()=>{var x,$;const ne=(x=window.prompt("Merge tag key","customer_name"))==null?void 0:x.trim();if(!ne)return;const ae=ne.replace(/\s+/g,"_"),Fe=(($=window.prompt("Merge tag label",ae.replace(/_/g," ")))==null?void 0:$.trim())||ae;Tl(Ue=>{if(Ue[ae])return Ue;const Ze={...Ue,[ae]:{label:Fe,value:Cs(ae),sample:""}};return ss(Gt=>Gt.map(Qe=>({...Qe,values:{...Qe.values,[ae]:Qe.values[ae]??""}}))),Ze})},lT=(x,$)=>{Tl(ne=>{const ae=ne[x];return ae?{...ne,[x]:{...ae,...$.label!==void 0?{label:$.label}:{},...$.sample!==void 0?{sample:$.sample}:{}}}:ne}),$.sample!==void 0&&ss(ne=>ne.map((ae,Fe)=>Fe===0?{...ae,values:{...ae.values,[x]:$.sample??""}}:ae))},cT=x=>{Tl($=>{if(!$[x])return $;const ne={...$};return delete ne[x],ne}),ss($=>$.map(ne=>{const ae={...ne.values};return delete ae[x],{...ne,values:ae}}))},dT=()=>{var x;const $=(x=window.prompt("Preview context name",`Context ${is.length+1}`))==null?void 0:x.trim();if(!$)return;const ne={id:`preview-context-${Math.random().toString(36).slice(2,10)}`,name:$,values:{...Hn}};ss(ae=>[ne,...ae]),_l(ne.id)},uT=x=>{var $;if(is.length<=1)return;const ne=is.filter(ae=>ae.id!==x);ss(ne),_l((($=ne[0])==null?void 0:$.id)??"preview-context-default")},hT=(x,$)=>{ss(ne=>ne.map(ae=>ae.id===Sl?{...ae,values:{...ae.values,[x]:$}}:ae))},vg=()=>{const x=window.prompt("Version name",`Version ${Vr.length+1}`);x!==null&&yi(x.trim()||"Manual save","manual")},Ru=v.useMemo(()=>({design:le,selectedBlockId:pn,selectedColumnId:Ar}),[le,pn,Ar]),Or=Pe!=="default"?Np.find(x=>x.id===Pe):void 0,pT=Or?oj(Tt,Or.id):Tt,Ll=v.useMemo(()=>{var x;return ve?hj(le,{validators:(x=O.qa)==null?void 0:x.validators}):[]},[ve,le,(S=O.qa)==null?void 0:S.validators]),wn=Ll.reduce((x,$)=>({...x,[$.severity]:(x[$.severity]??0)+1}),{}),wg=wn.error?wn.error:wn.warning?wn.warning:null,mT=wn.error?"error":"warning",kg=c.jsxs("div",{className:`edm-shell${((k=O.appearance)==null?void 0:k.mode)==="dark"?" edm-shell--dark":""}${je==="preview"?" edm-shell--preview":""}`,style:{...$C,...DC,...MC},dir:fg,"data-edm-dir":fg,children:[gg?c.jsx("style",{children:gg}):null,mg?c.jsx("style",{children:mg}):null,c.jsxs("main",{className:"edm-workspace",children:[c.jsxs("header",{className:"edm-toolbar",role:"toolbar","aria-label":"Editor toolbar",children:[ht&&c.jsx("span",{className:"edm-readonly-badge",role:"status",children:"Read-only"}),c.jsxs("div",{className:"edm-toolbar-main",children:[c.jsxs("div",{className:"edm-toolbar-group",children:[jC&&c.jsxs(c.Fragment,{children:[c.jsx(Wn,{icon:"undo",label:te.undo,disabled:!cC,onClick:Tu}),c.jsx(Wn,{icon:"redo",label:te.redo,disabled:!dC,onClick:Ml})]}),BC&&c.jsx(Wn,{icon:"save",label:te.saveVersion,onClick:vg}),OC.map(x=>c.jsx(ch,{label:x.label,icon:x.icon,onClick:()=>x.onClick(Ru)},x.id))]}),c.jsxs("div",{className:"edm-toolbar-group edm-toolbar-group-center",children:[PC&&c.jsxs(c.Fragment,{children:[c.jsx(Wn,{icon:"desktop",label:te.desktopView,active:it==="desktop",onClick:()=>He("desktop")}),c.jsx(Wn,{icon:"mobile",label:te.mobileView,active:it==="mobile",onClick:()=>He("mobile")})]}),je==="preview"&&ce&&c.jsxs("select",{className:"edm-preview-client-select",value:Pe,onChange:x=>Nn(x.target.value),title:"Preview in an email client","aria-label":"Preview in an email client",children:[c.jsx("option",{value:"default",children:"Default render"}),Np.map(x=>c.jsx("option",{value:x.id,children:x.label},x.id))]}),RC.map(x=>c.jsx(ch,{label:x.label,icon:x.icon,onClick:()=>x.onClick(Ru)},x.id))]}),c.jsxs("div",{className:"edm-toolbar-group",children:[ve&&c.jsx(Wn,{icon:"check",label:wg?`Audit, ${wn.error??0} error${(wn.error??0)===1?"":"s"}, ${wn.warning??0} warning${(wn.warning??0)===1?"":"s"}`:"Audit, no issues",active:Xi,badge:wg,badgeTone:mT,onClick:()=>In(x=>!x)}),mt&&c.jsx(Wn,{icon:"sparkles",label:"AI assistant, describe a change",active:we,onClick:()=>ue(x=>!x)}),Ne&&c.jsx(Wn,{icon:"palette",label:"Theme & custom CSS",active:Dr,onClick:()=>es(x=>!x)}),FC&&c.jsx(Wn,{icon:je==="preview"?"edit":"preview",label:je==="preview"?te.backToEdit:te.previewDesign,active:je==="preview",onClick:()=>{if(je==="preview"){rt("edit");return}xn(Qn(le,{fullDocument:!0,mergeTags:Hn,tools:W,fontImports:J})),rt("preview")}}),Iu&&c.jsx(Wn,{icon:"json",label:te.copyDesignJson,onClick:()=>void XC()}),Rl&&c.jsx(Wn,{icon:"html",label:te.copyExportedHtml,onClick:()=>void JC()}),Rl&&c.jsx(Wn,{icon:"amp",label:"Copy AMP (interactive email)",onClick:()=>void ZC()}),Ee&&(Rl||Iu)&&c.jsxs("div",{className:"edm-export-menu",children:[c.jsx(Wn,{icon:"download",label:"Export / download",active:ts,onClick:()=>lt(x=>!x)}),ts&&c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:"edm-export-backdrop","aria-label":"Close export menu",onClick:()=>lt(!1)}),c.jsx("ul",{className:"edm-export-list",role:"menu","aria-label":"Export formats",children:Jt.filter(x=>x.id==="json"?Iu:Rl).map(x=>c.jsx("li",{role:"none",children:c.jsxs("button",{type:"button",role:"menuitem",className:"edm-export-item",onClick:()=>void tT(x),children:[c.jsx("span",{children:x.label}),c.jsxs("span",{className:"edm-export-ext",children:[".",x.extension]})]})},x.id))})]})]}),LC.map(x=>c.jsx(ch,{label:x.label,icon:x.icon,onClick:()=>x.onClick(Ru)},x.id))]})]})]}),c.jsx("section",{className:"edm-canvas","aria-label":"Email canvas",children:je==="edit"?c.jsx("div",{className:`edm-stage edm-stage--${it}`,style:Mu,children:c.jsx(X6,{empty:le.body.rows.length===0,children:c.jsx("div",{className:"edm-canvas-stack",children:le.body.rows.length===0?c.jsxs("div",{className:"edm-empty-canvas",children:[c.jsxs("div",{className:"edm-empty-canvas-illustration","aria-hidden":"true",children:[c.jsx("span",{}),c.jsx("span",{}),c.jsx("span",{})]}),c.jsx("strong",{children:te.startBlankCanvas}),c.jsx("p",{children:te.startBlankCanvasHelp})]}):c.jsx(Hx,{items:Sp(Du.body.rows).map(x=>`row:${x.id}`),strategy:Px,children:Sp(Du.body.rows).map((x,$)=>{const ne=mr===x.id&&dt!==x.id,ae=ne&&pg!==-1?pg<$?"bottom":"top":null,Fe=Js!==null||et!=="content";return c.jsx(n8,{row:x,rowIndex:$,rowCount:le.body.rows.length,isSelected:(br==null?void 0:br.id)===x.id,isRowOver:ne,rowDropSide:ae,hasOpenConfig:Fe,selectedBlockId:pn,inlineEditingBlockId:Js,selectedColumnId:Ar,mergeTags:qs,previewMergeTags:Hn,onClearSelection:yg,onMoveRow:vu,onAddColumn:Nl,onDuplicateRow:eg,onRemoveRow:Ue=>qr("row",Ue),onSelectRow:Ue=>{var Ze;gr(null);const Gt=le.body.rows.find(Qe=>Qe.id===Ue);Go(((Ze=Gt==null?void 0:Gt.columns[0])==null?void 0:Ze.id)??null)},onSelectColumn:Ue=>{gr(null),Go(Ue)},onSelectBlock:(Ue,Ze)=>{gr(null),Wo(Ue,Ze),eo()},onRemoveColumn:Ue=>qr("column",Ue),onDuplicateBlock:Dl,onRemoveBlock:Ue=>qr("block",Ue),onUpdateBlock:Il,onEnterInlineEdit:(Ue,Ze)=>{Wo(Ue,Ze),gr(Ue),eo()},onResizeColumns:mC,onBlockContextMenu:(Ue,Ze,Gt,Qe)=>Oe({x:Gt,y:Qe,target:{kind:"block",blockId:Ue,columnId:Ze}}),onColumnContextMenu:(Ue,Ze,Gt)=>Oe({x:Ze,y:Gt,target:{kind:"column",columnId:Ue}}),onRowContextMenu:(Ue,Ze,Gt)=>Oe({x:Ze,y:Gt,target:{kind:"row",rowId:Ue}})},x.id)})})})})}):c.jsxs("div",{className:"edm-preview-shell",children:[c.jsx("div",{className:`edm-preview-stage edm-stage edm-stage--${Or!=null&&Or.mobile?"mobile":it}`,style:Or?{...Mu,maxWidth:Or.width,width:Or.width}:Mu,children:c.jsx("iframe",{className:"edm-preview-frame",title:"Edm preview",sandbox:"",srcDoc:pT})}),Or?c.jsxs("div",{className:"edm-preview-client-notes",children:[c.jsxs("span",{className:"edm-preview-client-notes-title",children:[Or.label,", how it renders"]}),c.jsx("ul",{children:Or.notes.map(x=>c.jsx("li",{children:x},x))})]}):null]})})]}),c.jsxs("aside",{className:`edm-inspector edm-sidebar-right${_&&!as?" is-collapsed":""}`,children:[c.jsx(d8,{open:pe,starterTemplates:aN,savedTemplates:Nt,sharedTemplates:rs,onClose:()=>qe(!1),onSelectStarter:x=>Ou(structuredClone(x.design)),onSelectSaved:x=>Ou(structuredClone(x.design)),onSelectShared:x=>Ou(structuredClone(x.design)),onDeleteSaved:sT,onDeleteShared:x=>void oT(x)}),!as&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"edm-sidebar-resizer",onPointerDown:zC,role:"separator","aria-label":te.expandRightPanel,"aria-orientation":"vertical"}),c.jsx("button",{type:"button",className:"edm-sidebar-collapse","aria-label":_?te.expandRightPanel:te.collapseRightPanel,title:_?te.expandRightPanel:te.collapseRightPanel,onClick:YC,children:Yi(_?"expand":"collapse")})]}),c.jsxs("div",{className:"edm-builder-panel",role:"complementary","aria-label":"Design settings panel",children:[c.jsxs("div",{className:"edm-builder-content",children:[c.jsxs("div",{className:"edm-builder-scroll",children:[c.jsxs("div",{className:"edm-panel-title",children:[c.jsx("span",{children:et==="blocks"&&z==="selection"&&Jn?(Ag==null?void 0:Ag.title)??Jn.type:et==="blocks"&&z==="selection"&&br?"Row":et==="content"?te.content:et==="blocks"?te.blocks:te.body}),c.jsx("small",{children:et==="blocks"&&z==="selection"&&Jn?"Edit the selected block":et==="blocks"&&z==="selection"&&br?"Edit row and column properties":et==="content"?Ar?te.contentPrompt:te.selectColumnFirst:et==="blocks"?te.layoutLibraryPrompt:te.bodyCanvasWidth.replace("{width}",String(le.body.content_width))})]}),et==="content"&&c.jsx("div",{className:"edm-content-panel",children:ht?c.jsx("p",{className:"edm-readonly-note",role:"note",children:"Editing is disabled for this project."}):c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"edm-tool-grid edm-tool-grid--content",children:UC.map(x=>c.jsx(sB,{label:x.label,icon:x.icon,onClick:x.onClick,draggableId:x.draggableId},x.key))}),(Ye||he)&&c.jsx("div",{className:"edm-content-footer",children:c.jsx("small",{children:te.draggingComponent})})]})}),et==="blocks"&&c.jsx(c.Fragment,{children:z==="selection"&&Jn?c.jsx(gB,{block:Jn,design:le,mergeTags:qs,previewMergeTags:Hn,aiAdapter:pt,aiAllowed:de,assetSources:_C,assetConnectors:NC,onImageUpload:(I=O.assets)==null?void 0:I.onImageUpload,onChange:x=>Jn&&Il(Jn.id,x),onMetaChange:x=>Jn&&ig(Jn.id,x),freeformEnabled:Ot==="page"&&((L=br==null?void 0:br.settings)==null?void 0:L.layout_mode)==="free"}):z==="selection"&&br?c.jsx(oB,{row:br,selectedColumnId:Ar,onApplyLayout:x=>pC(br.id,x),onAddColumn:()=>Nl(br.id),onRemoveColumn:x=>qr("column",x),onUpdateColumnSettings:gC,onUpdateRowSettings:x=>fC(br.id,x),builderMode:Ot}):c.jsxs("div",{className:"edm-blocks-panel",children:[c.jsxs("div",{className:"edm-layout-section",children:[c.jsx("label",{children:"Blank"}),c.jsx(Op,{preset:ms[0],onClick:()=>Xf(ms[0].id)})]}),c.jsxs("div",{className:"edm-layout-section",children:[c.jsx("label",{children:"Layouts"}),c.jsx("div",{className:"edm-layout-grid",children:ms.slice(1).map(x=>c.jsx(Op,{preset:x,onClick:()=>Xf(x.id)},x.id))})]})]})}),et==="body"&&c.jsxs("div",{className:"edm-body-panel",children:[c.jsx(nB,{design:le,mergeTags:Hn,mergeTagDefinitions:qs,aiAdapter:pt,aiAllowed:de,design_tokens:le.design_tokens,background_color:le.body.background_color,content_width:le.body.content_width,font_family:le.body.font_family,customFonts:ie,text_color:le.body.text_color,content_align:le.body.content_align,font_weight:le.body.font_weight,subject_line:le.body.subject_line,preheader_text:le.body.preheader_text,link_color:le.body.link_color,link_underline:le.body.link_underline,html_title:le.body.html_title,onChange:Eu,onChangeTokens:rg,onApplyGeneratedDesign:bi}),(R=O.ui)!=null&&R.previewData?c.jsx(Dj,{mergeTags:qs,previewContexts:is,activePreviewContextId:(Ol==null?void 0:Ol.id)??Sl,availableMergeTagKeys:HC,onSelectPreviewContext:_l,onCreatePreviewContext:dT,onDeletePreviewContext:uT,onUpdatePreviewValue:hT,onAddMergeTag:aT,onUpdateMergeTag:lT,onRemoveMergeTag:cT}):null,c.jsxs("div",{className:"edm-panel-title edm-section-title",children:[c.jsx("span",{children:"Templates"}),c.jsxs("small",{children:[Nt.length," saved locally"]})]}),c.jsx("input",{ref:Zf,type:"file",accept:"application/json",hidden:!0,onChange:x=>{var $;nT((($=x.target.files)==null?void 0:$[0])??null),x.target.value=""}}),c.jsxs("div",{className:"edm-template-actions",children:[c.jsx("button",{type:"button",className:"edm-secondary-button",onClick:()=>qe(!0),children:"Open Library"}),c.jsx("button",{type:"button",className:"edm-secondary-button",onClick:rT,children:"Save Current"}),Ee?c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:"edm-secondary-button",onClick:()=>void iT(),children:"Save to Team"}),c.jsx("button",{type:"button",className:"edm-secondary-button",onClick:()=>{var x;return(x=Zf.current)==null?void 0:x.click()},children:"Import JSON"}),c.jsx("button",{type:"button",className:"edm-secondary-button",onClick:eT,children:"Export JSON"})]}):null]}),c.jsxs("div",{className:"edm-panel-title edm-section-title",children:[c.jsx("span",{children:"Versions"}),c.jsxs("small",{children:[Vr.length," snapshots"]})]}),c.jsxs("div",{className:"edm-history-panel",children:[c.jsxs("div",{className:"edm-history-toolbar",children:[c.jsx("input",{className:"edm-history-search",placeholder:"Filter versions",value:_u,onChange:x=>TC(x.target.value)}),c.jsxs("div",{className:"edm-inline-actions",children:[c.jsx(Dt,{icon:"save",label:"Save snapshot now",onClick:vg}),c.jsx(Dt,{icon:"delete",label:"Clear snapshot history",onClick:wC})]})]}),c.jsxs("div",{className:"edm-history-list",children:[ug.map(x=>{var $,ne;return c.jsxs("div",{className:`edm-history-card${(($=Vr[0])==null?void 0:$.id)===x.id?" is-latest":""}`,children:[c.jsxs("div",{className:"edm-history-card-top",children:[c.jsx("strong",{children:x.label}),c.jsxs("div",{className:"edm-inline-actions",children:[c.jsx(Dt,{icon:"compare",label:`Compare ${x.label}`,onClick:()=>qf(x.id)}),c.jsx(Dt,{icon:"preview",label:`Restore ${x.label}`,onClick:()=>vC(x.id)})]})]}),c.jsxs("div",{className:"edm-history-card-meta",children:[c.jsx("span",{className:`edm-history-kind edm-history-kind--${x.kind}`,children:x.kind==="autosave"?"Auto-save":"Manual"}),((ne=Vr[0])==null?void 0:ne.id)===x.id?c.jsx("span",{className:"edm-history-kind edm-history-kind--latest",children:"Latest"}):null]}),c.jsx("small",{children:zh(x.createdAt)})]},x.id)}),ug.length===0?c.jsxs("div",{className:"edm-empty-state",children:[c.jsx("h3",{children:"No matching versions"}),c.jsx("p",{children:"Try a different filter or save a new checkpoint."})]}):null]})]})]})]}),c.jsx("div",{className:"edm-panel-footer",children:ye})]}),c.jsxs("div",{className:"edm-mode-rail",children:[xe.content&&c.jsxs("button",{type:"button",className:`edm-mode-button${et==="content"?" is-active":""}`,onClick:()=>Yo("content"),"aria-label":te.contentTools,children:[c.jsx("span",{children:Ss("content")}),c.jsx("small",{children:te.content})]}),xe.blocks&&c.jsxs("button",{type:"button",className:`edm-mode-button${et==="blocks"?" is-active":""}`,onClick:GC,"aria-label":te.blockInspector,children:[c.jsx("span",{children:Ss("blocks")}),c.jsx("small",{children:te.blocks})]}),xe.body&&c.jsxs("button",{type:"button",className:`edm-mode-button${et==="body"?" is-active":""}`,onClick:()=>Yo("body"),"aria-label":te.bodySettings,children:[c.jsx("span",{children:Ss("body")}),c.jsx("small",{children:te.body})]})]}),(B=O.branding)!=null&&B.badge?c.jsx("div",{className:"edm-branding-badge",children:O.branding.badge}):null]})]}),Z?c.jsx(AB,{x:Z.x,y:Z.y,items:WC(Z.target),onClose:()=>Oe(null)}):null,Xi&&ve?c.jsxs("aside",{className:"edm-qa-drawer",role:"complementary","aria-label":"Audit",children:[c.jsxs("div",{className:"edm-asset-header",children:[c.jsxs("div",{children:[c.jsx("h3",{children:"Audit"}),c.jsx("p",{children:Ll.length===0?"All checks passed, ready to send.":`${wn.error??0} error${(wn.error??0)===1?"":"s"}, ${wn.warning??0} warning${(wn.warning??0)===1?"":"s"}, ${wn.info??0} note${(wn.info??0)===1?"":"s"}.`})]}),c.jsx("button",{type:"button",className:"edm-secondary-button",onClick:()=>In(!1),children:"Close"})]}),Ll.length===0?c.jsx("div",{className:"edm-qa-empty",children:"✓ No issues found."}):c.jsx("ul",{className:"edm-qa-list",children:Ll.map(x=>c.jsxs("li",{className:`edm-qa-item edm-qa-item--${x.severity}${x.blockId?" is-clickable":""}`,onClick:x.blockId?()=>{Wo(x.blockId,null),gr(null),eo()}:void 0,children:[c.jsx("span",{className:`edm-qa-badge edm-qa-badge--${x.severity}`,children:x.severity==="error"?"!":x.severity==="warning"?"▲":"i"}),c.jsxs("span",{className:"edm-qa-body",children:[c.jsx("span",{className:"edm-qa-message",children:x.message}),x.hint?c.jsx("span",{className:"edm-qa-hint",children:x.hint}):null]}),x.blockId?c.jsx("span",{className:"edm-qa-jump",children:"Go →"}):null]},x.id))})]}):null,we&&mt?c.jsxs("aside",{className:"edm-assistant-drawer",role:"complementary","aria-label":"AI assistant",children:[c.jsxs("div",{className:"edm-asset-header",children:[c.jsxs("div",{children:[c.jsx("h3",{children:"AI assistant"}),c.jsx("p",{children:"Describe a change and I'll edit the design."})]}),c.jsx("button",{type:"button",className:"edm-secondary-button",onClick:()=>ue(!1),children:"Close"})]}),c.jsxs("div",{className:"edm-assistant-messages",children:[ct.length===0?c.jsxs("div",{className:"edm-assistant-empty",children:[c.jsx("p",{children:"Try:"}),c.jsxs("ul",{children:[c.jsx("li",{children:"“Add a footer with an unsubscribe link.”"}),c.jsx("li",{children:"“Change the headline to ‘Summer Sale’.”"}),c.jsx("li",{children:"“Make the button green and say ‘Shop now’.”"})]})]}):ct.map(x=>c.jsx("div",{className:`edm-assistant-msg edm-assistant-msg--${x.role}`,children:x.content},x.id)),pr?c.jsx("div",{className:"edm-assistant-msg edm-assistant-msg--assistant is-busy",children:"Working…"}):null]}),c.jsxs("form",{className:"edm-assistant-input",onSubmit:x=>{x.preventDefault(),xg()},children:[c.jsx("textarea",{value:hr,onChange:x=>Qs(x.target.value),onKeyDown:x=>{x.key==="Enter"&&!x.shiftKey&&(x.preventDefault(),xg())},placeholder:"Describe a change…",rows:2,"aria-label":"Message the assistant",disabled:pr}),c.jsx("button",{type:"submit",className:"edm-primary-button",disabled:pr||!hr.trim(),children:"Send"})]})]}):null,Dr&&Ne&&typeof document<"u"?Ts.createPortal(c.jsx("div",{className:"edm-asset-overlay",role:"dialog","aria-modal":"true",onClick:()=>es(!1),children:c.jsx(iB,{design:le,customFonts:ie,onUpdateBody:Eu,onUpdateTokens:rg,onApplyThemeToBlocks:bC,onClose:()=>es(!1)})}),document.body):null,ft&&typeof document<"u"?Ts.createPortal(c.jsx("div",{className:"edm-asset-overlay",role:"dialog","aria-modal":"true",onClick:()=>vn(null),children:c.jsxs("div",{className:"edm-confirm-dialog",onClick:x=>x.stopPropagation(),children:[c.jsxs("h3",{children:["Delete ",ft.kind,"?"]}),c.jsxs("p",{children:["This ",ft.kind," and everything inside it will be removed. You can undo it afterward with Ctrl/⌘+Z."]}),c.jsxs("div",{className:"edm-confirm-actions",children:[c.jsx("button",{type:"button",className:"edm-secondary-button",onClick:()=>vn(null),children:"Cancel"}),c.jsx("button",{type:"button",className:"edm-danger-button",onClick:yC,autoFocus:!0,children:"Delete"})]})]})}),document.body):null]});return je!=="edit"?kg:c.jsx(Xm.Provider,{value:Q,children:c.jsx(U1.Provider,{value:pt,children:c.jsxs(MS,{sensors:ht?[]:IC,collisionDetection:l8,onDragStart:KC,onDragOver:QC,onDragEnd:VC,onDragCancel:qC,children:[kg,(()=>{var x,$,ne;const ae=c.jsx(VS,{modifiers:[O8],children:Ye?c.jsx(lc,{block:Yt(Ye)}):he?c.jsx(lc,{label:((x=ms.find(Fe=>Fe.id===he))==null?void 0:x.label)??"Columns",icon:"layout",widths:($=ms.find(Fe=>Fe.id===he))==null?void 0:$.widths}):dt?c.jsx(lc,{label:"Row",icon:"layout",widths:(ne=le.body.rows.find(Fe=>Fe.id===dt))==null?void 0:ne.columns.map(Fe=>Fe.width)}):hg?c.jsx(lc,{block:hg}):null});return typeof document<"u"?Ts.createPortal(ae,document.body):ae})(),Xs?c.jsx("div",{className:"edm-asset-overlay",role:"dialog","aria-modal":"true",children:c.jsxs("div",{className:"edm-compare-dialog",children:[c.jsxs("div",{className:"edm-asset-header",children:[c.jsxs("div",{children:[c.jsx("h3",{children:"Compare Versions"}),c.jsx("p",{children:"Current design on the left, selected snapshot on the right."})]}),c.jsx("button",{type:"button",className:"edm-secondary-button",onClick:()=>qf(null),children:"Close"})]}),c.jsxs("div",{className:"edm-compare-grid",children:[c.jsxs("div",{className:"edm-compare-pane",children:[c.jsxs("div",{className:"edm-panel-title",children:[c.jsx("span",{children:"Current"}),c.jsx("small",{children:le.title||"Untitled design"})]}),c.jsx("iframe",{className:"edm-preview-frame",title:"Current design preview",sandbox:"",srcDoc:Tt})]}),c.jsxs("div",{className:"edm-compare-pane",children:[c.jsxs("div",{className:"edm-panel-title",children:[c.jsx("span",{children:Xs.label}),c.jsx("small",{children:zh(Xs.createdAt)})]}),c.jsx("iframe",{className:"edm-preview-frame",title:"Snapshot preview",sandbox:"",srcDoc:SC})]})]})]})}):null]})})})},Hf=v.forwardRef(({className:e,style:t,...n},r)=>{const i=be(u=>u.design),s=be(u=>u.exportHtml),o=be(u=>u.setDesign),a=be(u=>u.saveSnapshot),l=be(u=>u.snapshots),d=be(u=>u.restoreSnapshot);return v.useImperativeHandle(r,()=>({getDesign:()=>i,exportHtml:u=>u?Qn(i,{fullDocument:!0,mergeTags:u}):s(),exportAmp:u=>ru(i,u?{mergeTags:u}:{}),exportDocument:u=>FL(i,u?{mergeTags:u}:{}),exportZip:u=>L1(i,u?{mergeTags:u}:{}),loadDesign:u=>o(u),saveSnapshot:u=>a(u,"manual"),getSnapshots:()=>l,restoreSnapshot:d}),[i,s,d,a,o,l]),c.jsx("div",{className:e,style:{height:"100%",minHeight:0,...t},children:c.jsx(R8,{...n})})});Hf.displayName="EdmEditor";const L8=e=>(e||"").toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,""),j8=(e,t)=>{const n=String(e).match(/\{\{\s*([^}]+?)\s*\}\}/);return(n?n[1].trim():"")||L8(t)};function ax(e){const t={},n=(r,i)=>{if(!r||typeof r!="object")return;const s=Array.isArray(r)?r:Object.values(r);for(const o of s)if(!(!o||typeof o!="object")){if(o.mergeTags){const a=o.name?i?`${i} · ${o.name}`:o.name:i;n(o.mergeTags,a);continue}if(typeof o.value=="string"&&o.value){const a=j8(o.value,o.name||"");if(!a||t[a])continue;t[a]={label:i&&o.name?`${i} · ${o.name}`:o.name||a,value:o.value,sample:typeof o.sample=="string"?o.sample:void 0}}}};return n(e,""),t}let lx=0;const Uf=e=>`${e}-${(lx++).toString(36)}-${Math.floor(lx*2654435761%1e6).toString(36)}`;let tC=600;const wr=e=>{if(typeof e=="number")return e;if(typeof e=="string"){const t=parseFloat(e);return Number.isFinite(t)?t:void 0}},nC=(e,t,n)=>Math.min(n,Math.max(t,e)),ps=e=>typeof e=="string"?e.replace(/<[^>]+>/g,"").replace(/\s+/g," ").trim():"",cx=e=>String(e).replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">"),dx=e=>String(e??"").replace(/\{\{\s*([^}]+?)\s*\}\}/g,(t,n)=>{const r=String(n).trim();return`<span data-merge-tag="${cx(r)}" data-merge-label="${cx(r)}">{{${r}}}</span>`}),go=e=>{var t;return e?typeof e=="string"?e:((t=e==null?void 0:e.values)==null?void 0:t.href)||(e==null?void 0:e.href)||"":""},B8=e=>{var n;const t=((n=e==null?void 0:e.icons)==null?void 0:n.icons)||(e==null?void 0:e.items)||[];return Array.isArray(t)?t.map(r=>({network:((r==null?void 0:r.name)||(r==null?void 0:r.network)||"link").toLowerCase(),label:(r==null?void 0:r.name)||(r==null?void 0:r.label)||"",href:go(r==null?void 0:r.url)||(r==null?void 0:r.href)||(r==null?void 0:r.url)||""})):[]},P8=e=>{var r;const t=((r=e==null?void 0:e.menu)==null?void 0:r.items)||(e==null?void 0:e.items)||[];return!Array.isArray(t)||!t.length?"<p></p>":`<p>${t.map(i=>`<a href="${go(i==null?void 0:i.link)||(i==null?void 0:i.href)||"#"}">${(i==null?void 0:i.text)||(i==null?void 0:i.label)||"Link"}</a>`).join(" ")}</p>`},ux=e=>e==null?"":typeof e=="string"?ps(e)||e:String(typeof e=="object"?e.text??e.value??e.content??e.html??"":e),F8=e=>{const t=(e==null?void 0:e.table)??e??{},n=[];let r=!1;const i=t==null?void 0:t.columns;Array.isArray(i)&&i.some(o=>(o==null?void 0:o.name)??(o==null?void 0:o.label)??(typeof o=="string"?o:null))&&(n.push(i.map(o=>ux((o==null?void 0:o.name)??(o==null?void 0:o.label)??o))),r=!0);const s=(t==null?void 0:t.rows)??(e==null?void 0:e.rows);if(Array.isArray(s))for(const o of s){const a=Array.isArray(o)?o:Array.isArray(o==null?void 0:o.cells)?o.cells:Array.isArray(o==null?void 0:o.values)?o.values:null;a&&n.push(a.map(ux))}return{rows:n,header:r}},$8=e=>{var s,o,a,l,d,u,h,p,m,g,b,A;const t=e==null?void 0:e.type,n=(e==null?void 0:e.values)||{},r=(y,w)=>({id:Uf("blk"),type:y,values:w}),i=()=>{const y=typeof n.html=="string"?n.html:typeof n.text=="string"?n.text:"";return y?r("raw-html",{html:y}):r("text",{html:`<p><em>[Unsupported block: ${t??"unknown"}]</em></p>`})};switch(t){case"text":case"paragraph":case"list":return r("text",{html:dx(typeof n.text=="string"?n.text:"<p></p>"),align:n.textAlign,color:n.color,font_size:wr(n.fontSize)});case"heading":{const y=typeof n.text=="string"?n.text:"";return/\{\{/.test(y)?r("text",{html:`<p>${dx(y)}</p>`,font_size:wr(n.fontSize)||22,font_weight:"700",align:n.textAlign,color:n.color}):r("heading",{text:ps(y)||"Heading",tag:/^h[1-6]$/.test(n.headingType)?n.headingType:"h2",align:n.textAlign,color:n.color,font_size:wr(n.fontSize)})}case"image":{const y=wr((s=n.src)==null?void 0:s.width)??wr(n.width),w=y?nC(Math.round(y/tC*100),5,100):100;return r("image",{src:((o=n.src)==null?void 0:o.url)||(typeof n.src=="string"?n.src:"")||"",alt:n.altText||((a=n.src)==null?void 0:a.altText)||"",href:go(n.action)||go(n.href),align:n.textAlign||n.align||"center",width:w})}case"button":return r("button",{label:ps(n.text)||"Button",href:go(n.href),background_color:(l=n.buttonColors)==null?void 0:l.backgroundColor,color:(d=n.buttonColors)==null?void 0:d.color,align:n.textAlign||n.align||"left",border_radius:wr(n.borderRadius)});case"divider":return r("divider",{color:((u=n.border)==null?void 0:u.borderTopColor)||n.color||"#d9dce5",thickness:wr((h=n.border)==null?void 0:h.borderTopWidth)||1,width:wr(n.width)||100});case"html":return r("raw-html",{html:typeof n.html=="string"?n.html:""});case"menu":return r("raw-html",{html:P8(n)});case"social":return r("social",{items:B8(n),align:n.align||"center"});case"divider2":case"spacer":return r("spacer",{height:wr(n.height)||24});case"table":{const{rows:y,header:w}=F8(n);return y.length?r("table",{rows:y,header_row:w,align:n.textAlign||n.align||"left"}):i()}case"timer":case"countdown":{const y=((p=n==null?void 0:n.timer)==null?void 0:p.endTime)||(n==null?void 0:n.endTime)||(n==null?void 0:n.endDate)||(n==null?void 0:n.deadline)||((m=n==null?void 0:n.settings)==null?void 0:m.endDate);return r("countdown",{label:ps(n==null?void 0:n.text)||"Offer ends in",...typeof y=="string"&&y?{end_date:y}:{},background_color:n==null?void 0:n.backgroundColor,color:n==null?void 0:n.color,align:(n==null?void 0:n.align)||"center"})}case"video":{const y=(n==null?void 0:n.videoUrl)||(n==null?void 0:n.url)||go(n==null?void 0:n.action)||(typeof(n==null?void 0:n.src)=="string"?n.src:(g=n==null?void 0:n.src)==null?void 0:g.url)||"";return r("video",{url:y,thumbnail:((b=n==null?void 0:n.thumbnail)==null?void 0:b.url)||(typeof(n==null?void 0:n.thumbnail)=="string"?n.thumbnail:"")||(n==null?void 0:n.poster)||"",title:ps(n==null?void 0:n.text)||"Video",align:(n==null?void 0:n.align)||"center"})}case"form":return r("form",{headline:ps((n==null?void 0:n.title)||(n==null?void 0:n.headline)||(n==null?void 0:n.text))||"Sign up",button_label:ps(((A=n==null?void 0:n.button)==null?void 0:A.text)||(n==null?void 0:n.submitLabel)||(n==null?void 0:n.buttonText))||"Submit"});default:return i()}},H8=(e,t)=>{const n=(e==null?void 0:e.values)||{};return{id:Uf("col"),width:Math.round(t*100)/100,blocks:((e==null?void 0:e.contents)||[]).map($8).filter(Boolean),settings:{background_color:n.backgroundColor||void 0,padding:wr(n.padding)}}},U8=e=>{const t=(e==null?void 0:e.values)||{},n=(e==null?void 0:e.columns)||[],r=Array.isArray(e==null?void 0:e.cells)&&e.cells.length?e.cells.map(s=>Number(s)||1):n.map(()=>1),i=r.reduce((s,o)=>s+o,0)||1;return{id:Uf("row"),columns:n.map((s,o)=>H8(s,(r[o]||1)/i*100)),settings:{background_color:t.backgroundColor||void 0,content_background_color:t.columnsBackgroundColor||t.contentBackgroundColor||void 0,padding:typeof t.padding=="string"?t.padding:void 0}}};function G8(e){var s,o;const t=hl();if(!e||typeof e!="object"||!e.body)return t;const n=e.body,r=n.values||{},i=nC(wr(r.contentWidth)??t.body.content_width,320,1200);return tC=i,{...t,body:{...t.body,background_color:r.backgroundColor||t.body.background_color,content_width:i,font_family:((s=r.fontFamily)==null?void 0:s.value)||(typeof r.fontFamily=="string"?r.fontFamily:void 0)||t.body.font_family,preheader_text:typeof r.preheaderText=="string"?r.preheaderText:t.body.preheader_text,link_color:((o=r.linkStyle)==null?void 0:o.linkColor)||t.body.link_color,rows:Array.isArray(n.rows)?n.rows.map(U8):[]}}}const Gf={plan:"free",features:{"editor.undo_redo":!0,"editor.save_version":!0,"appearance.custom_themes":!0,"branding.white_label":!0,"assets.private_connectors":!0,"ai.generate":!0,"ai.rewrite":!0,"ai.subjects":!0,"ai.alt_text":!0,"preview.inbox":!0}},Wf=`
|
|
285
|
+
.edm-canvas { background: #ece9e2 !important; }
|
|
286
|
+
.edm-stage { border: 1px solid #ddd8cd; border-radius: 16px; box-shadow: 0 2px 14px rgba(20, 33, 61, 0.07); overflow: clip; }
|
|
287
|
+
`;function Yf(e){const t={onImageUpload:oC(e)};return e.googleClientId&&(t.googleDrive={clientId:e.googleClientId}),t.s3Connector=w8({listEndpoint:e.s3ListEndpoint??`${zf(e.apiBaseUrl)}${sC}`,headers:yu(e),label:"Amazon S3"}),t}const rC="/buzz-communication/upload/template-assets",iC="/mail-templates/ai-generate",sC="/buzz-communication/upload/template-assets",zf=e=>e.replace(/\/$/,"");function yu(e){const t={"organization-id":e.orgId};return e.authToken&&(t.Authorization=`Bearer ${e.authToken}`),t}function oC(e){const t=`${zf(e.apiBaseUrl)}${e.uploadPath??rC}`;return async(n,r)=>{const i=new FormData;i.append("file",n);const s=await fetch(t,{method:"POST",body:i,headers:yu(e),credentials:"include"});if(!s.ok)throw new Error(`Upload failed: ${s.status} ${s.statusText}`);const o=await s.json().catch(()=>({})),a=W8(o);if(!a)throw new Error("Upload failed: no URL in the response");return{url:a}}}function W8(e){if(!e||typeof e!="object")return;const t=e,n=t.file&&typeof t.file=="object"?t.file:void 0,r=(n==null?void 0:n.url)??t.url??t.Location??t.fileUrl;return typeof r=="string"&&/^https?:\/\//i.test(r)?r:void 0}function Y8(e="off",t){return e==="client-id"&&t?{clientId:t}:!1}const aC=e=>e.replace(/<style[\s\S]*?<\/style>/gi," ").replace(/<[^>]+>/g," ").replace(/ /gi," ").replace(/\s+/g," ").trim(),z8=e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),K8=e=>{const t=e.match(/<(h1|h2|h3|p)[^>]*>([\s\S]*?)<\/\1>/i);return aC(t?t[2]:e)},Q8=e=>{const t=e==null?void 0:e.values,n=(t==null?void 0:t.html)??(t==null?void 0:t.text)??"";return typeof n=="string"?aC(n):""};function Kf(e){const t=`${zf(e.apiBaseUrl)}${e.aiGeneratePath??iC}`,n=async r=>{const i=await fetch(t,{method:"POST",credentials:"include",headers:{"content-type":"application/json",...yu(e)},body:JSON.stringify(r)});if(!i.ok)throw new Error(`AI request failed: ${i.status} ${i.statusText}`);return await i.json().catch(()=>({}))};return{generateDesignFromPrompt:async r=>{const i=await n({prompt:r.prompt,allowedVariables:Object.keys(r.mergeTags??{})});if(!i.htmlContent)return{summary:i.subject};const{design:s}=zL(i.htmlContent,{title:i.subject});return{design:s,summary:i.subject}},rewriteText:async r=>{var o;const i=((o=r.selectedText)==null?void 0:o.trim())||Q8(r.block),s=await n({prompt:`${r.prompt} Keep it to a single short piece of body text based on: "${i}"`,currentHtmlContent:`<p>${z8(i)}</p>`});return{text:K8(s.htmlContent??"")||i}},generateSubjectLines:async r=>{const i=Math.min(r.count??5,5),s=await Promise.all(Array.from({length:i},()=>n({prompt:`Write one short, catchy email subject line for: ${r.prompt}`}).then(a=>(a.subject??"").trim()).catch(()=>"")));return{subjects:Array.from(new Set(s.filter(Boolean)))}},generateAltText:async r=>{var i,s;return{alt:((i=r.currentAlt)==null?void 0:i.trim())||((s=r.title)==null?void 0:s.trim())||""}}}}const hx=760,px=e=>{const t=e==null?void 0:e.body;return!t||(Number(t.content_width)||0)>=hx?e:{...e,body:{...t,content_width:hx}}},V8=e=>{var t;return!!(e&&typeof e=="object"&&((t=e.body)!=null&&t.rows)&&!("schema_version"in e))},q8=e=>e==="web"||e==="page"?"page":e==="document"?"document":e==="popup"?"popup":"email",J8=()=>{if(typeof window>"u")return"";const e=window.location.pathname.match(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i);return e?e[0]:""};function Z8(e){const t=(e==null?void 0:e.apiBaseUrl)??(typeof window<"u"?window.location.origin:""),n=(e==null?void 0:e.orgId)??J8(),r=(e==null?void 0:e.authToken)??(typeof window<"u"?localStorage.getItem("token")??void 0:void 0);return{...e,apiBaseUrl:t,orgId:n,authToken:r}}const Qf=v.forwardRef(({edmission:e,options:t,onReady:n,onLoad:r,logoUrl:i,logoAlt:s,style:o,minHeight:a,className:l},d)=>{const u=v.useRef(null),h=v.useMemo(()=>Z8(e),[e==null?void 0:e.apiBaseUrl,e==null?void 0:e.orgId,e==null?void 0:e.authToken,e==null?void 0:e.uploadPath,e==null?void 0:e.aiGeneratePath,e==null?void 0:e.googleClientId,e==null?void 0:e.s3ListEndpoint]),p=q8(t==null?void 0:t.displayMode),[m,g]=v.useState(()=>ax(t==null?void 0:t.mergeTags)),[b]=v.useState(()=>px(hl())),A=v.useRef(new Map),y=v.useMemo(()=>({builder:p,entitlements:Gf,appearance:{customCss:Wf},branding:i?{paletteLogoUrl:i,paletteLogoAlt:s}:void 0,assets:Yf(h),ai:{adapter:Kf(h)}}),[p,i,s,h]),w=v.useMemo(()=>({loadDesign:E=>{var S;try{const k=V8(E)?G8(E):yj(E);(S=u.current)==null||S.loadDesign(px(k))}catch(k){console.warn("[@edmissioncrm/editor] loadDesign skipped (unrecognized design).",k)}},saveDesign:E=>{var S;return E(((S=u.current)==null?void 0:S.getDesign())??{})},exportHtml:E=>{var S,k;return E({design:((S=u.current)==null?void 0:S.getDesign())??{},html:((k=u.current)==null?void 0:k.exportHtml())??""})},exportPlainText:E=>{var S;return E({design:((S=u.current)==null?void 0:S.getDesign())??{},text:""})},setMergeTags:E=>g(ax(E)),addEventListener:(E,S)=>{const k=A.current.get(E)??new Set;k.add(S),A.current.set(E,k)},removeEventListener:(E,S)=>{var k;(k=A.current.get(E))==null||k.delete(S)},registerCallback:()=>{}}),[]);v.useImperativeHandle(d,()=>({editor:w}),[w]),v.useEffect(()=>{r==null||r(),n==null||n(w)},[]);const C=v.useCallback(E=>{const S=A.current.get("design:updated");if(S)for(const k of S)k({design:E})},[]);return c.jsx(Hf,{ref:u,className:l,style:a!=null?{minHeight:a,...o}:o,config:y,mergeTags:m,initialDesign:b,onDesignChange:C})});Qf.displayName="EmailEditor";const lC=v.forwardRef(({edmission:e,builder:t="email",mergeTags:n,logoUrl:r,logoAlt:i,initialDesign:s,onDesignChange:o,className:a,style:l},d)=>{const u={builder:t,entitlements:Gf,appearance:{customCss:Wf},branding:r?{paletteLogoUrl:r,paletteLogoAlt:i}:void 0,assets:Yf(e),ai:{adapter:Kf(e)}};return c.jsx(Hf,{ref:d,className:a,style:l,config:u,mergeTags:n,initialDesign:s,onDesignChange:o})});lC.displayName="EdmissionEmailEditor";exports.DEFAULT_EDMISSION_AI_GENERATE_PATH=iC;exports.DEFAULT_EDMISSION_S3_LIST_PATH=sC;exports.DEFAULT_EDMISSION_UPLOAD_PATH=rC;exports.EDMISSION_ENTITLEMENTS=Gf;exports.EDMISSION_FRAME_CSS=Wf;exports.EdmissionEmailEditor=lC;exports.EmailEditor=Qf;exports.buildEdmissionGoogleDrive=Y8;exports.createEdmissionAiAdapter=Kf;exports.createEdmissionAssets=Yf;exports.createEdmissionUploadHandler=oC;exports.default=Qf;exports.edmissionConnectorHeaders=yu;
|