From cbc459abc0ab521788987df9c4a33755f37d6487 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Sko=C4=8D=C3=ADk?= Date: Wed, 23 Aug 2023 13:29:36 +0200 Subject: [PATCH] v4.1.1 --- .../assets/SveltyPicker.45a105f2.css | 1 - .../assets/SveltyPicker.da9e068b.css | 1 + .../chunks/{4.839c4d69.js => 4.3441f93b.js} | 4 +-- ...kdown.9bc11fe5.js => Markdown.3e9603ee.js} | 2 +- .../immutable/chunks/SveltyPicker.3fdc3aea.js | 4 --- .../immutable/chunks/SveltyPicker.eae60443.js | 4 +++ ...5f.js => basic-setup-BJSL5TOQ.2d40ffcc.js} | 2 +- .../{data.1e149bb0.js => data.545e9fea.js} | 5 ++-- .../{index.e05b4548.js => index.0dcb629e.js} | 2 +- .../{index.2e2743a9.js => index.2cc1589e.js} | 2 +- .../{index.a9117787.js => index.2f611d82.js} | 2 +- .../{index.187d7fe5.js => index.35753574.js} | 2 +- .../{index.c256d31b.js => index.3a167c29.js} | 2 +- .../{index.a4621221.js => index.69bb2f53.js} | 2 +- .../{index.6642cdb8.js => index.6b0eed4b.js} | 2 +- .../{index.554bb5dd.js => index.9a280567.js} | 2 +- .../{index.9718953a.js => index.e9e1bf88.js} | 2 +- ....js => minimal-setup-Y523JPZT.d07eb42d.js} | 2 +- .../{page.3abd85bd.js => page.05889853.js} | 2 +- .../{page.61cb0928.js => page.71926cf7.js} | 6 ++-- ...ons.fb133fb4.js => singletons.5f2d455d.js} | 2 +- ...{stores.fa9f97f4.js => stores.fb27b686.js} | 2 +- .../{app.4612c491.js => app.80ca6dde.js} | 2 +- .../{start.d769a4e6.js => start.ff6546a5.js} | 2 +- .../nodes/{0.6ff2288c.js => 0.c6f29719.js} | 2 +- .../nodes/{1.30ced9fc.js => 1.b23b6eb1.js} | 2 +- .../nodes/{2.3402bc5a.js => 2.7022c991.js} | 2 +- .../nodes/{3.41a8c02d.js => 3.beded4db.js} | 2 +- docs/_app/immutable/nodes/4.7cf6db0a.js | 1 - docs/_app/immutable/nodes/4.e76f8abd.js | 1 + docs/_app/version.json | 2 +- docs/auto-commit.html | 28 +++++++++---------- docs/disabling-dates.html | 28 +++++++++---------- docs/events.html | 28 +++++++++---------- docs/formatting.html | 28 +++++++++---------- docs/global-config.html | 28 +++++++++---------- docs/index.html | 26 ++++++++--------- docs/localization.html | 28 +++++++++---------- docs/principles.html | 28 +++++++++---------- docs/properties.html | 28 +++++++++---------- docs/slots.html | 28 +++++++++---------- docs/test.html | 26 ++++++++--------- docs/theme.html | 28 +++++++++---------- package.json | 2 +- src/routes/_generated/data.js | 2 +- src/styles/tokens.css | 1 - 46 files changed, 205 insertions(+), 203 deletions(-) delete mode 100644 docs/_app/immutable/assets/SveltyPicker.45a105f2.css create mode 100644 docs/_app/immutable/assets/SveltyPicker.da9e068b.css rename docs/_app/immutable/chunks/{4.839c4d69.js => 4.3441f93b.js} (99%) rename docs/_app/immutable/chunks/{Markdown.9bc11fe5.js => Markdown.3e9603ee.js} (92%) delete mode 100644 docs/_app/immutable/chunks/SveltyPicker.3fdc3aea.js create mode 100644 docs/_app/immutable/chunks/SveltyPicker.eae60443.js rename docs/_app/immutable/chunks/{basic-setup-BJSL5TOQ.52cb615f.js => basic-setup-BJSL5TOQ.2d40ffcc.js} (99%) rename docs/_app/immutable/chunks/{data.1e149bb0.js => data.545e9fea.js} (99%) rename docs/_app/immutable/chunks/{index.e05b4548.js => index.0dcb629e.js} (99%) rename docs/_app/immutable/chunks/{index.2e2743a9.js => index.2cc1589e.js} (99%) rename docs/_app/immutable/chunks/{index.a9117787.js => index.2f611d82.js} (99%) rename docs/_app/immutable/chunks/{index.187d7fe5.js => index.35753574.js} (99%) rename docs/_app/immutable/chunks/{index.c256d31b.js => index.3a167c29.js} (99%) rename docs/_app/immutable/chunks/{index.a4621221.js => index.69bb2f53.js} (99%) rename docs/_app/immutable/chunks/{index.6642cdb8.js => index.6b0eed4b.js} (99%) rename docs/_app/immutable/chunks/{index.554bb5dd.js => index.9a280567.js} (99%) rename docs/_app/immutable/chunks/{index.9718953a.js => index.e9e1bf88.js} (94%) rename docs/_app/immutable/chunks/{minimal-setup-Y523JPZT.606046c0.js => minimal-setup-Y523JPZT.d07eb42d.js} (68%) rename docs/_app/immutable/chunks/{page.3abd85bd.js => page.05889853.js} (96%) rename docs/_app/immutable/chunks/{page.61cb0928.js => page.71926cf7.js} (82%) rename docs/_app/immutable/chunks/{singletons.fb133fb4.js => singletons.5f2d455d.js} (77%) rename docs/_app/immutable/chunks/{stores.fa9f97f4.js => stores.fb27b686.js} (80%) rename docs/_app/immutable/entry/{app.4612c491.js => app.80ca6dde.js} (79%) rename docs/_app/immutable/entry/{start.d769a4e6.js => start.ff6546a5.js} (99%) rename docs/_app/immutable/nodes/{0.6ff2288c.js => 0.c6f29719.js} (98%) rename docs/_app/immutable/nodes/{1.30ced9fc.js => 1.b23b6eb1.js} (92%) rename docs/_app/immutable/nodes/{2.3402bc5a.js => 2.7022c991.js} (91%) rename docs/_app/immutable/nodes/{3.41a8c02d.js => 3.beded4db.js} (90%) delete mode 100644 docs/_app/immutable/nodes/4.7cf6db0a.js create mode 100644 docs/_app/immutable/nodes/4.e76f8abd.js diff --git a/docs/_app/immutable/assets/SveltyPicker.45a105f2.css b/docs/_app/immutable/assets/SveltyPicker.45a105f2.css deleted file mode 100644 index 0a5ec66..0000000 --- a/docs/_app/immutable/assets/SveltyPicker.45a105f2.css +++ /dev/null @@ -1 +0,0 @@ -td.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo,th.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{padding:0;border-width:0}.sdt-cal-td.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{padding:0;font-size:90%;text-align:center}.sdt-cal-th.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{text-align:center;height:24px}.sdt-calendar.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{height:221px;overflow:hidden}.sdt-calendar.is-grid.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{display:grid}.sdt-calendar.is-grid.svelte-14xtbbo .sdt-table.svelte-14xtbbo.svelte-14xtbbo{grid-column:1/2;grid-row:1/2}.sdt-table.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{width:100%;border-collapse:collapse;margin:0;background-color:var(--sdt-table-bg, transparent)}.sdt-table-height.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{height:222px}.animate-transition.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{will-change:transform;transition:transform .3s ease}.not-current.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{opacity:.3}.not-current.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo:hover{opacity:.55}.std-btn.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{margin:0;border:0;background:transparent;text-align:center;width:100%;border-radius:4px;cursor:pointer;padding:.3rem;box-sizing:border-box;color:var(--sdt-color, initial)}.sdt-btn-day.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{max-height:32px;height:32px}.std-btn[disabled].svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{cursor:not-allowed;opacity:.5;color:var(--sdt-disabled-date, #b22222);background-color:var(--sdt-disabled-date-bg, var(--sdt-bg-main, #fff))}.std-btn-header.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{width:auto;font-weight:700;padding:.375em .5em;color:var(--sdt-header-color, var(--sdt-color, initial))}.std-btn-header.icon-btn.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo:first-of-type{padding-left:.375em;padding-right:.375em}.std-btn-header.icon-btn.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{padding-left:.25em;padding-right:.25em}.std-btn.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo:hover{background-color:var(--sdt-btn-bg-hover, #eee)}.is-selected.in-range.svelte-14xtbbo .std-btn.svelte-14xtbbo.svelte-14xtbbo{border-radius:4px 0 0 4px}.in-range.svelte-14xtbbo .std-btn.svelte-14xtbbo.svelte-14xtbbo,.in-range-hover.svelte-14xtbbo:not(.is-selected) .std-btn.svelte-14xtbbo.svelte-14xtbbo{background-color:color-mix(in srgb,transparent 75%,var(--sdt-primary, #286090));border-radius:0}.in-range-hover.is-selected.svelte-14xtbbo:has(+.in-range-hover) .std-btn.svelte-14xtbbo.svelte-14xtbbo{border-top-right-radius:0;border-bottom-right-radius:0}.in-range-hover.svelte-14xtbbo+.in-range-hover.is-selected .std-btn.svelte-14xtbbo.svelte-14xtbbo{border-top-left-radius:0;border-bottom-left-radius:0}.in-range.svelte-14xtbbo:not(.is-selected) .std-btn.svelte-14xtbbo.svelte-14xtbbo:hover{background-color:color-mix(in srgb,var(--sdt-btn-bg-hover, #eee) 75%,var(--sdt-primary, #286090))}.in-range.svelte-14xtbbo+.is-selected.svelte-14xtbbo .std-btn.svelte-14xtbbo,.is-selected.svelte-14xtbbo+.is-selected .std-btn.svelte-14xtbbo.svelte-14xtbbo{border-top-left-radius:0;border-bottom-left-radius:0}.is-selected.svelte-14xtbbo+.is-selected .std-btn.svelte-14xtbbo.svelte-14xtbbo{border-left:1px solid color-mix(in srgb,white 75%,var(--sdt-primary, #286090));margin-left:-1px}.is-selected.svelte-14xtbbo .std-btn.svelte-14xtbbo.svelte-14xtbbo,.is-selected.in-range.svelte-14xtbbo .std-btn.svelte-14xtbbo.svelte-14xtbbo{background-color:var(--sdt-primary, #286090);color:var(--sdt-color-selected, var(--sdt-bg-main, #fff));opacity:.9}.std-btn-header.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo:hover{background-color:var(--sdt-btn-header-bg-hover, #dfdfdf)}.sdt-time-icon.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{display:inline-flex;align-items:center;padding:.375em!important}.sdt-time-icon.svelte-14xtbbo svg.svelte-14xtbbo.svelte-14xtbbo{height:1em!important;stroke:initial!important}.sdt-tbody-lg.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{background-color:var(--sdt-bg-main, #fff)}.sdt-tbody-lg.svelte-14xtbbo .std-btn.svelte-14xtbbo.svelte-14xtbbo{height:74px}.sdt-thead-nav.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{display:flex;margin-bottom:.25em;align-items:stretch}.sdt-nav-btns.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{white-space:nowrap}.sdt-toggle-btn.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{width:100%;text-align:left}.sdt-today.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{position:relative}.sdt-today.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo:before{box-sizing:border-box;position:absolute;content:"";margin-left:4px;margin-top:4px;border-left:4px solid var(--sdt-today-indicator, #ccc);border-top:4px solid var(--sdt-today-indicator, #ccc);border-bottom:4px solid transparent;border-right:4px solid transparent;border-radius:2px;height:4px;z-index:2}.sdt-svg.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{fill:var(--sdt-header-color, inital)}.sdt-today.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo:hover:before,.in-range.sdt-today.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo:before{border-left-color:var(--sdt-primary, #286090);border-top-color:var(--sdt-primary, #286090)}.is-selected.sdt-today.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo:before{border-left-color:#eee;border-top-color:#eee}.sdt-timer.svelte-qory1t.svelte-qory1t{position:relative;--sdt-clock-size:220px}.sdt-time-head.svelte-qory1t.svelte-qory1t{position:relative;display:flex;justify-content:center;align-items:center;margin-bottom:4px}.sdt-time-figure.svelte-qory1t.svelte-qory1t{font-size:1.5em;font-weight:700}.sdt-clock.svelte-qory1t.svelte-qory1t{margin:auto;position:relative;width:var(--sdt-clock-size);height:var(--sdt-clock-size);background-color:var(--sdt-clock-bg, #eeeded);border-radius:50%;transition:background-color .3s;overflow:hidden}.sdt-time-btn.svelte-qory1t.svelte-qory1t{border:0;background:transparent;text-align:center;border-radius:4px;cursor:pointer;height:38px;padding:0 .375em;color:var(--sdt-header-color, inital)}.sdt-time-btn.svelte-qory1t>svg.svelte-qory1t{stroke:initial!important}.sdt-svg.svelte-qory1t.svelte-qory1t{fill:var(--sdt-header-color, inital)}.sdt-time-btn.svelte-qory1t.svelte-qory1t:not(.is-active){opacity:.5}.sdt-time-btn.svelte-qory1t.svelte-qory1t:hover{background-color:var(--sdt-btn-header-bg-hover, #dfdfdf)}.sdt-back-btn.svelte-qory1t.svelte-qory1t{position:absolute;top:0;left:0;padding:.3em;opacity:1!important}.sdt-meridian.svelte-qory1t.svelte-qory1t{position:absolute;top:0;right:40px;display:flex}.sdt-meridian.svelte-qory1t .sdt-time-btn.svelte-qory1t{width:56px;font-weight:700}.sdt-middle-dot.svelte-qory1t.svelte-qory1t{left:50%;top:50%;width:6px;height:6px;position:absolute;transform:translate(-50%,-50%);background-color:var(--sdt-primary, #286090);border-radius:50%}.sdt-hand-pointer.svelte-qory1t.svelte-qory1t{width:2px;height:calc(40% - 3px);bottom:50%;left:calc(50% - 1px);position:absolute;background-color:var(--sdt-primary, #286090);transform-origin:center bottom 0;transition:transform .3s ease,height .15s ease}.sdt-hand-circle.svelte-qory1t.svelte-qory1t{left:-15px;top:-21px;position:relative;width:4px;height:4px;background-color:transparent;border:14px solid var(--sdt-primary, #286090);border-radius:50%;box-sizing:content-box}.sdt-tick.svelte-qory1t.svelte-qory1t{position:absolute;width:30px;height:30px;border-width:0;transform:translate(-50%,-50%);text-align:center;border-radius:50%;line-height:20px;cursor:pointer;background-color:transparent;transition:all .3s}.sdt-tick[disabled].svelte-qory1t.svelte-qory1t{cursor:not-allowed;color:var(--sdt-disabled-date, #b22222)}.sdt-tick.outer-tick.svelte-qory1t.svelte-qory1t{opacity:0}.sdt-tick.is-selected.svelte-qory1t.svelte-qory1t{animation:svelte-qory1t-tick-selection 0s .175s ease-out forwards}@keyframes svelte-qory1t-tick-selection{0%{color:initial;background-color:transparent}to{background-color:var(--sdt-primary, #286090);color:var(--sdt-color-selected, var(--sdt-bg-main, #fff))}}.std-component-wrap.svelte-97by3f.svelte-97by3f{position:relative;display:inline}.std-calendar-wrap.svelte-97by3f.svelte-97by3f{width:280px;background-color:var(--sdt-bg-main, #fff);box-shadow:var(--sdt-wrap-shadow, 0 1px 6px var(--sdt-shadow-color, #ccc));border-radius:var(--sdt-radius, 4px);padding:.5em;color:var(--sdt-color, initial)}.std-calendar-wrap.is-range-wrap.svelte-97by3f.svelte-97by3f{width:560px}.sdt-widget-wrap.svelte-97by3f.svelte-97by3f{display:flex;gap:.5rem;justify-content:stretch;position:relative}.sdt-widget.svelte-97by3f.svelte-97by3f{flex:1;min-width:264px}.value-dirty.svelte-97by3f.svelte-97by3f{color:color-mix(in srgb,black 20%,white)}.std-calendar-wrap.is-popup.svelte-97by3f.svelte-97by3f{position:absolute;box-shadow:0 1px 6px var(--sdt-shadow-color, #ccc);z-index:100}.sdt-btn-row.svelte-97by3f.svelte-97by3f{margin-top:.5rem;display:flex;gap:.5rem;justify-content:space-between;flex-flow:row-reverse}.sdt-action-btn.svelte-97by3f.svelte-97by3f{padding:.25em .5em;font-size:.875em;border-radius:.2em}.sdt-today-btn.svelte-97by3f.svelte-97by3f{background-color:var(--sdt-primary, #286090);color:var(--sdt-today-color, var(--sdt-bg-main, #fff));padding:.25em .5em;font-size:.875em;border-radius:.2em;border:1px solid var(--sdt-today-bg, #286090)}.sdt-today-btn[disabled].svelte-97by3f.svelte-97by3f{opacity:.5;cursor:not-allowed}.sdt-today-btn.svelte-97by3f.svelte-97by3f:focus,.sdt-today-btn.svelte-97by3f.svelte-97by3f:active,.sdt-today-btn.svelte-97by3f.svelte-97by3f:hover:not([disabled]){background-color:var(--sdt-today-bg, #286090)}.sdt-clear-btn.svelte-97by3f.svelte-97by3f{border:1px solid var(--sdt-clear-color, #dc3545);background-color:var(--sdt-clear-bg, transparent);color:var(--sdt-clear-color, #dc3545)}.sdt-clear-btn.svelte-97by3f.svelte-97by3f:focus,.sdt-clear-btn.svelte-97by3f.svelte-97by3f:active:not([disabled]),.sdt-clear-btn.svelte-97by3f.svelte-97by3f:hover:not([disabled]){background-color:var(--sdt-clear-hover-bg, #dc3545);color:var(--sdt-clear-hover-color, var(--sdt-bg-main, #fff))}.sdt-widget.svelte-97by3f+.sdt-widget.svelte-97by3f:before{content:"";position:absolute;top:0;bottom:0;left:50%;width:1px;background-color:#eee}@media screen and (max-width: 560px){.std-calendar-wrap.std-calendar-wrap.is-range-wrap.svelte-97by3f.svelte-97by3f{width:280px}.sdt-widget-wrap.svelte-97by3f.svelte-97by3f{flex-wrap:wrap}.sdt-widget.svelte-97by3f+.sdt-widget.svelte-97by3f:before{content:none}} diff --git a/docs/_app/immutable/assets/SveltyPicker.da9e068b.css b/docs/_app/immutable/assets/SveltyPicker.da9e068b.css new file mode 100644 index 0000000..46cba2b --- /dev/null +++ b/docs/_app/immutable/assets/SveltyPicker.da9e068b.css @@ -0,0 +1 @@ +td.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo,th.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{padding:0;border-width:0}.sdt-cal-td.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{padding:0;font-size:90%;text-align:center}.sdt-cal-th.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{text-align:center;height:24px}.sdt-calendar.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{height:221px;overflow:hidden}.sdt-calendar.is-grid.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{display:grid}.sdt-calendar.is-grid.svelte-14xtbbo .sdt-table.svelte-14xtbbo.svelte-14xtbbo{grid-column:1/2;grid-row:1/2}.sdt-table.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{width:100%;border-collapse:collapse;margin:0;background-color:var(--sdt-table-bg, transparent)}.sdt-table-height.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{height:222px}.animate-transition.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{will-change:transform;transition:transform .3s ease}.not-current.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{opacity:.3}.not-current.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo:hover{opacity:.55}.std-btn.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{margin:0;border:0;background:transparent;text-align:center;width:100%;border-radius:4px;cursor:pointer;padding:.3rem;box-sizing:border-box;color:var(--sdt-color, initial)}.sdt-btn-day.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{max-height:32px;height:32px}.std-btn[disabled].svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{cursor:not-allowed;opacity:.5;color:var(--sdt-disabled-date, #b22222);background-color:var(--sdt-disabled-date-bg, var(--sdt-bg-main, #fff))}.std-btn-header.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{width:auto;font-weight:700;padding:.375em .5em;color:var(--sdt-header-color, var(--sdt-color, initial))}.std-btn-header.icon-btn.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo:first-of-type{padding-left:.375em;padding-right:.375em}.std-btn-header.icon-btn.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{padding-left:.25em;padding-right:.25em}.std-btn.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo:hover{background-color:var(--sdt-btn-bg-hover, #eee)}.is-selected.in-range.svelte-14xtbbo .std-btn.svelte-14xtbbo.svelte-14xtbbo{border-radius:4px 0 0 4px}.in-range.svelte-14xtbbo .std-btn.svelte-14xtbbo.svelte-14xtbbo,.in-range-hover.svelte-14xtbbo:not(.is-selected) .std-btn.svelte-14xtbbo.svelte-14xtbbo{background-color:color-mix(in srgb,transparent 75%,var(--sdt-primary, #286090));border-radius:0}.in-range-hover.is-selected.svelte-14xtbbo:has(+.in-range-hover) .std-btn.svelte-14xtbbo.svelte-14xtbbo{border-top-right-radius:0;border-bottom-right-radius:0}.in-range-hover.svelte-14xtbbo+.in-range-hover.is-selected .std-btn.svelte-14xtbbo.svelte-14xtbbo{border-top-left-radius:0;border-bottom-left-radius:0}.in-range.svelte-14xtbbo:not(.is-selected) .std-btn.svelte-14xtbbo.svelte-14xtbbo:hover{background-color:color-mix(in srgb,var(--sdt-btn-bg-hover, #eee) 75%,var(--sdt-primary, #286090))}.in-range.svelte-14xtbbo+.is-selected.svelte-14xtbbo .std-btn.svelte-14xtbbo,.is-selected.svelte-14xtbbo+.is-selected .std-btn.svelte-14xtbbo.svelte-14xtbbo{border-top-left-radius:0;border-bottom-left-radius:0}.is-selected.svelte-14xtbbo+.is-selected .std-btn.svelte-14xtbbo.svelte-14xtbbo{border-left:1px solid color-mix(in srgb,white 75%,var(--sdt-primary, #286090));margin-left:-1px}.is-selected.svelte-14xtbbo .std-btn.svelte-14xtbbo.svelte-14xtbbo,.is-selected.in-range.svelte-14xtbbo .std-btn.svelte-14xtbbo.svelte-14xtbbo{background-color:var(--sdt-primary, #286090);color:var(--sdt-color-selected, var(--sdt-bg-main, #fff));opacity:.9}.std-btn-header.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo:hover{background-color:var(--sdt-btn-header-bg-hover, #dfdfdf)}.sdt-time-icon.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{display:inline-flex;align-items:center;padding:.375em!important}.sdt-time-icon.svelte-14xtbbo svg.svelte-14xtbbo.svelte-14xtbbo{height:1em!important;stroke:initial!important}.sdt-tbody-lg.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{background-color:var(--sdt-bg-main, #fff)}.sdt-tbody-lg.svelte-14xtbbo .std-btn.svelte-14xtbbo.svelte-14xtbbo{height:74px}.sdt-thead-nav.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{display:flex;margin-bottom:.25em;align-items:stretch}.sdt-nav-btns.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{white-space:nowrap}.sdt-toggle-btn.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{width:100%;text-align:left}.sdt-today.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{position:relative}.sdt-today.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo:before{box-sizing:border-box;position:absolute;content:"";margin-left:4px;margin-top:4px;border-left:4px solid var(--sdt-today-indicator, #ccc);border-top:4px solid var(--sdt-today-indicator, #ccc);border-bottom:4px solid transparent;border-right:4px solid transparent;border-radius:2px;height:4px;z-index:2}.sdt-svg.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo{fill:var(--sdt-header-color, inital)}.sdt-today.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo:hover:before,.in-range.sdt-today.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo:before{border-left-color:var(--sdt-primary, #286090);border-top-color:var(--sdt-primary, #286090)}.is-selected.sdt-today.svelte-14xtbbo.svelte-14xtbbo.svelte-14xtbbo:before{border-left-color:#eee;border-top-color:#eee}.sdt-timer.svelte-1u35wsk.svelte-1u35wsk{position:relative;--sdt-clock-size:220px}.sdt-time-head.svelte-1u35wsk.svelte-1u35wsk{position:relative;display:flex;justify-content:center;align-items:center;margin-bottom:4px;color:var(--sdt-header-color, initial)}.sdt-time-figure.svelte-1u35wsk.svelte-1u35wsk{font-size:1.5em;font-weight:700}.sdt-clock.svelte-1u35wsk.svelte-1u35wsk{margin:auto;position:relative;width:var(--sdt-clock-size);height:var(--sdt-clock-size);background-color:var(--sdt-clock-bg, #eeeded);border-radius:50%;transition:background-color .3s;overflow:hidden}.sdt-time-btn.svelte-1u35wsk.svelte-1u35wsk{border:0;background:transparent;text-align:center;border-radius:4px;cursor:pointer;height:38px;padding:0 .375em;color:var(--sdt-header-color, inital)}.sdt-time-btn.svelte-1u35wsk>svg.svelte-1u35wsk{stroke:initial!important}.sdt-svg.svelte-1u35wsk.svelte-1u35wsk{fill:var(--sdt-header-color, inital)}.sdt-time-btn.svelte-1u35wsk.svelte-1u35wsk:not(.is-active){opacity:.5}.sdt-time-btn.svelte-1u35wsk.svelte-1u35wsk:hover{background-color:var(--sdt-btn-header-bg-hover, #dfdfdf)}.sdt-back-btn.svelte-1u35wsk.svelte-1u35wsk{position:absolute;top:0;left:0;padding:.3em;opacity:1!important}.sdt-meridian.svelte-1u35wsk.svelte-1u35wsk{position:absolute;top:0;right:40px;display:flex}.sdt-meridian.svelte-1u35wsk .sdt-time-btn.svelte-1u35wsk{width:56px;font-weight:700}.sdt-middle-dot.svelte-1u35wsk.svelte-1u35wsk{left:50%;top:50%;width:6px;height:6px;position:absolute;transform:translate(-50%,-50%);background-color:var(--sdt-primary, #286090);border-radius:50%}.sdt-hand-pointer.svelte-1u35wsk.svelte-1u35wsk{width:2px;height:calc(40% - 3px);bottom:50%;left:calc(50% - 1px);position:absolute;background-color:var(--sdt-primary, #286090);transform-origin:center bottom 0;transition:transform .3s ease,height .15s ease}.sdt-hand-circle.svelte-1u35wsk.svelte-1u35wsk{left:-15px;top:-21px;position:relative;width:4px;height:4px;background-color:transparent;border:14px solid var(--sdt-primary, #286090);border-radius:50%;box-sizing:content-box}.sdt-tick.svelte-1u35wsk.svelte-1u35wsk{position:absolute;width:30px;height:30px;border-width:0;transform:translate(-50%,-50%);text-align:center;border-radius:50%;line-height:20px;cursor:pointer;background-color:transparent;transition:all .3s;color:var(--sdt-color-time, inherit)}.sdt-tick[disabled].svelte-1u35wsk.svelte-1u35wsk{cursor:not-allowed;color:var(--sdt-disabled-date, #b22222)}.sdt-tick.outer-tick.svelte-1u35wsk.svelte-1u35wsk{opacity:0}.sdt-tick.is-selected.svelte-1u35wsk.svelte-1u35wsk{animation:svelte-1u35wsk-tick-selection 0s .175s ease-out forwards}@keyframes svelte-1u35wsk-tick-selection{0%{color:initial;background-color:transparent}to{background-color:var(--sdt-primary, #286090);color:var(--sdt-color-selected, var(--sdt-bg-main, #fff))}}.std-component-wrap.svelte-97by3f.svelte-97by3f{position:relative;display:inline}.std-calendar-wrap.svelte-97by3f.svelte-97by3f{width:280px;background-color:var(--sdt-bg-main, #fff);box-shadow:var(--sdt-wrap-shadow, 0 1px 6px var(--sdt-shadow-color, #ccc));border-radius:var(--sdt-radius, 4px);padding:.5em;color:var(--sdt-color, initial)}.std-calendar-wrap.is-range-wrap.svelte-97by3f.svelte-97by3f{width:560px}.sdt-widget-wrap.svelte-97by3f.svelte-97by3f{display:flex;gap:.5rem;justify-content:stretch;position:relative}.sdt-widget.svelte-97by3f.svelte-97by3f{flex:1;min-width:264px}.value-dirty.svelte-97by3f.svelte-97by3f{color:color-mix(in srgb,black 20%,white)}.std-calendar-wrap.is-popup.svelte-97by3f.svelte-97by3f{position:absolute;box-shadow:0 1px 6px var(--sdt-shadow-color, #ccc);z-index:100}.sdt-btn-row.svelte-97by3f.svelte-97by3f{margin-top:.5rem;display:flex;gap:.5rem;justify-content:space-between;flex-flow:row-reverse}.sdt-action-btn.svelte-97by3f.svelte-97by3f{padding:.25em .5em;font-size:.875em;border-radius:.2em}.sdt-today-btn.svelte-97by3f.svelte-97by3f{background-color:var(--sdt-primary, #286090);color:var(--sdt-today-color, var(--sdt-bg-main, #fff));padding:.25em .5em;font-size:.875em;border-radius:.2em;border:1px solid var(--sdt-today-bg, #286090)}.sdt-today-btn[disabled].svelte-97by3f.svelte-97by3f{opacity:.5;cursor:not-allowed}.sdt-today-btn.svelte-97by3f.svelte-97by3f:focus,.sdt-today-btn.svelte-97by3f.svelte-97by3f:active,.sdt-today-btn.svelte-97by3f.svelte-97by3f:hover:not([disabled]){background-color:var(--sdt-today-bg, #286090)}.sdt-clear-btn.svelte-97by3f.svelte-97by3f{border:1px solid var(--sdt-clear-color, #dc3545);background-color:var(--sdt-clear-bg, transparent);color:var(--sdt-clear-color, #dc3545)}.sdt-clear-btn.svelte-97by3f.svelte-97by3f:focus,.sdt-clear-btn.svelte-97by3f.svelte-97by3f:active:not([disabled]),.sdt-clear-btn.svelte-97by3f.svelte-97by3f:hover:not([disabled]){background-color:var(--sdt-clear-hover-bg, #dc3545);color:var(--sdt-clear-hover-color, var(--sdt-bg-main, #fff))}.sdt-widget.svelte-97by3f+.sdt-widget.svelte-97by3f:before{content:"";position:absolute;top:0;bottom:0;left:50%;width:1px;background-color:#eee}@media screen and (max-width: 560px){.std-calendar-wrap.std-calendar-wrap.is-range-wrap.svelte-97by3f.svelte-97by3f{width:280px}.sdt-widget-wrap.svelte-97by3f.svelte-97by3f{flex-wrap:wrap}.sdt-widget.svelte-97by3f+.sdt-widget.svelte-97by3f:before{content:none}} diff --git a/docs/_app/immutable/chunks/4.839c4d69.js b/docs/_app/immutable/chunks/4.3441f93b.js similarity index 99% rename from docs/_app/immutable/chunks/4.839c4d69.js rename to docs/_app/immutable/chunks/4.3441f93b.js index a849723..953c0e0 100644 --- a/docs/_app/immutable/chunks/4.839c4d69.js +++ b/docs/_app/immutable/chunks/4.3441f93b.js @@ -1,4 +1,4 @@ -var Cp=Object.defineProperty;var Mp=(s,e,t)=>e in s?Cp(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var qe=(s,e,t)=>(Mp(s,typeof e!="symbol"?e+"":e,t),t),Tp=(s,e,t)=>{if(!e.has(s))throw TypeError("Cannot "+t)};var nl=(s,e,t)=>{if(e.has(s))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(s):e.set(s,t)};var As=(s,e,t)=>(Tp(s,e,"access private method"),t);import{a as Ep,d as Dp,s as Op}from"./data.1e149bb0.js";import{s as be,f as A,g as C,h as P,d as b,j as k,i as x,r as de,u as pt,l as R,a as X,m as I,c as Z,v as ne,w as y,y as ue,n as re,C as Mt,e as he,k as it,J as Cr,K as vo,E as Tt,F as Et,G as Dt,L as Mr,M as Pf,p as Xe,H as $f,z as yo,A as Ce,x as Me,N as Dn,D as Tr,O as ia,B as ze,t as ns,P as ei,Q as Bf,R as rn,S as sa,T as Nf,o as wo,U as tr,q as ra,V as Pp,W as la}from"./scheduler.6381a9b9.js";import{S as _e,i as ke,a as S,t as M,g as we,c as Se,f as oa,b as W,d as K,m as q,e as U,h as ln,n as aa,l as $p}from"./index.cf31950d.js";import{M as Bp,f as Np}from"./Markdown.9bc11fe5.js";import{n as Lp}from"./stores.fa9f97f4.js";import{e as Te,u as Rp,d as Ip}from"./each.31dbf577.js";import{w as lt,r as zp,k as jp}from"./singletons.fb133fb4.js";import{_ as Cn}from"./preload-helper.07ba51e7.js";import{s as ha}from"./index.93a0d223.js";function ca(s,e){const t={},n={},i={$$scope:1};let r=s.length;for(;r--;){const l=s[r],o=e[r];if(o){for(const a in l)a in o||(n[a]=1);for(const a in o)i[a]||(t[a]=o[a],i[a]=1);s[r]=o}else for(const a in l)i[a]=1}for(const l in n)l in t||(t[l]=void 0);return t}function fa(s){return typeof s=="object"&&s!==null?s:{}}async function Vp({params:s}){const e=Ep(Dp,s.slug);return{title:e.title,slug:s.slug,repl:e.files}}const $w=Object.freeze(Object.defineProperty({__proto__:null,load:Vp},Symbol.toStringTag,{value:"Module"}));function ua(s,e,t){const n=s.slice();return n[3]=e[t],n[5]=t,n}function da(s){let e,t=s[3]+"",n,i,r,l;function o(){return s[2](s[5])}return{c(){e=A("button"),n=R(t),i=X(),this.h()},l(a){e=C(a,"BUTTON",{class:!0});var h=P(e);n=I(h,t),i=Z(h),h.forEach(b),this.h()},h(){k(e,"class","svelte-o6j61a"),ne(e,"selected",s[0]===s[5])},m(a,h){x(a,e,h),y(e,n),y(e,i),r||(l=ue(e,"click",o),r=!0)},p(a,h){s=a,h&2&&t!==(t=s[3]+"")&&re(n,t),h&1&&ne(e,"selected",s[0]===s[5])},d(a){a&&b(e),r=!1,l()}}}function Hp(s){let e,t=Te(s[1]),n=[];for(let i=0;it(0,i=l);return s.$$set=l=>{"labels"in l&&t(1,n=l.labels),"offset"in l&&t(0,i=l.offset)},[i,n,r]}class Wp extends _e{constructor(e){super(),ke(this,e,Fp,Hp,be,{labels:1,offset:0})}}class De{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){let i=[];return this.decompose(0,e,i,2),n.length&&n.decompose(0,n.length,i,3),this.decompose(t,this.length,i,1),on.from(i,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let n=[];return this.decompose(e,t,n,0),on.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),i=new Yi(this),r=new Yi(e);for(let l=t,o=t;;){if(i.next(l),r.next(l),l=0,i.lineBreak!=r.lineBreak||i.done!=r.done||i.value!=r.value)return!1;if(o+=i.value.length,i.done||o>=n)return!0}}iter(e=1){return new Yi(this,e)}iterRange(e,t=this.length){return new Lf(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t==null&&(t=this.lines+1);let i=this.line(e).from;n=this.iterRange(i,Math.max(i,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Rf(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?De.empty:e.length<=32?new Je(e):on.from(Je.split(e,[]))}}class Je extends De{constructor(e,t=qp(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,i){for(let r=0;;r++){let l=this.text[r],o=i+l.length;if((t?n:o)>=e)return new Up(i,o,n,l);i=o+1,n++}}decompose(e,t,n,i){let r=e<=0&&t>=this.length?this:new Je(pa(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(i&1){let l=n.pop(),o=qs(r.text,l.text.slice(),0,r.length);if(o.length<=32)n.push(new Je(o,l.length+r.length));else{let a=o.length>>1;n.push(new Je(o.slice(0,a)),new Je(o.slice(a)))}}else n.push(r)}replace(e,t,n){if(!(n instanceof Je))return super.replace(e,t,n);let i=qs(this.text,qs(n.text,pa(this.text,0,e)),t),r=this.length+n.length-(t-e);return i.length<=32?new Je(i,r):on.from(Je.split(i,[]),r)}sliceString(e,t=this.length,n=` +var Cp=Object.defineProperty;var Mp=(s,e,t)=>e in s?Cp(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var qe=(s,e,t)=>(Mp(s,typeof e!="symbol"?e+"":e,t),t),Tp=(s,e,t)=>{if(!e.has(s))throw TypeError("Cannot "+t)};var nl=(s,e,t)=>{if(e.has(s))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(s):e.set(s,t)};var As=(s,e,t)=>(Tp(s,e,"access private method"),t);import{a as Ep,d as Dp,s as Op}from"./data.545e9fea.js";import{s as be,f as A,g as C,h as P,d as b,j as k,i as x,r as de,u as pt,l as R,a as X,m as I,c as Z,v as ne,w as y,y as ue,n as re,C as Mt,e as he,k as it,J as Cr,K as vo,E as Tt,F as Et,G as Dt,L as Mr,M as Pf,p as Xe,H as $f,z as yo,A as Ce,x as Me,N as Dn,D as Tr,O as ia,B as ze,t as ns,P as ei,Q as Bf,R as rn,S as sa,T as Nf,o as wo,U as tr,q as ra,V as Pp,W as la}from"./scheduler.6381a9b9.js";import{S as _e,i as ke,a as S,t as M,g as we,c as Se,f as oa,b as W,d as K,m as q,e as U,h as ln,n as aa,l as $p}from"./index.cf31950d.js";import{M as Bp,f as Np}from"./Markdown.3e9603ee.js";import{n as Lp}from"./stores.fb27b686.js";import{e as Te,u as Rp,d as Ip}from"./each.31dbf577.js";import{w as lt,r as zp,k as jp}from"./singletons.5f2d455d.js";import{_ as Cn}from"./preload-helper.07ba51e7.js";import{s as ha}from"./index.93a0d223.js";function ca(s,e){const t={},n={},i={$$scope:1};let r=s.length;for(;r--;){const l=s[r],o=e[r];if(o){for(const a in l)a in o||(n[a]=1);for(const a in o)i[a]||(t[a]=o[a],i[a]=1);s[r]=o}else for(const a in l)i[a]=1}for(const l in n)l in t||(t[l]=void 0);return t}function fa(s){return typeof s=="object"&&s!==null?s:{}}async function Vp({params:s}){const e=Ep(Dp,s.slug);return{title:e.title,slug:s.slug,repl:e.files}}const $w=Object.freeze(Object.defineProperty({__proto__:null,load:Vp},Symbol.toStringTag,{value:"Module"}));function ua(s,e,t){const n=s.slice();return n[3]=e[t],n[5]=t,n}function da(s){let e,t=s[3]+"",n,i,r,l;function o(){return s[2](s[5])}return{c(){e=A("button"),n=R(t),i=X(),this.h()},l(a){e=C(a,"BUTTON",{class:!0});var h=P(e);n=I(h,t),i=Z(h),h.forEach(b),this.h()},h(){k(e,"class","svelte-o6j61a"),ne(e,"selected",s[0]===s[5])},m(a,h){x(a,e,h),y(e,n),y(e,i),r||(l=ue(e,"click",o),r=!0)},p(a,h){s=a,h&2&&t!==(t=s[3]+"")&&re(n,t),h&1&&ne(e,"selected",s[0]===s[5])},d(a){a&&b(e),r=!1,l()}}}function Hp(s){let e,t=Te(s[1]),n=[];for(let i=0;it(0,i=l);return s.$$set=l=>{"labels"in l&&t(1,n=l.labels),"offset"in l&&t(0,i=l.offset)},[i,n,r]}class Wp extends _e{constructor(e){super(),ke(this,e,Fp,Hp,be,{labels:1,offset:0})}}class De{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){let i=[];return this.decompose(0,e,i,2),n.length&&n.decompose(0,n.length,i,3),this.decompose(t,this.length,i,1),on.from(i,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let n=[];return this.decompose(e,t,n,0),on.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),i=new Yi(this),r=new Yi(e);for(let l=t,o=t;;){if(i.next(l),r.next(l),l=0,i.lineBreak!=r.lineBreak||i.done!=r.done||i.value!=r.value)return!1;if(o+=i.value.length,i.done||o>=n)return!0}}iter(e=1){return new Yi(this,e)}iterRange(e,t=this.length){return new Lf(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t==null&&(t=this.lines+1);let i=this.line(e).from;n=this.iterRange(i,Math.max(i,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Rf(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?De.empty:e.length<=32?new Je(e):on.from(Je.split(e,[]))}}class Je extends De{constructor(e,t=qp(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,i){for(let r=0;;r++){let l=this.text[r],o=i+l.length;if((t?n:o)>=e)return new Up(i,o,n,l);i=o+1,n++}}decompose(e,t,n,i){let r=e<=0&&t>=this.length?this:new Je(pa(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(i&1){let l=n.pop(),o=qs(r.text,l.text.slice(),0,r.length);if(o.length<=32)n.push(new Je(o,l.length+r.length));else{let a=o.length>>1;n.push(new Je(o.slice(0,a)),new Je(o.slice(a)))}}else n.push(r)}replace(e,t,n){if(!(n instanceof Je))return super.replace(e,t,n);let i=qs(this.text,qs(n.text,pa(this.text,0,e)),t),r=this.length+n.length-(t-e);return i.length<=32?new Je(i,r):on.from(Je.split(i,[]),r)}sliceString(e,t=this.length,n=` `){let i="";for(let r=0,l=0;r<=t&&le&&l&&(i+=n),er&&(i+=o.slice(Math.max(0,e-r),t-r)),r=a+1}return i}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],i=-1;for(let r of e)n.push(r),i+=r.length+1,n.length==32&&(t.push(new Je(n,i)),n=[],i=-1);return i>-1&&t.push(new Je(n,i)),t}}class on extends De{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,t,n,i){for(let r=0;;r++){let l=this.children[r],o=i+l.length,a=n+l.lines-1;if((t?a:o)>=e)return l.lineInner(e,t,n,i);i=o+1,n=a+1}}decompose(e,t,n,i){for(let r=0,l=0;l<=t&&r=l){let h=i&((l<=e?1:0)|(a>=t?2:0));l>=e&&a<=t&&!h?n.push(o):o.decompose(e-l,t-l,n,h)}l=a+1}}replace(e,t,n){if(n.lines=r&&t<=o){let a=l.replace(e-r,t-r,n),h=this.lines-l.lines+a.lines;if(a.lines>5-1&&a.lines>h>>5+1){let c=this.children.slice();return c[i]=a,new on(c,this.length-(t-e)+n.length)}return super.replace(r,o,a)}r=o+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n=` `){let i="";for(let r=0,l=0;re&&r&&(i+=n),el&&(i+=o.sliceString(e-l,t-l,n)),l=a+1}return i}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof on))return 0;let n=0,[i,r,l,o]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=t,r+=t){if(i==l||r==o)return n;let a=this.children[i],h=e.children[r];if(a!=h)return n+a.scanIdentical(h,t);n+=a.length+1}}static from(e,t=e.reduce((n,i)=>n+i.length+1,-1)){let n=0;for(let d of e)n+=d.lines;if(n<32){let d=[];for(let p of e)p.flatten(d);return new Je(d,t)}let i=Math.max(32,n>>5),r=i<<1,l=i>>1,o=[],a=0,h=-1,c=[];function f(d){let p;if(d.lines>r&&d instanceof on)for(let g of d.children)f(g);else d.lines>l&&(a>l||!a)?(u(),o.push(d)):d instanceof Je&&a&&(p=c[c.length-1])instanceof Je&&d.lines+p.lines<=32?(a+=d.lines,h+=d.length+1,c[c.length-1]=new Je(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>i&&u(),a+=d.lines,h+=d.length+1,c.push(d))}function u(){a!=0&&(o.push(c.length==1?c[0]:on.from(c,h)),h=-1,a=c.length=0)}for(let d of e)f(d);return u(),o.length==1?o[0]:new on(o,t)}}De.empty=new Je([""],0);function qp(s){let e=-1;for(let t of s)e+=t.length+1;return e}function qs(s,e,t=0,n=1e9){for(let i=0,r=0,l=!0;r=t&&(a>n&&(o=o.slice(0,n-i)),i0?1:(e instanceof Je?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,i=this.nodes[n],r=this.offsets[n],l=r>>1,o=i instanceof Je?i.text.length:i.children.length;if(l==(t>0?o:0)){if(n==0)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=` `,this;e--}else if(i instanceof Je){let a=i.text[l+(t<0?-1:0)];if(this.offsets[n]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=i.children[l+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof Je?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Lf{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new Yi(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*t,this.value=i.length<=n?i:t<0?i.slice(i.length-n):i.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Rf{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:i}=this.inner.next(e);return t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(De.prototype[Symbol.iterator]=function(){return this.iter()},Yi.prototype[Symbol.iterator]=Lf.prototype[Symbol.iterator]=Rf.prototype[Symbol.iterator]=function(){return this});class Up{constructor(e,t,n,i){this.from=e,this.to=t,this.number=n,this.text=i}get length(){return this.to-this.from}}let vi="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(s=>s?parseInt(s,36):1);for(let s=1;ss)return vi[e-1]<=s;return!1}function ga(s){return s>=127462&&s<=127487}const ma=8205;function Ct(s,e,t=!0,n=!0){return(t?If:Jp)(s,e,n)}function If(s,e,t){if(e==s.length)return e;e&&zf(s.charCodeAt(e))&&jf(s.charCodeAt(e-1))&&e--;let n=Xi(s,e);for(e+=Cl(n);e=0&&ga(Xi(s,l));)r++,l-=2;if(r%2==0)break;e+=2}else break}return e}function Jp(s,e,t){for(;e>0;){let n=If(s,e-2,t);if(n=56320&&s<57344}function jf(s){return s>=55296&&s<56320}function Xi(s,e){let t=s.charCodeAt(e);if(!jf(t)||e+1==s.length)return t;let n=s.charCodeAt(e+1);return zf(n)?(t-55296<<10)+(n-56320)+65536:t}function Bw(s){return s<=65535?String.fromCharCode(s):(s-=65536,String.fromCharCode((s>>10)+55296,(s&1023)+56320))}function Cl(s){return s<65536?1:2}const Ml=/\r\n?|\n/;var bt=function(s){return s[s.Simple=0]="Simple",s[s.TrackDel=1]="TrackDel",s[s.TrackBefore=2]="TrackBefore",s[s.TrackAfter=3]="TrackAfter",s}(bt||(bt={}));class pn{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return r+(e-i);r+=o}else{if(n!=bt.Simple&&h>=e&&(n==bt.TrackDel&&ie||n==bt.TrackBefore&&ie))return null;if(h>e||h==e&&t<0&&!o)return e==i||t<0?r:r+a;r+=a}i=h}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return r}touchesRange(e,t=e){for(let n=0,i=0;n=0&&i<=t&&o>=e)return it?"cover":!0;i=o}return!1}toString(){let e="";for(let t=0;t=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new pn(e)}static create(e){return new pn(e)}}class Ye extends pn{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Tl(this,(t,n,i,r,l)=>e=e.replace(i,i+(n-t),l),!1),e}mapDesc(e,t=!1){return El(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let i=0,r=0;i=0){t[i]=o,t[i+1]=l;let a=i>>1;for(;n.length0&&In(n,t,r.text),r.forward(c),o+=c}let h=e[l++];for(;o>1].toJSON()))}return e}static of(e,t,n){let i=[],r=[],l=0,o=null;function a(c=!1){if(!c&&!i.length)return;lu||f<0||u>t)throw new RangeError(`Invalid change range ${f} to ${u} (in doc of length ${t})`);let p=d?typeof d=="string"?De.of(d.split(n||Ml)):d:De.empty,g=p.length;if(f==u&&g==0)return;fl&&at(i,f-l,-1),at(i,u-f,g),In(r,i,p),l=u}}return h(e),a(!o),o}static empty(e){return new Ye(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let i=0;io&&typeof l!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)t.push(r[0],0);else{for(;n.length=0&&t<=0&&t==s[i+1]?s[i]+=e:e==0&&s[i]==0?s[i+1]+=t:n?(s[i]+=e,s[i+1]+=t):s.push(e,t)}function In(s,e,t){if(t.length==0)return;let n=e.length-2>>1;if(n>1])),!(t||l==s.sections.length||s.sections[l+1]<0);)o=s.sections[l++],a=s.sections[l++];e(i,h,r,c,f),i=h,r=c}}}function El(s,e,t,n=!1){let i=[],r=n?[]:null,l=new is(s),o=new is(e);for(let a=-1;;)if(l.ins==-1&&o.ins==-1){let h=Math.min(l.len,o.len);at(i,h,-1),l.forward(h),o.forward(h)}else if(o.ins>=0&&(l.ins<0||a==l.i||l.off==0&&(o.len=0&&a=0){let h=0,c=l.len;for(;c;)if(o.ins==-1){let f=Math.min(c,o.len);h+=f,c-=f,o.forward(f)}else if(o.ins==0&&o.lena||l.ins>=0&&l.len>a)&&(o||n.length>h),r.forward2(a),l.forward(a)}}}}class is{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?De.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?De.empty:t[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class ni{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return this.flags&16?this.to:this.from}get head(){return this.flags&16?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&4?-1:this.flags&8?1:0}get bidiLevel(){let e=this.flags&3;return e==3?null:e}get goalColumn(){let e=this.flags>>5;return e==33554431?void 0:e}map(e,t=-1){let n,i;return this.empty?n=i=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),n==this.from&&i==this.to?this:new ni(n,i,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return F.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return F.range(this.anchor,n)}eq(e){return this.anchor==e.anchor&&this.head==e.head}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return F.range(e.anchor,e.head)}static create(e,t,n){return new ni(e,t,n)}}class F{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:F.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let t=0;te.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new F(e.ranges.map(t=>ni.fromJSON(t)),e.main)}static single(e,t=e){return new F([F.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let n=0,i=0;ie?4:0)|r)}static normalized(e,t=0){let n=e[t];e.sort((i,r)=>i.from-r.from),t=e.indexOf(n);for(let i=1;ir.head?F.range(a,o):F.range(o,a))}}return new F(e,t)}}function Hf(s,e){for(let t of s.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let So=0;class le{constructor(e,t,n,i,r){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=i,this.id=So++,this.default=e([]),this.extensions=typeof r=="function"?r(this):r}static define(e={}){return new le(e.combine||(t=>t),e.compareInput||((t,n)=>t===n),e.compare||(e.combine?(t,n)=>t===n:xo),!!e.static,e.enables)}of(e){return new Us([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Us(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Us(e,this,2,t)}from(e,t){return t||(t=n=>n),this.compute([e],n=>t(n.field(e)))}}function xo(s,e){return s==e||s.length==e.length&&s.every((t,n)=>t===e[n])}class Us{constructor(e,t,n,i){this.dependencies=e,this.facet=t,this.type=n,this.value=i,this.id=So++}dynamicSlot(e){var t;let n=this.value,i=this.facet.compareInput,r=this.id,l=e[r]>>1,o=this.type==2,a=!1,h=!1,c=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?h=!0:((t=e[f.id])!==null&&t!==void 0?t:1)&1||c.push(e[f.id]);return{create(f){return f.values[l]=n(f),1},update(f,u){if(a&&u.docChanged||h&&(u.docChanged||u.selection)||Dl(f,c)){let d=n(f);if(o?!ba(d,f.values[l],i):!i(d,f.values[l]))return f.values[l]=d,1}return 0},reconfigure:(f,u)=>{let d,p=u.config.address[r];if(p!=null){let g=ir(u,p);if(this.dependencies.every(m=>m instanceof le?u.facet(m)===f.facet(m):m instanceof Pt?u.field(m,!1)==f.field(m,!1):!0)||(o?ba(d=n(f),g,i):i(d=n(f),g)))return f.values[l]=g,0}else d=n(f);return f.values[l]=d,1}}}}function ba(s,e,t){if(s.length!=e.length)return!1;for(let n=0;ns[a.id]),i=t.map(a=>a.type),r=n.filter(a=>!(a&1)),l=s[e.id]>>1;function o(a){let h=[];for(let c=0;cn===i),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(_a).find(n=>n.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:n=>(n.values[t]=this.create(n),1),update:(n,i)=>{let r=n.values[t],l=this.updateF(r,i);return this.compareF(r,l)?0:(n.values[t]=l,1)},reconfigure:(n,i)=>i.config.address[this.id]!=null?(n.values[t]=i.field(this),0):(n.values[t]=this.create(n),1)}}init(e){return[this,_a.of({field:this,create:e})]}get extension(){return this}}const ti={lowest:4,low:3,default:2,high:1,highest:0};function Vi(s){return e=>new Ff(e,s)}const Er={highest:Vi(ti.highest),high:Vi(ti.high),default:Vi(ti.default),low:Vi(ti.low),lowest:Vi(ti.lowest)};class Ff{constructor(e,t){this.inner=e,this.prec=t}}class Nt{of(e){return new Ol(this,e)}reconfigure(e){return Nt.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Ol{constructor(e,t){this.compartment=e,this.inner=t}}class nr{constructor(e,t,n,i,r,l){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=i,this.staticValues=r,this.facets=l,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,n){let i=[],r=Object.create(null),l=new Map;for(let u of Yp(e,t,l))u instanceof Pt?i.push(u):(r[u.facet.id]||(r[u.facet.id]=[])).push(u);let o=Object.create(null),a=[],h=[];for(let u of i)o[u.id]=h.length<<1,h.push(d=>u.slot(d));let c=n==null?void 0:n.config.facets;for(let u in r){let d=r[u],p=d[0].facet,g=c&&c[u]||[];if(d.every(m=>m.type==0))if(o[p.id]=a.length<<1|1,xo(g,d))a.push(n.facet(p));else{let m=p.combine(d.map(_=>_.value));a.push(n&&p.compare(m,n.facet(p))?n.facet(p):m)}else{for(let m of d)m.type==0?(o[m.id]=a.length<<1|1,a.push(m.value)):(o[m.id]=h.length<<1,h.push(_=>m.dynamicSlot(_)));o[p.id]=h.length<<1,h.push(m=>Gp(m,p,d))}}let f=h.map(u=>u(o));return new nr(e,l,f,o,a,r)}}function Yp(s,e,t){let n=[[],[],[],[],[]],i=new Map;function r(l,o){let a=i.get(l);if(a!=null){if(a<=o)return;let h=n[a].indexOf(l);h>-1&&n[a].splice(h,1),l instanceof Ol&&t.delete(l.compartment)}if(i.set(l,o),Array.isArray(l))for(let h of l)r(h,o);else if(l instanceof Ol){if(t.has(l.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(l.compartment)||l.inner;t.set(l.compartment,h),r(h,o)}else if(l instanceof Ff)r(l.inner,l.prec);else if(l instanceof Pt)n[o].push(l),l.provides&&r(l.provides,o);else if(l instanceof Us)n[o].push(l),l.facet.extensions&&r(l.facet.extensions,ti.default);else{let h=l.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${l}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(h,o)}}return r(s,ti.default),n.reduce((l,o)=>l.concat(o))}function Zi(s,e){if(e&1)return 2;let t=e>>1,n=s.status[t];if(n==4)throw new Error("Cyclic dependency between fields and/or facets");if(n&2)return n;s.status[t]=4;let i=s.computeSlot(s,s.config.dynamicSlots[t]);return s.status[t]=2|i}function ir(s,e){return e&1?s.config.staticValues[e>>1]:s.values[e>>1]}const Wf=le.define(),qf=le.define({combine:s=>s.some(e=>e),static:!0}),Uf=le.define({combine:s=>s.length?s[0]:void 0,static:!0}),Kf=le.define(),Jf=le.define(),Gf=le.define(),Yf=le.define({combine:s=>s.length?s[0]:!1});class qn{constructor(e,t){this.type=e,this.value=t}static define(){return new Xp}}class Xp{of(e){return new qn(this,e)}}class Zp{constructor(e){this.map=e}of(e){return new Pe(this,e)}}class Pe{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new Pe(this.type,t)}is(e){return this.type==e}static define(e={}){return new Zp(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let i of e){let r=i.map(t);r&&n.push(r)}return n}}Pe.reconfigure=Pe.define();Pe.appendConfig=Pe.define();class Ze{constructor(e,t,n,i,r,l){this.startState=e,this.changes=t,this.selection=n,this.effects=i,this.annotations=r,this.scrollIntoView=l,this._doc=null,this._state=null,n&&Hf(n,t.newLength),r.some(o=>o.type==Ze.time)||(this.annotations=r.concat(Ze.time.of(Date.now())))}static create(e,t,n,i,r,l){return new Ze(e,t,n,i,r,l)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(Ze.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}Ze.time=qn.define();Ze.userEvent=qn.define();Ze.addToHistory=qn.define();Ze.remote=qn.define();function Qp(s,e){let t=[];for(let n=0,i=0;;){let r,l;if(n=s[n]))r=s[n++],l=s[n++];else if(i=0;i--){let r=n[i](s);r instanceof Ze?s=r:Array.isArray(r)&&r.length==1&&r[0]instanceof Ze?s=r[0]:s=Zf(e,yi(r),!1)}return s}function tg(s){let e=s.startState,t=e.facet(Gf),n=s;for(let i=t.length-1;i>=0;i--){let r=t[i](s);r&&Object.keys(r).length&&(n=Xf(n,Pl(e,r,s.changes.newLength),!0))}return n==s?s:Ze.create(e,s.changes,s.selection,n.effects,n.annotations,n.scrollIntoView)}const ng=[];function yi(s){return s==null?ng:Array.isArray(s)?s:[s]}var Sn=function(s){return s[s.Word=0]="Word",s[s.Space=1]="Space",s[s.Other=2]="Other",s}(Sn||(Sn={}));const ig=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let $l;try{$l=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function sg(s){if($l)return $l.test(s);for(let e=0;e"€"&&(t.toUpperCase()!=t.toLowerCase()||ig.test(t)))return!0}return!1}function rg(s){return e=>{if(!/\S/.test(e))return Sn.Space;if(sg(e))return Sn.Word;for(let t=0;t-1)return Sn.Word;return Sn.Other}}class ye{constructor(e,t,n,i,r,l){this.config=e,this.doc=t,this.selection=n,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=r,l&&(l._state=this);for(let o=0;oi.set(a,o)),t=null),i.set(l.value.compartment,l.value.extension)):l.is(Pe.reconfigure)?(t=null,n=l.value):l.is(Pe.appendConfig)&&(t=null,n=yi(n).concat(l.value));let r;t?r=e.startState.values.slice():(t=nr.resolve(n,i,this),r=new ye(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(o,a)=>a.reconfigure(o,this),null).values),new ye(t,e.newDoc,e.newSelection,r,(l,o)=>o.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:F.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),i=this.changes(n.changes),r=[n.range],l=yi(n.effects);for(let o=1;ol.spec.fromJSON(o,a)))}}return ye.create({doc:e.doc,selection:F.fromJSON(e.selection),extensions:t.extensions?i.concat([t.extensions]):i})}static create(e={}){let t=nr.resolve(e.extensions||[],new Map),n=e.doc instanceof De?e.doc:De.of((e.doc||"").split(t.staticFacet(ye.lineSeparator)||Ml)),i=e.selection?e.selection instanceof F?e.selection:F.single(e.selection.anchor,e.selection.head):F.single(0);return Hf(i,n.length),t.staticFacet(qf)||(i=i.asSingle()),new ye(t,n,i,t.dynamicSlots.map(()=>null),(r,l)=>l.create(r),null)}get tabSize(){return this.facet(ye.tabSize)}get lineBreak(){return this.facet(ye.lineSeparator)||` @@ -7,7 +7,7 @@ var Cp=Object.defineProperty;var Mp=(s,e,t)=>e in s?Cp(s,e,{enumerable:!0,config `;this.styleTag.textContent=r}}}var Vn={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:"'"},rs={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Sg=typeof navigator<"u"&&/Mac/.test(navigator.platform),xg=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var st=0;st<10;st++)Vn[48+st]=Vn[96+st]=String(st);for(var st=1;st<=24;st++)Vn[st+111]="F"+st;for(var st=65;st<=90;st++)Vn[st]=String.fromCharCode(st+32),rs[st]=String.fromCharCode(st);for(var ol in Vn)rs.hasOwnProperty(ol)||(rs[ol]=Vn[ol]);function Ag(s){var e=Sg&&s.metaKey&&s.shiftKey&&!s.ctrlKey&&!s.altKey||xg&&s.shiftKey&&s.key&&s.key.length==1||s.key=="Unidentified",t=!e&&s.key||(s.shiftKey?rs:Vn)[s.keyCode]||s.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function sr(s){let e;return s.nodeType==11?e=s.getSelection?s:s.ownerDocument:e=s,e.getSelection()}function jl(s,e){return e?s==e||s.contains(e.nodeType!=1?e.parentNode:e):!1}function Cg(s){let e=s.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Ks(s,e){if(!e.anchorNode)return!1;try{return jl(s,e.anchorNode)}catch{return!1}}function ls(s){return s.nodeType==3?Ai(s,0,s.nodeValue.length).getClientRects():s.nodeType==1?s.getClientRects():[]}function rr(s,e,t,n){return t?La(s,e,t,n,-1)||La(s,e,t,n,1):!1}function lr(s){for(var e=0;;e++)if(s=s.previousSibling,!s)return e}function La(s,e,t,n,i){for(;;){if(s==t&&e==n)return!0;if(e==(i<0?0:Hn(s))){if(s.nodeName=="DIV")return!1;let r=s.parentNode;if(!r||r.nodeType!=1)return!1;e=lr(s)+(i<0?0:1),s=r}else if(s.nodeType==1){if(s=s.childNodes[e+(i<0?-1:0)],s.nodeType==1&&s.contentEditable=="false")return!1;e=i<0?Hn(s):0}else return!1}}function Hn(s){return s.nodeType==3?s.nodeValue.length:s.childNodes.length}function Co(s,e){let t=e?s.left:s.right;return{left:t,right:t,top:s.top,bottom:s.bottom}}function Mg(s){return{left:0,right:s.innerWidth,top:0,bottom:s.innerHeight}}function Tg(s,e,t,n,i,r,l,o){let a=s.ownerDocument,h=a.defaultView||window;for(let c=s,f=!1;c&&!f;)if(c.nodeType==1){let u,d=c==a.body;if(d)u=Mg(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(f=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let m=c.getBoundingClientRect();u={left:m.left,right:m.left+c.clientWidth,top:m.top,bottom:m.top+c.clientHeight}}let p=0,g=0;if(i=="nearest")e.top0&&e.bottom>u.bottom+g&&(g=e.bottom-u.bottom+g+l)):e.bottom>u.bottom&&(g=e.bottom-u.bottom+l,t<0&&e.top-g0&&e.right>u.right+p&&(p=e.right-u.right+p+r)):e.right>u.right&&(p=e.right-u.right+r,t<0&&e.leftt.clientHeight||t.scrollWidth>t.clientWidth)return t;t=t.assignedSlot||t.parentNode}else if(t.nodeType==11)t=t.host;else break;return null}class Dg{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?Hn(t):0),n,Math.min(e.focusOffset,n?Hn(n):0))}set(e,t,n,i){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=i}}let pi=null;function iu(s){if(s.setActive)return s.setActive();if(pi)return s.focus(pi);let e=[];for(let t=s;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(s.focus(pi==null?{get preventScroll(){return pi={preventScroll:!0},!0}}:void 0),!pi){pi=!1;for(let t=0;tMath.max(1,s.scrollHeight-s.clientHeight-4)}class ut{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(e,t){return new ut(e.parentNode,lr(e),t)}static after(e,t){return new ut(e.parentNode,lr(e)+1,t)}}const Mo=[];class Le{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let t=this.posAtStart;for(let n of this.children){if(n==e)return t;t+=n.length+n.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(this.flags&2){let n=this.dom,i=null,r;for(let l of this.children){if(l.flags&7){if(!l.dom&&(r=i?i.nextSibling:n.firstChild)){let o=Le.get(r);(!o||!o.parent&&o.canReuseDOM(l))&&l.reuseDOM(r)}l.sync(e,t),l.flags&=-8}if(r=i?i.nextSibling:n.firstChild,t&&!t.written&&t.node==n&&r!=l.dom&&(t.written=!0),l.dom.parentNode==n)for(;r&&r!=l.dom;)r=Ia(r);else n.insertBefore(l.dom,r);i=l.dom}for(r=i?i.nextSibling:n.firstChild,r&&t&&t.node==n&&(t.written=!0);r;)r=Ia(r)}else if(this.flags&1)for(let n of this.children)n.flags&7&&(n.sync(e,t),n.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let n;if(e==this.dom)n=this.dom.childNodes[t];else{let i=Hn(e)==0?0:t==0?-1:1;for(;;){let r=e.parentNode;if(r==this.dom)break;i==0&&r.firstChild!=r.lastChild&&(e==r.firstChild?i=-1:i=1),e=r}i<0?n=e:n=e.nextSibling}if(n==this.dom.firstChild)return 0;for(;n&&!Le.get(n);)n=n.nextSibling;if(!n)return this.length;for(let i=0,r=0;;i++){let l=this.children[i];if(l.dom==n)return r;r+=l.length+l.breakAfter}}domBoundsAround(e,t,n=0){let i=-1,r=-1,l=-1,o=-1;for(let a=0,h=n,c=n;at)return f.domBoundsAround(e,t,h);if(u>=e&&i==-1&&(i=a,r=h),h>t&&f.dom.parentNode==this.dom){l=a,o=c;break}c=u,h=u+f.breakAfter}return{from:r,to:o<0?n+this.length:o,startDOM:(i?this.children[i-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:l=0?this.children[l].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,n=Mo){this.markDirty();for(let i=e;ithis.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}}function ou(s,e,t,n,i,r,l,o,a){let{children:h}=s,c=h.length?h[e]:null,f=r.length?r[r.length-1]:null,u=f?f.breakAfter:l;if(!(e==n&&c&&!l&&!u&&r.length<2&&c.merge(t,i,r.length?f:null,t==0,o,a))){if(n0&&(!l&&r.length&&c.merge(t,c.length,r[0],!1,o,0)?c.breakAfter=r.shift().breakAfter:(tr)&&this.lineBreak(),i=l}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let r=-1,l=1,o;if(this.lineSeparator?(r=t.indexOf(this.lineSeparator,n),l=this.lineSeparator.length):(o=i.exec(t))&&(r=o.index,l=o[0].length),this.append(t.slice(n,r<0?t.length:r)),r<0)break;if(this.lineBreak(),l>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=l-1);n=r+l}}readNode(e){if(e.cmIgnore)return;let t=Le.get(e),n=t&&t.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let i=n.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+Math.min(t,n.offset))}}function za(s){return s.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(s.nodeName)}class ja{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}let At=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},Vl=typeof document<"u"?document:{documentElement:{style:{}}};const Hl=/Edge\/(\d+)/.exec(At.userAgent),cu=/MSIE \d/.test(At.userAgent),Fl=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(At.userAgent),Dr=!!(cu||Fl||Hl),Va=!Dr&&/gecko\/(\d+)/i.test(At.userAgent),al=!Dr&&/Chrome\/(\d+)/.exec(At.userAgent),Ha="webkitFontSmoothing"in Vl.documentElement.style,fu=!Dr&&/Apple Computer/.test(At.vendor),Fa=fu&&(/Mobile\/\w+/.test(At.userAgent)||At.maxTouchPoints>2);var se={mac:Fa||/Mac/.test(At.platform),windows:/Win/.test(At.platform),linux:/Linux|X11/.test(At.platform),ie:Dr,ie_version:cu?Vl.documentMode||6:Fl?+Fl[1]:Hl?+Hl[1]:0,gecko:Va,gecko_version:Va?+(/Firefox\/(\d+)/.exec(At.userAgent)||[0,0])[1]:0,chrome:!!al,chrome_version:al?+al[1]:0,ios:Fa,android:/Android\b/.test(At.userAgent),webkit:Ha,safari:fu,webkit_version:Ha?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:Vl.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const $g=256;class Mn extends Le{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,n){return this.flags&8||n&&(!(n instanceof Mn)||this.length-(t-e)+n.length>$g||n.flags&8)?!1:(this.text=this.text.slice(0,e)+(n?n.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new Mn(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new ut(this.dom,e)}domBoundsAround(e,t,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return Bg(this.dom,e,t)}}class Tn extends Le{constructor(e,t=[],n=0){super(),this.mark=e,this.children=t,this.length=n;for(let i of t)i.setParent(this)}setAttrs(e){if(su(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,n,i,r,l){return n&&(!(n instanceof Tn&&n.mark.eq(this.mark))||e&&r<=0||te&&t.push(n=e&&(i=r),n=a,r++}let l=this.length-e;return this.length=e,i>-1&&(this.children.length=i,this.markDirty()),new Tn(this.mark,t,l)}domAtPos(e){return uu(this,e)}coordsAt(e,t){return pu(this,e,t)}}function Bg(s,e,t){let n=s.nodeValue.length;e>n&&(e=n);let i=e,r=e,l=0;e==0&&t<0||e==n&&t>=0?se.chrome||se.gecko||(e?(i--,l=1):r=0)?0:o.length-1];return se.safari&&!l&&a.width==0&&(a=Array.prototype.find.call(o,h=>h.width)||a),l?Co(a,l<0):a||null}class ii extends Le{constructor(e,t,n){super(),this.widget=e,this.length=t,this.side=n,this.prevWidget=null}static create(e,t,n){return new ii(e,t,n)}split(e){let t=ii.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.dom.contentEditable="false")}getSide(){return this.side}merge(e,t,n,i,r,l){return n&&(!(n instanceof ii)||!this.widget.compare(n.widget)||e>0&&r<=0||t0)?ut.before(this.dom):ut.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let n=this.widget.coordsAt(this.dom,e,t);if(n)return n;let i=this.dom.getClientRects(),r=null;if(!i.length)return null;let l=this.side?this.side<0:e>0;for(let o=l?i.length-1:0;r=i[o],!(e>0?o==0:o==i.length-1||r.top0?ut.before(this.dom):ut.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return De.empty}get isHidden(){return!0}}Mn.prototype.children=ii.prototype.children=Ci.prototype.children=Mo;function uu(s,e){let t=s.dom,{children:n}=s,i=0;for(let r=0;ir&&e0;r--){let l=n[r-1];if(l.dom.parentNode==t)return l.domAtPos(l.length)}for(let r=i;r0&&e instanceof Tn&&i.length&&(n=i[i.length-1])instanceof Tn&&n.mark.eq(e.mark)?du(n,e.children[0],t-1):(i.push(e),e.setParent(s)),s.length+=e.length}function pu(s,e,t){let n=null,i=-1,r=null,l=-1;function o(h,c){for(let f=0,u=0;f=c&&(d.children.length?o(d,c-u):(!r||r.isHidden&&t>0)&&(p>c||u==p&&d.getSide()>0)?(r=d,l=c-u):(u-1?1:0)!=i.length-(t&&i.indexOf(t)>-1?1:0))return!1;for(let r of n)if(r!=t&&(i.indexOf(r)==-1||s[r]!==e[r]))return!1;return!0}function ql(s,e,t){let n=null;if(e)for(let i in e)t&&i in t||s.removeAttribute(n=i);if(t)for(let i in t)e&&e[i]==t[i]||s.setAttribute(n=i,t[i]);return!!n}function Lg(s){let e=Object.create(null);for(let t=0;t0?3e8:-4e8:t>0?1e8:-1e8,new Fn(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,i;if(e.isBlockGap)n=-5e8,i=4e8;else{let{start:r,end:l}=gu(e,t);n=(r?t?-3e8:-1:5e8)-1,i=(l?t?2e8:1:-6e8)+1}return new Fn(e,n,i,t,e.widget||null,!0)}static line(e){return new bs(e)}static set(e,t=!1){return Ne.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Re.none=Ne.empty;class ms extends Re{constructor(e){let{start:t,end:n}=gu(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,n;return this==e||e instanceof ms&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((n=e.attrs)===null||n===void 0?void 0:n.class))&&To(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}ms.prototype.point=!1;class bs extends Re{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof bs&&this.spec.class==e.spec.class&&To(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}bs.prototype.mapMode=bt.TrackBefore;bs.prototype.point=!0;class Fn extends Re{constructor(e,t,n,i,r,l){super(t,n,r,e),this.block=i,this.isReplace=l,this.mapMode=i?t<=0?bt.TrackBefore:bt.TrackAfter:bt.TrackDel}get type(){return this.startSide=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Fn&&Rg(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}Fn.prototype.point=!0;function gu(s,e=!1){let{inclusiveStart:t,inclusiveEnd:n}=s;return t==null&&(t=s.inclusive),n==null&&(n=s.inclusive),{start:t??e,end:n??e}}function Rg(s,e){return s==e||!!(s&&e&&s.compare(e))}function Ul(s,e,t,n=0){let i=t.length-1;i>=0&&t[i]+n>=s?t[i]=Math.max(t[i],e):t.push(s,e)}class _t extends Le{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,n,i,r,l){if(n){if(!(n instanceof _t))return!1;this.dom||n.transferDOM(this)}return i&&this.setDeco(n?n.attrs:null),au(this,e,t,n?n.children:[],r,l),!0}split(e){let t=new _t;if(t.breakAfter=this.breakAfter,this.length==0)return t;let{i:n,off:i}=this.childPos(e);i&&(t.append(this.children[n].split(i),0),this.children[n].merge(i,this.children[n].length,null,!1,0,0),n++);for(let r=n;r0&&this.children[n-1].length==0;)this.children[--n].destroy();return this.children.length=n,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){To(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){du(this,e,t)}addLineDeco(e){let t=e.spec.attributes,n=e.spec.class;t&&(this.attrs=Wl(t,this.attrs||{})),n&&(this.attrs=Wl({class:n},this.attrs||{}))}domAtPos(e){return uu(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var n;this.dom?this.flags&4&&(su(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(ql(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let i=this.dom.lastChild;for(;i&&Le.get(i)instanceof Tn;)i=i.lastChild;if(!i||!this.length||i.nodeName!="BR"&&((n=Le.get(i))===null||n===void 0?void 0:n.isEditable)==!1&&(!se.ios||!this.children.some(r=>r instanceof Mn))){let r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let n of this.children){if(!(n instanceof Mn)||/[^ -~]/.test(n.text))return null;let i=ls(n.dom);if(i.length!=1)return null;e+=i[0].width,t=i[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let n=pu(this,e,t);if(!this.children.length&&n&&this.parent){let{heightOracle:i}=this.parent.view.viewState,r=n.bottom-n.top;if(Math.abs(r-i.lineHeight)<2&&i.textHeight=t){if(r instanceof _t)return r;if(l>t)break}i=l+r.breakAfter}return null}}class si extends Le{constructor(e,t,n){super(),this.widget=e,this.length=t,this.type=n,this.breakAfter=0,this.prevWidget=null}merge(e,t,n,i,r,l){return n&&(!(n instanceof si)||!this.widget.compare(n.widget)||e>0&&r<=0||t0;){if(this.textOff==this.text.length){let{value:r,lineBreak:l,done:o}=this.cursor.next(this.skip);if(this.skip=0,o)throw new Error("Ran out of text content when drawing inline views");if(l){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=r,this.textOff=0}let i=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-n)),this.getLine().append(Ts(new Mn(this.text.slice(this.textOff,this.textOff+i)),t),n),this.atCursorPos=!0,this.textOff+=i,e-=i,n=0}}span(e,t,n,i){this.buildText(t-e,n,i),this.pos=t,this.openStart<0&&(this.openStart=i)}point(e,t,n,i,r,l){if(this.disallowBlockEffectsFor[l]&&n instanceof Fn){if(n.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let o=t-e;if(n instanceof Fn)if(n.block){let{type:a}=n;a==Fe.WidgetAfter&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new si(n.widget||new qa("div"),o,a))}else{let a=ii.create(n.widget||new qa("span"),o,o?0:n.startSide),h=this.atCursorPos&&!a.isEditable&&r<=i.length&&(e0),c=!a.isEditable&&(ei.length||n.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!h&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(i),h&&(f.append(Ts(new Ci(1),i),r),r=i.length+Math.max(0,r-i.length)),f.append(Ts(a,i),r),this.atCursorPos=c,this.pendingBuffer=c?ei.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=i.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(n);o&&(this.textOff+o<=this.text.length?this.textOff+=o:(this.skip+=o-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=r)}static build(e,t,n,i,r){let l=new Qi(e,t,n,r);return l.openEnd=Ne.spans(i,t,n,l),l.openStart<0&&(l.openStart=l.openEnd),l.finish(l.openEnd),l}}function Ts(s,e){for(let t of e)s=new Tn(t,[s],s.length);return s}class qa extends Di{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}const mu=le.define(),bu=le.define(),_u=le.define(),ku=le.define(),Kl=le.define(),vu=le.define(),yu=le.define(),wu=le.define({combine:s=>s.some(e=>e)}),Su=le.define({combine:s=>s.some(e=>e)});class or{constructor(e,t="nearest",n="nearest",i=5,r=5){this.range=e,this.y=t,this.x=n,this.yMargin=i,this.xMargin=r}map(e){return e.empty?this:new or(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin)}}const Ua=Pe.define({map:(s,e)=>s.map(e)});function xn(s,e,t){let n=s.facet(ku);n.length?n[0](e):window.onerror?window.onerror(String(e),t,void 0,void 0,e):t?console.error(t+":",e):console.error(e)}const Or=le.define({combine:s=>s.length?s[0]:!0});let Ig=0;const Ui=le.define();class ht{constructor(e,t,n,i){this.id=e,this.create=t,this.domEventHandlers=n,this.extension=i(this)}static define(e,t){const{eventHandlers:n,provide:i,decorations:r}=t||{};return new ht(Ig++,e,n,l=>{let o=[Ui.of(l)];return r&&o.push(os.of(a=>{let h=a.plugin(l);return h?r(h):Re.none})),i&&o.push(i(l)),o})}static fromClass(e,t){return ht.define(n=>new e(n),t)}}class hl{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(n){if(xn(t.state,n,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){xn(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(n){xn(e.state,n,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const xu=le.define(),Eo=le.define(),os=le.define(),Do=le.define(),Au=le.define();function Cu(s){let e=0,t=0,n=0,i=0;for(let r of s.state.facet(Au)){let l=r(s);l&&(l.left!=null&&(e=Math.max(e,l.left)),l.right!=null&&(t=Math.max(t,l.right)),l.top!=null&&(n=Math.max(n,l.top)),l.bottom!=null&&(i=Math.max(i,l.bottom)))}return{left:e,right:t,top:n,bottom:i}}const Ki=le.define();class It{constructor(e,t,n,i){this.fromA=e,this.toA=t,this.fromB=n,this.toB=i}join(e){return new It(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let i=e[t-1];if(!(i.fromA>n.toA)){if(i.toAc)break;r+=2}if(!a)return n;new It(a.fromA,a.toA,a.fromB,a.toB).addToSet(n),l=a.toA,o=a.toB}}}class ar{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=Ye.empty(this.startState.doc.length);for(let r of n)this.changes=this.changes.compose(r.changes);let i=[];this.changes.iterChangedRanges((r,l,o,a)=>i.push(new It(r,l,o,a))),this.changedRanges=i}static create(e,t,n){return new ar(e,t,n)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}var Ue=function(s){return s[s.LTR=0]="LTR",s[s.RTL=1]="RTL",s}(Ue||(Ue={}));const Jl=Ue.LTR,zg=Ue.RTL;function Mu(s){let e=[];for(let t=0;t=t){if(o.level==n)return l;(r<0||(i!=0?i<0?o.fromt:e[r].level>o.level))&&(r=l)}}if(r<0)throw new RangeError("Index out of range");return r}}const Ve=[];function Wg(s,e){let t=s.length,n=e==Jl?1:2,i=e==Jl?2:1;if(!s||n==1&&!Fg.test(s))return Tu(t);for(let l=0,o=n,a=n;l=0;u-=3)if(Qt[u+1]==-c){let d=Qt[u+2],p=d&2?n:d&4?d&1?i:n:0;p&&(Ve[l]=Ve[Qt[u]]=p),o=u;break}}else{if(Qt.length==189)break;Qt[o++]=l,Qt[o++]=h,Qt[o++]=a}else if((f=Ve[l])==2||f==1){let u=f==n;a=u?0:1;for(let d=o-3;d>=0;d-=3){let p=Qt[d+2];if(p&2)break;if(u)Qt[d+2]|=2;else{if(p&4)break;Qt[d+2]|=4}}}for(let l=0;lo;){let c=h,f=Ve[--h]!=2;for(;h>o&&f==(Ve[h-1]!=2);)h--;r.push(new Si(h,c,f?2:1))}else r.push(new Si(o,l,0))}else for(let l=0;l0&&t.length&&(t.every(({fromA:o,toA:a})=>athis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0);let n=this.view.inputState.composing<0?null:Kg(this.view,e.changes);if(this.hasComposition){this.markedForComposition.clear();let{from:o,to:a}=this.hasComposition;t=new It(o,a,e.changes.mapPos(o,-1),e.changes.mapPos(a,1)).addToSet(t.slice())}this.hasComposition=n?{from:n.range.fromB,to:n.range.toB}:null,(se.ie||se.chrome)&&!n&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let i=this.decorations,r=this.updateDeco(),l=Yg(i,r,e.changes);return t=It.extendWithRanges(t,l),!(this.flags&7)&&t.length==0?!1:(this.updateInner(t,e.startState.doc.length,n),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,n){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,n);let{observer:i}=this.view;i.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let l=se.chrome||se.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,l),this.flags&=-8,l&&(l.written||i.selectionRange.focusNode!=l.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(l=>l.flags&=-9);let r=[];if(this.view.viewport.from||this.view.viewport.to=0?i[l]:null;if(!o)break;let{fromA:a,toA:h,fromB:c,toB:f}=o,u,d,p,g;if(n&&n.range.fromBc){let w=Qi.build(this.view.state.doc,c,n.range.fromB,this.decorations,this.dynamicDecorationMap),B=Qi.build(this.view.state.doc,n.range.toB,f,this.decorations,this.dynamicDecorationMap);d=w.breakAtStart,p=w.openStart,g=B.openEnd;let D=this.compositionView(n);B.breakAtStart?D.breakAfter=1:B.content.length&&D.merge(D.length,D.length,B.content[0],!1,B.openStart,0)&&(D.breakAfter=B.content[0].breakAfter,B.content.shift()),w.content.length&&D.merge(0,0,w.content[w.content.length-1],!0,0,w.openEnd)&&w.content.pop(),u=w.content.concat(D).concat(B.content)}else({content:u,breakAtStart:d,openStart:p,openEnd:g}=Qi.build(this.view.state.doc,c,f,this.decorations,this.dynamicDecorationMap));let{i:m,off:_}=r.findPos(h,1),{i:v,off:E}=r.findPos(a,-1);ou(this,v,E,m,_,u,d,p,g)}n&&this.fixCompositionDOM(n)}compositionView(e){let t=new Mn(e.text.nodeValue);t.flags|=8;for(let{deco:i}of e.marks)t=new Tn(i,[t],t.length);let n=new _t;return n.append(t,0),n}fixCompositionDOM(e){let t=(r,l)=>{l.flags|=8,this.markedForComposition.add(l);let o=Le.get(r);o!=l&&(o&&(o.dom=null),l.setDOM(r))},n=this.childPos(e.range.fromB,1),i=this.children[n.i];t(e.line,i);for(let r=e.marks.length-1;r>=-1;r--)n=i.childPos(n.off,1),i=i.children[n.i],t(r>=0?e.marks[r].node:e.text,i)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let n=this.view.root.activeElement,i=n==this.dom,r=!i&&Ks(this.dom,this.view.observer.selectionRange)&&!(n&&this.dom.contains(n));if(!(i||t||r))return;let l=this.forceSelection;this.forceSelection=!1;let o=this.view.state.selection.main,a=this.domAtPos(o.anchor),h=o.empty?a:this.domAtPos(o.head);if(se.gecko&&o.empty&&!this.hasComposition&&Ug(a)){let f=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(f,a.node.childNodes[a.offset]||null)),a=h=new ut(f,0),l=!0}let c=this.view.observer.selectionRange;(l||!c.focusNode||!rr(a.node,a.offset,c.anchorNode,c.anchorOffset)||!rr(h.node,h.offset,c.focusNode,c.focusOffset))&&(this.view.observer.ignore(()=>{se.android&&se.chrome&&this.dom.contains(c.focusNode)&&Xg(c.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=sr(this.view.root);if(f)if(o.empty){if(se.gecko){let u=Jg(a.node,a.offset);if(u&&u!=3){let d=Ou(a.node,a.offset,u==1?1:-1);d&&(a=new ut(d,u==1?0:d.nodeValue.length))}}f.collapse(a.node,a.offset),o.bidiLevel!=null&&c.cursorBidiLevel!=null&&(c.cursorBidiLevel=o.bidiLevel)}else if(f.extend){f.collapse(a.node,a.offset);try{f.extend(h.node,h.offset)}catch{}}else{let u=document.createRange();o.anchor>o.head&&([a,h]=[h,a]),u.setEnd(h.node,h.offset),u.setStart(a.node,a.offset),f.removeAllRanges(),f.addRange(u)}r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),n&&n.focus())}),this.view.observer.setSelectionRange(a,h)),this.impreciseAnchor=a.precise?null:new ut(c.anchorNode,c.anchorOffset),this.impreciseHead=h.precise?null:new ut(c.focusNode,c.focusOffset)}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=sr(e.root),{anchorNode:i,anchorOffset:r}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let l=_t.find(this,t.head);if(!l)return;let o=l.posAtStart;if(t.head==o||t.head==o+l.length)return;let a=this.coordsAt(t.head,-1),h=this.coordsAt(t.head,1);if(!a||!h||a.bottom>h.top)return;let c=this.domAtPos(t.head+t.assoc);n.collapse(c.node,c.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=t.from&&n.collapse(i,r)}nearest(e){for(let t=e;t;){let n=Le.get(t);if(n&&n.rootView==this)return n;t=t.parentNode}return null}posFromDOM(e,t){let n=this.nearest(e);if(!n)throw new RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(e,t)+n.posAtStart}domAtPos(e){let{i:t,off:n}=this.childCursor().findPos(e,-1);for(;tl||e==l&&r.type!=Fe.WidgetBefore&&r.type!=Fe.WidgetAfter&&(!i||t==2||this.children[i-1].breakAfter||this.children[i-1].type==Fe.WidgetBefore&&t>-2))return r.coordsAt(e-l,t);n=l}}measureVisibleLineHeights(e){let t=[],{from:n,to:i}=e,r=this.view.contentDOM.clientWidth,l=r>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,a=this.view.textDirection==Ue.LTR;for(let h=0,c=0;ci)break;if(h>=n){let d=f.dom.getBoundingClientRect();if(t.push(d.height),l){let p=f.dom.lastChild,g=p?ls(p):[];if(g.length){let m=g[g.length-1],_=a?m.right-d.left:d.right-m.left;_>o&&(o=_,this.minWidth=r,this.minWidthFrom=h,this.minWidthTo=u)}}}h=u+f.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?Ue.RTL:Ue.LTR}measureTextSize(){for(let r of this.children)if(r instanceof _t){let l=r.measureTextSize();if(l)return l}let e=document.createElement("div"),t,n,i;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let r=ls(e.firstChild)[0];t=e.getBoundingClientRect().height,n=r?r.width/27:7,i=r?r.height:t,e.remove()}),{lineHeight:t,charWidth:n,textHeight:i}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new lu(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,i=0;;i++){let r=i==t.viewports.length?null:t.viewports[i],l=r?r.from-1:this.length;if(l>n){let o=t.lineBlockAt(l).bottom-t.lineBlockAt(n).top;e.push(Re.replace({widget:new Ja(o),block:!0,inclusive:!0,isBlockGap:!0}).range(n,l))}if(!r)break;n=r.to+1}return Re.set(e)}updateDeco(){let e=this.view.state.facet(os).map((t,n)=>(this.dynamicDecorationMap[n]=typeof t=="function")?t(this.view):t);for(let t=e.length;tt.anchor?-1:1),i;if(!n)return;!t.empty&&(i=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(n={left:Math.min(n.left,i.left),top:Math.min(n.top,i.top),right:Math.max(n.right,i.right),bottom:Math.max(n.bottom,i.bottom)});let r=Cu(this.view),l={left:n.left-r.left,top:n.top-r.top,right:n.right+r.right,bottom:n.bottom+r.bottom};Tg(this.view.scrollDOM,l,t.head-1)return null;l+=f.text.length}if(o=o.parentNode,!o)return null;let a=Le.get(o);if(a){i=r=a.posAtStart+l;break}}return{from:i,to:r,node:t}}function Kg(s,e){let t=Du(s);if(!t)return null;let{from:n,to:i,node:r}=t,l=e.mapPos(n,-1),o=e.mapPos(i,1),a=r.nodeValue;if(/[\n\r]/.test(a))return null;if(o-l!=a.length){let u=e.mapPos(n,1),d=e.mapPos(i,-1);if(d-u==a.length)l=u,o=d;else if(s.state.doc.sliceString(o-a.length,o)==a)l=o-a.length;else if(s.state.doc.sliceString(l,l+a.length)==a)o=l+a.length;else return null}let{main:h}=s.state.selection;if(s.state.doc.sliceString(l,o)!=a||l>h.head||o0)n=n.childNodes[i-1],i=Hn(n);else break}if(t>=0)for(let n=s,i=e;;){if(n.nodeType==3)return n;if(n.nodeType==1&&i=0)n=n.childNodes[i],i=0;else break}return null}function Jg(s,e){return s.nodeType!=1?0:(e&&s.childNodes[e-1].contentEditable=="false"?1:0)|(e0;){let h=Ct(i.text,l,!1);if(n(i.text.slice(h,l))!=a)break;l=h}for(;os?e.left-s:Math.max(0,s-e.right)}function em(s,e){return e.top>s?e.top-s:Math.max(0,s-e.bottom)}function cl(s,e){return s.tope.top+1}function Ga(s,e){return es.bottom?{top:s.top,left:s.left,right:s.right,bottom:e}:s}function Yl(s,e,t){let n,i,r,l,o=!1,a,h,c,f;for(let p=s.firstChild;p;p=p.nextSibling){let g=ls(p);for(let m=0;mE||l==E&&r>v){n=p,i=_,r=v,l=E;let w=E?t<_.top?-1:1:v?e<_.left?-1:1:0;o=!w||(w>0?m0)}v==0?t>_.bottom&&(!c||c.bottom<_.bottom)?(a=p,c=_):t<_.top&&(!f||f.top>_.top)&&(h=p,f=_):c&&cl(c,_)?c=Ya(c,_.bottom):f&&cl(f,_)&&(f=Ga(f,_.top))}}if(c&&c.bottom>=t?(n=a,i=c):f&&f.top<=t&&(n=h,i=f),!n)return{node:s,offset:0};let u=Math.max(i.left,Math.min(i.right,e));if(n.nodeType==3)return Xa(n,u,t);if(o&&n.contentEditable!="false")return Yl(n,u,t);let d=Array.prototype.indexOf.call(s.childNodes,n)+(e>=(i.left+i.right)/2?1:0);return{node:s,offset:d}}function Xa(s,e,t){let n=s.nodeValue.length,i=-1,r=1e9,l=0;for(let o=0;ot?c.top-t:t-c.bottom)-1;if(c.left-1<=e&&c.right+1>=e&&f=(c.left+c.right)/2,d=u;if((se.chrome||se.gecko)&&Ai(s,o).getBoundingClientRect().left==c.right&&(d=!u),f<=0)return{node:s,offset:o+(d?1:0)};i=o+(d?1:0),r=f}}}return{node:s,offset:i>-1?i:l>0?s.nodeValue.length:0}}function Pu(s,e,t,n=-1){var i,r;let l=s.contentDOM.getBoundingClientRect(),o=l.top+s.viewState.paddingTop,a,{docHeight:h}=s.viewState,{x:c,y:f}=e,u=f-o;if(u<0)return 0;if(u>h)return s.state.doc.length;for(let w=s.viewState.heightOracle.textHeight/2,B=!1;a=s.elementAtHeight(u),a.type!=Fe.Text;)for(;u=n>0?a.bottom+w:a.top-w,!(u>=0&&u<=h);){if(B)return t?null:0;B=!0,n=-n}f=o+u;let d=a.from;if(ds.viewport.to)return s.viewport.to==s.state.doc.length?s.state.doc.length:t?null:Za(s,l,a,c,f);let p=s.dom.ownerDocument,g=s.root.elementFromPoint?s.root:p,m=g.elementFromPoint(c,f);m&&!s.contentDOM.contains(m)&&(m=null),m||(c=Math.max(l.left+1,Math.min(l.right-1,c)),m=g.elementFromPoint(c,f),m&&!s.contentDOM.contains(m)&&(m=null));let _,v=-1;if(m&&((i=s.docView.nearest(m))===null||i===void 0?void 0:i.isEditable)!=!1){if(p.caretPositionFromPoint){let w=p.caretPositionFromPoint(c,f);w&&({offsetNode:_,offset:v}=w)}else if(p.caretRangeFromPoint){let w=p.caretRangeFromPoint(c,f);w&&({startContainer:_,startOffset:v}=w,(!s.contentDOM.contains(_)||se.safari&&tm(_,v,c)||se.chrome&&nm(_,v,c))&&(_=void 0))}}if(!_||!s.docView.dom.contains(_)){let w=_t.find(s.docView,d);if(!w)return u>a.top+a.height/2?a.to:a.from;({node:_,offset:v}=Yl(w.dom,c,f))}let E=s.docView.nearest(_);if(!E)return null;if(E.isWidget&&((r=E.dom)===null||r===void 0?void 0:r.nodeType)==1){let w=E.dom.getBoundingClientRect();return e.ys.defaultLineHeight*1.5){let o=s.viewState.heightOracle.textHeight,a=Math.floor((i-t.top-(s.defaultLineHeight-o)*.5)/o);r+=a*s.viewState.heightOracle.lineLength}let l=s.state.sliceDoc(t.from,t.to);return t.from+Rl(l,r,s.state.tabSize)}function tm(s,e,t){let n;if(s.nodeType!=3||e!=(n=s.nodeValue.length))return!1;for(let i=s.nextSibling;i;i=i.nextSibling)if(i.nodeType!=1||i.nodeName!="BR")return!1;return Ai(s,n-1,n).getBoundingClientRect().left>t}function nm(s,e,t){if(e!=0)return!1;for(let i=s;;){let r=i.parentNode;if(!r||r.nodeType!=1||r.firstChild!=i)return!1;if(r.classList.contains("cm-line"))break;i=r}let n=s.nodeType==1?s.getBoundingClientRect():Ai(s,0,Math.max(s.nodeValue.length,1)).getBoundingClientRect();return t-n.left>5}function Xl(s,e){let t=s.lineBlockAt(e);if(Array.isArray(t.type)){for(let n of t.type)if(n.to>e||n.to==e&&(n.to==t.to||n.type==Fe.Text))return n}return t}function im(s,e,t,n){let i=Xl(s,e.head),r=!n||i.type!=Fe.Text||!(s.lineWrapping||i.widgetLineBreaks)?null:s.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(r){let l=s.dom.getBoundingClientRect(),o=s.textDirectionAt(i.from),a=s.posAtCoords({x:t==(o==Ue.LTR)?l.right-1:l.left+1,y:(r.top+r.bottom)/2});if(a!=null)return F.cursor(a,t?-1:1)}return F.cursor(t?i.to:i.from,t?-1:1)}function Qa(s,e,t,n){let i=s.state.doc.lineAt(e.head),r=s.bidiSpans(i),l=s.textDirectionAt(i.from);for(let o=e,a=null;;){let h=qg(i,r,l,o,t),c=Eu;if(!h){if(i.number==(t?s.state.doc.lines:1))return o;c=` `,i=s.state.doc.line(i.number+(t?1:-1)),r=s.bidiSpans(i),h=F.cursor(t?i.from:i.to)}if(a){if(!a(c))return o}else{if(!n)return h;a=n(c)}o=h}}function sm(s,e,t){let n=s.state.charCategorizer(e),i=n(t);return r=>{let l=n(r);return i==Sn.Space&&(i=l),i==l}}function rm(s,e,t,n){let i=e.head,r=t?1:-1;if(i==(t?s.state.doc.length:0))return F.cursor(i,e.assoc);let l=e.goalColumn,o,a=s.contentDOM.getBoundingClientRect(),h=s.coordsAtPos(i),c=s.documentTop;if(h)l==null&&(l=h.left-a.left),o=r<0?h.top:h.bottom;else{let d=s.viewState.lineBlockAt(i);l==null&&(l=Math.min(a.right-a.left,s.defaultCharacterWidth*(i-d.from))),o=(r<0?d.top:d.bottom)+c}let f=a.left+l,u=n??s.viewState.heightOracle.textHeight>>1;for(let d=0;;d+=10){let p=o+(u+d)*r,g=Pu(s,{x:f,y:p},!1,r);if(pa.bottom||(r<0?gi))return F.cursor(g,e.assoc,void 0,l)}}function Js(s,e,t){for(;;){let n=0;for(let i of s)i.between(e-1,e+1,(r,l,o)=>{if(e>r&&ei(s)),t.from,e.head>t.from?-1:1);return n==t.from?t:F.cursor(n,n{this.ignoreDuringComposition(i)||i.type=="keydown"&&this.keydown(e,i)||(this.mustFlushObserver(i)&&e.observer.forceFlush(),this.runCustomHandlers(i.type,e,i)?i.preventDefault():n(e,i))};for(let n in Ge){let i=Ge[n];e.contentDOM.addEventListener(n,r=>{eh(e,r)&&t(i,r)},Zl[n]),this.registeredEvents.push(n)}e.scrollDOM.addEventListener("mousedown",n=>{if(n.target==e.scrollDOM&&n.clientY>e.contentDOM.getBoundingClientRect().bottom&&(t(Ge.mousedown,n),!n.defaultPrevented&&n.button==2)){let i=e.contentDOM.style.minHeight;e.contentDOM.style.minHeight="100%",setTimeout(()=>e.contentDOM.style.minHeight=i,200)}}),e.scrollDOM.addEventListener("drop",n=>{n.target==e.scrollDOM&&n.clientY>e.contentDOM.getBoundingClientRect().bottom&&t(Ge.drop,n)}),se.chrome&&se.chrome_version==102&&e.scrollDOM.addEventListener("wheel",()=>{this.chromeScrollHack<0?e.contentDOM.style.pointerEvents="none":window.clearTimeout(this.chromeScrollHack),this.chromeScrollHack=setTimeout(()=>{this.chromeScrollHack=-1,e.contentDOM.style.pointerEvents=""},100)},{passive:!0}),this.notifiedFocused=e.hasFocus,se.safari&&e.contentDOM.addEventListener("input",()=>null)}setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}ensureHandlers(e,t){var n;let i;this.customHandlers=[];for(let r of t)if(i=(n=r.update(e).spec)===null||n===void 0?void 0:n.domEventHandlers){this.customHandlers.push({plugin:r.value,handlers:i});for(let l in i)this.registeredEvents.indexOf(l)<0&&l!="scroll"&&(this.registeredEvents.push(l),e.contentDOM.addEventListener(l,o=>{eh(e,o)&&this.runCustomHandlers(l,e,o)&&o.preventDefault()}))}}runCustomHandlers(e,t,n){for(let i of this.customHandlers){let r=i.handlers[e];if(r)try{if(r.call(i.plugin,n,t)||n.defaultPrevented)return!0}catch(l){xn(t.state,l)}}return!1}runScrollHandlers(e,t){this.lastScrollTop=e.scrollDOM.scrollTop,this.lastScrollLeft=e.scrollDOM.scrollLeft;for(let n of this.customHandlers){let i=n.handlers.scroll;if(i)try{i.call(n.plugin,t,e)}catch(r){xn(e.state,r)}}}keydown(e,t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&Date.now()i.keyCode==t.keyCode))&&!t.ctrlKey||om.indexOf(t.key)>-1&&t.ctrlKey&&!t.shiftKey)?(this.pendingIOSKey=n||t,setTimeout(()=>this.flushIOSKey(e),250),!0):!1}flushIOSKey(e){let t=this.pendingIOSKey;return t?(this.pendingIOSKey=void 0,wi(e.contentDOM,t.key,t.keyCode)):!1}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:se.safari&&!se.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}mustFlushObserver(e){return e.type=="keydown"&&e.keyCode!=229}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.mouseSelection&&this.mouseSelection.update(e),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}const $u=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],om="dthko",Bu=[16,17,18,20,91,92,224,225],Es=6;function Ds(s){return Math.max(0,s)*.7+8}function am(s,e){return Math.max(Math.abs(s.clientX-e.clientX),Math.abs(s.clientY-e.clientY))}class hm{constructor(e,t,n,i){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParent=Eg(e.contentDOM),this.atoms=e.state.facet(Do).map(l=>l(e));let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(ye.allowMultipleSelections)&&cm(e,t),this.dragging=um(e,t)&&Iu(t)==1?null:!1}start(e){this.dragging===!1&&(e.preventDefault(),this.select(e))}move(e){var t;if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&am(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,i=0,r=((t=this.scrollParent)===null||t===void 0?void 0:t.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},l=Cu(this.view);e.clientX-l.left<=r.left+Es?n=-Ds(r.left-e.clientX):e.clientX+l.right>=r.right-Es&&(n=Ds(e.clientX-r.right)),e.clientY-l.top<=r.top+Es?i=-Ds(r.top-e.clientY):e.clientY+l.bottom>=r.bottom-Es&&(i=Ds(e.clientY-r.bottom)),this.setScrollSpeed(n,i)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let n=0;nthis.select(this.lastEvent),20)}}function cm(s,e){let t=s.state.facet(mu);return t.length?t[0](e):se.mac?e.metaKey:e.ctrlKey}function fm(s,e){let t=s.state.facet(bu);return t.length?t[0](e):se.mac?!e.altKey:!e.ctrlKey}function um(s,e){let{main:t}=s.state.selection;if(t.empty)return!1;let n=sr(s.root);if(!n||n.rangeCount==0)return!0;let i=n.getRangeAt(0).getClientRects();for(let r=0;r=e.clientX&&l.top<=e.clientY&&l.bottom>=e.clientY)return!0}return!1}function eh(s,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,n;t!=s.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(n=Le.get(t))&&n.ignoreEvent(e))return!1;return!0}const Ge=Object.create(null),Zl=Object.create(null),Nu=se.ie&&se.ie_version<15||se.ios&&se.webkit_version<604;function dm(s){let e=s.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{s.focus(),t.remove(),Lu(s,t.value)},50)}function Lu(s,e){let{state:t}=s,n,i=1,r=t.toText(e),l=r.lines==t.selection.ranges.length;if(Ql!=null&&t.selection.ranges.every(a=>a.empty)&&Ql==r.toString()){let a=-1;n=t.changeByRange(h=>{let c=t.doc.lineAt(h.from);if(c.from==a)return{range:h};a=c.from;let f=t.toText((l?r.line(i++).text:e)+t.lineBreak);return{changes:{from:c.from,insert:f},range:F.cursor(h.from+f.length)}})}else l?n=t.changeByRange(a=>{let h=r.line(i++);return{changes:{from:a.from,to:a.to,insert:h.text},range:F.cursor(a.from+h.length)}}):n=t.replaceSelection(r);s.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}Ge.keydown=(s,e)=>{s.inputState.setSelectionOrigin("select"),e.keyCode==27&&(s.inputState.lastEscPress=Date.now())};Ge.touchstart=(s,e)=>{s.inputState.lastTouchTime=Date.now(),s.inputState.setSelectionOrigin("select.pointer")};Ge.touchmove=s=>{s.inputState.setSelectionOrigin("select.pointer")};Zl.touchstart=Zl.touchmove={passive:!0};Ge.mousedown=(s,e)=>{if(s.observer.flush(),s.inputState.lastTouchTime>Date.now()-2e3)return;let t=null;for(let n of s.state.facet(_u))if(t=n(s,e),t)break;if(!t&&e.button==0&&(t=mm(s,e)),t){let n=!s.hasFocus;s.inputState.startMouseSelection(new hm(s,e,t,n)),n&&s.observer.ignore(()=>iu(s.contentDOM)),s.inputState.mouseSelection&&s.inputState.mouseSelection.start(e)}};function th(s,e,t,n){if(n==1)return F.cursor(e,t);if(n==2)return Zg(s.state,e,t);{let i=_t.find(s.docView,e),r=s.state.doc.lineAt(i?i.posAtEnd:e),l=i?i.posAtStart:r.from,o=i?i.posAtEnd:r.to;return os>=e.top&&s<=e.bottom,nh=(s,e,t)=>Ru(e,t)&&s>=t.left&&s<=t.right;function pm(s,e,t,n){let i=_t.find(s.docView,e);if(!i)return 1;let r=e-i.posAtStart;if(r==0)return 1;if(r==i.length)return-1;let l=i.coordsAt(r,-1);if(l&&nh(t,n,l))return-1;let o=i.coordsAt(r,1);return o&&nh(t,n,o)?1:l&&Ru(n,l)?-1:1}function ih(s,e){let t=s.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:pm(s,t,e.clientX,e.clientY)}}const gm=se.ie&&se.ie_version<=11;let sh=null,rh=0,lh=0;function Iu(s){if(!gm)return s.detail;let e=sh,t=lh;return sh=s,lh=Date.now(),rh=!e||t>Date.now()-400&&Math.abs(e.clientX-s.clientX)<2&&Math.abs(e.clientY-s.clientY)<2?(rh+1)%3:1}function mm(s,e){let t=ih(s,e),n=Iu(e),i=s.state.selection;return{update(r){r.docChanged&&(t.pos=r.changes.mapPos(t.pos),i=i.map(r.changes))},get(r,l,o){let a=ih(s,r),h,c=th(s,a.pos,a.bias,n);if(t.pos!=a.pos&&!l){let f=th(s,t.pos,t.bias,n),u=Math.min(f.from,c.from),d=Math.max(f.to,c.to);c=u1&&(h=bm(i,a.pos))?h:o?i.addRange(c):F.create([c])}}}function bm(s,e){for(let t=0;t=e)return F.create(s.ranges.slice(0,t).concat(s.ranges.slice(t+1)),s.mainIndex==t?0:s.mainIndex-(s.mainIndex>t?1:0))}return null}Ge.dragstart=(s,e)=>{let{selection:{main:t}}=s.state,{mouseSelection:n}=s.inputState;n&&(n.dragging=t),e.dataTransfer&&(e.dataTransfer.setData("Text",s.state.sliceDoc(t.from,t.to)),e.dataTransfer.effectAllowed="copyMove")};function oh(s,e,t,n){if(!t)return;let i=s.posAtCoords({x:e.clientX,y:e.clientY},!1);e.preventDefault();let{mouseSelection:r}=s.inputState,l=n&&r&&r.dragging&&fm(s,e)?{from:r.dragging.from,to:r.dragging.to}:null,o={from:i,insert:t},a=s.state.changes(l?[l,o]:o);s.focus(),s.dispatch({changes:a,selection:{anchor:a.mapPos(i,-1),head:a.mapPos(i,1)},userEvent:l?"move.drop":"input.drop"})}Ge.drop=(s,e)=>{if(!e.dataTransfer)return;if(s.state.readOnly)return e.preventDefault();let t=e.dataTransfer.files;if(t&&t.length){e.preventDefault();let n=Array(t.length),i=0,r=()=>{++i==t.length&&oh(s,e,n.filter(l=>l!=null).join(s.state.lineBreak),!1)};for(let l=0;l{/[\x00-\x08\x0e-\x1f]{2}/.test(o.result)||(n[l]=o.result),r()},o.readAsText(t[l])}}else oh(s,e,e.dataTransfer.getData("Text"),!0)};Ge.paste=(s,e)=>{if(s.state.readOnly)return e.preventDefault();s.observer.flush();let t=Nu?null:e.clipboardData;t?(Lu(s,t.getData("text/plain")||t.getData("text/uri-text")),e.preventDefault()):dm(s)};function _m(s,e){let t=s.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.value=e,n.focus(),n.selectionEnd=e.length,n.selectionStart=0,setTimeout(()=>{n.remove(),s.focus()},50)}function km(s){let e=[],t=[],n=!1;for(let i of s.selection.ranges)i.empty||(e.push(s.sliceDoc(i.from,i.to)),t.push(i));if(!e.length){let i=-1;for(let{from:r}of s.selection.ranges){let l=s.doc.lineAt(r);l.number>i&&(e.push(l.text),t.push({from:l.from,to:Math.min(s.doc.length,l.to+1)})),i=l.number}n=!0}return{text:e.join(s.lineBreak),ranges:t,linewise:n}}let Ql=null;Ge.copy=Ge.cut=(s,e)=>{let{text:t,ranges:n,linewise:i}=km(s.state);if(!t&&!i)return;Ql=i?t:null;let r=Nu?null:e.clipboardData;r?(e.preventDefault(),r.clearData(),r.setData("text/plain",t)):_m(s,t),e.type=="cut"&&!s.state.readOnly&&s.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"})};const zu=qn.define();function ju(s,e){let t=[];for(let n of s.facet(yu)){let i=n(s,e);i&&t.push(i)}return t?s.update({effects:t,annotations:zu.of(!0)}):null}function Vu(s){setTimeout(()=>{let e=s.hasFocus;if(e!=s.inputState.notifiedFocused){let t=ju(s.state,e);t?s.dispatch(t):s.update([])}},10)}Ge.focus=s=>{s.inputState.lastFocusTime=Date.now(),!s.scrollDOM.scrollTop&&(s.inputState.lastScrollTop||s.inputState.lastScrollLeft)&&(s.scrollDOM.scrollTop=s.inputState.lastScrollTop,s.scrollDOM.scrollLeft=s.inputState.lastScrollLeft),Vu(s)};Ge.blur=s=>{s.observer.clearSelectionRange(),Vu(s)};Ge.compositionstart=Ge.compositionupdate=s=>{s.inputState.compositionFirstChange==null&&(s.inputState.compositionFirstChange=!0),s.inputState.composing<0&&(s.inputState.composing=0)};Ge.compositionend=s=>{s.inputState.composing=-1,s.inputState.compositionEndedAt=Date.now(),s.inputState.compositionPendingKey=!0,s.inputState.compositionPendingChange=s.observer.pendingRecords().length>0,s.inputState.compositionFirstChange=null,se.chrome&&se.android?s.observer.flushSoon():s.inputState.compositionPendingChange?Promise.resolve().then(()=>s.observer.flush()):setTimeout(()=>{s.inputState.composing<0&&s.docView.hasComposition&&s.update([])},50)};Ge.contextmenu=s=>{s.inputState.lastContextMenu=Date.now()};Ge.beforeinput=(s,e)=>{var t;let n;if(se.chrome&&se.android&&(n=$u.find(i=>i.inputType==e.inputType))&&(s.observer.delayAndroidKey(n.key,n.keyCode),n.key=="Backspace"||n.key=="Delete")){let i=((t=window.visualViewport)===null||t===void 0?void 0:t.height)||0;setTimeout(()=>{var r;(((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0)>i+10&&s.hasFocus&&(s.contentDOM.blur(),s.focus())},100)}};const ah=["pre-wrap","normal","pre-line","break-spaces"];class vm{constructor(e){this.lineWrapping=e,this.doc=De.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return ah.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=t,this.charWidth=n,this.textHeight=i,this.lineLength=r,a){this.heightSamples={};for(let h=0;h0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e,t){this.height!=t&&(Math.abs(this.height-t)>Gs&&(e.heightChanged=!0),this.height=t)}replace(e,t,n){return dt.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,i){let r=this,l=n.doc;for(let o=i.length-1;o>=0;o--){let{fromA:a,toA:h,fromB:c,toB:f}=i[o],u=r.lineAt(a,Ie.ByPosNoHeight,n.setDoc(t),0,0),d=u.to>=h?u:r.lineAt(h,Ie.ByPosNoHeight,n,0,0);for(f+=d.to-h,h=d.to;o>0&&u.from<=i[o-1].toA;)a=i[o-1].fromA,c=i[o-1].fromB,o--,ar*2){let o=e[t-1];o.break?e.splice(--t,1,o.left,null,o.right):e.splice(--t,1,o.left,o.right),n+=1+o.break,i-=o.size}else if(r>i*2){let o=e[n];o.break?e.splice(n,1,o.left,null,o.right):e.splice(n,1,o.left,o.right),n+=2+o.break,r-=o.size}else break;else if(i=r&&l(this.blockAt(0,n,i,r))}updateHeight(e,t=0,n=!1,i){return i&&i.from<=t&&i.more&&this.setHeight(e,i.heights[i.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class xt extends Hu{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,n,i){return new an(i,this.length,n,this.height,this.breaks)}replace(e,t,n){let i=n[0];return n.length==1&&(i instanceof xt||i instanceof nt&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof nt?i=new xt(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):dt.of(n)}updateHeight(e,t=0,n=!1,i){return i&&i.from<=t&&i.more?this.setHeight(e,i.heights[i.index++]):(n||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class nt extends dt{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,i=e.doc.lineAt(t+this.length).number,r=i-n+1,l,o=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*r);l=a/r,this.length>r+1&&(o=(this.height-a)/(this.length-r-1))}else l=this.height/r;return{firstLine:n,lastLine:i,perLine:l,perChar:o}}blockAt(e,t,n,i){let{firstLine:r,lastLine:l,perLine:o,perChar:a}=this.heightMetrics(t,i);if(t.lineWrapping){let h=i+Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length),c=t.doc.lineAt(h),f=o+c.length*a,u=Math.max(n,e-f/2);return new an(c.from,c.length,u,f,0)}else{let h=Math.max(0,Math.min(l-r,Math.floor((e-n)/o))),{from:c,length:f}=t.doc.line(r+h);return new an(c,f,n+o*h,o,0)}}lineAt(e,t,n,i,r){if(t==Ie.ByHeight)return this.blockAt(e,n,i,r);if(t==Ie.ByPosNoHeight){let{from:d,to:p}=n.doc.lineAt(e);return new an(d,p-d,0,0,0)}let{firstLine:l,perLine:o,perChar:a}=this.heightMetrics(n,r),h=n.doc.lineAt(e),c=o+h.length*a,f=h.number-l,u=i+o*f+a*(h.from-r-f);return new an(h.from,h.length,Math.max(i,Math.min(u,i+this.height-c)),c,0)}forEachLine(e,t,n,i,r,l){e=Math.max(e,r),t=Math.min(t,r+this.length);let{firstLine:o,perLine:a,perChar:h}=this.heightMetrics(n,r);for(let c=e,f=i;c<=t;){let u=n.doc.lineAt(c);if(c==e){let p=u.number-o;f+=a*p+h*(e-r-p)}let d=a+h*u.length;l(new an(u.from,u.length,f,d,0)),f+=d,c=u.to+1}}replace(e,t,n){let i=this.length-t;if(i>0){let r=n[n.length-1];r instanceof nt?n[n.length-1]=new nt(r.length+i):n.push(null,new nt(i-1))}if(e>0){let r=n[0];r instanceof nt?n[0]=new nt(e+r.length):n.unshift(new nt(e-1),null)}return dt.of(n)}decomposeLeft(e,t){t.push(new nt(e-1),null)}decomposeRight(e,t){t.push(null,new nt(this.length-e-1))}updateHeight(e,t=0,n=!1,i){let r=t+this.length;if(i&&i.from<=t+this.length&&i.more){let l=[],o=Math.max(t,i.from),a=-1;for(i.from>t&&l.push(new nt(i.from-t-1).updateHeight(e,t));o<=r&&i.more;){let c=e.doc.lineAt(o).length;l.length&&l.push(null);let f=i.heights[i.index++];a==-1?a=f:Math.abs(f-a)>=Gs&&(a=-2);let u=new xt(c,f);u.outdated=!1,l.push(u),o+=c+1}o<=r&&l.push(null,new nt(r-o).updateHeight(e,o));let h=dt.of(l);return(a<0||Math.abs(h.height-this.height)>=Gs||Math.abs(a-this.heightMetrics(e,t).perLine)>=Gs)&&(e.heightChanged=!0),h}else(n||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class wm extends dt{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return this.flags&1}blockAt(e,t,n,i){let r=n+this.left.height;return eo))return h;let c=t==Ie.ByPosNoHeight?Ie.ByPosNoHeight:Ie.ByPos;return a?h.join(this.right.lineAt(o,c,n,l,o)):this.left.lineAt(o,c,n,i,r).join(h)}forEachLine(e,t,n,i,r,l){let o=i+this.left.height,a=r+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,n,o,a,l);else{let h=this.lineAt(a,Ie.ByPos,n,i,r);e=e&&h.from<=t&&l(h),t>h.to&&this.right.forEachLine(h.to+1,t,n,o,a,l)}}replace(e,t,n){let i=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-i,t-i,n));let r=[];e>0&&this.decomposeLeft(e,r);let l=r.length;for(let o of n)r.push(o);if(e>0&&hh(r,l-1),t=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,i=n+this.break;if(e>=i)return this.right.decomposeRight(e-i,t);e2*t.size||t.size>2*e.size?dt.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=e.height+t.height,this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,i){let{left:r,right:l}=this,o=t+r.length+this.break,a=null;return i&&i.from<=t+r.length&&i.more?a=r=r.updateHeight(e,t,n,i):r.updateHeight(e,t,n),i&&i.from<=o+l.length&&i.more?a=l=l.updateHeight(e,o,n,i):l.updateHeight(e,o,n),a?this.balanced(r,l):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function hh(s,e){let t,n;s[e]==null&&(t=s[e-1])instanceof nt&&(n=s[e+1])instanceof nt&&s.splice(e-1,3,new nt(t.length+1+n.length))}const Sm=5;class Oo{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let n=Math.min(t,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof xt?i.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new xt(n-this.pos,-1)),this.writtenTo=n,t>n&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e=Sm)&&this.addLineDeco(i,r,l)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new xt(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let n=new nt(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof xt)return e;let t=new xt(0,-1);return this.nodes.push(t),t}addBlock(e){var t;this.enterLine();let n=(t=e.deco)===null||t===void 0?void 0:t.type;n==Fe.WidgetAfter&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n!=Fe.WidgetBefore&&(this.covering=e)}addLineDeco(e,t,n){let i=this.ensureLine();i.length+=n,i.collapsed+=n,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=t,this.writtenTo=this.pos=this.pos+n}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof xt)&&!this.isCovered?this.nodes.push(new xt(0,-1)):(this.writtenToc.clientHeight||c.scrollWidth>c.clientWidth)&&f.overflow!="visible"){let u=c.getBoundingClientRect();r=Math.max(r,u.left),l=Math.min(l,u.right),o=Math.max(o,u.top),a=h==s.parentNode?u.bottom:Math.min(a,u.bottom)}h=f.position=="absolute"||f.position=="fixed"?c.offsetParent:c.parentNode}else if(h.nodeType==11)h=h.host;else break;return{left:r-t.left,right:Math.max(r,l)-t.left,top:o-(t.top+e),bottom:Math.max(o,a)-(t.top+e)}}function Mm(s,e){let t=s.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class ul{constructor(e,t,n){this.from=e,this.to=t,this.size=n}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;ntypeof n!="function"&&n.class=="cm-lineWrapping");this.heightOracle=new vm(t),this.stateDeco=e.facet(os).filter(n=>typeof n!="function"),this.heightMap=dt.empty().applyChanges(this.stateDeco,De.empty,this.heightOracle.setDoc(e.doc),[new It(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Re.set(this.lineGaps.map(n=>n.draw(!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let i=n?t.head:t.anchor;if(!e.some(({from:r,to:l})=>i>=r&&i<=l)){let{from:r,to:l}=this.lineBlockAt(i);e.push(new Os(r,l))}}this.viewports=e.sort((n,i)=>n.from-i.from),this.scaler=this.heightMap.height<=7e6?fh:new Om(this.heightOracle,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(this.scaler.scale==1?e:Ji(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=this.state.facet(os).filter(c=>typeof c!="function");let i=e.changedRanges,r=It.extendWithRanges(i,xm(n,this.stateDeco,e?e.changes:Ye.empty(this.state.doc.length))),l=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),this.heightMap.height!=l&&(e.flags|=2),o?(this.scrollAnchorPos=e.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let h=!e.changes.empty||e.flags&2||a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,this.updateForViewport(),h&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(Su)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,n=window.getComputedStyle(t),i=this.heightOracle,r=n.whiteSpace;this.defaultTextDirection=n.direction=="rtl"?Ue.RTL:Ue.LTR;let l=this.heightOracle.mustRefreshForWrapping(r),o=t.getBoundingClientRect(),a=l||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let h=0,c=0,f=parseInt(n.paddingTop)||0,u=parseInt(n.paddingBottom)||0;(this.paddingTop!=f||this.paddingBottom!=u)&&(this.paddingTop=f,this.paddingBottom=u,h|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,h|=8),this.scrollTop!=e.scrollDOM.scrollTop&&(this.scrollAnchorHeight=-1,this.scrollTop=e.scrollDOM.scrollTop),this.scrolledToBottom=ru(e.scrollDOM);let d=(this.printing?Mm:Cm)(t,this.paddingTop),p=d.top-this.pixelViewport.top,g=d.bottom-this.pixelViewport.bottom;this.pixelViewport=d;let m=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(m!=this.inView&&(this.inView=m,m&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let _=o.width;if((this.contentDOMWidth!=_||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=o.width,this.editorHeight=e.scrollDOM.clientHeight,h|=8),a){let E=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(E)&&(l=!0),l||i.lineWrapping&&Math.abs(_-this.contentDOMWidth)>i.charWidth){let{lineHeight:w,charWidth:B,textHeight:D}=e.docView.measureTextSize();l=w>0&&i.refresh(r,w,B,D,_/B,E),l&&(e.docView.minWidth=0,h|=8)}p>0&&g>0?c=Math.max(p,g):p<0&&g<0&&(c=Math.min(p,g)),i.heightChanged=!1;for(let w of this.viewports){let B=w.from==this.viewport.from?E:e.docView.measureVisibleLineHeights(w);this.heightMap=(l?dt.empty().applyChanges(this.stateDeco,De.empty,this.heightOracle,[new It(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,l,new ym(w.from,B))}i.heightChanged&&(h|=2)}let v=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return v&&(this.viewport=this.getViewport(c,this.scrollTarget)),this.updateForViewport(),(h&2||v)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(l?[]:this.lineGaps,e)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,r=this.heightOracle,{visibleTop:l,visibleBottom:o}=this,a=new Os(i.lineAt(l-n*1e3,Ie.ByHeight,r,0,0).from,i.lineAt(o+(1-n)*1e3,Ie.ByHeight,r,0,0).to);if(t){let{head:h}=t.range;if(ha.to){let c=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=i.lineAt(h,Ie.ByPos,r,0,0),u;t.y=="center"?u=(f.top+f.bottom)/2-c/2:t.y=="start"||t.y=="nearest"&&h=o+Math.max(10,Math.min(n,250)))&&i>l-2*1e3&&r>1,l=i<<1;if(this.defaultTextDirection!=Ue.LTR&&!n)return[];let o=[],a=(h,c,f,u)=>{if(c-hh&&mm.from>=f.from&&m.to<=f.to&&Math.abs(m.from-h)m.from<_&&m.to>_));if(!g){if(cm.from<=c&&m.to>=c)){let m=t.moveToLineBoundary(F.cursor(c),!1,!0).head;m>h&&(c=m)}g=new ul(h,c,this.gapSize(f,h,c,u))}o.push(g)};for(let h of this.viewportLines){if(h.lengthh.from&&a(h.from,u,h,c),dt.draw(this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];Ne.spans(e,this.viewport.from,this.viewport.to,{span(i,r){t.push({from:i,to:r})},point(){}},20);let n=t.length!=this.visibleRanges.length||this.visibleRanges.some((i,r)=>i.from!=t[r].from||i.to!=t[r].to);return this.visibleRanges=t,n?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Ji(this.heightMap.lineAt(e,Ie.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return Ji(this.heightMap.lineAt(this.scaler.fromDOM(e),Ie.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return Ji(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Os{constructor(e,t){this.from=e,this.to=t}}function Em(s,e,t){let n=[],i=s,r=0;return Ne.spans(t,s,e,{span(){},point(l,o){l>i&&(n.push({from:i,to:l}),r+=l-i),i=o}},20),i=1)return e[e.length-1].to;let n=Math.floor(s*t);for(let i=0;;i++){let{from:r,to:l}=e[i],o=l-r;if(n<=o)return r+n;n-=o}}function $s(s,e){let t=0;for(let{from:n,to:i}of s.ranges){if(e<=i){t+=e-n;break}t+=i-n}return t/s.total}function Dm(s,e){for(let t of s)if(e(t))return t}const fh={toDOM(s){return s},fromDOM(s){return s},scale:1};class Om{constructor(e,t,n){let i=0,r=0,l=0;this.viewports=n.map(({from:o,to:a})=>{let h=t.lineAt(o,Ie.ByPos,e,0,0).top,c=t.lineAt(a,Ie.ByPos,e,0,0).bottom;return i+=c-h,{from:o,to:a,top:h,bottom:c,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(t.height-i);for(let o of this.viewports)o.domTop=l+(o.top-r)*this.scale,l=o.domBottom=o.domTop+(o.bottom-o.top),r=o.bottom}toDOM(e){for(let t=0,n=0,i=0;;t++){let r=tJi(i,e)):s._content)}const Bs=le.define({combine:s=>s.join(" ")}),eo=le.define({combine:s=>s.indexOf(!0)>-1}),to=jn.newName(),Fu=jn.newName(),Wu=jn.newName(),qu={"&light":"."+Fu,"&dark":"."+Wu};function no(s,e,t){return new jn(e,{finish(n){return/&/.test(n)?n.replace(/&\w*/,i=>{if(i=="&")return s;if(!t||!t[i])throw new RangeError(`Unsupported selector: ${i}`);return t[i]}):s+" "+n}})}const Pm=no("."+to,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",left:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},qu);class $m{constructor(e,t,n,i){this.typeOver=i,this.bounds=null,this.text="";let{impreciseHead:r,impreciseAnchor:l}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,n,0))){let o=r||l?[]:Nm(e),a=new hu(o,e.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=Lm(o,this.bounds.from)}else{let o=e.observer.selectionRange,a=r&&r.node==o.focusNode&&r.offset==o.focusOffset||!jl(e.contentDOM,o.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(o.focusNode,o.focusOffset),h=l&&l.node==o.anchorNode&&l.offset==o.anchorOffset||!jl(e.contentDOM,o.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(o.anchorNode,o.anchorOffset);this.newSel=F.single(h,a)}}}function Uu(s,e){let t,{newSel:n}=e,i=s.state.selection.main,r=s.inputState.lastKeyTime>Date.now()-100?s.inputState.lastKeyCode:-1;if(e.bounds){let{from:l,to:o}=e.bounds,a=i.from,h=null;(r===8||se.android&&e.text.length=i.from&&t.to<=i.to&&(t.from!=i.from||t.to!=i.to)&&i.to-i.from-(t.to-t.from)<=4?t={from:i.from,to:i.to,insert:s.state.doc.slice(i.from,t.from).append(t.insert).append(s.state.doc.slice(t.to,i.to))}:(se.mac||se.android)&&t&&t.from==t.to&&t.from==i.head-1&&/^\. ?$/.test(t.insert.toString())&&s.contentDOM.getAttribute("autocorrect")=="off"?(n&&t.insert.length==2&&(n=F.single(n.main.anchor-1,n.main.head-1)),t={from:i.from,to:i.to,insert:De.of([" "])}):se.chrome&&t&&t.from==t.to&&t.from==i.head&&t.insert.toString()==` `&&s.lineWrapping&&(n&&(n=F.single(n.main.anchor-1,n.main.head-1)),t={from:i.from,to:i.to,insert:De.of([" "])}),t){let l=s.state;if(se.ios&&s.inputState.flushIOSKey(s)||se.android&&(t.from==i.from&&t.to==i.to&&t.insert.length==1&&t.insert.lines==2&&wi(s.contentDOM,"Enter",13)||(t.from==i.from-1&&t.to==i.to&&t.insert.length==0||r==8&&t.insert.lengthc(s,t.from,t.to,o)))return!0;s.inputState.composing>=0&&s.inputState.composing++;let a;if(t.from>=i.from&&t.to<=i.to&&t.to-t.from>=(i.to-i.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&s.inputState.composing<0){let c=i.fromt.to?l.sliceDoc(t.to,i.to):"";a=l.replaceSelection(s.state.toText(c+t.insert.sliceString(0,void 0,s.state.lineBreak)+f))}else{let c=l.changes(t),f=n&&n.main.to<=c.newLength?n.main:void 0;if(l.selection.ranges.length>1&&s.inputState.composing>=0&&t.to<=i.to&&t.to>=i.to-10){let u=s.state.sliceDoc(t.from,t.to),d=Du(s)||s.state.doc.lineAt(i.head),p=i.to-t.to,g=i.to-i.from;a=l.changeByRange(m=>{if(m.from==i.from&&m.to==i.to)return{changes:c,range:f||m.map(c)};let _=m.to-p,v=_-u.length;if(m.to-m.from!=g||s.state.sliceDoc(v,_)!=u||d&&m.to>=d.from&&m.from<=d.to)return{range:m};let E=l.changes({from:v,to:_,insert:t.insert}),w=m.to-i.to;return{changes:E,range:f?F.range(Math.max(0,f.anchor+w),Math.max(0,f.head+w)):m.map(E)}})}else a={changes:c,selection:f&&l.selection.replaceRange(f)}}let h="input.type";return(s.composing||s.inputState.compositionPendingChange&&s.inputState.compositionEndedAt>Date.now()-50)&&(s.inputState.compositionPendingChange=!1,h+=".compose",s.inputState.compositionFirstChange&&(h+=".start",s.inputState.compositionFirstChange=!1)),s.dispatch(a,{scrollIntoView:!0,userEvent:h}),!0}else if(n&&!n.main.eq(i)){let l=!1,o="select";return s.inputState.lastSelectionTime>Date.now()-50&&(s.inputState.lastSelectionOrigin=="select"&&(l=!0),o=s.inputState.lastSelectionOrigin),s.dispatch({selection:n,scrollIntoView:l,userEvent:o}),!0}else return!1}function Bm(s,e,t,n){let i=Math.min(s.length,e.length),r=0;for(;r0&&o>0&&s.charCodeAt(l-1)==e.charCodeAt(o-1);)l--,o--;if(n=="end"){let a=Math.max(0,r-Math.min(l,o));t-=l+a-r}if(l=l?r-t:0;r-=a,o=r+(o-l),l=r}else if(o=o?r-t:0;r-=a,l=r+(l-o),o=r}return{from:r,toA:l,toB:o}}function Nm(s){let e=[];if(s.root.activeElement!=s.contentDOM)return e;let{anchorNode:t,anchorOffset:n,focusNode:i,focusOffset:r}=s.observer.selectionRange;return t&&(e.push(new ja(t,n)),(i!=t||r!=n)&&e.push(new ja(i,r))),e}function Lm(s,e){if(s.length==0)return null;let t=s[0].pos,n=s.length==2?s[1].pos:t;return t>-1&&n>-1?F.single(t+e,n+e):null}const Rm={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},dl=se.ie&&se.ie_version<=11;class Im{constructor(e){this.view=e,this.active=!1,this.selectionRange=new Dg,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.resizeContent=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let n of t)this.queue.push(n);(se.ie&&se.ie_version<=11||se.ios&&e.composing)&&t.some(n=>n.type=="childList"&&n.removedNodes.length||n.type=="characterData"&&n.oldValue.length>n.target.nodeValue.length)?this.flushSoon():this.flush()}),dl&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate)this.view.requestMeasure()),this.resizeContent.observe(e.contentDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runScrollHandlers(this.view,e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(){this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500)}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,i=this.selectionRange;if(n.state.facet(Or)?n.root.activeElement!=this.dom:!Ks(n.dom,i))return;let r=i.anchorNode&&n.docView.nearest(i.anchorNode);if(r&&r.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(se.ie&&se.ie_version<=11||se.android&&se.chrome)&&!n.state.selection.main.empty&&i.focusNode&&rr(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=se.safari&&e.root.nodeType==11&&Cg(this.dom.ownerDocument)==this.dom&&zm(this.view)||sr(e.root);if(!t||this.selectionRange.eq(t))return!1;let n=Ks(this.dom,t);return n&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let r=this.delayedAndroidKey;r&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=r.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&r.force&&wi(this.dom,r.key,r.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,i=!1;for(let r of e){let l=this.readMutation(r);l&&(l.typeOver&&(i=!0),t==-1?{from:t,to:n}=l:(t=Math.min(l.from,t),n=Math.max(l.to,n)))}return{from:t,to:n,typeOver:i}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),i=this.selectionChanged&&Ks(this.dom,this.selectionRange);return e<0&&!i?null:(e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1,new $m(this.view,e,t,n))}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return!1;let n=this.view.state,i=Uu(this.view,t);return this.view.state==n&&this.view.update([]),i}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let n=uh(t,e.previousSibling||e.target.previousSibling,-1),i=uh(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:i?t.posBefore(i):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}destroy(){var e,t,n,i;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(n=this.resizeScroll)===null||n===void 0||n.disconnect(),(i=this.resizeContent)===null||i===void 0||i.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}}function uh(s,e,t){for(;e;){let n=Le.get(e);if(n&&n.parent==s)return n;let i=e.parentNode;e=i!=s.dom?i:t>0?e.nextSibling:e.previousSibling}return null}function zm(s){let e=null;function t(a){a.preventDefault(),a.stopImmediatePropagation(),e=a.getTargetRanges()[0]}if(s.contentDOM.addEventListener("beforeinput",t,!0),s.dom.ownerDocument.execCommand("indent"),s.contentDOM.removeEventListener("beforeinput",t,!0),!e)return null;let n=e.startContainer,i=e.startOffset,r=e.endContainer,l=e.endOffset,o=s.docView.domAtPos(s.state.selection.main.anchor);return rr(o.node,o.offset,r,l)&&([n,i,r,l]=[r,l,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:l}}class ce{constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.style.cssText="position: fixed; top: -10000px",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),this._dispatch=e.dispatch||(t=>this.update([t])),this.dispatch=this.dispatch.bind(this),this._root=e.root||Og(e.parent)||document,this.viewState=new ch(e.state||ye.create(e)),this.plugins=this.state.facet(Ui).map(t=>new hl(t));for(let t of this.plugins)t.update(this);this.observer=new Im(this),this.inputState=new lm(this),this.inputState.ensureHandlers(this,this.plugins),this.docView=new Ka(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),e.parent&&e.parent.appendChild(this.dom)}get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}dispatch(...e){let t=e.length==1&&e[0]instanceof Ze?e[0]:this.state.update(...e);this._dispatch(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,n=!1,i,r=this.state;for(let u of e){if(u.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=u.state}if(this.destroyed){this.viewState.state=r;return}let l=this.hasFocus,o=0,a=null;e.some(u=>u.annotation(zu))?(this.inputState.notifiedFocused=l,o=1):l!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=l,a=ju(r,l),a||(o=1));let h=this.observer.delayedAndroidKey,c=null;if(h?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(c=null)):this.observer.clear(),r.facet(ye.phrases)!=this.state.facet(ye.phrases))return this.setState(r);i=ar.create(this,r,e),i.flags|=o;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let u of e){if(f&&(f=f.map(u.changes)),u.scrollIntoView){let{main:d}=u.state.selection;f=new or(d.empty?d:F.cursor(d.head,d.head>d.anchor?-1:1))}for(let d of u.effects)d.is(Ua)&&(f=d.value)}this.viewState.update(i,f),this.bidiCache=hr.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),t=this.docView.update(i),this.state.facet(Ki)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(u=>u.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(Bs)!=i.state.facet(Bs)&&(this.viewState.mustMeasureContent=!0),(t||n||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!i.empty)for(let u of this.state.facet(Kl))u(i);(a||c)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!Uu(this,c)&&h.force&&wi(this.contentDOM,h.key,h.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let n of this.plugins)n.destroy(this);this.viewState=new ch(e),this.plugins=e.facet(Ui).map(n=>new hl(n)),this.pluginMap.clear();for(let n of this.plugins)n.update(this);this.docView=new Ka(this),this.inputState.ensureHandlers(this,this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(Ui),n=e.state.facet(Ui);if(t!=n){let i=[];for(let r of n){let l=t.indexOf(r);if(l<0)i.push(new hl(r));else{let o=this.plugins[l];o.mustUpdate=e,i.push(o)}}for(let r of this.plugins)r.mustUpdate!=e&&r.destroy(this);this.plugins=i,this.pluginMap.clear(),this.inputState.ensureHandlers(this,this.plugins)}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.scrollDOM,{scrollTop:i}=n,{scrollAnchorPos:r,scrollAnchorHeight:l}=this.viewState;i!=this.viewState.scrollTop&&(l=-1),this.viewState.scrollAnchorHeight=-1;try{for(let o=0;;o++){if(l<0)if(ru(n))r=-1,l=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(i);r=d.from,l=d.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(o>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let h=[];a&4||([this.measureRequests,h]=[h,this.measureRequests]);let c=h.map(d=>{try{return d.read(this)}catch(p){return xn(this.state,p),dh}}),f=ar.create(this,this.state,[]),u=!1;f.flags|=a,t?t.flags|=a:t=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),u=this.docView.update(f));for(let d=0;d1||p<-1){i=n.scrollTop=i+p,l=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let o of this.state.facet(Kl))o(t)}get themeClasses(){return to+" "+(this.state.facet(eo)?Wu:Fu)+" "+this.state.facet(Bs)}updateAttrs(){let e=ph(this,xu,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(Or)?"true":"false",class:"cm-content",style:`${se.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),ph(this,Eo,t);let n=this.observer.ignore(()=>{let i=ql(this.contentDOM,this.contentAttrs,t),r=ql(this.dom,this.editorAttrs,e);return i||r});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let i of n.effects)if(i.is(ce.announce)){t&&(this.announceDOM.textContent=""),t=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(Ki),jn.mount(this.root,this.styleModules.concat(Pm).reverse())}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;tn.spec==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return fl(this,e,Qa(this,e,t,n))}moveByGroup(e,t){return fl(this,e,Qa(this,e,t,n=>sm(this,e.head,n)))}moveToLineBoundary(e,t,n=!0){return im(this,e,t,n)}moveVertically(e,t,n){return fl(this,e,rm(this,e,t,n))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),Pu(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;let i=this.state.doc.lineAt(e),r=this.bidiSpans(i),l=r[Si.find(r,e-i.from,-1,t)];return Co(n,l.dir==Ue.LTR==t>0)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(wu)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>jm)return Tu(e.length);let t=this.textDirectionAt(e.from);for(let i of this.bidiCache)if(i.from==e.from&&i.dir==t)return i.order;let n=Wg(e.text,t);return this.bidiCache.push(new hr(e.from,e.to,t,n)),n}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||se.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{iu(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return Ua.of(new or(typeof e=="number"?F.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}static domEventHandlers(e){return ht.define(()=>({}),{eventHandlers:e})}static theme(e,t){let n=jn.newName(),i=[Bs.of(n),Ki.of(no(`.${n}`,e))];return t&&t.dark&&i.push(eo.of(!0)),i}static baseTheme(e){return Er.lowest(Ki.of(no("."+to,e,qu)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),i=n&&Le.get(n)||Le.get(e);return((t=i==null?void 0:i.rootView)===null||t===void 0?void 0:t.view)||null}}ce.styleModule=Ki;ce.inputHandler=vu;ce.focusChangeEffect=yu;ce.perLineTextDirection=wu;ce.exceptionSink=ku;ce.updateListener=Kl;ce.editable=Or;ce.mouseSelectionStyle=_u;ce.dragMovesSelection=bu;ce.clickAddsSelectionRange=mu;ce.decorations=os;ce.atomicRanges=Do;ce.scrollMargins=Au;ce.darkTheme=eo;ce.contentAttributes=Eo;ce.editorAttributes=xu;ce.lineWrapping=ce.contentAttributes.of({class:"cm-lineWrapping"});ce.announce=Pe.define();const jm=4096,dh={};class hr{constructor(e,t,n,i){this.from=e,this.to=t,this.dir=n,this.order=i}static update(e,t){if(t.empty)return e;let n=[],i=e.length?e[e.length-1].dir:Ue.LTR;for(let r=Math.max(0,e.length-10);r=0;i--){let r=n[i],l=typeof r=="function"?r(s):r;l&&Wl(l,t)}return t}const Vm=se.mac?"mac":se.windows?"win":se.linux?"linux":"key";function Hm(s,e){const t=s.split(/-(?!$)/);let n=t[t.length-1];n=="Space"&&(n=" ");let i,r,l,o;for(let a=0;an.concat(i),[]))),t}function Nw(s,e,t){return Gu(Ju(s.state),e,s,t)}let Rn=null;const Wm=4e3;function qm(s,e=Vm){let t=Object.create(null),n=Object.create(null),i=(l,o)=>{let a=n[l];if(a==null)n[l]=o;else if(a!=o)throw new Error("Key binding "+l+" is used both as a regular binding and as a multi-stroke prefix")},r=(l,o,a,h,c)=>{var f,u;let d=t[l]||(t[l]=Object.create(null)),p=o.split(/ (?!$)/).map(_=>Hm(_,e));for(let _=1;_{let w=Rn={view:E,prefix:v,scope:l};return setTimeout(()=>{Rn==w&&(Rn=null)},Wm),!0}]})}let g=p.join(" ");i(g,!1);let m=d[g]||(d[g]={preventDefault:!1,stopPropagation:!1,run:((u=(f=d._any)===null||f===void 0?void 0:f.run)===null||u===void 0?void 0:u.slice())||[]});a&&m.run.push(a),h&&(m.preventDefault=!0),c&&(m.stopPropagation=!0)};for(let l of s){let o=l.scope?l.scope.split(" "):["editor"];if(l.any)for(let h of o){let c=t[h]||(t[h]=Object.create(null));c._any||(c._any={preventDefault:!1,stopPropagation:!1,run:[]});for(let f in c)c[f].run.push(l.any)}let a=l[e]||l.key;if(a)for(let h of o)r(h,a,l.run,l.preventDefault,l.stopPropagation),l.shift&&r(h,"Shift-"+a,l.shift,l.preventDefault,l.stopPropagation)}return t}function Gu(s,e,t,n){let i=Ag(e),r=Xi(i,0),l=Cl(r)==i.length&&i!=" ",o="",a=!1,h=!1,c=!1;Rn&&Rn.view==t&&Rn.scope==n&&(o=Rn.prefix+" ",Bu.indexOf(e.keyCode)<0&&(h=!0,Rn=null));let f=new Set,u=m=>{if(m){for(let _ of m.run)if(!f.has(_)&&(f.add(_),_(t,e)))return m.stopPropagation&&(c=!0),!0;m.preventDefault&&(m.stopPropagation&&(c=!0),h=!0)}return!1},d=s[n],p,g;return d&&(u(d[o+Ns(i,e,!l)])?a=!0:l&&(e.altKey||e.metaKey||e.ctrlKey)&&!(se.windows&&e.ctrlKey&&e.altKey)&&(p=Vn[e.keyCode])&&p!=i?(u(d[o+Ns(p,e,!0)])||e.shiftKey&&(g=rs[e.keyCode])!=i&&g!=p&&u(d[o+Ns(g,e,!1)]))&&(a=!0):l&&e.shiftKey&&u(d[o+Ns(i,e,!0)])&&(a=!0),!a&&u(d._any)&&(a=!0)),h&&(a=!0),a&&c&&e.stopPropagation(),a}class _s{constructor(e,t,n,i,r){this.className=e,this.left=t,this.top=n,this.width=i,this.height=r}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,n){if(n.empty){let i=e.coordsAtPos(n.head,n.assoc||1);if(!i)return[];let r=Yu(e);return[new _s(t,i.left-r.left,i.top-r.top,null,i.bottom-i.top)]}else return Um(e,t,n)}}function Yu(s){let e=s.scrollDOM.getBoundingClientRect();return{left:(s.textDirection==Ue.LTR?e.left:e.right-s.scrollDOM.clientWidth)-s.scrollDOM.scrollLeft,top:e.top-s.scrollDOM.scrollTop}}function mh(s,e,t){let n=F.cursor(e);return{from:Math.max(t.from,s.moveToLineBoundary(n,!1,!0).from),to:Math.min(t.to,s.moveToLineBoundary(n,!0,!0).from),type:Fe.Text}}function Um(s,e,t){if(t.to<=s.viewport.from||t.from>=s.viewport.to)return[];let n=Math.max(t.from,s.viewport.from),i=Math.min(t.to,s.viewport.to),r=s.textDirection==Ue.LTR,l=s.contentDOM,o=l.getBoundingClientRect(),a=Yu(s),h=l.querySelector(".cm-line"),c=h&&window.getComputedStyle(h),f=o.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),u=o.right-(c?parseInt(c.paddingRight):0),d=Xl(s,n),p=Xl(s,i),g=d.type==Fe.Text?d:null,m=p.type==Fe.Text?p:null;if(g&&(s.lineWrapping||d.widgetLineBreaks)&&(g=mh(s,n,g)),m&&(s.lineWrapping||p.widgetLineBreaks)&&(m=mh(s,i,m)),g&&m&&g.from==m.from)return v(E(t.from,t.to,g));{let B=g?E(t.from,null,g):w(d,!1),D=m?E(null,t.to,m):w(p,!0),$=[];return(g||d).to<(m||p).from-(g&&m?1:0)||d.widgetLineBreaks>1&&B.bottom+s.defaultLineHeight/2O&&Q.from=J)break;ge>ie&&H(Math.max(oe,ie),B==null&&oe<=O,Math.min(ge,J),D==null&&ge>=T,z.dir)}if(ie=fe.to+1,ie>=J)break}return V.length==0&&H(O,B==null,T,D==null,s.textDirection),{top:G,bottom:L,horizontal:V}}function w(B,D){let $=o.top+(D?B.top:B.bottom);return{top:$,bottom:$,horizontal:[]}}}function Km(s,e){return s.constructor==e.constructor&&s.eq(e)}class Jm{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(Ys)!=e.state.facet(Ys)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&e.view.requestMeasure(this.measureReq)}setOrder(e){let t=0,n=e.facet(Ys);for(;t!Km(t,this.drawn[n]))){let t=this.dom.firstChild,n=0;for(let i of e)i.update&&t&&i.constructor&&this.drawn[n].constructor&&i.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(i.draw(),t);for(;t;){let i=t.nextSibling;t.remove(),t=i}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Ys=le.define();function Xu(s){return[ht.define(e=>new Jm(e,s)),Ys.of(s)]}const Zu=!se.ios,as=le.define({combine(s){return Ei(s,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function Lw(s={}){return[as.of(s),Gm,Ym,Xm,Su.of(!0)]}function Qu(s){return s.startState.facet(as)!=s.state.facet(as)}const Gm=Xu({above:!0,markers(s){let{state:e}=s,t=e.facet(as),n=[];for(let i of e.selection.ranges){let r=i==e.selection.main;if(i.empty?!r||Zu:t.drawRangeCursor){let l=r?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",o=i.empty?i:F.cursor(i.head,i.head>i.anchor?-1:1);for(let a of _s.forRange(s,l,o))n.push(a)}}return n},update(s,e){s.transactions.some(n=>n.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=Qu(s);return t&&bh(s.state,e),s.docChanged||s.selectionSet||t},mount(s,e){bh(e.state,s)},class:"cm-cursorLayer"});function bh(s,e){e.style.animationDuration=s.facet(as).cursorBlinkRate+"ms"}const Ym=Xu({above:!1,markers(s){return s.state.selection.ranges.map(e=>e.empty?[]:_s.forRange(s,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(s,e){return s.docChanged||s.selectionSet||s.viewportChanged||Qu(s)},class:"cm-selectionLayer"}),ed={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};Zu&&(ed[".cm-line"].caretColor="transparent !important");const Xm=Er.highest(ce.theme(ed)),td=Pe.define({map(s,e){return s==null?null:e.mapPos(s)}}),Gi=Pt.define({create(){return null},update(s,e){return s!=null&&(s=e.changes.mapPos(s)),e.effects.reduce((t,n)=>n.is(td)?n.value:t,s)}}),Zm=ht.fromClass(class{constructor(s){this.view=s,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(s){var e;let t=s.state.field(Gi);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(s.startState.field(Gi)!=t||s.docChanged||s.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let s=this.view.state.field(Gi),e=s!=null&&this.view.coordsAtPos(s);if(!e)return null;let t=this.view.scrollDOM.getBoundingClientRect();return{left:e.left-t.left+this.view.scrollDOM.scrollLeft,top:e.top-t.top+this.view.scrollDOM.scrollTop,height:e.bottom-e.top}}drawCursor(s){this.cursor&&(s?(this.cursor.style.left=s.left+"px",this.cursor.style.top=s.top+"px",this.cursor.style.height=s.height+"px"):this.cursor.style.left="-100000px")}destroy(){this.cursor&&this.cursor.remove()}setDropPos(s){this.view.state.field(Gi)!=s&&this.view.dispatch({effects:td.of(s)})}},{eventHandlers:{dragover(s){this.setDropPos(this.view.posAtCoords({x:s.clientX,y:s.clientY}))},dragleave(s){(s.target==this.view.contentDOM||!this.view.contentDOM.contains(s.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function Rw(){return[Gi,Zm]}function _h(s,e,t,n,i){e.lastIndex=0;for(let r=s.iterRange(t,n),l=t,o;!r.next().done;l+=r.value.length)if(!r.lineBreak)for(;o=e.exec(r.value);)i(l+o.index,o)}function Qm(s,e){let t=s.visibleRanges;if(t.length==1&&t[0].from==s.viewport.from&&t[0].to==s.viewport.to)return t;let n=[];for(let{from:i,to:r}of t)i=Math.max(s.state.doc.lineAt(i).from,i-e),r=Math.min(s.state.doc.lineAt(r).to,r+e),n.length&&n[n.length-1].to>=i?n[n.length-1].to=r:n.push({from:i,to:r});return n}class e0{constructor(e){const{regexp:t,decoration:n,decorate:i,boundary:r,maxLength:l=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,i)this.addMatch=(o,a,h,c)=>i(c,h,h+o[0].length,o,a);else if(typeof n=="function")this.addMatch=(o,a,h,c)=>{let f=n(o,a,h);f&&c(h,h+o[0].length,f)};else if(n)this.addMatch=(o,a,h,c)=>c(h,h+o[0].length,n);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=r,this.maxLength=l}createDeco(e){let t=new ri,n=t.add.bind(t);for(let{from:i,to:r}of Qm(e,this.maxLength))_h(e.state.doc,this.regexp,i,r,(l,o)=>this.addMatch(o,e,l,n));return t.finish()}updateDeco(e,t){let n=1e9,i=-1;return e.docChanged&&e.changes.iterChanges((r,l,o,a)=>{a>e.view.viewport.from&&o1e3?this.createDeco(e.view):i>-1?this.updateRange(e.view,t.map(e.changes),n,i):t}updateRange(e,t,n,i){for(let r of e.visibleRanges){let l=Math.max(r.from,n),o=Math.min(r.to,i);if(o>l){let a=e.state.doc.lineAt(l),h=a.toa.from;l--)if(this.boundary.test(a.text[l-1-a.from])){c=l;break}for(;ou.push(_.range(g,m));if(a==h)for(this.regexp.lastIndex=c-a.from;(d=this.regexp.exec(a.text))&&d.indexthis.addMatch(m,e,g,p));t=t.update({filterFrom:c,filterTo:f,filter:(g,m)=>gf,add:u})}}return t}}const io=/x/.unicode!=null?"gu":"g",t0=new RegExp(`[\0-\b ---Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,io),n0={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let pl=null;function i0(){var s;if(pl==null&&typeof document<"u"&&document.body){let e=document.body.style;pl=((s=e.tabSize)!==null&&s!==void 0?s:e.MozTabSize)!=null}return pl||!1}const Xs=le.define({combine(s){let e=Ei(s,{render:null,specialChars:t0,addSpecialChars:null});return(e.replaceTabs=!i0())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,io)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,io)),e}});function Iw(s={}){return[Xs.of(s),s0()]}let kh=null;function s0(){return kh||(kh=ht.fromClass(class{constructor(s){this.view=s,this.decorations=Re.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(s.state.facet(Xs)),this.decorations=this.decorator.createDeco(s)}makeDecorator(s){return new e0({regexp:s.specialChars,decoration:(e,t,n)=>{let{doc:i}=t.state,r=Xi(e[0],0);if(r==9){let l=i.lineAt(n),o=t.state.tabSize,a=gs(l.text,o,n-l.from);return Re.replace({widget:new a0((o-a%o)*this.view.defaultCharacterWidth)})}return this.decorationCache[r]||(this.decorationCache[r]=Re.replace({widget:new o0(s,r)}))},boundary:s.replaceTabs?void 0:/[^]/})}update(s){let e=s.state.facet(Xs);s.startState.facet(Xs)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(s.view)):this.decorations=this.decorator.updateDeco(s,this.decorations)}},{decorations:s=>s.decorations}))}const r0="•";function l0(s){return s>=32?r0:s==10?"␤":String.fromCharCode(9216+s)}class o0 extends Di{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=l0(this.code),n=e.state.phrase("Control character")+" "+(n0[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,n,t);if(i)return i;let r=document.createElement("span");return r.textContent=t,r.title=n,r.setAttribute("aria-label",n),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class a0 extends Di{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function zw(){return c0}const h0=Re.line({class:"cm-activeLine"}),c0=ht.fromClass(class{constructor(s){this.decorations=this.getDeco(s)}update(s){(s.docChanged||s.selectionSet)&&(this.decorations=this.getDeco(s.view))}getDeco(s){let e=-1,t=[];for(let n of s.state.selection.ranges){let i=s.lineBlockAt(n.head);i.from>e&&(t.push(h0.range(i.from)),e=i.from)}return Re.set(t)}},{decorations:s=>s.decorations}),so=2e3;function f0(s,e,t){let n=Math.min(e.line,t.line),i=Math.max(e.line,t.line),r=[];if(e.off>so||t.off>so||e.col<0||t.col<0){let l=Math.min(e.off,t.off),o=Math.max(e.off,t.off);for(let a=n;a<=i;a++){let h=s.doc.line(a);h.length<=o&&r.push(F.range(h.from+l,h.to+o))}}else{let l=Math.min(e.col,t.col),o=Math.max(e.col,t.col);for(let a=n;a<=i;a++){let h=s.doc.line(a),c=Rl(h.text,l,s.tabSize,!0);if(c<0)r.push(F.cursor(h.to));else{let f=Rl(h.text,o,s.tabSize);r.push(F.range(h.from+c,h.from+f))}}}return r}function u0(s,e){let t=s.coordsAtPos(s.viewport.from);return t?Math.round(Math.abs((t.left-e)/s.defaultCharacterWidth)):-1}function vh(s,e){let t=s.posAtCoords({x:e.clientX,y:e.clientY},!1),n=s.state.doc.lineAt(t),i=t-n.from,r=i>so?-1:i==n.length?u0(s,e.clientX):gs(n.text,s.state.tabSize,t-n.from);return{line:n.number,col:r,off:i}}function d0(s,e){let t=vh(s,e),n=s.state.selection;return t?{update(i){if(i.docChanged){let r=i.changes.mapPos(i.startState.doc.line(t.line).from),l=i.state.doc.lineAt(r);t={line:l.number,col:t.col,off:Math.min(t.off,l.length)},n=n.map(i.changes)}},get(i,r,l){let o=vh(s,i);if(!o)return n;let a=f0(s.state,t,o);return a.length?l?F.create(a.concat(n.ranges)):F.create(a):n}}:null}function jw(s){let e=(s==null?void 0:s.eventFilter)||(t=>t.altKey&&t.button==0);return ce.mouseSelectionStyle.of((t,n)=>e(n)?d0(t,n):null)}const p0={Alt:[18,s=>!!s.altKey],Control:[17,s=>!!s.ctrlKey],Shift:[16,s=>!!s.shiftKey],Meta:[91,s=>!!s.metaKey]},g0={style:"cursor: crosshair"};function Vw(s={}){let[e,t]=p0[s.key||"Alt"],n=ht.fromClass(class{constructor(i){this.view=i,this.isDown=!1}set(i){this.isDown!=i&&(this.isDown=i,this.view.update([]))}},{eventHandlers:{keydown(i){this.set(i.keyCode==e||t(i))},keyup(i){(i.keyCode==e||!t(i))&&this.set(!1)},mousemove(i){this.set(t(i))}}});return[n,ce.contentAttributes.of(i=>{var r;return!((r=i.plugin(n))===null||r===void 0)&&r.isDown?g0:null})]}const Ls="-10000px";class nd{constructor(e,t,n){this.facet=t,this.createTooltipView=n,this.input=e.state.facet(t),this.tooltips=this.input.filter(i=>i),this.tooltipViews=this.tooltips.map(n)}update(e){var t;let n=e.state.facet(this.facet),i=n.filter(l=>l);if(n===this.input){for(let l of this.tooltipViews)l.update&&l.update(e);return!1}let r=[];for(let l=0;l{var e,t,n;return{position:se.ios?"absolute":((e=s.find(i=>i.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=s.find(i=>i.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((n=s.find(i=>i.tooltipSpace))===null||n===void 0?void 0:n.tooltipSpace)||m0}}}),yh=new WeakMap,id=ht.fromClass(class{constructor(s){this.view=s,this.inView=!0,this.lastTransaction=0,this.measureTimeout=-1;let e=s.state.facet(gl);this.position=e.position,this.parent=e.parent,this.classes=s.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.manager=new nd(s,sd,t=>this.createTooltip(t)),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),s.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let s of this.manager.tooltipViews)this.intersectionObserver.observe(s.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(s){s.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(s);e&&this.observeIntersection();let t=e||s.geometryChanged,n=s.state.facet(gl);if(n.position!=this.position){this.position=n.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;t=!0}if(n.parent!=this.parent){this.parent&&this.container.remove(),this.parent=n.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(s){let e=s.create(this.view);if(e.dom.classList.add("cm-tooltip"),s.arrow&&!e.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let t=document.createElement("div");t.className="cm-tooltip-arrow",e.dom.appendChild(t)}return e.dom.style.position=this.position,e.dom.style.top=Ls,this.container.appendChild(e.dom),e.mount&&e.mount(this.view),e}destroy(){var s,e;this.view.win.removeEventListener("resize",this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),(s=t.destroy)===null||s===void 0||s.call(t);(e=this.intersectionObserver)===null||e===void 0||e.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let s=this.view.dom.getBoundingClientRect();return{editor:s,parent:this.parent?this.container.getBoundingClientRect():s,pos:this.manager.tooltips.map((e,t)=>{let n=this.manager.tooltipViews[t];return n.getCoords?n.getCoords(e.pos):this.view.coordsAtPos(e.pos)}),size:this.manager.tooltipViews.map(({dom:e})=>e.getBoundingClientRect()),space:this.view.state.facet(gl).tooltipSpace(this.view)}}writeMeasure(s){var e;let{editor:t,space:n}=s,i=[];for(let r=0;r=Math.min(t.bottom,n.bottom)||h.rightMath.min(t.right,n.right)+.1){a.style.top=Ls;continue}let f=l.arrow?o.dom.querySelector(".cm-tooltip-arrow"):null,u=f?7:0,d=c.right-c.left,p=(e=yh.get(o))!==null&&e!==void 0?e:c.bottom-c.top,g=o.offset||_0,m=this.view.textDirection==Ue.LTR,_=c.width>n.right-n.left?m?n.left:n.right-c.width:m?Math.min(h.left-(f?14:0)+g.x,n.right-d):Math.max(n.left,h.left-d+(f?14:0)-g.x),v=!!l.above;!l.strictSide&&(v?h.top-(c.bottom-c.top)-g.yn.bottom)&&v==n.bottom-h.bottom>h.top-n.top&&(v=!v);let E=(v?h.top-n.top:n.bottom-h.bottom)-u;if(E_&&D.topw&&(w=v?D.top-p-2-u:D.bottom+u+2);this.position=="absolute"?(a.style.top=w-s.parent.top+"px",a.style.left=_-s.parent.left+"px"):(a.style.top=w+"px",a.style.left=_+"px"),f&&(f.style.left=`${h.left+(m?g.x:-g.x)-(_+14-7)}px`),o.overlap!==!0&&i.push({left:_,top:w,right:B,bottom:w+p}),a.classList.toggle("cm-tooltip-above",v),a.classList.toggle("cm-tooltip-below",!v),o.positioned&&o.positioned(s.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let s of this.manager.tooltipViews)s.dom.style.top=Ls}},{eventHandlers:{scroll(){this.maybeMeasure()}}}),b0=ce.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),_0={x:0,y:0},sd=le.define({enables:[id,b0]}),cr=le.define();class Po{constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new nd(e,cr,t=>this.createHostedView(t))}static create(e){return new Po(e)}createHostedView(e){let t=e.create(this.view);return t.dom.classList.add("cm-tooltip-section"),this.dom.appendChild(t.dom),this.mounted&&t.mount&&t.mount(this.view),t}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}}const k0=sd.compute([cr],s=>{let e=s.facet(cr).filter(t=>t);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.filter(t=>t.end!=null).map(t=>t.end)),create:Po.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class v0{constructor(e,t,n,i,r){this.view=e,this.source=t,this.field=n,this.setHover=i,this.hoverTime=r,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active)return;let e=Date.now()-this.lastMove.time;en.bottom||e.xn.right+this.view.defaultCharacterWidth)return;let i=this.view.bidiSpans(this.view.state.doc.lineAt(t)).find(o=>o.from<=t&&o.to>=t),r=i&&i.dir==Ue.RTL?-1:1,l=this.source(this.view,t,e.x{this.pending==o&&(this.pending=null,a&&this.view.dispatch({effects:this.setHover.of(a)}))},a=>xn(this.view.state,a,"hover tooltip"))}else l&&this.view.dispatch({effects:this.setHover.of(l)})}mousemove(e){var t;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let n=this.active;if(n&&!wh(this.lastMove.target)||this.pending){let{pos:i}=n||this.pending,r=(t=n==null?void 0:n.end)!==null&&t!==void 0?t:i;(i==r?this.view.posAtCoords(this.lastMove)!=i:!y0(this.view,i,r,e.clientX,e.clientY,6))&&(this.view.dispatch({effects:this.setHover.of(null)}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1,this.active&&!wh(e.relatedTarget)&&this.view.dispatch({effects:this.setHover.of(null)})}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}function wh(s){for(let e=s;e;e=e.parentNode)if(e.nodeType==1&&e.classList.contains("cm-tooltip"))return!0;return!1}function y0(s,e,t,n,i,r){let l=document.createRange(),o=s.domAtPos(e),a=s.domAtPos(t);l.setEnd(a.node,a.offset),l.setStart(o.node,o.offset);let h=l.getClientRects();l.detach();for(let c=0;ccr.from(i)});return[n,ht.define(i=>new v0(i,s,n,t,e.hoverTime||300)),k0]}function Fw(s,e){let t=s.plugin(id);if(!t)return null;let n=t.manager.tooltips.indexOf(e);return n<0?null:t.manager.tooltipViews[n]}const w0=Pe.define(),Sh=le.define({combine(s){let e,t;for(let n of s)e=e||n.topContainer,t=t||n.bottomContainer;return{topContainer:e,bottomContainer:t}}});function Ww(s,e){let t=s.plugin(rd),n=t?t.specs.indexOf(e):-1;return n>-1?t.panels[n]:null}const rd=ht.fromClass(class{constructor(s){this.input=s.state.facet(Ah),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(s));let e=s.state.facet(Sh);this.top=new Rs(s,!0,e.topContainer),this.bottom=new Rs(s,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(s){let e=s.state.facet(Sh);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Rs(s.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Rs(s.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=s.state.facet(Ah);if(t!=this.input){let n=t.filter(a=>a),i=[],r=[],l=[],o=[];for(let a of n){let h=this.specs.indexOf(a),c;h<0?(c=a(s.view),o.push(c)):(c=this.panels[h],c.update&&c.update(s)),i.push(c),(c.top?r:l).push(c)}this.specs=n,this.panels=i,this.top.sync(r),this.bottom.sync(l);for(let a of o)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let n of this.panels)n.update&&n.update(s)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:s=>ce.scrollMargins.of(e=>{let t=e.plugin(s);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class Rs{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=xh(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=xh(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function xh(s){let e=s.nextSibling;return s.remove(),e}const Ah=le.define({enables:rd});class En extends xi{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}En.prototype.elementClass="";En.prototype.toDOM=void 0;En.prototype.mapMode=bt.TrackBefore;En.prototype.startSide=En.prototype.endSide=-1;En.prototype.point=!0;const Zs=le.define(),S0={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Ne.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},es=le.define();function x0(s){return[ld(),es.of(Object.assign(Object.assign({},S0),s))]}const ro=le.define({combine:s=>s.some(e=>e)});function ld(s){let e=[A0];return s&&s.fixed===!1&&e.push(ro.of(!0)),e}const A0=ht.fromClass(class{constructor(s){this.view=s,this.prevViewport=s.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight+"px",this.gutters=s.state.facet(es).map(e=>new Mh(s,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!s.state.facet(ro),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),s.scrollDOM.insertBefore(this.dom,s.contentDOM)}update(s){if(this.updateGutters(s)){let e=this.prevViewport,t=s.view.viewport,n=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(n<(t.to-t.from)*.8)}s.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight+"px"),this.view.state.facet(ro)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=s.view.viewport}syncGutters(s){let e=this.dom.nextSibling;s&&this.dom.remove();let t=Ne.iter(this.view.state.facet(Zs),this.view.viewport.from),n=[],i=this.gutters.map(r=>new C0(r,this.view.viewport,-this.view.documentPadding.top));for(let r of this.view.viewportLineBlocks)if(n.length&&(n=[]),Array.isArray(r.type)){let l=!0;for(let o of r.type)if(o.type==Fe.Text&&l){lo(t,n,o.from);for(let a of i)a.line(this.view,o,n);l=!1}else if(o.widget)for(let a of i)a.widget(this.view,o)}else if(r.type==Fe.Text){lo(t,n,r.from);for(let l of i)l.line(this.view,r,n)}for(let r of i)r.finish();s&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(s){let e=s.startState.facet(es),t=s.state.facet(es),n=s.docChanged||s.heightChanged||s.viewportChanged||!Ne.eq(s.startState.facet(Zs),s.state.facet(Zs),s.view.viewport.from,s.view.viewport.to);if(e==t)for(let i of this.gutters)i.update(s)&&(n=!0);else{n=!0;let i=[];for(let r of t){let l=e.indexOf(r);l<0?i.push(new Mh(this.view,r)):(this.gutters[l].update(s),i.push(this.gutters[l]))}for(let r of this.gutters)r.dom.remove(),i.indexOf(r)<0&&r.destroy();for(let r of i)this.dom.appendChild(r.dom);this.gutters=i}return n}destroy(){for(let s of this.gutters)s.destroy();this.dom.remove()}},{provide:s=>ce.scrollMargins.of(e=>{let t=e.plugin(s);return!t||t.gutters.length==0||!t.fixed?null:e.textDirection==Ue.LTR?{left:t.dom.offsetWidth}:{right:t.dom.offsetWidth}})});function Ch(s){return Array.isArray(s)?s:[s]}function lo(s,e,t){for(;s.value&&s.from<=t;)s.from==t&&e.push(s.value),s.next()}class C0{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=Ne.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:i}=this,r=t.top-this.height;if(this.i==i.elements.length){let l=new od(e,t.height,r,n);i.elements.push(l),i.dom.appendChild(l.dom)}else i.elements[this.i].update(e,t.height,r,n);this.height=t.bottom,this.i++}line(e,t,n){let i=[];lo(this.cursor,i,t.from),n.length&&(i=i.concat(n));let r=this.gutter.config.lineMarker(e,t,i);r&&i.unshift(r);let l=this.gutter;i.length==0&&!l.config.renderEmptyElements||this.addElement(e,t,i)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t);n&&this.addElement(e,t,[n])}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class Mh{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let n in t.domEventHandlers)this.dom.addEventListener(n,i=>{let r=i.target,l;if(r!=this.dom&&this.dom.contains(r)){for(;r.parentNode!=this.dom;)r=r.parentNode;let a=r.getBoundingClientRect();l=(a.top+a.bottom)/2}else l=i.clientY;let o=e.lineBlockAtHeight(l-e.documentTop);t.domEventHandlers[n](e,o,i)&&i.preventDefault()});this.markers=Ch(t.markers(e)),t.initialSpacer&&(this.spacer=new od(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=Ch(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let n=e.view.viewport;return!Ne.eq(this.markers,t,n.from,n.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class od{constructor(e,t,n,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,n,i)}update(e,t,n,i){this.height!=t&&(this.dom.style.height=(this.height=t)+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),M0(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,t){let n="cm-gutterElement",i=this.dom.firstChild;for(let r=0,l=0;;){let o=l,a=rr(o,a,h)||l(o,a,h):l}return n}})}});class ml extends En{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function bl(s,e){return s.state.facet(_i).formatNumber(e,s.state)}const E0=es.compute([_i],s=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(T0)},lineMarker(e,t,n){return n.some(i=>i.toDOM)?null:new ml(bl(e,e.state.doc.lineAt(t.from).number))},widgetMarker:()=>null,lineMarkerChange:e=>e.startState.facet(_i)!=e.state.facet(_i),initialSpacer(e){return new ml(bl(e,Th(e.state.doc.lines)))},updateSpacer(e,t){let n=bl(t.view,Th(t.view.state.doc.lines));return n==e.number?e:new ml(n)},domEventHandlers:s.facet(_i).domEventHandlers}));function qw(s={}){return[_i.of(s),ld(),E0]}function Th(s){let e=9;for(;e{let e=[],t=-1;for(let n of s.selection.ranges){let i=s.doc.lineAt(n.head).from;i>t&&(t=i,e.push(D0.range(i)))}return Ne.of(e)});function Uw(){return O0}const P0=1024;let $0=0;class Lt{constructor(e,t){this.from=e,this.to=t}}class ve{constructor(e={}){this.id=$0++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=vt.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}}ve.closedBy=new ve({deserialize:s=>s.split(" ")});ve.openedBy=new ve({deserialize:s=>s.split(" ")});ve.group=new ve({deserialize:s=>s.split(" ")});ve.contextHash=new ve({perNode:!0});ve.lookAhead=new ve({perNode:!0});ve.mounted=new ve({perNode:!0});class B0{constructor(e,t,n){this.tree=e,this.overlay=t,this.parser=n}}const N0=Object.create(null);class vt{constructor(e,t,n,i=0){this.name=e,this.props=t,this.id=n,this.flags=i}static define(e){let t=e.props&&e.props.length?Object.create(null):N0,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new vt(e.name||"",t,e.id,n);if(e.props){for(let r of e.props)if(Array.isArray(r)||(r=r(i)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[r[0].id]=r[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(ve.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let i of n.split(" "))t[i]=e[n];return n=>{for(let i=n.prop(ve.group),r=-1;r<(i?i.length:0);r++){let l=t[r<0?n.name:i[r]];if(l)return l}}}}vt.none=new vt("",Object.create(null),0,8);class ad{constructor(e){this.types=e;for(let t=0;t0;for(let a=this.cursor(l|He.IncludeAnonymous);;){let h=!1;if(a.from<=r&&a.to>=i&&(!o&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;h=!0}for(;h&&n&&(o||!a.type.isAnonymous)&&n(a),!a.nextSibling();){if(!a.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:No(vt.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,i)=>new Qe(this.type,t,n,i,this.propValues),e.makeTree||((t,n,i)=>new Qe(vt.none,t,n,i)))}static build(e){return R0(e)}}Qe.empty=new Qe(vt.none,[],[],0);class $o{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new $o(this.buffer,this.index)}}class hi{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return vt.none}toString(){let e=[];for(let t=0;t0));a=l[a+3]);return o}slice(e,t,n){let i=this.buffer,r=new Uint16Array(t-e),l=0;for(let o=e,a=0;o=e&&te;case 1:return t<=e&&n>e;case 2:return n>e;case 4:return!0}}function cd(s,e){let t=s.childBefore(e);for(;t;){let n=t.lastChild;if(!n||n.to!=t.to)break;n.type.isError&&n.from==n.to?(s=t,t=n.prevSibling):t=n}return s}function Mi(s,e,t,n){for(var i;s.from==s.to||(t<1?s.from>=e:s.from>e)||(t>-1?s.to<=e:s.to0?o.length:-1;e!=h;e+=t){let c=o[e],f=a[e]+l.from;if(hd(i,n,f,f+c.length)){if(c instanceof hi){if(r&He.ExcludeBuffers)continue;let u=c.findChild(0,c.buffer.length,t,n-f,i);if(u>-1)return new hn(new L0(l,c,e,f),null,u)}else if(r&He.IncludeAnonymous||!c.type.isAnonymous||Bo(c)){let u;if(!(r&He.IgnoreMounts)&&c.props&&(u=c.prop(ve.mounted))&&!u.overlay)return new zt(u.tree,f,e,l);let d=new zt(c,f,e,l);return r&He.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(t<0?c.children.length-1:0,t,n,i)}}}if(r&He.IncludeAnonymous||!l.type.isAnonymous||(l.index>=0?e=l.index+t:e=t<0?-1:l._parent._tree.children.length,l=l._parent,!l))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,n=0){let i;if(!(n&He.IgnoreOverlays)&&(i=this._tree.prop(ve.mounted))&&i.overlay){let r=e-this.from;for(let{from:l,to:o}of i.overlay)if((t>0?l<=r:l=r:o>r))return new zt(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}cursor(e=0){return new hs(this,e)}get tree(){return this._tree}toTree(){return this._tree}resolve(e,t=0){return Mi(this,e,t,!1)}resolveInner(e,t=0){return Mi(this,e,t,!0)}enterUnfinishedNodesBefore(e){return cd(this,e)}getChild(e,t=null,n=null){let i=fr(this,e,t,n);return i.length?i[0]:null}getChildren(e,t=null,n=null){return fr(this,e,t,n)}toString(){return this._tree.toString()}get node(){return this}matchContext(e){return ur(this,e)}}function fr(s,e,t,n){let i=s.cursor(),r=[];if(!i.firstChild())return r;if(t!=null){for(;!i.type.is(t);)if(!i.nextSibling())return r}for(;;){if(n!=null&&i.type.is(n))return r;if(i.type.is(e)&&r.push(i.node),!i.nextSibling())return n==null?r:[]}}function ur(s,e,t=e.length-1){for(let n=s.parent;t>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[t]&&e[t]!=n.name)return!1;t--}}return!0}class L0{constructor(e,t,n,i){this.parent=e,this.buffer=t,this.index=n,this.start=i}}class hn{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:i}=this.context,r=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.context.start,n);return r<0?null:new hn(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,n=0){if(n&He.ExcludeBuffers)return null;let{buffer:i}=this.context,r=i.findChild(this.index+4,i.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new hn(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new hn(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new hn(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}cursor(e=0){return new hs(this,e)}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,i=this.index+4,r=n.buffer[this.index+3];if(r>i){let l=n.buffer[this.index+1];e.push(n.slice(i,r,l)),t.push(0)}return new Qe(this.type,e,t,this.to-this.from)}resolve(e,t=0){return Mi(this,e,t,!1)}resolveInner(e,t=0){return Mi(this,e,t,!0)}enterUnfinishedNodesBefore(e){return cd(this,e)}toString(){return this.context.buffer.childString(this.index)}getChild(e,t=null,n=null){let i=fr(this,e,t,n);return i.length?i[0]:null}getChildren(e,t=null,n=null){return fr(this,e,t,n)}get node(){return this}matchContext(e){return ur(this,e)}}class hs{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof zt)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let n=e._parent;n;n=n._parent)this.stack.unshift(n.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:i}=this.buffer;return this.type=t||i.set.types[i.buffer[e]],this.from=n+i.buffer[e+1],this.to=n+i.buffer[e+2],!0}yield(e){return e?e instanceof zt?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:i}=this.buffer,r=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.buffer.start,n);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&He.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&He.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&He.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let i=n<0?0:this.stack[n]+4;if(this.index!=i)return this.yieldBuf(t.findChild(i,this.index,-1,0,4))}else{let i=t.buffer[this.index+3];if(i<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(i)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:i}=this;if(i){if(e>0){if(this.index-1)for(let r=t+e,l=e<0?-1:n._tree.children.length;r!=l;r+=e){let o=n._tree.children[r];if(this.mode&He.IncludeAnonymous||o instanceof hi||!o.type.isAnonymous||Bo(o))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let l=e;l;l=l._parent)if(l.index==i){if(i==this.index)return l;t=l,n=r+1;break e}i=this.stack[--r]}for(let i=n;i=0;r--){if(r<0)return ur(this.node,e,i);let l=n[t.buffer[this.stack[r]]];if(!l.isAnonymous){if(e[i]&&e[i]!=l.name)return!1;i--}}return!0}}function Bo(s){return s.children.some(e=>e instanceof hi||!e.type.isAnonymous||Bo(e))}function R0(s){var e;let{buffer:t,nodeSet:n,maxBufferLength:i=P0,reused:r=[],minRepeatType:l=n.types.length}=s,o=Array.isArray(t)?new $o(t,t.length):t,a=n.types,h=0,c=0;function f(w,B,D,$,G){let{id:L,start:V,end:H,size:O}=o,T=c;for(;O<0;)if(o.next(),O==-1){let z=r[L];D.push(z),$.push(V-w);return}else if(O==-3){h=L;return}else if(O==-4){c=L;return}else throw new RangeError(`Unrecognized record size: ${O}`);let Q=a[L],ie,J,fe=V-w;if(H-V<=i&&(J=g(o.pos-B,G))){let z=new Uint16Array(J.size-J.skip),oe=o.pos-J.size,ge=z.length;for(;o.pos>oe;)ge=m(J.start,z,ge);ie=new hi(z,H-J.start,n),fe=J.start-w}else{let z=o.pos-O;o.next();let oe=[],ge=[],We=L>=l?L:-1,Ee=0,$t=H;for(;o.pos>z;)We>=0&&o.id==We&&o.size>=0?(o.end<=$t-i&&(d(oe,ge,V,Ee,o.end,$t,We,T),Ee=oe.length,$t=o.end),o.next()):f(V,z,oe,ge,We);if(We>=0&&Ee>0&&Ee-1&&Ee>0){let ee=u(Q);ie=No(Q,oe,ge,0,oe.length,0,H-V,ee,ee)}else ie=p(Q,oe,ge,H-V,T-H)}D.push(ie),$.push(fe)}function u(w){return(B,D,$)=>{let G=0,L=B.length-1,V,H;if(L>=0&&(V=B[L])instanceof Qe){if(!L&&V.type==w&&V.length==$)return V;(H=V.prop(ve.lookAhead))&&(G=D[L]+V.length+H)}return p(w,B,D,$,G)}}function d(w,B,D,$,G,L,V,H){let O=[],T=[];for(;w.length>$;)O.push(w.pop()),T.push(B.pop()+D-G);w.push(p(n.types[V],O,T,L-G,H-L)),B.push(G-D)}function p(w,B,D,$,G=0,L){if(h){let V=[ve.contextHash,h];L=L?[V].concat(L):[V]}if(G>25){let V=[ve.lookAhead,G];L=L?[V].concat(L):[V]}return new Qe(w,B,D,$,L)}function g(w,B){let D=o.fork(),$=0,G=0,L=0,V=D.end-i,H={size:0,start:0,skip:0};e:for(let O=D.pos-w;D.pos>O;){let T=D.size;if(D.id==B&&T>=0){H.size=$,H.start=G,H.skip=L,L+=4,$+=4,D.next();continue}let Q=D.pos-T;if(T<0||Q=l?4:0,J=D.start;for(D.next();D.pos>Q;){if(D.size<0)if(D.size==-3)ie+=4;else break e;else D.id>=l&&(ie+=4);D.next()}G=J,$+=T,L+=ie}return(B<0||$==w)&&(H.size=$,H.start=G,H.skip=L),H.size>4?H:void 0}function m(w,B,D){let{id:$,start:G,end:L,size:V}=o;if(o.next(),V>=0&&$4){let O=o.pos-(V-4);for(;o.pos>O;)D=m(w,B,D)}B[--D]=H,B[--D]=L-w,B[--D]=G-w,B[--D]=$}else V==-3?h=$:V==-4&&(c=$);return D}let _=[],v=[];for(;o.pos>0;)f(s.start||0,s.bufferStart||0,_,v,-1);let E=(e=s.length)!==null&&e!==void 0?e:_.length?v[0]+_[0].length:0;return new Qe(a[s.topID],_.reverse(),v.reverse(),E)}const Dh=new WeakMap;function Qs(s,e){if(!s.isAnonymous||e instanceof hi||e.type!=s)return 1;let t=Dh.get(e);if(t==null){t=1;for(let n of e.children){if(n.type!=s||!(n instanceof Qe)){t=1;break}t+=Qs(s,n)}Dh.set(e,t)}return t}function No(s,e,t,n,i,r,l,o,a){let h=0;for(let p=n;p=c)break;D+=$}if(E==w+1){if(D>c){let $=p[w];d($.children,$.positions,0,$.children.length,g[w]+v);continue}f.push(p[w])}else{let $=g[E-1]+p[E-1].length-B;f.push(No(s,p,g,w,E,B,$,null,a))}u.push(B+v-r)}}return d(e,t,n,i,0),(o||a)(f,u,l)}class Kw{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof hn?this.setBuffer(e.context.buffer,e.index,t):e instanceof zt&&this.map.set(e.tree,t)}get(e){return e instanceof hn?this.getBuffer(e.context.buffer,e.index):e instanceof zt?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class An{constructor(e,t,n,i,r=!1,l=!1){this.from=e,this.to=t,this.tree=n,this.offset=i,this.open=(r?1:0)|(l?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],n=!1){let i=[new An(0,e.length,e,0,!1,n)];for(let r of t)r.to>e.length&&i.push(r);return i}static applyChanges(e,t,n=128){if(!t.length)return e;let i=[],r=1,l=e.length?e[0]:null;for(let o=0,a=0,h=0;;o++){let c=o=n)for(;l&&l.from=u.from||f<=u.to||h){let d=Math.max(u.from,a)-h,p=Math.min(u.to,f)-h;u=d>=p?null:new An(d,p,u.tree,u.offset+h,o>0,!!c)}if(u&&i.push(u),l.to>f)break;l=rnew Lt(i.from,i.to)):[new Lt(0,0)]:[new Lt(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let i=this.startParse(e,t,n);for(;;){let r=i.advance();if(r)return r}}};class z0{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function Gw(s){return(e,t,n,i)=>new V0(e,s,t,n,i)}class Oh{constructor(e,t,n,i,r){if(this.parser=e,this.parse=t,this.overlay=n,this.target=i,this.ranges=r,!r.length||r.some(l=>l.from>=l.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(r))}}class j0{constructor(e,t,n,i,r,l,o){this.parser=e,this.predicate=t,this.mounts=n,this.index=i,this.start=r,this.target=l,this.prev=o,this.depth=0,this.ranges=[]}}const oo=new ve({perNode:!0});class V0{constructor(e,t,n,i,r){this.nest=t,this.input=n,this.fragments=i,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let n=this.baseParse.advance();if(!n)return null;if(this.baseParse=null,this.baseTree=n,this.startInner(),this.stoppedAt!=null)for(let i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let n=this.baseTree;return this.stoppedAt!=null&&(n=new Qe(n.type,n.children,n.positions,n.length,n.propValues.concat([[oo,this.stoppedAt]]))),n}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let n=Object.assign(Object.create(null),e.target.props);n[ve.mounted.id]=new B0(t,e.overlay,e.parser),e.target.props=n}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;tc.frag.from<=i.from&&c.frag.to>=i.to&&c.mount.overlay);if(h)for(let c of h.mount.overlay){let f=c.from+h.pos,u=c.to+h.pos;f>=i.from&&u<=i.to&&!t.ranges.some(d=>d.fromf)&&t.ranges.push({from:f,to:u})}}o=!1}else if(n&&(l=H0(n.ranges,i.from,i.to)))o=l!=2;else if(!i.type.isAnonymous&&i.fromnew Lt(f.from-i.from,f.to-i.from)):null,i.tree,c)),r.overlay?c.length&&(n={ranges:c,depth:0,prev:n}):o=!1}}else t&&(a=t.predicate(i))&&(a===!0&&(a=new Lt(i.from,i.to)),a.fromnew Lt(c.from-t.start,c.to-t.start)),t.target,h)),t=t.prev}n&&!--n.depth&&(n=n.prev)}}}}function H0(s,e,t){for(let n of s){if(n.from>=t)break;if(n.to>e)return n.from<=e&&n.to>=t?2:1}return 0}function Ph(s,e,t,n,i,r){if(e=e.to);n++);let l=i.children[n],o=l.buffer;function a(h,c,f,u,d){let p=h;for(;o[p+2]+r<=e.from;)p=o[p+3];let g=[],m=[];Ph(l,h,p,g,m,u);let _=o[p+1],v=o[p+2],E=_+r==e.from&&v+r==e.to&&o[p]==e.type.id;return g.push(E?e.toTree():a(p+4,o[p+3],l.set.types[o[p]],_,v-_)),m.push(_-u),Ph(l,o[p+3],c,g,m,u),new Qe(f,g,m,d)}i.children[n]=a(0,o.length,vt.none,0,l.length);for(let h=0;h<=t;h++)s.childAfter(e.from)}class $h{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(He.IncludeAnonymous|He.IgnoreMounts)}moveTo(e){let{cursor:t}=this,n=e-this.offset;for(;!this.done&&t.from=e&&t.enter(n,1,He.IgnoreOverlays|He.ExcludeBuffers)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof Qe)t=t.children[0];else break}return!1}}class W0{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let n=this.curFrag=e[0];this.curTo=(t=n.tree.prop(oo))!==null&&t!==void 0?t:n.to,this.inner=new $h(n.tree,-n.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(oo))!==null&&e!==void 0?e:t.to,this.inner=new $h(t.tree,-t.offset)}}findMounts(e,t){var n;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let r=this.inner.cursor.node;r;r=r.parent){let l=(n=r.tree)===null||n===void 0?void 0:n.prop(ve.mounted);if(l&&l.parser==t)for(let o=this.fragI;o=r.to)break;a.tree==this.curFrag.tree&&i.push({frag:a,pos:r.from-a.offset,mount:l})}}}return i}}function Bh(s,e){let t=null,n=e;for(let i=1,r=0;i=o)break;a.to<=l||(t||(n=t=e.slice()),a.fromo&&t.splice(r+1,0,new Lt(o,a.to))):a.to>o?t[r--]=new Lt(o,a.to):t.splice(r--,1))}}return n}function q0(s,e,t,n){let i=0,r=0,l=!1,o=!1,a=-1e9,h=[];for(;;){let c=i==s.length?1e9:l?s[i].to:s[i].from,f=r==e.length?1e9:o?e[r].to:e[r].from;if(l!=o){let u=Math.max(a,t),d=Math.min(c,f,n);unew Lt(u.from+n,u.to+n)),f=q0(e,c,a,h);for(let u=0,d=a;;u++){let p=u==f.length,g=p?h:f[u].from;if(g>d&&t.push(new An(d,g,i.tree,-l,r.from>=d||r.openStart,r.to<=g||r.openEnd)),p)break;d=f[u].to}}else t.push(new An(a,h,i.tree,-l,r.from>=l||r.openStart,r.to<=o||r.openEnd))}return t}let U0=0;class sn{constructor(e,t,n){this.set=e,this.base=t,this.modified=n,this.id=U0++}static define(e){if(e!=null&&e.base)throw new Error("Can not derive from a modified tag");let t=new sn([],null,[]);if(t.set.push(t),e)for(let n of e.set)t.set.push(n);return t}static defineModifier(){let e=new dr;return t=>t.modified.indexOf(e)>-1?t:dr.get(t.base||t,t.modified.concat(e).sort((n,i)=>n.id-i.id))}}let K0=0;class dr{constructor(){this.instances=[],this.id=K0++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(o=>o.base==e&&J0(t,o.modified));if(n)return n;let i=[],r=new sn(i,e,t);for(let o of t)o.instances.push(r);let l=G0(t);for(let o of e.set)if(!o.modified.length)for(let a of l)i.push(dr.get(o,a));return r}}function J0(s,e){return s.length==e.length&&s.every((t,n)=>t==e[n])}function G0(s){let e=[[]];for(let t=0;tn.length-t.length)}function Y0(s){let e=Object.create(null);for(let t in s){let n=s[t];Array.isArray(n)||(n=[n]);for(let i of t.split(" "))if(i){let r=[],l=2,o=i;for(let f=0;;){if(o=="..."&&f>0&&f+3==i.length){l=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!u)throw new RangeError("Invalid path: "+i);if(r.push(u[0]=="*"?"":u[0][0]=='"'?JSON.parse(u[0]):u[0]),f+=u[0].length,f==i.length)break;let d=i[f++];if(f==i.length&&d=="!"){l=0;break}if(d!="/")throw new RangeError("Invalid path: "+i);o=i.slice(f)}let a=r.length-1,h=r[a];if(!h)throw new RangeError("Invalid path: "+i);let c=new pr(n,l,a>0?r.slice(0,a):null);e[h]=c.sort(e[h])}}return fd.add(e)}const fd=new ve;class pr{constructor(e,t,n,i){this.tags=e,this.mode=t,this.context=n,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let l=i;for(let o of r)for(let a of o.set){let h=t[a.id];if(h){l=l?l+" "+h:h;break}}return l},scope:n}}function X0(s,e){let t=null;for(let n of s){let i=n.style(e);i&&(t=t?t+" "+i:i)}return t}function Z0(s,e,t,n=0,i=s.length){let r=new Q0(n,Array.isArray(e)?e:[e],t);r.highlightRange(s.cursor(),n,i,"",r.highlighters),r.flush(i)}class Q0{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,i,r){let{type:l,from:o,to:a}=e;if(o>=n||a<=t)return;l.isTop&&(r=this.highlighters.filter(d=>!d.scope||d.scope(l)));let h=i,c=e1(e)||pr.empty,f=X0(r,c.tags);if(f&&(h&&(h+=" "),h+=f,c.mode==1&&(i+=(i?" ":"")+f)),this.startSpan(Math.max(t,o),h),c.opaque)return;let u=e.tree&&e.tree.prop(ve.mounted);if(u&&u.overlay){let d=e.node.enter(u.overlay[0].from+o,1),p=this.highlighters.filter(m=>!m.scope||m.scope(u.tree.type)),g=e.firstChild();for(let m=0,_=o;;m++){let v=m=E||!e.nextSibling())););if(!v||E>n)break;_=v.to+o,_>t&&(this.highlightRange(d.cursor(),Math.max(t,v.from+o),Math.min(n,_),"",p),this.startSpan(Math.min(n,_),h))}g&&e.parent()}else if(e.firstChild()){u&&(i="");do if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,i,r),this.startSpan(Math.min(n,e.to),h)}while(e.nextSibling());e.parent()}}}function e1(s){let e=s.type.prop(fd);for(;e&&e.context&&!s.matchContext(e.context);)e=e.next;return e||null}const Y=sn.define,zs=Y(),Nn=Y(),Lh=Y(Nn),Rh=Y(Nn),Ln=Y(),js=Y(Ln),_l=Y(Ln),nn=Y(),Zn=Y(nn),en=Y(),tn=Y(),ao=Y(),Fi=Y(ao),Vs=Y(),N={comment:zs,lineComment:Y(zs),blockComment:Y(zs),docComment:Y(zs),name:Nn,variableName:Y(Nn),typeName:Lh,tagName:Y(Lh),propertyName:Rh,attributeName:Y(Rh),className:Y(Nn),labelName:Y(Nn),namespace:Y(Nn),macroName:Y(Nn),literal:Ln,string:js,docString:Y(js),character:Y(js),attributeValue:Y(js),number:_l,integer:Y(_l),float:Y(_l),bool:Y(Ln),regexp:Y(Ln),escape:Y(Ln),color:Y(Ln),url:Y(Ln),keyword:en,self:Y(en),null:Y(en),atom:Y(en),unit:Y(en),modifier:Y(en),operatorKeyword:Y(en),controlKeyword:Y(en),definitionKeyword:Y(en),moduleKeyword:Y(en),operator:tn,derefOperator:Y(tn),arithmeticOperator:Y(tn),logicOperator:Y(tn),bitwiseOperator:Y(tn),compareOperator:Y(tn),updateOperator:Y(tn),definitionOperator:Y(tn),typeOperator:Y(tn),controlOperator:Y(tn),punctuation:ao,separator:Y(ao),bracket:Fi,angleBracket:Y(Fi),squareBracket:Y(Fi),paren:Y(Fi),brace:Y(Fi),content:nn,heading:Zn,heading1:Y(Zn),heading2:Y(Zn),heading3:Y(Zn),heading4:Y(Zn),heading5:Y(Zn),heading6:Y(Zn),contentSeparator:Y(nn),list:Y(nn),quote:Y(nn),emphasis:Y(nn),strong:Y(nn),link:Y(nn),monospace:Y(nn),strikethrough:Y(nn),inserted:Y(),deleted:Y(),changed:Y(),invalid:Y(),meta:Vs,documentMeta:Y(Vs),annotation:Y(Vs),processingInstruction:Y(Vs),definition:sn.defineModifier(),constant:sn.defineModifier(),function:sn.defineModifier(),standard:sn.defineModifier(),local:sn.defineModifier(),special:sn.defineModifier()};ud([{tag:N.link,class:"tok-link"},{tag:N.heading,class:"tok-heading"},{tag:N.emphasis,class:"tok-emphasis"},{tag:N.strong,class:"tok-strong"},{tag:N.keyword,class:"tok-keyword"},{tag:N.atom,class:"tok-atom"},{tag:N.bool,class:"tok-bool"},{tag:N.url,class:"tok-url"},{tag:N.labelName,class:"tok-labelName"},{tag:N.inserted,class:"tok-inserted"},{tag:N.deleted,class:"tok-deleted"},{tag:N.literal,class:"tok-literal"},{tag:N.string,class:"tok-string"},{tag:N.number,class:"tok-number"},{tag:[N.regexp,N.escape,N.special(N.string)],class:"tok-string2"},{tag:N.variableName,class:"tok-variableName"},{tag:N.local(N.variableName),class:"tok-variableName tok-local"},{tag:N.definition(N.variableName),class:"tok-variableName tok-definition"},{tag:N.special(N.variableName),class:"tok-variableName2"},{tag:N.definition(N.propertyName),class:"tok-propertyName tok-definition"},{tag:N.typeName,class:"tok-typeName"},{tag:N.namespace,class:"tok-namespace"},{tag:N.className,class:"tok-className"},{tag:N.macroName,class:"tok-macroName"},{tag:N.propertyName,class:"tok-propertyName"},{tag:N.operator,class:"tok-operator"},{tag:N.comment,class:"tok-comment"},{tag:N.meta,class:"tok-meta"},{tag:N.invalid,class:"tok-invalid"},{tag:N.punctuation,class:"tok-punctuation"}]);var kl;const ki=new ve;function t1(s){return le.define({combine:s?e=>e.concat(s):void 0})}const n1=new ve;class Ut{constructor(e,t,n=[],i=""){this.data=e,this.name=i,ye.prototype.hasOwnProperty("tree")||Object.defineProperty(ye.prototype,"tree",{get(){return Ot(this)}}),this.parser=t,this.extension=[Wn.of(this),ye.languageData.of((r,l,o)=>{let a=Ih(r,l,o),h=a.type.prop(ki);if(!h)return[];let c=r.facet(h),f=a.type.prop(n1);if(f){let u=a.resolve(l-a.from,o);for(let d of f)if(d.test(u,r)){let p=r.facet(d.facet);return d.type=="replace"?p:p.concat(c)}}return c})].concat(n)}isActiveAt(e,t,n=-1){return Ih(e,t,n).type.prop(ki)==this.data}findRegions(e){let t=e.facet(Wn);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],i=(r,l)=>{if(r.prop(ki)==this.data){n.push({from:l,to:l+r.length});return}let o=r.prop(ve.mounted);if(o){if(o.tree.prop(ki)==this.data){if(o.overlay)for(let a of o.overlay)n.push({from:a.from+l,to:a.to+l});else n.push({from:l,to:l+r.length});return}else if(o.overlay){let a=n.length;if(i(o.tree,o.overlay[0].from+l),n.length>a)return}}for(let a=0;an.isTop?t:void 0)]}),e.name)}configure(e,t){return new ho(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Ot(s){let e=s.field(Ut.state,!1);return e?e.tree:Qe.empty}class i1{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}let Wi=null;class gr{constructor(e,t,n=[],i,r,l,o,a){this.parser=e,this.state=t,this.fragments=n,this.tree=i,this.treeLen=r,this.viewport=l,this.skipped=o,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new gr(e,t,[],Qe.empty,0,n,[],null)}startParse(){return this.parser.startParse(new i1(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=Qe.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var n;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(An.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Wi;Wi=this;try{return e()}finally{Wi=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=zh(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:i,treeLen:r,viewport:l,skipped:o}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((h,c,f,u)=>a.push({fromA:h,toA:c,fromB:f,toB:u})),n=An.applyChanges(n,a),i=Qe.empty,r=0,l={from:e.mapPos(l.from,-1),to:e.mapPos(l.to,1)},this.skipped.length){o=[];for(let h of this.skipped){let c=e.mapPos(h.from,1),f=e.mapPos(h.to,-1);ce.from&&(this.fragments=zh(this.fragments,i,r),this.skipped.splice(n--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends I0{createParse(t,n,i){let r=i[0].from,l=i[i.length-1].to;return{parsedPos:r,advance(){let a=Wi;if(a){for(let h of i)a.tempSkipped.push(h);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=l,new Qe(vt.none,[],[],l-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return Wi}}function zh(s,e,t){return An.applyChanges(s,[{fromA:e,toA:t,fromB:e,toB:t}])}class Ti{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new Ti(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=gr.create(e.facet(Wn).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new Ti(n)}}Ut.state=Pt.define({create:Ti.init,update(s,e){for(let t of e.effects)if(t.is(Ut.setState))return t.value;return e.startState.facet(Wn)!=e.state.facet(Wn)?Ti.init(e.state):s.apply(e)}});let dd=s=>{let e=setTimeout(()=>s(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(dd=s=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(s,{timeout:500-100})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const vl=typeof navigator<"u"&&(!((kl=navigator.scheduling)===null||kl===void 0)&&kl.isInputPending)?()=>navigator.scheduling.isInputPending():null,s1=ht.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Ut.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),e.docChanged&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Ut.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=dd(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndi+1e3,a=r.context.work(()=>vl&&vl()||Date.now()>l,i+(o?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:Ut.setState.of(new Ti(r.context))})),this.chunkBudget>0&&!(a&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>xn(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Wn=le.define({combine(s){return s.length?s[0]:null},enables:s=>[Ut.state,s1,ce.contentAttributes.compute([s],e=>{let t=e.facet(s);return t&&t.name?{"data-language":t.name}:{}})]});class Xw{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}class pd{constructor(e,t,n,i,r,l=void 0){this.name=e,this.alias=t,this.extensions=n,this.filename=i,this.loadFunc=r,this.support=l,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:t,support:n}=e;if(!t){if(!n)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(n)}return new pd(e.name,(e.alias||[]).concat(e.name).map(i=>i.toLowerCase()),e.extensions||[],e.filename,t,n)}static matchFilename(e,t){for(let i of e)if(i.filename&&i.filename.test(t))return i;let n=/\.([^.]+)$/.exec(t);if(n){for(let i of e)if(i.extensions.indexOf(n[1])>-1)return i}return null}static matchLanguageName(e,t,n=!0){t=t.toLowerCase();for(let i of e)if(i.alias.some(r=>r==t))return i;if(n)for(let i of e)for(let r of i.alias){let l=t.indexOf(r);if(l>-1&&(r.length>2||!/\w/.test(t[l-1])&&!/\w/.test(t[l+r.length])))return i}return null}}const r1=le.define(),Pr=le.define({combine:s=>{if(!s.length)return" ";let e=s[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(s[0]));return e}});function mr(s){let e=s.facet(Pr);return e.charCodeAt(0)==9?s.tabSize*e.length:e.length}function cs(s,e){let t="",n=s.tabSize,i=s.facet(Pr)[0];if(i==" "){for(;e>=n;)t+=" ",e-=n;i=" "}for(let r=0;r=n.from&&i<=n.to?r&&i==e?{text:"",from:e}:(t<0?i-1&&(r+=l-this.countColumn(n,n.search(/\S|$/))),r}countColumn(e,t=e.length){return gs(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:i}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let l=r(i);if(l>-1)return l}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const l1=new ve;function o1(s,e,t){return gd(e.resolveInner(t).enterUnfinishedNodesBefore(t),t,s)}function a1(s){return s.pos==s.options.simulateBreak&&s.options.simulateDoubleBreak}function h1(s){let e=s.type.prop(l1);if(e)return e;let t=s.firstChild,n;if(t&&(n=t.type.prop(ve.closedBy))){let i=s.lastChild,r=i&&n.indexOf(i.name)>-1;return l=>md(l,!0,1,void 0,r&&!a1(l)?i.from:void 0)}return s.parent==null?c1:null}function gd(s,e,t){for(;s;s=s.parent){let n=h1(s);if(n)return n(Ro.create(t,e,s))}return null}function c1(){return 0}class Ro extends $r{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.node=n}static create(e,t,n){return new Ro(e,t,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(f1(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){let e=this.node.parent;return e?gd(e,this.pos,this.base):0}}function f1(s,e){for(let t=e;t;t=t.parent)if(s==t)return!0;return!1}function u1(s){let e=s.node,t=e.childAfter(e.from),n=e.lastChild;if(!t)return null;let i=s.options.simulateBreak,r=s.state.doc.lineAt(t.from),l=i==null||i<=r.from?r.to:Math.min(r.to,i);for(let o=t.to;;){let a=e.childAfter(o);if(!a||a==n)return null;if(!a.type.isSkipped)return a.frommd(n,e,t,s)}function md(s,e,t,n,i){let r=s.textAfter,l=r.match(/^\s*/)[0].length,o=n&&r.slice(l,l+n.length)==n||i==s.pos+l,a=e?u1(s):null;return a?o?s.column(a.from):s.column(a.to):s.baseIndent+(o?0:s.unit*t)}const Qw=s=>s.baseIndent;function eS({except:s,units:e=1}={}){return t=>{let n=s&&s.test(t.textAfter);return t.baseIndent+(n?0:e*t.unit)}}const d1=200;function tS(){return ye.transactionFilter.of(s=>{if(!s.docChanged||!s.isUserEvent("input.type")&&!s.isUserEvent("input.complete"))return s;let e=s.startState.languageDataAt("indentOnInput",s.startState.selection.main.head);if(!e.length)return s;let t=s.newDoc,{head:n}=s.newSelection.main,i=t.lineAt(n);if(n>i.from+d1)return s;let r=t.sliceString(i.from,n);if(!e.some(h=>h.test(r)))return s;let{state:l}=s,o=-1,a=[];for(let{head:h}of l.selection.ranges){let c=l.doc.lineAt(h);if(c.from==o)continue;o=c.from;let f=Lo(l,c.from);if(f==null)continue;let u=/^\s*/.exec(c.text)[0],d=cs(l,f);u!=d&&a.push({from:c.from,to:c.from+u.length,insert:d})}return a.length?[s,{changes:a,sequential:!0}]:s})}const p1=le.define(),g1=new ve;function nS(s){let e=s.firstChild,t=s.lastChild;return e&&e.tot)continue;if(r&&l.from=e&&a.to>t&&(r=a)}}return r}function b1(s){let e=s.lastChild;return e&&e.to==s.to&&e.type.isError}function br(s,e,t){for(let n of s.facet(p1)){let i=n(s,e,t);if(i)return i}return m1(s,e,t)}function bd(s,e){let t=e.mapPos(s.from,1),n=e.mapPos(s.to,-1);return t>=n?void 0:{from:t,to:n}}const Br=Pe.define({map:bd}),ks=Pe.define({map:bd});function _d(s){let e=[];for(let{head:t}of s.state.selection.ranges)e.some(n=>n.from<=t&&n.to>=t)||e.push(s.lineBlockAt(t));return e}const li=Pt.define({create(){return Re.none},update(s,e){s=s.map(e.changes);for(let t of e.effects)t.is(Br)&&!_1(s,t.value.from,t.value.to)?s=s.update({add:[jh.range(t.value.from,t.value.to)]}):t.is(ks)&&(s=s.update({filter:(n,i)=>t.value.from!=n||t.value.to!=i,filterFrom:t.value.from,filterTo:t.value.to}));if(e.selection){let t=!1,{head:n}=e.selection.main;s.between(n,n,(i,r)=>{in&&(t=!0)}),t&&(s=s.update({filterFrom:n,filterTo:n,filter:(i,r)=>r<=n||i>=n}))}return s},provide:s=>ce.decorations.from(s),toJSON(s,e){let t=[];return s.between(0,e.doc.length,(n,i)=>{t.push(n,i)}),t},fromJSON(s){if(!Array.isArray(s)||s.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t{(!i||i.from>r)&&(i={from:r,to:l})}),i}function _1(s,e,t){let n=!1;return s.between(e,e,(i,r)=>{i==e&&r==t&&(n=!0)}),n}function kd(s,e){return s.field(li,!1)?e:e.concat(Pe.appendConfig.of(wd()))}const k1=s=>{for(let e of _d(s)){let t=br(s.state,e.from,e.to);if(t)return s.dispatch({effects:kd(s.state,[Br.of(t),vd(s,t)])}),!0}return!1},v1=s=>{if(!s.state.field(li,!1))return!1;let e=[];for(let t of _d(s)){let n=_r(s.state,t.from,t.to);n&&e.push(ks.of(n),vd(s,n,!1))}return e.length&&s.dispatch({effects:e}),e.length>0};function vd(s,e,t=!0){let n=s.state.doc.lineAt(e.from).number,i=s.state.doc.lineAt(e.to).number;return ce.announce.of(`${s.state.phrase(t?"Folded lines":"Unfolded lines")} ${n} ${s.state.phrase("to")} ${i}.`)}const y1=s=>{let{state:e}=s,t=[];for(let n=0;n{let e=s.state.field(li,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,s.state.doc.length,(n,i)=>{t.push(ks.of({from:n,to:i}))}),s.dispatch({effects:t}),!0},iS=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:k1},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:v1},{key:"Ctrl-Alt-[",run:y1},{key:"Ctrl-Alt-]",run:w1}],S1={placeholderDOM:null,placeholderText:"…"},yd=le.define({combine(s){return Ei(s,S1)}});function wd(s){let e=[li,A1];return s&&e.push(yd.of(s)),e}const jh=Re.replace({widget:new class extends Di{toDOM(s){let{state:e}=s,t=e.facet(yd),n=r=>{let l=s.lineBlockAt(s.posAtDOM(r.target)),o=_r(s.state,l.from,l.to);o&&s.dispatch({effects:ks.of(o)}),r.preventDefault()};if(t.placeholderDOM)return t.placeholderDOM(s,n);let i=document.createElement("span");return i.textContent=t.placeholderText,i.setAttribute("aria-label",e.phrase("folded code")),i.title=e.phrase("unfold"),i.className="cm-foldPlaceholder",i.onclick=n,i}}}),x1={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class yl extends En{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function sS(s={}){let e=Object.assign(Object.assign({},x1),s),t=new yl(e,!0),n=new yl(e,!1),i=ht.fromClass(class{constructor(l){this.from=l.viewport.from,this.markers=this.buildMarkers(l)}update(l){(l.docChanged||l.viewportChanged||l.startState.facet(Wn)!=l.state.facet(Wn)||l.startState.field(li,!1)!=l.state.field(li,!1)||Ot(l.startState)!=Ot(l.state)||e.foldingChanged(l))&&(this.markers=this.buildMarkers(l.view))}buildMarkers(l){let o=new ri;for(let a of l.viewportLineBlocks){let h=_r(l.state,a.from,a.to)?n:br(l.state,a.from,a.to)?t:null;h&&o.add(a.from,a.from,h)}return o.finish()}}),{domEventHandlers:r}=e;return[i,x0({class:"cm-foldGutter",markers(l){var o;return((o=l.plugin(i))===null||o===void 0?void 0:o.markers)||Ne.empty},initialSpacer(){return new yl(e,!1)},domEventHandlers:Object.assign(Object.assign({},r),{click:(l,o,a)=>{if(r.click&&r.click(l,o,a))return!0;let h=_r(l.state,o.from,o.to);if(h)return l.dispatch({effects:ks.of(h)}),!0;let c=br(l.state,o.from,o.to);return c?(l.dispatch({effects:Br.of(c)}),!0):!1}})}),wd()]}const A1=ce.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class vs{constructor(e,t){this.specs=e;let n;function i(o){let a=jn.newName();return(n||(n=Object.create(null)))["."+a]=o,a}const r=typeof t.all=="string"?t.all:t.all?i(t.all):void 0,l=t.scope;this.scope=l instanceof Ut?o=>o.prop(ki)==l.data:l?o=>o==l:void 0,this.style=ud(e.map(o=>({tag:o.tag,class:o.class||i(Object.assign({},o,{tag:null}))})),{all:r}).style,this.module=n?new jn(n):null,this.themeType=t.themeType}static define(e,t){return new vs(e,t||{})}}const co=le.define(),Sd=le.define({combine(s){return s.length?[s[0]]:null}});function wl(s){let e=s.facet(co);return e.length?e:s.facet(Sd)}function C1(s,e){let t=[T1],n;return s instanceof vs&&(s.module&&t.push(ce.styleModule.of(s.module)),n=s.themeType),e!=null&&e.fallback?t.push(Sd.of(s)):n?t.push(co.computeN([ce.darkTheme],i=>i.facet(ce.darkTheme)==(n=="dark")?[s]:[])):t.push(co.of(s)),t}class M1{constructor(e){this.markCache=Object.create(null),this.tree=Ot(e.state),this.decorations=this.buildDeco(e,wl(e.state))}update(e){let t=Ot(e.state),n=wl(e.state),i=n!=wl(e.startState);t.length{n.add(l,o,this.markCache[a]||(this.markCache[a]=Re.mark({class:a})))},i,r);return n.finish()}}const T1=Er.high(ht.fromClass(M1,{decorations:s=>s.decorations})),rS=vs.define([{tag:N.meta,color:"#404740"},{tag:N.link,textDecoration:"underline"},{tag:N.heading,textDecoration:"underline",fontWeight:"bold"},{tag:N.emphasis,fontStyle:"italic"},{tag:N.strong,fontWeight:"bold"},{tag:N.strikethrough,textDecoration:"line-through"},{tag:N.keyword,color:"#708"},{tag:[N.atom,N.bool,N.url,N.contentSeparator,N.labelName],color:"#219"},{tag:[N.literal,N.inserted],color:"#164"},{tag:[N.string,N.deleted],color:"#a11"},{tag:[N.regexp,N.escape,N.special(N.string)],color:"#e40"},{tag:N.definition(N.variableName),color:"#00f"},{tag:N.local(N.variableName),color:"#30a"},{tag:[N.typeName,N.namespace],color:"#085"},{tag:N.className,color:"#167"},{tag:[N.special(N.variableName),N.macroName],color:"#256"},{tag:N.definition(N.propertyName),color:"#00c"},{tag:N.comment,color:"#940"},{tag:N.invalid,color:"#f00"}]),E1=ce.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),xd=1e4,Ad="()[]{}",Cd=le.define({combine(s){return Ei(s,{afterCursor:!0,brackets:Ad,maxScanDistance:xd,renderMatch:P1})}}),D1=Re.mark({class:"cm-matchingBracket"}),O1=Re.mark({class:"cm-nonmatchingBracket"});function P1(s){let e=[],t=s.matched?D1:O1;return e.push(t.range(s.start.from,s.start.to)),s.end&&e.push(t.range(s.end.from,s.end.to)),e}const $1=Pt.define({create(){return Re.none},update(s,e){if(!e.docChanged&&!e.selection)return s;let t=[],n=e.state.facet(Cd);for(let i of e.state.selection.ranges){if(!i.empty)continue;let r=cn(e.state,i.head,-1,n)||i.head>0&&cn(e.state,i.head-1,1,n)||n.afterCursor&&(cn(e.state,i.head,1,n)||i.headce.decorations.from(s)}),B1=[$1,E1];function lS(s={}){return[Cd.of(s),B1]}const N1=new ve;function fo(s,e,t){let n=s.prop(e<0?ve.openedBy:ve.closedBy);if(n)return n;if(s.name.length==1){let i=t.indexOf(s.name);if(i>-1&&i%2==(e<0?1:0))return[t[i+e]]}return null}function uo(s){let e=s.type.prop(N1);return e?e(s.node):s}function cn(s,e,t,n={}){let i=n.maxScanDistance||xd,r=n.brackets||Ad,l=Ot(s),o=l.resolveInner(e,t);for(let a=o;a;a=a.parent){let h=fo(a.type,t,r);if(h&&a.from0?e>=c.from&&ec.from&&e<=c.to))return L1(s,e,t,a,c,h,r)}}return R1(s,e,t,l,o.type,i,r)}function L1(s,e,t,n,i,r,l){let o=n.parent,a={from:i.from,to:i.to},h=0,c=o==null?void 0:o.cursor();if(c&&(t<0?c.childBefore(n.from):c.childAfter(n.to)))do if(t<0?c.to<=n.from:c.from>=n.to){if(h==0&&r.indexOf(c.type.name)>-1&&c.from0)return null;let h={from:t<0?e-1:e,to:t>0?e+1:e},c=s.doc.iterRange(e,t>0?s.doc.length:0),f=0;for(let u=0;!c.next().done&&u<=r;){let d=c.value;t<0&&(u+=d.length);let p=e+u*t;for(let g=t>0?0:d.length-1,m=t>0?d.length:-1;g!=m;g+=t){let _=l.indexOf(d[g]);if(!(_<0||n.resolveInner(p+g,1).type!=i))if(_%2==0==t>0)f++;else{if(f==1)return{start:h,end:{from:p+g,to:p+g+1},matched:_>>1==a>>1};f--}}t>0&&(u+=d.length)}return c.done?{start:h,matched:!1}:null}const I1=Object.create(null),Vh=[vt.none],Hh=[],z1=Object.create(null);for(let[s,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])z1[s]=j1(I1,e);function Sl(s,e){Hh.indexOf(s)>-1||(Hh.push(s),console.warn(e))}function j1(s,e){let t=null;for(let r of e.split(".")){let l=s[r]||N[r];l?typeof l=="function"?t?t=l(t):Sl(r,`Modifier ${r} used at start of tag`):t?Sl(r,`Tag ${r} used as modifier`):t=l:Sl(r,`Unknown highlighting tag ${r}`)}if(!t)return 0;let n=e.replace(/ /g,"_"),i=vt.define({id:Vh.length,name:n,props:[Y0({[n]:t})]});return Vh.push(i),i.id}const V1=s=>{let{state:e}=s,t=e.doc.lineAt(e.selection.main.from),n=zo(s.state,t.from);return n.line?H1(s):n.block?W1(s):!1};function Io(s,e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let i=s(e,t);return i?(n(t.update(i)),!0):!1}}const H1=Io(K1,0),F1=Io(Md,0),W1=Io((s,e)=>Md(s,e,U1(e)),0);function zo(s,e){let t=s.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const qi=50;function q1(s,{open:e,close:t},n,i){let r=s.sliceDoc(n-qi,n),l=s.sliceDoc(i,i+qi),o=/\s*$/.exec(r)[0].length,a=/^\s*/.exec(l)[0].length,h=r.length-o;if(r.slice(h-e.length,h)==e&&l.slice(a,a+t.length)==t)return{open:{pos:n-o,margin:o&&1},close:{pos:i+a,margin:a&&1}};let c,f;i-n<=2*qi?c=f=s.sliceDoc(n,i):(c=s.sliceDoc(n,n+qi),f=s.sliceDoc(i-qi,i));let u=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-t.length;return c.slice(u,u+e.length)==e&&f.slice(p,p+t.length)==t?{open:{pos:n+u+e.length,margin:/\s/.test(c.charAt(u+e.length))?1:0},close:{pos:i-d-t.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function U1(s){let e=[];for(let t of s.selection.ranges){let n=s.doc.lineAt(t.from),i=t.to<=n.to?n:s.doc.lineAt(t.to),r=e.length-1;r>=0&&e[r].to>n.from?e[r].to=i.to:e.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:i.to})}return e}function Md(s,e,t=e.selection.ranges){let n=t.map(r=>zo(e,r.from).block);if(!n.every(r=>r))return null;let i=t.map((r,l)=>q1(e,n[l],r.from,r.to));if(s!=2&&!i.every(r=>r))return{changes:e.changes(t.map((r,l)=>i[l]?[]:[{from:r.from,insert:n[l].open+" "},{from:r.to,insert:" "+n[l].close}]))};if(s!=1&&i.some(r=>r)){let r=[];for(let l=0,o;li&&(r==l||l>f.from)){i=f.from;let u=/^\s*/.exec(f.text)[0].length,d=u==f.length,p=f.text.slice(u,u+h.length)==h?u:-1;ur.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:o,token:a,indent:h,empty:c,single:f}of n)(f||!c)&&r.push({from:o.from+h,insert:a+" "});let l=e.changes(r);return{changes:l,selection:e.selection.map(l,1)}}else if(s!=1&&n.some(r=>r.comment>=0)){let r=[];for(let{line:l,comment:o,token:a}of n)if(o>=0){let h=l.from+o,c=h+a.length;l.text[c-l.from]==" "&&c++,r.push({from:h,to:c})}return{changes:r}}return null}const po=qn.define(),J1=qn.define(),G1=le.define(),Td=le.define({combine(s){return Ei(s,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,i)=>e(n,i)||t(n,i)})}});function Y1(s){let e=0;return s.iterChangedRanges((t,n)=>e=n),e}const jo=Pt.define({create(){return fn.empty},update(s,e){let t=e.state.facet(Td),n=e.annotation(po);if(n){let a=e.docChanged?F.single(Y1(e.changes)):void 0,h=kt.fromTransaction(e,a),c=n.side,f=c==0?s.undone:s.done;return h?f=kr(f,f.length,t.minDepth,h):f=Od(f,e.startState.selection),new fn(c==0?n.rest:f,c==0?f:n.rest)}let i=e.annotation(J1);if((i=="full"||i=="before")&&(s=s.isolate()),e.annotation(Ze.addToHistory)===!1)return e.changes.empty?s:s.addMapping(e.changes.desc);let r=kt.fromTransaction(e),l=e.annotation(Ze.time),o=e.annotation(Ze.userEvent);return r?s=s.addChanges(r,l,o,t,e):e.selection&&(s=s.addSelection(e.startState.selection,l,o,t.newGroupDelay)),(i=="full"||i=="after")&&(s=s.isolate()),s},toJSON(s){return{done:s.done.map(e=>e.toJSON()),undone:s.undone.map(e=>e.toJSON())}},fromJSON(s){return new fn(s.done.map(kt.fromJSON),s.undone.map(kt.fromJSON))}});function oS(s={}){return[jo,Td.of(s),ce.domEventHandlers({beforeinput(e,t){let n=e.inputType=="historyUndo"?Ed:e.inputType=="historyRedo"?go:null;return n?(e.preventDefault(),n(t)):!1}})]}const Fh=jo;function Nr(s,e){return function({state:t,dispatch:n}){if(!e&&t.readOnly)return!1;let i=t.field(jo,!1);if(!i)return!1;let r=i.pop(s,t,e);return r?(n(r),!0):!1}}const Ed=Nr(0,!1),go=Nr(1,!1),X1=Nr(0,!0),Z1=Nr(1,!0);class kt{constructor(e,t,n,i,r){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=i,this.selectionsAfter=r}setSelAfter(e){return new kt(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(n=this.startSelection)===null||n===void 0?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new kt(e.changes&&Ye.fromJSON(e.changes),[],e.mapped&&pn.fromJSON(e.mapped),e.startSelection&&F.fromJSON(e.startSelection),e.selectionsAfter.map(F.fromJSON))}static fromTransaction(e,t){let n=Rt;for(let i of e.startState.facet(G1)){let r=i(e);r.length&&(n=n.concat(r))}return!n.length&&e.changes.empty?null:new kt(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,Rt)}static selection(e){return new kt(void 0,Rt,void 0,void 0,e)}}function kr(s,e,t,n){let i=e+1>t+20?e-t-1:0,r=s.slice(i,e);return r.push(n),r}function Q1(s,e){let t=[],n=!1;return s.iterChangedRanges((i,r)=>t.push(i,r)),e.iterChangedRanges((i,r,l,o)=>{for(let a=0;a=h&&l<=c&&(n=!0)}}),n}function eb(s,e){return s.ranges.length==e.ranges.length&&s.ranges.filter((t,n)=>t.empty!=e.ranges[n].empty).length===0}function Dd(s,e){return s.length?e.length?s.concat(e):s:e}const Rt=[],tb=200;function Od(s,e){if(s.length){let t=s[s.length-1],n=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-tb));return n.length&&n[n.length-1].eq(e)?s:(n.push(e),kr(s,s.length-1,1e9,t.setSelAfter(n)))}else return[kt.selection([e])]}function nb(s){let e=s[s.length-1],t=s.slice();return t[s.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function xl(s,e){if(!s.length)return s;let t=s.length,n=Rt;for(;t;){let i=ib(s[t-1],e,n);if(i.changes&&!i.changes.empty||i.effects.length){let r=s.slice(0,t);return r[t-1]=i,r}else e=i.mapped,t--,n=i.selectionsAfter}return n.length?[kt.selection(n)]:Rt}function ib(s,e,t){let n=Dd(s.selectionsAfter.length?s.selectionsAfter.map(o=>o.map(e)):Rt,t);if(!s.changes)return kt.selection(n);let i=s.changes.map(e),r=e.mapDesc(s.changes,!0),l=s.mapped?s.mapped.composeDesc(r):r;return new kt(i,Pe.mapEffects(s.effects,e),l,s.startSelection.map(r),n)}const sb=/^(input\.type|delete)($|\.)/;class fn{constructor(e,t,n=0,i=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=i}isolate(){return this.prevTime?new fn(this.done,this.undone):this}addChanges(e,t,n,i,r){let l=this.done,o=l[l.length-1];return o&&o.changes&&!o.changes.empty&&e.changes&&(!n||sb.test(n))&&(!o.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?s.moveByChar(t,e):Lr(t,e))}function ct(s){return s.textDirectionAt(s.state.selection.main.head)==Ue.LTR}const $d=s=>Pd(s,!ct(s)),Bd=s=>Pd(s,ct(s));function Nd(s,e){return Kt(s,t=>t.empty?s.moveByGroup(t,e):Lr(t,e))}const rb=s=>Nd(s,!ct(s)),lb=s=>Nd(s,ct(s));function ob(s,e,t){if(e.type.prop(t))return!0;let n=e.to-e.from;return n&&(n>2||/[^\s,.;:]/.test(s.sliceDoc(e.from,e.to)))||e.firstChild}function Rr(s,e,t){let n=Ot(s).resolveInner(e.head),i=t?ve.closedBy:ve.openedBy;for(let a=e.head;;){let h=t?n.childAfter(a):n.childBefore(a);if(!h)break;ob(s,h,i)?n=h:a=t?h.to:h.from}let r=n.type.prop(i),l,o;return r&&(l=t?cn(s,n.from,1):cn(s,n.to,-1))&&l.matched?o=t?l.end.to:l.end.from:o=t?n.to:n.from,F.cursor(o,t?-1:1)}const ab=s=>Kt(s,e=>Rr(s.state,e,!ct(s))),hb=s=>Kt(s,e=>Rr(s.state,e,ct(s)));function Ld(s,e){return Kt(s,t=>{if(!t.empty)return Lr(t,e);let n=s.moveVertically(t,e);return n.head!=t.head?n:s.moveToLineBoundary(t,e)})}const Rd=s=>Ld(s,!1),Id=s=>Ld(s,!0);function zd(s){let e=s.scrollDOM.clientHeightl.empty?s.moveVertically(l,e,t.height):Lr(l,e));if(i.eq(n.selection))return!1;let r;if(t.selfScroll){let l=s.coordsAtPos(n.selection.main.head),o=s.scrollDOM.getBoundingClientRect(),a=o.top+t.marginTop,h=o.bottom-t.marginBottom;l&&l.top>a&&l.bottomjd(s,!1),mo=s=>jd(s,!0);function Un(s,e,t){let n=s.lineBlockAt(e.head),i=s.moveToLineBoundary(e,t);if(i.head==e.head&&i.head!=(t?n.to:n.from)&&(i=s.moveToLineBoundary(e,t,!1)),!t&&i.head==n.from&&n.length){let r=/^\s*/.exec(s.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;r&&e.head!=n.from+r&&(i=F.cursor(n.from+r))}return i}const cb=s=>Kt(s,e=>Un(s,e,!0)),fb=s=>Kt(s,e=>Un(s,e,!1)),ub=s=>Kt(s,e=>Un(s,e,!ct(s))),db=s=>Kt(s,e=>Un(s,e,ct(s))),pb=s=>Kt(s,e=>F.cursor(s.lineBlockAt(e.head).from,1)),gb=s=>Kt(s,e=>F.cursor(s.lineBlockAt(e.head).to,-1));function mb(s,e,t){let n=!1,i=Oi(s.selection,r=>{let l=cn(s,r.head,-1)||cn(s,r.head,1)||r.head>0&&cn(s,r.head-1,1)||r.headmb(s,e,!1);function jt(s,e){let t=Oi(s.state.selection,n=>{let i=e(n);return F.range(n.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)});return t.eq(s.state.selection)?!1:(s.dispatch(gn(s.state,t)),!0)}function Vd(s,e){return jt(s,t=>s.moveByChar(t,e))}const Hd=s=>Vd(s,!ct(s)),Fd=s=>Vd(s,ct(s));function Wd(s,e){return jt(s,t=>s.moveByGroup(t,e))}const _b=s=>Wd(s,!ct(s)),kb=s=>Wd(s,ct(s)),vb=s=>jt(s,e=>Rr(s.state,e,!ct(s))),yb=s=>jt(s,e=>Rr(s.state,e,ct(s)));function qd(s,e){return jt(s,t=>s.moveVertically(t,e))}const Ud=s=>qd(s,!1),Kd=s=>qd(s,!0);function Jd(s,e){return jt(s,t=>s.moveVertically(t,e,zd(s).height))}const qh=s=>Jd(s,!1),Uh=s=>Jd(s,!0),wb=s=>jt(s,e=>Un(s,e,!0)),Sb=s=>jt(s,e=>Un(s,e,!1)),xb=s=>jt(s,e=>Un(s,e,!ct(s))),Ab=s=>jt(s,e=>Un(s,e,ct(s))),Cb=s=>jt(s,e=>F.cursor(s.lineBlockAt(e.head).from)),Mb=s=>jt(s,e=>F.cursor(s.lineBlockAt(e.head).to)),Kh=({state:s,dispatch:e})=>(e(gn(s,{anchor:0})),!0),Jh=({state:s,dispatch:e})=>(e(gn(s,{anchor:s.doc.length})),!0),Gh=({state:s,dispatch:e})=>(e(gn(s,{anchor:s.selection.main.anchor,head:0})),!0),Yh=({state:s,dispatch:e})=>(e(gn(s,{anchor:s.selection.main.anchor,head:s.doc.length})),!0),Tb=({state:s,dispatch:e})=>(e(s.update({selection:{anchor:0,head:s.doc.length},userEvent:"select"})),!0),Eb=({state:s,dispatch:e})=>{let t=zr(s).map(({from:n,to:i})=>F.range(n,Math.min(i+1,s.doc.length)));return e(s.update({selection:F.create(t),userEvent:"select"})),!0},Db=({state:s,dispatch:e})=>{let t=Oi(s.selection,n=>{var i;let r=Ot(s).resolveInner(n.head,1);for(;!(r.from=n.to||r.to>n.to&&r.from<=n.from||!(!((i=r.parent)===null||i===void 0)&&i.parent));)r=r.parent;return F.range(r.to,r.from)});return e(gn(s,t)),!0},Ob=({state:s,dispatch:e})=>{let t=s.selection,n=null;return t.ranges.length>1?n=F.create([t.main]):t.main.empty||(n=F.create([F.cursor(t.main.head)])),n?(e(gn(s,n)),!0):!1};function Ir(s,e){if(s.state.readOnly)return!1;let t="delete.selection",{state:n}=s,i=n.changeByRange(r=>{let{from:l,to:o}=r;if(l==o){let a=e(l);al&&(t="delete.forward",a=Hs(s,a,!0)),l=Math.min(l,a),o=Math.max(o,a)}else l=Hs(s,l,!1),o=Hs(s,o,!0);return l==o?{range:r}:{changes:{from:l,to:o},range:F.cursor(l)}});return i.changes.empty?!1:(s.dispatch(n.update(i,{scrollIntoView:!0,userEvent:t,effects:t=="delete.selection"?ce.announce.of(n.phrase("Selection deleted")):void 0})),!0)}function Hs(s,e,t){if(s instanceof ce)for(let n of s.state.facet(ce.atomicRanges).map(i=>i(s)))n.between(e,e,(i,r)=>{ie&&(e=t?r:i)});return e}const Gd=(s,e)=>Ir(s,t=>{let{state:n}=s,i=n.doc.lineAt(t),r,l;if(!e&&t>i.from&&tGd(s,!1),Yd=s=>Gd(s,!0),Xd=(s,e)=>Ir(s,t=>{let n=t,{state:i}=s,r=i.doc.lineAt(n),l=i.charCategorizer(n);for(let o=null;;){if(n==(e?r.to:r.from)){n==t&&r.number!=(e?i.doc.lines:1)&&(n+=e?1:-1);break}let a=Ct(r.text,n-r.from,e)+r.from,h=r.text.slice(Math.min(n,a)-r.from,Math.max(n,a)-r.from),c=l(h);if(o!=null&&c!=o)break;(h!=" "||n!=t)&&(o=c),n=a}return n}),Zd=s=>Xd(s,!1),Pb=s=>Xd(s,!0),Qd=s=>Ir(s,e=>{let t=s.lineBlockAt(e).to;return eIr(s,e=>{let t=s.lineBlockAt(e).from;return e>t?t:Math.max(0,e-1)}),Bb=({state:s,dispatch:e})=>{if(s.readOnly)return!1;let t=s.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:De.of(["",""])},range:F.cursor(n.from)}));return e(s.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},Nb=({state:s,dispatch:e})=>{if(s.readOnly)return!1;let t=s.changeByRange(n=>{if(!n.empty||n.from==0||n.from==s.doc.length)return{range:n};let i=n.from,r=s.doc.lineAt(i),l=i==r.from?i-1:Ct(r.text,i-r.from,!1)+r.from,o=i==r.to?i+1:Ct(r.text,i-r.from,!0)+r.from;return{changes:{from:l,to:o,insert:s.doc.slice(i,o).append(s.doc.slice(l,i))},range:F.cursor(o)}});return t.changes.empty?!1:(e(s.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function zr(s){let e=[],t=-1;for(let n of s.selection.ranges){let i=s.doc.lineAt(n.from),r=s.doc.lineAt(n.to);if(!n.empty&&n.to==r.from&&(r=s.doc.lineAt(n.to-1)),t>=i.number){let l=e[e.length-1];l.to=r.to,l.ranges.push(n)}else e.push({from:i.from,to:r.to,ranges:[n]});t=r.number+1}return e}function ep(s,e,t){if(s.readOnly)return!1;let n=[],i=[];for(let r of zr(s)){if(t?r.to==s.doc.length:r.from==0)continue;let l=s.doc.lineAt(t?r.to+1:r.from-1),o=l.length+1;if(t){n.push({from:r.to,to:l.to},{from:r.from,insert:l.text+s.lineBreak});for(let a of r.ranges)i.push(F.range(Math.min(s.doc.length,a.anchor+o),Math.min(s.doc.length,a.head+o)))}else{n.push({from:l.from,to:r.from},{from:r.to,insert:s.lineBreak+l.text});for(let a of r.ranges)i.push(F.range(a.anchor-o,a.head-o))}}return n.length?(e(s.update({changes:n,scrollIntoView:!0,selection:F.create(i,s.selection.mainIndex),userEvent:"move.line"})),!0):!1}const Lb=({state:s,dispatch:e})=>ep(s,e,!1),Rb=({state:s,dispatch:e})=>ep(s,e,!0);function tp(s,e,t){if(s.readOnly)return!1;let n=[];for(let i of zr(s))t?n.push({from:i.from,insert:s.doc.slice(i.from,i.to)+s.lineBreak}):n.push({from:i.to,insert:s.lineBreak+s.doc.slice(i.from,i.to)});return e(s.update({changes:n,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Ib=({state:s,dispatch:e})=>tp(s,e,!1),zb=({state:s,dispatch:e})=>tp(s,e,!0),jb=s=>{if(s.state.readOnly)return!1;let{state:e}=s,t=e.changes(zr(e).map(({from:i,to:r})=>(i>0?i--:rs.moveVertically(i,!0)).map(t);return s.dispatch({changes:t,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Vb(s,e){if(/\(\)|\[\]|\{\}/.test(s.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=Ot(s).resolveInner(e),n=t.childBefore(e),i=t.childAfter(e),r;return n&&i&&n.to<=e&&i.from>=e&&(r=n.type.prop(ve.closedBy))&&r.indexOf(i.name)>-1&&s.doc.lineAt(n.to).from==s.doc.lineAt(i.from).from?{from:n.to,to:i.from}:null}const Hb=np(!1),Fb=np(!0);function np(s){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(i=>{let{from:r,to:l}=i,o=e.doc.lineAt(r),a=!s&&r==l&&Vb(e,r);s&&(r=l=(l<=o.to?o:e.doc.lineAt(l)).to);let h=new $r(e,{simulateBreak:r,simulateDoubleBreak:!!a}),c=Lo(h,r);for(c==null&&(c=/^\s*/.exec(e.doc.lineAt(r).text)[0].length);lo.from&&r{let i=[];for(let l=n.from;l<=n.to;){let o=s.doc.lineAt(l);o.number>t&&(n.empty||n.to>o.from)&&(e(o,i,n),t=o.number),l=o.to+1}let r=s.changes(i);return{changes:i,range:F.range(r.mapPos(n.anchor,1),r.mapPos(n.head,1))}})}const Wb=({state:s,dispatch:e})=>{if(s.readOnly)return!1;let t=Object.create(null),n=new $r(s,{overrideIndentation:r=>{let l=t[r];return l??-1}}),i=Vo(s,(r,l,o)=>{let a=Lo(n,r.from);if(a==null)return;/\S/.test(r.text)||(a=0);let h=/^\s*/.exec(r.text)[0],c=cs(s,a);(h!=c||o.froms.readOnly?!1:(e(s.update(Vo(s,(t,n)=>{n.push({from:t.from,insert:s.facet(Pr)})}),{userEvent:"input.indent"})),!0),sp=({state:s,dispatch:e})=>s.readOnly?!1:(e(s.update(Vo(s,(t,n)=>{let i=/^\s*/.exec(t.text)[0];if(!i)return;let r=gs(i,s.tabSize),l=0,o=cs(s,Math.max(0,r-mr(s)));for(;l({mac:s.key,run:s.run,shift:s.shift}))),Kb=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:ab,shift:vb},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:hb,shift:yb},{key:"Alt-ArrowUp",run:Lb},{key:"Shift-Alt-ArrowUp",run:Ib},{key:"Alt-ArrowDown",run:Rb},{key:"Shift-Alt-ArrowDown",run:zb},{key:"Escape",run:Ob},{key:"Mod-Enter",run:Fb},{key:"Alt-l",mac:"Ctrl-l",run:Eb},{key:"Mod-i",run:Db,preventDefault:!0},{key:"Mod-[",run:sp},{key:"Mod-]",run:ip},{key:"Mod-Alt-\\",run:Wb},{key:"Shift-Mod-k",run:jb},{key:"Shift-Mod-\\",run:bb},{key:"Mod-/",run:V1},{key:"Alt-A",run:F1}].concat(Ub),Jb={key:"Tab",run:ip,shift:sp};let ft=[],Gb=(s,e)=>{let t,n=[],i={lc:0,l:e||0,value:s,set(r){i.value=r,i.notify()},get(){return i.lc||i.listen(()=>{})(),i.value},notify(r){t=n;let l=!ft.length;for(let o=0;o{n===t&&(n=n.slice());let o=n.indexOf(r);~o&&(n.splice(o,2),i.lc--,i.lc||i.off())}},subscribe(r,l){let o=i.listen(r,l);return r(i.value),o},off(){}};return i},Yb=(s={})=>{let e=Gb(s);return e.setKey=function(t,n){typeof n>"u"?t in e.value&&(e.value={...e.value},delete e.value[t],e.notify(t)):e.value[t]!==n&&(e.value={...e.value,[t]:n},e.notify(t))},e};var Xb=()=>Yb({view:null,extensions:null,value:null}),Zb=(s,e)=>{if(zn(e))throw new Error("No options provided. At least `value` is required.");let{value:t,instanceStore:n,onChangeBehavior:i={kind:"debounce",duration:50}}=e,r,l=new Promise($=>r=$),o,a=[];const h=new Nt,c=new Nt,f=new Nt,u=new Nt,d=new Nt,p=new Nt,g=new Nt,m=new Nt,_=ce.updateListener.of($=>D($));async function v($){return Promise.all([_,p.of(ic($)),g.of(await tc($)),h.of(await Xh($)??[]),Ku.of([...Kb,...$.useTabs?[Jb]:[]]),c.of(await Zh($)),f.of(Qh($)),u.of(await ec($)),d.of(nc($)),m.of(await sc($))])}function E($){const G=o.state.doc.toString();gi(G,t)||(t=G,s.dispatchEvent(new CustomEvent("codemirror:textChange",{detail:t}))),n==null||n.set({value:t,view:o,extensions:a}),s.dispatchEvent(new CustomEvent("codemirror:change",{detail:$}))}const{kind:w="debounce",duration:B=50}=i;let D=w==="debounce"?rc(E,B):lc(E,B);return(async()=>{a=await v(e);const $=ye.create({doc:t,extensions:a,selection:{anchor:e.cursorPos??0,head:e.cursorPos??0}});o=new ce({state:$,parent:s}),zn(e.cursorPos)||o.focus(),r()})(),{async update($){var O,T;await l;const G={};gi(t,$.value)||(t=$.value,G.changes={from:0,to:o.state.doc.length,insert:t}),!zn($.cursorPos)&&!gi(e.cursorPos,$.cursorPos)&&(G.selection={anchor:$.cursorPos??0,head:$.cursorPos??0},o.focus());async function L(Q,ie,J){G.effects=G.effects??[];const fe=G.effects;let z=!0;for(const oe of ie){const ge=$[oe],We=e[oe];if(!zn(ge)&&(z=!1,!gi(ge,We)))return fe.push(Q.reconfigure(await J($)))}z&&fe.push(Q.reconfigure([]))}await Promise.all([L(h,["setup"],Xh),L(c,["lang"],Zh),L(u,["useTabs","tabSize"],ec),L(f,["theme"],Qh),L(p,["extensions"],ic),L(d,["readonly"],nc),L(g,["autocomplete"],tc),L(m,["lint","lintOptions"],sc)]),o.dispatch(G);const{kind:V="debounce",duration:H=50}=$.onChangeBehavior??{kind:"debounce",duration:50};(!gi((O=e.onChangeBehavior)==null?void 0:O.kind,V)||!gi((T=e.onChangeBehavior)==null?void 0:T.duration,H))&&(D=V==="debounce"?rc(E,H):lc(E,H)),e=$,a=await v($)},destroy(){l.then(()=>o==null?void 0:o.destroy())}}};async function Xh(s){const{setup:e}=s;if(zn(e))return[];if(e==="basic")return(await Cn(()=>import("./basic-setup-BJSL5TOQ.52cb615f.js"),["_app/immutable/chunks/basic-setup-BJSL5TOQ.52cb615f.js","_app/immutable/chunks/index.6642cdb8.js","_app/immutable/chunks/index.a4621221.js"])).default(s);if(e==="minimal")return(await Cn(()=>import("./minimal-setup-Y523JPZT.606046c0.js"),[])).default(s);throw new Error("`setup` can only be `basic` or `minimal`. If you wish to provide another setup, pass through `extensions` prop.")}async function Zh({lang:s,langMap:e}){if(zn(s))return[];if(typeof s=="string"){if(!e)throw new Error("`langMap` is required when `lang` is a string.");if(!(s in e))throw new Error(`Language "${s}" is not defined in \`langMap\`.`);return await e[s]()}return s}function Qh({theme:s,styles:e}){return[s,e&&ce.theme(e)].filter(Boolean)}async function ec({useTabs:s=!1,tabSize:e=2}){return[ye.tabSize.of(e),Pr.of(s?" ":" ".repeat(e))]}async function tc({autocomplete:s}){if(zn(s))return[];const{autocompletion:e}=await Cn(()=>import("./index.6642cdb8.js"),[]);return e(typeof s=="object"&&s?s:{})}function nc({readonly:s}){return ye.readOnly.of(!!s)}function ic({extensions:s}){return s??[]}async function sc({lint:s,lintOptions:e={}}){if(zn(s))return[];if(!Qb(s))throw new Error("`lint` must be a function.");const{linter:t}=await Cn(()=>import("./index.a4621221.js").then(n=>n.i),[]);return t(s,e)}var gi=(s,e)=>s===e,zn=s=>typeof s>"u",Qb=s=>typeof s=="function";function rc(s,e,t=!1){let n;return function(...r){const l=this;n?clearTimeout(n):t&&s.apply(l,r),n=setTimeout(o,e||100);function o(){t||s.apply(l,r),n=null}}}function lc(s,e){let t,n=!1;function i(r){if(t){s.apply(r,t),setTimeout(i,e,r),t=null;return}n=!1}return function(...l){const o=this;if(n){t=l;return}s.apply(o,l),n=!0,setTimeout(i,e,o)}}function e_(s){let e;const t=s[7].default,n=Mt(t,s,s[6],null);return{c(){n&&n.c()},l(i){n&&n.l(i)},m(i,r){n&&n.m(i,r),e=!0},p(i,r){n&&n.p&&(!e||r&64)&&Tt(n,t,i,i[6],e?Dt(t,i[6],r,null):Et(i[6]),null)},i(i){e||(S(n,i),e=!0)},o(i){M(n,i),e=!1},d(i){n&&n.d(i)}}}function t_(s){let e,t=s[4](s[1])+"",n,i,r;return{c(){e=A("button"),n=R(t),this.h()},l(l){e=C(l,"BUTTON",{class:!0});var o=P(e);n=I(o,t),o.forEach(b),this.h()},h(){k(e,"class","svelte-1w145fq"),ne(e,"navigable",s[1].filename)},m(l,o){x(l,e,o),y(e,n),i||(r=[ue(e,"click",s[8]),ue(e,"keyup",s[9])],i=!0)},p(l,o){o&2&&t!==(t=l[4](l[1])+"")&&re(n,t),o&2&&ne(e,"navigable",l[1].filename)},i:de,o:de,d(l){l&&b(e),i=!1,Dn(r)}}}function n_(s){let e,t,n,i,r,l;const o=[t_,e_],a=[];function h(c,f){return c[1]?0:1}return t=h(s),n=a[t]=o[t](s),{c(){e=A("div"),n.c(),this.h()},l(c){e=C(c,"DIV",{class:!0});var f=P(e);n.l(f),f.forEach(b),this.h()},h(){k(e,"class",i="message "+s[0]+" svelte-1w145fq"),ne(e,"truncate",s[2])},m(c,f){x(c,e,f),a[t].m(e,null),l=!0},p(c,[f]){let u=t;t=h(c),t===u?a[t].p(c,f):(we(),M(a[u],1,1,()=>{a[u]=null}),Se(),n=a[t],n?n.p(c,f):(n=a[t]=o[t](c),n.c()),S(n,1),n.m(e,null)),(!l||f&1&&i!==(i="message "+c[0]+" svelte-1w145fq"))&&k(e,"class",i),(!l||f&5)&&ne(e,"truncate",c[2])},i(c){l||(S(n),c&&Cr(()=>{l&&(r||(r=oa(e,ha,{duration:100},!0)),r.run(1))}),l=!0)},o(c){M(n),c&&(r||(r=oa(e,ha,{duration:100},!1)),r.run(0)),l=!1},d(c){c&&b(e),a[t].d(),c&&r&&r.end()}}}function i_(s,e,t){let{$$slots:n={},$$scope:i}=e,{kind:r="info"}=e,{details:l=void 0}=e,{filename:o=void 0}=e,{truncate:a=!1}=e;const{go_to_warning_pos:h}=ai();function c(d){let p=d.message||"[missing message]",g=[];return d.filename&&d.filename!==o&&g.push(d.filename),d.start&&g.push(d.start.line,d.start.column),p+(g.length?` (${g.join(":")})`:"")}const f=()=>h(l),u=d=>d.key===" "&&h(l);return s.$$set=d=>{"kind"in d&&t(0,r=d.kind),"details"in d&&t(1,l=d.details),"filename"in d&&t(5,o=d.filename),"truncate"in d&&t(2,a=d.truncate),"$$scope"in d&&t(6,i=d.$$scope)},[r,l,a,h,c,o,i,n,f,u]}class Pi extends _e{constructor(e){super(),ke(this,e,i_,n_,be,{kind:0,details:1,filename:5,truncate:2})}}const s_=ce.theme({"&":{color:"var(--sk-code-base)",backgroundColor:"transparent"},".cm-content":{caretColor:"var(--sk-theme-3)"},".cm-cursor, .cm-dropCursor":{borderLeftColor:"var(--sk-theme-3)"},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"var(--sk-selection-color)"},".cm-panels":{backgroundColor:"var(--sk-back-2)",color:"var(--sk-text-2)"},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"var(--sk-theme-2)"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:"var(--sk-back-3)",border:"none"},".cm-activeLineGutter":{backgroundColor:"var(--sk-back-4)"},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:"var(--sk-back-3)"},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:"var(--sk-back-3)",borderBottomColor:"var(--sk-back-3)"},".cm-tooltip-autocomplete":{color:"var(--sk-text-2) !important",perspective:"1px","& > ul > li[aria-selected]":{backgroundColor:"var(--sk-back-4)",color:"var(--sk-text-1) !important"}}},{dark:!0}),r_=vs.define([{tag:N.keyword,color:"var(--sk-code-keyword)"},{tag:[N.name,N.deleted,N.character,N.propertyName,N.macroName],color:"var(--sk-code-base)"},{tag:[N.function(N.variableName),N.labelName],color:"var(--sk-code-tags)"},{tag:[N.color,N.constant(N.name),N.standard(N.name)],color:"var(--sk-code-base)"},{tag:[N.definition(N.name),N.separator],color:"var(--sk-code-base)"},{tag:[N.typeName,N.className,N.number,N.changed,N.annotation,N.modifier,N.self,N.namespace],color:"var(--sk-code-tags)"},{tag:[N.operator,N.operatorKeyword,N.url,N.escape,N.regexp,N.link,N.special(N.string)],color:"var(--sk-code-base)"},{tag:[N.meta,N.comment],color:"var(--sk-code-comment)"},{tag:N.strong,fontWeight:"bold"},{tag:N.emphasis,fontStyle:"italic"},{tag:N.strikethrough,textDecoration:"line-through"},{tag:N.link,color:"var(--sk-code-base)",textDecoration:"underline"},{tag:N.heading,fontWeight:"bold",color:"var(--sk-text-1)"},{tag:[N.atom,N.bool],color:"var(--sk-code-atom)"},{tag:[N.processingInstruction,N.string,N.inserted],color:"var(--sk-code-string)"},{tag:N.invalid,color:"#ff008c"}]),oc=[s_,C1(r_)];function ac(s){let e,t,n,i,r,l;return r=new Pi({props:{kind:"info",$$slots:{default:[l_]},$$scope:{ctx:s}}}),{c(){e=A("pre"),t=R(s[5]),n=X(),i=A("div"),W(r.$$.fragment),this.h()},l(o){e=C(o,"PRE",{style:!0,class:!0});var a=P(e);t=I(a,s[5]),a.forEach(b),n=Z(o),i=C(o,"DIV",{style:!0});var h=P(i);K(r.$$.fragment,h),h.forEach(b),this.h()},h(){it(e,"position","absolute"),it(e,"left","0"),it(e,"top","0"),k(e,"class","svelte-1s16tri"),it(i,"position","absolute"),it(i,"width","100%"),it(i,"bottom","0")},m(o,a){x(o,e,a),y(e,t),x(o,n,a),x(o,i,a),q(r,i,null),l=!0},p(o,a){(!l||a[0]&32)&&re(t,o[5]);const h={};a[1]&4&&(h.$$scope={dirty:a,ctx:o}),r.$set(h)},i(o){l||(S(r.$$.fragment,o),l=!0)},o(o){M(r.$$.fragment,o),l=!1},d(o){o&&(b(e),b(n),b(i)),U(r)}}}function l_(s){let e;return{c(){e=R("loading editor...")},l(t){e=I(t,"loading editor...")},m(t,n){x(t,e,n)},d(t){t&&b(e)}}}function o_(s){let e,t,n,i,r,l=!s[4].view&&ac(s);return{c(){e=A("div"),l&&l.c(),this.h()},l(o){e=C(o,"DIV",{class:!0});var a=P(e);l&&l.l(a),a.forEach(b),this.h()},h(){k(e,"class","codemirror-container svelte-1s16tri")},m(o,a){x(o,e,a),l&&l.m(e,null),n=!0,i||(r=[Pf(t=Zb.call(null,e,{value:s[5],setup:"basic",useTabs:s[2],tabSize:2,theme:oc,readonly:s[1],cursorPos:s[7],lang:s[6],langMap:{js:hc,json:cc,md:fc,css:uc,svelte:dc},lint:s[0],lintOptions:{delay:200},autocomplete:s[3],extensions:[s[10]],instanceStore:s[9]})),ue(e,"codemirror:textChange",s[25])],i=!0)},p(o,a){o[4].view?l&&(we(),M(l,1,1,()=>{l=null}),Se()):l?(l.p(o,a),a[0]&16&&S(l,1)):(l=ac(o),l.c(),S(l,1),l.m(e,null)),t&&Bf(t.update)&&a[0]&239&&t.update.call(null,{value:o[5],setup:"basic",useTabs:o[2],tabSize:2,theme:oc,readonly:o[1],cursorPos:o[7],lang:o[6],langMap:{js:hc,json:cc,md:fc,css:uc,svelte:dc},lint:o[0],lintOptions:{delay:200},autocomplete:o[3],extensions:[o[10]],instanceStore:o[9]})},i(o){n||(S(l),n=!0)},o(o){M(l),n=!1},d(o){o&&b(e),l&&l.d(),i=!1,Dn(r)}}}const rp=lt(0),hc=()=>Cn(()=>import("./index.187d7fe5.js").then(s=>s.i),["_app/immutable/chunks/index.187d7fe5.js","_app/immutable/chunks/index.c256d31b.js","_app/immutable/chunks/scheduler.6381a9b9.js","_app/immutable/chunks/index.6642cdb8.js"]).then(s=>s.javascript()),cc=()=>Cn(()=>import("./index.9718953a.js"),["_app/immutable/chunks/index.9718953a.js","_app/immutable/chunks/index.c256d31b.js","_app/immutable/chunks/scheduler.6381a9b9.js"]).then(s=>s.json()),fc=()=>Cn(()=>import("./index.554bb5dd.js"),["_app/immutable/chunks/index.554bb5dd.js","_app/immutable/chunks/index.6642cdb8.js","_app/immutable/chunks/index.e05b4548.js","_app/immutable/chunks/index.c256d31b.js","_app/immutable/chunks/scheduler.6381a9b9.js","_app/immutable/chunks/index.2e2743a9.js","_app/immutable/chunks/index.187d7fe5.js"]).then(s=>s.markdown()),uc=()=>Cn(()=>import("./index.2e2743a9.js"),["_app/immutable/chunks/index.2e2743a9.js","_app/immutable/chunks/index.c256d31b.js","_app/immutable/chunks/scheduler.6381a9b9.js"]).then(s=>s.css()),dc=()=>Cn(()=>import("./index.a9117787.js"),["_app/immutable/chunks/index.a9117787.js","_app/immutable/chunks/index.c256d31b.js","_app/immutable/chunks/scheduler.6381a9b9.js","_app/immutable/chunks/index.2e2743a9.js","_app/immutable/chunks/index.187d7fe5.js","_app/immutable/chunks/index.6642cdb8.js","_app/immutable/chunks/index.e05b4548.js"]).then(s=>s.svelte());function a_(s,e,t){let n,{errorLoc:i=null}=e,{diagnostics:r=void 0}=e,{readonly:l=!1}=e,{tab:o=!0}=e,{autocomplete:a=!0}=e;const h=Mr();let c="",f="svelte";async function u(z){d(z)}async function d(z){if(n.view&&(await ns(),z.lang&&z.lang!==f&&t(6,f=z.lang),z.code!==void 0)){const{scrollLeft:oe,scrollTop:ge}=n.view.scrollDOM;t(5,c=z.code),ze(V,n.view.scrollDOM.scrollTop=ge,n),ze(V,n.view.scrollDOM.scrollLeft=oe,n)}}function p(z){t(7,ie=z)}let g;const m=new Promise(z=>t(23,g=z));function _(){var z;(z=n.view)==null||z.requestMeasure()}function v(){var z;(z=n.view)==null||z.focus()}function E(){var z;return(z=n.view)==null?void 0:z.state.toJSON({history:Fh})}function w(z){var oe;n.view&&(n.view.setState(ye.fromJSON(z,{extensions:Q,doc:z.doc},{history:Fh})),(oe=n.view)==null||oe.dispatch({changes:{from:0,to:n.view.state.doc.length,insert:z.doc},effects:[Pe.reconfigure.of(n.extensions??[])]}))}async function B(){var z,oe;await ns(),(z=n.view)==null||z.setState(ye.create({extensions:Q,doc:""})),(oe=n.view)==null||oe.dispatch({changes:{from:0,to:n.view.state.doc.length,insert:""},effects:[Pe.reconfigure.of(n.extensions??[])]})}const D=Pe.define(),$=Pt.define({create(){return Re.none},update(z,oe){z=z.map(oe.changes);for(let ge of oe.effects)ge.is(D)&&(z=z.update({add:ge.value,sort:!0}));return z},provide:z=>ce.decorations.from(z)});function G({from:z,to:oe,className:ge="mark-text"}){var Ee;const We=Re.mark({class:ge});(Ee=n.view)==null||Ee.dispatch({effects:[Pe.appendConfig.of($),D.of([We.range(z,oe)])]})}function L(){var z;(z=n.view)==null||z.dispatch({effects:Pe.reconfigure.of(n.extensions??[])})}const V=Xb();Ce(s,V,z=>t(4,n=z));let H,O,T=!1,Q=[],ie=0;const J=ce.updateListener.of(z=>{z.selectionSet&&rp.set(z.state.selection.main.head)}),fe=({detail:z})=>{t(5,c=z),h("change",{value:c})};return s.$$set=z=>{"errorLoc"in z&&t(11,i=z.errorLoc),"diagnostics"in z&&t(0,r=z.diagnostics),"readonly"in z&&t(1,l=z.readonly),"tab"in z&&t(2,o=z.tab),"autocomplete"in z&&t(3,a=z.autocomplete)},s.$$.update=()=>{s.$$.dirty[0]&8388624&&n.view&&g(),s.$$.dirty[0]&16&&n.view&&H&&O&&_(),s.$$.dirty[0]&16779264&&i&&(G({from:i.character,to:i.character+1,className:"error-loc"}),i.line)},[r,l,o,a,n,c,f,ie,h,V,J,i,u,d,p,m,_,v,E,w,B,G,L,g,T,fe]}class jr extends _e{constructor(e){super(),ke(this,e,a_,o_,be,{errorLoc:11,diagnostics:0,readonly:1,tab:2,autocomplete:3,set:12,update:13,setCursor:14,isReady:15,resize:16,focus:17,getEditorState:18,setEditorState:19,clearEditorState:20,markText:21,unmarkText:22},null,[-1,-1])}get set(){return this.$$.ctx[12]}get update(){return this.$$.ctx[13]}get setCursor(){return this.$$.ctx[14]}get isReady(){return this.$$.ctx[15]}get resize(){return this.$$.ctx[16]}get focus(){return this.$$.ctx[17]}get getEditorState(){return this.$$.ctx[18]}get setEditorState(){return this.$$.ctx[19]}get clearEditorState(){return this.$$.ctx[20]}get markText(){return this.$$.ctx[21]}get unmarkText(){return this.$$.ctx[22]}}function pc(s,e,t){const n=s.slice();return n[17]=e[t],n}function h_(s){let e,t,n=Te(s[3]),i=[];for(let l=0;lM(i[l],1,1,()=>{i[l]=null});return{c(){for(let l=0;l0?1:-1}return~(l=u(s))&&(o=f[l]=c[l](s)),{c(){e=A("div"),t=A("div"),W(n.$$.fragment),i=X(),r=A("div"),o&&o.c(),this.h()},l(d){e=C(d,"DIV",{class:!0});var p=P(e);t=C(p,"DIV",{class:!0,translate:!0});var g=P(t);K(n.$$.fragment,g),g.forEach(b),i=Z(p),r=C(p,"DIV",{class:!0});var m=P(r);o&&o.l(m),m.forEach(b),p.forEach(b),this.h()},h(){k(t,"class","editor notranslate svelte-62nfk2"),k(t,"translate","no"),k(r,"class","info svelte-62nfk2"),k(e,"class","editor-wrapper svelte-62nfk2")},m(d,p){x(d,e,p),y(e,t),q(n,t,null),y(e,i),y(e,r),~l&&f[l].m(r,null),a=!0},p(d,[p]){const g={};p&1&&(g.errorLoc=d[0]),p&2&&(g.autocomplete=d[1]),n.$set(g);let m=l;l=u(d),l===m?~l&&f[l].p(d,p):(o&&(we(),M(f[m],1,1,()=>{f[m]=null}),Se()),~l?(o=f[l],o?o.p(d,p):(o=f[l]=c[l](d),o.c()),S(o,1),o.m(r,null)):o=null)},i(d){a||(S(n.$$.fragment,d),S(o),a=!0)},o(d){M(n.$$.fragment,d),M(o),a=!1},d(d){d&&b(e),s[15](null),U(n),~l&&f[l].d()}}}function u_(s,e,t){let n,i,r,l,o,{errorLoc:a=null}=e,{autocomplete:h}=e;function c(){o==null||o.focus()}const{bundle:f,handle_change:u,module_editor:d,selected:p,bundling:g}=ai();Ce(s,f,w=>t(14,l=w)),Ce(s,d,w=>t(5,o=w)),Ce(s,p,w=>t(13,i=w)),Ce(s,g,w=>t(16,r=w));let m=null,_=[];async function v(){return await r,[...i&&(m==null?void 0:m.filename)===Be(i)?[{from:m.start.character,to:m.end.character,severity:"error",message:m.message}]:[],..._.filter(w=>i&&w.filename===Be(i)).map(w=>({from:w.start.character,to:w.end.character,severity:"warning",message:w.message}))]}function E(w){Xe[w?"unshift":"push"](()=>{o=w,d.set(o)})}return s.$$set=w=>{"errorLoc"in w&&t(0,a=w.errorLoc),"autocomplete"in w&&t(1,h=w.autocomplete)},s.$$.update=()=>{s.$$.dirty&8192&&t(4,n=(i==null?void 0:i.name)+"."+(i==null?void 0:i.type)),s.$$.dirty&16384&&l&&(t(2,m=l==null?void 0:l.error),t(3,_=(l==null?void 0:l.warnings)??[]))},[a,h,m,_,n,o,f,u,d,p,g,v,c,i,l,E]}class d_ extends _e{constructor(e){super(),ke(this,e,u_,f_,be,{errorLoc:0,autocomplete:1,focus:12})}get focus(){return this.$$.ctx[12]}}function p_(s){let e,t,n;return{c(){e=A("input"),this.h()},l(i){e=C(i,"INPUT",{type:!0,class:!0}),this.h()},h(){k(e,"type","checkbox"),k(e,"class","svelte-1ja98dc")},m(i,r){x(i,e,r),e.checked=s[0],t||(n=ue(e,"change",s[1]),t=!0)},p(i,[r]){r&1&&(e.checked=i[0])},i:de,o:de,d(i){i&&b(e),t=!1,n()}}}function g_(s,e,t){let{checked:n=!1}=e;function i(){n=this.checked,t(0,n)}return s.$$set=r=>{"checked"in r&&t(0,n=r.checked)},[n,i]}class mi extends _e{constructor(e){super(),ke(this,e,g_,p_,be,{checked:0})}}function m_(s){let e,t,n="input",i,r,l,o,a,h,c="output",f;function u(p){s[1](p)}let d={};return s[0]!==void 0&&(d.checked=s[0]),l=new mi({props:d}),Xe.push(()=>ln(l,"checked",u)),{c(){e=A("label"),t=A("span"),t.textContent=n,i=X(),r=A("span"),W(l.$$.fragment),a=X(),h=A("span"),h.textContent=c,this.h()},l(p){e=C(p,"LABEL",{class:!0});var g=P(e);t=C(g,"SPAN",{style:!0,class:!0,"data-svelte-h":!0}),Me(t)!=="svelte-iwcvz2"&&(t.textContent=n),i=Z(g),r=C(g,"SPAN",{style:!0,class:!0});var m=P(r);K(l.$$.fragment,m),m.forEach(b),a=Z(g),h=C(g,"SPAN",{class:!0,"data-svelte-h":!0}),Me(h)!=="svelte-4pjs0t"&&(h.textContent=c),g.forEach(b),this.h()},h(){it(t,"text-align","right"),k(t,"class","svelte-l6oyfu"),ne(t,"active",!s[0]),it(r,"display","grid"),it(r,"place-items","center"),k(r,"class","svelte-l6oyfu"),k(h,"class","svelte-l6oyfu"),ne(h,"active",s[0]),k(e,"class","input-output-toggle svelte-l6oyfu")},m(p,g){x(p,e,g),y(e,t),y(e,i),y(e,r),q(l,r,null),y(e,a),y(e,h),f=!0},p(p,[g]){(!f||g&1)&&ne(t,"active",!p[0]);const m={};!o&&g&1&&(o=!0,m.checked=p[0],rn(()=>o=!1)),l.$set(m),(!f||g&1)&&ne(h,"active",p[0])},i(p){f||(S(l.$$.fragment,p),f=!0)},o(p){M(l.$$.fragment,p),f=!1},d(p){p&&b(e),U(l)}}}function b_(s,e,t){let{checked:n=!1}=e;function i(r){n=r,t(0,n)}return s.$$set=r=>{"checked"in r&&t(0,n=r.checked)},[n,i]}class __ extends _e{constructor(e){super(),ke(this,e,b_,m_,be,{checked:0})}}function Ho(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let Kn=Ho();function lp(s){Kn=s}const op=/[&<>"']/,k_=new RegExp(op.source,"g"),ap=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,v_=new RegExp(ap.source,"g"),y_={"&":"&","<":"<",">":">",'"':""","'":"'"},mc=s=>y_[s];function ot(s,e){if(e){if(op.test(s))return s.replace(k_,mc)}else if(ap.test(s))return s.replace(v_,mc);return s}const w_=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function hp(s){return s.replace(w_,(e,t)=>(t=t.toLowerCase(),t==="colon"?":":t.charAt(0)==="#"?t.charAt(1)==="x"?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const S_=/(^|[^\[])\^/g;function $e(s,e){s=typeof s=="string"?s:s.source,e=e||"";const t={replace:(n,i)=>(i=i.source||i,i=i.replace(S_,"$1"),s=s.replace(n,i),t),getRegex:()=>new RegExp(s,e)};return t}const x_=/[^\w:]/g,A_=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function bc(s,e,t){if(s){let n;try{n=decodeURIComponent(hp(t)).replace(x_,"").toLowerCase()}catch{return null}if(n.indexOf("javascript:")===0||n.indexOf("vbscript:")===0||n.indexOf("data:")===0)return null}e&&!A_.test(t)&&(t=E_(e,t));try{t=encodeURI(t).replace(/%25/g,"%")}catch{return null}return t}const Fs={},C_=/^[^:]+:\/*[^/]*$/,M_=/^([^:]+:)[\s\S]*$/,T_=/^([^:]+:\/*[^/]*)[\s\S]*$/;function E_(s,e){Fs[" "+s]||(C_.test(s)?Fs[" "+s]=s+"/":Fs[" "+s]=er(s,"/",!0)),s=Fs[" "+s];const t=s.indexOf(":")===-1;return e.substring(0,2)==="//"?t?e:s.replace(M_,"$1")+e:e.charAt(0)==="/"?t?e:s.replace(T_,"$1")+e:s+e}const vr={exec:function(){}};function _c(s,e){const t=s.replace(/\|/g,(r,l,o)=>{let a=!1,h=l;for(;--h>=0&&o[h]==="\\";)a=!a;return a?"|":" |"}),n=t.split(/ \|/);let i=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>e)n.splice(e);else for(;n.length{let{doc:i}=t.state,r=Xi(e[0],0);if(r==9){let l=i.lineAt(n),o=t.state.tabSize,a=gs(l.text,o,n-l.from);return Re.replace({widget:new a0((o-a%o)*this.view.defaultCharacterWidth)})}return this.decorationCache[r]||(this.decorationCache[r]=Re.replace({widget:new o0(s,r)}))},boundary:s.replaceTabs?void 0:/[^]/})}update(s){let e=s.state.facet(Xs);s.startState.facet(Xs)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(s.view)):this.decorations=this.decorator.updateDeco(s,this.decorations)}},{decorations:s=>s.decorations}))}const r0="•";function l0(s){return s>=32?r0:s==10?"␤":String.fromCharCode(9216+s)}class o0 extends Di{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=l0(this.code),n=e.state.phrase("Control character")+" "+(n0[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,n,t);if(i)return i;let r=document.createElement("span");return r.textContent=t,r.title=n,r.setAttribute("aria-label",n),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class a0 extends Di{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function zw(){return c0}const h0=Re.line({class:"cm-activeLine"}),c0=ht.fromClass(class{constructor(s){this.decorations=this.getDeco(s)}update(s){(s.docChanged||s.selectionSet)&&(this.decorations=this.getDeco(s.view))}getDeco(s){let e=-1,t=[];for(let n of s.state.selection.ranges){let i=s.lineBlockAt(n.head);i.from>e&&(t.push(h0.range(i.from)),e=i.from)}return Re.set(t)}},{decorations:s=>s.decorations}),so=2e3;function f0(s,e,t){let n=Math.min(e.line,t.line),i=Math.max(e.line,t.line),r=[];if(e.off>so||t.off>so||e.col<0||t.col<0){let l=Math.min(e.off,t.off),o=Math.max(e.off,t.off);for(let a=n;a<=i;a++){let h=s.doc.line(a);h.length<=o&&r.push(F.range(h.from+l,h.to+o))}}else{let l=Math.min(e.col,t.col),o=Math.max(e.col,t.col);for(let a=n;a<=i;a++){let h=s.doc.line(a),c=Rl(h.text,l,s.tabSize,!0);if(c<0)r.push(F.cursor(h.to));else{let f=Rl(h.text,o,s.tabSize);r.push(F.range(h.from+c,h.from+f))}}}return r}function u0(s,e){let t=s.coordsAtPos(s.viewport.from);return t?Math.round(Math.abs((t.left-e)/s.defaultCharacterWidth)):-1}function vh(s,e){let t=s.posAtCoords({x:e.clientX,y:e.clientY},!1),n=s.state.doc.lineAt(t),i=t-n.from,r=i>so?-1:i==n.length?u0(s,e.clientX):gs(n.text,s.state.tabSize,t-n.from);return{line:n.number,col:r,off:i}}function d0(s,e){let t=vh(s,e),n=s.state.selection;return t?{update(i){if(i.docChanged){let r=i.changes.mapPos(i.startState.doc.line(t.line).from),l=i.state.doc.lineAt(r);t={line:l.number,col:t.col,off:Math.min(t.off,l.length)},n=n.map(i.changes)}},get(i,r,l){let o=vh(s,i);if(!o)return n;let a=f0(s.state,t,o);return a.length?l?F.create(a.concat(n.ranges)):F.create(a):n}}:null}function jw(s){let e=(s==null?void 0:s.eventFilter)||(t=>t.altKey&&t.button==0);return ce.mouseSelectionStyle.of((t,n)=>e(n)?d0(t,n):null)}const p0={Alt:[18,s=>!!s.altKey],Control:[17,s=>!!s.ctrlKey],Shift:[16,s=>!!s.shiftKey],Meta:[91,s=>!!s.metaKey]},g0={style:"cursor: crosshair"};function Vw(s={}){let[e,t]=p0[s.key||"Alt"],n=ht.fromClass(class{constructor(i){this.view=i,this.isDown=!1}set(i){this.isDown!=i&&(this.isDown=i,this.view.update([]))}},{eventHandlers:{keydown(i){this.set(i.keyCode==e||t(i))},keyup(i){(i.keyCode==e||!t(i))&&this.set(!1)},mousemove(i){this.set(t(i))}}});return[n,ce.contentAttributes.of(i=>{var r;return!((r=i.plugin(n))===null||r===void 0)&&r.isDown?g0:null})]}const Ls="-10000px";class nd{constructor(e,t,n){this.facet=t,this.createTooltipView=n,this.input=e.state.facet(t),this.tooltips=this.input.filter(i=>i),this.tooltipViews=this.tooltips.map(n)}update(e){var t;let n=e.state.facet(this.facet),i=n.filter(l=>l);if(n===this.input){for(let l of this.tooltipViews)l.update&&l.update(e);return!1}let r=[];for(let l=0;l{var e,t,n;return{position:se.ios?"absolute":((e=s.find(i=>i.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=s.find(i=>i.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((n=s.find(i=>i.tooltipSpace))===null||n===void 0?void 0:n.tooltipSpace)||m0}}}),yh=new WeakMap,id=ht.fromClass(class{constructor(s){this.view=s,this.inView=!0,this.lastTransaction=0,this.measureTimeout=-1;let e=s.state.facet(gl);this.position=e.position,this.parent=e.parent,this.classes=s.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.manager=new nd(s,sd,t=>this.createTooltip(t)),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),s.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let s of this.manager.tooltipViews)this.intersectionObserver.observe(s.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(s){s.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(s);e&&this.observeIntersection();let t=e||s.geometryChanged,n=s.state.facet(gl);if(n.position!=this.position){this.position=n.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;t=!0}if(n.parent!=this.parent){this.parent&&this.container.remove(),this.parent=n.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(s){let e=s.create(this.view);if(e.dom.classList.add("cm-tooltip"),s.arrow&&!e.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let t=document.createElement("div");t.className="cm-tooltip-arrow",e.dom.appendChild(t)}return e.dom.style.position=this.position,e.dom.style.top=Ls,this.container.appendChild(e.dom),e.mount&&e.mount(this.view),e}destroy(){var s,e;this.view.win.removeEventListener("resize",this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),(s=t.destroy)===null||s===void 0||s.call(t);(e=this.intersectionObserver)===null||e===void 0||e.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let s=this.view.dom.getBoundingClientRect();return{editor:s,parent:this.parent?this.container.getBoundingClientRect():s,pos:this.manager.tooltips.map((e,t)=>{let n=this.manager.tooltipViews[t];return n.getCoords?n.getCoords(e.pos):this.view.coordsAtPos(e.pos)}),size:this.manager.tooltipViews.map(({dom:e})=>e.getBoundingClientRect()),space:this.view.state.facet(gl).tooltipSpace(this.view)}}writeMeasure(s){var e;let{editor:t,space:n}=s,i=[];for(let r=0;r=Math.min(t.bottom,n.bottom)||h.rightMath.min(t.right,n.right)+.1){a.style.top=Ls;continue}let f=l.arrow?o.dom.querySelector(".cm-tooltip-arrow"):null,u=f?7:0,d=c.right-c.left,p=(e=yh.get(o))!==null&&e!==void 0?e:c.bottom-c.top,g=o.offset||_0,m=this.view.textDirection==Ue.LTR,_=c.width>n.right-n.left?m?n.left:n.right-c.width:m?Math.min(h.left-(f?14:0)+g.x,n.right-d):Math.max(n.left,h.left-d+(f?14:0)-g.x),v=!!l.above;!l.strictSide&&(v?h.top-(c.bottom-c.top)-g.yn.bottom)&&v==n.bottom-h.bottom>h.top-n.top&&(v=!v);let E=(v?h.top-n.top:n.bottom-h.bottom)-u;if(E_&&D.topw&&(w=v?D.top-p-2-u:D.bottom+u+2);this.position=="absolute"?(a.style.top=w-s.parent.top+"px",a.style.left=_-s.parent.left+"px"):(a.style.top=w+"px",a.style.left=_+"px"),f&&(f.style.left=`${h.left+(m?g.x:-g.x)-(_+14-7)}px`),o.overlap!==!0&&i.push({left:_,top:w,right:B,bottom:w+p}),a.classList.toggle("cm-tooltip-above",v),a.classList.toggle("cm-tooltip-below",!v),o.positioned&&o.positioned(s.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let s of this.manager.tooltipViews)s.dom.style.top=Ls}},{eventHandlers:{scroll(){this.maybeMeasure()}}}),b0=ce.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),_0={x:0,y:0},sd=le.define({enables:[id,b0]}),cr=le.define();class Po{constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new nd(e,cr,t=>this.createHostedView(t))}static create(e){return new Po(e)}createHostedView(e){let t=e.create(this.view);return t.dom.classList.add("cm-tooltip-section"),this.dom.appendChild(t.dom),this.mounted&&t.mount&&t.mount(this.view),t}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}}const k0=sd.compute([cr],s=>{let e=s.facet(cr).filter(t=>t);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.filter(t=>t.end!=null).map(t=>t.end)),create:Po.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class v0{constructor(e,t,n,i,r){this.view=e,this.source=t,this.field=n,this.setHover=i,this.hoverTime=r,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active)return;let e=Date.now()-this.lastMove.time;en.bottom||e.xn.right+this.view.defaultCharacterWidth)return;let i=this.view.bidiSpans(this.view.state.doc.lineAt(t)).find(o=>o.from<=t&&o.to>=t),r=i&&i.dir==Ue.RTL?-1:1,l=this.source(this.view,t,e.x{this.pending==o&&(this.pending=null,a&&this.view.dispatch({effects:this.setHover.of(a)}))},a=>xn(this.view.state,a,"hover tooltip"))}else l&&this.view.dispatch({effects:this.setHover.of(l)})}mousemove(e){var t;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let n=this.active;if(n&&!wh(this.lastMove.target)||this.pending){let{pos:i}=n||this.pending,r=(t=n==null?void 0:n.end)!==null&&t!==void 0?t:i;(i==r?this.view.posAtCoords(this.lastMove)!=i:!y0(this.view,i,r,e.clientX,e.clientY,6))&&(this.view.dispatch({effects:this.setHover.of(null)}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1,this.active&&!wh(e.relatedTarget)&&this.view.dispatch({effects:this.setHover.of(null)})}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}function wh(s){for(let e=s;e;e=e.parentNode)if(e.nodeType==1&&e.classList.contains("cm-tooltip"))return!0;return!1}function y0(s,e,t,n,i,r){let l=document.createRange(),o=s.domAtPos(e),a=s.domAtPos(t);l.setEnd(a.node,a.offset),l.setStart(o.node,o.offset);let h=l.getClientRects();l.detach();for(let c=0;ccr.from(i)});return[n,ht.define(i=>new v0(i,s,n,t,e.hoverTime||300)),k0]}function Fw(s,e){let t=s.plugin(id);if(!t)return null;let n=t.manager.tooltips.indexOf(e);return n<0?null:t.manager.tooltipViews[n]}const w0=Pe.define(),Sh=le.define({combine(s){let e,t;for(let n of s)e=e||n.topContainer,t=t||n.bottomContainer;return{topContainer:e,bottomContainer:t}}});function Ww(s,e){let t=s.plugin(rd),n=t?t.specs.indexOf(e):-1;return n>-1?t.panels[n]:null}const rd=ht.fromClass(class{constructor(s){this.input=s.state.facet(Ah),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(s));let e=s.state.facet(Sh);this.top=new Rs(s,!0,e.topContainer),this.bottom=new Rs(s,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(s){let e=s.state.facet(Sh);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Rs(s.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Rs(s.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=s.state.facet(Ah);if(t!=this.input){let n=t.filter(a=>a),i=[],r=[],l=[],o=[];for(let a of n){let h=this.specs.indexOf(a),c;h<0?(c=a(s.view),o.push(c)):(c=this.panels[h],c.update&&c.update(s)),i.push(c),(c.top?r:l).push(c)}this.specs=n,this.panels=i,this.top.sync(r),this.bottom.sync(l);for(let a of o)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let n of this.panels)n.update&&n.update(s)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:s=>ce.scrollMargins.of(e=>{let t=e.plugin(s);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class Rs{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=xh(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=xh(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function xh(s){let e=s.nextSibling;return s.remove(),e}const Ah=le.define({enables:rd});class En extends xi{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}En.prototype.elementClass="";En.prototype.toDOM=void 0;En.prototype.mapMode=bt.TrackBefore;En.prototype.startSide=En.prototype.endSide=-1;En.prototype.point=!0;const Zs=le.define(),S0={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Ne.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},es=le.define();function x0(s){return[ld(),es.of(Object.assign(Object.assign({},S0),s))]}const ro=le.define({combine:s=>s.some(e=>e)});function ld(s){let e=[A0];return s&&s.fixed===!1&&e.push(ro.of(!0)),e}const A0=ht.fromClass(class{constructor(s){this.view=s,this.prevViewport=s.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight+"px",this.gutters=s.state.facet(es).map(e=>new Mh(s,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!s.state.facet(ro),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),s.scrollDOM.insertBefore(this.dom,s.contentDOM)}update(s){if(this.updateGutters(s)){let e=this.prevViewport,t=s.view.viewport,n=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(n<(t.to-t.from)*.8)}s.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight+"px"),this.view.state.facet(ro)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=s.view.viewport}syncGutters(s){let e=this.dom.nextSibling;s&&this.dom.remove();let t=Ne.iter(this.view.state.facet(Zs),this.view.viewport.from),n=[],i=this.gutters.map(r=>new C0(r,this.view.viewport,-this.view.documentPadding.top));for(let r of this.view.viewportLineBlocks)if(n.length&&(n=[]),Array.isArray(r.type)){let l=!0;for(let o of r.type)if(o.type==Fe.Text&&l){lo(t,n,o.from);for(let a of i)a.line(this.view,o,n);l=!1}else if(o.widget)for(let a of i)a.widget(this.view,o)}else if(r.type==Fe.Text){lo(t,n,r.from);for(let l of i)l.line(this.view,r,n)}for(let r of i)r.finish();s&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(s){let e=s.startState.facet(es),t=s.state.facet(es),n=s.docChanged||s.heightChanged||s.viewportChanged||!Ne.eq(s.startState.facet(Zs),s.state.facet(Zs),s.view.viewport.from,s.view.viewport.to);if(e==t)for(let i of this.gutters)i.update(s)&&(n=!0);else{n=!0;let i=[];for(let r of t){let l=e.indexOf(r);l<0?i.push(new Mh(this.view,r)):(this.gutters[l].update(s),i.push(this.gutters[l]))}for(let r of this.gutters)r.dom.remove(),i.indexOf(r)<0&&r.destroy();for(let r of i)this.dom.appendChild(r.dom);this.gutters=i}return n}destroy(){for(let s of this.gutters)s.destroy();this.dom.remove()}},{provide:s=>ce.scrollMargins.of(e=>{let t=e.plugin(s);return!t||t.gutters.length==0||!t.fixed?null:e.textDirection==Ue.LTR?{left:t.dom.offsetWidth}:{right:t.dom.offsetWidth}})});function Ch(s){return Array.isArray(s)?s:[s]}function lo(s,e,t){for(;s.value&&s.from<=t;)s.from==t&&e.push(s.value),s.next()}class C0{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=Ne.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:i}=this,r=t.top-this.height;if(this.i==i.elements.length){let l=new od(e,t.height,r,n);i.elements.push(l),i.dom.appendChild(l.dom)}else i.elements[this.i].update(e,t.height,r,n);this.height=t.bottom,this.i++}line(e,t,n){let i=[];lo(this.cursor,i,t.from),n.length&&(i=i.concat(n));let r=this.gutter.config.lineMarker(e,t,i);r&&i.unshift(r);let l=this.gutter;i.length==0&&!l.config.renderEmptyElements||this.addElement(e,t,i)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t);n&&this.addElement(e,t,[n])}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class Mh{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let n in t.domEventHandlers)this.dom.addEventListener(n,i=>{let r=i.target,l;if(r!=this.dom&&this.dom.contains(r)){for(;r.parentNode!=this.dom;)r=r.parentNode;let a=r.getBoundingClientRect();l=(a.top+a.bottom)/2}else l=i.clientY;let o=e.lineBlockAtHeight(l-e.documentTop);t.domEventHandlers[n](e,o,i)&&i.preventDefault()});this.markers=Ch(t.markers(e)),t.initialSpacer&&(this.spacer=new od(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=Ch(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let n=e.view.viewport;return!Ne.eq(this.markers,t,n.from,n.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class od{constructor(e,t,n,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,n,i)}update(e,t,n,i){this.height!=t&&(this.dom.style.height=(this.height=t)+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),M0(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,t){let n="cm-gutterElement",i=this.dom.firstChild;for(let r=0,l=0;;){let o=l,a=rr(o,a,h)||l(o,a,h):l}return n}})}});class ml extends En{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function bl(s,e){return s.state.facet(_i).formatNumber(e,s.state)}const E0=es.compute([_i],s=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(T0)},lineMarker(e,t,n){return n.some(i=>i.toDOM)?null:new ml(bl(e,e.state.doc.lineAt(t.from).number))},widgetMarker:()=>null,lineMarkerChange:e=>e.startState.facet(_i)!=e.state.facet(_i),initialSpacer(e){return new ml(bl(e,Th(e.state.doc.lines)))},updateSpacer(e,t){let n=bl(t.view,Th(t.view.state.doc.lines));return n==e.number?e:new ml(n)},domEventHandlers:s.facet(_i).domEventHandlers}));function qw(s={}){return[_i.of(s),ld(),E0]}function Th(s){let e=9;for(;e{let e=[],t=-1;for(let n of s.selection.ranges){let i=s.doc.lineAt(n.head).from;i>t&&(t=i,e.push(D0.range(i)))}return Ne.of(e)});function Uw(){return O0}const P0=1024;let $0=0;class Lt{constructor(e,t){this.from=e,this.to=t}}class ve{constructor(e={}){this.id=$0++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=vt.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}}ve.closedBy=new ve({deserialize:s=>s.split(" ")});ve.openedBy=new ve({deserialize:s=>s.split(" ")});ve.group=new ve({deserialize:s=>s.split(" ")});ve.contextHash=new ve({perNode:!0});ve.lookAhead=new ve({perNode:!0});ve.mounted=new ve({perNode:!0});class B0{constructor(e,t,n){this.tree=e,this.overlay=t,this.parser=n}}const N0=Object.create(null);class vt{constructor(e,t,n,i=0){this.name=e,this.props=t,this.id=n,this.flags=i}static define(e){let t=e.props&&e.props.length?Object.create(null):N0,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new vt(e.name||"",t,e.id,n);if(e.props){for(let r of e.props)if(Array.isArray(r)||(r=r(i)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[r[0].id]=r[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(ve.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let i of n.split(" "))t[i]=e[n];return n=>{for(let i=n.prop(ve.group),r=-1;r<(i?i.length:0);r++){let l=t[r<0?n.name:i[r]];if(l)return l}}}}vt.none=new vt("",Object.create(null),0,8);class ad{constructor(e){this.types=e;for(let t=0;t0;for(let a=this.cursor(l|He.IncludeAnonymous);;){let h=!1;if(a.from<=r&&a.to>=i&&(!o&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;h=!0}for(;h&&n&&(o||!a.type.isAnonymous)&&n(a),!a.nextSibling();){if(!a.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:No(vt.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,i)=>new Qe(this.type,t,n,i,this.propValues),e.makeTree||((t,n,i)=>new Qe(vt.none,t,n,i)))}static build(e){return R0(e)}}Qe.empty=new Qe(vt.none,[],[],0);class $o{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new $o(this.buffer,this.index)}}class hi{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return vt.none}toString(){let e=[];for(let t=0;t0));a=l[a+3]);return o}slice(e,t,n){let i=this.buffer,r=new Uint16Array(t-e),l=0;for(let o=e,a=0;o=e&&te;case 1:return t<=e&&n>e;case 2:return n>e;case 4:return!0}}function cd(s,e){let t=s.childBefore(e);for(;t;){let n=t.lastChild;if(!n||n.to!=t.to)break;n.type.isError&&n.from==n.to?(s=t,t=n.prevSibling):t=n}return s}function Mi(s,e,t,n){for(var i;s.from==s.to||(t<1?s.from>=e:s.from>e)||(t>-1?s.to<=e:s.to0?o.length:-1;e!=h;e+=t){let c=o[e],f=a[e]+l.from;if(hd(i,n,f,f+c.length)){if(c instanceof hi){if(r&He.ExcludeBuffers)continue;let u=c.findChild(0,c.buffer.length,t,n-f,i);if(u>-1)return new hn(new L0(l,c,e,f),null,u)}else if(r&He.IncludeAnonymous||!c.type.isAnonymous||Bo(c)){let u;if(!(r&He.IgnoreMounts)&&c.props&&(u=c.prop(ve.mounted))&&!u.overlay)return new zt(u.tree,f,e,l);let d=new zt(c,f,e,l);return r&He.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(t<0?c.children.length-1:0,t,n,i)}}}if(r&He.IncludeAnonymous||!l.type.isAnonymous||(l.index>=0?e=l.index+t:e=t<0?-1:l._parent._tree.children.length,l=l._parent,!l))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,n=0){let i;if(!(n&He.IgnoreOverlays)&&(i=this._tree.prop(ve.mounted))&&i.overlay){let r=e-this.from;for(let{from:l,to:o}of i.overlay)if((t>0?l<=r:l=r:o>r))return new zt(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}cursor(e=0){return new hs(this,e)}get tree(){return this._tree}toTree(){return this._tree}resolve(e,t=0){return Mi(this,e,t,!1)}resolveInner(e,t=0){return Mi(this,e,t,!0)}enterUnfinishedNodesBefore(e){return cd(this,e)}getChild(e,t=null,n=null){let i=fr(this,e,t,n);return i.length?i[0]:null}getChildren(e,t=null,n=null){return fr(this,e,t,n)}toString(){return this._tree.toString()}get node(){return this}matchContext(e){return ur(this,e)}}function fr(s,e,t,n){let i=s.cursor(),r=[];if(!i.firstChild())return r;if(t!=null){for(;!i.type.is(t);)if(!i.nextSibling())return r}for(;;){if(n!=null&&i.type.is(n))return r;if(i.type.is(e)&&r.push(i.node),!i.nextSibling())return n==null?r:[]}}function ur(s,e,t=e.length-1){for(let n=s.parent;t>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[t]&&e[t]!=n.name)return!1;t--}}return!0}class L0{constructor(e,t,n,i){this.parent=e,this.buffer=t,this.index=n,this.start=i}}class hn{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:i}=this.context,r=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.context.start,n);return r<0?null:new hn(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,n=0){if(n&He.ExcludeBuffers)return null;let{buffer:i}=this.context,r=i.findChild(this.index+4,i.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new hn(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new hn(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new hn(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}cursor(e=0){return new hs(this,e)}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,i=this.index+4,r=n.buffer[this.index+3];if(r>i){let l=n.buffer[this.index+1];e.push(n.slice(i,r,l)),t.push(0)}return new Qe(this.type,e,t,this.to-this.from)}resolve(e,t=0){return Mi(this,e,t,!1)}resolveInner(e,t=0){return Mi(this,e,t,!0)}enterUnfinishedNodesBefore(e){return cd(this,e)}toString(){return this.context.buffer.childString(this.index)}getChild(e,t=null,n=null){let i=fr(this,e,t,n);return i.length?i[0]:null}getChildren(e,t=null,n=null){return fr(this,e,t,n)}get node(){return this}matchContext(e){return ur(this,e)}}class hs{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof zt)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let n=e._parent;n;n=n._parent)this.stack.unshift(n.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:i}=this.buffer;return this.type=t||i.set.types[i.buffer[e]],this.from=n+i.buffer[e+1],this.to=n+i.buffer[e+2],!0}yield(e){return e?e instanceof zt?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:i}=this.buffer,r=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.buffer.start,n);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&He.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&He.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&He.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let i=n<0?0:this.stack[n]+4;if(this.index!=i)return this.yieldBuf(t.findChild(i,this.index,-1,0,4))}else{let i=t.buffer[this.index+3];if(i<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(i)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:i}=this;if(i){if(e>0){if(this.index-1)for(let r=t+e,l=e<0?-1:n._tree.children.length;r!=l;r+=e){let o=n._tree.children[r];if(this.mode&He.IncludeAnonymous||o instanceof hi||!o.type.isAnonymous||Bo(o))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let l=e;l;l=l._parent)if(l.index==i){if(i==this.index)return l;t=l,n=r+1;break e}i=this.stack[--r]}for(let i=n;i=0;r--){if(r<0)return ur(this.node,e,i);let l=n[t.buffer[this.stack[r]]];if(!l.isAnonymous){if(e[i]&&e[i]!=l.name)return!1;i--}}return!0}}function Bo(s){return s.children.some(e=>e instanceof hi||!e.type.isAnonymous||Bo(e))}function R0(s){var e;let{buffer:t,nodeSet:n,maxBufferLength:i=P0,reused:r=[],minRepeatType:l=n.types.length}=s,o=Array.isArray(t)?new $o(t,t.length):t,a=n.types,h=0,c=0;function f(w,B,D,$,G){let{id:L,start:V,end:H,size:O}=o,T=c;for(;O<0;)if(o.next(),O==-1){let z=r[L];D.push(z),$.push(V-w);return}else if(O==-3){h=L;return}else if(O==-4){c=L;return}else throw new RangeError(`Unrecognized record size: ${O}`);let Q=a[L],ie,J,fe=V-w;if(H-V<=i&&(J=g(o.pos-B,G))){let z=new Uint16Array(J.size-J.skip),oe=o.pos-J.size,ge=z.length;for(;o.pos>oe;)ge=m(J.start,z,ge);ie=new hi(z,H-J.start,n),fe=J.start-w}else{let z=o.pos-O;o.next();let oe=[],ge=[],We=L>=l?L:-1,Ee=0,$t=H;for(;o.pos>z;)We>=0&&o.id==We&&o.size>=0?(o.end<=$t-i&&(d(oe,ge,V,Ee,o.end,$t,We,T),Ee=oe.length,$t=o.end),o.next()):f(V,z,oe,ge,We);if(We>=0&&Ee>0&&Ee-1&&Ee>0){let ee=u(Q);ie=No(Q,oe,ge,0,oe.length,0,H-V,ee,ee)}else ie=p(Q,oe,ge,H-V,T-H)}D.push(ie),$.push(fe)}function u(w){return(B,D,$)=>{let G=0,L=B.length-1,V,H;if(L>=0&&(V=B[L])instanceof Qe){if(!L&&V.type==w&&V.length==$)return V;(H=V.prop(ve.lookAhead))&&(G=D[L]+V.length+H)}return p(w,B,D,$,G)}}function d(w,B,D,$,G,L,V,H){let O=[],T=[];for(;w.length>$;)O.push(w.pop()),T.push(B.pop()+D-G);w.push(p(n.types[V],O,T,L-G,H-L)),B.push(G-D)}function p(w,B,D,$,G=0,L){if(h){let V=[ve.contextHash,h];L=L?[V].concat(L):[V]}if(G>25){let V=[ve.lookAhead,G];L=L?[V].concat(L):[V]}return new Qe(w,B,D,$,L)}function g(w,B){let D=o.fork(),$=0,G=0,L=0,V=D.end-i,H={size:0,start:0,skip:0};e:for(let O=D.pos-w;D.pos>O;){let T=D.size;if(D.id==B&&T>=0){H.size=$,H.start=G,H.skip=L,L+=4,$+=4,D.next();continue}let Q=D.pos-T;if(T<0||Q=l?4:0,J=D.start;for(D.next();D.pos>Q;){if(D.size<0)if(D.size==-3)ie+=4;else break e;else D.id>=l&&(ie+=4);D.next()}G=J,$+=T,L+=ie}return(B<0||$==w)&&(H.size=$,H.start=G,H.skip=L),H.size>4?H:void 0}function m(w,B,D){let{id:$,start:G,end:L,size:V}=o;if(o.next(),V>=0&&$4){let O=o.pos-(V-4);for(;o.pos>O;)D=m(w,B,D)}B[--D]=H,B[--D]=L-w,B[--D]=G-w,B[--D]=$}else V==-3?h=$:V==-4&&(c=$);return D}let _=[],v=[];for(;o.pos>0;)f(s.start||0,s.bufferStart||0,_,v,-1);let E=(e=s.length)!==null&&e!==void 0?e:_.length?v[0]+_[0].length:0;return new Qe(a[s.topID],_.reverse(),v.reverse(),E)}const Dh=new WeakMap;function Qs(s,e){if(!s.isAnonymous||e instanceof hi||e.type!=s)return 1;let t=Dh.get(e);if(t==null){t=1;for(let n of e.children){if(n.type!=s||!(n instanceof Qe)){t=1;break}t+=Qs(s,n)}Dh.set(e,t)}return t}function No(s,e,t,n,i,r,l,o,a){let h=0;for(let p=n;p=c)break;D+=$}if(E==w+1){if(D>c){let $=p[w];d($.children,$.positions,0,$.children.length,g[w]+v);continue}f.push(p[w])}else{let $=g[E-1]+p[E-1].length-B;f.push(No(s,p,g,w,E,B,$,null,a))}u.push(B+v-r)}}return d(e,t,n,i,0),(o||a)(f,u,l)}class Kw{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof hn?this.setBuffer(e.context.buffer,e.index,t):e instanceof zt&&this.map.set(e.tree,t)}get(e){return e instanceof hn?this.getBuffer(e.context.buffer,e.index):e instanceof zt?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class An{constructor(e,t,n,i,r=!1,l=!1){this.from=e,this.to=t,this.tree=n,this.offset=i,this.open=(r?1:0)|(l?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],n=!1){let i=[new An(0,e.length,e,0,!1,n)];for(let r of t)r.to>e.length&&i.push(r);return i}static applyChanges(e,t,n=128){if(!t.length)return e;let i=[],r=1,l=e.length?e[0]:null;for(let o=0,a=0,h=0;;o++){let c=o=n)for(;l&&l.from=u.from||f<=u.to||h){let d=Math.max(u.from,a)-h,p=Math.min(u.to,f)-h;u=d>=p?null:new An(d,p,u.tree,u.offset+h,o>0,!!c)}if(u&&i.push(u),l.to>f)break;l=rnew Lt(i.from,i.to)):[new Lt(0,0)]:[new Lt(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let i=this.startParse(e,t,n);for(;;){let r=i.advance();if(r)return r}}};class z0{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function Gw(s){return(e,t,n,i)=>new V0(e,s,t,n,i)}class Oh{constructor(e,t,n,i,r){if(this.parser=e,this.parse=t,this.overlay=n,this.target=i,this.ranges=r,!r.length||r.some(l=>l.from>=l.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(r))}}class j0{constructor(e,t,n,i,r,l,o){this.parser=e,this.predicate=t,this.mounts=n,this.index=i,this.start=r,this.target=l,this.prev=o,this.depth=0,this.ranges=[]}}const oo=new ve({perNode:!0});class V0{constructor(e,t,n,i,r){this.nest=t,this.input=n,this.fragments=i,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let n=this.baseParse.advance();if(!n)return null;if(this.baseParse=null,this.baseTree=n,this.startInner(),this.stoppedAt!=null)for(let i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let n=this.baseTree;return this.stoppedAt!=null&&(n=new Qe(n.type,n.children,n.positions,n.length,n.propValues.concat([[oo,this.stoppedAt]]))),n}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let n=Object.assign(Object.create(null),e.target.props);n[ve.mounted.id]=new B0(t,e.overlay,e.parser),e.target.props=n}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;tc.frag.from<=i.from&&c.frag.to>=i.to&&c.mount.overlay);if(h)for(let c of h.mount.overlay){let f=c.from+h.pos,u=c.to+h.pos;f>=i.from&&u<=i.to&&!t.ranges.some(d=>d.fromf)&&t.ranges.push({from:f,to:u})}}o=!1}else if(n&&(l=H0(n.ranges,i.from,i.to)))o=l!=2;else if(!i.type.isAnonymous&&i.fromnew Lt(f.from-i.from,f.to-i.from)):null,i.tree,c)),r.overlay?c.length&&(n={ranges:c,depth:0,prev:n}):o=!1}}else t&&(a=t.predicate(i))&&(a===!0&&(a=new Lt(i.from,i.to)),a.fromnew Lt(c.from-t.start,c.to-t.start)),t.target,h)),t=t.prev}n&&!--n.depth&&(n=n.prev)}}}}function H0(s,e,t){for(let n of s){if(n.from>=t)break;if(n.to>e)return n.from<=e&&n.to>=t?2:1}return 0}function Ph(s,e,t,n,i,r){if(e=e.to);n++);let l=i.children[n],o=l.buffer;function a(h,c,f,u,d){let p=h;for(;o[p+2]+r<=e.from;)p=o[p+3];let g=[],m=[];Ph(l,h,p,g,m,u);let _=o[p+1],v=o[p+2],E=_+r==e.from&&v+r==e.to&&o[p]==e.type.id;return g.push(E?e.toTree():a(p+4,o[p+3],l.set.types[o[p]],_,v-_)),m.push(_-u),Ph(l,o[p+3],c,g,m,u),new Qe(f,g,m,d)}i.children[n]=a(0,o.length,vt.none,0,l.length);for(let h=0;h<=t;h++)s.childAfter(e.from)}class $h{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(He.IncludeAnonymous|He.IgnoreMounts)}moveTo(e){let{cursor:t}=this,n=e-this.offset;for(;!this.done&&t.from=e&&t.enter(n,1,He.IgnoreOverlays|He.ExcludeBuffers)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof Qe)t=t.children[0];else break}return!1}}class W0{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let n=this.curFrag=e[0];this.curTo=(t=n.tree.prop(oo))!==null&&t!==void 0?t:n.to,this.inner=new $h(n.tree,-n.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(oo))!==null&&e!==void 0?e:t.to,this.inner=new $h(t.tree,-t.offset)}}findMounts(e,t){var n;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let r=this.inner.cursor.node;r;r=r.parent){let l=(n=r.tree)===null||n===void 0?void 0:n.prop(ve.mounted);if(l&&l.parser==t)for(let o=this.fragI;o=r.to)break;a.tree==this.curFrag.tree&&i.push({frag:a,pos:r.from-a.offset,mount:l})}}}return i}}function Bh(s,e){let t=null,n=e;for(let i=1,r=0;i=o)break;a.to<=l||(t||(n=t=e.slice()),a.fromo&&t.splice(r+1,0,new Lt(o,a.to))):a.to>o?t[r--]=new Lt(o,a.to):t.splice(r--,1))}}return n}function q0(s,e,t,n){let i=0,r=0,l=!1,o=!1,a=-1e9,h=[];for(;;){let c=i==s.length?1e9:l?s[i].to:s[i].from,f=r==e.length?1e9:o?e[r].to:e[r].from;if(l!=o){let u=Math.max(a,t),d=Math.min(c,f,n);unew Lt(u.from+n,u.to+n)),f=q0(e,c,a,h);for(let u=0,d=a;;u++){let p=u==f.length,g=p?h:f[u].from;if(g>d&&t.push(new An(d,g,i.tree,-l,r.from>=d||r.openStart,r.to<=g||r.openEnd)),p)break;d=f[u].to}}else t.push(new An(a,h,i.tree,-l,r.from>=l||r.openStart,r.to<=o||r.openEnd))}return t}let U0=0;class sn{constructor(e,t,n){this.set=e,this.base=t,this.modified=n,this.id=U0++}static define(e){if(e!=null&&e.base)throw new Error("Can not derive from a modified tag");let t=new sn([],null,[]);if(t.set.push(t),e)for(let n of e.set)t.set.push(n);return t}static defineModifier(){let e=new dr;return t=>t.modified.indexOf(e)>-1?t:dr.get(t.base||t,t.modified.concat(e).sort((n,i)=>n.id-i.id))}}let K0=0;class dr{constructor(){this.instances=[],this.id=K0++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(o=>o.base==e&&J0(t,o.modified));if(n)return n;let i=[],r=new sn(i,e,t);for(let o of t)o.instances.push(r);let l=G0(t);for(let o of e.set)if(!o.modified.length)for(let a of l)i.push(dr.get(o,a));return r}}function J0(s,e){return s.length==e.length&&s.every((t,n)=>t==e[n])}function G0(s){let e=[[]];for(let t=0;tn.length-t.length)}function Y0(s){let e=Object.create(null);for(let t in s){let n=s[t];Array.isArray(n)||(n=[n]);for(let i of t.split(" "))if(i){let r=[],l=2,o=i;for(let f=0;;){if(o=="..."&&f>0&&f+3==i.length){l=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!u)throw new RangeError("Invalid path: "+i);if(r.push(u[0]=="*"?"":u[0][0]=='"'?JSON.parse(u[0]):u[0]),f+=u[0].length,f==i.length)break;let d=i[f++];if(f==i.length&&d=="!"){l=0;break}if(d!="/")throw new RangeError("Invalid path: "+i);o=i.slice(f)}let a=r.length-1,h=r[a];if(!h)throw new RangeError("Invalid path: "+i);let c=new pr(n,l,a>0?r.slice(0,a):null);e[h]=c.sort(e[h])}}return fd.add(e)}const fd=new ve;class pr{constructor(e,t,n,i){this.tags=e,this.mode=t,this.context=n,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let l=i;for(let o of r)for(let a of o.set){let h=t[a.id];if(h){l=l?l+" "+h:h;break}}return l},scope:n}}function X0(s,e){let t=null;for(let n of s){let i=n.style(e);i&&(t=t?t+" "+i:i)}return t}function Z0(s,e,t,n=0,i=s.length){let r=new Q0(n,Array.isArray(e)?e:[e],t);r.highlightRange(s.cursor(),n,i,"",r.highlighters),r.flush(i)}class Q0{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,i,r){let{type:l,from:o,to:a}=e;if(o>=n||a<=t)return;l.isTop&&(r=this.highlighters.filter(d=>!d.scope||d.scope(l)));let h=i,c=e1(e)||pr.empty,f=X0(r,c.tags);if(f&&(h&&(h+=" "),h+=f,c.mode==1&&(i+=(i?" ":"")+f)),this.startSpan(Math.max(t,o),h),c.opaque)return;let u=e.tree&&e.tree.prop(ve.mounted);if(u&&u.overlay){let d=e.node.enter(u.overlay[0].from+o,1),p=this.highlighters.filter(m=>!m.scope||m.scope(u.tree.type)),g=e.firstChild();for(let m=0,_=o;;m++){let v=m=E||!e.nextSibling())););if(!v||E>n)break;_=v.to+o,_>t&&(this.highlightRange(d.cursor(),Math.max(t,v.from+o),Math.min(n,_),"",p),this.startSpan(Math.min(n,_),h))}g&&e.parent()}else if(e.firstChild()){u&&(i="");do if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,i,r),this.startSpan(Math.min(n,e.to),h)}while(e.nextSibling());e.parent()}}}function e1(s){let e=s.type.prop(fd);for(;e&&e.context&&!s.matchContext(e.context);)e=e.next;return e||null}const Y=sn.define,zs=Y(),Nn=Y(),Lh=Y(Nn),Rh=Y(Nn),Ln=Y(),js=Y(Ln),_l=Y(Ln),nn=Y(),Zn=Y(nn),en=Y(),tn=Y(),ao=Y(),Fi=Y(ao),Vs=Y(),N={comment:zs,lineComment:Y(zs),blockComment:Y(zs),docComment:Y(zs),name:Nn,variableName:Y(Nn),typeName:Lh,tagName:Y(Lh),propertyName:Rh,attributeName:Y(Rh),className:Y(Nn),labelName:Y(Nn),namespace:Y(Nn),macroName:Y(Nn),literal:Ln,string:js,docString:Y(js),character:Y(js),attributeValue:Y(js),number:_l,integer:Y(_l),float:Y(_l),bool:Y(Ln),regexp:Y(Ln),escape:Y(Ln),color:Y(Ln),url:Y(Ln),keyword:en,self:Y(en),null:Y(en),atom:Y(en),unit:Y(en),modifier:Y(en),operatorKeyword:Y(en),controlKeyword:Y(en),definitionKeyword:Y(en),moduleKeyword:Y(en),operator:tn,derefOperator:Y(tn),arithmeticOperator:Y(tn),logicOperator:Y(tn),bitwiseOperator:Y(tn),compareOperator:Y(tn),updateOperator:Y(tn),definitionOperator:Y(tn),typeOperator:Y(tn),controlOperator:Y(tn),punctuation:ao,separator:Y(ao),bracket:Fi,angleBracket:Y(Fi),squareBracket:Y(Fi),paren:Y(Fi),brace:Y(Fi),content:nn,heading:Zn,heading1:Y(Zn),heading2:Y(Zn),heading3:Y(Zn),heading4:Y(Zn),heading5:Y(Zn),heading6:Y(Zn),contentSeparator:Y(nn),list:Y(nn),quote:Y(nn),emphasis:Y(nn),strong:Y(nn),link:Y(nn),monospace:Y(nn),strikethrough:Y(nn),inserted:Y(),deleted:Y(),changed:Y(),invalid:Y(),meta:Vs,documentMeta:Y(Vs),annotation:Y(Vs),processingInstruction:Y(Vs),definition:sn.defineModifier(),constant:sn.defineModifier(),function:sn.defineModifier(),standard:sn.defineModifier(),local:sn.defineModifier(),special:sn.defineModifier()};ud([{tag:N.link,class:"tok-link"},{tag:N.heading,class:"tok-heading"},{tag:N.emphasis,class:"tok-emphasis"},{tag:N.strong,class:"tok-strong"},{tag:N.keyword,class:"tok-keyword"},{tag:N.atom,class:"tok-atom"},{tag:N.bool,class:"tok-bool"},{tag:N.url,class:"tok-url"},{tag:N.labelName,class:"tok-labelName"},{tag:N.inserted,class:"tok-inserted"},{tag:N.deleted,class:"tok-deleted"},{tag:N.literal,class:"tok-literal"},{tag:N.string,class:"tok-string"},{tag:N.number,class:"tok-number"},{tag:[N.regexp,N.escape,N.special(N.string)],class:"tok-string2"},{tag:N.variableName,class:"tok-variableName"},{tag:N.local(N.variableName),class:"tok-variableName tok-local"},{tag:N.definition(N.variableName),class:"tok-variableName tok-definition"},{tag:N.special(N.variableName),class:"tok-variableName2"},{tag:N.definition(N.propertyName),class:"tok-propertyName tok-definition"},{tag:N.typeName,class:"tok-typeName"},{tag:N.namespace,class:"tok-namespace"},{tag:N.className,class:"tok-className"},{tag:N.macroName,class:"tok-macroName"},{tag:N.propertyName,class:"tok-propertyName"},{tag:N.operator,class:"tok-operator"},{tag:N.comment,class:"tok-comment"},{tag:N.meta,class:"tok-meta"},{tag:N.invalid,class:"tok-invalid"},{tag:N.punctuation,class:"tok-punctuation"}]);var kl;const ki=new ve;function t1(s){return le.define({combine:s?e=>e.concat(s):void 0})}const n1=new ve;class Ut{constructor(e,t,n=[],i=""){this.data=e,this.name=i,ye.prototype.hasOwnProperty("tree")||Object.defineProperty(ye.prototype,"tree",{get(){return Ot(this)}}),this.parser=t,this.extension=[Wn.of(this),ye.languageData.of((r,l,o)=>{let a=Ih(r,l,o),h=a.type.prop(ki);if(!h)return[];let c=r.facet(h),f=a.type.prop(n1);if(f){let u=a.resolve(l-a.from,o);for(let d of f)if(d.test(u,r)){let p=r.facet(d.facet);return d.type=="replace"?p:p.concat(c)}}return c})].concat(n)}isActiveAt(e,t,n=-1){return Ih(e,t,n).type.prop(ki)==this.data}findRegions(e){let t=e.facet(Wn);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],i=(r,l)=>{if(r.prop(ki)==this.data){n.push({from:l,to:l+r.length});return}let o=r.prop(ve.mounted);if(o){if(o.tree.prop(ki)==this.data){if(o.overlay)for(let a of o.overlay)n.push({from:a.from+l,to:a.to+l});else n.push({from:l,to:l+r.length});return}else if(o.overlay){let a=n.length;if(i(o.tree,o.overlay[0].from+l),n.length>a)return}}for(let a=0;an.isTop?t:void 0)]}),e.name)}configure(e,t){return new ho(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Ot(s){let e=s.field(Ut.state,!1);return e?e.tree:Qe.empty}class i1{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}let Wi=null;class gr{constructor(e,t,n=[],i,r,l,o,a){this.parser=e,this.state=t,this.fragments=n,this.tree=i,this.treeLen=r,this.viewport=l,this.skipped=o,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new gr(e,t,[],Qe.empty,0,n,[],null)}startParse(){return this.parser.startParse(new i1(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=Qe.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var n;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(An.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Wi;Wi=this;try{return e()}finally{Wi=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=zh(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:i,treeLen:r,viewport:l,skipped:o}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((h,c,f,u)=>a.push({fromA:h,toA:c,fromB:f,toB:u})),n=An.applyChanges(n,a),i=Qe.empty,r=0,l={from:e.mapPos(l.from,-1),to:e.mapPos(l.to,1)},this.skipped.length){o=[];for(let h of this.skipped){let c=e.mapPos(h.from,1),f=e.mapPos(h.to,-1);ce.from&&(this.fragments=zh(this.fragments,i,r),this.skipped.splice(n--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends I0{createParse(t,n,i){let r=i[0].from,l=i[i.length-1].to;return{parsedPos:r,advance(){let a=Wi;if(a){for(let h of i)a.tempSkipped.push(h);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=l,new Qe(vt.none,[],[],l-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return Wi}}function zh(s,e,t){return An.applyChanges(s,[{fromA:e,toA:t,fromB:e,toB:t}])}class Ti{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new Ti(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=gr.create(e.facet(Wn).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new Ti(n)}}Ut.state=Pt.define({create:Ti.init,update(s,e){for(let t of e.effects)if(t.is(Ut.setState))return t.value;return e.startState.facet(Wn)!=e.state.facet(Wn)?Ti.init(e.state):s.apply(e)}});let dd=s=>{let e=setTimeout(()=>s(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(dd=s=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(s,{timeout:500-100})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const vl=typeof navigator<"u"&&(!((kl=navigator.scheduling)===null||kl===void 0)&&kl.isInputPending)?()=>navigator.scheduling.isInputPending():null,s1=ht.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Ut.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),e.docChanged&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Ut.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=dd(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndi+1e3,a=r.context.work(()=>vl&&vl()||Date.now()>l,i+(o?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:Ut.setState.of(new Ti(r.context))})),this.chunkBudget>0&&!(a&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>xn(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Wn=le.define({combine(s){return s.length?s[0]:null},enables:s=>[Ut.state,s1,ce.contentAttributes.compute([s],e=>{let t=e.facet(s);return t&&t.name?{"data-language":t.name}:{}})]});class Xw{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}class pd{constructor(e,t,n,i,r,l=void 0){this.name=e,this.alias=t,this.extensions=n,this.filename=i,this.loadFunc=r,this.support=l,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:t,support:n}=e;if(!t){if(!n)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(n)}return new pd(e.name,(e.alias||[]).concat(e.name).map(i=>i.toLowerCase()),e.extensions||[],e.filename,t,n)}static matchFilename(e,t){for(let i of e)if(i.filename&&i.filename.test(t))return i;let n=/\.([^.]+)$/.exec(t);if(n){for(let i of e)if(i.extensions.indexOf(n[1])>-1)return i}return null}static matchLanguageName(e,t,n=!0){t=t.toLowerCase();for(let i of e)if(i.alias.some(r=>r==t))return i;if(n)for(let i of e)for(let r of i.alias){let l=t.indexOf(r);if(l>-1&&(r.length>2||!/\w/.test(t[l-1])&&!/\w/.test(t[l+r.length])))return i}return null}}const r1=le.define(),Pr=le.define({combine:s=>{if(!s.length)return" ";let e=s[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(s[0]));return e}});function mr(s){let e=s.facet(Pr);return e.charCodeAt(0)==9?s.tabSize*e.length:e.length}function cs(s,e){let t="",n=s.tabSize,i=s.facet(Pr)[0];if(i==" "){for(;e>=n;)t+=" ",e-=n;i=" "}for(let r=0;r=n.from&&i<=n.to?r&&i==e?{text:"",from:e}:(t<0?i-1&&(r+=l-this.countColumn(n,n.search(/\S|$/))),r}countColumn(e,t=e.length){return gs(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:i}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let l=r(i);if(l>-1)return l}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const l1=new ve;function o1(s,e,t){return gd(e.resolveInner(t).enterUnfinishedNodesBefore(t),t,s)}function a1(s){return s.pos==s.options.simulateBreak&&s.options.simulateDoubleBreak}function h1(s){let e=s.type.prop(l1);if(e)return e;let t=s.firstChild,n;if(t&&(n=t.type.prop(ve.closedBy))){let i=s.lastChild,r=i&&n.indexOf(i.name)>-1;return l=>md(l,!0,1,void 0,r&&!a1(l)?i.from:void 0)}return s.parent==null?c1:null}function gd(s,e,t){for(;s;s=s.parent){let n=h1(s);if(n)return n(Ro.create(t,e,s))}return null}function c1(){return 0}class Ro extends $r{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.node=n}static create(e,t,n){return new Ro(e,t,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(f1(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){let e=this.node.parent;return e?gd(e,this.pos,this.base):0}}function f1(s,e){for(let t=e;t;t=t.parent)if(s==t)return!0;return!1}function u1(s){let e=s.node,t=e.childAfter(e.from),n=e.lastChild;if(!t)return null;let i=s.options.simulateBreak,r=s.state.doc.lineAt(t.from),l=i==null||i<=r.from?r.to:Math.min(r.to,i);for(let o=t.to;;){let a=e.childAfter(o);if(!a||a==n)return null;if(!a.type.isSkipped)return a.frommd(n,e,t,s)}function md(s,e,t,n,i){let r=s.textAfter,l=r.match(/^\s*/)[0].length,o=n&&r.slice(l,l+n.length)==n||i==s.pos+l,a=e?u1(s):null;return a?o?s.column(a.from):s.column(a.to):s.baseIndent+(o?0:s.unit*t)}const Qw=s=>s.baseIndent;function eS({except:s,units:e=1}={}){return t=>{let n=s&&s.test(t.textAfter);return t.baseIndent+(n?0:e*t.unit)}}const d1=200;function tS(){return ye.transactionFilter.of(s=>{if(!s.docChanged||!s.isUserEvent("input.type")&&!s.isUserEvent("input.complete"))return s;let e=s.startState.languageDataAt("indentOnInput",s.startState.selection.main.head);if(!e.length)return s;let t=s.newDoc,{head:n}=s.newSelection.main,i=t.lineAt(n);if(n>i.from+d1)return s;let r=t.sliceString(i.from,n);if(!e.some(h=>h.test(r)))return s;let{state:l}=s,o=-1,a=[];for(let{head:h}of l.selection.ranges){let c=l.doc.lineAt(h);if(c.from==o)continue;o=c.from;let f=Lo(l,c.from);if(f==null)continue;let u=/^\s*/.exec(c.text)[0],d=cs(l,f);u!=d&&a.push({from:c.from,to:c.from+u.length,insert:d})}return a.length?[s,{changes:a,sequential:!0}]:s})}const p1=le.define(),g1=new ve;function nS(s){let e=s.firstChild,t=s.lastChild;return e&&e.tot)continue;if(r&&l.from=e&&a.to>t&&(r=a)}}return r}function b1(s){let e=s.lastChild;return e&&e.to==s.to&&e.type.isError}function br(s,e,t){for(let n of s.facet(p1)){let i=n(s,e,t);if(i)return i}return m1(s,e,t)}function bd(s,e){let t=e.mapPos(s.from,1),n=e.mapPos(s.to,-1);return t>=n?void 0:{from:t,to:n}}const Br=Pe.define({map:bd}),ks=Pe.define({map:bd});function _d(s){let e=[];for(let{head:t}of s.state.selection.ranges)e.some(n=>n.from<=t&&n.to>=t)||e.push(s.lineBlockAt(t));return e}const li=Pt.define({create(){return Re.none},update(s,e){s=s.map(e.changes);for(let t of e.effects)t.is(Br)&&!_1(s,t.value.from,t.value.to)?s=s.update({add:[jh.range(t.value.from,t.value.to)]}):t.is(ks)&&(s=s.update({filter:(n,i)=>t.value.from!=n||t.value.to!=i,filterFrom:t.value.from,filterTo:t.value.to}));if(e.selection){let t=!1,{head:n}=e.selection.main;s.between(n,n,(i,r)=>{in&&(t=!0)}),t&&(s=s.update({filterFrom:n,filterTo:n,filter:(i,r)=>r<=n||i>=n}))}return s},provide:s=>ce.decorations.from(s),toJSON(s,e){let t=[];return s.between(0,e.doc.length,(n,i)=>{t.push(n,i)}),t},fromJSON(s){if(!Array.isArray(s)||s.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t{(!i||i.from>r)&&(i={from:r,to:l})}),i}function _1(s,e,t){let n=!1;return s.between(e,e,(i,r)=>{i==e&&r==t&&(n=!0)}),n}function kd(s,e){return s.field(li,!1)?e:e.concat(Pe.appendConfig.of(wd()))}const k1=s=>{for(let e of _d(s)){let t=br(s.state,e.from,e.to);if(t)return s.dispatch({effects:kd(s.state,[Br.of(t),vd(s,t)])}),!0}return!1},v1=s=>{if(!s.state.field(li,!1))return!1;let e=[];for(let t of _d(s)){let n=_r(s.state,t.from,t.to);n&&e.push(ks.of(n),vd(s,n,!1))}return e.length&&s.dispatch({effects:e}),e.length>0};function vd(s,e,t=!0){let n=s.state.doc.lineAt(e.from).number,i=s.state.doc.lineAt(e.to).number;return ce.announce.of(`${s.state.phrase(t?"Folded lines":"Unfolded lines")} ${n} ${s.state.phrase("to")} ${i}.`)}const y1=s=>{let{state:e}=s,t=[];for(let n=0;n{let e=s.state.field(li,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,s.state.doc.length,(n,i)=>{t.push(ks.of({from:n,to:i}))}),s.dispatch({effects:t}),!0},iS=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:k1},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:v1},{key:"Ctrl-Alt-[",run:y1},{key:"Ctrl-Alt-]",run:w1}],S1={placeholderDOM:null,placeholderText:"…"},yd=le.define({combine(s){return Ei(s,S1)}});function wd(s){let e=[li,A1];return s&&e.push(yd.of(s)),e}const jh=Re.replace({widget:new class extends Di{toDOM(s){let{state:e}=s,t=e.facet(yd),n=r=>{let l=s.lineBlockAt(s.posAtDOM(r.target)),o=_r(s.state,l.from,l.to);o&&s.dispatch({effects:ks.of(o)}),r.preventDefault()};if(t.placeholderDOM)return t.placeholderDOM(s,n);let i=document.createElement("span");return i.textContent=t.placeholderText,i.setAttribute("aria-label",e.phrase("folded code")),i.title=e.phrase("unfold"),i.className="cm-foldPlaceholder",i.onclick=n,i}}}),x1={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class yl extends En{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function sS(s={}){let e=Object.assign(Object.assign({},x1),s),t=new yl(e,!0),n=new yl(e,!1),i=ht.fromClass(class{constructor(l){this.from=l.viewport.from,this.markers=this.buildMarkers(l)}update(l){(l.docChanged||l.viewportChanged||l.startState.facet(Wn)!=l.state.facet(Wn)||l.startState.field(li,!1)!=l.state.field(li,!1)||Ot(l.startState)!=Ot(l.state)||e.foldingChanged(l))&&(this.markers=this.buildMarkers(l.view))}buildMarkers(l){let o=new ri;for(let a of l.viewportLineBlocks){let h=_r(l.state,a.from,a.to)?n:br(l.state,a.from,a.to)?t:null;h&&o.add(a.from,a.from,h)}return o.finish()}}),{domEventHandlers:r}=e;return[i,x0({class:"cm-foldGutter",markers(l){var o;return((o=l.plugin(i))===null||o===void 0?void 0:o.markers)||Ne.empty},initialSpacer(){return new yl(e,!1)},domEventHandlers:Object.assign(Object.assign({},r),{click:(l,o,a)=>{if(r.click&&r.click(l,o,a))return!0;let h=_r(l.state,o.from,o.to);if(h)return l.dispatch({effects:ks.of(h)}),!0;let c=br(l.state,o.from,o.to);return c?(l.dispatch({effects:Br.of(c)}),!0):!1}})}),wd()]}const A1=ce.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class vs{constructor(e,t){this.specs=e;let n;function i(o){let a=jn.newName();return(n||(n=Object.create(null)))["."+a]=o,a}const r=typeof t.all=="string"?t.all:t.all?i(t.all):void 0,l=t.scope;this.scope=l instanceof Ut?o=>o.prop(ki)==l.data:l?o=>o==l:void 0,this.style=ud(e.map(o=>({tag:o.tag,class:o.class||i(Object.assign({},o,{tag:null}))})),{all:r}).style,this.module=n?new jn(n):null,this.themeType=t.themeType}static define(e,t){return new vs(e,t||{})}}const co=le.define(),Sd=le.define({combine(s){return s.length?[s[0]]:null}});function wl(s){let e=s.facet(co);return e.length?e:s.facet(Sd)}function C1(s,e){let t=[T1],n;return s instanceof vs&&(s.module&&t.push(ce.styleModule.of(s.module)),n=s.themeType),e!=null&&e.fallback?t.push(Sd.of(s)):n?t.push(co.computeN([ce.darkTheme],i=>i.facet(ce.darkTheme)==(n=="dark")?[s]:[])):t.push(co.of(s)),t}class M1{constructor(e){this.markCache=Object.create(null),this.tree=Ot(e.state),this.decorations=this.buildDeco(e,wl(e.state))}update(e){let t=Ot(e.state),n=wl(e.state),i=n!=wl(e.startState);t.length{n.add(l,o,this.markCache[a]||(this.markCache[a]=Re.mark({class:a})))},i,r);return n.finish()}}const T1=Er.high(ht.fromClass(M1,{decorations:s=>s.decorations})),rS=vs.define([{tag:N.meta,color:"#404740"},{tag:N.link,textDecoration:"underline"},{tag:N.heading,textDecoration:"underline",fontWeight:"bold"},{tag:N.emphasis,fontStyle:"italic"},{tag:N.strong,fontWeight:"bold"},{tag:N.strikethrough,textDecoration:"line-through"},{tag:N.keyword,color:"#708"},{tag:[N.atom,N.bool,N.url,N.contentSeparator,N.labelName],color:"#219"},{tag:[N.literal,N.inserted],color:"#164"},{tag:[N.string,N.deleted],color:"#a11"},{tag:[N.regexp,N.escape,N.special(N.string)],color:"#e40"},{tag:N.definition(N.variableName),color:"#00f"},{tag:N.local(N.variableName),color:"#30a"},{tag:[N.typeName,N.namespace],color:"#085"},{tag:N.className,color:"#167"},{tag:[N.special(N.variableName),N.macroName],color:"#256"},{tag:N.definition(N.propertyName),color:"#00c"},{tag:N.comment,color:"#940"},{tag:N.invalid,color:"#f00"}]),E1=ce.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),xd=1e4,Ad="()[]{}",Cd=le.define({combine(s){return Ei(s,{afterCursor:!0,brackets:Ad,maxScanDistance:xd,renderMatch:P1})}}),D1=Re.mark({class:"cm-matchingBracket"}),O1=Re.mark({class:"cm-nonmatchingBracket"});function P1(s){let e=[],t=s.matched?D1:O1;return e.push(t.range(s.start.from,s.start.to)),s.end&&e.push(t.range(s.end.from,s.end.to)),e}const $1=Pt.define({create(){return Re.none},update(s,e){if(!e.docChanged&&!e.selection)return s;let t=[],n=e.state.facet(Cd);for(let i of e.state.selection.ranges){if(!i.empty)continue;let r=cn(e.state,i.head,-1,n)||i.head>0&&cn(e.state,i.head-1,1,n)||n.afterCursor&&(cn(e.state,i.head,1,n)||i.headce.decorations.from(s)}),B1=[$1,E1];function lS(s={}){return[Cd.of(s),B1]}const N1=new ve;function fo(s,e,t){let n=s.prop(e<0?ve.openedBy:ve.closedBy);if(n)return n;if(s.name.length==1){let i=t.indexOf(s.name);if(i>-1&&i%2==(e<0?1:0))return[t[i+e]]}return null}function uo(s){let e=s.type.prop(N1);return e?e(s.node):s}function cn(s,e,t,n={}){let i=n.maxScanDistance||xd,r=n.brackets||Ad,l=Ot(s),o=l.resolveInner(e,t);for(let a=o;a;a=a.parent){let h=fo(a.type,t,r);if(h&&a.from0?e>=c.from&&ec.from&&e<=c.to))return L1(s,e,t,a,c,h,r)}}return R1(s,e,t,l,o.type,i,r)}function L1(s,e,t,n,i,r,l){let o=n.parent,a={from:i.from,to:i.to},h=0,c=o==null?void 0:o.cursor();if(c&&(t<0?c.childBefore(n.from):c.childAfter(n.to)))do if(t<0?c.to<=n.from:c.from>=n.to){if(h==0&&r.indexOf(c.type.name)>-1&&c.from0)return null;let h={from:t<0?e-1:e,to:t>0?e+1:e},c=s.doc.iterRange(e,t>0?s.doc.length:0),f=0;for(let u=0;!c.next().done&&u<=r;){let d=c.value;t<0&&(u+=d.length);let p=e+u*t;for(let g=t>0?0:d.length-1,m=t>0?d.length:-1;g!=m;g+=t){let _=l.indexOf(d[g]);if(!(_<0||n.resolveInner(p+g,1).type!=i))if(_%2==0==t>0)f++;else{if(f==1)return{start:h,end:{from:p+g,to:p+g+1},matched:_>>1==a>>1};f--}}t>0&&(u+=d.length)}return c.done?{start:h,matched:!1}:null}const I1=Object.create(null),Vh=[vt.none],Hh=[],z1=Object.create(null);for(let[s,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])z1[s]=j1(I1,e);function Sl(s,e){Hh.indexOf(s)>-1||(Hh.push(s),console.warn(e))}function j1(s,e){let t=null;for(let r of e.split(".")){let l=s[r]||N[r];l?typeof l=="function"?t?t=l(t):Sl(r,`Modifier ${r} used at start of tag`):t?Sl(r,`Tag ${r} used as modifier`):t=l:Sl(r,`Unknown highlighting tag ${r}`)}if(!t)return 0;let n=e.replace(/ /g,"_"),i=vt.define({id:Vh.length,name:n,props:[Y0({[n]:t})]});return Vh.push(i),i.id}const V1=s=>{let{state:e}=s,t=e.doc.lineAt(e.selection.main.from),n=zo(s.state,t.from);return n.line?H1(s):n.block?W1(s):!1};function Io(s,e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let i=s(e,t);return i?(n(t.update(i)),!0):!1}}const H1=Io(K1,0),F1=Io(Md,0),W1=Io((s,e)=>Md(s,e,U1(e)),0);function zo(s,e){let t=s.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const qi=50;function q1(s,{open:e,close:t},n,i){let r=s.sliceDoc(n-qi,n),l=s.sliceDoc(i,i+qi),o=/\s*$/.exec(r)[0].length,a=/^\s*/.exec(l)[0].length,h=r.length-o;if(r.slice(h-e.length,h)==e&&l.slice(a,a+t.length)==t)return{open:{pos:n-o,margin:o&&1},close:{pos:i+a,margin:a&&1}};let c,f;i-n<=2*qi?c=f=s.sliceDoc(n,i):(c=s.sliceDoc(n,n+qi),f=s.sliceDoc(i-qi,i));let u=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-t.length;return c.slice(u,u+e.length)==e&&f.slice(p,p+t.length)==t?{open:{pos:n+u+e.length,margin:/\s/.test(c.charAt(u+e.length))?1:0},close:{pos:i-d-t.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function U1(s){let e=[];for(let t of s.selection.ranges){let n=s.doc.lineAt(t.from),i=t.to<=n.to?n:s.doc.lineAt(t.to),r=e.length-1;r>=0&&e[r].to>n.from?e[r].to=i.to:e.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:i.to})}return e}function Md(s,e,t=e.selection.ranges){let n=t.map(r=>zo(e,r.from).block);if(!n.every(r=>r))return null;let i=t.map((r,l)=>q1(e,n[l],r.from,r.to));if(s!=2&&!i.every(r=>r))return{changes:e.changes(t.map((r,l)=>i[l]?[]:[{from:r.from,insert:n[l].open+" "},{from:r.to,insert:" "+n[l].close}]))};if(s!=1&&i.some(r=>r)){let r=[];for(let l=0,o;li&&(r==l||l>f.from)){i=f.from;let u=/^\s*/.exec(f.text)[0].length,d=u==f.length,p=f.text.slice(u,u+h.length)==h?u:-1;ur.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:o,token:a,indent:h,empty:c,single:f}of n)(f||!c)&&r.push({from:o.from+h,insert:a+" "});let l=e.changes(r);return{changes:l,selection:e.selection.map(l,1)}}else if(s!=1&&n.some(r=>r.comment>=0)){let r=[];for(let{line:l,comment:o,token:a}of n)if(o>=0){let h=l.from+o,c=h+a.length;l.text[c-l.from]==" "&&c++,r.push({from:h,to:c})}return{changes:r}}return null}const po=qn.define(),J1=qn.define(),G1=le.define(),Td=le.define({combine(s){return Ei(s,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,i)=>e(n,i)||t(n,i)})}});function Y1(s){let e=0;return s.iterChangedRanges((t,n)=>e=n),e}const jo=Pt.define({create(){return fn.empty},update(s,e){let t=e.state.facet(Td),n=e.annotation(po);if(n){let a=e.docChanged?F.single(Y1(e.changes)):void 0,h=kt.fromTransaction(e,a),c=n.side,f=c==0?s.undone:s.done;return h?f=kr(f,f.length,t.minDepth,h):f=Od(f,e.startState.selection),new fn(c==0?n.rest:f,c==0?f:n.rest)}let i=e.annotation(J1);if((i=="full"||i=="before")&&(s=s.isolate()),e.annotation(Ze.addToHistory)===!1)return e.changes.empty?s:s.addMapping(e.changes.desc);let r=kt.fromTransaction(e),l=e.annotation(Ze.time),o=e.annotation(Ze.userEvent);return r?s=s.addChanges(r,l,o,t,e):e.selection&&(s=s.addSelection(e.startState.selection,l,o,t.newGroupDelay)),(i=="full"||i=="after")&&(s=s.isolate()),s},toJSON(s){return{done:s.done.map(e=>e.toJSON()),undone:s.undone.map(e=>e.toJSON())}},fromJSON(s){return new fn(s.done.map(kt.fromJSON),s.undone.map(kt.fromJSON))}});function oS(s={}){return[jo,Td.of(s),ce.domEventHandlers({beforeinput(e,t){let n=e.inputType=="historyUndo"?Ed:e.inputType=="historyRedo"?go:null;return n?(e.preventDefault(),n(t)):!1}})]}const Fh=jo;function Nr(s,e){return function({state:t,dispatch:n}){if(!e&&t.readOnly)return!1;let i=t.field(jo,!1);if(!i)return!1;let r=i.pop(s,t,e);return r?(n(r),!0):!1}}const Ed=Nr(0,!1),go=Nr(1,!1),X1=Nr(0,!0),Z1=Nr(1,!0);class kt{constructor(e,t,n,i,r){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=i,this.selectionsAfter=r}setSelAfter(e){return new kt(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(n=this.startSelection)===null||n===void 0?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new kt(e.changes&&Ye.fromJSON(e.changes),[],e.mapped&&pn.fromJSON(e.mapped),e.startSelection&&F.fromJSON(e.startSelection),e.selectionsAfter.map(F.fromJSON))}static fromTransaction(e,t){let n=Rt;for(let i of e.startState.facet(G1)){let r=i(e);r.length&&(n=n.concat(r))}return!n.length&&e.changes.empty?null:new kt(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,Rt)}static selection(e){return new kt(void 0,Rt,void 0,void 0,e)}}function kr(s,e,t,n){let i=e+1>t+20?e-t-1:0,r=s.slice(i,e);return r.push(n),r}function Q1(s,e){let t=[],n=!1;return s.iterChangedRanges((i,r)=>t.push(i,r)),e.iterChangedRanges((i,r,l,o)=>{for(let a=0;a=h&&l<=c&&(n=!0)}}),n}function eb(s,e){return s.ranges.length==e.ranges.length&&s.ranges.filter((t,n)=>t.empty!=e.ranges[n].empty).length===0}function Dd(s,e){return s.length?e.length?s.concat(e):s:e}const Rt=[],tb=200;function Od(s,e){if(s.length){let t=s[s.length-1],n=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-tb));return n.length&&n[n.length-1].eq(e)?s:(n.push(e),kr(s,s.length-1,1e9,t.setSelAfter(n)))}else return[kt.selection([e])]}function nb(s){let e=s[s.length-1],t=s.slice();return t[s.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function xl(s,e){if(!s.length)return s;let t=s.length,n=Rt;for(;t;){let i=ib(s[t-1],e,n);if(i.changes&&!i.changes.empty||i.effects.length){let r=s.slice(0,t);return r[t-1]=i,r}else e=i.mapped,t--,n=i.selectionsAfter}return n.length?[kt.selection(n)]:Rt}function ib(s,e,t){let n=Dd(s.selectionsAfter.length?s.selectionsAfter.map(o=>o.map(e)):Rt,t);if(!s.changes)return kt.selection(n);let i=s.changes.map(e),r=e.mapDesc(s.changes,!0),l=s.mapped?s.mapped.composeDesc(r):r;return new kt(i,Pe.mapEffects(s.effects,e),l,s.startSelection.map(r),n)}const sb=/^(input\.type|delete)($|\.)/;class fn{constructor(e,t,n=0,i=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=i}isolate(){return this.prevTime?new fn(this.done,this.undone):this}addChanges(e,t,n,i,r){let l=this.done,o=l[l.length-1];return o&&o.changes&&!o.changes.empty&&e.changes&&(!n||sb.test(n))&&(!o.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?s.moveByChar(t,e):Lr(t,e))}function ct(s){return s.textDirectionAt(s.state.selection.main.head)==Ue.LTR}const $d=s=>Pd(s,!ct(s)),Bd=s=>Pd(s,ct(s));function Nd(s,e){return Kt(s,t=>t.empty?s.moveByGroup(t,e):Lr(t,e))}const rb=s=>Nd(s,!ct(s)),lb=s=>Nd(s,ct(s));function ob(s,e,t){if(e.type.prop(t))return!0;let n=e.to-e.from;return n&&(n>2||/[^\s,.;:]/.test(s.sliceDoc(e.from,e.to)))||e.firstChild}function Rr(s,e,t){let n=Ot(s).resolveInner(e.head),i=t?ve.closedBy:ve.openedBy;for(let a=e.head;;){let h=t?n.childAfter(a):n.childBefore(a);if(!h)break;ob(s,h,i)?n=h:a=t?h.to:h.from}let r=n.type.prop(i),l,o;return r&&(l=t?cn(s,n.from,1):cn(s,n.to,-1))&&l.matched?o=t?l.end.to:l.end.from:o=t?n.to:n.from,F.cursor(o,t?-1:1)}const ab=s=>Kt(s,e=>Rr(s.state,e,!ct(s))),hb=s=>Kt(s,e=>Rr(s.state,e,ct(s)));function Ld(s,e){return Kt(s,t=>{if(!t.empty)return Lr(t,e);let n=s.moveVertically(t,e);return n.head!=t.head?n:s.moveToLineBoundary(t,e)})}const Rd=s=>Ld(s,!1),Id=s=>Ld(s,!0);function zd(s){let e=s.scrollDOM.clientHeightl.empty?s.moveVertically(l,e,t.height):Lr(l,e));if(i.eq(n.selection))return!1;let r;if(t.selfScroll){let l=s.coordsAtPos(n.selection.main.head),o=s.scrollDOM.getBoundingClientRect(),a=o.top+t.marginTop,h=o.bottom-t.marginBottom;l&&l.top>a&&l.bottomjd(s,!1),mo=s=>jd(s,!0);function Un(s,e,t){let n=s.lineBlockAt(e.head),i=s.moveToLineBoundary(e,t);if(i.head==e.head&&i.head!=(t?n.to:n.from)&&(i=s.moveToLineBoundary(e,t,!1)),!t&&i.head==n.from&&n.length){let r=/^\s*/.exec(s.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;r&&e.head!=n.from+r&&(i=F.cursor(n.from+r))}return i}const cb=s=>Kt(s,e=>Un(s,e,!0)),fb=s=>Kt(s,e=>Un(s,e,!1)),ub=s=>Kt(s,e=>Un(s,e,!ct(s))),db=s=>Kt(s,e=>Un(s,e,ct(s))),pb=s=>Kt(s,e=>F.cursor(s.lineBlockAt(e.head).from,1)),gb=s=>Kt(s,e=>F.cursor(s.lineBlockAt(e.head).to,-1));function mb(s,e,t){let n=!1,i=Oi(s.selection,r=>{let l=cn(s,r.head,-1)||cn(s,r.head,1)||r.head>0&&cn(s,r.head-1,1)||r.headmb(s,e,!1);function jt(s,e){let t=Oi(s.state.selection,n=>{let i=e(n);return F.range(n.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)});return t.eq(s.state.selection)?!1:(s.dispatch(gn(s.state,t)),!0)}function Vd(s,e){return jt(s,t=>s.moveByChar(t,e))}const Hd=s=>Vd(s,!ct(s)),Fd=s=>Vd(s,ct(s));function Wd(s,e){return jt(s,t=>s.moveByGroup(t,e))}const _b=s=>Wd(s,!ct(s)),kb=s=>Wd(s,ct(s)),vb=s=>jt(s,e=>Rr(s.state,e,!ct(s))),yb=s=>jt(s,e=>Rr(s.state,e,ct(s)));function qd(s,e){return jt(s,t=>s.moveVertically(t,e))}const Ud=s=>qd(s,!1),Kd=s=>qd(s,!0);function Jd(s,e){return jt(s,t=>s.moveVertically(t,e,zd(s).height))}const qh=s=>Jd(s,!1),Uh=s=>Jd(s,!0),wb=s=>jt(s,e=>Un(s,e,!0)),Sb=s=>jt(s,e=>Un(s,e,!1)),xb=s=>jt(s,e=>Un(s,e,!ct(s))),Ab=s=>jt(s,e=>Un(s,e,ct(s))),Cb=s=>jt(s,e=>F.cursor(s.lineBlockAt(e.head).from)),Mb=s=>jt(s,e=>F.cursor(s.lineBlockAt(e.head).to)),Kh=({state:s,dispatch:e})=>(e(gn(s,{anchor:0})),!0),Jh=({state:s,dispatch:e})=>(e(gn(s,{anchor:s.doc.length})),!0),Gh=({state:s,dispatch:e})=>(e(gn(s,{anchor:s.selection.main.anchor,head:0})),!0),Yh=({state:s,dispatch:e})=>(e(gn(s,{anchor:s.selection.main.anchor,head:s.doc.length})),!0),Tb=({state:s,dispatch:e})=>(e(s.update({selection:{anchor:0,head:s.doc.length},userEvent:"select"})),!0),Eb=({state:s,dispatch:e})=>{let t=zr(s).map(({from:n,to:i})=>F.range(n,Math.min(i+1,s.doc.length)));return e(s.update({selection:F.create(t),userEvent:"select"})),!0},Db=({state:s,dispatch:e})=>{let t=Oi(s.selection,n=>{var i;let r=Ot(s).resolveInner(n.head,1);for(;!(r.from=n.to||r.to>n.to&&r.from<=n.from||!(!((i=r.parent)===null||i===void 0)&&i.parent));)r=r.parent;return F.range(r.to,r.from)});return e(gn(s,t)),!0},Ob=({state:s,dispatch:e})=>{let t=s.selection,n=null;return t.ranges.length>1?n=F.create([t.main]):t.main.empty||(n=F.create([F.cursor(t.main.head)])),n?(e(gn(s,n)),!0):!1};function Ir(s,e){if(s.state.readOnly)return!1;let t="delete.selection",{state:n}=s,i=n.changeByRange(r=>{let{from:l,to:o}=r;if(l==o){let a=e(l);al&&(t="delete.forward",a=Hs(s,a,!0)),l=Math.min(l,a),o=Math.max(o,a)}else l=Hs(s,l,!1),o=Hs(s,o,!0);return l==o?{range:r}:{changes:{from:l,to:o},range:F.cursor(l)}});return i.changes.empty?!1:(s.dispatch(n.update(i,{scrollIntoView:!0,userEvent:t,effects:t=="delete.selection"?ce.announce.of(n.phrase("Selection deleted")):void 0})),!0)}function Hs(s,e,t){if(s instanceof ce)for(let n of s.state.facet(ce.atomicRanges).map(i=>i(s)))n.between(e,e,(i,r)=>{ie&&(e=t?r:i)});return e}const Gd=(s,e)=>Ir(s,t=>{let{state:n}=s,i=n.doc.lineAt(t),r,l;if(!e&&t>i.from&&tGd(s,!1),Yd=s=>Gd(s,!0),Xd=(s,e)=>Ir(s,t=>{let n=t,{state:i}=s,r=i.doc.lineAt(n),l=i.charCategorizer(n);for(let o=null;;){if(n==(e?r.to:r.from)){n==t&&r.number!=(e?i.doc.lines:1)&&(n+=e?1:-1);break}let a=Ct(r.text,n-r.from,e)+r.from,h=r.text.slice(Math.min(n,a)-r.from,Math.max(n,a)-r.from),c=l(h);if(o!=null&&c!=o)break;(h!=" "||n!=t)&&(o=c),n=a}return n}),Zd=s=>Xd(s,!1),Pb=s=>Xd(s,!0),Qd=s=>Ir(s,e=>{let t=s.lineBlockAt(e).to;return eIr(s,e=>{let t=s.lineBlockAt(e).from;return e>t?t:Math.max(0,e-1)}),Bb=({state:s,dispatch:e})=>{if(s.readOnly)return!1;let t=s.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:De.of(["",""])},range:F.cursor(n.from)}));return e(s.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},Nb=({state:s,dispatch:e})=>{if(s.readOnly)return!1;let t=s.changeByRange(n=>{if(!n.empty||n.from==0||n.from==s.doc.length)return{range:n};let i=n.from,r=s.doc.lineAt(i),l=i==r.from?i-1:Ct(r.text,i-r.from,!1)+r.from,o=i==r.to?i+1:Ct(r.text,i-r.from,!0)+r.from;return{changes:{from:l,to:o,insert:s.doc.slice(i,o).append(s.doc.slice(l,i))},range:F.cursor(o)}});return t.changes.empty?!1:(e(s.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function zr(s){let e=[],t=-1;for(let n of s.selection.ranges){let i=s.doc.lineAt(n.from),r=s.doc.lineAt(n.to);if(!n.empty&&n.to==r.from&&(r=s.doc.lineAt(n.to-1)),t>=i.number){let l=e[e.length-1];l.to=r.to,l.ranges.push(n)}else e.push({from:i.from,to:r.to,ranges:[n]});t=r.number+1}return e}function ep(s,e,t){if(s.readOnly)return!1;let n=[],i=[];for(let r of zr(s)){if(t?r.to==s.doc.length:r.from==0)continue;let l=s.doc.lineAt(t?r.to+1:r.from-1),o=l.length+1;if(t){n.push({from:r.to,to:l.to},{from:r.from,insert:l.text+s.lineBreak});for(let a of r.ranges)i.push(F.range(Math.min(s.doc.length,a.anchor+o),Math.min(s.doc.length,a.head+o)))}else{n.push({from:l.from,to:r.from},{from:r.to,insert:s.lineBreak+l.text});for(let a of r.ranges)i.push(F.range(a.anchor-o,a.head-o))}}return n.length?(e(s.update({changes:n,scrollIntoView:!0,selection:F.create(i,s.selection.mainIndex),userEvent:"move.line"})),!0):!1}const Lb=({state:s,dispatch:e})=>ep(s,e,!1),Rb=({state:s,dispatch:e})=>ep(s,e,!0);function tp(s,e,t){if(s.readOnly)return!1;let n=[];for(let i of zr(s))t?n.push({from:i.from,insert:s.doc.slice(i.from,i.to)+s.lineBreak}):n.push({from:i.to,insert:s.lineBreak+s.doc.slice(i.from,i.to)});return e(s.update({changes:n,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Ib=({state:s,dispatch:e})=>tp(s,e,!1),zb=({state:s,dispatch:e})=>tp(s,e,!0),jb=s=>{if(s.state.readOnly)return!1;let{state:e}=s,t=e.changes(zr(e).map(({from:i,to:r})=>(i>0?i--:rs.moveVertically(i,!0)).map(t);return s.dispatch({changes:t,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Vb(s,e){if(/\(\)|\[\]|\{\}/.test(s.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=Ot(s).resolveInner(e),n=t.childBefore(e),i=t.childAfter(e),r;return n&&i&&n.to<=e&&i.from>=e&&(r=n.type.prop(ve.closedBy))&&r.indexOf(i.name)>-1&&s.doc.lineAt(n.to).from==s.doc.lineAt(i.from).from?{from:n.to,to:i.from}:null}const Hb=np(!1),Fb=np(!0);function np(s){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(i=>{let{from:r,to:l}=i,o=e.doc.lineAt(r),a=!s&&r==l&&Vb(e,r);s&&(r=l=(l<=o.to?o:e.doc.lineAt(l)).to);let h=new $r(e,{simulateBreak:r,simulateDoubleBreak:!!a}),c=Lo(h,r);for(c==null&&(c=/^\s*/.exec(e.doc.lineAt(r).text)[0].length);lo.from&&r{let i=[];for(let l=n.from;l<=n.to;){let o=s.doc.lineAt(l);o.number>t&&(n.empty||n.to>o.from)&&(e(o,i,n),t=o.number),l=o.to+1}let r=s.changes(i);return{changes:i,range:F.range(r.mapPos(n.anchor,1),r.mapPos(n.head,1))}})}const Wb=({state:s,dispatch:e})=>{if(s.readOnly)return!1;let t=Object.create(null),n=new $r(s,{overrideIndentation:r=>{let l=t[r];return l??-1}}),i=Vo(s,(r,l,o)=>{let a=Lo(n,r.from);if(a==null)return;/\S/.test(r.text)||(a=0);let h=/^\s*/.exec(r.text)[0],c=cs(s,a);(h!=c||o.froms.readOnly?!1:(e(s.update(Vo(s,(t,n)=>{n.push({from:t.from,insert:s.facet(Pr)})}),{userEvent:"input.indent"})),!0),sp=({state:s,dispatch:e})=>s.readOnly?!1:(e(s.update(Vo(s,(t,n)=>{let i=/^\s*/.exec(t.text)[0];if(!i)return;let r=gs(i,s.tabSize),l=0,o=cs(s,Math.max(0,r-mr(s)));for(;l({mac:s.key,run:s.run,shift:s.shift}))),Kb=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:ab,shift:vb},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:hb,shift:yb},{key:"Alt-ArrowUp",run:Lb},{key:"Shift-Alt-ArrowUp",run:Ib},{key:"Alt-ArrowDown",run:Rb},{key:"Shift-Alt-ArrowDown",run:zb},{key:"Escape",run:Ob},{key:"Mod-Enter",run:Fb},{key:"Alt-l",mac:"Ctrl-l",run:Eb},{key:"Mod-i",run:Db,preventDefault:!0},{key:"Mod-[",run:sp},{key:"Mod-]",run:ip},{key:"Mod-Alt-\\",run:Wb},{key:"Shift-Mod-k",run:jb},{key:"Shift-Mod-\\",run:bb},{key:"Mod-/",run:V1},{key:"Alt-A",run:F1}].concat(Ub),Jb={key:"Tab",run:ip,shift:sp};let ft=[],Gb=(s,e)=>{let t,n=[],i={lc:0,l:e||0,value:s,set(r){i.value=r,i.notify()},get(){return i.lc||i.listen(()=>{})(),i.value},notify(r){t=n;let l=!ft.length;for(let o=0;o{n===t&&(n=n.slice());let o=n.indexOf(r);~o&&(n.splice(o,2),i.lc--,i.lc||i.off())}},subscribe(r,l){let o=i.listen(r,l);return r(i.value),o},off(){}};return i},Yb=(s={})=>{let e=Gb(s);return e.setKey=function(t,n){typeof n>"u"?t in e.value&&(e.value={...e.value},delete e.value[t],e.notify(t)):e.value[t]!==n&&(e.value={...e.value,[t]:n},e.notify(t))},e};var Xb=()=>Yb({view:null,extensions:null,value:null}),Zb=(s,e)=>{if(zn(e))throw new Error("No options provided. At least `value` is required.");let{value:t,instanceStore:n,onChangeBehavior:i={kind:"debounce",duration:50}}=e,r,l=new Promise($=>r=$),o,a=[];const h=new Nt,c=new Nt,f=new Nt,u=new Nt,d=new Nt,p=new Nt,g=new Nt,m=new Nt,_=ce.updateListener.of($=>D($));async function v($){return Promise.all([_,p.of(ic($)),g.of(await tc($)),h.of(await Xh($)??[]),Ku.of([...Kb,...$.useTabs?[Jb]:[]]),c.of(await Zh($)),f.of(Qh($)),u.of(await ec($)),d.of(nc($)),m.of(await sc($))])}function E($){const G=o.state.doc.toString();gi(G,t)||(t=G,s.dispatchEvent(new CustomEvent("codemirror:textChange",{detail:t}))),n==null||n.set({value:t,view:o,extensions:a}),s.dispatchEvent(new CustomEvent("codemirror:change",{detail:$}))}const{kind:w="debounce",duration:B=50}=i;let D=w==="debounce"?rc(E,B):lc(E,B);return(async()=>{a=await v(e);const $=ye.create({doc:t,extensions:a,selection:{anchor:e.cursorPos??0,head:e.cursorPos??0}});o=new ce({state:$,parent:s}),zn(e.cursorPos)||o.focus(),r()})(),{async update($){var O,T;await l;const G={};gi(t,$.value)||(t=$.value,G.changes={from:0,to:o.state.doc.length,insert:t}),!zn($.cursorPos)&&!gi(e.cursorPos,$.cursorPos)&&(G.selection={anchor:$.cursorPos??0,head:$.cursorPos??0},o.focus());async function L(Q,ie,J){G.effects=G.effects??[];const fe=G.effects;let z=!0;for(const oe of ie){const ge=$[oe],We=e[oe];if(!zn(ge)&&(z=!1,!gi(ge,We)))return fe.push(Q.reconfigure(await J($)))}z&&fe.push(Q.reconfigure([]))}await Promise.all([L(h,["setup"],Xh),L(c,["lang"],Zh),L(u,["useTabs","tabSize"],ec),L(f,["theme"],Qh),L(p,["extensions"],ic),L(d,["readonly"],nc),L(g,["autocomplete"],tc),L(m,["lint","lintOptions"],sc)]),o.dispatch(G);const{kind:V="debounce",duration:H=50}=$.onChangeBehavior??{kind:"debounce",duration:50};(!gi((O=e.onChangeBehavior)==null?void 0:O.kind,V)||!gi((T=e.onChangeBehavior)==null?void 0:T.duration,H))&&(D=V==="debounce"?rc(E,H):lc(E,H)),e=$,a=await v($)},destroy(){l.then(()=>o==null?void 0:o.destroy())}}};async function Xh(s){const{setup:e}=s;if(zn(e))return[];if(e==="basic")return(await Cn(()=>import("./basic-setup-BJSL5TOQ.2d40ffcc.js"),["_app/immutable/chunks/basic-setup-BJSL5TOQ.2d40ffcc.js","_app/immutable/chunks/index.6b0eed4b.js","_app/immutable/chunks/index.69bb2f53.js"])).default(s);if(e==="minimal")return(await Cn(()=>import("./minimal-setup-Y523JPZT.d07eb42d.js"),[])).default(s);throw new Error("`setup` can only be `basic` or `minimal`. If you wish to provide another setup, pass through `extensions` prop.")}async function Zh({lang:s,langMap:e}){if(zn(s))return[];if(typeof s=="string"){if(!e)throw new Error("`langMap` is required when `lang` is a string.");if(!(s in e))throw new Error(`Language "${s}" is not defined in \`langMap\`.`);return await e[s]()}return s}function Qh({theme:s,styles:e}){return[s,e&&ce.theme(e)].filter(Boolean)}async function ec({useTabs:s=!1,tabSize:e=2}){return[ye.tabSize.of(e),Pr.of(s?" ":" ".repeat(e))]}async function tc({autocomplete:s}){if(zn(s))return[];const{autocompletion:e}=await Cn(()=>import("./index.6b0eed4b.js"),[]);return e(typeof s=="object"&&s?s:{})}function nc({readonly:s}){return ye.readOnly.of(!!s)}function ic({extensions:s}){return s??[]}async function sc({lint:s,lintOptions:e={}}){if(zn(s))return[];if(!Qb(s))throw new Error("`lint` must be a function.");const{linter:t}=await Cn(()=>import("./index.69bb2f53.js").then(n=>n.i),[]);return t(s,e)}var gi=(s,e)=>s===e,zn=s=>typeof s>"u",Qb=s=>typeof s=="function";function rc(s,e,t=!1){let n;return function(...r){const l=this;n?clearTimeout(n):t&&s.apply(l,r),n=setTimeout(o,e||100);function o(){t||s.apply(l,r),n=null}}}function lc(s,e){let t,n=!1;function i(r){if(t){s.apply(r,t),setTimeout(i,e,r),t=null;return}n=!1}return function(...l){const o=this;if(n){t=l;return}s.apply(o,l),n=!0,setTimeout(i,e,o)}}function e_(s){let e;const t=s[7].default,n=Mt(t,s,s[6],null);return{c(){n&&n.c()},l(i){n&&n.l(i)},m(i,r){n&&n.m(i,r),e=!0},p(i,r){n&&n.p&&(!e||r&64)&&Tt(n,t,i,i[6],e?Dt(t,i[6],r,null):Et(i[6]),null)},i(i){e||(S(n,i),e=!0)},o(i){M(n,i),e=!1},d(i){n&&n.d(i)}}}function t_(s){let e,t=s[4](s[1])+"",n,i,r;return{c(){e=A("button"),n=R(t),this.h()},l(l){e=C(l,"BUTTON",{class:!0});var o=P(e);n=I(o,t),o.forEach(b),this.h()},h(){k(e,"class","svelte-1w145fq"),ne(e,"navigable",s[1].filename)},m(l,o){x(l,e,o),y(e,n),i||(r=[ue(e,"click",s[8]),ue(e,"keyup",s[9])],i=!0)},p(l,o){o&2&&t!==(t=l[4](l[1])+"")&&re(n,t),o&2&&ne(e,"navigable",l[1].filename)},i:de,o:de,d(l){l&&b(e),i=!1,Dn(r)}}}function n_(s){let e,t,n,i,r,l;const o=[t_,e_],a=[];function h(c,f){return c[1]?0:1}return t=h(s),n=a[t]=o[t](s),{c(){e=A("div"),n.c(),this.h()},l(c){e=C(c,"DIV",{class:!0});var f=P(e);n.l(f),f.forEach(b),this.h()},h(){k(e,"class",i="message "+s[0]+" svelte-1w145fq"),ne(e,"truncate",s[2])},m(c,f){x(c,e,f),a[t].m(e,null),l=!0},p(c,[f]){let u=t;t=h(c),t===u?a[t].p(c,f):(we(),M(a[u],1,1,()=>{a[u]=null}),Se(),n=a[t],n?n.p(c,f):(n=a[t]=o[t](c),n.c()),S(n,1),n.m(e,null)),(!l||f&1&&i!==(i="message "+c[0]+" svelte-1w145fq"))&&k(e,"class",i),(!l||f&5)&&ne(e,"truncate",c[2])},i(c){l||(S(n),c&&Cr(()=>{l&&(r||(r=oa(e,ha,{duration:100},!0)),r.run(1))}),l=!0)},o(c){M(n),c&&(r||(r=oa(e,ha,{duration:100},!1)),r.run(0)),l=!1},d(c){c&&b(e),a[t].d(),c&&r&&r.end()}}}function i_(s,e,t){let{$$slots:n={},$$scope:i}=e,{kind:r="info"}=e,{details:l=void 0}=e,{filename:o=void 0}=e,{truncate:a=!1}=e;const{go_to_warning_pos:h}=ai();function c(d){let p=d.message||"[missing message]",g=[];return d.filename&&d.filename!==o&&g.push(d.filename),d.start&&g.push(d.start.line,d.start.column),p+(g.length?` (${g.join(":")})`:"")}const f=()=>h(l),u=d=>d.key===" "&&h(l);return s.$$set=d=>{"kind"in d&&t(0,r=d.kind),"details"in d&&t(1,l=d.details),"filename"in d&&t(5,o=d.filename),"truncate"in d&&t(2,a=d.truncate),"$$scope"in d&&t(6,i=d.$$scope)},[r,l,a,h,c,o,i,n,f,u]}class Pi extends _e{constructor(e){super(),ke(this,e,i_,n_,be,{kind:0,details:1,filename:5,truncate:2})}}const s_=ce.theme({"&":{color:"var(--sk-code-base)",backgroundColor:"transparent"},".cm-content":{caretColor:"var(--sk-theme-3)"},".cm-cursor, .cm-dropCursor":{borderLeftColor:"var(--sk-theme-3)"},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"var(--sk-selection-color)"},".cm-panels":{backgroundColor:"var(--sk-back-2)",color:"var(--sk-text-2)"},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"var(--sk-theme-2)"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:"var(--sk-back-3)",border:"none"},".cm-activeLineGutter":{backgroundColor:"var(--sk-back-4)"},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:"var(--sk-back-3)"},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:"var(--sk-back-3)",borderBottomColor:"var(--sk-back-3)"},".cm-tooltip-autocomplete":{color:"var(--sk-text-2) !important",perspective:"1px","& > ul > li[aria-selected]":{backgroundColor:"var(--sk-back-4)",color:"var(--sk-text-1) !important"}}},{dark:!0}),r_=vs.define([{tag:N.keyword,color:"var(--sk-code-keyword)"},{tag:[N.name,N.deleted,N.character,N.propertyName,N.macroName],color:"var(--sk-code-base)"},{tag:[N.function(N.variableName),N.labelName],color:"var(--sk-code-tags)"},{tag:[N.color,N.constant(N.name),N.standard(N.name)],color:"var(--sk-code-base)"},{tag:[N.definition(N.name),N.separator],color:"var(--sk-code-base)"},{tag:[N.typeName,N.className,N.number,N.changed,N.annotation,N.modifier,N.self,N.namespace],color:"var(--sk-code-tags)"},{tag:[N.operator,N.operatorKeyword,N.url,N.escape,N.regexp,N.link,N.special(N.string)],color:"var(--sk-code-base)"},{tag:[N.meta,N.comment],color:"var(--sk-code-comment)"},{tag:N.strong,fontWeight:"bold"},{tag:N.emphasis,fontStyle:"italic"},{tag:N.strikethrough,textDecoration:"line-through"},{tag:N.link,color:"var(--sk-code-base)",textDecoration:"underline"},{tag:N.heading,fontWeight:"bold",color:"var(--sk-text-1)"},{tag:[N.atom,N.bool],color:"var(--sk-code-atom)"},{tag:[N.processingInstruction,N.string,N.inserted],color:"var(--sk-code-string)"},{tag:N.invalid,color:"#ff008c"}]),oc=[s_,C1(r_)];function ac(s){let e,t,n,i,r,l;return r=new Pi({props:{kind:"info",$$slots:{default:[l_]},$$scope:{ctx:s}}}),{c(){e=A("pre"),t=R(s[5]),n=X(),i=A("div"),W(r.$$.fragment),this.h()},l(o){e=C(o,"PRE",{style:!0,class:!0});var a=P(e);t=I(a,s[5]),a.forEach(b),n=Z(o),i=C(o,"DIV",{style:!0});var h=P(i);K(r.$$.fragment,h),h.forEach(b),this.h()},h(){it(e,"position","absolute"),it(e,"left","0"),it(e,"top","0"),k(e,"class","svelte-1s16tri"),it(i,"position","absolute"),it(i,"width","100%"),it(i,"bottom","0")},m(o,a){x(o,e,a),y(e,t),x(o,n,a),x(o,i,a),q(r,i,null),l=!0},p(o,a){(!l||a[0]&32)&&re(t,o[5]);const h={};a[1]&4&&(h.$$scope={dirty:a,ctx:o}),r.$set(h)},i(o){l||(S(r.$$.fragment,o),l=!0)},o(o){M(r.$$.fragment,o),l=!1},d(o){o&&(b(e),b(n),b(i)),U(r)}}}function l_(s){let e;return{c(){e=R("loading editor...")},l(t){e=I(t,"loading editor...")},m(t,n){x(t,e,n)},d(t){t&&b(e)}}}function o_(s){let e,t,n,i,r,l=!s[4].view&&ac(s);return{c(){e=A("div"),l&&l.c(),this.h()},l(o){e=C(o,"DIV",{class:!0});var a=P(e);l&&l.l(a),a.forEach(b),this.h()},h(){k(e,"class","codemirror-container svelte-1s16tri")},m(o,a){x(o,e,a),l&&l.m(e,null),n=!0,i||(r=[Pf(t=Zb.call(null,e,{value:s[5],setup:"basic",useTabs:s[2],tabSize:2,theme:oc,readonly:s[1],cursorPos:s[7],lang:s[6],langMap:{js:hc,json:cc,md:fc,css:uc,svelte:dc},lint:s[0],lintOptions:{delay:200},autocomplete:s[3],extensions:[s[10]],instanceStore:s[9]})),ue(e,"codemirror:textChange",s[25])],i=!0)},p(o,a){o[4].view?l&&(we(),M(l,1,1,()=>{l=null}),Se()):l?(l.p(o,a),a[0]&16&&S(l,1)):(l=ac(o),l.c(),S(l,1),l.m(e,null)),t&&Bf(t.update)&&a[0]&239&&t.update.call(null,{value:o[5],setup:"basic",useTabs:o[2],tabSize:2,theme:oc,readonly:o[1],cursorPos:o[7],lang:o[6],langMap:{js:hc,json:cc,md:fc,css:uc,svelte:dc},lint:o[0],lintOptions:{delay:200},autocomplete:o[3],extensions:[o[10]],instanceStore:o[9]})},i(o){n||(S(l),n=!0)},o(o){M(l),n=!1},d(o){o&&b(e),l&&l.d(),i=!1,Dn(r)}}}const rp=lt(0),hc=()=>Cn(()=>import("./index.35753574.js").then(s=>s.i),["_app/immutable/chunks/index.35753574.js","_app/immutable/chunks/index.3a167c29.js","_app/immutable/chunks/scheduler.6381a9b9.js","_app/immutable/chunks/index.6b0eed4b.js"]).then(s=>s.javascript()),cc=()=>Cn(()=>import("./index.e9e1bf88.js"),["_app/immutable/chunks/index.e9e1bf88.js","_app/immutable/chunks/index.3a167c29.js","_app/immutable/chunks/scheduler.6381a9b9.js"]).then(s=>s.json()),fc=()=>Cn(()=>import("./index.9a280567.js"),["_app/immutable/chunks/index.9a280567.js","_app/immutable/chunks/index.6b0eed4b.js","_app/immutable/chunks/index.0dcb629e.js","_app/immutable/chunks/index.3a167c29.js","_app/immutable/chunks/scheduler.6381a9b9.js","_app/immutable/chunks/index.2cc1589e.js","_app/immutable/chunks/index.35753574.js"]).then(s=>s.markdown()),uc=()=>Cn(()=>import("./index.2cc1589e.js"),["_app/immutable/chunks/index.2cc1589e.js","_app/immutable/chunks/index.3a167c29.js","_app/immutable/chunks/scheduler.6381a9b9.js"]).then(s=>s.css()),dc=()=>Cn(()=>import("./index.2f611d82.js"),["_app/immutable/chunks/index.2f611d82.js","_app/immutable/chunks/index.3a167c29.js","_app/immutable/chunks/scheduler.6381a9b9.js","_app/immutable/chunks/index.2cc1589e.js","_app/immutable/chunks/index.35753574.js","_app/immutable/chunks/index.6b0eed4b.js","_app/immutable/chunks/index.0dcb629e.js"]).then(s=>s.svelte());function a_(s,e,t){let n,{errorLoc:i=null}=e,{diagnostics:r=void 0}=e,{readonly:l=!1}=e,{tab:o=!0}=e,{autocomplete:a=!0}=e;const h=Mr();let c="",f="svelte";async function u(z){d(z)}async function d(z){if(n.view&&(await ns(),z.lang&&z.lang!==f&&t(6,f=z.lang),z.code!==void 0)){const{scrollLeft:oe,scrollTop:ge}=n.view.scrollDOM;t(5,c=z.code),ze(V,n.view.scrollDOM.scrollTop=ge,n),ze(V,n.view.scrollDOM.scrollLeft=oe,n)}}function p(z){t(7,ie=z)}let g;const m=new Promise(z=>t(23,g=z));function _(){var z;(z=n.view)==null||z.requestMeasure()}function v(){var z;(z=n.view)==null||z.focus()}function E(){var z;return(z=n.view)==null?void 0:z.state.toJSON({history:Fh})}function w(z){var oe;n.view&&(n.view.setState(ye.fromJSON(z,{extensions:Q,doc:z.doc},{history:Fh})),(oe=n.view)==null||oe.dispatch({changes:{from:0,to:n.view.state.doc.length,insert:z.doc},effects:[Pe.reconfigure.of(n.extensions??[])]}))}async function B(){var z,oe;await ns(),(z=n.view)==null||z.setState(ye.create({extensions:Q,doc:""})),(oe=n.view)==null||oe.dispatch({changes:{from:0,to:n.view.state.doc.length,insert:""},effects:[Pe.reconfigure.of(n.extensions??[])]})}const D=Pe.define(),$=Pt.define({create(){return Re.none},update(z,oe){z=z.map(oe.changes);for(let ge of oe.effects)ge.is(D)&&(z=z.update({add:ge.value,sort:!0}));return z},provide:z=>ce.decorations.from(z)});function G({from:z,to:oe,className:ge="mark-text"}){var Ee;const We=Re.mark({class:ge});(Ee=n.view)==null||Ee.dispatch({effects:[Pe.appendConfig.of($),D.of([We.range(z,oe)])]})}function L(){var z;(z=n.view)==null||z.dispatch({effects:Pe.reconfigure.of(n.extensions??[])})}const V=Xb();Ce(s,V,z=>t(4,n=z));let H,O,T=!1,Q=[],ie=0;const J=ce.updateListener.of(z=>{z.selectionSet&&rp.set(z.state.selection.main.head)}),fe=({detail:z})=>{t(5,c=z),h("change",{value:c})};return s.$$set=z=>{"errorLoc"in z&&t(11,i=z.errorLoc),"diagnostics"in z&&t(0,r=z.diagnostics),"readonly"in z&&t(1,l=z.readonly),"tab"in z&&t(2,o=z.tab),"autocomplete"in z&&t(3,a=z.autocomplete)},s.$$.update=()=>{s.$$.dirty[0]&8388624&&n.view&&g(),s.$$.dirty[0]&16&&n.view&&H&&O&&_(),s.$$.dirty[0]&16779264&&i&&(G({from:i.character,to:i.character+1,className:"error-loc"}),i.line)},[r,l,o,a,n,c,f,ie,h,V,J,i,u,d,p,m,_,v,E,w,B,G,L,g,T,fe]}class jr extends _e{constructor(e){super(),ke(this,e,a_,o_,be,{errorLoc:11,diagnostics:0,readonly:1,tab:2,autocomplete:3,set:12,update:13,setCursor:14,isReady:15,resize:16,focus:17,getEditorState:18,setEditorState:19,clearEditorState:20,markText:21,unmarkText:22},null,[-1,-1])}get set(){return this.$$.ctx[12]}get update(){return this.$$.ctx[13]}get setCursor(){return this.$$.ctx[14]}get isReady(){return this.$$.ctx[15]}get resize(){return this.$$.ctx[16]}get focus(){return this.$$.ctx[17]}get getEditorState(){return this.$$.ctx[18]}get setEditorState(){return this.$$.ctx[19]}get clearEditorState(){return this.$$.ctx[20]}get markText(){return this.$$.ctx[21]}get unmarkText(){return this.$$.ctx[22]}}function pc(s,e,t){const n=s.slice();return n[17]=e[t],n}function h_(s){let e,t,n=Te(s[3]),i=[];for(let l=0;lM(i[l],1,1,()=>{i[l]=null});return{c(){for(let l=0;l0?1:-1}return~(l=u(s))&&(o=f[l]=c[l](s)),{c(){e=A("div"),t=A("div"),W(n.$$.fragment),i=X(),r=A("div"),o&&o.c(),this.h()},l(d){e=C(d,"DIV",{class:!0});var p=P(e);t=C(p,"DIV",{class:!0,translate:!0});var g=P(t);K(n.$$.fragment,g),g.forEach(b),i=Z(p),r=C(p,"DIV",{class:!0});var m=P(r);o&&o.l(m),m.forEach(b),p.forEach(b),this.h()},h(){k(t,"class","editor notranslate svelte-62nfk2"),k(t,"translate","no"),k(r,"class","info svelte-62nfk2"),k(e,"class","editor-wrapper svelte-62nfk2")},m(d,p){x(d,e,p),y(e,t),q(n,t,null),y(e,i),y(e,r),~l&&f[l].m(r,null),a=!0},p(d,[p]){const g={};p&1&&(g.errorLoc=d[0]),p&2&&(g.autocomplete=d[1]),n.$set(g);let m=l;l=u(d),l===m?~l&&f[l].p(d,p):(o&&(we(),M(f[m],1,1,()=>{f[m]=null}),Se()),~l?(o=f[l],o?o.p(d,p):(o=f[l]=c[l](d),o.c()),S(o,1),o.m(r,null)):o=null)},i(d){a||(S(n.$$.fragment,d),S(o),a=!0)},o(d){M(n.$$.fragment,d),M(o),a=!1},d(d){d&&b(e),s[15](null),U(n),~l&&f[l].d()}}}function u_(s,e,t){let n,i,r,l,o,{errorLoc:a=null}=e,{autocomplete:h}=e;function c(){o==null||o.focus()}const{bundle:f,handle_change:u,module_editor:d,selected:p,bundling:g}=ai();Ce(s,f,w=>t(14,l=w)),Ce(s,d,w=>t(5,o=w)),Ce(s,p,w=>t(13,i=w)),Ce(s,g,w=>t(16,r=w));let m=null,_=[];async function v(){return await r,[...i&&(m==null?void 0:m.filename)===Be(i)?[{from:m.start.character,to:m.end.character,severity:"error",message:m.message}]:[],..._.filter(w=>i&&w.filename===Be(i)).map(w=>({from:w.start.character,to:w.end.character,severity:"warning",message:w.message}))]}function E(w){Xe[w?"unshift":"push"](()=>{o=w,d.set(o)})}return s.$$set=w=>{"errorLoc"in w&&t(0,a=w.errorLoc),"autocomplete"in w&&t(1,h=w.autocomplete)},s.$$.update=()=>{s.$$.dirty&8192&&t(4,n=(i==null?void 0:i.name)+"."+(i==null?void 0:i.type)),s.$$.dirty&16384&&l&&(t(2,m=l==null?void 0:l.error),t(3,_=(l==null?void 0:l.warnings)??[]))},[a,h,m,_,n,o,f,u,d,p,g,v,c,i,l,E]}class d_ extends _e{constructor(e){super(),ke(this,e,u_,f_,be,{errorLoc:0,autocomplete:1,focus:12})}get focus(){return this.$$.ctx[12]}}function p_(s){let e,t,n;return{c(){e=A("input"),this.h()},l(i){e=C(i,"INPUT",{type:!0,class:!0}),this.h()},h(){k(e,"type","checkbox"),k(e,"class","svelte-1ja98dc")},m(i,r){x(i,e,r),e.checked=s[0],t||(n=ue(e,"change",s[1]),t=!0)},p(i,[r]){r&1&&(e.checked=i[0])},i:de,o:de,d(i){i&&b(e),t=!1,n()}}}function g_(s,e,t){let{checked:n=!1}=e;function i(){n=this.checked,t(0,n)}return s.$$set=r=>{"checked"in r&&t(0,n=r.checked)},[n,i]}class mi extends _e{constructor(e){super(),ke(this,e,g_,p_,be,{checked:0})}}function m_(s){let e,t,n="input",i,r,l,o,a,h,c="output",f;function u(p){s[1](p)}let d={};return s[0]!==void 0&&(d.checked=s[0]),l=new mi({props:d}),Xe.push(()=>ln(l,"checked",u)),{c(){e=A("label"),t=A("span"),t.textContent=n,i=X(),r=A("span"),W(l.$$.fragment),a=X(),h=A("span"),h.textContent=c,this.h()},l(p){e=C(p,"LABEL",{class:!0});var g=P(e);t=C(g,"SPAN",{style:!0,class:!0,"data-svelte-h":!0}),Me(t)!=="svelte-iwcvz2"&&(t.textContent=n),i=Z(g),r=C(g,"SPAN",{style:!0,class:!0});var m=P(r);K(l.$$.fragment,m),m.forEach(b),a=Z(g),h=C(g,"SPAN",{class:!0,"data-svelte-h":!0}),Me(h)!=="svelte-4pjs0t"&&(h.textContent=c),g.forEach(b),this.h()},h(){it(t,"text-align","right"),k(t,"class","svelte-l6oyfu"),ne(t,"active",!s[0]),it(r,"display","grid"),it(r,"place-items","center"),k(r,"class","svelte-l6oyfu"),k(h,"class","svelte-l6oyfu"),ne(h,"active",s[0]),k(e,"class","input-output-toggle svelte-l6oyfu")},m(p,g){x(p,e,g),y(e,t),y(e,i),y(e,r),q(l,r,null),y(e,a),y(e,h),f=!0},p(p,[g]){(!f||g&1)&&ne(t,"active",!p[0]);const m={};!o&&g&1&&(o=!0,m.checked=p[0],rn(()=>o=!1)),l.$set(m),(!f||g&1)&&ne(h,"active",p[0])},i(p){f||(S(l.$$.fragment,p),f=!0)},o(p){M(l.$$.fragment,p),f=!1},d(p){p&&b(e),U(l)}}}function b_(s,e,t){let{checked:n=!1}=e;function i(r){n=r,t(0,n)}return s.$$set=r=>{"checked"in r&&t(0,n=r.checked)},[n,i]}class __ extends _e{constructor(e){super(),ke(this,e,b_,m_,be,{checked:0})}}function Ho(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let Kn=Ho();function lp(s){Kn=s}const op=/[&<>"']/,k_=new RegExp(op.source,"g"),ap=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,v_=new RegExp(ap.source,"g"),y_={"&":"&","<":"<",">":">",'"':""","'":"'"},mc=s=>y_[s];function ot(s,e){if(e){if(op.test(s))return s.replace(k_,mc)}else if(ap.test(s))return s.replace(v_,mc);return s}const w_=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function hp(s){return s.replace(w_,(e,t)=>(t=t.toLowerCase(),t==="colon"?":":t.charAt(0)==="#"?t.charAt(1)==="x"?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const S_=/(^|[^\[])\^/g;function $e(s,e){s=typeof s=="string"?s:s.source,e=e||"";const t={replace:(n,i)=>(i=i.source||i,i=i.replace(S_,"$1"),s=s.replace(n,i),t),getRegex:()=>new RegExp(s,e)};return t}const x_=/[^\w:]/g,A_=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function bc(s,e,t){if(s){let n;try{n=decodeURIComponent(hp(t)).replace(x_,"").toLowerCase()}catch{return null}if(n.indexOf("javascript:")===0||n.indexOf("vbscript:")===0||n.indexOf("data:")===0)return null}e&&!A_.test(t)&&(t=E_(e,t));try{t=encodeURI(t).replace(/%25/g,"%")}catch{return null}return t}const Fs={},C_=/^[^:]+:\/*[^/]*$/,M_=/^([^:]+:)[\s\S]*$/,T_=/^([^:]+:\/*[^/]*)[\s\S]*$/;function E_(s,e){Fs[" "+s]||(C_.test(s)?Fs[" "+s]=s+"/":Fs[" "+s]=er(s,"/",!0)),s=Fs[" "+s];const t=s.indexOf(":")===-1;return e.substring(0,2)==="//"?t?e:s.replace(M_,"$1")+e:e.charAt(0)==="/"?t?e:s.replace(T_,"$1")+e:s+e}const vr={exec:function(){}};function _c(s,e){const t=s.replace(/\|/g,(r,l,o)=>{let a=!1,h=l;for(;--h>=0&&o[h]==="\\";)a=!a;return a?"|":" |"}),n=t.split(/ \|/);let i=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>e)n.splice(e);else for(;n.length{const r=i.match(/^\s+/);if(r===null)return i;const[l]=r;return l.length>=n.length?i.slice(n.length):i}).join(` `)}class yr{constructor(e){this.options=e||Kn}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:er(n,` `)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],i=P_(n,t[3]||"");return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,"$1"):t[2],text:i}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(/#$/.test(n)){const i=er(n,"#");(this.options.pedantic||!i||/ $/.test(i))&&(n=i.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const n=t[0].replace(/^ *>[ \t]?/gm,""),i=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(n);return this.lexer.state.top=i,{type:"blockquote",raw:t[0],tokens:r,text:n}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n,i,r,l,o,a,h,c,f,u,d,p,g=t[1].trim();const m=g.length>1,_={type:"list",raw:"",ordered:m,start:m?+g.slice(0,-1):"",loose:!1,items:[]};g=m?`\\d{1,9}\\${g.slice(-1)}`:`\\${g}`,this.options.pedantic&&(g=m?g:"[*+-]");const v=new RegExp(`^( {0,3}${g})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;e&&(p=!1,!(!(t=v.exec(e))||this.rules.block.hr.test(e)));){if(n=t[0],e=e.substring(n.length),c=t[2].split(` diff --git a/docs/_app/immutable/chunks/Markdown.9bc11fe5.js b/docs/_app/immutable/chunks/Markdown.3e9603ee.js similarity index 92% rename from docs/_app/immutable/chunks/Markdown.9bc11fe5.js rename to docs/_app/immutable/chunks/Markdown.3e9603ee.js index 0c79054..2be6dba 100644 --- a/docs/_app/immutable/chunks/Markdown.9bc11fe5.js +++ b/docs/_app/immutable/chunks/Markdown.3e9603ee.js @@ -1 +1 @@ -import{_ as f}from"./preload-helper.07ba51e7.js";import{s as T,f as E,a as $,g as w,h as P,c as C,d as u,j as A,i as p,w as L,$ as M,l as q,m as S,n as j,x as z,r as h,C as F,E as G,F as H,G as N,q as g,e as k}from"./scheduler.6381a9b9.js";import{S as B,i as J,g as O,t as d,c as R,a as m,b,d as K,m as D,e as I}from"./index.cf31950d.js";const et={home:async()=>(await f(()=>import("./page.3abd85bd.js"),["_app/immutable/chunks/page.3abd85bd.js","_app/immutable/chunks/scheduler.6381a9b9.js","_app/immutable/chunks/index.cf31950d.js","_app/immutable/chunks/SveltyPicker.3fdc3aea.js","_app/immutable/chunks/each.31dbf577.js","_app/immutable/chunks/index.dff5c7fd.js","_app/immutable/chunks/index.93a0d223.js","_app/immutable/assets/SveltyPicker.45a105f2.css"])).default,properties:async()=>(await f(()=>import("./page.f872a3e6.js"),["_app/immutable/chunks/page.f872a3e6.js","_app/immutable/chunks/scheduler.6381a9b9.js","_app/immutable/chunks/index.cf31950d.js"])).default,principles:async()=>(await f(()=>import("./page.64cb054f.js"),["_app/immutable/chunks/page.64cb054f.js","_app/immutable/chunks/scheduler.6381a9b9.js","_app/immutable/chunks/index.cf31950d.js"])).default,formatting:async()=>(await f(()=>import("./page.5c2f0afa.js"),["_app/immutable/chunks/page.5c2f0afa.js","_app/immutable/chunks/scheduler.6381a9b9.js","_app/immutable/chunks/index.cf31950d.js"])).default,"auto-commit":async()=>(await f(()=>import("./page.5f2a88df.js"),["_app/immutable/chunks/page.5f2a88df.js","_app/immutable/chunks/scheduler.6381a9b9.js","_app/immutable/chunks/index.cf31950d.js"])).default,"disabling-dates":async()=>(await f(()=>import("./page.5c14cbc7.js"),["_app/immutable/chunks/page.5c14cbc7.js","_app/immutable/chunks/scheduler.6381a9b9.js","_app/immutable/chunks/index.cf31950d.js"])).default,slots:async()=>(await f(()=>import("./page.4cbd535a.js"),["_app/immutable/chunks/page.4cbd535a.js","_app/immutable/chunks/scheduler.6381a9b9.js","_app/immutable/chunks/index.cf31950d.js"])).default,events:async()=>(await f(()=>import("./page.6836ddd9.js"),["_app/immutable/chunks/page.6836ddd9.js","_app/immutable/chunks/scheduler.6381a9b9.js","_app/immutable/chunks/index.cf31950d.js"])).default,theme:async()=>(await f(()=>import("./page.61cb0928.js"),["_app/immutable/chunks/page.61cb0928.js","_app/immutable/chunks/scheduler.6381a9b9.js","_app/immutable/chunks/index.cf31950d.js"])).default,localization:async()=>(await f(()=>import("./page.c40c8d69.js"),["_app/immutable/chunks/page.c40c8d69.js","_app/immutable/chunks/scheduler.6381a9b9.js","_app/immutable/chunks/index.cf31950d.js","_app/immutable/chunks/index.dff5c7fd.js"])).default,"global-config":async()=>(await f(()=>import("./page.75dcdfb4.js"),["_app/immutable/chunks/page.75dcdfb4.js","_app/immutable/chunks/scheduler.6381a9b9.js","_app/immutable/chunks/index.cf31950d.js"])).default};function V(l){let t,n;return{c(){t=E("h1"),n=q(l[0])},l(e){t=w(e,"H1",{});var a=P(t);n=S(a,l[0]),a.forEach(u)},m(e,a){p(e,t,a),L(t,n)},p(e,a){a&1&&j(n,e[0])},d(e){e&&u(t)}}}function Q(l){let t,n="loading ...";return{c(){t=E("div"),t.textContent=n,this.h()},l(e){t=w(e,"DIV",{class:!0,"data-svelte-h":!0}),z(t)!=="svelte-va05nw"&&(t.textContent=n),this.h()},h(){A(t,"class","text-center")},m(e,a){p(e,t,a)},p:h,i:h,o:h,d(e){e&&u(t)}}}function U(l){let t;const n=l[4].default,e=F(n,l,l[3],null);return{c(){e&&e.c()},l(a){e&&e.l(a)},m(a,_){e&&e.m(a,_),t=!0},p(a,_){e&&e.p&&(!t||_&8)&&G(e,n,a,a[3],t?N(n,a[3],_,null):H(a[3]),null)},i(a){t||(m(e,a),t=!0)},o(a){d(e,a),t=!1},d(a){e&&e.d(a)}}}function W(l){let t,n,e;var a=l[1];function _(i,r){return{}}return a&&(t=g(a,_())),{c(){t&&b(t.$$.fragment),n=k()},l(i){t&&K(t.$$.fragment,i),n=k()},m(i,r){t&&D(t,i,r),p(i,n,r),e=!0},p(i,r){if(r&2&&a!==(a=i[1])){if(t){O();const o=t;d(o.$$.fragment,1,0,()=>{I(o,1)}),R()}a?(t=g(a,_()),b(t.$$.fragment),m(t.$$.fragment,1),D(t,n.parentNode,n)):t=null}},i(i){e||(t&&m(t.$$.fragment,i),e=!0)},o(i){t&&d(t.$$.fragment,i),e=!1},d(i){i&&u(n),t&&I(t,i)}}}function X(l){let t,n,e,a,_,i=l[0]&&V(l);const r=[W,U,Q],o=[];function y(s,c){return s[1]?0:s[2].default?1:2}return e=y(l),a=o[e]=r[e](l),{c(){t=E("div"),i&&i.c(),n=$(),a.c(),this.h()},l(s){t=w(s,"DIV",{class:!0});var c=P(t);i&&i.l(c),n=C(c),a.l(c),c.forEach(u),this.h()},h(){A(t,"class","markdown-container svelte-1i37ee3")},m(s,c){p(s,t,c),i&&i.m(t,null),L(t,n),o[e].m(t,null),_=!0},p(s,[c]){s[0]?i?i.p(s,c):(i=V(s),i.c(),i.m(t,n)):i&&(i.d(1),i=null);let v=e;e=y(s),e===v?o[e].p(s,c):(O(),d(o[v],1,1,()=>{o[v]=null}),R(),a=o[e],a?a.p(s,c):(a=o[e]=r[e](s),a.c()),m(a,1),a.m(t,null))},i(s){_||(m(a),_=!0)},o(s){d(a),_=!1},d(s){s&&u(t),i&&i.d(),o[e].d()}}}function Y(l,t,n){let{$$slots:e={},$$scope:a}=t;const _=M(e);let{title:i}=t,{content:r}=t;return l.$$set=o=>{"title"in o&&n(0,i=o.title),"content"in o&&n(1,r=o.content),"$$scope"in o&&n(3,a=o.$$scope)},[i,r,_,a,e]}class at extends B{constructor(t){super(),J(this,t,Y,X,T,{title:0,content:1})}}export{at as M,et as f}; +import{_ as f}from"./preload-helper.07ba51e7.js";import{s as T,f as E,a as $,g as w,h as P,c as C,d as u,j as A,i as p,w as L,$ as M,l as q,m as S,n as j,x as z,r as h,C as F,E as G,F as H,G as N,q as g,e as k}from"./scheduler.6381a9b9.js";import{S as B,i as J,g as O,t as d,c as R,a as m,b,d as K,m as D,e as I}from"./index.cf31950d.js";const et={home:async()=>(await f(()=>import("./page.05889853.js"),["_app/immutable/chunks/page.05889853.js","_app/immutable/chunks/scheduler.6381a9b9.js","_app/immutable/chunks/index.cf31950d.js","_app/immutable/chunks/SveltyPicker.eae60443.js","_app/immutable/chunks/each.31dbf577.js","_app/immutable/chunks/index.dff5c7fd.js","_app/immutable/chunks/index.93a0d223.js","_app/immutable/assets/SveltyPicker.da9e068b.css"])).default,properties:async()=>(await f(()=>import("./page.f872a3e6.js"),["_app/immutable/chunks/page.f872a3e6.js","_app/immutable/chunks/scheduler.6381a9b9.js","_app/immutable/chunks/index.cf31950d.js"])).default,principles:async()=>(await f(()=>import("./page.64cb054f.js"),["_app/immutable/chunks/page.64cb054f.js","_app/immutable/chunks/scheduler.6381a9b9.js","_app/immutable/chunks/index.cf31950d.js"])).default,formatting:async()=>(await f(()=>import("./page.5c2f0afa.js"),["_app/immutable/chunks/page.5c2f0afa.js","_app/immutable/chunks/scheduler.6381a9b9.js","_app/immutable/chunks/index.cf31950d.js"])).default,"auto-commit":async()=>(await f(()=>import("./page.5f2a88df.js"),["_app/immutable/chunks/page.5f2a88df.js","_app/immutable/chunks/scheduler.6381a9b9.js","_app/immutable/chunks/index.cf31950d.js"])).default,"disabling-dates":async()=>(await f(()=>import("./page.5c14cbc7.js"),["_app/immutable/chunks/page.5c14cbc7.js","_app/immutable/chunks/scheduler.6381a9b9.js","_app/immutable/chunks/index.cf31950d.js"])).default,slots:async()=>(await f(()=>import("./page.4cbd535a.js"),["_app/immutable/chunks/page.4cbd535a.js","_app/immutable/chunks/scheduler.6381a9b9.js","_app/immutable/chunks/index.cf31950d.js"])).default,events:async()=>(await f(()=>import("./page.6836ddd9.js"),["_app/immutable/chunks/page.6836ddd9.js","_app/immutable/chunks/scheduler.6381a9b9.js","_app/immutable/chunks/index.cf31950d.js"])).default,theme:async()=>(await f(()=>import("./page.71926cf7.js"),["_app/immutable/chunks/page.71926cf7.js","_app/immutable/chunks/scheduler.6381a9b9.js","_app/immutable/chunks/index.cf31950d.js"])).default,localization:async()=>(await f(()=>import("./page.c40c8d69.js"),["_app/immutable/chunks/page.c40c8d69.js","_app/immutable/chunks/scheduler.6381a9b9.js","_app/immutable/chunks/index.cf31950d.js","_app/immutable/chunks/index.dff5c7fd.js"])).default,"global-config":async()=>(await f(()=>import("./page.75dcdfb4.js"),["_app/immutable/chunks/page.75dcdfb4.js","_app/immutable/chunks/scheduler.6381a9b9.js","_app/immutable/chunks/index.cf31950d.js"])).default};function V(l){let t,n;return{c(){t=E("h1"),n=q(l[0])},l(e){t=w(e,"H1",{});var a=P(t);n=S(a,l[0]),a.forEach(u)},m(e,a){p(e,t,a),L(t,n)},p(e,a){a&1&&j(n,e[0])},d(e){e&&u(t)}}}function Q(l){let t,n="loading ...";return{c(){t=E("div"),t.textContent=n,this.h()},l(e){t=w(e,"DIV",{class:!0,"data-svelte-h":!0}),z(t)!=="svelte-va05nw"&&(t.textContent=n),this.h()},h(){A(t,"class","text-center")},m(e,a){p(e,t,a)},p:h,i:h,o:h,d(e){e&&u(t)}}}function U(l){let t;const n=l[4].default,e=F(n,l,l[3],null);return{c(){e&&e.c()},l(a){e&&e.l(a)},m(a,_){e&&e.m(a,_),t=!0},p(a,_){e&&e.p&&(!t||_&8)&&G(e,n,a,a[3],t?N(n,a[3],_,null):H(a[3]),null)},i(a){t||(m(e,a),t=!0)},o(a){d(e,a),t=!1},d(a){e&&e.d(a)}}}function W(l){let t,n,e;var a=l[1];function _(i,r){return{}}return a&&(t=g(a,_())),{c(){t&&b(t.$$.fragment),n=k()},l(i){t&&K(t.$$.fragment,i),n=k()},m(i,r){t&&D(t,i,r),p(i,n,r),e=!0},p(i,r){if(r&2&&a!==(a=i[1])){if(t){O();const o=t;d(o.$$.fragment,1,0,()=>{I(o,1)}),R()}a?(t=g(a,_()),b(t.$$.fragment),m(t.$$.fragment,1),D(t,n.parentNode,n)):t=null}},i(i){e||(t&&m(t.$$.fragment,i),e=!0)},o(i){t&&d(t.$$.fragment,i),e=!1},d(i){i&&u(n),t&&I(t,i)}}}function X(l){let t,n,e,a,_,i=l[0]&&V(l);const r=[W,U,Q],o=[];function y(s,c){return s[1]?0:s[2].default?1:2}return e=y(l),a=o[e]=r[e](l),{c(){t=E("div"),i&&i.c(),n=$(),a.c(),this.h()},l(s){t=w(s,"DIV",{class:!0});var c=P(t);i&&i.l(c),n=C(c),a.l(c),c.forEach(u),this.h()},h(){A(t,"class","markdown-container svelte-1i37ee3")},m(s,c){p(s,t,c),i&&i.m(t,null),L(t,n),o[e].m(t,null),_=!0},p(s,[c]){s[0]?i?i.p(s,c):(i=V(s),i.c(),i.m(t,n)):i&&(i.d(1),i=null);let v=e;e=y(s),e===v?o[e].p(s,c):(O(),d(o[v],1,1,()=>{o[v]=null}),R(),a=o[e],a?a.p(s,c):(a=o[e]=r[e](s),a.c()),m(a,1),a.m(t,null))},i(s){_||(m(a),_=!0)},o(s){d(a),_=!1},d(s){s&&u(t),i&&i.d(),o[e].d()}}}function Y(l,t,n){let{$$slots:e={},$$scope:a}=t;const _=M(e);let{title:i}=t,{content:r}=t;return l.$$set=o=>{"title"in o&&n(0,i=o.title),"content"in o&&n(1,r=o.content),"$$scope"in o&&n(3,a=o.$$scope)},[i,r,_,a,e]}class at extends B{constructor(t){super(),J(this,t,Y,X,T,{title:0,content:1})}}export{at as M,et as f}; diff --git a/docs/_app/immutable/chunks/SveltyPicker.3fdc3aea.js b/docs/_app/immutable/chunks/SveltyPicker.3fdc3aea.js deleted file mode 100644 index 99aedd8..0000000 --- a/docs/_app/immutable/chunks/SveltyPicker.3fdc3aea.js +++ /dev/null @@ -1,4 +0,0 @@ -import{s as Vt,f as R,l as _e,a as ee,g as I,h as P,m as be,d as T,c as te,x as gt,j as y,v as j,i as K,w as E,y as X,n as ye,N as Re,L as At,af as bt,ag as yt,k as Jt,J as Ue,u as rt,Q as Un,O as qn,t as jn,p as _t,C as zn,E as Wn,F as Gn,G as Xn,o as Bl,e as Xe,M as Zn,W as Yt,U as Ze}from"./scheduler.6381a9b9.js";import{S as Rt,i as It,a as se,g as Be,t as ce,c as Oe,j as Dt,k as Nt,f as Ke,b as Kn,d as Jn,m as Qn,e as xn}from"./index.cf31950d.js";import{e as fe,u as ut,d as Pt,o as $n}from"./each.31dbf577.js";import{e as Ol}from"./index.dff5c7fd.js";import{c as Vl,f as Pe}from"./index.93a0d223.js";const Al={theme:"sdt-calendar-colors",format:"yyyy-mm-dd",formatType:"standard",displayFormat:null,displayFormatType:null,minuteIncrement:1,weekStart:1,inputClasses:"",todayBtnClasses:"sdt-action-btn sdt-today-btn",clearBtnClasses:"sdt-action-btn sdt-clear-btn",todayBtn:!0,clearBtn:!0,autocommit:!0,i18n:Ol},He=0,je=1,ve=2,Rl=3;function ot(n,e,t,l){var d,w;if(n instanceof Date)return n;const i=l==="php"?{date:"Y-m-d",datetime:"Y-m-d H:i",datetime_s:"Y-m-d H:i:s"}:{date:"yyyy-mm-dd",datetime:"yyyy-mm-dd hh:ii",datetime_s:"yyyy-mm-dd hh:ii:ss"};let s,u;/^\d{4}\-\d{1,2}\-\d{1,2}$/.test(n)?s=Ce.parseFormat(i.date,l):/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}$/.test(n)?s=Ce.parseFormat(i.datetime,l):/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}\:\d{1,2}[Z]{0,1}$/.test(n)?s=Ce.parseFormat(i.datetime_s,l):(/^([01]*\d|2[0-3])([0-5]\d)(?:[ ]([ap][m]|[AP][M]))?$/.test(n)&&(u=(d=n.match(/^([01]*\d|2[0-3])([0-5]\d)(?:[ ]([ap][m]|[AP][M]))?$/))==null?void 0:d.slice(1).filter(S=>S)),s=Ce.parseFormat(e,l));const r=u||n&&n.toString().match(Ce.nonpunctuation)||[];n=new Date,n.setHours(0,0,0,0);const o={},{setters_order:a,setters_map:c}=Ce.setters(l);let f,b;if(r.length!==s.parts.length&&s.parts.includes("S")){const S=(w=r[s.parts.indexOf("S")-1].match(/(\d+)([a-zA-Z]+)/))==null?void 0:w.slice(1,3);r.splice(s.parts.indexOf("S")-1,1,...S)}if(r.length===s.parts.length){for(var h=0,g=s.parts.length;hl.setHours(i),h:(l,i)=>l.setHours(i),HH:(l,i)=>l.setHours(i===12?0:i),H:(l,i)=>l.setHours(i===12?0:i),i:(l,i)=>l.setMinutes(i),s:(l,i)=>l.setSeconds(i),yyyy:(l,i)=>l.setFullYear(i),yy:(l,i)=>l.setFullYear((i<50?2e3:1900)+i),m:(l,i)=>{for(i-=1;i<0;)i+=12;for(i%=12,l.setMonth(i);l.getMonth()!==i;){if(isNaN(l.getMonth()))return l;l.setDate(l.getDate()-1)}return l},d:(l,i)=>l.setDate(i),p:(l,i)=>l.setHours(i===1&&l.getHours()<12?l.getHours()+12:l.getHours()),t:(l,i)=>l.setTime(i),mm:()=>{},M:()=>{},MM:()=>{},ii:()=>{},ss:()=>{},dd:()=>{},D:()=>{},DD:()=>{},P:()=>{}},t.mm=t.M=t.MM=t.m,t.ii=t.i,t.ss=t.s,t.dd=t.D=t.DD=t.d,t.P=t.p):(e=["Y","yy","m","M","F","n","d","D","j","l","N","S","H","G","h","g","i","s","p","P","U"],t={H:(l,i)=>l.setHours(i),G:(l,i)=>l.setHours(i),h:(l,i)=>l.setHours(i===12?0:i),g:(l,i)=>l.setHours(i===12?0:i),i:(l,i)=>l.setMinutes(i),s:(l,i)=>l.setSeconds(i),Y:(l,i)=>l.setFullYear(i),yy:(l,i)=>l.setFullYear((i<50?2e3:1900)+i),m:(l,i)=>{for(i-=1;i<0;)i+=12;for(i%=12,l.setMonth(i);l.getMonth()!==i;){if(isNaN(l.getMonth()))return l;l.setDate(l.getDate()-1)}return l},n:(l,i)=>l.setMonth(i-1),d:(l,i)=>l.setDate(i),a:(l,i)=>l.setHours(i===1?l.getHours()+12:l.getHours()),U:(l,i)=>l.setTime(i*1e3)},t.F=t.M=t.m,t.D=t.j=t.l=t.N=t.d,t.A=t.a),{setters_order:e,setters_map:t}}};function Il(n,e,t,l,i){if(t===He){let C=10,M=20;const H=-1,k=[];let v=[],Y=n.getFullYear()-n.getFullYear()%10;Y-=Y%20?12:10,Y%10&&(C=12,M=22);for(let V=0;V<32;V++)v.push(Y+V),v.length===4&&(k.push(v),v=[]);let B=[];return e[0]||(e[0]=new Date),e[0].getFullYear()>=Y&&B.push(e[0].getFullYear()%Y),{years:k,todayMark:H,nextFrom:M,prevTo:C,selectionMark:B}}if(t===je){let C=[],M=[],H=12,k=24;const v=n.toISOString().split("T")[0].substring(0,8),Y=new Date(v+"01 00:00:00"),B=Y.getFullYear()-1;Y.setFullYear(B);let V=0;for(let O=0;O<3;O++){for(let L=0;L<12;L++)Y.setMonth(L),M.push(l.monthsShort[L%12]),M.length===4&&(C.push(M),M=[]);Y.setFullYear(Y.getFullYear()+1)}let J=[];return e[0]||(e[0]=new Date),e[0].getFullYear()-B>=0&&e[0].getFullYear()-B<=2&&J.push(e[0].getMonth()+(e[0].getFullYear()-B||0)*12),{months:C,todayMark:V,nextFrom:k,prevTo:H,selectionMark:J}}let s=n||new Date,u=s.getFullYear(),r=s.getMonth();s.getDate(),s.getHours();let o=new Date,a=new Date(u,r-1,28,0,0,0,0),c=el(a.getFullYear(),a.getMonth());a.setDate(c),a.setDate(c-(a.getDay()-i+7)%7);let f=new Date(a);f.setDate(f.getDate()+42);let b=f.valueOf(),h=[],g=[],p=-1,d=[],w=0,S=42,N=0;for(;a.valueOf()u||a.getFullYear()===u&&a.getMonth()>r)&&(S=N-1),a.setDate(a.getDate()+1),a.getFullYear()===o.getFullYear()&&a.getMonth()===o.getMonth()&&a.getDate()===o.getDate()&&(p=N),d.length!==e.length&&e.map(C=>{a.getFullYear()===C.getFullYear()&&a.getMonth()===C.getMonth()&&a.getDate()===C.getDate()&&d.push(N)}),g.length===7&&(h.push(g),g=[]);return{grid:h,days:h,todayMark:p,prevTo:w,nextFrom:S,selectionMark:d}}function Nl(n,{duration:e=400,start:t=0,end:l=1,opacity:i=0}){const s=getComputedStyle(n),u=+s.opacity,r=s.transform==="none"?"":s.transform,o=1-t,a=u*(1-i);return l=l||1,{delay:0,duration:e,easing:Vl,css:(c,f)=>` - transform: ${r} scale(${l!==1?t+l*f:1-o*f}); - opacity: ${u-a*f}; - `}}function Qt(n,e,t){const l=n.slice();return l[47]=e[t],l[49]=t,l}function xt(n,e,t){const l=n.slice();l[50]=e[t],l[54]=t;const i=l[49]*7+l[54];l[51]=i;const s=l[50].getTime();return l[52]=s,l}function $t(n,e,t){const l=n.slice();return l[55]=e[t],l}function en(n,e,t){const l=n.slice();return l[47]=e[t],l[49]=t,l}function tn(n,e,t){const l=n.slice();l[59]=e[t],l[54]=t;const i=l[49]*4+l[54];return l[51]=i,l}function nn(n,e,t){const l=n.slice();return l[47]=e[t],l[49]=t,l}function ln(n,e,t){const l=n.slice();l[62]=e[t],l[54]=t;const i=l[49]*4+l[54];return l[51]=i,l}function sn(n){let e,t,l,i,s,u;return{c(){e=R("button"),t=bt("svg"),l=bt("path"),this.h()},l(r){e=I(r,"BUTTON",{type:!0,class:!0,title:!0});var o=P(e);t=yt(o,"svg",{class:!0,xmlns:!0,viewBox:!0,width:!0,height:!0});var a=P(t);l=yt(a,"path",{"fill-rule":!0,d:!0}),P(l).forEach(T),a.forEach(T),o.forEach(T),this.h()},h(){y(l,"fill-rule","evenodd"),y(l,"d","M1.5 8a6.5 6.5 0 1113 0 6.5 6.5 0 01-13 0zM8 0a8 8 0 100 16A8 8 0 008 0zm.5 4.75a.75.75 0 00-1.5 0v3.5a.75.75 0 00.471.696l2.5 1a.75.75 0 00.557-1.392L8.5 7.742V4.75z"),y(t,"class","sdt-svg svelte-14xtbbo"),y(t,"xmlns","http://www.w3.org/2000/svg"),y(t,"viewBox","0 0 16 16"),y(t,"width","16"),y(t,"height","16"),y(e,"type","button"),y(e,"class","std-btn std-btn-header icon-btn sdt-time-icon svelte-14xtbbo"),y(e,"title",i=n[3].timeView)},m(r,o){K(r,e,o),E(e,t),E(t,l),s||(u=X(e,"click",n[27]),s=!0)},p(r,o){o[0]&8&&i!==(i=r[3].timeView)&&y(e,"title",i)},d(r){r&&T(e),s=!1,u()}}}function on(n){let e,t,l,i,s,u,r,o,a=fe(n[15].years),c=[];for(let f=0;f{u&&(s&&s.end(1),i=Dt(t,n[18],{duration:Je,start:n[20],opacity:1}),i.start())}),u=!0)},o(f){i&&i.invalidate(),f&&(s=Nt(t,n[18],{duration:Je,end:n[19],start:1})),u=!1},d(f){f&&T(e),rt(c,f),f&&s&&s.end(),r=!1,Re(o)}}}function rn(n,e){let t,l,i=e[62]+"",s,u,r,o;function a(){return e[38](e[62])}return{key:n,first:null,c(){t=R("td"),l=R("button"),s=_e(i),this.h()},l(c){t=I(c,"TD",{class:!0});var f=P(t);l=I(f,"BUTTON",{type:!0,class:!0});var b=P(l);s=be(b,i),b.forEach(T),f.forEach(T),this.h()},h(){y(l,"type","button"),y(l,"class","std-btn svelte-14xtbbo"),l.disabled=u=e[22](new Date(e[62],e[7].getMonth(),e[7].getDate())),j(l,"not-current",!e[21](e[51])),y(t,"class","sdt-cal-td svelte-14xtbbo"),j(t,"is-selected",e[15].selectionMark.includes(e[51])),this.first=t},m(c,f){K(c,t,f),E(t,l),E(l,s),r||(o=X(l,"click",a),r=!0)},p(c,f){e=c,f[0]&32768&&i!==(i=e[62]+"")&&ye(s,i),f[0]&32896&&u!==(u=e[22](new Date(e[62],e[7].getMonth(),e[7].getDate())))&&(l.disabled=u),f[0]&2129920&&j(l,"not-current",!e[21](e[51])),f[0]&32768&&j(t,"is-selected",e[15].selectionMark.includes(e[51]))},d(c){c&&T(t),r=!1,o()}}}function an(n){let e,t=[],l=new Map,i,s=fe(n[47]);const u=r=>r[54];for(let r=0;r{u&&(s&&s.end(1),i=Dt(t,n[18],{duration:Je,start:n[20],opacity:1}),i.start())}),u=!0)},o(f){i&&i.invalidate(),f&&(s=Nt(t,n[18],{duration:Je,end:n[19],start:1})),u=!1},d(f){f&&T(e),rt(c,f),f&&s&&s.end(),r=!1,Re(o)}}}function fn(n,e){let t,l,i=e[59]+"",s,u,r,o;function a(){return e[40](e[59])}return{key:n,first:null,c(){t=R("td"),l=R("button"),s=_e(i),this.h()},l(c){t=I(c,"TD",{class:!0});var f=P(t);l=I(f,"BUTTON",{class:!0,type:!0});var b=P(l);s=be(b,i),b.forEach(T),f.forEach(T),this.h()},h(){y(l,"class","std-btn svelte-14xtbbo"),y(l,"type","button"),l.disabled=u=e[22](new Date(e[7].getFullYear(),e[3].monthsShort.indexOf(e[59]),e[7].getDate())),j(l,"not-current",!e[21](e[51])),y(t,"class","sdt-cal-td svelte-14xtbbo"),j(t,"is-selected",e[51]===e[15].selectionMark[0]),this.first=t},m(c,f){K(c,t,f),E(t,l),E(l,s),r||(o=X(l,"click",a),r=!0)},p(c,f){e=c,f[0]&32768&&i!==(i=e[59]+"")&&ye(s,i),f[0]&32904&&u!==(u=e[22](new Date(e[7].getFullYear(),e[3].monthsShort.indexOf(e[59]),e[7].getDate())))&&(l.disabled=u),f[0]&2129920&&j(l,"not-current",!e[21](e[51])),f[0]&32768&&j(t,"is-selected",e[51]===e[15].selectionMark[0])},d(c){c&&T(t),r=!1,o()}}}function cn(n){let e,t=[],l=new Map,i,s=fe(n[47]);const u=r=>r[54];for(let r=0;r{r&&(u&&u.end(1),s=Dt(t,n[18],{duration:Je,start:.5,opacity:1}),s.start())}),r=!0)},o(g){s&&s.invalidate(),g&&(u=Nt(t,n[18],{duration:Je,start:Math.abs(n[9])})),r=!1},d(g){g&&T(e),rt(f,g),rt(h,g),g&&u&&u.end(),o=!1,a()}}}function dn(n){let e,t=n[55]+"",l;return{c(){e=R("th"),l=_e(t),this.h()},l(i){e=I(i,"TH",{class:!0});var s=P(e);l=be(s,t),s.forEach(T),this.h()},h(){y(e,"class","sdt-cal-th svelte-14xtbbo")},m(i,s){K(i,e,s),E(e,l)},p(i,s){s[0]&131072&&t!==(t=i[55]+"")&&ye(l,t)},d(i){i&&T(e)}}}function mn(n,e){let t,l,i=e[50].getDate()+"",s,u,r,o;function a(){return e[42](e[50])}return{key:n,first:null,c(){t=R("td"),l=R("button"),s=_e(i),this.h()},l(c){t=I(c,"TD",{class:!0});var f=P(t);l=I(f,"BUTTON",{type:!0,class:!0});var b=P(l);s=be(b,i),b.forEach(T),f.forEach(T),this.h()},h(){y(l,"type","button"),y(l,"class","std-btn sdt-btn-day svelte-14xtbbo"),l.disabled=u=(e[16]||e[2]||e[6])&&e[22](e[50]),j(l,"not-current",!e[21](e[49]*7+e[54])),y(t,"class","sdt-cal-td svelte-14xtbbo"),j(t,"sdt-today",e[51]===e[15].todayMark),j(t,"in-range",e[29](e[52])),j(t,"is-selected",e[14].includes(e[52])),j(t,"in-range-hover",e[5]&&e[30](e[52],e[0])),this.first=t},m(c,f){K(c,t,f),E(t,l),E(l,s),r||(o=[X(l,"click",a),X(t,"mouseover",function(){Un(e[28](e[50]))&&e[28](e[50]).apply(this,arguments)}),X(t,"mouseout",e[28]())],r=!0)},p(c,f){e=c,f[0]&32768&&i!==(i=e[50].getDate()+"")&&ye(s,i),f[0]&98372&&u!==(u=(e[16]||e[2]||e[6])&&e[22](e[50]))&&(l.disabled=u),f[0]&2129920&&j(l,"not-current",!e[21](e[49]*7+e[54])),f[0]&32768&&j(t,"sdt-today",e[51]===e[15].todayMark),f[0]&536903680&&j(t,"in-range",e[29](e[52])),f[0]&49152&&j(t,"is-selected",e[14].includes(e[52])),f[0]&1073774625&&j(t,"in-range-hover",e[5]&&e[30](e[52],e[0]))},d(c){c&&T(t),r=!1,Re(o)}}}function gn(n){let e,t=[],l=new Map,i,s=fe(n[47]);const u=r=>r[54];for(let r=0;r{M=null}),Oe()),v[8]===je?H?(H.p(v,Y),Y[0]&256&&se(H,1)):(H=un(v),H.c(),se(H,1),H.m(p,w)):H&&(Be(),ce(H,1,1,()=>{H=null}),Oe()),v[8]===ve?k?(k.p(v,Y),Y[0]&256&&se(k,1)):(k=hn(v),k.c(),se(k,1),k.m(p,null)):k&&(Be(),ce(k,1,1,()=>{k=null}),Oe()),Y[0]&1024&&j(p,"is-grid",v[10])},i(v){se(M),se(H),se(k)},o(v){ce(M),ce(H),ce(k)},d(v){v&&(T(e),T(g),T(p)),C&&C.d(),M&&M.d(),H&&H.d(),k&&k.d(),S=!1,Re(N)}}}let Je=400;const Te=222,st=148;function Ll(n,e,t){var x;let l,i,s,u,r,o,a,c,{wid:f}=e,{dates:b}=e,{startDate:h=null}=e,{endDate:g=null}=e,{weekStart:p=1}=e,{initialView:d=ve}=e,{i18n:w}=e,{enableTimeToggle:S=!1}=e,{isRange:N=!1}=e,{hoverDate:C=null}=e,{additionalDisableFn:M}=e;function H(D,z){if(B!==ve){t(8,B=ve),t(9,V=1),t(7,v=new Date(k||new Date));return}if(!k){F(new Date,{keyboard:!0});return}let Z=new Date(k);switch(D){case"PageDown":z=!0;case"ArrowDown":z?Z.setMonth(k.getMonth()+1):Z.setDate(k.getDate()+7),z&&Z.getMonth()===k.getMonth()&&Z.setDate(0),F(Z,{keyboard:!0});break;case"PageUp":z=!0;case"ArrowUp":z?Z.setMonth(k.getMonth()-1):Z.setDate(k.getDate()-7),z&&Z.getMonth()===k.getMonth()&&Z.setDate(0),F(Z,{keyboard:!0});break;case"ArrowLeft":z?Z.setFullYear(k.getFullYear()-1):Z.setDate(k.getDate()-1),F(Z,{keyboard:!0});break;case"ArrowRight":z?Z.setFullYear(k.getFullYear()+1):Z.setDate(k.getDate()+1),F(Z,{keyboard:!0});break}}let k=b[f]||null,v=f===1?(()=>{const D=new Date(b[0]||new Date);return D.setMonth(D.getMonth()+1),D})():new Date(((x=b[0])==null?void 0:x.valueOf())||new Date);const Y=At();let B=d,V=-2,J=!1,O=Te,L=null;function Q(D){return o.prevTo<=D&&DD||g&&g<=D||M&&M(D))return!0;break;case je:if(l&&l.getFullYear()===D.getFullYear()&&l.getMonth()>D.getMonth()||g&&g.getFullYear()===D.getFullYear()&&g.getMonth()D.getFullYear()||g&&g.getFullYear()=10?Te:st:Te)}function U(D){if(B===ve)return G(D);if(t(12,L=()=>{G(D)}),B===He){t(11,O=O===st?D===-1?O-Te:Te+st:D===-1?O-Te:O+st);return}t(11,O=D===-1?O-Te:O+Te)}function pe(){if(t(9,V=-1),t(10,J=!0),B&&t(8,B--,B),B===He){const D=Math.floor(v.getFullYear()/10)*10%20===0;t(11,O=D?st:Te)}}function F(D,{keyboard:z}={}){switch(t(9,V=1),t(10,J=!0),B){case 0:v.setFullYear(D),t(7,v);break;case 1:v.setMonth(w.monthsShort.indexOf(D)),t(7,v);break;case 2:if($(D)||M&&M(D))return;const Z=new Date(D.getFullYear(),D.getMonth(),D.getDate());k&&(Z.setMinutes(k.getMinutes()),Z.setHours(k.getHours())),k=Z,z&&(v.getFullYear()!==Z.getFullYear()||v.getFullYear()===Z.getFullYear()&&v.getMonth()!==Z.getMonth())&&(v.setFullYear(Z.getFullYear()),v.setMonth(Z.getMonth()),t(7,v)),Y("date",{value:k,update:"date",isKeyboard:z});break}B=r[0]&&D=z&&r[0]>=D)}const le=()=>U(-1),ae=()=>U(1),ie=D=>{F(D)},me=()=>L&&L(),we=D=>{F(D)},W=()=>L&&L(),de=D=>{F(D)};return n.$$set=D=>{"wid"in D&&t(31,f=D.wid),"dates"in D&&t(1,b=D.dates),"startDate"in D&&t(32,h=D.startDate),"endDate"in D&&t(2,g=D.endDate),"weekStart"in D&&t(33,p=D.weekStart),"initialView"in D&&t(34,d=D.initialView),"i18n"in D&&t(3,w=D.i18n),"enableTimeToggle"in D&&t(4,S=D.enableTimeToggle),"isRange"in D&&t(5,N=D.isRange),"hoverDate"in D&&t(0,C=D.hoverDate),"additionalDisableFn"in D&&t(6,M=D.additionalDisableFn)},n.$$.update=()=>{n.$$.dirty[1]&2&&t(16,l=h?new Date(h.getFullYear(),h.getMonth(),h.getDate(),0,0,0,0):null),n.$$.dirty[0]&512&&t(20,i=V<1?1.5:.5),n.$$.dirty[0]&512&&t(19,s=V<1?1:1.5),n.$$.dirty[0]&512&&t(18,u=V===-2?Pe:V!==null?Nl:()=>({})),n.$$.dirty[0]&2&&t(14,r=b.map(D=>(D=new Date(D),D.setHours(0,0),D.getTime()))),n.$$.dirty[0]&394|n.$$.dirty[1]&4&&t(15,o=Il(v,b,B,w,p)),n.$$.dirty[0]&8|n.$$.dirty[1]&4&&t(17,a=w.daysMin.concat(...w.daysMin.slice(1)).slice(p,7+p)),n.$$.dirty[0]&2&&b.length===0&&(k=null),n.$$.dirty[0]&392&&t(13,c=w&&q(B,v))},[C,b,g,w,S,N,M,v,B,V,J,O,L,c,r,o,l,a,u,s,i,Q,$,U,pe,F,A,_,oe,ne,he,f,h,p,d,H,le,ae,ie,me,we,W,de]}class Ul extends Rt{constructor(e){super(),It(this,e,Ll,Pl,Vt,{wid:31,dates:1,startDate:32,endDate:2,weekStart:33,initialView:34,i18n:3,enableTimeToggle:4,isRange:5,hoverDate:0,additionalDisableFn:6,handleGridNav:35},null,[-1,-1,-1])}get handleGridNav(){return this.$$.ctx[35]}}function _n(n,e,t){const l=n.slice();return l[36]=e[t],l[38]=t,l}function bn(n,e,t){const l=n.slice();return l[36]=e[t],l[38]=t,l}function yn(n){let e,t,l,i,s,u;return{c(){e=R("button"),t=bt("svg"),l=bt("path"),this.h()},l(r){e=I(r,"BUTTON",{type:!0,class:!0,title:!0});var o=P(e);t=yt(o,"svg",{class:!0,xmlns:!0,viewBox:!0,width:!0,height:!0});var a=P(t);l=yt(a,"path",{"fill-rule":!0,d:!0}),P(l).forEach(T),a.forEach(T),o.forEach(T),this.h()},h(){y(l,"fill-rule","evenodd"),y(l,"d","M6.75 0a.75.75 0 01.75.75V3h9V.75a.75.75 0 011.5 0V3h2.75c.966 0 1.75.784 1.75 1.75v16a1.75 1.75 0 01-1.75 1.75H3.25a1.75 1.75 0 01-1.75-1.75v-16C1.5 3.784 2.284 3 3.25 3H6V.75A.75.75 0 016.75 0zm-3.5 4.5a.25.25 0 00-.25.25V8h18V4.75a.25.25 0 00-.25-.25H3.25zM21 9.5H3v11.25c0 .138.112.25.25.25h17.5a.25.25 0 00.25-.25V9.5z"),y(t,"class","sdt-svg svelte-qory1t"),y(t,"xmlns","http://www.w3.org/2000/svg"),y(t,"viewBox","0 0 24 24"),y(t,"width","20"),y(t,"height","20"),y(e,"type","button"),y(e,"class","sdt-time-btn sdt-back-btn svelte-qory1t"),y(e,"title",i=n[4].backToDate)},m(r,o){K(r,e,o),E(e,t),E(t,l),s||(u=X(e,"click",n[21]),s=!0)},p(r,o){o[0]&16&&i!==(i=r[4].backToDate)&&y(e,"title",i)},d(r){r&&T(e),s=!1,u()}}}function pn(n){let e,t,l=n[12]?"PM":"AM",i,s,u,r;return{c(){e=R("div"),t=R("button"),i=_e(l),this.h()},l(o){e=I(o,"DIV",{class:!0});var a=P(e);t=I(a,"BUTTON",{type:!0,class:!0,"data-value":!0});var c=P(t);i=be(c,l),c.forEach(T),a.forEach(T),this.h()},h(){y(t,"type","button"),y(t,"class","sdt-time-btn sdt-time-figure is-active svelte-qory1t"),y(t,"data-value",s=n[12]?n[8]%12:n[8]+12),y(e,"class","sdt-meridian svelte-qory1t")},m(o,a){K(o,e,a),E(e,t),E(t,i),u||(r=X(t,"click",n[19]),u=!0)},p(o,a){a[0]&4096&&l!==(l=o[12]?"PM":"AM")&&ye(i,l),a[0]&4352&&s!==(s=o[12]?o[8]%12:o[8]+12)&&y(t,"data-value",s)},d(o){o&&T(e),u=!1,r()}}}function wn(n,e){let t,l=e[36].val+"",i,s,u,r,o,a;return{key:n,first:null,c(){t=R("button"),i=_e(l),this.h()},l(c){t=I(c,"BUTTON",{type:!0,style:!0,class:!0,"data-value":!0});var f=P(t);i=be(f,l),f.forEach(T),this.h()},h(){y(t,"type","button"),y(t,"style",s=`left:${e[36].x}px; top:${e[36].y}px`),y(t,"class","sdt-tick svelte-qory1t"),y(t,"data-value",u=e[36].val),t.disabled=r=(e[0]||e[1])&&e[6]&&e[17](e[36].val,!1),j(t,"outer-tick",e[5]),j(t,"is-selected",e[16](e[8],e[36].val,e[38])),this.first=t},m(c,f){K(c,t,f),E(t,i),a=!0},p(c,f){e=c,(!a||f[0]&16384)&&l!==(l=e[36].val+"")&&ye(i,l),(!a||f[0]&16384&&s!==(s=`left:${e[36].x}px; top:${e[36].y}px`))&&y(t,"style",s),(!a||f[0]&16384&&u!==(u=e[36].val))&&y(t,"data-value",u),(!a||f[0]&16451&&r!==(r=(e[0]||e[1])&&e[6]&&e[17](e[36].val,!1)))&&(t.disabled=r),(!a||f[0]&32)&&j(t,"outer-tick",e[5]),(!a||f[0]&82176)&&j(t,"is-selected",e[16](e[8],e[36].val,e[38]))},i(c){a||(c&&Ue(()=>{a&&(o||(o=Ke(t,Pe,{duration:200},!0)),o.run(1))}),a=!0)},o(c){c&&(o||(o=Ke(t,Pe,{duration:200},!1)),o.run(0)),a=!1},d(c){c&&T(t),c&&o&&o.end()}}}function kn(n){let e,t=n[36].val+"",l,i,s,u,r,o;return{c(){e=R("button"),l=_e(t),this.h()},l(a){e=I(a,"BUTTON",{type:!0,style:!0,class:!0,"data-value":!0});var c=P(e);l=be(c,t),c.forEach(T),this.h()},h(){y(e,"type","button"),y(e,"style",i=`left:${n[36].x}px; top:${n[36].y}px;`),y(e,"class","sdt-tick svelte-qory1t"),y(e,"data-value",s=n[36].val),e.disabled=u=(n[0]||n[1])&&n[6]&&n[17](n[36].val,!1),j(e,"outer-tick",n[2]&&!n[5]),j(e,"is-selected",n[16](n[5]?n[7]:n[8],n[36].val,n[38]))},m(a,c){K(a,e,c),E(e,l),o=!0},p(a,c){(!o||c[0]&8192)&&t!==(t=a[36].val+"")&&ye(l,t),(!o||c[0]&8192&&i!==(i=`left:${a[36].x}px; top:${a[36].y}px;`))&&y(e,"style",i),(!o||c[0]&8192&&s!==(s=a[36].val))&&y(e,"data-value",s),(!o||c[0]&8259&&u!==(u=(a[0]||a[1])&&a[6]&&a[17](a[36].val,!1)))&&(e.disabled=u),(!o||c[0]&36)&&j(e,"outer-tick",a[2]&&!a[5]),(!o||c[0]&74144)&&j(e,"is-selected",a[16](a[5]?a[7]:a[8],a[36].val,a[38]))},i(a){o||(a&&Ue(()=>{o&&(r||(r=Ke(e,Pe,{duration:200},!0)),r.run(1))}),o=!0)},o(a){a&&(r||(r=Ke(e,Pe,{duration:200},!1)),r.run(0)),o=!1},d(a){a&&T(e),a&&r&&r.end()}}}function ql(n){let e,t,l,i,s=n[15](n[8],n[2])+"",u,r,o,a=":",c,f,b=n[15](n[7],!1)+"",h,g,p,d,w,S,N,C,M,H=[],k=new Map,v,Y,B,V,J,O=n[3]&&yn(n),L=n[2]&&pn(n),Q=fe(n[14]);const $=F=>F[36].val;for(let F=0;Fce(U[F],1,1,()=>{U[F]=null});return{c(){e=R("div"),t=R("div"),O&&O.c(),l=ee(),i=R("button"),u=_e(s),r=ee(),o=R("span"),o.textContent=a,c=ee(),f=R("button"),h=_e(b),g=ee(),L&&L.c(),p=ee(),d=R("div"),w=R("div"),S=ee(),N=R("div"),C=R("div"),M=ee();for(let F=0;F{Y=Dt(e,Pe,{duration:200}),Y.start()})),B=!0}},o(F){for(let A=0;A=9||W<3?-1:1)*q),val:ne?W*5||oe:W?W+he:oe});return we}function V(_,q){return q?i&&_===12?12:_<10||_%12<10?`0${_%12}`:_%12:_<10?`0${_}`:_}function J(_,q,oe){return M?q===_||oe===0&&oe===_:p?i&&q==12&&_===12||!i&&q==12&&_===0?!0:q===(_?_%12:12):+q>12?(oe?u*oe+12:0)===_:q==="00"||q==="12"?_===12&&parseInt(q)==12||q==="00"&&_===0:q===_}function O(_,q=!1){return typeof _=="string"&&(_=parseInt(_)),b&&h&&r?M||q?b.getHours()===k.getHours()&&b.getMinutes()>_||h.getHours()===k.getHours()&&h.getMinutes()<_:b.getHours()>_||h.getHours()<_:b&&b.getDate()===k.getDate()&&b.getMonth()===k.getMonth()&&b.getFullYear()===k.getFullYear()?M||q?b.getHours()===k.getHours()&&b.getMinutes()>_:b.getHours()>_:h&&h.getDate()===k.getDate()&&h.getMonth()===k.getMonth()&&h.getFullYear()===k.getFullYear()?M||q?h.getHours()===k.getHours()&&h.getMinutes()<_:h.getHours()<_:!1}function L(_){if(!_.target)return;let q=0,oe=0;if(_.target.tagName==="BUTTON"){let ne=parseInt(_.target.dataset.value);const he=M?"setMinutes":"setHours";!M&&i&&(ne+=12),M&&g!==1&&(ne=ne>s?s+g:s-g),k[he](ne)}else if(M){const ne=C.getBoundingClientRect(),he=_.clientX-ne.left,le=_.clientY-ne.top,ae=130,ie=130;let me=null;switch(he>ae?me=le>ie?2:1:me=le>ie?3:4,me){case 1:q=he-ae,oe=ie-le;break;case 2:q=he-ae,oe=le-ie;break;case 3:q=ae-he,oe=le-ie;break;case 4:q=ae-he,oe=ie-le;break}const we=Math.sqrt(q*q+oe*oe),W=90-Math.asin(q/we)*(180/Math.PI);let de=0;switch(me){case 1:de=90-W;break;case 2:de=W+90;break;case 3:de=270-W;break;case 4:de=W+270;break}de=Math.round(de/6/g)*g,de>=60&&(de=0),k.setMinutes(de)}t(6,k),t(22,f),H||(v(M?"minute":"hour",{value:k,isKeyboard:_.type==="keyboard",dateIndex:c}),_.type!=="keyboard"&&!M&&t(5,M=!0))}function Q(_){const q=parseInt(_.target.dataset.value);k.setHours(q),t(6,k),t(22,f),v(M?"minute":"hour",{value:k,isKeyboard:_.type==="keyboard"})}function $(_){t(10,H=_.type==="mousedown")}function G(){v("switch","date")}const U=()=>t(5,M=!1),pe=()=>t(5,M=!0),F=_=>{H&&L(_)};function A(_){_t[_?"unshift":"push"](()=>{C=_,t(9,C)})}return n.$$set=_=>{"wid"in _&&t(23,c=_.wid),"date"in _&&t(22,f=_.date),"startDate"in _&&t(0,b=_.startDate),"endDate"in _&&t(1,h=_.endDate),"minuteIncrement"in _&&t(24,g=_.minuteIncrement),"showMeridian"in _&&t(2,p=_.showMeridian),"hasDateComponent"in _&&t(3,d=_.hasDateComponent),"i18n"in _&&t(4,w=_.i18n)},n.$$.update=()=>{if(n.$$.dirty[0]&4194368&&f!==k&&f&&t(6,k=f),n.$$.dirty[0]&67){let _=!1;b&&b.toDateString()===k.toDateString()&&(O(k.getHours())&&(k.setHours(b.getHours()),_=!0),O(k.getMinutes(),!0)&&(k.setMinutes(b.getMinutes()),_=!0)),h&&h.toDateString()===k.toDateString()&&(O(k.getHours())&&(k.setHours(h.getHours()),_=!0),O(k.getMinutes(),!0)&&(k.setMinutes(h.getMinutes()),_=!0)),_&&jn().then(()=>v("time",k))}if(n.$$.dirty[0]&64&&t(8,l=k?k.getHours():0),n.$$.dirty[0]&260&&t(12,i=p?l>=12:!1),n.$$.dirty[0]&64&&t(7,s=k?k.getMinutes():0),n.$$.dirty[0]&420){let _=M?s*6:l%12*30;t(11,Y=M||p||l<12?`transform: rotateZ(${_}deg);`:`transform: rotateZ(${_}deg); height: calc(25% + 1px)`)}n.$$.dirty[0]&32&&(u=M?5:1),n.$$.dirty[0]&3&&(r=b&&h&&["getFullYear","getMonth","getDate"].every(_=>h[_]()===b[_]())),n.$$.dirty[0]&32&&t(14,o=B(M?220:180,110,"00",!1,0)),n.$$.dirty[0]&32&&t(13,a=B(M?180:120,110,M?"00":"12",M,12)),n.$$.dirty[0]&32&&v("time-switch",M)},[b,h,p,d,w,M,k,s,l,C,H,Y,i,a,o,V,J,O,L,Q,$,G,f,c,g,S,N,U,pe,F,A]}class zl extends Rt{constructor(e){super(),It(this,e,jl,ql,Vt,{wid:23,date:22,startDate:0,endDate:1,minuteIncrement:24,showMeridian:2,hasDateComponent:3,i18n:4,showMinuteView:25,makeTick:26},null,[-1,-1])}get showMinuteView(){return this.$$.ctx[25]}get makeTick(){return this.$$.ctx[26]}}function Lt(n){return n.split("-")[1]}function tl(n){return n==="y"?"height":"width"}function ze(n){return n.split("-")[0]}function Ut(n){return["top","bottom"].includes(ze(n))?"x":"y"}function vn(n,e,t){let{reference:l,floating:i}=n;const s=l.x+l.width/2-i.width/2,u=l.y+l.height/2-i.height/2,r=Ut(e),o=tl(r),a=l[o]/2-i[o]/2,c=r==="x";let f;switch(ze(e)){case"top":f={x:s,y:l.y-i.height};break;case"bottom":f={x:s,y:l.y+l.height};break;case"right":f={x:l.x+l.width,y:u};break;case"left":f={x:l.x-i.width,y:u};break;default:f={x:l.x,y:l.y}}switch(Lt(e)){case"start":f[r]-=a*(t&&c?-1:1);break;case"end":f[r]+=a*(t&&c?-1:1)}return f}const Wl=async(n,e,t)=>{const{placement:l="bottom",strategy:i="absolute",middleware:s=[],platform:u}=t,r=s.filter(Boolean),o=await(u.isRTL==null?void 0:u.isRTL(e));let a=await u.getElementRects({reference:n,floating:e,strategy:i}),{x:c,y:f}=vn(a,l,o),b=l,h={},g=0;for(let p=0;pn.concat(e,e+"-start",e+"-end"),[]);const Jl={left:"right",right:"left",bottom:"top",top:"bottom"};function wt(n){return n.replace(/left|right|bottom|top/g,e=>Jl[e])}function Ql(n,e,t){t===void 0&&(t=!1);const l=Lt(n),i=Ut(n),s=tl(i);let u=i==="x"?l===(t?"end":"start")?"right":"left":l==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(u=wt(u)),{main:u,cross:wt(u)}}const xl={start:"end",end:"start"};function Ct(n){return n.replace(/start|end/g,e=>xl[e])}const $l=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(e){var t;const{placement:l,middlewareData:i,rects:s,initialPlacement:u,platform:r,elements:o}=e,{mainAxis:a=!0,crossAxis:c=!0,fallbackPlacements:f,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...p}=qt(n,e),d=ze(l),w=ze(u)===u,S=await(r.isRTL==null?void 0:r.isRTL(o.floating)),N=f||(w||!g?[wt(u)]:function(V){const J=wt(V);return[Ct(V),J,Ct(J)]}(u));f||h==="none"||N.push(...function(V,J,O,L){const Q=Lt(V);let $=function(G,U,pe){const F=["left","right"],A=["right","left"],_=["top","bottom"],q=["bottom","top"];switch(G){case"top":case"bottom":return pe?U?A:F:U?F:A;case"left":case"right":return U?_:q;default:return[]}}(ze(V),O==="start",L);return Q&&($=$.map(G=>G+"-"+Q),J&&($=$.concat($.map(Ct)))),$}(u,g,h,S));const C=[u,...N],M=await nl(e,p),H=[];let k=((t=i.flip)==null?void 0:t.overflows)||[];if(a&&H.push(M[d]),c){const{main:V,cross:J}=Ql(l,s,S);H.push(M[V],M[J])}if(k=[...k,{placement:l,overflows:H}],!H.every(V=>V<=0)){var v,Y;const V=(((v=i.flip)==null?void 0:v.index)||0)+1,J=C[V];if(J)return{data:{index:V,overflows:k},reset:{placement:J}};let O=(Y=k.filter(L=>L.overflows[0]<=0).sort((L,Q)=>L.overflows[1]-Q.overflows[1])[0])==null?void 0:Y.placement;if(!O)switch(b){case"bestFit":{var B;const L=(B=k.map(Q=>[Q.placement,Q.overflows.filter($=>$>0).reduce(($,G)=>$+G,0)]).sort((Q,$)=>Q[1]-$[1])[0])==null?void 0:B[0];L&&(O=L);break}case"initialPlacement":O=u}if(l!==O)return{reset:{placement:O}}}return{}}}};function ei(n){return n==="x"?"y":"x"}const ti=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(e){const{x:t,y:l,placement:i}=e,{mainAxis:s=!0,crossAxis:u=!1,limiter:r={fn:d=>{let{x:w,y:S}=d;return{x:w,y:S}}},...o}=qt(n,e),a={x:t,y:l},c=await nl(e,o),f=Ut(ze(i)),b=ei(f);let h=a[f],g=a[b];if(s){const d=f==="y"?"bottom":"right";h=Dn(h+c[f==="y"?"top":"left"],h,h-c[d])}if(u){const d=b==="y"?"bottom":"right";g=Dn(g+c[b==="y"?"top":"left"],g,g-c[d])}const p=r.fn({...e,[f]:h,[b]:g});return{...p,data:{x:p.x-t,y:p.y-l}}}}};function ke(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function Fe(n){return ke(n).getComputedStyle(n)}function ll(n){return n instanceof ke(n).Node}function Ve(n){return ll(n)?(n.nodeName||"").toLowerCase():"#document"}function De(n){return n instanceof HTMLElement||n instanceof ke(n).HTMLElement}function Mn(n){return typeof ShadowRoot<"u"&&(n instanceof ke(n).ShadowRoot||n instanceof ShadowRoot)}function at(n){const{overflow:e,overflowX:t,overflowY:l,display:i}=Fe(n);return/auto|scroll|overlay|hidden|clip/.test(e+l+t)&&!["inline","contents"].includes(i)}function ni(n){return["table","td","th"].includes(Ve(n))}function Bt(n){const e=jt(),t=Fe(n);return t.transform!=="none"||t.perspective!=="none"||!!t.containerType&&t.containerType!=="normal"||!e&&!!t.backdropFilter&&t.backdropFilter!=="none"||!e&&!!t.filter&&t.filter!=="none"||["transform","perspective","filter"].some(l=>(t.willChange||"").includes(l))||["paint","layout","strict","content"].some(l=>(t.contain||"").includes(l))}function jt(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Mt(n){return["html","body","#document"].includes(Ve(n))}const Ot=Math.min,We=Math.max,kt=Math.round,mt=Math.floor,Ae=n=>({x:n,y:n});function il(n){const e=Fe(n);let t=parseFloat(e.width)||0,l=parseFloat(e.height)||0;const i=De(n),s=i?n.offsetWidth:t,u=i?n.offsetHeight:l,r=kt(t)!==s||kt(l)!==u;return r&&(t=s,l=u),{width:t,height:l,$:r}}function Se(n){return n instanceof Element||n instanceof ke(n).Element}function zt(n){return Se(n)?n:n.contextElement}function Ge(n){const e=zt(n);if(!De(e))return Ae(1);const t=e.getBoundingClientRect(),{width:l,height:i,$:s}=il(e);let u=(s?kt(t.width):t.width)/l,r=(s?kt(t.height):t.height)/i;return u&&Number.isFinite(u)||(u=1),r&&Number.isFinite(r)||(r=1),{x:u,y:r}}const li=Ae(0);function sl(n){const e=ke(n);return jt()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:li}function Le(n,e,t,l){e===void 0&&(e=!1),t===void 0&&(t=!1);const i=n.getBoundingClientRect(),s=zt(n);let u=Ae(1);e&&(l?Se(l)&&(u=Ge(l)):u=Ge(n));const r=function(b,h,g){return h===void 0&&(h=!1),!(!g||h&&g!==ke(b))&&h}(s,t,l)?sl(s):Ae(0);let o=(i.left+r.x)/u.x,a=(i.top+r.y)/u.y,c=i.width/u.x,f=i.height/u.y;if(s){const b=ke(s),h=l&&Se(l)?ke(l):l;let g=b.frameElement;for(;g&&l&&h!==b;){const p=Ge(g),d=g.getBoundingClientRect(),w=getComputedStyle(g),S=d.left+(g.clientLeft+parseFloat(w.paddingLeft))*p.x,N=d.top+(g.clientTop+parseFloat(w.paddingTop))*p.y;o*=p.x,a*=p.y,c*=p.x,f*=p.y,o+=S,a+=N,g=ke(g).frameElement}}return pt({width:c,height:f,x:o,y:a})}function Tt(n){return Se(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function Ye(n){var e;return(e=(ll(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function ol(n){return Le(Ye(n)).left+Tt(n).scrollLeft}function Qe(n){if(Ve(n)==="html")return n;const e=n.assignedSlot||n.parentNode||Mn(n)&&n.host||Ye(n);return Mn(e)?e.host:e}function rl(n){const e=Qe(n);return Mt(e)?n.ownerDocument?n.ownerDocument.body:n.body:De(e)&&at(e)?e:rl(e)}function vt(n,e){var t;e===void 0&&(e=[]);const l=rl(n),i=l===((t=n.ownerDocument)==null?void 0:t.body),s=ke(l);return i?e.concat(s,s.visualViewport||[],at(l)?l:[]):e.concat(l,vt(l))}function Tn(n,e,t){let l;if(e==="viewport")l=function(i,s){const u=ke(i),r=Ye(i),o=u.visualViewport;let a=r.clientWidth,c=r.clientHeight,f=0,b=0;if(o){a=o.width,c=o.height;const h=jt();(!h||h&&s==="fixed")&&(f=o.offsetLeft,b=o.offsetTop)}return{width:a,height:c,x:f,y:b}}(n,t);else if(e==="document")l=function(i){const s=Ye(i),u=Tt(i),r=i.ownerDocument.body,o=We(s.scrollWidth,s.clientWidth,r.scrollWidth,r.clientWidth),a=We(s.scrollHeight,s.clientHeight,r.scrollHeight,r.clientHeight);let c=-u.scrollLeft+ol(i);const f=-u.scrollTop;return Fe(r).direction==="rtl"&&(c+=We(s.clientWidth,r.clientWidth)-o),{width:o,height:a,x:c,y:f}}(Ye(n));else if(Se(e))l=function(i,s){const u=Le(i,!0,s==="fixed"),r=u.top+i.clientTop,o=u.left+i.clientLeft,a=De(i)?Ge(i):Ae(1);return{width:i.clientWidth*a.x,height:i.clientHeight*a.y,x:o*a.x,y:r*a.y}}(e,t);else{const i=sl(n);l={...e,x:e.x-i.x,y:e.y-i.y}}return pt(l)}function al(n,e){const t=Qe(n);return!(t===e||!Se(t)||Mt(t))&&(Fe(t).position==="fixed"||al(t,e))}function ii(n,e,t){const l=De(e),i=Ye(e),s=t==="fixed",u=Le(n,!0,s,e);let r={scrollLeft:0,scrollTop:0};const o=Ae(0);if(l||!l&&!s)if((Ve(e)!=="body"||at(i))&&(r=Tt(e)),De(e)){const a=Le(e,!0,s,e);o.x=a.x+e.clientLeft,o.y=a.y+e.clientTop}else i&&(o.x=ol(i));return{x:u.left+r.scrollLeft-o.x,y:u.top+r.scrollTop-o.y,width:u.width,height:u.height}}function Fn(n,e){return De(n)&&Fe(n).position!=="fixed"?e?e(n):n.offsetParent:null}function En(n,e){const t=ke(n);if(!De(n))return t;let l=Fn(n,e);for(;l&&ni(l)&&Fe(l).position==="static";)l=Fn(l,e);return l&&(Ve(l)==="html"||Ve(l)==="body"&&Fe(l).position==="static"&&!Bt(l))?t:l||function(i){let s=Qe(i);for(;De(s)&&!Mt(s);){if(Bt(s))return s;s=Qe(s)}return null}(n)||t}const si={convertOffsetParentRelativeRectToViewportRelativeRect:function(n){let{rect:e,offsetParent:t,strategy:l}=n;const i=De(t),s=Ye(t);if(t===s)return e;let u={scrollLeft:0,scrollTop:0},r=Ae(1);const o=Ae(0);if((i||!i&&l!=="fixed")&&((Ve(t)!=="body"||at(s))&&(u=Tt(t)),De(t))){const a=Le(t);r=Ge(t),o.x=a.x+t.clientLeft,o.y=a.y+t.clientTop}return{width:e.width*r.x,height:e.height*r.y,x:e.x*r.x-u.scrollLeft*r.x+o.x,y:e.y*r.y-u.scrollTop*r.y+o.y}},getDocumentElement:Ye,getClippingRect:function(n){let{element:e,boundary:t,rootBoundary:l,strategy:i}=n;const s=[...t==="clippingAncestors"?function(o,a){const c=a.get(o);if(c)return c;let f=vt(o).filter(p=>Se(p)&&Ve(p)!=="body"),b=null;const h=Fe(o).position==="fixed";let g=h?Qe(o):o;for(;Se(g)&&!Mt(g);){const p=Fe(g),d=Bt(g);d||p.position!=="fixed"||(b=null),(h?!d&&!b:!d&&p.position==="static"&&b&&["absolute","fixed"].includes(b.position)||at(g)&&!d&&al(o,g))?f=f.filter(w=>w!==g):b=p,g=Qe(g)}return a.set(o,f),f}(e,this._c):[].concat(t),l],u=s[0],r=s.reduce((o,a)=>{const c=Tn(e,a,i);return o.top=We(c.top,o.top),o.right=Ot(c.right,o.right),o.bottom=Ot(c.bottom,o.bottom),o.left=We(c.left,o.left),o},Tn(e,u,i));return{width:r.right-r.left,height:r.bottom-r.top,x:r.left,y:r.top}},getOffsetParent:En,getElementRects:async function(n){let{reference:e,floating:t,strategy:l}=n;const i=this.getOffsetParent||En,s=this.getDimensions;return{reference:ii(e,await i(t),l),floating:{x:0,y:0,...await s(t)}}},getClientRects:function(n){return Array.from(n.getClientRects())},getDimensions:function(n){return il(n)},getScale:Ge,isElement:Se,isRTL:function(n){return getComputedStyle(n).direction==="rtl"}};function oi(n,e,t,l){l===void 0&&(l={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:r=typeof IntersectionObserver=="function",animationFrame:o=!1}=l,a=zt(n),c=i||s?[...a?vt(a):[],...vt(e)]:[];c.forEach(d=>{i&&d.addEventListener("scroll",t,{passive:!0}),s&&d.addEventListener("resize",t)});const f=a&&r?function(d,w){let S,N=null;const C=Ye(d);function M(){clearTimeout(S),N&&N.disconnect(),N=null}return function H(k,v){k===void 0&&(k=!1),v===void 0&&(v=1),M();const{left:Y,top:B,width:V,height:J}=d.getBoundingClientRect();if(k||w(),!V||!J)return;const O={rootMargin:-mt(B)+"px "+-mt(C.clientWidth-(Y+V))+"px "+-mt(C.clientHeight-(B+J))+"px "+-mt(Y)+"px",threshold:We(0,Ot(1,v))||1};let L=!0;function Q($){const G=$[0].intersectionRatio;if(G!==v){if(!L)return H();G?H(!1,G):S=setTimeout(()=>{H(!1,1e-7)},100)}L=!1}try{N=new IntersectionObserver(Q,{...O,root:C.ownerDocument})}catch{N=new IntersectionObserver(Q,O)}N.observe(d)}(!0),M}(a,t):null;let b,h=-1,g=null;u&&(g=new ResizeObserver(d=>{let[w]=d;w&&w.target===a&&g&&(g.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{g&&g.observe(e)})),t()}),a&&!o&&g.observe(a),g.observe(e));let p=o?Le(n):null;return o&&function d(){const w=Le(n);!p||w.x===p.x&&w.y===p.y&&w.width===p.width&&w.height===p.height||t(),p=w,b=requestAnimationFrame(d)}(),t(),()=>{c.forEach(d=>{i&&d.removeEventListener("scroll",t),s&&d.removeEventListener("resize",t)}),f&&f(),g&&g.disconnect(),g=null,o&&cancelAnimationFrame(b)}}const ri=(n,e,t)=>{const l=new Map,i={platform:si,...t},s={...i.platform,_c:l};return Wl(n,e,{...i,platform:s})};function ai(n){if((n==null?void 0:n.previousElementSibling)===null)return;const e=n==null?void 0:n.previousElementSibling,t=oi(e,n,()=>ri(e,n,{placement:"bottom-start",middleware:[ti({padding:5}),$l()]}).then(({x:l,y:i})=>{Object.assign(n.style,{left:`${l}px`,top:`${i}px`})}));return{destroy(){t()}}}function ui(n,e,t,l,i){let s=n?Array.isArray(n)?n:n.split(","):[];s=s.map(o=>o.replace(/(:\d+):\d+/,"$1"));let u=s,r=e?Array.isArray(e)?e:[e]:u.map(o=>ot(o,t,l,i));return r&&e&&(s=r.map(o=>qe(o,t,l,i))),{valueArray:s,prevValue:u,innerDates:r}}function fi(n,e){return n==="auto"?e.match(/g|hh?|ii?/i)&&e.match(/y|m|d/i)?"datetime":e.match(/g|hh?|ii?/i)?"time":"date":n}const ci=n=>({isTodayDisabled:n[1]&1024,currentMode:n[0]&33554432,i18n:n[0]&8388608}),Hn=n=>({onCancel:n[48],onConfirm:n[75],onClear:n[47],onToday:n[46],isTodayDisabled:n[41],currentMode:n[25],i18n:n[23]});function Sn(n,e,t){const l=n.slice();return l[95]=e[t],l[96]=e,l[97]=t,l}const hi=n=>({value:n[0]&1,displayValue:n[0]&1073741824,disabled:n[0]&32,isDirty:n[1]&64}),Yn=n=>({value:n[0],displayValue:n[30],disabled:n[5],isDirty:n[37],onKeyDown:n[49],onInputFocus:n[52],onInputBlur:n[53]});function Cn(n){let e,t,l,i=!n[9]&&Bn(n);return{c(){e=R("input"),t=ee(),i&&i.c(),l=Xe(),this.h()},l(s){e=I(s,"INPUT",{type:!0,name:!0}),t=te(s),i&&i.l(s),l=Xe(),this.h()},h(){y(e,"type","hidden"),y(e,"name",n[4]),e.value=n[0]},m(s,u){K(s,e,u),K(s,t,u),i&&i.m(s,u),K(s,l,u)},p(s,u){u[0]&16&&y(e,"name",s[4]),u[0]&1&&(e.value=s[0]),s[9]?i&&(i.d(1),i=null):i?i.p(s,u):(i=Bn(s),i.c(),i.m(l.parentNode,l))},d(s){s&&(T(e),T(t),T(l)),i&&i.d(s)}}}function Bn(n){let e,t,l,i,s,u;return{c(){e=R("input"),this.h()},l(r){e=I(r,"INPUT",{type:!0,id:!0,tabindex:!0,name:!0,placeholder:!0,autocomplete:!0,inputmode:!0,class:!0}),this.h()},h(){y(e,"type","text"),y(e,"id",n[3]),y(e,"tabindex","0"),y(e,"name",t=n[4].endsWith("]")?n[4].substring(0,n[4].length-1)+"_input]":n[4]+"_input"),e.value=n[30],y(e,"placeholder",n[6]),e.disabled=n[5],e.required=n[7],y(e,"autocomplete","off"),y(e,"inputmode","none"),y(e,"class",l=Ze(n[17])+" svelte-97by3f"),e.readOnly=i=n[24]&&!n[11]&&!n[8],j(e,"value-dirty",!n[22]&&n[37])},m(r,o){K(r,e,o),n[71](e),s||(u=[X(e,"input",function(){Un(n[11]?n[50]:Ln)&&(n[11]?n[50]:Ln).apply(this,arguments)}),Zn(n[42].call(null,e,n[43])),X(e,"focus",n[52]),X(e,"blur",n[53]),X(e,"click",n[72]),X(e,"input",n[69]),X(e,"change",n[70]),X(e,"keydown",n[49])],s=!0)},p(r,o){n=r,o[0]&8&&y(e,"id",n[3]),o[0]&16&&t!==(t=n[4].endsWith("]")?n[4].substring(0,n[4].length-1)+"_input]":n[4]+"_input")&&y(e,"name",t),o[0]&1073741824&&e.value!==n[30]&&(e.value=n[30]),o[0]&64&&y(e,"placeholder",n[6]),o[0]&32&&(e.disabled=n[5]),o[0]&128&&(e.required=n[7]),o[0]&131072&&l!==(l=Ze(n[17])+" svelte-97by3f")&&y(e,"class",l),o[0]&16779520&&i!==(i=n[24]&&!n[11]&&!n[8])&&(e.readOnly=i),o[0]&4325376|o[1]&64&&j(e,"value-dirty",!n[22]&&n[37])},d(r){r&&T(e),n[71](null),s=!1,Re(u)}}}function di(n){let e,t=!n[1]&&Cn(n);return{c(){t&&t.c(),e=Xe()},l(l){t&&t.l(l),e=Xe()},m(l,i){t&&t.m(l,i),K(l,e,i)},p(l,i){l[1]?t&&(t.d(1),t=null):t?t.p(l,i):(t=Cn(l),t.c(),t.m(e.parentNode,e))},d(l){l&&T(e),t&&t.d(l)}}}function On(n){let e,t,l=[],i=new Map,s,u,r,o,a,c,f=fe(n[36]);const b=d=>d[97];for(let d=0;d{o&&(r||(r=Ke(e,n[40],{duration:200},!0)),r.run(1))}),o=!0}},o(d){for(let w=0;wn[74](e,t,l),u=()=>n[74](null,t,l);let r={wid:n[97],date:n[29][n[97]],startDate:n[28],endDate:n[27],hasDateComponent:n[26]!=="time",showMeridian:n[13].match(n[14]==="php"?"a|A":"p|P")!==null,i18n:n[23],minuteIncrement:n[15]};return e=new zl({props:r}),s(),e.$on("hour",n[44]),e.$on("minute",n[44]),e.$on("switch",n[51]),e.$on("time-switch",n[55]),{c(){Kn(e.$$.fragment)},l(o){Jn(e.$$.fragment,o)},m(o,a){Qn(e,o,a),i=!0},p(o,a){(t!==o[96]||l!==o[97])&&(u(),t=o[96],l=o[97],s());const c={};a[1]&32&&(c.wid=o[97]),a[0]&536870912|a[1]&32&&(c.date=o[29][o[97]]),a[0]&268435456&&(c.startDate=o[28]),a[0]&134217728&&(c.endDate=o[27]),a[0]&67108864&&(c.hasDateComponent=o[26]!=="time"),a[0]&24576&&(c.showMeridian=o[13].match(o[14]==="php"?"a|A":"p|P")!==null),a[0]&8388608&&(c.i18n=o[23]),a[0]&32768&&(c.minuteIncrement=o[15]),e.$set(c)},i(o){i||(se(e.$$.fragment,o),i=!0)},o(o){ce(e.$$.fragment,o),i=!1},d(o){u(),xn(e,o)}}}function gi(n){var i;let e,t,l={wid:n[97],dates:n[29],isRange:n[8],startDate:n[28],endDate:n[27],enableTimeToggle:(i=n[26])==null?void 0:i.includes("time"),initialView:n[2]>2?2:n[2],hoverDate:n[31],additionalDisableFn:n[10],i18n:n[23],weekStart:n[16]};return e=new Ul({props:l}),n[73](e),e.$on("date",n[44]),e.$on("switch",n[51]),e.$on("internal_hoverUpdate",n[54]),{c(){Kn(e.$$.fragment)},l(s){Jn(e.$$.fragment,s)},m(s,u){Qn(e,s,u),t=!0},p(s,u){var o;const r={};u[1]&32&&(r.wid=s[97]),u[0]&536870912&&(r.dates=s[29]),u[0]&256&&(r.isRange=s[8]),u[0]&268435456&&(r.startDate=s[28]),u[0]&134217728&&(r.endDate=s[27]),u[0]&67108864&&(r.enableTimeToggle=(o=s[26])==null?void 0:o.includes("time")),u[0]&4&&(r.initialView=s[2]>2?2:s[2]),u[1]&1&&(r.hoverDate=s[31]),u[0]&1024&&(r.additionalDisableFn=s[10]),u[0]&8388608&&(r.i18n=s[23]),u[0]&65536&&(r.weekStart=s[16]),e.$set(r)},i(s){t||(se(e.$$.fragment,s),t=!0)},o(s){ce(e.$$.fragment,s),t=!1},d(s){n[73](null),xn(e,s)}}}function Vn(n,e){let t,l,i,s,u;const r=[gi,mi],o=[];function a(c,f){return c[25]==="date"?0:1}return l=a(e),i=o[l]=r[l](e),{key:n,first:null,c(){t=R("div"),i.c(),s=ee(),this.h()},l(c){t=I(c,"DIV",{class:!0});var f=P(t);i.l(f),s=te(f),f.forEach(T),this.h()},h(){y(t,"class","sdt-widget svelte-97by3f"),this.first=t},m(c,f){K(c,t,f),o[l].m(t,null),E(t,s),u=!0},p(c,f){e=c;let b=l;l=a(e),l===b?o[l].p(e,f):(Be(),ce(o[b],1,1,()=>{o[b]=null}),Oe(),i=o[l],i?i.p(e,f):(i=o[l]=r[l](e),i.c()),se(i,1),i.m(t,s))},i(c){u||(se(i),u=!0)},o(c){ce(i),u=!1},d(c){c&&T(t),o[l].d()}}}function An(n){let e,t,l=!n[35]&&Rn(n),i=(n[20]||n[21])&&In(n);return{c(){e=R("div"),l&&l.c(),t=ee(),i&&i.c(),this.h()},l(s){e=I(s,"DIV",{class:!0});var u=P(e);l&&l.l(u),t=te(u),i&&i.l(u),u.forEach(T),this.h()},h(){y(e,"class","sdt-btn-row svelte-97by3f")},m(s,u){K(s,e,u),l&&l.m(e,null),E(e,t),i&&i.m(e,null)},p(s,u){s[35]?l&&(l.d(1),l=null):l?l.p(s,u):(l=Rn(s),l.c(),l.m(e,t)),s[20]||s[21]?i?i.p(s,u):(i=In(s),i.c(),i.m(e,null)):i&&(i.d(1),i=null)},d(s){s&&T(e),l&&l.d(),i&&i.d()}}}function Rn(n){let e,t,l=n[23].cancelBtn+"",i,s,u,r=n[23].okBtn+"",o,a,c;return{c(){e=R("span"),t=R("button"),i=_e(l),s=ee(),u=R("button"),o=_e(r),this.h()},l(f){e=I(f,"SPAN",{});var b=P(e);t=I(b,"BUTTON",{type:!0,class:!0});var h=P(t);i=be(h,l),h.forEach(T),s=te(b),u=I(b,"BUTTON",{type:!0,class:!0});var g=P(u);o=be(g,r),g.forEach(T),b.forEach(T),this.h()},h(){y(t,"type","button"),y(t,"class","sdt-action-btn sdt-clear-btn svelte-97by3f"),y(u,"type","button"),y(u,"class","sdt-action-btn sdt-today-btn svelte-97by3f")},m(f,b){K(f,e,b),E(e,t),E(t,i),E(e,s),E(e,u),E(u,o),a||(c=[X(t,"click",n[48]),X(u,"click",n[76])],a=!0)},p(f,b){b[0]&8388608&&l!==(l=f[23].cancelBtn+"")&&ye(i,l),b[0]&8388608&&r!==(r=f[23].okBtn+"")&&ye(o,r)},d(f){f&&T(e),a=!1,Re(c)}}}function In(n){let e,t,l=n[20]&&n[25]==="date"&&Nn(n),i=n[21]&&Pn(n);return{c(){e=R("span"),l&&l.c(),t=ee(),i&&i.c()},l(s){e=I(s,"SPAN",{});var u=P(e);l&&l.l(u),t=te(u),i&&i.l(u),u.forEach(T)},m(s,u){K(s,e,u),l&&l.m(e,null),E(e,t),i&&i.m(e,null)},p(s,u){s[20]&&s[25]==="date"?l?l.p(s,u):(l=Nn(s),l.c(),l.m(e,t)):l&&(l.d(1),l=null),s[21]?i?i.p(s,u):(i=Pn(s),i.c(),i.m(e,null)):i&&(i.d(1),i=null)},d(s){s&&T(e),l&&l.d(),i&&i.d()}}}function Nn(n){let e,t=n[23].todayBtn+"",l,i,s,u;return{c(){e=R("button"),l=_e(t),this.h()},l(r){e=I(r,"BUTTON",{type:!0,class:!0});var o=P(e);l=be(o,t),o.forEach(T),this.h()},h(){y(e,"type","button"),y(e,"class",i=Ze(n[18])+" svelte-97by3f"),e.disabled=n[41]},m(r,o){K(r,e,o),E(e,l),s||(u=X(e,"click",n[46]),s=!0)},p(r,o){o[0]&8388608&&t!==(t=r[23].todayBtn+"")&&ye(l,t),o[0]&262144&&i!==(i=Ze(r[18])+" svelte-97by3f")&&y(e,"class",i),o[1]&1024&&(e.disabled=r[41])},d(r){r&&T(e),s=!1,u()}}}function Pn(n){let e,t=n[23].clearBtn+"",l,i,s,u;return{c(){e=R("button"),l=_e(t),this.h()},l(r){e=I(r,"BUTTON",{type:!0,class:!0});var o=P(e);l=be(o,t),o.forEach(T),this.h()},h(){y(e,"type","button"),y(e,"class",i=Ze(n[19])+" svelte-97by3f")},m(r,o){K(r,e,o),E(e,l),s||(u=X(e,"click",n[47]),s=!0)},p(r,o){o[0]&8388608&&t!==(t=r[23].clearBtn+"")&&ye(l,t),o[0]&524288&&i!==(i=Ze(r[19])+" svelte-97by3f")&&y(e,"class",i)},d(r){r&&T(e),s=!1,u()}}}function _i(n){let e,t=(!n[35]||!0)&&An(n);return{c(){t&&t.c(),e=Xe()},l(l){t&&t.l(l),e=Xe()},m(l,i){t&&t.m(l,i),K(l,e,i)},p(l,i){l[35],t?t.p(l,i):(t=An(l),t.c(),t.m(e.parentNode,e))},d(l){l&&T(e),t&&t.d(l)}}}function bi(n){let e,t,l;const i=n[67].inputs,s=zn(i,n,n[66],Yn),u=s||di(n);let r=n[34]&&n[24]&&On(n);return{c(){e=R("span"),u&&u.c(),t=ee(),r&&r.c(),this.h()},l(o){e=I(o,"SPAN",{class:!0});var a=P(e);u&&u.l(a),t=te(a),r&&r.l(a),a.forEach(T),this.h()},h(){y(e,"class","std-component-wrap svelte-97by3f")},m(o,a){K(o,e,a),u&&u.m(e,null),E(e,t),r&&r.m(e,null),l=!0},p(o,a){s?s.p&&(!l||a[0]&1073741857|a[1]&64|a[2]&16)&&Wn(s,i,o,o[66],l?Xn(i,o[66],a,hi):Gn(o[66]),Yn):u&&u.p&&(!l||a[0]&1094847483|a[1]&74)&&u.p(o,l?a:[-1,-1,-1,-1]),o[34]&&o[24]?r?(r.p(o,a),a[0]&16777216|a[1]&8&&se(r,1)):(r=On(o),r.c(),se(r,1),r.m(e,null)):r&&(Be(),ce(r,1,1,()=>{r=null}),Oe())},i(o){l||(se(u,o),se(r),l=!0)},o(o){ce(u,o),ce(r),l=!1},d(o){o&&T(e),u&&u.d(o),r&&r.d()}}}const ge=Al;function yi(n){return n?[{ref:null},{ref:null}]:[{ref:null}]}const Ln=()=>{};function pi(n,e,t){let l,i,s,u,r,o,a,c,f,b,h,g,{$$slots:p={},$$scope:d}=e,{inputId:w=""}=e,{name:S="date"}=e,{disabled:N=!1}=e,{placeholder:C=null}=e,{required:M=!1}=e,{value:H=null}=e,{initialDate:k=null}=e,{isRange:v=!1}=e,{startDate:Y=null}=e,{endDate:B=null}=e,{pickerOnly:V=!1}=e,{startView:J=ve}=e,{mode:O="auto"}=e,{disableDatesFn:L=null}=e,{manualInput:Q=!1}=e,{theme:$=ge.theme}=e,{format:G=ge.format}=e,{formatType:U=ge.formatType}=e,{displayFormat:pe=ge.displayFormat}=e,{displayFormatType:F=ge.displayFormatType}=e,{minuteIncrement:A=ge.minuteIncrement}=e,{weekStart:_=ge.weekStart}=e,{inputClasses:q=ge.inputClasses}=e,{todayBtnClasses:oe=ge.todayBtnClasses}=e,{clearBtnClasses:ne=ge.clearBtnClasses}=e,{todayBtn:he=ge.todayBtn}=e,{clearBtn:le=ge.clearBtn}=e,{autocommit:ae=ge.autocommit}=e,{i18n:ie=ge.i18n}=e,{validatorAction:me=null}=e,{ce_valueElement:we=null}=e,{ce_displayElement:W=null}=e;const de=At();let{valueArray:x,prevValue:D,innerDates:z}=ui(H,k,G,ie,U),Z=G,Ie=V,ft=[...x],Ne=et(),xe=ht(),Wt,Me=J===Rl?"time":"date",$e=!1,Ft=W,ul=me?me.shift():()=>{},fl=me||[],ct,Et;function cl(m,ue,re,nt,lt){return!m||ue&&(re==="datetime"||lt.length!==2)?!1:nt==="minute"||re===nt}function hl(m){m.join("")!==D.join("")&&(t(29,z=m.filter(ue=>ue).map(ue=>ot(ue,G,ie,U))),D=m,Ne=et(),t(30,xe=ht()))}function dl(m){const ue=Array.isArray(m)?m.join(","):m;Ne!==ue&&(t(64,x=(ue||"").split(",")),ft=x)}function ml(m,ue){Z!==m&&z.length&&(t(64,x=z.map(re=>qe(re,m,ie,U))),D=x,t(30,xe=ht()),Z=m,O==="auto"&&t(26,a=m.match(/g|hh?|ii?/i)&&m.match(/y|m|d/i)?"datetime":m.match(/g|hh?|ii?/i)?"time":"date"),Ne=et(),Ee(!0))}function ht(){return z.map(m=>qe(m,pe||G,ie,F||U)).sort().join(" - ")}function gl(){return v?x.length===2?x:null:x[0]||null}function et(){return x.join(",")}function Gt(m){return m.join(",")!==ft.join(",")}function Xt(){t(2,J=ve),$e=!1,a==="datetime"?setTimeout(()=>{V||t(34,l=!1),t(25,Me="date")},ae?300:0):V||t(34,l=!1)}function _l(m,ue){m==="date"&&a==="datetime"&&(v&&x.length===2||!v)?t(25,Me="time"):m==="hour"&&o[ue].ref.showMinuteView()}function Ht({type:m,detail:ue}){let{value:re,isKeyboard:nt,dateIndex:lt}=ue;if(re&&!v&&z.length&&z[0].getFullYear()===re.getFullYear()&&z[0].getMonth()===re.getMonth()&&z[0].getDate()===re.getDate()&&a==="date"&&!M&&(re=null),v){if(m==="date")t(29,z=re?(z.length===2?[re]:z.concat(re)).map(it=>it.getTime()).sort().map(it=>new Date(it)):[]);else if(re&<!==void 0)t(29,z[lt]=re,z);else throw new Error("Invalid event type");t(64,x=z.map(it=>qe(it,G,ie,U)))}else t(29,z=re?[re]:[]),t(64,x=re?[qe(re,G,ie,U)]:[]);nt||(t(65,Et=m),_l(m,lt||0)),jn().then(()=>f&&Ee(!nt))}function Ee(m){t(0,H=gl()),Ne=et(),ft=[...x],t(30,xe=ht()),t(37,g=Gt(x)),wl(!0),de("change",v?x:x[0]||null),m&&Xt()}function bl(){const m=new Date,ue=z[0]||m;Ht(new CustomEvent(a,{detail:{value:new Date(m.getFullYear(),m.getMonth(),m.getDate(),ue.getHours(),ue.getMinutes(),0),isKeyboard:!1}})),Ee(!0)}function dt(){t(64,x=[]),D=[],t(29,z=[]),Ne="",ae&&Ee()}function St(){t(64,x=[...ft]),Ne=et(),Xt()}function Zt(m){if(l||(["Backspace","Delete"].includes(m.key)&&!M&&dt(),m.key==="Enter"&&tt()),!l&&m.key!=="Tab"){t(34,l=m.key!=="Shift"),m.preventDefault();return}switch(m.key){case"PageDown":case"PageUp":case"ArrowDown":case"ArrowUp":case"ArrowLeft":case"ArrowRight":if(m.preventDefault(),v)return;Me==="date"?ct.handleGridNav(m.key,m.shiftKey):o[0].ref.makeTick(["ArrowDown","ArrowLeft","PageDown"].includes(m.key)?-1:1);break;case"Escape":ae?dt():St();break;case"Backspace":if(Q&&!v)return;case"Delete":!M&&dt();break;case"Enter":if(Ie&&m.preventDefault(),x.length===0){t(34,l=!1);return}if(Me==="time"&&!$e)return o[0].ref.showMinuteView();if(a==="datetime"&&Me!=="time"){t(25,Me="time");return}Ee(a==="date"||a.includes("time")&&$e);break;case"Tab":l&&(t(34,l=!1),m.preventDefault());case"F5":break;default:!Q&&m.preventDefault()}}function yl(m){m.preventDefault(),m.stopPropagation();const ue=ot(m.target.value,pe||G,ie,F||U);qe(ue,pe||G,ie,F||U)===m.target.value&&Ht(new CustomEvent("date",{detail:{value:ue,isKeyboard:!0}}))}function pl(m){t(2,J=ve),t(25,Me=m.detail),$e=!1}function tt(){t(24,Ie=!0),t(34,l=!0)}function Kt(){t(24,Ie=!1),c?Ee(!1):St(),!W&&de("blur")}function wl(m){we&&W&&(t(56,we.value=x.join(",")||"",we),t(1,W.value=xe,W),we.dispatchEvent(new Event("input")),W.dispatchEvent(new Event("input"))),m&&de("input",Ne)}function kl({detail:m}){t(31,Wt=m)}function vl(m){$e=m.detail}Bl(()=>{W&&(t(1,W.onfocus=tt,W),t(1,W.onblur=Kt,W),t(1,W.onclick=()=>!l&&tt(),W),t(1,W.onkeydown=Zt,W))});function Dl(m){Yt.call(this,n,m)}function Ml(m){Yt.call(this,n,m)}function Tl(m){Yt.call(this,n,m)}function Fl(m){_t[m?"unshift":"push"](()=>{Ft=m,t(32,Ft)})}const El=()=>{!l&&tt()};function Hl(m){_t[m?"unshift":"push"](()=>{ct=m,t(33,ct)})}function Sl(m,ue,re){_t[m?"unshift":"push"](()=>{ue[re].ref=m,t(36,o),t(8,v)})}const Yl=()=>Ee(!0),Cl=()=>Ee(!0);return n.$$set=m=>{"inputId"in m&&t(3,w=m.inputId),"name"in m&&t(4,S=m.name),"disabled"in m&&t(5,N=m.disabled),"placeholder"in m&&t(6,C=m.placeholder),"required"in m&&t(7,M=m.required),"value"in m&&t(0,H=m.value),"initialDate"in m&&t(57,k=m.initialDate),"isRange"in m&&t(8,v=m.isRange),"startDate"in m&&t(58,Y=m.startDate),"endDate"in m&&t(59,B=m.endDate),"pickerOnly"in m&&t(9,V=m.pickerOnly),"startView"in m&&t(2,J=m.startView),"mode"in m&&t(60,O=m.mode),"disableDatesFn"in m&&t(10,L=m.disableDatesFn),"manualInput"in m&&t(11,Q=m.manualInput),"theme"in m&&t(12,$=m.theme),"format"in m&&t(13,G=m.format),"formatType"in m&&t(14,U=m.formatType),"displayFormat"in m&&t(61,pe=m.displayFormat),"displayFormatType"in m&&t(62,F=m.displayFormatType),"minuteIncrement"in m&&t(15,A=m.minuteIncrement),"weekStart"in m&&t(16,_=m.weekStart),"inputClasses"in m&&t(17,q=m.inputClasses),"todayBtnClasses"in m&&t(18,oe=m.todayBtnClasses),"clearBtnClasses"in m&&t(19,ne=m.clearBtnClasses),"todayBtn"in m&&t(20,he=m.todayBtn),"clearBtn"in m&&t(21,le=m.clearBtn),"autocommit"in m&&t(22,ae=m.autocommit),"i18n"in m&&t(23,ie=m.i18n),"validatorAction"in m&&t(63,me=m.validatorAction),"ce_valueElement"in m&&t(56,we=m.ce_valueElement),"ce_displayElement"in m&&t(1,W=m.ce_displayElement),"$$scope"in m&&t(66,d=m.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&512&&t(34,l=V),n.$$.dirty[0]&8413184|n.$$.dirty[1]&134217728&&t(28,i=Y?ot(Y,G,ie,U):null),n.$$.dirty[0]&8413184|n.$$.dirty[1]&268435456&&t(27,s=B?new Date(ot(B,G,ie,U).setSeconds(1)):null),n.$$.dirty[0]&402653184&&t(41,u=i&&i>new Date||s&&s({}):Pe),n.$$.dirty[0]&256&&t(36,o=yi(v)),n.$$.dirty[0]&8192|n.$$.dirty[1]&536870912&&t(26,a=fi(O,G)),n.$$.dirty[0]&100663296&&a==="time"&&Me!==a&&t(25,Me=a),n.$$.dirty[0]&71303424&&t(35,c=ae&&(v&&a==="date"||!v)),n.$$.dirty[0]&71303424|n.$$.dirty[2]&12&&(f=cl(ae,v,a,Et,x)),n.$$.dirty[0]&16777218&&W&&t(1,W.readOnly=Ie,W),n.$$.dirty[0]&512&&t(39,b=!!V),n.$$.dirty[0]&512&&t(38,h=V?()=>{}:ai),n.$$.dirty[2]&4&&t(37,g=Gt(x)),n.$$.dirty[0]&1&&dl(H),n.$$.dirty[2]&4&&hl(x),n.$$.dirty[0]&8192|n.$$.dirty[1]&1073741824&&ml(G)},[H,W,J,w,S,N,C,M,v,V,L,Q,$,G,U,A,_,q,oe,ne,he,le,ae,ie,Ie,Me,a,s,i,z,xe,Wt,Ft,ct,l,c,o,g,h,b,r,u,ul,fl,Ht,Ee,bl,dt,St,Zt,yl,pl,tt,Kt,kl,vl,we,k,Y,B,O,pe,F,me,x,Et,d,p,Dl,Ml,Tl,Fl,El,Hl,Sl,Yl,Cl]}class Ti extends Rt{constructor(e){super(),It(this,e,pi,bi,Vt,{inputId:3,name:4,disabled:5,placeholder:6,required:7,value:0,initialDate:57,isRange:8,startDate:58,endDate:59,pickerOnly:9,startView:2,mode:60,disableDatesFn:10,manualInput:11,theme:12,format:13,formatType:14,displayFormat:61,displayFormatType:62,minuteIncrement:15,weekStart:16,inputClasses:17,todayBtnClasses:18,clearBtnClasses:19,todayBtn:20,clearBtn:21,autocommit:22,i18n:23,validatorAction:63,ce_valueElement:56,ce_displayElement:1},null,[-1,-1,-1,-1])}}export{Ti as S}; diff --git a/docs/_app/immutable/chunks/SveltyPicker.eae60443.js b/docs/_app/immutable/chunks/SveltyPicker.eae60443.js new file mode 100644 index 0000000..a240003 --- /dev/null +++ b/docs/_app/immutable/chunks/SveltyPicker.eae60443.js @@ -0,0 +1,4 @@ +import{s as Vt,f as R,l as _e,a as ee,g as I,h as P,m as be,d as T,c as te,x as gt,j as y,v as z,i as K,w as E,y as X,n as ye,N as Re,L as At,af as bt,ag as yt,k as Jt,J as Ue,u as rt,Q as Un,O as jn,t as zn,p as _t,C as Wn,E as qn,F as Gn,G as Xn,o as Bl,e as Xe,M as Zn,W as Yt,U as Ze}from"./scheduler.6381a9b9.js";import{S as Rt,i as It,a as se,g as Be,t as ce,c as Oe,j as Dt,k as Nt,f as Ke,b as Kn,d as Jn,m as Qn,e as xn}from"./index.cf31950d.js";import{e as fe,u as ut,d as Pt,o as $n}from"./each.31dbf577.js";import{e as Ol}from"./index.dff5c7fd.js";import{c as Vl,f as Pe}from"./index.93a0d223.js";const Al={theme:"sdt-calendar-colors",format:"yyyy-mm-dd",formatType:"standard",displayFormat:null,displayFormatType:null,minuteIncrement:1,weekStart:1,inputClasses:"",todayBtnClasses:"sdt-action-btn sdt-today-btn",clearBtnClasses:"sdt-action-btn sdt-clear-btn",todayBtn:!0,clearBtn:!0,autocommit:!0,i18n:Ol},He=0,ze=1,ve=2,Rl=3;function ot(n,e,t,l){var d,w;if(n instanceof Date)return n;const i=l==="php"?{date:"Y-m-d",datetime:"Y-m-d H:i",datetime_s:"Y-m-d H:i:s"}:{date:"yyyy-mm-dd",datetime:"yyyy-mm-dd hh:ii",datetime_s:"yyyy-mm-dd hh:ii:ss"};let s,u;/^\d{4}\-\d{1,2}\-\d{1,2}$/.test(n)?s=Ce.parseFormat(i.date,l):/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}$/.test(n)?s=Ce.parseFormat(i.datetime,l):/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}\:\d{1,2}[Z]{0,1}$/.test(n)?s=Ce.parseFormat(i.datetime_s,l):(/^([01]*\d|2[0-3])([0-5]\d)(?:[ ]([ap][m]|[AP][M]))?$/.test(n)&&(u=(d=n.match(/^([01]*\d|2[0-3])([0-5]\d)(?:[ ]([ap][m]|[AP][M]))?$/))==null?void 0:d.slice(1).filter(S=>S)),s=Ce.parseFormat(e,l));const r=u||n&&n.toString().match(Ce.nonpunctuation)||[];n=new Date,n.setHours(0,0,0,0);const o={},{setters_order:a,setters_map:c}=Ce.setters(l);let f,b;if(r.length!==s.parts.length&&s.parts.includes("S")){const S=(w=r[s.parts.indexOf("S")-1].match(/(\d+)([a-zA-Z]+)/))==null?void 0:w.slice(1,3);r.splice(s.parts.indexOf("S")-1,1,...S)}if(r.length===s.parts.length){for(var h=0,g=s.parts.length;hl.setHours(i),h:(l,i)=>l.setHours(i),HH:(l,i)=>l.setHours(i===12?0:i),H:(l,i)=>l.setHours(i===12?0:i),i:(l,i)=>l.setMinutes(i),s:(l,i)=>l.setSeconds(i),yyyy:(l,i)=>l.setFullYear(i),yy:(l,i)=>l.setFullYear((i<50?2e3:1900)+i),m:(l,i)=>{for(i-=1;i<0;)i+=12;for(i%=12,l.setMonth(i);l.getMonth()!==i;){if(isNaN(l.getMonth()))return l;l.setDate(l.getDate()-1)}return l},d:(l,i)=>l.setDate(i),p:(l,i)=>l.setHours(i===1&&l.getHours()<12?l.getHours()+12:l.getHours()),t:(l,i)=>l.setTime(i),mm:()=>{},M:()=>{},MM:()=>{},ii:()=>{},ss:()=>{},dd:()=>{},D:()=>{},DD:()=>{},P:()=>{}},t.mm=t.M=t.MM=t.m,t.ii=t.i,t.ss=t.s,t.dd=t.D=t.DD=t.d,t.P=t.p):(e=["Y","yy","m","M","F","n","d","D","j","l","N","S","H","G","h","g","i","s","p","P","U"],t={H:(l,i)=>l.setHours(i),G:(l,i)=>l.setHours(i),h:(l,i)=>l.setHours(i===12?0:i),g:(l,i)=>l.setHours(i===12?0:i),i:(l,i)=>l.setMinutes(i),s:(l,i)=>l.setSeconds(i),Y:(l,i)=>l.setFullYear(i),yy:(l,i)=>l.setFullYear((i<50?2e3:1900)+i),m:(l,i)=>{for(i-=1;i<0;)i+=12;for(i%=12,l.setMonth(i);l.getMonth()!==i;){if(isNaN(l.getMonth()))return l;l.setDate(l.getDate()-1)}return l},n:(l,i)=>l.setMonth(i-1),d:(l,i)=>l.setDate(i),a:(l,i)=>l.setHours(i===1?l.getHours()+12:l.getHours()),U:(l,i)=>l.setTime(i*1e3)},t.F=t.M=t.m,t.D=t.j=t.l=t.N=t.d,t.A=t.a),{setters_order:e,setters_map:t}}};function Il(n,e,t,l,i){if(t===He){let C=10,M=20;const H=-1,k=[];let v=[],Y=n.getFullYear()-n.getFullYear()%10;Y-=Y%20?12:10,Y%10&&(C=12,M=22);for(let V=0;V<32;V++)v.push(Y+V),v.length===4&&(k.push(v),v=[]);let B=[];return e[0]||(e[0]=new Date),e[0].getFullYear()>=Y&&B.push(e[0].getFullYear()%Y),{years:k,todayMark:H,nextFrom:M,prevTo:C,selectionMark:B}}if(t===ze){let C=[],M=[],H=12,k=24;const v=n.toISOString().split("T")[0].substring(0,8),Y=new Date(v+"01 00:00:00"),B=Y.getFullYear()-1;Y.setFullYear(B);let V=0;for(let O=0;O<3;O++){for(let L=0;L<12;L++)Y.setMonth(L),M.push(l.monthsShort[L%12]),M.length===4&&(C.push(M),M=[]);Y.setFullYear(Y.getFullYear()+1)}let J=[];return e[0]||(e[0]=new Date),e[0].getFullYear()-B>=0&&e[0].getFullYear()-B<=2&&J.push(e[0].getMonth()+(e[0].getFullYear()-B||0)*12),{months:C,todayMark:V,nextFrom:k,prevTo:H,selectionMark:J}}let s=n||new Date,u=s.getFullYear(),r=s.getMonth();s.getDate(),s.getHours();let o=new Date,a=new Date(u,r-1,28,0,0,0,0),c=el(a.getFullYear(),a.getMonth());a.setDate(c),a.setDate(c-(a.getDay()-i+7)%7);let f=new Date(a);f.setDate(f.getDate()+42);let b=f.valueOf(),h=[],g=[],p=-1,d=[],w=0,S=42,N=0;for(;a.valueOf()u||a.getFullYear()===u&&a.getMonth()>r)&&(S=N-1),a.setDate(a.getDate()+1),a.getFullYear()===o.getFullYear()&&a.getMonth()===o.getMonth()&&a.getDate()===o.getDate()&&(p=N),d.length!==e.length&&e.map(C=>{a.getFullYear()===C.getFullYear()&&a.getMonth()===C.getMonth()&&a.getDate()===C.getDate()&&d.push(N)}),g.length===7&&(h.push(g),g=[]);return{grid:h,days:h,todayMark:p,prevTo:w,nextFrom:S,selectionMark:d}}function Nl(n,{duration:e=400,start:t=0,end:l=1,opacity:i=0}){const s=getComputedStyle(n),u=+s.opacity,r=s.transform==="none"?"":s.transform,o=1-t,a=u*(1-i);return l=l||1,{delay:0,duration:e,easing:Vl,css:(c,f)=>` + transform: ${r} scale(${l!==1?t+l*f:1-o*f}); + opacity: ${u-a*f}; + `}}function Qt(n,e,t){const l=n.slice();return l[47]=e[t],l[49]=t,l}function xt(n,e,t){const l=n.slice();l[50]=e[t],l[54]=t;const i=l[49]*7+l[54];l[51]=i;const s=l[50].getTime();return l[52]=s,l}function $t(n,e,t){const l=n.slice();return l[55]=e[t],l}function en(n,e,t){const l=n.slice();return l[47]=e[t],l[49]=t,l}function tn(n,e,t){const l=n.slice();l[59]=e[t],l[54]=t;const i=l[49]*4+l[54];return l[51]=i,l}function nn(n,e,t){const l=n.slice();return l[47]=e[t],l[49]=t,l}function ln(n,e,t){const l=n.slice();l[62]=e[t],l[54]=t;const i=l[49]*4+l[54];return l[51]=i,l}function sn(n){let e,t,l,i,s,u;return{c(){e=R("button"),t=bt("svg"),l=bt("path"),this.h()},l(r){e=I(r,"BUTTON",{type:!0,class:!0,title:!0});var o=P(e);t=yt(o,"svg",{class:!0,xmlns:!0,viewBox:!0,width:!0,height:!0});var a=P(t);l=yt(a,"path",{"fill-rule":!0,d:!0}),P(l).forEach(T),a.forEach(T),o.forEach(T),this.h()},h(){y(l,"fill-rule","evenodd"),y(l,"d","M1.5 8a6.5 6.5 0 1113 0 6.5 6.5 0 01-13 0zM8 0a8 8 0 100 16A8 8 0 008 0zm.5 4.75a.75.75 0 00-1.5 0v3.5a.75.75 0 00.471.696l2.5 1a.75.75 0 00.557-1.392L8.5 7.742V4.75z"),y(t,"class","sdt-svg svelte-14xtbbo"),y(t,"xmlns","http://www.w3.org/2000/svg"),y(t,"viewBox","0 0 16 16"),y(t,"width","16"),y(t,"height","16"),y(e,"type","button"),y(e,"class","std-btn std-btn-header icon-btn sdt-time-icon svelte-14xtbbo"),y(e,"title",i=n[3].timeView)},m(r,o){K(r,e,o),E(e,t),E(t,l),s||(u=X(e,"click",n[27]),s=!0)},p(r,o){o[0]&8&&i!==(i=r[3].timeView)&&y(e,"title",i)},d(r){r&&T(e),s=!1,u()}}}function on(n){let e,t,l,i,s,u,r,o,a=fe(n[15].years),c=[];for(let f=0;f{u&&(s&&s.end(1),i=Dt(t,n[18],{duration:Je,start:n[20],opacity:1}),i.start())}),u=!0)},o(f){i&&i.invalidate(),f&&(s=Nt(t,n[18],{duration:Je,end:n[19],start:1})),u=!1},d(f){f&&T(e),rt(c,f),f&&s&&s.end(),r=!1,Re(o)}}}function rn(n,e){let t,l,i=e[62]+"",s,u,r,o;function a(){return e[38](e[62])}return{key:n,first:null,c(){t=R("td"),l=R("button"),s=_e(i),this.h()},l(c){t=I(c,"TD",{class:!0});var f=P(t);l=I(f,"BUTTON",{type:!0,class:!0});var b=P(l);s=be(b,i),b.forEach(T),f.forEach(T),this.h()},h(){y(l,"type","button"),y(l,"class","std-btn svelte-14xtbbo"),l.disabled=u=e[22](new Date(e[62],e[7].getMonth(),e[7].getDate())),z(l,"not-current",!e[21](e[51])),y(t,"class","sdt-cal-td svelte-14xtbbo"),z(t,"is-selected",e[15].selectionMark.includes(e[51])),this.first=t},m(c,f){K(c,t,f),E(t,l),E(l,s),r||(o=X(l,"click",a),r=!0)},p(c,f){e=c,f[0]&32768&&i!==(i=e[62]+"")&&ye(s,i),f[0]&32896&&u!==(u=e[22](new Date(e[62],e[7].getMonth(),e[7].getDate())))&&(l.disabled=u),f[0]&2129920&&z(l,"not-current",!e[21](e[51])),f[0]&32768&&z(t,"is-selected",e[15].selectionMark.includes(e[51]))},d(c){c&&T(t),r=!1,o()}}}function an(n){let e,t=[],l=new Map,i,s=fe(n[47]);const u=r=>r[54];for(let r=0;r{u&&(s&&s.end(1),i=Dt(t,n[18],{duration:Je,start:n[20],opacity:1}),i.start())}),u=!0)},o(f){i&&i.invalidate(),f&&(s=Nt(t,n[18],{duration:Je,end:n[19],start:1})),u=!1},d(f){f&&T(e),rt(c,f),f&&s&&s.end(),r=!1,Re(o)}}}function fn(n,e){let t,l,i=e[59]+"",s,u,r,o;function a(){return e[40](e[59])}return{key:n,first:null,c(){t=R("td"),l=R("button"),s=_e(i),this.h()},l(c){t=I(c,"TD",{class:!0});var f=P(t);l=I(f,"BUTTON",{class:!0,type:!0});var b=P(l);s=be(b,i),b.forEach(T),f.forEach(T),this.h()},h(){y(l,"class","std-btn svelte-14xtbbo"),y(l,"type","button"),l.disabled=u=e[22](new Date(e[7].getFullYear(),e[3].monthsShort.indexOf(e[59]),e[7].getDate())),z(l,"not-current",!e[21](e[51])),y(t,"class","sdt-cal-td svelte-14xtbbo"),z(t,"is-selected",e[51]===e[15].selectionMark[0]),this.first=t},m(c,f){K(c,t,f),E(t,l),E(l,s),r||(o=X(l,"click",a),r=!0)},p(c,f){e=c,f[0]&32768&&i!==(i=e[59]+"")&&ye(s,i),f[0]&32904&&u!==(u=e[22](new Date(e[7].getFullYear(),e[3].monthsShort.indexOf(e[59]),e[7].getDate())))&&(l.disabled=u),f[0]&2129920&&z(l,"not-current",!e[21](e[51])),f[0]&32768&&z(t,"is-selected",e[51]===e[15].selectionMark[0])},d(c){c&&T(t),r=!1,o()}}}function cn(n){let e,t=[],l=new Map,i,s=fe(n[47]);const u=r=>r[54];for(let r=0;r{r&&(u&&u.end(1),s=Dt(t,n[18],{duration:Je,start:.5,opacity:1}),s.start())}),r=!0)},o(g){s&&s.invalidate(),g&&(u=Nt(t,n[18],{duration:Je,start:Math.abs(n[9])})),r=!1},d(g){g&&T(e),rt(f,g),rt(h,g),g&&u&&u.end(),o=!1,a()}}}function dn(n){let e,t=n[55]+"",l;return{c(){e=R("th"),l=_e(t),this.h()},l(i){e=I(i,"TH",{class:!0});var s=P(e);l=be(s,t),s.forEach(T),this.h()},h(){y(e,"class","sdt-cal-th svelte-14xtbbo")},m(i,s){K(i,e,s),E(e,l)},p(i,s){s[0]&131072&&t!==(t=i[55]+"")&&ye(l,t)},d(i){i&&T(e)}}}function mn(n,e){let t,l,i=e[50].getDate()+"",s,u,r,o;function a(){return e[42](e[50])}return{key:n,first:null,c(){t=R("td"),l=R("button"),s=_e(i),this.h()},l(c){t=I(c,"TD",{class:!0});var f=P(t);l=I(f,"BUTTON",{type:!0,class:!0});var b=P(l);s=be(b,i),b.forEach(T),f.forEach(T),this.h()},h(){y(l,"type","button"),y(l,"class","std-btn sdt-btn-day svelte-14xtbbo"),l.disabled=u=(e[16]||e[2]||e[6])&&e[22](e[50]),z(l,"not-current",!e[21](e[49]*7+e[54])),y(t,"class","sdt-cal-td svelte-14xtbbo"),z(t,"sdt-today",e[51]===e[15].todayMark),z(t,"in-range",e[29](e[52])),z(t,"is-selected",e[14].includes(e[52])),z(t,"in-range-hover",e[5]&&e[30](e[52],e[0])),this.first=t},m(c,f){K(c,t,f),E(t,l),E(l,s),r||(o=[X(l,"click",a),X(t,"mouseover",function(){Un(e[28](e[50]))&&e[28](e[50]).apply(this,arguments)}),X(t,"mouseout",e[28]())],r=!0)},p(c,f){e=c,f[0]&32768&&i!==(i=e[50].getDate()+"")&&ye(s,i),f[0]&98372&&u!==(u=(e[16]||e[2]||e[6])&&e[22](e[50]))&&(l.disabled=u),f[0]&2129920&&z(l,"not-current",!e[21](e[49]*7+e[54])),f[0]&32768&&z(t,"sdt-today",e[51]===e[15].todayMark),f[0]&536903680&&z(t,"in-range",e[29](e[52])),f[0]&49152&&z(t,"is-selected",e[14].includes(e[52])),f[0]&1073774625&&z(t,"in-range-hover",e[5]&&e[30](e[52],e[0]))},d(c){c&&T(t),r=!1,Re(o)}}}function gn(n){let e,t=[],l=new Map,i,s=fe(n[47]);const u=r=>r[54];for(let r=0;r{M=null}),Oe()),v[8]===ze?H?(H.p(v,Y),Y[0]&256&&se(H,1)):(H=un(v),H.c(),se(H,1),H.m(p,w)):H&&(Be(),ce(H,1,1,()=>{H=null}),Oe()),v[8]===ve?k?(k.p(v,Y),Y[0]&256&&se(k,1)):(k=hn(v),k.c(),se(k,1),k.m(p,null)):k&&(Be(),ce(k,1,1,()=>{k=null}),Oe()),Y[0]&1024&&z(p,"is-grid",v[10])},i(v){se(M),se(H),se(k)},o(v){ce(M),ce(H),ce(k)},d(v){v&&(T(e),T(g),T(p)),C&&C.d(),M&&M.d(),H&&H.d(),k&&k.d(),S=!1,Re(N)}}}let Je=400;const Te=222,st=148;function Ll(n,e,t){var x;let l,i,s,u,r,o,a,c,{wid:f}=e,{dates:b}=e,{startDate:h=null}=e,{endDate:g=null}=e,{weekStart:p=1}=e,{initialView:d=ve}=e,{i18n:w}=e,{enableTimeToggle:S=!1}=e,{isRange:N=!1}=e,{hoverDate:C=null}=e,{additionalDisableFn:M}=e;function H(D,W){if(B!==ve){t(8,B=ve),t(9,V=1),t(7,v=new Date(k||new Date));return}if(!k){F(new Date,{keyboard:!0});return}let Z=new Date(k);switch(D){case"PageDown":W=!0;case"ArrowDown":W?Z.setMonth(k.getMonth()+1):Z.setDate(k.getDate()+7),W&&Z.getMonth()===k.getMonth()&&Z.setDate(0),F(Z,{keyboard:!0});break;case"PageUp":W=!0;case"ArrowUp":W?Z.setMonth(k.getMonth()-1):Z.setDate(k.getDate()-7),W&&Z.getMonth()===k.getMonth()&&Z.setDate(0),F(Z,{keyboard:!0});break;case"ArrowLeft":W?Z.setFullYear(k.getFullYear()-1):Z.setDate(k.getDate()-1),F(Z,{keyboard:!0});break;case"ArrowRight":W?Z.setFullYear(k.getFullYear()+1):Z.setDate(k.getDate()+1),F(Z,{keyboard:!0});break}}let k=b[f]||null,v=f===1?(()=>{const D=new Date(b[0]||new Date);return D.setMonth(D.getMonth()+1),D})():new Date(((x=b[0])==null?void 0:x.valueOf())||new Date);const Y=At();let B=d,V=-2,J=!1,O=Te,L=null;function Q(D){return o.prevTo<=D&&DD||g&&g<=D||M&&M(D))return!0;break;case ze:if(l&&l.getFullYear()===D.getFullYear()&&l.getMonth()>D.getMonth()||g&&g.getFullYear()===D.getFullYear()&&g.getMonth()D.getFullYear()||g&&g.getFullYear()=10?Te:st:Te)}function U(D){if(B===ve)return G(D);if(t(12,L=()=>{G(D)}),B===He){t(11,O=O===st?D===-1?O-Te:Te+st:D===-1?O-Te:O+st);return}t(11,O=D===-1?O-Te:O+Te)}function pe(){if(t(9,V=-1),t(10,J=!0),B&&t(8,B--,B),B===He){const D=Math.floor(v.getFullYear()/10)*10%20===0;t(11,O=D?st:Te)}}function F(D,{keyboard:W}={}){switch(t(9,V=1),t(10,J=!0),B){case 0:v.setFullYear(D),t(7,v);break;case 1:v.setMonth(w.monthsShort.indexOf(D)),t(7,v);break;case 2:if($(D)||M&&M(D))return;const Z=new Date(D.getFullYear(),D.getMonth(),D.getDate());k&&(Z.setMinutes(k.getMinutes()),Z.setHours(k.getHours())),k=Z,W&&(v.getFullYear()!==Z.getFullYear()||v.getFullYear()===Z.getFullYear()&&v.getMonth()!==Z.getMonth())&&(v.setFullYear(Z.getFullYear()),v.setMonth(Z.getMonth()),t(7,v)),Y("date",{value:k,update:"date",isKeyboard:W});break}B=r[0]&&D=W&&r[0]>=D)}const le=()=>U(-1),ae=()=>U(1),ie=D=>{F(D)},me=()=>L&&L(),we=D=>{F(D)},q=()=>L&&L(),de=D=>{F(D)};return n.$$set=D=>{"wid"in D&&t(31,f=D.wid),"dates"in D&&t(1,b=D.dates),"startDate"in D&&t(32,h=D.startDate),"endDate"in D&&t(2,g=D.endDate),"weekStart"in D&&t(33,p=D.weekStart),"initialView"in D&&t(34,d=D.initialView),"i18n"in D&&t(3,w=D.i18n),"enableTimeToggle"in D&&t(4,S=D.enableTimeToggle),"isRange"in D&&t(5,N=D.isRange),"hoverDate"in D&&t(0,C=D.hoverDate),"additionalDisableFn"in D&&t(6,M=D.additionalDisableFn)},n.$$.update=()=>{n.$$.dirty[1]&2&&t(16,l=h?new Date(h.getFullYear(),h.getMonth(),h.getDate(),0,0,0,0):null),n.$$.dirty[0]&512&&t(20,i=V<1?1.5:.5),n.$$.dirty[0]&512&&t(19,s=V<1?1:1.5),n.$$.dirty[0]&512&&t(18,u=V===-2?Pe:V!==null?Nl:()=>({})),n.$$.dirty[0]&2&&t(14,r=b.map(D=>(D=new Date(D),D.setHours(0,0),D.getTime()))),n.$$.dirty[0]&394|n.$$.dirty[1]&4&&t(15,o=Il(v,b,B,w,p)),n.$$.dirty[0]&8|n.$$.dirty[1]&4&&t(17,a=w.daysMin.concat(...w.daysMin.slice(1)).slice(p,7+p)),n.$$.dirty[0]&2&&b.length===0&&(k=null),n.$$.dirty[0]&392&&t(13,c=w&&j(B,v))},[C,b,g,w,S,N,M,v,B,V,J,O,L,c,r,o,l,a,u,s,i,Q,$,U,pe,F,A,_,oe,ne,he,f,h,p,d,H,le,ae,ie,me,we,q,de]}class Ul extends Rt{constructor(e){super(),It(this,e,Ll,Pl,Vt,{wid:31,dates:1,startDate:32,endDate:2,weekStart:33,initialView:34,i18n:3,enableTimeToggle:4,isRange:5,hoverDate:0,additionalDisableFn:6,handleGridNav:35},null,[-1,-1,-1])}get handleGridNav(){return this.$$.ctx[35]}}function _n(n,e,t){const l=n.slice();return l[36]=e[t],l[38]=t,l}function bn(n,e,t){const l=n.slice();return l[36]=e[t],l[38]=t,l}function yn(n){let e,t,l,i,s,u;return{c(){e=R("button"),t=bt("svg"),l=bt("path"),this.h()},l(r){e=I(r,"BUTTON",{type:!0,class:!0,title:!0});var o=P(e);t=yt(o,"svg",{class:!0,xmlns:!0,viewBox:!0,width:!0,height:!0});var a=P(t);l=yt(a,"path",{"fill-rule":!0,d:!0}),P(l).forEach(T),a.forEach(T),o.forEach(T),this.h()},h(){y(l,"fill-rule","evenodd"),y(l,"d","M6.75 0a.75.75 0 01.75.75V3h9V.75a.75.75 0 011.5 0V3h2.75c.966 0 1.75.784 1.75 1.75v16a1.75 1.75 0 01-1.75 1.75H3.25a1.75 1.75 0 01-1.75-1.75v-16C1.5 3.784 2.284 3 3.25 3H6V.75A.75.75 0 016.75 0zm-3.5 4.5a.25.25 0 00-.25.25V8h18V4.75a.25.25 0 00-.25-.25H3.25zM21 9.5H3v11.25c0 .138.112.25.25.25h17.5a.25.25 0 00.25-.25V9.5z"),y(t,"class","sdt-svg svelte-1u35wsk"),y(t,"xmlns","http://www.w3.org/2000/svg"),y(t,"viewBox","0 0 24 24"),y(t,"width","20"),y(t,"height","20"),y(e,"type","button"),y(e,"class","sdt-time-btn sdt-back-btn svelte-1u35wsk"),y(e,"title",i=n[4].backToDate)},m(r,o){K(r,e,o),E(e,t),E(t,l),s||(u=X(e,"click",n[21]),s=!0)},p(r,o){o[0]&16&&i!==(i=r[4].backToDate)&&y(e,"title",i)},d(r){r&&T(e),s=!1,u()}}}function pn(n){let e,t,l=n[12]?"PM":"AM",i,s,u,r;return{c(){e=R("div"),t=R("button"),i=_e(l),this.h()},l(o){e=I(o,"DIV",{class:!0});var a=P(e);t=I(a,"BUTTON",{type:!0,class:!0,"data-value":!0});var c=P(t);i=be(c,l),c.forEach(T),a.forEach(T),this.h()},h(){y(t,"type","button"),y(t,"class","sdt-time-btn sdt-time-figure is-active svelte-1u35wsk"),y(t,"data-value",s=n[12]?n[8]%12:n[8]+12),y(e,"class","sdt-meridian svelte-1u35wsk")},m(o,a){K(o,e,a),E(e,t),E(t,i),u||(r=X(t,"click",n[19]),u=!0)},p(o,a){a[0]&4096&&l!==(l=o[12]?"PM":"AM")&&ye(i,l),a[0]&4352&&s!==(s=o[12]?o[8]%12:o[8]+12)&&y(t,"data-value",s)},d(o){o&&T(e),u=!1,r()}}}function wn(n,e){let t,l=e[36].val+"",i,s,u,r,o,a;return{key:n,first:null,c(){t=R("button"),i=_e(l),this.h()},l(c){t=I(c,"BUTTON",{type:!0,style:!0,class:!0,"data-value":!0});var f=P(t);i=be(f,l),f.forEach(T),this.h()},h(){y(t,"type","button"),y(t,"style",s=`left:${e[36].x}px; top:${e[36].y}px`),y(t,"class","sdt-tick svelte-1u35wsk"),y(t,"data-value",u=e[36].val),t.disabled=r=(e[0]||e[1])&&e[6]&&e[17](e[36].val,!1),z(t,"outer-tick",e[5]),z(t,"is-selected",e[16](e[8],e[36].val,e[38])),this.first=t},m(c,f){K(c,t,f),E(t,i),a=!0},p(c,f){e=c,(!a||f[0]&16384)&&l!==(l=e[36].val+"")&&ye(i,l),(!a||f[0]&16384&&s!==(s=`left:${e[36].x}px; top:${e[36].y}px`))&&y(t,"style",s),(!a||f[0]&16384&&u!==(u=e[36].val))&&y(t,"data-value",u),(!a||f[0]&16451&&r!==(r=(e[0]||e[1])&&e[6]&&e[17](e[36].val,!1)))&&(t.disabled=r),(!a||f[0]&32)&&z(t,"outer-tick",e[5]),(!a||f[0]&82176)&&z(t,"is-selected",e[16](e[8],e[36].val,e[38]))},i(c){a||(c&&Ue(()=>{a&&(o||(o=Ke(t,Pe,{duration:200},!0)),o.run(1))}),a=!0)},o(c){c&&(o||(o=Ke(t,Pe,{duration:200},!1)),o.run(0)),a=!1},d(c){c&&T(t),c&&o&&o.end()}}}function kn(n){let e,t=n[36].val+"",l,i,s,u,r,o;return{c(){e=R("button"),l=_e(t),this.h()},l(a){e=I(a,"BUTTON",{type:!0,style:!0,class:!0,"data-value":!0});var c=P(e);l=be(c,t),c.forEach(T),this.h()},h(){y(e,"type","button"),y(e,"style",i=`left:${n[36].x}px; top:${n[36].y}px;`),y(e,"class","sdt-tick svelte-1u35wsk"),y(e,"data-value",s=n[36].val),e.disabled=u=(n[0]||n[1])&&n[6]&&n[17](n[36].val,!1),z(e,"outer-tick",n[2]&&!n[5]),z(e,"is-selected",n[16](n[5]?n[7]:n[8],n[36].val,n[38]))},m(a,c){K(a,e,c),E(e,l),o=!0},p(a,c){(!o||c[0]&8192)&&t!==(t=a[36].val+"")&&ye(l,t),(!o||c[0]&8192&&i!==(i=`left:${a[36].x}px; top:${a[36].y}px;`))&&y(e,"style",i),(!o||c[0]&8192&&s!==(s=a[36].val))&&y(e,"data-value",s),(!o||c[0]&8259&&u!==(u=(a[0]||a[1])&&a[6]&&a[17](a[36].val,!1)))&&(e.disabled=u),(!o||c[0]&36)&&z(e,"outer-tick",a[2]&&!a[5]),(!o||c[0]&74144)&&z(e,"is-selected",a[16](a[5]?a[7]:a[8],a[36].val,a[38]))},i(a){o||(a&&Ue(()=>{o&&(r||(r=Ke(e,Pe,{duration:200},!0)),r.run(1))}),o=!0)},o(a){a&&(r||(r=Ke(e,Pe,{duration:200},!1)),r.run(0)),o=!1},d(a){a&&T(e),a&&r&&r.end()}}}function jl(n){let e,t,l,i,s=n[15](n[8],n[2])+"",u,r,o,a=":",c,f,b=n[15](n[7],!1)+"",h,g,p,d,w,S,N,C,M,H=[],k=new Map,v,Y,B,V,J,O=n[3]&&yn(n),L=n[2]&&pn(n),Q=fe(n[14]);const $=F=>F[36].val;for(let F=0;Fce(U[F],1,1,()=>{U[F]=null});return{c(){e=R("div"),t=R("div"),O&&O.c(),l=ee(),i=R("button"),u=_e(s),r=ee(),o=R("span"),o.textContent=a,c=ee(),f=R("button"),h=_e(b),g=ee(),L&&L.c(),p=ee(),d=R("div"),w=R("div"),S=ee(),N=R("div"),C=R("div"),M=ee();for(let F=0;F{Y=Dt(e,Pe,{duration:200}),Y.start()})),B=!0}},o(F){for(let A=0;A=9||q<3?-1:1)*j),val:ne?q*5||oe:q?q+he:oe});return we}function V(_,j){return j?i&&_===12?12:_<10||_%12<10?`0${_%12}`:_%12:_<10?`0${_}`:_}function J(_,j,oe){return M?j===_||oe===0&&oe===_:p?i&&j==12&&_===12||!i&&j==12&&_===0?!0:j===(_?_%12:12):+j>12?(oe?u*oe+12:0)===_:j==="00"||j==="12"?_===12&&parseInt(j)==12||j==="00"&&_===0:j===_}function O(_,j=!1){return typeof _=="string"&&(_=parseInt(_)),b&&h&&r?M||j?b.getHours()===k.getHours()&&b.getMinutes()>_||h.getHours()===k.getHours()&&h.getMinutes()<_:b.getHours()>_||h.getHours()<_:b&&b.getDate()===k.getDate()&&b.getMonth()===k.getMonth()&&b.getFullYear()===k.getFullYear()?M||j?b.getHours()===k.getHours()&&b.getMinutes()>_:b.getHours()>_:h&&h.getDate()===k.getDate()&&h.getMonth()===k.getMonth()&&h.getFullYear()===k.getFullYear()?M||j?h.getHours()===k.getHours()&&h.getMinutes()<_:h.getHours()<_:!1}function L(_){if(!_.target)return;let j=0,oe=0;if(_.target.tagName==="BUTTON"){let ne=parseInt(_.target.dataset.value);const he=M?"setMinutes":"setHours";!M&&i&&(ne+=12),M&&g!==1&&(ne=ne>s?s+g:s-g),k[he](ne)}else if(M){const ne=C.getBoundingClientRect(),he=_.clientX-ne.left,le=_.clientY-ne.top,ae=130,ie=130;let me=null;switch(he>ae?me=le>ie?2:1:me=le>ie?3:4,me){case 1:j=he-ae,oe=ie-le;break;case 2:j=he-ae,oe=le-ie;break;case 3:j=ae-he,oe=le-ie;break;case 4:j=ae-he,oe=ie-le;break}const we=Math.sqrt(j*j+oe*oe),q=90-Math.asin(j/we)*(180/Math.PI);let de=0;switch(me){case 1:de=90-q;break;case 2:de=q+90;break;case 3:de=270-q;break;case 4:de=q+270;break}de=Math.round(de/6/g)*g,de>=60&&(de=0),k.setMinutes(de)}t(6,k),t(22,f),H||(v(M?"minute":"hour",{value:k,isKeyboard:_.type==="keyboard",dateIndex:c}),_.type!=="keyboard"&&!M&&t(5,M=!0))}function Q(_){const j=parseInt(_.target.dataset.value);k.setHours(j),t(6,k),t(22,f),v(M?"minute":"hour",{value:k,isKeyboard:_.type==="keyboard"})}function $(_){t(10,H=_.type==="mousedown")}function G(){v("switch","date")}const U=()=>t(5,M=!1),pe=()=>t(5,M=!0),F=_=>{H&&L(_)};function A(_){_t[_?"unshift":"push"](()=>{C=_,t(9,C)})}return n.$$set=_=>{"wid"in _&&t(23,c=_.wid),"date"in _&&t(22,f=_.date),"startDate"in _&&t(0,b=_.startDate),"endDate"in _&&t(1,h=_.endDate),"minuteIncrement"in _&&t(24,g=_.minuteIncrement),"showMeridian"in _&&t(2,p=_.showMeridian),"hasDateComponent"in _&&t(3,d=_.hasDateComponent),"i18n"in _&&t(4,w=_.i18n)},n.$$.update=()=>{if(n.$$.dirty[0]&4194368&&f!==k&&f&&t(6,k=f),n.$$.dirty[0]&67){let _=!1;b&&b.toDateString()===k.toDateString()&&(O(k.getHours())&&(k.setHours(b.getHours()),_=!0),O(k.getMinutes(),!0)&&(k.setMinutes(b.getMinutes()),_=!0)),h&&h.toDateString()===k.toDateString()&&(O(k.getHours())&&(k.setHours(h.getHours()),_=!0),O(k.getMinutes(),!0)&&(k.setMinutes(h.getMinutes()),_=!0)),_&&zn().then(()=>v("time",k))}if(n.$$.dirty[0]&64&&t(8,l=k?k.getHours():0),n.$$.dirty[0]&260&&t(12,i=p?l>=12:!1),n.$$.dirty[0]&64&&t(7,s=k?k.getMinutes():0),n.$$.dirty[0]&420){let _=M?s*6:l%12*30;t(11,Y=M||p||l<12?`transform: rotateZ(${_}deg);`:`transform: rotateZ(${_}deg); height: calc(25% + 1px)`)}n.$$.dirty[0]&32&&(u=M?5:1),n.$$.dirty[0]&3&&(r=b&&h&&["getFullYear","getMonth","getDate"].every(_=>h[_]()===b[_]())),n.$$.dirty[0]&32&&t(14,o=B(M?220:180,110,"00",!1,0)),n.$$.dirty[0]&32&&t(13,a=B(M?180:120,110,M?"00":"12",M,12)),n.$$.dirty[0]&32&&v("time-switch",M)},[b,h,p,d,w,M,k,s,l,C,H,Y,i,a,o,V,J,O,L,Q,$,G,f,c,g,S,N,U,pe,F,A]}class Wl extends Rt{constructor(e){super(),It(this,e,zl,jl,Vt,{wid:23,date:22,startDate:0,endDate:1,minuteIncrement:24,showMeridian:2,hasDateComponent:3,i18n:4,showMinuteView:25,makeTick:26},null,[-1,-1])}get showMinuteView(){return this.$$.ctx[25]}get makeTick(){return this.$$.ctx[26]}}function Lt(n){return n.split("-")[1]}function tl(n){return n==="y"?"height":"width"}function We(n){return n.split("-")[0]}function Ut(n){return["top","bottom"].includes(We(n))?"x":"y"}function vn(n,e,t){let{reference:l,floating:i}=n;const s=l.x+l.width/2-i.width/2,u=l.y+l.height/2-i.height/2,r=Ut(e),o=tl(r),a=l[o]/2-i[o]/2,c=r==="x";let f;switch(We(e)){case"top":f={x:s,y:l.y-i.height};break;case"bottom":f={x:s,y:l.y+l.height};break;case"right":f={x:l.x+l.width,y:u};break;case"left":f={x:l.x-i.width,y:u};break;default:f={x:l.x,y:l.y}}switch(Lt(e)){case"start":f[r]-=a*(t&&c?-1:1);break;case"end":f[r]+=a*(t&&c?-1:1)}return f}const ql=async(n,e,t)=>{const{placement:l="bottom",strategy:i="absolute",middleware:s=[],platform:u}=t,r=s.filter(Boolean),o=await(u.isRTL==null?void 0:u.isRTL(e));let a=await u.getElementRects({reference:n,floating:e,strategy:i}),{x:c,y:f}=vn(a,l,o),b=l,h={},g=0;for(let p=0;pn.concat(e,e+"-start",e+"-end"),[]);const Jl={left:"right",right:"left",bottom:"top",top:"bottom"};function wt(n){return n.replace(/left|right|bottom|top/g,e=>Jl[e])}function Ql(n,e,t){t===void 0&&(t=!1);const l=Lt(n),i=Ut(n),s=tl(i);let u=i==="x"?l===(t?"end":"start")?"right":"left":l==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(u=wt(u)),{main:u,cross:wt(u)}}const xl={start:"end",end:"start"};function Ct(n){return n.replace(/start|end/g,e=>xl[e])}const $l=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(e){var t;const{placement:l,middlewareData:i,rects:s,initialPlacement:u,platform:r,elements:o}=e,{mainAxis:a=!0,crossAxis:c=!0,fallbackPlacements:f,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...p}=jt(n,e),d=We(l),w=We(u)===u,S=await(r.isRTL==null?void 0:r.isRTL(o.floating)),N=f||(w||!g?[wt(u)]:function(V){const J=wt(V);return[Ct(V),J,Ct(J)]}(u));f||h==="none"||N.push(...function(V,J,O,L){const Q=Lt(V);let $=function(G,U,pe){const F=["left","right"],A=["right","left"],_=["top","bottom"],j=["bottom","top"];switch(G){case"top":case"bottom":return pe?U?A:F:U?F:A;case"left":case"right":return U?_:j;default:return[]}}(We(V),O==="start",L);return Q&&($=$.map(G=>G+"-"+Q),J&&($=$.concat($.map(Ct)))),$}(u,g,h,S));const C=[u,...N],M=await nl(e,p),H=[];let k=((t=i.flip)==null?void 0:t.overflows)||[];if(a&&H.push(M[d]),c){const{main:V,cross:J}=Ql(l,s,S);H.push(M[V],M[J])}if(k=[...k,{placement:l,overflows:H}],!H.every(V=>V<=0)){var v,Y;const V=(((v=i.flip)==null?void 0:v.index)||0)+1,J=C[V];if(J)return{data:{index:V,overflows:k},reset:{placement:J}};let O=(Y=k.filter(L=>L.overflows[0]<=0).sort((L,Q)=>L.overflows[1]-Q.overflows[1])[0])==null?void 0:Y.placement;if(!O)switch(b){case"bestFit":{var B;const L=(B=k.map(Q=>[Q.placement,Q.overflows.filter($=>$>0).reduce(($,G)=>$+G,0)]).sort((Q,$)=>Q[1]-$[1])[0])==null?void 0:B[0];L&&(O=L);break}case"initialPlacement":O=u}if(l!==O)return{reset:{placement:O}}}return{}}}};function ei(n){return n==="x"?"y":"x"}const ti=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(e){const{x:t,y:l,placement:i}=e,{mainAxis:s=!0,crossAxis:u=!1,limiter:r={fn:d=>{let{x:w,y:S}=d;return{x:w,y:S}}},...o}=jt(n,e),a={x:t,y:l},c=await nl(e,o),f=Ut(We(i)),b=ei(f);let h=a[f],g=a[b];if(s){const d=f==="y"?"bottom":"right";h=Dn(h+c[f==="y"?"top":"left"],h,h-c[d])}if(u){const d=b==="y"?"bottom":"right";g=Dn(g+c[b==="y"?"top":"left"],g,g-c[d])}const p=r.fn({...e,[f]:h,[b]:g});return{...p,data:{x:p.x-t,y:p.y-l}}}}};function ke(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function Fe(n){return ke(n).getComputedStyle(n)}function ll(n){return n instanceof ke(n).Node}function Ve(n){return ll(n)?(n.nodeName||"").toLowerCase():"#document"}function De(n){return n instanceof HTMLElement||n instanceof ke(n).HTMLElement}function Mn(n){return typeof ShadowRoot<"u"&&(n instanceof ke(n).ShadowRoot||n instanceof ShadowRoot)}function at(n){const{overflow:e,overflowX:t,overflowY:l,display:i}=Fe(n);return/auto|scroll|overlay|hidden|clip/.test(e+l+t)&&!["inline","contents"].includes(i)}function ni(n){return["table","td","th"].includes(Ve(n))}function Bt(n){const e=zt(),t=Fe(n);return t.transform!=="none"||t.perspective!=="none"||!!t.containerType&&t.containerType!=="normal"||!e&&!!t.backdropFilter&&t.backdropFilter!=="none"||!e&&!!t.filter&&t.filter!=="none"||["transform","perspective","filter"].some(l=>(t.willChange||"").includes(l))||["paint","layout","strict","content"].some(l=>(t.contain||"").includes(l))}function zt(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Mt(n){return["html","body","#document"].includes(Ve(n))}const Ot=Math.min,qe=Math.max,kt=Math.round,mt=Math.floor,Ae=n=>({x:n,y:n});function il(n){const e=Fe(n);let t=parseFloat(e.width)||0,l=parseFloat(e.height)||0;const i=De(n),s=i?n.offsetWidth:t,u=i?n.offsetHeight:l,r=kt(t)!==s||kt(l)!==u;return r&&(t=s,l=u),{width:t,height:l,$:r}}function Se(n){return n instanceof Element||n instanceof ke(n).Element}function Wt(n){return Se(n)?n:n.contextElement}function Ge(n){const e=Wt(n);if(!De(e))return Ae(1);const t=e.getBoundingClientRect(),{width:l,height:i,$:s}=il(e);let u=(s?kt(t.width):t.width)/l,r=(s?kt(t.height):t.height)/i;return u&&Number.isFinite(u)||(u=1),r&&Number.isFinite(r)||(r=1),{x:u,y:r}}const li=Ae(0);function sl(n){const e=ke(n);return zt()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:li}function Le(n,e,t,l){e===void 0&&(e=!1),t===void 0&&(t=!1);const i=n.getBoundingClientRect(),s=Wt(n);let u=Ae(1);e&&(l?Se(l)&&(u=Ge(l)):u=Ge(n));const r=function(b,h,g){return h===void 0&&(h=!1),!(!g||h&&g!==ke(b))&&h}(s,t,l)?sl(s):Ae(0);let o=(i.left+r.x)/u.x,a=(i.top+r.y)/u.y,c=i.width/u.x,f=i.height/u.y;if(s){const b=ke(s),h=l&&Se(l)?ke(l):l;let g=b.frameElement;for(;g&&l&&h!==b;){const p=Ge(g),d=g.getBoundingClientRect(),w=getComputedStyle(g),S=d.left+(g.clientLeft+parseFloat(w.paddingLeft))*p.x,N=d.top+(g.clientTop+parseFloat(w.paddingTop))*p.y;o*=p.x,a*=p.y,c*=p.x,f*=p.y,o+=S,a+=N,g=ke(g).frameElement}}return pt({width:c,height:f,x:o,y:a})}function Tt(n){return Se(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function Ye(n){var e;return(e=(ll(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function ol(n){return Le(Ye(n)).left+Tt(n).scrollLeft}function Qe(n){if(Ve(n)==="html")return n;const e=n.assignedSlot||n.parentNode||Mn(n)&&n.host||Ye(n);return Mn(e)?e.host:e}function rl(n){const e=Qe(n);return Mt(e)?n.ownerDocument?n.ownerDocument.body:n.body:De(e)&&at(e)?e:rl(e)}function vt(n,e){var t;e===void 0&&(e=[]);const l=rl(n),i=l===((t=n.ownerDocument)==null?void 0:t.body),s=ke(l);return i?e.concat(s,s.visualViewport||[],at(l)?l:[]):e.concat(l,vt(l))}function Tn(n,e,t){let l;if(e==="viewport")l=function(i,s){const u=ke(i),r=Ye(i),o=u.visualViewport;let a=r.clientWidth,c=r.clientHeight,f=0,b=0;if(o){a=o.width,c=o.height;const h=zt();(!h||h&&s==="fixed")&&(f=o.offsetLeft,b=o.offsetTop)}return{width:a,height:c,x:f,y:b}}(n,t);else if(e==="document")l=function(i){const s=Ye(i),u=Tt(i),r=i.ownerDocument.body,o=qe(s.scrollWidth,s.clientWidth,r.scrollWidth,r.clientWidth),a=qe(s.scrollHeight,s.clientHeight,r.scrollHeight,r.clientHeight);let c=-u.scrollLeft+ol(i);const f=-u.scrollTop;return Fe(r).direction==="rtl"&&(c+=qe(s.clientWidth,r.clientWidth)-o),{width:o,height:a,x:c,y:f}}(Ye(n));else if(Se(e))l=function(i,s){const u=Le(i,!0,s==="fixed"),r=u.top+i.clientTop,o=u.left+i.clientLeft,a=De(i)?Ge(i):Ae(1);return{width:i.clientWidth*a.x,height:i.clientHeight*a.y,x:o*a.x,y:r*a.y}}(e,t);else{const i=sl(n);l={...e,x:e.x-i.x,y:e.y-i.y}}return pt(l)}function al(n,e){const t=Qe(n);return!(t===e||!Se(t)||Mt(t))&&(Fe(t).position==="fixed"||al(t,e))}function ii(n,e,t){const l=De(e),i=Ye(e),s=t==="fixed",u=Le(n,!0,s,e);let r={scrollLeft:0,scrollTop:0};const o=Ae(0);if(l||!l&&!s)if((Ve(e)!=="body"||at(i))&&(r=Tt(e)),De(e)){const a=Le(e,!0,s,e);o.x=a.x+e.clientLeft,o.y=a.y+e.clientTop}else i&&(o.x=ol(i));return{x:u.left+r.scrollLeft-o.x,y:u.top+r.scrollTop-o.y,width:u.width,height:u.height}}function Fn(n,e){return De(n)&&Fe(n).position!=="fixed"?e?e(n):n.offsetParent:null}function En(n,e){const t=ke(n);if(!De(n))return t;let l=Fn(n,e);for(;l&&ni(l)&&Fe(l).position==="static";)l=Fn(l,e);return l&&(Ve(l)==="html"||Ve(l)==="body"&&Fe(l).position==="static"&&!Bt(l))?t:l||function(i){let s=Qe(i);for(;De(s)&&!Mt(s);){if(Bt(s))return s;s=Qe(s)}return null}(n)||t}const si={convertOffsetParentRelativeRectToViewportRelativeRect:function(n){let{rect:e,offsetParent:t,strategy:l}=n;const i=De(t),s=Ye(t);if(t===s)return e;let u={scrollLeft:0,scrollTop:0},r=Ae(1);const o=Ae(0);if((i||!i&&l!=="fixed")&&((Ve(t)!=="body"||at(s))&&(u=Tt(t)),De(t))){const a=Le(t);r=Ge(t),o.x=a.x+t.clientLeft,o.y=a.y+t.clientTop}return{width:e.width*r.x,height:e.height*r.y,x:e.x*r.x-u.scrollLeft*r.x+o.x,y:e.y*r.y-u.scrollTop*r.y+o.y}},getDocumentElement:Ye,getClippingRect:function(n){let{element:e,boundary:t,rootBoundary:l,strategy:i}=n;const s=[...t==="clippingAncestors"?function(o,a){const c=a.get(o);if(c)return c;let f=vt(o).filter(p=>Se(p)&&Ve(p)!=="body"),b=null;const h=Fe(o).position==="fixed";let g=h?Qe(o):o;for(;Se(g)&&!Mt(g);){const p=Fe(g),d=Bt(g);d||p.position!=="fixed"||(b=null),(h?!d&&!b:!d&&p.position==="static"&&b&&["absolute","fixed"].includes(b.position)||at(g)&&!d&&al(o,g))?f=f.filter(w=>w!==g):b=p,g=Qe(g)}return a.set(o,f),f}(e,this._c):[].concat(t),l],u=s[0],r=s.reduce((o,a)=>{const c=Tn(e,a,i);return o.top=qe(c.top,o.top),o.right=Ot(c.right,o.right),o.bottom=Ot(c.bottom,o.bottom),o.left=qe(c.left,o.left),o},Tn(e,u,i));return{width:r.right-r.left,height:r.bottom-r.top,x:r.left,y:r.top}},getOffsetParent:En,getElementRects:async function(n){let{reference:e,floating:t,strategy:l}=n;const i=this.getOffsetParent||En,s=this.getDimensions;return{reference:ii(e,await i(t),l),floating:{x:0,y:0,...await s(t)}}},getClientRects:function(n){return Array.from(n.getClientRects())},getDimensions:function(n){return il(n)},getScale:Ge,isElement:Se,isRTL:function(n){return getComputedStyle(n).direction==="rtl"}};function oi(n,e,t,l){l===void 0&&(l={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:r=typeof IntersectionObserver=="function",animationFrame:o=!1}=l,a=Wt(n),c=i||s?[...a?vt(a):[],...vt(e)]:[];c.forEach(d=>{i&&d.addEventListener("scroll",t,{passive:!0}),s&&d.addEventListener("resize",t)});const f=a&&r?function(d,w){let S,N=null;const C=Ye(d);function M(){clearTimeout(S),N&&N.disconnect(),N=null}return function H(k,v){k===void 0&&(k=!1),v===void 0&&(v=1),M();const{left:Y,top:B,width:V,height:J}=d.getBoundingClientRect();if(k||w(),!V||!J)return;const O={rootMargin:-mt(B)+"px "+-mt(C.clientWidth-(Y+V))+"px "+-mt(C.clientHeight-(B+J))+"px "+-mt(Y)+"px",threshold:qe(0,Ot(1,v))||1};let L=!0;function Q($){const G=$[0].intersectionRatio;if(G!==v){if(!L)return H();G?H(!1,G):S=setTimeout(()=>{H(!1,1e-7)},100)}L=!1}try{N=new IntersectionObserver(Q,{...O,root:C.ownerDocument})}catch{N=new IntersectionObserver(Q,O)}N.observe(d)}(!0),M}(a,t):null;let b,h=-1,g=null;u&&(g=new ResizeObserver(d=>{let[w]=d;w&&w.target===a&&g&&(g.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{g&&g.observe(e)})),t()}),a&&!o&&g.observe(a),g.observe(e));let p=o?Le(n):null;return o&&function d(){const w=Le(n);!p||w.x===p.x&&w.y===p.y&&w.width===p.width&&w.height===p.height||t(),p=w,b=requestAnimationFrame(d)}(),t(),()=>{c.forEach(d=>{i&&d.removeEventListener("scroll",t),s&&d.removeEventListener("resize",t)}),f&&f(),g&&g.disconnect(),g=null,o&&cancelAnimationFrame(b)}}const ri=(n,e,t)=>{const l=new Map,i={platform:si,...t},s={...i.platform,_c:l};return ql(n,e,{...i,platform:s})};function ai(n){if((n==null?void 0:n.previousElementSibling)===null)return;const e=n==null?void 0:n.previousElementSibling,t=oi(e,n,()=>ri(e,n,{placement:"bottom-start",middleware:[ti({padding:5}),$l()]}).then(({x:l,y:i})=>{Object.assign(n.style,{left:`${l}px`,top:`${i}px`})}));return{destroy(){t()}}}function ui(n,e,t,l,i){let s=n?Array.isArray(n)?n:n.split(","):[];s=s.map(o=>o.replace(/(:\d+):\d+/,"$1"));let u=s,r=e?Array.isArray(e)?e:[e]:u.map(o=>ot(o,t,l,i));return r&&e&&(s=r.map(o=>je(o,t,l,i))),{valueArray:s,prevValue:u,innerDates:r}}function fi(n,e){return n==="auto"?e.match(/g|hh?|ii?/i)&&e.match(/y|m|d/i)?"datetime":e.match(/g|hh?|ii?/i)?"time":"date":n}const ci=n=>({isTodayDisabled:n[1]&1024,currentMode:n[0]&33554432,i18n:n[0]&8388608}),Hn=n=>({onCancel:n[48],onConfirm:n[75],onClear:n[47],onToday:n[46],isTodayDisabled:n[41],currentMode:n[25],i18n:n[23]});function Sn(n,e,t){const l=n.slice();return l[95]=e[t],l[96]=e,l[97]=t,l}const hi=n=>({value:n[0]&1,displayValue:n[0]&1073741824,disabled:n[0]&32,isDirty:n[1]&64}),Yn=n=>({value:n[0],displayValue:n[30],disabled:n[5],isDirty:n[37],onKeyDown:n[49],onInputFocus:n[52],onInputBlur:n[53]});function Cn(n){let e,t,l,i=!n[9]&&Bn(n);return{c(){e=R("input"),t=ee(),i&&i.c(),l=Xe(),this.h()},l(s){e=I(s,"INPUT",{type:!0,name:!0}),t=te(s),i&&i.l(s),l=Xe(),this.h()},h(){y(e,"type","hidden"),y(e,"name",n[4]),e.value=n[0]},m(s,u){K(s,e,u),K(s,t,u),i&&i.m(s,u),K(s,l,u)},p(s,u){u[0]&16&&y(e,"name",s[4]),u[0]&1&&(e.value=s[0]),s[9]?i&&(i.d(1),i=null):i?i.p(s,u):(i=Bn(s),i.c(),i.m(l.parentNode,l))},d(s){s&&(T(e),T(t),T(l)),i&&i.d(s)}}}function Bn(n){let e,t,l,i,s,u;return{c(){e=R("input"),this.h()},l(r){e=I(r,"INPUT",{type:!0,id:!0,tabindex:!0,name:!0,placeholder:!0,autocomplete:!0,inputmode:!0,class:!0}),this.h()},h(){y(e,"type","text"),y(e,"id",n[3]),y(e,"tabindex","0"),y(e,"name",t=n[4].endsWith("]")?n[4].substring(0,n[4].length-1)+"_input]":n[4]+"_input"),e.value=n[30],y(e,"placeholder",n[6]),e.disabled=n[5],e.required=n[7],y(e,"autocomplete","off"),y(e,"inputmode","none"),y(e,"class",l=Ze(n[17])+" svelte-97by3f"),e.readOnly=i=n[24]&&!n[11]&&!n[8],z(e,"value-dirty",!n[22]&&n[37])},m(r,o){K(r,e,o),n[71](e),s||(u=[X(e,"input",function(){Un(n[11]?n[50]:Ln)&&(n[11]?n[50]:Ln).apply(this,arguments)}),Zn(n[42].call(null,e,n[43])),X(e,"focus",n[52]),X(e,"blur",n[53]),X(e,"click",n[72]),X(e,"input",n[69]),X(e,"change",n[70]),X(e,"keydown",n[49])],s=!0)},p(r,o){n=r,o[0]&8&&y(e,"id",n[3]),o[0]&16&&t!==(t=n[4].endsWith("]")?n[4].substring(0,n[4].length-1)+"_input]":n[4]+"_input")&&y(e,"name",t),o[0]&1073741824&&e.value!==n[30]&&(e.value=n[30]),o[0]&64&&y(e,"placeholder",n[6]),o[0]&32&&(e.disabled=n[5]),o[0]&128&&(e.required=n[7]),o[0]&131072&&l!==(l=Ze(n[17])+" svelte-97by3f")&&y(e,"class",l),o[0]&16779520&&i!==(i=n[24]&&!n[11]&&!n[8])&&(e.readOnly=i),o[0]&4325376|o[1]&64&&z(e,"value-dirty",!n[22]&&n[37])},d(r){r&&T(e),n[71](null),s=!1,Re(u)}}}function di(n){let e,t=!n[1]&&Cn(n);return{c(){t&&t.c(),e=Xe()},l(l){t&&t.l(l),e=Xe()},m(l,i){t&&t.m(l,i),K(l,e,i)},p(l,i){l[1]?t&&(t.d(1),t=null):t?t.p(l,i):(t=Cn(l),t.c(),t.m(e.parentNode,e))},d(l){l&&T(e),t&&t.d(l)}}}function On(n){let e,t,l=[],i=new Map,s,u,r,o,a,c,f=fe(n[36]);const b=d=>d[97];for(let d=0;d{o&&(r||(r=Ke(e,n[40],{duration:200},!0)),r.run(1))}),o=!0}},o(d){for(let w=0;wn[74](e,t,l),u=()=>n[74](null,t,l);let r={wid:n[97],date:n[29][n[97]],startDate:n[28],endDate:n[27],hasDateComponent:n[26]!=="time",showMeridian:n[13].match(n[14]==="php"?"a|A":"p|P")!==null,i18n:n[23],minuteIncrement:n[15]};return e=new Wl({props:r}),s(),e.$on("hour",n[44]),e.$on("minute",n[44]),e.$on("switch",n[51]),e.$on("time-switch",n[55]),{c(){Kn(e.$$.fragment)},l(o){Jn(e.$$.fragment,o)},m(o,a){Qn(e,o,a),i=!0},p(o,a){(t!==o[96]||l!==o[97])&&(u(),t=o[96],l=o[97],s());const c={};a[1]&32&&(c.wid=o[97]),a[0]&536870912|a[1]&32&&(c.date=o[29][o[97]]),a[0]&268435456&&(c.startDate=o[28]),a[0]&134217728&&(c.endDate=o[27]),a[0]&67108864&&(c.hasDateComponent=o[26]!=="time"),a[0]&24576&&(c.showMeridian=o[13].match(o[14]==="php"?"a|A":"p|P")!==null),a[0]&8388608&&(c.i18n=o[23]),a[0]&32768&&(c.minuteIncrement=o[15]),e.$set(c)},i(o){i||(se(e.$$.fragment,o),i=!0)},o(o){ce(e.$$.fragment,o),i=!1},d(o){u(),xn(e,o)}}}function gi(n){var i;let e,t,l={wid:n[97],dates:n[29],isRange:n[8],startDate:n[28],endDate:n[27],enableTimeToggle:(i=n[26])==null?void 0:i.includes("time"),initialView:n[2]>2?2:n[2],hoverDate:n[31],additionalDisableFn:n[10],i18n:n[23],weekStart:n[16]};return e=new Ul({props:l}),n[73](e),e.$on("date",n[44]),e.$on("switch",n[51]),e.$on("internal_hoverUpdate",n[54]),{c(){Kn(e.$$.fragment)},l(s){Jn(e.$$.fragment,s)},m(s,u){Qn(e,s,u),t=!0},p(s,u){var o;const r={};u[1]&32&&(r.wid=s[97]),u[0]&536870912&&(r.dates=s[29]),u[0]&256&&(r.isRange=s[8]),u[0]&268435456&&(r.startDate=s[28]),u[0]&134217728&&(r.endDate=s[27]),u[0]&67108864&&(r.enableTimeToggle=(o=s[26])==null?void 0:o.includes("time")),u[0]&4&&(r.initialView=s[2]>2?2:s[2]),u[1]&1&&(r.hoverDate=s[31]),u[0]&1024&&(r.additionalDisableFn=s[10]),u[0]&8388608&&(r.i18n=s[23]),u[0]&65536&&(r.weekStart=s[16]),e.$set(r)},i(s){t||(se(e.$$.fragment,s),t=!0)},o(s){ce(e.$$.fragment,s),t=!1},d(s){n[73](null),xn(e,s)}}}function Vn(n,e){let t,l,i,s,u;const r=[gi,mi],o=[];function a(c,f){return c[25]==="date"?0:1}return l=a(e),i=o[l]=r[l](e),{key:n,first:null,c(){t=R("div"),i.c(),s=ee(),this.h()},l(c){t=I(c,"DIV",{class:!0});var f=P(t);i.l(f),s=te(f),f.forEach(T),this.h()},h(){y(t,"class","sdt-widget svelte-97by3f"),this.first=t},m(c,f){K(c,t,f),o[l].m(t,null),E(t,s),u=!0},p(c,f){e=c;let b=l;l=a(e),l===b?o[l].p(e,f):(Be(),ce(o[b],1,1,()=>{o[b]=null}),Oe(),i=o[l],i?i.p(e,f):(i=o[l]=r[l](e),i.c()),se(i,1),i.m(t,s))},i(c){u||(se(i),u=!0)},o(c){ce(i),u=!1},d(c){c&&T(t),o[l].d()}}}function An(n){let e,t,l=!n[35]&&Rn(n),i=(n[20]||n[21])&&In(n);return{c(){e=R("div"),l&&l.c(),t=ee(),i&&i.c(),this.h()},l(s){e=I(s,"DIV",{class:!0});var u=P(e);l&&l.l(u),t=te(u),i&&i.l(u),u.forEach(T),this.h()},h(){y(e,"class","sdt-btn-row svelte-97by3f")},m(s,u){K(s,e,u),l&&l.m(e,null),E(e,t),i&&i.m(e,null)},p(s,u){s[35]?l&&(l.d(1),l=null):l?l.p(s,u):(l=Rn(s),l.c(),l.m(e,t)),s[20]||s[21]?i?i.p(s,u):(i=In(s),i.c(),i.m(e,null)):i&&(i.d(1),i=null)},d(s){s&&T(e),l&&l.d(),i&&i.d()}}}function Rn(n){let e,t,l=n[23].cancelBtn+"",i,s,u,r=n[23].okBtn+"",o,a,c;return{c(){e=R("span"),t=R("button"),i=_e(l),s=ee(),u=R("button"),o=_e(r),this.h()},l(f){e=I(f,"SPAN",{});var b=P(e);t=I(b,"BUTTON",{type:!0,class:!0});var h=P(t);i=be(h,l),h.forEach(T),s=te(b),u=I(b,"BUTTON",{type:!0,class:!0});var g=P(u);o=be(g,r),g.forEach(T),b.forEach(T),this.h()},h(){y(t,"type","button"),y(t,"class","sdt-action-btn sdt-clear-btn svelte-97by3f"),y(u,"type","button"),y(u,"class","sdt-action-btn sdt-today-btn svelte-97by3f")},m(f,b){K(f,e,b),E(e,t),E(t,i),E(e,s),E(e,u),E(u,o),a||(c=[X(t,"click",n[48]),X(u,"click",n[76])],a=!0)},p(f,b){b[0]&8388608&&l!==(l=f[23].cancelBtn+"")&&ye(i,l),b[0]&8388608&&r!==(r=f[23].okBtn+"")&&ye(o,r)},d(f){f&&T(e),a=!1,Re(c)}}}function In(n){let e,t,l=n[20]&&n[25]==="date"&&Nn(n),i=n[21]&&Pn(n);return{c(){e=R("span"),l&&l.c(),t=ee(),i&&i.c()},l(s){e=I(s,"SPAN",{});var u=P(e);l&&l.l(u),t=te(u),i&&i.l(u),u.forEach(T)},m(s,u){K(s,e,u),l&&l.m(e,null),E(e,t),i&&i.m(e,null)},p(s,u){s[20]&&s[25]==="date"?l?l.p(s,u):(l=Nn(s),l.c(),l.m(e,t)):l&&(l.d(1),l=null),s[21]?i?i.p(s,u):(i=Pn(s),i.c(),i.m(e,null)):i&&(i.d(1),i=null)},d(s){s&&T(e),l&&l.d(),i&&i.d()}}}function Nn(n){let e,t=n[23].todayBtn+"",l,i,s,u;return{c(){e=R("button"),l=_e(t),this.h()},l(r){e=I(r,"BUTTON",{type:!0,class:!0});var o=P(e);l=be(o,t),o.forEach(T),this.h()},h(){y(e,"type","button"),y(e,"class",i=Ze(n[18])+" svelte-97by3f"),e.disabled=n[41]},m(r,o){K(r,e,o),E(e,l),s||(u=X(e,"click",n[46]),s=!0)},p(r,o){o[0]&8388608&&t!==(t=r[23].todayBtn+"")&&ye(l,t),o[0]&262144&&i!==(i=Ze(r[18])+" svelte-97by3f")&&y(e,"class",i),o[1]&1024&&(e.disabled=r[41])},d(r){r&&T(e),s=!1,u()}}}function Pn(n){let e,t=n[23].clearBtn+"",l,i,s,u;return{c(){e=R("button"),l=_e(t),this.h()},l(r){e=I(r,"BUTTON",{type:!0,class:!0});var o=P(e);l=be(o,t),o.forEach(T),this.h()},h(){y(e,"type","button"),y(e,"class",i=Ze(n[19])+" svelte-97by3f")},m(r,o){K(r,e,o),E(e,l),s||(u=X(e,"click",n[47]),s=!0)},p(r,o){o[0]&8388608&&t!==(t=r[23].clearBtn+"")&&ye(l,t),o[0]&524288&&i!==(i=Ze(r[19])+" svelte-97by3f")&&y(e,"class",i)},d(r){r&&T(e),s=!1,u()}}}function _i(n){let e,t=(!n[35]||!0)&&An(n);return{c(){t&&t.c(),e=Xe()},l(l){t&&t.l(l),e=Xe()},m(l,i){t&&t.m(l,i),K(l,e,i)},p(l,i){l[35],t?t.p(l,i):(t=An(l),t.c(),t.m(e.parentNode,e))},d(l){l&&T(e),t&&t.d(l)}}}function bi(n){let e,t,l;const i=n[67].inputs,s=Wn(i,n,n[66],Yn),u=s||di(n);let r=n[34]&&n[24]&&On(n);return{c(){e=R("span"),u&&u.c(),t=ee(),r&&r.c(),this.h()},l(o){e=I(o,"SPAN",{class:!0});var a=P(e);u&&u.l(a),t=te(a),r&&r.l(a),a.forEach(T),this.h()},h(){y(e,"class","std-component-wrap svelte-97by3f")},m(o,a){K(o,e,a),u&&u.m(e,null),E(e,t),r&&r.m(e,null),l=!0},p(o,a){s?s.p&&(!l||a[0]&1073741857|a[1]&64|a[2]&16)&&qn(s,i,o,o[66],l?Xn(i,o[66],a,hi):Gn(o[66]),Yn):u&&u.p&&(!l||a[0]&1094847483|a[1]&74)&&u.p(o,l?a:[-1,-1,-1,-1]),o[34]&&o[24]?r?(r.p(o,a),a[0]&16777216|a[1]&8&&se(r,1)):(r=On(o),r.c(),se(r,1),r.m(e,null)):r&&(Be(),ce(r,1,1,()=>{r=null}),Oe())},i(o){l||(se(u,o),se(r),l=!0)},o(o){ce(u,o),ce(r),l=!1},d(o){o&&T(e),u&&u.d(o),r&&r.d()}}}const ge=Al;function yi(n){return n?[{ref:null},{ref:null}]:[{ref:null}]}const Ln=()=>{};function pi(n,e,t){let l,i,s,u,r,o,a,c,f,b,h,g,{$$slots:p={},$$scope:d}=e,{inputId:w=""}=e,{name:S="date"}=e,{disabled:N=!1}=e,{placeholder:C=null}=e,{required:M=!1}=e,{value:H=null}=e,{initialDate:k=null}=e,{isRange:v=!1}=e,{startDate:Y=null}=e,{endDate:B=null}=e,{pickerOnly:V=!1}=e,{startView:J=ve}=e,{mode:O="auto"}=e,{disableDatesFn:L=null}=e,{manualInput:Q=!1}=e,{theme:$=ge.theme}=e,{format:G=ge.format}=e,{formatType:U=ge.formatType}=e,{displayFormat:pe=ge.displayFormat}=e,{displayFormatType:F=ge.displayFormatType}=e,{minuteIncrement:A=ge.minuteIncrement}=e,{weekStart:_=ge.weekStart}=e,{inputClasses:j=ge.inputClasses}=e,{todayBtnClasses:oe=ge.todayBtnClasses}=e,{clearBtnClasses:ne=ge.clearBtnClasses}=e,{todayBtn:he=ge.todayBtn}=e,{clearBtn:le=ge.clearBtn}=e,{autocommit:ae=ge.autocommit}=e,{i18n:ie=ge.i18n}=e,{validatorAction:me=null}=e,{ce_valueElement:we=null}=e,{ce_displayElement:q=null}=e;const de=At();let{valueArray:x,prevValue:D,innerDates:W}=ui(H,k,G,ie,U),Z=G,Ie=V,ft=[...x],Ne=et(),xe=ht(),qt,Me=J===Rl?"time":"date",$e=!1,Ft=q,ul=me?me.shift():()=>{},fl=me||[],ct,Et;function cl(m,ue,re,nt,lt){return!m||ue&&(re==="datetime"||lt.length!==2)?!1:nt==="minute"||re===nt}function hl(m){m.join("")!==D.join("")&&(t(29,W=m.filter(ue=>ue).map(ue=>ot(ue,G,ie,U))),D=m,Ne=et(),t(30,xe=ht()))}function dl(m){const ue=Array.isArray(m)?m.join(","):m;Ne!==ue&&(t(64,x=(ue||"").split(",")),ft=x)}function ml(m,ue){Z!==m&&W.length&&(t(64,x=W.map(re=>je(re,m,ie,U))),D=x,t(30,xe=ht()),Z=m,O==="auto"&&t(26,a=m.match(/g|hh?|ii?/i)&&m.match(/y|m|d/i)?"datetime":m.match(/g|hh?|ii?/i)?"time":"date"),Ne=et(),Ee(!0))}function ht(){return W.map(m=>je(m,pe||G,ie,F||U)).sort().join(" - ")}function gl(){return v?x.length===2?x:null:x[0]||null}function et(){return x.join(",")}function Gt(m){return m.join(",")!==ft.join(",")}function Xt(){t(2,J=ve),$e=!1,a==="datetime"?setTimeout(()=>{V||t(34,l=!1),t(25,Me="date")},ae?300:0):V||t(34,l=!1)}function _l(m,ue){m==="date"&&a==="datetime"&&(v&&x.length===2||!v)?t(25,Me="time"):m==="hour"&&o[ue].ref.showMinuteView()}function Ht({type:m,detail:ue}){let{value:re,isKeyboard:nt,dateIndex:lt}=ue;if(re&&!v&&W.length&&W[0].getFullYear()===re.getFullYear()&&W[0].getMonth()===re.getMonth()&&W[0].getDate()===re.getDate()&&a==="date"&&!M&&(re=null),v){if(m==="date")t(29,W=re?(W.length===2?[re]:W.concat(re)).map(it=>it.getTime()).sort().map(it=>new Date(it)):[]);else if(re&<!==void 0)t(29,W[lt]=re,W);else throw new Error("Invalid event type");t(64,x=W.map(it=>je(it,G,ie,U)))}else t(29,W=re?[re]:[]),t(64,x=re?[je(re,G,ie,U)]:[]);nt||(t(65,Et=m),_l(m,lt||0)),zn().then(()=>f&&Ee(!nt))}function Ee(m){t(0,H=gl()),Ne=et(),ft=[...x],t(30,xe=ht()),t(37,g=Gt(x)),wl(!0),de("change",v?x:x[0]||null),m&&Xt()}function bl(){const m=new Date,ue=W[0]||m;Ht(new CustomEvent(a,{detail:{value:new Date(m.getFullYear(),m.getMonth(),m.getDate(),ue.getHours(),ue.getMinutes(),0),isKeyboard:!1}})),Ee(!0)}function dt(){t(64,x=[]),D=[],t(29,W=[]),Ne="",ae&&Ee()}function St(){t(64,x=[...ft]),Ne=et(),Xt()}function Zt(m){if(l||(["Backspace","Delete"].includes(m.key)&&!M&&dt(),m.key==="Enter"&&tt()),!l&&m.key!=="Tab"){t(34,l=m.key!=="Shift"),m.preventDefault();return}switch(m.key){case"PageDown":case"PageUp":case"ArrowDown":case"ArrowUp":case"ArrowLeft":case"ArrowRight":if(m.preventDefault(),v)return;Me==="date"?ct.handleGridNav(m.key,m.shiftKey):o[0].ref.makeTick(["ArrowDown","ArrowLeft","PageDown"].includes(m.key)?-1:1);break;case"Escape":ae?dt():St();break;case"Backspace":if(Q&&!v)return;case"Delete":!M&&dt();break;case"Enter":if(Ie&&m.preventDefault(),x.length===0){t(34,l=!1);return}if(Me==="time"&&!$e)return o[0].ref.showMinuteView();if(a==="datetime"&&Me!=="time"){t(25,Me="time");return}Ee(a==="date"||a.includes("time")&&$e);break;case"Tab":l&&(t(34,l=!1),m.preventDefault());case"F5":break;default:!Q&&m.preventDefault()}}function yl(m){m.preventDefault(),m.stopPropagation();const ue=ot(m.target.value,pe||G,ie,F||U);je(ue,pe||G,ie,F||U)===m.target.value&&Ht(new CustomEvent("date",{detail:{value:ue,isKeyboard:!0}}))}function pl(m){t(2,J=ve),t(25,Me=m.detail),$e=!1}function tt(){t(24,Ie=!0),t(34,l=!0)}function Kt(){t(24,Ie=!1),c?Ee(!1):St(),!q&&de("blur")}function wl(m){we&&q&&(t(56,we.value=x.join(",")||"",we),t(1,q.value=xe,q),we.dispatchEvent(new Event("input")),q.dispatchEvent(new Event("input"))),m&&de("input",Ne)}function kl({detail:m}){t(31,qt=m)}function vl(m){$e=m.detail}Bl(()=>{q&&(t(1,q.onfocus=tt,q),t(1,q.onblur=Kt,q),t(1,q.onclick=()=>!l&&tt(),q),t(1,q.onkeydown=Zt,q))});function Dl(m){Yt.call(this,n,m)}function Ml(m){Yt.call(this,n,m)}function Tl(m){Yt.call(this,n,m)}function Fl(m){_t[m?"unshift":"push"](()=>{Ft=m,t(32,Ft)})}const El=()=>{!l&&tt()};function Hl(m){_t[m?"unshift":"push"](()=>{ct=m,t(33,ct)})}function Sl(m,ue,re){_t[m?"unshift":"push"](()=>{ue[re].ref=m,t(36,o),t(8,v)})}const Yl=()=>Ee(!0),Cl=()=>Ee(!0);return n.$$set=m=>{"inputId"in m&&t(3,w=m.inputId),"name"in m&&t(4,S=m.name),"disabled"in m&&t(5,N=m.disabled),"placeholder"in m&&t(6,C=m.placeholder),"required"in m&&t(7,M=m.required),"value"in m&&t(0,H=m.value),"initialDate"in m&&t(57,k=m.initialDate),"isRange"in m&&t(8,v=m.isRange),"startDate"in m&&t(58,Y=m.startDate),"endDate"in m&&t(59,B=m.endDate),"pickerOnly"in m&&t(9,V=m.pickerOnly),"startView"in m&&t(2,J=m.startView),"mode"in m&&t(60,O=m.mode),"disableDatesFn"in m&&t(10,L=m.disableDatesFn),"manualInput"in m&&t(11,Q=m.manualInput),"theme"in m&&t(12,$=m.theme),"format"in m&&t(13,G=m.format),"formatType"in m&&t(14,U=m.formatType),"displayFormat"in m&&t(61,pe=m.displayFormat),"displayFormatType"in m&&t(62,F=m.displayFormatType),"minuteIncrement"in m&&t(15,A=m.minuteIncrement),"weekStart"in m&&t(16,_=m.weekStart),"inputClasses"in m&&t(17,j=m.inputClasses),"todayBtnClasses"in m&&t(18,oe=m.todayBtnClasses),"clearBtnClasses"in m&&t(19,ne=m.clearBtnClasses),"todayBtn"in m&&t(20,he=m.todayBtn),"clearBtn"in m&&t(21,le=m.clearBtn),"autocommit"in m&&t(22,ae=m.autocommit),"i18n"in m&&t(23,ie=m.i18n),"validatorAction"in m&&t(63,me=m.validatorAction),"ce_valueElement"in m&&t(56,we=m.ce_valueElement),"ce_displayElement"in m&&t(1,q=m.ce_displayElement),"$$scope"in m&&t(66,d=m.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&512&&t(34,l=V),n.$$.dirty[0]&8413184|n.$$.dirty[1]&134217728&&t(28,i=Y?ot(Y,G,ie,U):null),n.$$.dirty[0]&8413184|n.$$.dirty[1]&268435456&&t(27,s=B?new Date(ot(B,G,ie,U).setSeconds(1)):null),n.$$.dirty[0]&402653184&&t(41,u=i&&i>new Date||s&&s({}):Pe),n.$$.dirty[0]&256&&t(36,o=yi(v)),n.$$.dirty[0]&8192|n.$$.dirty[1]&536870912&&t(26,a=fi(O,G)),n.$$.dirty[0]&100663296&&a==="time"&&Me!==a&&t(25,Me=a),n.$$.dirty[0]&71303424&&t(35,c=ae&&(v&&a==="date"||!v)),n.$$.dirty[0]&71303424|n.$$.dirty[2]&12&&(f=cl(ae,v,a,Et,x)),n.$$.dirty[0]&16777218&&q&&t(1,q.readOnly=Ie,q),n.$$.dirty[0]&512&&t(39,b=!!V),n.$$.dirty[0]&512&&t(38,h=V?()=>{}:ai),n.$$.dirty[2]&4&&t(37,g=Gt(x)),n.$$.dirty[0]&1&&dl(H),n.$$.dirty[2]&4&&hl(x),n.$$.dirty[0]&8192|n.$$.dirty[1]&1073741824&&ml(G)},[H,q,J,w,S,N,C,M,v,V,L,Q,$,G,U,A,_,j,oe,ne,he,le,ae,ie,Ie,Me,a,s,i,W,xe,qt,Ft,ct,l,c,o,g,h,b,r,u,ul,fl,Ht,Ee,bl,dt,St,Zt,yl,pl,tt,Kt,kl,vl,we,k,Y,B,O,pe,F,me,x,Et,d,p,Dl,Ml,Tl,Fl,El,Hl,Sl,Yl,Cl]}class Ti extends Rt{constructor(e){super(),It(this,e,pi,bi,Vt,{inputId:3,name:4,disabled:5,placeholder:6,required:7,value:0,initialDate:57,isRange:8,startDate:58,endDate:59,pickerOnly:9,startView:2,mode:60,disableDatesFn:10,manualInput:11,theme:12,format:13,formatType:14,displayFormat:61,displayFormatType:62,minuteIncrement:15,weekStart:16,inputClasses:17,todayBtnClasses:18,clearBtnClasses:19,todayBtn:20,clearBtn:21,autocommit:22,i18n:23,validatorAction:63,ce_valueElement:56,ce_displayElement:1},null,[-1,-1,-1,-1])}}export{Ti as S}; diff --git a/docs/_app/immutable/chunks/basic-setup-BJSL5TOQ.52cb615f.js b/docs/_app/immutable/chunks/basic-setup-BJSL5TOQ.2d40ffcc.js similarity index 99% rename from docs/_app/immutable/chunks/basic-setup-BJSL5TOQ.52cb615f.js rename to docs/_app/immutable/chunks/basic-setup-BJSL5TOQ.2d40ffcc.js index c3d7f36..1596cf5 100644 --- a/docs/_app/immutable/chunks/basic-setup-BJSL5TOQ.52cb615f.js +++ b/docs/_app/immutable/chunks/basic-setup-BJSL5TOQ.2d40ffcc.js @@ -1,2 +1,2 @@ -import{closeBrackets as me,autocompletion as pe,closeBracketsKeymap as ge,completionKeymap as xe}from"./index.6642cdb8.js";import{V as X,B as d,v as S,C as ye,F as Se,G as Me,H as D,S as W,J as Y,K as Z,M as m,E as p,j as ve,O as ee,Q as te,l as re,R as ne,U as be,W as Ce,X as ke,Y as Le,Z as We,_ as Fe,$ as Ae,a0 as Ee,a1 as De,a2 as Re,a3 as qe,a4 as Pe,a5 as we,a6 as Te,a7 as Ie,a8 as Oe,k as $e,a9 as Ke,aa as _e,ab as Be,ac as Qe}from"./4.839c4d69.js";import{c as h,l as ze}from"./index.a4621221.js";const G=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class C{constructor(e,r,n=0,s=e.length,i,a){this.test=a,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,s),this.bufferStart=n,this.normalize=i?l=>i(G(l)):G,this.query=this.normalize(r)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return ye(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let r=Se(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=Me(e);let s=this.normalize(r);for(let i=0,a=n;;i++){let l=s.charCodeAt(i),o=this.match(l,a);if(o)return this.value=o,this;if(i==s.length-1)break;a==n&&ithis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let r=this.matchPos<=this.to&&this.re.exec(this.curLine);if(r){let n=this.curLineStart+r.index,s=n+r[0].length;if(this.matchPos=R(this.text,s+(n==s?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(nthis.value.to)&&(!this.test||this.test(n,s,r)))return this.value={from:n,to:s,match:r},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=n||s.to<=r){let l=new b(r,e.sliceString(r,n));return $.set(e,l),l}if(s.from==r&&s.to==n)return s;let{text:i,from:a}=s;return a>r&&(i=e.sliceString(r,a)+i,a=r),s.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,r=this.re.exec(this.flat.text);if(r&&!r[0]&&r.index==e&&(this.re.lastIndex=e+1,r=this.re.exec(this.flat.text)),r){let n=this.flat.from+r.index,s=n+r[0].length;if((this.flat.to>=this.to||r.index+r[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,s,r)))return this.value={from:n,to:s,match:r},this.matchPos=R(this.text,s+(n==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=b.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(ie.prototype[Symbol.iterator]=le.prototype[Symbol.iterator]=function(){return this});function He(t){try{return new RegExp(t,Q),!0}catch{return!1}}function R(t,e){if(e>=t.length)return e;let r=t.lineAt(e),n;for(;e=56320&&n<57344;)e++;return e}function _(t){let e=h("input",{class:"cm-textfield",name:"line"}),r=h("form",{class:"cm-gotoLine",onkeydown:s=>{s.keyCode==27?(s.preventDefault(),t.dispatch({effects:q.of(!1)}),t.focus()):s.keyCode==13&&(s.preventDefault(),n())},onsubmit:s=>{s.preventDefault(),n()}},h("label",t.state.phrase("Go to line"),": ",e)," ",h("button",{class:"cm-button",type:"submit"},t.state.phrase("go")));function n(){let s=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(e.value);if(!s)return;let{state:i}=t,a=i.doc.lineAt(i.selection.main.head),[,l,o,c,u]=s,g=c?+c.slice(1):0,x=o?+o:a.number;if(o&&u){let O=x/100;l&&(O=O*(l=="-"?-1:1)+a.number/i.doc.lines),x=Math.round(i.doc.lines*O)}else o&&l&&(x=x*(l=="-"?-1:1)+a.number);let V=i.doc.line(Math.max(1,Math.min(i.doc.lines,x)));t.dispatch({effects:q.of(!1),selection:p.cursor(V.from+Math.max(0,Math.min(g,V.length))),scrollIntoView:!0}),t.focus()}return{dom:r}}const q=W.define(),j=ee.define({create(){return!0},update(t,e){for(let r of e.effects)r.is(q)&&(t=r.value);return t},provide:t=>te.from(t,e=>e?_:null)}),Ne=t=>{let e=D(t,_);if(!e){let r=[q.of(!0)];t.state.field(j,!1)==null&&r.push(W.appendConfig.of([j,Ve])),t.dispatch({effects:r}),e=D(t,_)}return e&&e.dom.querySelector("input").focus(),!0},Ve=S.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),Ge={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},ae=Y.define({combine(t){return Z(t,Ge,{highlightWordAroundCursor:(e,r)=>e||r,minSelectionLength:Math.min,maxMatches:Math.min})}});function je(t){let e=[Ze,Ye];return t&&e.push(ae.of(t)),e}const Je=d.mark({class:"cm-selectionMatch"}),Ue=d.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function J(t,e,r,n){return(r==0||t(e.sliceDoc(r-1,r))!=m.Word)&&(n==e.doc.length||t(e.sliceDoc(n,n+1))!=m.Word)}function Xe(t,e,r,n){return t(e.sliceDoc(r,r+1))==m.Word&&t(e.sliceDoc(n-1,n))==m.Word}const Ye=X.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(ae),{state:r}=t,n=r.selection;if(n.ranges.length>1)return d.none;let s=n.main,i,a=null;if(s.empty){if(!e.highlightWordAroundCursor)return d.none;let o=r.wordAt(s.head);if(!o)return d.none;a=r.charCategorizer(s.head),i=r.sliceDoc(o.from,o.to)}else{let o=s.to-s.from;if(o200)return d.none;if(e.wholeWords){if(i=r.sliceDoc(s.from,s.to),a=r.charCategorizer(s.head),!(J(a,r,s.from,s.to)&&Xe(a,r,s.from,s.to)))return d.none}else if(i=r.sliceDoc(s.from,s.to).trim(),!i)return d.none}let l=[];for(let o of t.visibleRanges){let c=new C(r.doc,i,o.from,o.to);for(;!c.next().done;){let{from:u,to:g}=c.value;if((!a||J(a,r,u,g))&&(s.empty&&u<=s.from&&g>=s.to?l.push(Ue.range(u,g)):(u>=s.to||g<=s.from)&&l.push(Je.range(u,g)),l.length>e.maxMatches))return d.none}}return d.set(l)}},{decorations:t=>t.decorations}),Ze=S.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),et=({state:t,dispatch:e})=>{let{selection:r}=t,n=p.create(r.ranges.map(s=>t.wordAt(s.head)||p.cursor(s.head)),r.mainIndex);return n.eq(r)?!1:(e(t.update({selection:n})),!0)};function tt(t,e){let{main:r,ranges:n}=t.selection,s=t.wordAt(r.head),i=s&&s.from==r.from&&s.to==r.to;for(let a=!1,l=new C(t.doc,e,n[n.length-1].to);;)if(l.next(),l.done){if(a)return null;l=new C(t.doc,e,0,Math.max(0,n[n.length-1].from-1)),a=!0}else{if(a&&n.some(o=>o.from==l.value.from))continue;if(i){let o=t.wordAt(l.value.from);if(!o||o.from!=l.value.from||o.to!=l.value.to)continue}return l.value}}const rt=({state:t,dispatch:e})=>{let{ranges:r}=t.selection;if(r.some(i=>i.from===i.to))return et({state:t,dispatch:e});let n=t.sliceDoc(r[0].from,r[0].to);if(t.selection.ranges.some(i=>t.sliceDoc(i.from,i.to)!=n))return!1;let s=tt(t,n);return s?(e(t.update({selection:t.selection.addRange(p.range(s.from,s.to),!1),effects:S.scrollIntoView(s.to)})),!0):!1},k=Y.define({combine(t){return Z(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new mt(e),scrollToMatch:e=>S.scrollIntoView(e)})}});class oe{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||He(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(r,n)=>n=="n"?` +import{closeBrackets as me,autocompletion as pe,closeBracketsKeymap as ge,completionKeymap as xe}from"./index.6b0eed4b.js";import{V as X,B as d,v as S,C as ye,F as Se,G as Me,H as D,S as W,J as Y,K as Z,M as m,E as p,j as ve,O as ee,Q as te,l as re,R as ne,U as be,W as Ce,X as ke,Y as Le,Z as We,_ as Fe,$ as Ae,a0 as Ee,a1 as De,a2 as Re,a3 as qe,a4 as Pe,a5 as we,a6 as Te,a7 as Ie,a8 as Oe,k as $e,a9 as Ke,aa as _e,ab as Be,ac as Qe}from"./4.3441f93b.js";import{c as h,l as ze}from"./index.69bb2f53.js";const G=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class C{constructor(e,r,n=0,s=e.length,i,a){this.test=a,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,s),this.bufferStart=n,this.normalize=i?l=>i(G(l)):G,this.query=this.normalize(r)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return ye(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let r=Se(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=Me(e);let s=this.normalize(r);for(let i=0,a=n;;i++){let l=s.charCodeAt(i),o=this.match(l,a);if(o)return this.value=o,this;if(i==s.length-1)break;a==n&&ithis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let r=this.matchPos<=this.to&&this.re.exec(this.curLine);if(r){let n=this.curLineStart+r.index,s=n+r[0].length;if(this.matchPos=R(this.text,s+(n==s?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(nthis.value.to)&&(!this.test||this.test(n,s,r)))return this.value={from:n,to:s,match:r},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=n||s.to<=r){let l=new b(r,e.sliceString(r,n));return $.set(e,l),l}if(s.from==r&&s.to==n)return s;let{text:i,from:a}=s;return a>r&&(i=e.sliceString(r,a)+i,a=r),s.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,r=this.re.exec(this.flat.text);if(r&&!r[0]&&r.index==e&&(this.re.lastIndex=e+1,r=this.re.exec(this.flat.text)),r){let n=this.flat.from+r.index,s=n+r[0].length;if((this.flat.to>=this.to||r.index+r[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,s,r)))return this.value={from:n,to:s,match:r},this.matchPos=R(this.text,s+(n==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=b.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(ie.prototype[Symbol.iterator]=le.prototype[Symbol.iterator]=function(){return this});function He(t){try{return new RegExp(t,Q),!0}catch{return!1}}function R(t,e){if(e>=t.length)return e;let r=t.lineAt(e),n;for(;e=56320&&n<57344;)e++;return e}function _(t){let e=h("input",{class:"cm-textfield",name:"line"}),r=h("form",{class:"cm-gotoLine",onkeydown:s=>{s.keyCode==27?(s.preventDefault(),t.dispatch({effects:q.of(!1)}),t.focus()):s.keyCode==13&&(s.preventDefault(),n())},onsubmit:s=>{s.preventDefault(),n()}},h("label",t.state.phrase("Go to line"),": ",e)," ",h("button",{class:"cm-button",type:"submit"},t.state.phrase("go")));function n(){let s=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(e.value);if(!s)return;let{state:i}=t,a=i.doc.lineAt(i.selection.main.head),[,l,o,c,u]=s,g=c?+c.slice(1):0,x=o?+o:a.number;if(o&&u){let O=x/100;l&&(O=O*(l=="-"?-1:1)+a.number/i.doc.lines),x=Math.round(i.doc.lines*O)}else o&&l&&(x=x*(l=="-"?-1:1)+a.number);let V=i.doc.line(Math.max(1,Math.min(i.doc.lines,x)));t.dispatch({effects:q.of(!1),selection:p.cursor(V.from+Math.max(0,Math.min(g,V.length))),scrollIntoView:!0}),t.focus()}return{dom:r}}const q=W.define(),j=ee.define({create(){return!0},update(t,e){for(let r of e.effects)r.is(q)&&(t=r.value);return t},provide:t=>te.from(t,e=>e?_:null)}),Ne=t=>{let e=D(t,_);if(!e){let r=[q.of(!0)];t.state.field(j,!1)==null&&r.push(W.appendConfig.of([j,Ve])),t.dispatch({effects:r}),e=D(t,_)}return e&&e.dom.querySelector("input").focus(),!0},Ve=S.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),Ge={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},ae=Y.define({combine(t){return Z(t,Ge,{highlightWordAroundCursor:(e,r)=>e||r,minSelectionLength:Math.min,maxMatches:Math.min})}});function je(t){let e=[Ze,Ye];return t&&e.push(ae.of(t)),e}const Je=d.mark({class:"cm-selectionMatch"}),Ue=d.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function J(t,e,r,n){return(r==0||t(e.sliceDoc(r-1,r))!=m.Word)&&(n==e.doc.length||t(e.sliceDoc(n,n+1))!=m.Word)}function Xe(t,e,r,n){return t(e.sliceDoc(r,r+1))==m.Word&&t(e.sliceDoc(n-1,n))==m.Word}const Ye=X.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(ae),{state:r}=t,n=r.selection;if(n.ranges.length>1)return d.none;let s=n.main,i,a=null;if(s.empty){if(!e.highlightWordAroundCursor)return d.none;let o=r.wordAt(s.head);if(!o)return d.none;a=r.charCategorizer(s.head),i=r.sliceDoc(o.from,o.to)}else{let o=s.to-s.from;if(o200)return d.none;if(e.wholeWords){if(i=r.sliceDoc(s.from,s.to),a=r.charCategorizer(s.head),!(J(a,r,s.from,s.to)&&Xe(a,r,s.from,s.to)))return d.none}else if(i=r.sliceDoc(s.from,s.to).trim(),!i)return d.none}let l=[];for(let o of t.visibleRanges){let c=new C(r.doc,i,o.from,o.to);for(;!c.next().done;){let{from:u,to:g}=c.value;if((!a||J(a,r,u,g))&&(s.empty&&u<=s.from&&g>=s.to?l.push(Ue.range(u,g)):(u>=s.to||g<=s.from)&&l.push(Je.range(u,g)),l.length>e.maxMatches))return d.none}}return d.set(l)}},{decorations:t=>t.decorations}),Ze=S.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),et=({state:t,dispatch:e})=>{let{selection:r}=t,n=p.create(r.ranges.map(s=>t.wordAt(s.head)||p.cursor(s.head)),r.mainIndex);return n.eq(r)?!1:(e(t.update({selection:n})),!0)};function tt(t,e){let{main:r,ranges:n}=t.selection,s=t.wordAt(r.head),i=s&&s.from==r.from&&s.to==r.to;for(let a=!1,l=new C(t.doc,e,n[n.length-1].to);;)if(l.next(),l.done){if(a)return null;l=new C(t.doc,e,0,Math.max(0,n[n.length-1].from-1)),a=!0}else{if(a&&n.some(o=>o.from==l.value.from))continue;if(i){let o=t.wordAt(l.value.from);if(!o||o.from!=l.value.from||o.to!=l.value.to)continue}return l.value}}const rt=({state:t,dispatch:e})=>{let{ranges:r}=t.selection;if(r.some(i=>i.from===i.to))return et({state:t,dispatch:e});let n=t.sliceDoc(r[0].from,r[0].to);if(t.selection.ranges.some(i=>t.sliceDoc(i.from,i.to)!=n))return!1;let s=tt(t,n);return s?(e(t.update({selection:t.selection.addRange(p.range(s.from,s.to),!1),effects:S.scrollIntoView(s.to)})),!0):!1},k=Y.define({combine(t){return Z(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new mt(e),scrollToMatch:e=>S.scrollIntoView(e)})}});class oe{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||He(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(r,n)=>n=="n"?` `:n=="r"?"\r":n=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new lt(this):new st(this)}getCursor(e,r=0,n){let s=e.doc?e:re.create({doc:e});return n==null&&(n=s.doc.length),this.regexp?v(this,s,r,n):M(this,s,r,n)}}class ce{constructor(e){this.spec=e}}function M(t,e,r,n){return new C(e.doc,t.unquoted,r,n,t.caseSensitive?void 0:s=>s.toLowerCase(),t.wholeWord?nt(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function nt(t,e){return(r,n,s,i)=>((i>r||i+s.length=r)return null;s.push(n.value)}return s}highlight(e,r,n,s){let i=M(this.spec,e,Math.max(0,r-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)s(i.value.from,i.value.to)}}function v(t,e,r,n){return new ie(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?it(e.charCategorizer(e.selection.main.head)):void 0},r,n)}function P(t,e){return t.slice(ne(t,e,!1),e)}function w(t,e){return t.slice(e,ne(t,e))}function it(t){return(e,r,n)=>!n[0].length||(t(P(n.input,n.index))!=m.Word||t(w(n.input,n.index))!=m.Word)&&(t(w(n.input,n.index+n[0].length))!=m.Word||t(P(n.input,n.index+n[0].length))!=m.Word)}class lt extends ce{nextMatch(e,r,n){let s=v(this.spec,e,n,e.doc.length).next();return s.done&&(s=v(this.spec,e,0,r).next()),s.done?null:s.value}prevMatchInRange(e,r,n){for(let s=1;;s++){let i=Math.max(r,n-s*1e4),a=v(this.spec,e,i,n),l=null;for(;!a.next().done;)l=a.value;if(l&&(i==r||l.from>i+10))return l;if(i==r)return null}}prevMatch(e,r,n){return this.prevMatchInRange(e,0,r)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace.replace(/\$([$&\d+])/g,(r,n)=>n=="$"?"$":n=="&"?e.match[0]:n!="0"&&+n=r)return null;s.push(n.value)}return s}highlight(e,r,n,s){let i=v(this.spec,e,Math.max(0,r-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)s(i.value.from,i.value.to)}}const L=W.define(),z=W.define(),y=ee.define({create(t){return new K(B(t).create(),null)},update(t,e){for(let r of e.effects)r.is(L)?t=new K(r.value.create(),t.panel):r.is(z)&&(t=new K(t.query,r.value?H:null));return t},provide:t=>te.from(t,e=>e.panel)});class K{constructor(e,r){this.query=e,this.panel=r}}const at=d.mark({class:"cm-searchMatch"}),ot=d.mark({class:"cm-searchMatch cm-searchMatch-selected"}),ct=X.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(y))}update(t){let e=t.state.field(y);(e!=t.startState.field(y)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return d.none;let{view:r}=this,n=new be;for(let s=0,i=r.visibleRanges,a=i.length;si[s+1].from-2*250;)o=i[++s].to;t.highlight(r.state,l,o,(c,u)=>{let g=r.state.selection.ranges.some(x=>x.from==c&&x.to==u);n.add(c,u,g?ot:at)})}return n.finish()}},{decorations:t=>t.decorations});function F(t){return e=>{let r=e.state.field(y,!1);return r&&r.query.spec.valid?t(e,r):fe(e)}}const T=F((t,{query:e})=>{let{to:r}=t.state.selection.main,n=e.nextMatch(t.state,r,r);if(!n)return!1;let s=p.single(n.from,n.to),i=t.state.facet(k);return t.dispatch({selection:s,effects:[N(t,n),i.scrollToMatch(s.main,t)],userEvent:"select.search"}),ue(t),!0}),I=F((t,{query:e})=>{let{state:r}=t,{from:n}=r.selection.main,s=e.prevMatch(r,n,n);if(!s)return!1;let i=p.single(s.from,s.to),a=t.state.facet(k);return t.dispatch({selection:i,effects:[N(t,s),a.scrollToMatch(i.main,t)],userEvent:"select.search"}),ue(t),!0}),ht=F((t,{query:e})=>{let r=e.matchAll(t.state,1e3);return!r||!r.length?!1:(t.dispatch({selection:p.create(r.map(n=>p.range(n.from,n.to))),userEvent:"select.search.matches"}),!0)}),ut=({state:t,dispatch:e})=>{let r=t.selection;if(r.ranges.length>1||r.main.empty)return!1;let{from:n,to:s}=r.main,i=[],a=0;for(let l=new C(t.doc,t.sliceDoc(n,s));!l.next().done;){if(i.length>1e3)return!1;l.value.from==n&&(a=i.length),i.push(p.range(l.value.from,l.value.to))}return e(t.update({selection:p.create(i,a),userEvent:"select.search.matches"})),!0},U=F((t,{query:e})=>{let{state:r}=t,{from:n,to:s}=r.selection.main;if(r.readOnly)return!1;let i=e.nextMatch(r,n,n);if(!i)return!1;let a=[],l,o,c=[];if(i.from==n&&i.to==s&&(o=r.toText(e.getReplacement(i)),a.push({from:i.from,to:i.to,insert:o}),i=e.nextMatch(r,i.from,i.to),c.push(S.announce.of(r.phrase("replaced match on line $",r.doc.lineAt(n).number)+"."))),i){let u=a.length==0||a[0].from>=i.to?0:i.to-i.from-o.length;l=p.single(i.from-u,i.to-u),c.push(N(t,i)),c.push(r.facet(k).scrollToMatch(l.main,t))}return t.dispatch({changes:a,selection:l,effects:c,userEvent:"input.replace"}),!0}),ft=F((t,{query:e})=>{if(t.state.readOnly)return!1;let r=e.matchAll(t.state,1e9).map(s=>{let{from:i,to:a}=s;return{from:i,to:a,insert:e.getReplacement(s)}});if(!r.length)return!1;let n=t.state.phrase("replaced $ matches",r.length)+".";return t.dispatch({changes:r,effects:S.announce.of(n),userEvent:"input.replace.all"}),!0});function H(t){return t.state.facet(k).createPanel(t)}function B(t,e){var r,n,s,i,a;let l=t.selection.main,o=l.empty||l.to>l.from+100?"":t.sliceDoc(l.from,l.to);if(e&&!o)return e;let c=t.facet(k);return new oe({search:((r=e==null?void 0:e.literal)!==null&&r!==void 0?r:c.literal)?o:o.replace(/\n/g,"\\n"),caseSensitive:(n=e==null?void 0:e.caseSensitive)!==null&&n!==void 0?n:c.caseSensitive,literal:(s=e==null?void 0:e.literal)!==null&&s!==void 0?s:c.literal,regexp:(i=e==null?void 0:e.regexp)!==null&&i!==void 0?i:c.regexp,wholeWord:(a=e==null?void 0:e.wholeWord)!==null&&a!==void 0?a:c.wholeWord})}function he(t){let e=D(t,H);return e&&e.dom.querySelector("[main-field]")}function ue(t){let e=he(t);e&&e==t.root.activeElement&&e.select()}const fe=t=>{let e=t.state.field(y,!1);if(e&&e.panel){let r=he(t);if(r&&r!=t.root.activeElement){let n=B(t.state,e.query.spec);n.valid&&t.dispatch({effects:L.of(n)}),r.focus(),r.select()}}else t.dispatch({effects:[z.of(!0),e?L.of(B(t.state,e.query.spec)):W.appendConfig.of(gt)]});return!0},de=t=>{let e=t.state.field(y,!1);if(!e||!e.panel)return!1;let r=D(t,H);return r&&r.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:z.of(!1)}),!0},dt=[{key:"Mod-f",run:fe,scope:"editor search-panel"},{key:"F3",run:T,shift:I,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:T,shift:I,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:de,scope:"editor search-panel"},{key:"Mod-Shift-l",run:ut},{key:"Alt-g",run:Ne},{key:"Mod-d",run:rt,preventDefault:!0}];class mt{constructor(e){this.view=e;let r=this.query=e.state.field(y).query.spec;this.commit=this.commit.bind(this),this.searchField=h("input",{value:r.search,placeholder:f(e,"Find"),"aria-label":f(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=h("input",{value:r.replace,placeholder:f(e,"Replace"),"aria-label":f(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=h("input",{type:"checkbox",name:"case",form:"",checked:r.caseSensitive,onchange:this.commit}),this.reField=h("input",{type:"checkbox",name:"re",form:"",checked:r.regexp,onchange:this.commit}),this.wordField=h("input",{type:"checkbox",name:"word",form:"",checked:r.wholeWord,onchange:this.commit});function n(s,i,a){return h("button",{class:"cm-button",name:s,onclick:i,type:"button"},a)}this.dom=h("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,n("next",()=>T(e),[f(e,"next")]),n("prev",()=>I(e),[f(e,"previous")]),n("select",()=>ht(e),[f(e,"all")]),h("label",null,[this.caseField,f(e,"match case")]),h("label",null,[this.reField,f(e,"regexp")]),h("label",null,[this.wordField,f(e,"by word")]),...e.state.readOnly?[]:[h("br"),this.replaceField,n("replace",()=>U(e),[f(e,"replace")]),n("replaceAll",()=>ft(e),[f(e,"replace all")])],h("button",{name:"close",onclick:()=>de(e),"aria-label":f(e,"close"),type:"button"},["×"])])}commit(){let e=new oe({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:L.of(e)}))}keydown(e){Ce(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?I:T)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),U(this.view))}update(e){for(let r of e.transactions)for(let n of r.effects)n.is(L)&&!n.value.eq(this.query)&&this.setQuery(n.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(k).top}}function f(t,e){return t.state.phrase(e)}const A=30,E=/[\s\.,:;?!]/;function N(t,{from:e,to:r}){let n=t.state.doc.lineAt(e),s=t.state.doc.lineAt(r).to,i=Math.max(n.from,e-A),a=Math.min(s,r+A),l=t.state.sliceDoc(i,a);if(i!=n.from){for(let o=0;ol.length-A;o--)if(!E.test(l[o-1])&&E.test(l[o])){l=l.slice(0,o);break}}return S.announce.of(`${t.state.phrase("current match")}. ${l} ${t.state.phrase("on line")} ${n.number}.`)}const pt=S.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),gt=[y,ve.lowest(ct),pt];var Mt=t=>[ke(),Le(),We(),Fe(),Ae(),Ee(),De(),Re(),qe(Pe,{fallback:!0}),we(),me(),re.allowMultipleSelections.of(!0),t.autocomplete!==!1?pe():[],Te(),Ie(),Oe(),je(),$e.of([].concat(ge,Ke,dt,_e,Be,xe,ze,t.useTabs?[Qe]:[]))];export{Mt as default}; diff --git a/docs/_app/immutable/chunks/data.1e149bb0.js b/docs/_app/immutable/chunks/data.545e9fea.js similarity index 99% rename from docs/_app/immutable/chunks/data.1e149bb0.js rename to docs/_app/immutable/chunks/data.545e9fea.js index b5af4c2..fcf3fce 100644 --- a/docs/_app/immutable/chunks/data.1e149bb0.js +++ b/docs/_app/immutable/chunks/data.545e9fea.js @@ -287,13 +287,14 @@ Restricted selection list:
<\/script> The picker's mode responds to website light/dark mode setting. - + `}]},{title:"Localization",slug:"localization",files:[{name:"App.svelte",type:"svelte",content:`